/* The console stylesheet is split per area: scripts/build.mjs concatenates
   src/styles/*.css in name order (00-, 10-, …) into dist/styles.css. Order matters:
   later rules override earlier ones, so keep the numbering when adding a file. */
/* Atom console: the look of the console prototype (docs/console-design.md): a light
   theme with a petrol accent and a dark one; the system decides unless the user
   chose (data-theme on <html>, from the profile). Only these names exist
   (docs/console-style-guide.md §3.1); console/scripts/lint.mjs checks that
   every var(--x) is defined and that no sheet outside this file has a raw colour.
   --on-strong: text on a strong colour (a count on --bad, a badge on --accent);
   --paper: the proposal preview's paper, the same in both themes. */
:root {
  --bg: #f3f5f8; --panel: #ffffff; --panel2: #eef1f6; --line: #dbe1ea; --fg: #17202c; --muted: #5b697c;
  --accent: #0a6c8f; --accent-soft: #e2f1f7; --accent-fg: #ffffff; --sel: #dcecf5;
  --ok: #15733f; --warn: #945800; --bad: #b93026; --ok-soft: #e3f4ea; --warn-soft: #fbf0dc; --bad-soft: #fbe5e3;
  --input: #ffffff; --shadow: 0 .5rem 1.5rem rgba(16, 24, 40, .14); --scrim: rgba(10, 16, 24, .38);
  --on-strong: #ffffff; --shadow-sheet: -.75rem 0 2.5rem rgba(16, 24, 40, .18); --paper: #f6f4ef;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: .5rem;
  /* The scale (docs/console-style-guide.md §3.2–3.5, appendix A): every
     font-size, padding, margin, gap and radius in the sheets is one of these
     (the lint's G1 fails on a raw one). --ctl / --ctl-sm: the height of
     a control (button, input, select, segmented control) and of a small one
     (toolbars), so controls on one line line up (§3.8). Two densities (profile › Display,
     data-density on <html>): these are Comfortable, the default (36 px rows,
     14 px body text, more room between lines, fields and sections); Compact
     is at the end of this file. */
  --row: 2.25rem; --lh: 1.55; --ctl: 2.25rem; --ctl-sm: 1.875rem;
  --fs-0: .6875rem; --fs-1: .75rem; --fs-2: .8125rem; --fs-3: .875rem; --fs-4: .9375rem; --fs-5: 1rem; --fs-6: 1.125rem;
  --fs-7: 1.25rem; --fs-8: 1.5rem; --fs-9: 1.75rem; --fs-grid: .8438rem;
  --sp-0: .1875rem; --sp-1: .3125rem; --sp-2: .5rem; --sp-3: .625rem; --sp-4: .75rem; --sp-5: 1rem; --sp-6: 1.25rem; --sp-7: 1.5rem; --sp-8: 1.75rem; --sp-9: 2.5rem;
  /* The space under a section heading before its fields (owner 2026-11-07, R6; style guide §4.11.6): one token, console-wide. */
  --sp-section: var(--sp-5);
  /* The space between field groups in a form: a label sits 16–20 px below the field (and hint) above it
     (owner 2026-11-08, verify item 4): one token for every form layout, not per page. */
  --sp-field: 1.125rem;
  /* Room a scrolling container keeps around its fields so a focus ring (2px, 1px offset) is not clipped. */
  --focus-room: 4px;
  --r-xs: .1875rem; --r-sm: .375rem; --r-md: var(--radius); --r-lg: .75rem; --r-pill: 999px;
  /* Layers (docs/console-style-guide.md §3.4): a z-index is one of these, or a
     local 1 inside a component. Whatever opens from an overlay stacks on top of it (§4.11.5):
     dialogs and confirms are --z-modal; a panel opened over a sheet marks data-above-layers. */
  --z-sticky: 2; --z-pin: 3; --z-pin-head: 4; --z-list: 5; --z-pop: 6; --z-menu: 20; --z-topbar: 30; --z-side-toggle: 29; --z-filter: 30;
  --z-panel: 40; --z-overlay: 45; --z-modal: 50; --z-notice: 55; --z-toast: 60; --z-dev: 65;
  --z-annotate: 70; --z-annotate-btn: 71; --z-annotate-pop: 80; --z-annotate-hint: 81; --z-tip: 1000;
  --env: var(--accent);
  --topline: var(--logo-blue); /* the header's top line: the logo's blue (#0085ad), not the environment colour (#142) */
  /* The operator's logo (21-logo.css, docs/research/logo-motion.md): the brand's
     own colours, the file's exact fills, the same in both themes: the three
     icons, the three overlaps; only the wordmark's ink adapts to the theme. */
  --logo-ink: #1a1a1a; --logo-ink-ls: #403b33; --logo-word-accent: #0085ad;
  --logo-blue: #0085ad; --logo-teal: #63b1bc; --logo-red: #e40046;
  --logo-blue-teal: #0c5a80; --logo-blue-red: #63295c; --logo-red-teal: #800040;
  /* Targeting (docs/plan/targeting-setup-2026-11-09.md §m.5; the mockup testdata/mockups/targeting-2026-11-09):
     Include is green, Exclude red. --only-on / --never-on: the fills behind a white (--on-fill) icon (≥ 4.5:1) that
     also stand out from the panel as a pressed state (≥ 3:1, WCAG 1.4.11; lint G3); dark --never-on is a little
     lighter (#c43c33) because the light one is 2.91:1 on the dark panel; --only-on-fg / --never-fg: the colours for text, rails and borders on a
     panel; --only-inh / --never-inh: the tint of an inherited (locked) choice; --never-soft: an Exclude row. */
  --on-fill: #ffffff; --only-on: #1e7f4f; --only-on-fg: #1e7f4f; --never-on: #b4372f; --never-fg: #b4372f; --never-soft: #fbe9e7;
  --only-inh: color-mix(in srgb, var(--only-on) 18%, var(--panel)); --never-inh: color-mix(in srgb, var(--never-on) 22%, var(--panel));
  /* The map (ui/map, the mockup's TMap): the Include fill and its edge, the Exclude hatch (the table's Exclude red, --never-fg), the edit handles in the
     accent with a white ring, paused shapes grey (dashed), a shape that needs attention amber, the shape being drawn,
     context outlines, and the halo behind map labels. */
  --tmap-include: #1e7f4f; --tmap-include-fill: rgba(30, 127, 79, .30); --tmap-include-edge: #1e7f4f;
  --tmap-exclude: var(--never-fg); --tmap-edit: var(--accent); --tmap-edit-ring: #ffffff; --tmap-paused: #7a8591; --tmap-attention: var(--warn);
  --tmap-draw: #9a3412; --tmap-context: #5b6673; --tmap-halo: #ffffff; --tmap-text: #1f2933;
  /* A set in the chip strip (ui/ChipStrip.tsx, the mockup's .set): the square SET chip's purple edge, tag and tint. */
  --set: #6a3fb5; --set-soft: #f1ebfb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --panel: #151b24; --panel2: #1c2430; --line: #29323f; --fg: #e5eaf1; --muted: #8e9bad;
    --accent: #4fb3d9; --accent-soft: #15303d; --accent-fg: #06141b; --sel: #172e3b;
    --ok: #4cc27f; --warn: #e3a33a; --bad: #f0675c; --ok-soft: #12291c; --warn-soft: #2d2410; --bad-soft: #321614;
    --input: #10151d; --shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .45); --scrim: rgba(0, 0, 0, .55);
    --on-strong: #06141b; --shadow-sheet: -.75rem 0 2.5rem rgba(0, 0, 0, .5);
    --logo-ink: #f2f5f9; --logo-ink-ls: #f2f5f9;
    --only-on-fg: #5fcf94; --never-on: #c43c33; --never-fg: #f08a80; --never-soft: #43211f;
    --tmap-include: #4cc38a; --tmap-include-fill: rgba(76, 195, 138, .33); --tmap-include-edge: #5fcf94;
    --tmap-paused: #8b949e; --tmap-draw: #f2cc60; --tmap-context: #9aa6b2; --tmap-halo: #0d1117; --tmap-text: #e6edf3;
  --set: #c3a5f5; --set-soft: #2f2645;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --panel: #151b24; --panel2: #1c2430; --line: #29323f; --fg: #e5eaf1; --muted: #8e9bad;
  --accent: #4fb3d9; --accent-soft: #15303d; --accent-fg: #06141b; --sel: #172e3b;
  --ok: #4cc27f; --warn: #e3a33a; --bad: #f0675c; --ok-soft: #12291c; --warn-soft: #2d2410; --bad-soft: #321614;
  --input: #10151d; --shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .45); --scrim: rgba(0, 0, 0, .55);
  --on-strong: #06141b; --shadow-sheet: -.75rem 0 2.5rem rgba(0, 0, 0, .5);
  --logo-ink: #f2f5f9; --logo-ink-ls: #f2f5f9;
  --only-on-fg: #5fcf94; --never-on: #c43c33; --never-fg: #f08a80; --never-soft: #43211f;
  --tmap-include: #4cc38a; --tmap-include-fill: rgba(76, 195, 138, .33); --tmap-include-edge: #5fcf94;
  --tmap-paused: #8b949e; --tmap-draw: #f2cc60; --tmap-context: #9aa6b2; --tmap-halo: #0d1117; --tmap-text: #e6edf3;
  --set: #c3a5f5; --set-soft: #2f2645;
  color-scheme: dark;
}
/* Text size (profile, data-text on <html>): sizes and spacing are in rem, so the
   root font size scales the whole console. Normal keeps the browser's 16 px root
   (14 px body text in Comfortable, 13 in Compact); the others scale it by
   12/13, 14.5/13 and 16/13. Hairlines (1-2 px)
   and the @media widths stay in px. */
:root[data-text="small"] { font-size: 92.3077%; }
:root[data-text="large"] { font-size: 111.5385%; }
:root[data-text="xlarge"] { font-size: 123.0769%; }
/* Compact density (profile › Display, data-density="compact"): the console's
   original density, 30 px rows and 13 px body text, on the same scale. */
:root[data-density="compact"] {
  --row: 1.875rem; --lh: 1.45; --ctl: 1.875rem; --ctl-sm: 1.5rem;
  --fs-0: .625rem; --fs-1: .6875rem; --fs-2: .75rem; --fs-3: .8125rem; --fs-4: .875rem; --fs-5: .9375rem; --fs-6: 1.0625rem;
  --fs-7: 1.125rem; --fs-8: 1.375rem; --fs-9: 1.625rem; --fs-grid: .7813rem;
  --sp-0: .125rem; --sp-1: .25rem; --sp-2: .375rem; --sp-3: .5rem; --sp-4: .625rem; --sp-5: .75rem; --sp-6: 1rem; --sp-7: 1.25rem; --sp-8: 1.5rem; --sp-9: 2rem;
  --sp-field: 1rem;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; }
/* No UI animations (profile › Display, feedback note 122) or the system's reduced motion (lib/logomotion.ts applyMotion): nothing moves. */
:root[data-motion=off] *, :root[data-motion=off] *::before, :root[data-motion=off] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--fs-3)/var(--lh) var(--sans); -webkit-font-smoothing: antialiased; }
h1 { font-size: var(--fs-6); margin: 0; font-weight: 700; text-wrap: balance; }
h3 { font-size: var(--fs-1); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: var(--sp-5) 0 var(--sp-section); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--accent); text-decoration: none; }
label { display: block; font-size: var(--fs-2); color: var(--muted); margin: var(--sp-4) 0 var(--sp-1); }
input, select, textarea { font: inherit; background: var(--input); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); width: 100%; max-width: 26.25rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 .1875rem var(--accent-soft); }
textarea { max-width: none; }
/* One height for a control (§3.8): a text field and a select are as high as a button. */
input:not([type=checkbox], [type=radio], [type=color], [type=range], [type=file], [type=image]), select:not([size], [multiple]) { height: var(--ctl); padding-top: 0; padding-bottom: 0; }
input[type=checkbox] { width: auto; }
input[type=color] { padding: 2px; height: 2.125rem; width: 3.75rem; }
/* Icon (ui/Icon.tsx): 1em, the text's colour; the sidebar sizes its own. */
.icon { width: 1em; height: 1em; flex: none; vertical-align: -.125em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); }
input.wide { width: 100%; } /* a full-width read-only field (the invitation link in dev/test) */
.small { font-size: var(--fs-2); }
.muted { color: var(--muted); } .ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.spacer { flex: 1; }
.pad { padding: var(--sp-7) var(--sp-8); }
.row { display: flex; gap: var(--sp-3); align-items: center; margin: var(--sp-3) 0; }
.row.end { justify-content: flex-end; margin: 0; }
.row.wrap { flex-wrap: wrap; }
.row input, .row select { width: auto; }

.btn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 var(--sp-4); color: var(--fg); white-space: nowrap; display: inline-block; line-height: calc(var(--ctl) - 2px); vertical-align: middle; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--panel); border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 0 var(--sp-3); font-size: var(--fs-2); border-radius: var(--r-sm); line-height: calc(var(--ctl-sm) - 2px); } /* at least 24 px (WCAG 2.5.8) */
.btn.xs { padding: 1px var(--sp-2); font-size: var(--fs-1); line-height: 1.4; border-radius: var(--r-sm); } /* inside table cells, with the row's height as its hit area */
.btn.big { padding: var(--sp-5) var(--sp-6); font-size: var(--fs-4); font-weight: 600; line-height: var(--lh); }
.btn.xl { padding: var(--sp-5) var(--sp-8); font-size: var(--fs-5); line-height: var(--lh); }
.btn.danger.xl { background: var(--bad); color: var(--on-strong); }
.btn.danger.xl:hover { filter: brightness(1.08); }
.btn.block { width: 100%; margin-top: var(--sp-6); padding: var(--sp-4); line-height: var(--lh); }
.btn:disabled { opacity: .45; cursor: default; }
/* Link-like buttons ("show more", jump links: no consequences) and chips (filters, views with counts). */
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left; font: inherit; }
.linkish:hover, .linkish:focus-visible { text-decoration: underline; }
.linkish[aria-pressed="true"] { font-weight: 600; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-lg); padding: 2px var(--sp-4); font-size: var(--fs-2); color: var(--fg); cursor: pointer; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.chips .chip { display: inline-flex; gap: var(--sp-2); align-items: center; }
.chip.warn { border-color: var(--warn); }
.pill { font-size: var(--fs-1); padding: 0 var(--sp-2); line-height: 1.125rem; border-radius: var(--r-pill); background: var(--panel); border: 1px solid var(--line); margin-left: var(--sp-1); white-space: nowrap; display: inline-block; }
.pill.prod, .pill.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.pill.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.st-active { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.st-paused { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.st-archived { color: var(--muted); }
.st-inactive { border-color: var(--line); color: var(--fg); }
.st-ended { color: var(--muted); border-style: dashed; }
/* A status as grey words (owner decision A2, 2026-10-15): the resting state carries no tone; Draft, Ended and Archived muted. */
.st-neutral { border-color: var(--line); color: var(--fg); background: var(--panel); }
.st-neutral.st-draft, .st-neutral.st-ended, .st-neutral.st-archived { color: var(--muted); }
.rv-approved { color: var(--ok); border-color: var(--ok); }
.rv-rejected { color: var(--bad); border-color: var(--bad); }
.rv-pending { color: var(--warn); border-color: var(--warn); }
.act-kill { color: var(--bad); border-color: var(--bad); }
.act-delete { color: var(--bad); }
.act-resume { color: var(--ok); }
.swatch { display: inline-block; width: .625rem; height: .625rem; border-radius: var(--r-xs); vertical-align: middle; }
.error-box { background: var(--bad-soft); border: 1px solid var(--bad); color: var(--bad); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-sm); margin: var(--sp-4) 0; white-space: pre-wrap; }
.warn-box { background: var(--warn-soft); border: 1px solid var(--warn); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-sm); margin: var(--sp-4) 0; }
.warn-box > summary { cursor: pointer; font-weight: 600; }
.warn-box ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-6); }

/* login */
.login-wrap { display: grid; place-items: center; min-height: calc(100% - 1.875rem); padding: var(--sp-6); background: radial-gradient(75rem 37.5rem at 50% -10%, var(--accent-soft), var(--bg)); }
.login-card { width: 100%; max-width: 23.75rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-8); box-shadow: var(--shadow); }
.login-brand { font-weight: 800; letter-spacing: .3em; font-size: var(--fs-8); }
.login-brand .logo + .login-brand-name { font-size: var(--fs-5); letter-spacing: .08em; margin-top: var(--sp-2); }
.login-card input { max-width: none; }

/* shell: the prototype's top bar over the whole width, a sidebar per workspace that collapses to icons */
.app { display: grid; grid-template-columns: 13.75rem minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.app.bare { grid-template-columns: minmax(0, 1fr); }
.app.bare .main { grid-column: 1; }
.app.collapsed { grid-template-columns: 3.75rem minmax(0, 1fr); }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-3) var(--sp-6); background: var(--panel); border-bottom: 1px solid var(--line); border-top: .1875rem solid var(--topline); flex-wrap: wrap; position: relative; z-index: var(--z-topbar); }
.app.prod .topbar { border-top-color: var(--bad); }
.brand { font-weight: 700; letter-spacing: .02em; font-size: var(--fs-5); display: flex; align-items: center; gap: var(--sp-3); white-space: nowrap; }
.brand i { width: 1.125rem; height: 1.125rem; border-radius: var(--r-sm); background: var(--accent); display: inline-block; }
.top-r { display: flex; gap: var(--sp-4); align-items: center; margin-left: auto; flex-wrap: wrap; }
/* The search centred on the window (useCenteredSearch sets data-centered and --top-side, the wider of brand and
   controls): both side columns are at least that wide, so they stay equal and the search (at most 48rem) shrinks
   first. Without the attribute, or on a phone, the flex layout above stays. */
@media (min-width: 761px) {
  .topbar[data-centered] { display: grid; grid-template-columns: minmax(var(--top-side, max-content), 1fr) minmax(0, 48rem) minmax(var(--top-side, max-content), 1fr); }
  .topbar[data-centered] .brand { grid-column: 1; justify-self: start; }
  .topbar[data-centered] .assistant { grid-column: 2; min-width: 0; max-width: none; width: 100%; }
  .topbar[data-centered] .top-r { grid-column: 3; justify-self: end; flex-wrap: nowrap; margin-left: 0; }
}
.sel { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-1) var(--sp-3); width: auto; max-width: 15rem; }
.role-pick { display: flex; flex-direction: row; align-items: center; gap: var(--sp-2); white-space: nowrap; }
.role-pick label { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; display: inline-flex; align-items: center; }
.viewas-ico { color: var(--muted); display: inline-flex; }
.viewas-pick select { width: 6rem; }
#partner-select { max-width: 9rem; }
.viewas-chip { display: inline-flex; align-items: center; gap: var(--sp-2); white-space: nowrap; font-size: var(--fs-2); border: 1px solid var(--warn); background: var(--warn-soft, var(--panel2)); color: var(--fg); border-radius: var(--r-lg); padding: 0 var(--sp-1) 0 var(--sp-3); }
.viewas-chip select { margin: 0; width: auto; }
.viewas-x { border: 0; background: none; color: inherit; padding: var(--sp-1); border-radius: var(--r-sm); display: inline-grid; place-items: center; cursor: pointer; }
.viewas-x:hover { background: var(--panel2); }
.role-pick select.locale { margin: 0; width: auto; padding: var(--sp-1) var(--sp-3); background: var(--panel2); }
.envtag { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-1); font-family: var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2px var(--sp-3); white-space: nowrap; background: var(--panel); }
.side .foot .envtag { margin-bottom: var(--sp-3); max-width: 100%; white-space: normal; text-align: left; border-radius: var(--r-md); cursor: pointer; }
.envtag:hover { border-color: var(--accent); color: var(--fg); }
.envtag.prod { color: var(--bad); border-color: var(--bad); }
.envdot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--env); display: inline-block; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-fg); font-weight: 700; font-size: var(--fs-2); display: inline-grid; place-items: center; flex: none; padding: 0; }
.avatar:hover { box-shadow: 0 0 0 .1875rem var(--accent-soft); }
.avatar.big { width: 2.75rem; height: 2.75rem; font-size: var(--fs-5); cursor: default; }
.side { grid-column: 1; grid-row: 2; background: var(--panel); border-right: 1px solid var(--line); padding: var(--sp-5) var(--sp-3); overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.ws { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--sp-3); }
.ws-name { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: var(--sp-2) var(--sp-4) var(--sp-2); }
.nav { display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left; background: none; border: 0; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); color: var(--muted); }
.nav:hover { background: var(--panel2); color: var(--fg); }
.nav.on { background: var(--accent-soft); color: var(--fg); font-weight: 600; box-shadow: inset .1875rem 0 0 var(--accent); }
.nav svg, .side-toggle svg { width: 1.125rem; height: 1.125rem; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav .ico { position: relative; display: inline-flex; }
.nav .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .cnt { margin-left: auto; font-size: var(--fs-1); background: var(--bad); color: var(--on-strong); border-radius: var(--r-pill); padding: 0 var(--sp-2); font-weight: 600; }
.nav .dot { display: none; }
/* A count of work waiting (supply to review) rather than a problem. */
.nav .cnt.todo { background: var(--accent); color: var(--accent-fg); }
/* A section inside a workspace (Operations › Supply): a small heading, its entries indented a little. */
.nav-sec { font-size: var(--fs-0); font-weight: 600; letter-spacing: .04em; color: var(--muted); padding: var(--sp-3) var(--sp-4) var(--sp-0); display: flex; align-items: center; gap: var(--sp-2); }
.nav-sec::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.nav-sec.end { padding: var(--sp-0) var(--sp-4) var(--sp-1); }
.nav.in-sec { padding-left: var(--sp-5); }
/* The collapse toggle: a small round icon button on the divider between the menu and the panes (WP-E), in the grid cell of the menu, half over the divider. */
.side-toggle { grid-column: 1; grid-row: 2; justify-self: end; align-self: start; transform: translateX(50%); margin-top: var(--sp-5); z-index: var(--z-side-toggle); display: grid; place-items: center; width: 1.5rem; height: 1.5rem; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.side-toggle:hover { background: var(--panel2); color: var(--fg); }
.side-toggle svg { width: .875rem; height: .875rem; transition: transform .15s; }
.app.collapsed .side-toggle svg { transform: rotate(180deg); }
.app.collapsed .side { padding-inline: var(--sp-2); overflow-x: hidden; }
.app.collapsed .ws-name, .app.collapsed .side .foot, .app.collapsed .nav .lbl, .app.collapsed .nav .cnt { display: none; }
.app.collapsed .nav { justify-content: center; padding: var(--sp-3) 0; position: relative; }
.app.collapsed .nav .dot { display: block; position: absolute; top: -.4375rem; right: -.5rem; min-width: 1rem; height: 1rem; padding: 0 var(--sp-1); border-radius: var(--r-md); background: var(--bad); color: var(--on-strong); font-size: var(--fs-0); font-weight: 700; line-height: 1rem; text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.app.collapsed .nav .dot.todo { background: var(--accent); color: var(--accent-fg); }
.app.collapsed .nav-sec { font-size: 0; padding: var(--sp-1) var(--sp-1); }
.app.collapsed .nav.in-sec { padding-left: 0; }
.side-tip { position: fixed; transform: translateY(-50%); background: var(--fg); color: var(--bg); font-size: var(--fs-2); font-weight: 500; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-sm); white-space: nowrap; pointer-events: none; z-index: var(--z-modal); }
.side .foot { margin-top: auto; padding: var(--sp-4); font-size: var(--fs-1); color: var(--muted); border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.main { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.env-bar { padding: var(--sp-1) var(--sp-6); font-size: var(--fs-2); background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); }
.env-bar.prod { background: var(--bad); color: var(--on-strong); font-weight: 600; letter-spacing: .02em; }
.env-bar.preview { display: flex; align-items: center; gap: var(--sp-5); background: var(--accent-soft, var(--panel2)); color: var(--fg); }
.env-bar.preview .btn { margin-left: auto; }
.profile-head { display: flex; gap: var(--sp-5); align-items: center; margin-bottom: var(--sp-5); }
.profile-body { padding-top: var(--sp-5); }
.env-manage { margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.env-manage h3 { margin: 0 0 var(--sp-3); }
.env-manage td .row { gap: var(--sp-2); justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--sp-field) var(--sp-6); }
.field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.field > label, .field .flabel { font-size: var(--fs-2); font-weight: 600; color: var(--fg); margin: 0; }
.field .hint { font-size: var(--fs-1); color: var(--muted); }
.field .err { font-size: var(--fs-1); color: var(--bad); }
.field.wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea { max-width: none; }
.field input.bad, .field select.bad { border-color: var(--bad); }
@media (max-width: 760px) {
  .app, .app.collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .main { grid-column: 1; grid-row: 3; }
  .side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: var(--sp-2) var(--sp-3); }
  .ws { flex-direction: row; margin: 0; }
  .ws-name, .side .foot, .side-toggle, .nav-sec { display: none; }
  .app.collapsed .nav .lbl { display: inline; }
  .app.collapsed .nav .dot, .side-tip { display: none; }
  .nav { width: auto; white-space: nowrap; }
  .assistant { order: 5; flex-basis: 100%; max-width: none; }
}

/* The operator's logo (components/Logo.tsx; docs/research/logo-motion.md).
   The colours are tokens in 00-tokens.css: the brand's own (data, like an
   environment's colour) and the same in both themes: the three icons keep
   their colour, each overlap has the file's own colour, the hole in the
   middle shows the page. Only the wordmark's ink adapts to a dark background.
   The Logo lab shows both themes at once, so its panels carry the dark
   theme's values as a class (.logo-on-dark). */
.logo-on-light { --logo-ink: #1a1a1a; --logo-ink-ls: #403b33; --lab-panel: #ffffff; --lab-line: #dbe1ea; } /* the light theme's --panel and --line */
.logo-on-dark { --logo-ink: #f2f5f9; --logo-ink-ls: #f2f5f9; --lab-panel: #151b24; --lab-line: #29323f; } /* the dark theme's --panel and --line */

/* The element: sized by height, the width follows the viewBox (no shift). */
.logo { display: block; height: 1.5rem; width: auto; flex: none; overflow: visible; }
/* The mark: three icons, three overlaps (an icon clipped by the other's twin,
   Logo.tsx), the hole a mask. */
.logo-i1 path { fill: var(--logo-blue); }
.logo-i2 path { fill: var(--logo-teal); }
.logo-i3 path { fill: var(--logo-red); }
.logo-ov12 path { fill: var(--logo-blue-teal); }
.logo-ov13 path { fill: var(--logo-blue-red); }
.logo-ov23 path { fill: var(--logo-red-teal); }
.logo-ink { fill: var(--logo-ink); }
.logo-localsensor .logo-ink { fill: var(--logo-ink-ls); }
.logo-accent { fill: var(--logo-word-accent); }
/* Every moving part turns around its own centre (fill-box: its own bounds, in
   user units). The wordmark has no transform-box: it never moves. */
.logo-i, .logo-mark { transform-box: fill-box; transform-origin: center; }

/* In the shell: top left, where the operator's name was, a link home. */
.brand-logo { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
.brand .logo { height: 1.5rem; }
.login-brand .logo { height: 2.25rem; margin: 0 auto var(--sp-1); }

/* The Logo lab (#/logo-lab): every brand, variant and animation, light and dark. */
.logo-lab .logo-row { display: flex; flex-wrap: wrap; gap: var(--sp-5); margin-bottom: var(--sp-6); }
.logo-panel { display: flex; align-items: center; gap: var(--sp-8); padding: var(--sp-6) var(--sp-7); border-radius: var(--r-md); border: 1px solid var(--lab-line); background: var(--lab-panel); min-height: 4.5rem; flex: 1 1 18rem; }
.logo-panel .logo { height: 2.25rem; }
.logo-lab-head { display: flex; align-items: baseline; gap: var(--sp-5); margin-top: var(--sp-6); }
.logo-lab-head h2 { margin: 0; }
.logo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); gap: var(--sp-5); margin-top: var(--sp-3); }
.logo-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: var(--sp-5); display: grid; gap: var(--sp-3); }
.logo-card .logo-card-head { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.logo-card .logo-card-head h3 { margin: 0; font-size: var(--fs-3); text-transform: none; letter-spacing: 0; }
.logo-card .logo-card-head .btn { margin-left: auto; }
.logo-card .logo-card-desc { margin: 0; }
.logo-card .logo-panel { padding: var(--sp-5) var(--sp-6); min-height: 3.75rem; }
.logo-card .logo-panel .logo { height: 1.75rem; }
.logo-new { color: var(--accent); border-color: var(--accent); margin-left: 0; }
.logo-lab .check { display: flex; gap: var(--sp-3); align-items: center; font-size: var(--fs-2); }
.logo-lab .checks { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-7); }

/* The animations: transforms and opacity only (the compositor's work), each
   at most 1.2 s, then the static logo (data-play comes off). Only the mark
   moves: the icons (and, for beat, the mark as a whole);
   the wordmark has no keyframes at all (owner, 2026-10-16). The overlaps and
   the hole are cut from the icons' twins, which follow the icons every frame
   (Logo.tsx, followIcons), so wherever the icons go the overlaps travel and
   change size with them and the hole stays where all three meet, or is gone
   while they are apart. Offsets in % of an icon (99.18 units): red−blue
   (57.2, −28.7), teal−blue (28.8, 28.4), red−teal (28.5, −57.2). The mark's
   centre in each icon's own box: blue (78, 49.5), teal (49.5, 21.3), red
   (21.3, 78). */

/* The pool (owner, 2026-10-16: fan, deal, bounce, shuffle, assemble, beat; 2026-11-01: spin replaces fan). */

/* spin (owner, 2026-11-01; replaces fan): the icons move apart (each away
   from the centre, 45 % of an icon), each turns a full 360° around its own
   centre while apart, then they come back with a slight settle: a 2 % press
   past the stack toward the centre, then rest (1.2 s). Every keyframe has the
   same list, translate() rotate(), so the browser interpolates the turn
   function by function (never as a matrix, in which 0° and 360° are one).
   Each segment is ease-in-out. Apart at 300 ms, the turn 300-900 ms (135° at
   558 ms), the press at 1080 ms, rest at 1200 ms. */
@keyframes logo-spin-1 { 0% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(-45%, 0) rotate(0deg); } 75% { transform: translate(-45%, 0) rotate(360deg); } 90% { transform: translate(2%, 0) rotate(360deg); } 100% { transform: translate(0, 0) rotate(360deg); } }
@keyframes logo-spin-2 { 0% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(0, 45%) rotate(0deg); } 75% { transform: translate(0, 45%) rotate(360deg); } 90% { transform: translate(0, -2%) rotate(360deg); } 100% { transform: translate(0, 0) rotate(360deg); } }
@keyframes logo-spin-3 { 0% { transform: translate(0, 0) rotate(0deg); } 25% { transform: translate(45%, -45%) rotate(0deg); } 75% { transform: translate(45%, -45%) rotate(360deg); } 90% { transform: translate(-2%, 2%) rotate(360deg); } 100% { transform: translate(0, 0) rotate(360deg); } }
.logo[data-play="spin"] .logo-i1 { animation: logo-spin-1 1.2s cubic-bezier(.45, 0, .55, 1) both; }
.logo[data-play="spin"] .logo-i2 { animation: logo-spin-2 1.2s cubic-bezier(.45, 0, .55, 1) both; }
.logo[data-play="spin"] .logo-i3 { animation: logo-spin-3 1.2s cubic-bezier(.45, 0, .55, 1) both; }

/* deal: the red icon is the deck; blue and teal are dealt from it into place (0.9 s). */
@keyframes logo-deal-1 { 0% { transform: translate(57.2%, -28.7%) rotate(-14deg); opacity: 0; } 25% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes logo-deal-2 { 0% { transform: translate(28.5%, -57.2%) rotate(12deg); opacity: 0; } 25% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes logo-deal-3 { 0% { transform: translateY(-10%) scale(1.04); } 100% { transform: none; } }
.logo[data-play="deal"] .logo-i3 { animation: logo-deal-3 .5s cubic-bezier(.2, .7, .2, 1) both; }
.logo[data-play="deal"] .logo-i1 { animation: logo-deal-1 .5s cubic-bezier(.2, .7, .2, 1) .15s both; }
.logo[data-play="deal"] .logo-i2 { animation: logo-deal-2 .5s cubic-bezier(.2, .7, .2, 1) .35s both; }

/* bounce: the icons drop in one by one and settle with a small bounce (1 s). */
@keyframes logo-bounce { 0% { transform: translateY(-130%); opacity: 0; } 10% { opacity: 1; } 55% { transform: translateY(6%); } 75% { transform: translateY(-3%); } 100% { transform: none; opacity: 1; } }
.logo[data-play="bounce"] .logo-i1 { animation: logo-bounce .7s cubic-bezier(.2, .7, .2, 1) both; }
.logo[data-play="bounce"] .logo-i2 { animation: logo-bounce .7s cubic-bezier(.2, .7, .2, 1) .12s both; }
.logo[data-play="bounce"] .logo-i3 { animation: logo-bounce .7s cubic-bezier(.2, .7, .2, 1) .26s both; }

/* shuffle: the icons trade places and come back (1 s). */
@keyframes logo-shuffle-1 { 0% { transform: none; } 40% { transform: translate(57.2%, -28.7%); } 60% { transform: translate(57.2%, -28.7%); } 100% { transform: none; } }
@keyframes logo-shuffle-2 { 0% { transform: none; } 40% { transform: translate(-28.8%, -28.4%); } 60% { transform: translate(-28.8%, -28.4%); } 100% { transform: none; } }
@keyframes logo-shuffle-3 { 0% { transform: none; } 40% { transform: translate(-28.5%, 57.2%); } 60% { transform: translate(-28.5%, 57.2%); } 100% { transform: none; } }
.logo[data-play="shuffle"] .logo-i1 { animation: logo-shuffle-1 1s ease-in-out both; }
.logo[data-play="shuffle"] .logo-i2 { animation: logo-shuffle-2 1s ease-in-out both; }
.logo[data-play="shuffle"] .logo-i3 { animation: logo-shuffle-3 1s ease-in-out both; }

/* assemble: the three icons come in from their own side, small and a little
   turned, and snap into the stack with a short overshoot; the overlap colours
   and the hole appear the moment they meet (0.9 s). */
@keyframes logo-assemble-1 { 0% { transform: translate(-90%, 0) rotate(-20deg) scale(.6); opacity: 0; } 30% { opacity: 1; } 75% { transform: translate(3%, 0) rotate(2deg) scale(1.02); } 100% { transform: none; opacity: 1; } }
@keyframes logo-assemble-2 { 0% { transform: translate(0, 90%) rotate(20deg) scale(.6); opacity: 0; } 30% { opacity: 1; } 75% { transform: translate(0, -3%) rotate(-2deg) scale(1.02); } 100% { transform: none; opacity: 1; } }
@keyframes logo-assemble-3 { 0% { transform: translate(70%, -70%) rotate(-20deg) scale(.6); opacity: 0; } 30% { opacity: 1; } 75% { transform: translate(-3%, 3%) rotate(2deg) scale(1.02); } 100% { transform: none; opacity: 1; } }
.logo[data-play="assemble"] .logo-i1 { animation: logo-assemble-1 .7s cubic-bezier(.2, .7, .2, 1) both; }
.logo[data-play="assemble"] .logo-i2 { animation: logo-assemble-2 .7s cubic-bezier(.2, .7, .2, 1) .08s both; }
.logo[data-play="assemble"] .logo-i3 { animation: logo-assemble-3 .7s cubic-bezier(.2, .7, .2, 1) .16s both; }

/* beat: a heartbeat, lub-dub. The icons press toward the centre twice, so the
   overlaps widen and the hole opens, while the mark swells with each beat;
   then everything settles (0.8 s). The first beat's peak is at 176 ms (the
   frame tests/logo.spec.ts freezes). */
@keyframes logo-beat-1 { 0%, 40%, 75%, 100% { transform: none; } 22% { transform: translate(10%, 0); } 55% { transform: translate(6%, 0); } }
@keyframes logo-beat-2 { 0%, 40%, 75%, 100% { transform: none; } 22% { transform: translate(0, -10%); } 55% { transform: translate(0, -6%); } }
@keyframes logo-beat-3 { 0%, 40%, 75%, 100% { transform: none; } 22% { transform: translate(-7%, 7%); } 55% { transform: translate(-4.2%, 4.2%); } }
@keyframes logo-beat-mark { 0%, 40%, 75%, 100% { transform: none; } 22% { transform: scale(1.05); } 55% { transform: scale(1.03); } }
.logo[data-play="beat"] .logo-i1 { animation: logo-beat-1 .8s cubic-bezier(.4, 0, .2, 1) both; }
.logo[data-play="beat"] .logo-i2 { animation: logo-beat-2 .8s cubic-bezier(.4, 0, .2, 1) both; }
.logo[data-play="beat"] .logo-i3 { animation: logo-beat-3 .8s cubic-bezier(.4, 0, .2, 1) both; }
.logo[data-play="beat"] .logo-mark { animation: logo-beat-mark .8s cubic-bezier(.4, 0, .2, 1) both; }

/* loading: a carousel. Every 1050 ms the three icons each move along the circle through the three resting places to the next place (450 ms, ease-in-out with a slight settle), then hold 600 ms; a full cycle is three steps (3150 ms) and the icons are back where they began. Each resting phase is a valid stack: the overlaps are cut from the twins, so they follow. The wordmark stays put. */
@keyframes logo-loading-1 { 0.0% { transform: translate(0%, 0%); } 1.429% { transform: translate(0.2%, 1.2%); } 2.857% { transform: translate(0.97%, 4.41%); } 4.286% { transform: translate(2.66%, 8.99%); } 5.714% { transform: translate(5.61%, 14.18%); } 7.143% { transform: translate(9.82%, 19.16%); } 8.571% { transform: translate(14.93%, 23.25%); } 10.0% { transform: translate(20.25%, 26.07%); } 11.429% { transform: translate(24.89%, 27.63%); } 12.857% { transform: translate(27.98%, 28.28%); } 14.286% { transform: translate(28.8%, 28.4%); } 33.333% { transform: translate(28.8%, 28.4%); } 33.333% { transform: translate(28.8%, 28.4%); } 34.762% { transform: translate(31.13%, 28.63%); } 36.19% { transform: translate(37.5%, 28.44%); } 37.619% { transform: translate(46.58%, 25.98%); } 39.048% { transform: translate(56.19%, 19.73%); } 40.476% { transform: translate(63.64%, 9.65%); } 41.905% { transform: translate(66.89%, -2.51%); } 43.333% { transform: translate(65.74%, -14.03%); } 44.762% { transform: translate(61.96%, -22.66%); } 46.19% { transform: translate(58.29%, -27.55%); } 47.619% { transform: translate(57.2%, -28.7%); } 66.667% { transform: translate(57.2%, -28.7%); } 66.667% { transform: translate(57.2%, -28.7%); } 68.095% { transform: translate(55.48%, -30.32%); } 69.524% { transform: translate(50.26%, -34.07%); } 70.952% { transform: translate(41.47%, -37.64%); } 72.381% { transform: translate(29.94%, -38.48%); } 73.81% { transform: translate(17.83%, -34.88%); } 75.238% { transform: translate(7.86%, -27.02%); } 76.667% { transform: translate(1.86%, -17.01%); } 78.095% { transform: translate(-0.25%, -7.74%); } 79.524% { transform: translate(-0.2%, -1.59%); } 80.952% { transform: translate(0%, 0%); } 100% { transform: translate(0%, 0%); } }
@keyframes logo-loading-2 { 0.0% { transform: translate(0%, 0%); } 1.429% { transform: translate(2.33%, 0.23%); } 2.857% { transform: translate(8.7%, 0.04%); } 4.286% { transform: translate(17.78%, -2.42%); } 5.714% { transform: translate(27.39%, -8.67%); } 7.143% { transform: translate(34.84%, -18.75%); } 8.571% { transform: translate(38.09%, -30.91%); } 10.0% { transform: translate(36.94%, -42.43%); } 11.429% { transform: translate(33.16%, -51.06%); } 12.857% { transform: translate(29.49%, -55.95%); } 14.286% { transform: translate(28.4%, -57.1%); } 33.333% { transform: translate(28.4%, -57.1%); } 33.333% { transform: translate(28.4%, -57.1%); } 34.762% { transform: translate(26.68%, -58.72%); } 36.19% { transform: translate(21.46%, -62.47%); } 37.619% { transform: translate(12.67%, -66.04%); } 39.048% { transform: translate(1.14%, -66.88%); } 40.476% { transform: translate(-10.97%, -63.28%); } 41.905% { transform: translate(-20.94%, -55.42%); } 43.333% { transform: translate(-26.94%, -45.41%); } 44.762% { transform: translate(-29.05%, -36.14%); } 46.19% { transform: translate(-29%, -29.99%); } 47.619% { transform: translate(-28.8%, -28.4%); } 66.667% { transform: translate(-28.8%, -28.4%); } 66.667% { transform: translate(-28.8%, -28.4%); } 68.095% { transform: translate(-28.6%, -27.2%); } 69.524% { transform: translate(-27.83%, -23.99%); } 70.952% { transform: translate(-26.14%, -19.41%); } 72.381% { transform: translate(-23.19%, -14.22%); } 73.81% { transform: translate(-18.98%, -9.24%); } 75.238% { transform: translate(-13.87%, -5.15%); } 76.667% { transform: translate(-8.55%, -2.33%); } 78.095% { transform: translate(-3.91%, -0.77%); } 79.524% { transform: translate(-0.82%, -0.12%); } 80.952% { transform: translate(0%, 0%); } 100% { transform: translate(0%, 0%); } }
@keyframes logo-loading-3 { 0.0% { transform: translate(0%, 0%); } 1.429% { transform: translate(-1.72%, -1.62%); } 2.857% { transform: translate(-6.94%, -5.37%); } 4.286% { transform: translate(-15.73%, -8.94%); } 5.714% { transform: translate(-27.26%, -9.78%); } 7.143% { transform: translate(-39.37%, -6.18%); } 8.571% { transform: translate(-49.34%, 1.68%); } 10.0% { transform: translate(-55.34%, 11.69%); } 11.429% { transform: translate(-57.45%, 20.96%); } 12.857% { transform: translate(-57.4%, 27.11%); } 14.286% { transform: translate(-57.2%, 28.7%); } 33.333% { transform: translate(-57.2%, 28.7%); } 33.333% { transform: translate(-57.2%, 28.7%); } 34.762% { transform: translate(-57%, 29.9%); } 36.19% { transform: translate(-56.23%, 33.11%); } 37.619% { transform: translate(-54.54%, 37.69%); } 39.048% { transform: translate(-51.59%, 42.88%); } 40.476% { transform: translate(-47.38%, 47.86%); } 41.905% { transform: translate(-42.27%, 51.95%); } 43.333% { transform: translate(-36.95%, 54.77%); } 44.762% { transform: translate(-32.31%, 56.33%); } 46.19% { transform: translate(-29.22%, 56.98%); } 47.619% { transform: translate(-28.4%, 57.1%); } 66.667% { transform: translate(-28.4%, 57.1%); } 66.667% { transform: translate(-28.4%, 57.1%); } 68.095% { transform: translate(-26.07%, 57.33%); } 69.524% { transform: translate(-19.7%, 57.14%); } 70.952% { transform: translate(-10.62%, 54.68%); } 72.381% { transform: translate(-1.01%, 48.43%); } 73.81% { transform: translate(6.44%, 38.35%); } 75.238% { transform: translate(9.69%, 26.19%); } 76.667% { transform: translate(8.54%, 14.67%); } 78.095% { transform: translate(4.76%, 6.04%); } 79.524% { transform: translate(1.09%, 1.15%); } 80.952% { transform: translate(0%, 0%); } 100% { transform: translate(0%, 0%); } }
.logo[data-play="loading"] .logo-i1 { animation: logo-loading-1 3150ms linear infinite; }
.logo[data-play="loading"] .logo-i2 { animation: logo-loading-2 3150ms linear infinite; }
.logo[data-play="loading"] .logo-i3 { animation: logo-loading-3 3150ms linear infinite; }

/* Reduced motion (WCAG 2.3.3, C39): no keyframes at all; the static logo. */
@media (prefers-reduced-motion: reduce) {
  .logo, .logo * { animation: none !important; }
}
/* pages */
.page { padding: var(--sp-5) var(--sp-6) var(--sp-7); max-width: 73.75rem; }
.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--sp-6); flex-wrap: wrap; }
.page-head p { margin: var(--sp-1) 0 0; max-width: 47.5rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); overflow: auto; margin-bottom: var(--sp-5); }
.card h3:first-child { margin-top: 0; }
.card > h2 { margin: 0; padding: var(--sp-3) var(--sp-5); font-size: var(--fs-1); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: var(--sp-3); }
.card > .body { padding: var(--sp-5); }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18.75rem, 1fr)); gap: var(--sp-5); }
.crumbs { margin-bottom: var(--sp-3); color: var(--muted); font-size: var(--fs-2); }
.form .field { margin-bottom: var(--sp-field); }
.help { font-size: var(--fs-1); color: var(--muted); margin-top: var(--sp-0); }
.check { display: flex; gap: var(--sp-3); align-items: center; color: var(--fg); font-size: var(--fs-3); }
.checks { display: grid; gap: 2px; }
.attrs > summary { cursor: pointer; font-size: var(--fs-3); color: var(--muted); padding: var(--sp-1) 0; }
.attrs > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.attrs[open] > summary { margin-bottom: var(--sp-1); }
textarea.json { font-family: var(--mono); font-size: var(--fs-2); }
textarea.invalid { border-color: var(--bad); }
.warnings { margin: 0; padding-left: var(--sp-6); color: var(--warn); }
.warnings li { margin-bottom: var(--sp-1); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-grid); }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-2); padding: 0 var(--sp-4); height: var(--row); background: var(--panel2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover td { background: var(--panel2); }
.table tr:last-child td { border-bottom: 0; }
.table.num td:not(:first-child), .table.num th:not(:first-child) { text-align: right; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--panel2); }
.table tr.killed td { background: var(--bad-soft); }
.kv td { padding: 2px var(--sp-5) 2px 0; } .kv .num { text-align: right; }
tr.rc-incident td { background: var(--bad-soft); }
tr.rc-warning td { background: var(--warn-soft); }
.pill.rc-ok { color: var(--ok); border-color: var(--ok); }
.pill.rc-incident { color: var(--bad); border-color: var(--bad); }
.pill.rc-warning { color: var(--warn); border-color: var(--warn); }
.diff { font-family: var(--mono); font-size: var(--fs-2); background: var(--input); padding: var(--sp-3); border-radius: var(--r-sm); margin: 0 0 var(--sp-2); overflow: auto; max-height: 26.25rem; }
.diff .add { color: var(--ok); background: var(--ok-soft); }
.diff .del { color: var(--bad); background: var(--bad-soft); }

/* red button */

/* dialog and notifications */
.modal-back { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: var(--sp-6); z-index: var(--z-modal); }
.modal { width: 100%; max-width: 27.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--shadow); }
.modal h2, .modal h3 { font-size: var(--fs-4); text-transform: none; letter-spacing: 0; color: var(--fg); margin: 0 0 var(--sp-3); }
.modal input { max-width: none; }
.modal .row.end { margin-top: var(--sp-6); gap: var(--sp-3); }
/* bottom: above an open sheet's action bar (--toast-lift, ui/sheet.tsx; walk feedback 2026-11-12 #2), never over a button. */
.toasts { position: fixed; right: 1rem; bottom: calc(var(--toast-lift, 0rem) + 1rem); display: grid; gap: var(--sp-3); z-index: var(--z-toast); max-width: calc(100vw - 2rem); }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: .1875rem solid var(--ok); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.toast.bad { border-left-color: var(--bad); }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
  .page { padding: var(--sp-6); }
}
.linklike { background: none; border: 0; color: var(--accent); padding: var(--sp-5) 0 0; font-size: var(--fs-2); text-decoration: underline; cursor: pointer; }
.side-user .btn { margin-top: var(--sp-3); }
.grant { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-3); }
.checks.perms { grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); }
.us-active { color: var(--ok); border-color: var(--ok); }
.us-invited { color: var(--warn); border-color: var(--warn); }
.us-disabled { color: var(--muted); }
/* The Users detail's one verdict line (a locked login), under the name and actions. */
.detail-head .us-verdict { flex-basis: 100%; order: 99; }
tr.disabled-row td { opacity: .55; }
tr.partner-row td { background: var(--panel2); }
.usage { position: relative; min-width: 8.75rem; background: var(--input); border-radius: var(--r-sm); padding: var(--sp-0) var(--sp-3); overflow: hidden; }
.usage-bar { position: absolute; inset: 0 auto 0 0; background: var(--ok-soft); }
.usage-bar.high { background: var(--warn-soft); }
.usage-bar.full { background: var(--bad-soft); }
.usage span { position: relative; }
.geomap { display: block; max-width: 100%; image-rendering: pixelated; background: var(--input); border: 1px solid var(--line); border-radius: var(--r-sm); margin-top: var(--sp-3); }
.stack { display: grid; gap: var(--sp-3); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.75rem, 1fr)); gap: var(--sp-3) var(--sp-5); }
.grid2 label, .stack label { display: grid; gap: var(--sp-0); font-size: var(--fs-2); color: var(--muted); }
/* A check box and its text stay on one line inside a stack too (feedback note 108: the Reopen dialog's options stacked). */
.grid2 label.check, .stack label.check { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); color: var(--fg); }
.grid2 label.check:not(.small), .stack label.check:not(.small) { font-size: var(--fs-3); }

/* language and format */
select.locale { margin-top: var(--sp-4); width: 100%; font-size: var(--fs-2); }

.toast-rid { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); font-size: var(--fs-2); color: var(--muted); }
.toast-rid code { user-select: all; }
/* Tip (ui/Tip.tsx): an (i) whose explanation shows on hover and focus (feedback notes 25, 30). */
.tip { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: .9375rem; height: .9375rem; margin-left: var(--sp-1); border: 1px solid var(--muted); border-radius: 50%; color: var(--muted); font-size: var(--fs-0); font-weight: 700; font-style: italic; line-height: 1; cursor: help; vertical-align: middle; }
/* A 15 px mark with a 25 px hit area (WCAG 2.5.8). */
.tip { position: relative; }
.tip::after { content: ""; position: absolute; inset: -.3125rem; border-radius: 50%; }
.tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The bubble lives on document.body, fixed, kept inside the window by Tip. */
.tip-bubble { position: fixed; z-index: var(--z-tip); max-width: 18rem; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--fg); box-shadow: var(--shadow); font-size: var(--fs-2); line-height: 1.35; pointer-events: none; }
.field > .lab { display: flex; align-items: center; gap: 0; min-height: 1.125rem; }
.field > .lab > label { font-size: var(--fs-2); font-weight: 600; color: var(--fg); margin: 0; }
.field.invalid > .lab > label { color: var(--bad); }
/* Radio buttons keep their own size (base inputs are 100% wide; feedback note 33). */
input[type=radio] { width: auto; }
/* PageInfo (ui/PageInfo.tsx): the page's (i) beside its title, a button that opens a popover (console row 6). */
.page-title { display: flex; align-items: center; gap: var(--sp-2); }
.page-title > h1 { margin: 0; }
button.tip.page-info { padding: 0; margin-left: 0; background: none; cursor: pointer; }
.page-info-pop { position: fixed; z-index: var(--z-tip); max-width: 24rem; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--fg); box-shadow: var(--shadow); font-size: var(--fs-2); line-height: 1.4; font-weight: 400; }
.page-info-pop p { margin: 0; max-width: none; }
.page-info-pop p + p { margin-top: var(--sp-2); }
/* IconButton (ui/IconButton.tsx; targeting setup §m.5, the mockup's .btn.ib and .tg): a 32 px hit target at every
   text size, the focus ring, the pressed look; the Include / Exclude toggle (tone only / never) is an outline with
   a muted icon when off, a solid fill with a white, bolder icon when on, a light tint when inherited. */
.icon-btn { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: var(--sp-1); min-width: max(2rem, 32px); min-height: max(2rem, 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--fg); font: inherit; font-size: var(--fs-3); cursor: pointer; }
.icon-btn .icon { width: 1.125rem; height: 1.125rem; }
.icon-btn.with-text { padding: 0 var(--sp-2); }
.icon-btn.round { border-radius: 50%; }
.icon-btn:hover:not([aria-disabled="true"]) { border-color: var(--accent); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.icon-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.icon-btn.only, .icon-btn.never { color: var(--muted); }
.icon-btn.only:hover:not([aria-disabled="true"]), .icon-btn.never:hover:not([aria-disabled="true"]) { border-color: var(--fg); color: var(--fg); }
.icon-btn.only[aria-pressed="true"] { background: var(--only-on); border-color: var(--only-on); color: var(--on-fill); }
.icon-btn.never[aria-pressed="true"] { background: var(--never-on); border-color: var(--never-on); color: var(--on-fill); }
.icon-btn.only[aria-pressed="true"] .icon, .icon-btn.never[aria-pressed="true"] .icon { stroke-width: 3; }
.icon-btn.only.inherited[aria-pressed="true"] { background: var(--only-inh); border-color: var(--only-on-fg); color: var(--only-on-fg); opacity: 1; }
.icon-btn.never.inherited[aria-pressed="true"] { background: var(--never-inh); border-color: var(--never-fg); color: var(--never-fg); opacity: 1; }
/* The catalog's swatches of the targeting tokens (views/dev/UiCatalog.tsx). */
.token-swatch { display: inline-flex; align-items: center; gap: var(--sp-2); }
.token-swatch > i { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--on-fill); }
.token-swatch > i.sw-only-on { background: var(--only-on); }
.token-swatch > i.sw-never-on { background: var(--never-on); }
.token-swatch > i.sw-only-inh { background: var(--only-inh); color: var(--only-on-fg); }
.token-swatch > i.sw-never-inh { background: var(--never-inh); color: var(--never-fg); }
.token-swatch > i.sw-never-soft { background: var(--never-soft); color: var(--never-fg); }
.token-swatch > i.sw-tmap-include { background: var(--tmap-include-fill); border-color: var(--tmap-include-edge); }
.token-swatch > i.sw-tmap-exclude { background: repeating-linear-gradient(45deg, var(--tmap-exclude) 0 1px, transparent 1px 4px); border-color: var(--tmap-exclude); }
.token-swatch > i.sw-tmap-edit { background: var(--tmap-edit); border: 2px solid var(--tmap-edit-ring); border-radius: 50%; }
.token-swatch > i.sw-tmap-paused { background: transparent; border: 2px dashed var(--tmap-paused); }
.token-swatch > i.sw-tmap-attention { background: var(--tmap-attention); border-radius: 50%; }
.token-swatch > i.sw-tmap-draw { background: transparent; border: 2px solid var(--tmap-draw); }
/* The idle lock (components/IdleLock.tsx): the warning sits at the bottom
   centre, on the toasts' layer but clear of them (they are bottom right);
   the lock's reason is one quiet line on the login card. No transitions or
   animations of their own, so "No UI animations" (profile › Display) and
   the system's reduced motion have nothing to stop here; should one be
   added, :root[data-motion=off] in 10-base.css stops it. */
.idle-warning { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--toast-lift, 0rem) + 1rem); z-index: var(--z-toast); width: max-content; max-width: min(28rem, calc(100vw - 2rem));
  display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left: .1875rem solid var(--warn);
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.lock-notice { background: var(--warn-soft); border: 1px solid var(--line); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-sm); margin: var(--sp-4) 0; }
/* The map building block (ui/map/TMap.tsx; targeting setup §m.4, §m.9; the mockup's TMap and Location workspace). The
   tools float on the map as icon buttons (no panel behind them): a row at the top left with a gap before Layers, the
   status card under it only while drawing or editing, zoom and Fit top right, the scale bar bottom left, the tip at
   the pointer, "Removed · Undo" at the bottom. The key (MapLegend) sits under the map. */
.tmap { position: relative; overflow: hidden; background: var(--panel2); }
.tmap > .basemap { position: absolute; inset: 0; }
.tmap .maplibregl-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tmap.drawing .maplibregl-canvas { cursor: crosshair; }
.tmap-top { position: absolute; top: var(--sp-2); left: var(--sp-2); max-width: calc(100% - 3.5rem); display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); z-index: 1; pointer-events: none; }
.tmap-top > * { pointer-events: auto; }
.tmap-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.tmap-sep { width: 1px; align-self: stretch; margin: 0 2px; background: var(--line); }
.tmap-nav { position: absolute; top: var(--sp-2); right: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-1); z-index: 1; }
.tmap-tools .icon-btn, .tmap-nav .icon-btn { box-shadow: var(--shadow); }
.tmap-tools .icon-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-fill); }
.tmap-layers { margin: 0; padding: var(--sp-2) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-1); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--fg); font-size: var(--fs-1); box-shadow: var(--shadow); }
.tmap-layers legend { padding: 0; font-weight: 600; }
/* the status line only reports: clicks pass through to the map (a short map put its wrapped text over the first corner) */
.tmap-top > .tmap-status { pointer-events: none; }
.tmap-status { max-width: 30rem; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-sm); background: var(--panel); color: var(--fg); font-size: var(--fs-1); box-shadow: var(--shadow); }
.tmap-status.empty { display: none; }
.tmap-status.err { color: var(--bad); }
.tmap-scale { position: absolute; left: var(--sp-2); bottom: var(--sp-2); box-sizing: border-box; padding: 0 var(--sp-1); border: 2px solid var(--fg); border-top: 0; background: color-mix(in srgb, var(--panel) 80%, transparent); color: var(--fg); font-size: var(--fs-1); line-height: 1.4; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; z-index: 1; }
.tmap-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); margin: var(--sp-2) 0 0; color: var(--muted); }
.tmap-legend > span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.tmap-sw { display: inline-block; width: .9rem; height: .75rem; border-radius: 2px; }
.tmap-sw.include { background: color-mix(in srgb, var(--tmap-include) 45%, transparent); box-shadow: inset 0 0 0 1px var(--tmap-include); }
.tmap-sw.exclude { background: repeating-linear-gradient(45deg, var(--tmap-exclude) 0 1.5px, transparent 1.5px 5px); box-shadow: inset 0 0 0 1px var(--tmap-exclude); }
.tmap-tip { position: absolute; pointer-events: none; padding: 2px var(--sp-2); border-radius: var(--r-xs); background: var(--panel); color: var(--fg); font-size: var(--fs-1); white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); transform: translate(0.75rem, -50%); z-index: 1; }
.tmap-tip[hidden] { display: none; }
.tmap-cross { position: absolute; left: 50%; top: 50%; width: 1.375rem; height: 1.375rem; transform: translate(-50%, -50%); pointer-events: none; z-index: 1;
  background: linear-gradient(var(--fg), var(--fg)) center / 2px 100% no-repeat, linear-gradient(var(--fg), var(--fg)) center / 100% 2px no-repeat; opacity: .7; }
.tmap-removed { position: absolute; left: 50%; bottom: var(--sp-6); transform: translateX(-50%); display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3); border-radius: var(--r-sm); background: var(--panel); color: var(--fg); font-size: var(--fs-1); box-shadow: var(--shadow); z-index: 1; }
/* ERP foundation (docs/console-design.md): pages that fill the height */
.view { flex: 1 0 auto; }
.view:has(> .page.fill) { flex: 1 1 0; min-height: 0; }
.page.fill { max-width: none; height: 100%; display: flex; flex-direction: column; padding-bottom: 0; min-height: 26.25rem; }
.page-head.tight { margin-bottom: var(--sp-3); align-items: center; }
/* Segmented control: the options share the bar evenly, each as wide as the longest (feedback note 121);
   in a form field the bar fills the field. */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-left: var(--sp-5); }
.seg button { background: var(--panel); border: 0; border-right: 1px solid var(--line); padding: 0 var(--sp-4); line-height: calc(var(--ctl) - 2px); color: var(--muted); text-align: center; }
.field > .seg { display: grid; margin-left: 0; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent); color: var(--accent-fg); }
input.filter { width: 13.75rem; }
label.inline { display: inline-flex; gap: var(--sp-3); align-items: center; margin: 0; }
label.inline select { width: auto; }

/* master-detail */
.md { flex: 1; min-height: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--panel); margin-bottom: var(--sp-5); }
.md-master { min-height: 6.25rem; display: flex; flex-direction: column; flex-grow: 0; flex-shrink: 0; }
.md-split { height: .5rem; cursor: row-resize; background: var(--input); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; place-items: center; flex: none; }
body.dragging, body.dragging * { user-select: none !important; -webkit-user-select: none !important; cursor: row-resize !important; }
.md-split { touch-action: none; }
.md-split::after { content: ""; width: 2.5rem; height: .1875rem; border-radius: 2px; background: var(--line); }
.md-split:focus-visible { outline: 2px solid var(--accent); }
.md-detail { flex: 1; min-height: 5rem; overflow: auto; }
.detail { padding: var(--sp-4) var(--sp-5) var(--sp-6); }
.detail-head { display: flex; gap: var(--sp-3); align-items: flex-start; flex-wrap: wrap; }
.detail-head h2 { margin: 0; font-size: var(--fs-5); overflow-wrap: anywhere; }
/* DetailTitle: the name takes what it needs, up to two lines then an
   ellipsis; the status and other pills sit beside it and wrap onto their own
   row when they do not fit. .detail-main may shrink, so the actions beside
   it keep their place (or wrap below it) and are never overlapped. */
.detail-main { flex: 1 1 14rem; min-width: 0; }
.head-title { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); min-width: 0; }
.head-name { flex: 0 1 auto; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); min-width: 0; }
.head-meta > .pill { margin: 0; }
.facts { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-7); margin: var(--sp-3) 0 0; font-size: var(--fs-2); }
.facts dt { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.dt-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: var(--sp-4) 0 var(--sp-5); overflow-x: auto; position: sticky; top: 0; background: var(--panel); z-index: var(--z-sticky); }
.dt-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: var(--sp-2) var(--sp-5); white-space: nowrap; }
.dt-tab.on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.kvlist { display: grid; grid-template-columns: max-content 1fr; gap: var(--sp-1) var(--sp-6); margin: 0 0 var(--sp-4); }
.kvlist > div { display: contents; }
.kvlist dt { color: var(--muted); } .kvlist dd { margin: 0; }
.timeline { list-style: none; margin: 0 0 var(--sp-3); padding: 0; }
.timeline li { padding: var(--sp-1) 0 var(--sp-1) var(--sp-5); border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -.3125rem; top: .6875rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }

.dt-badge { display: inline-block; margin-left: var(--sp-2); min-width: 1.25em; padding: 0 .375em; border-radius: var(--r-pill); background: var(--accent); color: var(--on-strong); font-size: var(--fs-2); line-height: 1.4; text-align: center; font-weight: 600; }

/* The action bar (ActionBar.tsx; console-style-guide §7): the actions of one object or list, ≤ 3 buttons, the rest
   under More actions ▾ (opening to the left edge of the summary's right side, so it stays inside the detail). */
.action-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.action-bar-more .menu-pop { left: auto; right: 0; }
.action-bar-more .menu-pop > a { padding: var(--sp-2) var(--sp-5); color: var(--fg); text-decoration: none; }
.action-bar-more .menu-pop > a:hover, .action-bar-more .menu-pop > a:focus-visible { background: var(--accent-soft); }
.action-bar-more .menu-pop > button:disabled { opacity: .45; cursor: default; }
.action-bar-more .menu-pop > .action-danger { color: var(--bad); }
/* grid */
.dg { display: flex; flex-direction: column; min-height: 0; flex: 1; border: 1px solid var(--line); border-radius: var(--r-md); }
.md-master > .dg { border: 0; border-radius: 0; }
.dg-toolbar { border-radius: var(--r-md) var(--r-md) 0 0; display: flex; gap: var(--sp-2); align-items: center; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.dg-count { color: var(--muted); font-size: var(--fs-2); margin-left: var(--sp-1); }
.dg-chooser { position: relative; }
.dg-pop { position: absolute; right: 0; top: calc(100% + .25rem); z-index: var(--z-pop); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); min-width: 15rem; max-height: 22.5rem; overflow: auto; box-shadow: var(--shadow); display: grid; gap: 2px; }
.dg-scroll { overflow: auto; flex: 1; min-height: 0; border-radius: 0 0 var(--r-md) var(--r-md); }
.md-master > .dg > .dg-toolbar, .md-master > .dg > .dg-scroll { border-radius: 0; }
.dg-empty { padding: var(--sp-7) var(--sp-6); text-align: center; color: var(--muted); white-space: normal; }
.dg-table tbody tr.dg-emptyrow { cursor: default; }
.dg-table tbody tr.dg-emptyrow td { height: auto; border-bottom: 0; background: none; }
.dg-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-grid); }
.dg-table:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dg-table th { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--panel2); color: var(--muted); font-weight: 600; text-align: left; padding: 0 var(--sp-4); height: var(--row); border-bottom: 1px solid var(--line); white-space: nowrap; }
.dg-table th.num, .dg-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dg-sort { background: none; border: 0; padding: 0; color: inherit; font: inherit; white-space: nowrap; display: inline-flex; align-items: baseline; max-width: 100%; vertical-align: middle; }
/* a column narrower than its header: the label gives way ("…"), the sort arrow keeps its room */
.dg-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dg-arrow { color: var(--accent); font-size: var(--fs-0); margin-left: var(--sp-0); flex-shrink: 0; }
.dg-table td { padding: 0 var(--sp-4); height: var(--row); border-bottom: 1px solid var(--line); white-space: nowrap; }
.dg-table tbody tr { cursor: pointer; }
.dg-table tbody tr:hover td { background: var(--panel2); }
.dg-table tbody tr.on td { background: var(--sel); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.dg-table tbody tr.on td:first-child { box-shadow: inset .1875rem 0 0 var(--accent), inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.dg-table tbody tr.on td:last-child { box-shadow: inset -1px 0 0 var(--accent), inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
.dg-table tbody tr.checked:not(.on) td { background: var(--accent-soft); }
/* check boxes: square, thin, in the accent colour */
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: .875rem; height: .875rem; margin: 0; padding: 0; border: 1.5px solid var(--muted); border-radius: var(--r-xs); background: var(--input); display: inline-grid; place-content: center; vertical-align: middle; cursor: pointer; flex: none; }
input[type=checkbox]:hover { border-color: var(--accent); }
input[type=checkbox]::before { content: ""; width: .5rem; height: .3125rem; border-left: 2px solid var(--accent-fg); border-bottom: 2px solid var(--accent-fg); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
input[type=checkbox]:checked, input[type=checkbox]:indeterminate { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::before { opacity: 1; }
input[type=checkbox]:indeterminate::before { opacity: 1; border-left: 0; transform: none; height: 0; }
input[type=checkbox]:disabled { opacity: .5; cursor: default; }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dg-table tfoot td { position: sticky; bottom: 0; background: var(--panel2); font-weight: 600; border-top: 1px solid var(--line); }
.dg-lead { width: 1%; padding-right: var(--sp-1) !important; }
.dg-lead input { vertical-align: middle; }
/* The lead cell's check box and flags on one flex line, centred on the row (feedback note 99). */
.dg-lead-in { display: flex; align-items: center; gap: var(--sp-1); }
.dg-lead-in > .dg-flags { margin-left: 0; align-items: center; }
/* A row moved to by keyboard stays clear of the sticky header (WCAG 2.4.11). */
.dg-table tbody tr { scroll-margin-top: var(--row); }
/* The row check box keeps its 14 px look with a 24 px hit area (WCAG 2.5.8). */
.dg-lead input[type=checkbox] { position: relative; }
.dg-lead input[type=checkbox]::after { content: ""; position: absolute; inset: -.3125rem; }
.dg-flags { display: inline-flex; gap: 2px; margin-left: var(--sp-1); vertical-align: middle; }
.dg-flags:first-child { margin-left: 0; } /* flags alone in the lead column start on its edge */
.dg-flag { width: .5rem; height: .5rem; border-radius: 2px; display: inline-block; }
.dg-flag.bad { background: var(--bad); } .dg-flag.warn { background: var(--warn); } .dg-flag.info { background: var(--accent); }
.dg-flag.dot { border-radius: 50%; }
/* Meter (components/Meter.tsx, feedback #54): a light-grey track, a darker fill for the share done,
   an optional thin marker (where the fill should be by now), the figure underneath. The track has
   a width of its own: an empty bar has no content width, so in a shrink-to-fit (auto layout) cell
   a bar that only "takes the spare width" got none at all. In fixed-width columns it follows the
   column. Sizes in rem, so it scales with the text size. */
.meter { display: block; min-width: 5rem; line-height: 1.1; }
.meter-track { position: relative; display: block; width: 100%; height: .375rem; border-radius: var(--r-xs); background: var(--line); background: color-mix(in srgb, var(--fg) 10%, transparent); }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; max-width: 100%; border-radius: var(--r-xs); background: var(--muted); background: color-mix(in srgb, var(--fg) 42%, transparent); transition: width .4s ease; }
.meter-ok .meter-fill { background: var(--ok); background: color-mix(in srgb, var(--ok) 72%, var(--panel)); }
.meter-warn .meter-fill { background: var(--warn); background: color-mix(in srgb, var(--warn) 72%, var(--panel)); }
.meter-bad .meter-fill { background: var(--bad); background: color-mix(in srgb, var(--bad) 72%, var(--panel)); }
.meter-mark { position: absolute; top: -.1875rem; bottom: -.1875rem; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--fg); }
.meter-text { margin-top: var(--sp-0); font-size: var(--fs-1); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter-text .pace { font-weight: 600; }
td.num .meter-text { text-align: right; }
.dg-fixed .meter { min-width: 0; }
.tile .meter { margin-top: var(--sp-2); }
.tile .meter-text, .tile .meter-text .pace { font-size: var(--fs-2); }
.facts .meter { min-width: 6.25rem; max-width: 10rem; }
@media (prefers-reduced-motion: reduce) { .meter-fill { transition: none; } }
.pace.bad { color: var(--bad); font-weight: 600; } .pace.warn { color: var(--warn); font-weight: 600; } .pace.ok { color: var(--ok); }
/* resizable columns (ui/colresize.ts): a handle on each header's right edge */
.rz-handle { position: absolute; top: 0; right: 0; bottom: 0; width: .4375rem; cursor: col-resize; touch-action: none; z-index: 1; }
.rz-handle::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: 2px; width: 2px; border-radius: 1px; background: var(--line); opacity: 0; }
th:hover > .rz-handle::after { opacity: 1; }
.rz-handle:hover::after, .rz-handle:focus-visible::after { background: var(--accent); opacity: 1; }
.rz-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
body.rz-dragging, body.rz-dragging * { cursor: col-resize !important; user-select: none !important; -webkit-user-select: none !important; }
.rz-handle { user-select: none; -webkit-user-select: none; }
th[data-rz-host] { position: relative; }
/* once resized: fixed widths, so live updates cannot shift the columns; cut-off text ends in "…" */
.dg-table.dg-fixed { table-layout: fixed; }
.dg-fixed th, .dg-fixed td { overflow: hidden; text-overflow: ellipsis; }
.dg-table th.dg-fill, .dg-table td.dg-fill { padding: 0; }
table[data-rz="1"] th, table[data-rz="1"] td { overflow: hidden; text-overflow: ellipsis; }
table[data-rz-measure] th, table[data-rz-measure] td, table[data-rz-measure] .dg-sort { white-space: nowrap !important; }
table[data-rz-measure] .dg-sort { max-width: none; }

/* the row's open action (openAction): a visible "Edit" or "Open", stuck to the right edge */
.dg-table th.dg-act, .dg-table td.dg-act { position: sticky; right: 0; width: 1%; text-align: right; padding: 0 var(--sp-3) 0 var(--sp-2); overflow: visible; }
.dg-table th.dg-act { z-index: var(--z-pin); }
.dg-table td.dg-act { background: var(--panel); z-index: 1; }
.dg-fixed th.dg-act, .dg-fixed td.dg-act { width: 4.75rem; }

/* big tables (feedback #67, ui/grid.tsx): only the rows and columns in view are rendered.
   No scroll anchoring: the spacers change height while scrolling and the browser must not
   "correct" the position for it. Layout and paint stay inside the scroll box. */
.dg-scroll { overflow-anchor: none; contain: content; }
.dg-table td.dg-pad, .dg-table th.dg-pad { padding: 0; }
.dg-table tr.dg-pad td { padding: 0; border: 0; }
.dg-table tbody tr.dg-pad, .dg-table tbody tr.dg-hole { cursor: default; }
.dg-table tbody tr.dg-pad:hover td { background: none; }
.dg-table tbody tr.dg-hole td { color: var(--muted); }
/* frozen columns (feedback #75) and wide tables: the lead column and the locked columns stay put
   while scrolling sideways; each locked column's offset (--dg-pin-<n>) is measured by the grid */
.dg-pinned .dg-lead, .dg-pinned .dg-pin { position: sticky; z-index: 1; background: var(--panel); }
.dg-pinned .dg-lead { left: 0; }
.dg-pinned .dg-pin-last { border-right: 1px solid var(--line); }
.dg-pinned th.dg-lead, .dg-pinned th.dg-pin { z-index: var(--z-pin-head); background: var(--panel2); }
.dg-pinned tfoot td.dg-lead, .dg-pinned tfoot td.dg-pin { z-index: var(--z-pin); background: var(--panel2); }
/* moving columns: drag a header; the drop place is a line on the header's edge */
.dg-table th { user-select: none; -webkit-user-select: none; }
.dg-table.dg-dragging, .dg-table.dg-dragging * { cursor: grabbing !important; }
.dg-table th.dg-moving { opacity: .55; }
.dg-table th.dg-drop-before { box-shadow: inset 2px 0 0 var(--accent); }
.dg-table th.dg-drop-after { box-shadow: inset -2px 0 0 var(--accent); }
/* rows that open nothing: no pointer */
.dg-table.dg-static tbody tr { cursor: default; }
/* the Columns dialog: show, freeze and move each column */
.dg-cols { min-width: 20rem; max-height: 26rem; }
.dg-cols-help { margin: 0 0 var(--sp-2); max-width: 22rem; }
.dg-collist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.dg-collist li { display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: center; gap: var(--sp-2); padding: 1px var(--sp-1); border-radius: var(--r-xs); }
.dg-collist li.pinned { background: var(--panel2); }
.dg-collist .dg-freeze { color: var(--muted); white-space: nowrap; }
.dg-collist .btn.xs { min-width: 1.5rem; padding-inline: var(--sp-1); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the whole header cell sorts (feedback #82), except the resize handle and the funnel */
.dg-table thead tr:first-child th[data-col] { cursor: pointer; }
.dg-table thead tr:first-child th[data-col]:hover { background: var(--line); color: var(--fg); }
.dg-sort { cursor: inherit; }
/* column filters (feedback #81): the funnel in a header, the popover, the chips and the filter row */
.dg-table th.dg-filterable { padding-right: var(--sp-8); }
.dg-funnel { position: absolute; top: 50%; right: .5rem; transform: translateY(-50%); display: inline-grid; place-items: center; width: 1rem; height: 1rem; padding: 0; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); opacity: .45; cursor: pointer; }
.dg-funnel svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
th:hover > .dg-funnel, .dg-funnel:focus-visible, .dg-funnel[aria-expanded=true] { opacity: 1; }
.dg-funnel:hover { color: var(--fg); background: var(--line); }
.dg-funnel.on { opacity: 1; color: var(--accent); }
.dg-funnel.on svg { fill: currentColor; }
.dg-funnel:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.dg-fpop { position: fixed; right: auto; z-index: var(--z-filter); min-width: 16rem; max-width: min(22rem, calc(100vw - 1rem)); max-height: min(28rem, calc(100vh - 1rem)); gap: var(--sp-2); }
.dg-fform { display: grid; gap: var(--sp-2); }
.dg-fhead {font-weight: 600; font-size: var(--fs-3); }
.dg-fpop select, .dg-fpop .dg-fval-in, .dg-fpop .dg-fsearch { width: 100%; }
.dg-fall { gap: var(--sp-2); align-items: center; }
.dg-flist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; max-height: 14rem; overflow: auto; }
.dg-flist label { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-2); align-items: center; padding: 1px var(--sp-1); border-radius: var(--r-xs); cursor: pointer; }
.dg-flist label:hover { background: var(--panel2); }
.dg-fval { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-fcount { font-variant-numeric: tabular-nums; font-size: var(--fs-2); }
.dg-factions { gap: var(--sp-2); margin-top: var(--sp-1); }
.dg-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: var(--sp-1) var(--sp-4); border-bottom: 1px solid var(--line); background: var(--panel); }
.dg-chip { display: inline-flex; align-items: center; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--r-lg); font-size: var(--fs-2); max-width: 100%; }
.dg-chip-text { border: 0; background: none; color: var(--fg); font: inherit; padding: 1px var(--sp-1) 1px var(--sp-4); cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-chip-x { border: 0; background: none; color: var(--muted); font: inherit; font-size: var(--fs-4); line-height: 1; padding: 1px var(--sp-3) 1px var(--sp-1); cursor: pointer; border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.dg-chip-x:hover { color: var(--bad); }
.dg-chip button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-lg); }
.dg-table tr.dg-filterrow th { top: var(--dg-head1, var(--row)); padding: 0 var(--sp-1); height: 1.75rem; font-weight: 400; }
.dg-frow-in { width: 100%; min-width: 3rem; height: 1.375rem; font-size: var(--fs-2); padding: 0 var(--sp-2); }
.dg-frow-in[aria-invalid=true], .dg-fpop .dg-fval-in[aria-invalid=true] { border-color: var(--bad); }
.dg-frow-btn { width: 100%; min-width: 3rem; height: 1.375rem; font: inherit; font-size: var(--fs-2); text-align: left; padding: 0 var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--input); color: var(--fg); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the Columns dialog's bar on top (owner, 2026-10-11): Reset to default and Save stay in reach in a long list */
.dg-cols { padding-top: 0; }
.dg-cols-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: var(--sp-3); margin: 0 calc(-1 * var(--sp-5)) var(--sp-2); padding: var(--sp-3) var(--sp-5); background: var(--panel); border-bottom: 1px solid var(--line); }
.dg-collist li.calc { grid-template-columns: 1fr auto auto auto auto auto; }
.dg-calc-add { flex-wrap: wrap; margin: var(--sp-2) 0 0; }
.dg-calc-add .muted { flex: 1 1 12rem; }
/* calculated columns: a mark in the header, #ERR with its reason, "≈" over the loaded rows only */
.dg-calc-mark { margin-left: var(--sp-1); color: var(--muted); font-style: italic; font-weight: 400; }
.dg-calc-btn { margin-left: var(--sp-1); padding: 0 var(--sp-1); border: 1px solid transparent; border-radius: var(--r-xs); background: none; color: var(--muted); font: inherit; font-style: italic; font-weight: 400; line-height: 1.2; cursor: pointer; vertical-align: middle; }
.dg-calc-btn:hover, .dg-calc-btn:focus-visible { color: var(--accent); border-color: var(--line); background: var(--panel); }
.dg-funnel.dg-funnel-off, .dg-funnel.dg-funnel-off:hover { opacity: .3; cursor: not-allowed; background: none; color: var(--muted); }
.dg-calc-err { color: var(--bad); font-weight: 600; cursor: help; }
.dg-calc-partial { color: var(--muted); cursor: help; }
/* the calculated column editor (ui/gridcalc.tsx) */
.calc-ed { display: grid; gap: var(--sp-6); }
.calc-ed .field { display: grid; gap: var(--sp-1); margin: 0; }
.calc-ac { position: relative; display: flex; align-items: flex-start; gap: var(--sp-2); }
.calc-eq { padding-top: var(--sp-2); color: var(--muted); font-family: var(--mono); }
.calc-ac textarea { flex: 1; font-family: var(--mono); min-height: 4.5rem; resize: vertical; }
.calc-ac-list { position: absolute; left: 1.25rem; right: 0; top: 100%; z-index: var(--z-list); list-style: none; margin: var(--sp-0) 0 0; padding: var(--sp-1); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); max-height: 14rem; overflow: auto; }
.calc-ac-list li { display: flex; justify-content: space-between; gap: var(--sp-6); padding: var(--sp-1) var(--sp-3); border-radius: var(--r-xs); cursor: pointer; }
.calc-ac-list li.on, .calc-ac-list li:hover { background: var(--sel); }
.calc-help { margin: 0; color: var(--muted); font-size: var(--fs-3); line-height: 1.45; }
.calc-preview h3 { margin: 0 0 var(--sp-2); }
.calc-preview .hint { margin: 0 0 var(--sp-2); }
.calc-prev-table { border-collapse: collapse; min-width: 50%; }
.calc-prev-table td { padding: var(--sp-1) var(--sp-5) var(--sp-1) 0; border-bottom: 1px solid var(--line); }
.calc-prev-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.calc-foot { width: 100%; }
/* One line per cell, cut off with … and the whole text in a tooltip (owner feedback note 66). */
.dg-table td { overflow: hidden; text-overflow: ellipsis; max-width: 28rem; }
.dg-table td > span, .dg-table td > b { white-space: nowrap; }
.dg-table td .att-cell { flex-wrap: nowrap; }
.dg-table th { overflow: hidden; text-overflow: ellipsis; }
/* A toolbar dropdown (Export, Columns) is fixed at its button (ui/anchor.ts): no panel edge clips it and it lies over the left navigation (style guide §4.11.5, dry run R4). */
.dg-pop.dg-anchored { position: fixed; right: auto; top: 0; left: 0; z-index: var(--z-menu); }
/* tree table (ui/TreeTable.tsx; targeting model v2 §10.1, v2 = build plan U2 / targeting setup §m.6): the grid's
   table with a search, the "N chosen" line with "Show chosen only", frozen Name and choose columns with the columns
   between them scrolling sideways, and the ✓ | ⊘ pair per row. Tokens only. */
.tree { flex: none; }
/* the grid scrolls inside itself (it never pushes the page down); a master pane scrolls as a whole */
.tree > .tt-grid { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.tree > .tt-grid > .dg-scroll { max-height: min(32rem, 60vh); }
.md-master > .tree > .tt-grid > .dg-scroll { max-height: none; border-radius: 0; }
.tree-cols { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 10rem; }
.tree-search { display: inline-flex; align-items: center; gap: var(--sp-1); flex: 1; min-width: 12rem; }
.tree-search input { flex: 1; min-width: 0; }

/* the table never squeezes or drops a column: it is as wide as its content and scrolls sideways */
.tree-table { width: max-content; min-width: 100%; }
.tree-table tbody tr.tree-row { cursor: default; }
.tree-table tbody tr.tree-row.tree-opens { cursor: pointer; }
.tree-table td { height: auto; min-height: var(--row); padding-top: var(--sp-0); padding-bottom: var(--sp-0); }
.tree-table tbody tr.tree-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tree-table tbody td:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* frozen columns: Name on the left, the choose column on the right, opaque in every row state and above the
   scrolling cells; the header corners above both */
/* the table takes its content's width (at least the box's): the columns between the frozen ones never squeeze or
   wrap, the box scrolls sideways instead; Name alone wraps, at a fixed 260 px (220–300): a width that followed the
   rows on screen grew when a group opened, so a long name above unwrapped and the clicked row jumped (CI, round 25) */
.tree-table { width: max-content; min-width: 100%; }
.tree-table th, .tree-table td { white-space: nowrap; }
.tree-table th.tree-name-h, .tree-table td.tree-name { position: sticky; left: 0; z-index: var(--z-sticky); width: 260px; min-width: 260px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.tree-table th.tree-choice, .tree-table td.tree-choice { position: sticky; right: 0; z-index: var(--z-sticky); width: 1%; white-space: nowrap; text-align: right; padding-left: var(--sp-2); padding-right: var(--sp-2); }
.tree-table thead th.tree-name-h, .tree-table thead th.tree-choice { z-index: var(--z-pin-head); }
.tree-table thead th { z-index: var(--z-pin); }
.tree-table tbody tr.tree-row td { background: var(--panel); }
/* hover and the open row: a neutral grey; a direct choice: a light tint plus a bar on the frozen name cell */
.tree-table tbody tr.tree-row:hover td { background: var(--panel2); }
.tree-table tbody tr.tree-row.checked td { background: linear-gradient(var(--accent-soft), var(--accent-soft)) var(--panel); }
.tree-table tbody tr.tree-row.checked.tree-exc td { background: linear-gradient(var(--never-soft), var(--never-soft)) var(--panel); }
.tree-table tbody tr.tree-row.checked td.tree-name { box-shadow: inset 4px 0 0 var(--only-on-fg); }
.tree-table tbody tr.tree-row.checked.tree-exc td.tree-name { box-shadow: inset 4px 0 0 var(--never-fg); }
.tree-table tbody tr.tree-row.on td { background: linear-gradient(var(--sel), var(--sel)) var(--panel); }
/* the edge shadow, only on an edge with content hidden behind it */
[data-edge~="start"] .tree-table .tree-name-h::after, [data-edge~="start"] .tree-table td.tree-name::after,
[data-edge~="end"] .tree-table th.tree-choice::before, [data-edge~="end"] .tree-table td.tree-choice::before { content: ""; position: absolute; top: 0; bottom: 0; width: var(--sp-2); pointer-events: none; }
[data-edge~="start"] .tree-table .tree-name-h::after, [data-edge~="start"] .tree-table td.tree-name::after { right: calc(-1 * var(--sp-2)); background: linear-gradient(to right, color-mix(in srgb, var(--fg) 16%, transparent), transparent); }
[data-edge~="end"] .tree-table th.tree-choice::before, [data-edge~="end"] .tree-table td.tree-choice::before { left: calc(-1 * var(--sp-2)); background: linear-gradient(to left, color-mix(in srgb, var(--fg) 16%, transparent), transparent); }

/* nesting: one step per level, sub-groups to depth 5 */
.tree-d1 .tree-name { padding-left: calc(var(--sp-4) + var(--sp-6)); }
.tree-d2 .tree-name { padding-left: calc(var(--sp-4) + 2 * var(--sp-6)); }
.tree-d3 .tree-name { padding-left: calc(var(--sp-4) + 3 * var(--sp-6)); }
.tree-d4 .tree-name { padding-left: calc(var(--sp-4) + 4 * var(--sp-6)); }
.tree-d5 .tree-name { padding-left: calc(var(--sp-4) + 5 * var(--sp-6)); }
.tree-twist { background: none; border: 0; padding: 0; font: inherit; line-height: inherit; display: inline-block; width: var(--sp-6); color: var(--muted); font-weight: 600; text-align: center; cursor: pointer; user-select: none; }
.tree-twist:empty { cursor: default; }
button.tree-twist:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: var(--r-xs); }
.tree-label { font-weight: 500; }
.tree-group .tree-label { font-weight: 600; }
.tree-count { color: var(--muted); font-weight: 400; }
/* a group's count: a small badge with a gap */
/* a group's " (n)" chosen count keeps its place while it is 0 (an invisible " (0)", not in the text), so choosing a
   row never rewraps a group name above it and the clicked row stays put */
.tree-count { font-variant-numeric: tabular-nums; }
.tree-count-0::before { content: " (0)"; visibility: hidden; }
.tree-kids { display: inline-block; margin-left: var(--sp-1); padding: 0 var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-pill, 999px); background: var(--panel2); color: var(--muted); font-size: var(--fs-1); line-height: 1.5; white-space: nowrap; vertical-align: 1px; }
.tree-hint { display: block; margin-left: var(--sp-6); color: var(--muted); font-size: var(--fs-1); }
.tree-note { display: block; }
.tree-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: var(--sp-1) 0 var(--sp-1) var(--sp-6); }
.tree-more { cursor: default; font-weight: 600; }
.tree-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* the choose cell: actions, then the ✓ | ⊘ pair, right-aligned so the pair lines up on every row */
.tree-cell3 { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); vertical-align: middle; }
.tree-acts { display: inline-flex; align-items: center; gap: var(--sp-1); }
.tree-pair { display: inline-flex; align-items: center; gap: 2px; min-width: calc(2 * max(2rem, 32px) + 2px); justify-content: flex-end; }
.tree-tg-gap { display: inline-block; width: max(2rem, 32px); flex: none; }
.icon-btn.with-text.tree-tg { padding: 0; }
.icon-btn.tree-tg > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tree-locked { color: var(--muted); font-size: var(--fs-1); white-space: normal; }
.tree-chosen-bar { display: inline-flex; align-items: center; gap: var(--sp-3); }
.tree-chosen-n { color: var(--muted); font-size: var(--fs-1); }
.tree-foot { padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-2); }
/* ChipStrip (ui/ChipStrip.tsx; targeting setup §m.7, the mockup's .chosen / .band / .line / .val / .set / .pluschip):
   the Include / Exclude / Rules bands, each row capped at two lines of chips that scroll inside it with a "+N" chip,
   the compact AND row, the active row's accent outline. */
.cs { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); font-size: var(--fs-2); line-height: 1.5; }
.cs-band { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-0) var(--sp-3); border-bottom: 1px solid var(--line); align-items: start; }
.cs-band:last-child { border-bottom: 0; }
.cs-lbl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-top: var(--sp-1); font-size: var(--fs-0); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.cs-lbl > span { cursor: help; }
.cs-band.include .cs-lbl > span { color: var(--only-on-fg); }
.cs-band.exclude .cs-lbl > span { color: var(--never-fg); }
.cs-andalso { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: var(--fs-1); letter-spacing: 0; text-transform: none; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; line-height: 1.2; text-align: left; }
.cs-rows { min-width: 0; display: grid; gap: 2px; }

/* A row: one line of chips, at most two lines tall; it scrolls inside itself. */
.cs-row { position: relative; display: flex; align-items: flex-start; gap: var(--sp-1); min-height: 1.875rem; padding: 2px var(--sp-1); border: 1px solid transparent; border-radius: var(--r-sm); }
.cs-row.pickable { cursor: pointer; }
.cs-row.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.cs-row.over { padding-right: var(--sp-9); }
.cs-line { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-0) var(--sp-1); margin: 0; padding: 1px 2px; list-style: none; max-height: 3.625rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.cs-row.over .cs-line { -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent); mask-image: linear-gradient(to bottom, black 70%, transparent); }
.cs-row.over.atend .cs-line { -webkit-mask-image: none; mask-image: none; }
/* Scrolled down: the top line fades too, so a half-cut line does not read as a chip. */
.cs-row.over.scrolled .cs-line { -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent); mask-image: linear-gradient(to bottom, transparent, black 30%, black 70%, transparent); }
.cs-row.over.scrolled.atend .cs-line { -webkit-mask-image: linear-gradient(to bottom, transparent, black 30%); mask-image: linear-gradient(to bottom, transparent, black 30%); }
.cs-or { font-size: var(--fs-1); color: var(--muted); }
.cs-empty { align-self: center; color: var(--muted); font-size: var(--fs-2); }
.cs-and { flex: none; align-self: center; font-size: var(--fs-0); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-xs); padding: 0 var(--sp-1); white-space: nowrap; cursor: help; }
.cs-row .cs-andx { margin-left: auto; align-self: center; border: 0; background: none; color: var(--muted); }

/* Chips: a value is a soft pill (red on Exclude), a set a square chip with a purple edge and its SET tag, a rule locked. */
.cs-chip { display: inline-flex; align-items: center; gap: var(--sp-1); max-width: 100%; min-height: 1.625rem; padding: 0 var(--sp-1) 0 var(--sp-3); border-radius: var(--r-pill); background: var(--accent-soft); color: var(--fg); white-space: nowrap; }
.cs-chip:not(:has(button)) { padding-right: var(--sp-3); }
.cs-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cs-chip.nv { background: var(--never-soft); color: var(--never-fg); }
.cs-chip.set { border: 1px solid var(--set); border-left-width: 4px; border-radius: var(--r-xs); background: var(--set-soft); padding-left: var(--sp-1); }
.cs-chip.set.nv { border-color: var(--never-fg); background: var(--never-soft); }
.cs-chip.rule { background: var(--panel2); color: var(--muted); }
.cs-text { overflow: hidden; text-overflow: ellipsis; }
.cs-tag { font-size: var(--fs-0); font-weight: 700; letter-spacing: .06em; color: var(--set); }
.cs-chip.set.nv .cs-tag { color: var(--never-fg); }
.cs-own, .cs-detail { font-size: var(--fs-1); color: var(--muted); }
.cs-chip.nv .cs-detail { color: inherit; opacity: .85; }
.cs-except { flex: none; min-height: 1.5rem; padding: 0 var(--sp-1); border: 1px solid currentColor; border-radius: var(--r-xs); background: var(--panel); color: inherit; font: inherit; font-size: var(--fs-1); cursor: pointer; }
.cs-except:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cs-toggle { flex: none; min-height: 1.5rem; padding: 0; border: 0; background: none; font-family: inherit; text-decoration: underline dotted; cursor: pointer; }
.cs-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* × in a chip: the IconButton at the 24 px minimum target (WCAG 2.5.8), borderless, round. */
.cs-chip .icon-btn.cs-x { min-width: 1.5rem; min-height: 1.5rem; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; background: none; color: inherit; }
.cs-chip .icon-btn.cs-x .icon { width: .75rem; height: .75rem; }
.cs-chip .icon-btn.cs-x:hover:not([aria-disabled="true"]) { background: color-mix(in srgb, currentColor 14%, transparent); }

/* "+N": the chips out of view; the tooltip lists the row's every choice. */
.cs-more { position: absolute; right: var(--sp-1); bottom: 3px; z-index: var(--z-sticky); min-width: 2rem; height: 1.5rem; padding: 0 var(--sp-2); border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--panel); color: var(--fg); font: inherit; font-size: var(--fs-1); font-weight: 600; cursor: pointer; }
.cs-more:hover { border-color: var(--accent); }
.cs-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cs-pop { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: var(--z-menu); max-height: 40vh; overflow: auto; padding: var(--sp-1) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow); font-size: var(--fs-1); columns: 2; column-gap: var(--sp-5); }
.cs-pop[hidden] { display: none; }
.cs-pop > div { break-inside: avoid; padding: 1px 0; }

/* The hint beside a table's search: where Include adds. */
.cs-addsto { font-size: var(--fs-1); color: var(--accent); font-weight: 600; white-space: nowrap; }
/* rule table (ui/RuleTable.tsx; build plan U6, the mockup's .dtab): TreeTable v2's table (46-tree.css: the frozen
   first and end columns, opaque cells, the edge shadow) with a grip per row, a pinned (Default) row, paused rows and
   a drop line. Tokens only. */
.rules { flex: none; }
.rules > .dg-scroll { max-height: min(40rem, 70vh); }
.rule-table th { vertical-align: bottom; }
.rule-table td { vertical-align: middle; }
.rule-table td.rt-cell { text-align: left; }
.rt-note { display: block; font-weight: 400; font-size: var(--fs-1); }

/* the lead of the frozen first cell: the grip (or the pin) and the row number, then the caller's content */
.rt-lead { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: calc(max(2rem, 32px) + 1.5em); margin-right: var(--sp-2); vertical-align: middle; color: var(--muted); }
.rt-what { display: inline-block; vertical-align: middle; max-width: calc(100% - max(2rem, 32px) - 1.5em - var(--sp-2)); }
.rt-ro .rt-lead { min-width: 1.5em; }
.rt-ro .rt-what { max-width: calc(100% - 1.5em - var(--sp-2)); }
.rt-n { font-size: var(--fs-1); font-variant-numeric: tabular-nums; min-width: 1.5em; }
.rt-grip { display: inline-flex; align-items: center; justify-content: center; min-width: max(2rem, 32px); min-height: max(2rem, 32px); padding: 0; border: 0; border-radius: var(--r-xs); background: none; color: var(--muted); cursor: grab; touch-action: none; }
.rt-grip:hover { color: var(--fg); background: var(--panel2); }
.rt-grip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rt-dragging .rt-grip { cursor: grabbing; }
.rt-pin { display: inline-flex; align-items: center; justify-content: center; min-width: max(2rem, 32px); min-height: max(2rem, 32px); }

/* the pinned (Default) row: shaded in every state, also its frozen cells */
.tree-table tbody tr.rt-pinned td, .tree-table tbody tr.rt-pinned:hover td { background: var(--panel2); }
/* a paused row is dimmed, its actions are not */
.rule-table tr.rt-paused td:not(.rt-end) > * { opacity: .55; }
/* the row being dragged, and where it will land */
.rule-table tr.rt-dragging td { background: linear-gradient(var(--sel), var(--sel)) var(--panel); }
.rule-table tr[data-drop="before"] td { box-shadow: inset 0 2px 0 var(--accent); }
.rule-table tr[data-drop="after"] td { box-shadow: inset 0 -2px 0 var(--accent); }
/* the moved row flashes once (only when UI animations are allowed; never under reduced motion) */
.rule-table tr.rt-moved td { animation: rt-moved .4s ease-out; }
@keyframes rt-moved { from { background: linear-gradient(var(--accent-soft), var(--accent-soft)) var(--panel); } }
@media (prefers-reduced-motion: reduce) { .rule-table tr.rt-moved td { animation: none; } }
/* a preview's winning cell (D5b "Try a situation"): marked by an accent edge, never by colour alone (data-win) */
.rule-table td.rt-cell[data-win="true"] { box-shadow: inset 3px 0 0 var(--accent); background: linear-gradient(var(--sel), var(--sel)) var(--panel); }
/* tiles and charts */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.tile { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); background: var(--panel); }
.tile b { display: block; font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tile span { font-size: var(--fs-7); font-weight: 700; font-variant-numeric: tabular-nums; }
.tile small { display: block; color: var(--muted); }
.tile.ok { border-left: .1875rem solid var(--ok); } .tile.warn { border-left: .1875rem solid var(--warn); } .tile.bad { border-left: .1875rem solid var(--bad); }
/* The state is the left border only (the design's mockup): the texts keep
   their colours, not the global .ok/.warn/.bad ones. A tile's value is never
   coloured, not even on a bad tile (feedback #13); the red border says it. */
.tile.ok, .tile.warn, .tile.bad { color: var(--fg); }
.chart { width: 100%; max-width: 51.25rem; height: auto; display: block; margin-bottom: var(--sp-5); }
.chart text { fill: var(--muted); font-size: var(--fs-0); }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-area { fill: var(--accent); opacity: .12; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-ref { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-dot { fill: var(--accent); }

/* overlay side sheet */
.ov-back { position: fixed; inset: 0; margin: 0; background: var(--scrim); z-index: var(--z-overlay); display: flex; justify-content: flex-end; }
.ov-sheet { width: max(var(--ov-min), calc(var(--ov-top) - (var(--ov-depth, 1) - 1) * var(--ov-step))); height: 100%; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; box-shadow: var(--shadow-sheet); }
/* The stack rule (docs/console-style-guide.md "Stacked overlays"; ui/sheet.tsx stackPlace sets data-depth,
   data-base and --ov-depth on the scrim): layer 1 is compact (45rem) or wide (min(72rem, 100% - 2rem));
   each next layer is one equal step narrower, so every layer below shows the same strip. The step is 4rem
   and shrinks on a small screen; a layer never gets narrower than --ov-min. No per-screen widths. */
.ov-back { --ov-top: min(45rem, 100%); --ov-step: clamp(1rem, (100% - 32rem) / 8, 4rem); --ov-min: min(20rem, 100%); }
.ov-back[data-base=wide] { --ov-top: min(72rem, calc(100% - 2rem)); }
/* The profile sheet slides in from the right and its scrim fades (feedback note 123): short and quiet; never
   with "No UI animations" or reduced motion (10-base.css, and layout.tsx closes at once then). */
@keyframes ov-fade { from { opacity: 0; } }
@keyframes ov-slide { from { transform: translateX(2.5rem); opacity: 0; } }
@keyframes ov-fade-out { to { opacity: 0; } }
@keyframes ov-slide-out { to { transform: translateX(2.5rem); opacity: 0; } }
.ov-back.ov-anim { animation: ov-fade .2s ease-out; }
.ov-back.ov-anim > .ov-sheet { animation: ov-slide .22s cubic-bezier(.2, .7, .2, 1); }
.ov-back.ov-anim.closing { animation: ov-fade-out .16s ease-in forwards; }
.ov-back.ov-anim.closing > .ov-sheet { animation: ov-slide-out .16s ease-in forwards; }
@media (prefers-reduced-motion: reduce) { .ov-back.ov-anim, .ov-back.ov-anim > .ov-sheet { animation: none; } }
.ov-head { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-5) var(--sp-7) var(--sp-4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ov-head h2 { margin: 0; font-size: var(--fs-5); flex: 1; }
.ov-head > .ov-close { width: var(--ctl-sm); height: var(--ctl-sm); padding: 0; display: inline-grid; place-items: center; flex: none; }
.ov-body { flex: 1; overflow: auto; padding: var(--sp-6) var(--sp-7); }
/* A strip under the title that does not scroll with the body (the wizard's steps). */
.ov-sub { padding: var(--sp-3) var(--sp-7); border-bottom: 1px solid var(--line); background: var(--panel); }
/* The embedded card scrolls (overflow: auto), so its body keeps room for a field's focus ring (2px + 1px offset;
   verify item 6, the IAB combobox); the card's negative margin keeps the fields lined up with the sheet's padding. */
.ov-body .embedded .card { border: 0; background: none; margin-inline: calc(-1 * var(--focus-room)); }
.ov-body .embedded .card > .body { padding: 0 var(--focus-room); }
/* The entity's actions (SheetActions, R3) on the footer's left; Cancel and the primary stay on the right. */
.ov-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; margin-right: auto; }
.ov-actions:empty { display: none; }
.ov-foot { padding: var(--sp-4) var(--sp-7); border-top: 1px solid var(--line); display: flex; gap: var(--sp-3); justify-content: flex-end; align-items: center; flex-wrap: wrap; }
@media (max-width: 760px) {
  .page.fill { height: auto; }
  .md { min-height: 80vh; }
  .seg { margin-left: 0; }
}

.dg-sep { border: 0; border-top: 1px solid var(--line); margin: var(--sp-2) 0; width: 100%; }

/* Dialog (centred, 28rem) and Popover (anchored, no scrim): ui/sheet.tsx */
.dlg-back { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: var(--sp-6); z-index: var(--z-modal); }
.dlg { width: 100%; max-width: 28rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--shadow); }
.dlg h3 { font-size: var(--fs-4); text-transform: none; letter-spacing: 0; color: var(--fg); margin: 0 0 var(--sp-3); }
.dlg .row.end { margin-top: var(--sp-6); gap: var(--sp-3); }
.pop-back { position: fixed; inset: 0; z-index: var(--z-modal); }
.pop { position: fixed; z-index: var(--z-modal); width: min(20rem, calc(100vw - 1rem)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--shadow); }
/* ReviewSheet and DiffSheet (ui/ReviewSheet.tsx, ui/DiffSheet.tsx; build plan U5). Tokens only. */

/* ReviewSheet: header, a table that scrolls inside a max height, a footer that stays in view. */
.rsh { display: flex; flex-direction: column; max-height: min(34rem, calc(100vh - 6rem)); min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.rsh-head { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); font-size: var(--fs-2); }
.rsh-scroll { flex: 1; min-height: 6rem; overflow: auto; }
.rsh-table { width: 100%; border-collapse: collapse; font-size: var(--fs-2); }
.rsh-table thead th { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--panel2); text-align: left; font-weight: 600; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); }
.rsh-table td { padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--line); vertical-align: middle; height: var(--row); }
/* GridTable's .dg-table th (45-grid.css) makes every th a sticky, muted, one-line header. Here only the thead is
   that: a body row header (the group row, the diff's row name) scrolls with its row and wraps (review U5 F1). */
.rsh-table tbody th { position: static; top: auto; height: auto; color: var(--fg); white-space: normal; overflow: visible; user-select: auto; -webkit-user-select: auto; }
.rsh-grp th { text-align: left; padding: var(--sp-2) var(--sp-3); background: var(--bg); border-bottom: 1px solid var(--line); }
.rsh-tw { border: 0; background: none; color: var(--fg); font: inherit; font-size: var(--fs-1); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; min-height: 1.5rem; display: inline-flex; align-items: center; gap: var(--sp-2); }
.rsh-cnt { color: var(--muted); font-weight: 400; }
.rsh-in { white-space: pre; font-family: var(--mono); font-size: var(--fs-1); }
.rsh-in input { width: 100%; font-family: var(--mono); }
.rsh-what.warn { color: var(--warn); }
.rsh-what.muted { color: var(--muted); }
.rsh-fix { text-align: right; white-space: nowrap; }
.rsh-fixes, .rsh-leave { display: inline-flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rsh-leave input { min-width: 14rem; }
.rsh-leave .err { flex-basis: 100%; text-align: right; }
.rsh-foot { position: sticky; bottom: 0; display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line); background: var(--panel); border-radius: 0 0 var(--radius) var(--radius); }
.rsh-sum { flex: 1 1 0; min-width: 0; display: inline-flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.rsh-sum .chip { cursor: default; }

/* DiffSheet in the apply sheet: the body is a column; only the table scrolls. */
.ov-back[data-sheet=apply] .ov-body { display: flex; flex-direction: column; overflow: hidden; gap: var(--sp-2); padding-block: var(--sp-3); }
/* The summary is kept short (review U5 F4): counts and cell counts on one line, the totals and Remove missing on one
   line, a one-line overrun box with its tick; at 1280 × 720 the table keeps room for 8 rows or more. */
.df-top { display: flex; flex-direction: column; gap: var(--sp-1); }
.df-top p { margin: 0; }
.df-line { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); align-items: center; margin: 0; }
.df-total { font-size: var(--fs-2); font-variant-numeric: tabular-nums; }
.df-over { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); align-items: center; padding: var(--sp-1) var(--sp-3); border: 1px solid var(--warn); background: var(--warn-soft); border-radius: var(--radius); font-size: var(--fs-2); }
.df-over.err { border-color: var(--bad); background: var(--bad-soft); }
.df-over > svg { color: var(--warn); flex: none; }
.df-over-text { flex: 1 1 24rem; min-width: 0; }
.df-raise { display: inline-flex; gap: var(--sp-2); align-items: center; font-weight: 600; white-space: nowrap; }
.df-rm { display: inline-flex; gap: var(--sp-2); align-items: center; margin-left: auto; }
.df-steperr { margin: 0; }
.df-scroll { flex: 1; min-height: 8rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.df-table { table-layout: auto; width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-2); }
.df-table thead th { position: sticky; top: 0; z-index: var(--z-pin); background: var(--panel2); text-align: left; font-weight: 600; height: auto; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.df-table td, .df-table tbody th { padding: var(--sp-1) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; font-weight: 400; height: auto; }
/* Body row headers scroll with their row, wrap and read as normal text (review U5 F1; see .rsh-table above). */
.df-table tbody th { position: static; top: auto; color: var(--fg); white-space: normal; overflow: visible; user-select: auto; -webkit-user-select: auto; }
.df-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* The tick and Row columns are frozen while the table scrolls sideways (as TreeTable v2); the Row column wraps. */
.df-table .df-sel { position: sticky; left: 0; z-index: 1; box-sizing: border-box; width: 2rem; min-width: 2rem; max-width: 2rem; padding-inline: 0; text-align: center; background: var(--panel); }
.df-sel input { width: 1.125rem; height: 1.125rem; margin: 0; }
.df-table .df-name { position: sticky; left: 2rem; z-index: 1; min-width: 14rem; max-width: 20rem; background: var(--panel); border-right: 1px solid var(--line); }
.df-table thead th.df-sel, .df-table thead th.df-name { z-index: var(--z-pin-head); background: var(--panel2); }
.df-name .pill { white-space: nowrap; }
.df-table td { max-width: 20rem; white-space: nowrap; }
.df-clip { display: block; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.df-same { color: var(--muted); }
.df-why { display: block; font-size: var(--fs-1); color: var(--muted); }
.df-chg { background: var(--accent-soft); font-variant-numeric: tabular-nums; }
.df-chg s, .df-ref s, .df-ign s { color: var(--muted); }
.df-ref { background: var(--bad-soft); }
.df-ref .df-why { color: var(--bad); }
.df-conf { background: var(--warn-soft); }
.df-conf .df-why { color: var(--warn); }
.df-cv { display: inline; font-size: var(--fs-1); margin-right: var(--sp-2); }
.df-conf select { height: 1.5rem; padding-block: 0; font-size: var(--fs-1); }
.df-ign { color: var(--muted); }
.df-added td.df-chg { background: var(--ok-soft); }
.df-missing th, .df-missing td { color: var(--muted); }
tr[data-state=refused] .df-name .df-why { color: var(--bad); }
.ov-body .df-reason { margin: 0; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); }
.ov-body .df-reason label { margin: 0; white-space: nowrap; }
.ov-body .df-reason input { flex: 1 1 20rem; width: auto; min-width: 0; }
.ov-body .df-reason .err { flex-basis: 100%; }
.df-reason input[aria-invalid=true] { border-color: var(--bad); }
/* monitor: dimensions and timeseries */
.dims { display: grid; grid-template-columns: 10.625rem minmax(0, 1fr); gap: var(--sp-5); min-height: 16.25rem; }
.dimnav { display: flex; flex-direction: column; gap: 1px; border-right: 1px solid var(--line); padding-right: var(--sp-4); }
.dimgroup { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: var(--sp-4) 0 var(--sp-0); }
.dimnav > div:first-child .dimgroup { margin-top: 0; }
.dimbtn { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 2px var(--sp-3); border-radius: var(--r-sm); color: var(--fg); font-size: var(--fs-grid); line-height: 1.6; }
.dimbtn:hover:not(:disabled) { background: var(--panel2); }
.dimbtn.on { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.dimbtn:disabled { color: var(--muted); opacity: .6; cursor: default; }
.dimmain { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); align-self: start; }
.dimmain .dg { max-height: 26.25rem; flex: none; }
.dimgroup { margin-top: var(--sp-3); }
.drill { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.drillable { cursor: pointer; }
@media (max-width: 760px) { .dims { grid-template-columns: 1fr; } .dimnav { flex-direction: row; flex-wrap: wrap; border-right: 0; } }

/* toggle bars (dimensions, metric groups) and the report builder */
.dimbar { display: flex; gap: var(--sp-3); align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.dimbar input.filter { width: 12.5rem; }
.dimbar .seg { margin-left: 0; }
.dimbar > .small { align-self: center; }
.toggles { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.toggles button { background: var(--panel); border: 0; border-right: 1px solid var(--line); padding: var(--sp-2) var(--sp-5); color: var(--fg); font-size: var(--fs-grid); display: inline-flex; gap: var(--sp-2); align-items: center; }
.toggles button:last-child { border-right: 0; }
.toggles button.on { background: var(--panel2); box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }
.toggles button:disabled { color: var(--muted); opacity: .55; cursor: default; }
.toggles .order { background: var(--accent); color: var(--accent-fg); border-radius: var(--r-md); font-size: var(--fs-0); min-width: 1rem; text-align: center; padding: 0 var(--sp-1); }
.report h3 { font-size: var(--fs-1); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: var(--sp-6) 0 var(--sp-2); }
.report-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); gap: var(--sp-2) var(--sp-5); }
.report-filter { display: grid; grid-template-columns: 7.5rem 1fr; margin: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; color: var(--fg); }
.report-filter span { background: var(--panel2); padding: var(--sp-2) var(--sp-4); font-size: var(--fs-grid); border-right: 1px solid var(--line); }
.report-filter input { border: 0; border-radius: 0; max-width: none; }
.report-filter.off { opacity: .5; }
.report-run { display: flex; gap: var(--sp-3); align-items: center; margin: var(--sp-6) 0 var(--sp-4); padding: var(--sp-3); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.report-run input.filter { width: 15rem; }
.report .dg { max-height: 60vh; }

.dg-search { width: 13.75rem; max-width: 100%; padding: 0 var(--sp-3); height: var(--ctl-sm); font-size: var(--fs-2); }
.dg-arrow sup { font-size: var(--fs-0); margin-left: 1px; }

.dg-menuitem { display: block; width: 100%; text-align: left; border: 0; background: none; }
.dg-menuitem:hover { background: var(--panel2); }


/* The campaign's verdict (style guide Part 0.2; flow analysis Q7, Q9): in the
   head the headline in its bucket's tone with at most two actions, the facts
   line under it; on the Overview the verdict block first, with the reason in
   grey and the other items as one line each, a dot in their tone. */
/* One baseline for the text, the action buttons and the Needs attention link, each a small control high (feedback note 102). */
.verdict-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-1) var(--sp-3); margin: var(--sp-0) 0 var(--sp-0); font-size: var(--fs-3); }
.verdict-line.bad .verdict-text { color: var(--bad); font-weight: 600; }
.verdict-line.warn .verdict-text { color: var(--warn); font-weight: 600; }
.verdict-line > .att-dot { align-self: center; }
.verdict-line > .verdict-text { line-height: var(--ctl-sm); }
.verdict-line > .linklike { padding: 0; font-size: var(--fs-2); line-height: var(--ctl-sm); }
.verdict { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.verdict p { margin: 0; }
.verdict-items { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.verdict-item { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-3); }
.verdict-item > .att-dot { margin-top: var(--sp-1); }
.verdict-item-body { flex: 1 1 auto; min-width: 0; }
.verdict-acts { display: inline-flex; gap: var(--sp-2); flex: 0 0 auto; }
/* a line item's creatives under the Line items grid (feedback #40) */
.li-creatives { margin-top: var(--sp-5); }
.li-creatives h3 { margin: 0; font-size: var(--fs-4); }
.li-creatives tr.warn td:first-child { box-shadow: inset .1875rem 0 0 var(--warn); }
td .btn.xs .pill { margin-left: var(--sp-1); }
/* bulk edit (feedback #39) */
.bulk-ops { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.bulk-ops h3 { margin: 0; font-size: var(--fs-2); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bulk-op { gap: var(--sp-2); align-items: center; }
.bulk-op input:not([type=date]):not([type=number]):not(.num-in) { min-width: 14rem; }
.bulk-op input[type=number], .bulk-op input.num-in { width: 6rem; }
.bulk-creatives { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--sp-1) var(--sp-5); flex: 1; }
.bulk-rows td { vertical-align: top; }
.bulk-rows tr.bad td:first-child { box-shadow: inset .1875rem 0 0 var(--bad); }
.bulk-rows tr.warn td:first-child { box-shadow: inset .1875rem 0 0 var(--warn); }
.bulk-rows .golive-list { margin: var(--sp-1) 0; gap: var(--sp-1); }
.bulk-op-wrap { display: flex; flex-direction: column; gap: var(--sp-1); }
.bulk-week { flex-basis: 100%; max-width: 100%; overflow-x: auto; }
/* Copy… and Apply settings from… (ADR 0048 §4) */
.copy-blocks { min-width: 0; }
.copy-blocks fieldset { margin-top: var(--sp-3); }
.form-grid select[size] { width: 100%; margin-top: var(--sp-2); }
/* the × that clears a search field (ui/ClearSearch.tsx, feedback #55): a filled circle, in the top bar in place of
   the ⌘K hint; the browser's own is hidden */
.search-field { position: relative; display: inline-flex; align-items: center; max-width: 100%; }
.search-field .dg-search { padding-right: var(--sp-8); }
.dg-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-clear { flex: none; display: inline-grid; place-items: center; width: 1.125rem; height: 1.125rem; padding: 0; border: 0; border-radius: 50%; background: var(--muted); color: var(--panel); line-height: 1; cursor: pointer; }
.search-clear svg { width: .625rem; height: .625rem; }
.search-clear:hover { background: var(--fg); }
.search-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-field .search-clear { position: absolute; right: .25rem; }

/* "Why is it not running?" (components/WhyNot.tsx): the one-line status in the lists and the reasons in two buckets. */
.why-line.ok { color: var(--ok); }
.why-line.warn { color: var(--warn); }
.why-line.bad { color: var(--bad); }
.why-not { margin-bottom: var(--sp-5); border-left: 3px solid var(--line); }
.why-not.bad { border-left-color: var(--bad); }
.why-not.warn { border-left-color: var(--warn); }
.why-not h3 { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-4); }
.why-list { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; gap: var(--sp-2); }
.why-list li { display: flex; gap: var(--sp-4); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); background: var(--panel); border: 1px solid var(--line); }
.why-list.fix li { border-left: 3px solid var(--bad); }
.why-list.wait li { border-left: 3px solid var(--warn); }
.why-text { flex: 1; min-width: 0; }
.why-detail { font-family: var(--mono); overflow-wrap: anywhere; }
/* Bulk Activate's confirmation: the readiness per row scrolls, the buttons stay in view. */
.bulk-readiness { max-height: 50vh; overflow: auto; margin: var(--sp-3) 0; }
/* The attention model on the dashboard (campaign screen analysis §6). */
.att-chips { gap: var(--sp-2); margin-top: var(--sp-1) !important; margin-left: auto !important; justify-content: flex-end; } /* right-aligned (note 92) */
.att-chips .chip b { margin-left: var(--sp-1); font-weight: 600; }
.att-chip-needsYou b { color: var(--bad); }
.att-chip-waiting b, .att-chip-watch b { color: var(--warn); }
.att-cell { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: center; }
.att-cell.bad .att-text { color: var(--bad); font-weight: 600; }
.att-cell.warn .att-text { color: var(--warn); }
/* The row's one action (owner decision A5): a small button with a 24 px target. */
.att-cell .att-act-btn { min-height: 1.5rem; }
.att-block { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-4); border-left: .25rem solid var(--line); border-radius: var(--r-xs); background: var(--panel2); }
.att-block.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.att-block.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.att-period { margin: 0 0 var(--sp-1); }
.menu-pop.menu-right { left: auto; right: 0; }
.sub-tabs { margin: 0 0 var(--sp-4); }
/* The last 24 hours, the Needs the platform list (analysis §6.3, §6.6). */
.att-since { margin: 0 0 var(--sp-3); }
.needs th { text-align: left; font-weight: 600; white-space: nowrap; }
.needs td, .needs th { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: top; }
/* Calm attention and why-not lines (owner feedback note 70): no big coloured boxes. */
.att-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.att-dot.bad { background: var(--bad); } .att-dot.warn { background: var(--warn); } .att-dot.ok { background: var(--ok); }
.att-act { padding: 0; font-size: var(--fs-2); }
.why-mini { margin: 0 0 var(--sp-3); font-size: var(--fs-3); }
.why-mini > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--sp-1); }
.why-mini > summary::-webkit-details-marker { display: none; }
.why-mini .why-list { margin: var(--sp-1) 0 0 var(--sp-5); padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-0); }
.why-mini .why-list li { padding: 0; border: 0; background: none; }
/* The Overview's Ready to activate and Setup (owner feedback note 81). */
.rv-compact .rv-ready h3, .ov-setup > h3 { margin: var(--sp-7) 0 var(--sp-3); font-size: var(--fs-5); }
.ov-setup-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--sp-5) var(--sp-8); }
.ov-setup-part h4 { margin: var(--sp-1) var(--sp-3) var(--sp-1) 0; }
/* Creatives page: the preview frame and the new-creative choice. */
.cr-preview iframe { max-width: 100%; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--panel2); }
.cr-kind { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); }
.cr-kind legend { font-weight: 600; padding: 0 var(--sp-1); }

/* The uploaded file of a creative (views/creatives/AssetInput.tsx, go-live G4). */
/* The Preview tab (views/creatives/Preview.tsx): one figure per size. */
.cr-preview { margin: 0; display: flex; flex-direction: column; gap: var(--sp-1); align-items: flex-start; }
.cr-verdict { margin: 0; }
.cr-sample { overflow-wrap: anywhere; }
.asset-input { display: flex; flex-direction: column; gap: var(--sp-2); }
.asset-drop { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-4); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel2); }
.asset-drop.over { border-color: var(--accent); }
.asset-uploads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.asset-uploads li { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.asset-name { overflow-wrap: anywhere; }
.asset-done { display: inline-flex; align-items: center; gap: var(--sp-1); }
.asset-actions { display: inline-flex; gap: var(--sp-1); margin-left: auto; }
.asset-facts { display: flex; gap: var(--sp-4); align-items: flex-start; }
.asset-thumb { max-width: 10rem; max-height: 6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel2); }

/* Atom's own review and exchange expiry (views/creatives/Review.tsx, ADR 0032): used on Creatives, the dashboard and Reviews. */
.ar-expired { color: var(--bad); }
.ar-note { overflow-wrap: anywhere; white-space: pre-wrap; }
.ar-reasons, .ar-exreasons { margin: var(--sp-1) 0; padding-left: var(--sp-6); }
.ar-exreasons li { margin: var(--sp-1) 0; overflow-wrap: anywhere; }
.ar-exreasons ul { margin: var(--sp-0) 0; padding-left: var(--sp-6); }
.ar section h3 { display: flex; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-2); font-size: var(--fs-4); }
.ar-form fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-3); }
.ar-reason-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--sp-1) var(--sp-5); }
.ar-form textarea { width: 100%; }
.rv-ex-table td { vertical-align: top; }

/* The line item's Creatives table (feedback #110): a linked creative's weight. */
.crp-weight { width: 4.5rem; }

/* A kit template's settings (views/creatives/KitParamsInput.tsx): cards as groups, the rest in collapsed sections. */
.kit-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.kit-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--sp-2) var(--sp-5); align-items: start; }
.kit-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.kit-list-head { margin: 0; font-size: var(--fs-3); display: flex; gap: var(--sp-3); align-items: baseline; }
.kit-item, .kit-obj { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-4) var(--sp-3); margin: 0; min-width: 0; }
.kit-item > legend, .kit-obj > legend { font-weight: 600; padding: 0 var(--sp-1); }
.kit-obj { grid-column: 1 / -1; }
.kit-item-actions { justify-content: flex-end; margin-bottom: var(--sp-1); }
.kit-field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.kit-performat { grid-column: 1 / -1; }
.kit-sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--sp-2) var(--sp-5); padding-left: var(--sp-4); border-left: 2px solid var(--line); }
.kit-sizes > .hint { grid-column: 1 / -1; }
.asset-url { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.asset-url .row { flex-wrap: nowrap; }
.asset-url select { min-width: 0; flex: 1; }
.asset-thumb.sm { max-width: 6rem; max-height: 4rem; }
.sim-controls { flex-wrap: wrap; gap: var(--sp-3); }
.sim-caption { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
/* Partner goals (ADR 0046): the goal input in the forms, the goal panel on
   the dashboard (components/GoalStatus.tsx); the Bidding card reuses the
   click guard's card styles (.guard-card). */
.goal-input .goal-note { color: var(--muted); }
.goal-input .grid2 label { display: flex; flex-direction: column; gap: var(--sp-1); }
.goal-events { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-1) var(--sp-3) var(--sp-2); margin: 0; }
.goal-events legend { padding: 0 var(--sp-1); }
/* Conversion events (#138): one row per event, name left and the "main" choice right, in the normal font. */
.goal-events .checks { display: grid; gap: 0; }
.goal-ev { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 2rem; }
.goal-ev > .check { font-family: inherit; }
.goal-events .help { display: block; margin-top: var(--sp-1); }

.goal-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.goal-recs { display: grid; gap: var(--sp-2); }
.goal-rec { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; justify-content: space-between; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm); }
/* Reporting (feedback #57): the report builder's dimension lists (facets),
   the size guard and the preview. The toggle bars are in 55-monitor.css. */
.report-builder .facet-bar { align-items: baseline; gap: var(--sp-4); margin-top: var(--sp-5); }
.report-builder .facet-bar h3 { margin: 0; }
.facets { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--sp-2) var(--sp-4); align-items: start; }
.facet { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); min-width: 0; }
.facet.open { grid-row: span 3; }
.facet.off { opacity: .5; }
.facet-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-2) var(--sp-1) 0; }
.facet-toggle { flex: 1; display: flex; align-items: center; gap: var(--sp-2); background: none; border: 0; padding: var(--sp-1) var(--sp-3); color: var(--fg); font-size: var(--fs-grid); text-align: left; cursor: pointer; min-width: 0; }
.facet-toggle:disabled { cursor: default; }
.facet-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-caret { color: var(--muted); width: .75rem; }
.facet-sel { padding: 0 var(--sp-4) var(--sp-2) calc(var(--sp-8) + var(--sp-1)); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-body { border-top: 1px solid var(--line); padding: var(--sp-2); }
.facet-body input[type=search] { width: 100%; max-width: none; margin-bottom: var(--sp-1); }
.facet-list { list-style: none; margin: 0; padding: 0; max-height: 14rem; overflow: auto; }
.facet-list label { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-0) var(--sp-1); margin: 0; font-size: var(--fs-grid); color: var(--fg); border-radius: var(--r-xs); cursor: pointer; }
.facet-list label:hover { background: var(--panel2); }
.facet-list label.stale { color: var(--warn); }
.fv-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--fs-1); }
.report-size { margin: var(--sp-6) 0 0; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); font-size: var(--fs-3); }
.report-size.warn { border-color: var(--warn); background: var(--warn-soft); }
.report-size p { margin: var(--sp-2) 0; }
.report-size ul { margin: 0 0 var(--sp-2); padding-left: var(--sp-7); }
.report-builder .report-run { flex-wrap: wrap; }
.report-builder label.inline, .report label.inline { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0; }
.report-preview .facts { margin-bottom: var(--sp-3); }
/* The base map (components/BaseMap.tsx, docs/basemap.md): MapLibre fills
   the box; its controls (the attribution) in the console's tokens. */
.basemap { position: relative; background: var(--panel2); overflow: hidden; }
.basemap-canvas { position: absolute; inset: 0; }
.basemap-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--sp-6); pointer-events: none; }
.basemap-msg > * { pointer-events: auto; }
.basemap .maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--muted); font-size: var(--fs-1); }
.basemap .maplibregl-ctrl-attrib a { color: var(--fg); }
/* The campaign builder (ADR 0048 §1–§2, C1/C2): the wizard's one-line step intros, Advanced sections, the inherited rules, and the line item table's allocation line. */
.wz-intro { margin: 0 0 var(--sp-5); color: var(--muted); }
.wz-adv { margin-top: var(--sp-5); }
/* View only (a user who may not edit): the same wizard, every field disabled but readable (style guide §4.1).
   A fieldset per part disables its controls natively; display: contents keeps the layout as in edit. */
fieldset.ro-field { display: contents; }
.wz-ro input:disabled, .wz-ro select:disabled, .wz-ro textarea:disabled { opacity: 1; color: var(--fg); background: var(--panel2); cursor: default; }
.wz-viewonly { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: baseline; margin: 0 0 var(--sp-3); }
.ts-ro-list { margin: 0; padding-left: var(--sp-5); }
.wz-adv > summary { display: flex; gap: var(--sp-3); align-items: baseline; }
.wz-inherited { margin-top: var(--sp-6); }
.wz-inherited h3 { margin: 0 0 var(--sp-3); font-size: var(--fs-5); }
.sb-sub > summary { display: flex; gap: var(--sp-3); align-items: baseline; flex-wrap: wrap; }

.lit { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.li-alloc { display: flex; flex-direction: column; gap: var(--sp-1); }
/* Contexts (ADR 0039): the line item's picker (ContextInput.tsx) and
   Operations' context form and detail (ContextAdmin.tsx). */
.cx-picker { display: flex; flex-direction: column; gap: var(--sp-3); max-width: 46rem; }
.cx-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-5); padding: var(--sp-1) 0; border-bottom: 1px solid var(--line); }
.cx-row:last-child { border-bottom: 0; }
.cx-row select { flex: none; }
.cx-row .warn-text { color: var(--warn); }
.cx-admin { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.cx-form .cx-signals { margin-top: var(--sp-3); }
.cx-form .cx-signals td select { min-width: 8rem; }
.cx-form input[type=search] { max-width: 20rem; }
.cx-admin .cx-dropped { color: var(--bad); }
/* The sticky forecast panel (components/ForecastPanel.tsx, ADR 0048 §5): beside a form, top right, staying in view while the form scrolls; on a narrow screen one summary line above the form that opens its details. */
.fp-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); gap: var(--sp-6); align-items: start; }
.fp { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); box-shadow: var(--shadow); }
.fp-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.fp-head h2 { margin: 0; flex: 1 1 auto; font-size: var(--fs-5); }
.fp-levels { margin-left: 0; }
.fp-levels button { padding: var(--sp-0) var(--sp-3); font-size: var(--fs-2); }
.fp-toggle { display: none; }
.fp-verdict { display: flex; flex-wrap: wrap; gap: var(--sp-0) var(--sp-2); align-items: baseline; margin: 0; padding: var(--sp-2) var(--sp-3); border-left: .25rem solid var(--line); border-radius: var(--r-xs); background: var(--panel2); font-size: var(--fs-3); }
.fp-verdict.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.fp-verdict.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.fp-verdict.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.fp-verdict.ok b { color: var(--ok); }
.fp-verdict.warn b { color: var(--warn); }
.fp-verdict.bad b { color: var(--bad); }
.fp-why { flex: 1 1 100%; color: var(--fg); }
.fp-summary { display: none; }
.fp-dot { display: inline-block; width: .5625rem; height: .5625rem; border-radius: 50%; background: var(--muted); align-self: center; }
.fp-verdict.ok .fp-dot, .fp-dot.ok { background: var(--ok); }
.fp-verdict.warn .fp-dot, .fp-dot.warn { background: var(--warn); }
.fp-verdict.bad .fp-dot, .fp-dot.bad { background: var(--bad); }
.fp-body { display: flex; flex-direction: column; gap: var(--sp-2); }
.fp-body p { margin: 0; }
.fp-figures { display: grid; gap: var(--sp-1); margin: 0; }
.fp-figures > div { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: baseline; }
.fp-figures dt { color: var(--muted); font-size: var(--fs-3); }
.fp-notes { margin: 0; padding-left: var(--sp-4); display: grid; gap: var(--sp-1); }
.fp-figures dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.fp-bar { height: .375rem; border-radius: var(--r-xs); background: var(--panel2); overflow: hidden; }
.fp-bar > span { display: block; height: 100%; background: var(--accent); }
.fp-bar.ok > span { background: var(--ok); }
.fp-bar.warn > span { background: var(--warn); }
.fp-bar.bad > span { background: var(--bad); }
.fp-items { font-size: var(--fs-2); }
.fp-items td { padding: var(--sp-0) var(--sp-1); }
.fp-manual { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
@media (max-width: 900px) {
  .fp-wrap { grid-template-columns: minmax(0, 1fr); }
  .fp-wrap > .fp { order: -1; }
  .fp-toggle { display: inline-block; }
  .fp:not(.open) .fp-body { display: none; }
  .fp:not(.open) .fp-why { flex-basis: auto; }
  .fp:not(.open) .fp-summary { display: inline; }
}
/* The forecast as a strip under the wizard's steps (feedback note 22). */
.fp.fp-strip-box { position: static; padding: 0; border: 0; box-shadow: none; background: none; gap: var(--sp-2); margin-top: var(--sp-3); }
.fp-strip { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); align-items: center; padding: var(--sp-1) var(--sp-4); border-left: .25rem solid var(--line); border-radius: var(--r-xs); background: var(--panel2); font-size: var(--fs-3); }
.fp-strip.ok { border-left-color: var(--ok); }
.fp-strip.warn { border-left-color: var(--warn); }
.fp-strip.bad { border-left-color: var(--bad); }
.fp-strip.ok .fp-dot { background: var(--ok); }
.fp-strip.warn .fp-dot { background: var(--warn); }
.fp-strip.bad .fp-dot { background: var(--bad); }
.fp-strip .fp-fig { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fp-strip .spacer { flex: 1 1 auto; }
.fp-strip .fp-levels { margin-left: 0; }
.fp-strip-box.open > .fp-body { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); max-height: 40vh; overflow: auto; }
/* Geo layers (Operations › Geo layers, feedback #62, #64): the Details tab
   and the Map tab: the layer on the base map (58-basemap.css) with the
   clicked feature's data in a side panel. */
.geo-details h3 { margin: var(--sp-5) 0 var(--sp-2); font-size: var(--fs-3); }
.geo-details h3:first-child { margin-top: 0; }
.field .hint.warn { color: var(--warn); }
.lmap-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--sp-5); align-items: start; }
@media (max-width: 760px) { .lmap-wrap { grid-template-columns: minmax(0, 1fr); } }
.lmap-tools { gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
.lmap-by { display: inline-flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-2); color: var(--muted); }
.lmap-legend { display: inline-flex; gap: var(--sp-2); align-items: center; }
.lmap-ramp { display: inline-block; width: 4rem; height: .5rem; border-radius: var(--r-xs); background: linear-gradient(to right, var(--accent-soft), var(--accent)); border: 1px solid var(--line); }
.lmap { height: clamp(16rem, 52vh, 34rem); border: 1px solid var(--line); border-radius: var(--r-md); touch-action: none; }
.lmap-foot { margin: var(--sp-2) 0 0; }
.lmap-foot .warn { color: var(--warn); }
.lmap-side { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); background: var(--panel); max-height: clamp(16rem, 52vh, 34rem); overflow: auto; }
.lmap-side h3 { margin: 0; font-size: var(--fs-3); }
.lmap-side .kvlist { margin-top: var(--sp-3); font-size: var(--fs-2); overflow-wrap: anywhere; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-1) var(--sp-5); }
.lmap-side .kvlist dd { text-align: right; }
/* New geo layer from a table (feedback #63): the source choice and the
   preview of the join; the Features tab (feedback #66): its pager. */
.geo-source { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-7); align-items: center; }
.geo-source input[type="radio"] { width: auto; margin: 0; }
.geo-preview { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); background: var(--panel); }
.geo-preview.busy { opacity: .6; }
.geo-preview h3 { margin: 0 0 var(--sp-1); font-size: var(--fs-3); }
.geo-preview p { margin: var(--sp-1) 0; }
.geo-preview-scroll { overflow: auto; max-height: 16rem; border: 1px solid var(--line); border-radius: var(--r-md); margin: var(--sp-2) 0; }
.geo-preview-table { width: 100%; font-size: var(--fs-2); }
.geo-preview-table th { text-align: left; vertical-align: bottom; white-space: nowrap; background: var(--panel2); position: sticky; top: 0; }
.geo-preview-table th.key { box-shadow: inset 0 -2px 0 var(--accent); }
.geo-preview-table th .geo-type { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-1); }
.geo-preview-table th .geo-type.number { color: var(--accent); }
.geo-preview-table td { white-space: nowrap; }
.geo-match { margin: var(--sp-3) 0 0; font-size: var(--fs-3); }
.geo-match .ok { color: var(--ok); } .geo-match .warn { color: var(--warn); } .geo-match .bad, .geo-preview p.bad { color: var(--bad); }
/* the Features tab fills the detail pane (at least 16rem of table, else the pane scrolls), so the
   table scrolls itself: the header stays, the sideways scroll bar is in view, and only the rows
   in view are rendered (feedback #67) */
.md-detail:has(> .detail > .dt-body > .geo-features) { display: flex; flex-direction: column; }
.md-detail > .detail:has(> .dt-body > .geo-features) { flex: 1 1 0; display: flex; flex-direction: column; }
.detail > .dt-body:has(> .geo-features) { flex: 1 1 0; display: flex; flex-direction: column; }
.geo-features { flex: 1 1 0; display: flex; flex-direction: column; }
.geo-features .dg { flex: 1 1 0; min-height: 16rem; }
.geo-n { display: inline-block; }
.geo-features-help { margin: var(--sp-2) 0 0; }
/* Geo-audiences (ADR 0042 §5): the class table, the overlay's preview and the line item's class picker. */
.ga-classes { width: auto; min-width: 32rem; margin: var(--sp-3) 0; }
.ga-classes td, .ga-classes th { padding: var(--sp-1) var(--sp-5); }
.ga-classes tr.bad td { color: var(--bad); }
.ga-bar-cell { width: 10rem; }
.ga-bar { display: block; height: 0.6rem; border-radius: var(--r-xs); background: var(--accent); }
.ga-detail h3 { margin-top: var(--sp-6); }
.ga-preview { border-top: 1px solid var(--line); padding-top: var(--sp-5); }
.ga-cols summary { cursor: pointer; margin-top: var(--sp-1); }
.ga-col-list { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: var(--sp-2) 0; max-height: 12rem; overflow: auto; }
.ga-picker { display: flex; flex-direction: column; gap: var(--sp-3); }
.ga-pick { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-5); }
.ga-pick p { margin: var(--sp-1) 0; }
.ga-scale { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; margin-top: var(--sp-1); }
.ga-class { min-width: 2rem; justify-content: center; }
.ga-class:disabled { opacity: 0.4; }
/* The location map (components/LocationMap.tsx) and the location workspace's accuracy choice and footer (components/targeting/location/LocationParts.tsx). */
.loc-map { position: relative; border: 1px solid var(--line); border-radius: var(--r-xs); padding: var(--sp-2); }
.loc-map:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.loc-map-canvas { height: 16rem; border-radius: var(--r-xs); overflow: hidden; }
.loc-quality h4 { margin: var(--sp-3) 0 var(--sp-1); }
.loc-q-grid { display: grid; }
.loc-q-row { display: grid; grid-template-columns: 1.6fr .8fr .8fr 1.4fr; gap: var(--sp-2); align-items: center; padding: var(--sp-1) var(--sp-2); text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--muted); font: inherit; }
.loc-q-row.head { font-size: var(--fs-1); font-weight: 600; }
.loc-q-row[role=radio] { cursor: pointer; }
.loc-q-row.on { color: var(--fg); background: var(--sel); font-weight: 600; }
.loc-q-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.loc-q-share { display: flex; align-items: center; gap: var(--sp-2); }
.loc-q-share meter { flex: 1; }
.loc-q-ask { display: grid; gap: var(--sp-2); justify-items: start; margin-top: var(--sp-2); }
.loc-foot { margin-top: var(--sp-3); }
/* Location blocks (ADR 0042 addendum): the line item's block picker and the Operations page. */
.lb-picker, .db-picker { display: flex; flex-direction: column; gap: var(--sp-3); }
.lb-group { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-1) var(--sp-5) var(--sp-3); margin: 0; }
.lb-group legend { font-weight: 600; padding: 0 var(--sp-1); }
.lb-row { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }
.lb-row:last-of-type { border-bottom: 0; }
.lb-row.include .lb-text b { color: var(--ok); }
.lb-row.exclude .lb-text b { color: var(--bad); text-decoration: line-through; }
.lb-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lb-desc { overflow-wrap: anywhere; }
.lb-seg { margin-left: 0; flex: none; }
.lb-detail h3 { margin-top: var(--sp-6); }
.lb-sources td { vertical-align: top; }
@media (max-width: 40rem) {
  .lb-row { flex-direction: column; align-items: flex-start; }
}
/* Moments: the reach preview (MomentAdmin.tsx) and the calendar overlay
   (MomentCalendarAdmin.tsx; BACKLOG 2i). */
.mo-reach { display: flex; flex-direction: column; gap: var(--sp-2); }
.mo-reach .row { gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.cal-admin { max-width: 64rem; }
.cal-admin .cal-rule { display: block; font-weight: 400; max-width: 26rem; }
.cal-payday { gap: var(--sp-5); align-items: flex-end; flex-wrap: wrap; padding: var(--sp-1) 0; }
.cal-payday .cal-country { min-width: 2rem; padding-bottom: var(--sp-2); }
.cal-payday input[type=number] { width: 5rem; }
.cal-add { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-5); background: var(--panel); }
.cal-check { flex-direction: row; align-items: center; gap: var(--sp-2); }
/* A line item's occasions in the Time picker (CalendarInput.tsx OccasionInput):
   per row a check box, a tip and one status (a dot and a word; today in the accent). */
.occ-list { border: 0; margin: var(--sp-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.occ-row { display: flex; align-items: center; gap: var(--sp-2); }
.occ-row .check { margin: 0; }
.occ-status { margin-left: auto; display: inline-flex; align-items: center; gap: var(--sp-1); white-space: nowrap; }
.occ-status .att-dot.on { background: var(--accent); }
/* The reporting map (components/ReportMap.tsx): Reporting › Map and the
   dashboard's Map tab. The map and its side panel reuse the geo layer map's
   classes (58-geo.css: .lmap-wrap, .lmap, .lmap-side). */
.rmap { display: flex; flex-direction: column; gap: var(--sp-3); }
.rmap-tools { gap: var(--sp-3); align-items: center; }
.rmap-legend { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); align-items: center; }
.rmap-step { display: inline-flex; gap: var(--sp-1); align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rmap-swatch { display: inline-block; width: .875rem; height: .625rem; border-radius: var(--r-xs); background: var(--accent); }
.rmap-swatch.none { background: transparent; border: 1px solid var(--line); opacity: 1; }
.rmap-main { position: relative; min-width: 0; }
.rmap-tip { position: absolute; z-index: var(--z-sticky); pointer-events: none; max-width: 16rem; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-2);
  background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
.rmap .dg { max-height: 28rem; flex: none; }
/* The review page (ADR 0048 §6, E2; components/CampaignReview.tsx): the
   summary header, the readiness, the line item table and the detail pane. */
.rv { min-width: 0; }
.rv-head { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: var(--sp-5); }
.rv-head .row { align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.rv-head h3 { margin: 0; }
.rv-head .linkish { margin-left: var(--sp-1); }
.rv-ready .row { align-items: center; gap: var(--sp-3); margin: var(--sp-1) 0 0; flex-wrap: wrap; }
.rv-detail { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.rv-detail h4 { margin: var(--sp-5) 0 var(--sp-1); }
.rv-detail h5, .rv-ready h5 { margin: var(--sp-3) 0 var(--sp-1); font-size: var(--fs-2); color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.rv .ok-text { color: var(--ok); }
/* Saved-targeting paste box (components/TargetingPicker.tsx) and the targeting sheet's axis button (components/TargetingSheet.tsx). */
.sb-paste { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.sb-paste textarea { width: 100%; font: inherit; }
.sb-paste .row { gap: var(--sp-2); }
.tt-axis { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--fg); cursor: pointer; text-align: left; }
.tt-axis:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The targeting sheet (phase T1): rules, Always, Never in reading order, and the sentence. */
.ts { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.ts-table { width: 100%; border-collapse: collapse; font-size: var(--fs-3); }
.ts-table thead th { font-size: var(--fs-1); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: var(--sp-0) var(--sp-3); text-align: left; }
.ts-table thead th.num { text-align: right; }
.ts-band > th { text-align: left; padding: var(--sp-3) var(--sp-3) var(--sp-1); font-size: var(--fs-2); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); }
.ts-band.never > th { color: var(--bad); }
.ts-row > th, .ts-row > td { padding: var(--sp-1) var(--sp-3); border-bottom: 1px solid var(--line); vertical-align: middle; }
.ts-row > th { width: 22rem; min-width: 16rem; text-align: left; font-weight: 600; }
.ts-row.locked > th, .ts-row.locked > td { color: var(--muted); background: var(--panel2); }
.ts-row.off > td { text-decoration: none; }
.ts-vals .chip { display: inline-block; margin: 1px var(--sp-1) 1px 0; }
.ts-vals .chip { cursor: default; }
.ts-cut { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.ts-most { margin-left: var(--sp-2); }
.ts-sentence { margin: 0; padding: var(--sp-3) var(--sp-4); border-left: .25rem solid var(--accent); background: var(--accent-soft); border-radius: var(--r-xs); font-size: var(--fs-3); }
/* The line item's tabs (Basics, Targeting, Creatives), with a dot or count for a tab with a problem. */
.liw-tabs { margin: var(--sp-2) 0 0; }
.liw-tabs .tab-dot { display: inline-flex; align-items: center; justify-content: center; min-width: .5rem; height: .5rem; margin-left: var(--sp-2); border-radius: var(--r-md); font-size: var(--fs-0); line-height: 1; padding: 0; }
.liw-tabs .tab-dot.bad { background: var(--bad); color: var(--on-strong); min-width: 1rem; height: 1rem; padding: 0 var(--sp-1); }
.liw-tabs .tab-dot.warn { background: var(--warn); }
.att-period-pick { width: auto; height: var(--ctl-sm); padding: 0 var(--sp-2); font-size: var(--fs-2); }

/* Platform policy rows under Within the rules (ADR 0056 B2): links inline. */
.ts-policy .linklike { padding: 0; font-size: inherit; }
/* The chip strip (ui/ChipStrip.tsx): its bands in a column. */
.cs { display: flex; flex-direction: column; gap: var(--sp-2); }
/* The Targeting tab's category rows (targeting setup §c.2, TP1): Category | Include | Exclude (wins) | What it keeps. */
.ts-verdict { margin: 0 0 var(--sp-3); }
.ts-cats thead th { text-align: left; font-size: var(--fs-2); color: var(--muted); font-weight: 600; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); }
.ts-cats thead th.num { text-align: right; }
.ts-cat > th, .ts-cat > td { vertical-align: top; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); }
.ts-cat > th { text-align: left; white-space: nowrap; }
.ts-part { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: baseline; }
.ts-part-label::after { content: ':'; }
.ts-exc .ts-part .chip { border-color: var(--never-fg); }
.ts-and { margin: var(--sp-1) 0; text-transform: uppercase; letter-spacing: .04em; }
.ts-addexc { margin-top: var(--sp-1); }
.ts-cats .ts-cut { min-width: 9rem; white-space: nowrap; }
.ts-bar { display: block; height: 4px; margin-top: var(--sp-1); background: var(--line); border-radius: 2px; overflow: hidden; }
.ts-bar > svg { display: block; width: 100%; height: 100%; }
.ts-bar rect { fill: var(--only-on-fg); }
/* Operations › Targeting (Targeting.tsx): the axis's line and its views, an embedded register's head. */
.tx-sub { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.tx-sub p { margin: 0; }
.tx-sub .seg { margin-left: 0; }
.embedded-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.embedded-head p { margin: 0; max-width: 60rem; }
.tx-detail .kvlist { margin-top: var(--sp-5); }
/* The set panel (components/SetPanel.tsx, TG step 2): its sections stacked, the composition tree no taller than the detail. */
.set-panel { display: flex; flex-direction: column; gap: var(--sp-2); }
.set-panel h3 { margin: var(--sp-4) 0 0; }
/* The head: the name left, the set ActionBar (ui/ActionBar.tsx, TG step 6a) right; it wraps under a long name. */
.set-panel-title { display: flex; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.set-panel-title h2 { margin: 0; flex: 1 1 16rem; }
.set-panel .facts, .set-panel .kvlist { margin-bottom: 0; }
.set-panel .dg.tree { max-height: 24rem; }
/* The set lifecycle (TG step 5, components/SetLifecycle.tsx): its actions, the live-use warning and the history. */
.lc-actions { display: flex; flex-direction: column; gap: var(--sp-2); }
.lc-warn { margin: var(--sp-2) 0; padding: var(--sp-3) var(--sp-5); border: 1px solid var(--warn); border-radius: var(--r-sm); background: var(--warn-soft); }
.lc-warn p { margin: 0; }
.lc-history { margin: 0; padding-left: var(--sp-6); max-height: 16rem; overflow: auto; }
.tree-badge { margin-left: var(--sp-2); }

/* The week grid (WeekGridInput.tsx): 7 days × 24 hours, painted with pointer or keyboard. */
.wk { display: flex; flex-direction: column; gap: var(--sp-2); max-width: 46rem; }
.wk-presets { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; }
.wk-presets .chip { font-size: var(--fs-2); padding: var(--sp-0) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); color: var(--fg); }
.wk-presets .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.wk-presets label.check { margin-left: var(--sp-1); }
.wk-scroll { overflow-x: auto; }
.wk-grid { border-collapse: separate; border-spacing: 2px; touch-action: none; user-select: none; -webkit-user-select: none; }
.wk-grid th { padding: 0; font-weight: 400; }
.wk-grid td { width: 1.25rem; min-width: 1.25rem; height: 1.25rem; padding: 0; background: var(--input); border: 1px solid var(--line); border-radius: 2px; cursor: pointer; }
.wk-grid td.on { background: var(--accent); border-color: var(--accent); }
/* Tinted by the expected supply of the hour (--wk-s 0–1, BACKLOG 2c): off cells
   from the empty colour towards a pale accent, on cells from a lighter to the
   full accent. */
.wk-grid td.tint { background: color-mix(in srgb, var(--accent) calc(var(--wk-s, 0) * 35%), var(--input)); }
.wk-grid td.tint.on { background: color-mix(in srgb, var(--accent) calc(45% + var(--wk-s, 0) * 55%), var(--input)); }
.wk-grid td:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }
.wk-grid .wk-h, .wk-grid .wk-d, .wk-grid .wk-corner { background: none; border: 0; padding: 0 var(--sp-0); font-size: var(--fs-1); color: var(--muted); cursor: pointer; }
.wk-grid .wk-d { min-width: 2rem; text-align: left; }
.wk-ro .wk-grid td { cursor: default; }
.wk-actions { gap: var(--sp-1); }

/* The weather picker (WeatherBlockInput.tsx); groups as the location blocks' (58-locationblocks.css). */
.wb-row { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-1) 0; font-weight: 400; }
.wb-row input { margin-top: var(--sp-0); }
.wb-row .lb-text { display: flex; flex-direction: column; }
.wb-admin { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); max-width: 40rem; }
.wb-admin .row { gap: var(--sp-3); align-items: flex-end; }
.wb-admin input[type=number] { width: 5rem; }
.wb-picker { display: flex; flex-direction: column; gap: var(--sp-3); }


/* Operations › Targeting › Policies (Policies.tsx, ADR 0056 B2): one row per policy. */
.policy-rows { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: flex; flex-direction: column; gap: var(--sp-4); }
.policy-rows li { padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.policy-rows .pill, .policy-rows .btn { margin-left: var(--sp-2); }

/* A set's definition as conditions (GT8c, components/ConditionEditor.tsx): the read-only block and the editor's rows. */
.cond-def { display: flex; flex-direction: column; gap: var(--sp-1); }
.cond-summary { margin: 0; font-weight: 600; }
.cond-rows, .cond-caps { margin: 0; padding-left: var(--sp-5); }
.cond-edit { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.cond-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.cond-inputs { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-start; flex: 1 1 28rem; }
.cond-value .row { gap: var(--sp-2); }
.cond-setref { flex: 1 1 100%; }
.cond-setref .dg.tree { max-height: 16rem; }
.cond-problem { flex: 1 1 100%; margin: 0; }
.cond-problem p { margin: 0; }

/* The set definition editor: Signal / Operator / Value are column headers once, values line up (D5.6) */
.cond-heads, .cond-form .cond-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: var(--sp-3); align-items: start; }
.cond-heads { font-size: var(--fs-2); font-weight: 600; color: var(--muted); padding: 0 0 var(--sp-1); }
.cond-form .cond-inputs.heads { display: contents; }
.cond-form .cond-inputs.heads > .field, .cond-form .cond-inputs.heads > .cond-value { min-width: 0; }
.cond-form .cond-inputs.heads > .field select, .cond-form .cond-inputs.heads .cond-value > * { max-width: 100%; }
.cond-form .cond-row > .cond-problem, .cond-form .cond-row > .cond-setref { grid-column: 1 / -1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cond-form .cond-row > .btn { grid-column: 4; }
/* TP1: the targeting panel shell (components/targeting/TargetingPanel.tsx): the list and the evidence pane at one
   width beside it; the head is one sentence and one figures line; the panel fits the sheet's body and the table fills
   what the head, the strip and the notes leave (it scrolls inside; at 1280×720 at least four rows show). The notes sit
   under the table: one that a pick brings takes room from the table's bottom, so the table and its rows stay put. */
/* The side pane takes a share of the sheet, at least 17rem and at most 28.5rem: the panel is a layer of the overlay stack
   (docs/console-style-guide.md "Stacked overlays": no per-screen widths), so its width is the stack's, not its own. */
.tpn { --tp-side: clamp(17rem, 30%, 28.5rem); display: grid; grid-template-columns: minmax(0, 1fr) auto var(--tp-side); gap: var(--sp-1); align-items: stretch; min-height: 0; flex: 1 1 auto; }
/* The panel fills the sheet's body, not the viewport (walk 2026-11-12, finding 14): the body is a column, the panel
   (and the Location workspace around it) takes what is left, so the table fills its box and the sheet does not scroll. */
.ov-body:has(> .tpn, > .lw, > .tpn-wrap) { display: flex; flex-direction: column; }
.lw { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
/* The divider between the list and the side pane (finding 13): dragged or moved with the keys (sideresize.ts). */
.tpn-div { width: var(--sp-2); cursor: col-resize; touch-action: none; border-radius: var(--r-xs); }
.tpn-div:hover, .tpn-div:focus-visible { background: color-mix(in srgb, currentColor 15%, transparent); }
.tpn-main { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; min-height: 0; overflow-y: auto; }
.tpn-head p { margin: 0; line-height: 1.35; }
.tpn .dg.tree { flex: 1 1 12rem; min-height: 12rem; }
/* The strip: a band as tall with a chip as without one (an empty row's text and a chip line are both 1.875rem), so
   a pick never moves the table below it. */
.tpn .cs-band { padding-block: 0; }
.tpn .cs-row { padding-block: 1px; }
.tpn .cs-line { padding-block: 0; }
.tpn-sentence { font-weight: 600; }
.tpn-note { display: flex; gap: var(--sp-field); align-items: center; flex-wrap: wrap; margin: 0; }
.tpn-tools { display: flex; gap: var(--sp-field); }
.tpn-paste { display: flex; gap: var(--sp-field); align-items: flex-start; width: 100%; }
.tpn-paste textarea { flex: 1; min-width: 0; }
.tpn .dg-scroll { max-height: none; }
.tpn-side { position: sticky; top: 0; border-left: 1px solid color-mix(in srgb, currentColor 15%, transparent); padding-left: var(--sp-field); }
.tpn-side-h { margin: 0 0 var(--sp-field); }
.tpn-keeps { list-style: none; margin: 0; padding: 0; }
.tpn-keeps li { display: flex; justify-content: space-between; gap: var(--sp-field); padding: 2px 0; }
.tpn-keeps li.exc span:first-child { color: var(--tmap-exclude); }
.tpn-except { display: flex; gap: var(--sp-field); align-items: center; flex-wrap: wrap; }
.tpn-keeps li.tpn-together { border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent); font-weight: 600; margin-top: 2px; }
.tpn-wins { margin: var(--sp-field) 0 0; }
.tree-mark { margin-right: .4em; }
.tree-mark::before { content: attr(data-mark); }
.tree-people { margin-left: .15em; font-size: var(--fs-0); opacity: .75; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 1100px) {
  .tpn { grid-template-columns: minmax(0, 1fr); }
  .tpn-div { display: none; }
  .ov-body:has(> .tpn, > .lw, > .tpn-wrap) { display: block; }
  .tpn-main { overflow-y: visible; }
  .tpn .dg-scroll { max-height: calc(100vh - 16rem); }
  .tpn-side { position: static; border-left: 0; padding-left: 0; }
}
/* TP2: the Location workspace (components/targeting/location): the map is the side pane, at the shell's width, and
   runs the panel's full height; a row's own fields (a radius, "Fix the address") sit under its name. */
.tpn[data-cat="location"] { align-items: stretch; }
.tpn[data-cat="location"] .tpn-side { display: flex; flex-direction: column; min-height: 0; }
.lw-map, .lw-map .loc-map { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.lw-map .loc-map-canvas { flex: 1; min-height: 20rem; }
.tree-inline { display: flex; flex-wrap: wrap; gap: var(--sp-field); align-items: center; margin-top: 2px; white-space: normal; }
/* The Location columns (Type, People, Requests/day; Radius and Store ID with own items) keep their width: the table scrolls sideways
   between the frozen Name and Include | Exclude instead of squeezing them (TreeTable v2). */
.tpn[data-cat="location"] .tree-table thead th:not(.tree-name-h):not(.tree-choice) { min-width: 6.5rem; }
.lw-radius { white-space: nowrap; }
.lw-radius input { width: 4.5em; margin-right: .25em; text-align: right; }
.lw-need, .lw-fix { display: flex; flex-wrap: wrap; gap: var(--sp-field); align-items: center; }
.lw-ops { margin-top: var(--sp-field); }
/* The paste review (walkthrough 2026-11-11 S5): while it is open it takes the list's place, so at 1280×720 its
   "needs you" lines (first) and at least four rows show above its footer. */
.tpn-main:has(> .rsh) > .dg.tree { display: none; }
/* While the review is open the panel's head steps back: the sentence keeps one line, the figures, the strip, the
   notes and the tools wait until it closes (they come back unchanged), so the review gets the height. */
.tpn-main:has(> .rsh) > :is(.tpn-strip, .tpn-note, .tpn-tools), .tpn-main:has(> .rsh) .tpn-figures { display: none; }
.tpn-main:has(> .rsh) .tpn-sentence { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpn-main > .rsh .rsh-grp th { padding-block: 2px; }
.tpn-main > .rsh .rsh-table thead th { padding-block: var(--sp-1); }
/* A "needs you" row is one line of actions (edit, Point it on the map, Leave out), not a stack. */
.tpn-main > .rsh .rsh-fix { width: 1%; white-space: nowrap; }
.tpn-main > .rsh .rsh-fixes { flex-wrap: nowrap; }
.tpn-main > .rsh .rsh-fixes .btn.sm { min-height: 0; padding-block: 0; }
.tpn-main > .rsh .rsh-foot .small { font-size: var(--fs-0); }
.tpn-main > .rsh { flex: 1 1 auto; max-height: none; min-height: 16rem; }
.tpn-main > .rsh .rsh-head, .tpn-main > .rsh .rsh-foot { padding-block: var(--sp-2); }
.tpn-main > .rsh .rsh-table td { padding-block: var(--sp-1); height: auto; }
.tpn-main > .rsh .rsh-in { white-space: normal; overflow-wrap: anywhere; }
/* Price models (ADR 0027): the line editor and the example waterfall. */
.row.nowrap { flex-wrap: nowrap; margin: 0; gap: var(--sp-1); }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.composer h3, .example h3 { font-size: var(--fs-2); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: var(--sp-6) 0 var(--sp-2); }
.line-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.line-row { display: grid; grid-template-columns: auto minmax(8rem, 1fr) minmax(10rem, 1.2fr) minmax(12rem, 3fr) minmax(6rem, 1fr) auto auto; gap: var(--sp-2); align-items: center; padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--line); }
.line-row.dragging { opacity: .5; }
.line-base { padding: var(--sp-1) var(--sp-2); font-weight: 600; background: var(--panel2); }
.line-problem { padding: 0 var(--sp-2); }
.line-row select, .line-row input:not([type=checkbox]) { font-size: var(--fs-2); padding: var(--sp-0) var(--sp-1); max-width: 16.25rem; }
.line-row .mv { white-space: nowrap; }
.line-row .grab { cursor: grab; }
.line-row .w-5, .example .w-5 { width: 5rem; }
.line-row .w-6, .example .w-6 { width: 6rem; }
.line-row .w-8 { width: 8rem; }
.bare { border: 0; margin: 0; padding: 0; }
.flush { margin: 0; }
.example { max-width: 48.75rem; }
/* Rate cards › Templates (feedback #72): what templates are for, under the page intro. */
.tpl-help { margin: var(--sp-2) 0 0; padding: var(--sp-2) var(--sp-4); border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: var(--r-xs); max-width: 60rem; }
/* What uses a record that cannot be deleted: its own line under the actions. */
.detail-head .used-by { flex-basis: 100%; order: 99; text-align: right; }
.form-grid.tpl-fields { align-items: start; margin-bottom: var(--sp-5); }
h3.sect { font-size: var(--fs-2); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: var(--sp-6) 0 var(--sp-2); }
.waterfall { margin: 0; }
.waterfall > div { display: flex; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-1) var(--sp-4); }
.waterfall dt, .waterfall dd { margin: 0; }
.waterfall .sub { font-weight: 600; background: var(--panel2); }
.waterfall .tot { font-weight: 700; border-top: 2px solid var(--line); }

/* Pricing options, the campaign's billing and the budget split (ADR 0047 §3–§5): components/PricingOptionPicker.tsx, CampaignBilling.tsx, BudgetSplit.tsx and views/PricingOptions.tsx. Tokens only. */
.po { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.po-choice { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); cursor: pointer; }
.po-choice.on { border-color: var(--accent); background: var(--accent-soft); }
.po-choice input { margin-top: var(--sp-0); }
.po-choice .pill { margin-left: auto; }
.po-opt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.po-price { font-size: var(--fs-3); }
.po-empty { margin: 0; }
.po-warn { color: var(--warn); }
.po-table { border-collapse: collapse; width: 100%; max-width: 48rem; }
.po-table th { text-align: left; font-size: var(--fs-2); color: var(--muted); font-weight: 600; padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--line); }
.po-table td { padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--line); vertical-align: middle; }
.po-table td input:not([type="radio"]), .po-table td select { width: 100%; }

.cb { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.cb-choices { display: flex; flex-direction: column; gap: var(--sp-1); }
.cb-adv summary, .cb-segs summary { cursor: pointer; color: var(--muted); }
.cb-adv[open], .cb-segs[open] { display: flex; flex-direction: column; gap: var(--sp-1); }
.cb-seg { display: grid; grid-template-columns: minmax(0, 2fr) auto minmax(8rem, 1fr); gap: var(--sp-3); align-items: center; }
.cb .hint { font-size: var(--fs-1); color: var(--muted); margin: 0; }

.bs-input { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; min-width: 0; }
.bs-input .hint { font-size: var(--fs-1); color: var(--muted); }
.bs-amount { display: inline-flex; gap: var(--sp-1); align-items: center; }
.bs-amount input { width: 7rem; }
.bs { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
@media (max-width: 700px) {
  .cb-seg { grid-template-columns: minmax(0, 1fr); }
}
/* Reallocation (components/Reallocation.tsx, ADR 0047 §6): the option, the log under the Overview's Setup, Move unspent budget…. */
.realloc-input .hint { margin-top: var(--sp-1); }
.realloc-moves { margin: var(--sp-0) 0 var(--sp-0); padding-left: var(--sp-6); }
.realloc-log { margin-top: var(--sp-5); }
.realloc-log > summary { cursor: pointer; color: var(--muted); }
.realloc-ask { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; border: 1px solid var(--line); background: var(--accent-soft); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-5); margin: var(--sp-3) 0; }
.realloc-ask > span { flex: 1 1 16rem; }
.realloc-reasoning, .realloc-runs { margin-top: var(--sp-5); }
.realloc-reasoning summary, .realloc-runs summary { cursor: pointer; color: var(--muted); }
.realloc-runs ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-6); }
/* The status page (Operations workspace). Calm: the state shows as a tile's
   left border or a small pill, the texts keep their colours. */
.st-tiles { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); }
.st-tiles .tile span { font-size: var(--fs-5); }
.st-tile-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.st-reason { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The main switch's "Stop one source…" (feedback #49): a small menu under the tile's text. */
.st-more { font-size: var(--fs-2); position: relative; }
.st-more > summary { cursor: pointer; color: var(--muted); }
.st-more > summary:hover { color: var(--fg); }
.st-more ul { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: var(--sp-1); }
.st-more li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
/* The main switch: a switch. */
.st-toggle { position: relative; flex: none; width: 2.125rem; height: 1.125rem; padding: 0; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.st-toggle i { position: absolute; top: 1px; left: 1px; width: .875rem; height: .875rem; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); box-sizing: border-box; transition: left .15s; }
.st-toggle[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.st-toggle[aria-checked="true"] i { left: 1.0625rem; border-color: var(--ok); }
.st-toggle:disabled { cursor: not-allowed; opacity: .6; }
.st-model .kv { margin-bottom: var(--sp-3); }
.st-model .warnings { color: var(--fg); max-height: 15rem; overflow: auto; font-size: var(--fs-2); }
/* State pills: OK stays quiet, only what is off normal has a colour. */
.pill.sp-ok { border-color: var(--line); color: var(--muted); background: transparent; }
.pill.sp-outside { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.pill.sp-down, .pill.sp-critical { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.pill.sp-low { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.st-spark { width: 7.5rem; height: 1.375rem; display: block; }
.st-band { fill: var(--accent); opacity: .14; stroke: none; }
.st-line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.st-chart .st-line { stroke-width: 2; }
.st-spark.st-outside .st-line, .st-line.st-outside, .st-spark.st-low .st-line, .st-line.st-low { stroke: var(--warn); }
.st-spark.st-down .st-line, .st-line.st-down, .st-spark.st-critical .st-line, .st-line.st-critical { stroke: var(--bad); }
.st-dot { fill: var(--accent); }
.st-dot.st-outside, .st-dot.st-low { fill: var(--warn); }
.st-dot.st-down, .st-dot.st-critical { fill: var(--bad); }
.st-runbook ul { margin: var(--sp-1) 0 var(--sp-4); padding-left: var(--sp-6); }
/* Status' first lines (FQ18/FQ19): what waits on Operations, then the platform verdict, above the tiles. */
.st-verdict { margin: 0 0 var(--sp-4); }
.st-needs { margin: 0 0 var(--sp-1); }
/* Alerting (views/ops/Alerting.tsx) and the console-wide pause banner (components/AlertingBanner.tsx). */
.alert-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: var(--sp-5); }
.alert-board .card { margin-bottom: 0; }
.alert-oncall { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.alert-oncall ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.alert-user { font-size: var(--fs-5); }
.alert-paused { margin: 0; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.alert-kinds { border: 0; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.alert-open { margin-top: var(--sp-6); }
.alert-h { font-size: var(--fs-1); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 0 0 var(--sp-3); }
.env-bar.alert-bar { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.env-bar.alert-bar .muted { font-weight: 400; }
.env-bar.alert-bar a.btn { margin-left: auto; }
@media (max-width: 40rem) { .alert-oncall { grid-template-columns: 1fr; } }
/* The incidents page (Operations workspace). */
.inc-timeline li { display: grid; gap: 2px; }
.inc-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.inc-note { max-width: 40rem; }
.inc-note textarea { width: 100%; }
.inc-labels { display: grid; grid-template-columns: max-content 1fr; gap: 2px var(--sp-5); margin: 0; font-size: var(--fs-2); }
.inc-labels > div { display: contents; }
.inc-labels dt { color: var(--muted); }
.inc-labels dd { margin: 0; overflow-wrap: anywhere; }
.inc-callout { margin: 0; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-left: .1875rem solid var(--warn); border-radius: var(--r-sm); background: var(--warn-soft); font-size: var(--fs-2); max-width: 45rem; }
/* The partners (portfolio) page (Operations workspace). */
.portfolio-users { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.portfolio-users .muted { margin-left: var(--sp-2); }
/* Partner readiness (components/Readiness.tsx) and Activate and Reopen (components/Activate.tsx). */
.readiness-state { padding: var(--sp-3) var(--sp-5); border-radius: var(--r-sm); margin: 0 0 var(--sp-5); }
/* The Activate verdict: one compact line, grey unless something blocks (bad) or nothing would buy yet (warn), note 100. */
.golive-state { padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); margin: 0 0 var(--sp-2); background: var(--panel2); font-size: var(--fs-3); }
.golive-state.warn { background: var(--warn-soft); color: var(--warn); }
.readiness-state.ok, .golive-state.ok { background: var(--ok-soft); color: var(--ok); }
.readiness-state.bad, .golive-state.bad { background: var(--bad-soft); color: var(--bad); }
.readiness-list, .golive-list, .golive-items { list-style: none; margin: 0 0 var(--sp-5); padding: 0; display: grid; gap: var(--sp-3); }
.readiness-item { display: flex; gap: var(--sp-4); align-items: flex-start; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.readiness-item > div { flex: 1; }
/* Ready and not-blocking items grey; tone only on what blocks going live (FQ16). */
.readiness-mark { width: 20px; text-align: center; font-weight: 600; color: var(--muted); }
.readiness-mark.bad { color: var(--bad); }
.readiness-mark.warn { color: var(--warn); }
.golive-list li { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm); border-left: 3px solid var(--line); background: var(--panel); }
.golive-list.bad li { border-left-color: var(--bad); }
.golive-list.warn li { border-left-color: var(--warn); }
.golive-items li.muted { text-decoration: line-through; }
.golive h3 { margin: var(--sp-5) 0 var(--sp-2); }
/* The line items Activate takes along (note 79; compact since note 100): a checklist in words, one line of --row
   each: tick box, name, what it still needs on the right; ready grey, tone only on what blocks or keeps it from buying. */
.li-pick { margin: 0 0 var(--sp-3); }
.li-pick-head { display: flex; align-items: baseline; gap: var(--sp-4); margin: var(--sp-2) 0 var(--sp-1); }
.li-pick-head h5 { margin: 0; font-size: var(--fs-1); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.li-pick-list { list-style: none; margin: 0; padding: 0; }
.li-pick-list li { display: flex; gap: var(--sp-4); align-items: center; min-height: var(--row); padding: 0 var(--sp-2); border-bottom: 1px solid var(--line); font-size: var(--fs-3); }
.li-pick-list li > label { display: flex; align-items: center; gap: var(--sp-3); flex: 1 1 auto; min-width: 0; margin: 0; }
.li-pick-list li > label input { margin: 0; flex: none; }
.li-pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-pick-words { flex: 0 1 auto; color: var(--muted); font-size: var(--fs-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-pick-words.bad { color: var(--bad); }
.li-pick-words.warn { color: var(--warn); }
/* Reopen: what it comes back as, one line of choices (feedback note 107). */
.reopen-as { border: 0; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.reopen-as > legend { padding: 0; margin-bottom: var(--sp-1); }
.reopen-as .checks { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-6); }
.reopen-blocked { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0; }
/* Reviews → Media and Publishers (ADR 0028, SupplyReview.tsx). */
.sr-detail .row { margin: var(--sp-2) 0 var(--sp-4); flex-wrap: wrap; }
.sr-suggestions, .sr-pick { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.sr-suggestions li, .sr-pick li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.sr-pick { max-height: 60vh; overflow: auto; }
.sr-detail td.mono, .sr-detail .mono { overflow-wrap: anywhere; }
/* Phase 2 (SupplyEnrich.tsx): the Identity tab. */
.sr-identity p { margin: 0; }
.sr-identity .table { margin-top: var(--sp-1); }
/* Research suggestions (SupplyResearch.tsx): label, confidence, facts and sources. */
.rs-list { list-style: none; margin: 0 0 var(--sp-5); padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.rs-item { border: 1px solid var(--line); border-left: .1875rem solid var(--accent); border-radius: var(--r-md); background: var(--panel); padding: var(--sp-3) var(--sp-4); }
.rs-item.rejected { border-left-color: var(--line); }
.rs-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.rs-head .pill { margin-left: 0; }
.rs-head .pill.ok { border-color: var(--ok); }
.pill.rs-label { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.rs-target { margin-left: auto; overflow-wrap: anywhere; }
.rs-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-0) var(--sp-5); margin: var(--sp-2) 0; }
.rs-facts dt { color: var(--muted); }
.rs-facts dd { margin: 0; overflow-wrap: anywhere; }
.rs-actions { align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.rs-decided { margin: var(--sp-1) 0 0; }
.rs-soldby { font-style: italic; }
/* The reviews page (Operations workspace). */
.rv-detail { color: var(--fg); overflow-wrap: anywhere; }
.rv-preview { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.rv-preview iframe { max-width: 100%; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--panel2); }
/* Dynamic creative (ADR 0025). */
.dco h3 { font-size: var(--fs-2); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: var(--sp-6) 0 var(--sp-2); }
.dco-slot, .dco-rule { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin: var(--sp-2) 0; background: var(--panel2); }
.dco-when { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); align-items: center; margin: var(--sp-2) 0 0; }
.dco .bad { color: var(--bad); }
.pill.ok { border-color: var(--ok); color: var(--ok); }
.dco-rule .order { background: var(--accent); color: var(--accent-fg); border-radius: var(--r-md); font-size: var(--fs-0); min-width: 1rem; text-align: center; padding: 0 var(--sp-1); }

.swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: var(--r-xs); border: 1px solid var(--line); vertical-align: middle; }
.table.matrix td { vertical-align: top; min-width: 13.75rem; }

.card.risk { border-color: var(--bad); }

/* Operations › Devices (the device tier table) and Users › Assistant tokens (ADR 0045). */
.pill.tier-0 { color: var(--muted); }
.pill.tier-1 { border-color: var(--line); }
.pill.tier-2 { border-color: var(--accent); color: var(--accent); }
.pill.tier-3 { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.pill.tier-4 { border-color: var(--ok); color: var(--panel); background: var(--ok); }
.form .plan { margin-top: var(--sp-5); padding: var(--sp-4) var(--sp-5); }
.form .plan h3 { margin: 0 0 var(--sp-2); }
.form .plan .warn { color: var(--warn); }
.token-once { padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); overflow-wrap: anywhere; white-space: pre-wrap; user-select: all; }
/* Media packages (ADR 0049 §2): Operations › Targeting › Media & content › Sets (TG step 7). */
.mp-warn { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-5); border: 1px solid var(--warn); border-radius: var(--r-sm); background: var(--warn-soft); color: var(--warn); }
.mp-over { color: var(--bad); }
.mp-hits, .mp-entries { list-style: none; margin: var(--sp-1) 0 var(--sp-5); padding: 0; }
.mp-hits li, .mp-entries li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-1) 0; border-bottom: 1px solid var(--line); }
.mp-entries li .btn { margin-left: auto; }
.mp-entries { max-height: 22rem; overflow-y: auto; }
/* Supply: Publishers and Media (Operations workspace): the Details tab, the Performance tabs and the ad slots. */
.sup-perf h3, .sup-slot h3 { margin: var(--sp-1) 0 var(--sp-2); font-size: var(--fs-4); }
.sup-perf > section > .sel { margin-bottom: var(--sp-2); }
.sup-diag { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); max-width: 56.25rem; }
.sup-diag li { display: flex; gap: var(--sp-4); align-items: baseline; padding: var(--sp-2) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.sup-diag .pill { margin: 0; flex: none; min-width: 4.5rem; text-align: center; }
.sup-diag .pill.ok { background: var(--ok-soft); }
.sup-diag .pill.info { color: var(--muted); }
.sup-slot { border-top: 1px solid var(--line); padding-top: var(--sp-3); }
/* The detail's Details tab (feedback #74): the record's facts, then each section with a short heading. */
.sup-details > .facts { margin: 0 0 var(--sp-6); }
.sup-details > section + section { margin-top: var(--sp-6); }
.sup-details h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-3); font-weight: 600; }
.sup-details section > .dg + * { margin-top: var(--sp-3); }

/* Unique users (ADR 0038): the estimate with the counted users under it (Operations). */
.uq-cell { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }

/* A context's unique users in its detail (Operations › Targeting › Context): yesterday and the period side by side. */
.uq-ctx { display: inline-flex; gap: 1.5em; flex-wrap: wrap; align-items: flex-start; }
.uq-ctx > span { display: inline-flex; gap: .4em; align-items: baseline; }
/* The Traffic quality page (Operations workspace, BACKLOG 0k). */
.tq .card .body > p:first-child { margin-top: 0; }
.tq .dg { max-height: 26.25rem; }
.tq > p.muted, .tq-lead { margin: 0 0 var(--sp-3); flex: none; max-width: 75rem; }
.tq-lead p { margin: 0; }
.tq-tiles { grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); flex: none; }
.tq-own-form { align-items: flex-end; gap: var(--sp-5); }
.tq-own-form .field { min-width: 18rem; }
/* Click review (ADR 0044). */
.tq-proposals { list-style: none; margin: 0; padding: 0; }
.tq-proposals li { gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tq-proposals li:last-child { border-bottom: 0; }
.tq-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: var(--sp-5); }
.tq-groups h3 { margin: 0 0 var(--sp-1); }
.tq-groups ul { margin: 0; padding-left: var(--sp-6); }
.tq-bulk { gap: var(--sp-3); flex: none; flex-wrap: wrap; }
/* The click guard on a campaign (ADR 0044). */
.guard-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); background: var(--panel); }
.guard-card + .guard-card { margin-top: var(--sp-5); }
.guard-head { gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.guard-head h3 { margin: 0; }
.guard-reason { margin: var(--sp-3) 0; }
.guard-settings { margin-top: var(--sp-3); }
/* Post-bid and the supply-chain switch (F13). The switch is on = no bid: a warning colour. */
.tq-note { margin: 0; }
.tq-switch { gap: var(--sp-2); align-items: center; flex-wrap: nowrap; }
.tq-toggle { position: relative; flex: none; width: 2.125rem; height: 1.125rem; padding: 0; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--panel2); cursor: pointer; }
.tq-toggle i { position: absolute; top: 1px; left: 1px; width: .875rem; height: .875rem; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); box-sizing: border-box; transition: left .15s; }
.tq-toggle[aria-checked="true"] { background: var(--warn); border-color: var(--warn); }
.tq-toggle[aria-checked="true"] i { left: 1.0625rem; border-color: var(--warn); }
.tq-toggle:disabled { cursor: not-allowed; opacity: .6; }
.tq-more summary { cursor: pointer; font-weight: 600; }
.tq-more[open] summary { margin-bottom: var(--sp-3); }
.tq-more .dg { max-height: 18rem; }
/* The money page (Operations workspace). */
.pill.money-closed { color: var(--muted); }
.pill.money-closable { border-color: var(--accent); color: var(--accent); }
.pill.money-open { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.money-actions { white-space: nowrap; }
.money-actions .btn + .btn { margin-left: var(--sp-1); }
.money-text { white-space: normal; }
.money-off { color: var(--bad); font-weight: 600; }
/* Console usage analytics (docs/console-analytics.md): the Usage page, the privacy notice, the profile's Privacy tab. */
.usage-tiles { grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr)); }
.usage-bad { color: var(--bad); font-weight: 600; }
.usage-panel { overflow: auto; }
.usage-target { max-width: 17.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-bar { display: inline-block; vertical-align: middle; width: 7.5rem; height: .5rem; border-radius: var(--r-xs); background: var(--line); overflow: hidden; }
.usage-bar i { display: block; height: 100%; background: var(--accent); }
.usage-notice { position: fixed; z-index: var(--z-notice); left: 1rem; bottom: 1rem; max-width: min(27.5rem, calc(100vw - 2rem)); background: var(--panel); border: 1px solid var(--line); border-left: .1875rem solid var(--accent); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); box-shadow: var(--shadow); font-size: var(--fs-grid); }
.usage-notice p { margin: 0 0 var(--sp-3); }
.usage-notice .row { justify-content: flex-end; flex-wrap: wrap; }
.usage-privacy h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-4); }
.usage-privacy .field { margin-top: var(--sp-4); }
/* Client service workspace (views/csm/Clients.tsx) and the platform health on My clients (components/PlatformHealth.tsx). */
.csm-why { margin: var(--sp-5) 0 0; padding-left: var(--sp-6); font-size: var(--fs-3); }
.csm-why li { margin: var(--sp-0) 0; }

/* Calm: a dot and a word; colour only in the dot. */
.health { position: relative; }
.health-btn { display: inline-flex; align-items: center; gap: var(--sp-2); font: inherit; font-size: var(--fs-2); color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2px var(--sp-4); white-space: nowrap; cursor: pointer; }
.health-btn:hover { border-color: var(--accent); color: var(--fg); }
.health-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); display: inline-block; }
.health-btn.h-ok .health-dot { background: var(--ok); }
.health-btn.h-warn .health-dot { background: var(--warn); }
.health-btn.h-bad .health-dot { background: var(--bad); }
.health-btn.h-bad { color: var(--fg); }
.health-pop { font-size: var(--fs-3); }
.health-pop p { margin: 0; }
.health-pop ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-6); }
.health-sub { margin-top: var(--sp-4); font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
/* Proposals: the list, the steps, the document and the fine-tune panel. */
.eyebrow { font-size: var(--fs-1); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.prhero { display: flex; gap: var(--sp-6); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: var(--sp-6) var(--sp-7); margin-bottom: var(--sp-6); border: 1px solid var(--line); border-radius: var(--r-md); background: linear-gradient(120deg, var(--panel), var(--panel2)); }
.prhero h2 { margin: 0 0 var(--sp-1); font-size: var(--fs-7); }
.prsteps { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 var(--sp-6); }
.prsteps button { display: inline-flex; align-items: center; gap: var(--sp-3); border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: var(--r-pill); padding: var(--sp-1) var(--sp-5) var(--sp-1) var(--sp-1); font-size: var(--fs-3); }
.prsteps button span { display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--panel2); font-size: var(--fs-2); font-weight: 600; }
.prsteps button.done { color: var(--fg); }
.prsteps button.done span { background: var(--ok-soft); color: var(--ok); }
.prsteps button.on { color: var(--fg); border-color: var(--accent); font-weight: 600; }
.prsteps button.on span { background: var(--accent); color: var(--accent-fg); }
.prsteps button:disabled { cursor: default; }
.prpaste { display: grid; gap: var(--sp-4); max-width: 51.25rem; }
.prpaste textarea { width: 100%; font: inherit; }
.savebadge { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-2); padding: var(--sp-1) var(--sp-4); border-radius: var(--r-pill); border: 1px solid var(--line); white-space: nowrap; }
.savebadge.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.savebadge.saving { color: var(--muted); }
.savebadge.bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.savebadge .linklike { padding: 0; color: inherit; text-decoration: underline; font-weight: 600; }
.prgrid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--sp-7); align-items: start; }
.prq { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); margin-bottom: var(--sp-4); background: var(--panel); display: grid; gap: var(--sp-2); }
.prq.done { border-color: var(--ok); }
.prchoices { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-1) 0 var(--sp-3); }
.prchoices .chip { cursor: pointer; }
.prdraft, .prtune { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--sp-7); align-items: start; }
.prdone, .prpanel { position: sticky; top: .75rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: var(--sp-5); display: grid; gap: var(--sp-4); }
.prdone h3, .pp-block h3 { margin: 0 0 var(--sp-2); font-size: var(--fs-4); }
.prdone ul { margin: 0; padding-left: var(--sp-6); display: grid; gap: var(--sp-1); font-size: var(--fs-3); }
.prpanel { max-height: calc(100vh - 1.5rem); overflow: auto; gap: 0; padding: 0; }
.pp-block { padding: var(--sp-5); border-bottom: 1px solid var(--line); display: grid; gap: var(--sp-2); }
.pp-block:last-child { border-bottom: 0; }
.pp-l { display: grid; gap: var(--sp-0); font-size: var(--fs-2); color: var(--muted); flex: 1; }
.pp-block textarea { width: 100%; font: inherit; }
.prversions { margin: 0; padding-left: 0; list-style: none; display: grid; gap: var(--sp-1); font-size: var(--fs-2); max-height: 16.25rem; overflow: auto; }
.prversions .linklike { padding: 0; }
/* The document */
.pdoc { border: 1px solid var(--line); border-radius: calc(var(--r-md) * 2); background: var(--panel); overflow: hidden; }
.pdoc-hero { padding: var(--sp-8) var(--sp-8) var(--sp-7); background: radial-gradient(circle at 85% 0%, var(--sel), transparent 60%), var(--panel2); border-bottom: 1px solid var(--line); }
.pdoc-hero h2 { margin: var(--sp-2) 0 var(--sp-3); font-size: var(--fs-9); line-height: 1.2; }
.pdoc-hero .lede { margin: 0 0 var(--sp-5); font-size: var(--fs-5); color: var(--fg); max-width: 70ch; }
.pmeta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.pmeta span { border: 1px solid var(--line); border-radius: var(--r-pill); padding: 2px var(--sp-4); font-size: var(--fs-2); background: var(--panel); }
.pkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.pkpis div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); display: grid; gap: 2px; }
.pkpis b { font-size: var(--fs-8); font-variant-numeric: tabular-nums; }
.pkpis span { font-size: var(--fs-2); color: var(--muted); }
.psec { padding: var(--sp-7) var(--sp-8); border-bottom: 1px solid var(--line); }
.psec.hidden { background: repeating-linear-gradient(135deg, transparent 0 .625rem, var(--panel2) .625rem 1.25rem); }
.psec-head { display: flex; gap: var(--sp-4); align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.psec-head h3 { margin: 0; font-size: var(--fs-5); }
.psec-tools { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.psec-ask { display: inline-flex; gap: var(--sp-1); }
.psec-ask input { width: 13.75rem; font-size: var(--fs-2); }
.pdoc-foot { padding: var(--sp-5) var(--sp-8); font-size: var(--fs-2); color: var(--muted); }
.pv { transition: background-color .6s; border-radius: var(--r-xs); }
.pv.chg { background: var(--warn-soft); box-shadow: 0 0 0 2px var(--warn-soft); }
.ptext { outline: none; border-radius: var(--r-xs); cursor: text; }
.editing .ptext { box-shadow: inset 0 -1px 0 var(--line); }
.editing .ptext:hover, .ptext:focus { background: var(--sel); }
.ptext:empty::before { content: attr(data-placeholder); color: var(--muted); }
.pgoal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--sp-6); align-items: center; }
.pgoal .big { font-size: var(--fs-6); font-weight: 600; margin: var(--sp-1) 0 0; }
.pkpi { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.pkpi li { display: grid; background: var(--panel2); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.pkpi b { font-size: var(--fs-7); font-variant-numeric: tabular-nums; }
.pkpi span { font-size: var(--fs-2); color: var(--muted); }
.pdata { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.pdata li { display: grid; grid-template-columns: 8.125rem minmax(0, 1fr); gap: 2px var(--sp-5); }
.pdata li > .small { grid-column: 2; }
.pfc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.pfc-note { grid-column: 1 / -1; margin: 0; }
.pfct { width: 100%; border-collapse: collapse; font-size: var(--fs-3); }
.pfct th, .pfct td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); text-align: left; }
.pfct .num { text-align: right; font-variant-numeric: tabular-nums; }
.pfct small { display: block; color: var(--muted); font-weight: 400; font-size: var(--fs-1); }
.prcurve { width: 100%; height: auto; }
.prc-grid { stroke: var(--line); }
.prc-t { fill: var(--muted); font-size: var(--fs-0); }
.prc-area { fill: var(--accent); opacity: .12; }
.prc-line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.prc-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 3; }
.pideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: var(--sp-5); }
.pidea { margin: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--panel); }
.pidea.off { border-style: dashed; background: var(--input); }
.pidea-tpl { height: 4.375rem; display: grid; place-items: center; background: linear-gradient(135deg, var(--panel2), var(--sel)); font-family: var(--mono); font-size: var(--fs-2); color: var(--muted); }
.pidea figcaption { padding: var(--sp-4) var(--sp-5); display: grid; gap: var(--sp-1); font-size: var(--fs-3); }
.pidea figcaption p { margin: 0; }
.penv { display: grid; gap: var(--sp-5); }
.papps { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.appchip { border-radius: var(--r-md); padding: var(--sp-0) var(--sp-3); font-size: var(--fs-2); background: var(--panel2); border: 1px solid var(--line); }
.pgarm { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); gap: var(--sp-2) var(--sp-6); }
.pgarm li { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; font-size: var(--fs-3); }
.pgarm small { color: var(--muted); }
.pgarm select { font-size: var(--fs-2); max-width: 10.625rem; }
.tl-bar { display: flex; gap: var(--sp-1); }
.tl-seg { display: grid; gap: 2px; padding: var(--sp-4) var(--sp-5); background: var(--panel2); border-left: .1875rem solid var(--accent); border-radius: var(--r-xs); font-size: var(--fs-2); min-width: 0; }
.tl-seg em { font-style: normal; font-weight: 600; }
.prclientwrap { display: grid; gap: var(--sp-5); max-width: 61.25rem; }
.prsharebar { display: flex; gap: var(--sp-4); align-items: center; flex-wrap: wrap; padding: var(--sp-5) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel2); }
.prsharebar > div { flex: 1; min-width: 12.5rem; }
@media (max-width: 1000px) {
  .prgrid, .prdraft, .prtune, .pfc, .pgoal { grid-template-columns: minmax(0, 1fr); }
  .prdone, .prpanel { position: static; max-height: none; }
  .pkpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .psec, .pdoc-hero { padding-left: var(--sp-6); padding-right: var(--sp-6); }
}
.prsteps button.skip { color: var(--muted); text-decoration: line-through; }
.page-head h1 .ptext:hover, .page-head h1 .ptext:focus { background: var(--sel); }
.prshare { display: grid; grid-template-columns: 23.75rem minmax(0, 1fr); gap: var(--sp-7); align-items: start; }
.prshare-side { display: grid; gap: var(--sp-5); position: sticky; top: .75rem; }
.prshare-side .card { padding: var(--sp-5); }
.prlink { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2); margin-top: var(--sp-4); }
.prlink input { font-family: var(--mono); font-size: var(--fs-2); }
.prlink p { grid-column: 1 / -1; margin: 0; }
.pranswers { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.pranswers li { border-left: .1875rem solid var(--line); padding: var(--sp-1) var(--sp-4); }
.pranswers li.accept { border-color: var(--ok); }
.pranswers li.changes { border-color: var(--warn); }
.pranswers p { margin: var(--sp-1) 0 0; white-space: pre-wrap; }
.prpreview { margin: 0; display: grid; gap: var(--sp-3); }
.prpreview figcaption { display: flex; gap: var(--sp-2); align-items: baseline; }
.prpreview iframe { width: 100%; min-height: 56.25rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
@media (max-width: 1100px) { .prshare { grid-template-columns: minmax(0, 1fr); } .prshare-side { position: static; } }
.prlinks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
.prlinks li { display: grid; gap: var(--sp-0); justify-items: start; padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line); }
.prlinks li:last-child { border-bottom: 0; padding-bottom: 0; }


/* The proposal stage (ADR next-proposals-as-campaign-stage §8): formats and sizes on a line item, the Book dialog,
   the client's answer, the answers on the share links, the history, and the requirements on the wizard's last step. */
/* Expected formats (walk E33): one compact row per format, the name, its size chips and a custom size inline. */
.fmt-list { display: grid; gap: var(--sp-2); margin-top: var(--sp-2); }
.fmt-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); padding: var(--sp-2) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.fmt-name { font-weight: 600; font-size: var(--fs-3); min-width: 9rem; }
.fmt-suggest { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); }
.fmt-bad { flex-basis: 100%; margin: 0; }
.fmt-derived { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: var(--sp-1); }
.pr-book { display: grid; gap: var(--sp-6); }
.pr-book h4, .pr-answer h4 { margin: 0 0 var(--sp-2); font-size: var(--fs-4); }
.pr-book fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.pr-book textarea, .pr-answer textarea { width: 100%; font: inherit; }
.pr-answer { display: grid; gap: var(--sp-3); margin-top: var(--sp-6); padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.pr-answer .row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pr-answers, .pr-history { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); font-size: var(--fs-3); }
.pr-answers li, .pr-history li { padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.pr-answers li:last-child, .pr-history li:last-child { border-bottom: 0; }
.pr-history li .muted { display: inline-block; min-width: 9rem; margin-right: var(--sp-3); }
.wz-reqs { margin-top: var(--sp-7); }
.wz-reqs h3 { margin: 0 0 var(--sp-3); font-size: var(--fs-4); }

.fmt-add { display: inline-flex; align-items: center; gap: var(--sp-1); }
.fmt-choice .fmt-add input { width: 5rem; max-width: 5rem; }

/* Proposals awaiting action on the Campaigns dashboard (P5-F3b): one grey line in the page head, opened for the list. */
.pr-attention.compact { margin: var(--sp-2) 0 0; font-size: var(--fs-3); }
.pr-attention.compact > summary { cursor: pointer; color: var(--muted); width: fit-content; }
.pr-attention.compact[open] > summary { margin-bottom: var(--sp-2); }
/* The support bar in the top bar, and its panel. */
.scroller { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.assistant { position: relative; flex: 1; min-width: 11.25rem; max-width: 48rem; }
.as-bar { display: flex; align-items: center; gap: var(--sp-2); border: 1px solid var(--line); background: var(--panel2); border-radius: var(--r-sm); padding: 0 var(--sp-3); }
.as-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 .1875rem var(--sel); }
.as-bar input { flex: 1; width: auto; max-width: none; border: 0; background: transparent; padding: var(--sp-3) 0; font-size: var(--fs-4); box-shadow: none; outline: none; color: var(--fg); min-width: 0; }
.as-glyph { color: var(--accent); font-size: var(--fs-5); }
.as-kbd { font: var(--fs-1) var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 1px var(--sp-2); }
.as-list { position: absolute; left: 0; right: 0; top: calc(100% + .375rem); margin: 0; padding: var(--sp-2); list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
.as-list li { display: flex; gap: var(--sp-5); align-items: baseline; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-4); }
.as-list li.on { background: var(--sel); }
.as-list li.as-empty { cursor: default; color: var(--muted); }
.as-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-hint { color: var(--muted); font-size: var(--fs-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; text-align: right; }
.as-icon { display: inline-block; width: 1.125rem; color: var(--muted); }
/* Opened over a sheet or dialog (Assistant.tsx sets data-above-layers): above it, never behind (R5). */
.as-panel[data-above-layers] { z-index: var(--z-modal); }
.as-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(28.75rem, 100vw); z-index: var(--z-panel); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-sheet); }
.as-panel-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--line); }
.as-panel-body { flex: 1; overflow: auto; padding: var(--sp-6); display: grid; gap: var(--sp-6); align-content: start; }
.as-q { margin: 0; font-weight: 600; background: var(--panel2); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-5); justify-self: end; }
.as-exchange { display: grid; gap: var(--sp-3); }
.as-answer, .as-training h3 { margin: 0; font-size: var(--fs-5); }
.as-training p { margin: 0; }
.as-training { display: grid; gap: var(--sp-3); font-size: var(--fs-4); line-height: 1.5; }
.as-md p { margin: 0 0 var(--sp-3); }
.as-md p:last-child { margin-bottom: 0; }
.as-md ul, .as-md ol { margin: 0 0 var(--sp-3); padding-left: var(--sp-7); }
.as-md h4 { margin: var(--sp-3) 0 var(--sp-1); }
.as-steps { margin: 0; padding-left: var(--sp-7); display: grid; gap: var(--sp-2); }
.as-steps li .btn { margin-left: var(--sp-3); }
.as-sources { margin: 0; color: var(--muted); }
.as-sources .linklike { padding: 0; font-size: inherit; }
.as-follow { display: flex; gap: var(--sp-3); padding: var(--sp-5) var(--sp-6); border-top: 1px solid var(--line); }
.as-follow input { flex: 1; max-width: none; }
.as-foot { padding: var(--sp-3) var(--sp-6) var(--sp-5); }
.as-thinking::after { content: ' ●'; animation: as-pulse 1s infinite; }
@keyframes as-pulse { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .as-thinking::after { animation: none; } }
.as-article h2 { margin: var(--sp-2) 0 var(--sp-4); font-size: var(--fs-7); }
.as-article h3 { font-size: var(--fs-4); margin: var(--sp-5) 0 var(--sp-2); }
.as-article { font-size: var(--fs-4); line-height: 1.55; }
.as-lessons { display: flex; gap: var(--sp-2); }
.as-lessons button { width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--fg); font-size: var(--fs-2); }
.as-lessons button.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.as-lessons button.done { background: var(--ok-soft); color: var(--ok); }
.as-lesson { display: grid; gap: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-5); }
.as-lesson h4 { margin: 0; }
.as-check { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-5); display: grid; gap: var(--sp-2); }
.as-check legend { font-weight: 600; padding: 0 var(--sp-1); }
.as-opt { display: flex; gap: var(--sp-3); align-items: center; margin: 0; font-size: var(--fs-4); color: var(--fg); }
.as-opt input { width: auto; margin: 0; }
.as-opt.right { color: var(--ok); font-weight: 600; }
.as-opt.wrong { color: var(--bad); }
.as-right { color: var(--ok); }
.as-wrong { color: var(--bad); }
@media (max-width: 700px) { .as-kbd { display: none; } .topbar { padding: var(--sp-3) var(--sp-5); } }

/* ERP pages over the whole width (the prototype): heading and filters padded, the grid edge to edge. */
.page.fill { padding: 0; }
.page.fill > .page-head { padding: var(--sp-4) var(--sp-6) var(--sp-2); margin: 0; }
.page.fill > :not(.page-head):not(.md):not(.ov-back):not(.modal-back) { margin-left: var(--sp-6); margin-right: var(--sp-6); }
.page-note { margin-top: 0; margin-bottom: var(--sp-3); }
.page.fill .md { border: 0; border-top: 1px solid var(--line); border-radius: 0; margin: 0; }
.page.fill .md-split { background: var(--bg); }
/* One vertical edge (§3.8): the head, the grid's toolbar, its first column and the detail start on the page gutter. */
.page.fill .md-master .dg-toolbar, .page.fill .md-detail > .detail { padding-left: var(--sp-6); padding-right: var(--sp-6); }
.page.fill .md-master .dg-table tr > :first-child { padding-left: var(--sp-6); }
/* Small controls on the grid's toolbar line, one height. */
.dg-toolbar :is(input:not([type=checkbox], [type=radio]), select:not([size], [multiple])) { height: var(--ctl-sm); font-size: var(--fs-2); }

/* structured inputs (budget segments, frequency cap, formats, seats) */
.segs { display: grid; gap: var(--sp-2); }
/* The placement picker's search results (ADR 0037 phase 2). */
.pl-pick { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); max-height: 14rem; overflow-y: auto; }
.pl-pick li { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.seg-row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.seg-row input[type=number], .seg-row input.num-in { width: 8.125rem; }
/* A typed number (NumberInput, notes 117 and 118): right-aligned like the figures it becomes; refused text in red. */
input.num-in { text-align: right; font-variant-numeric: tabular-nums; }
input.num-in[aria-invalid=true] { border-color: var(--bad); }
.seg-row input[type=date] { width: 9.375rem; }
/* A line item's flights (ADR 0030): rows that scroll sideways on a phone. */
.flights .tscroll { overflow-x: auto; }
.flights .table.lines { min-width: 30rem; }
.flights .table.lines input[type=date] { width: 9.375rem; }
.flights .table.lines td.num input { width: 7.5rem; text-align: right; }
.capin select { width: auto; }
.seats { display: grid; gap: var(--sp-2); }
.seat-x { width: 10rem; font-size: var(--fs-2); }
.chips label.chip { display: inline-flex; gap: var(--sp-2); align-items: center; margin: 0; color: var(--fg); font-size: var(--fs-2); }

/* the wizard's steps and review */
.steps { display: flex; gap: var(--sp-2); margin: 0 0 var(--sp-6); flex-wrap: wrap; }
.step { font-size: var(--fs-2); padding: var(--sp-0) var(--sp-4); border-radius: var(--r-lg); border: 1px solid var(--line); color: var(--muted); background: var(--panel); }
.step.on { border-color: var(--accent); color: var(--fg); background: var(--accent-soft); font-weight: 600; }
.step.done { color: var(--ok); border-color: var(--ok); }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(18.75rem, 1fr)); gap: var(--sp-6); align-items: start; }
.wz-review h3:first-child { margin-top: 0; }
/* The review fits the sheet: nothing in it is wider than the sheet (a wide table scrolls inside its own box). */
.wz-review, .wz-review .rv, .wz-review .rv > * { min-width: 0; max-width: 100%; }
.wz-review .dg-scroll { max-width: 100%; }
.grants { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
/* forms in overlays: fields in columns, the large ones over the whole width */
.ov-body .embedded .card.form > .body { display: grid; grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr)); gap: var(--sp-field) var(--sp-6); align-items: start; }
.ov-body .embedded .card.form > .body > :is(.row, .error-box, p, textarea),
.ov-body .embedded .field:has(textarea, .checks, .segs, .chips, .seats, .capin, .grant, table) { grid-column: 1 / -1; }
.prsummary-frame { width: 100%; height: 40rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
/* the time zone a date counts in (feedback #41) */
.zone-hint { color: var(--muted); font-size: var(--fs-1); }
.row > .zone-hint, .seg-row ~ .zone-hint { align-self: center; }
/* entity forms in sections (feedback #44/#45): the wizard's steps and the New/Edit overlays */
.fsec-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-field) var(--sp-6); align-items: start; }
.fsec-body > .field { margin: 0; min-width: 0; }
.fsec-body > .field:has(textarea, .checks, .segs, .chips, .seats, .capin, .grant, table, .seg-row) { grid-column: 1 / -1; }
.fsec-body > label, .fsec-body > input[name=id] { grid-column: auto; }
/* The political declaration takes the whole row, so creative brand approval sits below it on its own row (R2 item 5). */
.fsec-body > .field:is([data-field=politicalAds], [data-field=brandApproval]) { grid-column: 1 / -1; }
.eform { display: flex; flex-direction: column; gap: var(--sp-1); }
.fsec { padding: var(--sp-4) 0 var(--sp-5); border-top: 1px solid var(--line); scroll-margin-top: 2.5rem; }
.fsec:first-of-type { border-top: 0; padding-top: var(--sp-1); }
.fsec > h3 { margin: 0 0 var(--sp-section); font-size: var(--fs-2); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fsec-nav { position: sticky; top: -1rem; z-index: var(--z-sticky); display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); padding: var(--sp-3) 0; margin-top: calc(-1 * var(--sp-3)); background: var(--panel); border-bottom: 1px solid var(--line); font-size: var(--fs-2); }
.fsec-nav a { color: var(--muted); text-decoration: none; }
/* A focused field scrolls clear of the sticky section nav (WCAG 2.4.11). */
.field { scroll-margin-top: 3rem; }
.fsec-nav a:hover, .fsec-nav a:focus-visible { color: var(--accent); }
.fsubs { display: flex; flex-direction: column; gap: var(--sp-2); }
.fsub { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-4); }
.fsub > summary { cursor: pointer; display: flex; gap: var(--sp-4); align-items: baseline; flex-wrap: wrap; }
.fsub > summary b { font-size: var(--fs-3); }
.fsub[open] > summary { margin-bottom: var(--sp-2); }
.form-errors ul { margin: var(--sp-1) 0 0 var(--sp-6); padding: 0; }
.ov-body .embedded .card.form > .body:has(> .eform), .ov-body .embedded .card.form > .body:has(> .fsec-body) { display: block; }
@media (max-width: 760px) { .fsec-body { grid-template-columns: 1fr; } }
/* Campaign wizard rework phase A (owner feedback 2026-10-13). */
/* The steps in the overlay's fixed strip (.ov-sub): always in view. */
.ov-sub .steps { margin: 0; }
/* The name on its own full-width line: names can be long. */
.fsec-body > .field[data-field=displayName] { grid-column: 1 / -1; }
.fsec-body > .field[data-field=displayName] > input { max-width: none; }
/* Dates easier to read and hit. */
.fsec-body input[type=date], .seg-row input[type=date] { font-size: var(--fs-5); padding: var(--sp-2) var(--sp-4); min-width: 11.5rem; }
/* Run dates with their (fixed) time, larger and with a larger calendar button (feedback note 3). */
.date-time { display: flex; gap: var(--sp-2); align-items: center; }
.date-time > .date-in { min-width: 13rem; flex: 1 1 13rem; max-width: 16rem; --date-pad: var(--sp-5); }
.date-time > .date-in > input[type=date] { font-size: var(--fs-5); padding: var(--sp-3) var(--sp-5); width: 100%; }
.date-time > .date-in > input[type=date]::-webkit-calendar-picker-indicator { width: 1.25rem; height: 1.25rem; cursor: pointer; }
/* An empty date (DateInput, feedback note 119): the browser's mask hidden, "--/--/----" in muted instead. */
.date-in { position: relative; display: inline-flex; --date-pad: var(--sp-4); }
.date-in[data-empty]:not(:focus-within) > input[type=date] { color: transparent; }
.date-in[data-empty]:not(:focus-within)::after { content: attr(data-placeholder); position: absolute; top: 0; bottom: 0; left: calc(var(--date-pad) + 1px); display: flex; align-items: center; color: var(--muted); pointer-events: none; letter-spacing: .08em; }
.date-time > .date-time-t { font-size: var(--fs-5); padding: var(--sp-3) var(--sp-3); width: 6.5rem; flex: 0 0 auto; color: var(--muted); }
.seg-row input[type=date] { width: 11.5rem; }
/* The main goal as wide as a secondary KPI's choice. */
.goal-input > select, .kpi-row > select { width: 16rem; max-width: 100%; }
.kpi-unit { min-width: 2rem; }
/* An amount with its currency beside it. */
.money-in { display: flex; gap: var(--sp-2); align-items: center; }
.money-in > input { max-width: 12rem; }
/* The advertiser search box (components/AdvertiserPicker.tsx). */
.combo { position: relative; max-width: 26.25rem; }
.combo-list { position: absolute; z-index: var(--z-list); left: 0; right: 0; top: calc(100% + 2px); margin: 0; padding: var(--sp-1) 0; list-style: none; max-height: 16rem; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.combo-list > li { padding: var(--sp-1) var(--sp-4); cursor: pointer; }
.combo-list > li.on { background: var(--accent-soft); }
.combo-list > li[aria-selected=true] { font-weight: 600; }
.combo-list > li.combo-empty { cursor: default; }
.combo-list > li.combo-new { border-top: 1px solid var(--line); color: var(--accent); }
/* The advertiser over the whole width (names can be long), so the run dates
   that follow sit side by side on one row (feedback note 2). */
.fsec-body > .field.adv-pick { grid-column: 1 / -1; }
.fsec-body > .field.adv-pick .combo { max-width: none; }
.combo-list > li.combo-group { cursor: default; padding-top: var(--sp-3); font-weight: 600; }
.combo-list > li.in-group { padding-left: var(--sp-7); }
.combo-list > li.off { color: var(--muted); cursor: not-allowed; }
/* Inactive advertisers (ADR 0050 §1a): in lists, details and the picker. */
.pill.adv-inactive { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.adv-inactive-note { margin-top: var(--sp-1); max-width: 40rem; }
/* The political-advertising declaration (components/PoliticalDeclaration.tsx). */
.political-note, .political-check, .political-declared { margin-top: var(--sp-1); max-width: 40rem; }
/* Who gains or loses access when an advertiser changes group (ADR 0050 §3). */
.access-change { max-width: 36rem; }
.access-change-list ul { margin: var(--sp-1) 0 var(--sp-3); padding-left: var(--sp-7); }
.adv-new { margin-top: var(--sp-3); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel2); }
.adv-new h4 { margin: 0 0 var(--sp-2); font-size: var(--fs-3); }
.adv-new-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--sp-1) var(--sp-5); }
.adv-new-fields > .field { margin: 0; }
.wz-ids { margin: var(--sp-5) 0 0; }
/* Fields with a problem (feedback note 4): outlined, the message beside the
   label, and the "Please fix" items as links to them. */
.field.invalid > label { color: var(--bad); font-weight: 600; }
.field.invalid :is(input:not([type=checkbox]):not([type=radio]):not([disabled]), select, textarea) { border-color: var(--bad); box-shadow: 0 0 0 .1875rem var(--bad-soft); }
.field.invalid > .err { font-size: var(--fs-2); margin: 0 0 var(--sp-0); }
.form-errors .err-link { padding: 0; font-size: inherit; color: inherit; text-align: left; }
/* The main goal's price target and how it counts (feedback note 8). */
.goal-target { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-8); align-items: flex-start; }
.goal-target > .goal-price { display: flex; flex-direction: column; gap: var(--sp-1); }
.goal-mode { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.goal-mode > legend { padding: 0; margin-bottom: var(--sp-1); }
/* The contract step (note 7): the PO beside the advertiser's row end, the run dates together on the next row. */
.fsec-body > .field[data-field="campaignFlight.startDate"] { grid-column: 1; }
.wz-perday { margin: var(--sp-1) 0 0; }
.wz-rules { margin: var(--sp-1) 0 0 var(--sp-6); padding: 0; font-size: var(--fs-3); }
/* Feedback batch 2 (notes 16, 18, 22, 27, 29). */
.goal-row { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); align-items: center; }
.goal-row > .goal-pick { display: inline-flex; align-items: center; }
.goal-row .goal-price > input { width: 7.5rem; }
/* The Target · Maximum control and its (i) on one line at every text size (feedback note 103: the base .goal-mode is a column). */
.goal-row .goal-mode { display: inline-flex; flex-direction: row; flex-wrap: nowrap; align-items: center; }
.goal-row .goal-mode .seg { margin-left: 0; }
/* Walk finding 8: the price target, its unit and Target · Maximum stay together (the group moves to the next line as a whole); the label sits on the input's line. */
.goal-row .goal-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.goal-row .goal-price > label { margin: 0; }
.goal-row .goal-price > .muted { white-space: nowrap; }
.fsec-body > .field[data-field=invoice] { grid-column: 1 / -1; }
.cb .form-grid { display: block; }
/* The invoice choice: one option per line, left-aligned, its text on one line (note 33). */
.cb .cb-choices { display: flex; flex-direction: column; gap: var(--sp-1); align-items: flex-start; }
.cb .cb-choices > label.check { margin: 0; display: inline-flex; gap: var(--sp-2); align-items: center; white-space: nowrap; }
/* The rate card over the whole width, its full name shown (note 32). */
.fsec-body > .field[data-field=pricingOption] { grid-column: 1 / -1; }
.fsec-body > .field[data-field=pricingOption] .po-choice { width: 100%; }
/* The (i) of Target / Never higher beside it (note 34). */
.goal-row .goal-mode { flex-wrap: nowrap; white-space: nowrap; }
.ov-back .ov-back { background: transparent; }
.lit-status { font-size: var(--fs-2); padding: var(--sp-0) var(--sp-1); width: auto; }
/* Feedback batch 4. One height for every control in a form, centred
   (note 41): text, number, date and time inputs, selects and the segmented
   choices. */
.fsec-body :is(input:not([type=checkbox]):not([type=radio]):not([type=color]), select),
.fsec-body .seg > button { height: 2.25rem; box-sizing: border-box; padding-top: 0; padding-bottom: 0; line-height: 2.25rem; font-size: var(--fs-4); }
.fsec-body .seg { align-items: stretch; height: 2.25rem; box-sizing: border-box; }
.fsec-body .seg > button { line-height: calc(2.25rem - 2px); height: auto; }
.fsec-body .date-time > .date-in > input[type=date], .fsec-body .date-time > .date-time-t { font-size: var(--fs-4); padding-top: 0; padding-bottom: 0; }
.fsec-body .money-in, .fsec-body .goal-row, .fsec-body .goal-pick, .fsec-body .goal-mode { align-items: center; }
/* The goal row over the whole width, on one line (note 37). */
.fsec-body > .field[data-field=goal] { grid-column: 1 / -1; }
.goal-row { flex-wrap: nowrap; }
@media (max-width: 760px) { .goal-row { flex-wrap: wrap; } }
.goal-ro { display: flex; align-items: center; min-height: 2.25rem; }
/* A line item's run dates side by side, as the campaign's (note 44). */
.fsec-body > .field[data-field="flight.dateRange.startDate"] { grid-column: 1; }
/* Campaign flow quick wins (notes 56-59, 62). */
/* The goal row: its three controls on one line, the same height, aligned (note 56). */
.goal-row { display: grid; grid-template-columns: auto auto 1fr; gap: var(--sp-3) var(--sp-6); align-items: center; justify-content: start; }
.goal-row > * { display: inline-flex; align-items: center; min-height: 2.25rem; }
@media (max-width: 760px) { .goal-row { grid-template-columns: 1fr; } }
/* "Same as campaign · Own…" (notes 57, 58). */
.same-own { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-7); align-items: center; min-height: 2.25rem; }
.same-own > label.check { margin: 0; display: inline-flex; gap: var(--sp-2); align-items: center; }
.date-pair { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); align-items: center; margin-top: var(--sp-1); }
.fsec-body > .field[data-field=flight], .fsec-body > .field[data-field=flights] { grid-column: 1 / -1; }
/* A chip's × (note 62). */
.chip-x { border: 0; background: none; padding: 0 0 0 var(--sp-1); margin: 0; color: var(--muted); cursor: pointer; font-size: var(--fs-4); line-height: 1; }
.chip-x:hover, .chip-x:focus-visible { color: var(--bad); }
/* + New campaign ▾ (analysis §7.1) and the Start from list. */
.menu-btn { position: relative; display: inline-block; }
.menu-btn > summary { list-style: none; cursor: pointer; }
.menu-btn > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; z-index: var(--z-menu); top: calc(100% + 2px); left: 0; display: flex; flex-direction: column; min-width: 10rem; padding: var(--sp-1) 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.menu-pop > button { text-align: left; padding: var(--sp-2) var(--sp-5); background: none; border: 0; cursor: pointer; color: var(--fg); font: inherit; }
.menu-pop > button:hover, .menu-pop > button:focus-visible { background: var(--accent-soft); }
/* The line item as one sheet (analysis §7.5). */
.liw-sheet { display: flex; flex-direction: column; gap: var(--sp-5); }
.liw-sec { scroll-margin-top: 3rem; }
.liw-sec > h3 { margin: 0 0 var(--sp-3); font-size: var(--fs-2); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 1px solid var(--line); padding-top: var(--sp-4); }
.liw-nav { margin-top: var(--sp-1); }
/* The line item sheet: more room above each field, so the fields do not run together (owner feedback note 88). */
.liw-sheet .fsec-body { row-gap: var(--sp-7); }
.br-deals { display: grid; gap: var(--sp-2); margin-block: var(--sp-2); }
/* The Buying route (walk E17): space from the block above, the main question first, the rest in a fold. */
.fsub.br { margin-top: var(--sp-8); }
.br-mode { border: 0; padding: 0; margin: 0 0 var(--sp-2); min-width: 0; display: grid; gap: var(--sp-2); }
.br-mode legend { font-weight: 600; padding: 0; margin-bottom: var(--sp-2); }
.br-choice { display: grid; gap: var(--sp-0); }
.br-choice .hint { padding-left: var(--sp-6); }
.br-adv { margin-top: var(--sp-4); border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.br-adv > summary { cursor: pointer; min-height: 1.5rem; display: flex; align-items: center; }
.br-adv[open] > summary { margin-bottom: var(--sp-2); }
.br-effect.bad, .br-error { color: var(--bad); }

/* Users › Roles and rights (WP-U1): roles as columns, rights as rows per group */
.rr-note { margin: 0; }
.rr-scroll { overflow-x: auto; }
.rr-table th.rr-role { text-align: center; vertical-align: bottom; white-space: normal; min-width: 6.5rem; height: auto; padding: var(--sp-2) var(--sp-3); }
.rr-table th.rr-role > span { display: block; }
.rr-scopes { font-weight: 400; font-size: var(--fs-1); }
.rr-table .rr-right { text-align: left; font-weight: 400; position: sticky; left: 0; background: var(--panel); min-width: 16rem; }
.rr-table thead .rr-right { background: var(--panel2); }
.rr-table .rr-cell { text-align: center; }
.rr-yes { color: var(--ok); }
.rr-group th, .rr-group td { background: var(--panel2); }
.rr-toggle { display: inline-flex; align-items: center; gap: var(--sp-2); background: none; border: 0; padding: 0; color: var(--fg); font: inherit; font-weight: 600; cursor: pointer; }
.rr-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rr-grants { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }

/* Dry run D2 (T07): the Form/JSON switch covers the body's top padding while it sticks, so the form never
   shows above it; the advertiser form's own tabs sit under it and scroll with the form (no second sticky bar). */
.eform-tabbed > .form-tabs { position: static; margin-top: 0; }
.form-tab-panel[hidden] { display: none; }
/* The billing details (dry run 2026-11-07 R1): every field labelled, postal code + house number + addition on one line. */
/* The partner's billing, agreement and contacts (R1 retest): one row per group, only related fields side by side. */
.billing-in { display: flex; flex-direction: column; gap: var(--sp-field); max-width: 44rem; }
.billing-in .bill-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--sp-5); align-items: end; }
.billing-in .bill-row.bill-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.billing-in .bill-row.bill-3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr); }
.billing-in .bill-row.bill-short { grid-template-columns: minmax(0, 14rem); }
.billing-in .bill-f, .contacts-in .bill-f { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.billing-in .bill-f > :is(input, select), .contacts-in .bill-f > :is(input, select) { width: 100%; max-width: none; }
.billing-in input.ro { background: var(--panel2); color: var(--muted); cursor: default; }
.billing-in .bill-h { margin: var(--sp-3) 0 0; font-size: var(--fs-3); }
.billing-in .bill-h:first-child { margin-top: 0; }
.billing-in p { margin: 0; }
.bill-preview { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); background: var(--panel2); }
.bill-preview h4 { margin: 0 0 var(--sp-2); font-size: var(--fs-3); }
.contacts-in { display: flex; flex-direction: column; gap: var(--sp-4); align-items: start; }
.contacts-in .contact-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 0 var(--sp-4); align-items: end; width: 100%; }
@media (max-width: 760px) { .contacts-in .contact-row, .billing-in .bill-row.bill-2, .billing-in .bill-row.bill-3 { grid-template-columns: 1fr; } }
.fsec-body > .field:is([data-field=billing], [data-field=contacts], [data-field=agreement], [data-field=emailDomains], [data-field=defaultFrequencyCap], [data-field=advertiserVisibility]) { grid-column: 1 / -1; }
/* Fields that belong together share a line (owner 2026-11-07, R2): postal code + city, street + number. */
.field-pair { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); gap: 0 var(--sp-5); align-items: start; }
.field-pair > .field { margin: 0; min-width: 0; }
/* The multi-value picker (ui/ChipCombo.tsx, style guide §4.11.7): chips inside one field, the input after them. */
.ccombo { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); min-height: 2.25rem; padding: var(--sp-1) var(--sp-2);
  background: var(--input); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: text; }
.ccombo:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.ccombo.off { opacity: .6; cursor: not-allowed; }
.ccombo-chips { display: contents; list-style: none; margin: 0; padding: 0; }
.ccombo-chips .chip { display: inline-flex; gap: var(--sp-1); align-items: center; cursor: default; }
.ccombo > input { flex: 1 1 10rem; min-width: 8rem; border: 0; background: transparent; padding: var(--sp-1); outline: none; box-shadow: none; }
.ov-body .embedded .field:has(.ccombo), .fsec-body > .field:has(.ccombo) { grid-column: 1 / -1; }
.form-grid > .field:has(.ccombo) { grid-column: 1 / -1; }

/* A deal's exchange fields (R4 h): one grey, read-only group headed "From the exchange". */
fieldset.deal-ex { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4) var(--sp-4); margin: 0 0 var(--sp-5); background: var(--panel2); }
fieldset.deal-ex legend { padding: 0 var(--sp-2); font-weight: 600; }
fieldset.deal-ex > .hint { margin: 0 0 var(--sp-3); }
fieldset.deal-ex :is(input, select) { color: var(--muted); cursor: default; }
/* annotations: the top bar's button, the armed pick (hover outline, hint), the feedback note (move, resize) and its thank-you */
.ann-layer { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: var(--z-annotate); } /* out of the app grid; its children are fixed */
/* The button stays above an open overlay (.ov-back, 45) or dialog (.modal-back, 50): the top bar (z-index 30)
   stops being a stacking context then, so the button's own z-index counts against the scrims. With a side
   sheet open it sits in the sheet's top-right corner, where the sheet's header keeps room for it (the top bar
   wraps differently per width, so its own place could be anywhere over the sheet). */
body:has(.ov-back, .modal-back) .topbar { z-index: auto; }
/* The sheet's close (×) stays at the far right, the feedback button sits just left of it (feedback note 127):
   the close is one control square (--ctl-sm) at the head's right padding, the button 2rem beside it. */
body:has(.ov-back) .ann-toggle { position: fixed; top: calc(var(--sp-5) + var(--ctl-sm) / 2 - 1rem); right: calc(var(--sp-7) + var(--ctl-sm) + var(--sp-2)); }
body:has(.ann-toggle) .ov-head > .ov-close { margin-left: calc(var(--sp-9) + var(--sp-3)); }
.ann-toggle { position: relative; z-index: var(--z-annotate-btn); width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted); display: inline-grid; place-items: center; padding: 0; flex: none; }
.ann-toggle svg { width: 1.125rem; height: 1.125rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ann-toggle:hover { color: var(--fg); border-color: var(--accent); }
.ann-toggle.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
body.annotating, body.annotating * { cursor: crosshair !important; }
/* A disabled control lets the pick through to its parent, which finds it again (note 74). */
body.annotating :disabled { pointer-events: none; }
body.annotating .ann-pop, body.annotating .ann-pop *,body.annotating .ann-toggle, body.annotating .ov-back, body.annotating .modal-back { cursor: auto !important; }
.ann-hover { position: fixed; z-index: var(--z-annotate); pointer-events: none; outline: 2px solid var(--accent); outline-offset: 1px; background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: var(--r-xs); }
/* the element a note is about, highlighted from the Feedback page for three seconds */
.ann-flash { outline: .1875rem solid var(--accent) !important; outline-offset: 2px; border-radius: var(--r-xs); }
@media (prefers-reduced-motion: no-preference) { .ann-flash { animation: ann-flash 1s ease 3; } }
@keyframes ann-flash { 0%, 100% { outline-color: var(--accent); } 50% { outline-color: transparent; } }
.ann-pop { position: fixed; left: 0; top: 0; z-index: var(--z-annotate-pop); width: min(21.25rem, calc(100vw - 1rem)); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--sp-5); display: grid; gap: var(--sp-3); }
.ann-pop textarea { max-width: none; font: inherit; }
.ann-pop .seg { margin: 0; }
/* the feedback note: moved by its header, resized by its corner; the textarea fills it */
.ann-quick { display: flex; flex-direction: column; max-height: none; overflow: hidden; min-width: 13.75rem; min-height: 9.375rem; padding-bottom: var(--sp-5); }
.ann-quick textarea { flex: 1 1 auto; min-height: 3.75rem; resize: none; width: 100%; box-sizing: border-box; }
.ann-qhead { display: flex; align-items: center; gap: var(--sp-2); margin: calc(-1 * var(--sp-2)) calc(-1 * var(--sp-2)) 0; padding: 2px 2px 2px var(--sp-2); cursor: move; touch-action: none; user-select: none; border-radius: var(--r-sm); }
.ann-qhead:hover { background: var(--panel2); }
.ann-grip { width: 1.625rem; height: 1.625rem; padding: 0; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--muted); display: inline-grid; place-items: center; cursor: move; touch-action: none; }
.ann-grip:hover, .ann-grip:focus-visible { color: var(--fg); border-color: var(--line); }
.ann-grip svg { width: 1rem; height: 1rem; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ann-size { position: absolute; right: 0; bottom: 0; width: 1.125rem; height: 1.125rem; padding: 0; border: 0; border-radius: 0 0 var(--r-lg) 0; cursor: nwse-resize; touch-action: none; color: var(--muted);
  background: linear-gradient(135deg, transparent 0 50%, currentColor 50% 56%, transparent 56% 66%, currentColor 66% 72%, transparent 72% 82%, currentColor 82% 88%, transparent 88%); }
.ann-size:hover, .ann-size:focus-visible { color: var(--accent); }
body.annotating .ann-qhead, body.annotating .ann-grip { cursor: move !important; }
body.annotating .ann-size { cursor: nwse-resize !important; }
/* the thank-you: where the note was, for three seconds */
.ann-thanks { position: fixed; z-index: var(--z-annotate-pop); background: var(--fg); color: var(--bg); border-radius: var(--r-lg); padding: var(--sp-3) var(--sp-5); box-shadow: var(--shadow); font-size: var(--fs-3); max-width: calc(100vw - 1rem); }
@media (prefers-reduced-motion: no-preference) { .ann-thanks { animation: ann-fade 3s ease forwards; } }
@keyframes ann-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
/* the armed pick's hint: follows the pointer */
.ann-hint { position: fixed; z-index: var(--z-annotate-hint); pointer-events: none; max-width: 16.25rem; background: var(--fg); color: var(--bg); border-radius: var(--r-md); padding: var(--sp-1) var(--sp-4); box-shadow: var(--shadow); font-size: var(--fs-2); }
.ann-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.ann-head .pill { margin: 0; }
.ann-note { margin: 0; white-space: pre-wrap; }
.ann-note.lead { font-size: var(--fs-6); line-height: 1.45; }
.ann-reply { border-left: .1875rem solid var(--line); padding: 2px var(--sp-3); }
.ann-reply p { margin: 0; white-space: pre-wrap; }
.ann-replybox { display: flex; gap: var(--sp-2); }
.ann-replybox input { flex: 1; max-width: none; }
.ann-thread { display: grid; gap: var(--sp-3); max-width: 47.5rem; }
.ann-kind.k-missing { border-color: var(--warn); color: var(--warn); }
.ann-kind.k-bug { border-color: var(--bad); color: var(--bad); }
.ann-kind.k-idea { border-color: var(--accent); color: var(--accent); }
.pill.st-planned { border-color: var(--warn); color: var(--warn); }
.pill.st-done { border-color: var(--ok); color: var(--ok); }
.pill.st-declined { color: var(--muted); }
.ann-html pre { max-height: 15rem; }
/* The live-reload badge (make dev only; components/DevBadge.tsx): small, in the
   bottom-left corner, out of the way of the toasts and of an overlay's buttons
   (in the middle it covered the wizard's Cancel; owner feedback 2026-10-13). */
.dev-badge { position: fixed; z-index: var(--z-dev); left: .5rem; bottom: calc(var(--toast-lift, 0rem) + .375rem); display: inline-flex; align-items: center; gap: var(--sp-2); max-width: min(35rem, calc(100vw - 2rem)); padding: 2px var(--sp-4); border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: var(--fs-1); box-shadow: var(--shadow); opacity: .85; white-space: nowrap; }
.dev-badge:hover { opacity: 1; }
.dev-badge code { font-family: var(--mono); color: var(--fg); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dev-dot { width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--ok); flex: none; }
.dev-badge.busy .dev-dot { background: var(--warn); animation: dev-pulse 1s ease-in-out infinite; }
.dev-badge.warn .dev-dot { background: var(--warn); }
.dev-badge.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); opacity: 1; }
.dev-badge.bad .dev-dot { background: var(--bad); }
.dev-badge.flash { animation: dev-flash 2.5s ease-out; }
@keyframes dev-pulse { 50% { opacity: .3; } }
@keyframes dev-flash { 0%, 40% { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dev-badge.busy .dev-dot, .dev-badge.flash { animation: none; } }

/* The UI catalog (#/ui-catalog, dev builds; views/dev/UiCatalog.tsx). */
.ui-catalog section + section { margin-top: var(--sp-4); }
.ui-catalog-wide { width: 100%; }
.ui-catalog-md { display: flex; width: 100%; height: 22rem; }
.ui-catalog-map { width: 100%; }
.ui-catalog-strip { width: min(100%, 44rem); display: grid; gap: var(--sp-2); }
.ui-catalog-map-canvas { height: 24rem; border-radius: var(--r-xs); }
.ui-catalog-map-list { list-style: none; margin: var(--sp-2) 0; padding: 0; display: grid; gap: 2px; }
.ui-catalog-map-list li { padding: 2px var(--sp-2); border-radius: var(--r-xs); }
.ui-catalog-map-list li.hovered { background: var(--panel2); }
.ui-catalog-map-list li.selected { background: var(--sel); }
/* Live data (docs/live-data.md): a changed number flashes once, calmly, and
   goes back to the normal text colour; the arrow sits left of the number so
   nothing shifts. Only the text and the arrow change colour, never the cell's
   background (feedback #52: a blue cell drew too much attention on the
   Campaigns dashboard, where spend ticks with every statistics update);
   a neutral change shows only the arrow. */
.tick { position: relative; }
.tick.better { animation: tick-better 1.1s ease-out; }
.tick.worse { animation: tick-worse 1.1s ease-out; }
@keyframes tick-better { from { color: var(--ok); } to { color: inherit; } }
@keyframes tick-worse { from { color: var(--bad); } to { color: inherit; } }
.tick-arrow {
  position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
  margin-right: 2px; font-size: var(--fs-0); line-height: 1; pointer-events: none;
  animation: tick-arrow 1.1s ease-out forwards;
}
.tick.better .tick-arrow { color: var(--ok); }
.tick.worse .tick-arrow { color: var(--bad); }
.tick.neutral .tick-arrow { color: var(--muted); }
@keyframes tick-arrow { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .tick.better, .tick.worse, .tick-arrow { animation: none; }
}

.updated { white-space: nowrap; padding: 0 var(--sp-1); }
.notice-changed { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; padding: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-3);
  border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--r-sm); background: var(--panel); }
