/*
 * Design tokens, following the INCUBATOR brand: graphite surfaces, soft borders, a violet accent.
 * Every colour is used through a role. Green is reserved for "confirmed/working", teal for manual records.
 */
:root {
  color-scheme: light;
  --bg: #f4f4f7;
  --surface: #ffffff;
  --surface-2: #eeeef3;
  --line: #e3e3eb;
  --line-strong: #c8c8d5;
  --ink: #111114;
  --ink-2: #3a3a46;
  --muted: #62626f;
  /* --accent colours text and outlines; --accent-bg fills buttons and must carry --accent-ink at AA contrast. */
  --accent: #6d28d9;
  --accent-bg: #6d28d9;
  --accent-bg-hover: #5b21b6;
  --accent-ink: #ffffff;
  --accent-soft: #efe9fd;
  --info: #1d5fa8;
  --info-soft: #e3eefa;
  --success: #17694a;
  --success-soft: #e2f1e9;
  --warning: #8a5300;
  --warning-soft: #fdf0d5;
  --danger: #a52a2a;
  --danger-soft: #fbe6e4;
  --manual: #0b6b72;
  --manual-soft: #dff3f4;
  --focus: #7c3aed;
  --shadow: 0 1px 2px rgb(17 17 20 / .05), 0 1px 3px rgb(17 17 20 / .06);
  --shadow-lift: 0 12px 34px rgb(17 17 20 / .16);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 256px;
  font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #070709; --surface: #111114; --surface-2: #1a1a1f; --line: #24242b; --line-strong: #383842;
    --ink: #f4f4f7; --ink-2: #cdcdd6; --muted: #9797a6;
    --accent: #c4b5fd; --accent-bg: #7c3aed; --accent-bg-hover: #6d28d9; --accent-ink: #ffffff; --accent-soft: #1f1838;
    --info: #8ab8f0; --info-soft: #14253a; --success: #6fd3a3; --success-soft: #12301f;
    --warning: #f1bd5c; --warning-soft: #36280a; --danger: #f29a94; --danger-soft: #3d1918;
    --manual: #5fd8d0; --manual-soft: #0e2c2d; --focus: #a78bfa;
    --shadow: 0 0 0 1px rgb(255 255 255 / .02); --shadow-lift: 0 16px 44px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070709; --surface: #111114; --surface-2: #1a1a1f; --line: #24242b; --line-strong: #383842;
  --ink: #f4f4f7; --ink-2: #cdcdd6; --muted: #9797a6;
  --accent: #c4b5fd; --accent-bg: #7c3aed; --accent-bg-hover: #6d28d9; --accent-ink: #ffffff; --accent-soft: #1f1838;
  --info: #8ab8f0; --info-soft: #14253a; --success: #6fd3a3; --success-soft: #12301f;
  --warning: #f1bd5c; --warning-soft: #36280a; --danger: #f29a94; --danger-soft: #3d1918;
  --manual: #5fd8d0; --manual-soft: #0e2c2d; --focus: #a78bfa;
  --shadow: 0 0 0 1px rgb(255 255 255 / .02); --shadow-lift: 0 16px 44px rgb(0 0 0 / .6);
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.035em; font-weight: 800; text-wrap: balance; }
h2 { font-size: 17px; line-height: 1.3; letter-spacing: -.02em; font-weight: 750; }
h3 { font-size: 16px; line-height: 1.35; letter-spacing: -.01em; font-weight: 700; overflow-wrap: anywhere; }
h4 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
a { color: var(--accent); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.5; }
.eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; color: var(--accent); margin-bottom: 6px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Controls */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 14px; font-weight: 700; transition: background-color .16s, border-color .16s, color .16s; }
button:disabled { opacity: .55; cursor: not-allowed; }
.primary { background: var(--accent-bg); color: var(--accent-ink); }
.primary:hover:not(:disabled) { background: var(--accent-bg-hover); }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.secondary:hover:not(:disabled) { background: var(--surface-2); }
.ghost { background: transparent; color: var(--ink-2); text-align: left; padding-inline: 12px; }
.ghost:hover:not(:disabled) { background: var(--surface-2); }
.block { width: 100%; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea { width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); font-size: 15px; font-weight: 400; color: var(--ink); transition: border-color .16s, box-shadow .16s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea { resize: vertical; line-height: 1.6; }
.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; color: var(--ink); cursor: pointer; min-height: 44px; padding: 10px 0; }
.check input { width: 20px; height: 20px; min-height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent-bg); }
.check-group { display: flex; flex-direction: column; gap: 12px; justify-content: center; }

/* Chips: the tone carries meaning, the text always states it too. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); }
.chip-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.chip-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-manual { background: var(--manual-soft); color: var(--manual); border-color: transparent; }
.chip-source { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.fit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; }
.reader { display: grid; gap: 12px; justify-items: start; }
.reader label { width: 100%; max-width: 420px; }
.reader .check { max-width: 640px; }
.contacts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; font-size: 14px; }
.contacts-label { color: var(--muted); font-size: 13px; }
.contacts a { color: var(--accent); font-weight: 600; min-height: 24px; }
.fit-reason { font-size: 13px; color: var(--muted); }
.chip-off { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
/* The brand panel is graphite in both themes, like the site it belongs to. */
.login-intro { background: #08080b radial-gradient(120% 80% at 0% 100%, rgb(124 58 237 / .38), transparent 60%); color: #f4f4f7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.login-intro .brand { color: #f4f4f7; }
.login-pitch h1 { font-size: 44px; letter-spacing: -.045em; max-width: 13em; }
.login-pitch p { margin-top: 16px; font-size: 17px; max-width: 30em; opacity: .9; }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; opacity: .92; }
.login-points li { padding-left: 22px; position: relative; }
.login-points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 10px; height: 2px; background: currentColor; }
.login-card { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 48px; max-width: 520px; width: 100%; margin: 0 auto; }
.login-card h2 { font-size: 24px; }
.login-card form { display: grid; gap: 14px; margin-top: 8px; }

/* Shell */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .04em; font-size: 15px; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-bg); flex: none; }
.brand-sub { font-weight: 600; letter-spacing: .02em; opacity: .6; }
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar .brand { padding: 0 8px; }
.candidate-label { padding: 0 4px; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav button { display: flex; align-items: center; gap: 12px; width: 100%; background: transparent; color: var(--ink-2); font-weight: 500; text-align: left; padding: 9px 12px; }
nav button svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
nav button:hover { background: var(--surface-2); color: var(--ink); }
nav button.selected { background: var(--accent-soft); color: var(--accent); font-weight: 750; }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.mode { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 12px 10px; }
.mode-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--warning); flex: none; }
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 40px 0; min-width: 0; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.tag { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tab { display: flex; flex-direction: column; gap: 16px; }
footer { margin-top: 40px; padding: 20px 0 28px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* Surfaces */
.panel, .card, .metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-quiet { background: transparent; box-shadow: none; border-style: dashed; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.wide { grid-column: 1 / -1; }
.notice { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); }
.notice-info { background: var(--info-soft); border-color: transparent; color: var(--info); }

/* Overview */
.hero { padding: 24px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid transparent; }
.hero h2 { font-size: 26px; letter-spacing: -.035em; font-weight: 800; }
.hero-summary { margin-top: 6px; color: var(--ink-2); }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.facts { display: grid; gap: 10px; }
.labelled { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.labelled-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); min-width: 150px; }
.labelled-value { font-weight: 550; overflow-wrap: anywhere; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.metric-label { font-size: 13px; color: var(--muted); }
.metric strong { font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.task-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.task-row:first-child { border-top: 0; padding-top: 0; }
.task-row p { margin-top: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.task-row > div { min-width: 0; }
.due { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.due.overdue { color: var(--danger); font-weight: 600; }
.pipeline-row { display: grid; grid-template-columns: minmax(0, 150px) 1fr auto; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; }
.pipeline-name { color: var(--ink-2); }
.pipeline-bar { height: 8px; border-radius: 999px; background: var(--surface-2); position: relative; overflow: hidden; }
.pipeline-bar::after { content: ""; position: absolute; inset: 0; width: calc(var(--share, 0) * 100%); background: var(--manual); border-radius: inherit; }
.pipeline-row strong { font-variant-numeric: tabular-nums; min-width: 1.5em; text-align: right; }
.checklist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check-item { display: flex; flex-direction: column; gap: 4px; padding-left: 26px; position: relative; }
.check-item::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); }
.check-item.done::before { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 3px var(--surface); }
.off-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 14px; color: var(--ink-2); }
.off-list li { padding-left: 18px; position: relative; }
.off-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; border: 1px dashed var(--muted); }

/* Profile */
.form-section header { display: flex; flex-direction: column; gap: 2px; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lift); }
.dirty-flag { margin-right: auto; font-size: 13px; font-weight: 650; color: var(--warning); padding-left: 16px; position: relative; }
.dirty-flag::before { content: ""; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
/* An edited letter, note or stage form is marked until it is saved or re-rendered. */
.letter-editor.is-dirty textarea, .vacancy-notes.is-dirty textarea, .tracking.is-dirty { box-shadow: inset 3px 0 0 var(--warning); }

/* Lists and cards */
.filter-bar { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.filter-bar label { flex: 1 1 150px; }
.filter-bar .filter-search { flex: 3 1 240px; }
.filter-bar .check { flex: 0 0 auto; align-items: center; }
.filter-bar .check input { margin-top: 0; }
.list-count { font-size: 13px; color: var(--muted); padding: 0 4px; }
.cards { display: grid; gap: 12px; }
.card { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.is-favorite { border-color: var(--accent); }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-company { margin-top: 2px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.card-link { font-size: 13px; font-weight: 550; align-self: flex-start; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
details > summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 11px 0; min-height: 44px; }
details[open] > summary { margin-bottom: 8px; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; color: var(--ink-2); max-width: 78ch; }
.vacancy-notes label { margin-bottom: 10px; }
.import-panel > summary { font-size: 15px; color: var(--accent); padding: 0; }
.import-panel[open] > summary { margin-bottom: 14px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.skeleton { height: 112px; border-radius: var(--radius); background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Application card: letter, delivery and manual stage never share a look. */
.status-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.status-strip .labelled { flex-direction: column; align-items: flex-start; gap: 6px; }
.status-strip .labelled-name { min-width: 0; }
.application-content { display: grid; gap: 14px; }
.block { padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.block > * { max-width: 100%; }
.block > label, .block > form, .block > .letter, .block > details { width: 100%; }
.block-letter { border-left: 3px solid var(--accent-bg); }
.block-delivery { border-left: 3px solid var(--info); background: var(--surface-2); }
.block-manual { border-left: 3px solid var(--manual); border-style: dashed; border-left-style: solid; }
.letter { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; }
.tracking { width: 100%; }
.reply-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-card { align-items: flex-start; }

/* History */
.timeline { display: grid; }
.event { display: grid; gap: 2px; padding: 12px 0 12px 20px; border-left: 2px solid var(--line); margin-left: 5px; position: relative; font-size: 14px; overflow-wrap: anywhere; }
.event::before { content: ""; position: absolute; left: -6px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.event small, .event-detail { color: var(--muted); font-size: 13px; }

/* Connections: one row per platform, three states side by side. */
.sources { display: grid; }
.access-item { padding: 14px 0; border-top: 1px solid var(--line); }
.access-item:first-child { border-top: 0; padding-top: 4px; }
.access-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px 14px; }
.access-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.access-who { display: grid; gap: 2px; min-width: 0; }
.access-login { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.access-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 12px 0 0 54px; }
.access-form label { flex: 1 1 240px; }
.invite-box { display: grid; gap: 12px; margin: 12px 0 0 54px; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.invite-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.operator-login { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.operator-login summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.operator-login form { margin-top: 10px; }
.source-row { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.source-row:first-child { border-top: 0; }
.source-cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.source-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.source-cell .labelled-name { min-width: 0; }
.search-run { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line); }
.search-run > div { flex: 1 1 280px; display: grid; gap: 4px; }
.search-result { display: grid; gap: 8px; }
.search-result-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }

/* States */
.state { padding: 24px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.state-error { background: var(--danger-soft); color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20; margin: 0; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 550; white-space: pre-wrap; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lift); }
.toast:empty { display: none; }
.toast-error { background: var(--danger); color: #fff; }
.toast-busy { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }

/* Screen head: what this screen shows right now, its main action and the secondary ones. */
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.screen-status { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.screen-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* The outcome of an action is shown where the action was taken. */
.inline-result { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; }
.inline-success { background: var(--success-soft); color: var(--success); }
.inline-error { background: var(--danger-soft); color: var(--danger); }
.inline-result button { min-height: 36px; padding: 6px 12px; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 30; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--accent-bg); color: var(--accent-ink); font-weight: 700; }
.skip-link:focus { top: 12px; }
main:focus, h1:focus { outline: none; }

/* Tablet: the sidebar narrows, grids relax. */
@media (max-width: 1100px) {
  :root { --sidebar: 212px; }
  main { padding: 24px 24px 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist { grid-template-columns: 1fr; }
  .source-row { grid-template-columns: 1fr; gap: 10px; }
}
/* Phone: navigation moves to a bottom bar, everything becomes one column. */
@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 23px; }
  .login { grid-template-columns: 1fr; }
  .login-intro { padding: 28px 22px; gap: 22px; }
  .login-pitch h1 { font-size: 28px; }
  .login-points { display: none; }
  .login-card { padding: 28px 22px 40px; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { padding: 0; margin-right: auto; }
  .brand-sub { display: none; }
  .candidate-label { order: 3; flex: 1 0 100%; padding: 0; }
  .sidebar-bottom { margin: 0; flex-direction: row; gap: 0; }
  .sidebar-bottom .mode { display: none; }
  .sidebar-bottom .ghost { min-height: 38px; padding: 6px 8px; font-size: 12px; }
  nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; flex-direction: row; gap: 0; overflow-x: auto; scrollbar-width: none; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); }
  nav button { flex: 1 0 auto; width: auto; min-width: 44px; flex-direction: column; gap: 3px; min-height: 52px; padding: 6px 1px; font-size: 10px; letter-spacing: -.01em; text-align: center; justify-content: center; }
  main { padding: 18px 16px 96px; }
  .page-header { margin-bottom: 16px; }
  .page-header .tag { display: none; }
  .panel, .card { padding: 16px; }
  .hero { padding: 18px; }
  .grid, .overview-grid, .off-list, .status-strip, .source-cells { grid-template-columns: 1fr; }
  .labelled-name { min-width: 0; }
  .pipeline-row { grid-template-columns: minmax(0, 120px) 1fr auto; }
  .actions button, .screen-actions button { flex: 1 1 auto; }
  .screen-actions { width: 100%; }
  .login-pitch h1 { font-size: 30px; }
  .save-bar { bottom: 76px; }
  .save-bar .muted { display: none; }
  .toast { bottom: 84px; }
  .task-row { align-items: flex-start; flex-direction: column; }
  .access-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .access-row .access-actions { grid-column: 1 / -1; }
  .access-form, .invite-box { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
