/* JobSpecter design system: instrument-grade calm.
   Navy ink, signal blue for actions, slate neutrals, and ONE signature: the thin optical-spectrum line under
   the top bar (and in the landing hero), a nod to the photonics/semiconductor world our users come from.
   Body text uses the system font (zero download, instant render, plain zeros for money and counts);
   headings use Atkinson Hyperlegible Bold (one 17 KB file, preloaded). Colours meet WCAG AA. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  --navy: #0e1b2e; --navy-2: #172a45; --navy-line: #24395a; --on-navy: #e8eef7; --on-navy-2: #a9b8cf;
  --ink: #142033; --ink-2: #344256; --muted: #566377; --paper: #f4f6f9; --card: #ffffff;
  --line: #dbe1ea; --line-2: #c3ccd9;
  --brand: #1f3d8a; --brand-ink: #ffffff; --brand-soft: #e7edf9; --brand-strong: #172f6c;
  --good: #0f7b6c; --good-soft: #e3f3ef;
  --sun: #fff1c2; --sun-ink: #4d3d00;
  --bad: #b42318; --bad-soft: #fdecea; --warn: #8a5300; --warn-soft: #fdf2dc;
  --info: #1f5fa8; --info-soft: #e6f0fb; --muted-soft: #edf0f5;
  --spectrum: linear-gradient(90deg, #5b3fa8 0%, #2c4fd6 30%, #1f8fd6 55%, #19b0b8 78%, #4cc28a 100%);
  --radius: 10px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(14,27,46,.06);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Atkinson Hyperlegible", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #0b1526; --navy-2: #13223a; --navy-line: #22365a; --on-navy: #e8eef7; --on-navy-2: #9fb0c9;
    --ink: #e6ebf3; --ink-2: #c3cddb; --muted: #94a2b8; --paper: #0f1a2b; --card: #15233a;
    --line: #253752; --line-2: #34496b;
    --brand: #8fb0ff; --brand-ink: #0b1526; --brand-soft: #1b2d4f; --brand-strong: #b9cdff;
    --good: #5fd0b8; --good-soft: #13332f;
    --sun: #4a3f17; --sun-ink: #f7e7a6; --bad: #ff9a8f; --bad-soft: #3b1d1c;
    --warn: #f3c46f; --warn-soft: #3a2c12; --info: #8fc0ff; --info-soft: #18304f; --muted-soft: #1c2c46;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16.5px; line-height: 1.55; color: var(--ink);
  background: var(--paper); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-strong); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; margin: 0 0 var(--space-3);
  letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 var(--space-3); }
small, .small { font-size: .88rem; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; } .skip:focus { left: var(--space-3); top: var(--space-3); background: var(--card); padding: var(--space-2); z-index: 10; }

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-4); }
main.wrap { padding-top: var(--space-5); padding-bottom: var(--space-7); }
.grid { display: grid; gap: var(--space-4); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: var(--space-4); }
.hide { display: none !important; }

/* Top bar: navy, with the spectrum line as its bottom edge */
.topbar { background: var(--navy); color: var(--on-navy); position: sticky; top: 0; z-index: 5; }
.topbar::after { content: ""; display: block; height: 3px; background: var(--spectrum); }
.topbar .wrap { display: flex; align-items: center; gap: var(--space-4); min-height: 58px; flex-wrap: wrap; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--on-navy); text-decoration: none;
  display: flex; gap: 9px; align-items: center; letter-spacing: -0.01em; }
.brand:hover { color: #fff; }
.brand .mark { width: 22px; height: 22px; flex: none; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
nav.main a { text-decoration: none; color: var(--on-navy-2); padding: 7px 11px; border-radius: 6px; font-size: .94rem; }
nav.main a[aria-current="page"] { background: var(--navy-2); color: #fff; font-weight: 600;
  box-shadow: inset 0 -2px 0 #4f8cf0; }
nav.main a:hover { color: #fff; background: var(--navy-2); }
.topbar form { margin: 0; }
.topbar .btn { background: transparent; color: var(--on-navy); border-color: var(--navy-line); }
.topbar .btn:hover { background: var(--navy-2); color: #fff; border-color: var(--on-navy-2); }
/* Top-right actions: notifications bell and the account menu */
.top-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 8px; color: var(--on-navy-2); }
.bell:hover, .bell[aria-current="page"] { color: #fff; background: var(--navy-2); }
.bell .dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ffd166; color: #1b1300; font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; }
.icon { display: block; flex: none; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 4px 8px; border-radius: 8px; color: var(--on-navy); }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary:hover, details.menu[open] > summary { background: var(--navy-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: var(--spectrum); color: #fff; }
.acct-name { font-size: .94rem; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(14,27,46,.18); padding: 6px; z-index: 20; }
.menu-panel a, .menu-panel .menu-btn { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 6px;
  color: var(--ink); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; min-height: 44px; }
.menu-panel a:hover, .menu-panel .menu-btn:hover { background: var(--brand-soft); color: var(--brand-strong); }
.menu-panel form { margin: 0; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.menu-who { padding: 8px 12px 4px; margin: 0; }

/* Phone: bottom bar + "More" drawer instead of the top links */
.bottombar { display: none; }
@media (max-width: 760px) {
  nav.main { display: none; }
  .acct-name { display: none; }
  .bottombar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
    background: var(--navy); border-top: 1px solid var(--navy-line); padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; min-height: 56px;
    color: var(--on-navy-2); text-decoration: none; font-size: .74rem; }
  .bottombar a[aria-current="page"] { color: #fff; box-shadow: inset 0 3px 0 #4f8cf0; }
  body { padding-bottom: 72px; }
  .menu-panel { position: fixed; right: 8px; left: 8px; top: 64px; }
}
dialog.drawer { margin: auto 0 0 0; max-width: none; width: 100%; border-radius: 16px 16px 0 0; max-height: 85vh; overflow-y: auto; }
.menu-list { list-style: none; padding: 0; margin: var(--space-4) 0 0; }
.menu-list li { border-bottom: 1px solid var(--line); }
.menu-list li:last-child { border-bottom: 0; padding-top: var(--space-3); }
.menu-list a { display: block; padding: 14px 4px; text-decoration: none; color: var(--ink); font-weight: 600; }
.menu-list a[aria-current="page"] { color: var(--brand-strong); }

.banner { background: var(--sun); color: var(--sun-ink); padding: 10px 0; font-size: .95rem; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5);
  box-shadow: var(--shadow); }
.card.tight { padding: var(--space-4); }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card.accent { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.card > h2:first-child { padding-bottom: var(--space-2); }
.hero { padding: var(--space-6) 0 var(--space-5); }
.hero h1 { font-size: 2.2rem; max-width: 22ch; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700;
  font-size: .98rem; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--card);
  color: var(--ink); cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { border-color: var(--brand); color: var(--brand-strong); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { .btn.primary:hover { background: var(--brand-strong); color: var(--brand-ink); } }
.btn.big { font-size: 1.12rem; padding: 14px 28px; min-height: 54px; }
.btn.small { font-size: .88rem; padding: 6px 12px; min-height: 34px; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--brand-strong); font-weight: 400; text-decoration: underline; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

/* Forms */
label { font-weight: 700; display: block; margin-bottom: 4px; }
.field { margin-bottom: var(--space-4); }
.help { color: var(--muted); font-size: .9rem; margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url],
input[type=datetime-local], input[type=search], input[type=date], select, textarea {
  font: inherit; width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink); min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input[type=number] { max-width: 9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-bottom: var(--space-3); }
.check input { width: 20px; height: 20px; margin-top: 3px; flex: none; accent-color: var(--brand); }
.radio-cards { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.radio-cards label { font-weight: 400; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: var(--space-3);
  display: flex; gap: 10px; cursor: pointer; }
.radio-cards label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-cards input { accent-color: var(--brand); margin-top: 4px; }
fieldset { border: 0; padding: 0; margin: 0 0 var(--space-4); }
legend { font-weight: 700; margin-bottom: var(--space-2); }

/* Notices */
.notice { border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
  background: var(--info-soft); color: var(--ink); border-left: 4px solid var(--info); }
.notice.ok { background: var(--good-soft); border-color: var(--good); }
.notice.info { background: var(--info-soft); border-color: var(--info); }
.notice.warn { background: var(--warn-soft); border-color: var(--warn); }
.notice.bad { background: var(--bad-soft); border-color: var(--bad); }

/* Badges */
.badge { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 5px;
  background: var(--muted-soft); color: var(--ink-2); white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.score { font-weight: 700; font-variant-numeric: tabular-nums; display: inline-block; min-width: 2.6em; text-align: center;
  padding: 2px 8px; border-radius: 8px; background: var(--muted-soft); }
.score.hi { background: var(--good-soft); color: var(--good); }
.score.mid { background: var(--warn-soft); color: var(--warn); }

/* Tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: var(--space-4); }
.tabs a { text-decoration: none; color: var(--ink-2); padding: 10px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--brand-strong); border-color: var(--brand); font-weight: 700; }
.tabs .count { color: var(--muted); font-size: .85rem; }

/* Tables / lists */
.table { width: 100%; border-collapse: collapse; font-size: .96rem; }
.table th { text-align: left; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:hover td { background: color-mix(in srgb, var(--brand-soft) 35%, transparent); }
.joblist { list-style: none; padding: 0; margin: 0; }
.job { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.job .title { font-weight: 700; font-size: 1.04rem; }
.job .meta { color: var(--muted); font-size: .92rem; }
.job .reason { font-size: .94rem; margin-top: 4px; }
.job .actions { display: flex; gap: 6px; flex-direction: column; align-items: flex-end; }
@media (max-width: 680px) {
  .job { grid-template-columns: 52px 1fr; } .job .actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; }
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .85rem; background: var(--muted-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; }

/* Stats */
.stat { text-align: left; }
.stat .n { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--brand-strong); }
.stat .l { color: var(--muted); font-size: .9rem; }

/* Run progress */
.steps { list-style: none; margin: var(--space-4) 0; padding: 0; display: grid; gap: var(--space-2);
  grid-template-columns: repeat(4, 1fr); }
.steps li { position: relative; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--muted-soft);
  color: var(--muted); font-size: .92rem; overflow: hidden; }
.steps li.done { background: var(--brand-soft); color: var(--brand-strong); }
.steps li.now { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.steps li.now::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transform: translateX(-100%); animation: shimmer 1.6s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { .steps li.now::after { animation: none; } }
.counters { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.counters div { min-width: 110px; }
.counters .n { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.events { list-style: none; padding: 0; margin: var(--space-3) 0 0; font-size: .9rem; color: var(--ink-2); max-height: 220px; overflow-y: auto; }
.events li { padding: 4px 0; border-top: 1px dashed var(--line); }
.events li.warn { color: var(--warn); } .events li.error { color: var(--bad); }
.pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }

/* Onboarding steps */
.setup { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.setup li { counter-increment: s; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--muted-soft); }
.setup li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; background: var(--card); border: 1px solid var(--line-2); flex: none; }
.setup li.done::before { content: "✓"; background: var(--good); color: #fff; border-color: var(--good); }
.setup li.now { background: var(--brand-soft); font-weight: 700; }

/* Bullet review */
.entry { margin-bottom: var(--space-5); }
.entry h3 { margin-bottom: 2px; }
.bullet { display: grid; grid-template-columns: 1fr auto; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: var(--space-2); background: var(--card); }
.bullet.approved { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); border-left: 3px solid var(--good); }
.bullet.deleted { opacity: .55; text-decoration: line-through; }
.bullet .text mark { background: var(--sun); color: var(--sun-ink); }
.bullet .tools { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .bullet { grid-template-columns: 1fr; } .bullet .tools { justify-content: flex-start; } }

/* Report */
.title-list { list-style: none; padding: 0; margin: 0; }
.title-list li { display: grid; grid-template-columns: 34px 56px 1fr; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.title-list .rank { color: var(--muted); font-weight: 700; padding-top: 4px; }
.title-list details summary { cursor: pointer; color: var(--brand-strong); font-size: .9rem; }

footer.site { border-top: 1px solid var(--line); padding: var(--space-5) 0; color: var(--muted); font-size: .9rem; background: var(--card); }
footer.site a { color: var(--ink-2); }
footer.site .wrap { display: flex; gap: var(--space-4); flex-wrap: wrap; justify-content: space-between; }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); max-width: 520px; width: calc(100% - 32px);
  background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(14, 27, 46, .55); }
.htmx-request .when-idle { display: none; } .when-busy { display: none; } .htmx-request .when-busy { display: inline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.3rem; letter-spacing: .08em;
  background: var(--sun); color: var(--sun-ink); padding: 8px 14px; border-radius: 8px; display: inline-block; }
.pager { display: flex; gap: var(--space-2); margin-top: var(--space-4); align-items: center; }
.desc { white-space: pre-wrap; font-size: .95rem; max-height: 520px; overflow-y: auto; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-4); }
.narrow { max-width: 640px; } .narrow-center { max-width: 460px; margin: var(--space-6) auto; }
.mt-0 { margin-top: 0; } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mb-0 { margin-bottom: 0; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.list { padding-left: 1.2em; } .list li { margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .95rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.table .right, .table th.right { text-align: right; }
form.row input[type=text] { width: auto; flex: 1 1 220px; }
form.row .check { flex: 1 1 100%; }
.title-list label { display: inline; }

/* Run: choose companies */
.run-scope { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.run-scope legend { padding: 0; margin-bottom: 6px; width: 100%; }
.run-scope .radio { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pick-companies { width: 100%; margin-top: 6px; }
.pick-companies summary { cursor: pointer; color: var(--brand-strong); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px;
  margin-top: 10px; max-height: 320px; overflow-y: auto; padding-right: 6px; }
.pick { display: flex; gap: 8px; align-items: baseline; cursor: pointer; padding: 3px 0; }
.pick span:first-of-type { flex: 1; }

/* CV details editor */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.edit-entry { border-top: 1px solid var(--line, #e3e6e4); padding-top: var(--space-4); margin-top: var(--space-4); }
.edit-entry:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.edit-entry legend { padding: 0; margin-bottom: 6px; }
.skill-row { grid-template-columns: minmax(140px, 1fr) 3fr; gap: 0 12px; }
.skill-row .field { margin-bottom: 8px; }
input.short { max-width: 120px; }
.new-version summary { cursor: pointer; color: var(--brand-strong); }

.new-version textarea { width: 100%; margin-top: 6px; }
@media (max-width: 640px) { .skill-row { grid-template-columns: 1fr; } }
.add-line { margin: 4px 0 8px; }
.add-line summary { cursor: pointer; color: var(--brand-strong); }
.add-line textarea { width: 100%; }

/* Application status control (+ undo) */
.app-status { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.app-status .row.tight { gap: 6px; flex-wrap: nowrap; }
.app-status select { min-height: 36px; padding: 6px 10px; width: auto; }
.app-status form { margin: 0; }
.linkish { background: none; border: 0; padding: 2px 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; }
.linkish:hover { color: var(--brand-strong); }
.job .app-status, .card .app-status { align-items: flex-start; }

/* Landing */
.hero-band { background: var(--navy); color: var(--on-navy); position: relative; overflow: hidden; }
.hero-band::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--spectrum); }
.hero-band .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--space-7); align-items: center;
  padding-top: 64px; padding-bottom: 72px; }
.hero-band h1 { color: #fff; font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.08; letter-spacing: -0.025em; max-width: 16ch; }
.hero-band .lede { color: var(--on-navy-2); font-size: 1.13rem; max-width: 52ch; }
.hero-band .btn { border-color: var(--navy-line); color: var(--on-navy); background: transparent; }
.hero-band .btn:hover { border-color: var(--on-navy-2); color: #fff; }
.hero-band .btn.primary { background: #fff; color: var(--navy); border-color: #fff; }
.hero-band .btn.primary:hover { background: var(--brand-soft); color: var(--navy); }
.specimen { background: #fff; color: #142033; border-radius: 12px; padding: 18px 20px; box-shadow: 0 18px 40px rgba(0,0,0,.35);
  font-size: .93rem; }
.specimen .job-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.specimen .job-line strong { font-family: var(--font-head); font-size: 1.02rem; }
.specimen .sc { font-weight: 700; color: #0f7b6c; background: #e3f3ef; border-radius: 6px; padding: 1px 8px; }
.specimen .meta { color: #566377; font-size: .85rem; margin-bottom: 12px; }
.specimen .line { border-left: 3px solid #0f7b6c; background: #f4f8f7; padding: 8px 10px; border-radius: 0 6px 6px 0; margin-top: 8px; }
.specimen .line.kept { border-left-color: #8a5300; background: #fdf7ea; }
.specimen .why { display: block; font-size: .8rem; color: #566377; margin-top: 3px; }
.specimen .why b { color: #0f7b6c; font-weight: 600; } .specimen .line.kept .why b { color: #8a5300; }
.specimen mark { background: #fff1c2; color: inherit; padding: 0 2px; border-radius: 2px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-top: var(--space-6); }
.how h3 { font-size: 1.05rem; }
.how .n { font-family: var(--font-head); color: var(--brand); font-size: .95rem; display: block; margin-bottom: 4px; }
@media (max-width: 860px) {
  .hero-band .wrap { grid-template-columns: 1fr; gap: var(--space-5); padding-top: 40px; padding-bottom: 48px; }
  .how { grid-template-columns: 1fr; }
}
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
footer.site .btn.link { font-size: inherit; color: var(--ink-2); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* LaTeX editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); }
.editor textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; line-height: 1.5;
  height: 72vh; min-height: 420px; white-space: pre; overflow: auto; tab-size: 2; background: var(--card); }
.editor-preview iframe { width: 100%; height: calc(72vh + 60px); min-height: 480px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; }
.tex-error { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } .editor-preview iframe { height: 70vh; } }
.table-wrap { overflow-x: auto; max-width: 100%; }

/* --- Phase 1 components (docs/DESIGN_SYSTEM.md) --- */
/* Empty states */
.empty { text-align: center; padding: var(--space-6) var(--space-4); }
.empty-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; margin-bottom: var(--space-2); }
.empty .muted { max-width: 46ch; margin-left: auto; margin-right: auto; }

/* Trust cue */
.trust { display: flex; gap: var(--space-3); align-items: flex-start; background: var(--muted-soft); border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4); font-size: .92rem; color: var(--ink-2); margin: var(--space-4) 0; }
.trust .icon { color: var(--good); margin-top: 2px; }
.trust ul { margin: 0; padding-left: 1.1em; flex: 1; } .trust li { margin-bottom: 2px; }
.trust a { white-space: nowrap; align-self: center; }
@media (max-width: 600px) { .trust { flex-wrap: wrap; } }

/* Loading skeleton (shown while an HTMX request runs) */
.htmx-indicator { display: none; } .htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }
.skeleton { padding: var(--space-3) 0; } .skeleton span { display: block; height: 14px; margin: 8px 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--muted-soft), var(--line), var(--muted-soft)); background-size: 200% 100%;
  animation: sk 1.4s infinite linear; } .skeleton span:nth-child(2) { width: 85%; } .skeleton span:nth-child(3) { width: 60%; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton span { animation: none; } }

/* Toasts */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 30; display: grid; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-weight: 600; font-size: .95rem; }
@media (max-width: 760px) { .toasts { bottom: 84px; } }

/* Notifications list */
.notes { list-style: none; margin: 0; padding: 0; }
.note { display: flex; gap: var(--space-3); justify-content: space-between; align-items: center; padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note-title { font-weight: 600; margin: 0; }
.note.unread .note-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); margin-right: 8px; vertical-align: middle; }
.note.bad .note-title { color: var(--bad); }

/* Guided start checklist on Home */
.progress { height: 8px; background: var(--muted-soft); border-radius: 4px; overflow: hidden; margin: var(--space-2) 0 var(--space-4); }
.progress > span { display: block; height: 100%; background: var(--spectrum); }
.progress > span.p0 { width: 4%; } .progress > span.p1 { width: 20%; } .progress > span.p2 { width: 40%; }
.progress > span.p3 { width: 60%; } .progress > span.p4 { width: 80%; } .progress > span.p5 { width: 100%; }
.setup li a { color: inherit; }
.next-step { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; }

/* Focus visible inside custom controls */
.radio-cards label:has(input:focus-visible), .check:has(input:focus-visible), .pick:has(input:focus-visible),
.run-scope .radio:has(input:focus-visible) { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* Tables that become stacked rows on phones: <table class="table stack"> with data-label on each td */
@media (max-width: 640px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: var(--space-3); padding: var(--space-2) var(--space-3); }
  .table.stack td { border: 0; padding: 6px 0; text-align: left !important; }
  .table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); font-weight: 600; }
  .table.stack tr:hover td { background: none; }
}

/* Company cards (Companies page) */
.co-search { position: sticky; top: 61px; z-index: 3; background: var(--paper); padding: var(--space-3) 0; }
.co-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.co-card { display: flex; gap: var(--space-3); align-items: center; justify-content: space-between; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: var(--space-3); background: var(--card); }
.co-card.on { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.co-card .co-name { font-weight: 700; }
.co-card .co-meta { color: var(--muted); font-size: .86rem; }

/* Job card: one clear primary action */
.job .actions .btn.primary { order: -1; }

/* Editor on phones: preview link first, frame hidden (mobile browsers can't show PDFs inline) */
.preview-mobile { display: none; }
@media (max-width: 900px) { .preview-mobile { display: block; } .editor-preview iframe { display: none; } }

/* Settings: a section list on the left (desktop), a "change section" picker on phones */
.settings-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.settings-list { list-style: none; margin: 0; padding: 0; position: sticky; top: 80px; }
.settings-list a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.settings-list a span { display: block; color: var(--muted); font-size: .84rem; }
.settings-list a:hover { background: var(--brand-soft); }
.settings-list a[aria-current="page"] { background: var(--card); box-shadow: inset 3px 0 0 var(--brand); border: 1px solid var(--line); }
.settings-pick { display: none; }
.settings-pick summary { cursor: pointer; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--card); font-weight: 700; }
.settings-pick ul { list-style: none; margin: 6px 0 0; padding: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-sm); }
.settings-pick a { display: block; padding: 10px; text-decoration: none; color: var(--ink); }
.settings-pick a[aria-current="page"] { font-weight: 700; color: var(--brand-strong); }
details.advanced { margin: var(--space-4) 0; border-top: 1px solid var(--line); padding-top: var(--space-3); }
details.advanced > summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; margin-bottom: var(--space-3); }
.qr { background: #fff; display: inline-block; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.qr svg { display: block; width: 180px; height: 180px; }
code.secret { font-size: 1.05rem; letter-spacing: .06em; word-break: break-all; }
.codes { columns: 2; list-style: none; padding: 0; margin: var(--space-3) 0; font-size: 1.05rem; }
@media (max-width: 760px) {
  .settings-layout { grid-template-columns: 1fr; gap: var(--space-3); }
  .settings-list { display: none; }
  .settings-pick { display: block; }
}
/* Top-100 companies */
.top-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); counter-reset: top; }
.top-list > li { counter-increment: top; }
.top-list > li .co-name::before { content: counter(top) ". "; color: var(--muted); font-weight: 600; }
.top-line { margin: 0 0 var(--space-2); font-size: 1.05rem; }
.start-paths .card { display: flex; flex-direction: column; gap: var(--space-2); }
.start-paths .card > .btn, .start-paths form { margin-top: auto; }
/* Jobs filters */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-4); align-items: flex-end; margin-bottom: var(--space-4); }
.filters .field, .filters .check { margin-bottom: 0; }
.filters select { width: auto; }
/* Match breakdown */
.match-parts { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-2); }
.match-parts li { display: grid; grid-template-columns: 11rem 1fr 3rem; gap: var(--space-3); align-items: center; }
.match-parts meter { width: 100%; height: 12px; }
.match-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 520px) { .match-parts li { grid-template-columns: 1fr 3rem; } .match-parts li .match-label { grid-column: 1 / -1; } }
/* Cover letter preview */
.letter { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-4) var(--space-5); max-width: 70ch; }
.letter p.placeholder { background: var(--sun); color: var(--sun-ink); padding: 2px 6px; border-radius: 4px; }
/* Board (T11): six columns that scroll inside the board on desktop, stacked on phones */
.board { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: var(--space-3); overflow-x: auto;
  padding-bottom: var(--space-3); margin-top: var(--space-4); }
.board-col { background: var(--muted-soft); border-radius: var(--radius); padding: var(--space-3); min-height: 160px; }
.board-col.over { outline: 3px dashed var(--brand); outline-offset: -3px; }
.board-h { font-size: 1rem; margin-bottom: var(--space-2); }
.board-h .count { color: var(--muted); font-weight: 600; }
.board-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.board-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-3);
  font-size: .92rem; }
.board-card[draggable="true"] { cursor: grab; }
.board-card.dragging { opacity: .5; }
.bc-title { font-weight: 700; margin-bottom: 2px; }
.bc-meta { color: var(--ink-2); }
.bc-move { display: flex; gap: 6px; margin-top: var(--space-2); flex-wrap: wrap; }
.bc-move select { min-height: 36px; padding: 4px 8px; width: auto; flex: 1 1 120px; font-size: .88rem; }
.board-empty { padding: var(--space-2); }
@media (max-width: 760px) { .board { grid-template-columns: 1fr; overflow-x: visible; } }
.board { max-width: 100%; }
.board-col, .board-card { min-width: 0; }
.bc-move select { max-width: 100%; min-width: 0; }
.code-box { overflow-wrap: anywhere; max-width: 100%; }
@media (min-width: 761px) and (max-width: 1100px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); overflow-x: visible; } }
