/* First lifted from comms-console.html (v0.6) by scripts/lift-design.mjs. Since 20 Nov 2026 the design is the
   prototype Michael approved on 19 and 20 Nov (docs/portal-uplift-2026-11-20/spec/index.html): Geist, paper, ink pill
   buttons with amber text, hairlines, no lifted shadows. It wins wherever the two disagree. Do not lift again. */
/* Blocks 1-3: lines 6-228 */
/* REQOPS Governance design system · v0.5 (draft for review, 2026-10-13)
   Source of truth: the brand at reqops.com — amber, warm ink, cream, the dark console
   panel, the open ring, ink pills. v0.5 is the type pass: the sans for the interface and
   everything people read, the mono only for ids, codes, times and raw logs; brighter
   secondary text; almost no tracking on small text; app headings at working size.
   v0.3 is the calm pass: quiet neutral surfaces, hairlines, less tracking, amber only for the
   one primary action and the dot on what needs you. The theme follows the OS until the toggle
   picks Night (the site's console panel) or Paper (a soft cream). v0.4 (review fixes): --faint is never used for text, busy
   buttons keep their label, disabled buttons stay readable, and every component can be drawn
   as a static specimen (.is-on, .is-busy, .is-disabled, .sort, .menu-item).

   Structure follows the product repo's CLAUDE.md § Theme so it can be lifted into the three
   theme files later:
     1. bare :root                          theme-independent tokens
     2. :root, :root[data-theme="dark"]     night (default)
     3. :root[data-theme="light"]           paper
   Components below use tokens only. No colour literal appears after the token blocks. */

/* ---------- 1. theme-independent ---------- */
:root {
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* the prototype's own names (docs/portal-uplift-2026-11-20/spec/index.html :root), so its CSS can be copied as it is */
  --sans: var(--font-sans);
  --mono: var(--font-mono);

  /* type (the approved prototype, 20 Nov 2026): Geist for everything people read, 15px/1.5 body, 36px/600 page
     titles, 17px ledes, 12px uppercase labels in the sans. Geist Mono only for times, codes and links. */
  --fs-label: 12px;   /* the uppercase label (.lbl, the prototype's .eyebrow and .tagl) */
  --fs-body: 15px;    /* what people read */
  --fs-xs: 12.5px;
  --fs-sm: 13.5px;
  --fs-md: 14.5px;    /* interface: navigation, rows, tables */
  --fs-lg: 15px;      /* findings, explanations, body text */
  --fs-xl: 17px;      /* a lede */
  --fs-code: 13px;    /* ids, codes, times (mono) */
  --fs-input: 16px;   /* what people type (the prototype's .inp), never zoomed on a phone */
  --fs-h3: 18px;      /* section and card headings (the prototype's .h2row h2) */
  --fs-h2: 28px;      /* a heading inside a page, and the page title on a phone */
  --fs-card: 22px;    /* a card's own heading (the prototype's .card h2) */
  --fs-title: 36px;   /* the page title (the prototype's h1) */
  --fs-h1: 36px;
  --fs-display: 56px; /* marketing and cover headlines only, never inside the app */
  --fs-num: 48px;     /* headline figures */
  --lh-ui: 1.5;
  --lh-read: 1.55;
  --lh-head: 1.1;
  --tr-head: -0.02em;
  --tr-display: -0.035em;
  --tr-tag: 0.04em;
  --tr-label: 0.04em; /* the uppercase label */
  --tr-title: -0.035em; /* page titles */
  --tr-chip: 0em;
  --fw-title: 600;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-strong: 600;
  --fw-heavy: 700;

  /* spacing, 4-based */
  --sp-0: 2px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;
  --sp-10: 72px;

  /* radius: 10px fields, 12px cards and menus, 16px dialogs; buttons and chips are pills */
  --r-chip: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-frame: 16px;
  --r-pill: 99px;

  /* control sizes: the prototype's buttons are 44px, small ones 36px; chips 32px */
  --ctl-h-sm: 32px;
  --ctl-h-md: 36px;
  --ctl-h-lg: 44px;
  --row-h: 52px;

  /* layout: a top bar, the page centred under it (720px a task, 1140px wide), and a job's side panel */
  --header-h: 56px;
  --side-w: 300px;     /* a job's side panel */
  --content-max: 1140px;
  --content-narrow: 720px;
  --gutter: 16px;
  --rail-w: 232px;     /* kept for any page that still reads it; the shell has no left rail since 20 Nov */
  --steps-w: 168px;

  /* motion: short and even; nothing lifts or bounces */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-panel: 240ms;

  /* the brand surface: amber with the dot grid (sign-in and brand moments only) */
  --amber: #f4a259;
  --brand-ink: #231e1e;
  --brand-dot: rgba(35, 30, 30, 0.13);
  /* the prototype's other names for the paper colours, so its CSS reads the same here */
  --ink2: var(--ink-soft);
  --line2: var(--line-strong);
  --amber-wash: var(--warn-soft);
  --amber-ink: var(--warn);
}

/* ---------- 2. night (default): the site's console panel ---------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17130e;
  --bg-elevated: #1f1a15;
  --surface: #1c1813;
  --well: #12100c;
  --hover: rgba(235, 228, 217, 0.04);
  --pressed: rgba(235, 228, 217, 0.07);

  --ink: #ebe4d9;
  --ink-soft: #d3cbbe;
  --muted: #ada08e;
  --faint: #6f665a; /* icons and edges only, never text */
  --line: #29231d;
  --line-strong: #433b31;

  /* amber: the one primary action, and the dot on what needs you */
  --action: #f4a259;
  --action-hover: #f6b175;
  --on-action: #231e1e;
  --signal: #f4a259;

  --ok: #8fbf9a;
  --ok-soft: #1b241d;
  --warn: #f4a259;
  --warn-dot: #f4a259;
  --warn-soft: #2b2118;
  --bad: #e38b77;
  --bad-soft: #2c1c17;
  --info: #a7b6cc;
  --info-soft: #1c2029;

  --focus: #ebe4d9;
  --scrim: rgba(10, 8, 6, 0.6);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 24px 60px rgba(0, 0, 0, 0.5);
  --skeleton-a: #1f1a15;
  --skeleton-b: #29231d;
  --selection-bg: #f4a259;
  --selection-fg: #231e1e;
  --panel: #17130e;   /* the page under the menu: the same as --bg on night */

  /* charts (validated, see validation/charts.txt) */
  --series-1: #6a84d4;
  --series-2: #c4643f;
  --series-3: #2a9f84;
  --series-4: #7776cc;
  --series-5: #cc6680;
  --series-6: #3a9cc0;
  --series-7: #7a9a40;
  --series-8: #a46aa9;
  --seq-1: #2b2118;
  --seq-2: #6b4424;
  --seq-3: #a8652e;
  --seq-4: #f4a259;
  --seq-5: #fbd3a6;
  --div-neg: #c4643f;
  --div-mid: #362f27;
  --div-pos: #6a84d4;
  --chart-grid: #29231d;
  --chart-axis: #433b31;
}

/* ---------- 3. paper: soft cream, ink, amber kept for the brand moment ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbf7f1;
  --bg-elevated: #fffdf9;
  --surface: #fffefb;
  --well: #f3ece2;
  --hover: rgba(35, 30, 30, 0.04);
  --pressed: rgba(35, 30, 30, 0.065);

  --ink: #231e1e;
  --ink-soft: #3f3834;
  --muted: #5a534d;
  --faint: #948a81; /* icons and edges only, never text */
  --line: #ece4d8;
  --line-strong: #d9cdbd;

  /* on paper the action is the site's ink pill with amber text */
  --action: #231e1e;
  --action-hover: #3a3230;
  --on-action: #f4a259;
  --signal: #e0893a;

  --ok: #2f6b48;
  --ok-soft: #e6efe5;
  --warn: #8a5418;
  --warn-dot: #e0893a;
  --warn-soft: #f8eadb;
  --bad: #a23b28;
  --bad-soft: #f8e4dd;
  --info: #3d5a84;
  --info-soft: #e7ecf3;

  --focus: #231e1e;
  --scrim: rgba(35, 30, 30, 0.3);
  --shadow-1: 0 1px 2px rgba(35, 30, 30, 0.05);
  --shadow-2: 0 12px 32px rgba(35, 30, 30, 0.12);
  --shadow-3: 0 24px 60px rgba(35, 30, 30, 0.2);
  --skeleton-a: #f3ece2;
  --skeleton-b: #fbf7f1;
  --selection-bg: #231e1e;
  --selection-fg: #fbf7f1;
  --panel: #fbf7f1;   /* paper: the page and the bar are one colour, cards sit on it in --surface (20 Nov 2026) */

  --series-1: #3d65b0;
  --series-2: #b4532f;
  --series-3: #0f8f74;
  --series-4: #4b4aa0;
  --series-5: #c8506a;
  --series-6: #1f86a8;
  --series-7: #5f7f2a;
  --series-8: #8a4f8f;
  --seq-1: #f8eadb;
  --seq-2: #f4a259;
  --seq-3: #c8762f;
  --seq-4: #7d4a17;
  --seq-5: #3a2410;
  --div-neg: #b4532f;
  --div-mid: #efe6da;
  --div-pos: #3d65b0;
  --chart-grid: #ece4d8;
  --chart-axis: #d9cdbd;
}

/* ---------- 4. follow the OS: lines 679-741 ---------- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
  color-scheme: light;
  --bg: #fbf7f1;
  --bg-elevated: #fffdf9;
  --surface: #fffefb;
  --well: #f3ece2;
  --hover: rgba(35, 30, 30, 0.04);
  --pressed: rgba(35, 30, 30, 0.065);

  --ink: #231e1e;
  --ink-soft: #3f3834;
  --muted: #5a534d;
  --faint: #948a81; /* icons and edges only, never text */
  --line: #ece4d8;
  --line-strong: #d9cdbd;

  /* on paper the action is the site's ink pill with amber text */
  --action: #231e1e;
  --action-hover: #3a3230;
  --on-action: #f4a259;
  --signal: #e0893a;

  --ok: #2f6b48;
  --ok-soft: #e6efe5;
  --warn: #8a5418;
  --warn-dot: #e0893a;
  --warn-soft: #f8eadb;
  --bad: #a23b28;
  --bad-soft: #f8e4dd;
  --info: #3d5a84;
  --info-soft: #e7ecf3;

  --focus: #231e1e;
  --scrim: rgba(35, 30, 30, 0.3);
  --shadow-1: 0 1px 2px rgba(35, 30, 30, 0.05);
  --shadow-2: 0 12px 32px rgba(35, 30, 30, 0.12);
  --shadow-3: 0 24px 60px rgba(35, 30, 30, 0.2);
  --skeleton-a: #f3ece2;
  --skeleton-b: #fbf7f1;
  --selection-bg: #231e1e;
  --selection-fg: #fbf7f1;
  --panel: #fbf7f1;   /* paper: the page and the bar are one colour, cards sit on it in --surface (20 Nov 2026) */

  --series-1: #3d65b0;
  --series-2: #b4532f;
  --series-3: #0f8f74;
  --series-4: #4b4aa0;
  --series-5: #c8506a;
  --series-6: #1f86a8;
  --series-7: #5f7f2a;
  --series-8: #8a4f8f;
  --seq-1: #f8eadb;
  --seq-2: #f4a259;
  --seq-3: #c8762f;
  --seq-4: #7d4a17;
  --seq-5: #3a2410;
  --div-neg: #b4532f;
  --div-mid: #efe6da;
  --div-pos: #3d65b0;
  --chart-grid: #ece4d8;
  --chart-axis: #d9cdbd;
}
}

/* ---------- 5. Amber: the ReqOps brand as its own theme (the design, 1 Nov) ----------
   An amber page, cream sheets and ink pills. It sits on paper (data-theme="light") and adds data-brand="amber".
   Screen only: print stays on paper. */
@media screen {
  :root[data-brand="amber"] {
  --bg: #f4a259;
  --bg-elevated: #fff3e2;
  --surface: #fff3e2;
  --well: #fbe2c5;
  --hover: rgba(35, 30, 30, 0.06);
  --pressed: rgba(35, 30, 30, 0.1);
  --ink: #231e1e;
  --ink-soft: #352c28;
  --muted: #4f4136;
  --faint: #6b5a4a;
  --line: rgba(35, 30, 30, 0.16);
  --line-strong: rgba(35, 30, 30, 0.32);
  --action: #231e1e;
  --action-hover: #3a3230;
  --on-action: #f4a259;
  --signal: #231e1e;
  --ok: #1f5236;
  --warn: #5f3608;
  --warn-dot: #231e1e;
  --bad: #7f2414;
  --info: #2b4469;
  --amber: #231e1e;
  }
}
