:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #edf3fb;
  --ink: #112c47;
  --muted: #668099;
  --line: #d9e3ee;
  --blue: #3268f4;
  --blue-pressed: #2755c9;
  --blue-soft: #e9efff;
  --mint: #32c6a2;
  --mint-soft: #e9f8f3;
  --coral: #ff7467;
  --coral-soft: #fff0ed;
  --amber: #c98926;
  --amber-soft: #fcf4e4;
  --navy: #112f4c;
  --navy-soft: #1d4265;
  --shadow: 0 16px 42px rgba(27, 58, 91, .10);
  --button-shadow: 0 10px 22px rgba(50, 104, 244, .24);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  color-scheme: light;
}

:root[data-theme="night"] {
  --bg: #0c1725;
  --surface: #142437;
  --surface-soft: #1a3047;
  --ink: #f2f7fc;
  --muted: #b3c4d6;
  --line: #294057;
  --blue: #7d9dff;
  --blue-pressed: #9db3ff;
  --blue-soft: #1d3560;
  --mint: #67d9bd;
  --mint-soft: #143e3b;
  --coral: #ff9a90;
  --coral-soft: #4b2930;
  --amber: #f1ba60;
  --amber-soft: #43331c;
  --navy: #0b1a2a;
  --navy-soft: #193954;
  --shadow: 0 18px 42px rgba(0, 0, 0, .28);
  --button-shadow: 0 10px 22px rgba(0, 0, 0, .26);
  color-scheme: dark;
}

:root[data-period="dawn"] { --blue: #4e7ee9; --blue-soft: #e9effe; }
:root[data-period="dusk"] { --blue: #a15f3c; --blue-soft: #f9eee7; }
:root[data-period="night"] { --blue: #7d9dff; --blue-soft: #1d3560; }

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100dvh; background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 56%, transparent); outline-offset: 3px; }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: absolute; left: 16px; top: -52px; z-index: 1000; background: var(--surface); color: var(--ink); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); transition: top .2s ease; }
.skip-link:focus { top: 16px; }
.app-shell { width: min(100%, 720px); min-height: 100dvh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 20px calc(92px + var(--safe-bottom)); position: relative; overflow: hidden; }
.app-shell::before { content: ""; position: absolute; width: 280px; height: 280px; right: -190px; top: -104px; border-radius: 50%; background: var(--blue-soft); opacity: .72; pointer-events: none; transition: background .7s ease; }
.topbar { height: 54px; display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: -.02em; color: var(--ink); }
.brand-mark { width: 29px; height: 29px; display: inline-grid; place-items: center; border-radius: 10px; background: var(--navy); color: white; font-size: 14px; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.doctor-name { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 650; }
.chapter-context { position: relative; z-index: 1; width: 100%; min-height: 58px; margin-top: 5px; padding: 9px 13px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "route arrow" "destination arrow"; gap: 2px 10px; text-align: left; color: var(--ink); background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 5px 15px rgba(27, 58, 91, .04); transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.chapter-context:active, .record-context:active, .review-context:active { transform: scale(.988); background: var(--surface-soft); }
.context-route { grid-area: route; color: var(--muted); font-size: 11px; font-weight: 700; }
.context-destination { grid-area: destination; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue); font-size: 14px; font-weight: 760; }
.context-arrow { grid-area: arrow; align-self: center; color: var(--muted); font-size: 25px; }
.book-progress { margin: 12px 0 2px; padding: 10px 13px 11px; border: 1px solid color-mix(in srgb, var(--blue) 17%, var(--line)); border-radius: 16px; background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 4px 12px rgba(27, 58, 91, .035); }
.book-progress > div:first-child { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.book-progress strong { color: var(--blue); font-size: 13px; }
.book-progress span { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.book-progress-track, .chapter-progress-track { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.book-progress-track i, .chapter-progress-track i { width: var(--book-progress, var(--chapter-progress)); height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--blue), color-mix(in srgb, var(--mint) 70%, var(--blue))); transition: width .35s ease; }
.time-mode { color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); border-radius: 15px; transition: background .2s ease, color .2s ease, transform .2s ease; }
.icon-button:active { transform: scale(.96); background: var(--surface-soft); }
.main-content { position: relative; z-index: 1; }
.doctor-view { padding-top: 31px; animation: view-enter .26s ease-out both; }
.doctor-view.hidden { display: none; }
.eyebrow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eyebrow { margin: 0; color: var(--blue); font-weight: 750; font-size: 13px; letter-spacing: .02em; }
.status-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; gap: 6px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.status-safe { background: var(--mint-soft); color: color-mix(in srgb, var(--mint) 72%, var(--ink)); }
.review-chip { background: var(--amber-soft); color: var(--amber); }
.dark-chip { background: rgba(112, 152, 191, .24); color: #d8e8f6; }
.dot { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
h1, h2, p { margin-top: 0; }
h1 { margin: 18px 0 10px; font-size: clamp(31px, 9vw, 44px); line-height: 1.15; letter-spacing: -.055em; font-weight: 780; color: var(--ink); }
h2 { letter-spacing: -.035em; }
.lead { margin-bottom: 26px; max-width: 33ch; font-size: 17px; line-height: 1.7; color: var(--muted); }
.workflow-rail { margin: 0 0 17px; padding: 13px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.workflow-rail article { min-height: 72px; padding: 8px; display: grid; align-content: space-between; border-radius: 14px; color: var(--muted); background: var(--surface-soft); }
.workflow-rail article.is-current { color: white; background: var(--blue); }
.workflow-rail span { font-size: 11px; font-weight: 800; opacity: .9; }
.workflow-rail strong { font-size: 12px; line-height: 1.25; }
.workflow-rail small { font-size: 10px; }
.outline-brief { margin-bottom: 13px; padding: 17px; border-radius: var(--radius-lg); background: var(--blue-soft); }
.outline-brief > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.outline-brief strong { color: var(--blue); font-size: 16px; }
.outline-brief p { margin: 10px 0 0; color: var(--ink); font-size: 14px; line-height: 1.55; }
.outline-list { display: grid; gap: 10px; }
.outline-part { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.outline-part > header { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.outline-part > header strong { font-size: 14px; }
.outline-part > header span { color: var(--muted); font-size: 12px; }
.outline-chapter { width: 100%; min-height: 63px; padding: 11px 16px; display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: center; text-align: left; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); transition: background .18s ease; }
.outline-chapter:last-child { border-bottom: 0; }
.outline-chapter:active { background: var(--surface-soft); }
.outline-chapter > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 11px; font-weight: 800; }
.outline-chapter strong, .outline-chapter small { display: block; }
.outline-chapter strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.outline-chapter small { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.outline-chapter b { color: var(--amber); font-size: 11px; }
.outline-chapter.is-ready b { color: var(--mint); }
.chapter-stage-locked { padding: 22px; border: 1px dashed var(--line); border-radius: var(--radius-lg); background: var(--surface-soft); }
.chapter-stage-locked strong { font-size: 18px; }
.chapter-stage-locked p { color: var(--muted); line-height: 1.6; }
.chapter-stage-locked button { min-height: 44px; border: 0; background: transparent; color: var(--blue); font-weight: 750; padding: 0; }
.chapter-workspace { display: grid; gap: 12px; }
.chapter-progress-card { padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(27, 58, 91, .04); }
.chapter-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chapter-progress-heading span { color: var(--muted); font-size: 13px; font-weight: 720; }
.chapter-progress-heading strong { color: var(--blue); font-size: 24px; letter-spacing: -.04em; }
.chapter-progress-card > p { margin: 12px 0 11px; color: var(--ink); font-size: 13px; line-height: 1.5; }
.chapter-milestones { margin: 0; padding: 0; display: grid; gap: 7px; list-style: none; }
.chapter-milestones li { min-height: 37px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 11px; color: var(--muted); background: var(--surface-soft); font-size: 12px; line-height: 1.35; }
.chapter-milestones li.is-done { color: color-mix(in srgb, var(--mint) 70%, var(--ink)); background: var(--mint-soft); }
.chapter-milestones li span:last-child { font-weight: 760; white-space: nowrap; }
.chapter-progress-card .save-draft-button, .chapter-progress-card .voice-edit-button { font-size: 13px; }
.chapter-task { padding: 17px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.chapter-task span { color: var(--muted); font-size: 12px; font-weight: 720; }
.chapter-task p { margin: 8px 0 0; color: var(--ink); font-size: 15px; line-height: 1.6; }
.question-card { padding: 24px; border-radius: var(--radius-xl); color: white; background: linear-gradient(145deg, var(--blue), color-mix(in srgb, var(--blue) 72%, #173c91)); box-shadow: var(--button-shadow); }
.question-meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 13px; color: rgba(255,255,255,.82); }
.question-label { padding: 7px 10px; border-radius: 99px; background: rgba(255,255,255,.16); font-weight: 650; }
.question-card h2 { margin: 24px 0 10px; color: white; font-size: clamp(24px, 6.8vw, 32px); line-height: 1.28; }
.question-card p { margin-bottom: 22px; color: rgba(255,255,255,.82); line-height: 1.6; font-size: 15px; }
.primary-button { width: 100%; min-height: 54px; border: 0; border-radius: 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 20px; background: white; color: var(--blue); font-weight: 760; font-size: 16px; transition: transform .18s ease, filter .18s ease, box-shadow .18s ease; }
.primary-button:active { transform: scale(.98); filter: brightness(.96); }
.progress-panel { margin: 18px 0; padding: 19px; border-radius: var(--radius-lg); display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: center; background: var(--surface); box-shadow: var(--shadow); }
.progress-panel > div { min-width: 0; display: grid; gap: 3px; }
.metric { font-size: 31px; line-height: 1; color: var(--mint); font-weight: 780; letter-spacing: -.04em; }
.metric.coral { color: var(--coral); }
.metric.amber-text { color: var(--amber); }
.metric-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.inline-action { min-width: 44px; min-height: 44px; padding: 6px; border: 0; color: var(--blue); background: transparent; font-size: 13px; font-weight: 720; }
.secondary-actions { display: grid; gap: 12px; }
.action-card { width: 100%; min-height: 80px; padding: 15px 16px; display: grid; grid-template-columns: 48px 1fr 24px; align-items: center; gap: 13px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: 0 8px 22px rgba(27, 58, 91, .045); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.action-card:active { transform: scale(.987); background: var(--surface-soft); }
.action-card strong, .action-card small { display: block; }
.action-card strong { margin-bottom: 4px; font-size: 16px; }
.action-card small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.action-card > span:last-child { text-align: right; font-size: 26px; color: var(--muted); }
.action-icon { height: 46px; width: 46px; display: grid; place-items: center; border-radius: 16px; }
.action-icon.mint { color: var(--mint); background: var(--mint-soft); }
.action-icon.amber { color: var(--amber); background: var(--amber-soft); }
.back-button { min-height: 44px; padding: 7px 0; border: 0; background: transparent; color: var(--blue); font-size: 14px; font-weight: 720; }
.record-stage { margin-top: 14px; min-height: 510px; padding: 16px 20px; border-radius: 32px; display: flex; flex-direction: column; justify-content: flex-start; gap: 10px; color: white; background: var(--navy); box-shadow: var(--shadow); }
.app-shell:has(.doctor-view[data-view="record"]:not(.hidden)) .chapter-context, .app-shell:has(.doctor-view[data-view="home"]:not(.hidden)) .chapter-context, .app-shell:has(.doctor-view[data-view="editor"]:not(.hidden)) .chapter-context { display: none; }
.record-context { width: 100%; min-height: 48px; margin-top: 13px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "route arrow" "title arrow"; gap: 2px 10px; text-align: left; border: 1px solid rgba(196, 214, 231, .22); border-radius: 15px; color: white; background: rgba(255,255,255,.08); transition: background .18s ease, transform .18s ease; }
.record-context span:first-child { grid-area: route; color: #c4d6e7; font-size: 11px; font-weight: 700; }
.record-context strong { grid-area: title; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.record-context span:last-child { grid-area: arrow; align-self: center; color: #c4d6e7; font-size: 24px; }
.record-kicker { color: #c4d6e7; font-size: 13px; margin: 14px 0 6px; }
.record-stage h1 { margin-bottom: 0; color: white; font-size: 26px; letter-spacing: -.04em; }
.logic-lane { margin-top: 8px; padding: 11px; border-radius: 17px; }
.logic-lane > p { margin: 0 0 7px; font-size: 12px; font-weight: 720; }
.logic-lane ol { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; list-style: none; }
.logic-lane li { min-height: 42px; padding: 5px; border-radius: 12px; font-size: 10px; line-height: 1.25; font-weight: 650; }
.logic-lane li span { display: block; margin-bottom: 3px; font-size: 10px; font-weight: 790; }
.logic-lane-dark { background: rgba(255,255,255,.08); }
.logic-lane-dark > p { color: #c4d6e7; }
.logic-lane-dark li { color: #eaf2fb; background: rgba(255,255,255,.06); }
.logic-lane-dark li:first-child { color: white; background: rgba(125, 157, 255, .26); }
.logic-lane-light { margin: 15px 0; background: var(--surface-soft); }
.logic-lane-light > p { color: var(--blue); }
.logic-lane-light li { color: var(--ink); background: var(--surface); box-shadow: 0 2px 8px rgba(27, 58, 91, .05); }
.logic-lane-light li:first-child { color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 24%, transparent); }
.recording-visual { flex: none; display: grid; align-content: center; gap: 8px; text-align: center; }
.record-timer { color: white; font-size: 44px; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; font-weight: 680; }
.waveform { height: 42px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.waveform i { width: 4px; height: 18px; display: inline-block; border-radius: 10px; background: #9eb6ff; transform-origin: center; opacity: .65; }
.is-recording .waveform i { opacity: 1; animation: wave 680ms ease-in-out infinite alternate; }
.is-recording .waveform i:nth-child(2n) { animation-delay: 80ms; } .is-recording .waveform i:nth-child(3n) { animation-delay: 150ms; } .is-recording .waveform i:nth-child(4n) { animation-delay: 230ms; }
.recording-visual p { display: none; }
.record-button { align-self: center; min-width: 118px; min-height: 118px; display: grid; place-content: center; gap: 7px; border: 0; border-radius: 999px; color: white; background: var(--coral); box-shadow: 0 10px 0 color-mix(in srgb, var(--coral) 70%, #812e30); font-weight: 750; transition: transform .18s ease, background .18s ease; }
.record-button:active { transform: translateY(5px); box-shadow: 0 7px 0 color-mix(in srgb, var(--coral) 70%, #812e30); }
.record-button.is-recording { background: #f25356; }
.record-ring { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; }
.record-ring svg { width: 28px; height: 28px; }
.safe-save { min-height: 58px; padding: 12px 13px; display: flex; align-items: center; gap: 10px; border-radius: 17px; background: var(--navy-soft); color: #d0deeb; font-size: 12px; line-height: 1.45; }
.safe-save svg { min-width: 21px; }
.transcript-preview { margin-top: 16px; padding: 16px; border-radius: 18px; background: var(--surface); color: var(--muted); line-height: 1.6; box-shadow: var(--shadow); }
.review-card { padding: 18px; border-radius: var(--radius-lg); margin-top: 14px; }
.source-card { background: var(--surface); border: 1px solid var(--line); }
.draft-card { background: var(--blue-soft); }
.card-label { margin-bottom: 9px; color: var(--muted); font-size: 13px; font-weight: 720; }
.draft-card .card-label { color: var(--blue); }
textarea { width: 100%; resize: vertical; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 16px; line-height: 1.65; }
textarea::placeholder { color: var(--muted); opacity: .82; }
.review-controls { margin: 15px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.choice-button { min-height: 46px; padding: 6px 5px; border: 1px solid transparent; border-radius: 14px; background: var(--surface); color: var(--blue); box-shadow: 0 3px 12px rgba(28, 61, 95, .06); font-size: 13px; font-weight: 720; transition: transform .18s ease, background .18s ease; }
.choice-button:active { transform: scale(.96); }
.choice-button.approve { background: var(--mint-soft); color: color-mix(in srgb, var(--mint) 72%, var(--ink)); }
.choice-button.danger { background: var(--coral-soft); color: var(--coral); }
.choice-button.amber-outline { background: var(--amber-soft); color: var(--amber); }
.voice-edit-button { width: 100%; min-height: 54px; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 17px; background: var(--blue); color: white; font-weight: 750; box-shadow: var(--button-shadow); }
.voice-edit-button:active { background: var(--blue-pressed); }
.save-draft-button { width: 100%; min-height: 50px; margin-top: 10px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--ink); font-weight: 740; }
.save-draft-button:active { background: var(--surface-soft); }
.voice-edit-button:disabled, .save-draft-button:disabled { cursor: not-allowed; opacity: .46; box-shadow: none; }
.ai-assist-button { width: 100%; min-height: 68px; margin: 12px 0 0; padding: 12px 14px; display: grid; grid-template-columns: 28px 1fr; grid-template-areas: "mark copy" "mark note"; column-gap: 9px; text-align: left; border: 1px solid color-mix(in srgb, var(--blue) 23%, var(--line)); border-radius: 18px; color: var(--ink); background: linear-gradient(135deg, color-mix(in srgb, var(--blue-soft) 72%, var(--surface)), var(--surface)); box-shadow: 0 7px 20px rgba(27, 58, 91, .045); }
.ai-assist-button > span:first-child { grid-area: mark; width: 26px; height: 26px; display: grid; place-items: center; align-self: center; border-radius: 9px; color: white; background: linear-gradient(135deg, var(--blue), #7d9dff); font-size: 15px; }
.ai-assist-button > span:nth-child(2) { grid-area: copy; font-size: 14px; font-weight: 760; }
.ai-assist-button small { grid-area: note; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.ai-assist-button:disabled { cursor: not-allowed; opacity: .55; }
.ai-sheet { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; width: min(100%, 720px); max-height: min(88dvh, 800px); margin-inline: auto; padding: 27px 24px calc(27px + var(--safe-bottom)); overflow-y: auto; border-radius: 32px 32px 0 0; color: var(--ink); background: var(--surface); box-shadow: 0 -20px 60px rgba(0, 0, 0, .22); animation: sheet-enter .28s ease-out both; }
.ai-sheet h2 { margin: 13px 0 8px; padding-right: 42px; font-size: 29px; line-height: 1.25; letter-spacing: -.05em; }
.ai-suggestions { margin: 17px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ai-suggestions button { min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 720; text-align: left; }
.ai-question-label { display: block; margin: 14px 0 7px; color: var(--ink); font-size: 13px; font-weight: 760; }
.ai-sheet textarea { min-height: 96px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-soft); font-size: 15px; }
.ai-privacy { margin: 10px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.ai-answer { margin-top: 16px; padding: 15px; border-radius: 17px; background: var(--blue-soft); line-height: 1.65; }
.ai-answer > span { display: block; margin-bottom: 8px; color: var(--blue); font-size: 12px; font-weight: 760; }
.ai-answer-copy { white-space: pre-wrap; font-size: 14px; }
.review-context { width: 100%; min-height: 73px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label arrow" "title arrow" "section arrow"; gap: 2px 8px; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 5px 15px rgba(27, 58, 91, .04); transition: background .18s ease, transform .18s ease; }
.review-context > span:first-child { grid-area: label; color: var(--muted); font-size: 11px; font-weight: 700; }
.review-context strong { grid-area: title; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.review-context small { grid-area: section; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue); font-size: 12px; font-weight: 700; }
.review-context > span:last-child { grid-area: arrow; align-self: center; color: var(--muted); font-size: 25px; }
#recorded-audio { width: 100%; margin-top: 16px; }
.editor-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0 14px; }
.editor-overview article { min-height: 94px; padding: 16px; border-radius: 19px; display: grid; align-content: center; gap: 7px; background: var(--surface); box-shadow: var(--shadow); }
.editor-overview article span:last-child { color: var(--muted); font-size: 12px; }
.chapter-list { padding: 8px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.chapter-list article { padding: 18px 0; border-bottom: 1px solid var(--line); }
.chapter-list article:last-child { border-bottom: 0; }
.chapter-list .empty-entry { color: var(--muted); }
.chapter-heading { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; }
.chapter-heading span { color: var(--muted); font-size: 12px; }
.chapter-heading strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapter-heading b { font-size: 12px; color: var(--blue); }
.progress { height: 8px; margin: 11px 0 0 38px; overflow: hidden; border-radius: 9px; background: var(--surface-soft); }
.progress i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--blue); }
.mint-progress i { background: var(--mint); } .coral-progress i { background: var(--coral); } .amber-progress i { background: var(--amber); }
.recommendation-card { margin-top: 15px; padding: 20px; border-radius: var(--radius-lg); display: grid; gap: 7px; background: var(--blue-soft); }
.recommendation-card span { color: var(--blue); font-size: 13px; font-weight: 720; }
.recommendation-card strong { font-size: 17px; }
.recommendation-card button { justify-self: start; min-height: 44px; margin-top: 5px; border: 0; color: var(--blue); background: transparent; padding: 0; font-weight: 750; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 720px); min-height: calc(72px + var(--safe-bottom)); padding: 8px 15px var(--safe-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--surface) 93%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
.nav-item { min-height: 55px; display: grid; place-content: center; gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; }
.nav-item svg { width: 20px; height: 20px; margin: 0 auto; }
.nav-item.is-active { color: var(--blue); }
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(8, 20, 34, .54); backdrop-filter: blur(3px); }
.case-sheet { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; width: min(100%, 720px); max-height: min(83dvh, 760px); margin-inline: auto; padding: 27px 24px calc(27px + var(--safe-bottom)); overflow-y: auto; border-radius: 32px 32px 0 0; color: var(--ink); background: var(--surface); box-shadow: 0 -20px 60px rgba(0, 0, 0, .22); animation: sheet-enter .28s ease-out both; }
.chapter-sheet { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; width: min(100%, 720px); max-height: min(84dvh, 780px); margin-inline: auto; padding: 27px 24px calc(27px + var(--safe-bottom)); overflow-y: auto; border-radius: 32px 32px 0 0; color: var(--ink); background: var(--surface); box-shadow: 0 -20px 60px rgba(0, 0, 0, .22); animation: sheet-enter .28s ease-out both; }
.sheet-close { position: absolute; top: 14px; right: 17px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--muted); background: var(--surface-soft); font-size: 28px; }
.case-sheet h2 { margin: 13px 0 22px; font-size: 29px; line-height: 1.25; letter-spacing: -.05em; }
.chapter-sheet h2 { margin: 13px 0 8px; padding-right: 42px; font-size: 29px; line-height: 1.25; letter-spacing: -.05em; }
.sheet-lead { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.chapter-options { display: grid; gap: 10px; }
.chapter-option { width: 100%; min-height: 84px; padding: 13px; display: grid; grid-template-columns: 35px 1fr auto; gap: 10px; align-items: center; text-align: left; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.chapter-option:active { transform: scale(.988); background: var(--surface-soft); }
.chapter-option.is-selected { border-color: var(--blue); background: var(--blue-soft); }
.chapter-option > span { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: var(--blue-soft); font-size: 12px; font-weight: 800; }
.chapter-option.is-selected > span { color: white; background: var(--blue); }
.chapter-option strong, .chapter-option small { display: block; }
.chapter-option strong { margin-bottom: 3px; font-size: 15px; }
.chapter-option small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.chapter-option > b { color: var(--blue); font-size: 19px; }
.case-steps { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 15px; }
.case-steps li { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: start; }
.case-steps li > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--blue); font-weight: 750; }
.case-steps li:last-child > span { background: var(--mint); }
.case-steps strong { display: block; margin-bottom: 4px; font-size: 17px; }
.case-steps p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: calc(88px + var(--safe-bottom)); width: min(calc(100% - 40px), 440px); padding: 14px 18px; border-radius: 16px; transform: translateX(-50%); color: white; background: var(--navy); box-shadow: var(--shadow); font-size: 14px; line-height: 1.45; }
@keyframes wave { from { transform: scaleY(.45); } to { transform: scaleY(2.2); } }
@keyframes view-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheet-enter { from { transform: translateY(36px); opacity: .8; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 800px) { .app-shell { padding-inline: 40px; } .question-card { padding: 31px; } .bottom-nav { border-radius: 22px 22px 0 0; } }
@media (max-height: 850px) { .record-stage .safe-save { display: none; } }
@media (max-width: 560px) {
  .logic-lane ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .logic-lane li { min-height: 68px; padding: 10px; font-size: 14px; line-height: 1.36; }
  .logic-lane li span { margin-bottom: 5px; font-size: 12px; }
}
@media (max-width: 370px) { .app-shell { padding-inline: 16px; } .time-mode, .doctor-name { display: none; } .question-card { padding: 20px; } .review-controls { grid-template-columns: repeat(2, 1fr); } .logic-lane ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
