:root {
  --navy-950: #041426;
  --navy-900: #071c35;
  --navy-850: #0a2442;
  --navy-800: #0e2c4f;
  --navy-700: #153c64;
  --blue: #67ccec;
  --blue-strong: #4facdf;
  --violet: #8268f1;
  --violet-soft: #a391ff;
  --coral: #ee9788;
  --yellow: #ffd85b;
  --mint: #79dfbd;
  --white: #f8fbff;
  --muted: #a7bdd3;
  --muted-2: #6f8eaa;
  --border: rgba(106, 204, 236, .28);
  --border-strong: rgba(106, 204, 236, .55);
  --shadow: 0 22px 70px rgba(0, 8, 22, .35);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font: "Roboto", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background: var(--navy-950);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 70% 24%, rgba(70, 101, 190, .13), transparent 30%),
    linear-gradient(180deg, #071c35 0%, #06182e 55%, #041426 100%);
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .13;
  pointer-events: none;
}

.ambient-one { top: 18%; left: -240px; background: var(--violet); }
.ambient-two { right: -260px; bottom: 0; background: var(--blue); }

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(22px, 4vw, 72px);
  border-bottom: 1px solid rgba(106, 204, 236, .18);
  background: rgba(4, 20, 38, .84);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
}

.brand-mark svg { width: 48px; height: 48px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .76rem; text-transform: uppercase; letter-spacing: .18em; color: var(--blue); }
.brand small { font-size: 1.08rem; font-weight: 750; margin-top: 2px; }

.top-actions { display: flex; align-items: center; gap: 12px; }
.privacy-pill, .autosave {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
}

.privacy-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 14px rgba(121, 223, 189, .7); }

.icon-button, .text-button, .preview-link, .primary-button, .secondary-button, .export-button, .book-link {
  border: 0;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(12, 41, 72, .72);
}
.icon-button:hover { transform: translateY(-2px); border-color: var(--violet-soft); background: rgba(130, 104, 241, .2); }
.icon-button svg { width: 19px; fill: var(--blue); }
.icon-button .sound-off { display: none; }
.icon-button[aria-pressed="false"] .sound-on { display: none; }
.icon-button[aria-pressed="false"] .sound-off { display: block; }
.theme-toggle .theme-sun { display: none; }
.theme-toggle .theme-moon { display: block; }
html[data-theme="light"] .theme-toggle .theme-sun { display: block; }
html[data-theme="light"] .theme-toggle .theme-moon { display: none; }

.text-button { background: transparent; padding: 10px 12px; color: var(--muted); }
.text-button:hover { color: var(--yellow); }

.app-shell { width: min(1580px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 72px; }

.intro-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 34px;
}

.eyebrow, .mini-label, .step-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 870px; margin-bottom: 12px; font-size: clamp(2.15rem, 4vw, 4rem); line-height: 1.02; letter-spacing: -.045em; }
.lede { max-width: 760px; margin: 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.65; }
.autosave { min-width: 124px; justify-content: flex-end; padding-bottom: 5px; }
.autosave.saving { color: var(--yellow); }
.checkmark { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: var(--navy-950); background: var(--mint); font-size: .72rem; font-weight: 900; }

.builder-grid {
  display: grid;
  grid-template-columns: minmax(215px, .72fr) minmax(500px, 1.85fr) minmax(300px, .92fr);
  gap: 22px;
  align-items: stretch;
}

.stepper, .form-card, .readiness-card, .handoff-document, .stress-test-card, .book-card {
  border: 1px solid var(--border);
  background: rgba(8, 32, 59, .78);
  box-shadow: var(--shadow);
}

.stepper, .readiness-card { border-radius: var(--radius-xl); padding: 24px; }
.form-card { border-radius: var(--radius-xl); padding: clamp(24px, 3vw, 42px); min-height: 680px; display: flex; flex-direction: column; }

.stepper-head { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 19px; border-bottom: 1px solid rgba(106, 204, 236, .16); }
.stepper-head span { font-size: .68rem; letter-spacing: .17em; color: var(--muted); font-weight: 800; }
.stepper-head strong { color: var(--blue); font-size: .8rem; }
.step-list { position: relative; margin-top: 16px; }
.step-list::before { content: ""; position: absolute; left: 18px; top: 24px; bottom: 36px; width: 1px; background: rgba(106, 204, 236, .25); }

.step-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
}
.step-item:hover { background: rgba(255, 216, 91, .06); color: var(--yellow); border-color: rgba(255, 216, 91, .24); }
.step-item.active { background: rgba(130, 104, 241, .11); border-color: rgba(130, 104, 241, .5); color: var(--white); }
.step-item.complete .step-number { background: var(--mint); color: var(--navy-950); border-color: var(--mint); }
.step-number { position: relative; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--navy-800); border: 1px solid rgba(106, 204, 236, .45); font-size: .8rem; font-weight: 850; }
.step-item.active .step-number { background: var(--violet); border-color: var(--violet-soft); color: white; box-shadow: 0 0 20px rgba(130, 104, 241, .35); }
.step-copy strong { display: block; font-size: .9rem; line-height: 1.25; }
.step-copy small { display: block; margin-top: 4px; color: var(--muted-2); font-size: .72rem; line-height: 1.3; }

.stepper-tip { display: grid; grid-template-columns: 18px 1fr; align-items: start; gap: 10px; margin-top: 26px; padding: 16px; border: 1px solid rgba(255, 216, 91, .22); border-radius: 16px; background: rgba(255, 216, 91, .05); }
.stepper-tip p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.stepper-tip strong { color: var(--white); }
.tip-icon { margin-top: 1px; color: var(--yellow); line-height: 1.55; }

.form-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid rgba(106, 204, 236, .18); }
.form-card-head h2 { margin-bottom: 9px; font-size: clamp(1.75rem, 2.8vw, 2.7rem); letter-spacing: -.035em; }
.form-card-head p:not(.step-kicker) { margin: 0; max-width: 600px; color: var(--muted); line-height: 1.55; }
.preview-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; background: transparent; color: var(--blue); white-space: nowrap; }
.preview-link:hover { color: var(--yellow); transform: translateX(2px); }
.preview-link svg { width: 19px; fill: currentColor; }

.dynamic-form { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 30px 0; flex: 1; align-content: start; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .9rem; font-weight: 730; }
.field .optional { color: var(--muted-2); font-size: .72rem; font-weight: 600; }
.field-hint { color: var(--muted-2); font-size: .73rem; line-height: 1.4; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid rgba(106, 204, 236, .33);
  border-radius: var(--radius-md);
  color: var(--white);
  background: rgba(12, 44, 79, .72);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.field input, .field select { min-height: 52px; padding: 0 15px; }
.field textarea { min-height: 122px; resize: vertical; padding: 14px 15px; line-height: 1.55; }
.field textarea.tall { min-height: 160px; }
.field input::placeholder, .field textarea::placeholder { color: #718ca8; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--violet-soft); box-shadow: 0 0 0 4px rgba(130, 104, 241, .12); background: rgba(14, 48, 85, .9); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--blue) 50%), linear-gradient(135deg, var(--blue) 50%, transparent 50%); background-position: calc(100% - 19px) 23px, calc(100% - 13px) 23px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 42px; }
.field select option { background: var(--navy-850); }

.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; grid-column: 1 / -1; }
.preset-button { padding: 15px 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(12, 44, 79, .7); color: var(--muted); cursor: pointer; text-align: left; transition: all .2s ease; }
.preset-button:hover { border-color: var(--yellow); transform: translateY(-2px); color: var(--yellow); background: rgba(255, 216, 91, .07); }
.preset-button.active { border-color: var(--violet-soft); background: rgba(130, 104, 241, .15); color: white; box-shadow: inset 0 0 0 1px rgba(130, 104, 241, .28); }
.preset-button strong { display: block; margin-bottom: 3px; font-size: .84rem; }
.preset-button small { font-size: .68rem; color: var(--muted-2); }

.form-navigation { display: flex; justify-content: space-between; gap: 14px; padding-top: 24px; border-top: 1px solid rgba(106, 204, 236, .18); }
.primary-button, .secondary-button, .export-button, .book-link { position: relative; overflow: hidden; border-radius: 13px; font-weight: 800; }
.primary-button { min-width: 170px; padding: 15px 24px; background: var(--violet); color: white; box-shadow: 0 12px 30px rgba(70, 47, 175, .28); }
.primary-button:hover { transform: translateY(-2px); background: #9077fa; box-shadow: 0 16px 36px rgba(70, 47, 175, .38); }
.secondary-button { padding: 14px 20px; border: 1px solid var(--border); background: rgba(10, 39, 70, .75); color: var(--muted); }
.secondary-button:hover { transform: translateY(-2px); border-color: var(--yellow); color: var(--yellow); background: rgba(255, 216, 91, .07); }
.secondary-button:disabled { opacity: .35; cursor: not-allowed; transform: none; }

.shine::after {
  content: "";
  position: absolute;
  top: -60%;
  bottom: -60%;
  left: -45%;
  width: 30%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transition: left .55s ease;
  pointer-events: none;
}
.shine:hover::after { left: 125%; }

.readiness-card { min-height: 680px; }
.readiness-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid rgba(106, 204, 236, .18); }
.readiness-top h2 { margin: 0; font-size: 2.8rem; letter-spacing: -.05em; }
.readiness-top h2 small { font-size: 1rem; color: var(--muted); letter-spacing: 0; }
.score-ring { --score: 0deg; width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--violet) var(--score), rgba(106, 204, 236, .13) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--navy-850); }
.score-ring span { position: relative; z-index: 1; font-size: .72rem; color: var(--muted); font-weight: 800; }
.score-summary { margin: 20px 0 22px; color: var(--muted); line-height: 1.55; font-size: .88rem; }
.dimension-list { display: grid; gap: 14px; }
.dimension-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.dimension-name { display: flex; align-items: center; gap: 9px; font-size: .8rem; font-weight: 720; }
.dimension-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--blue)); }
.dimension-meter { display: flex; gap: 4px; }
.dimension-meter i { display: block; width: 17px; height: 5px; border-radius: 99px; background: rgba(106, 204, 236, .16); }
.dimension-meter i.filled { background: var(--meter, var(--blue)); box-shadow: 0 0 8px color-mix(in srgb, var(--meter, var(--blue)) 50%, transparent); }
.coach-card { display: flex; gap: 12px; margin-top: 26px; padding: 16px; border-radius: 16px; border: 1px solid rgba(255, 216, 91, .3); background: rgba(255, 216, 91, .06); }
.coach-spark { color: var(--yellow); font-size: 1.2rem; }
.coach-card strong { font-size: .8rem; }
.coach-card p { margin: 5px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }

.result-view { animation: reveal .45s ease both; min-height: calc(100vh - 150px); scroll-margin-top: 102px; }
body.result-mode .intro-row { display: none; }
body.result-mode .app-shell { padding-top: 28px; }
@keyframes reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 30px 34px; margin-bottom: 30px; border: 1px solid rgba(121, 223, 189, .35); border-radius: var(--radius-xl); background: rgba(12, 54, 73, .62); }
.result-head h2 { margin-bottom: 6px; font-size: clamp(2rem, 3vw, 3.2rem); letter-spacing: -.04em; }
.result-head p:not(.eyebrow) { margin: 0; color: var(--muted); }
.result-edit-pill { display: inline-flex; align-items: center; gap: 7px; margin-top: 16px; padding: 8px 11px; border: 1px solid rgba(255, 216, 91, .28); border-radius: 999px; color: var(--yellow); background: rgba(255, 216, 91, .07); font-size: .72rem; font-weight: 700; }
.result-edit-pill b { font-size: .9rem; }
.final-score { min-width: 130px; text-align: center; padding-left: 30px; border-left: 1px solid rgba(121, 223, 189, .24); }
.final-score strong { font-size: 3.25rem; letter-spacing: -.06em; color: var(--mint); }
.final-score > span { color: var(--muted); }
.final-score small { display: block; margin-top: -5px; font-size: .62rem; letter-spacing: .18em; color: var(--muted); }
.result-grid { display: grid; grid-template-columns: 1.5fr .8fr; gap: 30px; }
.handoff-document { display: flex; flex-direction: column; gap: 15px; border-radius: var(--radius-xl); padding: clamp(28px, 4vw, 52px); }
.document-title { padding-bottom: 25px; margin-bottom: 8px; border-bottom: 1px solid rgba(106, 204, 236, .2); }
.document-title h2 { margin-bottom: 7px; font-size: 2rem; }
.document-title p { margin: 0; color: var(--muted); }
.document-section { padding: 19px 20px; border: 1px solid rgba(106, 204, 236, .16); border-radius: 16px; background: rgba(106, 204, 236, .035); transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.document-section:hover { border-color: rgba(255, 216, 91, .34); background: rgba(255, 216, 91, .025); }
.document-section:last-child { border-bottom: 1px solid rgba(106, 204, 236, .16); }
.document-section h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: .74rem; letter-spacing: .17em; color: var(--blue); }
.document-section h3 span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--navy-950); background: var(--blue); font-size: .65rem; letter-spacing: 0; }
.document-section p { margin: 0; white-space: pre-line; line-height: 1.7; color: #dce8f4; }
.document-section p[contenteditable], .document-title h2[contenteditable] { outline: none; border-radius: 9px; transition: background .2s ease, box-shadow .2s ease; cursor: text; }
.document-section p[contenteditable] { padding: 8px 9px; margin: -8px -9px; }
.document-section p[contenteditable]:hover, .document-title h2[contenteditable]:hover { background: rgba(255, 216, 91, .045); }
.document-section p[contenteditable]:focus, .document-title h2[contenteditable]:focus { background: rgba(255, 216, 91, .075); box-shadow: 0 0 0 2px rgba(255, 216, 91, .32); }
.edit-tag { margin-left: auto; color: var(--yellow); font-size: .58rem; letter-spacing: .12em; opacity: .72; }
.document-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 15px; }
.meta-chip { padding: 12px; border-radius: 12px; background: rgba(106, 204, 236, .06); border: 1px solid rgba(106, 204, 236, .14); }
.meta-chip small { display: block; color: var(--muted-2); font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; }
.meta-chip strong { display: block; margin-top: 6px; font-size: .82rem; }
.result-side { display: grid; gap: 30px; align-content: start; }
.stress-test-card, .book-card { border-radius: var(--radius-xl); padding: 26px; }
.stress-test-card h3, .book-card h3 { font-size: 1.35rem; margin-bottom: 14px; }
.stress-test-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 2px; border-bottom: 1px solid rgba(106, 204, 236, .14); }
.stress-test-head img { width: 68px; height: 68px; flex: 0 0 auto; object-fit: cover; object-position: 50% 25%; border-radius: 50%; border: 3px solid rgba(106, 204, 236, .55); box-shadow: 0 0 0 5px rgba(106, 204, 236, .08); }
.stress-test-head .mini-label { margin-bottom: 6px; }
.stress-test-head h3 { margin: 0; }
.stress-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(106, 204, 236, .12); color: var(--muted); font-size: .82rem; line-height: 1.45; }
.stress-item:last-child { border-bottom: 0; }
.stress-item.good span { color: var(--mint); }
.stress-item.warn span { color: var(--yellow); }
.book-card { display: grid; grid-template-columns: 112px 1fr; gap: 22px; align-items: center; border-color: rgba(130, 104, 241, .36); background: linear-gradient(145deg, rgba(38, 43, 100, .68), rgba(7, 28, 53, .92)); }
.book-cover { display: block; width: 112px; height: auto; border: 1px solid rgba(255,255,255,.18); border-radius: 5px; box-shadow: 10px 13px 0 rgba(0,0,0,.17); transform: rotate(-2deg); }
.book-card p:not(.mini-label) { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.book-link { display: inline-flex; align-items: center; gap: 8px; padding: 11px 15px; color: white; text-decoration: none; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); font-size: .8rem; }
.book-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.book-link:hover { transform: translateY(-2px); border-color: var(--yellow); color: var(--yellow); background: rgba(255, 216, 91, .07); }
.book-link-primary { border-color: var(--violet-soft); background: var(--violet); }
.book-link-primary:hover { border-color: var(--violet-soft); color: white; background: #927bfa; }
.export-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(8, 32, 59, .78); }
.export-button { padding: 13px 17px; border: 1px solid var(--border); background: rgba(12, 44, 79, .78); }
.export-button:hover { transform: translateY(-2px); border-color: var(--yellow); color: var(--yellow); background: rgba(255, 216, 91, .07); }
.export-icon { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-right: 6px; border-radius: 7px; background: rgba(106, 204, 236, .13); color: var(--blue); font-size: .65rem; }
.export-bar .secondary-button { margin-left: auto; }

.preview-dialog { width: min(860px, calc(100% - 32px)); max-height: 90vh; padding: 0; color: var(--white); border: 1px solid var(--border-strong); border-radius: 24px; background: var(--navy-900); box-shadow: 0 30px 100px rgba(0,0,0,.7); }
.preview-dialog::backdrop { background: rgba(1, 8, 18, .74); backdrop-filter: blur(8px); }
.dialog-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 28px 18px; background: rgba(7, 28, 53, .95); border-bottom: 1px solid var(--border); z-index: 2; }
.dialog-head h2 { margin: 0; }
.dialog-head .icon-button { font-size: 1.7rem; font-weight: 300; }
.dialog-document { padding: 12px 30px; }
.dialog-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 12px; padding: 18px 28px; background: rgba(7, 28, 53, .97); border-top: 1px solid var(--border); }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 30px; display: flex; align-items: center; gap: 10px; padding: 13px 18px; color: var(--navy-950); background: var(--mint); border-radius: 999px; box-shadow: 0 18px 45px rgba(0,0,0,.42); transform: translate(-50%, 120px); opacity: 0; transition: all .34s cubic-bezier(.2,.9,.25,1.2); font-size: .84rem; font-weight: 800; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-icon { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: rgba(4,20,38,.14); }

.confetti-layer { position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: none; }
.confetti { position: absolute; top: -18px; width: 9px; height: 15px; border-radius: 2px; animation: confetti-fall var(--duration) cubic-bezier(.13,.72,.26,1) forwards; transform: translate3d(0,0,0) rotate(0deg); }
@keyframes confetti-fall {
  0% { transform: translate3d(0,-10px,0) rotate(0deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate3d(var(--drift), 105vh, 0) rotate(var(--spin)); opacity: 0; }
}

body.printing { background: white; color: #10243a; }
body.printing .topbar, body.printing .intro-row, body.printing .result-head, body.printing .result-side, body.printing .export-bar, body.printing .ambient { display: none !important; }
body.printing .app-shell { width: 100%; padding: 0; }
body.printing .result-grid { display: block; }
body.printing .handoff-document { border: 0; box-shadow: none; background: white; color: #10243a; }
body.printing .document-section p { color: #10243a; }
body.printing .meta-chip { border-color: #ccd8e4; background: #f5f8fb; }

/* Professional light mode — inspired by the book's pale blue and yellow palette. */
html[data-theme="light"] {
  color-scheme: light;
  --navy-950: #24353a;
  --navy-900: #f3f6f5;
  --navy-850: #ffffff;
  --navy-800: #dfecef;
  --navy-700: #b9d7df;
  --blue: #2f91ad;
  --blue-strong: #247992;
  --violet: #725bd4;
  --violet-soft: #866ee4;
  --coral: #d67d70;
  --yellow: #e5bd22;
  --mint: #46aa88;
  --white: #24353a;
  --muted: #63767b;
  --muted-2: #829196;
  --border: rgba(78, 118, 127, .22);
  --border-strong: rgba(47, 145, 173, .46);
  --shadow: 0 20px 55px rgba(54, 73, 79, .10);
}

html[data-theme="light"] body {
  color: var(--white);
  background: #eef2f1;
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(circle at 72% 18%, rgba(151, 214, 229, .24), transparent 29%),
    radial-gradient(circle at 15% 78%, rgba(240, 210, 74, .10), transparent 25%),
    linear-gradient(180deg, #f8faf9 0%, #f0f4f3 54%, #e9eeee 100%);
}

html[data-theme="light"] .ambient-one { background: #a6cfe1; opacity: .18; }
html[data-theme="light"] .ambient-two { background: #f0d34a; opacity: .11; }

html[data-theme="light"] .topbar {
  border-bottom-color: rgba(72, 111, 120, .16);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 28px rgba(54, 73, 79, .06);
}

html[data-theme="light"] .brand strong { color: var(--blue-strong); }
html[data-theme="light"] .icon-button {
  border-color: rgba(65, 111, 122, .22);
  background: #ffffff;
}
html[data-theme="light"] .icon-button:hover {
  border-color: #d7ae16;
  background: #fff8d9;
}
html[data-theme="light"] .icon-button svg { fill: var(--blue-strong); }

html[data-theme="light"] .stepper,
html[data-theme="light"] .form-card,
html[data-theme="light"] .readiness-card,
html[data-theme="light"] .handoff-document,
html[data-theme="light"] .stress-test-card {
  background: rgba(255, 255, 255, .94);
  border-color: rgba(76, 117, 126, .19);
}

html[data-theme="light"] .stepper-head,
html[data-theme="light"] .form-card-head,
html[data-theme="light"] .form-navigation,
html[data-theme="light"] .readiness-top,
html[data-theme="light"] .stress-test-head {
  border-color: rgba(76, 117, 126, .16);
}

html[data-theme="light"] .step-list::before { background: rgba(61, 127, 143, .22); }
html[data-theme="light"] .step-item:hover {
  color: #735c00;
  border-color: rgba(229, 189, 34, .45);
  background: rgba(245, 211, 70, .13);
}
html[data-theme="light"] .step-item.active {
  color: #283a3f;
  border-color: rgba(47, 145, 173, .42);
  background: #e8f4f6;
}
html[data-theme="light"] .step-number {
  color: #294047;
  border-color: rgba(47, 145, 173, .33);
  background: #e7f2f4;
}
html[data-theme="light"] .step-item.complete .step-number,
html[data-theme="light"] .checkmark { color: #ffffff; }
html[data-theme="light"] .step-item.active .step-number { color: #ffffff; background: var(--blue-strong); border-color: var(--blue-strong); box-shadow: 0 0 18px rgba(47, 145, 173, .22); }

html[data-theme="light"] .stepper-tip,
html[data-theme="light"] .coach-card {
  border-color: rgba(229, 189, 34, .36);
  background: #fff9df;
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .field select {
  color: #24353a;
  border-color: rgba(72, 119, 130, .28);
  background-color: #f8faf9;
}
html[data-theme="light"] .field input::placeholder,
html[data-theme="light"] .field textarea::placeholder { color: #8a999d; }
html[data-theme="light"] .field input:focus,
html[data-theme="light"] .field textarea:focus,
html[data-theme="light"] .field select:focus {
  border-color: var(--blue);
  background-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(47, 145, 173, .12);
}
html[data-theme="light"] .field select option { color: #24353a; background: #ffffff; }

html[data-theme="light"] .preset-button,
html[data-theme="light"] .secondary-button,
html[data-theme="light"] .export-button {
  color: #5f7277;
  border-color: rgba(72, 119, 130, .24);
  background: #f7f9f8;
}
html[data-theme="light"] .preset-button:hover,
html[data-theme="light"] .secondary-button:hover,
html[data-theme="light"] .export-button:hover {
  color: #6b5600;
  border-color: #d8ad16;
  background: #fff8d7;
}
html[data-theme="light"] .preset-button.active {
  color: #273b40;
  border-color: rgba(47, 145, 173, .5);
  background: #e4f2f5;
  box-shadow: inset 0 0 0 1px rgba(47, 145, 173, .16);
}
html[data-theme="light"] .primary-button {
  color: #304044;
  background: #efd24a;
  box-shadow: 0 12px 28px rgba(179, 143, 13, .20);
}
html[data-theme="light"] .primary-button:hover {
  color: #24353a;
  background: #f6dd67;
  box-shadow: 0 16px 34px rgba(179, 143, 13, .25);
}
html[data-theme="light"] .text-button:hover { color: #756000; }

html[data-theme="light"] .score-ring { background: conic-gradient(var(--blue) var(--score), rgba(47, 145, 173, .13) 0); }
html[data-theme="light"] .score-ring::before { background: #ffffff; }

html[data-theme="light"] .result-head {
  border-color: rgba(47, 145, 173, .28);
  background: linear-gradient(115deg, #ffffff, #e7f4f6);
  box-shadow: var(--shadow);
}
html[data-theme="light"] .result-edit-pill {
  color: #6c5904;
  border-color: rgba(213, 171, 21, .36);
  background: #fff8d7;
}
html[data-theme="light"] .final-score { border-color: rgba(47, 145, 173, .22); }
html[data-theme="light"] .final-score strong { color: var(--blue-strong); }

html[data-theme="light"] .document-title { border-color: rgba(72, 119, 130, .18); }
html[data-theme="light"] .document-section {
  border-color: rgba(72, 119, 130, .18);
  background: #f8faf9;
}
html[data-theme="light"] .document-section:hover {
  border-color: rgba(213, 171, 21, .42);
  background: #fffdf5;
}
html[data-theme="light"] .document-section:last-child { border-bottom-color: rgba(72, 119, 130, .18); }
html[data-theme="light"] .document-section h3 { color: var(--blue-strong); }
html[data-theme="light"] .document-section h3 span { color: #ffffff; background: var(--blue-strong); }
html[data-theme="light"] .document-section p { color: #35494f; }
html[data-theme="light"] .document-section p[contenteditable]:hover,
html[data-theme="light"] .document-title h2[contenteditable]:hover { background: rgba(245, 211, 70, .13); }
html[data-theme="light"] .document-section p[contenteditable]:focus,
html[data-theme="light"] .document-title h2[contenteditable]:focus {
  background: #fff9dd;
  box-shadow: 0 0 0 2px rgba(213, 171, 21, .34);
}
html[data-theme="light"] .edit-tag { color: #806700; }
html[data-theme="light"] .meta-chip {
  border-color: rgba(72, 119, 130, .17);
  background: #edf5f6;
}

html[data-theme="light"] .stress-item { border-color: rgba(72, 119, 130, .14); }
html[data-theme="light"] .book-card {
  color: #25383d;
  border-color: rgba(47, 145, 173, .27);
  background: linear-gradient(145deg, #e1f1f4, #ffffff);
}
html[data-theme="light"] .book-cover { border-color: rgba(57, 78, 83, .15); box-shadow: 10px 13px 0 rgba(47, 89, 99, .10); }
html[data-theme="light"] .book-link {
  color: #294047;
  border-color: rgba(72, 119, 130, .27);
  background: rgba(255, 255, 255, .74);
}
html[data-theme="light"] .book-link:hover { color: #6b5600; border-color: #d8ad16; background: #fff8d7; }
html[data-theme="light"] .book-link-primary { color: #ffffff; border-color: var(--blue-strong); background: var(--blue-strong); }
html[data-theme="light"] .book-link-primary:hover { color: #ffffff; border-color: #267f98; background: #267f98; }

html[data-theme="light"] .export-bar {
  border-color: rgba(72, 119, 130, .2);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 16px 40px rgba(54, 73, 79, .08);
}
html[data-theme="light"] .export-icon { color: var(--blue-strong); background: #e3f2f5; }

html[data-theme="light"] .preview-dialog {
  color: #24353a;
  border-color: rgba(47, 145, 173, .34);
  background: #f5f8f7;
  box-shadow: 0 30px 90px rgba(41, 56, 61, .28);
}
html[data-theme="light"] .preview-dialog::backdrop { background: rgba(28, 43, 48, .40); }
html[data-theme="light"] .dialog-head,
html[data-theme="light"] .dialog-actions { background: rgba(255, 255, 255, .97); border-color: rgba(72, 119, 130, .18); }

html[data-theme="light"] .toast { color: #ffffff; background: var(--blue-strong); box-shadow: 0 18px 45px rgba(41, 75, 84, .25); }
html[data-theme="light"] .toast-icon { background: rgba(255,255,255,.18); }

@media print {
  @page { margin: 17mm; }
  body { background: white !important; color: #10243a !important; }
  .topbar, .intro-row, .result-head, .result-side, .export-bar, .ambient, .toast, .confetti-layer { display: none !important; }
  .app-shell { width: 100%; padding: 0; }
  .result-grid { display: block; }
  .handoff-document { border: 0; box-shadow: none; background: white; color: #10243a; padding: 0; }
  .document-section p { color: #10243a; }
  .meta-chip { border-color: #ccd8e4; background: #f5f8fb; }
}

@media (max-width: 1180px) {
  .builder-grid { grid-template-columns: 220px 1fr; }
  .readiness-card { grid-column: 1 / -1; min-height: auto; display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; }
  .readiness-top { border-bottom: 0; border-right: 1px solid rgba(106, 204, 236, .18); padding: 0 24px 0 0; }
  .score-summary { grid-column: 1; margin: -40px 24px 0 0; align-self: end; }
  .dimension-list { grid-column: 2; grid-row: 1 / span 2; }
  .coach-card { grid-column: 1 / -1; margin-top: 0; }
}

@media (max-width: 820px) {
  .topbar { position: static; padding: 12px 18px; }
  .privacy-pill { display: none; }
  .app-shell { width: min(100% - 28px, 680px); padding-top: 30px; }
  .intro-row { display: block; }
  .autosave { justify-content: flex-start; margin-top: 16px; }
  .builder-grid { display: block; }
  .stepper { margin-bottom: 16px; padding: 16px; }
  .step-list { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .step-list::before, .step-copy small, .stepper-tip { display: none; }
  .step-item { flex: 0 0 auto; grid-template-columns: 30px auto; padding: 8px 12px; }
  .step-number { width: 28px; height: 28px; }
  .form-card { min-height: 0; margin-bottom: 16px; }
  .readiness-card { display: block; min-height: 0; }
  .readiness-top { border-right: 0; border-bottom: 1px solid rgba(106, 204, 236, .18); padding: 0 0 20px; }
  .score-summary { margin: 20px 0; }
  .dimension-list { margin-bottom: 20px; }
  .dynamic-form, .preset-grid { grid-template-columns: 1fr; }
  .field { grid-column: 1 / -1; }
  .result-head { align-items: flex-start; }
  .result-grid { grid-template-columns: 1fr; }
  .book-card { grid-template-columns: 95px 1fr; }
  .export-bar .secondary-button { margin-left: 0; }
}

@media (max-width: 560px) {
  .brand small { font-size: .92rem; }
  .brand strong { font-size: .6rem; }
  .brand-mark { width: 40px; }
  .brand-mark svg { width: 40px; }
  .top-actions .text-button { font-size: .72rem; padding: 8px 5px; }
  h1 { font-size: 2.25rem; }
  .form-card-head { display: block; }
  .preview-link { margin-top: 10px; }
  .form-navigation { flex-direction: column-reverse; }
  .primary-button, .secondary-button { width: 100%; }
  .result-head { display: block; padding: 25px; }
  .final-score { margin-top: 20px; padding: 18px 0 0; border-left: 0; border-top: 1px solid rgba(121, 223, 189, .24); text-align: left; }
  .document-meta { grid-template-columns: 1fr; }
  .book-card { grid-template-columns: 1fr; }
  .book-cover { width: 108px; }
  .export-button { width: 100%; }
  .toast { width: calc(100% - 30px); justify-content: center; text-align: center; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
