:root {
  color-scheme: dark;
  --ink: #f4f6f5;
  --muted: #b6c3c6;
  --quiet: #81959b;
  --gold: #e7bf73;
  --gold-soft: rgba(231, 191, 115, 0.16);
  --line: rgba(205, 224, 226, 0.16);
  --panel: rgba(7, 22, 33, 0.78);
  --panel-deep: rgba(5, 17, 26, 0.92);
  --field: rgba(3, 14, 22, 0.58);
  --focus: #f0c977;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 28px 80px rgba(0, 7, 12, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #071723;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(110deg, rgba(4, 15, 24, 0.97) 0%, rgba(5, 21, 31, 0.82) 47%, rgba(8, 25, 35, 0.58) 100%),
    linear-gradient(180deg, rgba(5, 17, 25, 0.18) 0%, rgba(5, 17, 25, 0.82) 100%),
    url("./assets/kompass-seascape.png") center / cover fixed no-repeat,
    #071723;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(240, 201, 119, 0.55);
  outline-offset: 3px;
}

.sea-light {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 76% 9%, rgba(229, 189, 112, 0.12), transparent 26rem),
    radial-gradient(circle at 34% 82%, rgba(52, 129, 143, 0.15), transparent 31rem);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px clamp(18px, 3vw, 48px) 38px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-logo {
  display: block;
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.25));
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(231, 191, 115, 0.48);
  border-radius: 50%;
  background: rgba(5, 19, 28, 0.58);
  box-shadow: inset 0 0 0 5px rgba(231, 191, 115, 0.04);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span::before,
.brand-mark span::after {
  position: absolute;
  width: 1px;
  height: 34px;
  content: "";
  background: linear-gradient(var(--gold), transparent 42%, transparent 58%, var(--gold));
}

.brand-mark::after {
  transform: rotate(90deg);
}

.brand-mark span::before {
  transform: rotate(45deg);
  opacity: 0.48;
}

.brand-mark span::after {
  transform: rotate(-45deg);
  opacity: 0.48;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}

h2 {
  margin-bottom: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.6vw, 3.55rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #76b9b0;
  box-shadow: 0 0 0 4px rgba(118, 185, 176, 0.12);
}

.story-panel,
.origin-intro {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(118%);
  -webkit-backdrop-filter: blur(20px) saturate(118%);
}

.story-panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.story-panel > summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 70px;
  padding: 12px 21px;
  list-style: none;
  cursor: pointer;
}

.story-panel > summary::-webkit-details-marker {
  display: none;
}

.story-panel > summary:hover {
  background: rgba(255, 255, 255, 0.035);
}

.story-summary-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(231, 191, 115, 0.34);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  transition: transform 180ms ease;
}

.story-panel[open] .story-summary-icon {
  transform: rotate(180deg);
}

.story-panel summary strong,
.story-panel summary small {
  display: block;
}

.story-panel summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.03rem;
  font-weight: 500;
}

.story-panel summary small,
.story-summary-action {
  color: var(--quiet);
  font-size: 0.78rem;
}

.story-summary-action {
  color: var(--gold);
}

.story-content {
  max-height: min(72vh, 900px);
  overflow-y: auto;
  padding: clamp(26px, 4.6vw, 64px);
  border-top: 1px solid var(--line);
  background:
    radial-gradient(circle at 85% 8%, rgba(231, 191, 115, 0.1), transparent 26rem),
    rgba(3, 15, 23, 0.48);
  scrollbar-color: rgba(231, 191, 115, 0.38) transparent;
}

.story-heading,
.story-prose {
  width: min(780px, 100%);
  margin-inline: auto;
}

.story-heading {
  margin-bottom: 30px;
}

.story-heading h2 {
  max-width: 13ch;
  font-size: clamp(2.15rem, 5vw, 3.8rem);
}

.story-prose p {
  margin-bottom: 0.92rem;
  color: #c6d1d2;
  font-size: 1rem;
  line-height: 1.78;
}

.story-prose .story-emphasis {
  margin-block: 1.5rem;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.8vw, 1.72rem);
  line-height: 1.55;
}

.story-levels {
  display: grid;
  gap: 8px;
  margin: 1.6rem 0;
  padding: 20px 22px;
  border: 1px solid rgba(231, 191, 115, 0.23);
  border-radius: var(--radius-md);
  background: rgba(231, 191, 115, 0.06);
}

.story-levels p {
  margin: 0;
}

.story-levels strong {
  color: var(--gold);
}

.origin-intro {
  margin-bottom: 22px;
  padding: clamp(25px, 3.8vw, 46px);
}

.intro-lead {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(300px, 1.18fr);
  column-gap: clamp(28px, 5vw, 72px);
  align-items: end;
  margin-bottom: 28px;
}

.intro-lead .eyebrow {
  grid-column: 1 / -1;
}

.intro-lead h2 {
  max-width: 13ch;
  margin-bottom: 0;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  line-height: 1.08;
}

.intro-lead > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.intro-grid article {
  min-height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(3, 16, 24, 0.42);
}

.intro-number {
  display: block;
  margin-bottom: 15px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
}

.intro-grid h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
  line-height: 1.4;
}

.intro-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 2fr);
  gap: clamp(18px, 2vw, 28px);
  min-height: calc(100vh - 138px);
}

.course-panel,
.main-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(118%);
  -webkit-backdrop-filter: blur(20px) saturate(118%);
}

.course-panel {
  align-self: start;
  padding: 26px 18px 18px;
}

.course-heading {
  padding: 0 8px 14px;
}

.course-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-track {
  height: 3px;
  margin: 0 8px 20px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fbdbd, var(--gold));
  transition: width 280ms ease;
}

.step-nav {
  position: relative;
  display: grid;
  gap: 4px;
}

.step-nav::before {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 25px;
  width: 1px;
  content: "";
  background: var(--line);
}

.step-button {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 54px;
  padding: 7px 9px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.step-button:hover {
  background: rgba(255, 255, 255, 0.045);
}

.step-button.is-active {
  background: linear-gradient(90deg, rgba(231, 191, 115, 0.16), rgba(231, 191, 115, 0.035));
}

.step-number {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(184, 206, 209, 0.25);
  border-radius: 50%;
  background: #0a202c;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.step-button.is-active .step-number {
  border-color: rgba(231, 191, 115, 0.72);
  color: var(--gold);
  box-shadow: 0 0 0 5px rgba(231, 191, 115, 0.06);
}

.step-button.is-complete .step-number {
  border-color: rgba(126, 191, 183, 0.62);
  background: #173b42;
  color: #e8ffff;
}

.step-copy strong,
.step-copy small {
  display: block;
}

.step-copy strong {
  font-size: 0.88rem;
  letter-spacing: 0.035em;
}

.step-copy small {
  margin-top: 1px;
  color: var(--quiet);
  font-size: 0.75rem;
}

.summary-nav {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-top: 16px;
  padding: 13px 9px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  cursor: pointer;
}

.summary-nav:hover,
.summary-nav.is-active {
  border-color: rgba(231, 191, 115, 0.42);
  background: var(--gold-soft);
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--gold);
  font-size: 1.1rem;
}

.summary-nav strong,
.summary-nav small {
  display: block;
}

.summary-nav strong {
  font-size: 0.86rem;
}

.summary-nav small {
  color: var(--quiet);
  font-size: 0.74rem;
}

.main-panel {
  min-width: 0;
  padding: clamp(26px, 4.8vw, 70px);
}

.reflection-view,
.summary-view {
  width: min(840px, 100%);
  margin: 0 auto;
}

.level-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(26px, 4vw, 44px);
}

.level-meaning {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.metaphor-badge {
  flex: 0 0 auto;
  margin-top: 4px;
  padding: 9px 13px;
  border: 1px solid rgba(231, 191, 115, 0.32);
  border-radius: 999px;
  background: rgba(231, 191, 115, 0.08);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  white-space: nowrap;
}

.question-card {
  position: relative;
  margin-bottom: 28px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
  border: 1px solid rgba(231, 191, 115, 0.25);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 96% 2%, rgba(231, 191, 115, 0.13), transparent 15rem),
    rgba(3, 16, 24, 0.47);
}

.question-card::after {
  position: absolute;
  right: -42px;
  bottom: -42px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(231, 191, 115, 0.09);
  border-radius: 50%;
  content: "";
  box-shadow: inset 0 0 0 18px rgba(231, 191, 115, 0.025), inset 0 0 0 36px rgba(231, 191, 115, 0.025);
}

.question-label {
  margin-bottom: 9px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

blockquote {
  position: relative;
  z-index: 1;
  margin: 0 0 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.34;
}

.step-intro {
  position: relative;
  z-index: 1;
  max-width: 67ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.notes-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 2px 9px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.character-count {
  color: var(--quiet);
  font-size: 0.74rem;
  font-weight: 500;
}

textarea {
  display: block;
  width: 100%;
  min-height: 184px;
  resize: vertical;
  padding: 18px 20px;
  border: 1px solid rgba(190, 214, 216, 0.21);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  font-size: 1rem;
  line-height: 1.65;
  transition: border-color 180ms ease, background 180ms ease;
}

textarea:hover,
textarea:focus {
  border-color: rgba(231, 191, 115, 0.4);
  background: rgba(3, 14, 22, 0.74);
}

textarea::placeholder {
  color: #71858b;
}

.thought-anchors {
  margin-top: 14px;
  padding: 0 2px;
  color: var(--muted);
}

.thought-anchors summary {
  width: fit-content;
  color: #c6d1d2;
  font-size: 0.86rem;
  cursor: pointer;
}

.thought-anchors ul {
  display: grid;
  gap: 5px;
  margin: 12px 0 0;
  padding-left: 21px;
  font-size: 0.88rem;
}

.navigation-actions,
.summary-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 19px;
  border-radius: 13px;
  font-size: 0.9rem;
  font-weight: 720;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  transform: none;
}

.button-quiet {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.button-primary {
  border: 1px solid rgba(240, 207, 140, 0.5);
  color: #152029;
  background: linear-gradient(135deg, #f1d69b, #dba956);
  box-shadow: 0 10px 26px rgba(165, 115, 37, 0.15);
}

.summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.summary-heading h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.summary-heading p:last-child {
  max-width: 64ch;
  margin-bottom: 0;
  color: var(--muted);
}

.completion-ring {
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: 84px;
  height: 84px;
  padding-top: 19px;
  flex: 0 0 auto;
  border: 1px solid rgba(231, 191, 115, 0.48);
  border-radius: 50%;
  color: var(--gold);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 7px rgba(231, 191, 115, 0.035);
}

.completion-ring strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.9rem;
  font-weight: 500;
}

.completion-ring span {
  color: var(--muted);
  font-size: 0.78rem;
}

.course-narrative {
  margin-bottom: 18px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(231, 191, 115, 0.27);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(231, 191, 115, 0.11), rgba(10, 39, 48, 0.2));
}

.course-narrative p:last-child {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.26rem);
  line-height: 1.7;
}

.summary-cards {
  display: grid;
  gap: 10px;
}

.summary-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: start;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(4, 17, 25, 0.46);
}

.summary-card-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(231, 191, 115, 0.34);
  border-radius: 50%;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 750;
}

.summary-card h3 {
  margin: 0 0 5px;
  font-size: 0.9rem;
  letter-spacing: 0.025em;
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.summary-card .empty-answer {
  color: var(--quiet);
  font-style: italic;
}

.vision-section {
  margin-top: 38px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.vision-heading {
  margin-bottom: 18px;
}

.vision-heading h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.vision-heading p:last-child {
  max-width: 64ch;
  margin-bottom: 0;
  color: var(--muted);
}

.written-vision {
  margin-bottom: 16px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid rgba(231, 191, 115, 0.28);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 96% 5%, rgba(231, 191, 115, 0.11), transparent 16rem),
    rgba(3, 16, 24, 0.5);
}

.vision-statement {
  margin-bottom: 18px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2.2vw, 1.35rem);
  line-height: 1.72;
}

.inline-action {
  padding: 5px 2px;
  border: 0;
  border-bottom: 1px solid rgba(231, 191, 115, 0.32);
  color: var(--gold);
  background: transparent;
  font-size: 0.8rem;
  cursor: pointer;
}

.inline-action:hover {
  border-bottom-color: currentColor;
}

.vision-figure {
  margin: 0;
}

.vision-canvas-wrap {
  overflow-x: auto;
  border: 1px solid rgba(231, 191, 115, 0.24);
  border-radius: var(--radius-md);
  background: #071723;
  box-shadow: 0 18px 44px rgba(0, 5, 10, 0.28);
  scrollbar-color: rgba(231, 191, 115, 0.4) transparent;
}

.vision-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.vision-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 3px 0;
  color: var(--quiet);
  font-size: 0.76rem;
}

.edit-step {
  padding: 5px 3px;
  border: 0;
  color: var(--gold);
  background: transparent;
  font-size: 0.76rem;
  cursor: pointer;
}

.reset-button {
  display: block;
  margin: 24px auto 0;
  padding: 6px 2px;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--quiet);
  background: transparent;
  font-size: 0.78rem;
  cursor: pointer;
}

.reset-button:hover {
  border-bottom-color: currentColor;
  color: #d7b4ab;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 44px));
  padding: 11px 15px;
  border: 1px solid rgba(231, 191, 115, 0.32);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(5, 18, 27, 0.96);
  box-shadow: var(--shadow);
  font-size: 0.86rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }

  .shell {
    padding: 16px 16px 28px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .intro-lead {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .course-panel {
    padding: 17px 14px 13px;
  }

  .course-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
  }

  .course-heading .eyebrow {
    margin: 0;
  }

  .progress-track {
    margin-bottom: 12px;
  }

  .step-nav {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 2px 7px;
    scrollbar-width: thin;
  }

  .step-nav::before {
    display: none;
  }

  .step-button {
    display: block;
    min-width: 98px;
    min-height: 72px;
    padding: 8px;
    text-align: center;
  }

  .step-number {
    width: 28px;
    height: 28px;
    margin: 0 auto 5px;
  }

  .step-copy strong {
    font-size: 0.76rem;
  }

  .step-copy small {
    font-size: 0.68rem;
  }

  .summary-nav {
    grid-template-columns: 30px 1fr;
    margin-top: 7px;
    padding: 9px 10px;
  }

  .summary-icon {
    width: 28px;
    height: 28px;
  }

  .main-panel {
    min-height: 650px;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    margin-bottom: 14px;
  }

  .brand-logo {
    width: 52px;
    height: 52px;
  }

  .brand .eyebrow {
    font-size: 0.62rem;
  }

  h1 {
    font-size: 1.06rem;
  }

  .save-state {
    max-width: 92px;
    justify-content: flex-end;
    text-align: right;
    font-size: 0.68rem;
    line-height: 1.3;
  }

  .story-panel > summary {
    grid-template-columns: 38px minmax(0, 1fr);
    padding-inline: 14px;
  }

  .story-summary-action {
    display: none;
  }

  .story-content {
    max-height: 76vh;
    padding: 27px 20px 34px;
  }

  .story-prose p {
    font-size: 0.96rem;
  }

  .origin-intro {
    padding: 25px 20px;
  }

  .intro-grid article {
    padding: 18px;
  }

  .course-heading p:last-child {
    font-size: 0.76rem;
  }

  .main-panel {
    padding: 25px 20px;
    border-radius: 23px;
  }

  .level-header {
    display: block;
    margin-bottom: 23px;
  }

  .metaphor-badge {
    display: inline-block;
    margin-top: 14px;
  }

  .question-card {
    padding: 21px 19px;
  }

  blockquote {
    font-size: 1.38rem;
  }

  textarea {
    min-height: 210px;
    padding: 16px;
  }

  .navigation-actions,
  .summary-actions {
    align-items: stretch;
  }

  .summary-actions {
    flex-direction: column-reverse;
  }

  .summary-heading {
    align-items: flex-start;
  }

  .completion-ring {
    width: 66px;
    height: 66px;
    padding-top: 13px;
  }

  .completion-ring strong {
    font-size: 1.55rem;
  }

  .summary-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 11px;
    padding: 15px;
  }

  .summary-card-number {
    width: 34px;
    height: 34px;
  }

  .edit-step {
    grid-column: 2;
    justify-self: start;
  }

  .vision-canvas-wrap canvas {
    width: 720px;
    max-width: none;
  }

  .vision-figure figcaption {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.coaching-contact {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
  margin-top: 18px;
  padding: clamp(26px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(118%);
  -webkit-backdrop-filter: blur(20px) saturate(118%);
}

.coaching-contact-logo {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  justify-self: center;
  object-fit: contain;
  filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.28));
}

.coaching-contact-copy {
  max-width: 720px;
}

.coaching-contact h2 {
  margin-bottom: 18px;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.coaching-contact-note {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.16rem);
}

.coaching-contact address {
  display: grid;
  gap: 3px;
  color: var(--ink);
  font-style: normal;
}

.coaching-contact address span {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.coaching-contact address strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 500;
}

.coaching-contact address a {
  width: fit-content;
  color: var(--muted);
  text-decoration-color: rgba(231, 191, 115, 0.52);
  text-underline-offset: 4px;
}

.coaching-contact address a:hover {
  color: var(--gold);
}

@media (max-width: 700px) {
  .coaching-contact {
    grid-template-columns: 1fr;
    gap: 18px;
    text-align: center;
  }

  .coaching-contact-logo {
    width: min(220px, 68vw);
  }

  .coaching-contact address a {
    justify-self: center;
  }
}

@media print {
  body {
    color: #172228;
    background: #fff;
  }

  .topbar,
  .story-panel,
  .origin-intro,
  .course-panel,
  .summary-actions,
  .reset-button,
  .sea-light,
  .toast {
    display: none !important;
  }

  .shell,
  .workspace,
  .main-panel {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    color: #172228;
    background: #fff;
    box-shadow: none;
  }

  .reflection-view {
    display: none !important;
  }

  .summary-view {
    display: block !important;
  }

  .summary-heading p,
  .summary-card p {
    color: #3a474c !important;
  }

  .summary-card,
  .course-narrative,
  .written-vision,
  .vision-canvas-wrap {
    break-inside: avoid;
    border-color: #cad0d2;
    background: #fff;
  }
}


/* Design preference: the original dark palette remains the default. */
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 20px;
}
.theme-switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.theme-switch button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 0.875rem;
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}
.theme-switch button:hover { color: var(--ink); }
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .topbar-actions .save-state { max-width: 155px; text-align: left; justify-content: flex-start; }
}
@media screen {
  :root[data-theme="light"] {
    color-scheme: light;
    --ink: #152f3e;
    --muted: #425e6c;
    --quiet: #526c79;
    --gold: #805a1c;
    --gold-soft: rgba(161, 115, 38, 0.12);
    --line: rgba(38, 78, 99, 0.22);
    --panel: rgba(255, 255, 255, 0.90);
    --panel-deep: rgba(249, 252, 254, 0.97);
    --field: rgba(255, 255, 255, 0.94);
    --focus: #805a1c;
    --shadow: 0 28px 80px rgba(26, 63, 83, 0.12);
    background: #eef5f8;
  }
  [data-theme="light"] body {
    background:
      linear-gradient(110deg, rgba(242, 248, 251, 0.97), rgba(235, 245, 250, 0.89) 47%, rgba(238, 246, 250, 0.75)),
      url("./assets/kompass-seascape.png") center / cover fixed no-repeat,
      #eef5f8;
  }
  [data-theme="light"] .story-content {
    background: radial-gradient(circle at 85% 8%, rgba(231, 191, 115, 0.13), transparent 26rem), #f4f8fa;
  }
  [data-theme="light"] .story-prose p,
  [data-theme="light"] .thought-anchors summary { color: var(--muted); }
  [data-theme="light"] .story-prose .story-emphasis { color: var(--ink); }
  [data-theme="light"] .intro-grid article,
  [data-theme="light"] .summary-card { background: #f2f7fa; }
  [data-theme="light"] .question-card,
  [data-theme="light"] .written-vision {
    background: radial-gradient(circle at 96% 2%, rgba(231, 191, 115, 0.14), transparent 15rem), #f4f8fa;
    border-color: rgba(128, 90, 28, 0.28);
  }
  [data-theme="light"] .course-narrative { background: linear-gradient(135deg, #faf3e5, #edf5f8); }
  [data-theme="light"] .step-number { background: #edf4f8; border-color: var(--line); }
  [data-theme="light"] .step-button.is-complete .step-number { background: #d9eee7; color: #245847; border-color: #528875; }
  [data-theme="light"] .step-button.is-active .step-number { border-color: var(--gold); color: var(--gold); }
  [data-theme="light"] .progress-track { background: #dbe5eb; }
  [data-theme="light"] .progress-track span { background: linear-gradient(90deg, #387f7e, #a57529); }
  [data-theme="light"] .step-button:hover,
  [data-theme="light"] .story-panel > summary:hover,
  [data-theme="light"] .button-quiet:hover { background: rgba(36, 82, 106, 0.07); }
  [data-theme="light"] textarea { border-color: var(--line); }
  [data-theme="light"] textarea:hover,
  [data-theme="light"] textarea:focus { background: #fff; border-color: var(--gold); }
  [data-theme="light"] textarea::placeholder { color: #59727f; }
  [data-theme="light"] .toast { background: #fff; border-color: var(--line); }
  [data-theme="light"] .reset-button:hover { color: #8c4034; }
  [data-theme="light"] button:focus-visible,
  [data-theme="light"] textarea:focus-visible,
  [data-theme="light"] summary:focus-visible { outline-color: #805a1c; }
}
@media screen and (max-width: 900px) {
  [data-theme="light"] body { background-attachment: scroll; }
}

/* Mobile refinement: preserve the existing content and visual language while
   giving every control and reading surface a calmer phone-sized rhythm. */
@media screen and (max-width: 620px) {
  :root {
    --radius-lg: 22px;
    --radius-md: 16px;
  }

  body {
    overflow-x: hidden;
  }

  .shell {
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .topbar {
    gap: 12px;
    min-height: 0;
  }

  .brand {
    width: 100%;
    min-width: 0;
    gap: 11px;
  }

  .brand > div {
    min-width: 0;
  }

  .brand-logo {
    flex: 0 0 auto;
  }

  .brand .eyebrow {
    overflow-wrap: anywhere;
    line-height: 1.35;
  }

  .topbar-actions {
    gap: 10px;
  }

  .topbar-actions .save-state {
    max-width: none;
    font-size: 0.72rem;
  }

  .theme-switch {
    border-radius: 12px;
  }

  .theme-switch button {
    min-width: 58px;
    min-height: 42px;
    padding: 7px 10px;
  }

  .story-panel,
  .origin-intro,
  .course-panel,
  .main-panel,
  .coaching-contact {
    box-shadow: 0 18px 48px rgba(0, 7, 12, 0.32);
  }

  .story-panel {
    margin-bottom: 12px;
  }

  .story-panel > summary {
    min-height: 64px;
    gap: 10px;
    padding: 10px 13px;
  }

  .story-summary-icon {
    width: 34px;
    height: 34px;
  }

  .story-panel summary strong {
    font-size: 0.96rem;
    line-height: 1.3;
  }

  .story-panel summary small {
    margin-top: 2px;
    font-size: 0.75rem;
  }

  .story-content {
    max-height: none;
    padding: 24px 17px 30px;
  }

  .story-content h2,
  .intro-lead h2,
  .summary-heading h2,
  .vision-heading h2,
  .coaching-contact h2 {
    font-size: clamp(1.72rem, 8.1vw, 2.12rem);
    line-height: 1.12;
  }

  .story-prose {
    max-width: 100%;
  }

  .story-prose p {
    font-size: 1rem;
    line-height: 1.68;
  }

  .story-levels {
    padding: 16px;
  }

  .origin-intro {
    gap: 22px;
    margin-bottom: 12px;
    padding: 22px 17px;
  }

  .intro-lead {
    gap: 10px;
  }

  .intro-lead h2 {
    max-width: 100%;
  }

  .intro-lead > p:last-child {
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .intro-grid {
    gap: 9px;
  }

  .intro-grid article {
    padding: 16px;
  }

  .intro-number {
    margin-bottom: 9px;
  }

  .intro-grid h3 {
    font-size: 1rem;
  }

  .intro-grid p {
    font-size: 0.93rem;
    line-height: 1.6;
  }

  .workspace {
    gap: 12px;
    min-height: 0;
  }

  .course-panel {
    padding: 15px 11px 11px;
  }

  .course-heading {
    align-items: flex-end;
    gap: 10px;
    padding: 0 3px 10px;
  }

  .course-heading p:last-child {
    flex: 0 0 auto;
    line-height: 1.35;
    text-align: right;
  }

  .progress-track {
    margin: 0 3px 10px;
  }

  .step-nav {
    margin-inline: -1px;
    padding: 2px 1px 8px;
    scroll-padding-inline: 1px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .step-button {
    min-width: 88px;
    min-height: 68px;
    scroll-snap-align: start;
  }

  .step-copy strong {
    font-size: 0.78rem;
  }

  .step-copy small {
    font-size: 0.7rem;
  }

  .summary-nav {
    min-height: 52px;
    margin-top: 5px;
  }

  .main-panel {
    min-height: 0;
    padding: 23px 17px;
  }

  .level-header {
    margin-bottom: 20px;
  }

  .level-header h2 {
    font-size: clamp(2rem, 11vw, 2.65rem);
  }

  .level-meaning {
    font-size: 0.94rem;
    line-height: 1.5;
  }

  .metaphor-badge {
    margin-top: 11px;
    padding: 7px 11px;
    font-size: 0.88rem;
  }

  .question-card {
    margin-bottom: 23px;
    padding: 19px 16px;
  }

  blockquote {
    font-size: clamp(1.28rem, 6.2vw, 1.55rem);
    line-height: 1.38;
  }

  .step-intro {
    font-size: 0.95rem;
    line-height: 1.62;
  }

  .notes-label {
    gap: 10px;
  }

  textarea {
    min-height: 190px;
    padding: 15px;
    font-size: 1rem;
  }

  .thought-anchors summary,
  .thought-anchors ul {
    font-size: 0.9rem;
  }

  .navigation-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
  }

  .button {
    width: 100%;
    min-height: 50px;
    padding: 10px 12px;
  }

  .summary-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    margin-bottom: 22px;
  }

  .summary-heading h2 {
    overflow-wrap: anywhere;
  }

  .summary-heading p:last-child {
    font-size: 0.94rem;
    line-height: 1.58;
  }

  .completion-ring {
    width: 62px;
    height: 62px;
    padding-top: 12px;
  }

  .course-narrative,
  .written-vision {
    padding: 18px 16px;
  }

  .course-narrative p:last-child,
  .vision-statement {
    line-height: 1.62;
  }

  .summary-card {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .summary-card-number {
    width: 32px;
    height: 32px;
  }

  .summary-card p {
    font-size: 0.93rem;
    line-height: 1.58;
  }

  .edit-step {
    grid-column: 2;
    min-height: 36px;
    padding: 7px 3px;
  }

  .vision-section {
    margin-top: 30px;
    padding-top: 29px;
  }

  .vision-canvas-wrap {
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .vision-canvas-wrap canvas {
    width: 640px;
  }

  .vision-figure figcaption {
    gap: 8px;
    line-height: 1.45;
  }

  .inline-action {
    min-height: 40px;
  }

  .summary-actions {
    gap: 10px;
    margin-top: 24px;
  }

  .coaching-contact {
    gap: 15px;
    margin-top: 12px;
    padding: 22px 17px 25px;
  }

  .coaching-contact-logo {
    width: min(180px, 56vw);
  }

  .coaching-contact h2 {
    margin-bottom: 13px;
  }

  .coaching-contact-note {
    margin-bottom: 17px;
    font-size: 1rem;
    line-height: 1.58;
  }

  .coaching-contact address {
    gap: 5px;
  }

  .coaching-contact address a {
    min-height: 44px;
    padding-top: 8px;
  }

  .toast {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}

@media screen and (max-width: 390px) {
  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .brand .eyebrow {
    font-size: 0.58rem;
    letter-spacing: 0.11em;
  }

  h1 {
    font-size: 1rem;
  }

  .topbar-actions {
    align-items: center;
  }

  .topbar-actions .save-state {
    max-width: 132px;
  }

  .course-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .course-heading p:last-child {
    text-align: left;
  }

  .summary-heading {
    grid-template-columns: 1fr;
  }

  .completion-ring {
    justify-self: start;
  }
}
