/* Brand Office. Design standard: the Review Console (tokens, chips, gate amber for a human
   decision, mono labels, condensed display type). Light first; dark follows the system
   unless the person picks a theme. Archivo and IBM Plex are self-hosted (SIL OFL, see
   assets/fonts/LICENSE.txt), so the portal loads nothing from other sites. */

@font-face { font-family: 'Archivo Variable'; src: url('fonts/archivo-var.woff2') format('woff2'); font-weight: 500 800; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url('fonts/ibm-plex-sans-var.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/ibm-plex-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/ibm-plex-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/ibm-plex-mono-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f4f5f1; --surface: #ffffff; --surface-2: #eceee8;
  --ink: #18202b; --ink-2: #364150; --muted: #5f6977;
  --rule: #d6dad0; --rule-strong: #b9beb3;
  --accent: #2443b5; --accent-ink: #ffffff; --accent-soft: #e6eaf8; --accent-line: #8d9fe0;
  --gate: #9a5f0c; --gate-line: #c88a1f; --gate-soft: #faf0dc;
  --ok: #2b7448; --ok-ink: #ffffff; --ok-soft: #e3f0e7; --ok-line: #7fb593;
  --bad: #b03a2e; --bad-ink: #ffffff; --bad-soft: #f9e6e3; --bad-line: #df9a91;
  --neutral-soft: #eceee8; --selected: #e9edfa; --hover: #f7f8f4;
  --overlay: rgb(16 20 26 / 0.42);
  --shadow-1: 0 1px 2px rgb(24 32 43 / 0.06), 0 1px 1px rgb(24 32 43 / 0.04);
  --shadow-2: 0 8px 24px rgb(24 32 43 / 0.12), 0 2px 6px rgb(24 32 43 / 0.08);
  --font-display: 'Archivo Variable', 'Archivo', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --font-ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', 'SF Mono', Consolas, monospace;
  --display-stretch: 78%;
  --radius-s: 4px; --radius: 6px; --radius-l: 10px;
  --header-h: 52px;
  --focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent);
  --toast-bg: #18202b; --toast-fg: #f4f5f1; --toast-ok: #8fd6a9; --toast-warn: #f0c27a; --toast-bad: #ffb4a8; --toast-info: #b9c5ff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #10141a; --surface: #161b22; --surface-2: #1d232c;
    --ink: #e7eae4; --ink-2: #c4cad2; --muted: #949eab;
    --rule: #2b333e; --rule-strong: #3c4553;
    --accent: #97a9ff; --accent-ink: #10141a; --accent-soft: #1d2647; --accent-line: #4e5fa8;
    --gate: #e8b25a; --gate-line: #c88a1f; --gate-soft: #2a2114;
    --ok: #74c493; --ok-ink: #0e1a13; --ok-soft: #13261b; --ok-line: #2f6b47;
    --bad: #f08e82; --bad-ink: #1c0f0d; --bad-soft: #321a18; --bad-line: #7c3a33;
    --neutral-soft: #1d232c; --selected: #1b2340; --hover: #1a2028;
    --overlay: rgb(0 0 0 / 0.6);
    --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-2: 0 10px 28px rgb(0 0 0 / 0.55), 0 2px 6px rgb(0 0 0 / 0.4);
    --toast-bg: #e7eae4; --toast-fg: #10141a; --toast-ok: #2b7448; --toast-warn: #9a5f0c; --toast-bad: #b03a2e; --toast-info: #2443b5;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #10141a; --surface: #161b22; --surface-2: #1d232c;
  --ink: #e7eae4; --ink-2: #c4cad2; --muted: #949eab;
  --rule: #2b333e; --rule-strong: #3c4553;
  --accent: #97a9ff; --accent-ink: #10141a; --accent-soft: #1d2647; --accent-line: #4e5fa8;
  --gate: #e8b25a; --gate-line: #c88a1f; --gate-soft: #2a2114;
  --ok: #74c493; --ok-ink: #0e1a13; --ok-soft: #13261b; --ok-line: #2f6b47;
  --bad: #f08e82; --bad-ink: #1c0f0d; --bad-soft: #321a18; --bad-line: #7c3a33;
  --neutral-soft: #1d232c; --selected: #1b2340; --hover: #1a2028;
  --overlay: rgb(0 0 0 / 0.6);
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-2: 0 10px 28px rgb(0 0 0 / 0.55), 0 2px 6px rgb(0 0 0 / 0.4);
  --toast-bg: #e7eae4; --toast-fg: #10141a; --toast-ok: #2b7448; --toast-warn: #9a5f0c; --toast-bad: #b03a2e; --toast-info: #2443b5;
}

/* ---- Reset and type --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-ui); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { margin: 0 0 10px; font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 640; line-height: 1.15; color: var(--ink); }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 15.5px; }
p { margin: 0 0 8px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-s); }
::selection { background: var(--accent-soft); }
.mono, code, kbd, samp { font-family: var(--font-mono); }
.num, time, .tabular { font-variant-numeric: tabular-nums; }
.label { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tone-gate { color: var(--gate); } .tone-bad { color: var(--bad); } .tone-ok { color: var(--ok); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -40px; z-index: 100; padding: 6px 10px; background: var(--ink); color: var(--paper); border-radius: var(--radius); }
.skip-link:focus { top: 8px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; height: 1.6em; padding: 0 0.35em; font-size: 11px; font-weight: 500; line-height: 1; color: var(--ink-2); background: var(--surface); border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: var(--radius-s); }
code { font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: var(--radius-s); }
details summary { cursor: pointer; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 16px 0; }

/* ---- Buttons ---------------------------------------------------------------- */
.btn { --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-line: var(--rule-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px;
  font-weight: 500; font-size: 14px; line-height: 1; white-space: nowrap; text-decoration: none;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-line); border-radius: var(--radius); cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.btn:hover { background: var(--hover); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled, .btn[aria-disabled='true'] { cursor: not-allowed; color: var(--muted); background: var(--surface-2); border-color: var(--rule); opacity: 0.85; }
.btn-primary, .btn.pri { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-line: var(--accent); }
.btn-primary:hover, .btn.pri:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-approve, .btn.gold { --btn-bg: var(--ok); --btn-fg: var(--ok-ink); --btn-line: var(--ok); }
.btn-approve:hover, .btn.gold:hover { background: color-mix(in srgb, var(--ok) 86%, var(--ink)); }
.btn-gate { --btn-fg: var(--gate); --btn-line: var(--gate-line); }
.btn-gate:hover { background: var(--gate-soft); }
.btn-bad, .btn.danger { --btn-fg: var(--bad); --btn-line: var(--bad-line); }
.btn-bad:hover, .btn.danger:hover { background: var(--bad-soft); }
.btn-ghost { --btn-bg: transparent; --btn-line: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; color: var(--ink-2); background: transparent; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.icon-btn.is-on { color: var(--accent); background: var(--accent-soft); }
.link-btn { padding: 0; font: inherit; color: var(--accent); background: none; border: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* ---- Inputs ----------------------------------------------------------------- */
label { display: block; margin: 12px 0 5px; font-weight: 500; font-size: 13px; color: var(--ink-2); }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=file], select, textarea, .input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 10px; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius); transition: border-color 120ms ease; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=file] { padding: 6px; }
textarea { min-height: 90px; line-height: 1.55; resize: vertical; }
textarea.body { min-height: 440px; font-size: 15px; line-height: 1.6; }
.field-help { font-size: 12.5px; color: var(--muted); }

/* ---- Chips, notices --------------------------------------------------------- */
.chip, .pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.02em; white-space: nowrap; text-decoration: none; vertical-align: middle;
  color: var(--ink-2); background: var(--neutral-soft); border: 1px solid var(--rule); border-radius: 999px; }
a.chip:hover, a.pill:hover { border-color: var(--rule-strong); text-decoration: none; }
.chip svg { flex: none; }
.chip-gate, .p-draft, .p-New, .p-Tailoring { color: var(--gate); background: var(--gate-soft); border-color: var(--gate-line); }
.chip-accent, .p-approved, .p-publishing, .p-Ready, .p-Shortlisted, .p-Submitted { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.chip-ok, .p-published, .p-Interview, .p-Offer { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.chip-bad, .p-failed, .p-action { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
.chip-muted, .p-cancelled, .p-Rejected, .p-Skipped, .p-Closed { color: var(--muted); background: transparent; border-color: var(--rule); }
.notice, .flash { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.notice > svg { flex: none; margin-top: 2px; }
.notice-gate, .flash.warn { background: var(--gate-soft); border-color: var(--gate-line); }
.notice-gate > svg { color: var(--gate); }
.notice-bad, .flash.err { background: var(--bad-soft); border-color: var(--bad-line); }
.notice-bad > svg { color: var(--bad); }
.notice-ok, .flash.ok { background: var(--ok-soft); border-color: var(--ok-line); }
.notice-ok > svg { color: var(--ok); }
.notice-accent { background: var(--accent-soft); border-color: var(--accent-line); }
.notice-accent > svg { color: var(--accent); }

/* ---- App frame -------------------------------------------------------------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; position: relative; overflow: hidden; }
.app-main { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.app-main:focus { outline: none; }
.page { flex: 1; width: 100%; max-width: 1440px; padding: 22px clamp(16px, 2.4vw, 32px) 32px; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 6px 20px; font-size: 12px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--rule); }

.app-header { flex: none; background: var(--surface); border-bottom: 1px solid var(--rule); }
.header-row { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); padding: 0 12px 0 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { flex: none; }
.brand-name { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 700; font-size: 19px; letter-spacing: 0.005em; }
.brand-sub { padding-left: 9px; border-left: 1px solid var(--rule); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.main-nav { display: flex; align-self: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; font-weight: 500; white-space: nowrap; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; border-top: 2px solid transparent; }
.main-nav a svg { color: var(--muted); }
.main-nav a:hover { color: var(--ink); background: var(--hover); }
.main-nav a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--accent); }
.main-nav a[aria-current='page'] svg { color: var(--accent); }
.main-nav a:focus-visible { outline-offset: -2px; }
.nav-count { padding: 0 6px; font-family: var(--font-mono); font-size: 11px; line-height: 18px; color: var(--gate); background: var(--gate-soft); border: 1px solid var(--gate-line); border-radius: 999px; }
.header-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.who { display: grid; margin-right: 6px; line-height: 1.2; text-align: right; }
.who-name { font-weight: 600; font-size: 13px; }
.who-role { font-size: 11.5px; color: var(--muted); }

.stats { display: flex; flex-wrap: wrap; margin: 0; padding: 0 20px; background: var(--paper); border-top: 1px solid var(--rule); }
.stats .stat { display: flex; align-items: baseline; gap: 10px; margin: 6px 20px 6px 0; padding-right: 20px; border-right: 1px solid var(--rule); }
.stats .stat:last-child { border-right: 0; }
.stats dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 650; font-size: 21px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats dd.stat-text { font-family: var(--font-ui); font-size: 13px; align-self: center; }

.ks-banner { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; background: var(--bad-soft); border-bottom: 2px solid var(--bad); }
.ks-banner > svg { flex: none; margin-top: 1px; color: var(--bad); }
.ks-text { display: grid; gap: 2px; }
.ks-meta { font-size: 13px; color: var(--ink-2); }

.version-watermark { position: fixed; right: 10px; bottom: 8px; z-index: 50; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 4px; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; pointer-events: none; }

/* ---- Page structure --------------------------------------------------------- */
.top, .screen-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 18px; }
.top h1, .screen-head h1 { margin: 0; }
.top p, .screen-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 80ch; }
.card { padding: 18px 20px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-l); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.card-head h2 svg { color: var(--muted); }
.card.is-gate { border-color: var(--gate-line); box-shadow: inset 3px 0 0 var(--gate-line); }
.card.is-bad { border-color: var(--bad-line); box-shadow: inset 3px 0 0 var(--bad); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; }
.grid + .split, .grid + .card, .grid + .grid { margin-top: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row > form { margin: 0; }
.card.stat { display: grid; gap: 2px; padding: 14px 16px; }
.card.stat .v { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: 30px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card.stat .l { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.empty { display: grid; justify-items: start; gap: 6px; padding: 14px 0; color: var(--muted); }

/* ---- Tables ----------------------------------------------------------------- */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
th { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; color: var(--muted); background: var(--surface-2); }
tr:last-child > td { border-bottom: 0; }
tbody tr:hover > td, table tr:hover > td { background: var(--hover); }
.card.scroll { padding: 0; }
.card.scroll > table th:first-child, .card.scroll > table td:first-child { padding-left: 16px; }
.card.scroll > table th:last-child, .card.scroll > table td:last-child { padding-right: 16px; }
.card.scroll > table tr:first-child th:first-child { border-top-left-radius: var(--radius-l); }
.card.scroll > table tr:first-child th:last-child { border-top-right-radius: var(--radius-l); }

/* ---- Toasts and dialog ------------------------------------------------------ */
.toasts { position: fixed; bottom: 16px; left: 16px; z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 8px 10px 12px; color: var(--toast-fg); background: var(--toast-bg); border-radius: var(--radius-l); box-shadow: var(--shadow-2); pointer-events: auto; animation: toast-in 160ms ease-out; }
.toast > svg { margin-top: 2px; }
.toast-success > svg { color: var(--toast-ok); } .toast-info > svg { color: var(--toast-info); } .toast-warn > svg { color: var(--toast-warn); }
.toast-error { box-shadow: inset 4px 0 0 var(--toast-bad), var(--shadow-2); }
.toast-error > svg { color: var(--toast-bad); }
.toast-text { font-size: 13.5px; }
.toast-close { width: 26px; height: 26px; color: inherit; opacity: 0.75; }
.toast-close:hover { color: inherit; background: rgb(127 127 127 / 0.2); opacity: 1; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 160ms, transform 160ms; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dialog { width: min(560px, calc(100vw - 32px)); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-2); }
.dialog::backdrop { background: var(--overlay); }
.dialog-body { display: grid; gap: 16px; padding: 20px 22px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; }
.shortcut-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shortcut-list { display: grid; gap: 7px; margin: 8px 0 0; }
.shortcut-list > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 10px; }
.shortcut-list dt { display: flex; gap: 4px; }
.shortcut-list dd { margin: 0; color: var(--ink-2); }
.dialog-foot { font-size: 12.5px; margin: 0; }

/* ---- Sign-in ---------------------------------------------------------------- */
.auth { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }
.auth-card { display: grid; gap: 14px; width: 100%; max-width: 440px; padding: 28px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-1); }
.auth-card h1 { margin: 0; font-size: 30px; }
.auth-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-lead { color: var(--ink-2); margin: 0; }
.auth-form { display: grid; gap: 4px; }
.auth-form label { margin-top: 8px; }
.auth-submit { width: 100%; min-height: 42px; margin-top: 14px; }
.auth-foot { max-width: 440px; font-size: 12.5px; text-align: center; color: var(--muted); margin: 0; }
.code-input { min-height: 54px !important; font-family: var(--font-mono); font-size: 26px !important; letter-spacing: 0.35em; text-align: center; }

/* ---- Editorial checks and LinkedIn preview ---------------------------------- */
.checks { padding: 0; margin: 0; }
.checks li { list-style: none; padding: 5px 0 5px 24px; position: relative; font-size: 13.5px; border-bottom: 1px dashed var(--rule); }
.checks li:last-child { border-bottom: 0; }
.checks li::before { position: absolute; left: 0; top: 5px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-size: 11px; font-weight: 700; }
.checks .ok::before { content: "✓"; color: var(--ok); background: var(--ok-soft); }
.checks .warn::before { content: "!"; color: var(--gate); background: var(--gate-soft); }
.checks .fail::before { content: "✕"; color: var(--bad); background: var(--bad-soft); }
.li-preview { border: 1px solid var(--rule); border-radius: var(--radius-l); background: var(--surface); font-family: -apple-system, 'Segoe UI', system-ui, sans-serif; font-size: 14px; overflow: hidden; box-shadow: var(--shadow-1); }
.li-preview .hd { display: flex; gap: 10px; padding: 12px 14px 6px; }
.li-preview .av { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 700; flex: none; }
.li-preview .tx { padding: 4px 14px 10px; white-space: pre-wrap; }
.li-preview .more { color: var(--muted); }
.li-preview img { display: block; width: 100%; border-top: 1px solid var(--rule); }

/* ---- Calendar ---------------------------------------------------------------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dh { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal .d { min-height: 120px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px; font-size: 12px; }
.cal .d:hover { border-color: var(--rule-strong); }
.cal .d.out { background: transparent; opacity: 0.55; }
.cal .d.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal .d.today .n { color: var(--accent-ink); background: var(--accent); }
.cal .n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px; font-family: var(--font-mono); font-weight: 600; color: var(--ink-2); text-decoration: none; }
.cal .n:hover { background: var(--surface-2); }
.cal .ev { display: block; margin-top: 4px; padding: 4px 6px; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); background: var(--paper); border-left: 3px solid var(--rule-strong); line-height: 1.3; }
.cal .ev:hover { background: var(--hover); }
.cal .ev.draft { border-color: var(--gate-line); background: var(--gate-soft); }
.cal .ev.approved { border-color: var(--accent); background: var(--accent-soft); }
.cal .ev.published { border-color: var(--ok); background: var(--ok-soft); }
.cal .ev.action, .cal .ev.failed { border-color: var(--bad); background: var(--bad-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 16px; padding: 0; font-size: 12.5px; color: var(--ink-2); list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; border-left: 3px solid; }

/* ---- Jobs -------------------------------------------------------------------- */
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.kan { display: grid; grid-template-columns: repeat(6, minmax(230px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.kan .col { background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius-l); padding: 8px; min-height: 140px; }
.kan .col h3 { font-family: var(--font-mono); font-stretch: normal; font-weight: 500; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; margin: 2px 4px 8px; }
.jc { display: block; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 9px 10px; margin-bottom: 8px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-1); transition: border-color 120ms; }
.jc:hover { border-color: var(--accent-line); }
.jc b { display: block; font-size: 13.5px; line-height: 1.3; margin: 4px 0 2px; }
.jc .m { font-size: 12px; color: var(--muted); }
.score { display: inline-grid; place-items: center; min-width: 36px; height: 22px; padding: 0 6px; border-radius: var(--radius-s); font-family: var(--font-mono); font-weight: 600; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--rule); vertical-align: middle; }
.s5, .s4 { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.s3 { background: var(--gate-soft); color: var(--gate); border-color: var(--gate-line); }
.spark { width: 100%; height: 160px; }

/* ---- Narrower screens -------------------------------------------------------- */
@media (max-width: 1280px) { .brand-sub, .who { display: none; } }
@media (max-width: 1100px) { .split, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .header-row { flex-wrap: wrap; gap: 8px; padding: 6px 12px; }
  .main-nav { order: 3; flex-basis: 100%; min-height: 40px; }
  .stats { padding: 0 12px; }
  .stats .stat { margin-right: 12px; padding-right: 12px; }
  .stats dd { font-size: 17px; }
  .g2, .shortcut-groups { grid-template-columns: minmax(0, 1fr); }
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal .dh, .cal .d.out { display: none; }
  .cal .d { min-height: 0; }
  .header-tools .btn-ghost { padding: 0 8px; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: minmax(0, 1fr); } .page { padding: 16px; } .header-tools .btn-ghost span { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
@media print { .app-header, .app-footer, .version-watermark, .toasts { display: none !important; } .app, .app-main { height: auto; overflow: visible; } }
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
svg { flex: none; }
.main-nav a, .header-tools > * { flex: none; }
@media (max-width: 1180px) { .main-nav a svg { display: none; } .main-nav a { padding: 0 8px; } }

/* ---- v1.0: palette, scheduler, phone navigation, offline ---------------------- */
.palette-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; color: var(--muted); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); font: inherit; font-size: 13px; cursor: pointer; }
.palette-btn:hover { color: var(--ink); border-color: var(--rule-strong); }
.palette-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.palette-btn kbd { font-size: 11px; padding: 1px 5px; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); }
.palette { width: min(640px, calc(100vw - 24px)); margin-top: 12vh; }
.palette-box { display: grid; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); color: var(--muted); }
.palette-input input { border: 0 !important; box-shadow: none !important; background: transparent; font-size: 16px; padding: 4px 0; min-height: 0; }
.palette-input kbd { font-size: 11px; padding: 1px 5px; border: 1px solid var(--rule); border-radius: 4px; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 60vh); overflow-y: auto; }
.palette-group { padding: 10px 10px 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.palette-item { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; min-height: 36px; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; }
.palette-item[aria-selected=true] { background: var(--selected); box-shadow: inset 3px 0 0 var(--accent); }
.pi-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-m { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.palette-empty { padding: 14px 10px; color: var(--muted); }
.palette-foot { margin: 0; padding: 8px 16px 12px; font-size: 12px; border-top: 1px solid var(--rule); }
.chip-link { text-decoration: none; }
.chip-ok, .chip-accent { text-decoration: none; }
.offline-banner { display: flex; align-items: center; gap: 8px; padding: 8px 20px; color: var(--gate); background: var(--gate-soft); border-bottom: 1px solid var(--gate-line); font-size: 13px; }
.offline-banner[hidden] { display: none; }
[data-offline] { opacity: .55; }
.bottom-nav { display: none; }
@media (max-width: 720px) {
  .main-nav, .palette-btn span, .palette-btn kbd, .stats .stat:nth-child(n+4) { display: none; }
  .palette-btn { width: 34px; padding: 0; justify-content: center; }
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--rule); box-shadow: 0 -4px 14px rgb(0 0 0 / .06); }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 2px; min-height: 48px; padding: 6px 0; color: var(--muted); background: none; border: 0; font: inherit; font-size: 11px; text-decoration: none; cursor: pointer; border-radius: var(--radius); }
  .bottom-nav [aria-current=page] { color: var(--accent); }
  .app-main { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .toasts { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .version-watermark { display: none; }
  .btn, .icon-btn { min-height: 40px; }
  .btn-small { min-height: 36px; }
}

/* ---- v1.0: sign-in, security, backups ------------------------------------------ */
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.key-row { padding: 6px 0; border-bottom: 1px dashed var(--rule); }
.row.between { justify-content: space-between; }
.nowrap { white-space: nowrap; flex-wrap: nowrap; }
pre.recovery { margin: 8px 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); font-size: 15px; line-height: 1.7; columns: 2; }
.card h3 { font-size: 16px; margin: 0 0 6px; }

/* ---- v1.0: editor ------------------------------------------------------------- */
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.seg-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 10px; color: var(--muted); background: var(--surface); border: 0; font: inherit; font-size: 12.5px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--rule); }
.seg-btn[aria-pressed=true] { color: var(--accent); background: var(--accent-soft); }
.seg-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.li-preview.is-phone { max-width: 360px; margin: 0 auto; font-size: 14.5px; }
.marked-wrap { margin-top: 10px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
.marked { font-size: 13.5px; line-height: 1.6; max-height: 220px; overflow-y: auto; }
mark.mk-fail { color: inherit; background: var(--bad-soft); box-shadow: inset 0 -2px 0 var(--bad); border-radius: 2px; }
mark.mk-warn { color: inherit; background: var(--gate-soft); box-shadow: inset 0 -2px 0 var(--gate-line); border-radius: 2px; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.versions li:last-child { border-bottom: 0; }
.diff { font-size: 15px; line-height: 1.7; white-space: normal; }
.diff ins { text-decoration: none; background: var(--ok-soft); box-shadow: inset 0 -2px 0 var(--ok-line); }
.diff del { color: var(--bad); background: var(--bad-soft); }
.pre { white-space: pre-wrap; }

/* ---- v1.0: calendar and boards ------------------------------------------------ */
.cal-aside { display: grid; gap: 8px; margin-bottom: 12px; }
.notice-info { background: var(--accent-soft); border-color: var(--accent-line); }
.cal .d.slot { background: linear-gradient(var(--surface), var(--surface)) padding-box, repeating-linear-gradient(135deg, var(--accent-line) 0 2px, transparent 2px 7px) border-box; border: 1px dashed var(--accent-line); }
.cal .d.past .n { opacity: .6; }
.cal .ev[draggable=true] { cursor: grab; }
.is-dragging { opacity: .45; }
.cal .d.is-over, .kan .col.is-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.legend i.slot-key { border: 1px dashed var(--accent-line); border-left-width: 1px; background: var(--surface); }
.jc[draggable=true] { cursor: grab; }
.saved-row { margin: -4px 0 12px; }
.saved-chip { display: inline-flex; align-items: center; gap: 2px; padding-left: 8px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); font-size: 12.5px; }
.saved-chip a { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); text-decoration: none; }
.saved-chip form { margin: 0; }
.saved-chip .icon-btn { width: 26px; height: 26px; }

/* ---- v1.0: analytics ---------------------------------------------------------- */
.tone-accent { color: var(--accent); }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) auto 3.4em; gap: 10px; align-items: center; font-size: 13.5px; }
.hb-t { height: 12px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.hb-v { font-variant-numeric: tabular-nums; }
.hb-r { text-align: right; }
table.heat td { text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--accent) var(--h, 0%), transparent); color: var(--ink); }
table.heat td[style] { color: var(--ink); }
table.heat th[scope=row] { text-align: left; }

/* ---- v1.0: accessibility floor (WCAG 2.2 target size, focus not obscured) ----- */
a, button, input, select, textarea, summary { scroll-margin-top: 120px; scroll-margin-bottom: 90px; }
.btn, .icon-btn, .seg-btn, .palette-btn, .chip-link { min-height: 24px; min-width: 24px; }
summary { cursor: pointer; min-height: 24px; }
@media (forced-colors: active) { .chip, .pill, .btn, .nav-count { border: 1px solid CanvasText; } mark { forced-color-adjust: none; } }

/* ---- v1.0: header fit. Below 1180px the section links take their own row, so nothing is cut off. */
@media (max-width: 1280px) { .palette-btn span { display: none; } }
@media (max-width: 1180px) and (min-width: 721px) {
  .header-row { flex-wrap: wrap; row-gap: 0; }
  .main-nav { order: 3; flex-basis: 100%; min-height: 40px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--rule); }
  .header-tools { margin-left: auto; }
}
