/* ============================================================================
   Arc design system. One file: tokens, layout, components, states.
   Purpose: make responsibility and review legible. Calm neutrals, one accent,
   status colours that mean the same thing everywhere, generous tap targets,
   nothing decorative that does not carry information.
   ========================================================================= */

/* Colours come from the shared theme set in css/themes.css (generated
   outside this repo and copied in unchanged). Arc names each role once here,
   so every theme the picker offers re-skins every screen. Each text role holds
   4.5:1 or more on every ground in every theme; the generator refuses less. */
:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --bg: var(--theme-canvas);
  --surface: var(--theme-surface);
  --surface-2: var(--theme-surface-2);
  --surface-3: var(--theme-surface-3);
  --border: var(--theme-line);
  --border-strong: var(--theme-line-strong);
  --field-border: var(--theme-field-line);
  --text: var(--theme-text);
  --text-2: var(--theme-text-2);
  --text-3: var(--theme-text-3);
  --accent: var(--theme-accent);
  --accent-hover: var(--theme-accent-hover);
  --accent-strong: var(--theme-accent-ink);   /* accent coloured text */
  --accent-soft: var(--theme-accent-soft);
  --on-accent: var(--theme-on-accent);
  --focus: var(--theme-focus);
  --overlay: var(--theme-overlay);

  --ok: var(--theme-success);     --ok-soft: var(--theme-success-soft);
  --warn: var(--theme-warning);   --warn-soft: var(--theme-warning-soft);
  --bad: var(--theme-danger);     --bad-soft: var(--theme-danger-soft);
  --info: var(--theme-info);      --info-soft: var(--theme-info-soft);
  --wait: var(--theme-pending);   --wait-soft: var(--theme-pending-soft);
  --muted: var(--theme-neutral);  --muted-soft: var(--theme-neutral-soft);
  --on-status: var(--theme-on-status);

  --radius: 10px;
  --radius-sm: 7px;
  --shadow-1: var(--theme-shadow-1);
  --shadow-2: var(--theme-shadow-2);
  --sidebar: 236px;
  --tap: 40px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 8px; }
small, .small { font-size: 13px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
/* hidden always hides, whatever display a class sets. */
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ------------------------------------------------------------------ layout */

.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 750; font-size: 15px; flex: none;
}
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand-org { font-size: 12px; color: var(--text-3); line-height: 1.2; }
.org-switch { margin: 0 4px 10px; }
.nav-group { margin: 10px 0 2px; padding: 0 10px; font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.nav a {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px; margin: 1px 0;
  border-radius: 8px; color: var(--text-2); font-weight: 520; font-size: 14px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 620; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--bad); color: var(--on-status); font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.sidebar-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); }
.btn.install { width: 100%; margin-bottom: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.me .who { min-width: 0; }
.me .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a .ext { margin-left: auto; display: inline-flex; color: var(--text-3); }
.nav a .ext svg { width: 14px; height: 14px; }

/* The theme picker: one swatch per theme, the current one ringed. Swatch
   colours come from css/themes.css (.theme-swatch[data-for]). */
.theme-picker { padding: 6px 8px 10px; }
.theme-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.theme-head .label { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.theme-head .name { font-size: 13px; font-weight: 600; color: var(--text-2); }
.theme-swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; justify-items: center; }
.theme-swatch {
  width: 100%; max-width: 34px; aspect-ratio: 1; min-height: 28px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--swatch-line);
  background: linear-gradient(135deg, var(--swatch-ground) 0 50%, var(--swatch-accent) 50% 100%);
}
.theme-swatch[data-for="auto"] { background: linear-gradient(135deg, var(--swatch-ground) 0 50%, var(--swatch-surface) 50% 100%); }
.theme-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.theme-swatch:focus-visible { outline-offset: 5px; border-radius: 50%; }
.sheet-panel .theme-swatch { max-width: var(--tap); }
@media (pointer: coarse) { .theme-swatch { max-width: var(--tap); } }

.main { min-width: 0; padding: 22px 28px 64px; max-width: 1240px; width: 100%; }
/* The view takes focus on each navigation so screen readers announce it; it is
   a landmark, not a control, so it shows no ring. */
.main:focus, .main:focus-visible { outline: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; }
.page-head .sub { margin-top: 4px; color: var(--text-2); font-size: 14px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 6px; }
.crumbs a { color: var(--text-2); }

.topbar { display: none; }
.tabbar { display: none; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ------------------------------------------------------------------ cards */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: 15px; }
.card-body { padding: 14px 16px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.stat { padding: 14px 16px; }
.stat .label { font-size: 12px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 13px; color: var(--text-2); }

/* ------------------------------------------------------------------ lists */

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); min-height: 56px; }
.list > li:last-child { border-bottom: 0; }
.list-empty { margin: 0; padding: 14px 16px; }
.list > li.clickable { cursor: pointer; }
.list > li.clickable:hover { background: var(--surface-2); }
.list .main-col { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list .meta { font-size: 13px; color: var(--text-2); margin-top: 2px; display: flex; gap: 10px; flex-wrap: wrap; }
.list .side { display: flex; align-items: center; gap: 8px; flex: none; }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ badges */

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 620; white-space: nowrap; background: var(--muted-soft); color: var(--muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.wait { background: var(--wait-soft); color: var(--wait); }
.badge.accent { background: var(--accent-soft); color: var(--accent-strong); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--text-2); }

.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
/* High contrast holds text to 7:1: a dark veil under the initials takes every
   avatar colour from 5.0:1 to 8.4:1 or more against the white letters. */
:root[data-theme="contrast"] .avatar { box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .3); }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person .name { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.progress.thin { height: 5px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--tap); padding: 0 15px;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.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); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.btn.ok:hover { background: var(--ok-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13px; }
.btn.icon { width: var(--tap); padding: 0; }
.btn svg { width: 17px; height: 17px; }
.btn .spin { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ forms */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 620; color: var(--text); }
.field .req { color: var(--bad); margin-left: 2px; }
.field .help { font-size: 12.5px; color: var(--text-3); }
.field .error { font-size: 12.5px; color: var(--bad); font-weight: 560; }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 8px 11px; border-radius: 8px; border: 1px solid var(--field-border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px;
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid color-mix(in srgb, var(--focus) 35%, transparent); border-color: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--bad); }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: var(--tap); padding: 6px 0; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.segmented button { min-height: 36px; padding: 0 13px; border: 0; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; border-right: 1px solid var(--border); }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-strong); }

/* ------------------------------------------------------------------ tabs */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { min-height: 42px; padding: 0 14px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs [aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.tabs .count { font-size: 11.5px; padding: 0 6px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); line-height: 18px; }

/* ------------------------------------------------------------------ states */

.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.empty .icon svg { width: 22px; height: 22px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.empty p { max-width: 420px; margin: 0 auto 12px; font-size: 14px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 9px; font-size: 14px; border: 1px solid; margin-bottom: 14px; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--text); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--text); }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--text); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--text); }
.notice .grow { flex: 1; min-width: 0; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line { height: 12px; margin: 10px 0; }
.sk-block { height: 64px; margin: 10px 0; }

/* ------------------------------------------------------------------ dialog */

dialog.modal { border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
/* Older browsers give ::backdrop no inherited variables: the fallback covers them. */
dialog.modal::backdrop { background: var(--overlay, rgba(10, 14, 20, .45)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 11px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: flex-start; animation: rise .18s ease-out; }
.toast.bad { background: var(--bad); color: var(--on-status); }
.toast.ok { background: var(--ok); color: var(--on-status); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.menu { position: relative; display: inline-block; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; z-index: 50; }
.menu-pop button, .menu-pop a { display: flex; width: 100%; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border: 0; background: none; color: var(--text); font: inherit; font-size: 14px; border-radius: 7px; cursor: pointer; text-align: left; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-2); text-decoration: none; }

/* ------------------------------------------------------------------ kanban */

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.column { background: var(--surface-2); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-size: 13px; font-weight: 650; color: var(--text-2); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow-1); }
.tile:hover { border-color: var(--border-strong); }
.tile .t { font-weight: 600; font-size: 14px; }
.tile .m { font-size: 12.5px; color: var(--text-2); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ timeline */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12.5px; color: var(--text-3); }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--text-3); font-weight: 560; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.prose { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.prose p { margin: 0 0 10px; }
.letter { background: #fff; color: #17202b; border: 1px solid var(--border); border-radius: 8px; padding: 28px 32px; font-size: 15px; line-height: 1.65; }

/* ------------------------------------------------------------------ portal (public pages) */

.public { max-width: 720px; margin: 0 auto; padding: 28px 18px 60px; }
.public .brand { padding: 0 0 18px; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-2); background: var(--surface); cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }

/* Recruitment studio and the public application journey. */
.hiring-studio { gap: 24px; }
.studio-intro, .opening-head, .opening-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.studio-intro { padding: 12px 0; }
.studio-intro h2 { font-size: clamp(23px, 3vw, 32px); max-width: 640px; letter-spacing: -.035em; }
.studio-intro p { max-width: 640px; margin-top: 10px; }
.eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .13em; color: var(--accent-strong); margin-bottom: 10px; }
.studio-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-row input { flex: 1 1 260px; min-width: 0; }
.opening-canvas { border: 1px solid var(--border); border-radius: 18px; background: var(--surface-2); overflow: hidden; }
.opening-head { padding: 22px 24px; }
.opening-head h2 { font-size: 22px; }
.flow-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; padding: 0 24px 24px; }
.flow-node { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }
.flow-node:not(:last-child)::after { content: ''; position: absolute; width: 17px; height: 2px; background: var(--border-strong); right: -18px; top: 46px; }
.flow-node p { flex: 1; margin: 0; overflow-wrap: anywhere; }
.flow-node-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; width: 100%; }
.flow-number { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.opening-foot { padding: 18px 24px; border-top: 1px solid var(--border); background: var(--surface); }
.application-brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 750; margin-bottom: 44px; }
.application-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 12px; }
.application-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; font-weight: 600; }
.application-steps li { display: flex; gap: 8px; align-items: center; }
.application-steps span { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent-strong); }
.role-description { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin: 22px 0 30px; }
.role-description h3 { margin: 8px 0 12px; font-size: 18px; }
.role-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.role-tags span { font-size: 12px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.assignment-preview { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; }
.assignment-preview summary { cursor: pointer; font-weight: 650; min-height: 40px; }
.intake-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Public applicant welcome. These tokens stay inside the application journey;
   the staff theme and HR-authored role, assignment and privacy content stay intact. */
.application-page, .applicant-portal {
  --bg: #fffaf5; --surface: #ffffff; --surface-2: #faf6ff; --surface-3: #f3ecfb;
  --text: #302748; --text-2: #5e5570; --text-3: #70667d;
  --border: #e6dfed; --border-strong: #9b89ad; --field-border: #9b89ad;
  --accent: #6745b3; --accent-hover: #55349e; --accent-strong: #5d399f; --accent-soft: #efe7fb; --on-accent: #fff;
  --focus: #6842ad; --ok: #26734c; --ok-soft: #e8f6eb; --info: #32618c; --info-soft: #eaf4fc;
  --warn: #805a17; --warn-soft: #fff6dc; --bad: #ab3753; --bad-soft: #fff0f3;
  color: var(--text); color-scheme: light; overflow-wrap: anywhere;
}
body:has(main.public > .application-page), body:has(main.public > .applicant-portal) {
  background: radial-gradient(ellipse at 3% 10%,#f5edff 0,transparent 35%), radial-gradient(ellipse at 95% 60%,#fff1dd 0,transparent 36%), #fffaf5;
}
.public:has(> .applicant-portal) { max-width: 860px; padding: 32px 24px 60px; }
.application-brand { position: relative; z-index: 2; margin-bottom: 40px; color: var(--text); }
.application-logo { background: #fff; padding: 5px; box-shadow: 0 3px 12px #5d399f0a; }
.application-steps { position: relative; z-index: 2; gap: 12px; font-size: 12px; color: var(--text-2); }
.application-steps li { padding: 7px 11px 7px 7px; border-radius: 24px; background: var(--step-bg, #ffffff80); border: 1px solid var(--step-line, #ffffffc4); }
.application-steps li[aria-current=step] { background: var(--step-now-bg, #fff); border-color: var(--step-now-line, #d3bfe9); color: var(--step-now-text, #593595); box-shadow: 0 3px 10px #6745b309; }
.application-steps span { width: 27px; height: 27px; border: 0; background: var(--step-num-bg, #ece2fb); color: var(--step-num, #6745b3); }
.application-steps li.complete span { background: var(--done-bg, #dff1e4); color: var(--done-text, #26734c); }
.application-page .input, .application-page .select, .application-page .textarea, .applicant-portal .input, .applicant-portal .textarea, .applicant-portal .select { min-height: 46px; border-radius: 10px; background: var(--field-bg, #fff); }
.application-page .btn, .applicant-portal .btn { min-height: 44px; border-radius: 10px; }
.application-page .btn.sm, .applicant-portal .btn.sm { min-height: 44px; }
.application-page .btn.primary, .applicant-portal .btn.primary { box-shadow: 0 4px 12px #6745b31a; }
.application-section-kicker { font-size: 10px; letter-spacing: .13em; font-weight: 750; color: var(--kicker, #79578f); margin-bottom: 8px; }
.application-page .check, .applicant-portal .check { min-height: 44px; align-items: flex-start; padding: 6px 0; }
.application-page .check input, .applicant-portal .check input { flex: none; margin-top: 3px; }
.applicant-portal { color: var(--text); }
.applicant-portal > .brand { color: var(--text); }
.applicant-portal .brand-mark { background: var(--accent); }
.applicant-portal .brand-org { color: var(--text-3); }
.application-assignment-hero { padding: 26px; background: var(--hero-bg, linear-gradient(115deg,#f0e8ff,#fff5e3)); border: 1px solid var(--hero-line, #e5d9f0); border-radius: 20px; }
.application-assignment-hero h1 { font-size: 30px; }
.application-assignment-hero .application-steps { margin-top: 22px; }
.applicant-portal .card { border-color: var(--card-line, #e6dfed); border-radius: 16px; box-shadow: 0 5px 22px #60399004; }
.applicant-portal .card-head { background: var(--surface); }
.applicant-portal .dropzone { background: var(--drop-bg, #faf7ff); border: 2px dashed var(--drop-line, #9b7cb6); border-radius: 14px; padding: 24px 18px; transition: border-color .2s, background .2s; }
.applicant-portal .dropzone:hover, .applicant-portal .dropzone.over { background: var(--drop-hover, #f1e8fc); border-color: var(--drop-hover-line, #8c63ba); }
.applicant-portal .dropzone:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.application-upload-readiness { padding: 15px; border: 1px solid var(--readiness-line, #e4d9ed); border-radius: 12px; background: var(--readiness-bg, #faf6ff); margin-bottom: 22px; }
.application-upload-milestones { display: flex; flex-wrap: wrap; gap: 8px; }
.application-upload-milestones > span { display: flex; gap: 6px; align-items: center; font-size: 12px; padding: 6px 9px; border: 1px solid var(--pill-line, #e1d8e8); border-radius: 20px; color: var(--pill-text, #766882); background: var(--pill-bg, #fff); }
.application-upload-milestones i { width: 12px; height: 12px; border: 1px solid var(--pill-mark, #b0a0bd); border-radius: 50%; }
.application-upload-milestones > .complete { background: var(--done-bg, #e9f7ed); color: var(--done-text, #26734c); border-color: var(--done-line, #c7e5d1); }
.application-upload-encouragement { font-size: 12px; color: var(--encourage, #6a4b8e); line-height: 1.6; margin: 11px 0 0; }
.application-upload-row.complete { border-color: var(--done-line, #b7d9c4) !important; background: var(--done-row, #f6fcf7) !important; animation: application-reveal .3s ease-out; }
.application-upload-row .small > span svg { vertical-align: -2px; }
.application-receipt { display: flex; gap: 16px; align-items: flex-start; padding: 24px; background: var(--receipt-bg, linear-gradient(110deg,#e9f8ed,#f9fff7)); border: 1px solid var(--receipt-line, #bcdcc6); border-radius: 18px; color: var(--receipt-text, #2a6143); animation: application-reveal .5s ease-out; }
.application-receipt-mark { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--receipt-mark, #d0ebd9); box-shadow: 0 0 0 6px var(--receipt-ring, #ffffff80); animation: application-bloom .6s ease-out; }
.application-receipt h2 { font-size: 22px; margin-bottom: 8px; color: var(--receipt-head, #24563b); }
.application-receipt p { line-height: 1.65; }
@keyframes application-bloom { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
@keyframes application-reveal { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .public:has(> .application-page), .public:has(> .applicant-portal) { padding: 18px 16px 40px; }
  .application-brand { font-size: 14px; margin-bottom: 30px; gap: 10px; }
  .application-logo, .application-monogram { width: 46px; min-width: 46px; height: 46px; min-height: 46px; }
  .application-steps { gap: 7px; font-size: 11px; }
  .application-steps li { padding: 5px 7px 5px 5px; gap: 5px; }
  .application-steps span { width: 22px; height: 22px; }
  .application-assignment-hero { padding: 22px; }
  .application-assignment-hero .application-steps { margin-top: 18px; }
  .application-receipt { padding: 20px; gap: 12px; }
  .application-receipt-mark { width: 36px; height: 36px; }
  .application-receipt h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .application-page *, .application-page *::before, .application-page *::after, .applicant-portal *, .applicant-portal *::before, .applicant-portal *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 1100px) { .flow-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .flow-node:nth-child(2)::after { display: none; } }
@media (max-width: 600px) {
  .flow-grid { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .flow-node::after { display: none; }
  .opening-head, .opening-foot { padding: 18px 16px; }
  .application-brand { margin-bottom: 30px; }
  .application-steps { gap: 12px; }
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1080px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40; height: 54px; padding: 0 12px;
    background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .topbar .brand { padding: 0; }
  .topbar .grow { flex: 1; min-width: 0; }
  .main { padding: 16px 16px 92px; }
  .page-head { margin-bottom: 14px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .grid-2, .grid-3, .grid-4, .form-row { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; color: var(--text-3); font-size: 11px; font-weight: 600; border: 0; background: none; font-family: inherit; cursor: pointer; position: relative; }
  .tabbar a[aria-current="page"] { color: var(--accent-strong); }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar .dot { position: absolute; top: 9px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
  .list > li { padding: 12px 14px; align-items: flex-start; }
  .list .side { flex-direction: column; align-items: flex-end; }
  .table.stack-mobile thead { display: none; }
  .table.stack-mobile tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table.stack-mobile td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; }
  .table.stack-mobile td::before { content: attr(data-label); color: var(--text-3); font-size: 12.5px; font-weight: 600; }
  .table.stack-mobile td.num { text-align: right; }
  /* A stacked row's first cell is its title: no label, full width. */
  .table.stack-mobile td:first-child:not(.num) { justify-content: flex-start; font-weight: 600; padding-block: 6px; }
  .table.stack-mobile td:first-child:not(.num)::before { display: none; }
  .board { display: flex; }
  .board > .column { flex: 0 0 84%; }
  .board > .column.empty { flex-basis: 136px; }
  dialog.modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .letter { padding: 18px; }
  .toasts { left: 16px; right: 16px; bottom: 76px; max-width: none; }
  .hide-mobile { display: none !important; }
  /* Small controls stay compact on a desk, but a finger needs the full tap target. */
  .btn.sm, .segmented button { min-height: var(--tap); }
  .segmented { max-width: 100%; overflow-x: auto; }
}
@media (pointer: coarse) { .btn.sm, .segmented button { min-height: var(--tap); } }
@media (min-width: 761px) { .show-mobile { display: none !important; } }

.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; background: var(--overlay); }
.sheet-panel { width: 100%; max-height: 80vh; overflow-y: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 10px 10px calc(16px + env(safe-area-inset-bottom)); }
.sheet-panel .nav a { min-height: 46px; font-size: 15px; }

@media print {
  .sidebar, .topbar, .tabbar, .page-head .actions, .no-print { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .letter { border: 0; padding: 0; }
}

/* -------------------------------------- hiring flow (Fixboard #35, #3761) */

.studio-live-count { margin: 0; }
.studio-glance { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 16px 18px; }
.studio-glance h3 { font-size: 13px; margin: 0 0 10px; }
.studio-glance ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.studio-glance li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 40px; }
.studio-glance-role { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 620; color: var(--accent-strong); cursor: pointer; text-align: left; min-height: 40px; }
.studio-glance-role:hover { text-decoration: underline; }
.studio-inactive { border: 1px dashed var(--border-strong); border-radius: 14px; padding: 14px 18px; }
.studio-inactive > summary { cursor: pointer; font-weight: 650; min-height: 40px; }
.studio-inactive[open] > summary { margin-bottom: 8px; }
.studio-inactive .opening-canvas { margin-top: 14px; }
.opening-canvas { scroll-margin-top: 16px; }
.flow-node.ready { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.flow-node-detail { flex: 1; width: 100%; min-width: 0; }
.flow-node-detail p { margin: 0 0 6px; overflow-wrap: anywhere; }
.rubric-slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.rubric-slot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.rubric-slot.set { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.rubric-slot > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rubric-slot-kind { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--text); }
.rubric-slot-name { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.rubric-slot .btn { flex: none; }
.rubric-preview ul { margin: 4px 0 14px; padding-left: 18px; }
.opening-status { margin: 0; max-width: 560px; color: var(--text-2); }
.live-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 13px; font-weight: 600; position: relative; }
.live-switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.live-switch-track { width: 44px; height: 26px; border-radius: 13px; background: var(--border-strong); position: relative; transition: background .2s; flex: none; }
.live-switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px #0003; }
.live-switch input:checked + .live-switch-track { background: var(--ok); }
.live-switch input:checked + .live-switch-track::after { transform: translateX(18px); }
.live-switch input:focus-visible + .live-switch-track { outline: 3px solid var(--focus, var(--accent)); outline-offset: 2px; }
.live-switch input:disabled + .live-switch-track { opacity: .5; }
@media (max-width: 1360px) and (min-width: 601px) { .flow-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .flow-node:nth-child(2)::after { display: none; } }
@media (prefers-reduced-motion: reduce) { .live-switch-track, .live-switch-track::after { transition: none; } }

.applicant-portal .card-head { border-radius: 16px 16px 0 0; }
.applicant-portal .notice, .application-page .notice { flex-wrap: wrap; align-items: center; }
.applicant-portal .notice .grow, .application-page .notice .grow { flex: 1 1 220px; }
/* candidate status (Fixboard #34) */
@media (max-width: 760px) {
  /* On a phone the Status button starts at the left edge, so it widens like the
     stage buttons and its menu opens to the right, inside the screen. */
  .page-head .actions .menu.status-menu { flex: 1; }
  .page-head .actions .menu.status-menu > .btn { width: 100%; }
  .menu.status-menu .menu-pop { right: auto; left: 0; }
  .menu.status-menu .menu-pop button { min-height: 40px; }
}

/* ============================================================================
   Public application page (#/apply/<org>), in the hiring organisation's own
   brand (sql/0132, js/lib/brand.mjs, js/screens/apply.mjs).

   applyBrand() puts --brand-* colours on the page, each already checked for
   contrast; this block maps them onto the app's tokens: light by default,
   dark when the visitor's device is dark (unless they chose a light theme)
   or they chose the dark theme. Fallbacks are the neutral look of a page
   with no brand. Fonts are the system stack: the site's CSP loads none.
   The applicant's private page keeps its own rules above; it only shares
   the "branded" accent below when applyBrand() is called on it.
   ========================================================================= */

.branded {
  --accent: var(--brand-primary); --accent-hover: var(--brand-primary-hover); --accent-strong: var(--brand-primary);
  --accent-soft: var(--brand-primary-soft); --on-accent: var(--brand-on-primary); --focus: var(--brand-primary);
}
.application-page {
  --bg: var(--brand-bg, #f8f9fe); --surface: #ffffff; --surface-2: var(--brand-surface-2, #f5f6fd); --surface-3: var(--brand-wash, #eff1fc);
  --wash: var(--brand-wash, #eff1fc);
  --text: var(--brand-ink, #171e51); --text-2: var(--brand-text-2, #475467); --text-3: var(--brand-text-3, #556172);
  --border: var(--brand-line, #e0e3f8); --border-strong: var(--brand-line-strong, #a8b0ed); --field-border: var(--brand-field, #838de4);
  --accent: var(--brand-primary, #3d4fd6); --accent-hover: var(--brand-primary-hover, #3342b4); --accent-strong: var(--brand-primary, #3d4fd6);
  --accent-soft: var(--brand-primary-soft, #eaecfa); --on-accent: var(--brand-on-primary, #ffffff); --focus: var(--brand-primary, #3d4fd6);
  --mark: var(--brand-accent, #3d4fd6); --mark-ink: var(--brand-accent-ink, #3d4fd6); --mark-soft: var(--brand-accent-soft, #e4e6f9);
  --shadow-card: 0 14px 34px -24px color-mix(in srgb, var(--accent) 70%, transparent);
  color-scheme: light; background: var(--bg); color: var(--text);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .application-page, :root[data-theme="auto"] .application-page {
    --bg: var(--brand-bg-dark, #0f1522); --surface: var(--brand-surface-dark, #171e2f); --surface-2: var(--brand-surface-2-dark, #1a2139); --surface-3: var(--brand-wash-dark, #171e3f);
    --wash: var(--brand-wash-dark, #171e3f);
    --text: var(--brand-ink-dark, #dfe0e7); --text-2: var(--brand-text-2-dark, #b8c2d0); --text-3: var(--brand-text-3-dark, #9ea9b8);
    --border: var(--brand-line-dark, #2c334e); --border-strong: var(--brand-line-strong-dark, #495284); --field-border: var(--brand-field-dark, #5964a5);
    --accent: var(--brand-primary-dark, #7c88e3); --accent-hover: var(--brand-primary-hover-dark, #949de8); --accent-strong: var(--brand-primary-dark, #7c88e3);
    --accent-soft: var(--brand-primary-soft-dark, #192146); --on-accent: var(--brand-on-primary-dark, #0b0f16); --focus: var(--brand-primary-dark, #7c88e3);
    --mark: var(--brand-accent-dark, #5262da); --mark-ink: var(--brand-accent-ink-dark, #7c88e3); --mark-soft: var(--brand-accent-soft-dark, #171e3f);
    --ok: #5fd197; --ok-soft: #12301f; --warn: #f2b65c; --warn-soft: #33260f; --bad: #ff8a80; --bad-soft: #3a1714; --info: #7fb2ff; --info-soft: #14253d;
    --shadow-card: 0 16px 36px -26px rgba(0, 0, 0, .9);
    color-scheme: dark;
  }
  :root:not([data-theme]) body:has(main.public > .application-page), :root[data-theme="auto"] body:has(main.public > .application-page) { background: #0f1522; }
}
:root[data-theme="dark"] .application-page {
  --bg: var(--brand-bg-dark, #0f1522); --surface: var(--brand-surface-dark, #171e2f); --surface-2: var(--brand-surface-2-dark, #1a2139); --surface-3: var(--brand-wash-dark, #171e3f);
  --wash: var(--brand-wash-dark, #171e3f);
  --text: var(--brand-ink-dark, #dfe0e7); --text-2: var(--brand-text-2-dark, #b8c2d0); --text-3: var(--brand-text-3-dark, #9ea9b8);
  --border: var(--brand-line-dark, #2c334e); --border-strong: var(--brand-line-strong-dark, #495284); --field-border: var(--brand-field-dark, #5964a5);
  --accent: var(--brand-primary-dark, #7c88e3); --accent-hover: var(--brand-primary-hover-dark, #949de8); --accent-strong: var(--brand-primary-dark, #7c88e3);
  --accent-soft: var(--brand-primary-soft-dark, #192146); --on-accent: var(--brand-on-primary-dark, #0b0f16); --focus: var(--brand-primary-dark, #7c88e3);
  --mark: var(--brand-accent-dark, #5262da); --mark-ink: var(--brand-accent-ink-dark, #7c88e3); --mark-soft: var(--brand-accent-soft-dark, #171e3f);
  --ok: #5fd197; --ok-soft: #12301f; --warn: #f2b65c; --warn-soft: #33260f; --bad: #ff8a80; --bad-soft: #3a1714; --info: #7fb2ff; --info-soft: #14253d;
  --shadow-card: 0 16px 36px -26px rgba(0, 0, 0, .9);
  color-scheme: dark;
}
:root[data-theme="dark"] body:has(main.public > .application-page) { background: #0f1522; }
body:has(main.public > .application-page) { background: #f8f9fe; }

/* Layout: the page paints edge to edge; its sections share one column. */
.public:has(> .application-page) { max-width: none; padding: 0; }
.public > .application-page { min-height: 100vh; }
.application-page { padding: 0 clamp(16px, 4vw, 40px) 40px; overflow-wrap: anywhere; }
.application-page > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.application-page h1, .application-page h2, .application-page h3, .application-page h4 { color: var(--text); }
.application-page a { color: var(--accent-strong); }
.application-page .prose { white-space: pre-wrap; color: var(--text); }
.application-page .btn { border-radius: 999px; padding: 0 20px; }
.application-page .btn.primary { box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--accent) 75%, transparent); }
.application-page .input, .application-page .select, .application-page .textarea { background: var(--surface); color: var(--text); border-color: var(--field-border); }

.application-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.application-page .application-brand { margin: 0; gap: 12px; min-width: 0; font-weight: 400; }
.application-page .application-logo { width: 52px; height: 52px; padding: 0; background: transparent; box-shadow: 0 0 0 1px var(--border); border-radius: 12px; object-fit: contain; flex: none; }
.application-monogram { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 17px; white-space: nowrap; }
.application-brand-text { display: flex; flex-direction: column; min-width: 0; }
.application-org { font-size: 17px; font-weight: 760; line-height: 1.25; color: var(--text); }
.application-tagline { font-size: 13.5px; font-weight: 650; line-height: 1.35; color: var(--accent-strong); }
.application-website { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-height: 42px; padding: 0 16px; border: 1.5px solid var(--accent); border-radius: 999px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.application-website:hover { background: var(--accent-soft); text-decoration: none; }

.application-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; margin-top: 24px; padding: clamp(26px, 5vw, 56px); border: 1px solid var(--border); border-radius: 28px;
  background: radial-gradient(110% 80% at 100% 0%, var(--mark-soft) 0%, transparent 46%), linear-gradient(160deg, var(--wash) 0%, var(--surface-2) 100%); }
.application-hero.with-image { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; }
.application-hero-copy { min-width: 0; }
.application-hero h1 { max-width: 780px; font-size: clamp(32px, 4.6vw, 52px); line-height: 1.1; letter-spacing: -.03em; font-weight: 760; }
.application-intro { max-width: 680px; margin: 18px 0 0; font-size: 17.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; }
.application-mission { max-width: 640px; margin: 22px 0 0; padding: 2px 0 2px 16px; border-left: 4px solid var(--mark); font-size: 16px; line-height: 1.6; font-weight: 620; color: var(--text); }
.application-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 28px; }
.application-count { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13.5px; font-weight: 680; white-space: nowrap; }
.application-hero-image { width: 100%; height: 100%; max-height: 360px; object-fit: cover; border-radius: 20px; }
.application-page .application-hero .application-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; font-size: 14px; font-weight: 400; color: var(--text-2); }
.application-page .application-hero .application-steps li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
.application-page .application-steps .application-step-number { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 14px; font-weight: 760; }
.application-page .application-steps strong { display: block; margin-bottom: 2px; font-size: 14.5px; color: var(--text); }
.application-page .application-steps p { margin: 0; font-size: 13.5px; line-height: 1.5; }

.application-about { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 40px; margin-top: 48px; align-items: start; }
.application-about.both { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.application-about h2, .application-roles h2, .application-empty h2 { font-size: clamp(23px, 2.8vw, 29px); letter-spacing: -.02em; font-weight: 740; }
.application-about-text p { max-width: 620px; margin: 14px 0 0; font-size: 16.5px; line-height: 1.75; color: var(--text-2); white-space: pre-wrap; }
.application-why { padding: 26px 28px; border: 1px solid var(--border); border-radius: 22px; background: var(--surface); }
.application-about .application-why h2 { font-size: 20px; }
.application-why ul { display: grid; gap: 12px; margin: 16px 0 0; padding: 0; list-style: none; }
.application-why li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.55; color: var(--text); }
.application-why-mark { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mark-soft); color: var(--mark-ink); }

.application-roles { margin-top: 56px; scroll-margin-top: 16px; }
.application-roles:focus { outline: none; }
.application-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.application-lead { max-width: 680px; margin: 10px 0 0; font-size: 15px; line-height: 1.65; color: var(--text-2); }
.application-role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 20px; align-items: start; margin-top: 24px; }
.application-role-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 28px 24px 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.application-role-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--accent), var(--mark)); }
.application-role-card h3 { font-size: 21px; letter-spacing: -.015em; font-weight: 720; }
.application-role-summary { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.application-page .role-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.application-page .role-tags li { padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; font-weight: 650; }
.application-page details > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; cursor: pointer; list-style: none; font-weight: 680; color: var(--accent-strong); }
.application-page details > summary::-webkit-details-marker { display: none; }
.application-page details > summary::after { content: ''; flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.application-page details[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.application-role-more { padding-top: 4px; border-top: 1px solid var(--border); }
.application-role-more[open] > summary { margin-bottom: 4px; }
.application-jd { max-height: 420px; overflow-y: auto; padding-right: 6px; font-size: 14.5px; }
.application-role-assignment { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); font-size: 14px; line-height: 1.55; color: var(--text-2); }
.application-role-assignment p { margin: 6px 0 0; }
.application-role-assignment .application-assignment-lead { margin: 0; font-weight: 720; color: var(--text); }
.application-role-assignment ul { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.application-role-assignment li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-weight: 620; color: var(--text); }
.application-days { font-size: 13px; font-weight: 500; color: var(--text-3); }
.application-role-actions { margin-top: auto; padding-top: 8px; }
.application-role-actions .btn { width: 100%; padding-top: 10px; padding-bottom: 10px; line-height: 1.3; text-align: center; white-space: normal; }
.application-role-actions .btn svg { flex: none; }

/* ----------------------- assignment options and publish checklist (0131) */

.portal-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; align-items: start; }
.portal-choice { border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.portal-choice h3 { margin: 0; font-size: 17px; }
.portal-choice p { margin: 0; }
.portal-choice details > summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.portal-choice .btn { width: 100%; justify-content: center; }
.option-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.option-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.option-item.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.option-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.option-item-title { font-weight: 650; font-size: 13px; overflow-wrap: anywhere; }
.option-item-meta { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.option-item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.option-mode { width: 100%; }
.option-mode label { font-size: 12px; font-weight: 650; display: block; margin-bottom: 4px; }
.listing-steps { list-style: none; margin: 0 24px 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.listing-steps li { padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); }
.listing-steps li[aria-current="step"] { border-color: var(--accent); color: var(--accent-strong); font-weight: 650; background: var(--accent-soft); }
.listing-steps li.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.publish-checklist { margin: 0 24px 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.publish-checklist h3 { font-size: 14px; margin: 0 0 8px; }
.publish-checklist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.publish-checklist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; min-height: 40px; }
.publish-checklist li > span { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.publish-checklist li.done > span { color: var(--text-2); }
.publish-checklist li.done svg { color: var(--ok); }
.publish-checklist li.todo svg { color: var(--warn); }
.publish-checklist li.check-warning { padding: 6px 10px; border-radius: 10px; background: var(--warn-soft); }
.publish-checklist li.check-warning > span { color: var(--text); align-items: flex-start; }
.publish-checklist li.check-warning svg { color: var(--warn); flex: none; margin-top: 2px; }
.applicant-summary { margin: 0 24px 16px; font-size: 13px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.studio-howto { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 12px 18px; }
.studio-howto > summary { cursor: pointer; font-weight: 650; min-height: 40px; display: flex; align-items: center; }
.studio-howto ol { margin: 6px 0 4px; padding-left: 20px; line-height: 1.7; font-size: 14px; }
@media (max-width: 600px) {
  .listing-steps, .publish-checklist, .applicant-summary { margin-left: 16px; margin-right: 16px; }
}
/* rubric builder */
.rb-intro { margin: 0; padding: 12px 16px 4px; }
.rb-retired { border-top: 1px solid var(--border); }
.rb-retired > h3 { padding: 14px 16px 2px; }
.rb-retired > p { padding: 0 16px; margin: 0 0 4px; }
.rb-layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 860px) { .rb-layout { grid-template-columns: minmax(0, 1fr) 270px; } }
.rb-build { min-width: 0; }
.rb-editor { margin-bottom: 14px; }
.rb-editor-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.rb-editor-head > div { flex: 1 1 220px; min-width: 0; }
.rb-label { font-size: 13px; font-weight: 620; margin-bottom: 2px; }
.rb-outof { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 620; white-space: nowrap; }
.rb-outof .input { width: 88px; }
.rb-rows { display: flex; flex-direction: column; gap: 8px; }
.rb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "crit points remove" "guide guide guide"; gap: 6px 8px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.rb-row > .rb-crit { grid-area: crit; }
.rb-row > .rb-row-points { grid-area: points; }
.rb-row > .rb-remove { grid-area: remove; }
.rb-row > .rb-guide { grid-area: guide; }
.rb-row .input.rb-guide { font-size: 13.5px; color: var(--text-2); }
.rb-row-points { display: flex; align-items: center; gap: 6px; }
.rb-row-points .input { width: 76px; }
.rb-share { min-width: 4ch; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rb-editor-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.rb-tally { font-size: 13px; font-weight: 620; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); }
.rb-tally.ok { background: var(--ok-soft); color: var(--ok); }
.rb-preview { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.rb-preview-eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: 6px; }
.rb-preview-name { font-size: 15px; font-weight: 650; margin-bottom: 10px; overflow-wrap: anywhere; }
.rb-preview-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rb-preview-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rb-preview-crit { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.rb-preview-score { display: flex; align-items: center; gap: 6px; flex: none; }
.rb-preview-box { width: 44px; height: 30px; border: 1px solid var(--field-border); border-radius: 7px; background: var(--surface); }
.rb-preview-bar { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.rb-preview-bar > span { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width .2s ease-out; }
.rb-preview-total { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; margin-bottom: 4px; border-top: 1px solid var(--border); font-size: 14px; }
.rb-preview-warn { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--text); font-size: 13px; }
@media (max-width: 600px) {
  .rb-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "crit crit" "guide guide" "points remove"; }
  .rb-outof { flex: 1 1 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { .rb-preview-bar > span { transition: none; } }
.application-form { max-width: 820px; margin: 56px auto 0; padding: clamp(24px, 4vw, 44px); border: 1px solid var(--border); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-card); scroll-margin-top: 16px; }
.application-form-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.application-form-intro h2 { font-size: clamp(24px, 3vw, 30px); letter-spacing: -.02em; font-weight: 740; }
.application-step-label { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.application-form > .application-lead { margin-bottom: 22px; }
.application-role-found { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 14px; font-weight: 650; color: var(--accent-strong); }
.application-role-found svg { flex: none; }
.application-page .role-description { margin: 14px 0 28px; padding: 22px 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-2); }
.application-page .role-description h3 { margin: 10px 0 8px; font-size: 19px; }
.application-jd-again, .application-page .assignment-preview { margin-top: 12px; padding-top: 6px; border-top: 1px solid var(--border); }
.application-jd-again .prose, .application-assignment-option .prose { font-size: 14.5px; }
.application-assignment-option { padding-top: 12px; }
.application-assignment-option + .application-assignment-option { margin-top: 12px; border-top: 1px dashed var(--border); }
.application-assignment-option h4 { margin-bottom: 6px; font-size: 15px; }
.application-identity > h3 { margin-top: 6px; font-size: 20px; }
.application-readiness { margin: 18px 0 22px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.application-encouragement { min-height: 20px; margin-bottom: 8px; font-size: 13px; font-weight: 620; color: var(--text-2); }
.application-ready-bar { display: block; width: 100%; height: 6px; border: 0; border-radius: 6px; overflow: hidden; appearance: none; background: var(--accent-soft); accent-color: var(--accent); }
.application-ready-bar::-webkit-progress-bar { background: var(--accent-soft); border-radius: 6px; }
.application-ready-bar::-webkit-progress-value { background: var(--accent); border-radius: 6px; transition: width .3s ease; }
.application-ready-bar::-moz-progress-bar { background: var(--accent); }
.application-contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; }
.application-consent { margin: 8px 0 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); font-size: 14px; line-height: 1.6; color: var(--text); }
.application-form .btn.primary { min-width: 260px; }
.application-ai-note { margin: 14px 0 0; font-size: 13px; color: var(--text-3); }

.application-empty { margin-top: 40px; padding: clamp(24px, 4vw, 40px); border: 1px solid var(--border); border-radius: 22px; background: var(--surface); text-align: center; }
.application-empty p { max-width: 520px; margin: 10px auto 0; color: var(--text-2); }
.application-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px; margin-top: 56px; padding: 24px 0 8px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-2); }
.application-footer-brand { display: flex; flex-direction: column; gap: 2px; }
.application-footer-brand strong { font-size: 15px; color: var(--text); }
.application-footer-brand span { font-size: 13px; color: var(--text-3); }
.application-footer ul { display: flex; flex-wrap: wrap; gap: 0 20px; margin: 0; padding: 0; list-style: none; }
.application-footer a { display: inline-flex; align-items: center; min-height: 40px; font-weight: 620; }

@media (max-width: 760px) {
  .application-hero.with-image, .application-about.both { grid-template-columns: minmax(0, 1fr); }
  .application-hero-image { max-height: 220px; }
  .application-page .application-hero .application-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .public:has(> .application-page) { padding: 0; }
  .application-page { padding: 0 16px 28px; }
  .application-topbar { padding: 12px 0; gap: 12px; }
  .application-page .application-logo, .application-monogram { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .application-org { font-size: 15.5px; }
  .application-tagline { font-size: 12.5px; }
  .application-website { width: 42px; padding: 0; }
  .application-website span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .application-hero { gap: 22px; margin-top: 16px; padding: 26px 20px; border-radius: 22px; }
  .application-hero h1 { font-size: 32px; }
  .application-intro { font-size: 16px; }
  .application-hero-actions .btn { width: 100%; }
  .application-page .application-hero .application-steps { gap: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; }
  .application-page .application-hero .application-steps li { padding: 12px 14px; border: 0; border-radius: 0; background: transparent; }
  .application-page .application-hero .application-steps li + li { border-top: 1px solid var(--border); }
  .application-about { margin-top: 36px; }
  .application-why { padding: 22px 20px; }
  .application-roles { margin-top: 44px; }
  .application-role-card { padding: 26px 18px 18px; border-radius: 18px; }
  .application-form { margin-top: 40px; padding: 26px 18px; border-radius: 22px; }
  .application-contact { grid-template-columns: minmax(0, 1fr); }
  .application-form .btn.primary { width: 100%; min-width: 0; }
  .application-page .role-description { padding: 18px 16px; }
  .application-footer { flex-direction: column; align-items: flex-start; }
}

/* Page branding, the HR dialog for the page above (js/screens/hiring-brand.mjs). */
.branding-section { margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.branding-section h3 { margin-bottom: 4px; font-size: 15px; }
.branding-colour { display: flex; align-items: center; gap: 10px; }
.branding-colour .input { max-width: 160px; font-family: var(--mono); text-transform: uppercase; }
.branding-swatch { flex: none; width: 46px; height: 40px; padding: 2px; border: 1px solid var(--field-border); border-radius: 8px; background: var(--surface); cursor: pointer; }
.branding-preview { margin: 4px 0 18px; }
.branding-preview-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.branding-preview-panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px; border: 1px solid; border-radius: 14px; font-size: 12px; overflow-wrap: anywhere; }
.branding-preview-caption { font-size: 11px; font-weight: 650; opacity: .9; }
.branding-preview-top { display: flex; align-items: center; gap: 8px; }
.branding-preview-mark { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 800; font-size: 13px; }
.branding-preview-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.branding-preview-name span { font-size: 11px; font-weight: 650; }
.branding-preview-title { font-size: 16px; font-weight: 760; line-height: 1.2; }
.branding-preview-mission { padding-left: 8px; border-left: 3px solid; }
.branding-preview-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.branding-preview-link { font-weight: 680; }
.branding-preview-button { padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.branding-links { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.branding-links legend { padding: 0; font-size: 13px; font-weight: 620; color: var(--text); }
.branding-links .help { margin: 4px 0 8px; font-size: 12.5px; color: var(--text-3); }
.branding-links-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.branding-link { display: flex; align-items: flex-start; gap: 6px; }
.branding-link-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 6px; }
.branding-links .error { margin-top: 6px; font-size: 12.5px; font-weight: 560; color: var(--bad); }
@media (max-width: 600px) {
  .branding-preview-pair, .branding-link-fields { grid-template-columns: minmax(0, 1fr); }
}

/* The applicant's private page in the organisation's brand: applyBrand()
   adds .branded when the organisation has set one; otherwise the rules above
   keep their own colours. */
body:has(main.public > .applicant-portal.branded) { background: #f8f9fe; }
.applicant-portal.branded {
  --surface-2: var(--brand-surface-2); --surface-3: var(--brand-wash); --border: var(--brand-line); --border-strong: var(--brand-line-strong); --field-border: var(--brand-field);
  --card-line: var(--brand-line); --hero-bg: var(--brand-wash); --hero-line: var(--brand-line);
  --step-now-line: var(--brand-line-strong); --step-now-text: var(--accent-strong); --step-num-bg: var(--brand-primary-soft); --step-num: var(--accent-strong);
  --kicker: var(--accent-strong); --encourage: var(--accent-strong);
  --drop-bg: var(--brand-surface-2); --drop-line: var(--brand-line-strong); --drop-hover: var(--brand-primary-soft); --drop-hover-line: var(--accent);
  --readiness-bg: var(--brand-surface-2); --readiness-line: var(--brand-line);
}
.applicant-portal.branded .portal-choice { border-color: var(--card-line); }
.applicant-portal.branded .role-description { background: var(--surface-2); border-color: var(--card-line); }

/* The private page follows the device into dark, branded or not, with the
   public page's dark palette so one organisation looks the same on both. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .applicant-portal, :root[data-theme="auto"] .applicant-portal {
  --bg: var(--brand-bg-dark, #0f1522); --surface: var(--brand-surface-dark, #171e2f); --surface-2: var(--brand-surface-2-dark, #1a2139); --surface-3: var(--brand-wash-dark, #171e3f);
  --text: var(--brand-ink-dark, #dfe0e7); --text-2: var(--brand-text-2-dark, #b8c2d0); --text-3: var(--brand-text-3-dark, #9ea9b8);
  --border: var(--brand-line-dark, #2c334e); --border-strong: var(--brand-line-strong-dark, #495284); --field-border: var(--brand-field-dark, #5964a5);
  --accent: var(--brand-primary-dark, #7c88e3); --accent-hover: var(--brand-primary-hover-dark, #949de8); --accent-strong: var(--brand-primary-dark, #7c88e3);
  --accent-soft: var(--brand-primary-soft-dark, #192146); --on-accent: var(--brand-on-primary-dark, #0b0f16); --focus: var(--brand-primary-dark, #7c88e3);
  --ok: #5fd197; --ok-soft: #12301f; --warn: #f2b65c; --warn-soft: #33260f; --bad: #ff8a80; --bad-soft: #3a1714; --info: #7fb2ff; --info-soft: #14253d;
  --field-bg: var(--surface-2); --card-line: var(--border); --hero-bg: var(--surface-3); --hero-line: var(--border);
  --step-bg: var(--surface-2); --step-line: var(--border); --step-now-bg: var(--surface); --step-now-line: var(--border-strong); --step-now-text: var(--accent);
  --step-num-bg: var(--accent-soft); --step-num: var(--accent); --kicker: var(--accent); --encourage: var(--accent);
  --drop-bg: var(--surface-2); --drop-line: var(--border-strong); --drop-hover: var(--accent-soft); --drop-hover-line: var(--accent);
  --readiness-bg: var(--surface-2); --readiness-line: var(--border); --pill-bg: var(--surface); --pill-line: var(--border); --pill-text: var(--text-2); --pill-mark: var(--border-strong);
  --done-bg: var(--ok-soft); --done-line: #2a5a3e; --done-text: var(--ok); --done-row: var(--ok-soft);
  --receipt-bg: var(--ok-soft); --receipt-line: #2a5a3e; --receipt-text: var(--text); --receipt-head: var(--ok); --receipt-mark: #1d4430; --receipt-ring: transparent;
  color-scheme: dark;
  }
  :root:not([data-theme]) body:has(main.public > .applicant-portal), :root[data-theme="auto"] body:has(main.public > .applicant-portal) { background: #0f1522; }
}
:root[data-theme="dark"] .applicant-portal {
  --bg: var(--brand-bg-dark, #0f1522); --surface: var(--brand-surface-dark, #171e2f); --surface-2: var(--brand-surface-2-dark, #1a2139); --surface-3: var(--brand-wash-dark, #171e3f);
  --text: var(--brand-ink-dark, #dfe0e7); --text-2: var(--brand-text-2-dark, #b8c2d0); --text-3: var(--brand-text-3-dark, #9ea9b8);
  --border: var(--brand-line-dark, #2c334e); --border-strong: var(--brand-line-strong-dark, #495284); --field-border: var(--brand-field-dark, #5964a5);
  --accent: var(--brand-primary-dark, #7c88e3); --accent-hover: var(--brand-primary-hover-dark, #949de8); --accent-strong: var(--brand-primary-dark, #7c88e3);
  --accent-soft: var(--brand-primary-soft-dark, #192146); --on-accent: var(--brand-on-primary-dark, #0b0f16); --focus: var(--brand-primary-dark, #7c88e3);
  --ok: #5fd197; --ok-soft: #12301f; --warn: #f2b65c; --warn-soft: #33260f; --bad: #ff8a80; --bad-soft: #3a1714; --info: #7fb2ff; --info-soft: #14253d;
  --field-bg: var(--surface-2); --card-line: var(--border); --hero-bg: var(--surface-3); --hero-line: var(--border);
  --step-bg: var(--surface-2); --step-line: var(--border); --step-now-bg: var(--surface); --step-now-line: var(--border-strong); --step-now-text: var(--accent);
  --step-num-bg: var(--accent-soft); --step-num: var(--accent); --kicker: var(--accent); --encourage: var(--accent);
  --drop-bg: var(--surface-2); --drop-line: var(--border-strong); --drop-hover: var(--accent-soft); --drop-hover-line: var(--accent);
  --readiness-bg: var(--surface-2); --readiness-line: var(--border); --pill-bg: var(--surface); --pill-line: var(--border); --pill-text: var(--text-2); --pill-mark: var(--border-strong);
  --done-bg: var(--ok-soft); --done-line: #2a5a3e; --done-text: var(--ok); --done-row: var(--ok-soft);
  --receipt-bg: var(--ok-soft); --receipt-line: #2a5a3e; --receipt-text: var(--text); --receipt-head: var(--ok); --receipt-mark: #1d4430; --receipt-ring: transparent;
  color-scheme: dark;
}
:root[data-theme="dark"] body:has(main.public > .applicant-portal) { background: #0f1522; }
