:root {
  color-scheme: light;
  --bg: #f6f4f0;
  --surface: #fffcf8;
  --surface-2: #f3f0ea;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --muted: #57534e;
  --faint: #6f6862;
  --line: #e7e2d9;
  --line-strong: #d6d0c6;
  --accent: #8a4b24;
  --accent-soft: #f6eee6;
  --warn-bg: #fbf6ee;
  --warn-line: #eadfce;
  --warn-ink: #7c4a1e;
  --code: #f3f0ea;
  --code-ink: #1c1917;
  --shadow: 0 30px 70px rgba(28, 25, 23, 0.12);
  --header: rgba(246, 244, 240, 0.9);
  --max: 1120px;
  --sans: Inter, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Mono", "WenQuanYi Micro Hei Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101011;
  --surface: #18181b;
  --surface-2: #222226;
  --ink: #f5f4f1;
  --ink-soft: #d6d3d1;
  --muted: #a8a29e;
  --faint: #b5b0aa;
  --line: #2e2e33;
  --line-strong: #45454d;
  --accent: #e4c48a;
  --accent-soft: #2a241c;
  --warn-bg: #1c1814;
  --warn-line: #3d3428;
  --warn-ink: #e4c48a;
  --code: #101012;
  --code-ink: #e7e5e4;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --header: rgba(16, 16, 17, 0.88);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
::selection { background: var(--accent-soft); color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 80;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip:focus { top: 12px; }
.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;
}
.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}
section[id] { scroll-margin-top: 88px; }

.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.topbar {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.15;
  min-width: 0;
}
.brand-symbol {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 650;
  flex: none;
}
.brand b { display: block; font-size: 14px; font-weight: 640; letter-spacing: -0.02em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.primary-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.primary-nav a {
  color: var(--muted);
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 999px;
}
.primary-nav a:hover { color: var(--ink); background: var(--surface-2); }
.top-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.theme-toggle {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .label::after { content: "深色"; }
[data-theme="dark"] .theme-toggle .label::after { content: "浅色"; }
.author-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.author-mark:hover { border-color: var(--line-strong); }
.seal {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-family: Georgia, "Iowan Old Style", "Songti SC", "Noto Serif SC", serif;
  font-size: 12px;
  line-height: 1;
}
.author-mark-name { font-size: 12px; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 56px;
  align-items: center;
  padding: 72px 0 56px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}
.tiny-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.hero h1 {
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.22;
  letter-spacing: -0.03em;
  font-weight: 620;
  max-width: 11em;
  margin: 0 0 16px;
  text-wrap: balance;
}
.hero-sub {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-desc {
  margin: 0 0 28px;
  max-width: 38em;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.trust-line {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 40em;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.btn svg { flex: none; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-soft); }
[data-theme="dark"] .btn-primary:hover { background: #fff; color: #171614; }
.btn-star, .btn-ghost, .btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-star:hover, .btn-ghost:hover, .btn-outline:hover { background: var(--surface); border-color: var(--ink); }
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 22px 18px;
}
.hero-panel-kicker {
  margin: 16px 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.hero-panel ol { list-style: none; margin: 0; padding: 0; }
.hero-panel li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 4px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.hero-panel li span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.hero-panel strong { display: block; font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
.hero-panel small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.hero-panel-foot {
  margin: 4px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}
.stats > div { padding: 0 28px; border-right: 1px solid var(--line); }
.stats > div:first-child { padding-left: 0; }
.stats > div:last-child { border-right: 0; padding-right: 0; }
.stats strong {
  display: block;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stats span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }

.notice-band, .billing-update, .first-step { margin-top: 28px; }
.notice-band {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}
.notice-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-style: italic;
  font-family: Georgia, serif;
  color: var(--ink);
  flex: none;
  margin-top: 2px;
}
.notice-band p { margin: 0; font-size: 14px; line-height: 1.7; }
.notice-band strong { color: var(--ink); }
.notice-band a, .first-step-foot a, .safety-sources a, .sources-note a, .diagnose-links a, .first-step-result a, .preflight-score a, .faq-item > a, .dialog-actions a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.billing-update {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--warn-line);
  border-radius: 12px;
  background: var(--warn-bg);
}
.billing-label {
  flex: none;
  max-width: 9em;
  color: var(--warn-ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}
.billing-update > div { flex: 1; min-width: 0; }
.billing-update strong { display: block; font-size: 15px; font-weight: 620; }
.billing-update p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.billing-update > a {
  flex: none;
  color: var(--warn-ink);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--warn-line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
}

.first-step {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 28px;
}
.first-step-heading, .section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.section-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.first-step-heading h2, .section-heading h2, .final-contact h2, .contact-banner h3 {
  font-weight: 620;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.first-step-heading h2 { font-size: clamp(28px, 3vw, 36px); margin: 0 0 8px; }
.first-step-heading p, .section-heading p { margin: 0; color: var(--muted); font-size: 15px; max-width: 40em; }
.first-step-heading > a { color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.first-step-layout { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 16px; margin-top: 24px; }
.first-step-panel, .first-step-result, .diagnose-picker, .diagnose-steps, .preflight-score {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  padding: 20px;
}
.first-step-panel label, .diagnose-picker > label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
select {
  appearance: none;
  width: auto;
  max-width: 100%;
  height: 44px;
  padding: 0 36px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background-color: var(--surface);
  color: var(--ink);
  font-size: 14px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2357534e' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23a8a29e' stroke-width='1.4' stroke-linecap='round'/></svg>");
}
.first-step-panel select, .diagnose-picker select { width: 100%; }
.plan-footnote, .first-step-foot { color: var(--muted); font-size: 13px; }
.plan-footnote { margin: 10px 0 0; }
.plan-result-eyebrow, .preflight-kicker, .modal-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.first-step-result h3 { font-size: 22px; letter-spacing: -0.02em; margin: 8px 0 8px; }
.first-step-result p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }
.first-step-foot { margin-top: 14px; }
.no-js-guide p {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.no-js-guide a { color: var(--accent); text-decoration: underline; }

.section { padding-top: 88px; }
.section-heading { margin-bottom: 28px; }
.section-heading h2 { font-size: clamp(28px, 3.2vw, 40px); margin: 0 0 8px; }
.meta { color: var(--faint); font-size: 13px; white-space: nowrap; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 240px);
  flex: 1;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}
.search-wrap > span[aria-hidden="true"] { color: var(--faint); font-size: 16px; line-height: 1; }
.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  min-width: 0;
}
.search-wrap input::placeholder { color: var(--faint); }
.checkbox-small, .task-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.checkbox-small input, .task-check input, .preflight-check input, .lesson-card-bottom input { accent-color: var(--accent); width: 15px; height: 15px; }
.btn-plain {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 4px;
}
.btn-plain:hover { color: var(--ink); }
.result-count { color: var(--faint); font-size: 13px; margin: 12px 0 16px; }

.lesson-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.lesson-aside {
  position: sticky;
  top: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.lesson-aside > p { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.lesson-nav { display: flex; flex-direction: column; gap: 2px; }
.lesson-nav button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 13px;
}
.lesson-nav button:hover, .lesson-nav button.current { background: var(--surface-2); color: var(--ink); }
.progress-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.progress-box > span, .progress-box strong { font-size: 13px; }
.progress-box small { color: var(--faint); font-size: 12px; }
.progress-track { width: 100%; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-track > div { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.lesson-cards, .prompt-grid, .roadmap-grid, .safety-grid, .sources-grid { display: grid; gap: 12px; }
.lesson-cards, .roadmap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prompt-grid, .sources-grid, .safety-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lesson-card, .prompt-card, .day-card, .safety-card, .source-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color .16s ease, background-color .16s ease;
}
.lesson-card, .prompt-card { padding: 18px 18px 14px; display: flex; flex-direction: column; min-width: 0; }
.lesson-card:hover, .prompt-card:hover, .source-card:hover, .day-card:hover { border-color: var(--line-strong); }
.lesson-card-top, .prompt-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--faint);
  font-size: 12px;
}
.lesson-card-top span:first-child, .prompt-card-head span:first-child { color: var(--accent); font-weight: 650; }
.lesson-card h3, .prompt-card h3 { font-size: 18px; line-height: 1.4; letter-spacing: -0.02em; font-weight: 620; margin: 14px 0 8px; }
.lesson-card p, .prompt-card p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0 0 12px; }
.lesson-card p { flex: 1; }
.evidence-line { display: block; color: var(--muted); font-size: 12px; margin: 0 0 14px; }
.lesson-card-bottom, .prompt-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.lesson-card-bottom button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}
.lesson-card-bottom button:hover { color: var(--accent); }
.lesson-card-bottom label { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.lesson-card.complete { background: var(--surface-2); }
.lesson-card.complete h3::after { content: "  ✓"; color: var(--accent); font-size: 14px; }

.contact-banner {
  margin-top: 56px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.contact-banner h3 { font-size: 28px; margin: 0 0 8px; }
.contact-banner p { margin: 0; color: var(--muted); font-size: 14px; }
.contact-banner-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; flex: none; }
.contact-banner-actions > a { color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-chips button {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
}
.filter-chips button:hover { color: var(--ink); border-color: var(--ink); }
.filter-chips button.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.favorite-btn { border: 0; background: transparent; color: var(--faint); font-size: 16px; line-height: 1; padding: 0; }
.favorite-btn.active { color: var(--accent); }
.prompt-card p { flex: 1; }
.prompt-preview, .prompt-card pre, .dialog-container pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--code-ink);
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.prompt-preview { margin: 0 0 14px; min-height: 0; }
.prompt-card-foot button {
  border: 0;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 650;
}
.prompt-card-foot .expand { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.prompt-card-foot .expand:hover { border-color: var(--ink); }
.prompt-card details { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.prompt-card details summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.prompt-card pre { margin: 12px 0; }
.prompt-card dl { margin: 0; }
.prompt-card dt { margin-top: 10px; color: var(--accent); font-size: 12px; font-weight: 650; }
.prompt-card dd { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.roadmap-grid { margin-top: 4px; }
.day-card { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.day-tag { color: var(--accent); font-size: 13px; font-weight: 650; min-width: 52px; font-variant-numeric: tabular-nums; }
.day-card h3 { font-size: 15px; margin: 0 0 4px; letter-spacing: -0.01em; }
.day-card p { margin: 0; color: var(--muted); font-size: 13px; }
.task-check { margin-left: auto; }
.day-card.checked { background: var(--accent-soft); border-color: var(--warn-line); }
.privacy-foot { margin: 16px 0 0; color: var(--faint); font-size: 13px; }

.safety-card { padding: 22px; }
.safety-card span { color: var(--accent); font-size: 12px; font-weight: 650; letter-spacing: 0.08em; }
.safety-card h3 { font-size: 20px; margin: 18px 0 8px; letter-spacing: -0.02em; }
.safety-card p { margin: 0; color: var(--muted); font-size: 14px; }
.safety-sources { margin: 16px 0 0; font-size: 14px; }

.faq-search { max-width: 640px; margin-bottom: 8px; }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  padding: 18px 2px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--faint); font-weight: 500; font-size: 20px; line-height: 1; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 10px; padding-right: 28px; color: var(--muted); font-size: 15px; line-height: 1.75; }
.faq-item > a { display: inline-block; margin-bottom: 18px; font-size: 13px; }

.diagnose-layout, .preflight-layout { display: grid; gap: 16px; align-items: start; }
.diagnose-layout { grid-template-columns: minmax(240px, 0.85fr) 1.15fr; }
.preflight-layout { grid-template-columns: 1.35fr 0.65fr; }
.diagnose-severity { display: block; color: var(--warn-ink); font-size: 12px; font-weight: 650; letter-spacing: 0.04em; }
.diagnose-intro { margin-top: 18px; }
.diagnose-intro h3 { font-size: 20px; letter-spacing: -0.02em; margin: 8px 0; }
.diagnose-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.diagnose-links { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.diagnose-steps { display: flex; flex-direction: column; }
.diagnostic-step { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.diagnostic-step:last-child { border-bottom: 0; padding-bottom: 0; }
.diagnostic-step:first-child { padding-top: 0; }
.diagnostic-step b { color: var(--accent); font-size: 12px; min-width: 58px; font-variant-numeric: tabular-nums; }
.diagnostic-step p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.preflight-list { display: grid; gap: 8px; }
.preflight-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  cursor: pointer;
}
.preflight-check:has(input:checked) { border-color: var(--warn-line); background: var(--accent-soft); }
.preflight-score { position: sticky; top: 88px; }
.preflight-score strong { display: block; margin: 12px 0 16px; font-size: 48px; line-height: 1; letter-spacing: -0.04em; font-weight: 600; font-variant-numeric: tabular-nums; }
.preflight-score p { margin: 14px 0; color: var(--muted); font-size: 14px; }
.preflight-score a { font-size: 14px; font-weight: 600; }

.source-card { display: block; padding: 16px 16px 14px; min-width: 0; }
.source-card span { float: right; color: var(--faint); }
.source-card strong { display: block; font-size: 14px; margin: 0 28px 6px 0; letter-spacing: -0.01em; }
.source-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sources-note { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 62em; }

.final-contact { margin-top: 88px; padding: 72px 0; border-top: 1px solid var(--line); background: var(--surface); }
.final-contact-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 48px; align-items: start; }
.final-contact h2 { font-size: clamp(36px, 4vw, 52px); margin: 0 0 12px; }
.final-contact-content > div:first-child > p { max-width: 36em; color: var(--muted); font-size: 16px; }
.fineprint, .unofficial, .contact-note { color: var(--faint); font-size: 13px; }
.unofficial { color: var(--muted); }
.contact-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  padding: 8px 20px 18px;
}
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.contact-list span { color: var(--faint); font-size: 13px; }
.contact-list strong, .contact-list a { font-size: 16px; font-weight: 620; letter-spacing: -0.02em; }
.contact-list a:hover { color: var(--accent); }
.contact-list button {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}
.contact-list button:hover { border-color: var(--ink); }
.contact-note { margin: 14px 0 8px; }
.contact-services { color: var(--accent); font-size: 14px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

footer { padding: 28px 0 40px; }
.footer-inner, .footer-links { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-inner { color: var(--muted); font-size: 13px; }
.footer-inner small { display: block; color: var(--faint); margin-top: 2px; }
.footer-links { flex-wrap: wrap; justify-content: flex-end; }
.footer-links a:hover { color: var(--ink); }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(320px, calc(100% - 32px));
  background: var(--ink);
  color: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }

dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(860px, calc(100% - 32px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(20, 18, 16, 0.46); backdrop-filter: blur(8px); }
.dialog-container { position: relative; padding: 36px 36px 32px; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}
.modal-close:hover { border-color: var(--ink); }
.dialog-container h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.3; letter-spacing: -0.03em; font-weight: 620; margin: 10px 36px 12px 0; }
.dialog-summary { color: var(--muted); font-size: 16px; margin-bottom: 8px; }
.dialog-block { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.dialog-block h3 { margin: 0 0 8px; font-size: 13px; color: var(--accent); font-weight: 650; }
.dialog-block p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.75; }
.dialog-block ol { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: step; }
.dialog-block li {
  position: relative;
  counter-increment: step;
  margin: 0 0 0 11px;
  padding: 0 0 16px 28px;
  border-left: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.7;
}
.dialog-block li:last-child { border-left-color: transparent; padding-bottom: 0; }
.dialog-block li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: -12px;
  top: 0;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  padding-bottom: 4px;
}
.dialog-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 22px; }
.dialog-mini-contact {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
}
.dialog-mini-contact strong { color: var(--ink); }
.dialog-mini-contact button {
  margin-left: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}
.dialog-mini-contact a { color: var(--accent); }

@media (max-width: 980px) {
  .hero, .first-step-layout, .diagnose-layout, .preflight-layout, .final-contact-content, .lesson-layout { grid-template-columns: 1fr; }
  .prompt-grid, .sources-grid { grid-template-columns: 1fr 1fr; }
  .hero { gap: 28px; padding-top: 48px; }
  .hero h1 { max-width: 16em; }
  .preflight-score, .lesson-aside { position: static; }
  .lesson-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .billing-update { flex-wrap: wrap; }
  .topbar { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 12px 0 0; }
  .brand { margin-right: auto; }
  .primary-nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 4px 0 10px;
    scrollbar-width: none;
  }
  .primary-nav::-webkit-scrollbar { display: none; }
  .primary-nav a { flex: none; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .stats { grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .stats > div { border: 0; padding: 0 12px 0 0; }
  .lesson-cards, .roadmap-grid, .safety-grid, .prompt-grid, .sources-grid { grid-template-columns: 1fr; }
  .section { padding-top: 64px; }
  .section-heading, .first-step-heading, .contact-banner, .footer-inner { flex-direction: column; align-items: flex-start; }
  .meta { white-space: normal; }
  .contact-banner { padding: 22px; }
  .contact-banner h3 { font-size: 24px; }
  .first-step { padding: 20px; }
  .first-step-heading > a, .billing-update > a { white-space: normal; }
  .billing-update > a { width: 100%; text-align: center; }
  .day-card { flex-wrap: wrap; }
  .task-check { margin-left: 66px; }
  .footer-links { justify-content: flex-start; }
  .final-contact { margin-top: 64px; padding: 48px 0; }
  dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .dialog-container { padding: 28px 20px 32px; }
}
@media (max-width: 420px) {
  .brand small { display: none; }
  .author-mark { padding-right: 8px; }
  .author-mark-name { font-size: 12px; }
  .theme-toggle { padding: 0 8px; }
  .hero h1 { font-size: 32px; }
  .contact-list li { grid-template-columns: 64px minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
