:root {
  --demo-ink: #112033;
  --demo-muted: #69757d;
  --demo-line: #d7d5cc;
  --demo-paper: #fffdf7;
  --demo-canvas: #f4f1e9;
  --demo-mint: #cce6da;
  --demo-mint-dark: #2f6955;
  --demo-coral: #eb846b;
  --demo-amber: #e9b255;
  --demo-blue: #496ba7;
}
body.demo-page { background: var(--demo-canvas); color: var(--demo-ink); }
.demo-header { min-height: 68px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 12px max(28px, calc((100% - 1240px) / 2)); background: rgba(255,253,247,.96); border-bottom: 1px solid var(--demo-line); }
.demo-header .wordmark { color: var(--demo-ink); }
.demo-header .wordmark-mark { background: var(--demo-ink); color: var(--demo-paper); }
.demo-header-meta { justify-self: center; display: inline-flex; align-items: center; gap: 7px; color: #68746e; font-size: 10px; font-weight: 800; letter-spacing: 1.15px; }
.demo-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--demo-mint-dark); box-shadow: 0 0 0 4px #e2f0e9; }
.demo-back { justify-self: end; color: var(--demo-ink); font-size: 12px; font-weight: 750; text-decoration: none; }
.demo-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.demo-intro { width: min(1240px, calc(100% - 56px)); margin: 0 auto; display: flex; justify-content: space-between; align-items: end; gap: 34px; padding: 76px 0 55px; }
.demo-intro h1 { max-width: 800px; margin: 0; color: var(--demo-ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5.2vw, 68px); font-weight: 500; line-height: 1.02; }
.demo-intro h1 em { color: var(--demo-mint-dark); font-style: normal; }
.demo-lede { max-width: 650px; margin: 24px 0 0; color: var(--demo-muted); font-size: 16px; line-height: 1.6; }
.demo-intro-note { flex: 0 0 150px; padding: 15px 0 4px 17px; border-left: 2px solid var(--demo-coral); }
.demo-intro-note span { color: var(--demo-coral); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; font-weight: 800; }
.demo-intro-note p { margin: 9px 0 0; color: #59656d; font-family: Georgia, serif; font-size: 17px; line-height: 1.35; }
.demo-layout { width: min(1240px, calc(100% - 56px)); margin: 0 auto 90px; display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 38px; align-items: start; }
.demo-rail { position: sticky; top: 25px; }
.rail-label, .panel-kicker, .record-kicker, .flag-heading { color: #7b827b; font-size: 10px; font-weight: 800; letter-spacing: 1.25px; }
.progress-list { display: grid; gap: 4px; margin: 14px 0 34px; padding: 0; list-style: none; }
.progress-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 11px 9px; border-left: 2px solid transparent; color: #87918d; }
.progress-item span { color: #9ba39f; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; font-weight: 800; }
.progress-item b, .progress-item small { display: block; }
.progress-item b { font-size: 12px; font-weight: 800; }
.progress-item small { margin-top: 3px; color: #8b9590; font-size: 11px; }
.progress-item.active { border-left-color: var(--demo-coral); background: rgba(255,253,247,.85); color: var(--demo-ink); }
.progress-item.active span { color: var(--demo-coral); }
.progress-item.done { color: var(--demo-mint-dark); }
.rail-boundary { display: flex; gap: 9px; padding: 16px 10px 17px 0; border-top: 1px solid var(--demo-line); border-bottom: 1px solid var(--demo-line); }
.boundary-icon { display: grid; place-items: center; flex: 0 0 21px; width: 21px; height: 21px; border-radius: 50%; background: var(--demo-mint); color: var(--demo-mint-dark); font-size: 12px; font-weight: 900; }
.rail-boundary b { display: block; font-size: 11px; }
.rail-boundary p { margin: 3px 0 0; color: var(--demo-muted); font-size: 11px; line-height: 1.45; }
.rail-link { display: inline-flex; gap: 6px; margin-top: 21px; color: var(--demo-ink); font-size: 11px; font-weight: 750; text-decoration: none; }
.rail-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.demo-workspace { min-width: 0; }
.demo-panel, .record-strip, .draft-panel, .report-panel { border: 1px solid var(--demo-line); background: var(--demo-paper); }
.demo-panel { padding: 31px 35px; }
.panel-kicker { display: flex; justify-content: space-between; gap: 15px; }
.panel-state { color: var(--demo-mint-dark); }
.demo-panel h2 { margin: 15px 0 9px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; line-height: 1.15; }
.panel-copy { max-width: 560px; margin: 0; color: var(--demo-muted); font-size: 14px; line-height: 1.55; }
.demo-gate { max-width: 710px; padding: 34px 35px; border-color: #c5ddd1; background: #eef6f1; }
.demo-gate .panel-state { color: #9a6524; }
.demo-gate-form { margin-top: 25px; }
.demo-gate-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.demo-gate-row input { min-width: 0; min-height: 44px; padding: 0 13px; border: 1px solid #b8c8be; border-radius: 5px; background: #fffefb; color: var(--demo-ink); font-size: 14px; }
.demo-gate-row input:focus { outline: 3px solid rgba(70,103,169,.22); border-color: var(--demo-blue); }
.demo-gate-message { min-height: 19px; margin: 10px 0 0; color: #345849; font-size: 12px; font-weight: 650; }
.demo-gate-message.error { color: #8f3123; }
.demo-form { margin-top: 27px; }
.field-label { display: block; margin-bottom: 7px; color: var(--demo-ink); font-size: 12px; font-weight: 800; }
#area { width: 100%; min-height: 47px; padding: 0 13px; border: 1px solid #bfc5bd; border-radius: 5px; background: #fff; color: var(--demo-ink); font-size: 14px; }
#area:focus { outline: 3px solid rgba(70,103,169,.22); border-color: var(--demo-blue); }
.demo-submit { margin-top: 18px; }
.setup-foot { display: flex; gap: 8px; align-items: center; margin: 21px 0 0; color: #7f8984; font-size: 11px; }
.lock-mark { color: var(--demo-mint-dark); font-size: 10px; }
.progress-panel { background: #eef6f1; border-color: #c5ddd1; }
.progress-panel .panel-state { color: #9a6524; }
.job-progress { height: 8px; margin-top: 26px; overflow: hidden; border-radius: 99px; background: #d6e7de; }
.job-progress i { display: block; width: 8%; height: 100%; border-radius: inherit; background: var(--demo-mint-dark); transition: width 300ms ease; }
.progress-meta { display: flex; justify-content: space-between; gap: 15px; margin-top: 9px; color: #71847b; font-size: 11px; }
.result-stack { display: grid; gap: 17px; }
.record-strip { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 22px 25px; }
.record-strip h2 { margin: 7px 0 5px; font-family: Georgia, serif; font-size: 23px; font-weight: 500; line-height: 1.15; }
.record-strip p { margin: 0; color: var(--demo-muted); font-size: 12px; }
.mode-badge { margin-left: 6px; padding: 3px 6px; font-size: 9px; font-weight: 850; letter-spacing: .9px; }
.mode-badge.is-live { background: var(--demo-mint); color: var(--demo-mint-dark); }
.mode-badge.is-offline { background: #fdece6; color: #a2543c; }
.source-button { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; min-height: 37px; padding: 0 12px; border: 1px solid #b6cfc3; border-radius: 5px; color: var(--demo-mint-dark); font-size: 11px; font-weight: 800; text-decoration: none; }
.source-button:hover { background: #eef8f2; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 17px; align-items: start; }
.draft-panel { min-width: 0; padding: 28px 30px 23px; }
.draft-topline, .report-topline { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.draft-topline h2 { max-width: 680px; margin: 8px 0 0; font-family: Georgia, serif; font-size: 28px; font-weight: 500; line-height: 1.15; }
.draft-badge { padding: 5px 7px; background: var(--demo-mint); color: var(--demo-mint-dark); font-size: 9px; font-weight: 850; letter-spacing: .9px; }
.draft-editor-wrap { margin-top: 23px; }
#draft-editor { display: block; width: 100%; min-height: 395px; padding: 22px; resize: vertical; border: 1px solid #dbd8cf; border-radius: 4px; background: #fffefb; color: #283640; font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.65; }
#draft-editor:focus { outline: 3px solid rgba(70,103,169,.18); border-color: var(--demo-blue); }
.draft-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.button-outline { border: 1px solid #aeb9b2; background: transparent; color: var(--demo-ink); }
.save-state { margin-left: auto; color: #7f8984; font-size: 10px; }
.report-panel { padding: 26px 25px 22px; background: #e7f2ed; border-color: #c5ddd1; }
.overall-score { color: var(--demo-mint-dark); white-space: nowrap; }
.overall-score strong { font-size: 30px; font-weight: 850; line-height: 1; }
.overall-score small { margin-left: 3px; color: #668377; font-size: 11px; font-weight: 700; }
.report-note { margin: 20px 0 0; color: #587168; font-size: 11px; line-height: 1.45; }
.axis-list { display: grid; gap: 14px; margin-top: 22px; }
.axis-row { display: grid; grid-template-columns: 42px auto; gap: 8px 10px; align-items: center; color: #38594d; font-size: 11px; font-weight: 800; }
.axis-row b { text-align: right; }
.axis-bar { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 99px; background: #c5ddd1; }
.axis-bar i { display: block; height: 100%; border-radius: inherit; background: var(--demo-mint-dark); }
.flag-section { margin-top: 27px; padding-top: 18px; border-top: 1px solid #bfd2c8; }
.flag-heading { display: flex; justify-content: space-between; color: #6e7e77; }
#flag-list { display: grid; gap: 9px; margin: 13px 0 0; padding: 0; list-style: none; }
#flag-list li { position: relative; padding-left: 14px; color: #5c5a4d; font-size: 11px; line-height: 1.48; }
#flag-list li::before { position: absolute; top: 5px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--demo-amber); content: ""; }
.report-disclaimer { margin-top: 20px; padding-top: 14px; border-top: 1px solid #bfd2c8; color: #668075; font-size: 10px; line-height: 1.45; }
.result-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 0 4px; color: #74817b; font-size: 11px; }
.result-footer .text-link { border: 0; background: transparent; font-family: inherit; cursor: pointer; }
.demo-error { margin: 17px 0 0; padding: 12px 14px; border: 1px solid #e2b3a7; background: #fff3ef; color: #884b3b; font-size: 12px; }
@media (max-width: 920px) {
  .demo-layout { grid-template-columns: 1fr; gap: 18px; }
  .demo-rail { position: static; }
  .progress-list { grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 15px; }
  .progress-item { border-top: 2px solid transparent; border-left: 0; padding: 10px 8px; }
  .progress-item.active { border-top-color: var(--demo-coral); border-left: 0; }
  .progress-item div { min-width: 0; }
  .rail-boundary, .rail-link { display: none; }
}
@media (max-width: 720px) {
  .demo-header { grid-template-columns: 1fr auto; padding: 12px 17px; }
  .demo-header-meta { display: none; }
  .demo-intro { width: min(100% - 34px, 640px); display: block; padding: 48px 0 35px; }
  .demo-intro h1 { font-size: 43px; }
  .demo-intro-note { margin-top: 26px; }
  .demo-layout { width: min(100% - 34px, 640px); margin-bottom: 55px; }
  .demo-panel { padding: 24px 20px; }
  .demo-gate { padding: 27px 22px; }
  .demo-gate-row { grid-template-columns: 1fr; }
  .demo-panel h2 { font-size: 26px; }
  .record-strip { display: block; padding: 20px; }
  .source-button { margin-top: 15px; }
  .result-grid { grid-template-columns: 1fr; }
  .draft-panel { padding: 23px 18px 18px; }
  .draft-topline h2 { font-size: 24px; }
  #draft-editor { min-height: 430px; padding: 17px; font-size: 15px; }
  .report-panel { padding: 23px 18px 19px; }
  .save-state { width: 100%; margin-left: 0; }
  .result-footer { display: block; }
  .result-footer .text-link { margin-top: 12px; padding: 0; }
}
