/* Job Consultant: one stylesheet for every page.
   Design system: tokens (colour, type, space, shape) first, then base, layout, components, then page parts.
   Rules: colours only as tokens; font sizes only from --fs-*; paddings, margins and gaps from --sp-*;
   one page width; buttons are primary (default), .secondary, .link or .danger-btn. tests/test_design_system.py checks these. */

/* ---- Tokens ---- */
:root {
  --bg: #f6f6f3; --card: #ffffff; --ink: #1c1c1a; --muted: #5f5e57; --line: #e2e1db; --field-line: #8d8c84;
  --accent: #2459d6; --accent-ink: #ffffff; --accent-soft: #e7eefc; --focus: #2459d6;
  --good: #1a7a43; --mid: #8a5a0c; --low: #b3261e; --danger-ink: #ffffff;
  --note-bg: #e8f4ec; --note-ink: #1d4d31; --error-bg: #fdecea; --error-ink: #8a1c12; --warn-bg: #fdf3e1; --warn-ink: #6b4508;
  --tag-must-bg: #fbe3e0; --tag-must-ink: #8a1c12; --tag-nice-bg: #eceae4; --tag-nice-ink: #4a4944;
  --tag-cert-bg: #e3ebfd; --tag-cert-ink: #1d3f99; --mark-bg: #fde68a; --mark-ink: #1c1c1a;
  --shadow: 0 1px 2px rgb(28 28 26 / 6%); --shadow-lg: 0 4px 16px rgb(28 28 26 / 18%);
  --fs-1: 13px; --fs-2: 14px; --fs-3: 16px; --fs-4: 18px; --fs-5: 22px; --fs-6: 28px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --radius: 12px; --radius-sm: 8px; --pill: 999px; --page: 1120px; --tabbar: 56px; --measure: 68ch;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* Dark: follows the device unless the person picked Light or Dark in Settings (data-theme on <html>).
   The two dark blocks must stay identical (a test checks). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514; --card: #1f1f1d; --ink: #ecebe6; --muted: #a8a7a0; --line: #34332f; --field-line: #75746d;
    --accent: #7aa2ff; --accent-ink: #0d1a33; --accent-soft: #1d2a47; --focus: #9cbcff;
    --good: #4cc27f; --mid: #e0a43a; --low: #f07167; --danger-ink: #1a0806;
    --note-bg: #183324; --note-ink: #bfe8cf; --error-bg: #3a1a17; --error-ink: #ffc9c2; --warn-bg: #3a2a10; --warn-ink: #f5d9a8;
    --tag-must-bg: #45211d; --tag-must-ink: #ffc9c2; --tag-nice-bg: #2c2b28; --tag-nice-ink: #cfcdc6;
    --tag-cert-bg: #1d2a47; --tag-cert-ink: #c3d4ff; --mark-bg: #5c4a12; --mark-ink: #fff3c4;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%); --shadow-lg: 0 4px 16px rgb(0 0 0 / 50%);
  }
}
:root[data-theme="dark"] {
    --bg: #151514; --card: #1f1f1d; --ink: #ecebe6; --muted: #a8a7a0; --line: #34332f; --field-line: #75746d;
    --accent: #7aa2ff; --accent-ink: #0d1a33; --accent-soft: #1d2a47; --focus: #9cbcff;
    --good: #4cc27f; --mid: #e0a43a; --low: #f07167; --danger-ink: #1a0806;
    --note-bg: #183324; --note-ink: #bfe8cf; --error-bg: #3a1a17; --error-ink: #ffc9c2; --warn-bg: #3a2a10; --warn-ink: #f5d9a8;
    --tag-must-bg: #45211d; --tag-must-ink: #ffc9c2; --tag-nice-bg: #2c2b28; --tag-nice-ink: #cfcdc6;
    --tag-cert-bg: #1d2a47; --tag-cert-ink: #c3d4ff; --mark-bg: #5c4a12; --mark-ink: #fff3c4;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%); --shadow-lg: 0 4px 16px rgb(0 0 0 / 50%);
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* ---- Base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs-3)/1.55 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-size: var(--fs-6); line-height: 1.2; margin: 0 0 var(--sp-2); text-wrap: balance; }
h2 { font-size: var(--fs-5); line-height: 1.3; margin: var(--sp-6) 0 var(--sp-3); }
h3 { font-size: var(--fs-4); line-height: 1.35; margin: var(--sp-5) 0 var(--sp-2); }
h4 { font-size: var(--fs-3); margin: var(--sp-4) 0 var(--sp-1); }
h2.inline { display: inline; margin: 0; }
p { margin: var(--sp-2) 0; }
p, li, dd { max-width: var(--measure); }
code { font-family: var(--mono); font-size: var(--fs-2); background: var(--accent-soft); padding: 1px var(--sp-1); border-radius: var(--sp-1); overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.lead, .muted, .hint { color: var(--muted); }
.lead { font-size: var(--fs-4); }
.hint { font-size: var(--fs-2); }
.small { font-size: var(--fs-1); font-weight: 400; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--sp-4); top: var(--sp-2); background: var(--card); padding: var(--sp-2) var(--sp-3); z-index: 10; }
[hidden], .sprite { display: none !important; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Layout: header with the 6-section main menu, the section's sub-menu, breadcrumbs, main, footer.
   On phones the main menu moves to a tab bar fixed at the bottom. One page width everywhere. ---- */
.top { display: flex; gap: var(--sp-5); align-items: center; padding: 0 var(--sp-5); min-height: 56px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 750; color: var(--ink); text-decoration: none; font-size: var(--fs-4); margin-right: auto; white-space: nowrap; }
.mainnav { display: flex; gap: var(--sp-1); align-self: stretch; }
.mainnav a { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-3); color: var(--ink); text-decoration: none; font-size: var(--fs-3); font-weight: 500; border-bottom: 3px solid transparent; }
.mainnav a:hover { color: var(--accent); }
.mainnav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.subnav { background: var(--card); border-bottom: 1px solid var(--line); }
.subnav-inner { max-width: var(--page); margin: 0 auto; padding: 0 var(--sp-4); display: flex; gap: var(--sp-1); align-items: center; overflow-x: auto; scrollbar-width: none; }
.subnav a { flex: none; padding: var(--sp-3) var(--sp-3); color: var(--muted); text-decoration: none; font-size: var(--fs-2); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }
.logout { display: inline-flex; gap: var(--sp-2); align-items: baseline; margin: 0 0 0 auto; padding-left: var(--sp-4); white-space: nowrap; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: 0 0 var(--sp-3); padding: 0; font-size: var(--fs-2); color: var(--muted); }
.crumbs li { max-width: none; }
.crumbs li + li::before { content: "›"; margin-right: var(--sp-1); color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs [aria-current="page"] { color: var(--ink); }
.tabbar { display: none; }
main { max-width: var(--page); margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-7); }
.foot { max-width: var(--page); margin: 0 auto; padding: 0 var(--sp-4) var(--sp-6); color: var(--muted); font-size: var(--fs-1); }
.narrow { max-width: 440px; margin: var(--sp-5) auto; }

@media (max-width: 860px) {
  .top { padding: 0 var(--sp-4); min-height: 52px; }
  .mainnav { display: none; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabbar); padding: var(--sp-1) 0;
    color: var(--muted); text-decoration: none; font-size: var(--fs-1); font-weight: 500; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 650; box-shadow: inset 0 3px 0 var(--accent); }
  .tabbar .icon { width: 22px; height: 22px; }
  body { padding-bottom: calc(var(--tabbar) + 1px + env(safe-area-inset-bottom)); }
  .subnav-inner { padding: 0 var(--sp-2); }
}

/* ---- Surfaces: every card-like box shares one look ---- */
fieldset, .card, .job, .week, .stat, .rewrite, .answer, .star, .doc, .dashboard, .setup, .next-actions, .nps, .step,
.score, .change, .cards li, .table-wrap, .feedback-panel, .factcheck, .next-step, .match-list a {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---- Forms ---- */
fieldset { padding: var(--sp-4); margin: 0 0 var(--sp-4); min-width: 0; max-width: 800px; }
legend { font-weight: 600; padding: 0 var(--sp-2); }
label { display: block; margin: var(--sp-2) 0 var(--sp-3); font-size: var(--fs-2); font-weight: 500; color: var(--ink); }
label .hint, label .muted { font-weight: 400; }
textarea, select, input:not([type]), input[type=text], input[type=url], input[type=number], input[type=email], input[type=password],
input[type=date], input[type=time], input[type=search], input[type=tel] {
  display: block; width: 100%; margin-top: var(--sp-1); padding: var(--sp-2) var(--sp-3); font: inherit; color: var(--ink);
  font-size: var(--fs-3); /* 16px or more stops iPhones zooming in when a field is tapped */
  border: 1px solid var(--field-line); border-radius: var(--radius-sm); background: var(--card); min-height: 44px;
}
::placeholder { color: var(--muted); opacity: 1; }
[aria-invalid="true"] { border-color: var(--low) !important; box-shadow: 0 0 0 1px var(--low); }
.field-error { display: flex; gap: var(--sp-1); align-items: center; color: var(--low); font-size: var(--fs-2); font-weight: 500; margin: var(--sp-1) 0 0; }
input[type=file] { display: block; width: 100%; margin-top: var(--sp-1); font: inherit; font-size: var(--fs-3); color: var(--muted); min-height: 44px; padding: var(--sp-1) 0; }
input[type=file]::file-selector-button {
  margin-right: var(--sp-3); min-height: 40px; padding: var(--sp-2) var(--sp-4); font: inherit; font-weight: 600; cursor: pointer;
  color: var(--accent); background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius-sm);
}
textarea { resize: vertical; }
label.check { display: flex; gap: var(--sp-3); align-items: center; color: var(--ink); font-size: var(--fs-3); font-weight: 400; margin: 2px 0; min-height: 40px; }
label.check input, .inline-choice input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 var(--sp-3); }

/* ---- Buttons: primary (default), .secondary, .link, .danger-btn; .small-btn for compact rows ---- */
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 44px;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-5); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.25;
}
button:hover, a.button:hover { filter: brightness(1.08); }
button:active, a.button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: wait; }
.secondary, a.button.secondary { background: var(--card); color: var(--accent); }
.secondary:hover, a.button.secondary:hover { background: var(--accent-soft); filter: none; }
.small-btn { min-height: 36px; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-2); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; font-size: var(--fs-2); text-decoration: underline; text-underline-offset: 2px; }
.danger { color: var(--low) !important; }
.danger-btn { background: var(--low); border-color: var(--low); color: var(--danger-ink); }
.danger-btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; margin: var(--sp-4) 0; }
.actions form { margin: 0; }
form.inline { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: var(--sp-1) 0; }
form.inline select { flex: 1 1 110px; min-width: 0; width: auto; margin: 0; padding: var(--sp-1) var(--sp-2); min-height: 36px; }
form.inline input[type=number] { width: 90px; margin: 0; padding: var(--sp-1) var(--sp-2); min-height: 36px; }
form.inline button { white-space: nowrap; }
form.inline-reset { display: inline; }

/* ---- Messages ---- */
.error, .note, .warn-note { border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
.error { background: var(--error-bg); color: var(--error-ink); }
.note { background: var(--note-bg); color: var(--note-ink); }
.warn-note { background: var(--warn-bg); color: var(--warn-ink); }
.note ul, .error ul { margin: var(--sp-2) 0 0; }
.note a, .error a, .warn-note a { color: inherit; }

/* ---- Badges: .tag plus one variant ---- */
.tag, .change-tag { display: inline-block; font-style: normal; font-size: var(--fs-1); font-weight: 600; line-height: 1.5; padding: 0 var(--sp-2); border-radius: var(--pill); white-space: nowrap; background: var(--tag-nice-bg); color: var(--tag-nice-ink); }
.tag { margin-left: var(--sp-2); }
.tag.must, .tag.bad, .change-tag.left { background: var(--tag-must-bg); color: var(--tag-must-ink); }
.tag.cert, .change-tag.new { background: var(--tag-cert-bg); color: var(--tag-cert-ink); }
.tag.good, .tag.best, .tag.outcome-interview, .tag.outcome-offer, .change-tag.reworded { background: var(--note-bg); color: var(--note-ink); }
.tag.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chips span { display: inline-block; background: var(--card); border: 1px solid var(--line); border-radius: var(--pill); padding: 2px var(--sp-3); margin: 0 var(--sp-2) var(--sp-2) 0; font-size: var(--fs-2); }
.chips a { text-decoration: none; }

/* ---- Components ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.cards li { border-radius: var(--radius-sm); padding: var(--sp-3); display: grid; gap: 2px; max-width: none; }
.cards span { color: var(--muted); font-size: var(--fs-2); }
.cards label.check span { color: var(--ink); font-size: var(--fs-3); }
.rewrite { border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
.rewrite p { margin: var(--sp-1) 0; }
.before { text-decoration: line-through; color: var(--muted); }
.after { font-weight: 600; }
details > summary { cursor: pointer; }
.dial { flex: none; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center; font-size: var(--fs-6); font-weight: 700; border: 6px solid currentColor; }
.dial small { font-size: var(--fs-1); color: var(--muted); }
.dial.small { width: 56px; height: 56px; font-size: var(--fs-4); border-width: 4px; }
.dial.good { color: var(--good); } .dial.mid { color: var(--mid); } .dial.low { color: var(--low); }
.progress { height: 10px; background: var(--line); border-radius: var(--pill); overflow: hidden; margin: var(--sp-3) 0 var(--sp-1); }
.progress .bar { height: 100%; width: var(--w, 0%); background: var(--good); transition: width .3s; }
/* Loading skeletons: an empty .skeleton is one block; with <span>s it is lines of text. */
.skeleton { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0; }
.skeleton:empty, .skeleton > span { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--line), var(--card), var(--line)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton:empty { height: 64px; margin: 0; }
.skeleton > span { display: block; height: var(--sp-4); }
.skeleton > span.title { height: var(--sp-5); width: 45%; }
.skeleton > span:nth-child(3n) { width: 70%; }
.skeleton[hidden] { display: none; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.prose { max-width: 760px; line-height: 1.6; }
.prose h2 { margin-top: var(--sp-6); }
.prose li { margin-bottom: var(--sp-2); }
.plain { list-style: none; padding: 0; }
.plain li { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; max-width: none; }
.plain li form.inline { margin: 0 0 0 auto; }
input.copy { width: 100%; margin-top: var(--sp-2); font-family: var(--mono); font-size: var(--fs-1); }
.tabs { display: flex; flex-wrap: wrap; gap: var(--sp-1); border-bottom: 1px solid var(--line); margin: 0 0 var(--sp-5); }
.tabs a { padding: var(--sp-2) var(--sp-4); text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-3); }
.stat { border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); display: grid; gap: var(--sp-1); }
.stat-value { font-size: var(--fs-5); font-weight: 700; }
.stat-label { color: var(--muted); font-size: var(--fs-1); }
.stat.warn { border-color: var(--mid); }
.stat.bad { border-color: var(--low); }
.stat.bad .stat-value { color: var(--low); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); margin: var(--sp-3) 0 var(--sp-5); }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-2); }
th, td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: var(--fs-1); color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.row-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
td.row-actions form.inline { margin: 0; }
table.compare { min-width: 560px; }
table.compare th, table.compare td { vertical-align: top; }
table.compare tbody th { white-space: nowrap; }
table.compare ul { margin: 0; padding-left: 1.1em; }
table.compare tr.best th, table.compare tr.best td { background: var(--note-bg); }
table.heatmap { border-collapse: separate; border-spacing: 3px; min-width: 100%; }
table.heatmap th, table.heatmap td { padding: var(--sp-1) var(--sp-2); white-space: nowrap; border: 0; }
table.heatmap tbody th { font-weight: 600; color: var(--ink); }
table.heatmap .job-col { text-align: center; font-weight: 500; }
table.heatmap td.cell { width: 22px; min-width: 22px; height: 22px; padding: 0; border-radius: var(--sp-1); background: var(--line); }
table.heatmap td.cell.on { background: var(--accent); }
table.heatmap td.count { min-width: 64px; border-radius: var(--sp-1); background: linear-gradient(to right, var(--accent-soft) var(--share), transparent var(--share)); }
table.heatmap td.learn form { margin: 0; }
.job-legend { columns: 2 280px; font-size: var(--fs-2); }

/* ---- Fit analysis and resume ---- */
.score { display: flex; gap: var(--sp-5); align-items: center; padding: var(--sp-5); }
.plan > li { margin-bottom: var(--sp-3); } .plan ul { margin: var(--sp-2) 0; }
.doc { padding: var(--sp-5); overflow-wrap: anywhere; }
.doc h3 { font-size: var(--fs-2); border-bottom: 1px solid var(--line); padding-bottom: var(--sp-1); margin: var(--sp-5) 0 var(--sp-2); }
.doc .doc-name { margin: 0; font-size: var(--fs-5); }
.doc p { margin: var(--sp-1) 0; }
.letter { font-family: inherit; line-height: 1.5; }

/* ---- Autopilot and job pages ---- */
.toolbar { display: flex; gap: var(--sp-4); align-items: center; flex-wrap: wrap; }
.toolbar form { margin: 0; }
.job { padding: var(--sp-4) var(--sp-4); margin-bottom: var(--sp-4); }
.job-head { display: flex; gap: var(--sp-3); align-items: center; }
.job-head h3 { margin: 0; }
.job-head p { margin: 2px 0 0; }
.job .actions { gap: var(--sp-2); margin: var(--sp-3) 0 0; }
.questions { border-top: 1px solid var(--line); margin-top: var(--sp-3); padding-top: var(--sp-3); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 var(--sp-3); }
details.curated { margin: var(--sp-1) 0 var(--sp-4); }
details.curated summary { color: var(--accent); }
details.why, details.not-interested { margin: var(--sp-2) 0; }
details.why summary, details.not-interested summary { color: var(--accent); font-size: var(--fs-2); min-height: 36px; display: flex; align-items: center; }
details.why ul { margin: var(--sp-1) 0 var(--sp-2); padding-left: 1.2em; }
.job-page h1 { margin: 0; }
.job-page h2 { margin-top: var(--sp-5); }
.job-links { padding-left: var(--sp-5); }
.jd-text { white-space: pre-wrap; margin-top: var(--sp-2); }
.reqs { list-style: none; padding: 0; margin: var(--sp-2) 0 var(--sp-3); display: grid; gap: var(--sp-2); }
.req { display: flex; gap: var(--sp-2); align-items: flex-start; }
.req-mark { flex: 0 0 1.4em; font-weight: 700; text-align: center; }
.req.met .req-mark { color: var(--good); }
.req.partial .req-mark { color: var(--mid); }
.req.missing .req-mark { color: var(--low); }
.req q { font-size: var(--fs-2); }
.factcheck { border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); margin: var(--sp-2) 0 var(--sp-4); }
.factcheck.warn { border-left: 4px solid var(--mid); }
.factcheck.ok { border-left: 4px solid var(--good); }
.factcheck h4 { margin: 0 0 var(--sp-1); }
.factcheck ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-4); }

/* ---- Learning path ---- */
.week { border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-2); }
.phase { margin-top: var(--sp-5); }
.tasks, .resources { list-style: none; padding: 0; margin: var(--sp-2) 0; }
.resources li { margin: var(--sp-1) 0; }
form.tick { margin: 0; display: flex; gap: var(--sp-2); align-items: baseline; justify-content: space-between; }

/* ---- Mock interview ---- */
.turn { border-top: 1px solid var(--line); padding-top: var(--sp-2); margin-top: var(--sp-5); }
.turn.current textarea { margin-bottom: var(--sp-3); }
.score-line { display: flex; gap: var(--sp-3); align-items: center; }
.answer { white-space: pre-wrap; border-radius: var(--radius-sm); padding: var(--sp-3); }
.voice { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; margin: 0 0 var(--sp-3); }
.voice .hint { flex-basis: 100%; margin: 0; }
label.inline { display: inline-flex; gap: var(--sp-2); align-items: center; margin: 0; }
label.inline select { width: auto; margin: 0; }
.star { border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); margin: var(--sp-3) 0; }
.star-parts { list-style: none; padding: 0; margin: var(--sp-2) 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.star-parts li { border: 1px solid var(--line); border-radius: var(--pill); padding: 2px var(--sp-3); font-size: var(--fs-2); }
.star-parts em { font-style: normal; font-weight: 600; }
.star-clear em { color: var(--good); } .star-weak em { color: var(--mid); } .star-missing em { color: var(--low); }
.interview-form .row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

/* ---- Tracker ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(208px, 1fr); gap: var(--sp-3); align-items: start; margin: var(--sp-4) 0 var(--sp-5); overflow-x: auto; padding-bottom: var(--sp-2); }
.column { border: 1px dashed var(--line); border-radius: var(--radius); padding: var(--sp-2); min-height: 80px; }
.column h2 { font-size: var(--fs-3); margin: var(--sp-1) var(--sp-1) var(--sp-2); }
.card { border-radius: var(--radius-sm); padding: var(--sp-3); margin-bottom: var(--sp-2); display: grid; gap: var(--sp-1); overflow-wrap: anywhere; }
.card.due { border-color: var(--mid); box-shadow: inset 3px 0 0 var(--mid); }
.card .notes { white-space: pre-wrap; margin: var(--sp-1) 0 0; color: var(--muted); }
.card-links a + a { margin-left: var(--sp-3); }
.debrief { border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.referrers { padding-left: 1.3em; display: grid; gap: var(--sp-3); }
.referrers form.inline { margin-top: var(--sp-2); }
.row-form { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; }
.row-form label { flex: 1 1 200px; margin: 0; }
.radio-row { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.radio-row legend { width: 100%; }
.inline-choice { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: normal; margin: 0; min-height: 40px; color: var(--ink); }
.inline-choice input { margin: 0; }
fieldset.checks { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
fieldset.checks legend { width: 100%; }
fieldset fieldset.checks { border: 0; padding: 0; margin: 0; box-shadow: none; background: none; }
fieldset fieldset.checks legend { padding: 0; margin-bottom: var(--sp-1); font-size: var(--fs-2); font-weight: 500; }  /* reads like the other field labels */
fieldset.checks label, .radio-row label { min-height: 36px; display: inline-flex; align-items: center; gap: var(--sp-2); margin: 2px 0; font-weight: 400; }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--sp-4); }
.offer-grid fieldset.offer { margin: 0; }
ul.versions li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); max-width: none; }
ul.versions form.inline select { max-width: 220px; }

/* ---- Getting started and home ---- */
.steps { list-style: none; padding: 0; display: grid; gap: var(--sp-3); margin: var(--sp-5) 0; }
.step { display: flex; gap: var(--sp-4); align-items: flex-start; padding: var(--sp-4); max-width: none; }
.step h2 { margin: 0 0 var(--sp-1); font-size: var(--fs-4); }
.step p { margin: 0 0 var(--sp-3); }
.step-mark { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-content: center; font-weight: 700; border: 2px solid var(--accent); color: var(--accent); }
.step.done .step-mark { background: var(--accent); color: var(--accent-ink); }
.step.done h2 { color: var(--muted); }
.first-run { max-width: 800px; }
.step-count { margin: 0 0 var(--sp-2); color: var(--muted); font-size: var(--fs-2); font-weight: 600; }
.progress-steps { list-style: none; padding: 0; margin: 0 0 var(--sp-5); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); counter-reset: none; }
.progress-steps li { display: flex; flex-direction: column; gap: var(--sp-2); padding-top: var(--sp-2); border-top: 4px solid var(--line); font-size: var(--fs-2); color: var(--muted); max-width: none; }
.progress-steps li.done { border-top-color: var(--good); color: var(--ink); }
.progress-steps li[aria-current="step"] { border-top-color: var(--accent); color: var(--ink); font-weight: 650; }
.progress-steps .step-mark { width: 26px; height: 26px; font-size: var(--fs-2); }
.progress-steps li.done .step-mark { background: var(--good); border-color: var(--good); color: var(--accent-ink); }
.progress-steps li.done .step-mark .icon { width: 16px; height: 16px; }
.skip-setup { margin-top: var(--sp-5); }
details.try summary { font-weight: 600; }
/* Score-first pages: the score, verdict and one next step lead; the rest folds into sections */
.verdict { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-4); }
.req-summary { margin: 0 0 var(--sp-3); font-size: var(--fs-2); }
.job-page .job-head { margin-bottom: var(--sp-1); }
.job-page .job-head h1 { margin: 0; }
.job-page .next-step, .score + .next-step { margin-top: var(--sp-4); }
.next-step form { margin: 0; }
details.section { border-top: 1px solid var(--line); padding: var(--sp-2) 0; }
details.section:last-of-type { border-bottom: 1px solid var(--line); }
details.section > summary { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; list-style: none; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::before { content: ""; flex: none; width: var(--sp-2); height: var(--sp-2); border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
details.section[open] > summary::before { transform: rotate(45deg); }
details.section > summary h2 { margin: 0; font-size: var(--fs-4); }
details.section[open] > summary { margin-bottom: var(--sp-2); }
details.other-resume > summary { color: var(--accent); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
details.match-more > summary { color: var(--accent); font-size: var(--fs-2); font-weight: 600; min-height: 36px; display: flex; align-items: center; }

.try { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: var(--sp-4); margin: var(--sp-5) 0; }
.try h2 { margin-top: 0; }
.getting-started a { font-weight: 600; }
.wizard legend { display: flex; align-items: center; gap: var(--sp-3); font-weight: 600; }
.wizard .step-mark { width: 26px; height: 26px; font-size: var(--fs-2); }
.setup, .next-actions, .dashboard { padding: var(--sp-4); margin: 0 0 var(--sp-5); }
.setup h2, .next-actions h2, .dashboard h2 { margin-top: 0; font-size: var(--fs-4); }
.dashboard h3 { font-size: var(--fs-2); color: var(--muted); margin: var(--sp-4) 0 var(--sp-2); font-weight: 600; }
.setup-tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.setup-tasks .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-right: var(--sp-2); }
.setup-tasks [data-state=running] .dot { background: var(--mid); animation: pulse 1.2s ease-in-out infinite; }
.setup-tasks [data-state=done] .dot { background: var(--good); }
.setup-tasks [data-state=failed] .dot { background: var(--low); }
@keyframes pulse { 50% { opacity: .35; } }
.next-step { padding: var(--sp-5); margin: 0 0 var(--sp-5); border-left: 4px solid var(--accent); }
.next-step h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-5); }
.next-step h2 a { color: var(--ink); text-decoration: none; }
.next-step p { margin: 0 0 var(--sp-4); }
.eyebrow { margin: 0 0 var(--sp-1) !important; color: var(--accent); font-size: var(--fs-2); font-weight: 650; }
.match-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.match-list li { max-width: none; }
.match-list a { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3); color: var(--ink); text-decoration: none; }
.match-list a:hover { border-color: var(--accent); }
.match-list .icon { margin-left: auto; color: var(--muted); }
.next-actions ol { margin: 0; padding-left: 1.3em; display: grid; gap: var(--sp-3); }
.chip-label { margin-right: var(--sp-1); min-width: 6.5em; display: inline-block; }
.pipeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--sp-2); }
.pipeline a { display: grid; gap: 2px; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.pipeline a:hover, .pipeline a:focus-visible { border-color: var(--accent); }
.pipeline .stat-value { font-size: var(--fs-5); }
.week-counts { list-style: none; padding: 0; margin: 0 0 var(--sp-2); display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-1) var(--sp-4); }
.trend { font-size: var(--fs-1); color: var(--muted); margin-left: var(--sp-1); }
.trend.up { color: var(--good); }
.trend.down { color: var(--low); }
.goals { list-style: none; padding: 0; margin: 0 0 var(--sp-2); display: grid; gap: var(--sp-2); }
.goals li { display: grid; gap: var(--sp-1); }
.goal-bar { display: block; height: 8px; background: var(--line); border-radius: var(--pill); overflow: hidden; }
.goal-bar span { display: block; height: 100%; width: var(--w, 0%); background: var(--good); }
.goal-form form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 var(--sp-3); align-items: end; }
.nps { padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-5); }
.nps p { margin: 0 0 var(--sp-2); }
.nps-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: var(--sp-1); }
.nps-option { margin: 0; position: relative; }
.nps-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.nps-option span { display: flex; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--field-line); border-radius: var(--radius-sm); color: var(--ink); font-weight: 600; }
.nps-option input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.nps-option input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.nps-ends { display: flex; justify-content: space-between; margin-top: var(--sp-1) !important; }
.release ul { padding-left: 1.2em; }

/* ---- Application answers ---- */
.answer-row { display: grid; gap: var(--sp-1); margin: 0 0 var(--sp-3); }
.answer-row.custom { grid-template-columns: 1fr; }
.answer-row .small-btn { justify-self: start; }
.answers-list dt { font-weight: 600; margin-top: var(--sp-3); }
.answers-list dd { margin: 2px 0 0; }
.tailor-answers { margin-top: var(--sp-3); display: grid; gap: var(--sp-2); }

/* ---- What changed (tailored resume vs original) ---- */
.change-counts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin: var(--sp-2) 0 var(--sp-4); }
.change-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.change { border-left-width: 4px; border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3); max-width: none; }
.change.same { border-left-color: var(--line); }
.change.reworded { border-left-color: var(--mid); }
.change.new { border-left-color: var(--accent); }
.change.left { border-left-color: var(--low); }
.change-text { margin: var(--sp-1) 0 2px; }
ins { background: var(--note-bg); color: var(--note-ink); text-decoration: none; border-radius: 3px; padding: 0 2px; }
del { color: var(--low); }
mark { background: var(--mark-bg); color: var(--mark-ink); border-radius: 3px; padding: 0 2px; }

/* ---- Waiting page for AI requests ---- */
.wait-progress { height: 6px; background: var(--line); border-radius: var(--pill); overflow: hidden; margin: var(--sp-3) 0 var(--sp-4); }
.wait-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 1s linear; }
.wait-steps { padding-left: var(--sp-5); margin: var(--sp-2) 0 var(--sp-4); }
.wait-steps li { color: var(--muted); margin: var(--sp-1) 0; }
.wait-steps li.done { color: var(--ink); }
.wait-steps li.done::marker { content: "✓  "; color: var(--good); }
.wait-steps li.current { color: var(--ink); font-weight: 600; }

/* ---- Feedback: a button fixed in a corner on every signed-in page ---- */
.feedback { margin: 0 0 var(--sp-4); }
.feedback-fab { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 20; }
.feedback-fab summary { list-style: none; cursor: pointer; margin-left: auto; width: max-content; padding: var(--sp-2) var(--sp-4);
  border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: var(--fs-2); box-shadow: var(--shadow-lg); }
.feedback-fab summary::-webkit-details-marker { display: none; }
.feedback-fab:not([open]) .feedback-panel { display: none; }
.feedback-panel { position: absolute; right: 0; bottom: calc(100% + 8px); width: min(300px, calc(100vw - 32px)); padding: var(--sp-3); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.feedback-panel p { margin: 0 0 var(--sp-2); }
.feedback-kinds { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.feedback-kinds button { min-height: 36px; }

.feedback summary { color: var(--accent); font-weight: 500; }
.feedback form { max-width: 560px; margin-top: var(--sp-2); }
.feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; width: 100%; color: var(--ink); }
@media (max-width: 860px) { /* phones: the button sits in the header, clear of the content and the tab bar */
  .feedback-fab { top: var(--sp-2); bottom: auto; right: var(--sp-3); }
  .feedback-fab summary { padding: var(--sp-1) var(--sp-3); box-shadow: none; }
  .feedback-panel { top: calc(100% + 8px); bottom: auto; }
}

/* ---- Small screens ---- */
@media (max-width: 960px) { main .board { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-x: visible; } }
@media (max-width: 700px) {
  main { padding: var(--sp-4) var(--sp-4) var(--sp-7); }
  h1 { font-size: var(--fs-5); }
  h2 { font-size: var(--fs-4); margin-top: var(--sp-5); }
  .grid, main .board { grid-template-columns: 1fr; }
  .score { flex-direction: column; align-items: flex-start; }
  .doc { padding: var(--sp-4); }
  .actions > *, .actions form, .actions form button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton:empty, .skeleton > span, .setup-tasks [data-state=running] .dot { animation: none; }
  details.section > summary::before { transition: none; }
  .toast, .toast.leaving { transition: none; }
  .progress .bar, .wait-progress span { transition: none; }
  button:active, a.button:active { transform: none; }
}
/* Empty states: one heading, one sentence, one next action */
.empty-state { text-align: center; padding: var(--sp-6) var(--sp-4); border: 1px dashed var(--field-line); border-radius: var(--radius); background: var(--card); margin: var(--sp-4) 0; }
.empty-state > .icon { width: 32px; height: 32px; color: var(--muted); }
.empty-state h2 { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-4); }
.empty-state p { margin: 0 auto var(--sp-4); max-width: 46ch; color: var(--muted); }
.empty-state form { margin: 0; }

/* Toasts: confirmations after a save. Bottom-right on desktop, above the tab bar on phones. */
.toasts { position: fixed; right: var(--sp-4); bottom: calc(var(--sp-7) + var(--sp-4));  /* clear of the Feedback button */
   z-index: 30; display: grid; gap: var(--sp-2); max-width: min(420px, calc(100vw - 2 * var(--sp-4))); }
.toast { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-size: var(--fs-2); transition: opacity .2s, transform .2s; }
.toast > .icon { flex: none; color: var(--bg); }
.toast > span { flex: 1; padding-top: 2px; }
.toast-close { flex: none; min-width: 32px; min-height: 32px; padding: 0; background: none; border: 0; color: var(--bg); font-size: var(--fs-4); line-height: 1; box-shadow: none; }
.toast-close:hover { background: none; opacity: .8; }
.toast.leaving { opacity: 0; transform: translateY(var(--sp-2)); }
@media (max-width: 860px) {
  .toasts { left: var(--sp-3); right: var(--sp-3); bottom: calc(var(--tabbar) + var(--sp-3) + env(safe-area-inset-bottom)); max-width: none; }
}

/* Landing page: what a signed-out visitor sees at / (templates/landing.html) */
.landing { max-width: var(--page); margin: 0 auto; }
.landing section { margin: var(--sp-7) 0; }
.landing-hero { margin-top: var(--sp-6); max-width: var(--measure); }
.landing-hero h1 { font-weight: 800; letter-spacing: -0.01em; }
.landing-kicker { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--accent); font-weight: 600; font-size: var(--fs-2); background: var(--accent-soft); padding: var(--sp-1) var(--sp-3); border-radius: var(--pill); }
.landing-features { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.landing-features li, .landing-steps li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--sp-5); }
.landing-features h3, .landing-steps h3 { margin: var(--sp-3) 0 var(--sp-1); }
.landing-features p, .landing-steps p { color: var(--muted); margin: 0; }
.landing-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); }
.landing-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); counter-reset: step; }
.landing-steps li { counter-increment: step; }
.landing-steps li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--pill); background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.landing-privacy p, .landing-cta p { max-width: var(--measure); }
.landing-cta { text-align: center; background: var(--accent-soft); border-radius: var(--radius); padding: var(--sp-6) var(--sp-5); }
.landing-cta p { margin-left: auto; margin-right: auto; }
.landing-cta h2 { margin-top: 0; }
@media (max-width: 700px) {
  .landing section { margin: var(--sp-6) 0; }
  .landing-how { display: none; }  /* the steps are a short scroll away */
}

@media print { .feedback-fab, .top, .toasts { display: none; } }
