/* The T brand's design tokens (Brand/T/T_Brand_Guide.docx: navy, leaf green, periwinkle, mist, Outfit). docs/UI_TASTE.md is the brief; tests/ui/test_tokens.py checks every text pair here for WCAG AA.
   One accent token per tenant: the shell sets --accent, --accent-ink and --on-accent from the tenant's own colour. */
@font-face { font-family: "Outfit"; src: url("outfit.woff2") format("woff2"); font-weight: 300 800; font-display: swap; }

:root {
  color-scheme: light;
  /* surfaces */
  --page: #F5F6FB; --surface: #FFFFFF; --band: #EEF0F8; --border: #E1E4F0; --border-strong: #7F86A3;
  --glass: rgba(255, 255, 255, .72); --scrim: rgba(15, 18, 62, .36);
  /* text */
  --text: #0F123E; --muted: #555B6E; --faint: #7F86A3; --chip: #8A87A6; --chip-ink: #4C4A66;
  /* semantic: approved, published, healthy */
  --success: #068943; --success-strong: #05733A; --on-success: #FFFFFF; --success-ink: #056B35; --success-tint: #DDF5EA;
  /* semantic: queued, scheduled, draft, charts */
  --info: #4453D6; --info-ink: #3644C2; --info-tint: #E8EBFF;
  /* semantic: blocked, failed, safety, needs a fix. A soft fill, never solid red. */
  --risk-ink: #A61B1B; --risk-tint: #FFE3E3; --risk-border: #FFAAAA;
  --warn-ink: #7A4F00; --warn-tint: #FFF1CC; --warn-border: #F1D48A;
  /* the T accent: periwinkle, the right end of the wave. Restrained: the active mark, the flow ribbon, a link's ink. */
  --accent: #7C8CF8; --accent-ink: #3F4FC8; --accent-tint: #ECEEFF; --on-accent: #0F123E;
  /* the primary action is leaf green, the left end of the wave */
  --action: #067A3C; --on-action: #FFFFFF; --action-hover: #05652F;
  --focus: #4453D6;
  /* charts and the soft glows behind glass (lilac, mint) */
  --track: #E6E9F3; --wash-a: #F5F6FB; --wash-b: #DDE2FF; --orb-a: #E9E4FF; --orb-b: #DDF5EA; --orb-c: #FFE9DC;
  /* shape */
  --r-chip: 8px; --r-ctl: 12px; --r-card: 16px; --r-pill: 999px;
  /* depth: borders first; a soft lift only for what floats */
  --lift-1: 0 8px 24px rgba(15, 18, 62, .06); --lift-2: 0 16px 40px rgba(15, 18, 62, .09); --glow: none;
  /* space: an 8px grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  /* type */
  --font: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* motion */
  --ease: cubic-bezier(.22, 1, .36, 1); --t-fast: 160ms; --t-fade: 240ms; --t-morph: 420ms; --t-draw: 900ms;
  --rail: 76px; --top: 64px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0B0E2E; --surface: #151A45; --band: #10143A; --border: #262C5C; --border-strong: #7C84B0;
  --glass: rgba(16, 20, 58, .72); --scrim: rgba(0, 0, 0, .6);
  --text: #F5F6FB; --muted: #B4B9D6; --faint: #7C84B0; --chip: #262C5C; --chip-ink: #F5F6FB;
  --success: #2FBF74; --success-strong: #5FD99A; --on-success: #0B0E2E; --success-ink: #5FD99A; --success-tint: #12372C;
  --info: #7C8CF8; --info-ink: #AEB8FF; --info-tint: #1E2560;
  --risk-ink: #FFAAAA; --risk-tint: #3A1F22; --risk-border: #7A3B3B;
  --warn-ink: #F5C86A; --warn-tint: #3A2F14; --warn-border: #6B5520;
  --accent: #9AA6FF; --accent-ink: #B8C1FF; --accent-tint: #22285E; --on-accent: #0B0E2E;
  --action: #2FBF74; --on-action: #0B0E2E; --action-hover: #5FD99A;
  --focus: #AEB8FF;
  --track: #262C5C; --wash-a: #0B0E2E; --wash-b: #1A2160; --orb-a: #2A2F7A; --orb-b: #0E4A36; --orb-c: #0B0E2E;
  /* dark lifts with a coloured glow, not a shadow */
  --lift-1: 0 0 0 1px rgba(154, 166, 255, .08), 0 12px 32px rgba(124, 140, 248, .14);
  --lift-2: 0 0 0 1px rgba(154, 166, 255, .10), 0 20px 56px rgba(124, 140, 248, .22);
  --glow: 0 0 48px rgba(47, 191, 116, .25);
}

/* The sign-in, second-step and onboarding scene: always dark, on the navy wash with green and periwinkle glows. */
:root[data-scene="night"] {
  color-scheme: dark;
  --page: #0F123E; --surface: rgba(21, 26, 69, .72); --band: rgba(255, 255, 255, .06); --border: rgba(255, 255, 255, .14); --border-strong: #9AA6FF;
  --glass: rgba(15, 18, 62, .6); --text: #F5F6FB; --muted: #B4B9D6; --faint: #B4B9D6; --chip: #262C5C; --chip-ink: #F5F6FB;
  --success: #2FBF74; --success-strong: #5FD99A; --on-success: #0B0E2E; --success-ink: #5FD99A; --success-tint: rgba(47, 191, 116, .16);
  --info: #7C8CF8; --info-ink: #AEB8FF; --info-tint: rgba(124, 140, 248, .18);
  --risk-ink: #FFAAAA; --risk-tint: rgba(255, 170, 170, .12); --risk-border: rgba(255, 170, 170, .4);
  --warn-ink: #F5C86A; --warn-tint: rgba(245, 200, 106, .14); --warn-border: rgba(245, 200, 106, .4);
  --accent: #9AA6FF; --accent-ink: #B8C1FF; --accent-tint: rgba(154, 166, 255, .16); --on-accent: #0B0E2E;
  --action: #2FBF74; --on-action: #0B0E2E; --action-hover: #5FD99A; --focus: #AEB8FF; --track: rgba(255, 255, 255, .14);
  --lift-1: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 40px rgba(124, 140, 248, .28);
  --lift-2: 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 72px rgba(124, 140, 248, .36); --glow: 0 0 64px rgba(47, 191, 116, .35);
}

/* Base: reset, type, focus. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--text); background: var(--page); font-feature-settings: "cv11", "ss01", "calt"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, p, figure, ul, ol, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }      /* a picture carries its width and height (so the page does not jump); its own shape decides once it has loaded */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }
::selection { background: var(--accent-tint); color: var(--text); }

/* Type: display 40-56 semibold tight; section titles 20-24; body 12-14; micro-labels 11 uppercase. */
.display { font-size: clamp(34px, 4.6vw, 56px); font-weight: 600; letter-spacing: -.035em; line-height: 1.08; }
h1, .h1 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
h2, .h2 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
h3, .h3 { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1.4; }
h4, .h4 { font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.micro { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted, .meta, small { color: var(--muted); }
.meta, small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11"; }
.big { font-size: 34px; font-weight: 650; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.lede { font-size: 15px; color: var(--muted); max-width: 62ch; }
.ok { color: var(--success-ink); font-weight: 600; }
.no { color: var(--risk-ink); font-weight: 600; }
.note { color: var(--warn-ink); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Focus: one ring, everywhere, only for the keyboard. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: fixed; left: 12px; top: -64px; z-index: 100; background: var(--action); color: var(--on-action); padding: 10px 16px; border-radius: var(--r-pill); font-weight: 600; transition: top var(--t-fast) var(--ease); }
.skip:focus { top: 12px; text-decoration: none; }

/* Layout helpers on the 8px grid. */
.row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.row.tight { gap: var(--s2); } .row.nowrap { flex-wrap: nowrap; } .row.top { align-items: flex-start; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--s4); } .stack.tight { gap: var(--s2); } .stack.loose { gap: var(--s6); }
.grow { flex: 1 1 0; min-width: 0; } .right { margin-left: auto; } .center { text-align: center; }
.grid { display: grid; gap: var(--s4); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: var(--s5); align-items: start; }
.section { margin-top: var(--s7); } .section:first-child { margin-top: 0; }
.section > .head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s4); flex-wrap: wrap; }
.section > .head .right { font-size: 13px; }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid.c2, .grid.c3 { grid-template-columns: minmax(0, 1fr); } .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); } .hide-sm { display: none !important; } .section { margin-top: var(--s6); } }
@media (min-width: 641px) { .only-sm { display: none !important; } }
[hidden] { display: none !important; }

/* Components. Pills for actions and search, 16px cards, 8px chips, 1px borders before shadows. */

/* ---- icons: 1.5px line, round caps */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 14px; height: 14px; } .i.lg { width: 22px; height: 22px; } .i.xl { width: 32px; height: 32px; }

/* ---- buttons */
.btn, button.go, button.no { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid transparent;
  background: var(--action); color: var(--on-action); font-weight: 600; font-size: 13.5px; letter-spacing: -.005em; white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.btn:hover { background: var(--action-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.soft, form button:not([class]), .card button:not([class]) { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
form button:not([class]), .card button:not([class]) { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); border-width: 1px; border-style: solid; font-weight: 600; font-size: 13.5px; }
.btn.soft:hover, form button:not([class]):hover, .card button:not([class]):hover { background: var(--band); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost:hover { background: var(--band); }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.accent:hover { filter: brightness(1.05); }
.btn.ok, button.go { background: var(--success-strong); color: var(--on-success); }
.btn.ok:hover, button.go:hover { filter: brightness(1.08); }
/* destructive: the soft red fill with its border, never solid red */
.btn.danger, button.no { background: var(--risk-tint); color: var(--risk-ink); border-color: var(--risk-border); }
.btn.danger:hover, button.no:hover { filter: brightness(.98) saturate(1.2); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; gap: 6px; } .btn.lg { min-height: 48px; padding: 0 24px; font-size: 15px; }
.btn.icon { width: 40px; padding: 0; } .btn.icon.sm { width: 32px; }
.btn[disabled], button[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.busy { color: transparent !important; position: relative; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--on-action); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.soft.busy::after, .btn.ghost.busy::after, .btn.danger.busy::after { border-color: var(--text); border-right-color: transparent; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 600; }
.linkbtn:hover { text-decoration: underline; }

/* ---- status pills and chips */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--band); color: var(--chip-ink); border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.plain::before { display: none; }
.pill.success { background: var(--success-tint); color: var(--success-ink); }
.pill.info { background: var(--info-tint); color: var(--info-ink); }
.pill.risk { background: var(--risk-tint); color: var(--risk-ink); border-color: var(--risk-border); }
.pill.warn { background: var(--warn-tint); color: var(--warn-ink); border-color: var(--warn-border); }
.pill.accent { background: var(--accent-tint); color: var(--accent-ink); }
.pill.live::before { animation: pulse 2s var(--ease) infinite; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-chip); font-size: 12.5px; font-weight: 500; color: var(--chip-ink); background: var(--surface); border: 1px solid var(--border); white-space: nowrap; text-decoration: none; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
a.chip:hover, button.chip:hover { background: var(--band); text-decoration: none; }
.chip.on { background: var(--action); color: var(--on-action); border-color: var(--action); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .72; font-weight: 600; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--chip-ink); background: var(--band); letter-spacing: .01em; }
.tag.ch { text-transform: capitalize; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface); font: 600 11px var(--mono); color: var(--muted); }

/* ---- chip rail: scrolls sideways, chevrons at the ends */
.chiprail { position: relative; display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s5); }
.chiprail .track { display: flex; gap: var(--s2); overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 2px; flex: 1; mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%); }
.chiprail .track::-webkit-scrollbar { display: none; }
.chiprail .chev { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; padding: 0; }
.chiprail .chev:hover { color: var(--text); background: var(--band); }
.chiprail:not(.over) .chev { display: none; } .chiprail:not(.over) .track { mask-image: none; }

/* ---- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s5); position: relative; min-width: 0; }
.card.pad0 { padding: 0; overflow: hidden; } .card.tight { padding: var(--s4); }
.card.band { background: var(--band); border-color: transparent; }
.card.lift { transition: transform var(--t-fade) var(--ease), box-shadow var(--t-fade) var(--ease), border-color var(--t-fade) var(--ease); }
.card.lift:hover, .card.lift:focus-within { transform: translateY(-2px); box-shadow: var(--lift-1); }
.card > h2:first-child, .card > .head:first-child { margin-bottom: var(--s4); }
.card .head { display: flex; align-items: center; gap: var(--s3); }
.card .foot { margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--border); display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
/* the whole card is the link: one anchor, stretched */
.card a.item::after, .card a.stretch::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card a.item, .card a.stretch { color: inherit; font-weight: 600; }
.card a.item:hover, .card a.stretch:hover { text-decoration: none; }
.card a.item:focus-visible, .card a.stretch:focus-visible { outline: none; }
.card:has(a.item:focus-visible), .card:has(a.stretch:focus-visible), .card.cur { outline: 2px solid var(--focus); outline-offset: 2px; }
.card .above { position: relative; z-index: 1; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); } .card { padding: var(--s4); } }

/* a post card: thumbnail, micro-label row, title, footer */
.post .thumb { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--band); margin-bottom: var(--s3); display: grid; place-items: center; color: var(--faint); }
.post .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post .title { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; }
.thumb.sq { aspect-ratio: 1; } .thumb.tall { aspect-ratio: 4 / 5; }
.mini { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--band); flex: none; display: grid; place-items: center; color: var(--faint); overflow: hidden; }
.mini img { width: 100%; height: 100%; object-fit: cover; }

/* ---- KPI tiles */
.kpi { display: flex; gap: var(--s4); align-items: center; }
.kpi .l { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .n { font-size: 34px; font-weight: 650; letter-spacing: -.035em; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 6px; }
.kpi .n small { font-size: 14px; font-weight: 500; letter-spacing: 0; }
.kpi .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.delta { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--success-ink); } .delta.down { color: var(--risk-ink); }

/* ---- tables */
.tablewrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr, table tr { transition: background var(--t-fast) var(--ease); }
tr:hover td { background: color-mix(in srgb, var(--band) 60%, transparent); }
tr.cur td { background: var(--band); }
td h3 { margin: 12px 0 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
td:first-child { font-weight: 550; }
.tablewrap + p, .tablewrap + .more { margin-top: var(--s4); }
@media (max-width: 640px) { th, td { padding: 10px 12px; } }

/* ---- forms */
label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field .hint { font-size: 12px; font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=color]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 14px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 14px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
textarea { min-height: 96px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent); border-radius: var(--r-ctl); }
input[type=file] { font-size: 13px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: 12px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--action); vertical-align: -4px; margin: 0 6px 0 0; }
form.inline, form.sw { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
form.inline input:not([type=hidden]), form.sw input:not([type=hidden]) { width: auto; min-width: 0; flex: 1 1 160px; }
.formrow { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: flex-end; }
.formrow > .field { flex: 1 1 180px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--text); background: none; border: 0; padding: 0; }
.switch i { width: 40px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background var(--t-fade) var(--ease); flex: none; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--t-fade) var(--ease); }
.switch[aria-pressed=true] i, .switch.on i { background: var(--success-strong); }
.switch[aria-pressed=true] i::after, .switch.on i::after { transform: translateX(16px); }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--band); border: 1px solid var(--border); }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.seg a.on, .seg button.on, .seg [aria-current=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(5, 6, 11, .08); }

/* ---- banners, flash, toasts */
.banner, p.msg { display: flex; gap: var(--s3); align-items: flex-start; padding: 12px 16px; border-radius: var(--r-ctl); background: var(--info-tint); color: var(--info-ink); font-size: 13.5px; font-weight: 500; border: 1px solid transparent; margin-bottom: var(--s4); overflow-wrap: anywhere; white-space: pre-line; }
.banner.success { background: var(--success-tint); color: var(--success-ink); }
.banner.risk { background: var(--risk-tint); color: var(--risk-ink); border-color: var(--risk-border); }
.banner.warn { background: var(--warn-tint); color: var(--warn-ink); border-color: var(--warn-border); }
.banner.quiet { background: var(--band); color: var(--muted); }
.banner a { color: inherit; text-decoration: underline; }
#toasts { position: fixed; z-index: 90; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; max-width: min(440px, calc(100vw - 32px)); padding: 12px 14px 12px 16px; border-radius: 14px; background: var(--action); color: var(--on-action); font-size: 13.5px; font-weight: 500; box-shadow: var(--lift-2); animation: toast-in var(--t-morph) var(--ease) both; overflow-wrap: anywhere; white-space: pre-line; }
.toast.out { animation: toast-out var(--t-fade) var(--ease) both; }
.toast button { background: none; border: 0; color: inherit; opacity: .7; padding: 2px; margin: -2px -2px 0 0; border-radius: 6px; }
.toast button:hover { opacity: 1; }
@media (max-width: 640px) { #toasts { right: 12px; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); align-items: stretch; } }

/* ---- dialogs: modal in the middle, drawer from the side */
dialog { border: 0; padding: 0; color: var(--text); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade var(--t-fade) var(--ease) both; }
dialog.modal[open] { animation: pop var(--t-morph) var(--ease) both; }
dialog.modal .sheet { width: min(520px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 48px)); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--lift-2); padding: var(--s5); }
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; }
dialog.drawer[open] { animation: drawer var(--t-morph) var(--ease) both; }
dialog.drawer .sheet { width: min(480px, 100vw); height: 100%; overflow: auto; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--lift-2); padding: var(--s5); }
dialog .sheet > .head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
dialog .sheet > .head h2 { flex: 1; }
dialog .sheet > .foot { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); flex-wrap: wrap; }
@media (max-width: 640px) { dialog.drawer { margin: auto 0 0; height: auto; width: 100vw; } dialog.drawer .sheet { width: 100vw; height: auto; max-height: 86dvh; border-left: 0; border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom)); } dialog.drawer[open] { animation-name: sheet; } }

/* ---- menus (details): the avatar menu, the client switcher */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > .pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--lift-2); animation: pop var(--t-fade) var(--ease) both; }
details.menu.left > .pop { right: auto; left: 0; }
.pop .item, .pop a, .pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; border: 0; background: none; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; text-decoration: none; min-height: 0; }
.pop a:hover, .pop button:hover { background: var(--band); text-decoration: none; }
.pop form { display: block; } .pop hr { margin: 6px 0; }
.pop .lab { padding: 8px 12px 4px; }

/* ---- avatars */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; letter-spacing: .02em; background: var(--accent-tint); color: var(--accent-ink); text-transform: uppercase; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; } .avatar.lg { width: 44px; height: 44px; font-size: 15px; }

/* ---- charts: thin, rounded, a light track */
.donut { position: relative; flex: none; display: inline-grid; place-items: center; }
.donut svg { transform: rotate(-90deg); overflow: visible; }
.donut circle { fill: none; stroke-width: 7; stroke-linecap: round; }
.donut .trk { stroke: var(--track); }
.donut .arc { stroke: var(--info); stroke-dasharray: var(--len) 1000; transition: stroke-dasharray var(--t-draw) var(--ease); }
.donut.success .arc { stroke: var(--success); } .donut.accent .arc { stroke: var(--accent); } .donut.risk .arc { stroke: var(--risk-border); } .donut.muted .arc { stroke: var(--faint); }
.donut b { position: absolute; font-size: 15px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.donut.lg b { font-size: 22px; }
.draw:not(.in) .donut .arc, .donut.draw:not(.in) .arc { stroke-dasharray: 0 1000; }
.progress { height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--info); transition: width var(--t-draw) var(--ease); }
.progress.success i { background: var(--success); } .progress.accent i { background: var(--accent); } .progress.risk i { background: var(--risk-border); } .progress.warn i { background: var(--warn-border); }
.draw:not(.in) .progress i, .progress.draw:not(.in) i { width: 0; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.bars .b { flex: 1; min-width: 4px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; position: relative; }
.bars .b i { width: 100%; max-width: 14px; height: var(--h); min-height: 4px; border-radius: 999px; background: var(--info); transition: height var(--t-draw) var(--ease); transition-delay: calc(var(--i) * 18ms); }
.bars .b.zero i { background: var(--track); }
.bars .b.peak i { background: var(--accent); }
.bars .b span { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.draw:not(.in) .bars .b i, .bars.draw:not(.in) .b i { height: 4px; }
.hbars { display: grid; grid-template-columns: minmax(96px, max-content) 1fr max-content; gap: 10px 14px; align-items: center; font-size: 13px; }
.hbars .progress { height: 6px; }
.spark { width: 100%; height: 40px; overflow: visible; }
.spark path { fill: none; stroke: var(--info); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset var(--t-draw) var(--ease); }
.spark .fill { fill: color-mix(in srgb, var(--info) 10%, transparent); stroke: none; transition: opacity var(--t-draw) var(--ease); }
.draw:not(.in) .spark path:not(.fill), .spark.draw:not(.in) path:not(.fill) { stroke-dashoffset: 1; }
.draw:not(.in) .spark .fill { opacity: 0; }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--info); }
.legend .success i { background: var(--success); } .legend .accent i { background: var(--accent); } .legend .muted i { background: var(--faint); } .legend .risk i { background: var(--risk-border); }

/* ---- the flow ribbon: COPS's own signature. A post's road from message to published, as one thin line. */
.flow { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 0; position: relative; }
.flow .st { position: relative; padding: 18px 12px 0 0; min-width: 0; color: inherit; text-decoration: none; }
.flow .st::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 4px; border-radius: 999px; background: var(--track); }
.flow .st::after { content: ""; position: absolute; left: 0; top: 4px; height: 4px; width: var(--w, 0%); border-radius: 999px; background: var(--info); transition: width var(--t-draw) var(--ease); transition-delay: calc(var(--i) * 90ms); }
.flow .st.done::after { background: var(--success); } .flow .st.hot::after { background: var(--accent); } .flow .st.stop::after { background: var(--risk-border); }
.flow .st i { position: absolute; left: -1px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--info); z-index: 1; }
.flow .st.done i { border-color: var(--success); } .flow .st.hot i { border-color: var(--accent); } .flow .st.stop i { border-color: var(--risk-border); } .flow .st.idle i { border-color: var(--track); }
.flow .st b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.flow .st span { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.flow .st small { display: block; margin-top: 2px; }
a.st:hover b { color: var(--accent-ink); }
.draw:not(.in) .flow .st::after, .flow.draw:not(.in) .st::after { width: 0; }
@media (max-width: 640px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s5); } .flow .st b { font-size: 22px; } }

/* ---- timeline: a post's own history */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--track); transform-origin: top; transition: transform var(--t-draw) var(--ease); }
.timeline.draw:not(.in)::before { transform: scaleY(0); }
.timeline li { position: relative; padding-bottom: var(--s5); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -28px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--info); }
.timeline li.success::before { border-color: var(--success); } .timeline li.risk::before { border-color: var(--risk-border); } .timeline li.accent::before { border-color: var(--accent); } .timeline li.neutral::before { border-color: var(--faint); } .timeline li.warn::before { border-color: var(--warn-border); }
.timeline .when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .what { font-weight: 600; font-size: 14px; }

/* ---- skeletons: the shape of what is coming */
.skel { border-radius: 8px; background: linear-gradient(90deg, var(--band) 0%, color-mix(in srgb, var(--band) 40%, var(--surface)) 45%, var(--band) 90%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; min-height: 12px; color: transparent !important; user-select: none; }
.skel.line { height: 12px; margin: 8px 0; } .skel.title { height: 28px; width: 38%; margin-bottom: var(--s5); border-radius: 10px; } .skel.tile { height: 112px; border-radius: var(--r-card); } .skel.block { height: 220px; border-radius: var(--r-card); } .skel.row { height: 48px; border-radius: 12px; margin-bottom: 8px; } .skel.chip { height: 28px; width: 84px; display: inline-block; margin-right: 8px; }
.skeleton { animation: fade var(--t-fade) var(--ease) both; }
.reveal { animation: reveal var(--t-morph) var(--ease) both; }

/* ---- empty and error states: airy and centred */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--s3); padding: var(--s8) var(--s5); border: 1px dashed var(--border); border-radius: var(--r-card); background: var(--surface); position: relative; overflow: hidden; }
.empty .glyph { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--band); color: var(--muted); position: relative; }
.empty .glyph::before, .empty .glyph::after { content: ""; position: absolute; border-radius: 12px; border: 1px solid var(--border); inset: -10px 18px 14px -22px; z-index: -1; animation: drift 9s var(--ease) infinite alternate; }
.empty .glyph::after { inset: 16px -24px -12px 20px; animation-delay: -4s; }
.empty h2 { font-size: 18px; } .empty p { color: var(--muted); max-width: 46ch; }
.empty.small { padding: var(--s6) var(--s4); } .empty.small .glyph { width: 44px; height: 44px; border-radius: 14px; }
.empty.error { border-style: solid; border-color: var(--risk-border); background: var(--risk-tint); }
.empty.error .glyph { background: var(--surface); color: var(--risk-ink); } .empty.error p { color: var(--risk-ink); }
.empty.error .glyph::before, .empty.error .glyph::after { display: none; }

/* ---- small things */
.swatch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 0 14px 8px 0; }
.swatch i { width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--border); display: inline-block; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 13.5px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list > li { display: flex; gap: var(--s3); align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; } .list > li:first-child { padding-top: 0; }
ul.plain li { padding: 3px 0; overflow-wrap: anywhere; }
ul.stop li, ul.chk li.no { color: var(--risk-ink); font-weight: 600; }
ul.stop li { padding: 8px 12px; border-radius: 10px; background: var(--risk-tint); border: 1px solid var(--risk-border); margin-bottom: 6px; }
ul.chk li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
ul.chk li:last-child { border-bottom: 0; } ul.chk li.ok { color: var(--success-ink); font-weight: 500; }
pre.words { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14.5px; line-height: 1.6; background: var(--band); border-radius: var(--r-ctl); padding: var(--s4); }
code { background: var(--band); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--border); margin: var(--s4) 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; display: inline-block; }
.dot.success { background: var(--success); } .dot.info { background: var(--info); } .dot.risk { background: var(--risk-border); } .dot.accent { background: var(--accent); } .dot.warn { background: var(--warn-border); }
.more { display: flex; justify-content: center; }
/* a field that was filled in wrongly: the sentence under it, and its edge */
.field .err { font-size: 12.5px; font-weight: 500; color: var(--risk-ink); }
.field.bad input, .field.bad select, .field.bad textarea, .field input[aria-invalid=true], .field select[aria-invalid=true], .field textarea[aria-invalid=true] { border-color: var(--risk-border); background: var(--risk-tint); }
.field.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; } .field.check input { margin-top: 3px; flex: none; } .field.check span { color: var(--text); }
/* Details: where the technical part of a thing lives (ids, digests, versions, a provider's own words), off the main surface */
details.tech { font-size: 12.5px; color: var(--muted); } details.tech > summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; width: max-content; border-radius: 6px; list-style: none; }
details.tech > summary::-webkit-details-marker { display: none; } details.tech > summary::after { content: " ▾"; font-weight: 400; } details.tech[open] > summary::after { content: " ▴"; }
details.tech code { word-break: break-all; } details.tech .dl { margin-top: 8px; }
/* on a phone a field's type is 16px: smaller, and the phone zooms the page when the field is touched */
@media (max-width: 520px) { input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=color]), select, textarea { font-size: 16px; } }

/* The shell: a frosted top bar (mark, the command pill, actions), a slim icon rail, the page. */
body.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-rows: var(--top) 1fr; min-height: 100dvh; }

.bar { grid-column: 1 / -1; position: sticky; top: 0; z-index: 50; height: var(--top); display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s5) 0 var(--s4);
  background: var(--glass); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-bottom: 1px solid transparent;
  transition: border-color var(--t-fade) var(--ease), box-shadow var(--t-fade) var(--ease); }
.bar.scrolled { border-bottom-color: var(--border); box-shadow: 0 8px 24px rgba(5, 6, 11, .05); }
.bar .mark { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-weight: 700; letter-spacing: -.02em; font-size: 15px; flex: none; }
.bar .mark:hover { text-decoration: none; }
.bar .mark img { height: 26px; width: auto; border-radius: 6px; }
.glyph-mark { width: 30px; height: 30px; display: grid; place-items: center; flex: none; }
.glyph-mark svg { width: 30px; height: 30px; display: block; }
.bar .tenant > summary { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: 13.5px; max-width: 240px; }
.bar .tenant > summary b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar .tenant.solo > summary { pointer-events: none; }
.bar .tenant.solo > summary .i { display: none; }
.bar .mode { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; height: 22px; }
.bar .actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }
.bar .who > summary { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--muted); max-width: 260px; }
.bar .who > summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the command pill: search and command in one, in the middle */
.cmd { flex: 1 1 420px; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.cmd input { height: 40px !important; min-height: 40px !important; border-radius: var(--r-pill) !important; padding: 0 84px 0 42px !important; background: var(--surface) !important; border-color: var(--border) !important; font-size: 13.5px !important; }
.cmd input:focus-visible { border-color: var(--focus) !important; border-radius: var(--r-pill) !important; }
.cmd > .i { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.cmd .hint { position: absolute; right: 8px; display: inline-flex; gap: 4px; pointer-events: none; }
.cmd .type { position: absolute; left: 42px; right: 84px; color: var(--muted); font-size: 13.5px; pointer-events: none; white-space: nowrap; overflow: hidden; }
.cmd .type::after { content: ""; display: inline-block; width: 1.5px; height: 14px; background: var(--accent); margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
.cmd input:focus ~ .type, .cmd input:not(:placeholder-shown) ~ .type { display: none; }
.cmd.typing input::placeholder { color: transparent; }

/* the palette */
dialog.palette { margin-top: 12vh; }
dialog.palette[open] { animation: pop var(--t-morph) var(--ease) both; }
dialog.palette .sheet { width: min(640px, calc(100vw - 24px)); background: var(--glass); backdrop-filter: saturate(160%) blur(24px); -webkit-backdrop-filter: saturate(160%) blur(24px); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--lift-2); overflow: hidden; }
dialog.palette .ask { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
dialog.palette .ask input { border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; min-height: 28px !important; font-size: 16px !important; border-radius: 0 !important; }
dialog.palette .results { max-height: min(52vh, 440px); overflow: auto; padding: 8px; }
dialog.palette .results .lab { padding: 10px 12px 4px; }
dialog.palette .opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text); font-size: 14px; text-decoration: none; }
dialog.palette .opt[aria-selected=true] { background: var(--band); }
dialog.palette .opt .meta { margin-left: auto; }
dialog.palette .foot { display: flex; gap: var(--s4); padding: 10px 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

/* the rail: icons with a small label; the active mark is the accent */
.rail { grid-row: 2; position: sticky; top: var(--top); align-self: start; height: calc(100dvh - var(--top)); overflow-y: auto; scrollbar-width: none; padding: var(--s3) 8px var(--s4); display: flex; flex-direction: column; gap: 2px; }
.rail::-webkit-scrollbar { display: none; }
.rail a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 2px 7px; border-radius: 14px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; text-align: center; line-height: 1.2; text-decoration: none; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.rail a:hover { background: var(--band); color: var(--text); text-decoration: none; }
.rail a.on { color: var(--text); background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.rail a.on::before { content: ""; position: absolute; left: -8px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); view-transition-name: rail-mark; }
.rail a .i { width: 20px; height: 20px; }
.rail .sep { height: 1px; background: var(--border); margin: 8px 12px; flex: none; }
.rail .badge, .tabbar .badge { position: absolute; top: 4px; right: 12px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.rail .badge:empty, .tabbar .badge:empty { display: none; }
.rail .end { margin-top: auto; }

main { grid-row: 2; min-width: 0; padding: var(--s5) var(--s6) var(--s8); max-width: 1360px; width: 100%; }
main:focus { outline: none; }
.pagehead { display: flex; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.pagehead .lede { margin-top: 6px; }
.pagehead .actions { margin-left: auto; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: var(--s3); }
.crumb:hover { color: var(--text); text-decoration: none; }

/* phones: the rail becomes a tab bar; the command pill becomes a button */
.tabbar { display: none; }
@media (max-width: 860px) {
  body.app { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  main { padding: var(--s4) var(--s4) calc(96px + env(safe-area-inset-bottom)); }
  .bar { padding: 0 var(--s3); gap: var(--s2); }
  .bar .mark > span:not(.glyph-mark), .bar .who > summary > span:not(.avatar), .cmd .hint, .bar .mode { display: none; }
  .bar .who > summary { padding: 3px; border: 0; background: none; }
  .bar .tenant > summary { max-width: 150px; }
  .cmd { flex: 1 1 auto; }
  .cmd input { padding-right: 14px !important; }
  .cmd .type { right: 14px; }
  .tabbar { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border-top: 1px solid var(--border); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none; border-radius: 12px; color: var(--muted); font-size: 10.5px; font-weight: 600; text-decoration: none; min-height: 48px; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on .i { color: var(--accent-ink); }
  .tabbar .badge { right: calc(50% - 22px); top: 2px; }
  .pagehead .actions { margin-left: 0; width: 100%; }
}
.navsheet a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--text); font-weight: 500; text-decoration: none; }
.navsheet a.on { background: var(--band); font-weight: 600; }
.navsheet .micro { margin: 16px 12px 4px; }

/* ---- the hero band on Home: the wash, two orbs, slow drift */
.hero { position: relative; border-radius: 24px; padding: var(--s6); overflow: hidden; isolation: isolate; background: linear-gradient(120deg, var(--wash-a) 0%, color-mix(in srgb, var(--wash-b) 55%, var(--wash-a)) 100%); border: 1px solid var(--border); }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(48px); opacity: .75; animation: drift 16s ease-in-out infinite alternate; }
.hero::before { width: 320px; height: 320px; right: -60px; top: -120px; background: var(--orb-a); }
.hero::after { width: 260px; height: 260px; right: 22%; bottom: -150px; background: var(--orb-b); animation-delay: -6s; }
.hero .tiles { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5; transform: translateY(calc(var(--scroll, 0) * -0.06px)); }
.hero .tiles i { position: absolute; border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); border-radius: 14px; animation: drift 14s ease-in-out infinite alternate; }
.hero .tiles i:nth-child(1) { width: 96px; height: 120px; right: 8%; top: 18%; }
.hero .tiles i:nth-child(2) { width: 72px; height: 72px; right: 20%; top: 52%; animation-delay: -5s; border-radius: 18px; }
.hero .tiles i:nth-child(3) { width: 132px; height: 84px; right: 2%; top: 58%; animation-delay: -9s; }
.hero .display { max-width: 16ch; }
.hero .lede { color: var(--text); opacity: .78; margin-top: var(--s3); }
@media (max-width: 640px) { .hero { padding: var(--s5) var(--s4); border-radius: 20px; } }

/* ---- the night scene: sign-in, the second step, onboarding */
body.night { min-height: 100dvh; display: grid; place-items: center; padding: var(--s5); position: relative; overflow-x: hidden; isolation: isolate;
  background: radial-gradient(900px 600px at 82% -10%, rgba(124, 140, 248, .38), transparent 60%), radial-gradient(800px 520px at 8% 110%, rgba(47, 191, 116, .22), transparent 60%), linear-gradient(160deg, #141850 0%, #0F123E 52%, #0B0E2E 100%); }
.night .feed { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.night .feed i { position: absolute; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .12); background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0)); animation: float 22s ease-in-out infinite alternate; }
.night .feed i:nth-child(1) { width: 180px; height: 230px; left: 6%; top: 12%; }
.night .feed i:nth-child(2) { width: 130px; height: 130px; left: 20%; bottom: 10%; animation-delay: -7s; }
.night .feed i:nth-child(3) { width: 220px; height: 150px; right: 7%; top: 16%; animation-delay: -3s; }
.night .feed i:nth-child(4) { width: 150px; height: 190px; right: 16%; bottom: 8%; animation-delay: -12s; }
.night .feed i:nth-child(5) { width: 90px; height: 90px; left: 44%; top: 6%; animation-delay: -16s; border-radius: 50%; background: radial-gradient(circle, rgba(255, 138, 69, .28), transparent 70%); border: 0; filter: blur(6px); }
.night .panel { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: var(--s6); box-shadow: var(--lift-2); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); animation: reveal var(--t-morph) var(--ease) both; }
.night .panel.wide { width: min(720px, 100%); }
.night .panel h1 { font-size: 30px; margin: var(--s4) 0 var(--s2); }
.night .panel p { color: var(--muted); }
.night .panel .stack { margin-top: var(--s5); }
.night .panel pre { background: var(--band); border-radius: var(--r-ctl); padding: var(--s4); font-size: 14px; line-height: 1.9; letter-spacing: .06em; columns: 2; }
.night .panel code { word-break: break-all; }
.night .fine { margin-top: var(--s5); font-size: 12.5px; color: var(--muted); }
.night .btn.sso { width: 100%; background: var(--band); color: var(--text); border-color: var(--border); }
.night .btn.sso:hover { background: rgba(255, 255, 255, .12); }
@media (max-width: 640px) { .night .panel { padding: var(--s5); border-radius: 20px; } }

/* a plain message page (a link that ran out, a refusal) */
.plainpage { max-width: 520px; margin: 14vh auto; padding: 0 var(--s5); }

/* What single pages need beyond the components. */

/* ---- review: the draft and what the decision rests on */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.shots img, .shots video { width: 100%; border-radius: 14px; border: 1px solid var(--border); background: var(--band); }
.shots img:only-child, .shots video:only-child { max-width: 440px; }
.review pre.words { margin: 8px 0 var(--s4); }
.review .side h3 { margin-bottom: 8px; }
.review .side .card { overflow-wrap: anywhere; }
.decide { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: 12px 16px; border-radius: 20px; background: var(--glass); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px); border: 1px solid var(--border); box-shadow: var(--lift-1); }
.decide #fees { width: 100%; font-size: 13px; }
.decide #reject { flex: 1 1 260px; flex-wrap: nowrap; }
.decide .kbd { background: transparent; border-color: currentColor; color: inherit; opacity: .7; }
@media (max-width: 860px) { .decide { bottom: calc(76px + env(safe-area-inset-bottom)); } }

/* ---- calendar: five weeks, light and thin */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cal .dow { background: var(--surface); padding: 10px 12px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cal .day { background: var(--surface); min-height: 112px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day.past { background: color-mix(in srgb, var(--surface) 55%, var(--band)); }
.cal .dn { font-size: 12px; font-weight: 600; color: var(--muted); width: max-content; min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; }
.cal .today .dn { background: var(--accent); color: var(--on-accent); }
.cal .ev { display: block; font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: 6px; background: var(--info-tint); color: var(--info-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.cal .ev.out { background: var(--success-tint); color: var(--success-ink); } .cal .ev.wait { background: var(--accent-tint); color: var(--accent-ink); }
.cal .ev:hover { filter: brightness(.97); }
@media (max-width: 860px) { .cal .day { min-height: 64px; padding: 4px; } .cal .ev { font-size: 0; height: 6px; padding: 0; border-radius: 999px; } .cal .dow { padding: 6px 4px; font-size: 10px; text-align: center; } .calwrap { padding: 8px; } }

/* ---- getting started: the dark band, as the sign-in is dark */
.nightband { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; gap: var(--s6); flex-wrap: wrap; padding: var(--s6); border-radius: 24px; color: #F5F6FB;
  background: radial-gradient(900px 500px at 85% -20%, rgba(124, 140, 248, .42), transparent 60%), radial-gradient(700px 420px at 0% 120%, rgba(47, 191, 116, .24), transparent 60%), linear-gradient(160deg, #141850 0%, #0F123E 52%, #0B0E2E 100%); box-shadow: var(--glow);
  --text: #F5F6FB; --muted: #B4B9D6; --track: rgba(255, 255, 255, .16); --accent: #9AA6FF; --on-accent: #0B0E2E; }
.nightband .micro, .nightband .lede { color: #B4B9D6; opacity: 1; }
.nightband .lede { margin-top: var(--s3); }
.nightband .feed { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.nightband .feed i { position: absolute; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .12); background: linear-gradient(160deg, rgba(255, 255, 255, .07), transparent); animation: float 20s ease-in-out infinite alternate; }
.nightband .feed i:nth-child(1) { width: 120px; height: 150px; right: 26%; top: -30px; } .nightband .feed i:nth-child(2) { width: 90px; height: 90px; right: 38%; bottom: -24px; animation-delay: -6s; } .nightband .feed i:nth-child(3) { width: 160px; height: 100px; right: -30px; bottom: 12px; animation-delay: -11s; }
.nightband .donut b { color: #FFFFFF; font-size: 26px; }
.stepno { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--band); color: var(--muted); font-size: 12.5px; font-weight: 700; }
.stepno.done { background: var(--success-tint); color: var(--success-ink); }
details.more-d { margin-top: var(--s3); font-size: 13px; }
details.more-d summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; width: max-content; border-radius: 6px; }
td.num, td time { white-space: nowrap; }
.tablewrap td:first-child { min-width: 180px; }
.tablewrap.nowrap1 td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 400; }

/* ---- pages with a bar of their own: the approver's link, the chat simulator, the staff console, the preview gallery */
body.solo { min-height: 100dvh; display: flex; flex-direction: column; }
body.solo .bar { flex: none; padding: 0 var(--s5); }
body.solo .bar .mark > span:not(.glyph-mark) { display: inline; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.solo .bar nav { margin-left: var(--s4); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
body.solo main { margin: 0 auto; flex: 1; }
@media (max-width: 860px) { body.solo .bar { padding: 0 var(--s4); } body.solo .bar nav .chip:not(.on) { display: none; } body.solo main { padding: var(--s4) var(--s4) var(--s7); } }

/* the approver's link: the picture beside the decision on a desk, above it on a phone */
.approve { max-width: 1120px; }
.approve .page { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s6); align-items: start; }
.approve .shot { position: sticky; top: calc(var(--top) + var(--s5)); }
.approve h1 { font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -.03em; line-height: 1.1; }
.approve .card h2 { font-size: 16px; }
.approve .decide { bottom: 12px; }
.approve .decide .btn.ok { flex: 1 1 160px; min-height: 48px; font-size: 15px; }
.approve .decide .btn.danger { margin-left: auto; }
.strip { display: flex; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.strip img, .strip video { flex: none; max-height: 420px; max-width: 100%; border-radius: 14px; border: 1px solid var(--border); background: var(--band); scroll-snap-align: start; }
.approve .strip img, .approve .strip video { max-height: none; width: 100%; border-radius: 20px; box-shadow: var(--lift-1); }
.approve .strip:has(> :nth-child(2)) > * { width: 86%; }
input.otp { font-size: 28px; font-weight: 600; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; height: 64px; }
@media (max-width: 860px) { .approve .page { grid-template-columns: minmax(0, 1fr); gap: var(--s4); } .approve .shot { position: static; } .approve .decide { bottom: calc(8px + env(safe-area-inset-bottom)); } .approve .decide .btn { flex: 1 1 40%; } .approve .decide .btn.danger { margin-left: 0; } }

/* the preview gallery */
.gallery { max-width: 1240px; }
.gallery .card h2 { margin: 4px 0; } .gallery h3 { margin: var(--s3) 0 6px; } .gallery h3:first-child { margin-top: 0; }
pre.mono { font: 11.5px/1.5 var(--mono); max-height: 320px; overflow: auto; }

/* the chat: who is sending, the thread, what to type */
.sim { display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: 264px minmax(0, 1fr) 280px; gap: var(--s4); align-items: stretch; max-width: 1360px; height: calc(100dvh - var(--top)); padding-bottom: var(--s5); }
.sim.one { grid-template-columns: minmax(0, 720px); justify-content: center; }
.sim > aside { display: flex; flex-direction: column; gap: var(--s3); overflow-y: auto; align-self: start; max-height: 100%; }
.sim .person { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 4px; border-radius: 14px; border: 1px solid transparent; background: none; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.sim .person:hover { background: var(--band); } .sim .person.on { background: var(--surface); border-color: var(--border-strong); box-shadow: var(--lift-1); }
.sim .person b { display: block; font-weight: 600; } .sim .person small { display: block; }
.sim .cheat .micro { margin-top: var(--s2); } .sim .cheat button.tag { cursor: pointer; border: 0; font: inherit; font-size: 12px; } .sim .cheat button.tag:hover { background: var(--accent-tint); color: var(--accent-ink); }
.chat { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat .head { display: flex; align-items: center; gap: 12px; padding: 14px var(--s4); border-bottom: 1px solid var(--border); margin: 0; }
.chat .log { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: 10px; background: radial-gradient(600px 300px at 100% 0, color-mix(in srgb, var(--orb-a) 30%, transparent), transparent 70%), var(--band); }
.chat .log .empty { margin: auto; }
.msg { max-width: min(74%, 520px); padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 8px; animation: rise var(--t-fade) var(--ease) both; }
.msg .t { white-space: pre-wrap; }
.msg.in { align-self: flex-end; background: var(--action); color: var(--on-action); border-bottom-right-radius: 6px; }
.msg.out { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.in a { color: inherit; text-decoration: underline; }
.msg img, .msg video { width: 280px; max-width: 100%; border-radius: 12px; display: block; }
.msg .att { font-size: 12.5px; opacity: .8; } .msg .att::before { content: "＋ "; }
.msg .dl { font-size: 12.5px; font-weight: 600; } .msg .mock { font-size: 11px; color: var(--faint); }
.msg .acts { display: flex; flex-direction: column; gap: 6px; }
.msg .acts button { font-weight: 600; font-size: 13.5px; min-height: 40px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--band); color: var(--info-ink); text-align: center; }
.msg .acts button:hover { border-color: var(--info); } .msg .acts small { display: block; font-weight: 400; }
.menurow { padding: 8px var(--s4) 0; background: var(--surface); border-top: 1px solid var(--border); } .menurow .tag { cursor: pointer; border: 0; font: inherit; font-size: 13px; padding: 6px 14px; }
.menurow + .composer { border-top: 0; }
.composer { display: flex; align-items: center; gap: var(--s2); padding: 12px var(--s4); border-top: 1px solid var(--border); background: var(--surface); }
.composer #text { flex: 1; min-width: 0; border-radius: var(--r-pill); height: 44px; padding: 0 18px; }
.composer .attach { position: relative; overflow: hidden; flex: none; } .composer .attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.composer .attach:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.chat .tips { padding: 0 var(--s4) 12px; background: var(--surface); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 1100px) { .sim { grid-template-columns: 220px minmax(0, 1fr); } .sim .cheat { display: none; } }
@media (max-width: 720px) { .sim { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; height: auto; } .sim .people { flex-direction: row; flex-wrap: wrap; } .sim .people #people { display: flex; gap: 4px; overflow-x: auto; width: 100%; } .sim .people .person { width: auto; flex: none; margin: 0; } .sim .people .meta { display: none; } .chat { height: calc(100dvh - var(--top) - 150px); min-height: 420px; } .sim.one .chat { height: calc(100dvh - var(--top) - 2 * var(--s4)); } .msg { max-width: 88%; } }

/* ---- tickets: the conversation that came with one */
ul.said { margin-top: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-ctl); background: var(--band); display: flex; flex-direction: column; gap: 8px; }
ul.said li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--s3); font-size: 13.5px; padding: 0; }
ul.said li b { font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } ul.said li.me b { color: var(--text); }
ul.said li span { white-space: pre-wrap; overflow-wrap: anywhere; }
.upload { max-width: 600px; } .upload > h2 { margin-top: var(--s4); font-size: 16px; }

/* ---- stories: a story's outputs, two to a row beside its own facts */
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .cards.two { grid-template-columns: minmax(0, 1fr); } }
.storycard .tags .pill { font-size: 11.5px; }
/* ---- the board: one column a stage, the cards a column holds; it scrolls sideways on a narrow screen */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(248px, 1fr); gap: var(--s3); overflow-x: auto; align-items: start; padding-bottom: var(--s3); scroll-snap-type: x proximity; }
.board .col { background: var(--band); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s3); min-height: 180px; scroll-snap-align: start; }
.board .col > h2 { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 2px 4px; }
.board .col > h2 .num { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 1px 8px; letter-spacing: 0; }
.board .card { padding: var(--s3); display: flex; flex-direction: column; gap: 10px; }
.board .card .title { font-size: 14px; }
.board .card .foot { margin-top: 0; padding-top: 10px; }
.board .none { padding: var(--s4) 4px; }
.savev { max-width: 420px; }
@media (max-width: 640px) { .board { grid-auto-columns: 82vw; } }
/* ---- the video desk: the video on the left, what was said on the right */
.vdesk { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s5); align-items: start; }
.vdesk .player { position: sticky; top: calc(var(--top) + var(--s4)); }
.vdesk video, .vdesk audio { width: 100%; border-radius: 14px; border: 1px solid var(--border); background: var(--band); display: block; }
.said { list-style: none; margin: 0; padding: 0; max-height: 68vh; overflow-y: auto; }
.said li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s3); padding: 8px 4px; border-bottom: 1px solid var(--border); align-items: baseline; }
.said li:last-child { border-bottom: 0; }
.said .at { font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--info-ink); background: var(--info-tint); border: 0; border-radius: var(--r-chip); padding: 2px 8px; cursor: pointer; text-align: center; }
.said .at:hover { filter: brightness(.97); }
.said .who { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.said mark { background: var(--warn-tint); color: var(--warn-ink); border-radius: 3px; padding: 0 2px; }
@media (max-width: 900px) { .vdesk { grid-template-columns: minmax(0, 1fr); } .vdesk .player { position: static; } }
.list.clips .at { font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--info-ink); background: var(--info-tint); border: 0; border-radius: var(--r-chip); padding: 4px 8px; cursor: pointer; white-space: nowrap; }
.menu.make > summary { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); cursor: pointer; }
.menu.make .pop { min-width: 240px; } .menu.make form.mk { padding: 8px 12px; display: grid; gap: 6px; } .menu.make form.mk > button { all: unset; display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 14px; }
/* ---- graphics on video: the form beside its live preview */
.gform { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s5); align-items: start; }
.gform .prev { position: sticky; top: calc(var(--top) + var(--s4)); }
.gform .prev img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 14px; border: 1px solid var(--border); background: var(--band); display: block; }
.gform .on li form { display: contents; }
@media (max-width: 900px) { .gform { grid-template-columns: minmax(0, 1fr); } .gform .prev { position: static; } }
/* ---- a post's channels: one panel each, with exactly what it carries */
.chanpanel pre.words.chan { margin: 6px 0 0; max-height: 220px; overflow: auto; font-size: 13px; }
/* ---- the assistant's requests, each with its steps */
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.steps li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.steps li.success { color: var(--success-ink); } .steps li.info { color: var(--info-ink); } .steps li.risk { color: var(--risk-ink); }
.asks button.tag, .tags button.tag { cursor: pointer; border: 0; font: inherit; font-size: 12px; }
/* the legal pages: one readable column */
main.legal { max-width: 760px; margin: 0 auto; padding: var(--s6) var(--s4) var(--s7); }
.prose h1 { font-size: 32px; margin: 0 0 var(--s4); } .prose h2 { font-size: 20px; margin: var(--s6) 0 var(--s2); } .prose h3 { font-size: 16px; margin: var(--s5) 0 var(--s2); }
.prose p, .prose li { font-size: 15px; line-height: 1.65; color: var(--text); } .prose p { margin: 0 0 var(--s3); } .prose ul { margin: 0 0 var(--s3); padding-left: 1.2em; } .prose li { margin-bottom: 6px; }
.prose p.note { background: var(--band); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: var(--s3) var(--s4); font-size: 14px; }
ul.plain { list-style: none; padding: 0; margin: var(--s3) 0; display: flex; flex-direction: column; gap: 8px; }
/* connecting an account: the numbered steps beside a field, and an account to pick */
ol.howto { margin: 6px 0 12px; padding-left: 1.3em; display: grid; gap: 4px; }
label.pick { cursor: pointer; display: block; } label.pick:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; } label.pick input { flex: none; }
.acct { display: flex; gap: 12px; align-items: center; min-width: 0; } .acct img { border-radius: 50%; object-fit: cover; flex: none; background: var(--band); }
/* the platform console: a staff tool in the product's look, one wide column */
main.platform { max-width: 1280px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
@media (max-width: 640px) { main.platform { padding: var(--s4) var(--s3) var(--s6); } }
/* the approver's link on a phone: three decisions in one row within reach of a thumb, type that reads without zooming,
   several pictures as a row to swipe */
.approve .decide { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px; }
.approve .decide .btn { min-height: 52px; font-size: 16px; justify-content: center; margin: 0; }
.approve h2[id] { scroll-margin-top: 16px; }
@media (max-width: 520px) {
  .approve .page { animation: none; transform: none; }          /* a moving ancestor would carry the fixed bar along with the page */
  .approve .decide { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 20; }      /* always under the thumb, wherever the page is scrolled to */
  .approve pre.words { font-size: 15px; line-height: 1.55; } .approve h1 { font-size: 24px; line-height: 1.2; }
  .approve .strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; -webkit-overflow-scrolling: touch; } .approve .strip > * { flex: 0 0 100%; scroll-snap-align: center; }
  .approve main, main.approve { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .upload .btn { min-height: 48px; } .upload form .btn:not(.sm) { width: 100%; justify-content: center; }
}

/* ---- the front door (contentops/web/front.py): a public page, phone first, in the same tokens as the app */
body.frontdoor { background: var(--page); color: var(--text); }
.fbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); max-width: 1120px; margin: 0 auto; }
.fbar .mark { display: inline-flex; flex-direction: row; align-items: center; gap: var(--s2); font-weight: 600; text-decoration: none; color: var(--text); }
.fbar nav { display: flex; align-items: center; gap: var(--s4); font-size: 14px; } .fbar nav a:not(.btn) { color: var(--muted); text-decoration: none; display: none; }
main.front { max-width: 1120px; margin: 0 auto; padding: 0 var(--s4) var(--s7); } main.front section { margin-top: var(--s7); } main.front h2 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 var(--s4); }
.fhero { padding-top: var(--s6); } .fhero .lede { font-size: 17px; line-height: 1.55; margin: var(--s4) 0 var(--s5); color: var(--text); max-width: 60ch; } .fhero .row, .fend .row { align-items: center; gap: var(--s3); flex-wrap: wrap; }
.fsteps { list-style: none; padding: 0; margin: 0 0 var(--s3); display: grid; gap: var(--s6); grid-template-columns: 1fr; } .fstep { display: block; }
.fstep .fh { font-size: 19px; font-weight: 600; letter-spacing: -.01em; text-transform: none; color: var(--text); margin: var(--s1) 0 var(--s2); } .fstep p.meta { font-size: 15px; line-height: 1.55; max-width: 44ch; }
.fshot { border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; background: var(--surface); margin-bottom: var(--s4); max-width: 390px; box-shadow: var(--lift-1); }
.fshot img { display: block; width: 100%; height: auto; aspect-ratio: 390 / 780; object-fit: cover; object-position: top; }
.fplans { display: grid; gap: var(--s4); grid-template-columns: 1fr; } .card.plan .price { margin: var(--s2) 0 var(--s1); } .card.plan .price b { font-size: 30px; letter-spacing: -.02em; }
.ticks { list-style: none; padding: 0; margin: var(--s3) 0 0; } .ticks li { padding-left: 22px; position: relative; margin-bottom: 6px; font-size: 14px; } .ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--success-strong); font-weight: 700; }
.fincl { margin-top: var(--s5); grid-template-columns: 1fr; } .fincl h3 { font-size: 16px; margin: 0 0 var(--s2); } .fincl ul.plain li { margin-bottom: 8px; font-size: 14px; }
.qa { border-bottom: 1px solid var(--border); padding: var(--s3) 0; } .qa summary { cursor: pointer; font-weight: 600; font-size: 16px; } .qa p { margin: var(--s2) 0 0; color: var(--muted); max-width: 70ch; line-height: 1.6; }
.fend { text-align: left; border-top: 1px solid var(--border); padding-top: var(--s6); }
.ffoot { max-width: 1120px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); font-size: 13px; color: var(--muted); display: grid; gap: var(--s2); border-top: 1px solid var(--border); } .ffoot a { color: var(--muted); }
@media (min-width: 760px) { .fbar nav a:not(.btn) { display: inline; } .fsteps { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fplans { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fincl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fhero { padding-top: var(--s7); } }
/* the T brand on the front door: soft lilac and mint glows behind the hero, the wave gradient on the one headline word, leaf-green calls to action */
.fhero { position: relative; isolation: isolate; } .fhero .fglow { position: absolute; z-index: -1; inset: -40px -16px auto; height: 420px; pointer-events: none;
  background: radial-gradient(360px 260px at 18% 30%, var(--orb-b), transparent 70%), radial-gradient(420px 300px at 78% 20%, var(--orb-a), transparent 70%), radial-gradient(300px 220px at 60% 85%, var(--orb-c), transparent 70%); filter: blur(12px); opacity: .9; }
:root[data-theme="dark"] .fhero .fglow { opacity: .55; }
.fhero h1.display { font-size: clamp(40px, 7vw, 68px); line-height: 1.04; letter-spacing: -.03em; font-weight: 700; color: var(--text); text-wrap: balance; margin: 0; }
.frontdoor .btn.accent { background: var(--action); color: var(--on-action); } .frontdoor .btn.accent:hover { background: var(--action-hover); filter: none; }
.fbar .glyph-mark, .fbar .glyph-mark svg { width: 34px; height: 34px; } .fbar .mark > span:last-child { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.card.plan { border-radius: 20px; } .card.plan.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--lift-2); }
.fshot { border-radius: 24px; }

/* Motion: morphs of 300-500ms with ease-out, 200-300ms dissolves between pages, skeletons that become content,
   charts that draw in once, a gentle drift on hero, sign-in and empty states only. No slides, no flips. */
@keyframes fade { from { opacity: 0; } }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes drawer { from { opacity: 0; transform: translateX(24px); } }
@keyframes sheet { from { opacity: 0; transform: translateY(24px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 40%, transparent); } 60% { box-shadow: 0 0 0 5px transparent; } }
@keyframes drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-14px, 10px, 0); } }
@keyframes float { from { transform: translate3d(0, 0, 0) rotate(-1.5deg); } to { transform: translate3d(18px, -22px, 0) rotate(1.5deg); } }
@keyframes stamp { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }

/* Pages dissolve into each other; an element that is the same thing on both pages (a post's picture, the rail's
   active mark, the page title) morphs between its two places. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade var(--t-fade) var(--ease) reverse both; }
::view-transition-new(root) { animation: fade var(--t-fade) var(--ease) both; }
::view-transition-group(*) { animation-duration: var(--t-morph); animation-timing-function: var(--ease); }
::view-transition-old(*), ::view-transition-new(*) { animation-duration: var(--t-fade); }
.bar { view-transition-name: bar; } .rail { view-transition-name: rail; } .tabbar { view-transition-name: tabbar; }

main > * { animation: reveal var(--t-morph) var(--ease) both; }
main > *:nth-child(2) { animation-delay: 40ms; } main > *:nth-child(3) { animation-delay: 80ms; } main > *:nth-child(n+4) { animation-delay: 120ms; }
.stamp { animation: stamp var(--t-morph) var(--ease) both; }

/* Anyone who asks for less motion gets none: no drift, no draw-in, no morph; states still change, at once. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .card.lift:hover, .card.lift:focus-within { transform: none; }
  .cmd .type::after { display: none; }
  .hero .tiles { transform: none; }
}

