/* ============================================================
   Civicsmith · the visual language (design phase step 4, DEC-138)
   GENERATED by build.py from palette.json (colors) + tokens.head.css + components.css.
   Edit those, never this file. One system for every member screen and the published case,
   replacing civicos-ui/tokens.css, the action-design sketches' look and the measures map's
   placeholders. Faces: faces.css (shipped inside the group's copy, principle 9.6).

   The system's rules:
   1. Color always means something. Verdigris (the patina on a brass plumb bob) is the one
      color for acting and for Civicsmith itself; rust is attention only (a clock, a change,
      a refusal, something visible outside the group); each evidence scale has its own hue;
      machine work and another group's work carry no hue and are told apart by edge, mark
      and word.
   2. Three voices in type: serif for words people wrote (the group's questions, findings and
      cases; passages quoted from documents), sans for Civicsmith's own words, mono only for
      identifiers machines check (fingerprints, short names, receipt numbers).
   3. Rules before shadows; corners nearly square, like a printed form; no pill shapes.
   4. Nothing moves unless the member needs to act (principle 7.2).
   5. Every color has a word or an icon beside it (principle 8.2); WCAG 2.2 AA in both themes
      (check_contrast.py).
   ============================================================ */

:root {
  --c-ground: #EDEFE9;
  --c-ground-2: #E3E7DF;
  --c-surface: #F8F9F5;
  --c-sheet: #FDFDFB;
  --c-ink: #15222C;
  --c-ink-2: #334149;
  --c-muted: #55635E;
  --c-rule: #C3C9BE;
  --c-rule-strong: #7E877C;
  --c-accent: #2B6A5D;
  --c-accent-strong: #1D4E44;
  --c-accent-tint: #E2EEE9;
  --c-on-accent: #FFFFFF;
  --c-signal: #A23B19;
  --c-signal-tint: #F7E9E2;
  --c-capture: #1F5C9E;
  --c-capture-tint: #E3ECF7;
  --c-connection: #8A2F6E;
  --c-connection-tint: #F4E4EF;
  --c-testimony: #865300;
  --c-testimony-tint: #F7ECD9;
  --c-subject: #55621A;
  --c-subject-tint: #EDF0DC;
  --c-stage: #3A587F;
  --c-ready: #2E6E4A;
  --c-ident: #9B3355;
  --c-machine: #4A5560;
  --c-machine-tint: #ECEEF0;
  --c-elsewhere: #4B4F7A;
  --c-elsewhere-tint: #E8E9F2;
  --c-focus: #1D4E44;
  --c-kind-money: #773AC1;
  --c-kind-part: #0092C3;
  --c-kind-mention: #DF407F;
  color-scheme: light;

  /* type: the three voices */
  --f-serif: "Civicsmith Serif", "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-sans: "Civicsmith Sans", "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Civicsmith Mono", "Source Code Pro", ui-monospace, Menlo, Consolas, monospace;
  --t-xs: 0.8125rem;   /* 13px: labels, marks, eyebrows */
  --t-sm: 0.875rem;    /* 14px: secondary lines */
  --t-md: 1rem;        /* 16px: the working default; never smaller in a field */
  --t-lg: 1.125rem;    /* 18px: published body; a record's lines */
  --t-xl: 1.3125rem;   /* 21px: a record's title */
  --t-2xl: 1.625rem;   /* 26px: a page title */
  --t-3xl: 2.125rem;   /* 34px: the published case's title */
  --t-4xl: 2.75rem;    /* 44px: the published masthead, wide screens */
  --lh-tight: 1.2; --lh-ui: 1.45; --lh-read: 1.6;
  --track-caps: 0.07em;
  --measure: 68ch;

  /* space: a 4px base */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* shape */
  --r-0: 0; --r-1: 2px; --r-2: 4px;
  --hair: 1px solid var(--c-rule);
  --hair-strong: 1px solid var(--c-rule-strong);
  --shadow-float: 0 1px 2px rgb(10 20 25 / .10), 0 8px 24px rgb(10 20 25 / .14); /* the hold strip, a dialog, a menu; nothing else */

  /* motion: short, no bounce, only when the member must act */
  --d-1: 120ms; --d-2: 200ms; --ease: cubic-bezier(.2,0,.2,1);

  /* layout */
  --rail: 184px; --dock: 380px; --mast: 52px; --tap: 44px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --c-ground: #11181C;
  --c-ground-2: #172026;
  --c-surface: #1A242A;
  --c-sheet: #1E2930;
  --c-ink: #E3E9E4;
  --c-ink-2: #C3CCC6;
  --c-muted: #9AA7A1;
  --c-rule: #33414A;
  --c-rule-strong: #73817A;
  --c-accent: #74C2AE;
  --c-accent-strong: #9AD8C7;
  --c-accent-tint: #1C332D;
  --c-on-accent: #0D1A16;
  --c-signal: #EE9874;
  --c-signal-tint: #3A231A;
  --c-capture: #8DB9EE;
  --c-capture-tint: #1B2B40;
  --c-connection: #E39BCB;
  --c-connection-tint: #36202F;
  --c-testimony: #E7B865;
  --c-testimony-tint: #352A15;
  --c-subject: #BACB6B;
  --c-subject-tint: #2A3016;
  --c-stage: #93B1DC;
  --c-ready: #7FCB9E;
  --c-ident: #EC93AE;
  --c-machine: #AEB8C2;
  --c-machine-tint: #232B32;
  --c-elsewhere: #AEB2E6;
  --c-elsewhere-tint: #24263B;
  --c-focus: #9AD8C7;
  --c-kind-money: #A473FF;
  --c-kind-part: #007BAA;
  --c-kind-mention: #D5305F;
  color-scheme: dark;
  --shadow-float: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .5);
} }
:root[data-theme="dark"], .cs[data-theme="dark"] {
  --c-ground: #11181C;
  --c-ground-2: #172026;
  --c-surface: #1A242A;
  --c-sheet: #1E2930;
  --c-ink: #E3E9E4;
  --c-ink-2: #C3CCC6;
  --c-muted: #9AA7A1;
  --c-rule: #33414A;
  --c-rule-strong: #73817A;
  --c-accent: #74C2AE;
  --c-accent-strong: #9AD8C7;
  --c-accent-tint: #1C332D;
  --c-on-accent: #0D1A16;
  --c-signal: #EE9874;
  --c-signal-tint: #3A231A;
  --c-capture: #8DB9EE;
  --c-capture-tint: #1B2B40;
  --c-connection: #E39BCB;
  --c-connection-tint: #36202F;
  --c-testimony: #E7B865;
  --c-testimony-tint: #352A15;
  --c-subject: #BACB6B;
  --c-subject-tint: #2A3016;
  --c-stage: #93B1DC;
  --c-ready: #7FCB9E;
  --c-ident: #EC93AE;
  --c-machine: #AEB8C2;
  --c-machine-tint: #232B32;
  --c-elsewhere: #AEB2E6;
  --c-elsewhere-tint: #24263B;
  --c-focus: #9AD8C7;
  --c-kind-money: #A473FF;
  --c-kind-part: #007BAA;
  --c-kind-mention: #D5305F;
  color-scheme: dark;
  --shadow-float: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .5);
}
@media (prefers-reduced-motion: reduce) { :root { --d-1: 0ms; --d-2: 0ms; } }
/* a frame drawn in one theme inside a page in the other (specimens, mockups) */
.cs[data-theme="light"] {
  --c-ground: #EDEFE9;
  --c-ground-2: #E3E7DF;
  --c-surface: #F8F9F5;
  --c-sheet: #FDFDFB;
  --c-ink: #15222C;
  --c-ink-2: #334149;
  --c-muted: #55635E;
  --c-rule: #C3C9BE;
  --c-rule-strong: #7E877C;
  --c-accent: #2B6A5D;
  --c-accent-strong: #1D4E44;
  --c-accent-tint: #E2EEE9;
  --c-on-accent: #FFFFFF;
  --c-signal: #A23B19;
  --c-signal-tint: #F7E9E2;
  --c-capture: #1F5C9E;
  --c-capture-tint: #E3ECF7;
  --c-connection: #8A2F6E;
  --c-connection-tint: #F4E4EF;
  --c-testimony: #865300;
  --c-testimony-tint: #F7ECD9;
  --c-subject: #55621A;
  --c-subject-tint: #EDF0DC;
  --c-stage: #3A587F;
  --c-ready: #2E6E4A;
  --c-ident: #9B3355;
  --c-machine: #4A5560;
  --c-machine-tint: #ECEEF0;
  --c-elsewhere: #4B4F7A;
  --c-elsewhere-tint: #E8E9F2;
  --c-focus: #1D4E44;
  --c-kind-money: #773AC1;
  --c-kind-part: #0092C3;
  --c-kind-mention: #DF407F;
  color-scheme: light;
}
.cs[data-theme] { background: var(--c-ground); color: var(--c-ink); }

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
.cs { font: 400 var(--t-md)/var(--lh-ui) var(--f-sans); color: var(--c-ink); background: var(--c-ground);
      font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.cs :focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.cs a { color: var(--c-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.cs a:hover { color: var(--c-accent-strong); }
.cs svg.i { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.cs .rec { font-family: var(--f-serif); font-optical-sizing: auto; }      /* words people wrote */
.cs .id { font-family: var(--f-mono); font-size: .9em; letter-spacing: 0; } /* identifiers machines check */
.cs .eyebrow { font: 600 var(--t-xs)/1.2 var(--f-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); }
.cs .muted { color: var(--c-muted); }
.cs h1, .cs h2, .cs h3 { margin: 0; text-wrap: balance; line-height: var(--lh-tight); }
.cs .t-title { font: 600 var(--t-2xl)/var(--lh-tight) var(--f-sans); }
.cs .t-record { font: 600 var(--t-xl)/1.3 var(--f-serif); }
.cs .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============================================================
   Frames: where you are (principles 5.1–5.4, DEC-106, DEC-112)
   working: paper ground, the group's masthead, the standing band
   published: the clean sheet, the group's name large, no band
   imported: the working frame with another group's band and double edge
   ============================================================ */
.cs-frame { background: var(--c-ground); color: var(--c-ink); min-width: 0; }
.cs-frame[data-frame="published"] { background: var(--c-sheet); }
.cs-mast { display: flex; align-items: center; gap: var(--s-3); min-height: var(--mast); padding-inline: var(--s-4);
           border-bottom: var(--hair); background: var(--c-ground-2); }
.cs-mast .grp { font: 600 var(--t-lg)/1.2 var(--f-serif); }
.cs-mast .grp img, .cs-mast .logo { height: 24px; width: auto; }
.cs-mast .spacer { flex: 1; }
.cs-band { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); padding: 6px var(--s-4);
           font-size: var(--t-sm); border-bottom: var(--hair); background: var(--c-ground-2); color: var(--c-ink-2); }
.cs-band b { font-weight: 600; color: var(--c-ink); }
.cs-band[data-band="working"]   { background: var(--c-ground-2); }
.cs-band[data-band="review"]    { background: var(--c-signal-tint); color: var(--c-ink); border-bottom-color: var(--c-signal); }
.cs-band[data-band="review"] svg { color: var(--c-signal); }
.cs-band[data-band="imported"]  { background: var(--c-elsewhere-tint); color: var(--c-ink); border-bottom: 3px double var(--c-elsewhere); }
.cs-band[data-band="imported"] svg { color: var(--c-elsewhere); }
/* DEC-240 (N1049; interface-shell R53): the test-instance band, across the whole frame above the rail and the work, on every screen of a test
   Civicsmith; machine work's colors, the rule dashed for what has not yet passed its tests. */
.cs-band[data-band="test"]      { background: var(--c-machine-tint); color: var(--c-ink); border-bottom: 3px dashed var(--c-machine); }
.cs-band[data-band="test"] svg { color: var(--c-machine); }
.cs-band[data-band="published"] { display: none; } /* the published frame never carries the working band */
.cs-pubhead { padding: var(--s-6) var(--s-4) var(--s-4); border-bottom: 2px solid var(--c-ink); }
.cs-pubhead .grp { font: 600 var(--t-3xl)/1.1 var(--f-serif); letter-spacing: -.01em; }
.cs-pubfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); padding: var(--s-3) var(--s-4);
              border-top: var(--hair); font-size: var(--t-xs); color: var(--c-muted); }
.cs-credit { display: inline-flex; align-items: center; gap: 6px; color: var(--c-muted); }
.cs-credit svg { height: 14px; width: auto; color: var(--c-accent); }
.cs-credit b { font: 600 var(--t-sm) var(--f-sans); color: var(--c-ink); letter-spacing: -.005em; }

/* path to publication marker (DEC-106) */
.cs-path { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: var(--t-xs); color: var(--c-muted); }
.cs-path span { padding: 1px 6px; border: 1px solid transparent; border-radius: var(--r-1); }
.cs-path span[aria-current] { border-color: currentColor; color: var(--c-ink); font-weight: 600; }
.cs-path i { font-style: normal; }

/* the origin edge: who made this, at a glance (DEC-90, DEC-92); ours carries none */
.cs-edge { position: relative; padding-left: var(--s-4); }
.cs-edge::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.cs-edge[data-origin="machine"]::before   { border-left: 3px dotted var(--c-machine); }
.cs-edge[data-origin="elsewhere"]::before,
.cs-edge[data-origin="unevaluated"]::before { border-left: 3px double var(--c-elsewhere); width: 4px; }
.cs-edge[data-origin="accepted"]::before  { border-left: 3px double var(--c-accent); width: 4px; }
.cs-edge[data-origin="flagged"]::before   { border-left: 3px double var(--c-signal); width: 4px; }

/* ============================================================
   Surfaces
   ============================================================ */
.cs-sheet { background: var(--c-surface); border: var(--hair); }
.cs-row { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-1) var(--s-3); align-items: start;
          padding: var(--s-3) var(--s-4); border-bottom: var(--hair); background: var(--c-surface); min-width: 0; }
.cs-row:last-child { border-bottom: 0; }
.cs-row > * { min-width: 0; }
.cs-row .meta { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); align-items: center; font-size: var(--t-sm); color: var(--c-muted); }
.cs-section { display: grid; gap: var(--s-3); }
.cs-section > h2 { font: 600 var(--t-xs)/1.2 var(--f-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--c-muted); }

/* ============================================================
   Acts and their weight (principles 4.1–4.6, DEC-87, the measures map's pips)
   ============================================================ */
.cs-btn { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 7px 14px;
          font: 600 var(--t-md)/1.2 var(--f-sans); border-radius: var(--r-1); border: 1.5px solid var(--c-ink);
          background: transparent; color: var(--c-ink); cursor: pointer; text-decoration: none; text-align: left; flex-wrap: wrap; max-width: 100%;
          transition: background-color var(--d-1) var(--ease); }
.cs-btn:hover { background: var(--c-ground-2); }
.cs-btn[data-tone="primary"] { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.cs-btn[data-tone="primary"]:hover { background: var(--c-accent-strong); border-color: var(--c-accent-strong); }
.cs-btn[data-tone="quiet"] { border-color: transparent; color: var(--c-accent); padding-inline: 8px; }
.cs-btn[data-tone="quiet"]:hover { background: var(--c-accent-tint); }
.cs-btn[disabled] { opacity: 1; color: var(--c-muted); border-color: var(--c-rule-strong); background: transparent; cursor: not-allowed; }
.cs-btn .w { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; padding-left: var(--s-2); margin-left: 2px;
             border-left: 1px solid currentColor; font: 500 var(--t-xs)/1 var(--f-sans); letter-spacing: .02em; }
.cs-btn[data-tone="primary"] .w { border-left-color: color-mix(in srgb, var(--c-on-accent) 55%, transparent); }
.cs-pips { display: inline-flex; gap: 2px; }
.cs-pips i { width: 6px; height: 6px; border-radius: 50%; border: 1.25px solid currentColor; }
.cs-pips i.on { background: currentColor; }
.cs-tag-outward { display: inline-flex; align-items: center; gap: 4px; font: 600 var(--t-xs)/1 var(--f-sans); color: var(--c-signal); }
/* reasoned acts open a reason field in place */
.cs-reason { display: grid; gap: var(--s-2); padding: var(--s-3); border: var(--hair); border-left: 3px solid var(--c-ink); background: var(--c-surface); }
/* terminal, signed and outward acts open a full dialog: what ends, who signs */
.cs-dialog { background: var(--c-sheet); border: var(--hair-strong); box-shadow: var(--shadow-float); padding: var(--s-5); display: grid; gap: var(--s-4); max-width: 560px; }
.cs-dialog .ends { padding: var(--s-3); background: var(--c-ground-2); border-left: 3px solid var(--c-ink); }

/* ============================================================
   Fields; labeled drafts (principle 6.4, DEC-120 G5)
   ============================================================ */
.cs-field { display: grid; gap: 6px; min-width: 0; }
.cs-field > label { font-weight: 600; }
.cs-field .help { font-size: var(--t-sm); color: var(--c-muted); }
.cs-input { width: 100%; min-height: 44px; padding: 9px 11px; font: 400 var(--t-md)/1.4 var(--f-sans); color: var(--c-ink);
            background: var(--c-sheet); border: 1.5px solid var(--c-rule-strong); border-radius: var(--r-1); }
textarea.cs-input { min-height: 96px; resize: vertical; }
.cs-input.rec { font: 400 var(--t-lg)/1.5 var(--f-serif); }
.cs-draft { border-style: dashed; border-color: var(--c-machine); background: var(--c-machine-tint); }
.cs-draftlabel { display: inline-flex; align-items: center; gap: 5px; font: 600 var(--t-xs)/1 var(--f-sans); color: var(--c-machine); }

/* ============================================================
   Evidence: letters grade it (DEC-82). One shape for every scale;
   the scale's color and icon name the scale; the letter gives the value.
   ============================================================ */
.cs-grade { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px 3px 5px; border: 1.5px solid currentColor;
            border-radius: var(--r-1); font: 700 var(--t-sm)/1 var(--f-sans); white-space: nowrap; }
.cs-grade svg { width: 13px; height: 13px; }
.cs-grade[data-scale="capture"]    { color: var(--c-capture);    background: var(--c-capture-tint); }
.cs-grade[data-scale="connection"] { color: var(--c-connection); background: var(--c-connection-tint); }
.cs-grade[data-scale="testimony"]  { color: var(--c-testimony);  background: var(--c-testimony-tint); }
.cs-grade[data-scale="subject"]    { color: var(--c-subject);    background: var(--c-subject-tint); }
.cs-grade .sc { font-weight: 500; font-size: var(--t-xs); }
.cs-strength { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cs-strength .phrase { font-size: var(--t-sm); color: var(--c-ink-2); }
.cs-strength .phrase b { color: var(--c-ink); }

/* ============================================================
   What we don't know: five gaps, five looks, never an error (DEC-86)
   ============================================================ */
.cs-gap { display: inline-flex; align-items: flex-start; gap: 6px; font-size: var(--t-sm); line-height: 1.35; color: var(--c-ink); }
.cs-gap svg { margin-top: 1px; }
.cs-gap b { font-weight: 700; }
.cs-gap[data-gap="undetermined"] { padding: 3px 8px; border: 1.5px dashed var(--c-ink-2); border-radius: var(--r-1); }
.cs-gap[data-gap="withheld"]     { padding: 4px 8px; background: var(--c-ground-2); border-left: 4px solid var(--c-ink); }
.cs-gap[data-gap="unrated"]      { padding: 3px 7px 3px 5px; border: 1.5px solid var(--c-rule-strong); border-radius: var(--r-1); color: var(--c-ink-2); }
.cs-gap[data-gap="nobody"]       { padding: 3px 8px; border: 1.5px dotted var(--c-ink-2); border-radius: var(--r-1); }
.cs-gap[data-gap="refused"]      { display: flex; padding: var(--s-2) var(--s-3); background: var(--c-signal-tint); border-left: 3px solid var(--c-signal); }
.cs-gap[data-gap="refused"] svg { color: var(--c-signal); }

/* ordinary states: one vocabulary (DEC-98) */
.cs-state { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4); color: var(--c-muted); font-size: var(--t-md); }
.cs-state[data-state="failed"] { color: var(--c-ink); border-top: var(--hair); }
.cs-state[data-state="loading"] .bar { flex: 0 0 64px; height: 3px; background: var(--c-rule); position: relative; overflow: hidden; }
.cs-state[data-state="loading"] .bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--c-muted); }
.cs-wait { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--c-ink-2); }

/* ============================================================
   Who made this: the origin family (DEC-90, DEC-92, DEC-96)
   ============================================================ */
.cs-origin { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px 2px 5px; border-radius: var(--r-1);
             font: 600 var(--t-xs)/1.25 var(--f-sans); white-space: nowrap; }
.cs-origin svg { width: 13px; height: 13px; }
.cs-origin[data-origin="machine"]     { color: var(--c-machine);   background: var(--c-machine-tint); border: 1px dotted var(--c-machine); }
.cs-origin[data-origin="elsewhere"]   { color: var(--c-elsewhere); background: var(--c-elsewhere-tint); border: 3px double var(--c-elsewhere); padding-block: 0; }
.cs-origin[data-origin="unevaluated"] { color: var(--c-elsewhere); background: transparent; border: 1px dashed var(--c-elsewhere); }
.cs-origin[data-origin="accepted"]    { color: var(--c-accent);    background: var(--c-accent-tint); border: 3px double var(--c-accent); padding-block: 0; }
.cs-origin[data-origin="flagged"]     { color: var(--c-signal);    background: var(--c-signal-tint); border: 1px solid var(--c-signal); }
.cs-origin[data-origin="search"]      { color: var(--c-ink);       background: transparent; border: 1px solid var(--c-rule); }  /* DEC-164: found by search, nothing recorded */
.cs-machinework { padding: var(--s-3); background: var(--c-machine-tint); border: 1px dotted var(--c-machine); display: grid; gap: var(--s-2); }
.cs-machinework .by { font-size: var(--t-xs); color: var(--c-machine); display: flex; gap: 6px; align-items: center; font-weight: 600; }

/* recreation of an imported finding (principle 5.4) */
.cs-recreate { display: inline-flex; align-items: center; gap: 5px; font: 600 var(--t-xs)/1.25 var(--f-sans); padding: 2px 7px; border-radius: var(--r-1); }
.cs-recreate[data-r="pending"] { border: 1px dashed var(--c-elsewhere); color: var(--c-elsewhere); }
.cs-recreate[data-r="yes"]     { border: 1.5px solid var(--c-elsewhere); color: var(--c-elsewhere); background: var(--c-elsewhere-tint); }
.cs-recreate[data-r="part"]    { border: 1.5px solid var(--c-elsewhere); color: var(--c-elsewhere); background: linear-gradient(90deg, var(--c-elsewhere-tint) 50%, transparent 50%); }
.cs-recreate[data-r="no"]      { border: 1.5px solid var(--c-signal); color: var(--c-signal); }

/* ============================================================
   The queue's three kinds, the hint, the hunch (DEC-110, DEC-131, K1491)
   ============================================================ */
.cs-kind { display: inline-flex; align-items: center; gap: 5px; font: 700 var(--t-xs)/1 var(--f-sans); letter-spacing: var(--track-caps); text-transform: uppercase; }
.cs-kind[data-kind="todo"]    { color: var(--c-ink); }
.cs-kind[data-kind="noticed"] { color: var(--c-ink-2); }
.cs-kind[data-kind="status"]  { color: var(--c-muted); }
.cs-hint { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px 2px 5px; font: 600 var(--t-xs)/1.25 var(--f-sans);
           color: var(--c-machine); background: var(--c-machine-tint); border: 1px dotted var(--c-machine); border-radius: var(--r-1); }
.cs-hunch { display: inline-flex; align-items: center; gap: 4px; font: italic 500 var(--t-xs)/1.25 var(--f-sans); color: var(--c-ink-2);
            border-bottom: 1.5px dotted var(--c-ink-2); }

/* deadlines: display changes as a date nears; only "Overdue" is said unasked (DEC-94) */
.cs-due { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; font: 600 var(--t-xs)/1.25 var(--f-sans);
          border-radius: var(--r-1); border: 1px solid var(--c-rule-strong); color: var(--c-ink-2); white-space: nowrap; }
.cs-due[data-due="near"]    { border-color: var(--c-signal); color: var(--c-signal); }
.cs-due[data-due="overdue"] { border-color: var(--c-signal); background: var(--c-signal); color: var(--c-sheet); }
.cs-due[data-due="met"]     { border-color: var(--c-accent); color: var(--c-accent); }

/* change and tension (principles 3.8, DEC-77) */
.cs-changed { display: inline-flex; align-items: center; gap: 5px; font: 600 var(--t-xs)/1.25 var(--f-sans); color: var(--c-signal); }
.cs-tension { display: inline-flex; align-items: center; gap: 5px; font: 600 var(--t-xs)/1.25 var(--f-sans); color: var(--c-ink);
              padding: 2px 7px; border: 1.5px solid var(--c-ink); border-radius: var(--r-1); background: var(--c-surface); }

/* ============================================================
   Bars show progress: each ladder its own hue and texture (DEC-79, DEC-82)
   ============================================================ */
.cs-ladder { display: flex; flex-wrap: wrap; gap: 3px; }
.cs-ladder > span { flex: 1 1 80px; min-width: 0; padding: 5px 8px; font: 600 var(--t-xs)/1.2 var(--f-sans); color: var(--c-ink);
                    border: 1.5px solid var(--c-rule); background: transparent; border-radius: var(--r-1); }
.cs-ladder > span:not(.on) { color: var(--c-muted); }
.cs-ladder[data-ladder="stage"] > .on { border-color: var(--c-stage); background: color-mix(in srgb, var(--c-stage) 22%, var(--c-surface)); }
.cs-ladder[data-ladder="ready"] > .on { border-color: var(--c-ready); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c-ready) 26%, var(--c-surface)) 0 6px, color-mix(in srgb, var(--c-ready) 12%, var(--c-surface)) 6px 12px); }
.cs-ladder[data-ladder="ident"] > .on { border: 1.5px dotted var(--c-ident); background: color-mix(in srgb, var(--c-ident) 18%, var(--c-surface)); }
.cs-ladder > .pend { border-style: dashed; border-color: var(--c-rule-strong); }
.cs-ladder > .closed { border-color: var(--c-stage); background: var(--c-surface); }

/* ============================================================
   The hold strip: a set held together and the acts on it (§S, UI-25)
   ============================================================ */
.cs-hold { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) var(--s-4);
           background: var(--c-sheet); border: var(--hair-strong); border-top: 3px solid var(--c-ink); box-shadow: var(--shadow-float); }
.cs-hold .n { font-weight: 700; }
.cs-hold .drift { font-size: var(--t-sm); color: var(--c-muted); }
.cs-hold .acts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-left: auto; }

/* ============================================================
   The dock: the assistant panel and the wizard guide (DEC-90, principle 6.3)
   docked at the side on wide screens, at the bottom on narrow ones; never floating
   ============================================================ */
.cs-dock { background: var(--c-surface); border-left: var(--hair-strong); display: grid; grid-template-rows: auto 1fr auto; min-width: 0; min-height: 0; }
.cs-dock > header { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-bottom: var(--hair); font-weight: 600; }
.cs-dock > header .spacer { flex: 1; }
.cs-dock > .body { overflow: auto; padding: var(--s-3); display: grid; gap: var(--s-3); align-content: start; min-height: 0; }
.cs-dock > footer { border-top: var(--hair); padding: var(--s-2) var(--s-3); display: grid; gap: var(--s-2); }
.cs-wizard { display: grid; gap: var(--s-2); padding: var(--s-3); border: var(--hair); border-top: 3px solid var(--c-accent); background: var(--c-sheet); }
.cs-wizard .step { font-size: var(--t-xs); color: var(--c-muted); display: flex; gap: 6px; align-items: center; font-weight: 600; }
.cs-wizard .what { font-weight: 600; font-size: var(--t-lg); line-height: 1.3; }
.cs-wizard .why { color: var(--c-ink-2); font-size: var(--t-sm); }
.cs-wizard .why::before { content: "Why: "; font-weight: 700; color: var(--c-ink); }
.cs-wizard .nav { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.cs-target { outline: 3px solid var(--c-accent); outline-offset: 3px; position: relative; }
.cs-target-label { display: inline-flex; align-items: center; gap: 5px; font: 600 var(--t-xs)/1 var(--f-sans); color: var(--c-accent); }
@media (prefers-reduced-motion: no-preference) {
  .cs-target { animation: cs-ring 600ms var(--ease) 1; }
  @keyframes cs-ring { from { outline-offset: 9px; outline-color: transparent; } to { outline-offset: 3px; } }
}
.cs-kbd { font: 500 var(--t-xs)/1 var(--f-mono); padding: 3px 6px; border: 1px solid var(--c-rule-strong); border-bottom-width: 2px; border-radius: var(--r-1); color: var(--c-ink-2); background: var(--c-sheet); }
/* "Show me where": the member asks to see the ring again; it is drawn again, the control scrolled into view and focused */
@media (prefers-reduced-motion: no-preference) { .cs-target.again { animation: cs-ring 600ms var(--ease) 1; } }
/* the wizard mark: where wizards start (principle 6.7) */
.cs-wizmark { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 6px; border: 1px solid var(--c-accent); border-radius: var(--r-1);
              color: var(--c-accent); font: 600 var(--t-xs)/1.2 var(--f-sans); background: transparent; cursor: pointer; }
.cs-wizmark:hover { background: var(--c-accent-tint); }

/* ============================================================
   The application shell: desktop and phone (step 5)
   ============================================================ */
.cs-shell { display: grid; grid-template-columns: var(--rail) minmax(0,1fr); grid-template-rows: auto auto minmax(0,1fr); min-height: 100%; }
.cs-shell.with-dock { grid-template-columns: var(--rail) minmax(0,1fr) var(--dock); }
.cs-shell > .cs-mast, .cs-shell > .cs-band { grid-column: 1 / -1; }
.cs-rail { position: relative; border-right: var(--hair); padding: var(--s-3) var(--s-2); display: grid; gap: 2px; align-content: start; background: var(--c-ground); min-width: 0; }
/* DEC-155: the rail's width is the member's: drag its edge, or focus the edge and use the arrow keys; double-click or Home
   resets it. Narrower than 120px it becomes icons only, each with its name on hover and focus. */
.cs-grip { position: absolute; top: 0; right: -4px; bottom: 0; width: 8px; cursor: col-resize; z-index: 2; background: transparent; border: 0; padding: 0; }
.cs-grip:hover, .cs-grip:focus-visible { background: linear-gradient(to right, transparent 3px, var(--c-accent) 3px, var(--c-accent) 5px, transparent 5px); outline: none; }
.cs-shell.rail-icons .cs-rail a { justify-content: center; padding: 8px 0; font-size: 0; gap: 0; }
.cs-shell.rail-icons .cs-rail a svg { width: 20px; height: 20px; }
.cs-shell.rail-icons .cs-rail a .count { display: none; }
.cs-rail a { display: flex; align-items: center; gap: var(--s-2); padding: 8px 10px; white-space: nowrap; overflow: hidden; color: var(--c-ink-2); text-decoration: none; border-radius: var(--r-1); font-weight: 500; }
.cs-rail a[aria-current] { background: var(--c-surface); color: var(--c-ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--c-accent); }
.cs-rail a .count { margin-left: auto; font-size: var(--t-xs); color: var(--c-muted); }
.cs-main { padding: var(--s-5) var(--s-5) var(--s-7); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-content: start; min-width: 0; }
.cs-tabs { display: none; }
@media (max-width: 760px) {
  .cs-shell, .cs-shell.with-dock { grid-template-columns: minmax(0,1fr); }
  .cs-rail { display: none; }
  .cs-main { padding: var(--s-4) var(--s-4) calc(var(--s-8) + env(safe-area-inset-bottom, 0px)); }
  .cs-shell.with-dock .cs-dock { border-left: 0; border-top: var(--hair-strong); max-height: 55vh; }
  .cs-tabs { display: grid; grid-template-columns: repeat(5, 1fr); border-top: var(--hair); background: var(--c-ground-2); }
  .cs-tabs a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px calc(6px + env(safe-area-inset-bottom, 0px)); font-size: 11.5px; color: var(--c-ink-2); text-decoration: none; min-height: var(--tap); }
  .cs-tabs a[aria-current] { color: var(--c-ink); font-weight: 700; box-shadow: inset 0 3px 0 var(--c-accent); }
}

/* ============================================================
   Explanations where they appear (DEC-129 rule 4, DEC-82 disclosure, DEC-159)
   Every mark opens its meaning on hover, focus or tap; a name opens a card. One tip at a time, never over the thing
   it explains. Timing (DEC-161, after Nielsen Norman Group's timing guidelines): on hover it waits 0.5 s with the pointer
   still, then shows; it stays while the pointer is on the thing or on the tip, and closes 0.5 s after the pointer has left
   both. Keyboard focus and a tap show it at once. Escape closes it (WCAG 2.2 1.4.13: dismissible, hoverable, persistent).
   The cursor never announces an explanation (DEC-224, Bob, 14 October): no help or hand cursor on a mark, a name or any
   element that explains itself on hover; the cursor changes only over a control (a button, a link, a node in a graph).
   ============================================================ */
.cs-tip { position: fixed; z-index: 50; max-width: 300px; background: var(--c-sheet); color: var(--c-ink); border: var(--hair-strong);
  box-shadow: 0 4px 14px rgba(0,0,0,.14); padding: 8px 10px; font: 400 var(--t-sm)/1.45 var(--f-sans); border-radius: var(--r-1); }
.cs-tip b { font-weight: 600; } .cs-tip .more { display: block; margin-top: 4px; color: var(--c-muted); font-size: var(--t-xs); }
.cs-tip[hidden] { display: none; }
[data-tip]:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }
.cs-card { text-decoration: underline dotted var(--c-rule-strong); text-underline-offset: 3px; }
.cs-tip .why { display: block; margin-top: 4px; }
.cs-ref { color: inherit; text-decoration: underline; text-decoration-color: var(--c-accent); text-underline-offset: 3px; }
.cs-ref:hover, .cs-ref:focus-visible { color: var(--c-accent-strong); }

/* ============================================================
   The security screen (K1875, DEC-165): the level against the group's usual, and a map of kinds over time.
   Rust is attention, so it marks only what is above the usual; the highest step is also textured, and every cell
   names its count on hover, focus or tap, so color is never the only signal.
   ============================================================ */
.cs-risk { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; margin-right: 6px; font: 700 var(--t-xs)/1.25 var(--f-sans);
           letter-spacing: var(--track-caps); text-transform: uppercase; border-radius: var(--r-1); border: 1.5px solid var(--c-rule-strong); color: var(--c-ink-2); }
.cs-risk[data-risk="raised"] { border-color: var(--c-signal); color: var(--c-signal); }
.cs-risk[data-risk="high"]   { border-color: var(--c-signal); background: var(--c-signal); color: var(--c-sheet); }
.cs-heat { display: grid; grid-template-columns: minmax(96px, 190px) repeat(var(--n, 24), minmax(0, 1fr)); gap: 2px; align-items: center; font-size: var(--t-xs); }
.cs-heat .k { padding-right: var(--s-2); color: var(--c-ink-2); line-height: 1.25; }
.cs-heat .t { color: var(--c-muted); font-size: 11px; text-align: left; white-space: nowrap; overflow: visible; }
.cs-heat i { display: block; height: 22px; background: var(--c-surface); border: 1px solid var(--c-rule); }
.cs-heat i[data-x="1"] { background: color-mix(in srgb, var(--c-signal) 20%, var(--c-surface)); border-color: color-mix(in srgb, var(--c-signal) 40%, var(--c-rule)); }
.cs-heat i[data-x="2"] { background: color-mix(in srgb, var(--c-signal) 50%, var(--c-surface)); border-color: var(--c-signal); }
.cs-heat i[data-x="3"] { background: var(--c-signal) repeating-linear-gradient(45deg, transparent 0 3px, color-mix(in srgb, var(--c-sheet) 40%, transparent) 3px 5px); border-color: var(--c-signal); }
.cs-heatkey { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); align-items: center; font-size: var(--t-xs); color: var(--c-ink-2); }
.cs-heatkey i { display: inline-block; width: 16px; height: 12px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--c-rule); background: var(--c-surface); }
/* The faces (DEC-138): Source Serif 4, Source Sans 3 and Source Code Pro, SIL Open Font License 1.1 (fonts/OFL-*.txt),
   shipped inside the group's copy and never fetched from outside (principle 9.6). Latin, Latin Extended and Vietnamese subsets;
   other scripts fall back to the device's own faces until a group adds a language that needs them. */
@font-face{font-family:"Civicsmith Serif";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-serif-4-vietnamese-opsz-normal.woff2") format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Civicsmith Serif";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-serif-4-latin-ext-opsz-normal.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Civicsmith Serif";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Civicsmith Serif";font-style:italic;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-serif-4-vietnamese-opsz-italic.woff2") format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Civicsmith Serif";font-style:italic;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-serif-4-latin-ext-opsz-italic.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Civicsmith Serif";font-style:italic;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-serif-4-latin-opsz-italic.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Civicsmith Sans";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-sans-3-vietnamese-wght-normal.woff2") format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Civicsmith Sans";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-sans-3-latin-ext-wght-normal.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Civicsmith Sans";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Civicsmith Sans";font-style:italic;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-sans-3-vietnamese-wght-italic.woff2") format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Civicsmith Sans";font-style:italic;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-sans-3-latin-ext-wght-italic.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Civicsmith Sans";font-style:italic;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Civicsmith Mono";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-code-pro-vietnamese-wght-normal.woff2") format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Civicsmith Mono";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-code-pro-latin-ext-wght-normal.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Civicsmith Mono";font-style:normal;font-weight:200 900;font-display:swap;src:url("/app/assets/fonts/source-code-pro-latin-wght-normal.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
