/* ─────────────────────────────────────────────────────────────────────────────
   Dime WF — shared design style sheet (W-71, 2026-10-27)

   THE ONE PLACE A COLOUR, FONT OR RADIUS IS DEFINED for every new or restyled
   page on the site. The rules that go with it are in docs/DESIGN.md; the visual
   reference is /design/ (not linked from the landing page, no sign-in, no data).

   ALL COLOUR LIVES IN :root, BELOW. Every component class further down is
   built from var(--…) only — no hex outside :root, and tools/design-tests.js
   fails if one appears. That is what makes the brand swappable: another shop
   re-skins by changing the token values, never by rebuilding a page.

   Fonts are NOT imported here (an @import inside a style sheet is a second
   round trip before any text draws). A page links them itself, in its <head>:

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,500;8..60,600&display=swap">
     <link rel="stylesheet" href="/assets/dime-design.css">

   Status on 10/27: the WIP Board (/wip/) loads this file — W-72, the first
   screen moved over — the hub (/) since W-73 and File Compare (/file-compare/)
   since W-74. The station follows (W-75); every other page still wears the old
   look until its own session.
   ───────────────────────────────────────────────────────────────────────────── */

:root{
  /* ── Base ── */
  --ink:#062B3A;          /* headings, primary text, primary buttons */
  --muted:#566C7C;        /* secondary text — on --surface, --bg, --sunk ONLY (4.86:1+) */
  --muted-on-wash:#3D5260;/* secondary text on a day band or wash (W-72): --muted drops under 4.5:1 there */
  --bg:#FCFAF8;           /* page */
  --surface:#FFFFFF;      /* cards */
  --sunk:#F4F1EC;         /* wells, chips */
  --line:#E6E1DA;
  --line-soft:#F0EBE4;
  --line-strong:#CFC8BE;  /* secondary button border */
  --late-text:#B4182D;
  --on-ink:#FFFFFF;       /* text on an --ink fill */
  --shadow-raise:0 1px 2px rgba(6,43,58,.12);   /* the selected tab, a pinned bar */
  /* W-72 · the two the board needed: a panel that floats over the page (the
     ticket viewer, a dialog, the ⋯ menu, a toast) and the dimmed page behind a
     dialog. Both are ink at low strength, so they re-skin with --ink's family. */
  --shadow-pop:0 12px 32px rgba(6,43,58,.22);
  --scrim:rgba(6,43,58,.45);
  /* a job card inside its day block (W-72, PR #97 walk): a soft lift so the gap
     between two cards reads, never a hard line */
  --shadow-card:0 1px 2px rgba(6,43,58,.14), 0 0 0 1px rgba(6,43,58,.06);

  /* ── Prism accents (the Prisma logo) — fills, dots and rules, never body text ── */
  --cyan:#00A2E0;
  --yellow:#F2B705;
  --lime:#C5D300;
  --red:#D7263D;
  --blue:#2A4EEF;

  /* ── Status pills: background / text / dot ── */
  --st-production-bg:#E3F5FC; --st-production-fg:#04587A; --st-production-dot:#00A2E0;
  --st-proof-bg:#C2185B;      --st-proof-fg:#FFFFFF;      --st-proof-dot:#FFFFFF;
  --st-received-bg:#EEF1F3;   --st-received-fg:#3D5260;   --st-received-dot:#566C7C;
  --st-hold-bg:#FDE8EA;       --st-hold-fg:#A1162A;       --st-hold-dot:#D7263D;
  --st-finished-bg:#F2F6CC;   --st-finished-fg:#4D5300;   --st-finished-dot:#C5D300;

  /* W-79 (10/28, Ryan): Out on proof is the ONE SOLID status pill — magenta, white text,
     white dot. As a pale blue it read as In production's twin on every day colour; a job
     waiting on a customer is the status someone has to chase, so it is the one that
     stands out. White on #C2185B is 5.87:1. Keep it the only solid pill (docs/DESIGN.md). */
  /* A light pill on a strong wash (the cyan In production pill on a Monday row) needs an
     edge to stay a pill: one thin ink-tinted line, drawn inside so nothing moves (W-72). */
  --pill-line:rgba(6,43,58,.22);

  /* An information note inside a dialog (the board's .locked-note): the pale blue the proof
     pill wore until W-79, kept as its own pair so the note did not turn magenta with it. */
  --note-bg:#ECEFFE;          --note-fg:#1F3BC0;

  /* ── Flags ── */
  --flag-attn-bg:#FFE08A;    --flag-attn-fg:#5C3F00;    --flag-attn-line:#D9A300;
  --flag-neutral-bg:#EEF1F3; --flag-neutral-fg:#3D5260;

  /* ── Day colours — a FIXED weekly set: header band / row wash / date chip ──
     Strengthened 10/27 (W-72, Ryan on the walk: "colour has to read at a glance"). The
     washes are the live board's own row colours (its old --day1..--day4 and --past), on
     purpose — the shop already reads those; the bands are a step stronger. Text on a band
     or wash is --ink, or --muted-on-wash for secondary text — never --muted. */
  --day-mon-band:#B3D1FF; --day-mon-wash:#CFE3FF; --day-mon-chip:#7FA2EE;
  --day-tue-band:#FFE57A; --day-tue-wash:#FFF3B0; --day-tue-chip:#F2B705;
  --day-wed-band:#A6EBA1; --day-wed-wash:#C8F7C5; --day-wed-chip:#8CC56B;
  --day-thu-band:#9FE3DB; --day-thu-wash:#C4F0EB; --day-thu-chip:#4DBFB3;
  --day-fri-band:#D3BFFF; --day-fri-wash:#E6D9FF; --day-fri-chip:#A98BDB;
  --day-wkd-band:#D8D0C4; --day-wkd-wash:#E9E4DC; --day-wkd-chip:#B5ACA0;   /* Sat + Sun */
  --day-late-band:#FFC4C4; --day-late-wash:#FFE1E1; --day-late-chip:#D7263D; /* late / on hold — overrides the day */
  /* The late chip's text is WHITE, not ink: ink on #D7263D is 2.99:1 and fails the
     4.5:1 rule; white is 4.96:1. Every other chip keeps ink (5.23:1 and up). */
  --day-late-chip-fg:#FFFFFF;

  /* ── Behind the artwork (W-89) — File Compare's viewer, close-up, overlay and blink.
     --art-bg / --art-bg-alt are the checkerboard the page sits on (the old --sunk / --bg
     pair, so light mode is unchanged); --art-paper is the white a transparent image sits
     on and --art-ink the dark stripe of a difference outline. Both stay the SAME in dark
     mode on purpose: the art is never recoloured, and what is drawn ON it must not invert. */
  --art-bg:#F4F1EC; --art-bg-alt:#FCFAF8; --art-paper:#FFFFFF; --art-ink:#062B3A;

  /* ── Type ── */
  --font-title:"Source Serif 4", Georgia, "Times New Roman", serif;   /* page titles + hub headline ONLY */
  --font-ui:"Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-hub:44px;
  --fs-title:34px;
  --fs-section:16px;
  --fs-job:17px;
  --fs-body:15px;
  --fs-body-sm:14px;
  --fs-meta:13px;
  --fs-meta-sm:12px;
  --fs-label:11px;
  --fw-body:400;            /* body text weight: 400 here, 500 in dark mode (W-89, Ryan 11/7) */
  --track-label:.08em;

  /* ── Shape ── */
  --r-card:16px;
  --r-day:14px;
  --r-input:10px;
  --r-toggle:8px;          /* the ☾ / ☀ light / dark pill (W-100) */
  --r-pill:999px;          /* buttons, pills, tabs */
  --tap:36px;              /* minimum control height; 44px on a tablet (below) */
  --tap-tablet:44px;
}

/* Tablets and station screens: every control is a 44px target. A coarse pointer
   (a finger) gets it automatically; a station page can force it with .dd-tablet on
   <html> or <body> whatever the browser reports. */
/* ═══ DARK MODE (W-89, 2026-11-06) ═══════════════════════════════════════════════
   A dark value for EVERY colour token, here beside the light set and nowhere else.
   OPT-IN ONLY: a page goes dark when its <html> carries data-dark-ok AND
   /assets/theme.js has set data-theme="dark" (the device setting, or the person's
   sun/moon choice). Phase 1 opts in the hub, /am/, /am/ticket-helper/ and
   /file-compare/. Every other page — the WIP board, the station, the lobby,
   Inventory, Materials — has no data-dark-ok and stays light whatever the setting.
   .dd-dark applies the same values to one part of a page (how /design/ shows both).
   Rules held by tools/design-tests.js: every text pair 4.5:1 in dark as in light;
   the prism accents and the solid proof pill 3:1 against what they sit on. In dark the
   proof pill is the one BRIGHT pill (dark text on pink) — still the one that stands out.
   The weekday colours are a first dark set; they meet the contrast rule but nothing
   uses them dark until phase 2 (the WIP board). */
:root[data-dark-ok][data-theme="dark"], .dd-dark{
  color-scheme:dark;
  /* Ryan's walk 11/7: light text on dark reads thinner than the same text on light, so
     body text is one weight heavier in dark (400 → 500). Titles, labels and anything
     already 600+ set their own weight and are unchanged. */
  --fw-body:500;
  font-weight:var(--fw-body);
  --ink:#F2F5F7; --muted:#B8C7D1; --muted-on-wash:#D0DAE1;   /* brighter — Ryan's walk 11/7 */
  --bg:#0D1A20; --surface:#14232B; --sunk:#1B2D36;
  --line:#29404B; --line-soft:#20343E; --line-strong:#3D5664;
  --late-text:#FF8F99; --on-ink:#0D1A20;
  --shadow-raise:0 1px 2px rgba(0,0,0,.5);
  --shadow-pop:0 12px 32px rgba(0,0,0,.55);
  --scrim:rgba(0,0,0,.6);
  --shadow-card:0 1px 2px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.06);
  --cyan:#2DB8EE; --yellow:#F5C842; --lime:#D2DF3A; --red:#F05468; --blue:#6E8BFF;
  --st-production-bg:#0E3A4E; --st-production-fg:#A6E1F8; --st-production-dot:#2DB8EE;
  --st-proof-bg:#F27AAE; --st-proof-fg:#2A0516; --st-proof-dot:#2A0516;
  --st-received-bg:#263640; --st-received-fg:#C6D2DA; --st-received-dot:#9DB0BD;
  --st-hold-bg:#4C1720; --st-hold-fg:#FFB8C0; --st-hold-dot:#F05468;
  --st-finished-bg:#333A0A; --st-finished-fg:#E2EC86; --st-finished-dot:#D2DF3A;
  --pill-line:rgba(255,255,255,.16);
  --note-bg:#1D2A57; --note-fg:#B9C6FF;
  --flag-attn-bg:#4B3A05; --flag-attn-fg:#FFE18F; --flag-attn-line:#E0AE1A;
  --flag-neutral-bg:#263640; --flag-neutral-fg:#C6D2DA;
  --day-mon-band:#1F3557; --day-mon-wash:#182B47; --day-mon-chip:#3A5FA8;
  --day-tue-band:#4A3D0A; --day-tue-wash:#3A300A; --day-tue-chip:#7A6210;
  --day-wed-band:#1E4420; --day-wed-wash:#183719; --day-wed-chip:#3B6E33;
  --day-thu-band:#13423D; --day-thu-wash:#113632; --day-thu-chip:#237068;
  --day-fri-band:#36285A; --day-fri-wash:#2C2149; --day-fri-chip:#5A44A0;
  --day-wkd-band:#3A342C; --day-wkd-wash:#2F2A24; --day-wkd-chip:#6A6156;
  --day-late-band:#561C22; --day-late-wash:#43161B; --day-late-chip:#D7263D;
  --day-late-chip-fg:#FFFFFF;
  --art-bg:#383C40; --art-bg-alt:#323538; --art-paper:#FFFFFF; --art-ink:#062B3A;
}

/* Placeholder text in dark mode: --muted, fully opaque — visibly dimmer than typed text
   (ink), still readable. Light mode keeps the browser's own placeholder, unchanged. */
:root[data-dark-ok][data-theme="dark"] ::placeholder, .dd-dark ::placeholder{ color:var(--muted); opacity:1; }

@media (pointer:coarse){ :root{ --tap:var(--tap-tablet); } }
.dd-tablet{ --tap:var(--tap-tablet); }

/* ── Page base ── */
*,*::before,*::after{ box-sizing:border-box; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font-ui);
  font-size:var(--fs-body);
  font-weight:var(--fw-body);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

/* ── Type ── */
.t-hub,.t-title{ font-family:var(--font-title); color:var(--ink); margin:0; letter-spacing:-.01em; }
.t-hub{ font-size:var(--fs-hub); font-weight:600; line-height:1.1; }
.t-title{ font-size:var(--fs-title); font-weight:500; line-height:1.15; }
.t-section{ font-size:var(--fs-section); font-weight:700; line-height:1.3; margin:0; }
.t-job{ font-size:var(--fs-job); font-weight:700; font-variant-numeric:tabular-nums; }
.t-body{ font-size:var(--fs-body); }
.t-body-sm{ font-size:var(--fs-body-sm); }
.t-meta{ font-size:var(--fs-meta); color:var(--muted); }
.t-meta-sm{ font-size:var(--fs-meta-sm); color:var(--muted); }
.t-label{ font-size:var(--fs-label); font-weight:600; text-transform:uppercase; letter-spacing:var(--track-label); color:var(--muted); }
.num{ font-variant-numeric:tabular-nums; }   /* job #, dates, quantities */
.t-late{ color:var(--late-text); }

/* ── Buttons ── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:var(--tap); padding:0 18px;
  border-radius:var(--r-pill);
  border:1px solid var(--line-strong);
  background:var(--surface); color:var(--ink);
  font:600 var(--fs-body-sm)/1 var(--font-ui);
  text-decoration:none; cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.btn:hover{ background:var(--sunk); }
.btn:focus-visible,.tab:focus-visible{ outline:2px solid var(--cyan); outline-offset:2px; }
.btn:disabled,.btn[aria-disabled="true"]{ opacity:.5; cursor:not-allowed; }
.btn-primary{ background:var(--ink); border-color:var(--ink); color:var(--on-ink); }
.btn-primary:hover{ background:var(--ink); opacity:.9; }

/* ── Pill tabs ── */
.tabs{ display:inline-flex; flex-wrap:wrap; gap:4px; padding:4px; background:var(--sunk); border-radius:var(--r-pill); }
.tab{
  display:inline-flex; align-items:center; gap:6px;
  min-height:var(--tap); padding:0 16px;
  border:0; border-radius:var(--r-pill);
  background:transparent; color:var(--muted);
  font:600 var(--fs-body-sm)/1 var(--font-ui);
  cursor:pointer; text-decoration:none;
}
.tab:hover{ color:var(--ink); }
.tab-on,.tab-on:hover{ background:var(--surface); color:var(--ink); box-shadow:var(--shadow-raise); }

/* ── Status pills — status is always a pill, never a row background ── */
.pill{
  --pill-bg:var(--st-received-bg); --pill-fg:var(--st-received-fg); --pill-dot:var(--st-received-dot);
  display:inline-flex; align-items:center; gap:6px;
  padding:3px 10px 3px 8px;
  border-radius:var(--r-pill);
  background:var(--pill-bg); color:var(--pill-fg);
  font:600 var(--fs-meta-sm)/1.4 var(--font-ui);
  white-space:nowrap;
}
.pill{ box-shadow:inset 0 0 0 1px var(--pill-line); }
.pill::before{ content:""; width:7px; height:7px; border-radius:50%; background:var(--pill-dot); flex:none; }
.pill-production{ --pill-bg:var(--st-production-bg); --pill-fg:var(--st-production-fg); --pill-dot:var(--st-production-dot); }
.pill-proof     { --pill-bg:var(--st-proof-bg);      --pill-fg:var(--st-proof-fg);      --pill-dot:var(--st-proof-dot); }
.pill-received  { --pill-bg:var(--st-received-bg);   --pill-fg:var(--st-received-fg);   --pill-dot:var(--st-received-dot); }
.pill-hold      { --pill-bg:var(--st-hold-bg);       --pill-fg:var(--st-hold-fg);       --pill-dot:var(--st-hold-dot); }
.pill-finished  { --pill-bg:var(--st-finished-bg);   --pill-fg:var(--st-finished-fg);   --pill-dot:var(--st-finished-dot); }

/* ── Flags ── */
.flag{
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 8px;
  border-radius:var(--r-pill);
  font:700 var(--fs-label)/1.5 var(--font-ui);
  text-transform:uppercase; letter-spacing:var(--track-label);
  white-space:nowrap;
}
.flag-attn{ background:var(--flag-attn-bg); color:var(--flag-attn-fg); box-shadow:inset 0 0 0 1px var(--flag-attn-line); }
.flag-neutral{ background:var(--flag-neutral-bg); color:var(--flag-neutral-fg); box-shadow:inset 0 0 0 1px var(--pill-line); }

/* ── Card ── */
.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-card);
  padding:20px;
}

/* ── KPI tile ── */
.kpi{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--r-card);
  padding:16px 18px;
  display:flex; flex-direction:column; gap:4px;
}
.kpi-label{ font-size:var(--fs-label); font-weight:600; text-transform:uppercase; letter-spacing:var(--track-label); color:var(--muted); }
.kpi-value{ font-size:var(--fs-title); font-weight:700; line-height:1.1; font-variant-numeric:tabular-nums; color:var(--ink); }
.kpi-note{ font-size:var(--fs-meta); color:var(--muted); }
.kpi-late .kpi-value{ color:var(--late-text); }

/* ── Day groups — day colour is GROUPING only. Each day is its own rounded group:
      a header band, its rows on the wash, and a date chip in the header.
      Late / on hold overrides the weekday (.day-late wins whatever the order). ── */
.day-group{
  --day-band:var(--day-wkd-band); --day-wash:var(--day-wkd-wash);
  --day-chip:var(--day-wkd-chip); --day-chip-fg:var(--ink);
  border-radius:var(--r-day);
  overflow:hidden;
  background:var(--day-wash);
  border:1px solid var(--line-soft);
}
.day-group + .day-group{ margin-top:14px; }
.day-mon{ --day-band:var(--day-mon-band); --day-wash:var(--day-mon-wash); --day-chip:var(--day-mon-chip); }
.day-tue{ --day-band:var(--day-tue-band); --day-wash:var(--day-tue-wash); --day-chip:var(--day-tue-chip); }
.day-wed{ --day-band:var(--day-wed-band); --day-wash:var(--day-wed-wash); --day-chip:var(--day-wed-chip); }
.day-thu{ --day-band:var(--day-thu-band); --day-wash:var(--day-thu-wash); --day-chip:var(--day-thu-chip); }
.day-fri{ --day-band:var(--day-fri-band); --day-wash:var(--day-fri-wash); --day-chip:var(--day-fri-chip); }
.day-sat,
.day-sun{ --day-band:var(--day-wkd-band); --day-wash:var(--day-wkd-wash); --day-chip:var(--day-wkd-chip); }
.day-group.day-late{
  --day-band:var(--day-late-band); --day-wash:var(--day-late-wash);
  --day-chip:var(--day-late-chip); --day-chip-fg:var(--day-late-chip-fg);
}
.day-head{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:10px 14px;
  background:var(--day-band);
  color:var(--ink);                 /* ink, never --muted: muted on a band can fall under 4.5:1 */
}
.day-head .t-section{ color:var(--ink); }
.day-count{ margin-left:auto; font-size:var(--fs-meta); font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums; }
.day-chip{
  display:inline-flex; align-items:center;
  padding:3px 10px;
  border-radius:var(--r-pill);
  background:var(--day-chip); color:var(--day-chip-fg);
  font:700 var(--fs-meta)/1.4 var(--font-ui);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.day-row{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  padding:10px 14px;
  border-top:1px solid var(--line-soft);
  background:var(--day-wash);
  color:var(--ink);
}
.day-row .t-meta,.day-row .t-meta-sm{ color:var(--muted-on-wash); }   /* --muted fails on the stronger washes */

/* ── The light / dark switch (W-89; a ☾ / ☀ pill since W-100, Ryan 11/8) — in the header of
      every dark-mode page. ONE pill shows BOTH icons, moon / sun: the CURRENT mode's icon at full
      strength, the other dimmed, so the pill says which mode you are in. A press anywhere on it
      switches; /assets/theme.js wires it and keeps the tooltip ("Switch to dark mode" / "…light…").
      White (--surface) in light, the dark surface in dark — the same token. Its height is the
      Feedback button beside it (--tap, or the 36px a header's .fb-btn is held to). ── */
.btn.theme-btn{
  width:auto; min-width:0; flex:none;
  padding:0 10px; gap:6px;
  border-radius:var(--r-toggle);
  border:1px solid var(--line-strong);
  background:var(--surface); color:var(--ink);
}
.btn.theme-btn:hover{ background:var(--sunk); }
.fb-btn + .btn.theme-btn{ min-height:36px; }
.theme-btn svg{ display:block; flex:none; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.theme-btn .ti-moon{ order:1; }
.theme-btn::before{ content:"/"; order:2; color:var(--muted); font-weight:400; font-size:var(--fs-body-sm); line-height:1; opacity:.6; }
.theme-btn .ti-sun{ order:3; }
/* light: the sun is the mode you are in */
.theme-btn .ti-moon{ opacity:.4; }
.theme-btn .ti-sun{ opacity:1; }
/* dark: the moon is */
:root[data-dark-ok][data-theme="dark"] .theme-btn .ti-moon{ opacity:1; }
:root[data-dark-ok][data-theme="dark"] .theme-btn .ti-sun{ opacity:.4; }
/* /design/ shows the switch inside its .dd-dark block too, drawn the dark way there. */
.dd-dark .theme-btn .ti-moon{ opacity:1; }
.dd-dark .theme-btn .ti-sun{ opacity:.4; }
