/* Kinetic Horizon (Stitch) tokens: docs/superpowers/specs/2026-10-08-ui-redesign-design.md
   Fonts: Geist and JetBrains Mono, SIL Open Font License 1.1 (see fonts/OFL-*.txt). */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-Variable.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #FBFBF9; --surface: #FFFFFF; --muted-bg: #F4F4F0; --line: #E5E7EB; --line-strong: #CBD5E1;
  --text: #0F172A; --text-2: #475569; --text-3: #5F6B80;
  --accent: #3B5BF5; --accent-press: #2F4BE0; --accent-wash: rgba(59, 91, 245, 0.07);
  /* PM-007: white text sits on --accent-fill (≥4.5:1 in both themes); form fields use --field-line (≥3:1) */
  --accent-fill: #3B5BF5; --accent-fill-press: #2F4BE0; --field-line: #858FA1;
  --strong-fg: #065F46; --strong-bg: #ECFDF5; --strong-line: #A7F3D0; --strong-dot: #10B981;
  --good-fg: #92400E; --good-bg: #FFFBEB; --good-line: #FDE68A; --good-dot: #F59E0B;
  --weak-fg: #991B1B; --weak-bg: #FEF2F2; --weak-line: #FECACA; --weak-dot: #EF4444;
  --neutral-fg: #5F6B80; --neutral-bg: #F1F5F9; --neutral-line: #E2E8F0;
  --radius-card: 16px; --radius-ctl: 8px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-2: 0 4px 12px -2px rgba(15, 23, 42, .06), 0 2px 4px -1px rgba(15, 23, 42, .03);
  --shadow-3: 0 12px 32px -4px rgba(15, 23, 42, .10), 0 4px 8px -2px rgba(15, 23, 42, .04);
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* aliases so legacy app.css / mobile.css rules pick up the new palette until they are removed */
  --panel: var(--surface); --muted: var(--text-2); --ok: var(--strong-dot); --warn: var(--good-dot); --err: var(--weak-dot);
  color-scheme: light;
}
/* P3 B5: data-theme on <html> (set before paint by _theme.html) overrides the system choice both ways */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0B1120; --surface: #111827; --muted-bg: #1A2232; --line: #253045; --line-strong: #334155;
    --text: #E5E9F0; --text-2: #A3AEC2; --text-3: #8391A7;
    --accent: #6F87FF; --accent-press: #5A74F5; --accent-wash: rgba(111, 135, 255, 0.12);
    --accent-fill: #3B5BF5; --accent-fill-press: #2F4BE0; --field-line: #64748B;
    --strong-fg: #6EE7B7; --strong-bg: rgba(16, 185, 129, .12); --strong-line: rgba(16, 185, 129, .35);
    --good-fg: #FCD34D; --good-bg: rgba(245, 158, 11, .12); --good-line: rgba(245, 158, 11, .35);
    --weak-fg: #FCA5A5; --weak-bg: rgba(239, 68, 68, .12); --weak-line: rgba(239, 68, 68, .35);
    --neutral-fg: #A3AEC2; --neutral-bg: #1A2232; --neutral-line: #253045;
    --shadow-1: none; --shadow-2: 0 4px 12px rgba(0, 0, 0, .35); --shadow-3: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #0B1120; --surface: #111827; --muted-bg: #1A2232; --line: #253045; --line-strong: #334155;
  --text: #E5E9F0; --text-2: #A3AEC2; --text-3: #8391A7;
  --accent: #6F87FF; --accent-press: #5A74F5; --accent-wash: rgba(111, 135, 255, 0.12);
  --accent-fill: #3B5BF5; --accent-fill-press: #2F4BE0; --field-line: #64748B;
  --strong-fg: #6EE7B7; --strong-bg: rgba(16, 185, 129, .12); --strong-line: rgba(16, 185, 129, .35);
  --good-fg: #FCD34D; --good-bg: rgba(245, 158, 11, .12); --good-line: rgba(245, 158, 11, .35);
  --weak-fg: #FCA5A5; --weak-bg: rgba(239, 68, 68, .12); --weak-line: rgba(239, 68, 68, .35);
  --neutral-fg: #A3AEC2; --neutral-bg: #1A2232; --neutral-line: #253045;
  --shadow-1: none; --shadow-2: 0 4px 12px rgba(0, 0, 0, .35); --shadow-3: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--font); letter-spacing: -0.005em; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.025em; margin: 0 0 4px; }
h2 { font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 8px; }
h3 { font-size: 15px; line-height: 22px; font-weight: 500; margin: 0; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.mono, .score, .count, .stat b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.label { font-size: 12px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; color: var(--text-2); }
.icon { flex: 0 0 auto; vertical-align: middle; }
code { font-family: var(--mono); font-size: .9em; }

/* ---- skip link (PM-010): first in the tab order, off-screen until focused ---- */
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; border-radius: var(--radius-ctl);
  background: var(--surface); color: var(--accent); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2); font-weight: 500;
  transform: translateY(-200%); }
.skip-link:focus { transform: none; }
main:focus { outline: none; }

/* ---- controls ---- */
button, .btn { font: 500 14px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 14px; border-radius: var(--radius-ctl); border: 1px solid var(--line); background: var(--surface);
  color: var(--text); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
button:hover, .btn:hover { border-color: var(--line-strong); background: var(--muted-bg); }
button:active, .btn:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: not-allowed; }
/* PM-008: the pressed button while its request runs (busy.js) */
button.is-busy, button.is-busy:disabled { opacity: .75; cursor: progress; }
button.is-busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: busy-spin .8s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
button.primary, .btn-primary { background: var(--accent-fill); border-color: transparent; color: #fff; }
button.primary:hover, .btn-primary:hover { background: var(--accent-fill-press); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
input, select, textarea { font: 400 15px/1.5 var(--font); color: var(--text); background: var(--muted-bg); border: 1px solid var(--field-line);
  border-radius: var(--radius-ctl); padding: 9px 12px; min-height: 44px; max-width: 100%; }
input[type=checkbox], input[type=radio] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--accent); }
input:focus:not(:focus-visible), select:focus:not(:focus-visible), textarea:focus:not(:focus-visible) { outline: none; }
textarea { width: 100%; }
form { margin: 0; }
label { font-size: 14px; }

/* ---- shared components ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow-1); padding: 16px 18px; min-width: 0; }
.pill, .tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 9999px; padding: 2px 9px; font: 500 12px/18px var(--mono);
  border: 1px solid var(--neutral-line); background: var(--neutral-bg); color: var(--neutral-fg); white-space: nowrap; }
.tag { font-family: var(--font); }
.tier-strong { color: var(--strong-fg); background: var(--strong-bg); border-color: var(--strong-line); }
.tier-good { color: var(--good-fg); background: var(--good-bg); border-color: var(--good-line); }
.tier-weak { color: var(--weak-fg); background: var(--weak-bg); border-color: var(--weak-line); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 9999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font: 500 13px/1 var(--font); white-space: nowrap; cursor: pointer; }
.chip:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.chip .count { font-size: 11px; color: var(--text-3); }
.chip.is-active, .chip.is-active:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.is-active .count { color: inherit; opacity: .7; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.fetch-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fetch-now form { margin: 0; }
.fetch-now .chip { white-space: normal; cursor: default; }
.fetch-now > p { flex-basis: 100%; margin: 0; }
.job-search-label { font: 600 14px/1.3 var(--font); color: var(--text); }
.ok { color: var(--strong-fg); } .warnc, .warn { color: var(--good-fg); } .bad, .err { color: var(--weak-fg); }
.empty { text-align: center; color: var(--text-2); padding: 32px 16px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: var(--surface);
  padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; color: var(--text); padding: 4px 10px 18px; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-fill); color: #fff; display: grid; place-items: center; font: 600 13px var(--mono); }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: var(--radius-ctl); color: var(--text-2); font-weight: 500; }
.nav-item:hover { background: var(--muted-bg); color: var(--text); }
.nav-item.is-active { background: var(--accent-wash); color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 9999px; background: var(--muted-bg); color: var(--text-2); }
.sidebar-foot { margin-top: auto; padding: 0 10px; }
.topbar { display: none; }
.tabbar { display: none; }
.main { min-width: 0; padding: 28px 32px 48px; max-width: 1200px; width: 100%; }
.flash { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-ctl); border: 1px solid var(--line); background: var(--surface); }
.flash.ok { border-color: var(--strong-line); background: var(--strong-bg); color: var(--strong-fg); }
.flash.err { border-color: var(--weak-line); background: var(--weak-bg); color: var(--weak-fg); }
.flash.warn { border-color: var(--good-line); background: var(--good-bg); color: var(--good-fg); }
.alerts .flash { margin-bottom: 8px; }

/* run notes (sidebar foot on desktop, top bar on phone) */
.run-notes { position: relative; }
.run-notes > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 500; color: var(--good-fg); }
.run-notes > summary::-webkit-details-marker { display: none; }
.run-notes > summary.err { color: var(--weak-fg); }
.run-notes-panel { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 40; width: 320px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 12px 14px; }
.run-notes-panel p { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.run-notes-panel ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.45; color: var(--text); }
.run-notes-panel li + li { margin-top: 6px; }
.run-notes-panel li.err { color: var(--weak-fg); }

/* toast (swipe Undo) */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  display: flex; gap: 12px; align-items: center; background: var(--text); color: var(--bg); border-radius: 12px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow-3); }
.toast[hidden] { display: none; }
button[hidden], .btn[hidden] { display: none; }  /* .btn's display would otherwise beat the hidden attribute (upload.js hides Upload) */
.toast.err { background: var(--weak-fg); color: var(--bg); padding: 12px 16px; }
.toast button { min-height: 36px; background: transparent; color: inherit; border-color: transparent; text-decoration: underline; }

/* ---- phone ---- */
@media (max-width: 640px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 52px; }
  .topbar .brand { padding: 0; }
  .topbar .run-notes-panel { position: fixed; left: 16px; right: 16px; width: auto; top: calc(60px + env(safe-area-inset-top)); bottom: auto; }
  .main { padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar .nav-item { position: relative; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; font-size: 11px; padding: 0; }
  .tabbar .nav-item .count { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; background: var(--accent-fill); color: #fff; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  input, select, textarea { font-size: 16px; }
  h1 { font-size: 24px; line-height: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- pages (sections added per task) ---- */

/* ---- Today ---- */
.page-head { margin: 0 0 18px; }
.page-head p { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; color: var(--text); padding: 14px 16px; }
a.stat:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.stat b { font-size: 26px; line-height: 32px; font-weight: 500; }
.stat-label { font-size: 13px; color: var(--text-2); }
.today { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.today > section { min-width: 0; scroll-margin-top: 72px; }
.today-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.today-job { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; flex: 1; }
.today-job .pill { min-width: 40px; justify-content: center; }
.today-job-text { display: flex; flex-direction: column; min-width: 0; }
.today-job b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-job small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-link { margin: 10px 0 0; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 22px; line-height: 28px; }
}

/* ---- Jobs ---- */
.phone-only { display: none; }
.inbox-count { margin: 0; color: var(--text-2); }
.filter-chips { margin: 0 0 16px; overflow: visible; flex-wrap: wrap; }
.chip-menu { position: relative; }
.chip-menu > summary { list-style: none; }
.chip-menu > summary::-webkit-details-marker { display: none; }
.chip-menu .menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 200px; max-height: 320px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; }
.chip-menu .menu a { display: block; padding: 9px 10px; border-radius: 6px; color: var(--text); text-transform: capitalize; }
.chip-menu .menu a:hover { background: var(--muted-bg); }
/* PM-034: the current choice is marked (Track A sets aria-current on it) */
.chip-menu .menu a[aria-current="true"] { font-weight: 600; color: var(--accent); }
/* PM-037: the focused row shows the same selection as j/k, with the focus ring inside the row */
table.inbox tbody tr:focus { outline: none; }
table.inbox tbody tr:focus-visible td { background: var(--accent-wash); box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.table-card { padding: 0; overflow: hidden; }
.aside-card { padding: 0; overflow-x: auto; }  /* Set aside: shown on phones too */
.aside-group { font-size: 1rem; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
table.inbox { width: 100%; border-collapse: collapse; }
table.inbox th { text-align: left; font: 500 12px/1 var(--font); letter-spacing: .02em; text-transform: uppercase; color: var(--text-2);
  background: var(--muted-bg); padding: 11px 14px; border-bottom: 1px solid var(--line); }
table.inbox td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
table.inbox tbody tr { cursor: pointer; }
table.inbox tbody tr:hover td { background: var(--muted-bg); }
table.inbox tr.sel td { background: var(--accent-wash); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
table.inbox td.role { max-width: 380px; }
.row-title { display: block; color: var(--text); font-weight: 500; }
table.inbox small { display: block; margin-top: 2px; }
table.inbox .why { max-width: 280px; }
table.inbox .why span { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.inbox .acts { white-space: nowrap; text-align: right; }
table.inbox .acts form { display: inline; }
table.inbox .acts button { min-height: 34px; padding: 0 10px; }
.hint { font-size: 12px; padding: 10px 14px; margin: 0; }
.cards { display: none; list-style: none; margin: 0; padding: 0; }
.next-step { font-size: 13px; font-weight: 600; color: var(--text-2); }
.next-step.find { color: var(--accent); } .next-step.ready { color: var(--strong-fg); }
@media (max-width: 640px) {
  .phone-only { display: inline; }
  .table-card { display: none; }
  .cards { display: block; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px; }
  .chip-menu { position: static; }
  .chip-menu .menu { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); max-height: 50vh; }
  .swipe-card { position: relative; margin-bottom: 10px; border-radius: var(--radius-card); overflow: hidden; touch-action: pan-y; }
  .swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
    font-weight: 600; visibility: hidden; }
  .swipe-card[data-dir] .swipe-bg { visibility: visible; }
  .swipe-card[data-dir=skip] .swipe-bg { background: var(--weak-bg); color: var(--weak-fg); }
  .swipe-card[data-dir=snooze] .swipe-bg { background: var(--good-bg); color: var(--good-fg); }
  .swipe-card[data-dir=skip] .bg-snooze, .swipe-card[data-dir=snooze] .bg-skip { visibility: hidden; }
  .card-body { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
    box-shadow: var(--shadow-1); padding: 14px 16px; }
  .card-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
  .card-link { font-weight: 600; color: var(--text); line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
  .card-link::after { content: ""; position: absolute; inset: 0; }  /* whole card opens the job */
  .card-meta { margin: 4px 0 6px; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-why { margin: 0 0 10px; font-size: 13px; display: flex; gap: 10px; min-width: 0; }
  .card-why span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .card-acts { position: relative; z-index: 1; display: flex; gap: 6px; }
  .card-acts button { padding: 0 12px; font-size: 13px; }
  .cards .empty { list-style: none; }
}

/* ---- Job page: header, decision, steps, approve ---- */
.job { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 14px; margin-bottom: 8px; }
.job-title-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.job-title { min-width: 0; }
.job-title h1 { overflow-wrap: anywhere; }
.job-title p { margin: 0; }
.job-head-acts { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.decision { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 28px; align-items: center;
  box-shadow: inset 0 0 0 1px var(--accent-wash), var(--shadow-1); }
.decision-score { text-align: center; }
.ring { --pct: 0; --ring: var(--neutral-fg); width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 80%, transparent 81% 100%), conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--muted-bg) 0); }
.ring.tier-strong { --ring: var(--strong-dot); } .ring.tier-good { --ring: var(--good-dot); } .ring.tier-weak { --ring: var(--weak-dot); }
.ring.tier-strong, .ring.tier-good, .ring.tier-weak { color: var(--text); border: 0; }
.ring-score { font: 600 32px/1 var(--mono); }
.ring-label { font: 500 11px/1.6 var(--font); text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.decision-tier { margin: 8px 0 0; font-weight: 600; font-size: 14px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bars li { display: grid; grid-template-columns: 120px minmax(0, 1fr) 52px; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { color: var(--text-2); }
.bar { height: 8px; border-radius: 9999px; background: var(--muted-bg); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar-num { text-align: right; color: var(--text-2); font-size: 12px; }
.decision-lists { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.decision-lists .label { margin: 0 0 6px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.steps { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); padding-top: 10px; border-top: 3px solid var(--line); }
.step-num { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--muted-bg); }
.step.is-done { color: var(--text-2); border-top-color: var(--strong-dot); }
.step.is-done .step-num { background: var(--strong-bg); color: var(--strong-fg); }
.step.is-current { color: var(--text); font-weight: 600; border-top-color: var(--accent); }
.step.is-current .step-num { background: var(--accent-fill); color: #fff; }
.next-action { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.next-action p { margin: 0; flex-basis: 100%; }
.trust { font-size: 13px; }
.actions .approve { display: grid; gap: 10px; }
.actions .approve label { display: flex; gap: 8px; align-items: center; }
.actions .approve button.primary { width: 100%; }
.more-menu { position: relative; margin-top: 10px; }
.more-menu > summary { list-style: none; width: 100%; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu .menu { margin-top: 8px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--surface); }
.more-menu .menu button, .more-menu .menu a { width: 100%; justify-content: flex-start; }
.more-menu .menu a { display: flex; align-items: center; min-height: 44px; padding: 0 14px; color: var(--text); }
.danger-zone { border-top: 1px solid var(--line); margin-top: 4px; padding: 6px 14px 0; display: grid; gap: 4px; font-size: 13px; }
.danger-zone button { padding: 0; }
@media (max-width: 640px) {
  .job { gap: 12px; }
  .job-title-row { flex-direction: column; gap: 10px; }
  .decision { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
  .decision-score { display: flex; align-items: center; gap: 14px; text-align: left; }
  .decision-tier { margin: 0; font-size: 16px; }
  .ring { width: 84px; height: 84px; } .ring-score { font-size: 24px; } .ring-label { font-size: 10px; }
  .bars li { grid-template-columns: 96px minmax(0, 1fr) 44px; }
  .decision-lists { grid-template-columns: 1fr; gap: 12px; }
  .step { flex-direction: column; align-items: flex-start; gap: 4px; }
  .step span:last-child { font-size: 11px; line-height: 1.25; }
  .next-action > form, .next-action > .btn { flex: 1 1 auto; }
  .next-action button, .next-action .btn { width: 100%; }
}

/* ---- Job page: body, tabs, people, drafts, timeline ---- */
.job-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-areas: "job people" "job draft";
  grid-template-rows: auto 1fr; gap: 14px; align-items: start; }
.tab-bar { display: none; }
.panel { display: grid; gap: 14px; min-width: 0; }
.panel-job { grid-area: job; } .panel-people { grid-area: people; } .panel-draft { grid-area: draft; }
.block h2 { font-size: 16px; }
.jd-box > summary { list-style: none; cursor: pointer; }
.jd-box > summary::-webkit-details-marker { display: none; }
.jd-box > summary h2 { margin: 0; }
.jd-box[open] > summary h2 { margin-bottom: 10px; }
.jd { font-size: 14px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.jd h3 { font-size: 1rem; margin: 1rem 0 .25rem; }
.jd ul { padding-left: 1.2rem; }
.jd p { margin: 0 0 .6rem; }
mark, .jd mark { background: var(--strong-bg); color: var(--strong-fg); border-radius: 4px; padding: 0 2px; }
.notes form, .drafts form { display: grid; gap: 8px; }
.notes form button, .drafts form button { justify-self: start; }
.drafts details { border-top: 1px solid var(--line); padding: 4px 0; }
.drafts details:first-of-type { border-top: 0; }
.drafts details > summary { cursor: pointer; font-weight: 500; padding: 8px 0; }
.drafts form > div, .drafts .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.over { color: var(--weak-fg); font-weight: 600; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.people .person { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 6px; }
.people .person:first-of-type { border-top: 0; padding-top: 4px; }
.people .person p { margin: 0; }
.person-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rank { color: var(--text-3); }
.person-role, .person-reason { font-size: 13px; }
.person-email { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; overflow-wrap: anywhere; }
.person-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.person-edit > summary { cursor: pointer; color: var(--text-2); font-size: 13px; padding: 6px 0; }
.person-edit form { margin-top: 6px; }
.people form { margin-top: 8px; }
.people .usage { margin: 10px 0 0; }
.domain-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.domain-form input { flex: 1 1 160px; }
.add-person > summary { list-style: none; width: 100%; }
.add-person > summary::-webkit-details-marker { display: none; }
.add-person[open] > summary { display: none; }
ol.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
ol.timeline li { display: flex; gap: 10px; }
ol.timeline .mono { flex: 0 0 52px; font-size: 12px; padding-top: 2px; }
@media (max-width: 640px) {
  .job-body { display: block; }
  .tab-bar { display: flex; position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 10; background: var(--bg);
    margin: 0 -16px 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
  .tab-bar .chip { flex: 1; justify-content: center; min-height: 44px; }
  .panel.is-hidden { display: none; }
  .panel + .panel { margin-top: 14px; }
  .grid { grid-template-columns: 1fr; }
  .drafts textarea[data-unit=words] { min-height: 16em; }
  .person-acts > * { flex: 1; }
  body.typing .tabbar { display: none; }  /* never cover the field being typed in */
}

/* ---- Pipeline ---- */
.pipe-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stage-chips { display: none; }
.columns { display: grid; grid-auto-flow: column; grid-auto-columns: 272px; gap: 12px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.column { background: rgba(244, 244, 240, .6); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 10px; display: grid; gap: 10px;
  align-content: start; scroll-snap-align: start; min-height: 160px; }
.column-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px; }
.column .empty { padding: 18px 8px; font-size: 13px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; box-shadow: var(--shadow-1); min-width: 0; }
.kcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.kcard.due { border-color: var(--good-line); background: var(--good-bg); }
.kcard-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.kcard-title { color: var(--text); font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.kcard p { margin: 0; font-size: 13px; }
.kmove > summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--text-2); width: fit-content; padding: 2px 0; }
.kmove > summary::-webkit-details-marker { display: none; }
.kmove[open] > summary { margin-bottom: 6px; }
.kcard .move { display: flex; gap: 6px; }
.kcard .move select { flex: 1; min-width: 0; min-height: 36px; padding: 4px 8px; font-size: 13px; text-transform: capitalize; }
.kcard .move button { min-height: 36px; font-size: 13px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .column { background: var(--muted-bg); } }
:root[data-theme=dark] .column { background: var(--muted-bg); }
@media (max-width: 640px) {
  .stage-chips { display: flex; margin: 0 -16px 12px; padding: 0 16px 2px; }
  .columns { display: block; overflow: visible; padding: 0; }
  .column { background: transparent; border: 0; padding: 0; min-height: 0; }
  .column.is-hidden { display: none; }
  .column-head { display: none; }
  .kcard .move select { font-size: 16px; min-height: 44px; }
  .kcard .move button { min-height: 44px; }
  .kmove > summary { min-height: 32px; display: flex; align-items: center; }
}

/* ---- Tablet / narrow desktop: one column on the job page, inputs never wider than their box ---- */
input, select, textarea { min-width: 0; }
.grid > * { min-width: 0; }
.table-card { overflow-x: auto; }
@media (min-width: 641px) and (max-width: 1240px) {
  /* Stitch tablet rule: the sidebar becomes an icon rail */
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 18px 10px; align-items: center; }
  .sidebar .brand { padding: 4px 0 18px; font-size: 0; gap: 0; }
  /* PM-036: icons keep a short label underneath, so the rail is readable without hovering */
  .sidebar .nav-item { position: relative; flex-direction: column; justify-content: center; gap: 2px; width: 60px; min-height: 56px; padding: 4px 0; }
  .sidebar .nav-item > span:not(.count) { font-size: 11px; line-height: 14px; font-weight: 500; }
  .sidebar .nav-item .count { position: absolute; top: 2px; right: 0; margin: 0; background: var(--accent-fill); color: #fff; }
  .sidebar-foot { padding: 0; text-align: center; }
  .sidebar .run-notes > summary { font-size: 11px; }
  .sidebar .run-notes-panel { left: 0; }
  table.inbox th:nth-child(6), table.inbox td.why { display: none; }
  .job-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "people" "draft" "job"; grid-template-rows: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main { padding: 24px; }
}

/* ---- public landing ---- */
.landing { max-width: 480px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 16px; }
.landing-card { display: grid; gap: 16px; }
.landing-points { display: grid; gap: 12px; margin: 0; padding-left: 20px; }
.btn-google { background: #fff; border: 1px solid var(--line-strong); color: #1F1F1F; min-height: 44px; gap: 12px; }
.btn-google:hover { background: #fff; border-color: var(--text-3); }
.landing-footer { text-align: center; font-size: 13px; }

/* Onboarding and Settings preference forms */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.chip:has(input:checked) { background: var(--accent-wash); border-color: var(--accent); color: var(--accent); }
.field { display: grid; gap: 4px; margin: 12px 0 0; }
.field-err { color: var(--weak-fg); font-size: .9rem; margin: 4px 0 0; }
.field-hint { color: var(--text-2); font-size: 13px; line-height: 1.4; }
/* P3 B5: Settings → Theme */
.theme-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.theme-pick legend { padding: 0; width: 100%; }
.theme-pick label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
/* PM-021: onboarding's optional fields fold under "Add more (optional)" */
details.more { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more > summary { cursor: pointer; font-weight: 600; color: var(--text-2); min-height: 34px; display: flex; align-items: center; }
/* PM-020: title exclusions as removable chips (chips.js); the hidden input still posts the comma list */
.chip-editor { display: grid; gap: 8px; margin: 6px 0 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip-list .chip { cursor: default; padding-right: 4px; }
.chip-list .chip button { border: 0; background: transparent; color: var(--text-2); font-size: 16px; line-height: 1;
  min-width: 28px; min-height: 28px; border-radius: 9999px; cursor: pointer; }
.chip-list .chip button:hover { background: var(--muted-bg); color: var(--text); }
@media (pointer: coarse) { .chip-list .chip button { min-width: 36px; min-height: 36px; } }
.onboarding .sticky-actions { display: flex; gap: 12px; align-items: center; margin-top: 16px; }
@media (max-width: 640px) { .onboarding .sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding: .75rem 0; } }
.role-row { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr; gap: 6px; margin-bottom: 6px; }
@media (max-width: 640px) { .role-row { grid-template-columns: 1fr 1fr; } }
.facts-form textarea { width: 100%; margin-bottom: 6px; }
.prefs-section { border-top: 1px solid var(--line); padding: 10px 0; }
.prefs-section > summary { cursor: pointer; font-weight: 600; }
.settings .preview { border-color: var(--accent); background: var(--accent-wash); margin-bottom: 12px; }
/* P2 B8: section index, the Admin row, one full-width save per card, custom matching notice */
.settings-index { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.settings-index .chip { color: var(--text); text-decoration: none; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; color: var(--text);
  text-decoration: none; margin-bottom: 14px; }
.admin-row span { color: var(--accent); font-size: 14px; }
.btn-block { display: flex; width: 100%; justify-content: center; margin-top: 16px; }
.custom-on { border: 1px solid var(--line); border-radius: 12px; background: var(--muted-bg); padding: 10px 12px; margin: 8px 0 4px;
  display: grid; gap: 8px; justify-items: start; }
.custom-on p { margin: 0; }
.chip:has(input:disabled) { opacity: .6; cursor: not-allowed; }
#account form { margin: 8px 0; }
/* score pending (Jobs): matches waiting for their first score */
.pending { margin-bottom: 16px; }
.pending-list { list-style: none; padding: 0; margin: 8px 0 0; }
.pending-list li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }

/* Role search (combobox.js) */
.role-search { position: relative; margin-bottom: 12px; }
.role-search input { width: 100%; }
#role-list { list-style: none; margin: 4px 0 0; padding: 0; }
#role-list:not(:empty) { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-ctl); }
.role-opt { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; cursor: pointer; }
.role-opt[aria-selected="true"], .role-opt:hover { background: var(--accent-wash); }
.role-opt.is-added { cursor: default; color: var(--muted); background: none; }

/* ---- P2 B6: targets, tablet why line, Pipeline strip, stacked tables (PM-036, PM-049, PM-052, PM-059, contract C1) ----
   Last in the file so these minimums win over the component rules above. .linkedin-search is the class hook for the job
   page's "Search LinkedIn ↗"; the .contact fallback covers it until the markup carries the class. */
.why-inline { display: none; }
@media (pointer: fine) {
  table.inbox .acts button, .card-acts button, .back, .linkedin-search, .contact p > a[target="_blank"], .chip { min-height: 34px; }
}
@media (pointer: coarse) {
  table.inbox .acts button, .card-acts button, .back, .linkedin-search, .contact p > a[target="_blank"], .chip { min-height: 44px; }
  .linkedin-search, .contact p > a[target="_blank"] { display: inline-flex; align-items: center; }
}
@media (min-width: 641px) { .sort-chip { display: none; } }  /* A13: the table's Age header sorts here; phones keep the chip */
@media (min-width: 641px) and (max-width: 1240px) {
  /* the Why column is hidden here, so the row keeps one ✓/⚠ line under the title */
  .why-inline { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 640px) {
  .pipe-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin: 0 0 14px; padding: 0; }
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { display: block; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 8px 12px; margin-bottom: 10px; }
  table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; border: 0;
    text-align: right; overflow-wrap: anywhere; min-width: 0; }
  table.stack td[data-label]::before { content: attr(data-label); flex: none; color: var(--text-3); font-size: 12px; font-weight: 500; text-align: left; }
  table.stack td:not([data-label]) { justify-content: flex-end; }
  table.stack td:empty { display: none; }
  table.stack .who { min-width: 0; overflow-wrap: anywhere; }  /* a long email wraps inside its own block, not beside the name */
}

/* ---- P3 B1 (PM-022, PM-023): onboarding orientation and the resume drop zone ---- */
.onboarding { margin-inline: auto; }
.onboarding-welcome { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.onboarding-progress { display: grid; gap: 6px; margin-bottom: 16px; }
.onboarding-progress progress { width: 100%; height: 6px; appearance: none; border: 0; border-radius: 999px;
  background: var(--muted-bg); overflow: hidden; }
.onboarding-progress progress::-webkit-progress-bar { background: var(--muted-bg); border-radius: 999px; }
.onboarding-progress progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.onboarding-progress progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.dropzone { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 24px 16px; cursor: pointer;
  border: 2px dashed var(--field-line); border-radius: var(--radius-card); background: var(--muted-bg); }
.dropzone:hover, .dropzone.is-over, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-wash); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone-title { font-weight: 600; color: var(--text); }
.dropzone-name:empty { display: none; }
/* the input stays in the label (its accessible name) and focusable, but the zone is what people see */
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone { position: relative; }
.is-busy-inline { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: busy-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .is-busy-inline { animation: none; } }

/* ---- P3 B2 (PM-024): the facts form ---- */
.saved-note { margin-left: 10px; color: var(--strong-fg); font-weight: 600; }
.more-achievements { margin: 6px 0; }
.more-achievements > summary { cursor: pointer; color: var(--accent); padding: 6px 0; }
.more-achievements textarea { margin-top: 6px; }
