/* Chimera console.

   An instrument, not a brochure. White page, #141413 ink, one accent: the
   brand cobalt #2230D9. The page is flat and ruled; a hairline separates
   things and a filled surface is reserved for the two places that have to be
   seen from across a room: the record being acted on, and a stop.

   Three radii and no others: 6px on anything pressed or typed into, 10px on a
   panel, and a full round on a status chip. Red, amber and green mean state
   and are never decoration. Cobalt means "you can act here" or "you are
   here". No purple, no gradients, no shadows on resting surfaces.

   Every colour is a token, and every token has a dark value, so there is one
   stylesheet and the theme is one attribute on <html>.

   Type is Outfit, vendored locally. No external request at runtime. */

@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;

  --bg:       #FFFFFF;      /* the page. manifest.webmanifest must match. */
  --panel:    #FFFFFF;
  --panel-2:  #F6F6F4;      /* hover, and a quiet fill */
  --chip:     #F0F0ED;
  --chip-hi:  #E4E4E0;
  --line:     #E2E2DD;
  --line-2:   #8E8E88;      /* a control edge: 3.3:1 on the page (WCAG 1.4.11) */

  --text:     #141413;
  --text-2:   #4A4A46;
  --text-3:   #6B6B66;      /* 5.3:1 on white. The floor for small text. */

  --ink:      #141413;      /* the filled surface */
  --on-ink:   #FFFFFF;
  --on-ink-2: #B9B9B3;

  --accent:    #2230D9;     /* brand cobalt, from scripts/gen_static_ads.py */
  --accent-hi: #1A25B0;
  --on-accent: #FFFFFF;
  --accent-wash: #EEF0FD;

  --red:      #B3261E;
  --red-wash: #FCEEEC;
  --amber:    #8A5300;
  --amber-wash: #FBF1DF;
  --green:    #0B6E48;
  --green-wash: #E6F4EE;

  --yellow:   #F2E85C;      /* a deadline, and nothing else */
  --on-yellow: #141413;

  --scrim:    rgba(20, 20, 19, 0.42);
  --shadow:   0 18px 48px rgba(20, 20, 19, 0.16);

  --geo: "Outfit", "Avenir Next", -apple-system, BlinkMacSystemFont,
         "Segoe UI", sans-serif;

  --r-lg: 10px;
  --r-chip: 6px;
  --sidebar: 232px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* The W3 design contract's token block (34-W3-UI-SPEC.md section 2.2),
     copied name for name and value for value. Every new name either holds a
     plain value or resolves through a token above that already has a dark
     value, so the dark blocks below need no addition. */

  /* type: four sizes, two weights */
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs-meta: 13px;     /* labels, table heads, chips, timestamps, axis labels, help text */
  --fs-body: 15px;     /* body, table cells, controls, nav */
  --fs-title: 22px;    /* the screen sentence; dialog, drawer and sheet titles */
  --fs-figure: 30px;   /* the one large number in a stat tile */
  --fw-regular: 400;
  --fw-strong: 600;
  --lh-body: 1.5;
  --lh-tight: 1.2;     /* titles, table cells that wrap */
  --lh-figure: 1.1;

  /* space: multiples of 4 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;

  /* sizes */
  --tap: 44px;         /* minimum target at the phone tier */
  --ctl: 36px;         /* control height above the phone tier */
  --row: 48px;         /* minimum table row height */
  --drawer: 440px;     /* Why drawer, bell panel */
  --sq: 16px;          /* mailbox square; 20px at the phone tier */

  /* radii: three, plus one for marks under 16px */
  --r-mark: 2px;       /* squares, meter and chart bars */
  --r-ctl: var(--r-chip);    /* 6px: anything pressed or typed into */
  --r-panel: var(--r-lg);    /* 10px: panels, drawers, sheets */
  --r-round: 999px;    /* chips, switches */
  --r-md: var(--r-lg); /* was 8px; retired so the set is three */

  /* motion */
  --dur-1: 120ms;      /* hover, press */
  --dur-2: 200ms;      /* drawer, sheet, toast enter and leave */
  --dur-3: 400ms;      /* stream-row highlight fade, chart draw */

  /* layers (existing values, now named) */
  --z-sticky: 30; --z-topbar: 40; --z-scrim: 55; --z-nav: 60;
  --z-drawer: 180; --z-palette: 200; --z-sheet: 220; --z-toast: 240; --z-dialog: 250;

  /* meaning */
  --stop: var(--red);        --on-stop: var(--bg);
  --idle: var(--text-2);     --idle-wash: var(--chip);
  --hi: var(--accent-wash);
  --chart-ink: var(--text);  --chart-pick: var(--accent);
  --chart-ghost: var(--line-2); --chart-grid: var(--line);
  --band-ok: var(--green-wash); --band-warn: var(--amber-wash); --band-bad: var(--red-wash);
}
/* The mailbox square grows at the phone tier, where it is also a tap target. */
@media (max-width: 640px) { :root { --sq: 20px; } }

/* Dark. Applied when the device asks for it and the operator has not pinned
   light, or when the operator pinned dark. The two blocks are the same list
   on purpose: a media query cannot be combined with an attribute selector in
   one rule without nesting, and this file is flat. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141413; --panel: #141413; --panel-2: #1D1D1B; --chip: #252523;
    --chip-hi: #333330; --line: #2E2E2B; --line-2: #6A6A65;
    --text: #F2F2EE; --text-2: #C4C4BE; --text-3: #9C9C96;
    --ink: #F2F2EE; --on-ink: #141413; --on-ink-2: #4A4A46;
    --accent: #8C96FF; --accent-hi: #A9B1FF; --on-accent: #141413; --accent-wash: #1E2149;
    --red: #FF8A80; --red-wash: #3A1A17; --amber: #F0B45A; --amber-wash: #33260F;
    --green: #6FD3A6; --green-wash: #12301F;
    --scrim: rgba(0, 0, 0, 0.6); --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413; --panel: #141413; --panel-2: #1D1D1B; --chip: #252523;
  --chip-hi: #333330; --line: #2E2E2B; --line-2: #6A6A65;
  --text: #F2F2EE; --text-2: #C4C4BE; --text-3: #9C9C96;
  --ink: #F2F2EE; --on-ink: #141413; --on-ink-2: #4A4A46;
  --accent: #8C96FF; --accent-hi: #A9B1FF; --on-accent: #141413; --accent-wash: #1E2149;
  --red: #FF8A80; --red-wash: #3A1A17; --amber: #F0B45A; --amber-wash: #33260F;
  --green: #6FD3A6; --green-wash: #12301F;
  --scrim: rgba(0, 0, 0, 0.6); --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--geo);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { text-wrap: balance; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hi); }

.num, td.num, .metric-value, .money, .figure-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.money { color: var(--green); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-chip);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: baseline; gap: 8px; padding: 2px 8px 0; }
.brand-mark { font-size: 15px; font-weight: 700; letter-spacing: 0.08em; }
.brand-sub { font-size: 13px; color: var(--text-3); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: 12px; color: var(--text-3); padding: 16px 8px 5px; font-weight: 500; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  min-height: 34px;
  border-radius: var(--r-chip);
  color: var(--text-2);
  border: none;
  background: none;
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  width: 100%;
  transition: color 120ms var(--ease), background 120ms var(--ease);
}

.nav-ico {
  flex: none;
  width: 20px; height: 20px;
  display: grid; place-items: center;
}

/* The More tab's alert is positioned against its icon, so the icon is the
   containing block. Shared with every nav item; it costs nothing where no
   alert is rendered. */
.nav-ico { position: relative; }

.nav-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.nav-item:hover { color: var(--text); background: var(--panel-2); }

/* Where you are: ink text, a cobalt icon, and a rule down the left edge. Three
   cues, so it survives greyscale. */
.nav-item[aria-current="true"] {
  color: var(--text); font-weight: 600; background: var(--panel-2);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item[aria-current="true"] .nav-ico { color: var(--accent); }

.nav-badge {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nav-badge[data-tone="bad"] { color: var(--red); font-weight: 600; }
/* A pause narrower than the fleet: something is held, and it is not a stop. */
.nav-badge[data-tone="warn"] { color: var(--amber); font-weight: 600; }

/* Phone-only members of the navigation, inert at every other width.

   `.nav-more` is the fifth tab: eleven sections do not fit a thumb, so four
   reach the tab bar and the rest live one tap away in the sheet the same
   `.sidebar` element becomes when `data-expanded` is set. One nav in the DOM,
   two skins, so `show()` keeps working, the badges keep updating, and there
   is no second copy of the section list to drift. */
.nav-more, .nav-user, .sheet-grip, .nav-scrim { display: none; }

.nav-more {
  border: none;
  background: none;
  font: inherit;
  color: var(--text-2);
  border-radius: var(--r-chip);
  cursor: pointer;
}

.nav-more:hover { color: var(--text); }
.nav-more[aria-expanded="true"] { color: var(--text); font-weight: 600; }
.nav-more[aria-expanded="true"] .nav-ico { color: var(--accent); }

/* How many posts are waiting on a human decision, on the More tab. An alert,
   not a counter: it is 0 to 9+, and it marks the one time-sensitive thing a
   sheet can hide. Ink on yellow, so it does not rest on colour alone. */
.nav-alert {
  position: absolute;
  top: -7px; right: -10px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--on-yellow);
  font-size: 11px; font-weight: 700; line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.nav-alert[hidden] { display: none; }

/* The bar shows a short label and the sidebar shows the full one;
   `aria-label` on the button carries the real name at every width. */
.nav-short { display: none; }

.main { min-width: 0; padding: 0 28px; max-width: 1480px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
}

.topbar h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-user { font-size: 13.5px; color: var(--text-3); padding: 0 4px; }
.logout-form { margin: 0; display: flex; }

/* ---------- Buttons ---------- */

.btn {
  font: inherit;
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--r-chip);
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background 120ms var(--ease), border-color 120ms var(--ease),
    transform 120ms var(--ease);
}

.btn:hover { background: var(--panel-2); border-color: var(--text-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
/* A request on the wire. The button was tapped and is waiting on the server. */
.btn[aria-busy="true"] { cursor: progress; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--on-accent); }
.btn-danger { background: var(--red); border-color: var(--red); color: var(--bg); font-weight: 600; }
.btn-danger:hover { background: var(--red); border-color: var(--red); color: var(--bg); filter: brightness(0.92); }
.btn-sm { padding: 5px 11px; font-size: 13.5px; }
.kbd { font-size: 12px; color: var(--text-3); margin-left: 2px; }

/* A topbar action carries a word and a glyph and shows one of them: the word
   down to 900px, the glyph below it. The accessible name is on `aria-label`
   at every width. */
.btn-ico { display: none; }
.btn-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.section { padding: 0 0 80px; }
.section[hidden] { display: none; }

/* ---------- The record being acted on ---------- */

/* The one filled surface on a screen. It holds the organization about to be
   called or the post about to be approved, so it reads as the thing to act
   on. `--ink` inverts with the theme, and everything inside is written
   against `--on-ink`. */
.detail-head { padding: 28px 28px 26px; background: var(--ink); color: var(--on-ink);
  border-radius: var(--r-lg) var(--r-lg) 0 0; }

.eyebrow { font-size: 13px; color: var(--on-ink-2); font-weight: 500; margin-bottom: 8px; }

.next-call-name {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 10px;
  max-width: 26ch;
}

.next-call-why {
  color: var(--on-ink-2);
  margin: 0 0 22px;
  font-size: 15.5px;
  line-height: 1.5;
  max-width: 60ch;
}

.next-call-figures { display: flex; flex-wrap: wrap; gap: 32px; margin-bottom: 22px; }
.figure-label { font-size: 12.5px; color: var(--on-ink-2); margin-bottom: 2px; }
.figure-value { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.detail-head .money { color: var(--on-ink); }
.detail-head a { color: var(--on-ink); }
.detail-head .k, .detail-head .muted { color: var(--on-ink-2); }

.detail-head .pill {
  background: var(--yellow);
  color: var(--on-yellow);
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13.5px;
}

.next-call-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-head .btn { background: transparent; border-color: var(--on-ink-2); color: var(--on-ink); }
.detail-head .btn:hover { background: transparent; border-color: var(--on-ink); }
.detail-head .btn-primary { background: var(--on-ink); border-color: var(--on-ink); color: var(--ink); }
.detail-head .btn-primary:hover { background: var(--on-ink); filter: brightness(0.92); }

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

/* Not cards. A ruled row of figures: the numbers sit on the page and a
   hairline separates one from the next. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.stat {
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }

.stat-head { display: flex; align-items: flex-start; gap: 10px; }

.stat-ico {
  flex: none;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  color: var(--text-3);
  margin-top: 1px;
}

.stat-ico svg { width: 17px; height: 17px; stroke: currentColor; fill: none;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.stat-titles { min-width: 0; flex: 1; }
.stat-title { font-size: 13.5px; font-weight: 600; }
.stat-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

/* Carries aria-label="Details" and has no handler. Hidden everywhere rather
   than shown as a control that does nothing. */
.stat-expand { display: none; }
.stat-expand svg { width: 14px; height: 14px; }

.stat-figure { display: flex; align-items: center; gap: 9px; }
.stat-value { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums; }

.dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }
.dot.ok { background: var(--green); }
.dot.warn { background: var(--amber); }
.dot.bad { background: var(--red); }
.dot.idle { background: var(--line-2); }

.spark { display: flex; align-items: flex-end; gap: 2px; height: 36px; }
.spark span { flex: 1; min-width: 2px; border-radius: 1px 1px 0 0;
  background: var(--chip-hi); min-height: 2px; }
.spark span[data-heat="now"]  { background: var(--red); }
.spark span[data-heat="hot"]  { background: var(--amber); }
.spark span[data-heat="near"] { background: var(--text-3); }
.spark span[data-heat="far"]  { background: var(--line-2); }

.spark-foot { display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--text-3); }
.spark-foot b { display: block; color: var(--text); font-weight: 600;
  font-variant-numeric: tabular-nums; font-size: 13px; }
.spark-foot > span:last-child { text-align: right; }

/* ---------- Cliff banner + countdown ---------- */

.cliff {
  background: var(--ink);
  color: var(--on-ink);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cliff-title { font-size: 13px; color: var(--on-ink-2); }
.cliff-h { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 0; }
.cliff-sub { font-size: 13.5px; color: var(--on-ink-2); margin-top: 4px; }

.countdown { display: flex; align-items: flex-end; gap: 8px; }

.cd-unit {
  background: var(--yellow);
  color: var(--on-yellow);
  border-radius: var(--r-chip);
  padding: 8px 12px;
  min-width: 58px;
  text-align: center;
}

.cd-num { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums; }
.cd-cap { font-size: 11.5px; margin-top: 3px; font-weight: 500; opacity: 0.7; }
.cd-sep { font-size: 20px; color: var(--on-ink-2); padding-bottom: 14px; }

/* ---------- Rings ---------- */

.rings { display: flex; flex-wrap: wrap; gap: 24px; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring-svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--chip-hi); stroke-width: 5; }
.ring-arc { fill: none; stroke-width: 5; stroke-linecap: round;
  transition: stroke-dashoffset 600ms var(--ease); }
.ring-wrap { position: relative; display: grid; place-items: center; }
.ring-label { position: absolute; font-size: 13.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; }
.ring-cap { font-size: 12.5px; color: var(--text-3); }

.delta { font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 2px 8px;
  font-variant-numeric: tabular-nums; }
.delta.up { background: var(--green-wash); color: var(--green); }
.delta.down { background: var(--red-wash); color: var(--red); }
.delta.flat { background: var(--chip); color: var(--text-3); }

/* Channel permission chips (outreach gate). Whether voice, email and mail are
   open is the first thing an operator reads. Tinted ground, coloured text and
   a dot, so the state does not rest on colour alone (WCAG 1.4.1). */
.perm-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  border-radius: 999px; padding: 3px 10px;
  white-space: nowrap;
}
.perm-chip .perm-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex: none;
}
.perm-chip.ok  { background: var(--green-wash); color: var(--green); }
.perm-chip.bad { background: var(--red-wash); color: var(--red); }

.perm-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Workspace ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 20px;
  align-items: start;
}

.pane { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0; }
.pane-list { display: flex; flex-direction: column; max-height: calc(100vh - 120px);
  position: sticky; top: 84px; }
.pane-head { padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 10px;
  border-bottom: 1px solid var(--line); }

.search { display: flex; align-items: center; gap: 8px; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r-chip); padding: 0 10px; }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 16px; height: 16px; flex: none; stroke: var(--text-3);
  fill: none; stroke-width: 1.8; stroke-linecap: round; }
.search input { border: none; background: none; color: var(--text); font: inherit;
  font-size: 14.5px; width: 100%; outline: none; padding: 8px 0; }
.search input::placeholder { color: var(--text-3); }

.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }

/* An edge fade on a row that scrolls sideways, on the side that has more.
   The scrollbar is hidden, so without it nothing says the row continues: ten
   Email tabs in a phone's width show three and a half.

   The fade is stepped, not a gradient: this file has none, and the tests hold
   it to that. A page-colored sliver sticks to the edge of the scrollport and
   casts three fainter copies of itself inward. `data-more-start` and
   `data-more-end` are set by the script from the scroll position, so a row
   that fits, or one scrolled to its end, shows no fade on that side. The
   negative margin gives the sliver no room of its own in the row. */
.subnav[data-more-end="true"]::after, .filters[data-more-end="true"]::after,
.subnav[data-more-start="true"]::before, .filters[data-more-start="true"]::before {
  content: ""; flex: none; align-self: stretch;
  position: sticky; z-index: 1; width: 8px;
  background: var(--bg); pointer-events: none;
}
.subnav[data-more-end="true"]::after, .filters[data-more-end="true"]::after {
  right: 0; margin-left: -14px;
  box-shadow: -8px 0 0 color-mix(in srgb, var(--bg) 76%, transparent),
              -16px 0 0 color-mix(in srgb, var(--bg) 50%, transparent),
              -24px 0 0 color-mix(in srgb, var(--bg) 24%, transparent);
}
.subnav[data-more-start="true"]::before, .filters[data-more-start="true"]::before {
  left: 0; margin-right: -14px;
  box-shadow: 8px 0 0 color-mix(in srgb, var(--bg) 76%, transparent),
              16px 0 0 color-mix(in srgb, var(--bg) 50%, transparent),
              24px 0 0 color-mix(in srgb, var(--bg) 24%, transparent);
}

.filter {
  font: inherit;
  font-size: 13.5px;
  white-space: nowrap;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text-2);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.filter:hover { background: var(--panel-2); color: var(--text); }
.filter[aria-selected="true"], .filter[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: 600; }

.pane-body { overflow-y: auto; padding: 6px; display: flex;
  flex-direction: column; gap: 1px; }

.org-card {
  text-align: left; border: none; background: none; font: inherit; color: inherit;
  width: 100%; padding: 10px 12px; border-radius: var(--r-chip); cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; gap: 3px 12px;
  transition: background 120ms var(--ease);
}

.org-card:hover { background: var(--panel-2); }
.org-card[aria-selected="true"] { background: var(--accent-wash); box-shadow: inset 2px 0 0 var(--accent); }
.org-card .t { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.org-card .s { font-size: 13px; color: var(--text-3); grid-column: 1 / -1; }
.org-card .v { font-size: 13.5px; color: var(--green); font-variant-numeric: tabular-nums; }

.pane-detail { padding: 0; overflow: hidden; }

/* Return to the list. Hidden above the phone tier, where both panes are on
   screen at once and there is nothing to go back to. */
.pane-back {
  display: none;
  align-items: center; gap: 8px;
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: none; background: none; color: var(--accent);
  font: inherit; font-size: 15px; font-weight: 500;
  text-align: left; cursor: pointer;
}
.pane-back svg { width: 16px; height: 16px; flex: none; stroke: currentColor;
  fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.detail-empty { padding: 72px 28px; text-align: center; color: var(--text-3); }
.detail-body { padding: 22px 28px 28px; display: flex; flex-direction: column; gap: 20px; }
.detail-row { display: flex; flex-wrap: wrap; gap: 30px; }
.detail-block .k, .detail-body .k { font-size: 12.5px; color: var(--text-3); margin-bottom: 3px; }
.detail-block .v { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.assumptions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }

th {
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--text-3);
  padding: 10px 14px; white-space: nowrap;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
}

td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr:first-child td { border-top: none; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; }

.rank { color: var(--text-3); font-variant-numeric: tabular-nums; }
.org-name { font-weight: 600; }
.org-why { color: var(--text-3); font-size: 13px; margin-top: 2px; }

.group-head {
  font-size: 13px; color: var(--text-3); font-weight: 600; margin: 24px 0 8px;
}

/* ---------- Accordion ----------

   Capabilities is a 36-subsystem reference table. On a phone it becomes one
   row per subsystem with the configuration behind a native `<details>`: no
   JavaScript, keyboard operable, and find-in-page opens it. */

.acc { display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: var(--r-lg); margin-bottom: 8px; }

.acc-item { border-top: 1px solid var(--line); }
.acc-item:first-child { border-top: none; }

.acc-sum {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; min-height: 44px;
  cursor: pointer; list-style: none;
  font-size: 14.5px; font-weight: 500;
}

.acc-sum::-webkit-details-marker { display: none; }
.acc-sum::marker { content: ""; }
.acc-sum:hover { background: var(--panel-2); }

.acc-name { flex: 1; min-width: 0; }
.acc-count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.acc-chev { flex: none; width: 16px; height: 16px; color: var(--text-3);
  transition: transform 140ms var(--ease); }
.acc-chev svg { width: 16px; height: 16px; stroke: currentColor; fill: none;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.acc-item[open] .acc-chev { transform: rotate(90deg); }

.acc-body { padding: 2px 14px 14px; }
.acc-body .k { font-size: 12.5px; color: var(--text-3); margin-bottom: 5px; }

.pill {
  display: inline-block; font-size: 12.5px; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
  background: var(--chip); color: var(--text-2);
}

.pill[data-heat="now"]  { background: var(--yellow); color: var(--on-yellow); font-weight: 600; }
.pill[data-heat="hot"]  { background: var(--amber-wash); color: var(--amber); font-weight: 600; }
.pill[data-heat="near"] { background: var(--chip); color: var(--text-2); }
.pill[data-heat="far"]  { background: var(--chip); color: var(--text-3); }
.pill[data-heat="none"] { background: var(--chip); color: var(--text-3); }

.stage-select, .field input, .field select, .field textarea {
  font: inherit; font-size: 14.5px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-chip); padding: 7px 10px;
  transition: border-color 120ms var(--ease);
}

.stage-select:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -1px;
}

.controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  margin-bottom: 20px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.field input, .field select { min-width: 140px; }
.field-grow { flex: 1; min-width: 280px; }
.field-grow input { width: 100%; }
.field-help { margin: 0; font-size: 12.5px; color: var(--text-3); }

/* ---------- Config tags ---------- */

.tags { max-width: 620px; }

.tag {
  display: inline-flex; align-items: baseline; gap: 5px;
  background: var(--chip); border-radius: 4px; padding: 2px 7px;
  margin: 2px 4px 2px 0; font-size: 12.5px; color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tag i { font-style: normal; color: var(--text-3); }
.muted { color: var(--text-3); }

.path {
  max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2); font-size: 13px; direction: rtl; text-align: left;
}

/* ---------- Empty & status ---------- */

.empty {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 36px 28px; color: var(--text-2); margin-bottom: 20px;
}

.empty h3 { margin: 0 0 8px; color: var(--text); font-size: 20px; font-weight: 600;
  letter-spacing: -0.02em; }
.empty p { margin: 0 0 14px; max-width: 64ch; font-size: 15px; }
.empty p:last-child { margin-bottom: 0; }

/* The toast stack (34-W3-UI-SPEC.md 4.11): bottom right, at most three.
   Under the decision dialog (250), so a toast from the last action never
   sits on top of the next decision's buttons. Ink for a success, the stop
   surface for an error. */
.toast-stack {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-toast);
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  max-width: 420px; pointer-events: none;
}
.toast-region { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.toast {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; pointer-events: auto;
  background: var(--ink); color: var(--on-ink);
  border-radius: var(--r-md); padding: 12px 16px; max-width: 420px;
  font-size: 15px; font-weight: 600; box-shadow: var(--shadow);
  animation: toast-rise var(--dur-2) var(--ease);
}
@keyframes toast-rise { from { transform: translateY(8px); opacity: 0; } }
.toast-text { margin: 0; flex: 1 1 200px; min-width: 0; }
.toast-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toast-actions:empty { display: none; }
.toast .toast-action, .toast .toast-close {
  background: transparent; color: inherit; border-color: currentColor;
}
.toast[data-kind="error"] { background: var(--stop); color: var(--on-stop); }

/* ---------- Command palette ---------- */

.palette-backdrop {
  position: fixed; inset: 0;
  background: var(--scrim);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh; z-index: 200;
}

.palette-backdrop[hidden] { display: none; }

.palette {
  width: min(580px, 92vw); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
}

.palette input {
  width: 100%; font: inherit; font-size: 17px; padding: 16px 18px;
  background: transparent; color: var(--text); border: none;
  border-bottom: 1px solid var(--line);
}

.palette input:focus { outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow-y: auto; }

.palette-item {
  padding: 9px 12px; border-radius: var(--r-chip); cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 14.5px; color: var(--text-2);
}

.palette-item[aria-selected="true"] { background: var(--accent); color: var(--on-accent); font-weight: 500; }
.palette-hint { color: var(--text-3); font-size: 13px; }
.palette-item[aria-selected="true"] .palette-hint { color: var(--on-accent); opacity: 0.75; }

/* 34-W3-11d: two lines per result (contract 4.13), the action and its
   consequence in meta size. A result that changes sending carries a red dot
   and the words; an armed one says "Press Enter again" in a heavier weight. */
.palette-line { display: flex; align-items: center; gap: 8px; color: inherit; }
.palette-meta { font-size: var(--fs-meta); color: var(--text-3); display: flex; flex-wrap: wrap; gap: 8px; }
.palette-item[aria-selected="true"] .palette-meta { color: var(--on-accent); }
.palette-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }
.palette-changes { color: var(--red); font-weight: 600; }
.palette-item[aria-selected="true"] .palette-changes { color: var(--on-accent); }
.palette-item[data-armed="true"] .palette-meta { font-weight: 600; }
.palette-item[aria-disabled="true"] { cursor: default; opacity: 0.7; }
.palette-note { padding: 9px 12px; font-size: var(--fs-meta); color: var(--text-2); list-style: none; }

/* ---------- Email ----------

   The v5.0 Email screens (static/email.js). Same tokens, same three radii.
   What is new is the stop bar and a handful of shapes for reading state:
   a notice, a figure, an item, a key-value list. */

/* The stop strip (34-W3-UI-SPEC.md section 4.1). Above every Email screen
   and stuck to the top of it, so stopping every send is one tap from
   anywhere. ONE ROW: the state block, then Pause part, then Stop all.
   Quiet while sending; filled with the stop surface once stopped, because
   "is anything going out" must be answerable at a glance, from a phone, by
   the operator who did not press it. The reason is in the Why drawer the
   state block opens, and in the toast, never on the strip. */
.stopbar {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: nowrap;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-2); border-radius: var(--r-panel);
  background: var(--panel);
  margin-bottom: var(--sp-3);
}
#email-stopbar { position: sticky; top: 68px; z-index: var(--z-sticky); background: var(--bg); padding-top: 2px; }
/* The state block is a button that opens the Why drawer for all sending
   (a reader may press it too). The unreadable strip draws the same block
   as plain text. */
.stopbar-state {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
  font: inherit; color: inherit; text-align: left; background: none; border: 0;
  padding: var(--sp-1); margin: calc(-1 * var(--sp-1)); border-radius: var(--r-ctl);
}
button.stopbar-state { cursor: pointer; min-height: var(--ctl); }
button.stopbar-state:hover { background: var(--panel-2); }
.stopbar[data-state="sending"] .stopbar-state { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 0 var(--sp-2); }
.stopbar-word, .stopbar-state > strong { font-size: var(--fs-body); font-weight: var(--fw-strong); }
.stopbar-line { white-space: nowrap; }
.stopbar-detail, .stopbar-state > span { font-size: var(--fs-meta); color: var(--text-2); overflow-wrap: anywhere; }
.stopbar[data-state="sending"] .stopbar-word::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: var(--r-round);
  background: var(--green); margin-right: var(--sp-2); vertical-align: 1px;
}
/* Narrower pauses beside the word, on every screen and at every width: with
   a domain, a lane or a campaign held, "Sending" alone is true and still
   misleads. The block it sits in opens the drawer that names them. */
.stopbar-pauses { color: var(--amber); font-weight: var(--fw-strong); }
/* When the switch was last read. The page refreshes itself, and this is how
   an operator knows how old "Sending" is. */
.stopbar-asof { font-size: var(--fs-meta); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* How long sending has been stopped, beside the time it stopped. */
.stopbar-for { font-weight: var(--fw-strong); white-space: nowrap; }
.stopbar-held { white-space: nowrap; font-weight: var(--fw-strong); }
.stopbar-vendor { white-space: nowrap; }

/* Stopped: the stop surface, its text in --on-stop at full strength. */
.stopbar[data-state="stopped"] { background: var(--stop); border-color: var(--stop); color: var(--on-stop); }
.stopbar[data-state="stopped"] .stopbar-detail, .stopbar[data-state="stopped"] .stopbar-state > span,
.stopbar[data-state="stopped"] .stopbar-asof { color: var(--on-stop); }
.stopbar[data-state="stopped"] button.stopbar-state:hover { background: transparent; text-decoration: underline; }
/* The go-live gate: deliberately not sending, nothing wrong (idle). */
.stopbar[data-state="gate"] { background: var(--idle-wash); border-color: var(--line-2); }
.stopbar[data-state="gate"] .stopbar-detail, .stopbar[data-state="gate"] .stopbar-asof { color: var(--text-2); }
/* No lane: nobody has anything to read here (unknown): no fill, dashed. */
.stopbar[data-state="unconnected"] { border-style: dashed; }
/* A role that can read and not act: the state, no button, these words. */
.stopbar-readonly { flex: none; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-2); white-space: nowrap; }
.stopbar[data-state="stopped"] .stopbar-readonly { color: var(--on-stop); }

/* The absolute time beside a relative one, in the page: a touch screen has
   no hover, so a `title` is no place for it. */
.when-abs { color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stopbar[data-state="stopped"] .when-abs { color: inherit; }

.stopbar .btn { flex: none; }
.stopbar-part-mark { margin-left: var(--sp-1); }
.btn-stop { border-color: var(--red); color: var(--red); font-weight: var(--fw-strong); padding: 9px var(--sp-4); }
.btn-stop:hover { background: var(--red); border-color: var(--red); color: var(--bg); }
.btn-resume { background: var(--on-stop); border-color: var(--on-stop); color: var(--stop); font-weight: var(--fw-strong); padding: 9px var(--sp-4); }
.btn-resume:hover { background: var(--on-stop); border-color: var(--on-stop); color: var(--stop); filter: brightness(0.94); }

/* The scope sheet (section 4.1): a 440px panel under the pause-part button
   above the phone tier, a bottom sheet at it. Each row is at least 56px and
   says what is sending there and how much is queued before the tap. */
.layer[data-kind="menu"][data-name="scope"] .layer-panel { width: min(var(--drawer), calc(100vw - var(--sp-4)));
  max-width: none; max-height: 80vh; }
.scope-sheet { display: flex; flex-direction: column; }
.scope-sections { min-height: var(--tap); }
.scope-find { width: 100%; min-height: var(--ctl); padding: var(--sp-2) var(--sp-3); font: inherit; font-size: var(--fs-body);
  color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-ctl); }
.scope-section { margin-top: var(--sp-4); }
.scope-h { margin: 0 0 var(--sp-1); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em; }
.scope-rows { list-style: none; margin: 0; padding: 0; }
.scope-row {
  display: flex; align-items: center; gap: var(--sp-3); min-height: calc(var(--tap) + var(--sp-3));
  padding: var(--sp-1) 0; border-top: 1px solid var(--line);
}
.scope-row:first-child { border-top: 0; }
.scope-row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.scope-row-name { font-size: var(--fs-body); font-weight: var(--fw-strong); overflow-wrap: anywhere; }
.scope-row-now { font-size: var(--fs-meta); color: var(--text-2); overflow-wrap: anywhere; }
.scope-row[data-paused="true"] .scope-row-now { color: var(--amber); }
.scope-row-note { font-size: var(--fs-meta); color: var(--text-2); }
.scope-more { margin-top: var(--sp-1); padding: var(--sp-2) 0; font: inherit; font-size: var(--fs-meta); color: var(--accent);
  background: none; border: 0; cursor: pointer; text-decoration: underline; }
.scope-empty, .scope-note { margin: var(--sp-3) 0 0; font-size: var(--fs-meta); color: var(--text-2); }
.scope-foot { margin: var(--sp-4) 0 0; padding-top: var(--sp-3); border-top: 1px solid var(--line);
  font-size: var(--fs-meta); color: var(--text-2); }

/* The checklist in three tiers (section 4.18): Blocking, Warnings, Notes,
   always in that order. A glyph and a hidden word carry each result; the
   footer says the outcome. Shares `.checklist` with the launch check the
   Campaigns screen draws until 34-W3-ops-04b moves it onto this one. */
.check-tier + .check-tier { margin-top: var(--sp-3); }
.check-tier-h { margin: 0; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.04em; }
.check-tier-note { margin-left: var(--sp-3); font-weight: var(--fw-regular); text-transform: none; letter-spacing: 0; color: var(--text-3); }
.check-lines { list-style: none; margin: var(--sp-1) 0 0; padding: 0; }
.checklist .check-line { display: grid; grid-template-columns: var(--sp-6) minmax(0, 10rem) minmax(0, 1fr) auto;
  align-items: baseline; gap: var(--sp-1) var(--sp-3); padding: var(--sp-1) 0; }
.check-glyph { font-weight: var(--fw-strong); text-align: center; }
.check-line[data-result="blocking"] .check-glyph { color: var(--red); }
.check-line[data-result="warning"] .check-glyph { color: var(--amber); }
.check-line[data-result="passes"] .check-glyph { color: var(--green); }
.check-line[data-result="not_run"] .check-glyph { color: var(--text-2); }
.check-label { font-weight: var(--fw-strong); }
.check-text { color: var(--text-2); overflow-wrap: anywhere; }
.check-text .chip { margin-right: var(--sp-2); }
.check-link { white-space: nowrap; }
.check-more > summary { cursor: pointer; padding: var(--sp-1) 0; font-size: var(--fs-meta); color: var(--accent); }
.check-foot { margin: var(--sp-3) 0 0; font-weight: var(--fw-strong); }
.check-tier[data-tier="blocking"] .check-tier-h { color: var(--red); }
.check-tier[data-tier="warnings"] .check-tier-h { color: var(--amber); }
.checklist[data-can-proceed="false"] .check-foot { color: var(--red); }
.scope-section[data-scope="paused"] .scope-h { color: var(--amber); }

/* The step card and the sequence (section 4.15): a stack of cards with a
   delay pill between them. No control reorders a step. */
.sequence { display: flex; flex-direction: column; }
.sequence-steps { list-style: none; margin: 0; padding: 0; }
.sequence-item { display: block; }
.sequence-milestones { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.sequence-milestones-label { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-2); }
.sequence-milestones-text { font-size: var(--fs-meta); color: var(--text-2); }
.sequence-gap { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); padding: var(--sp-2) 0; }
.sequence-delay, .sequence-window { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-1) var(--sp-2); }
.delay-pill, .sequence-window-edit, .sequence-window-text {
  font: inherit; font-size: var(--fs-meta); color: var(--text); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r-round); padding: var(--sp-1) var(--sp-3);
}
.sequence-window-edit, .sequence-window-text { border-radius: var(--r-ctl); }
button.delay-pill, .sequence-window-edit { cursor: pointer; min-height: var(--ctl); }
button.delay-pill:hover, .sequence-window-edit:hover { background: var(--panel-2); }
.delay-edit { color: var(--text-2); }
.override-note { font-size: var(--fs-meta); color: var(--amber); }
.step-card { border: 1px solid var(--line-2); border-radius: var(--r-panel); background: var(--panel); padding: var(--sp-4); }
.step-card[data-copy-state="blocked"] { box-shadow: inset 4px 0 0 var(--red); }
.step-card[data-copy-state="waiting"] { box-shadow: inset 4px 0 0 var(--accent); }
.step-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.step-title { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-strong); }
.step-copy { display: grid; gap: var(--sp-1); margin: var(--sp-3) 0 0; }
.step-copy > div { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: var(--sp-3); }
.step-copy dt { font-size: var(--fs-meta); color: var(--text-3); }
.step-copy dd { margin: 0; overflow-wrap: anywhere; }
.step-more > summary { display: inline; cursor: pointer; color: var(--accent); margin-left: var(--sp-1); }
.step-copy dd:has(.step-more[open]) .step-body-cut { display: none; }
.step-body-full { margin-top: var(--sp-2); white-space: pre-wrap; }
.step-digest, .preview-digest { margin: var(--sp-2) 0 0; font-size: var(--fs-meta); color: var(--text-2); }
.step-digest-id { font-family: var(--mono); font-size: var(--fs-meta); }
.step-results { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); margin-top: var(--sp-3); }
.step-result { display: flex; flex-direction: column; gap: var(--sp-1); }
.step-result-label { font-size: var(--fs-meta); color: var(--text-3); }
.step-unreached { margin: var(--sp-3) 0 0; color: var(--text-2); }
.step-actions, .copy-actions, .preview-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

/* The copy editor: plain text on the cold lane, the findings under the
   fields, and a save offered only once they have been read. */
.copy-editor { display: flex; flex-direction: column; gap: var(--sp-3); }
.copy-editor textarea, .copy-editor input[type="text"] { width: 100%; font: inherit; font-size: var(--fs-body);
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--panel); color: var(--text); }
.copy-editor textarea { min-height: 12rem; resize: vertical; }
.copy-editor[data-plain="true"] textarea { font-family: var(--mono); }
.copy-note { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.copy-findings .checklist { margin-top: 0; }

/* The one question a copy change asks about leads already queued. */
.queued-question { border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: var(--sp-3) var(--sp-4); margin: 0; }
.queued-question legend { padding: 0 var(--sp-1); font-weight: var(--fw-strong); }
.queued-answers { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.queued-reach, .queued-none { margin: 0; color: var(--text-2); }

/* The pending-changes bar: sticky at the bottom while anything is unsaved. */
.pending-bar { position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--bg); border-top: 1px solid var(--line-2); }
.pending-count { margin: 0; }
.pending-review { flex: 1 1 auto; }
.pending-review > summary { list-style: none; display: inline-flex; }
.pending-review > summary::-webkit-details-marker { display: none; }
.pending-review[open] { flex-basis: 100%; }
.pending-diff { width: 100%; margin: var(--sp-3) 0; border-collapse: collapse; font-size: var(--fs-body); }
.pending-diff th, .pending-diff td { text-align: left; padding: var(--sp-2); border-bottom: 1px solid var(--line); }
.pending-diff thead th { font-size: var(--fs-meta); color: var(--text-3); }

/* The mail preview (section 4.24): the subject alone first, as an inbox
   row in a 390px strip, then the message. A warm HTML message is drawn
   only inside a sandboxed frame. */
.preview { display: flex; flex-direction: column; gap: var(--sp-3); }
.inbox-row { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 390px; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--panel); }
.inbox-from { font-weight: var(--fw-strong); }
.inbox-subject { font-weight: var(--fw-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-snippet { font-size: var(--fs-meta); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.preview-as { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-meta); color: var(--text-2); }
.mail[data-width="phone"] { max-width: 390px; }
.mail-html { padding: 0; }
.mail-frame { display: block; width: 100%; min-height: 24rem; border: 0; background: var(--bg); }
.mail-html[data-theme="dark"] .mail-frame { filter: invert(1) hue-rotate(180deg); }

/* Fixture data must never read as live. The deadline yellow, which this
   stylesheet spends nowhere else in Email, inside a dashed ink edge: noticed
   once and recognised after. It sits in the stop bar, so it is on every
   screen. No stripes; this file has no gradients. */
.demo-badge {
  font-size: var(--fs-meta); font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 4px;
  color: var(--on-yellow);
  background: var(--yellow);
  border: 1.5px dashed var(--on-yellow);
  white-space: nowrap;
}

.subnav {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.subnav::-webkit-scrollbar { height: 0; }
.subnav-item {
  flex: none; padding: 9px var(--sp-3); font-size: var(--fs-body); color: var(--text-2);
  text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav-item:hover { color: var(--text); }
.subnav-item[aria-current="page"] { color: var(--text); font-weight: var(--fw-strong); border-bottom-color: var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-meta); font-weight: var(--fw-strong); white-space: nowrap;
  border-radius: 999px; padding: 2px 9px;
  border: 1px solid transparent;
}
.chip[data-tone="ok"]   { background: var(--green-wash); color: var(--green); }
.chip[data-tone="warn"] { background: var(--amber-wash); color: var(--amber); }
.chip[data-tone="bad"]  { background: var(--red-wash); color: var(--red); }
.chip[data-tone="info"] { background: var(--accent-wash); color: var(--accent); }
/* Unknown is drawn as an absence: no fill, a dashed edge. It must never be
   mistaken for the green chip beside it. */
.chip[data-tone="unknown"] { background: transparent; color: var(--text-2);
  border: 1px dashed var(--line-2); font-weight: var(--fw-regular); }

.notice {
  border: 1px solid var(--line-2); border-left-width: 4px; border-radius: var(--r-md);
  padding: 14px var(--sp-4); margin-bottom: 20px;
}
.notice strong { display: block; font-size: var(--fs-body); margin-bottom: var(--sp-1); }
.notice p { margin: 0 0 10px; max-width: 76ch; color: var(--text-2); }
.notice[data-tone="warn"] { border-left-color: var(--amber); background: var(--amber-wash); }
.notice[data-tone="bad"]  { border-left-color: var(--red); background: var(--red-wash); }
.notice ul { color: var(--text-2); }

.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }

.figures {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: var(--sp-6);
}
.figure { padding: var(--sp-4) 18px; border-right: 1px solid var(--line); min-width: 0; }
.figure:last-child { border-right: none; }
.figure-k { font-size: var(--fs-meta); color: var(--text-3); font-weight: var(--fw-regular); }
.figure-v { font-size: var(--fs-figure); font-weight: var(--fw-strong); letter-spacing: -0.03em; line-height: 1.2; margin: 2px 0 var(--sp-2); }
.figure-of { font-size: var(--fs-body); font-weight: var(--fw-regular); color: var(--text-3); letter-spacing: 0; }
.figure-note { font-size: var(--fs-meta); color: var(--text-3); }
.figure-v .chip { font-size: var(--fs-body); vertical-align: 5px; }

/* The stat tile (34-W3-UI-SPEC.md section 4.3; ui/format.js). The only way a
   headline number is drawn: label and window, the count over its
   denominator in words, then the rate, the trend and the change in words.
   The whole tile is the door to its rows, so it is drawn as a link that
   reads as the page and not as blue text. */
.stat {
  display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0;
  padding: var(--sp-4); color: var(--text); text-decoration: none;
  border-right: 1px solid var(--line);
}
.figures > .stat:last-child { border-right: none; }
a.stat:hover { background: var(--panel-2); color: var(--text); }
a.stat:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stat-label { font-size: var(--fs-meta); color: var(--text-3); font-weight: var(--fw-regular); }
.stat-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-2); }
.stat-count { font-size: var(--fs-figure); font-weight: var(--fw-strong); line-height: var(--lh-figure);
  letter-spacing: -0.03em; }
.stat-of { font-size: var(--fs-meta); color: var(--text-3); }
.stat-line { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
  font-size: var(--fs-meta); color: var(--text-2); }
.stat-rate { font-size: var(--fs-body); font-weight: var(--fw-strong); color: var(--text); }
.stat-change, .stat-trend-note, .stat-needs { color: var(--text-2); }
.stat-norows { font-size: var(--fs-meta); color: var(--text-3); }
.stat-figure { display: flex; align-items: center; min-height: calc(var(--fs-figure) * 1.1); }
.stat[data-size="sm"] { padding: var(--sp-3); border-right: none; }
.stat[data-size="sm"] .rate-cell-count { font-size: var(--fs-body); font-weight: var(--fw-strong); }

/* The same number in a table cell or a card: "38 / 1,204" over "3.16%",
   right-aligned. The count is the link. */
.rate-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px;
  text-align: right; }
.rate-cell-count, .rate-cell-rate { display: inline-flex; align-items: center; gap: var(--sp-1); }
.rate-cell-rate { font-size: var(--fs-meta); color: var(--text-2); }
.rate-cell-needs, .rate-cell-norows { font-size: var(--fs-meta); color: var(--text-3); }

/* A trend in ink, no axes (section 6.9). Hollow under its minimum: dashed,
   with an open last point, so a trend from too few sends never reads as
   one from enough. */
.spark { flex: none; color: var(--chart-ink); overflow: visible; }
.spark-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round;
  stroke-linecap: round; }
.spark-dot { fill: currentColor; stroke: currentColor; stroke-width: 1; }
.spark[data-hollow="true"] .spark-line { stroke-dasharray: 3 2; }
.spark[data-hollow="true"] .spark-dot { fill: var(--bg); }
.c-ink { color: var(--chart-ink); }

.meter { height: 4px; background: var(--chip-hi); border-radius: 2px; margin-bottom: var(--sp-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }

.block { margin-bottom: 28px; }
.block h2 { font-size: var(--fs-body); font-weight: var(--fw-strong); margin: 0 0 var(--sp-2); letter-spacing: -0.01em; }
.block > p { margin: 0 0 var(--sp-3); max-width: 80ch; }

/* The sentence the Overview exists to say. */
.statement { font-size: var(--fs-title); font-weight: var(--fw-strong); letter-spacing: -0.02em;
  line-height: 1.3; max-width: 34ch; }
.statement[data-tone="bad"] { color: var(--red); }
.statement[data-tone="ok"] { color: var(--green); }

/* One bar per tier, each its own whole: the filled part is who gets reached
   and the empty part is who does not. Not scaled against each other. The
   tiers differ a hundredfold, and a bar four pixels long says nothing. */
.reach { display: flex; flex-direction: column; gap: 14px; margin-top: var(--sp-4); }
.reach-row { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: var(--sp-1) 18px; align-items: center; }
.reach-name { display: flex; flex-direction: column; font-size: var(--fs-body); }
.reach-name span { color: var(--text-3); font-size: var(--fs-meta); }
.reach-bar {
  height: 14px; border-radius: 3px; overflow: hidden;
  background: var(--chip);
  border: 1px solid var(--line-2);
}
.reach-bar i { display: block; height: 100%; background: var(--accent); }
.reach-nums { grid-column: 2; font-size: var(--fs-meta); color: var(--text-2); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }

.rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 11px 14px; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: none; }
.rows li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--fs-body); }
.rows li > div > span { color: var(--text-2); font-size: var(--fs-meta); }
.rows li > div > .muted { color: var(--text-3); }
.rows li > div > .chip { align-self: flex-start; margin-top: 3px; }

.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 7px var(--sp-4); margin: 0; font-size: var(--fs-body); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; }
/* A run of short facts, label over value. Each pair is one grid cell, so a
   label never parts from its value when the row wraps. */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-3) 20px; margin: 0; }
.facts dt { font-size: var(--fs-meta); color: var(--text-3); }
.facts dd { margin: 0; font-size: var(--fs-body); min-width: 0; overflow-wrap: anywhere; }
.facts dd[data-over="true"] { color: var(--red); font-weight: var(--fw-strong); }
.kv dd[data-over="true"] { color: var(--red); font-weight: var(--fw-strong); }
.rtable td[data-over="true"] { color: var(--red); font-weight: var(--fw-strong); }
/* The threshold beside an over-the-line rate stays quiet; the rate is the news. */
.facts dd[data-over="true"] .muted { font-weight: var(--fw-regular); }

.item { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4) 18px; margin-bottom: 14px; }
.item[data-status="paused"], .item[data-status="listed"] { border-left: 4px solid var(--red); }
.item[data-status="running"], .item[data-status="approved"] { border-left: 4px solid var(--green); }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.item-head h3 { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-strong); letter-spacing: -0.01em; }
.item-head p { margin: 2px 0 0; font-size: var(--fs-meta); }
.item-note { margin: var(--sp-3) 0 0; font-size: var(--fs-meta); color: var(--text-2); max-width: 86ch; }
.item-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.item .table-wrap { margin-top: 14px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.toolbar .search { min-width: 240px; flex: 1; max-width: 420px; }

.empty-line { border: 1px dashed var(--line-2); border-radius: var(--r-lg);
  padding: 22px 18px; display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.empty-line span { color: var(--text-3); font-size: var(--fs-body); }

.skeleton { display: flex; flex-direction: column; gap: var(--sp-3); }
.skeleton span { height: 76px; border-radius: var(--r-lg); background: var(--panel-2);
  animation: skeleton 1.1s ease-in-out infinite alternate; }
@keyframes skeleton { from { opacity: 0.45; } to { opacity: 1; } }

/* Copy, as the recipient will read it. A subject is read alone in an inbox,
   so it is set apart from the body it cannot borrow a qualifier from. */
.mail { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); max-width: 78ch; }
.mail-subject { padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: var(--fw-strong); }
.mail-subject .muted { font-weight: var(--fw-regular); font-size: var(--fs-meta); margin-right: 6px; }
.mail-body { padding: var(--sp-3) 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-body); line-height: 1.55; }
.hash { font-variant-numeric: tabular-nums; font-size: var(--fs-meta); letter-spacing: 0.02em; margin: var(--sp-2) 0 0; }

.findings { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.findings li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-body); }
.findings li span:last-child { display: block; color: var(--text-2); }

.checklist { margin-top: var(--sp-4); border-top: 1px solid var(--line); padding-top: 14px; }
.checklist li { display: flex; gap: 10px; font-size: var(--fs-body); padding: var(--sp-1) 0; }
.checklist li > div { display: flex; flex-wrap: wrap; gap: 2px var(--sp-2); }
.checklist li > div > span { color: var(--text-2); }
.check-mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-meta); font-weight: var(--fw-strong); background: var(--green-wash); color: var(--green); }
.checklist li[data-ok="false"] .check-mark { background: var(--red-wash); color: var(--red); }
.checklist li[data-ok="false"][data-severity="warn"] .check-mark { background: var(--amber-wash); color: var(--amber); }
.checklist-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-top: var(--sp-3); font-size: var(--fs-body); font-weight: var(--fw-strong); }

.disclosure { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 var(--sp-4); }
.disclosure > summary { cursor: pointer; padding: var(--sp-3) 0; font-weight: var(--fw-strong); font-size: var(--fs-body); min-height: 44px;
  display: flex; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 200px; gap: var(--sp-3) 14px; padding: var(--sp-1) 0 var(--sp-4); align-items: end; }
.form-grid .field input, .form-grid .field select { width: 100%; }
.field-wide { grid-column: 1 / -1; }
.form-grid .btn { justify-self: start; }

/* The decision dialog. A sheet from the bottom on a phone. */
.ask { width: min(480px, 100%); }
.ask h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-title); font-weight: var(--fw-strong); letter-spacing: -0.02em; }
.ask-body { color: var(--text-2); font-size: var(--fs-body); margin-bottom: 14px; }
.ask-body p { margin: 0 0 var(--sp-2); }
.ask textarea { width: 100%; resize: vertical; min-height: 76px; }
.ask-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-4); }

/* ---------- Email: the shared shell (34-W3-11a) ----------

   The rules for every component in static/email/ui/, on the tokens only
   (34-W3-UI-SPEC.md sections 2 and 4). A screen draws a number, a state and
   a table by importing a function; this is where each of those looks the
   same on every screen. 34-W3-11c's charts and mailbox squares and
   34-W3-11b's stream row are styled here too, so those parts edit no
   stylesheet. */

/* Contract 4.0: every control in the Email section. Disabled is a quiet
   fill with its reason beside it, never half opacity (that measured 2.2:1).
   `opacity: 1` here undoes the shell's own `.btn:disabled` dimming. */
#section-email .btn, #section-email .filter { min-height: var(--ctl); }
#section-email .btn:disabled, #section-email .btn[aria-disabled="true"],
#section-email .filter:disabled {
  opacity: 1; color: var(--text-3); background: var(--panel-2); border-color: var(--line);
  cursor: not-allowed;
}
#section-email .btn[aria-busy="true"] { pointer-events: none; }
#section-email :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; scroll-margin-top: 140px; }

/* Six tones (section 2.6). `idle` is "not sending, nothing wrong": a solid
   quiet chip, never the dashed `unknown`. Two states sharing a tone differ
   in shape: an outline, or a line through the word. */
.chip[data-tone="idle"] { background: var(--idle-wash); color: var(--idle); }
.chip[data-fill="outline"] { background: transparent; }
.chip[data-fill="outline"][data-tone="ok"] { color: var(--green); border-color: var(--green); }
.chip[data-fill="outline"][data-tone="warn"] { color: var(--amber); border-color: var(--amber); }
.chip[data-fill="outline"][data-tone="bad"] { color: var(--red); border-color: var(--red); }
.chip[data-fill="outline"][data-tone="info"] { color: var(--accent); border-color: var(--accent); }
.chip[data-fill="outline"][data-tone="idle"] { color: var(--idle); border-color: var(--line-2); }
.chip[data-fill="stop"] { background: var(--stop); color: var(--on-stop); border-color: var(--stop); }
.chip[data-strike="true"] { text-decoration: line-through; }

/* The state pill (4.2): a chip that is a button, the word, a chevron. */
.state-pill {
  font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-strong); line-height: var(--lh-tight);
  min-height: 28px; padding: var(--sp-1) var(--sp-2); cursor: pointer; appearance: none;
}
.chip[data-why]:hover { border-color: currentColor; }
.state-pill-chevron { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.state-sentence { margin: var(--sp-1) 0 0; font-size: var(--fs-meta); color: var(--text-2);
  line-height: var(--lh-body); max-width: 76ch; }

/* The screen head (4.22): the screen's answer, in ink, never colored. */
.screen-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4);
  margin-bottom: var(--sp-6); }
.screen-head-main { min-width: 0; }
.screen-sentence { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-strong);
  line-height: var(--lh-tight); color: var(--text); letter-spacing: -0.02em; max-width: 46ch; }
.screen-asof { margin: var(--sp-1) 0 0; font-size: var(--fs-meta); color: var(--text-3); }
.screen-head-side { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.range { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-ctl); overflow: hidden; }
.range-opt {
  font: inherit; font-size: var(--fs-meta); min-height: var(--ctl); padding: 0 var(--sp-3);
  background: var(--panel); color: var(--text-2); border: none; border-left: 1px solid var(--line);
  cursor: pointer;
}
.range-opt:first-child { border-left: none; }
.range-opt[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); font-weight: var(--fw-strong); }

/* The five state panels (4.20). Not connected, not built and the error are
   `.notice`, above; these are the empty state, the stale line and the
   skeleton shapes. */
.empty-state {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2);
  border: 1px dashed var(--line-2); border-radius: var(--r-panel);
  padding: var(--sp-12) var(--sp-6); margin-bottom: var(--sp-4);
}
.empty-state strong { font-size: var(--fs-body); font-weight: var(--fw-strong); }
.empty-state p { margin: 0; color: var(--text-2); font-size: var(--fs-body); max-width: 64ch; }
.stale-line { margin: var(--sp-1) 0 0; font-size: var(--fs-meta); color: var(--amber); }
.skeleton[data-shape="rows"] { gap: var(--sp-1); }
.skeleton[data-shape="rows"] span { height: var(--row); border-radius: var(--r-ctl); }
.skeleton[data-shape="tiles"] { flex-direction: row; flex-wrap: wrap; gap: var(--sp-4); }
.skeleton[data-shape="tiles"] span { flex: 1 1 160px; height: 96px; }
.skeleton[data-shape="card"] span { height: 200px; }
.skeleton[data-shape="chart"] span { height: 220px; }

/* The data table (4.4). Its head stays under the stop strip while the page
   scrolls, so the wrapper is not a scroll box above the phone tier. */
.data-table { margin-bottom: var(--sp-6); }
.data-table .table-wrap { overflow: visible; }
.table-filters { flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3);
  overflow-x: visible; }
.filter-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.filter-on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.scope-chip { min-height: 28px; }
.table-export { margin-left: auto; display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.table-export-note { font-size: var(--fs-meta); color: var(--text-3); }
.table-sort { display: none; align-items: center; gap: var(--sp-2); font-size: var(--fs-meta); color: var(--text-3); }
/* `.stage-select` gives it the shell's field look, and at the phone tier its
   44px height and the 16px text that keeps iOS from zooming. */
.table-sort-select { min-width: 0; }
.table-showing { font-variant-numeric: tabular-nums; }
.data-table th {
  position: sticky; top: 140px; z-index: calc(var(--z-sticky) - 1);
  font-size: var(--fs-meta); font-weight: var(--fw-strong);
}
.data-table td { font-size: var(--fs-body); line-height: var(--lh-tight); padding: var(--sp-3) var(--sp-4); }
.data-table tbody tr { height: var(--row); }
.data-table tr[data-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.data-table tr[data-row-href] { cursor: pointer; }
.data-table td[data-priority="1"] { font-weight: var(--fw-regular); }
.sort-head {
  font: inherit; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3);
  display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 28px;
  padding: 0; border: none; background: none; cursor: pointer;
}
th[aria-sort="ascending"] .sort-head, th[aria-sort="descending"] .sort-head { color: var(--text); }
.sort-arrow { font-size: var(--fs-meta); color: inherit; }
.row-name { color: var(--text); font-weight: var(--fw-strong); text-decoration: none; }
.cell-state { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1);
  margin-top: var(--sp-1); }
.row-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.select-col { width: 44px; }
.select-col input { width: 18px; height: 18px; }
.bulk-bar {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-2);
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-panel);
}
.bulk-bar[hidden] { display: none; }
.bulk-count { font-weight: var(--fw-strong); margin-right: var(--sp-2); }
.table-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3);
  font-size: var(--fs-meta); color: var(--text-3); }
.table-asof { margin-left: auto; }

/* The state rail (4.25): the summary that is also the filter. A zero is
   drawn, quietly, because here zero is measured. */
.state-rail { width: 200px; flex: none; }
.state-rail-total { margin: 0 0 var(--sp-2); font-size: var(--fs-meta); color: var(--text-3); }
.state-rail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.state-rail .rail-reasons { padding-left: var(--sp-4); margin-top: var(--sp-1); }
.rail-item { display: flex; width: 100%; justify-content: space-between; gap: var(--sp-2); }
.rail-word { min-width: 0; text-align: left; }
.rail-item[data-zero="true"] .num { color: var(--text-3); }
.rail-item[aria-pressed="true"][data-zero="true"] .num { color: var(--on-ink); }

/* The detail head (4.25): the ink band that opens a detail view. */
.email-detail-head { border-radius: var(--r-panel); margin-bottom: var(--sp-6); padding: var(--sp-6); }
.detail-back { display: inline-block; font-size: var(--fs-meta); margin-bottom: var(--sp-2); text-decoration: none; }
.detail-head-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); }
.detail-head-id { min-width: 0; }
.detail-name { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-strong); line-height: var(--lh-tight); }
.detail-state { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); margin-top: var(--sp-2); }
.email-detail-head .state-sentence, .email-detail-head .stat { color: var(--on-ink); }
.email-detail-head .stat-label, .email-detail-head .rate-cell-rate, .email-detail-head .stat-norows { color: var(--on-ink-2); }
.detail-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.detail-head-stats { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); }

/* The threshold bar (4.6): an 8px track of bands with 1px gaps, a 2px ink
   marker 16px tall, the bands named under it. No reading is a dashed empty
   track; no threshold is one quiet fill. */
.band { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.band-head { position: relative; height: calc(var(--fs-body) * 1.5); }
.band-value { position: absolute; top: 0; font-size: var(--fs-body); font-weight: var(--fw-strong); white-space: nowrap; }
.band-track { position: relative; display: flex; gap: 1px; height: 8px; background: var(--bg); border-radius: var(--r-mark); }
.band-seg { display: block; height: 100%; flex: none; }
.band-seg[data-band="ok"] { background: var(--band-ok); }
.band-seg[data-band="warn"] { background: var(--band-warn); }
.band-seg[data-band="bad"] { background: var(--band-bad); }
.band-mark { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--text); transform: translateX(-1px); }
.band-track[data-flat="true"] { background: var(--chip-hi); }
.band-track[data-empty="true"] { background: transparent; border: 1px dashed var(--line-2); }
.band[data-empty="true"] { align-items: flex-start; }
.band-labels { display: flex; gap: var(--sp-2); font-size: var(--fs-meta); color: var(--text-3); }
.band-labels span { flex: 1; min-width: 0; }
.band-labels span[data-band="bad"] { color: var(--text-2); }
.band-note { font-size: var(--fs-meta); color: var(--text-2); }
.band[data-size="mini"] .band-track { width: 80px; }

/* Charts (section 6): ink, cobalt for the selection, gray dashed for the
   comparison, hairline grid. Colors through `currentColor`, so one SVG is
   right in light and dark. */
.c-pick { color: var(--chart-pick); }
/* The dash is the drawing's own (`stroke-dasharray="4 2"`, contract 6.2): a
   declaration here would beat that attribute and draw 4 3. */
.c-ghost { color: var(--chart-ghost); }
.c-grid { color: var(--chart-grid); }

/* Mailbox squares (4.5): one per mailbox, by lifecycle state. A ring 1px
   outside the square marks a person's pause (amber) or an automatic one or
   a vendor error (red). Never alone: the legend in words sits beside them. */
.squares { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.sq {
  position: relative; flex: none; width: var(--sq); height: var(--sq); padding: 0;
  border: 1px solid var(--line-2); border-radius: var(--r-mark); background: var(--panel); cursor: pointer;
}
.sq[data-state="new"] { background: transparent; border-style: dashed; }
.sq[data-state="warming"] { background: var(--amber-wash); border-color: var(--amber); }
.sq[data-state="ramping"] { background: var(--green-wash); border-color: var(--green); }
.sq[data-state="active"] { background: var(--green); border-color: var(--green); }
.sq[data-state="resting"] { background: var(--chip-hi); border-color: var(--line-2); }
.sq[data-state="recovering"] { background: var(--red-wash); border-color: var(--red); }
.sq[data-state="retired"] { background: var(--panel-2); border-color: var(--line-2); overflow: hidden; }
.sq[data-state="retired"]::after {
  content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px;
  background: var(--text-3); transform: rotate(45deg);
}
.sq[data-ring="paused"] { outline: 2px solid var(--amber); outline-offset: 1px; }
.sq[data-ring="fault"] { outline: 2px solid var(--red); outline-offset: 1px; }
.sq:hover, .sq:focus-visible { box-shadow: 0 0 0 2px var(--text); }

/* The live stream row (4.12), in its three kinds: an operator's action
   (`data-kind="operator"`, the person in a cobalt outline tag), an automatic
   one (`data-kind="automatic"`, an ink tag on a quiet fill) and a mail event
   (`data-kind="mail"`, no tag, secondary text). A row that arrived since the
   last look holds the highlight, then fades; under reduced motion it is a
   left rule instead. */
.stream { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-panel); }
.stream-row {
  display: grid; grid-template-columns: 96px auto 1fr auto auto; align-items: baseline;
  gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line);
  font-size: var(--fs-body); transition: background-color var(--dur-3) var(--ease);
}
.stream-row:first-child { border-top: none; }
.stream-row[data-kind="automatic"] { background: var(--panel-2); }
.stream-row[data-kind="mail"] { color: var(--text-2); }
.stream-row[data-new="true"] { background: var(--hi); }
.stream-time { font-size: var(--fs-meta); color: var(--text-3); white-space: nowrap; }
.stream-day { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-meta); font-weight: var(--fw-strong);
  color: var(--text-3); background: var(--bg); border-top: 1px solid var(--line); }
.actor-tag {
  display: inline-flex; align-items: center; padding: 2px var(--sp-2);
  font-size: var(--fs-meta); font-weight: var(--fw-strong); white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--r-round);
}
.actor-tag[data-actor="person"] { color: var(--accent); border-color: var(--accent); }
.actor-tag[data-actor="automatic"] { background: var(--ink); color: var(--on-ink); }
.actor-tag[data-actor="rule"] { background: var(--chip); color: var(--text-2); }

@media (max-width: 1180px) {
  .state-rail { width: auto; }
  .state-rail ul { flex-direction: row; flex-wrap: wrap; }
  .rail-item { width: auto; }
}

/* The phone tier of the shell: controls reach a finger, the screen head
   stacks, a table row becomes a card with its priority facts in two
   columns, the sort is a select, the bulk bar sits above the tab bar. */
@media (max-width: 640px) {
  #section-email .btn, #section-email .filter, #section-email .range-opt { min-height: var(--tap); }
  .state-pill { min-height: 28px; padding-block: var(--sp-2); }
  .screen-head { flex-direction: column; align-items: stretch; gap: var(--sp-3); }
  .screen-head-side { flex-direction: column; align-items: stretch; }
  .range { display: flex; }
  .range-opt { flex: 1; }
  .table-sort { display: inline-flex; }
  .table-export { margin-left: 0; }
  .data-table th { position: static; }
  .data-table .table-wrap { overflow: hidden; }
  .data-table .rtable tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1) var(--sp-3);
    padding: var(--sp-3); background: var(--panel-2); }
  .data-table .rtable td { grid-column: 1 / -1; padding: 0; }
  .data-table .rtable td[data-priority="1"]:not(:first-child) { grid-column: auto; }
  .data-table tbody tr { height: auto; }
  .bulk-bar { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
  .figures > .stat { border-right: none; border-bottom: 1px solid var(--line); }
  .figures > .stat:last-child { border-bottom: none; }
  .stream-row { grid-template-columns: auto 1fr; }
  .stream-row > :nth-child(3) { grid-column: 1 / -1; }
}

/* Under reduced motion nothing moves (the shell's global rule stops every
   animation); these are the still forms the contract asks for. */
@media (prefers-reduced-motion: reduce) {
  .skeleton span { opacity: 0.7; }
  .stream-row[data-new="true"] { background: transparent; box-shadow: inset 2px 0 0 var(--accent); }
}

/* ---------- Email: the layer, the Why drawer, the stream row (34-W3-11b) ----------

   One layer for every drawer, sheet and menu (static/email/ui/overlays.js),
   at elevation level 2: the shadow, a --line-2 edge, the scrim behind a
   modal one. The layer and its scrim start under the stop strip
   (`--layer-top`, measured when the layer opens), so nothing covers Stop
   all. A drawer slides from the right, a sheet rises from the bottom; under
   reduced motion the shell's global rule makes both simply appear. */
.layer {
  position: fixed; top: var(--layer-top, 0px); right: 0; bottom: 0; left: 0;
  z-index: var(--z-drawer); pointer-events: none;
}
.layer[data-kind="sheet"], .layer[data-kind="menu"] { z-index: var(--z-sheet); }
.layer-scrim { position: absolute; inset: 0; background: var(--scrim); pointer-events: auto; }
.layer-panel {
  position: absolute; display: flex; flex-direction: column; pointer-events: auto;
  background: var(--panel); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  overflow-y: auto; overscroll-behavior: contain;
}
.layer[data-kind="drawer"] .layer-panel, .layer[data-kind="sheet"] .layer-panel {
  top: 0; right: 0; bottom: 0; width: min(var(--drawer), 100vw);
  border-radius: var(--r-panel) 0 0 var(--r-panel);
  animation: layer-from-right var(--dur-2) var(--ease);
}
.layer[data-kind="menu"] .layer-panel {
  top: var(--sp-4); right: var(--sp-4); min-width: 240px; max-width: 360px;
  border-radius: var(--r-panel);
}
@keyframes layer-from-right { from { transform: translateX(var(--sp-6)); opacity: 0; } }
@keyframes layer-from-below { from { transform: translateY(var(--sp-2)); opacity: 0; } }
.layer-head {
  display: flex; align-items: flex-start; justify-content: flex-end; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6) 0;
}
.layer-title { margin: 0 auto 0 0; font-size: var(--fs-title); font-weight: var(--fw-strong); line-height: var(--lh-tight); }
.layer-close {
  flex: none; min-width: var(--ctl); min-height: var(--ctl); padding: 0;
  font: inherit; font-size: var(--fs-body); color: var(--text); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r-ctl); cursor: pointer;
}
.layer-close:hover { background: var(--panel-2); }
.layer-body { padding: var(--sp-2) var(--sp-6) var(--sp-6); }

/* The Why drawer (4.2): head, what, why, who or what, what happens next,
   holding, do, recently. Each block is a hairline and a meta label. */
.why-blocks { display: flex; flex-direction: column; gap: var(--sp-4); }
.why-block { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.why-head { flex-direction: row; flex-wrap: wrap; align-items: center; }
.why-title { margin: 0; font-size: var(--fs-meta); font-weight: var(--fw-regular); color: var(--text-3); }
.why-kind { font-weight: var(--fw-strong); }
.why-what { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-strong); line-height: var(--lh-tight); }
.why-h {
  align-self: stretch; margin: 0; padding-top: var(--sp-3); border-top: 1px solid var(--line);
  font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3);
}
.why-block p { margin: 0; font-size: var(--fs-body); line-height: var(--lh-body); }
.why-block .why-rule { font-weight: var(--fw-strong); }
.why-block .why-evidence { font-size: var(--fs-meta); }
.why-block .why-vendor { font-size: var(--fs-meta); color: var(--text-2); }
.why-block .why-vendor[data-tone="warn"] { color: var(--amber); }
.why-block .why-readonly, .why-block .why-note { color: var(--text-2); }
.why-block .band { align-self: stretch; }
.why-actor { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.why-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.why-recent { margin-top: var(--sp-4); }
.why-recent-body { align-self: stretch; display: flex; flex-direction: column; gap: var(--sp-2); }
.why-recent-body .skeleton span { height: var(--sp-4); border-radius: var(--r-mark); }
.why-stream .stream-row { grid-template-columns: auto 1fr; }
.why-stream .stream-row > .stream-text { grid-column: 1 / -1; }
.why-all { font-size: var(--fs-meta); }

/* The stream row's parts (4.12). The time, tag and kind rules are above. */
.stream-who:empty, .stream-go:empty, .stream-more:empty { display: none; }
.stream-text { min-width: 0; }
.stream-link { font-size: var(--fs-meta); white-space: nowrap; }
.stream-more summary { font-size: var(--fs-meta); color: var(--text-2); cursor: pointer; }
.stream-more[open] { grid-column: 1 / -1; }
.stream-since {
  padding: var(--sp-2) var(--sp-4); font-size: var(--fs-meta); font-weight: var(--fw-strong);
  color: var(--accent); border-top: 1px solid var(--accent);
}
.stream-empty, .stream-paused { margin: 0; padding: var(--sp-4); color: var(--text-2); font-size: var(--fs-body); }
.stream-skeleton span { display: block; grid-column: 1 / -1; height: var(--sp-4); background: var(--chip); border-radius: var(--r-mark); }
.diff-table { width: 100%; margin-top: var(--sp-2); border-collapse: collapse; font-size: var(--fs-meta); }
.diff-table th, .diff-table td { padding: var(--sp-1) var(--sp-2); text-align: left; border-top: 1px solid var(--line); }
.diff-was { color: var(--text-2); text-decoration: line-through; }
.diff-now { font-weight: var(--fw-strong); text-decoration: none; }
.diff-none { color: var(--text-3); }

/* The pause switch (4.7): a 44x24 track, a 20px thumb, the word always
   beside it. Sending is a green track with the thumb right; a person's pause
   amber, an automatic one red, thumb left. In flight the thumb sits in the
   middle. Covered by a wider pause it is disabled and says by which. */
.switch-wrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.switch {
  position: relative; flex: none; width: 44px; height: 24px; padding: 0; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--r-round); background: var(--line-2);
  transition: background-color var(--dur-1) var(--ease);
}
.switch[data-tone="ok"] { background: var(--green); }
.switch[data-tone="warn"] { background: var(--amber); }
.switch[data-tone="bad"] { background: var(--red); }
.switch-thumb {
  position: absolute; top: 1px; left: 1px; width: 20px; height: 20px;
  border-radius: var(--r-round); background: var(--bg); transition: left var(--dur-1) var(--ease);
}
.switch[aria-checked="true"] .switch-thumb { left: 21px; }
.switch[aria-busy="true"] .switch-thumb { left: 11px; }
.switch:disabled { cursor: not-allowed; background: var(--chip-hi); border-color: var(--line-2); }
.switch-word { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text); }
.switch-note { font-size: var(--fs-meta); color: var(--text-2); }
.switch-cover {
  font: inherit; font-size: var(--fs-meta); color: var(--accent); background: none; border: none;
  padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

/* The action sheet (4.8): 44px rows, a disabled row with its reason under
   it, the final action last in red under a hairline. Cancel is a phone row. */
.menu { list-style: none; margin: 0; padding: 0; }
.menu-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); width: 100%;
  min-height: var(--tap); padding: var(--sp-2) var(--sp-3); font: inherit; font-size: var(--fs-body);
  text-align: left; color: var(--text); background: none; border: none; border-radius: var(--r-ctl); cursor: pointer;
}
.menu-row:hover { background: var(--panel-2); }
.menu-row[aria-disabled="true"] { color: var(--text-3); cursor: not-allowed; }
.menu-row[aria-disabled="true"]:hover { background: none; }
.menu-label { font-weight: var(--fw-regular); }
.menu-why { font-size: var(--fs-meta); color: var(--text-2); }
.menu-final { color: var(--red); }
.menu-sep { height: 1px; margin: var(--sp-1) 0; background: var(--line); }
.menu-pill { margin-bottom: var(--sp-2); }
.menu-cancel-row { display: none; }

/* The stepper (4.9): 44px minus and plus around a number field, the range
   beside, the effect sentence under. */
.stepper { display: flex; flex-direction: column; gap: var(--sp-2); }
.stepper-label { font-size: var(--fs-body); font-weight: var(--fw-strong); }
.stepper-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
#section-email .stepper-btn, .confirm-box .stepper-btn { min-width: var(--tap); min-height: var(--tap); font-size: var(--fs-title); }
.stepper-field {
  width: 96px; min-height: var(--tap); padding: 0 var(--sp-3); font: inherit; font-size: var(--fs-body);
  text-align: center; border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--panel); color: var(--text);
}
.stepper-field[aria-invalid="true"] { border-color: var(--red); }
.stepper-range { font-size: var(--fs-meta); color: var(--text-3); }
.stepper-effect { margin: 0; font-size: var(--fs-body); color: var(--text-2); }

/* The in-page confirm (4.10): consequences as a list of sentences, the
   evidence above the reason, and why the confirm cannot be pressed yet. */
.ask-consequences { margin: 0 0 var(--sp-3); padding-left: var(--sp-6); font-size: var(--fs-body); }
.ask-consequences li + li { margin-top: var(--sp-1); }
.ask-evidence { margin-bottom: var(--sp-3); }
.ask-checks { list-style: none; margin: 0 0 var(--sp-2); padding: 0; font-size: var(--fs-body); }
.ask-checks > li + li { margin-top: var(--sp-2); }
.ask-checks-foot, .ask-blocked { margin: var(--sp-2) 0 0; font-size: var(--fs-meta); color: var(--text-2); }
.ask-blocked:empty { display: none; }

/* The phone tier: every drawer, sheet and menu is a bottom sheet up to 85%
   of the height, its close control a full 44px target. */
@media (max-width: 640px) {
  .layer[data-kind] .layer-panel {
    top: auto; right: 0; bottom: 0; left: 0; width: auto; min-width: 0; max-width: none; max-height: 85%;
    border-radius: var(--r-panel) var(--r-panel) 0 0;
    animation: layer-from-below var(--dur-2) var(--ease);
  }
  .layer-close { min-width: var(--tap); min-height: var(--tap); }
  .menu-cancel-row { display: block; margin-top: var(--sp-2); }
  .menu-cancel { width: 100%; }
  .switch-wrap { min-height: var(--tap); }
  .layer-head { padding: var(--sp-3) var(--sp-4) 0; }
  .layer-body { padding: var(--sp-2) var(--sp-4) var(--sp-6); }
}

/* ---------- Email: the navigation in six groups, the filters, the picker (34-W3-11b) ----------

   Above the phone tier: two rows under the stop strip. Row 1 is the six
   group tabs and, at its right end, the two global filters; row 2 is the
   open group's screens. Neither scrolls sideways: the groups are a grid
   (`display: contents` lets each group's tab and screens take their own
   rows) and the screens wrap. At the phone tier the rows are not drawn: the
   picker under the stop strip names where you are and opens this same
   element as a bottom sheet. Only the top bar and the stop strip stick. */
.skip-links { position: relative; height: 0; }
.skip-link {
  position: absolute; top: 0; left: 0; z-index: var(--z-dialog); min-height: var(--ctl);
  padding: var(--sp-2) var(--sp-3); font: inherit; font-size: var(--fs-body); color: var(--on-ink);
  background: var(--ink); border: none; border-radius: var(--r-ctl); cursor: pointer; white-space: nowrap;
}
/* Out of sight until it has focus, and then in plain view. */
.skip-link:not(:focus) {
  width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%);
}
.topbar-role { font-size: var(--fs-meta); font-weight: var(--fw-regular); color: var(--text-3); }
.subnav-picker, .subnav-head, .subnav-scrim { display: none; }
#email-tabs.subnav {
  display: grid; grid-template-columns: repeat(6, max-content) minmax(0, 1fr); align-items: end;
  column-gap: var(--sp-1); overflow-x: visible;
}
#email-tabs .subnav-group { display: contents; }
.subnav-group-tab {
  grid-row: 1; display: inline-flex; align-items: center; gap: var(--sp-1);
  min-height: 44px; padding: 0 var(--sp-3); font-size: var(--fs-body); color: var(--text-2);
  text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav-group-tab:hover { color: var(--text); }
.subnav-group[data-current="true"] .subnav-group-tab {
  color: var(--text); font-weight: var(--fw-strong); border-bottom-color: var(--accent);
}
.subnav-screens {
  grid-row: 2; grid-column: 1 / -1; display: none; flex-wrap: wrap; gap: 2px;
  padding-top: var(--sp-1); border-top: 1px solid var(--line);
}
.subnav-group[data-current="true"] .subnav-screens { display: flex; }
#email-tabs .subnav-item { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 40px; }
.subnav-filters {
  grid-row: 1; grid-column: 7; justify-self: end; align-self: center;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2);
  padding-bottom: var(--sp-1);
}
.global-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.global-filter { display: inline-flex; align-items: center; gap: var(--sp-2); }
.global-filter-label { font-size: var(--fs-meta); color: var(--text-3); }
.global-select { min-height: var(--ctl); font-size: var(--fs-body); }
.global-select:disabled { color: var(--text-3); background: var(--panel-2); border-color: var(--line); cursor: not-allowed; }
.scope-chip-wrap { display: inline-flex; align-items: center; gap: var(--sp-1); }
.scope-clear {
  min-width: 28px; min-height: 28px; padding: 0; font: inherit; font-size: var(--fs-meta);
  color: var(--text-2); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-round);
  cursor: pointer;
}
.not-filtered { font-size: var(--fs-meta); color: var(--amber); }

/* A count beside a screen or a group: how many things there need a person.
   Absent when zero. The number and the tone together; the link's name says
   it in words. */
.nav-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
  padding: 0 var(--sp-1); font-size: var(--fs-meta); font-weight: var(--fw-strong);
  border-radius: var(--r-round); background: var(--accent-wash); color: var(--accent);
}
.nav-count[data-tone="bad"] { background: var(--red-wash); color: var(--red); }
.nav-count[data-tone="warn"] { background: var(--amber-wash); color: var(--amber); }
.picker-sep { margin: 0 var(--sp-1); color: var(--text-3); }
.picker-group { color: var(--text-2); }
.picker-screen { font-weight: var(--fw-strong); }
.nav-dot { display: none; }

@media (max-width: 900px) {
  .subnav-filters { grid-row: 3; grid-column: 1 / -1; justify-self: start; padding-top: var(--sp-2); }
}

@media (max-width: 640px) {
  .subnav-picker {
    display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 44px;
    margin-bottom: var(--sp-3); padding: 0 var(--sp-3); font: inherit; font-size: var(--fs-body);
    color: var(--text); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-ctl);
    cursor: pointer; text-align: left;
  }
  .subnav-picker-label { flex: 1; min-width: 0; display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1); }
  #email-tabs.subnav { display: none; }
  /* The sheet and its scrim start under the stop strip (`--picker-top`,
     measured when the picker opens), so Stop all is never covered. */
  #email-tabs.subnav[data-sheet="open"] {
    position: fixed; right: 0; bottom: 0; left: 0; z-index: var(--z-sheet); display: flex;
    flex-direction: column; align-items: stretch; gap: var(--sp-3); overflow-y: auto; margin: 0;
    max-height: min(85%, calc(100% - var(--picker-top, 0px)));
    padding: var(--sp-4); background: var(--panel); border: 1px solid var(--line-2); border-bottom: none;
    border-radius: var(--r-panel) var(--r-panel) 0 0; box-shadow: var(--shadow);
  }
  #email-tabs[data-sheet="open"] .subnav-head { display: flex; align-items: center; justify-content: space-between; order: -2; }
  .subnav-sheet-title { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-strong); }
  .subnav-sheet-close {
    min-width: 44px; min-height: 44px; font: inherit; font-size: var(--fs-body); color: var(--text);
    background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-ctl); cursor: pointer;
  }
  #email-tabs[data-sheet="open"] .subnav-filters { order: -1; grid-row: auto; grid-column: auto; justify-self: stretch; justify-content: flex-start; }
  #email-tabs .subnav-group { display: block; }
  #email-tabs .subnav-group-tab {
    min-height: var(--tap); padding: 0; font-size: var(--fs-meta); font-weight: var(--fw-strong);
    color: var(--text-3); border-bottom: none; text-transform: uppercase; letter-spacing: 0.04em;
  }
  #email-tabs .subnav-screens, #email-tabs .subnav-group[data-current="true"] .subnav-screens {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2);
    padding-top: 0; border-top: none;
  }
  #email-tabs .subnav-item {
    justify-content: center; min-height: 44px; padding: 0 var(--sp-2); white-space: normal; text-align: center;
    border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  }
  #email-tabs .subnav-item[aria-current="page"] { border-color: var(--accent); }
  .subnav-scrim[data-on="true"] {
    position: fixed; top: var(--picker-top, 0px); right: 0; bottom: 0; left: 0;
    z-index: calc(var(--z-sheet) - 1); display: block; background: var(--scrim);
  }
  .global-filter { flex: 1 1 120px; }
  .global-select { width: 100%; min-height: var(--tap); }
  .scope-clear { min-width: var(--tap); min-height: var(--tap); }
  /* Beside the pause dot the Email tab already shows: a count for anything
     in Email that needs a person, red for any bad and amber for any warn. */
  .nav-item[data-tab] .nav-dot:not([hidden]) {
    position: absolute; top: 4px; left: calc(50% + 20px); display: block; width: 9px; height: 9px;
    border-radius: var(--r-round); background: var(--amber);
  }
  .nav-item[data-tab] .nav-dot[data-tone="bad"] { background: var(--red); }
  .sidebar[data-expanded="true"] .nav-item[data-tab] .nav-dot:not([hidden]) {
    position: static; display: inline-block; margin-left: var(--sp-1);
  }
}

/* ---------- Responsive ----------

   Three tiers, and the one that carries the work is the last. The console is
   used standing up, phone in hand, so the screens that hold a decision get a
   single column rather than a workspace squeezed to nothing.

   1180  the workspace stops being two columns.
    900  the sidebar becomes one scrolling row and the topbar's actions become
         glyphs. The keyboard hint goes with them.
    640  the phone. Navigation leaves the scroll flow for a bottom tab bar,
         every control clears 44px, and text inputs reach 16px so iOS stops
         zooming the page when one takes focus. */

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .pane-list { max-height: 420px; position: static; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* One column means two auto rows; rows size to content and pack at the
     top, or the nav row grows to share the slack on a short section. */
  .shell { grid-template-columns: 1fr; align-content: start; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 8px; border-right: none; border-bottom: 1px solid var(--line);
    padding: 8px 12px; }
  /* One row that scrolls, not eleven rows that wrap. */
  .nav { flex-direction: row; flex-wrap: nowrap; gap: 2px;
    overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { width: 0; height: 0; }
  .nav-label { display: none; }
  .nav-item { width: auto; flex: none; white-space: nowrap; }
  .nav-item[aria-current="true"] { box-shadow: inset 0 -2px 0 var(--accent); }
  .main { padding: 0 16px; }
  .topbar { padding: 12px 0; gap: 10px; }
  .topbar h1 { flex: 1; min-width: 0; }
  .topbar-actions { flex: none; gap: 6px; }
  /* A keyboard shortcut, advertised on a device with no keyboard. Scoped to
     the palette button: `.kbd` is also how the outreach gate renders an
     artifact path, and hiding the class outright left "Artifact" followed by
     nothing. */
  #palette-open .kbd { display: none; }
  .btn-label { display: none; }
  .btn-ico { display: grid; }
  .btn.btn-icon { width: 44px; height: 44px; padding: 0; place-items: center; }
  .detail-head { padding: 22px 20px; }
  .next-call-figures { gap: 24px; }
  #email-stopbar { top: 68px; }
}

/* ---------- Phone ----------

   No declaration in this block may impose a px width above 252. That is the
   narrowest phone (320) less the shell's gutters (2 x 10) less the deepest
   padding a control sits inside (2 x 24). `tests/web/test_console_mobile.py`
   resolves every width declaration at this tier and fails the build over one
   that does not fit. */

@media (max-width: 640px) {
  :root { --tabbar: 58px; }

  .shell {
    padding-left: max(10px, env(safe-area-inset-left, 0px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 10px);
  }
  .main { padding: 0; }

  /* --- Navigation: a bottom tab bar --- */

  /* Out of the scroll flow entirely. */
  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 60;
    height: auto;
    flex-direction: column;
    /* Reset, not inherit: the 900px tier styles a centred, wrapping row, and
       both declarations misbehave once the direction is column. */
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    border-bottom: none;
    border-top: 1px solid var(--line-2);
    overflow: visible;
  }

  .brand { display: none; }
  .nav { flex-direction: row; flex-wrap: nowrap; overflow: visible; gap: 2px; }

  /* Four sections reach the bar; `data-tab` marks them in the markup. */
  .nav-item { display: none; }
  .nav-item[data-tab], .nav-more {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 2px 4px;
    min-height: 50px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    background: none;
  }
  .nav-item[data-tab][aria-current="true"] { box-shadow: inset 0 2px 0 var(--accent); background: none; }
  .nav-item[data-tab] > span:not(.nav-ico):not(.nav-badge),
  .nav-more > span:not(.nav-ico) {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  /* Short label on the bar, full label everywhere else. */
  .nav-item[data-tab] .nav-short { display: block; }
  .nav-item[data-tab] .nav-name { display: none; }

  .nav-ico { width: 24px; height: 24px; }
  .nav-ico svg { width: 21px; height: 21px; }

  /* A counter reads "36,347": honest in a sidebar, absurd on a 70px tab. It
     comes back in the sheet, which has the room. */
  .nav-badge { display: none; }
  /* The exception is a stop. If email is stopped, the tab says so. */
  .nav-item[data-tab] { position: relative; }
  .nav-item[data-tab] .nav-badge[data-tone="bad"],
  .nav-item[data-tab] .nav-badge[data-tone="warn"] {
    display: block; position: absolute; top: 4px; left: calc(50% + 8px);
    font-size: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--red);
  }
  /* And so is any narrower pause: amber, so it is not read as a stop. From
     another section the tab is the only part of Email on screen. */
  .nav-item[data-tab] .nav-badge[data-tone="warn"] { background: var(--amber); }

  /* --- Navigation: the overflow sheet --- */

  .sidebar[data-expanded="true"] {
    border-radius: 14px 14px 0 0;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    max-height: 82vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    background: var(--bg);
  }

  .sidebar[data-expanded="true"] .nav { flex-direction: column; gap: 1px; }

  .sidebar[data-expanded="true"] .nav-item,
  .sidebar[data-expanded="true"] .nav-more {
    display: flex;
    flex: none;
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 48px;
    padding: 6px 10px;
    font-size: 16px;
    text-align: left;
  }
  .sidebar[data-expanded="true"] .nav-item[aria-current="true"] {
    box-shadow: inset 2px 0 0 var(--accent); background: var(--panel-2); }

  .sidebar[data-expanded="true"] .nav-item > span:not(.nav-ico):not(.nav-badge),
  .sidebar[data-expanded="true"] .nav-more > span:not(.nav-ico) {
    white-space: normal; overflow: visible;
  }

  .sidebar[data-expanded="true"] .nav-item .nav-name { display: block; }
  .sidebar[data-expanded="true"] .nav-item .nav-short { display: none; }
  .sidebar[data-expanded="true"] .nav-label { display: block; padding: 12px 10px 4px; }
  .sidebar[data-expanded="true"] .nav-badge { display: block; }
  .sidebar[data-expanded="true"] .nav-item[data-tab] .nav-badge[data-tone="bad"],
  .sidebar[data-expanded="true"] .nav-item[data-tab] .nav-badge[data-tone="warn"] {
    position: static; font-size: 12px; width: auto; height: auto; background: none; }
  .sidebar[data-expanded="true"] .nav-user { display: block; }
  .sidebar[data-expanded="true"] .sheet-grip { display: block; }

  .sheet-grip {
    width: 38px; height: 4px; border-radius: 999px;
    background: var(--line-2); margin: 2px auto 6px; flex: none;
  }

  .nav-user {
    font-size: 13px; color: var(--text-3);
    padding: 2px 10px 6px;
  }

  .nav-scrim[data-on="true"] {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: var(--scrim);
  }

  /* --- Topbar --- */

  .topbar { padding: 8px 2px; margin-bottom: 12px; }
  .topbar h1 { font-size: 19px; }
  .topbar-user { display: none; }

  /* --- Density --- */

  .section { padding: 0 0 32px; }

  /* Three figures cannot sit beside each other at 375px. Saying so directly
     keeps the phone tier free of any px track width. */
  .stats { grid-template-columns: 1fr; margin-bottom: 12px; }
  .stat { padding: 14px; border-right: none; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: none; }
  .stat-expand { display: none; }

  .cliff { padding: 16px; gap: 12px; }
  .countdown { gap: 6px; }

  .detail-head { padding: 20px 16px 18px; }
  .next-call-figures { gap: 18px; margin-bottom: 18px; }
  .next-call-name { font-size: 22px; }
  .next-call-why { font-size: 15.5px; }
  .detail-body { padding: 18px 16px 22px; gap: 16px; }
  .detail-row { gap: 18px; }
  .rings { gap: 16px; justify-content: space-between; }

  .empty { padding: 24px 16px; }
  .empty h3 { font-size: 19px; }
  /* A config path is one word to a line-breaking algorithm. Wrapping it
     mid-token beats running it off the card. */
  .empty p, .empty h3 { overflow-wrap: anywhere; }

  .controls { padding: 14px; gap: 12px; margin-bottom: 12px; }
  .pane-head { padding: 10px; }
  th { padding: 10px; }
  td { padding: 11px 10px; }

  /* --- Fields --- */

  /* `.field-grow`'s 280px inside a padded card does not fit a 320px phone,
     and dropping the minimum alone is not enough: it still carries `flex: 1`
     and takes whatever is left at the end of a wrapped line. Every control
     row on a phone is a column, and every field in it is full width. */
  .controls, .assumptions { flex-direction: column; align-items: stretch; }
  .field, .field-grow { flex: none; width: 100%; min-width: 0; }
  .field input, .field select { min-width: 0; width: 100%; }

  /* --- Touch targets, and iOS's 16px rule --- */

  .btn { min-height: 44px; padding: 10px 16px; }
  .btn-sm { min-height: 44px; padding: 9px 14px; font-size: 15px; }
  .filter { min-height: 44px; padding: 9px 15px; font-size: 15px; }
  .field input, .field select, .stage-select { min-height: 44px; font-size: 16px; }
  .field textarea { font-size: 16px; }

  /* The height goes on the input, not on its wrapper: padding the wrapper
     makes the card 44px while the field a finger has to hit stays a 26px
     line box. */
  .search { min-height: 44px; padding: 0 12px; }
  .search input { min-height: 44px; font-size: 16px; }

  .palette input { font-size: 16px; }
  .palette-item { min-height: 44px; align-items: center; }
  .org-card { min-height: 56px; }
  .filters { gap: 6px; }

  /* --- Call queue, Outreach, Posting: list, then detail --- */

  /* One pane at a time. */
  .section[data-mobile-view="list"] .pane-detail { display: none; }
  .section[data-mobile-view="detail"] .pane-list { display: none; }

  /* In detail, the workspace is the screen. Everything the section stacks
     above it belongs to choosing a record, and is a tap away on Back. */
  .section[data-mobile-view="detail"] > *:not(.workspace) { display: none; }

  /* No nested scroll area on a phone: the page scrolls, the panes do not. */
  .pane-list { max-height: none; }
  .pane-body { overflow-y: visible; padding: 4px; }
  .pane-back { display: flex; }

  /* --- Email --- */

  /* The strip stays reachable while a long screen scrolls under it, and
     costs as little of the screen as it can (34-W3-UI-SPEC.md 3.3 and 4.1):
     sending is ONE 52px row, the state block in two short lines (the word
     with the pause count, then when it was read), the pause-part chevron
     alone at 44px and named in words, and Stop all. Stopped is two lines in
     76px: the state, then Resume the full width. Nothing is dropped: the
     pause count and the time read stay; what does not fit ends in "…" and is
     whole in the drawer the state block opens. */
  #email-stopbar { top: 60px; }
  .stopbar { gap: var(--sp-2); margin-bottom: var(--sp-2); }
  .stopbar[data-state="sending"] { height: calc(var(--tap) + var(--sp-2)); padding: 0 var(--sp-2); }
  .stopbar[data-state="sending"] .stopbar-state { flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    justify-content: center; min-height: var(--tap); line-height: var(--lh-tight); }
  .stopbar-line, .stopbar-asof, .stopbar-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* When the row is tight the word gives way and the pause count does not. */
  .stopbar-line { display: flex; min-width: 0; }
  .stopbar-line .stopbar-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .stopbar-line .stopbar-pauses { flex: none; }
  .stopbar[data-state="sending"] { gap: var(--sp-1); }
  .stopbar .demo-badge { letter-spacing: 0; padding: 2px var(--sp-1); }
  .stopbar-part { width: var(--tap); padding: 0; justify-content: center; }
  .stopbar-part-word { display: none; }
  .stopbar-part-mark { margin-left: 0; }
  .stopbar[data-state="stopped"] { height: calc(var(--tap) + var(--sp-8)); padding: 0 var(--sp-2);
    flex-wrap: wrap; align-content: center; row-gap: var(--sp-1); }
  .stopbar[data-state="stopped"] .stopbar-state { flex: 1 1 0; display: block; min-height: var(--sp-6);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: var(--sp-6); }
  .stopbar[data-state="stopped"] .stopbar-state > * { display: inline; }
  .stopbar[data-state="stopped"] .demo-badge { order: 0; }
  .stopbar[data-state="stopped"] .btn-resume { flex: 1 1 100%; }
  .stopbar[data-state="gate"], .stopbar[data-state="unconnected"] { padding: var(--sp-1) var(--sp-2); }
  .stopbar[data-state="gate"] .stopbar-state, .stopbar[data-state="unconnected"] .stopbar-state { min-height: var(--tap); }
  /* The scope sheet is a bottom sheet here, like every layer; its rows and
     its find field reach a finger. */
  .layer[data-kind="menu"][data-name="scope"] .layer-panel { width: auto; max-height: 85%; }
  .scope-find { min-height: var(--tap); font-size: 16px; }
  .scope-more { min-height: var(--tap); }
  /* The editing components on a phone: cards full width, numbers in two
     columns, the pending bar above the tab bar, every pill a 44px target. */
  .step-copy > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .step-results { display: grid; grid-template-columns: 1fr 1fr; }
  .checklist .check-line { grid-template-columns: var(--sp-6) minmax(0, 1fr); }
  .checklist .check-line > .check-text, .checklist .check-line > .check-link { grid-column: 2; }
  button.delay-pill, .sequence-window-edit { min-height: var(--tap); }
  .pending-bar { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
  .copy-editor textarea, .copy-editor input[type="text"] { font-size: 16px; }
  .demo-badge { order: 3; }
  .subnav { margin-bottom: 14px; }
  .subnav-item { min-height: 44px; padding: 12px 12px; font-size: 15px; display: flex; align-items: center; }
  .figures { grid-template-columns: 1fr; margin-bottom: 18px; }
  .figure { border-right: none; border-bottom: 1px solid var(--line); padding: 14px; }
  .figure:last-child { border-bottom: none; }
  .reach-row { grid-template-columns: 1fr; }
  .reach-nums { grid-column: 1; }
  .item { padding: 14px; }
  .item-actions .btn { flex: 1 1 auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .facts { grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .toolbar .search { min-width: 0; max-width: none; flex: 1 1 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .btn { justify-self: stretch; }
  .rows li { flex-direction: column; align-items: stretch; }

  /* A table of facts becomes a list of labelled facts. Five columns at 375px
     is a sideways scroll through numbers with no headings in view. */
  .rtable thead { display: none; }
  .rtable tr { display: block; padding: 10px 12px; border-top: 1px solid var(--line); }
  .rtable tbody tr:first-child { border-top: none; }
  /* The label floats left and the value flows beside it, right-aligned, and
     wraps under the label when it is long. This was a flex row, which made
     every text run and every <br> inside a cell its own flex item, side by
     side: a source filename and its hash would not wrap, pushed the row to
     397px inside a 368px wrapper, and cut the state name, the last pull and
     the status chip off at the right edge. */
  .rtable td { display: flow-root; padding: 3px 0; border: none; text-align: right;
    min-width: 0; overflow-wrap: anywhere; }
  .rtable td::before { content: attr(data-label); color: var(--text-3); font-size: 13px;
    float: left; text-align: left; margin-right: 14px; }
  .rtable td[data-over="true"]::before { font-weight: 400; }
  .rtable td[data-label=""]::before { content: none; }
  .rtable td[data-label=""] { text-align: left; padding-top: 8px; }
  .rtable td[data-label=""]:empty { display: none; }
  .rtable .when-abs { white-space: normal; }

  /* --- Overlays --- */

  .toast-stack {
    left: 12px; right: 12px; max-width: none; align-items: stretch;
    bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 12px);
  }
  .toast-region { align-items: stretch; }
  .toast { max-width: none; }

  /* A full-height sheet on a phone, the field at the top (contract 4.13). */
  .palette-backdrop { padding-top: 0; align-items: stretch; }
  .palette { width: 100vw; height: 100dvh; border-radius: 0; display: flex; flex-direction: column; }
  .palette-list { max-height: none; flex: 1; }

  /* The login page's phone tier is NOT here. The Login section below comes
     later in source order and wins at equal specificity, so its overrides
     live at the end of the file. */
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Login ----------

   The sign-in page is the same language as the console, not a second one. */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 32px 28px 28px;
}

.login-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 24px;
  font-family: var(--geo);
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.login-form .field input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-chip);
  background: var(--panel);
  color: var(--text);
}

.login-submit { width: 100%; margin-top: 4px; }

.login-error {
  margin-bottom: 18px;
  padding: 10px 12px;
  border-radius: var(--r-chip);
  border: 1px solid var(--red);
  background: var(--red-wash);
  color: var(--red);
  font-size: 14px;
}

/* Deliberately at the very end of the Login section: these are the last in
   source order, so the same overrides written in the main phone block lost
   to them and the sign-in field stayed at 15px, the size at which iOS zooms
   the page on focus. */
@media (max-width: 640px) {
  .login-card { padding: 26px 20px 24px; }
  .login-form .field input { font-size: 16px; min-height: 44px; }
  .login-submit { min-height: 46px; }
}

/* Federated sign-in, shown on /login only when a provider is configured. */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--text-3);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-federated {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-federated .btn {
  text-align: center;
  text-decoration: none;
}

/* ---------- Posting ---------- */

/* The posting gate's reasoning, one tap away. The action stays on the face
   of the card; this holds the count, the ordering rule and the artifact. */
.gate-why { margin-top: 8px; }

.gate-why > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent);
}
.gate-why > summary::-webkit-details-marker { display: none; }
.gate-why > summary::before {
  content: "";
  width: 0; height: 0;
  border: 5px solid transparent;
  border-left-color: currentColor;
  transition: transform 120ms ease;
}
.gate-why[open] > summary::before { transform: rotate(90deg) translateX(-2px); }
.gate-why > p { margin: 0 0 8px; }

/* On a phone, the posts come before the diagnostics. Approving a post does
   not depend on whether dispatch is unblocked, so the gate keeps its full
   text one scroll below rather than two screens above. */
@media (max-width: 640px) {
  /* `:not([hidden])` is load-bearing. An id outranks `.section[hidden]`, so
     without it this rule un-hides Posting underneath every other section. */
  #section-posting:not([hidden]) { display: flex; flex-direction: column; }
  #section-posting > .workspace   { order: 1; }
  #section-posting > #posting-stats { order: 2; margin-top: 14px; }
  #section-posting > #posting-gate  { order: 3; margin-top: 14px; }
}

/* ---------- the destination preview ---------- */

/* Sits inside `.detail-head`, the filled surface, so it is drawn on the page
   colour: a separate object from the chrome around it. Not a replica of any
   platform. No brand colour, no avatar, no like buttons; a convincing fake
   asserts what the platform will show, which nobody verified. */
.pv {
  background: var(--panel);
  color: var(--text);
  border-radius: var(--r-md);
  margin: 0 0 20px;
  max-width: 60ch;
  overflow: hidden;
}
.pv a { color: var(--accent); }
.pv .muted { color: var(--text-3); }

.pv-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 14px 9px;
  border-bottom: 1px solid var(--line);
}
.pv-dest { font-weight: 600; font-size: 13.5px; }
.pv-acct { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.pv-body {
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
}

/* THE FOLD. Everything after it is what a reader has to tap "more" to see,
   which is where an appended disclosure goes to die. */
.pv-fold {
  display: block;
  border-top: 1px dashed var(--red);
  margin: 10px 0;
}
.pv-after { color: var(--text-3); }

.pv-foot {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 9px 14px 10px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
}
.pv-over { color: var(--red); font-weight: 600; }

@media (max-width: 720px) {
  .pv-body { font-size: 14.5px; }
  .pv-foot { font-size: 12px; }
}

/* ---------- attached media ---------- */

/* The picture or video a post carries, at a size a reviewer can judge it at.
   A 1080 card scaled to 340px puts its qualifier line near 8px: present,
   unreadable, and approved anyway. So the ceiling is the viewport, with the
   full-size view one click away. */
.mv {
  display: block;
  max-width: 100%;
  width: auto;
  max-height: 70vh;
  border-radius: var(--r-md);
  background: var(--panel-2);
  margin: 0 0 4px;
}

.mv-link {
  display: block;
  cursor: zoom-in;
}

@media (max-width: 720px) {
  .mv { max-height: 60vh; }
}

/* What a missing credential buys, beside its name. */
.env-unlocks {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--chip);
  vertical-align: 1px;
}

/* Drops a drafts JSON straight into the queue. The outline appears only
   while a file is over the section. */
#section-posting[data-dropping="true"] {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
  border-radius: var(--r-lg);
}

/* Set a credential inline, from the row that says it is missing. The input
   is type=password and always empty on load: no endpoint returns a value. */
.env-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.env-row:last-child { margin-bottom: 0; }
.env-row code { font-size: 12px; }
.env-set { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.env-set input {
  width: 190px; padding: 5px 8px; font-size: 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-chip);
  background: var(--panel); color: inherit;
}

/* `.btn-sm` is defined once, above, with its 44px phone rule. Do not restate
   a button class down here: a later `min-height` silently cancels the phone
   one, and the touch-target guard exists because that happened. */

/* In-page confirmation. Replaces window.confirm, which blocks the renderer's
   main thread and with it every input event. */
.confirm-backdrop {
  position: fixed; inset: 0; z-index: 250;
  background: var(--scrim);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.confirm-box {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 22px 22px 18px;
  max-width: 480px; box-shadow: var(--shadow);
}
.confirm-box p { margin: 0 0 16px; line-height: 1.5; }
.confirm-box .controls { justify-content: flex-end; border: none; padding: 0; margin: 0; }

@media (max-width: 640px) {
  .confirm-backdrop { align-items: flex-end; padding: 0; }
  .confirm-box { max-width: none; width: 100%; border-radius: 14px 14px 0 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .confirm-box .controls { flex-direction: row; }
  .ask-actions .btn { flex: 1; }
}

/* The media preview in the approval hero. It sits between the copy and the
   Approve button so the picture cannot be skipped; see `postDetail` in
   console.js for why that ordering is load-bearing. */
.hero-media { margin: 14px 0 4px; }
.hero-media .k { margin-bottom: 6px; }
.hero-media .mv,
.hero-media video.mv {
  max-width: 100%;
  max-height: 46vh;
  height: auto;
  display: block;
  border-radius: var(--r-chip);
}

/* The text editor in the post detail. Collapsed by default: an approver's job
   is to read, and an open textarea invites edits nobody asked for. */
.edit-details > summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--accent);
  padding: 4px 0;
}
.edit-details textarea {
  width: 100%;
  font: inherit;
  line-height: 1.55;
  padding: 10px 12px;
  resize: vertical;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--r-chip);
}

/* ---------- Segments `#/email/segments` (34-W3-seg-03) ----------

   The saved list and the rule builder (UI-SPEC 5.17 and 4.16): two columns
   at the wide tier; at the phone tier the saved list, then one segment as
   its own view with the counts footer sticky above the tab bar while it is
   closed. Opened, the five counts take their place in the page rather than
   covering the conditions above them. */

.seg-layout { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0px, 1fr); gap: 20px; align-items: start; }
.seg-list, .seg-detail { min-width: 0px; }
.seg-saved { list-style: none; margin: 0px; padding: 0px; }
.seg-entry { border-top: 1px solid var(--line); padding: 4px 0px 8px; }
.seg-entry:first-child { border-top: none; }
.seg-item { display: block; padding: 10px 14px; color: var(--text); text-decoration: none; min-height: 36px; }
.seg-item[aria-current="true"] { box-shadow: inset 2px 0px 0px var(--accent); background: var(--panel-2); }
.seg-item-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.seg-item-meta, .seg-item-needs { display: block; font-size: var(--fs-meta); color: var(--text-2); margin: 2px 0px 0px; }
.seg-item-needs { padding: 0px 14px; }
.seg-feed { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 14px; font-size: var(--fs-meta); }
.seg-detail { padding: 16px 18px; }
.seg-back { display: none; margin-bottom: 8px; }
.seg-title { margin: 0px 0px 4px; overflow-wrap: anywhere; }
.seg-byline { margin: 0px 0px 8px; font-size: var(--fs-meta); color: var(--text-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg-match { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0px 8px; }
.seg-cards { list-style: none; margin: 0px 0px 8px; padding: 0px; display: grid; gap: 8px; }
.seg-inner { margin-top: 8px; }
.seg-card { border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 10px 12px; background: var(--panel); min-width: 0px; }
.seg-card[data-invalid="true"] { border-color: var(--red); box-shadow: inset 3px 0px 0px var(--red); }
.seg-card-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg-card-row select, .seg-card-row input, .seg-match select, .seg-byline select { min-height: 36px; max-width: 100%; }
.seg-card-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.seg-card-error { color: var(--red); font-size: var(--fs-meta); margin: 6px 0px 0px; }
.seg-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.seg-card-actions:empty { display: none; }
.seg-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg-chip { display: inline-flex; align-items: center; gap: 4px; }
.seg-chip-x { border: none; background: none; color: inherit; cursor: pointer; min-width: 24px; min-height: 24px; }
.seg-add { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-foot { margin-top: 12px; }
.seg-foot-line { display: none; }
.seg-foot-tiles { margin-bottom: 8px; }
.seg-foot-note, .seg-foot-empty, .seg-counting { font-size: var(--fs-meta); color: var(--text-2); }
.seg-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.seg-disabled { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg-sheet .field input { width: 100%; font-size: 16px; }
.seg-builder { min-width: 0px; }
.seg-card-words { overflow-wrap: anywhere; }
.seg-group { background: var(--panel-2); }
.seg-days { width: 7em; }
.seg-tile { min-width: 0px; }
.seg-choose, .seg-readonly { margin: 8px 0px; }
.seg-check-answer, .seg-save-answer { min-height: 1.5em; margin: 8px 0px 0px; }
.seg-foot-toggle { cursor: pointer; }
@media (max-width: 640px) {
  .seg-layout { grid-template-columns: minmax(0px, 1fr); }
  .seg-layout[data-open="true"] .seg-list { display: none; }
  .seg-layout[data-open="false"] .seg-detail { display: none; }
  .seg-back { display: inline-flex; }
  .seg-item { min-height: 44px; }
  .seg-card-row { flex-direction: column; align-items: stretch; }
  .seg-card-row select, .seg-card-row input, .seg-match select, .seg-byline select { width: 100%; min-height: 44px; font-size: 16px; }
  .seg-card-count { margin-left: 0px; }
  .seg-card-actions .btn, .seg-add .btn, .seg-actions .btn { min-height: 44px; }
  .seg-actions > .btn, .seg-actions > a { flex: 1 1 100%; }
  .seg-foot { position: sticky; bottom: calc(var(--tabbar, 58px) + env(safe-area-inset-bottom, 0px)); z-index: 2;
    background: var(--panel); border-top: 1px solid var(--line); padding: 8px 0px; }
  .seg-foot-line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 0px; }
  .seg-foot-line .btn { min-height: 44px; }
  .seg-foot[data-expanded="false"] .seg-foot-tiles, .seg-foot[data-expanded="false"] .seg-foot-note { display: none; }
  /* Opened, the five counts take their place in the page rather than
     covering the conditions above them. */
  .seg-foot[data-expanded="true"] { position: static; }
}
/* ---------- Email: Replies (34-W3-reply-03, contract 5.10 and 4.17) ----------

   Three panes at the wide tier (list, thread, facts); the facts under the
   thread below it; one pane at a time on a phone, chosen by the screen
   root's data-view, with the action bar sticky above the tab bar. */
.replies { display: flex; flex-direction: column; gap: var(--sp-4, 16px); min-width: 0px; }
.replies-filters { flex-wrap: wrap; overflow-x: visible; align-items: center; }
.replies-campaign { display: inline-flex; gap: var(--sp-2, 8px); align-items: center; font-size: var(--fs-meta, 13px); }
.replies-campaign select { max-width: 100%; min-width: 0px; }
.replies-export { margin: 0px; display: flex; gap: var(--sp-2, 8px); align-items: center; flex-wrap: wrap; font-size: var(--fs-meta, 13px); }
.replies-panes { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) minmax(200px, 260px); gap: var(--sp-4, 16px); align-items: start; }
.replies-panes > .pane { padding: var(--sp-3, 12px); min-width: 0px; overflow-wrap: anywhere; }
.reply-rows { list-style: none; margin: 0px; padding: 0px; display: flex; flex-direction: column; gap: 2px; }
.reply-row { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-2, 8px) var(--sp-3, 12px); border-radius: var(--r-ctl, 6px); color: var(--text); text-decoration: none; min-height: var(--row, 48px); }
.reply-row[aria-current="true"] { background: var(--accent-wash); box-shadow: inset 2px 0px 0px var(--accent); }
.reply-unhandled .reply-excerpt { font-weight: var(--fw-strong, 600); }
.reply-row-head { display: flex; gap: var(--sp-2, 8px); align-items: center; }
.reply-meta, .reply-handled { font-size: var(--fs-meta, 13px); color: var(--text-2); }
.replies-foot { display: flex; justify-content: space-between; gap: var(--sp-2, 8px); align-items: center; font-size: var(--fs-meta, 13px); margin: var(--sp-2, 8px) 0px 0px; flex-wrap: wrap; }
.replies-thread { display: flex; flex-direction: column; gap: var(--sp-3, 12px); }
.reply-heading { font-size: var(--fs-body, 15px); margin: 0px; }
.reply-kicker { font-size: var(--fs-meta, 13px); color: var(--text-2); margin: 0px; text-transform: uppercase; letter-spacing: 0.02em; }
.reply-said { margin: 0px; padding: var(--sp-3, 12px); border-left: 3px solid var(--line-2); background: var(--panel-2); white-space: pre-wrap; }
.reply-labels { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); }
.reply-license { font-family: var(--mono); font-size: var(--fs-meta, 13px); }
.reply-label kbd { font-family: var(--mono); font-size: var(--fs-meta, 13px); }
.reply-label[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); font-weight: var(--fw-strong, 600); }
.reply-effect, .reply-suppressed, .reply-readonly { margin: 0px; font-size: var(--fs-meta, 13px); color: var(--text-2); }
.reply-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); align-items: center; }
.reply-refused { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); align-items: center; }
.reply-refused p { margin: 0px; }
.reply-composer { display: flex; flex-direction: column; gap: var(--sp-2, 8px); }
.reply-composer[hidden] { display: none; }
.reply-composer textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; }
.reply-findings { margin: 0px; padding-left: var(--sp-4, 16px); font-size: var(--fs-meta, 13px); }
.reply-send { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.reply-send-why { margin: 0px; font-size: var(--fs-meta, 13px); color: var(--text-2); }
.reply-console { list-style: none; margin: 0px; padding: 0px; }
.replies-facts .facts { grid-template-columns: 1fr; }
.replies-back { display: none; }
.replies-choose { color: var(--text-3); margin: var(--sp-6, 24px) 0px; text-align: center; }
.replies-intake { margin: 0px; font-size: var(--fs-meta, 13px); color: var(--text-2); }
@media (max-width: 1180px) {
  .replies-panes { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); }
  .replies-facts { grid-column: 2; }
}
@media (max-width: 640px) {
  .replies-panes { grid-template-columns: minmax(0, 1fr); }
  .replies-facts { grid-column: 1; }
  .replies[data-view="thread"] .replies-list, .replies[data-view="thread"] .replies-filters,
  .replies[data-view="thread"] .replies-export { display: none; }
  .replies[data-view="list"] .replies-thread, .replies[data-view="list"] .replies-facts { display: none; }
  .replies-back { display: flex; min-height: var(--tap, 44px); align-items: center; }
  .reply-actions { position: sticky; bottom: calc(var(--tabbar, 58px) + env(safe-area-inset-bottom, 0px)); background: var(--bg); padding: var(--sp-2, 8px) 0px; z-index: 5; border-top: 1px solid var(--line); }
  .reply-actions .btn, .reply-label, .replies-filters .filter, .replies-foot .btn { min-height: var(--tap, 44px); }
  .reply-row { min-height: var(--tap, 44px); }
}
.reply-mail { max-width: none; }
.reply-showall summary { padding: var(--sp-1, 4px) 14px; cursor: pointer; font-size: var(--fs-meta, 13px); color: var(--accent); }

/* Operations `#/email/operations` (34-W3-ops-04a, contract 5.7): five panel
   buttons above the phone tier, a "Panel" select at it. */
.ops-panel-bar { margin: var(--sp-3, 12px) 0 var(--sp-4, 16px); }
.ops-panel { min-width: 0; }
.ops-read-only { margin: var(--sp-2, 8px) 0; }
.ops-panel-pick { display: none; align-items: center; gap: var(--sp-2, 8px); font-size: var(--fs-meta, 13px); color: var(--text-3); }
.ops-panel-pick select { flex: 1; min-width: 0; }
.ops-fault { color: var(--red, var(--text)); }
.ops-key { font-family: var(--mono, monospace); font-size: var(--fs-meta, 13px); }
.ops-check { display: flex; align-items: center; gap: var(--sp-2, 8px); min-height: var(--tap, 44px); }
.ops-field-label { font-size: var(--fs-meta, 13px); font-weight: var(--fw-strong, 600); }
@media (max-width: 640px) {
  .range.ops-panels { display: none; }
  .ops-panel-pick { display: flex; }
}
/* ---------- The notifications bell (34-W3-11d, contract 4.23) ----------

   A top-bar button with the unread count (red, "9+" past nine, nothing at
   zero) and a drawer of stream rows, unread first, read under a divider. */
.bell-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--red); color: var(--bg);
  font-size: 11px; font-weight: 600; line-height: 1;
}
.bell-count[hidden] { display: none; }
.bell-panel { display: flex; flex-direction: column; gap: var(--sp-3, 12px); }
.bell-top { display: flex; justify-content: flex-end; }
.bell-note { margin: 0; color: var(--text-2); font-size: var(--fs-meta); }
.bell-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bell-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.bell-item[data-read="true"] .stream-text { color: var(--text-2); }
.bell-row { list-style: none; margin: 0; padding: 0; }
.bell-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.bell-divider {
  margin: 8px 0 0; font-size: var(--fs-meta); font-weight: 600; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ---------- The key map (34-W3-11d, contract 8.3) ----------

   The row `j` and `k` select, and the shortcuts sheet: every key in words,
   with the switch that turns single keys off. */
#email-view li.stream-row[data-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); }
#email-view tr[data-selected="true"]:focus,
#email-view li.stream-row[data-selected="true"]:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.shortcuts { display: flex; flex-direction: column; gap: var(--sp-3); }
.shortcuts-note { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.shortcuts-table { width: 100%; border-collapse: collapse; font-size: var(--fs-meta); }
.shortcuts-table th, .shortcuts-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.shortcuts-table thead th { color: var(--text-2); font-weight: 600; }
.shortcuts-table kbd, .shortcuts-note kbd {
  font-family: var(--mono, ui-monospace, monospace); font-size: 12px; padding: 1px 5px;
  border: 1px solid var(--line-2); border-radius: 4px; background: var(--panel-2); white-space: nowrap;
}
#shortcuts-single[aria-checked="false"] { border-color: var(--line-2); color: var(--text-2); }
/* ---------- Email: Look up (34-W3-stats-05c, contract 5.18) ----------

   One box with its kind switch, the pick list (the shared data table, cards
   on a phone), and one person's record as labeled lines. The kind switch is a
   segmented control at desktop width and a row of chips under the field that
   scrolls inside itself on a phone; the record's actions are a sticky bar
   above the tab bar there. */
.recipient { display: flex; flex-direction: column; gap: var(--sp-4, 16px); min-width: 0px; overflow-wrap: anywhere; }
.recipient-box { display: flex; flex-direction: column; gap: var(--sp-2, 8px); }
.recipient-field-row { display: flex; gap: var(--sp-2, 8px); align-items: stretch; }
.recipient-q { flex: 1; min-width: 0px; font: inherit; font-size: 16px; min-height: var(--ctl, 36px);
  padding: 4px 12px; border: 1px solid var(--line-2); border-radius: var(--r-ctl, 6px); background: var(--panel); color: var(--text); }
.recipient-kinds { gap: 0px; border: 1px solid var(--line-2); border-radius: var(--r-ctl, 6px); align-self: flex-start;
  max-width: 100%; overflow-x: auto; }
.recipient-kinds .recipient-kind { border: none; border-left: 1px solid var(--line-2); border-radius: 0px; }
.recipient-kinds .recipient-kind:first-child { border-left: none; }
.recipient-kind[aria-pressed="true"], .recipient-other[aria-pressed="true"] {
  background: var(--ink); color: var(--on-ink); font-weight: var(--fw-strong, 600); }
.recipient-error { margin: 0px; color: var(--red); font-size: var(--fs-meta, 13px); }
.recipient-kind-line { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); align-items: center; }
.recipient-searched, .recipient-cap, .recipient-coverage-line { margin: 0px; }
.recipient-others { align-items: center; max-width: 100%; }
.recipient-others > .muted { flex: none; white-space: nowrap; }
.recipient-coverage summary { cursor: pointer; color: var(--text-2); font-size: var(--fs-meta, 13px); }
.recipient-source, .recipient-actions-note, .recipient-revealed-note { color: var(--text-2); font-size: var(--fs-meta, 13px); }
.recipient-dnc { font-size: var(--fs-meta, 13px); }
.recipient-fact + .recipient-fact { margin-top: var(--sp-2, 8px); }
.recipient-h { font-size: var(--fs-meta, 13px); text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-2);
  margin: var(--sp-4, 16px) 0px var(--sp-1, 4px); }
.recipient-record { display: flex; flex-direction: column; gap: var(--sp-2, 8px); }
.recipient-counts { margin: 0px; }
.recipient-timeline li { display: flex; flex-wrap: wrap; gap: 4px var(--sp-3, 12px); padding: 4px 0px; border-bottom: 1px solid var(--line); }
.recipient-when { color: var(--text-2); font-size: var(--fs-meta, 13px); min-width: 12em; }
.recipient-checks li { padding: 2px 0px; }
.recipient-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); align-items: center; margin-top: var(--sp-4, 16px); }
.recipient-off { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2, 8px); align-items: center; }
.recipient-viewer-note { font-weight: var(--fw-strong, 600); }
.recipient .field-error, .recipient-refused, .recipient-unsearchable, .recipient-verdict { margin: 0px; }
.recipient-body, .recipient-facts, .recipient-more { min-width: 0px; }
.recipient-value { font-weight: var(--fw-strong, 600); overflow-wrap: anywhere; }
.recipient-note, .recipient-none { color: var(--text-2); margin: 0px; }
.recipient-count { white-space: nowrap; }
.recipient-export { display: inline-flex; }
@media (max-width: 640px) {
  .recipient-field-row .btn, .recipient-q { min-height: var(--tap, 44px); }
  .recipient-kinds { flex-wrap: nowrap; gap: 6px; border: none; border-radius: 0px; align-self: stretch; }
  .recipient-kinds .recipient-kind { border: 1px solid var(--line-2); border-radius: 999px; flex: none; }
  .recipient-kinds .recipient-kind:first-child { border-left: 1px solid var(--line-2); }
  .recipient-actions { position: sticky; bottom: calc(var(--tabbar, 58px) + env(safe-area-inset-bottom, 0px)); z-index: 5;
    background: var(--bg); padding: var(--sp-2, 8px) 0px; border-top: 1px solid var(--line); }
  .recipient-actions .btn, .recipient-kind, .recipient-other { min-height: var(--tap, 44px); }
  .recipient-when { min-width: 0px; }
}

/* The Warm lane screen (34-W3-warm-03b, 34-W3-UI-SPEC.md section 5.8). */
.warm-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px) var(--sp-3, 12px);
  margin: 0px 0px var(--sp-4, 16px); }
.warm-state .state-sentence { flex: 1 1 18em; margin: 0px; }
.figure-cell { display: flex; flex-direction: column; min-width: 0px; border-right: 1px solid var(--line); }
.figure-cell > .stat { border-right: none; }
.figure-cell > .figure-note { padding: 0px var(--sp-4, 16px) var(--sp-3, 12px); margin: 0px; }
.figures > .figure-cell:last-child { border-right: none; }
.warm-readonly { color: var(--text-2); font-size: var(--fs-meta, 13px); margin: 0px 0px var(--sp-3, 12px); }
.warm-bar h3 { font-size: var(--fs-meta, 13px); margin: 0px 0px var(--sp-1, 4px); }
.warm-tabs { margin: 0px 0px var(--sp-4, 16px); }
.warm-tab-row { flex-wrap: wrap; }
.warm-tab-pick { display: none; }
.warm-question + .warm-question { margin-top: var(--sp-4, 16px); }
.warm-question h3 { font-size: var(--fs-body, 15px); margin: 0px 0px var(--sp-2, 8px); }
.warm-preview { display: flex; flex-direction: column; gap: var(--sp-3, 12px); min-width: 0px; }
.warm-preview .step-digest-id { overflow-wrap: anywhere; word-break: break-all; }
@media (max-width: 640px) {
  .figure-cell { border-right: none; border-bottom: 1px solid var(--line); }
  .warm-tab-row { display: none; }
  .warm-tab-pick { display: block; }
  .warm-tab-pick select { width: 100%; min-height: var(--tap, 44px); }
  .warm-state .switch, .warm-preview .btn { min-height: var(--tap, 44px); }
}

/* ======================================================================
   Social (34-W4-05a). The posting strip's place, the Social navigation,
   the landing, KC, and a rule for every class the posting components and
   the W4 screens emit (34-W4-UI-SPEC.md 2.1 and 4.1 to 5.7), so no later
   W4 plan edits this stylesheet. Written on the W3 tokens and W3's rule
   patterns only: no new colour, no network colour.
   ====================================================================== */

:root {
  --judge: 960px;          /* widest the media is drawn on Approve and the post detail */
  --thumb: 64px;           /* media thumbnail in a list row */
  --tile: 200px;           /* media tile in the Library grid */
  --step: 12px;            /* one custody square */
  --frame: 480px;          /* a preview frame's width at the wide tier */
  --cal-hour: 48px;        /* one hour row in the week calendar (= --row) */
  --fold: var(--line-2);   /* the fold line in a preview frame, 1px dashed */
  --over: var(--red);      /* a counter past its limit */
}
@media (max-width: 640px) { :root { --thumb: 56px; --step: 16px; } }

/* 4.1 The posting strip: W3's `.stopbar`, in `#social-holdbar`, stuck under
   the top bar on every Social screen like Email's. */
#social-holdbar { position: sticky; top: 68px; z-index: var(--z-sticky); background: var(--bg); padding-top: 2px; }
.stopbar[data-scope="posting"] .stopbar-word { white-space: nowrap; }
.stopbar[data-scope="posting"][data-state="gate"] strong { font-weight: var(--fw-strong); }
#home-holdbar { margin-bottom: var(--sp-3); }

/* The Social navigation: W3's grouped subnav, seven groups. */
#social-tabs.subnav {
  display: grid; grid-template-columns: repeat(7, max-content) minmax(0, 1fr); align-items: end;
  column-gap: var(--sp-1); overflow-x: visible;
}
#social-tabs .subnav-group { display: contents; }
#social-tabs .subnav-item { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 40px; }
#social-tabs .subnav-filters { grid-column: 8; }
/* A group of one screen has no second row; its tab is the screen's link. */
#social-tabs .subnav-group[data-single="true"] .subnav-screens { display: none; }
.not-available { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1); }
.not-available .chip { border-style: dashed; }

/* A moved screen's hosts and a not-built screen's view take turns. */
#section-posting > [hidden] { display: none; }
#section-home:not([hidden]) { display: block; }

@media (max-width: 900px) {
  #social-holdbar { top: 68px; }
  #social-tabs .subnav-filters { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  #social-holdbar { top: 60px; }
  #social-tabs.subnav { display: none; }
  #social-tabs.subnav[data-sheet="open"] {
    position: fixed; right: 0; bottom: 0; left: 0; z-index: var(--z-sheet); display: flex;
    flex-direction: column; align-items: stretch; gap: var(--sp-3); overflow-y: auto; margin: 0;
    max-height: min(85%, calc(100% - var(--picker-top, 0px)));
    padding: var(--sp-4); background: var(--panel); border: 1px solid var(--line-2); border-bottom: none;
    border-radius: var(--r-panel) var(--r-panel) 0 0; box-shadow: var(--shadow);
  }
  #social-tabs[data-sheet="open"] .subnav-head { display: flex; align-items: center; justify-content: space-between; order: -2; }
  #social-tabs[data-sheet="open"] .subnav-filters { order: -1; grid-row: auto; grid-column: auto; justify-self: stretch; justify-content: flex-start; }
  #social-tabs .subnav-group { display: block; }
  #social-tabs .subnav-group-tab {
    min-height: var(--tap); padding: 0; font-size: var(--fs-meta); font-weight: var(--fw-strong);
    color: var(--text-3); border-bottom: none; text-transform: uppercase; letter-spacing: 0.04em;
  }
  #social-tabs .subnav-screens, #social-tabs .subnav-group[data-current="true"] .subnav-screens,
  #social-tabs .subnav-group[data-single="true"] .subnav-screens {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2);
    padding-top: 0; border-top: none;
  }
  #social-tabs .subnav-item {
    justify-content: center; min-height: 44px; padding: 0 var(--sp-2); white-space: normal; text-align: center;
    border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  }
  #social-tabs .subnav-item[aria-current="page"] { border-color: var(--accent); }
  /* The strip stays on screen when a post's detail owns the phone: stopping
     posting is one tap from every Social screen (C11). An id outranks the
     `> *:not(.workspace)` rule that hides the rest of the section. */
  #section-posting[data-mobile-view="detail"] > #social-holdbar { display: block; }
  /* And the picker: any Social screen stays two taps away from a detail
     view (C3), so the picker, its sheet and its scrim survive it too. */
  #section-posting[data-mobile-view="detail"] > #social-picker { display: flex; }
  #section-posting[data-mobile-view="detail"] > #social-tabs[data-sheet="open"] { display: flex; }
  #section-posting[data-mobile-view="detail"] > #social-picker-scrim[data-on="true"] { display: block; }
  /* KC on a phone: W3's bottom sheet, confirm above Cancel, so the confirm
     lands under the thumb that opened it (contract 5.0). */
  .ask[data-kc] .ask-actions { flex-direction: column-reverse; align-items: stretch; }
  .ask[data-kc] .ask-actions .btn { min-height: var(--tap); }
}

/* 4.3 Network chip: a W3 chip that is a button. The long word above the
   phone tier, the server's short word at it. */
.net-chip {
  display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 28px; padding: 2px var(--sp-2);
  font: inherit; font-size: var(--fs-meta); color: var(--text); background: var(--chip);
  border: 1px solid var(--line-2); border-radius: var(--r-chip); cursor: pointer;
}
.net-chip:hover { background: var(--chip-hi); }
.net-chip-short { display: none; }
.net-chip-state { font-weight: var(--fw-strong); }
.net-chip[data-tone="ok"] { background: var(--green-wash); color: var(--green); }
.net-chip[data-tone="warn"] { background: var(--amber-wash); color: var(--amber); }
.net-chip[data-tone="bad"] { background: var(--red-wash); color: var(--red); }
.net-chip[data-tone="info"] { background: var(--accent-wash); color: var(--accent); }
.net-chip[data-tone="idle"] { background: var(--idle-wash); color: var(--idle); }
.net-chip[data-tone="unknown"] { background: transparent; border-style: dashed; color: var(--text-2); }
@media (max-width: 640px) {
  .net-chip { min-height: var(--tap); }
  .net-chip-long { display: none; }
  .net-chip-short { display: inline; }
}

/* 4.4 Custody squares: the mailbox squares, applied to the five hand-offs. */
.custody { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.custody-sq {
  width: var(--step); height: var(--step); border: 1px solid var(--line-2); border-radius: var(--r-mark);
  background: transparent; position: relative; overflow: hidden;
}
.custody-sq[data-step-state="done"] { background: var(--text-2); border-color: var(--text-2); }
.custody-sq[data-step-state="current"] { outline: 2px solid var(--text-2); outline-offset: 1px; }
.custody-sq[data-step-state="todo"] { background: transparent; }
.custody-sq[data-step-state="skip"]::after {
  content: ""; position: absolute; inset: 0;
  border-top: 1px solid var(--text-3); transform: translateY(50%) rotate(-45deg); transform-origin: center;
}
.custody-sq[data-tone="ok"][data-step-state="done"] { background: var(--green); border-color: var(--green); }
.custody-sq[data-tone="ok"][data-step-state="current"] { outline-color: var(--green); }
.custody-sq[data-tone="warn"][data-step-state="done"] { background: var(--amber); border-color: var(--amber); }
.custody-sq[data-tone="warn"][data-step-state="current"] { outline-color: var(--amber); }
.custody-sq[data-tone="bad"][data-step-state="done"] { background: var(--red); border-color: var(--red); }
.custody-sq[data-tone="bad"][data-step-state="current"] { outline-color: var(--red); }
.custody-sq[data-tone="info"][data-step-state="done"] { background: var(--accent); border-color: var(--accent); }
.custody-sq[data-tone="info"][data-step-state="current"] { outline-color: var(--accent); }
.custody-sq[data-tone="idle"][data-step-state="current"] { outline-color: var(--idle); }
.custody-sq[data-dashed] { border-style: dashed; outline-style: dashed; }
.custody-label { font-size: var(--fs-meta); color: var(--text-2); margin-left: var(--sp-1); }

/* 4.5 Post card: the table card on the scorecard frame, in three sizes. */
.post-card {
  display: grid; grid-template-columns: var(--thumb) minmax(0, 1fr); gap: var(--sp-3); align-items: start;
  padding: var(--sp-3); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.post-card[data-size="row"] { border-radius: 0; border-width: 0 0 1px; background: transparent; }
.post-card[data-size="mini"] { grid-template-columns: 32px minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-2); }
.post-card[data-tone="bad"] { border-left: 2px solid var(--red); }
.post-card[data-tone="warn"] { border-left: 2px solid var(--amber); }
.post-card[data-tone="info"] { border-left: 2px solid var(--accent); }
.post-card[data-tone="ok"] { border-left: 2px solid var(--green); }
.post-thumb {
  width: var(--thumb); height: var(--thumb); border-radius: var(--r-md); background: var(--panel-2);
  object-fit: cover; position: relative; overflow: hidden; border: 1px solid var(--line);
}
.post-card[data-size="mini"] .post-thumb { width: 32px; height: 32px; }
.post-thumb[data-none] { border-style: dashed; display: grid; place-items: center; color: var(--text-3); font-size: var(--fs-meta); }
.post-play {
  position: absolute; inset: auto var(--sp-1) var(--sp-1) auto; padding: 0 var(--sp-1);
  font-size: var(--fs-meta); color: var(--on-ink); background: var(--ink); border-radius: var(--r-mark);
}
.post-first { font-size: var(--fs-body); font-weight: var(--fw-strong); overflow-wrap: anywhere; }
.post-meta { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); font-size: var(--fs-meta); color: var(--text-2); }
.post-sentence { margin: var(--sp-1) 0 0; font-size: var(--fs-body); color: var(--text-2); }
.post-when { font-size: var(--fs-meta); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.post-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-2); }
.post-more { font-size: var(--fs-meta); color: var(--text-2); }

/* 4.6 Preview frame: the text where it breaks and folds, never a replica of
   a network's chrome. */
figure.preview-frame {
  width: min(var(--frame), 100%); margin: 0; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r-panel); overflow: hidden;
}
.pf-head { display: flex; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line); font-size: var(--fs-meta); color: var(--text-2); }
.pf-count { font-variant-numeric: tabular-nums; }
.pf-count[data-over] { color: var(--over); font-weight: var(--fw-strong); }
.pf-fold { display: block; margin: var(--sp-2) 0; border-top: 1px dashed var(--fold); }
.pf-body { padding: var(--sp-3); font-size: var(--fs-body); font-weight: var(--fw-regular); white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-below { color: var(--text-3); }
.pf-part + .pf-part { border-top: 1px solid var(--line); }
.pf-line { display: block; }
.pf-foot { padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--line); font-size: var(--fs-meta); color: var(--text-2); }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--frame), 100%), 1fr)); gap: var(--sp-3); }

/* 4.7 Timeline: the stream row, per day. */
.timeline { margin: 0; padding: 0; list-style: none; }
.tl-day { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em; }
.tl-entry { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line); font-size: var(--fs-body); }
.tl-entry[data-kind="failure"] .tl-glyph { color: var(--red); }
.tl-entry[data-kind="hold"] .tl-glyph { color: var(--amber); }
.tl-entry[data-kind="confirm"] .tl-glyph { color: var(--green); }
.tl-entry[data-hollow] .tl-glyph { opacity: 0.6; }
.tl-glyph { color: var(--text-2); text-align: center; }
.tl-live { font-size: var(--fs-meta); color: var(--accent); }

/* 4.8 Media: the viewer at judging size, the region strip, the tiles. */
.media-viewer { display: block; max-width: var(--judge); width: 100%; margin: 0 auto; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--r-md); }
.media-viewer[data-size="judge"] { max-width: var(--judge); }
.media-viewer[data-size="tile"] { max-width: var(--tile); }
.media-facts { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: var(--sp-2) 0; font-size: var(--fs-meta); color: var(--text-2); }
.region-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-1); margin: var(--sp-2) 0; }
.region-strip[data-video] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.region { min-height: var(--tap); padding: 0; background: var(--panel-2); border: 1px solid var(--line-2);
  border-radius: var(--r-mark); cursor: pointer; overflow: hidden; }
.region[data-opened] { border-color: var(--text-2); box-shadow: inset 0 0 0 1px var(--text-2); }
.region-view { display: block; max-width: var(--judge); width: 100%; }
.region-step { display: flex; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-2); font-size: var(--fs-meta); }
.text-read { margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); background: var(--panel-2);
  border-left: 2px solid var(--line-2); font-size: var(--fs-body); white-space: pre-wrap; }
.review-block { margin: var(--sp-3) 0; padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-panel); }
.media-tile { display: grid; gap: var(--sp-1); padding: var(--sp-2); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-panel); }
.media-tile-thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--panel-2); border-radius: var(--r-md); position: relative; }
.media-tile-play { font-size: var(--fs-meta); color: var(--on-ink); background: var(--ink); border-radius: var(--r-mark); padding: 0 var(--sp-1); }
.media-tile-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.media-tile[data-selecting] { box-shadow: inset 2px 0 0 var(--accent); }

/* 4.9 Action bar: sticky above the tab bar at the phone tier. */
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3) 0;
  border-top: 1px solid var(--line); background: var(--bg); }
.action-bar-reason { flex: 1 1 100%; margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
@media (max-width: 640px) {
  .action-bar { position: sticky; bottom: calc(var(--tabbar, 58px) + env(safe-area-inset-bottom, 0px)); z-index: 5; }
  .action-bar .btn { min-height: var(--tap); }
}

/* 4.10 Posting calendar: week, month and agenda. */
.cal-week { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-hour { height: var(--cal-hour); font-size: var(--fs-meta); color: var(--text-3); border-bottom: 1px solid var(--line); }
.cal-day { position: relative; border-left: 1px solid var(--line); min-width: 0; }
.cal-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); }
.cal-slot { margin: 2px; border: 1px dashed var(--line-2); border-radius: var(--r-mark); min-height: 24px; }
.cal-best { background: var(--panel-2); }
.cal-chip { display: flex; align-items: center; height: 24px; margin: 0 2px 8px; padding: 0 var(--sp-1); font-size: var(--fs-meta);
  background: var(--chip); border: 1px solid var(--line-2); border-radius: var(--r-chip); overflow: hidden; white-space: nowrap; }
.cal-ghost { opacity: 0.5; border-style: dashed; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.cal-more { font-size: var(--fs-meta); color: var(--text-2); }
.cal-agenda { margin: 0; padding: 0; list-style: none; }
.cal-agenda-day { min-height: var(--tap); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.cal-deadline { background: var(--yellow); color: var(--on-yellow); border-radius: var(--r-mark); padding: 0 var(--sp-1); font-size: var(--fs-meta); }
@media (max-width: 640px) {
  .cal-week, .cal-month { display: none; }
  .cal-agenda-day, .cal-chip { min-height: var(--tap); height: auto; }
}

/* 4.11 Slot editor: a grid of 44px toggles. */
.slot-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(var(--tap), 1fr)); gap: var(--sp-1); }
.slot-cell { min-width: var(--tap); min-height: var(--tap); background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r-ctl); cursor: pointer; }
.slot-cell[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.slot-time { font-size: var(--fs-meta); color: var(--text-2); align-self: center; }
.slot-default { font-size: var(--fs-meta); color: var(--text-3); }

/* 4.12 Channel card: the scorecard frame. */
.channel-card { padding: var(--sp-3) var(--sp-4); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-panel); }
.channel-line { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); gap: var(--sp-1) var(--sp-3);
  padding: var(--sp-1) 0; font-size: var(--fs-body); }
.channel-line-k { color: var(--text-2); }

/* 4.13 Comment row: the reply list row. */
.comment-row { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line); }
.comment-row[data-unread] { font-weight: var(--fw-strong); }
.comment-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: var(--r-round); background: var(--accent); }

/* 4.14 Results row: the data table row with `rateCell`. */
.result-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-age { font-size: var(--fs-meta); color: var(--text-3); }

/* 4.15 Needs-me row and 4.16 action card: W3's attention card (a notice). */
.needs-row, .action-card { padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-2); background: var(--panel);
  border: 1px solid var(--line); border-left: 2px solid var(--line-2); border-radius: var(--r-md); }
.needs-row[data-tone="bad"], .action-card[data-tone="bad"] { border-left-color: var(--red); }
.needs-row[data-tone="warn"], .action-card[data-tone="warn"] { border-left-color: var(--amber); }
.needs-row[data-tone="info"], .action-card[data-tone="info"] { border-left-color: var(--accent); }
.needs-source { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.action-card-basis { margin: var(--sp-1) 0 0; font-size: var(--fs-meta); color: var(--text-2); }

/* 5.4 Compose. */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--frame)); gap: var(--sp-4); }
.compose-write, .compose-preview { min-width: 0; }
.compose-step { margin: 0 0 var(--sp-2); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3); }
.net-toggle { display: inline-flex; align-items: center; min-height: var(--ctl); padding: 0 var(--sp-3); font: inherit;
  font-size: var(--fs-body); background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-chip); cursor: pointer; }
.net-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--text); font-weight: var(--fw-strong); }
.version-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-1); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-3); }
.kind-fit { font-size: var(--fs-meta); color: var(--text-2); }
@media (max-width: 640px) {
  .compose { grid-template-columns: 1fr; }
  .net-toggle { min-height: var(--tap); }
}

/* 5.5 Approve: one column, the picture at judging width, centred. */
.approve-item { max-width: var(--judge); margin: 0 auto; display: grid; gap: var(--sp-3); }
.approve-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.approve-why { margin: 0; color: var(--text-2); font-size: var(--fs-body); }
@media (max-width: 640px) {
  .approve-item .media-viewer { border-radius: 0; margin-left: calc(-1 * var(--sp-4)); width: calc(100% + 2 * var(--sp-4)); max-width: none; }
}

/* 5.7 Library: five, three and two per row by tier. */
.media-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 1180px) { .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Email: Calendar (34-W3-mgmt-02, contract 5.3 and 4.19) ---------- */
.cal { display: block; min-width: 0; }
.cal-head { background: var(--panel); }
.cal-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-3) 0; }
.cal-month-name { font-weight: var(--fw-strong); margin-right: auto; }
.cal-filters { flex-wrap: wrap; }
.cal-toggle-off { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-meta); }
.cal-grid { display: grid; gap: 0; border: 1px solid var(--line); margin-top: var(--sp-3); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd { padding: var(--sp-1) var(--sp-2); font-size: var(--fs-meta); color: var(--text-3); border-bottom: 1px solid var(--line); }
.cal-wd abbr { text-decoration: none; }
.cal-day { position: relative; min-height: 112px; padding: var(--sp-2); border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--sp-1);
  font-size: var(--fs-meta); cursor: pointer; overflow-wrap: anywhere; scroll-margin-top: 140px; }
.cal-row > .cal-day:last-child { border-right: 0; }
.cal-blank { cursor: default; background: var(--panel-2); }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day[data-today="true"] { box-shadow: inset 0 2px 0 var(--accent); }
.cal-day[data-past="true"], .cal-day[data-past="true"] .cal-mark { color: var(--text-3); }
.cal-date { font-size: var(--fs-body); font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; }
.cal-bar { display: block; height: 6px; background: var(--panel-2); border: 1px solid var(--line); }
.cal-bar > span { display: block; height: 100%; background: var(--ink); }
.cal-count, .cal-sent { font-variant-numeric: tabular-nums; }
.cal-count[data-over="true"] { color: var(--red); font-weight: var(--fw-strong); }
.cal-marks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cal-mark, .cal-more { line-height: 1.3; }
.cal-more { color: var(--text-3); }
.cal-flag { display: inline-block; padding: 0 3px; background: var(--yellow); color: var(--on-yellow); }
.cal-span { display: block; height: 4px; background: var(--line-2); margin: 0 calc(-1 * var(--sp-2)); }
.cal-agenda { display: none; }
.cal-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-1); }
.cal-lines a { display: inline-block; }
.layer [data-cal-drawer] { gap: var(--sp-2); }
@media (max-width: 640px) {
  .cal-grid { display: none; }
  .cal-agenda { display: block; margin-top: var(--sp-3); }
  .cal-jump { display: grid; gap: var(--sp-1); margin-bottom: var(--sp-3); }
  .cal-jump input { min-height: var(--tap); width: 100%; box-sizing: border-box; }
  .cal-agenda-day { padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
  .cal-agenda-day[data-today="true"] { box-shadow: inset 0 2px 0 var(--accent); }
  .cal-agenda-date { margin: 0 0 var(--sp-1); font-size: var(--fs-meta); color: var(--text-3); }
  .cal-lines li { overflow-wrap: anywhere; }
  .cal-lines a { padding: 12px 0; }
  .cal-controls .btn, .cal-filters .filter { min-height: var(--tap); min-width: var(--tap); }
}

/* Campaigns `#/email/campaigns` and one campaign `?id=` (34-W3-ops-04b,
   contract 5.4): capacity as one collapsed line, the row's "⋯", the detail's
   tabs, the rail beside its rows, and the launch check on the Checks tab. */
.cap-line { margin: 0 0 var(--sp-4, 16px); }
.cap-line > summary { cursor: pointer; font-size: var(--fs-meta); color: var(--text-2);
  min-height: var(--tap, 44px); display: flex; align-items: center; gap: var(--sp-2, 8px); }
.cap-line[open] > summary { margin-bottom: var(--sp-3, 12px); }
.row-menu { min-width: var(--tap, 44px); }
.read-only { font-size: var(--fs-meta); color: var(--text-2); margin: 0 0 var(--sp-3, 12px); }
.detail-line { font-size: var(--fs-meta); color: var(--text-2); margin: var(--sp-2, 8px) 0 var(--sp-4, 16px); }
.campaign-tabs { margin: 0 0 var(--sp-4, 16px); }
.campaign-tab { min-width: 0px; }
.campaign-recipients { display: flex; gap: var(--sp-5, 24px); align-items: flex-start; }
.campaign-recipient-rows { flex: 1 1 auto; min-width: 0px; }
.launch-check { max-width: 760px; }
@media (max-width: 640px) {
  .campaign-recipients { flex-direction: column; gap: var(--sp-3, 12px); }
  .campaign-recipients .state-rail { width: 100%; }
}

/* ---------- Look up follow-on (34-W3-stats-06): do-not-call and the opt-out record ---------- */
.recipient-dnc[data-dnc="national"], .recipient-dnc[data-dnc="state"],
.recipient-dnc[data-dnc="internal"], .recipient-dnc[data-dnc="unknown"] { color: var(--text-2); }
.recipient-released, .recipient-withheld { font-size: var(--fs-meta, 13px); color: var(--text-2); }
.recipient-withheld { font-weight: var(--fw-strong, 600); }
.recipient-honor { margin: 4px 0px; font-size: var(--fs-meta, 13px); overflow-wrap: anywhere; }
.recipient-optout { margin: 8px 0px 12px; }
.recipient-optout-head { margin: 0px 0px 4px; font-weight: var(--fw-strong, 600); overflow-wrap: anywhere; }


/* Copy approval `#/email/copy` (34-W3-ops-04c, contract 5.5): one card per
   variant. On desktop the checklist sits beside the message, the source
   order unchanged (message, then checklist, then actions). On a phone one
   column, and the action row is a sticky bar above the tab bar, always
   below the message it decides on. */
.copy-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px) var(--sp-4, 16px); }
.copy-chips { flex: 1 1 auto; }
.copy-campaign { display: inline-flex; align-items: center; gap: var(--sp-2, 8px); font-size: var(--fs-meta); color: var(--text-2); }
.copy-counters { margin: 0 0 var(--sp-4, 16px); font-size: var(--fs-meta); }
.copy-counters > summary { cursor: pointer; color: var(--text-2); min-height: var(--tap, 44px); display: flex; align-items: center; }
.copy-head h3:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.copy-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: var(--sp-4, 16px); align-items: start; }
.copy-decide { display: contents; }
.copy-decide > .copy-checks { grid-column: 2; grid-row: 1; }
.copy-decide > :not(.copy-checks) { grid-column: 1 / -1; }
.copy-message { display: flex; flex-direction: column; gap: var(--sp-3, 12px); min-width: 0px; }
.copy-compare-btn { align-self: flex-end; }
.copy-compare { border-top: 1px dashed var(--line-2); padding-top: var(--sp-3, 12px); }
.copy-compare h4 { margin: 0 0 var(--sp-2, 8px); font-size: var(--fs-meta); color: var(--text-2); }
.copy-sample-note { margin: 0; font-size: var(--fs-meta); }
.copy-digest .hash { overflow-wrap: anywhere; }
.copy-digest p { margin: 0; }
.copy-diff > summary { cursor: pointer; font-size: var(--fs-meta); color: var(--accent); min-height: var(--tap, 44px); display: flex; align-items: center; }
.copy-diff .diff-table td { white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-checks { min-width: 0px; }
.copy-checks .checklist { margin-top: 0; }
.copy-checks .check-line { grid-template-columns: var(--sp-6) minmax(0, 1fr); }
.copy-checks .check-text, .copy-checks .check-link { grid-column: 2; }
.copy-no-approve { flex-basis: 100%; }
@media (max-width: 1180px) {
  .copy-body { display: block; }
  .copy-decide { display: block; margin-top: var(--sp-4, 16px); }
}
@media (max-width: 640px) {
  .copy-toolbar { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .copy-toolbar > * { min-width: 0px; max-width: 100%; }
  .copy-campaign { display: flex; }
  .copy-campaign select { flex: 1 1 auto; min-width: 0px; width: 100%; }
  .copy-chips { flex-wrap: wrap; }
  .copy-compare-btn { align-self: stretch; }
  .copy-actions { position: sticky; bottom: calc(var(--tabbar, 58px) + env(safe-area-inset-bottom, 0px)); z-index: 5;
    background: var(--bg); padding: var(--sp-2, 8px) 0px; border-top: 1px solid var(--line); }
}


/* Cohort windows and State access by state and vertical (34-W3-vert-03b,
   contract 5.16 and 5.21): the due-date bands of a vertical whose deadline is
   each licensee's own, a block's head carrying its state pill, and the full
   record each State access row expands to. */
.block[data-block] > h2 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); }
.due-bands > li { min-height: var(--tap, 44px); }
.record-detail { margin: 0 0 var(--sp-3, 12px); }
.record-detail > summary { cursor: pointer; min-height: var(--tap, 44px); display: flex;
  align-items: center; font-size: var(--fs-meta); color: var(--text-2); }
.record-detail[open] > summary { margin-bottom: var(--sp-3, 12px); }


/* Operations, the Sequence panel (34-W3-ops-04d). The stack, the step card,
   the editor and the pending bar are the shell's (ui/editor.js); these are
   only the panel's own lines around them. */
.ops-seq-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: var(--sp-2, 8px); }
.ops-seq-pick { max-width: 28rem; margin: var(--sp-2, 8px) 0 var(--sp-3, 12px); }
.ops-seq-pick select { width: 100%; }
.ops-seq-choose { margin: var(--sp-3, 12px) 0; }
.ops-seq-milestone-note { margin: 0 0 var(--sp-2, 8px); }
.ops-seq-reserve { margin: 0 0 var(--sp-3, 12px); font-size: var(--fs-meta, 0.8125rem); }
@media (max-width: 599px) {
  .ops-seq-pick { max-width: none; }
}

/* ---------- Email: Domains, one domain, one mailbox (34-W3-rot-04b, UI-SPEC 5.13) ---------- */
.fleet-list .fleet-cards { display: none; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.fleet-list[data-view="cards"] .fleet-cards { display: grid; }
.fleet-list[data-view="cards"] .fleet-table { display: none; }
.fleet-card[data-domain] { border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.fleet-card[data-tone="bad"] { border-left: 4px solid var(--red); }
.fleet-card[data-tone="warn"] { border-left: 4px solid var(--amber); }
.fleet-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fleet-card-head h3 { margin: 0; overflow-wrap: anywhere; }
.fleet-card-switch { margin-left: auto; }
.fleet-card .fleet-more { display: none; }
.graded, .sig-figure { display: block; }
.graded[data-over="true"], .sig[data-over="true"] .sig-figure { font-weight: 600; }
.over-mark { margin-right: 2px; }
.sig[data-signal] { margin: 8px 0; }
.sig-name { display: block; color: var(--text-2); }
.fleet-row-name { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.fleet-detail-block { margin-top: 16px; }
.fleet-detail-squares { margin: 8px 0; }
.fleet-trends { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.fleet-drawer-inline { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.row-open > td { background: var(--chip); }
@media (max-width: 640px) {
  .fleet-list .fleet-table { display: none; }
  .fleet-list .fleet-cards { display: grid; grid-template-columns: minmax(0, 1fr); }
  .fleet-card:not([data-more="true"]) [data-extra] { display: none; }
  .fleet-card .fleet-more { display: inline-flex; }
  .fleet-trends { grid-template-columns: minmax(0, 1fr); }
}


/* ---------- Social: Approve (34-W4-approve-02, contract 5.5) ---------- */
.approve-screen { display: block; min-width: 0; }
.approve-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); margin: 0 0 var(--sp-3); }
.approve-nav .btn { min-height: var(--tap); }
.approve-link { margin: 0 0 var(--sp-3); font-size: var(--fs-body); color: var(--text-2); }
.approve-sheet, .approve-list { display: grid; gap: var(--sp-2); padding: var(--sp-3); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-panel); }
.approve-sheet[hidden], .approve-list[hidden] { display: none; }
.approve-list { max-width: var(--judge); margin: 0 auto var(--sp-3); }
.approve-sheet-h { margin: 0; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3); }
.approve-rows { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.approve-link-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2);
  font-size: var(--fs-meta); }
.approve-self { font-size: var(--fs-meta); color: var(--text-2); }
.approve-media { display: block; min-width: 0; }
.approve-look { margin: var(--sp-2) 0 0; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3); }
.approve-fit { margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); border-left: 2px solid var(--red); font-size: var(--fs-body); }
.approve-copy, .approve-checks { display: block; min-width: 0; border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.approve-copy-h { margin: 0 0 var(--sp-2); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3);
  letter-spacing: 0.04em; }
.approve-binds { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.approve-readonly { padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.approve-comments { border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.approve-comments summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; }
.approve-comment-list { margin: 0; padding: 0; list-style: none; }
.approve-item .region-strip { max-width: 360px; }
.approve-head h2 { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-strong); }
.approve-item > .action-bar { gap: var(--sp-1) var(--sp-2); padding: var(--sp-2) 0; }
@media (max-width: 640px) {
  /* Edge to edge on a phone: the section's own gutter is max(10px, the safe
     area), so the picture steps out by exactly that, never by more (a wider
     step is sideways scroll). Overrides the 5.5 rule above, which assumed 16px. */
  .approve-item .media-viewer { display: block; max-width: none !important;
    margin-left: calc(-1 * max(10px, env(safe-area-inset-left, 0px)));
    width: calc(100% + max(10px, env(safe-area-inset-left, 0px)) + max(10px, env(safe-area-inset-right, 0px))); }
  .approve-link-row .btn, .approve-sheet .btn { min-height: var(--tap); }
  .approve-nav { justify-content: flex-start; }
  .approve-screen .screen-sentence { font-size: 1.125rem; line-height: 1.35; }
}
.approve-state { display: grid; gap: var(--sp-1); font-size: var(--fs-body); }
.approve-approval { white-space: nowrap; }



/* Channel health (34-W4-health-03, contract 5.9 and the card of 4.12). The
   relay and media blocks above the list, the filter row, the wide tier's
   table with each row's card under it, and the phone tier's cards. W3 tokens
   only; the channel card's frame is 05a's `.channel-card`. */
.health { display: block; min-width: 0; }
.health-relay, .health-media { padding: var(--sp-3, 12px) var(--sp-4, 16px); margin: 0 0 var(--sp-3, 12px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel, 8px); }
.health-block-k { margin: 0 0 var(--sp-1, 4px); font-size: var(--fs-meta); font-weight: var(--fw-strong);
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.health-relay-name, .health-relay-last, .health-media-line { margin: 0 0 var(--sp-2, 8px); }
.health-windows { display: grid; gap: var(--sp-2, 8px); margin-bottom: var(--sp-2, 8px); }
.health-window { display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr); gap: var(--sp-1, 4px) var(--sp-3, 12px);
  align-items: center; }
.health-window[data-window] .band { grid-column: 2; }
.health-window-k { color: var(--text-2); font-size: var(--fs-meta); }
.health-window-v { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1, 4px); align-items: baseline; }
.health-unmeasured { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1, 4px); }
.health-unmeasured .chip { border-style: dashed; }
.health-media-url { word-break: break-all; }
.health-relay-says { color: var(--text-2); }
.health-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); margin: 0 0 var(--sp-3, 12px); }
.health-export { margin-left: auto; }
.health-readonly { margin: 0 0 var(--sp-2, 8px); }
.health-expand { min-width: var(--tap, 44px); min-height: var(--tap, 44px); padding: 0; font: inherit;
  background: none; border: 1px solid var(--line-2); border-radius: var(--r-ctl, 6px); cursor: pointer; }
.health-expand[aria-expanded="true"] span { display: inline-block; transform: rotate(90deg); }
.health-name { font-weight: var(--fw-strong); }
.health-card-row > td { padding: 0 0 var(--sp-3, 12px); }
.health-card-row[hidden] { display: none; }
.health-cards { display: none; list-style: none; margin: 0; padding: 0; }
.health-cards > li { margin: 0 0 var(--sp-2, 8px); }
.health .channel-card { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.channel-card[data-tone="bad"] { border-left: 2px solid var(--red); }
.channel-card[data-tone="warn"] { border-left: 2px solid var(--amber); }
.channel-card[data-selected="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.channel-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-2, 8px); }
.channel-card-name { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-strong); overflow-wrap: anywhere; }
.channel-card-pill { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1, 4px); }
.channel-line-v { min-width: 0; overflow-wrap: anywhere; }
.channel-line-v code { font-family: var(--mono, monospace); font-size: var(--fs-meta); }
.health-meter { display: inline-block; position: relative; width: 120px; height: 4px; margin: 0 var(--sp-1, 4px);
  vertical-align: middle; overflow: visible; }
.health-refresh-mark { position: absolute; top: -3px; width: 1px; height: 10px; background: var(--text-2); }
.health-test-detail { color: var(--text-2); }
.health-note { margin: 0 0 var(--sp-2, 8px); font-size: var(--fs-meta); color: var(--text-2); }
.health-alerts { margin: var(--sp-1, 4px) 0 0; padding: 0; list-style: none; }
.health-switch-note { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.channel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); margin-top: var(--sp-3, 12px); }
.channel-actions [data-health-reauth] { white-space: nowrap; }
.health-excluded { margin: var(--sp-3, 12px) 0; }
.health-excluded > summary { cursor: pointer; min-height: var(--tap, 44px); display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--sp-2, 8px); color: var(--text-2); }
.health-excluded ul { margin: 0; padding-left: var(--sp-4, 16px); }
@media (max-width: 640px) {
  .health-wide { display: none; }
  .health-cards { display: block; }
  .health-window { grid-template-columns: 1fr; }
  .health-window[data-window] .band { grid-column: 1; }
  .channel-line { grid-template-columns: 1fr; }
  .channel-actions .btn { min-height: var(--tap, 44px); }
  .health-export { margin-left: 0; }
}


/* Library (34-W4-media-03, contract 5.7). The grid, the tiles, the viewer,
   the strip and the review block are 34-W4-05a's rules above; these are only
   the screen's own lines around them: a tile's cell with a rejection's
   reason or a rendition's origin, the upload lines, and the asset's
   sections. No colour of its own. */
.library-filters { flex-wrap: wrap; align-items: center; margin-bottom: var(--sp-3, 12px); }
.library-select { display: inline-flex; align-items: center; gap: var(--sp-1, 4px); font-size: var(--fs-meta); }
.library-select select { min-height: var(--ctl, 32px); }
.library-cell { display: grid; gap: var(--sp-1, 4px); align-content: start; min-width: 0; }
.library-reason { margin: 0; font-size: var(--fs-meta); color: var(--text-2); overflow-wrap: anywhere; }
.library-uploads { list-style: none; margin: 0 0 var(--sp-3, 12px); padding: 0; display: grid; gap: var(--sp-2, 8px); }
.library-uploads > li { font-size: var(--fs-meta); overflow-wrap: anywhere; }
.library-uploads .media-tile { max-width: var(--tile); }
.library-more { margin: var(--sp-3, 12px) 0; }
.library-h { margin: var(--sp-4, 16px) 0 var(--sp-2, 8px); font-size: var(--fs-body, 15px); }
.library-history, .library-fit, .library-used { list-style: none; margin: 0; padding: 0; display: grid;
  gap: var(--sp-2, 8px); font-size: var(--fs-meta); }
.library-detail { min-width: 0; }
.library-media { margin-bottom: var(--sp-2, 8px); }
.library-drawer { margin-top: var(--sp-4, 16px); }
.library { min-width: 0; }
@media (max-width: 640px) {
  .library-filters { flex-wrap: nowrap; }
  .library-detail .media-viewer { border-radius: 0; }
  .library-used .post-card { min-width: 0; }
}

/* ---------- Compose (34-W4-compose-03, contract 5.4) ----------
   The form's own parts. The grid (.compose), its two columns, the step
   heading, .net-toggle, .version-tabs and .kind-fit are 05a's rules above. */
#compose-host { display: flex; flex-direction: column; gap: var(--sp-3); }
#compose-host > .screen-head { order: -2; }
.compose-actions { order: -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.compose-why { margin: var(--sp-1) 0 0; font-size: var(--fs-meta); color: var(--text-2); }
.compose-foot { flex-basis: 100%; margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.compose-more { flex: none; }
.compose-section { margin: 0 0 var(--sp-4); }
.compose-section:focus { outline: 2px solid var(--accent); outline-offset: 4px; }
.compose-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 0 var(--sp-2); }
.compose-media { display: flex; gap: var(--sp-3); align-items: flex-start; margin: 0 0 var(--sp-2); }
.compose-thumb { width: var(--thumb, 72px); height: var(--thumb, 72px); object-fit: cover; flex: none;
  background: var(--panel-2); border-radius: var(--r-md); }
.compose-facts { margin: 0; overflow-wrap: anywhere; }
.compose-reads, .compose-none, .compose-carousel, .compose-upload { margin: var(--sp-1) 0; font-size: var(--fs-meta); color: var(--text-2); }
.compose-upload:empty { display: none; }
.compose-label { display: block; margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-2); }
.compose-write textarea, .compose-write input[type="text"], .compose-write input[type="url"],
.compose-write input[type="datetime-local"] { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; }
.compose-note, .compose-counter { margin: var(--sp-1) 0; font-size: var(--fs-meta); color: var(--text-2); overflow-wrap: anywhere; }
.compose-counter p { margin: 0; }
.compose-feature { margin: var(--sp-2) 0 0; }
.compose-lines { margin: var(--sp-1) 0 0; padding-left: var(--sp-4); font-size: var(--fs-meta); color: var(--text-2); }
.compose-lines code { overflow-wrap: anywhere; }
.compose-radio { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--ctl); }
.compose-select { display: none; align-items: center; gap: var(--sp-2); font-size: var(--fs-meta); }
.compose-readonly { margin: 0; color: var(--text-2); }
#compose-host .net-toggle { flex-wrap: wrap; text-align: left; white-space: normal; overflow-wrap: anywhere; }
#compose-host .net-toggle .net-chip-state { margin-left: 0.35em; }
.compose-gen fieldset { border: 0; margin: 0 0 var(--sp-2); padding: 0; }
.version-tab { min-height: var(--ctl); padding: 0 var(--sp-3); font: inherit; background: none; border: 0;
  border-bottom: 2px solid transparent; cursor: pointer; color: var(--text-2); }
.version-tab[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--text); font-weight: var(--fw-strong); }
.pf-tabs { display: none; gap: var(--sp-1); margin: 0 0 var(--sp-2); }
.pf-slot { min-width: 0; }
@media (max-width: 1180px) and (min-width: 641px) {
  .pf-tabs { display: flex; flex-wrap: wrap; }
  .pf-slot:not([data-current]) { display: none; }
}
@media (max-width: 640px) {
  #compose-host .version-tabs { display: none; }
  .compose-select { display: flex; }
  .compose-select select { min-height: var(--tap); font-size: 16px; }
  .compose-radio { min-height: var(--tap); }
  .compose-actions { order: 99; position: sticky; bottom: calc(var(--tabbar, 0px) + env(safe-area-inset-bottom, 0px));
    z-index: var(--z-sticky);
    padding: var(--sp-3) 0; background: var(--bg); border-top: 1px solid var(--line); }
  .compose-actions .btn { min-height: var(--tap); }
}



/* Social, the Calendar (34-W4-sched-04, contract 5.6, 4.10 and 4.11). The
   `.cal-*` posting classes are 34-W4-05a's and the month classes W3's; these
   are only the screen's own lines: the week's rows and cells, the open slot,
   the now line, the shading word, the agenda's lines, the move sheet's foot
   and the slot editor's table. */
.cal-posting .cal-week { grid-template-columns: 64px repeat(7, minmax(0, 1fr)); margin-top: var(--sp-3, 12px); }
.cal-wrow { display: contents; }
.cal-dayhead { padding: var(--sp-1, 4px) var(--sp-2, 8px); font-size: var(--fs-meta); color: var(--text-2);
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-dayhead[data-today="true"] { box-shadow: inset 0 2px 0 var(--accent); color: var(--text); font-weight: var(--fw-strong); }
.cal-posting .cal-hour { height: auto; min-height: var(--cal-hour); padding: var(--sp-1, 4px); }
.cal-best-word { display: block; font-size: var(--fs-meta); color: var(--text-2); }
.cal-cell { min-height: var(--cal-hour); min-width: 0; padding: var(--sp-1, 4px); border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--sp-2, 8px); }
.cal-cell:focus-visible, .cal-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-posting .cal-chip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1, 4px); height: auto;
  min-height: 24px; margin: 0; padding: 2px; white-space: normal; overflow: visible; background: var(--panel); }
.cal-posting .cal-chip .post-card { flex: 1 1 100%; min-width: 0; padding: 2px; }
.cal-chip[data-past="true"], .cal-chip[data-past="true"] .post-meta { color: var(--text-3); }
.cal-chip[draggable="true"] { cursor: grab; }
.cal-menu { min-width: 24px; min-height: 24px; padding: 0 var(--sp-1, 4px); margin-left: auto; }
.cal-open { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1, 4px); padding: 2px var(--sp-1, 4px);
  font-size: var(--fs-meta); color: var(--text-2); }
.cal-fill { margin-left: auto; }
.cal-beside { font-size: var(--fs-meta); color: var(--text-2); }
.cal-posting .cal-now { position: static; border-top: 2px solid var(--text); font-size: var(--fs-meta); }
.cal-now-word { display: inline-block; padding: 0 var(--sp-1, 4px); background: var(--bg); color: var(--text); }
.cal-ghost-word { display: block; font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text); }
.cal-marker { margin: 2px 0; font-size: var(--fs-meta); }
.cal-basis { margin: 0 0 var(--sp-2, 8px); font-size: var(--fs-meta); color: var(--text-2); }
.cal-asof { margin: 0; font-size: var(--fs-meta); }
.cal-posting-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-2, 8px); }
.cal-allhours { margin-top: var(--sp-2, 8px); }
.cal-daybar { font-size: var(--fs-meta); color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-grid.cal-month { grid-template-columns: 1fr; gap: 0; background: none; }
.cal-agenda-list { margin: 0; padding: 0; list-style: none; }
.cal-line { display: flex; align-items: center; gap: var(--sp-2, 8px); min-height: var(--tap, 44px); }
.cal-line > .cal-chip, .cal-line > .cal-open { flex: 1 1 auto; min-height: var(--tap, 44px); }
.cal-line-time { flex: 0 0 auto; font-size: var(--fs-meta); color: var(--text-2); font-variant-numeric: tabular-nums; }
.cal-move-foot { margin: var(--sp-2, 8px) var(--sp-3, 12px); font-size: var(--fs-meta); color: var(--text-2); }
.cal-pick { display: grid; gap: var(--sp-3, 12px); }
.cal-pick-beside { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.slot-editor { display: grid; gap: var(--sp-3, 12px); }
.slot-zone { margin: 0; font-weight: var(--fw-strong); }
.slot-table-wrap { overflow-x: auto; }
.slot-table { border-collapse: collapse; }
.slot-table th, .slot-table td { padding: 2px; border: 0; text-align: center; }
.slot-time { text-align: left; white-space: nowrap; }
.slot-time .cal-beside { display: block; }
.slot-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); }
.slot-add input { min-height: var(--tap, 44px); }
.slot-default, .slot-spacing, .slot-said { margin: 0; }
.slot-pending .pending-bar { position: sticky; bottom: 0; background: var(--bg); }
@media (max-width: 640px) {
  .cal-posting .cal-allhours { display: none; }
  .cal-posting .cal-agenda { display: block; }
  .cal-line .cal-menu { min-width: var(--tap, 44px); min-height: var(--tap, 44px); }
  .cal-fill { min-height: var(--tap, 44px); display: inline-flex; align-items: center; }
}
.cal-posting .post-when, .cal-posting .post-meta > span { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.cal-line, .cal-line > .cal-chip { min-width: 0; }
.range-toggle { display: inline-flex; gap: 0; }
.cal-posting[data-cal-view-shown="month"] .cal-allhours { display: none; }
.cal-chip[data-post-id] { position: relative; }

/* Engage (34-W4-engage-02): the comment rows of 4.13, the readers' panels of 4.17. */
.engage { min-width: 0; }
.engage-reader { min-width: 0; }
.engage-list { margin: 0; padding: 0; list-style: none; }
.engage .comment-dot { width: 6px; height: 6px; margin-top: 8px; }
.comment-row:not([data-unread]) { font-weight: 400; }
.comment-row[data-selected="true"] { box-shadow: inset 2px 0 0 var(--accent); }
.engage-body { min-width: 0; }
.engage-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-2); }
.engage-who { overflow-wrap: anywhere; }
.engage-where { color: var(--text-2); font-weight: 400; }
.engage-side { margin-left: auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  font-weight: 400; color: var(--text-2); }
.engage-label { white-space: nowrap; }
.engage-text { margin: var(--sp-1) 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.engage-text[data-clamped="true"] { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.engage-more { min-height: var(--tap); padding: 0; border: 0; background: none; color: var(--accent);
  font: inherit; font-weight: 400; text-decoration: underline; cursor: pointer; }
.engage-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-1);
  font-weight: 400; }
.engage-on { min-width: 0; overflow-wrap: anywhere; }
.engage-controls { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.engage-controls .btn { min-height: var(--tap); }
.engage-readers { display: grid; gap: var(--sp-2); margin: var(--sp-3) 0; }
.engage-reader[data-reader-state="not_available"] { font-size: var(--fs-body); }
.engage-reader[data-reader-state="not_connected"] .notice { margin: 0; }
.engage-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.engage-label-pick { display: inline-flex; align-items: center; gap: var(--sp-1); }
.engage-label-pick select { min-height: var(--tap); }
.engage-export { margin-left: auto; }
.engage-readonly { margin: var(--sp-2) 0; }
.engage-groups { display: grid; gap: var(--sp-4); }
.engage-group { border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.engage-group .engage-list { padding-left: var(--sp-4); }
.engage-group-none { margin: 0; color: var(--text-2); }
@media (max-width: 640px) {
  .engage-side, .engage-controls, .engage-export { margin-left: 0; }
  .engage-group .engage-list { padding-left: 0; }
}


/* Social, Accounts (34-W4-brands-02, contract 5.10). Accounts by brand: the
   places block, the wide tier's table and the phone tier's cards, the row
   editor in its drawer, and the bind sheet. W3 tokens only. */
.acct { display: block; min-width: 0; }
.acct-readonly { margin: 0 0 var(--sp-2, 8px); }
.acct-places { padding: var(--sp-3, 12px) var(--sp-4, 16px); margin: 0 0 var(--sp-3, 12px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel, 8px); }
.acct-block-k { margin: 0 0 var(--sp-1, 4px); font-size: var(--fs-meta); font-weight: var(--fw-strong);
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.acct-places-line { margin: 0 0 var(--sp-2, 8px); }
.acct-places-more > summary { cursor: pointer; min-height: var(--tap, 44px); display: flex; align-items: center;
  color: var(--text-2); }
.acct-places-table td[data-present="false"] { color: var(--red); }
.acct-places-table tr[data-disagree="true"] > th { color: var(--red); }
.acct-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); margin: 0 0 var(--sp-3, 12px); }
.acct-export { margin-left: auto; }
.acct-brand { margin: 0 0 var(--sp-5, 24px); }
.acct-brand-h { margin: 0 0 var(--sp-2, 8px); font-size: var(--fs-meta); font-weight: var(--fw-strong);
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.acct-brand-sentence { margin: 0 0 var(--sp-2, 8px); color: var(--text-2); }
.acct-id { font-weight: var(--fw-strong); overflow-wrap: anywhere; }
.acct-profile { font-size: var(--fs-meta); }
.acct-why { margin: var(--sp-1, 4px) 0 0; font-size: var(--fs-meta); color: var(--text-2); overflow-wrap: anywhere; }
.acct-why[data-acct-rotation="out"] { color: var(--amber); }
.acct-relay[data-relay="unbound"] { color: var(--red); }
.acct-relay[data-relay="first-party"] { color: var(--text-2); }
.acct-more { min-width: var(--tap, 44px); }
.acct-cards { display: none; list-style: none; margin: 0; padding: 0; }
.acct-card { padding: var(--sp-3, 12px); margin: 0 0 var(--sp-2, 8px); background: var(--panel);
  border: 1px solid var(--line); border-left: 2px solid var(--line-2); border-radius: var(--r-panel, 8px);
  min-width: 0; overflow-wrap: anywhere; }
.acct-card[data-selected="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct-card-head, .acct-card-line, .acct-card-actions { margin: 0 0 var(--sp-1, 4px); display: flex; flex-wrap: wrap;
  align-items: center; gap: var(--sp-2, 8px); }
.acct-card-actions .btn { min-height: var(--tap, 44px); }
.acct-editor { display: grid; gap: var(--sp-3, 12px); }
.acct-editor select, .acct-editor input[type="text"], .acct-editor input[type="url"] { width: 100%; max-width: 100%; }
.acct-editor-net { margin: 0; }
.acct-check { display: inline-flex; align-items: center; gap: var(--sp-2, 8px); min-height: var(--tap, 44px); }
.acct-overlay-note { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.acct-editor-error { margin: 0; color: var(--red); }
.acct-editor-error:empty { display: none; }
.acct-editor-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); }
.acct-dry-run { min-width: 0; }
@media (max-width: 640px) {
  .acct-wide { display: none; }
  .acct-cards { display: block; }
  .acct-editor .btn { min-height: var(--tap, 44px); }
}


/* ===== 34-W4-status-03b: Failed (#/social/failed), contract 5.3 ===== */
.failed-screen { display: grid; gap: var(--sp-3, 12px); min-width: 0; }
.failed-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); }
.failed-count { font-variant-numeric: tabular-nums; }
.failed-showing { font-size: var(--fs-meta); }
.failed-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-3, 12px); }
.failed-card { display: grid; gap: var(--sp-2, 8px); min-width: 0; padding-bottom: var(--sp-3, 12px); border-bottom: 1px solid var(--line); }
.failed-card[data-class="unknown"] .failed-next, .failed-card[data-class="unconfirmed"] .failed-next { color: var(--text); }
.failed-card[aria-current="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.failed-why { display: grid; gap: var(--sp-2, 8px); min-width: 0; }
.failed-said { margin: 0; overflow-wrap: anywhere; }
.failed-said[data-long]:not([data-open]) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.failed-showall { justify-self: start; min-height: var(--tap, 44px); }
.failed-help, .failed-check, .failed-full { overflow-wrap: anywhere; }
.failed-help, .failed-full { display: inline-flex; align-items: center; min-height: var(--tap, 44px); }
.failed-next { margin: 0; overflow-wrap: anywhere; }
.failed-class { margin-right: var(--sp-1, 4px); }
.failed-checkline { display: inline; }
.failed-controls { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); }
.failed-controls .btn { min-height: var(--tap, 44px); display: inline-flex; align-items: center; }
.failed-detail summary { min-height: var(--tap, 44px); display: flex; align-items: center; cursor: pointer; }
.failed-code-line { margin: 0; font-size: var(--fs-meta); }
.failed-code { font-family: var(--mono); overflow-wrap: anywhere; }
/* The card's ⋯ holds Retry anyway, a note and Cancel at every tier, so it is
   drawn on a desk too (W3's .btn-ico is phone-only). */
.failed-card .post-more { display: inline-grid; place-items: center; min-width: var(--tap, 44px); min-height: var(--tap, 44px); }


/* ===== 34-W4-auto-04: Automation (#/social/automation), contract 5.11 ===== */
.automation { display: grid; gap: var(--sp-4, 16px); min-width: 0; }
.auto-block { display: grid; gap: var(--sp-2, 8px); min-width: 0; }
.auto-h { margin: 0; font-size: var(--fs-meta); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.auto-sentence { margin: var(--sp-1, 4px) 0 0; font-size: var(--fs-meta); color: var(--text-2); overflow-wrap: anywhere; }
.auto-last, .auto-none { overflow-wrap: anywhere; }
.auto-pill { cursor: pointer; min-height: var(--tap, 44px); }
.auto-more, .auto-edit { min-width: var(--tap, 44px); min-height: var(--tap, 44px); }
.auto-cards { display: none; list-style: none; margin: 0; padding: 0; }
.auto-card { display: grid; gap: var(--sp-1, 4px); padding: var(--sp-2, 8px) 0 var(--sp-2, 8px) var(--sp-3, 12px); border-left: 3px solid var(--line-2); border-bottom: 1px solid var(--line); min-width: 0; }
.auto-card[data-tone="bad"] { border-left-color: var(--bad); }
.auto-card[data-tone="warn"] { border-left-color: var(--warn); }
.auto-card[data-tone="unknown"] { border-left-style: dashed; }
.auto-card[data-selected="true"], .automation tr[data-selected="true"], .auto-net[data-selected="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.auto-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2, 8px); }
.auto-card-line { margin: 0; overflow-wrap: anywhere; }
.auto-card-foot { display: flex; justify-content: flex-end; }
.auto-nets { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px) var(--sp-4, 16px); list-style: none; margin: 0; padding: 0; }
.auto-net { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); min-width: 0; }
.auto-net .switch { min-width: var(--tap, 44px); min-height: var(--tap, 44px); }
.auto-net-cond { font-size: var(--fs-meta); color: var(--text-2); }
.auto-net-who { flex-basis: 100%; font-size: var(--fs-meta); overflow-wrap: anywhere; }
.auto-job { font-weight: 600; overflow-wrap: anywhere; }
.auto-net-name { font-weight: 600; }
.auto-readonly { margin: 0 0 var(--sp-3, 12px); font-size: var(--fs-meta); }
.auto-run-list { margin: 0; }
.auto-settings tr[data-auto-setting] > th[scope="row"] { font-weight: 500; text-align: left; }
.auto-target { color: var(--text-2); }
.auto-changed { overflow-wrap: anywhere; }
.auto-pair { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.auto-link { display: inline-flex; align-items: center; min-height: var(--tap, 44px); }
.auto-next, .auto-runs ul { margin: 0; padding-left: var(--sp-4, 16px); font-size: var(--fs-meta); }
.auto-runs summary { min-height: var(--tap, 44px); display: flex; align-items: center; cursor: pointer; }
/* W3's stepper hides its reason box with `hidden` while the change tightens,
   and `.field { display: flex }` outranked the attribute, so the box never hid. */
.ask [data-stepper-reason][hidden] { display: none; }
@media (max-width: 640px) {
  .auto-wide { display: none; }
  .auto-cards { display: block; }
  .auto-settings thead { display: none; }
  .auto-settings tr { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--sp-2, 8px); padding: var(--sp-2, 8px) 0; border-bottom: 1px solid var(--line); }
  .auto-settings td, .auto-settings th { display: block; padding: 0; border: 0; }
  .auto-settings td[data-label]:not([data-label=""])::before { content: attr(data-label) " "; color: var(--text-2); font-size: var(--fs-meta); }
}

/* ===== 34-W4-results-03: Results (#/social/results), contract 5.8, 4.14, 4.16 ===== */
.results { display: grid; gap: var(--sp-3, 12px); min-width: 0; }
.results-readonly { margin: 0; }
.results-cards { display: grid; gap: var(--sp-2, 8px); }
.action-card-title { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.action-card .btn { margin-top: var(--sp-2, 8px); min-height: var(--tap, 44px); display: inline-flex; align-items: center; }
.results-followers { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: var(--sp-2, 8px) 0; min-width: 0; }
.results-followers summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); min-height: var(--tap, 44px); cursor: pointer; }
.results-followers-k { font-size: var(--fs-meta); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.results-follower-list { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px) var(--sp-4, 16px); min-width: 0; }
.results-follower { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1, 4px); font-variant-numeric: tabular-nums; }
.results-follower-name { font-weight: 600; }
.results-followers-drawer { display: grid; gap: var(--sp-3, 12px); padding-top: var(--sp-3, 12px); min-width: 0; overflow-x: auto; }
.results-followers-twin { min-width: 0; overflow-x: auto; }
.results-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); }
.results-group-by { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1, 4px); }
.results-group-by .filter, .results-export { min-height: var(--tap, 44px); display: inline-flex; align-items: center; }
.results-exports { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2, 8px); margin-left: auto; }
.results-wide { min-width: 0; overflow-x: auto; }
.results-post { min-width: 16rem; max-width: 28rem; }
.result-cell { display: grid; gap: 2px; justify-items: end; }
.results-group td, .results-totals td { font-weight: 600; }
.results-totals { border-top: 2px solid var(--line-2); }
.results-phone { display: none; margin: 0; padding: 0; list-style: none; }
.results-phone-card { position: relative; display: grid; gap: var(--sp-2, 8px); padding: var(--sp-3, 12px) var(--sp-2, 8px); border-bottom: 1px solid var(--line); min-width: 0; }
.results-phone-card dl { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1, 4px) var(--sp-3, 12px); margin: 0; }
.results-phone-card dt { color: var(--text-2); font-size: var(--fs-meta); }
.results-phone-card dd { margin: 0; }
.results-phone-card .result-cell { justify-items: start; white-space: normal; }
.results-open { position: absolute; right: 0; top: 0; min-width: var(--tap, 44px); min-height: var(--tap, 44px); display: inline-grid; place-items: center; }
@media (max-width: 640px) {
  .results-wide { display: none; }
  .results-phone { display: grid; }
  .results-post { min-width: 0; max-width: none; }
  .results-exports { margin-left: 0; }
}

/* ===== 34-W4-home-02: Needs me now (#/home, contract 5.1) and the posting strip's control (4.1) ===== */
.stopbar[data-scope="posting"] .stopbar-detail { display: block; }
.hold-rows { margin: 0; padding: 0; list-style: none; }
.hold-row { min-height: 56px; }
.hold-row .btn { flex: none; min-height: var(--tap, 44px); }
.hold-evidence ul { margin: 0 0 var(--sp-2, 8px); }
.hold-evidence-channels li, .hold-evidence-posts li { overflow-wrap: anywhere; }
.hold-sheet .scope-section-head { margin: var(--sp-2, 8px) 0 var(--sp-1, 4px); font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3); letter-spacing: 0.04em; }
.stopbar[data-compact] { margin-bottom: 0; }
.needs-row[data-source="email"] .needs-source { color: var(--text-2); }
.home-needs { min-width: 0; }
.home-email-half { margin: 0 0 var(--sp-2, 8px); }
.home-screen { display: grid; gap: var(--sp-3, 12px); min-width: 0; }
.home-head { display: grid; gap: var(--sp-1, 4px); }
.home-sentence { margin: 0; font-size: var(--fs-title, 1.25rem); font-weight: var(--fw-strong); }
.home-asof { margin: 0; font-size: var(--fs-meta); color: var(--text-2); }
.home-switches { position: sticky; top: 68px; z-index: var(--z-sticky); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius, 8px); padding: var(--sp-2, 8px); display: grid; gap: var(--sp-2, 8px); }
.home-switch { display: grid; grid-template-columns: 5rem minmax(0, 1fr); align-items: center; gap: var(--sp-2, 8px); min-width: 0; }
.home-switch-name { font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-2); }
.home-switch .stopbar, .home-switch #home-holdbar { margin: 0; min-width: 0; }
.home-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); }
.home-filters .btn { min-height: var(--tap, 44px); }
.home-filters .btn[aria-current="true"] { border-color: var(--accent); font-weight: var(--fw-strong); }
.home-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: var(--sp-4, 16px); align-items: start; }
.home-list { margin: 0; padding: 0; list-style: none; min-width: 0; }
.needs-row { display: grid; gap: var(--sp-1, 4px); min-width: 0; position: relative; }
.needs-row:focus-within, .needs-row:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.needs-head { display: flex; align-items: baseline; gap: var(--sp-2, 8px); min-width: 0; }
.needs-title { font-weight: var(--fw-strong); overflow-wrap: anywhere; color: var(--text); text-decoration: none; min-height: var(--tap, 44px); display: inline-flex; align-items: center; }
.needs-title::after { content: " ›"; color: var(--text-3); }
.needs-sentence { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.needs-count { font-size: var(--fs-meta); color: var(--text-2); font-variant-numeric: tabular-nums; }
.needs-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); }
.needs-actions .btn { min-height: var(--tap, 44px); display: inline-flex; align-items: center; }
.home-side { display: grid; gap: var(--sp-3, 12px); min-width: 0; }
.home-card { border: 1px solid var(--line); border-radius: var(--radius, 8px); padding: var(--sp-3, 12px); background: var(--panel); min-width: 0; }
.home-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2, 8px); margin: 0 0 var(--sp-2, 8px);
  font-size: var(--fs-meta); font-weight: var(--fw-strong); color: var(--text-3); letter-spacing: 0.04em; }
.home-card-head a { min-height: var(--tap, 44px); display: inline-flex; align-items: center; letter-spacing: 0; }
.home-card p { margin: 0 0 var(--sp-1, 4px); overflow-wrap: anywhere; }
.home-next { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2, 8px); }
.home-next-line { font-size: var(--fs-meta); color: var(--text-2); overflow-wrap: anywhere; }
.home-custody { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); margin: var(--sp-2, 8px) 0 0; padding: 0; list-style: none; }
.home-empty { padding: var(--sp-3, 12px) 0; }
.home-empty h3 { margin: 0 0 var(--sp-1, 4px); }
@media (max-width: 900px) {
  .home-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .home-switches { top: 60px; }
  .home-switches[data-sticky-phone="false"] { position: static; }
  .home-switch { grid-template-columns: minmax(0, 1fr); }
  .stopbar[data-scope="posting"][data-state="stopped"] { flex-wrap: wrap; min-height: 76px; }
  .stopbar[data-scope="posting"][data-state="stopped"] .btn-resume { width: 100%; }
}

/* ===== 34-W4-status-03a: Queue (#/social/queue) and one post, contract 5.2 ===== */
.queue-screen { display: grid; gap: var(--sp-3, 12px); min-width: 0; }
.queue-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2, 8px); }
.queue-account { display: inline-flex; align-items: center; gap: var(--sp-1, 4px); font-size: var(--fs-meta); }
.queue-split { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); gap: var(--sp-4, 16px); align-items: start; min-width: 0; }
.queue-split:has(.queue-pane) { grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) minmax(0, 1.2fr); }
.queue-rail { display: grid; gap: var(--sp-2, 8px); min-width: 0; }
.queue-rail-done { margin: var(--sp-2, 8px) 0 0; font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.queue-rail-select { display: none; }
.queue-list { min-width: 0; }
.queue-list .post-card { min-width: 0; }
.queue-list [aria-current="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.queue-pane { min-width: 0; }
.queue-detail { display: grid; gap: var(--sp-4, 16px); min-width: 0; }
.queue-detail section { min-width: 0; }
.queue-k { margin: 0 0 var(--sp-2, 8px); font-size: var(--fs-meta); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.queue-facts { display: flex; flex-wrap: wrap; gap: var(--sp-4, 16px); margin: var(--sp-3, 12px) 0 0; }
.queue-fact { margin: 0; min-width: 0; }
.queue-fact dd { overflow-wrap: anywhere; }
.queue-fact dt { font-size: var(--fs-meta); color: var(--on-ink-2); }
.queue-fact dd { margin: 0; }
.queue-media .media-viewer { max-width: 100%; height: auto; }
.queue-fit { margin: var(--sp-2, 8px) 0 0; color: var(--text); }
.queue-copy, .queue-decide, .queue-timeline, .queue-notes-block, .queue-byhand { display: grid; gap: var(--sp-2, 8px); }
.queue-decide { padding-top: var(--sp-2, 8px); border-top: 1px solid var(--line); }
.queue-publish-said { margin: 0; color: var(--text-2); }
.queue-outcomes { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); margin: 0; }
.queue-notes { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2, 8px); }
.queue-change { margin-top: var(--sp-4, 16px); padding-top: var(--sp-3, 12px); border-top: 1px solid var(--line-2); }
.queue-change-row { display: flex; flex-wrap: wrap; gap: var(--sp-2, 8px); }
.queue-move-foot { margin: var(--sp-2, 8px) 0; font-size: var(--fs-meta); color: var(--text-2); }
.queue-pick { display: grid; gap: var(--sp-2, 8px); }
.queue-media-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-2, 8px); }
/* The ⋯ on a card and in the band holds the post's actions at every tier,
   so it is drawn on a desk too (W3's .btn-ico is phone-only). */
.queue-screen .post-more { display: inline-grid; place-items: center; min-width: var(--tap, 44px); min-height: var(--tap, 44px); }
@media (max-width: 1180px) {
  .queue-split:has(.queue-pane) { grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); }
  .queue-split:has(.queue-pane) .queue-pane { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .queue-split, .queue-split:has(.queue-pane) { grid-template-columns: minmax(0, 1fr); }
  .queue-rail .state-rail, .queue-rail .queue-rail-done { display: none; }
  .queue-rail-select { display: inline-flex; align-items: center; gap: var(--sp-1, 4px); }
  .queue-screen[data-view="detail"] .queue-list, .queue-screen[data-view="detail"] .queue-rail,
  .queue-screen[data-view="detail"] .queue-filters,
  .queue-screen[data-view="detail"] > .screen-head { display: none; }
  /* The picture before the decision (C8): at the phone tier the post opens
     as its own view, so the band stays short and the media starts on the
     first screen. */
  .queue-detail .detail-head { padding: var(--sp-3, 12px) var(--sp-4, 16px); }
  .queue-media-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* A card names itself: W3's per-cell labels ("Select", "Post") only take
     width from it at the phone tier. */
  .queue-list .rtable td::before { content: none; }
  .queue-list .rtable td { text-align: left; }
  .queue-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2, 8px); }
}


/* ===== 34-W4-90: the post card's ⋯ on every screen, at every width ===== */
/* postCard's ⋯ holds the post's actions at every tier, so it is drawn on a
   desk too; W3's .btn-ico is phone-only, and status-03a/03b fixed only their
   own sections (.queue-screen, .failed-card). This rule covers the rest. */
.post-more { display: inline-grid; place-items: center; min-width: var(--tap, 44px); min-height: var(--tap, 44px); }
