/* Quiet surfaces, lime green and sun yellow accents (Syde palette). */
:root {
  /* brand palette; use through the semantic tokens below */
  --color-50: #F6FAEA;
  --color-100: #EAF4CC;
  --color-200: #D6EA9C;
  --color-300: #C0DE66;
  --color-400: #AED43F;
  --color-500: #9FCA28;
  --color-600: #84AF0B;
  --color-700: #6C9D25;
  --color-800: #4E7316;
  --color-900: #334C0F;
  --color-950: #1A2707;

  --paper: #f5f7f7;
  --surface: #ffffff;
  --ink: #2f343a;
  --ink-2: #4b525a;
  --ink-3: #67707b;
  --line: #d6dcdc;
  --line-2: #e4eaea;
  /* lime is too light for text: --accent fills (with --on-accent text), --accent-ink is the text colour */
  --accent: var(--color-500);
  --accent-hover: var(--color-600);
  --on-accent: #2f343a;
  --accent-ink: var(--color-800);
  --accent-deep: var(--color-900);
  --accent-wash: var(--color-100);
  --yellow: #ffbb13;
  --red: #c60a32;
  --red-wash: #fbe7eb;
  --green: #1f7a4d;
  --green-wash: #e5f4ec;
  --amber: #8a5d00;
  --amber-wash: #fff4d6;
  --slate-wash: #e7eeee;
  --focus: var(--color-700);
  --radius: 10px;
  --radius-s: 6px;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

/* Dark: the device's choice unless the user picked light in Settings, or the
   user picked dark (data-theme on <html>). Signed-out pages always carry
   data-theme=light. The two token blocks must match.
   Screen only, so printouts stay dark text on white. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --paper: #23272c;
    --surface: #2f343a;
    --ink: #eef2f2;
    --ink-2: #c3cad0;
    --ink-3: #9aa3ad;
    --line: #444b53;
    --line-2: #393f46;
    --accent-hover: var(--color-400);
    --accent-ink: var(--color-400);
    --accent-deep: var(--color-200);
    --accent-wash: #2f3a1c;
    --red: #ff7a8f;
    --red-wash: #3d1a21;
    --green: #6fcf9c;
    --green-wash: #183528;
    --amber: #ffcc4d;
    --amber-wash: #3a2f10;
    --slate-wash: #3a4047;
    --focus: var(--color-400);
    color-scheme: dark;
  }
}
@media screen {
  :root[data-theme=dark] {
    --paper: #23272c;
    --surface: #2f343a;
    --ink: #eef2f2;
    --ink-2: #c3cad0;
    --ink-3: #9aa3ad;
    --line: #444b53;
    --line-2: #393f46;
    --accent-hover: var(--color-400);
    --accent-ink: var(--color-400);
    --accent-deep: var(--color-200);
    --accent-wash: #2f3a1c;
    --red: #ff7a8f;
    --red-wash: #3d1a21;
    --green: #6fcf9c;
    --green-wash: #183528;
    --amber: #ffcc4d;
    --amber-wash: #3a2f10;
    --slate-wash: #3a4047;
    --focus: var(--color-400);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-deep); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--ink-3); font-weight: 400; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
form[action="/register"] input[name="name"] { display: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--slate-wash); padding: .1em .35em; border-radius: 4px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; padding: 0 8px 18px; }
.brand svg { width: 28px; height: 28px; flex: none; }
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .logo-a { fill: var(--color-500); } :root:not([data-theme=light]) .logo-b { fill: var(--yellow); }
  :root:not([data-theme=light]) .logo-c { fill: var(--color-200); }
}
@media screen {
  [data-theme=dark] .logo-a { fill: var(--color-500); } [data-theme=dark] .logo-b { fill: var(--yellow); }
  [data-theme=dark] .logo-c { fill: var(--color-200); }
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav > a:not(.btn) {
  display: block; padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav > a:not(.btn):hover { background: var(--slate-wash); color: var(--ink); }
.nav > a[aria-current="page"] { background: var(--accent-wash); color: var(--accent-deep); }
.nav .nav-count { float: right; color: var(--ink-3); font-weight: 400; font-size: .85rem; }
.nav-add { margin: 0 0 14px; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 8px; }
.nav-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.nav-foot .who { min-width: 0; flex: 1; line-height: 1.3; }
.nav-foot .who strong, .nav-foot .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-foot .who small { color: var(--ink-3); }
.nav-legal { display: flex; gap: 12px; padding: 10px 8px 0; font-size: .8rem; }
.nav-legal a, .public-footer a { color: var(--ink-3); }
.public-footer { display: flex; gap: 18px; justify-content: center; padding: 24px 16px 40px; font-size: .85rem; border-top: 1px solid var(--line); max-width: 1180px; margin: 0 auto; }
.legal { max-width: 46rem; }
.legal h2 { font-size: 1.15rem; margin-top: 1.8em; }
.legal li { margin-bottom: .35em; }
.legal .updated { color: var(--ink-3); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--accent-wash); color: var(--accent-deep);
}
.sidebar .menu-toggle { display: none; }
.main { padding: 28px 40px 64px; max-width: 1180px; width: 100%; }

/* ---------- public pages ---------- */
.public-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 28px; max-width: 1180px; margin: 0 auto; }
.public-header .brand { padding: 0; }
.public-header nav { display: flex; gap: 18px; align-items: center; }
.public-main { max-width: 1180px; margin: 0 auto; padding: 8px 28px 64px; }
.auth { max-width: 420px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.auth h1 { font-size: 1.5rem; }
.auth .alt { text-align: center; margin: 18px 0 0; color: var(--ink-2); }
/* "Sign in with Google" in Google's light theme (developers.google.com/identity/branding-guidelines):
   40px high, 1px #747775 stroke, 20px "G", 12px padding, 10px to the label. Light in dark mode too,
   since the "G" must sit on white. */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px;
  background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 4px;
  font: 500 14px/20px "Google Sans", Roboto, Arial, sans-serif; cursor: pointer;
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); }
.g-logo { width: 20px; height: 20px; flex: none; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-3); font-size: .85rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.landing { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 48px 0 24px; }
.landing h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); line-height: 1.08; letter-spacing: -0.025em; margin-bottom: .45em; }
.landing .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 34em; }
.landing .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 56px 0 0; padding: 32px 0 0; border-top: 1px solid var(--line); list-style: none; counter-reset: how; }
.how li { counter-increment: how; }
.how li::before { content: counter(how); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--accent-ink); color: var(--accent-ink); font-weight: 700; margin-bottom: 12px; }
.how h3 { font-size: 1.05rem; }
.how p { color: var(--ink-2); margin: 0; }
/* The hero animation (.hd) brings its own styles inline: see tasks/001-hero-video. */

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-2); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: .9rem; margin-bottom: 6px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
  padding: 9px 16px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn-danger-solid, .btn-danger-solid:hover { background: var(--red); border-color: var(--red); color: #fff; }
@media screen and (prefers-color-scheme: dark) { :root:not([data-theme=light]) .btn-danger-solid { color: var(--paper); } }
@media screen { [data-theme=dark] .btn-danger-solid { color: var(--paper); } }
.btn-small { padding: 5px 10px; font-size: .85rem; }
.btn-big { padding: 13px 22px; font-size: 1.05rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
button.link.danger { color: var(--red); }
.inline { display: inline; }

label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 6px; }
.field { margin-bottom: 16px; }
.field .hint, .hint { color: var(--ink-3); font-size: .85rem; margin: 6px 0 0; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-s); padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
select { width: auto; padding-right: 28px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: -3px; margin: 0 8px 0 0; }
.check { display: flex; align-items: flex-start; font-weight: 400; gap: 0; cursor: pointer; margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.error-box { background: var(--red-wash); color: var(--red); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 16px; font-weight: 500; }
.row-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row-form .field { margin: 0; flex: 1; min-width: 160px; }

/* ---------- flash & banner ---------- */
.flash { padding: 11px 16px; border-radius: var(--radius-s); margin-bottom: 20px; font-weight: 500; border-left: 4px solid; }
.flash-ok { background: var(--green-wash); color: var(--green); border-color: var(--green); }
.flash-error { background: var(--red-wash); color: var(--red); border-color: var(--red); }
.flash-info { background: var(--accent-wash); color: var(--accent-deep); border-color: var(--accent); }
.flash button.link { color: inherit; font-weight: 600; margin-left: 4px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--amber-wash); color: var(--amber); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 20px; font-weight: 600; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 22px; }
.panel > h2:first-child { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.cols-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); }
.empty h2 { color: var(--ink); }
.empty p { max-width: 30em; margin: 0 auto 1em; }

/* ---------- PDF preview ---------- */
.pdf-modal {
  width: min(920px, calc(100vw - 32px)); height: calc(100vh - 32px); max-width: none; max-height: none;
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.pdf-modal[open] { display: flex; flex-direction: column; }
.pdf-modal::backdrop, .confirm-modal::backdrop { background: rgba(35, 39, 44, .6); }
.pdf-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pdf-modal-head form { margin: 0; }
.pdf-modal iframe { flex: 1; width: 100%; border: 0; background: var(--paper); }

/* ---------- confirm dialog ---------- */
.confirm-modal {
  width: min(420px, calc(100vw - 32px)); padding: 22px 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.confirm-modal p { margin: 0 0 18px; line-height: 1.5; }
.confirm-modal .form-actions { justify-content: flex-end; margin: 0; }

/* ---------- import ---------- */
.import { margin: 0; }
.import-label { font-size: 1.05rem; margin-bottom: 10px; }
.import-row { display: flex; gap: 10px; }
.import-row input { flex: 1; font-size: 1.05rem; padding: 12px 14px; }
.import-row .btn { padding: 12px 22px; }
.hero-import { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; border-top: 3px solid var(--accent); }
.import-compact .import-label { font-size: .92rem; }
.import-compact .import-row input, .import-compact .import-row .btn { padding-top: 9px; padding-bottom: 9px; font-size: 1rem; }

/* ---------- pipeline strip ---------- */
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.stage { display: block; padding: 16px 20px; text-decoration: none; color: var(--ink-2); position: relative; }
.stage + .stage { border-left: 1px solid var(--line); }
.stage:hover { background: var(--slate-wash); color: var(--ink); }
.stage-n { display: block; font-size: 1.9rem; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.stage-saved::after { background: var(--ink-3); }
.stage-applied::after { background: var(--accent); }
.stage-interview::after { background: var(--yellow); }
.stage-offer::after { background: var(--green); }

/* ---------- checklist (a real sequence) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.checklist li { counter-increment: step; }
.checklist a { display: block; height: 100%; padding: 14px 14px 14px 52px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; color: var(--ink-2); position: relative; font-size: .9rem; }
.checklist a:hover { border-color: var(--accent); }
.checklist a::before { content: counter(step); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ink-3); display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.checklist strong { display: block; color: var(--ink); font-size: .98rem; margin-bottom: 2px; }
.checklist .done a { background: var(--paper); }
.checklist .done strong { text-decoration: line-through; color: var(--ink-3); }
.checklist .done a::before { content: "✓"; background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 12px; color: var(--ink-2); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--accent-deep); border-color: var(--accent); }
.tabs .n { color: var(--ink-3); font-size: .85rem; margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- job list ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search { display: flex; gap: 8px; }
.search input { width: 260px; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 18px; }
.list > li + li { border-top: 1px solid var(--line-2); }
.list .title { font-weight: 600; color: var(--ink); text-decoration: none; font-size: 1.02rem; }
.list .title:hover { color: var(--accent-ink); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-3); font-size: .88rem; margin-top: 2px; }
.meta .due { color: var(--amber); font-weight: 600; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.match { font-size: .85rem; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.match b { color: var(--ink); }

/* ---------- status pills ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--slate-wash); color: var(--ink-2); }
.pill-applied { background: var(--accent-wash); color: var(--accent-deep); }
.pill-interview { background: var(--amber-wash); color: var(--amber); }
.pill-offer, .pill-accepted { background: var(--green-wash); color: var(--green); }
.pill-rejected, .pill-withdrawn { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
.pill-suspended { background: var(--red-wash); color: var(--red); }
.pill-deleted { background: var(--red-wash); color: var(--red); }
.pill-active { background: var(--green-wash); color: var(--green); }
.status-form select { font-size: .88rem; padding: 5px 26px 5px 9px; font-weight: 600; }

/* ---------- job page ---------- */
.job-head h1 { font-size: 1.9rem; margin-bottom: 6px; }
.job-head .company { font-size: 1.1rem; color: var(--ink-2); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--ink-2); margin: 12px 0 0; padding: 0; list-style: none; font-size: .95rem; }
.facts li span { color: var(--ink-3); margin-right: 4px; }
.stepper { display: flex; flex-wrap: wrap; gap: 0; margin: 22px 0; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); width: fit-content; max-width: 100%; }
.stepper form { display: contents; }
.stepper button { font: inherit; font-size: .9rem; font-weight: 600; border: 0; background: transparent; color: var(--ink-2); padding: 9px 14px; cursor: pointer; border-right: 1px solid var(--line); }
.stepper form:last-child button { border-right: 0; }
.stepper button:hover { background: var(--slate-wash); color: var(--ink); }
.stepper button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.stepper .closed[aria-pressed="true"] { background: var(--ink-2); color: var(--surface); }
.apply-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--radius); background: var(--accent-wash); margin-bottom: 22px; }
.apply-cta > p { margin: 0; flex: 1; min-width: 200px; color: var(--accent-deep); }
/* split button: main action plus a <details> menu with other ways to do it */
.split { display: inline-flex; position: relative; }
.split > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-more > summary { list-style: none; height: 100%; padding-left: 12px; padding-right: 12px; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-color: var(--accent-hover); }
.split-more > summary::-webkit-details-marker { display: none; }
.split-more[open] > summary { background: var(--accent-hover); }
.split-more[open] > summary svg { transform: rotate(180deg); }
.split-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: min(340px, calc(100vw - 72px)); padding: 6px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(35, 39, 44, .16);
}
.menu-item { display: block; padding: 10px 12px; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); }
.menu-item:hover { background: var(--accent-wash); color: var(--accent-deep); }
.menu-item strong { display: block; }
.menu-section { margin: 0; padding: 10px 12px; border-top: 1px solid var(--line-2); }
.menu-section p { margin: 0 0 8px; }
.menu-section .hint { margin: 8px 0 0; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px dashed var(--line); border-radius: var(--radius-s); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; cursor: grab; }
.file-chip + .file-chip { margin-top: 6px; }
.file-chip:hover { border-style: solid; border-color: var(--accent); color: var(--ink); }
.file-chip:active { cursor: grabbing; }
.split-menu .file-chip .icon { width: 28px; height: 34px; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .97rem; line-height: 1.65; max-width: 72ch; }
.js .clamp:not(.open) { max-height: 22em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.expand { margin-top: 10px; font-weight: 600; text-decoration: none; }
.side h3 { font-size: .95rem; margin: 0 0 10px; }
.side .panel { padding: 18px 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .85rem; background: var(--slate-wash); color: var(--ink-2); border: 1px solid transparent; }
.chip-yes { background: var(--green-wash); color: var(--green); font-weight: 600; }
.chip form { display: inline; }
.chip-add { background: var(--surface); border: 1px dashed var(--ink-3); cursor: pointer; font: inherit; font-size: .85rem; color: var(--ink-2); padding: 3px 10px; border-radius: 999px; }
.chip-add:hover { border-color: var(--accent-ink); color: var(--accent-ink); border-style: solid; }
.meter { height: 6px; border-radius: 3px; background: var(--slate-wash); overflow: hidden; margin: 6px 0 12px; }
.meter span { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: .93rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- timeline (a real sequence) ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 18px 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.timeline .ev-status::before { border-color: var(--accent); background: var(--accent); }
.timeline .ev-email::before { border-color: var(--green); background: var(--green); }
.timeline .ev-note::before { border-color: var(--amber); }
.timeline time { color: var(--ink-3); font-size: .82rem; display: block; }
.timeline .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .del { margin-left: 8px; font-size: .8rem; }
.timeline a { color: var(--ink); font-weight: 600; text-decoration: none; }
.timeline a:hover { color: var(--accent-ink); text-decoration: underline; }
.note-form { margin-bottom: 20px; }
.note-form textarea { min-height: 70px; }

/* ---------- the envelope (apply page) ---------- */
.envelope {
  border: 10px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, transparent 14px 22px, var(--accent) 22px 36px, transparent 36px 44px) 10;
  background: var(--surface);
  padding: 30px 34px;
  margin-bottom: 22px;
  position: relative;
}
.envelope .addr { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px 14px; align-items: center; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px dashed var(--line); }
.envelope .addr label { margin: 0; color: var(--ink-3); font-weight: 500; }
.envelope .addr input { border-color: transparent; border-bottom-color: var(--line); border-radius: 0; padding-left: 2px; font-size: 1.02rem; }
.envelope .addr input:focus { border-radius: var(--radius-s); }
.stamp {
  position: absolute; top: 18px; right: 22px; width: 72px; height: 84px;
  border: 2px dashed var(--yellow); border-radius: 4px; color: var(--amber);
  display: grid; place-items: center; text-align: center; font-size: .7rem; font-weight: 700; line-height: 1.2;
  transform: rotate(4deg); background: var(--amber-wash); padding: 6px;
}
.stamp svg { width: 30px; height: 30px; display: block; margin: 0 auto 4px; }
.letter {
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.7;
  min-height: 340px; border: 0; padding: 4px 2px; background:
    repeating-linear-gradient(transparent 0 calc(1.7em - 1px), var(--line-2) calc(1.7em - 1px) 1.7em);
  background-attachment: local;
}
.letter:focus { outline: 1px dashed var(--line); outline-offset: 6px; }
.attach { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.attach h3 { font-size: .95rem; }
.send-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.send-bar .via { color: var(--ink-2); font-size: .9rem; flex: 1; min-width: 220px; }
.warn { background: var(--amber-wash); color: var(--amber); padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 18px; }
.warn a { color: inherit; font-weight: 600; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-weight: 600; color: var(--ink-3); font-size: .85rem; background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .sub, dd .sub { display: block; color: var(--ink-3); font-size: .85rem; }

/* ---------- documents & skills ---------- */
.files { list-style: none; margin: 0 0 16px; padding: 0; }
.files li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.files .icon, .file-chip .icon { width: 36px; height: 44px; border-radius: 4px; background: var(--accent-wash); color: var(--accent-deep); display: grid; place-items: center; font-size: .7rem; font-weight: 700; flex: none; }
.files .name { flex: 1; min-width: 160px; }
.files .name a { font-weight: 600; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.files .name small { display: block; color: var(--ink-3); }
.default-tag { color: var(--green); font-weight: 600; font-size: .85rem; }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--ink-2); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-wash); }
.dropzone input[type=file] { margin: 10px auto 0; display: block; max-width: 100%; }
.skills-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.skills-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.skills-list .sname { font-weight: 600; overflow-wrap: anywhere; }
.levels { display: flex; gap: 3px; }
.levels button { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--accent-ink); background: transparent; padding: 0; cursor: pointer; }
.levels button.on { background: var(--accent); }
.levels button:hover { transform: scale(1.2); }
.x { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 2px 4px; }
.x:hover { color: var(--red); }
.placeholders { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .88rem; margin: 0; }
.placeholders dt code { cursor: copy; }
.placeholders dd { margin: 0; color: var(--ink-2); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 22px; overflow: hidden; }
.stat-row div { padding: 14px 18px; border-right: 1px solid var(--line-2); }
.stat-row b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat-row span { color: var(--ink-3); font-size: .88rem; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: var(--mono); font-size: .85rem; }
.danger-zone { border-color: var(--red-wash); }
.danger-zone h2 { color: var(--red); }

.err-page { text-align: center; padding: 80px 20px; }
.err-page .code { font-size: 4rem; font-weight: 800; color: var(--line); line-height: 1; margin-bottom: 10px; }

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .cols-main { grid-template-columns: minmax(0, 1fr); }
  .checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: auto; z-index: 10; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .main [id] { scroll-margin-top: 72px; } /* clear the sticky bar when a link jumps to #section */
  .brand { padding: 0; flex: 1; }
  .sidebar .menu-toggle { display: inline-flex; }
  .nav { display: none; flex-basis: 100%; padding-top: 12px; }
  .nav.open { display: flex; }
  .main { padding: 20px 16px 48px; }
  .cols, .grid-2, .grid-3, .landing, .how { grid-template-columns: minmax(0, 1fr); }
  .landing { gap: 28px; padding-top: 16px; }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage:nth-child(3) { border-left: 0; }
  .stage:nth-child(n+3) { border-top: 1px solid var(--line); }
  .list > li { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .import-row { flex-direction: column; }
  .search input { width: 100%; }
  .search { flex: 1; }
  .envelope { padding: 22px 16px; }
  .envelope .addr { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .stamp { display: none; }
  .public-header, .public-main { padding-left: 16px; padding-right: 16px; }
  .auth { padding: 24px 18px; margin: 16px auto; }
}
@media (max-width: 520px) {
  .checklist { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 1.5rem; }
  .job-head h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .page-head .actions, .stepper, .note-form, .apply-cta { display: none; }
  .shell { display: block; }
  body { background: #fff; }
}
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-row input { flex: 1 1 260px; }
.add-row select { flex: 0 0 auto; }

/* ---------- CV ---------- */
.cv-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 18px; }
.cv-nav a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .88rem; font-weight: 500; }
.cv-nav a:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
.cv-nav .n { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: 2px; }
.cv-person { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 28px; align-items: start; }
.cv-photo { text-align: center; }
.cv-photo img, .cv-photo-empty { width: 150px; height: 200px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); margin: 0 auto 12px; display: block; }
.cv-photo-empty { display: grid; place-items: center; background: var(--slate-wash); color: var(--ink-3); font-size: 2rem; font-weight: 700; }
.cv-photo form { margin-bottom: 10px; }
.cv-photo input[type=file] { max-width: 100%; font-size: .85rem; margin-bottom: 4px; }
.cv-list { list-style: none; margin: 0 0 14px; padding: 0; }
.cv-list > li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.cv-when { color: var(--ink-3); font-size: .88rem; padding-top: 2px; font-variant-numeric: tabular-nums; }
.cv-desc { margin: 4px 0 0; color: var(--ink-2); font-size: .92rem; white-space: pre-line; overflow-wrap: anywhere; }
.cv-edit, .cv-add { margin-top: 6px; }
.cv-edit > summary, .cv-add > summary { cursor: pointer; color: var(--accent-ink); font-size: .88rem; font-weight: 600; width: fit-content; }
.cv-add > summary { list-style: none; display: inline-flex; padding: 7px 14px; border: 1px dashed var(--ink-3); border-radius: var(--radius-s); color: var(--ink-2); }
.cv-add > summary::-webkit-details-marker { display: none; }
.cv-add > summary::before { content: "+"; margin-right: 6px; }
.cv-add > summary:hover { border-color: var(--accent-ink); border-style: solid; color: var(--accent-ink); }
.cv-add[open] > summary { margin-bottom: 14px; }
.cv-form { margin-top: 12px; padding: 16px 18px 6px; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-s); }
.cv-current { margin: 8px 0 0; font-size: .88rem; }
@media (max-width: 860px) {
  .cv-person { grid-template-columns: minmax(0, 1fr); }
  .cv-photo { text-align: left; }
  .cv-photo img, .cv-photo-empty { margin-left: 0; }
  .cv-list > li { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .cv-when { grid-column: 1 / -1; }
}
.cv-attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cv-attach .check { margin: 0; }
.cv-attach select { font-size: .85rem; padding: 4px 26px 4px 8px; }

/* ---------- plans & pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-bottom: 14px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; display: flex; flex-direction: column; min-width: 0; }
.plan-card h2, .plan-card h3 { font-size: 1.15rem; margin: 0 0 6px; }
.plan-card.current { border-color: var(--green); box-shadow: inset 0 3px 0 var(--green); }
.plan-card.highlight { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.plan-price { margin: 0 0 8px; color: var(--ink-3); }
.plan-price b { font-size: 1.9rem; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.plan-desc { color: var(--ink-2); margin: 0 0 12px; font-size: .95rem; }
.plan-features { list-style: none; margin: 0 0 18px; padding: 0; flex: 1; font-size: .93rem; }
.plan-features li { padding: 3px 0 3px 22px; position: relative; color: var(--ink-2); }
.plan-features li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.plan-action .btn { width: 100%; }
.plan-action form { margin: 0; }
.plan-action .hint { margin: 0; }
.pricing { margin: 56px 0 0; padding: 32px 0 0; border-top: 1px solid var(--line); }
.pricing > h2 { font-size: 1.5rem; margin-bottom: 6px; }
.pricing > p { color: var(--ink-2); margin-bottom: 22px; }

/* delivery problems (bounces) */
.bounce { border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius-s); padding: 12px 16px; margin: 12px 0; background: var(--surface); }
.bounce.delayed { border-left-color: var(--amber); }
.bounce p { margin: 4px 0; }
.bounce .title { font-weight: 700; color: var(--red); }
.bounce.delayed .title { color: var(--amber); }
.bounce ul { margin: 4px 0 6px; padding-left: 20px; }
.bounce li { margin: 2px 0; }
.bounce .row-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.said { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); background: var(--paper); border-radius: 4px; padding: 6px 9px; overflow-wrap: anywhere; }
.attention { border-color: var(--red); }
.attention .panel-head h2 { color: var(--red); }
.bounce-note { display: block; color: var(--red); }
.pill-bounced { background: var(--red-wash); color: var(--red); }
.pill-delayed { background: var(--amber-wash); color: var(--amber); }
.timeline .ev-bounce::before { border-color: var(--red); background: var(--red); }
.timeline .ev-delay::before { border-color: var(--amber); background: var(--amber); }
pre.report { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: .82rem; background: var(--paper); border-radius: var(--radius-s); padding: 12px 14px; max-height: 420px; overflow: auto; margin: 0; }
