/* Design Read: dense mobile decision workspace, cold ink night, restrained cinnabar accent, quiet astronomical detail, not a marketing page. Dials: variance 4, motion 3, density 6. */
:root {
  color-scheme: dark;
  --ink-950: #06080d;
  --ink-900: #0b1018;
  --ink-850: #0d1420;
  --ink-800: #131d2d;
  --ink-700: #273342;
  --ink-500: #566173;
  --paper: #f0f3f8;
  --muted: #c2c9d6;
  --accent: #ba4e42;
  --accent-strong: #d86d61;
  --accent-soft: rgba(216, 109, 97, 0.13);
  --line: rgba(235, 240, 250, 0.12);
  --line-strong: rgba(235, 240, 250, 0.22);
  --radius-large: 18px;
  --radius-small: 12px;
  --focus: #d98b7d;
  font-family: "SF Pro Text", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink-950);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background-color: var(--ink-950);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(238, 242, 240, 0.18) 0 1px, transparent 1.5px),
    radial-gradient(circle at 76% 17%, rgba(238, 242, 240, 0.11) 0 1px, transparent 1.5px),
    radial-gradient(circle at 42% 31%, rgba(238, 242, 240, 0.08) 0 1px, transparent 1.5px);
  background-size: 173px 173px, 241px 241px, 311px 311px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

button,
a {
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--paper);
  background: var(--accent);
  border-radius: var(--radius-small);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0 18px max(32px, env(safe-area-inset-bottom));
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(180, 93, 80, 0.7);
  border-radius: var(--radius-small);
  color: #e0a49a;
  font-family: "Songti SC", "STSong", serif;
  font-size: 20px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.status-chip {
  max-width: 48vw;
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip.is-ready {
  color: #e3b4ac;
  border-color: rgba(180, 93, 80, 0.42);
  background: var(--accent-soft);
}

.intro {
  position: relative;
  overflow: hidden;
  padding: clamp(52px, 12vw, 128px) 0 clamp(36px, 8vw, 76px);
}

.intro::after {
  content: "";
  position: absolute;
  width: 168px;
  height: 168px;
  top: 22px;
  right: -88px;
  border: 1px solid rgba(180, 93, 80, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(180, 93, 80, 0.035), 0 0 0 64px rgba(180, 93, 80, 0.025);
  pointer-events: none;
}

.eyebrow,
.section-index {
  margin: 0 0 10px;
  color: #cf7c6e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(36px, 9vw, 72px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.intro-copy {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(15px, 3vw, 18px);
  line-height: 1.75;
}

.workspace,
.output {
  border-top: 1px solid var(--line-strong);
  padding: 28px 0 44px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 5vw, 34px);
  line-height: 1.2;
}

.section-heading > p {
  width: min(42%, 360px);
  margin: 23px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

form {
  display: grid;
  gap: 26px;
}

.field-group > label,
.choice-fieldset legend {
  display: block;
  margin-bottom: 10px;
  color: #dbe1df;
  font-size: 14px;
  font-weight: 650;
}

.choice-fieldset legend span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

textarea,
.choice-grid input {
  width: 100%;
  color: var(--paper);
  background: var(--ink-850);
  border: 1px solid var(--line);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.reality-baseline {
  padding: 20px;
  border: 1px solid rgba(180, 93, 80, 0.28);
  border-radius: var(--radius-large);
  background: linear-gradient(145deg, rgba(180, 93, 80, 0.09), rgba(14, 23, 33, 0.96) 38%);
}

.baseline-heading { display: flex; align-items: center; gap: 12px; }
.baseline-heading > span { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(203, 109, 94, 0.5); border-radius: 12px; color: #e2a399; font-family: "Songti SC", "STSong", serif; font-size: 20px; }
.baseline-heading .eyebrow,.baseline-heading h3 { margin: 0; }
.baseline-heading h3 { margin-top: 3px; font-size: 17px; }
.baseline-intro { margin: 12px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.baseline-grid { display: grid; gap: 12px; }
.baseline-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.baseline-grid.compact-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0; }
.baseline-grid.evidence-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.baseline-grid label { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; }
.baseline-grid label > span { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px; }
.baseline-grid em { color: var(--ink-500); font-size: 10px; font-style: normal; font-weight: 400; }
.baseline-grid textarea { min-height: 96px; padding: 12px; border-radius: var(--radius-small); font-size: 12px; }
.baseline-grid input,.baseline-grid select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--ink-850); color: var(--paper); }
.evidence-fact textarea { border-color: rgba(99, 171, 148, 0.34); }
.evidence-assumption textarea { border-color: rgba(197, 159, 87, 0.32); }
.evidence-unknown textarea { border-color: rgba(180, 93, 80, 0.42); }
.baseline-more { margin-top: 14px; border-top: 1px solid var(--line); }
.baseline-more summary { padding: 14px 0; color: #d2b0aa; font-size: 12px; cursor: pointer; }
.baseline-confirm { display: flex; align-items: flex-start; gap: 11px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-small); background: rgba(7, 12, 18, 0.5); cursor: pointer; }
.baseline-confirm input { width: 19px; height: 19px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.baseline-confirm strong,.baseline-confirm small { display: block; }.baseline-confirm strong { margin-bottom: 4px; font-size: 13px; }.baseline-confirm small { color: var(--muted); font-size: 11px; line-height: 1.55; }

textarea {
  min-height: 154px;
  padding: 17px 16px;
  resize: vertical;
  border-radius: var(--radius-large);
  line-height: 1.7;
}

textarea::placeholder,
input::placeholder {
  color: #677681;
}

textarea:hover,
.choice-grid input:hover {
  border-color: var(--line-strong);
}

textarea:focus,
.choice-grid input:focus {
  background: #111c26;
  border-color: rgba(180, 93, 80, 0.7);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: var(--ink-500);
  font-size: 11px;
}

.choice-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-note {
  margin: -4px 0 13px;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.55;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-grid label {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.choice-grid input {
  min-height: 46px;
  padding: 0 13px;
  border-radius: var(--radius-small);
}

.context-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  cursor: pointer;
}

.context-control strong,
.context-control small {
  display: block;
}

.context-control strong {
  margin-bottom: 5px;
  font-size: 14px;
}

.context-control small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.switch {
  flex: 0 0 auto;
  position: relative;
  width: 48px;
  height: 28px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #34424d;
  transition: background-color 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 180ms ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.switch input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.primary-action,
.secondary-action,
.quiet-action {
  min-height: 48px;
  border-radius: var(--radius-small);
  cursor: pointer;
}

.primary-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff8f5;
  background: var(--accent);
  border: 1px solid var(--accent);
  font-weight: 700;
  transition: background-color 160ms ease, transform 160ms ease;
}

.primary-action:hover,
.primary-action:active {
  background: var(--accent-strong);
}

.primary-action:active {
  transform: translateY(1px);
}

.primary-action svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: wait;
  opacity: 0.58;
}

.form-message {
  min-height: 0;
  margin: -10px 0 -10px;
  color: #e5a499;
  font-size: 12px;
}

.form-message:empty {
  display: none;
}

.output-heading {
  align-items: end;
}

.output-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.quiet-action {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  font-size: 12px;
}

.quiet-action:hover,
.quiet-action:active {
  color: var(--paper);
  border-color: var(--line-strong);
}

.danger-action {
  color: #dda49a;
  border-color: rgba(180, 93, 80, 0.3);
}

.danger-action:hover,
.danger-action:active {
  color: #f1c4bc;
  border-color: rgba(180, 93, 80, 0.62);
  background: rgba(180, 93, 80, 0.08);
}

.output-status {
  min-height: 0;
  margin: -10px 0 18px;
  color: #c2cfcb;
  font-size: 12px;
  line-height: 1.6;
}

.output-status:empty {
  display: none;
}

.confirmation-dialog {
  width: min(92vw, 460px);
  padding: 0;
  color: var(--paper);
  background: var(--ink-850);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-large);
  box-shadow: 0 24px 70px rgba(1, 5, 9, 0.52);
}

.confirmation-dialog::backdrop {
  background: rgba(2, 6, 10, 0.78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dialog-body {
  padding: 26px;
}

.dialog-kicker {
  margin-bottom: 10px;
  color: #cf7c6e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.dialog-body h2 {
  margin-bottom: 12px;
  font-size: clamp(22px, 5vw, 28px);
  line-height: 1.25;
}

.dialog-body > p:not(.dialog-kicker):not(.dialog-message) {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
}

.dialog-message {
  min-height: 0;
  margin: 14px 0 0;
  color: #e5a499;
  font-size: 12px;
  line-height: 1.55;
}

.dialog-message:empty {
  display: none;
}

.history-dialog {
  width: min(92vw, 620px);
}

.history-list {
  max-height: min(52vh, 520px);
  display: grid;
  gap: 9px;
  margin-top: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.history-item {
  width: 100%;
  min-height: 68px;
  padding: 13px 14px;
  color: var(--paper);
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  cursor: pointer;
  text-align: left;
}

.history-item:hover,
.history-item:active {
  border-color: var(--line-strong);
}

.history-item strong,
.history-item small {
  display: block;
}

.history-item strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

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

.dialog-actions .quiet-action,
.danger-confirm {
  width: 100%;
  min-height: 48px;
}

.danger-confirm {
  color: #fff8f5;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-small);
  cursor: pointer;
  font-weight: 700;
  transition: background-color 160ms ease, transform 160ms ease;
}

.danger-confirm:hover,
.danger-confirm:active {
  background: var(--accent-strong);
}

.danger-confirm:active {
  transform: translateY(1px);
}

.danger-confirm:disabled {
  cursor: wait;
  opacity: 0.58;
}

.state-panel {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(26px, 6vw, 48px);
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
}

.state-panel h3 {
  margin-bottom: 10px;
  font-size: clamp(23px, 5vw, 32px);
}

.state-panel > p:not(.eyebrow) {
  max-width: 580px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.state-symbol {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  color: #d28a7d;
  border: 1px solid rgba(180, 93, 80, 0.48);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 20px;
}

.loading-orbit {
  position: relative;
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  border: 1px solid rgba(180, 93, 80, 0.45);
  border-radius: 50%;
  animation: orbit-turn 2.8s linear infinite;
}

.loading-orbit::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.loading-orbit span {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -4px;
  left: calc(50% - 4px);
  border-radius: 50%;
  background: var(--accent-strong);
}

@keyframes orbit-turn {
  to { transform: rotate(360deg); }
}

.stage-list {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.stage-list li {
  position: relative;
  padding-top: 17px;
  color: var(--ink-500);
  font-size: 10px;
  text-align: center;
}

.stage-list li::before {
  content: "";
  position: absolute;
  top: 4px;
  right: 50%;
  left: -50%;
  height: 1px;
  background: var(--line);
}

.stage-list li:first-child::before {
  display: none;
}

.stage-list li span {
  position: absolute;
  z-index: 1;
  width: 9px;
  height: 9px;
  top: 0;
  left: calc(50% - 4px);
  border: 2px solid var(--ink-850);
  border-radius: 50%;
  background: #34424d;
}

.stage-list li.is-current,
.stage-list li.is-complete {
  color: #d5ddda;
}

.stage-list li.is-current span,
.stage-list li.is-complete span {
  background: var(--accent);
}

.stage-list li.is-complete::before,
.stage-list li.is-current::before {
  background: rgba(180, 93, 80, 0.7);
}

.progressive-preview {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.progress-preview-section {
  padding: 18px;
  background: rgba(7, 13, 20, 0.62);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.progress-preview-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.progress-preview-heading > span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  color: #dfb07a;
  background: rgba(180, 93, 80, 0.12);
  border: 1px solid rgba(180, 93, 80, 0.34);
  border-radius: 50%;
  font-family: "Songti SC", "STSong", serif;
}

.progress-preview-heading small,
.progress-preview-heading h4 {
  display: block;
  margin: 0;
}

.progress-preview-heading small {
  margin-bottom: 3px;
  color: var(--faint);
  font-size: 10px;
}

.progress-preview-heading h4 {
  color: var(--paper);
  font-size: 15px;
}

.progress-baseline,
.progress-first-round-content {
  display: grid;
  gap: 8px;
}

.progress-baseline p,
.progress-first-round-content p,
.progress-waiting {
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.progress-baseline p strong,
.progress-first-round-content p strong {
  color: #c9a16f;
  font-weight: 650;
}

.progress-waiting {
  display: block;
}

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

.progress-path-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 13px;
  background: rgba(14, 23, 33, 0.78);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.progress-path-card > span {
  color: var(--faint);
  font-family: Georgia, serif;
  font-size: 11px;
}

.progress-path-card strong,
.progress-path-card p,
.progress-path-card small {
  display: block;
  margin: 0;
}

.progress-path-card strong {
  color: var(--paper);
  font-size: 12px;
}

.progress-path-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.progress-path-card small {
  margin-top: 9px;
  color: var(--faint);
  font-size: 10px;
}

.progress-path-card.is-ready {
  border-color: rgba(207, 174, 105, 0.42);
}

.progress-path-card.is-ready small {
  color: #d9bd7b;
}

.progress-first-round {
  border-color: rgba(207, 174, 105, 0.32);
}

.secondary-action {
  margin-top: 24px;
  padding: 0 18px;
  color: #f0c3bc;
  background: var(--accent-soft);
  border: 1px solid rgba(180, 93, 80, 0.52);
  font-weight: 650;
}

.secondary-action:hover,
.secondary-action:active {
  background: rgba(180, 93, 80, 0.22);
}

.result-state {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-large);
  background: var(--ink-900);
}

.evidence-tabs,
.path-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.evidence-tabs::-webkit-scrollbar,
.path-tabs::-webkit-scrollbar {
  display: none;
}

.evidence-tabs {
  padding: 14px 14px 0;
  border-bottom: 1px solid var(--line);
}

.evidence-tabs button,
.path-tabs button {
  min-height: 42px;
  flex: 1 0 auto;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-small) var(--radius-small) 0 0;
  cursor: pointer;
}

.evidence-tabs button[aria-selected="true"],
.path-tabs button[aria-selected="true"] {
  color: var(--paper);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.evidence-panel,
.result-section,
.next-step,
.boundary-details {
  padding: clamp(22px, 5vw, 42px);
}

.panel-kicker {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
}

.plain-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  position: relative;
  padding: 10px 0 10px 18px;
  border-top: 1px solid var(--line);
  color: #d9e0dd;
  font-size: 14px;
  line-height: 1.65;
}

.plain-list li::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  top: 20px;
  left: 1px;
  border-radius: 50%;
  background: var(--accent);
}

.plain-list li:first-child {
  border-top: 0;
}

.plain-list .empty-item {
  color: var(--ink-500);
}

.plain-list .empty-item::before {
  background: #465660;
}

.result-section,
.next-step,
.boundary-details {
  border-top: 1px solid var(--line-strong);
}

.result-title-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}

.result-title-row h3,
.result-section > h3,
.next-step h3 {
  margin-bottom: 0;
  font-size: clamp(22px, 5vw, 32px);
}

#path-position {
  margin: 0;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.path-tabs {
  margin-bottom: 22px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--line);
}

.path-tabs button {
  max-width: 230px;
  padding: 0 14px;
  text-align: left;
}

.path-panel h4 {
  margin-bottom: 10px;
  font-size: 21px;
}

.path-summary {
  max-width: 760px;
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.72;
}

.path-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -10px 0 24px;
}

.path-meta span {
  padding: 6px 9px;
  color: #d7c3bf;
  border: 1px solid rgba(180, 93, 80, 0.28);
  border-radius: 999px;
  background: rgba(180, 93, 80, 0.08);
  font-size: 11px;
  line-height: 1.2;
}

.audit-stack {
  display: grid;
  gap: 20px;
  margin: 26px 0 30px;
}

.audit-stack > section > h4 {
  margin-bottom: 12px;
  color: #dfe5e2;
  font-size: 14px;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-card,
.audit-empty {
  margin: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: rgba(238, 242, 240, 0.025);
}

.audit-card h5,
.audit-card p {
  margin: 0;
}

.audit-card h5 {
  margin-bottom: 8px;
  color: #e7ecea;
  font-size: 14px;
}

.audit-card > p {
  color: #d6ddda;
  font-size: 13px;
  line-height: 1.65;
}

.audit-card > p + p {
  margin-top: 7px;
}

.audit-card .audit-meta {
  margin-top: 10px;
  color: #bd8c83;
  font-size: 11px;
}

.audit-card .audit-uncertainty,
.audit-card .audit-resolution {
  color: var(--muted);
}

.audit-empty {
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.6;
}

.path-columns,
.synthesis-grid {
  display: grid;
  gap: 24px;
}

.path-columns section,
.synthesis-grid section {
  min-width: 0;
}

.path-columns h5,
.synthesis-grid h4,
.boundary-details h4 {
  margin-bottom: 8px;
  color: #bfc9c7;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.path-action {
  margin-top: 30px;
  padding: 19px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.path-action span {
  display: block;
  margin-bottom: 7px;
  color: #d59b91;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.path-action p {
  margin: 0;
  color: #f0e8e5;
  line-height: 1.7;
}

.round-details,
.boundary-details {
  margin-top: 22px;
}

.round-details summary,
.boundary-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}

.round-details summary::-webkit-details-marker,
.boundary-details summary::-webkit-details-marker {
  display: none;
}

.round-details summary::after,
.boundary-details summary::after {
  content: "+";
  color: var(--accent-strong);
  font-size: 20px;
}

.round-details[open] summary::after,
.boundary-details[open] summary::after {
  content: "−";
}

.round-block {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.round-block h5 {
  margin: 0;
  color: #d38b80;
  font-size: 12px;
}

.round-block p {
  margin-bottom: 9px;
  color: #cbd3d1;
  font-size: 13px;
  line-height: 1.65;
}

.round-block p:last-child {
  margin-bottom: 0;
}

.synthesis-grid {
  margin-top: 24px;
}

.next-step {
  background: var(--accent-soft);
}

.next-step > p:not(.section-index) {
  max-width: 800px;
  margin: 18px 0 0;
  color: #f0e8e5;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(19px, 4vw, 27px);
  line-height: 1.65;
}

.next-step .revisit {
  color: #c79e98 !important;
  font-family: inherit !important;
  font-size: 12px !important;
}

.reflection ol {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: reflection;
}

.reflection li {
  counter-increment: reflection;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: #d9e0dd;
  line-height: 1.65;
}

.reflection li::before {
  content: counter(reflection, decimal-leading-zero);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.boundary-details {
  margin: 0;
}

.boundary-details > p {
  margin: 4px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
}

footer {
  padding: 12px 0 8px;
  color: var(--ink-500);
  font-family: "Songti SC", "STSong", serif;
  font-size: 12px;
  text-align: center;
}

footer p {
  margin: 0;
}

@media (min-width: 720px) {
  .page-shell {
    padding-right: 34px;
    padding-left: 34px;
  }

  form {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: start;
  }

  .field-group {
    grid-row: span 2;
  }

  .context-control,
  .reality-baseline,
  .form-message,
  .primary-action {
    grid-column: 1 / -1;
  }

  .choice-grid {
    gap: 8px;
  }

  .path-columns,
  .synthesis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-list li {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .reality-baseline { padding: 16px; }
  .baseline-grid.two-columns,.baseline-grid.compact-fields,.baseline-grid.evidence-inputs { grid-template-columns: 1fr; }
  .section-heading {
    display: block;
  }

  .section-heading > p {
    width: auto;
    margin-top: 12px;
  }

  .output-heading {
    display: flex;
    gap: 14px;
  }

  .output-actions {
    max-width: 148px;
  }

  .output-actions .quiet-action {
    width: 100%;
    min-height: 36px;
  }

  .choice-grid label {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .state-panel {
    min-height: 320px;
  }

  .stage-list li {
    font-size: 0;
  }

  .progress-paths {
    grid-template-columns: 1fr;
  }

  .progress-baseline p,
  .progress-first-round-content p {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

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

/* Life World V2: show a changing system, not a longer prose report. */
.world-copy {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.7;
}

.world-grid,
.world-detail-grid,
.synthesis-v2-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.world-grid > section,
.world-detail-grid > section {
  min-width: 0;
}

.world-grid h4,
.world-detail-grid h4 {
  margin-bottom: 10px;
  font-size: 14px;
}

.world-card-list,
.world-detail-grid > section > div {
  display: grid;
  gap: 9px;
}

.world-card {
  padding: 14px;
  background: rgba(14, 23, 33, 0.76);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.world-card h5,
.world-card p,
.world-card small {
  margin: 0;
}

.world-card h5 {
  margin-bottom: 7px;
  color: var(--paper);
  font-size: 13px;
}

.world-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.world-card small {
  display: block;
  margin-top: 7px;
  color: #d18b7f;
  font-size: 10px;
  line-height: 1.55;
}

.world-details {
  margin-top: 14px;
}

.memory-section .world-card-list {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.interview-form {
  margin-top: 20px;
  padding: 18px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: rgba(14, 23, 33, 0.62);
}

.interview-form label {
  display: grid;
  gap: 8px;
  color: #dbe1df;
  font-size: 13px;
}

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

.interview-form select,
.interview-form textarea {
  width: 100%;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--ink-850);
}

.interview-form select {
  min-height: 44px;
  padding: 0 12px;
}

.interview-form textarea {
  min-height: 96px;
  padding: 12px;
}

.interview-form .secondary-action {
  justify-self: start;
}

.interview-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.interview-card {
  padding: 16px;
  border-left: 3px solid var(--accent);
  background: rgba(180, 93, 80, 0.08);
}

.interview-card h5,
.interview-card p,
.interview-card small {
  margin: 0;
}

.interview-card h5 {
  color: #e8d6d2;
  font-size: 13px;
}

.interview-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.interview-card small {
  display: block;
  margin-top: 8px;
  color: #c98f85;
  font-size: 10px;
}

.worldline-replay {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid rgba(180, 93, 80, 0.25);
  border-radius: var(--radius-large);
  background: rgba(180, 93, 80, 0.055);
}

.worldline-heading,
.worldline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.worldline-heading h5 {
  margin: 0;
  color: #d9a197;
  font-size: 13px;
}

.worldline-actions button {
  min-width: 38px;
  min-height: 38px;
  padding: 0 10px;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink-850);
}

#worldline-slider {
  width: 100%;
  margin: 18px 0 14px;
  accent-color: var(--accent-strong);
}

.worldline-frame {
  min-height: 150px;
}

.worldline-frame h6,
.worldline-frame p {
  margin: 0;
}

.worldline-frame h6 {
  color: var(--paper);
  font-size: 15px;
}

.worldline-frame p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.62;
}

.decision-profile {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.decision-profile > div {
  display: grid;
  gap: 5px;
  padding: 12px 8px;
  text-align: center;
  background: rgba(180, 93, 80, 0.08);
  border: 1px solid rgba(180, 93, 80, 0.18);
  border-radius: 10px;
}

.decision-profile small {
  color: var(--muted);
  font-size: 10px;
}

.decision-profile strong {
  color: #e2a095;
  font-size: 16px;
}

.outcome-range {
  margin: 18px 0;
}

.outcome-range > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.outcome-range article {
  padding: 13px;
  background: rgba(7, 12, 18, 0.58);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.outcome-range h6,
.outcome-range p,
.outcome-range small {
  margin: 0;
}

.outcome-range h6 {
  margin-bottom: 7px;
  color: #d89084;
  font-size: 11px;
}

.outcome-range p {
  font-size: 12px;
  line-height: 1.6;
}

.outcome-range small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.round-trigger,
.round-action,
.round-state {
  padding-left: 10px;
  border-left: 2px solid rgba(180, 93, 80, 0.34);
}

.round-state {
  color: #e0a499 !important;
}

.path-rules {
  margin-top: 16px;
}

.recommended-strategy {
  margin: 22px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(180, 93, 80, 0.16), rgba(14, 23, 33, 0.78));
  border: 1px solid rgba(180, 93, 80, 0.35);
  border-radius: var(--radius-large);
}

.recommended-strategy p:last-child {
  margin-bottom: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(19px, 4vw, 26px);
  line-height: 1.6;
}

.inject-action {
  margin-top: 18px;
}

.dialog-field {
  display: block;
  margin: 18px 0 8px;
  color: var(--paper);
  font-size: 13px;
}

#injection-input {
  min-height: 116px;
}

.experience-offer,
.preview-unlock {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 0 0 28px;
  padding: 22px;
  border: 1px solid rgba(207, 174, 105, .38);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(207, 174, 105, .13), rgba(35, 91, 86, .12));
}

.experience-offer[hidden],
.preview-unlock[hidden] { display: none; }

.experience-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--ink-950);
  background: #cfad68;
  font-weight: 800;
}

.experience-offer h2,
.preview-unlock h3 { margin: 2px 0 6px; }
.experience-offer p,
.preview-unlock p { margin: 0; color: var(--muted); }
.experience-status {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(207, 174, 105, .16);
  color: #e5c983;
  white-space: nowrap;
}
.experience-offer.is-used { opacity: .82; }
.preview-unlock { margin-top: 0; }
.preview-unlock-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(229, 201, 131, .56);
  border-radius: 50%;
  color: #e5c983;
  background: rgba(207, 174, 105, .12);
  font-weight: 800;
}
.preview-unlock-copy { min-width: 0; }
.preview-unlock-list {
  display: grid;
  gap: 7px;
  margin: 14px 0 10px;
  padding: 0;
  list-style: none;
  color: var(--paper);
}
.preview-unlock-list li {
  position: relative;
  padding-left: 18px;
  line-height: 1.55;
}
.preview-unlock-list li::before {
  content: "";
  position: absolute;
  top: .65em;
  left: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #cfad68;
  box-shadow: 0 0 0 4px rgba(207, 174, 105, .12);
}
.preview-unlock-note {
  font-size: 12px;
  color: var(--faint);
}
.preview-unlock-action {
  display: grid;
  gap: 8px;
  justify-items: stretch;
  min-width: 188px;
}
.preview-unlock-button {
  min-height: 46px;
  padding: 11px 17px;
  border: 0;
  border-radius: 14px;
  color: var(--ink-950);
  background: #cfad68;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.preview-unlock-button:hover { background: #ddbf7e; }
.preview-unlock-button:focus-visible {
  outline: 2px solid #f1d99f;
  outline-offset: 3px;
}
.preview-unlock-button:disabled {
  cursor: wait;
  opacity: .72;
}
.preview-unlock-action small {
  max-width: 230px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 700px) {
  .world-grid,
  .world-detail-grid,
  .synthesis-v2-grid,
  .outcome-range > div {
    grid-template-columns: 1fr;
  }

  .interview-fields {
    grid-template-columns: 1fr;
  }

  .decision-profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .experience-offer,
  .preview-unlock { grid-template-columns: auto minmax(0, 1fr); }

  .experience-status { grid-column: 2; justify-self: start; }
  .preview-unlock-action {
    grid-column: 1 / -1;
    width: 100%;
  }
  .preview-unlock-action small { max-width: none; }
}
