/* Resume Agent — "Ink & Paper" design system. See /DESIGN.md for usage. */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: light;
  /* surfaces */
  --paper: #f3f0e8;        /* page background: warm off-white */
  --sheet: #fbfaf6;        /* raised surface: panels, cards, inputs */
  --sheet-2: #ebe7dc;      /* recessed: code, wells */
  /* ink */
  --ink: #16150f;          /* primary text */
  --ink-2: #4a4740;        /* secondary text */
  --ink-3: #6f6a5f;        /* metadata, placeholders */
  --rule: #d8d2c4;         /* hairlines */
  --rule-strong: #16150f;  /* heavy rules (page head, nav) */
  /* the one accent: vermilion, like a proofreader's pen */
  --accent: #c93a1b;
  --accent-ink: #fff;
  --accent-wash: #f6dfd6;
  /* states (muted) */
  --ok: #2f6b3a;   --ok-wash: #dfe9d9;
  --warn: #8a5a00; --warn-wash: #f1e4c4;
  --err: #b4231b;  --err-wash: #f3d9d5;
  /* type */
  --f-serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Noto Serif SC", serif;
  --f-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --f-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, Menlo, monospace;
  --t-xs: .75rem; --t-sm: .8125rem; --t-base: .9375rem; --t-md: 1.0625rem;
  --t-lg: 1.375rem; --t-xl: 1.875rem; --t-2xl: clamp(2.25rem, 5.2vw, 3.75rem);
  /* space (4px base) */
  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem;
  /* shape + motion */
  --r: 2px;
  --r-pill: 99px;
  --lift: 0 1px 0 rgba(22,21,15,.04), 0 10px 30px -12px rgba(22,21,15,.25);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 160ms;
  --measure: 68ch;
  --shell: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #12110e; --sheet: #1b1a16; --sheet-2: #24221d;
    --ink: #ece7db; --ink-2: #b9b3a5; --ink-3: #8f897b;
    --rule: #34312a; --rule-strong: #ece7db;
    --accent: #ff6a45; --accent-ink: #12110e; --accent-wash: #3a1d14;
    --ok: #8cc58f; --ok-wash: #1f2c1f; --warn: #e2b35a; --warn-wash: #33290f; --err: #ff8a7a; --err-wash: #3a1b18;
    --lift: 0 1px 0 rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #12110e; --sheet: #1b1a16; --sheet-2: #24221d;
  --ink: #ece7db; --ink-2: #b9b3a5; --ink-3: #8f897b;
  --rule: #34312a; --rule-strong: #ece7db;
  --accent: #ff6a45; --accent-ink: #12110e; --accent-wash: #3a1d14;
  --ok: #8cc58f; --ok-wash: #1f2c1f; --warn: #e2b35a; --warn-wash: #33290f; --err: #ff8a7a; --err-wash: #3a1b18;
  --lift: 0 1px 0 rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.8);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink);
  font: 400 var(--t-base)/1.55 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 240ms ease, color 240ms ease;
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-serif); font-weight: 600; color: var(--ink); text-wrap: balance; }
h1 { font-size: var(--t-xl); line-height: 1.1; letter-spacing: -.015em; margin: var(--s-2) 0 var(--s-4); }
h2 { font-size: var(--t-lg); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 var(--s-3); }
h3 { font-size: var(--t-md); line-height: 1.3; margin: 0 0 var(--s-2); }
p { margin: 0 0 var(--s-3); }
code, kbd, samp, .mono { font-family: var(--f-mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-5) 0; }

/* ---------- 3. Shell: header / nav / main / footer ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-5); flex-wrap: wrap;
  padding: 0 max(16px, calc((100vw - var(--shell)) / 2));
  min-height: 56px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(8px); backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule-strong);
}
.brand { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink); text-decoration: none; font-family: var(--f-serif); font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { color: var(--ink); }
.logo {
  position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px;
  background: var(--ink); color: var(--paper); font: 700 .8rem/1 var(--f-mono); border-radius: var(--r);
}
.logo::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 7px; height: 7px; background: var(--accent); }
.top nav { display: flex; gap: var(--s-1); flex: 1; align-self: stretch; }
.top nav a {
  display: flex; align-items: center; padding: 0 var(--s-2);
  color: var(--ink-2); text-decoration: none; font-size: var(--t-sm); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.me { display: flex; gap: var(--s-3); align-items: center; font-size: var(--t-sm); }
.me a { color: var(--ink-2); text-decoration: none; } .me a:hover { color: var(--ink); }
.me a.btn, .me a.btn:hover { color: var(--paper); }
.me form { margin: 0; }
.me .who { font-family: var(--f-mono); font-size: var(--t-xs); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  background: none; border: 1px solid var(--rule); border-radius: var(--r-pill); color: var(--ink-2); cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle svg { width: 14px; height: 14px; }

main { flex: 1; }
.wrap { width: 100%; max-width: var(--shell); margin: 0 auto; padding: var(--s-6) 16px var(--s-8); }
.wrap.wide { max-width: 1440px; }
.foot {
  display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  padding: var(--s-4) max(16px, calc((100vw - var(--shell)) / 2));
  border-top: 1px solid var(--rule); font: var(--t-xs)/1.4 var(--f-mono); color: var(--ink-3);
}
.foot a { color: var(--ink-3); text-decoration: none; } .foot a:hover { color: var(--ink); }

/* ---------- 4. Page header ---------- */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  padding-bottom: var(--s-4); margin-bottom: var(--s-5); border-bottom: 1px solid var(--rule-strong); }
.page-head h1 { margin: 0; }
.eyebrow, .kicker { display: block; font: 500 var(--t-xs)/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: var(--s-2); }
.eyebrow b, .kicker b { color: var(--accent); font-weight: 600; }

/* ---------- 5. Panels (card) ---------- */
.card, .panel {
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r);
  padding: var(--s-5); margin-bottom: var(--s-4);
}
.card > h2:first-child, .panel > h2:first-child, .card > h3:first-child { margin-top: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-4); padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--rule); font: 500 var(--t-xs)/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.card.flat { background: transparent; }
.danger-zone { border-color: var(--err); border-left-width: 3px; }
.li-card { display: block; color: var(--ink); text-decoration: none; transition: border-color var(--dur) var(--ease), transform 90ms ease-out; }
.li-card:hover { border-color: var(--ink); color: var(--ink); }
.li-card:active { transform: translateY(1px); }

/* ---------- 6. Layout helpers ---------- */
.narrow { max-width: 420px; margin: var(--s-6) auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); } .two > .card { margin: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.row { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; } .row > input, .row > label { flex: 1; min-width: 120px; }
.toolbar { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-2); }
.actions { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-top: var(--s-3); }
.grow { flex: 1; }
.stack > * + * { margin-top: var(--s-3); }
.prose { max-width: var(--measure); } .prose li { margin-bottom: var(--s-2); }
.prose h2 { margin-top: var(--s-6); }

/* ---------- 7. Text utilities ---------- */
.muted { color: var(--ink-3); }
.small { font-size: var(--t-sm); }
.hint { color: var(--ink-3); font-size: var(--t-sm); margin: var(--s-2) 0; }
.lead { font-size: var(--t-md); color: var(--ink-2); max-width: var(--measure); line-height: 1.55; }
.or { display: flex; align-items: center; gap: var(--s-3); color: var(--ink-3); font: var(--t-xs) var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 36px; padding: 0 var(--s-4);
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: var(--r);
  font: 600 var(--t-sm)/1 var(--f-sans); letter-spacing: .01em; cursor: pointer;
  text-decoration: none !important; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 90ms ease-out;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn.accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, .btn.accent:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn.danger:hover { background: var(--err); color: var(--sheet); }
.btn.sm { min-height: 28px; padding: 0 var(--s-3); font-size: var(--t-xs); }
.btn.full { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; pointer-events: none; }
.btn .arrow { font-family: var(--f-mono); transition: transform var(--dur) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
button.link { background: none; border: 0; padding: 0 var(--s-1); color: var(--ink-2); cursor: pointer; font: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .2em; }
button.link:hover { color: var(--accent); text-decoration-color: var(--accent); }
button.link.danger { color: var(--err); }
.me button.link { text-decoration: none; }

/* ---------- 9. Forms ---------- */
.form { display: flex; flex-direction: column; gap: var(--s-4); }
.form label { display: flex; flex-direction: column; gap: var(--s-1); font: 500 var(--t-xs)/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.form label.check { flex-direction: row; align-items: flex-start; gap: var(--s-2); font: 400 var(--t-sm)/1.45 var(--f-sans); text-transform: none; letter-spacing: 0; }
.form.cols { display: grid; grid-template-columns: 1fr 1fr; }
form.inline { display: inline; }
input, select, textarea {
  width: 100%; font: 400 var(--t-base)/1.4 var(--f-sans); color: var(--ink); text-transform: none; letter-spacing: 0;
  background: var(--sheet); border: 1px solid var(--rule); border-bottom-color: var(--ink-3); border-radius: var(--r);
  padding: .55rem .65rem; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 2px 0 0 var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); margin-top: .2em; }
input[type=file] { padding: .4rem; font-size: var(--t-sm); }
textarea { resize: vertical; min-height: 6rem; }
textarea.mono { font-family: var(--f-mono); font-size: var(--t-sm); }

/* ---------- 10. Flash / callout ---------- */
.flash {
  display: flex; gap: var(--s-3); align-items: baseline;
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4);
  background: var(--sheet); border: 1px solid var(--rule); border-left: 3px solid var(--ink); border-radius: var(--r);
  font-size: var(--t-sm); color: var(--ink);
  animation: flash-in 260ms var(--ease) both;
}
.flash::before { flex: none; content: "NOTE"; font: 600 var(--t-xs)/1.5 var(--f-mono); letter-spacing: .06em; color: var(--ink-3); }
.flash.ok { border-left-color: var(--ok); background: var(--ok-wash); } .flash.ok::before { content: "OK"; color: var(--ok); }
.flash.warn { border-left-color: var(--warn); background: var(--warn-wash); } .flash.warn::before { content: "WARN"; color: var(--warn); }
.flash.err { border-left-color: var(--err); background: var(--err-wash); } .flash.err::before { content: "ERROR"; color: var(--err); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- 11. Tags / badges / requirement ids ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .3em; vertical-align: middle; margin-left: var(--s-1);
  padding: .1rem .4rem; border: 1px solid var(--rule); border-radius: var(--r);
  font: 500 var(--t-xs)/1.3 var(--f-mono); letter-spacing: .02em; color: var(--ink-2); background: transparent;
}
.tag.done, .tag.ok { color: var(--ok); border-color: currentColor; }
.tag.error, .tag.err { color: var(--err); border-color: currentColor; }
.tag.running, .tag.queued, .tag.warn { color: var(--warn); border-color: currentColor; }
.tag.running::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.2s ease-in-out infinite; }
.tag.pin, .tag.accent { color: var(--accent); border-color: currentColor; }
.req { display: inline-block; padding: 0 .3em; font: 600 var(--t-xs)/1.5 var(--f-mono); color: var(--accent-ink); background: var(--accent); border-radius: var(--r); }
.req.miss { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--rule); }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- 12. Tables & lists ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-sm); border-top: 1px solid var(--rule-strong); }
.tbl th, .tbl td { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl th { font: 500 var(--t-xs)/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.tbl tbody tr { transition: background-color var(--dur) var(--ease); }
.tbl tbody tr:hover { background: var(--sheet); }
.tbl tr.dim td { opacity: .5; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--f-mono); }
.tbl form { margin: 0; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.li { display: flex; gap: var(--s-2); align-items: center; padding: var(--s-2) 0; border-bottom: 1px solid var(--rule); } .li:last-child { border: 0; }

/* ---------- 13. Tabs / segmented ---------- */
.tabs { display: flex; gap: var(--s-4); border-bottom: 1px solid var(--rule); margin-bottom: var(--s-4); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: var(--s-2) 0; font: 500 var(--t-sm) var(--f-sans); color: var(--ink-3); cursor: pointer; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--ink); padding: .35rem .8rem; font: 500 var(--t-xs) var(--f-mono); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--paper); }

/* ---------- 14. Steps (onboarding checklist) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: var(--s-5); border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); }
.step { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-4); color: var(--ink); text-decoration: none; border-right: 1px solid var(--rule); transition: background-color var(--dur) var(--ease); }
.step:last-child { border-right: 0; }
a.step:hover { background: var(--paper); color: var(--ink); }
.step b { font: 600 var(--t-xs)/1 var(--f-mono); color: var(--ink-3); letter-spacing: .06em; }
.step.done b { color: var(--ok); }
.step.done b::after { content: " \2713"; }
.step span { color: var(--ink-3); font-size: var(--t-sm); }

/* ---------- 15. Usage meters ---------- */
.usage { display: flex; gap: var(--s-5); flex-wrap: wrap; }
.usage > div { display: flex; flex-direction: column; min-width: 140px; font-family: var(--f-mono); font-size: var(--t-sm); }
.usage .muted { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; }
.bar { height: 4px; background: var(--sheet-2); margin-top: var(--s-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; animation: bar-in 600ms var(--ease) both; }
@keyframes bar-in { from { transform: scaleX(0); } }

/* ---------- 16. Code / log / progress ---------- */
pre.md, pre.log {
  margin: 0; white-space: pre-wrap; word-break: break-word; max-height: 70vh; overflow: auto;
  padding: var(--s-4); border-radius: var(--r); font: var(--t-sm)/1.6 var(--f-mono);
}
pre.md { background: var(--sheet-2); color: var(--ink); border: 1px solid var(--rule); }
pre.log { background: #12110e; color: #d9d3c4; border: 1px solid #12110e; }
:root[data-theme="dark"] pre.log { background: #0b0a08; border-color: var(--rule); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) pre.log { background: #0b0a08; border-color: var(--rule); } }
.spinner { display: inline-block; width: 12px; height: 12px; vertical-align: middle; border: 2px solid var(--rule); border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
.spinner.off { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 17. Empty state ---------- */
.empty { padding: var(--s-6) var(--s-5); border: 1px dashed var(--rule); border-radius: var(--r); color: var(--ink-2); }
.empty h3 { margin-bottom: var(--s-1); }

/* ---------- 18. Resume page (existing hooks; phase 2 may refine) ---------- */
.resume-layout { display: grid; grid-template-columns: minmax(0, 8.5in) minmax(320px, 1fr); gap: var(--s-5); align-items: start; }
.preview-box { background: #fff; border: 1px solid var(--rule); box-shadow: var(--lift); overflow: hidden; }
#preview { width: 100%; height: 11in; border: 0; display: block; }
.side { max-height: calc(100vh - 88px); overflow: auto; position: sticky; top: 72px; }
.side .card { margin-bottom: var(--s-3); }
.target { font-size: var(--t-sm); background: var(--sheet-2); border-left: 2px solid var(--accent); padding: var(--s-2) var(--s-3); margin-bottom: var(--s-2); }
.diff { font-size: var(--t-sm); background: var(--sheet-2); border-radius: var(--r); padding: var(--s-2) var(--s-3); margin: var(--s-2) 0; line-height: 1.65; }
.diff del { background: var(--err-wash); color: var(--err); }
.diff ins { background: var(--ok-wash); color: var(--ok); text-decoration: none; }
ul.map { padding-left: var(--s-4); } ul.map li { margin-bottom: var(--s-2); }
ul.cov { list-style: none; padding: 0; margin: 0; font-size: var(--t-sm); }
ul.cov li { padding: var(--s-1) 0; border-bottom: 1px solid var(--rule); }
ul.cov li.miss { color: var(--ink-3); }

/* ---------- 19. Landing ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s-7); align-items: center; padding: var(--s-5) 0 var(--s-7); }
.hero h1 { font-size: var(--t-2xl); line-height: 1.02; letter-spacing: -.03em; margin: 0 0 var(--s-5); }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .actions { margin-top: var(--s-5); }

/* the hero artifact: a resume sheet with requirement mapping */
.specimen { position: relative; }
.sheet {
  position: relative; background: #fdfcf8; color: #1b1a15; padding: 28px 30px 30px;
  box-shadow: var(--lift); border: 1px solid #e3ded1; font-family: var(--f-serif);
  transform: rotate(-.6deg); transition: transform 500ms var(--ease);
}
.specimen:hover .sheet { transform: rotate(0deg); }
.sheet .s-name { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; }
.sheet .s-meta { font: .66rem/1.4 var(--f-mono); color: #6f6a5f; margin: 4px 0 14px; }
.sheet .s-sec { font: 600 .62rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: #6f6a5f; border-bottom: 1px solid #1b1a15; padding-bottom: 4px; margin: 14px 0 8px; }
.sheet .s-role { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; font-weight: 600; }
.sheet .s-role span { font: 400 .64rem var(--f-mono); color: #6f6a5f; }
.sheet ul { margin: 4px 0 0; padding-left: 14px; font-size: .74rem; line-height: 1.45; }
.sheet li { margin-bottom: 3px; }
.sheet .hl { background: linear-gradient(transparent 58%, rgba(201,58,27,.2) 58%); }
.sheet .req { margin-left: 4px; vertical-align: 1px; font-size: .58rem; color: #fff; background: #c93a1b; }
.jd-card {
  position: absolute; right: -14px; bottom: -28px; width: min(260px, 64%);
  background: var(--ink); color: var(--paper); padding: 12px 14px; font: .7rem/1.55 var(--f-mono);
  box-shadow: var(--lift); border-radius: var(--r);
}
.jd-card .h { display: flex; justify-content: space-between; opacity: .6; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; font-size: .6rem; }
.jd-card ol { list-style: none; margin: 0; padding: 0; }
.jd-card li { display: flex; gap: 8px; align-items: baseline; }
.jd-card li b { color: var(--accent); font-weight: 600; flex: none; }
.jd-card li.gap { opacity: .55; }
.jd-card li.gap b { color: inherit; }

.pipeline { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); counter-reset: stage; margin-top: var(--s-6); }
.pipeline > div { padding: var(--s-5) var(--s-5) var(--s-5) 0; }
.pipeline > div + div { padding-left: var(--s-5); border-left: 1px solid var(--rule); }
.pipeline .eyebrow::before { counter-increment: stage; content: "0" counter(stage) " / "; color: var(--accent); }
.pipeline h3 { font-size: var(--t-lg); }
.pipeline p { color: var(--ink-2); font-size: var(--t-sm); margin: 0; }
.pipeline .src { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--s-3); }
.pipeline .src .tag { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); margin: var(--s-6) 0 0; font-size: var(--t-sm); color: var(--ink-2); }
.facts dt { font: 500 var(--t-xs) var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: var(--s-1); }
.facts dd { margin: 0; }

/* auth / error */
.auth { display: grid; grid-template-columns: 1fr minmax(0, 400px); gap: var(--s-7); align-items: start; padding-top: var(--s-5); }
.auth .card { padding: var(--s-6) var(--s-5); }
.code-big { font: 600 clamp(4rem, 14vw, 8rem)/.9 var(--f-serif); letter-spacing: -.04em; color: var(--accent); margin: 0 0 var(--s-3); }

/* ---------- 20. Motion ---------- */
.rise { animation: rise 420ms var(--ease) both; }
.rise-2 { animation-delay: 80ms; } .rise-3 { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .sheet, .specimen:hover .sheet { transform: none; }
}
@media (prefers-contrast: more) { :root { --rule: var(--ink-3); } }

/* ---------- 21. Responsive ---------- */
@media (max-width: 900px) {
  .two, .grid3, .form.cols, .resume-layout, .hero, .auth { grid-template-columns: 1fr; }
  .hero { padding-bottom: var(--s-8); }
  .steps { grid-template-columns: 1fr 1fr; } .step:nth-child(2) { border-right: 0; } .step:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .side { position: static; max-height: none; } #preview { height: 90vh; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline > div, .pipeline > div + div { padding: var(--s-4) 0; border-left: 0; }
  .pipeline > div + div { border-top: 1px solid var(--rule); }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .top { gap: var(--s-3); padding-top: var(--s-2); }
  .top nav { order: 3; width: 100%; flex: none; overflow-x: auto; scrollbar-width: none; gap: var(--s-4); min-height: 38px; }
  .top nav a { padding: 0; white-space: nowrap; }
  .me { margin-left: auto; }
  .me .who { display: none; }
  .wrap { padding-top: var(--s-5); }
  .card, .panel { padding: var(--s-4); }
  .panel-head { margin: calc(var(--s-4) * -1) calc(var(--s-4) * -1) var(--s-3); padding: var(--s-2) var(--s-4); }
  .sheet { padding: 20px; transform: none; }
  .jd-card { position: relative; right: auto; bottom: auto; width: auto; margin: -10px 12px 0; }
}

/* phase2: resume */
.rz-co { font-style: italic; color: var(--ink-2); font-weight: 400; }
.rz-sub { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin: var(--s-6) 0 var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--rule-strong); }
.rz-sub h2 { margin: 0; }
.rz-bar { position: sticky; top: 56px; z-index: 5; background: var(--paper); padding: var(--s-2) 0; margin-bottom: var(--s-4); border-bottom: 1px solid var(--rule); }
.rz-bar #mode-hint { margin: 0; }
.rz-dirty { font-size: var(--t-xs); color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.rz-dirty::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; background: var(--accent); border-radius: 50%; vertical-align: 1px; }
/* the preview is a white sheet on the desk in both themes */
.resume-layout .preview-box { background: #fff; color-scheme: light; border: 1px solid var(--rule); outline: 1px solid transparent; transition: outline-color var(--dur) var(--ease); }
body[data-rz-mode="edit"] .preview-box { outline: 1px solid var(--ink); outline-offset: 4px; }
body[data-rz-mode="ai"] .preview-box { outline: 1px solid var(--accent); outline-offset: 4px; }
body.rz-has-dirty .preview-box { box-shadow: var(--lift), inset 3px 0 0 var(--accent); }
/* side panel: engineering-style mapping */
.side .tabs { position: sticky; top: 0; background: var(--paper); z-index: 1; }
.side .tabs .mono { font-size: var(--t-xs); color: var(--ink-3); margin-left: 2px; }
.rz-item { padding: var(--s-3) 0 var(--s-4); border-bottom: 1px solid var(--rule); }
.rz-item:last-child { border-bottom: 0; }
.rz-item h3 { margin: 0 0 var(--s-1); font-size: var(--t-md); }
.rz-item p { margin: var(--s-1) 0; }
ol.map { list-style: none; counter-reset: b; padding: 0; margin: var(--s-2) 0 0; }
ol.map li { counter-increment: b; display: grid; grid-template-columns: 2.2em 1fr; column-gap: var(--s-2); padding: var(--s-2) 0; border-top: 1px dashed var(--rule); font-size: var(--t-sm); }
ol.map li::before { content: "b" counter(b, decimal-leading-zero); grid-row: span 2; font: var(--t-xs)/1.7 var(--f-mono); color: var(--ink-3); }
.rz-to { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s-2); margin-top: 4px; }
.rz-meter { display: grid; gap: var(--s-1); font-size: var(--t-xs); color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: var(--s-3); }
.rz-meter .bar { display: block; height: 4px; background: var(--sheet-2); box-shadow: inset 0 0 0 1px var(--rule); }
.rz-meter .bar i { display: block; height: 100%; background: var(--accent); }
ul.cov li { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-2); align-items: baseline; }
ul.cov li .req { min-width: 2.4em; text-align: center; }
.rz-by { grid-column: 2; font-size: var(--t-xs); color: var(--ink-3); }
/* Ask AI panel */
.rz-ai { border-color: var(--accent); }
.rz-ai textarea { width: 100%; }
.rz-ai .actions { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }
.target { white-space: pre-wrap; color: var(--ink-3); border-left-color: var(--rule); }
.target.on { color: var(--ink); border-left-color: var(--accent); }
.rz-diff-head { display: flex; justify-content: space-between; margin-top: var(--s-4); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.rz-diff-head del, .rz-diff-head ins { padding: 0 3px; }
.rz-diff-head del { background: var(--err-wash); color: var(--err); }
.rz-diff-head ins { background: var(--ok-wash); color: var(--ok); text-decoration: none; }
.diff del { text-decoration-thickness: 1px; }
#tab-fact .diff { margin-top: var(--s-2); }
@media (max-width: 900px) { .rz-bar { top: 0; } }

/* phase2: workspace */
.flow { list-style: none; margin: var(--s-4) 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule-strong); }
.flow > li { padding: var(--s-4) var(--s-4) var(--s-4) 0; border-bottom: 1px solid var(--rule); }
.flow > li + li { padding-left: var(--s-4); border-left: 1px solid var(--rule); }
.flow > li > b { display: block; font: 600 var(--t-xs)/1 var(--f-mono); letter-spacing: .06em; color: var(--ink-3); margin-bottom: var(--s-2); }
.flow > li.current > b { color: var(--accent); }
.flow > li.done > b { color: var(--ok); }
.flow > li.done > b::after { content: " \2713"; }
.flow > li h3 { margin: 0 0 var(--s-1); }
.flow > li p { color: var(--ink-2); font-size: var(--t-sm); margin: 0 0 var(--s-3); }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; } .flow > li + li { padding-left: 0; border-left: 0; } }
.next-step { border-left: 3px solid var(--accent); }
.next-step h2 { margin-top: 0; }
details > summary { cursor: pointer; font-family: var(--f-mono); font-size: var(--t-sm); color: var(--ink-2); }
details[open] > summary { margin-bottom: var(--s-2); }

/* the hidden attribute must win over component display rules (e.g. .flash is flex) */
[hidden] { display: none !important; }

/* phase3: resume agent chat */
.agent { border-color: var(--ink); }
.agent-log { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-2) 0; }
.agent-log:empty { display: none; }
.agent .msg { font-size: var(--t-sm); padding: var(--s-2) var(--s-3); border-left: 2px solid var(--rule); background: var(--sheet-2); }
.agent .msg.user { border-left-color: var(--ink); background: transparent; }
.agent .msg.err { border-left-color: var(--err); background: var(--err-wash); }
.agent .msg.busy .txt { color: var(--ink-3); }
.agent .msg.busy .txt::after { content: " ▍"; animation: agent-blink 1s steps(2) infinite; }
@keyframes agent-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .agent .msg.busy .txt::after { animation: none; } }
.agent .msg .who { display: block; font-size: var(--t-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.agent .msg .txt { white-space: pre-wrap; }
.agent .trace { margin-top: var(--s-2); font-size: var(--t-xs); }
.agent .trace summary { cursor: pointer; color: var(--ink-3); }
.agent .trace ol { margin: var(--s-1) 0 0; padding-left: var(--s-4); color: var(--ink-2); }
.agent .trace li.bad { color: var(--err); }
.agent .chg { margin-top: var(--s-2); padding: var(--s-2); border: 1px solid var(--rule); background: var(--sheet); display: flex; flex-direction: column; gap: 2px; line-height: 1.5; }
.agent .chg-h { font-size: var(--t-xs); color: var(--accent-ink); }
.agent .chg del { background: var(--err-wash); color: var(--err); white-space: pre-wrap; }
.agent .chg ins { background: var(--ok-wash); color: var(--ok); text-decoration: none; white-space: pre-wrap; }
.agent-pending { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-2); margin-bottom: var(--s-2); border-left: 2px solid var(--accent); background: var(--accent-wash); font-size: var(--t-sm); }
.agent-pending .mono { flex: 1; }
.agent textarea { width: 100%; }
.agent .actions { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-2); }

/* phase3: master resume page */
.mr-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--s-5); align-items: start; margin-bottom: var(--s-6); }
.mr-toc { position: sticky; top: var(--s-4); display: flex; flex-direction: column; gap: 2px; font-size: var(--t-sm); }
.mr-toc a { display: flex; justify-content: space-between; padding: var(--s-1) var(--s-2); border-left: 2px solid var(--rule); color: var(--ink-2); text-decoration: none; }
.mr-toc a:hover { border-left-color: var(--accent); color: var(--ink); }
.mr-toc .mono { color: var(--ink-3); font-size: var(--t-xs); }
/* the resume itself stays black on white in both themes, like the PDF */
.mr-sheet { background: #fff; color: #16150f; box-shadow: var(--lift); padding: 48px 56px; max-width: 900px;
            font-family: var(--f-sans); font-size: 14px; line-height: 1.45; }
.mr-sheet a { color: #16150f; }
.mr-head { text-align: center; margin-bottom: 18px; }
.mr-name { font-family: var(--f-serif); font-size: 28px; font-weight: 600; margin: 0; letter-spacing: -.01em; color: #16150f; }
.mr-contact { margin: 6px 0 0; font: 12px/1.5 var(--f-mono); color: #5d584d; }
.mr-contact span + span::before { content: " · "; }
.mr-headline { margin: 8px 0 0; font-style: italic; color: #3b382f; }
.mr-sec { margin-top: 20px; scroll-margin-top: var(--s-4); }
.mr-sec h3 { font: 600 12px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: #16150f;
             border-bottom: 1.5px solid #16150f; padding-bottom: 5px; margin: 0 0 10px; }
.mr-caps { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0; }
.mr-caps dt { font-weight: 600; } .mr-caps dt .mono { font-weight: 400; font-size: 11px; color: #8a8478; }
.mr-caps dd { margin: 0; }
.mr-item { position: relative; padding: 8px 10px; margin: 0 -10px 6px; border-left: 2px solid transparent; scroll-margin-top: var(--s-4); }
.mr-item:hover, .mr-item:target { border-left-color: #c93a1b; background: #faf8f3; }
.mr-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.mr-title { font-weight: 600; } .mr-org { font-weight: 400; font-style: italic; }
.mr-date { white-space: nowrap; font-size: 12px; color: #5d584d; }
.mr-sum { margin: 2px 0 0; color: #3b382f; font-size: 13px; }
.mr-item ul { margin: 4px 0 0; padding-left: 18px; } .mr-item li { margin-bottom: 2px; }
.mr-meta { margin: 4px 0 0; font-size: 11.5px; color: #6f6a5f; word-break: break-word; }
.mr-meta a { color: #6f6a5f; margin-left: 6px; }
.mr-edit { margin-top: 4px; }
.mr-edit > summary { font-size: 11px; color: #8a8478; cursor: pointer; width: max-content; }
.mr-edit > summary:hover { color: #c93a1b; }
.mr-edit[open] { margin: 8px 0 4px; }
.mr-edit[open] > form { background: var(--paper); color: var(--ink); padding: var(--s-3); border: 1px solid var(--rule-strong); }
.mr-edit .actions { display: flex; align-items: center; gap: var(--s-2); }
#add { max-width: 900px; margin-left: calc(180px + var(--s-5)); }
@media (max-width: 900px) {
  .mr-layout { grid-template-columns: 1fr; }
  .mr-toc { position: static; flex-direction: row; flex-wrap: wrap; }
  .mr-sheet { padding: 24px 18px; font-size: 13px; }
  .mr-row { flex-direction: column; gap: 0; }
  #add { margin-left: 0; }
}
@media print {
  header.top, nav, .page-head, .mr-toc, .mr-edit, #add, .flash, footer { display: none !important; }
  .mr-layout { display: block; } .mr-sheet { box-shadow: none; padding: 0; max-width: none; }
  .mr-item:hover { background: none; border-color: transparent; }
}

/* phase4: tracker board, evidence, cover letter, interview prep, template switch */
.st-draft { --st: var(--ink-3); } .st-applied { --st: #2f6fb0; } .st-interview { --st: var(--warn); }
.st-offer { --st: var(--ok); } .st-rejected { --st: var(--err); }
.tag[class*="st-"] { color: var(--st); border-color: var(--st); }
.rz-sub .seg a { text-decoration: none; }
.pipe { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--t-sm); color: var(--ink-3); margin: var(--s-2) 0 var(--s-3); }
.pipe b { color: var(--st); font-size: var(--t-lg); font-weight: 600; }
.board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: var(--s-3); overflow-x: auto; padding-bottom: var(--s-2); }
.col { border-top: 2px solid var(--st); background: var(--sheet-2); padding: var(--s-2); min-height: 120px; }
.col-h { display: flex; justify-content: space-between; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--st); margin-bottom: var(--s-2); }
.col-h span { color: var(--ink-3); }
.col-empty { color: var(--ink-3); text-align: center; padding: var(--s-3) 0; }
.app-card { background: var(--sheet); border: 1px solid var(--rule); padding: var(--s-2) var(--s-3); margin-bottom: var(--s-2); transition: border-color var(--dur) var(--ease); }
.app-card:hover { border-color: var(--st); }
.app-t { font-weight: 600; color: var(--ink); text-decoration: none; display: block; line-height: 1.3; }
.app-t:hover { color: var(--accent); }
.app-c { font-size: var(--t-sm); color: var(--ink-2); }
.app-m { display: flex; gap: var(--s-2); flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); margin-top: 2px; }
.app-move { display: flex; gap: 2px; margin-top: var(--s-2); opacity: 0; transition: opacity var(--dur) var(--ease); }
.app-card:hover .app-move, .app-card:focus-within .app-move { opacity: 1; }
.app-move button { flex: 1; font: var(--t-xs) var(--f-mono); padding: 2px 0; background: transparent; border: 1px solid var(--rule); color: var(--ink-3); cursor: pointer; }
.app-move button:hover { border-color: var(--accent); color: var(--accent); }
@media (hover: none) { .app-move { opacity: 1; } }
@media (max-width: 900px) { .board { grid-template-columns: repeat(5, 220px); } }

.rz-controls { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; margin: 0 0 var(--s-3); }
.rz-controls form { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.rz-stage .seg button.on { background: var(--st); color: var(--paper); }
.rz-src { display: block; margin-top: 3px; padding-left: var(--s-2); border-left: 2px solid var(--ok); font-size: var(--t-xs); color: var(--ink-2); line-height: 1.45; }
.rz-src .mono { color: var(--ok); text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.rz-src.weak { border-left-color: var(--warn); } .rz-src.weak .mono { color: var(--warn); }
.rz-letter { width: 100%; font-family: var(--f-serif); font-size: var(--t-md, 1rem); line-height: 1.6; }
.gen-row { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }
.rz-q { border-bottom: 1px solid var(--rule); padding: var(--s-2) 0; }
.rz-q > summary { cursor: pointer; font-weight: 600; line-height: 1.4; }
.rz-q > summary .tag { font-weight: 400; margin-right: 4px; }
.star { display: grid; grid-template-columns: 1.4em 1fr; gap: 4px var(--s-2); margin: var(--s-2) 0; font-size: var(--t-sm); }
.star dt { font: 600 var(--t-xs)/1.6 var(--f-mono); color: var(--accent); }
.star dd { margin: 0; }
.seg a { display: inline-block; padding: .35rem .8rem; font: 500 var(--t-xs) var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink); }
.seg a + a { border-left: 1px solid var(--ink); }
.seg a.on { background: var(--ink); color: var(--paper); }

/* ---------- guide / tour ---------- */
.zh { color: var(--ink-3); font-size: .92em; }
.tour { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; margin-top: 8px; }
.tour-rail { list-style: none; margin: 0; padding: 0; position: sticky; top: 16px; border-left: 1px solid var(--rule); }
.tour-rail button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 14px;
  margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-3); font: inherit; cursor: pointer; }
.tour-rail button b { margin-right: 6px; font-weight: 500; }
.tour-rail button:hover { color: var(--ink); }
.tour-rail button.seen { color: var(--ink); }
.tour-rail button.on { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.tour-stage { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 28px 32px; min-height: 420px; }
.tour-step h2 { margin: 6px 0 2px; font-size: 1.6rem; letter-spacing: -.01em; }
.tour-step .zh { margin: 0 0 14px; }
.tour-step > p { max-width: 62ch; }
.tour:not(.js) .tour-step + .tour-step { border-top: 1px solid var(--rule); margin-top: 28px; padding-top: 28px; }
.tour:not(.js) .tour-nav { display: none; }
.tour-list { padding-left: 18px; max-width: 64ch; line-height: 1.55; }
.tour-list li { margin-bottom: 6px; }
.tour-dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; max-width: 70ch; margin: 14px 0; }
.tour-dl dt { font-weight: 600; } .tour-dl dd { margin: 0; color: var(--ink); }
.tour-demo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 20px; padding: 14px;
  border: 1px dashed var(--rule); border-radius: 8px; background: var(--paper); }
.td-card { border: 1px solid var(--rule); background: var(--sheet); border-radius: 6px; padding: 6px 10px; font-size: .88rem; }
.td-card.strong { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.tour-demo.chat { display: block; }
.tour-demo.chat p { margin: 0 0 8px; padding: 8px 12px; border-radius: 8px; max-width: 56ch; font-size: .92rem; }
.tour-demo.chat .me { background: var(--ink); color: var(--paper); margin-left: auto; }
.tour-demo.chat .bot { background: var(--sheet); border: 1px solid var(--rule); }
.tour-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); }
@media (max-width: 760px) {
  .tour { grid-template-columns: 1fr; }
  .tour-rail { position: static; display: flex; overflow-x: auto; border-left: 0; border-bottom: 1px solid var(--rule); }
  .tour-rail li { flex: none; }
  .tour-rail button { border-left: 0; border-bottom: 2px solid transparent; margin: 0 0 -1px; white-space: nowrap; }
  .tour-rail button.on { border-bottom-color: var(--accent); }
  .tour-stage { padding: 20px 16px; }
  .tour-dl { grid-template-columns: 1fr; } .tour-dl dd { margin-bottom: 8px; }
}
