:root {
  color-scheme: dark;
  --surface: #111827;
  --surface-raised: #1b2536;
  --surface-input: #141d2d;
  --text-primary: #e8edf5;
  --text-secondary: #adb9cd;
  --line: #39475c;
  --action: #7550c9;
  --action-hover: #6440b4;
  --focus: #c4b5fd;
  --accent: #bea6f4;
  --gold: #e9bc69;
  --error: #fda4af;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-display: 'Playfair Display', 'Noto Serif SC', 'Songti SC', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (max-width: 767px) {
  html { touch-action: pan-x pan-y; }
}
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(circle at 74% 9%, rgb(117 80 201 / .1), transparent 32rem), var(--surface);
  color: var(--text-primary);
  font-family: var(--font-ui);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }
:where(a, button, input, select, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
input:focus-visible, select:focus-visible { box-shadow: 0 0 0 3px rgb(196 181 253 / .16); }

.skip-link {
  position: fixed; top: 8px; left: 16px; z-index: 100;
  transform: translateY(-160%); padding: 10px 16px;
  border-radius: 8px; background: var(--surface-raised);
  color: var(--text-primary); text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  height: 64px; padding: 0 max(24px, calc((100vw - 1020px) / 2));
  border-bottom: 1px solid rgb(148 163 184 / .15);
  background: rgb(17 24 39 / .94); backdrop-filter: blur(16px);
}
/* Match the chart page's header brand. */
.brand { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; min-height: 38px; color: #e2e8f0; text-decoration: none; transition: color 160ms ease, opacity 160ms ease; }
.brand-mark { color: #f59e0b; font-size: 1.45rem; line-height: 1; }
.brand-name { color: #e2e8f0; font-family: 'Playfair Display', 'Noto Serif SC', serif; font-size: .78rem; font-weight: 600; letter-spacing: .08em; white-space: nowrap; }
.brand:hover { color: #f59e0b; }
.brand:focus-visible { outline: 2px solid #f59e0b; outline-offset: 3px; border-radius: .5rem; }
@media (max-width: 767px) { .brand-name { display: none; } }
.header-context { display: inline-flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 12px; letter-spacing: .04em; white-space: nowrap; }
.header-context svg { opacity: .7; flex-shrink: 0; }

.page-shell { width: min(calc(100% - 48px), 1020px); margin: 0 auto; padding: 0 0 112px; }
.page-intro { position: relative; isolation: isolate; overflow: hidden; max-width: none; padding: 48px 0 24px; }
.hero-mark { display: flex; align-items: center; width: max-content; margin-bottom: 20px; padding: 1px; font-family: var(--font-display); }
.hero-person { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid; border-radius: 50%; font-size: 15px; font-weight: 400; line-height: 1; }
.hero-person-a { padding-right: 4px; border-color: rgb(190 166 244 / .35); color: #bea6f4; background: radial-gradient(circle at 30% 50%, rgb(190 166 244 / .045), transparent 75%); }
.hero-person-b { margin-left: -10px; padding-left: 4px; border-color: rgb(233 188 105 / .35); color: #e9bc69; background: radial-gradient(circle at 70% 50%, rgb(233 188 105 / .035), transparent 75%); }
.eyebrow, .card-kicker { margin: 0; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.page-intro h1 { max-width: 740px; margin: 12px 0 14px; font-family: var(--font-display); font-size: clamp(38px, 5vw, 60px); font-weight: 500; letter-spacing: -.025em; line-height: 1.2; text-wrap: balance; }
.intro { max-width: 680px; margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.85; }

.surface { padding: clamp(24px, 3.5vw, 38px); border: 1px solid var(--line); border-radius: 18px; background: var(--surface-raised); box-shadow: 0 18px 50px rgb(5 11 22 / .14); }
.section-heading { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 7px 0 0; font-size: clamp(22px, 2.6vw, 27px); font-weight: 650; line-height: 1.35; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.field { position: relative; display: flex; flex-direction: column; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { margin-bottom: 7px; font-size: 13px; font-weight: 600; }
.field input, .field select { width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: var(--surface-input); color: var(--text-primary); font-size: 15px; transition: border-color .16s, background .16s, box-shadow .16s; }
.field input:hover, .field select:hover { border-color: #6b7590; }
.field input:focus, .field select:focus { border-color: var(--focus); }
.field input::placeholder { color: var(--text-secondary); }
.field small { margin-top: 6px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
/* Match the homepage's iOS date/time sizing fix, keeping native pickers. */
.field input[type='date'], .field input[type='time'] {
  color-scheme: dark;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  min-height: 48px;
}
.place-options, .saved-profile-options { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: 248px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #1b2536; box-shadow: 0 18px 50px rgb(5 11 22 / .4); }
.place-field .place-options { top: 78px; }
.place-option, .saved-profile-option { display: flex; flex-direction: column; width: 100%; min-height: 44px; padding: 11px 14px; border: 0; border-bottom: 1px solid rgb(148 163 184 / .12); background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; }
.place-option:last-child, .saved-profile-option:last-child { border-bottom: 0; }
.place-option:hover, .place-option[aria-selected='true'], .saved-profile-option:hover, .saved-profile-option[aria-selected='true'] { background: rgb(190 166 244 / .13); }
.saved-profile-option strong { font-size: 13px; font-weight: 650; }
.saved-profile-option small { margin-top: 2px; font-size: 12px; }

.error { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgb(253 164 175 / .5); border-radius: 9px; color: var(--error); font-size: 13px; line-height: 1.55; }
.primary-button, .secondary-button, .text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border-radius: 10px; cursor: pointer; transition: background .16s, border-color .16s, color .16s; }
.primary-button { border: 1px solid var(--action); background: var(--action); color: #fafaff; font-weight: 650; }
.primary-button:hover { border-color: var(--action-hover); background: var(--action-hover); }
.primary-button:active { transform: scale(.99); }
.primary-button:disabled { opacity: .7; cursor: wait; }
#generate-button { width: 100%; min-height: 48px; padding: 12px 28px; font-size: 14px; border-radius: 12px; }
.secondary-button { border: 1px solid var(--line); background: var(--surface-raised); color: var(--text-primary); font-weight: 600; }
.secondary-button:hover { border-color: var(--accent); background: rgb(190 166 244 / .08); }
.text-button { border: 0; background: transparent; color: var(--text-secondary); }
.text-button:hover { color: var(--error); }

.state-panel { padding: 64px 24px; text-align: center; }
.state-panel h2 { margin: 0 0 8px; font-size: 21px; font-weight: 650; }
.state-panel p { max-width: 44ch; margin: 0 auto; color: var(--text-secondary); font-size: 14px; }
.state-panel .primary-button { margin-top: 18px; text-decoration: none; }
.loader { width: 38px; height: 38px; margin: 0 auto 22px; border: 3px solid rgb(190 166 244 / .2); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-section { margin-top: 52px; scroll-margin-top: 94px; }
.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.result-heading h2 { margin: 7px 0 0; font-family: var(--font-display); font-size: clamp(28px, 3.5vw, 40px); font-weight: 500; line-height: 1.25; }
#result-body { padding: 0 34px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-raised); box-shadow: 0 18px 50px rgb(5 11 22 / .12); }
.result-block { margin: 0; padding: 31px 0; border-bottom: 1px solid var(--line); }
.result-block:first-child { margin: 0 -34px; padding: 32px 34px; border-radius: 18px 18px 0 0; background: linear-gradient(120deg, rgb(117 80 201 / .12), transparent 72%); }
.result-block:last-of-type { border-bottom: 0; }
.result-block h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 18px; font-size: 20px; font-weight: 650; line-height: 1.35; }
.result-block h3::before { content: ''; display: block; flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); transform: translateY(-3px); }
.result-block:first-child h3 { font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.result-block p { margin: 0; color: var(--text-primary); font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.insight-item { padding: 20px 0; border-top: 1px solid rgb(148 163 184 / .16); }
.insight-item:first-of-type { padding-top: 0; border-top: 0; }
.insight-item:last-child { padding-bottom: 0; }
.insight-item h4 { margin: 0 0 7px; font-size: 15px; font-weight: 650; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.profile-status { min-height: 22px; margin: 12px 0 0; color: var(--text-secondary); font-size: 12px; }
.profile-status:empty { display: none; }

@media (max-width: 720px) {
  .site-header { height: 56px; padding: 0 18px; }
  .page-shell { width: min(calc(100% - 32px), 620px); padding-bottom: 80px; }
  .page-intro { padding: 38px 0 8px; }
  .page-intro h1 { font-size: clamp(34px, 8.4vw, 48px); }
  .pair-preview { grid-template-columns: 1fr; gap: 8px; margin: 26px 0; }
  .pair-link { height: 17px; font-size: 14px; }
  .person-card { min-height: 94px; padding: 16px 18px; }
  .surface { padding: 22px; }
  .form-grid { gap: 20px; }
  .result-section { margin-top: 44px; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .result-heading { align-items: start; flex-direction: column; gap: 12px; }
  #result-body { padding: 0 20px; }
  .result-block { padding: 25px 0; }
  .result-block:first-child { margin: 0 -20px; padding: 26px 20px; }
  .result-block h3 { font-size: 18px; }
  .result-block:first-child h3 { font-size: 22px; }
  .result-actions > * { flex: 1 1 calc(50% - 5px); }
  .result-actions .text-button { flex-basis: 100%; }
}
@media (max-width: 380px) {
  .person-card { gap: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Equal birth-profile panels: A uses violet, B uses gold. */
.profiles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 28px 0 22px; }
.profile-panel { --person-color: var(--accent); --person-tint: 190 166 244; min-width: 0; margin: 0; padding: 24px 26px 28px; border: 1px solid var(--line); border-top: 2px solid var(--person-color); border-radius: 14px; background: var(--surface-raised); }
.profile-b { --person-color: var(--gold); --person-tint: 233 188 105; }
.profile-panel legend { display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--text-primary); font-size: 19px; font-weight: 600; }

.profile-panel input:focus, .profile-panel select:focus { border-color: var(--person-color); }
.field [aria-invalid='true'] { border-color: var(--error); }
.pair-controls { display: grid; grid-template-columns: minmax(0, 540px) minmax(220px, 280px); justify-content: space-between; align-items: end; gap: 20px 32px; margin-top: 28px; padding: 24px 0 0; border-top: 1px solid rgb(148 163 184 / .18); }
.submit-area { align-self: end; }
.pair-controls .error { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) {
  .profiles-grid { grid-template-columns: 1fr; gap: 22px; }
  .profile-panel { padding: 20px; }

  .pair-controls { grid-template-columns: 1fr; gap: 18px; margin-top: 24px; padding: 20px 0 0; }
}

/* Like the homepage, keep birth date/time on separate rows below 768px. */
@media (max-width: 767px) {
  .profile-panel .form-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .profile-panel .field.full { grid-column: auto; }
}

/* Two quiet orbital fields meet behind the relationship heading. */
.relationship-orbits { position: absolute; z-index: -1; pointer-events: none; inset: 0 -40px 0 38%; overflow: hidden; opacity: .8; mask-image: linear-gradient(90deg, transparent, #000 45%), linear-gradient(#000 65%, transparent); mask-composite: intersect; }
.orbit { position: absolute; width: 390px; height: 290px; border-radius: 50%; transform: rotate(-28deg); }
.orbit-a { top: 14px; left: 0; color: var(--accent); animation: orbit-drift-a 28s ease-in-out infinite; }
.orbit-b { top: 12px; left: 210px; color: var(--gold); transform: rotate(28deg); animation: orbit-drift-b 32s ease-in-out infinite; }
.orbit i { position: absolute; inset: 0; border: 1px solid currentColor; border-radius: 50%; opacity: .2; }
.orbit i:nth-child(2) { inset: 22px; opacity: .12; }
.orbit i:nth-child(3) { inset: 48px; opacity: .08; }
.orbit b { position: absolute; top: 54px; right: 33px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 14px currentColor; opacity: .55; }
.orbit-b b { top: auto; bottom: 46px; right: auto; left: 40px; }
.orbit-meeting { position: absolute; top: 60px; left: 195px; width: 210px; height: 210px; border-radius: 50%; background: radial-gradient(ellipse at 35% 35%, rgb(190 166 244 / .13), transparent 65%), radial-gradient(ellipse at 65% 65%, rgb(233 188 105 / .09), transparent 65%); animation: orbit-breathe 24s ease-in-out infinite; }
@keyframes orbit-drift-a { 0%,100% { transform: translate(0, 0) rotate(-28deg); } 50% { transform: translate(12px, 8px) rotate(-24deg); } }
@keyframes orbit-drift-b { 0%,100% { transform: translate(0, 0) rotate(28deg); } 50% { transform: translate(-10px, -6px) rotate(24deg); } }
@keyframes orbit-breathe { 0%,100% { opacity: .5; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.05); } }
@media (max-width: 760px) {
  .relationship-orbits { inset: 0 -110px 0 12%; opacity: .5; }
  .orbit { width: 290px; height: 250px; animation: none; }
  .orbit-a { left: 0; top: 30px; }
  .orbit-b { left: 145px; top: 35px; }
  .orbit-meeting { left: 100px; top: 70px; width: 170px; height: 170px; animation: none; opacity: .5; }
  .hero-mark { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .orbit, .orbit-meeting { animation: none; }
}

/* Native radio groups styled as the landing page's pill selector. */
.gender-field { margin: 0; padding: 0; border: 0; }
.profile-panel .gender-field > legend { display: block; float: none; width: 100%; margin-bottom: 7px; padding: 0; color: var(--text-primary); font-family: var(--font-ui); font-size: 13px; font-weight: 600; }
.gender-toggle { display: inline-flex; align-self: start; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-input); }
.gender-option { position: relative; margin: 0 !important; cursor: pointer; }
.gender-option input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.gender-label { display: block; min-width: 80px; padding: 8px 24px; border-radius: 999px; color: var(--text-secondary); text-align: center; font-size: 14px; font-weight: 500; line-height: 1.6; transition: color .16s, background .16s; }
.gender-option:hover .gender-label { color: var(--text-primary); }
.gender-option input:checked + .gender-label { background: var(--action); color: #fff; }
.gender-option input:focus-visible + .gender-label { outline: 2px solid var(--focus); outline-offset: 2px; }
.gender-field[aria-invalid='true'] .gender-toggle { border-color: var(--error); }

/* Relationship stage: a quiet four-way choice beneath the birth profiles. */
.stage-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.stage-field legend { margin-bottom: 9px; padding: 0; color: var(--text-secondary); font-size: 12px; font-weight: 500; }
.stage-segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 4px; border: 1px solid rgb(148 163 184 / .22); border-radius: 12px; background: var(--surface-input); }
.stage-option { position: relative; display: flex; min-width: 0; cursor: pointer; }
.stage-option input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.stage-option span { display: grid; place-items: center; width: 100%; min-height: 40px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; color: var(--text-secondary); text-align: center; font-size: 13px; line-height: 1.45; transition: background .16s, color .16s, border-color .16s; }
.stage-option:hover span { color: var(--text-primary); background: rgb(190 166 244 / .04); }
.stage-option input:checked + span { color: #e6dcfa; background: rgb(190 166 244 / .13); border-color: rgb(190 166 244 / .18); font-weight: 600; }
.stage-option input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 760px) {
  .stage-segments { width: 100%; }
  .stage-option span { padding: 7px 5px; min-height: 44px; }
}

/* A reading desk: quiet controls, chapter navigation, generous text measure. */
.report-layout { display: grid; grid-template-columns: 216px minmax(0,1fr); gap: 36px; align-items: start; }
.chapter-nav { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 5px; }
.chapter-link { display: grid; grid-template-columns: 24px 1fr; gap: 2px 10px; padding: 12px 10px; border: 1px solid transparent; text-decoration: none; color: var(--text-secondary); border-radius: 9px; transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease; }
.chapter-number { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .04em; }
.chapter-link-title { font-size: 13px; line-height: 1.5; }
#result-body.report-content { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; min-width: 0; }
.report-overview { padding: 30px 32px; margin-bottom: 22px; border: 1px solid rgb(190 166 244 / .25); border-radius: 16px; background: linear-gradient(120deg,rgb(117 80 201 / .11),rgb(27 37 54 / .55)); scroll-margin-top: 100px; }
.report-overview .eyebrow { margin-bottom: 14px; color: var(--accent); }
.overview-text { margin: 0; font-size: 16px; line-height: 1.95; overflow-wrap: anywhere; }
.pending-text { color: var(--text-secondary); font-size: 13px; margin: 0; }
.report-chapter { margin: 0 0 12px; border: 1px solid rgb(148 163 184 / .23); border-radius: 12px; background: rgb(27 37 54 / .5); scroll-margin-top: 100px; overflow: hidden; }
.chapter-heading { display: grid; grid-template-columns: 26px minmax(0,1fr); gap: 12px; align-items: center; padding: 22px 26px;  }
.chapter-heading h3 { margin: 0; font-weight: 550; font-size: 17px; line-height: 1.5; }
.report-chapter[data-state='waiting'] .chapter-heading { color: var(--text-secondary); }
.chapter-content { padding: 0 32px 30px; }
.chapter-insight { margin: 4px 0 22px; color: var(--gold); font-weight: 500; font-size: 15px; }
.chapter-content > p { margin: 0 0 20px; font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.chapter-question { margin-top: 26px; padding: 16px 20px; border-left: 2px solid var(--accent); background: rgb(190 166 244 / .055); border-radius: 0 8px 8px 0; }
.chapter-question p { margin: 0; font-size: 14px; line-height: 1.8; }
.secondary-button:disabled { opacity: .45; cursor: default; }
@media (max-width: 767px) {
  .report-layout { display: block; }
  .chapter-nav { position: sticky; top: 64px; z-index: 30; display: flex; flex-direction: row; gap: 6px; margin: 0 -24px 28px; padding: 10px 24px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; border-bottom: 1px solid var(--line); background: rgb(17 24 39 / .96); backdrop-filter: blur(14px); }
  .chapter-nav::-webkit-scrollbar { display: none; }
  .chapter-link { display: block; flex: 0 0 auto; min-height: 44px; padding: 10px; text-align: center; scroll-snap-align: start; }
  .chapter-link .chapter-number { display: none; }
  .chapter-link-title { display: block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .report-chapter, .report-overview { scroll-margin-top: 152px; }
}
@media (max-width: 600px) {
  .chapter-nav { top: 56px; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .report-overview { padding: 24px 22px; }
  .chapter-heading { padding: 18px 20px; gap: 8px; }
  .chapter-heading h3 { font-size: 16px; }
  .chapter-content { padding: 0 22px 24px; }
  .overview-text, .chapter-content > p { font-size: 15px; }
}
.result-section { scroll-margin-top: 16px; }
.chapter-link[aria-current='location'] { border-color: var(--accent); background: rgb(190 166 244 / .08); color: var(--text-primary); }
/* Streaming Markdown keeps its own paragraphs without a JSON presentation layer. */
.reading-markdown p { margin: 0 0 20px; font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
.reading-markdown p:last-child { margin-bottom: 0; }
.reading-markdown strong { color: var(--gold); font-weight: 600; }
.reading-markdown h4 { margin: 26px 0 14px; color: var(--gold); font-size: 16px; font-weight: 550; }
.reading-markdown h4:first-child { margin-top: 0; }
.reading-markdown blockquote { margin: 24px 0; padding: 14px 18px; border-left: 2px solid var(--accent); color: var(--text-secondary); background: rgb(190 166 244 / .05); }
.reading-bullet { padding-left: 16px; border-left: 2px solid rgb(190 166 244 / .25); }
.report-chapter[data-state='streaming'] { border-color: rgb(190 166 244 / .45); }

.chapter-link:hover, .chapter-link:focus-visible { color: var(--text-primary); border-color: rgb(190 166 244 / .28); background: rgb(190 166 244 / .08); }
.chapter-link[aria-current='location'] { border-color: rgb(190 166 244 / .35); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .chapter-link { transition: none; } }

.section-retry { margin: 0 32px 24px; }
.report-overview .section-retry { margin: 20px 0 0; }
@media(max-width:600px) { .section-retry { margin-left:22px; margin-right:22px; } }

/* A quiet divider leads from the page introduction into this pair's reading. */
.result-heading { align-items: center; margin-bottom: 18px; padding-top: 28px; border-top: 1px solid rgb(148 163 184 / .18); }
.result-heading .pair-title { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 0; font-size: clamp(24px, 2.8vw, 32px); line-height: 1.5; }
.pair-title-name { display: inline-flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.pair-title-name::before { content: ''; flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.pair-title-b::before { background: var(--gold); }
.pair-title-connection { position: relative; flex: 0 0 34px; width: 34px; height: 24px; }
.pair-title-connection span { position: absolute; top: 2px; left: 0; width: 21px; height: 21px; border: 1px solid rgb(190 166 244 / .45); border-radius: 50%; }
.pair-title-connection span:last-child { left: 12px; border-color: rgb(233 188 105 / .45); }
@media (max-width:600px) {
  .result-heading { padding-top: 22px; }
  .result-heading .pair-title { gap: 10px; }
  .pair-title-name { gap: 7px; }
}

.reading-wait { display: flex; align-items: center; gap: 12px; min-height: 38px; }
.reading-wait .pending-text { margin: 0; font-size: 13px; }
.reading-spinner { flex: 0 0 22px; width: 22px; height: 22px; border: 2px solid rgb(190 166 244 / .2); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .reading-spinner { animation: none; } }

/* Align the closing action with the reading column, away from chapter navigation. */
.result-actions { margin: 28px 0 0 252px; padding-top: 0; justify-content: flex-end; }
.result-actions .reread-button { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 11px 20px; border: 1px solid rgb(190 166 244 / .3); border-radius: 999px; background: rgb(190 166 244 / .06); color: var(--accent); font-size: 14px; font-weight: 550; transition: background-color 160ms ease, border-color 160ms ease; }
.reread-button svg { flex-shrink: 0; }
.result-actions .reread-button:hover:not(:disabled) { background: rgb(190 166 244 / .13); border-color: rgb(190 166 244 / .55); }
.result-actions .reread-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 767px) {
  .result-actions { margin-left: 0; justify-content: center; padding-top: 0; }
  .result-actions .reread-button { flex: 0 1 100%; max-width: 320px; min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .result-actions .reread-button { transition: none; } }

.report-chapter .section-error { margin: 0 32px 16px; }
.report-overview .section-error { margin: 20px 0 0; }
@media (max-width: 600px) { .report-chapter .section-error { margin-left: 22px; margin-right: 22px; } }


@media (max-width: 767px) { .brand-name { display: inline; font-size: 11px; } .header-context { gap: 7px; font-size: 11px; } }

/* Keep mobile form focus from triggering an automatic page zoom. */
@media (max-width: 767px) {
  .field input, .field select, .profile-panel input { font-size: 16px; }
}
