/* Ocupop Moves — the one design system.
   Every surface (board, fit, admin, how-it-works, and the server-rendered
   confirm pages in api/action.ts + api/board) links this file. Tokens and
   primitives lived in four copies before; a contrast fix had to be made four
   times and was made once. Page-specific layout stays in the page.
   Lineage: DESIGN-AND-SEED A1, adopted per DECISIONS D1/D12. */

:root{
  /* Brand */
  --ink:#233b36; --ink-soft:#52645e; --white:#ffffff; --light:#f7f8f4;
  --alabaster:#ecf0e9; --blue:#00aaff; --teal:#70d9e5; --orange:#ff6d39;
  --pink:#e3edb9;

  /* Accessible derivatives. The brand orange is 2.8:1 on white — fine as a
     background behind ink (5.5:1), a contrast failure as text or behind
     white. So: --orange paints, --orange-ink writes (5.2:1 on white,
     4.8:1 on --light). Anything urgent stays orange and stays readable. */
  --orange-ink:#c2410c;
  /* Placeholder greys. --muted is for em-dashes and "nothing here" filler
     only (4.8:1 on white); real text uses --ink-soft (12:1). */
  --muted:#6f7375;
  --line:rgba(31,37,40,.15);
  --line-soft:rgba(31,37,40,.09);
  --focus:#1f2528;
  --focus-dark:#ffb4e6;

  --sans:'commuters-sans', system-ui, -apple-system, sans-serif;
  --serif:'Berlingske Serif', Georgia, serif;
  --mono:ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius:16px;
  --border:1px solid var(--line);
  /* One horizontal rhythm for every page-level band. */
  --gutter:clamp(20px,3vw,48px);
}

*{box-sizing:border-box}

body{
  margin:0;background:var(--light);color:var(--ink);
  font-family:var(--sans);font-size:15px;line-height:1.45;
  /* Nothing in this app is a horizontal-scrolling document; the wide bits
     (board columns, fit table) scroll inside their own container. */
  overflow-x:hidden;
}
button,select,input,textarea{font-family:inherit}
button{cursor:pointer}

/* ---------- focus ----------
   The app is drag-and-click first, which is exactly why the keyboard path
   has to be visible. One ring, everywhere, never removed. */
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.on-dark :focus-visible,
header :focus-visible{outline-color:var(--focus-dark)}

/* Screen-reader-only, and the skip link that becomes visible on focus. */
.vh{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0}
.skip{position:absolute;left:-9999px;top:0;z-index:200;background:var(--ink);color:#fff;
  padding:10px 16px;border-radius:0 0 10px 0;font-weight:600;font-size:14px;text-decoration:none}
.skip:focus{left:0}
/* It lands on the ink masthead, so the ink ring would be invisible. */
.skip:focus-visible{outline-color:var(--focus-dark);outline-offset:-3px}

.kicker{text-transform:uppercase;letter-spacing:.08em;font-weight:600;font-size:12px}
.muted{color:var(--muted)}
.warn{color:var(--orange-ink)}

/* ---------- masthead ----------
   Wraps instead of clipping: at 390px the old row pushed Admin and Process
   off the right edge with no way to reach them. */
header.mast{background:var(--ink);color:rgba(255,255,255,.92);padding:10px var(--gutter);
  display:flex;align-items:baseline;gap:8px 14px;flex-wrap:wrap}
header.mast .wordmark{font-weight:700;letter-spacing:.06em}
header.mast .tagline{font-family:var(--serif);font-style:italic;opacity:.85;font-size:14px}
header.mast .spacer{flex:1;min-width:0}
header.mast .who{font-size:13px;opacity:.85}
header.mast nav{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
header.mast nav a{color:#fff;font-size:13px;opacity:.85;text-decoration:none;
  border-bottom:1px solid rgba(255,255,255,.35);padding-bottom:1px}
header.mast nav a:hover{opacity:1;border-bottom-color:#fff}
header.mast nav button{background:transparent;color:#fff;border:1px solid rgba(255,255,255,.4);
  border-radius:999px;padding:4px 12px;font-size:12px;font-weight:600}
header.mast nav button:hover{background:rgba(255,255,255,.14)}
@media (max-width:560px){
  header.mast .tagline{display:none}
  header.mast .spacer{flex-basis:100%;height:0}
}

/* ---------- buttons ---------- */
.btn{border:var(--border);background:var(--white);border-radius:8px;padding:8px 16px;
  font-weight:600;font-size:14px;color:inherit;text-decoration:none;display:inline-block;
  line-height:1.3}
.btn:hover:not(:disabled){border-color:rgba(31,37,40,.45)}
.btn.primary{background:var(--pink);border-color:transparent}
.btn.primary:hover:not(:disabled){background:#d2e294}
.btn.on{background:var(--ink);color:#fff;border-color:transparent}
.btn.small{padding:5px 10px;font-size:12px}
.btn:disabled{opacity:.45;cursor:not-allowed}
/* Destructive verbs read as destructive without shouting in red. */
.btn.danger{border-color:var(--orange);color:var(--orange-ink)}
.btn.danger:hover:not(:disabled){background:var(--orange);color:var(--ink);border-color:transparent}

/* ---------- forms ----------
   Typed selectors kept missing new input types (the contact email field on
   the board card rendered unstyled for months). Select by what it is not. */
label{display:block;font-size:13px;font-weight:600;text-transform:none;
  letter-spacing:0;margin:12px 0 3px}
label .hint{text-transform:none;letter-spacing:0;font-weight:400;color:var(--ink-soft)}
input:not([type=checkbox]):not([type=radio]),select,textarea{
  width:100%;padding:8px;border:var(--border);border-radius:8px;
  font-size:14px;background:var(--white);color:inherit}
input:not([type=checkbox]):not([type=radio]):hover,select:hover,textarea:hover{border-color:rgba(31,37,40,.35)}
textarea{min-height:80px;resize:vertical}
input[type=checkbox],input[type=radio]{width:auto;accent-color:var(--ink);
  /* 14px checkboxes in a 105-row triage table are a miss-tap machine. */
  min-width:16px;min-height:16px}
.checkline{display:flex;gap:8px;align-items:center;margin:8px 0;font-size:14px}
.checkline label{display:inline;margin:0;text-transform:none;letter-spacing:0;
  font-weight:400;font-size:14px}
.btnrow{display:flex;gap:10px;margin-top:16px;justify-content:flex-end;flex-wrap:wrap}

/* ---------- chips ---------- */
.chip{display:inline-block;border:1px solid var(--ink);border-radius:999px;padding:1px 9px;
  font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;white-space:nowrap}
.chip.lane-nb{background:var(--blue);border-color:transparent}
.chip.lane-ex{background:var(--teal);border-color:transparent}
.chip.rank{background:var(--pink);border-color:transparent}
.chip.read{background:var(--alabaster);border-color:transparent}
/* Ink on orange, never white on orange: white gets 2.8:1 and disappears. */
.chip.warn,.flag{background:var(--orange);border-color:transparent;color:var(--ink)}

/* The overdue/attention badge, shared by board cards, the fit table and the
   dashboard strip. */
.flag{display:inline-block;border-radius:6px;padding:0 6px;font-weight:600;
  font-size:inherit;white-space:nowrap}

/* ---------- dialogs ----------
   Modal and side panel are the same object with different geometry: both
   trap focus, both close on Escape, both return focus where they found it
   (see the trapFocus helper each page ships). */
.modalback{position:fixed;inset:0;background:rgba(31,37,40,.45);display:none;
  align-items:center;justify-content:center;z-index:70;padding:16px}
.modalback.open{display:flex}
.modal{background:var(--white);border-radius:var(--radius);padding:22px;
  width:min(440px,100%);max-height:88vh;overflow-y:auto}
.modal h3{margin:0 0 6px;font-size:19px}
.modal .say{font-size:13px;color:var(--ink-soft);margin:0 0 4px}
.panelback{position:fixed;inset:0;background:rgba(31,37,40,.25);display:none;z-index:58}
.panelback.open{display:block}
.panel{position:fixed;top:0;right:0;bottom:0;width:min(460px,100vw);background:var(--white);
  border-left:var(--border);box-shadow:-8px 0 30px rgba(31,37,40,.12);
  overflow-y:auto;padding:20px;z-index:60;display:none}
.panel.open{display:block}
.panelhead{display:flex;justify-content:space-between;align-items:center;gap:10px}

/* ---------- toast ----------
   Also the app's only error channel, so it is a live region: a refused drag
   used to be announced to nobody. */
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:24px;background:var(--ink);
  color:#fff;padding:10px 18px;border-radius:10px;font-size:14px;display:none;z-index:100;
  max-width:min(80vw,560px);box-shadow:0 6px 24px rgba(31,37,40,.25)}
.toast.open{display:block}

/* ---------- dashboard tiles ---------- */
.tile .lab{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--ink-soft);font-weight:600}
.tile .big{font-size:22px;font-weight:700;line-height:1.2;margin-top:2px}
.tile .big.warn{color:var(--orange-ink)}
.tile .sub{font-size:12px;color:var(--ink-soft)}

/* ---------- one-up pages ----------
   The server-rendered confirm pages: redeem a board link, mark a next move
   done, resolve an inbound email. They arrive from an inbox, so they are one
   centred card with one obvious button and nothing else to do. */
body.oneup{display:flex;min-height:100vh;align-items:center;justify-content:center;padding:24px 16px}
body.oneup main{background:var(--white);border:var(--border);border-radius:var(--radius);
  padding:32px;max-width:520px;width:100%}
body.oneup .kicker{margin:0;color:var(--ink-soft)}
body.oneup h1{font-size:22px;line-height:1.2;margin:8px 0 14px}
body.oneup p{margin:0 0 12px}
body.oneup .fine{font-size:13px;color:var(--ink-soft)}
body.oneup fieldset{border:0;padding:0;margin:0}
body.oneup legend{padding:0}
body.oneup .choice{border:var(--border);border-radius:12px;padding:12px 14px;margin:10px 0}
body.oneup .choice > label{display:flex;gap:8px;align-items:center;margin:0;font-size:15px;
  text-transform:none;letter-spacing:0;font-weight:600}
body.oneup .btn{padding:11px 22px;font-size:15px}

/* ---------- misc ---------- */
code,.addr{font-family:var(--mono);font-size:.85em;background:var(--alabaster);
  padding:.1em .4em;border-radius:6px}
.addr{white-space:nowrap}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.01ms!important;scroll-behavior:auto!important}
}

/* Workspace surfaces */
[hidden]{display:none!important}
a{color:var(--ink);text-underline-offset:3px}
header.mast{min-height:76px;background:var(--white);color:var(--ink);border-bottom:var(--border);align-items:center;gap:18px}
header.mast .wordmark{font-size:13px;letter-spacing:.12em}
header.mast > .kicker{border-left:var(--border);padding-left:18px;font-size:18px;text-transform:none;letter-spacing:-.04em}
header.mast nav{gap:20px}
header.mast nav a{color:var(--ink-soft);opacity:1;font-size:13px;text-decoration:none;border:0;padding:8px 0}
header.mast nav a:hover,header.mast nav a[aria-current=page]{color:var(--ink);box-shadow:0 2px 0 var(--ink)}
header.mast nav button{color:var(--ink);border:var(--border);padding:8px 12px;border-radius:6px}
header.mast nav button:hover{background:var(--alabaster)}
header :focus-visible{outline-color:var(--focus)}
header.mast .who{font-size:12px;color:var(--ink-soft)}
.pageintro{padding:38px var(--gutter) 26px;display:flex;justify-content:space-between;align-items:center;gap:24px}
.pageintro h1{font-family:var(--serif);font-size:clamp(32px,3.3vw,48px);font-weight:400;letter-spacing:-.035em;line-height:1.15;margin:0 0 10px}
.pageintro p{color:var(--ink-soft);font-size:14px;margin:0;max-width:62ch}
.pageintro .eyebrow{font-size:11px;letter-spacing:.12em;text-transform:uppercase;margin-bottom:12px}
.btn{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:7px;font-size:13px}
.btn.primary{background:var(--ink);color:white}
.btn.primary:hover:not(:disabled){background:#38564c}
.btn.small{min-height:32px}
.chip{font-size:10px;letter-spacing:.01em;text-transform:none;border-color:var(--line);padding:2px 7px;background:var(--alabaster)}
.chip.lane-nb,.chip.lane-ex{background:transparent;border:0;padding:0;color:var(--ink-soft)}
.chip.rank{background:#edf1d9}
.flag{background:#fff0e4;color:#91390e;font-size:11px;padding:3px 6px}
.panel{width:min(540px,100vw);padding:28px}
.panel h2{font-family:var(--serif);font-size:29px;font-weight:400;line-height:1.2}
.panelhead{position:sticky;top:-28px;background:white;padding:12px 0;z-index:2}
.modal{border-radius:14px;padding:28px;max-height:90dvh;overflow:auto}
.modal h3{font-family:var(--serif);font-weight:400;font-size:28px;margin:0 0 18px}
.empty-state{text-align:center;padding:54px 24px;border:1px dashed var(--line);border-radius:12px;margin:24px var(--gutter);background:white}
.empty-state h2{font:400 28px var(--serif);margin:0 0 10px}
.empty-state p{color:var(--ink-soft);max-width:45ch;margin:0 auto 22px;font-size:14px}
.error-note{color:#91390e;background:#fff0e4;border-radius:8px;padding:12px;font-size:14px}
@media(max-width:768px){
 header.mast{padding:16px 20px;gap:12px;min-height:0}
 header.mast .spacer{flex:1;flex-basis:auto}
 header.mast nav{flex-basis:100%;gap:20px}
 header.mast .who{margin-left:auto}
 .pageintro{padding-top:28px;align-items:flex-start}
 .pageintro h1{font-size:34px}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px;min-height:44px}
 .btn{min-height:44px}
 .panel{padding:20px}.panelhead{top:-20px}
}
.optional-fields{border-top:var(--border);border-bottom:var(--border);padding:14px 0;margin:20px 0;font-size:13px}
.optional-fields summary{cursor:pointer}.optional-fields[open]{padding-bottom:20px}
