/* ── foundation: the hazevio.com system, carried into both portals ──
   Tokens are the public site's (hazevio-web app/globals.css), so the app reads as the product the site sold.
   The two typefaces are self-hosted (server/static-assets.ts); portal-shell.ts fills in their hashed file names at load. */
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/bricolage-grotesque-a97804dc9f.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/instrument-sans-2ee17598a9.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
:root {
  --bone: #f8f6f2; --bone-2: #efece6; --bone-3: #e5e0d7; --paper: #ffffff;
  --mist: #efedf9; --mist-2: #e3dff7;
  --ink: #17130e; --ink-2: #574f44; --ink-3: #6b6356;
  --line: #e3dfd7; --line-2: #cfc8bc;
  --volt: #5b2eff; --volt-2: #4a1fe0; --volt-soft: #e9e2ff; --volt-ink: #ffffff;
  --ok: #1f7a3a; --ok-soft: #e4f3e8; --warn: #8a5a00; --warn-soft: #fbf0d9; --err: #b3261e; --err-soft: #fbe6e4;
  --radius: 16px; --radius-sm: 10px; --radius-xs: 6px;
  --shadow-1: 0 1px 2px rgba(23, 19, 14, 0.04), 0 6px 20px rgba(23, 19, 14, 0.05);
  --shadow-2: 0 2px 4px rgba(23, 19, 14, 0.05), 0 14px 36px rgba(23, 19, 14, 0.09);
  --shadow-volt: 0 10px 28px rgba(91, 46, 255, 0.22);
  --rail: 15.5rem;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
* { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bone); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
/* The site's violet aura, behind everything and never over content. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60rem 36rem at 100% -10%, rgba(91, 46, 255, 0.10), transparent 60%), radial-gradient(40rem 30rem at -10% 110%, rgba(91, 46, 255, 0.05), transparent 60%); }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--volt); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5rem; text-wrap: balance; }
h1 { font-size: 2rem; line-height: 1.12; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.0625rem; letter-spacing: -0.01em; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--ink-3); }
.eyebrow { display: block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.4rem; }
.lede { font-size: 1.0625rem; color: var(--ink-2); max-width: 44rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; padding: 0.6rem 1rem; border-radius: var(--radius-sm); background: var(--ink); color: var(--paper); }
.skip:focus { top: 1rem; }

/* ── the mark and wordmark (hazevio-web _components/Logo.tsx) ── */
.logo { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--ink); }
.logo svg { width: 1.75rem; height: 1.75rem; flex: 0 0 auto; }
.logo-word { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.03em; line-height: 1; }
.logo-word em { font-style: normal; color: var(--volt); }
.logo-tag { margin-left: 0.15rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── customer shell: a labelled sidebar on a desktop, an icon rail on a tablet, a tab bar on a phone ── */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.125rem; padding: 1.25rem 0.875rem 1rem; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(12px); }
.rail .logo { padding: 0 0.625rem 1.25rem; }
.rail a.nav { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0 0.75rem; border-radius: var(--radius-sm); font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--ink-2); transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.rail a.nav svg { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.rail a.nav:hover { background: var(--bone-2); color: var(--ink); }
.rail a.nav[aria-current="page"] { background: var(--volt-soft); color: var(--volt-2); font-weight: 600; }
.rail .soon { margin-left: auto; padding: 0.05rem 0.45rem; border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-3); }
.rail .rail-sep { height: 1px; margin: 0.75rem 0.75rem; background: var(--line); }
.rail .spacer { flex: 1; min-height: 1rem; }
.rail a.more { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 0.75rem; min-height: 3.75rem; padding: 0.5rem 2rem; border-bottom: 1px solid var(--line); background: rgba(248, 246, 242, 0.82); backdrop-filter: blur(12px); }
.topbar .grow { flex: 1; }
.topbar form { margin: 0; }
.topbar .logo { display: none; }
.who { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-2); font-size: 0.875rem; min-width: 0; }
.who .avatar { display: grid; place-items: center; width: 2rem; height: 2rem; flex: 0 0 auto; border-radius: 999px; background: var(--volt-soft); color: var(--volt-2); font-weight: 700; font-size: 0.8125rem; }
.who .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16rem; }
.page { width: 100%; max-width: 76rem; padding: 2rem 2rem 4rem; }

/* ── surfaces ── */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-1); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.0625rem; }
.panel-body { padding: 1.25rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.notice { padding: 0.8rem 1rem; border-radius: var(--radius-sm); margin: 0 0 1.25rem; border: 1px solid var(--line-2); background: var(--paper); box-shadow: var(--shadow-1); }
.notice.err { border-color: var(--err); background: var(--err-soft); color: var(--err); }
.notice.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: 0.35rem 0 0; color: var(--ink-2); }
.page-head .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── empty and failed states: a designed state, never a bare dashed box ── */
.empty { display: grid; justify-items: center; gap: 0.5rem; padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-2); background: linear-gradient(180deg, var(--paper), rgba(255, 255, 255, 0.6)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
/* One 9:16 frame, the product's only output shape, drawn in CSS (the CSP admits no data: images). */
.empty::before { content: ""; width: 1.15rem; height: 2rem; margin: 0.9rem 0 1.15rem; border: 2px solid var(--volt); border-radius: 5px; background: var(--paper); box-shadow: 0 0 0 0.85rem var(--volt-soft); transform: rotate(-8deg); }
.empty > * { margin: 0; max-width: 36rem; }
.empty b, .empty strong { color: var(--ink); font-family: var(--display); font-size: 1.125rem; letter-spacing: -0.01em; }
.empty .btn, .empty p:has(.btn) { margin-top: 0.5rem; }

/* ── controls ── */
label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--ink-2); margin: 0.9rem 0 0.35rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], input[type="number"], textarea, select {
  width: 100%; min-height: 2.75rem; padding: 0.6rem 0.85rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); font: inherit; transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
select { width: auto; max-width: 100%; }
input:hover, textarea:hover, select:hover { border-color: var(--ink-3); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--volt); box-shadow: 0 0 0 3px rgba(91, 46, 255, 0.22); }
a:focus-visible, button:focus-visible, summary:focus-visible, video:focus-visible, input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
input[readonly] { background: var(--bone-2); color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.75rem; white-space: nowrap; padding: 0.55rem 1.15rem; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; font-size: 0.9375rem; cursor: pointer; text-decoration: none; transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease); }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); box-shadow: var(--shadow-volt); }
.btn-primary:hover { background: var(--volt-2); border-color: var(--volt-2); }
.btn-quiet { border-color: var(--line-2); font-weight: 500; }
.btn-danger { border-color: var(--err); color: var(--err); }
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn-sm { min-height: 2.25rem; padding: 0.35rem 0.9rem; font-size: 0.875rem; }
button[disabled], .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

/* ── tables and status ── */
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(239, 236, 230, 0.45); }
th { font-weight: 600; color: var(--ink-3); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(248, 246, 242, 0.7); }
.pill { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-2); }
.pill::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 999px; background: currentColor; opacity: 0.85; }
.pill.needs { border-color: transparent; background: var(--volt-soft); color: var(--volt-2); }
.pill.running { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.pill.ready { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.pill.failed { border-color: transparent; background: var(--err-soft); color: var(--err); }
.strip { display: grid; gap: 0.5rem; margin: 0 0 1.5rem; }
.strip .row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 0; padding: 0.75rem 0.75rem 0.75rem 1.1rem; border: 1px solid var(--line); border-left: 4px solid var(--volt); border-radius: var(--radius-sm); background: var(--paper); box-shadow: var(--shadow-1); }

/* ── sign in: a form beside what the product makes ── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.auth { display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 28rem; margin: 0 auto; padding: 3rem 1.5rem; }
.auth .logo { margin: 0 0 2.5rem; }
.auth h1 { font-size: 2.25rem; }
.auth form .btn { width: 100%; margin-top: 1.25rem; }
.auth .muted a { color: var(--volt-2); font-weight: 600; }
.auth-side { position: relative; display: grid; align-content: center; gap: 1.5rem; padding: 3rem; overflow: hidden; background: linear-gradient(160deg, var(--mist), var(--mist-2)); border-left: 1px solid var(--line); }
.auth-side h2 { font-size: 2rem; max-width: 22rem; }
.auth-side h2 em { font-style: normal; color: var(--volt); }
.auth-side p { color: var(--ink-2); max-width: 26rem; }
.auth-reel { display: flex; gap: 1rem; align-items: flex-end; }
.auth-reel img { width: 30%; max-width: 11rem; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow-2); border: 4px solid var(--paper); }
.auth-reel img:nth-child(2) { transform: translateY(-1.5rem); }
.auth-solo { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-solo .auth { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 2.5rem 2rem; min-height: 0; }

/* A tablet: the sidebar folds to an icon rail with its labels kept, at a readable size. */
@media (max-width: 64rem) {
  :root { --rail: 5.75rem; }
  .rail { padding: 1rem 0.5rem; align-items: stretch; }
  .rail .logo { justify-content: center; padding: 0 0 1rem; }
  .rail .logo-word { display: none; }
  .rail a.nav { flex-direction: column; justify-content: center; gap: 0.25rem; min-height: 3.5rem; padding: 0.4rem 0.25rem; font-size: 0.75rem; text-align: center; }
  .rail .soon { margin: 0; font-size: 0.625rem; padding: 0 0.35rem; }
  .rail .rail-sep { margin: 0.5rem 0.5rem; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
/* A phone: a bottom tab bar of the four places people go most, and "More" for the rest (a real page, /app/menu). */
@media (max-width: 40rem) {
  body { font-size: 15px; }
  h1 { font-size: 1.75rem; }
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; top: auto; height: auto; overflow: visible; flex-direction: row; gap: 0; padding: 0.35rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.94); }
  .rail .logo, .rail .rail-sep, .rail .spacer, .rail a.nav.extra { display: none; }
  .rail a.nav, .rail a.more { display: flex; flex: 1 1 0; flex-direction: column; justify-content: center; gap: 0.2rem; min-height: 3.25rem; padding: 0.3rem 0.1rem; font-size: 0.75rem; text-align: center; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); font-weight: 500; }
  .rail a.more svg { width: 1.25rem; height: 1.25rem; }
  .rail a.more[aria-current="page"] { background: var(--volt-soft); color: var(--volt-2); font-weight: 600; }
  .topbar { padding: 0.5rem 1rem; }
  .topbar .logo { display: inline-flex; }
  .topbar .logo svg { width: 1.5rem; height: 1.5rem; }
  .topbar .logo-word { font-size: 1.125rem; }
  .who .name { display: none; }
  .page { padding: 1.25rem 1rem 7rem; }
  /* A field focused near the bottom scrolls clear of the tab bar rather than under it. */
  html { scroll-padding-bottom: 6rem; }
  .card { padding: 1.15rem; }
  th, td { padding: 0.6rem 0.5rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
textarea { resize: vertical; }

/* ── products (server/portal-products.ts) ── */
.imports { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 0 0 1.5rem; }
.import { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; min-width: 0; box-shadow: var(--shadow-1); }
.import h2 { font-size: 1.05rem; }
.check { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.9rem; color: var(--ink); margin: 0.75rem 0 0; }
.check input { margin-top: 0.2rem; flex: 0 0 auto; }
.confirm { background: var(--paper); border: 1px solid var(--volt); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1.5rem; box-shadow: var(--shadow-1); }
.pgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); margin: 0 0 1.5rem; }
.pcard { display: grid; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; min-width: 0; box-shadow: var(--shadow-1); }
.pcard:hover, .acard:hover, .acct-link:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.pcard, .acard, .acct-link { transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease); }
.pcard-img, .pcard .ph { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--bone-2); }
.pcard-body { display: grid; gap: 0.15rem; padding: 0.75rem; overflow-wrap: anywhere; font-size: 0.92rem; }
.ph { background: var(--bone-2); display: grid; place-items: center; color: var(--ink-3); font-size: 0.85rem; }
.pimages { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); max-width: 60rem; margin: 0 0 1.5rem; }
.pimages figure { margin: 0; }
.pimages img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }
.pimages figcaption { font-size: 0.8rem; color: var(--ink-2); margin-top: 0.25rem; }
.wide-ish { max-width: 40rem; }
.err-text { color: var(--err); }
.rule { font-size: 0.85rem; color: var(--ink-2); border-left: 3px solid var(--warn); padding: 0.25rem 0 0.25rem 0.6rem; margin: 0.75rem 0 0; }
.outcomes li { margin: 0.2rem 0; }
/* ── admin portal (server/admin.ts): dense, tabular, a grouped side nav ── */
.page.wide { max-width: 90rem; }
.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.range, .tabs { margin: 0 0 1rem; color: var(--ink-2); font-size: 0.92rem; }
.kpis { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 0 0 1.5rem; }
.kpi { display: grid; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; gap: 0.15rem; box-shadow: var(--shadow-1); }
.kpi a { display: grid; gap: 0.15rem; text-decoration: none; }
.kpi-v { font-family: var(--display); font-size: 1.6rem; font-weight: 700; }
.kpi-l { font-size: 0.82rem; color: var(--ink-2); }
.kpi-d { font-size: 0.78rem; color: var(--ink-3); }
.charts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); margin: 0 0 1.5rem; }
.charts > * { min-width: 0; }
.chart { margin: 0; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.chart figcaption { margin: 0 0 0.5rem; }
.chart .bar-a { fill: var(--volt); }
.chart .bar-b { fill: var(--err); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--ink); fill-opacity: 0.05; }
.chart-base { stroke: var(--line-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart details { margin-top: 0.5rem; font-size: 0.88rem; }
.feed { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.35rem; overflow-wrap: anywhere; }
.feed li { padding: 0.5rem 0.75rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.92rem; }
.feed-kind { display: inline-block; min-width: 4.5rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.split { display: grid; gap: 1.5rem; grid-template-columns: minmax(16rem, 1fr) 2fr; }
/* A grid item defaults to min-width: auto, so a wide table inside stretched the column instead of scrolling in its wrapper. */
.split > * { min-width: 0; }
.worklist { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.4rem; }
.worklist li { padding: 0.6rem 0.8rem; border: 1px solid var(--line); border-left: 3px solid var(--volt); border-radius: var(--radius-sm); background: var(--paper); }
.worklist a { text-decoration: none; display: block; }
.worklist a::after { content: " \2192"; color: var(--volt); }
.qr { width: 13rem; max-width: 100%; margin: 0.75rem 0; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0.25rem; }
.qr svg { display: block; width: 100%; height: auto; }
details summary { cursor: pointer; color: var(--ink-2); margin: 0.25rem 0; }
.table-wrap { position: relative; overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1.5rem; box-shadow: var(--shadow-1); }
.table-wrap table { min-width: 40rem; }
.facts { display: grid; gap: 0.75rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin: 0 0 1.5rem; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; box-shadow: var(--shadow-1); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem; font-size: 0.85rem; margin: 0 0 0.75rem; }
.plain { padding-left: 1.1rem; overflow-wrap: anywhere; }
.secret code { font-size: 1.15rem; letter-spacing: 0.08em; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; display: inline-block; overflow-wrap: anywhere; }
.search-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem; margin: 0 0 1rem; }
.search-form label { width: 100%; margin: 0; }
.search-form input { flex: 1; max-width: 24rem; }
.narrow { max-width: 26rem; }
.kv { display: inline-block; margin: 0 0.5rem 0.15rem 0; font-size: 0.85rem; }
.search-form select { padding: 0.55rem 0.6rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); font: inherit; }
.chart-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart svg { display: block; width: 100%; height: 8rem; overflow: visible; }
/* Labels as HTML in one equal column per bar (server/chart.ts): they line up with the bars at any width. */
.chart-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); font-size: 0.75rem; color: var(--ink-3); line-height: 1.2; }
.chart-cols span { text-align: center; white-space: nowrap; overflow: visible; }
.chart-values { min-height: 1.1rem; font-weight: 600; color: var(--ink-2); }
.chart-ticks { margin-top: 0.4rem; }
.chart-empty { display: grid; place-items: center; min-height: 9.5rem; margin: 0; padding: 1rem; text-align: center; color: var(--ink-3); background: repeating-linear-gradient(0deg, transparent 0 1.9rem, var(--line) 1.9rem calc(1.9rem + 1px)); border-radius: var(--radius-sm); }
@media (max-width: 52rem) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; }
  .page.wide { padding: 1rem; }
}

/* ── make (server/portal-make.ts): composer, ad cards, the run workspace ── */
.small { font-size: 0.85rem; }
.accent { color: var(--volt); }
.h3 { font-size: 1.05rem; margin-top: 1.25rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.chip { padding: 0.35rem 0.8rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--paper); text-decoration: none; font-size: 0.9rem; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.composer { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin: 0 0 2rem; box-shadow: var(--shadow-1); }
.fields { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.fields > div { min-width: 0; }
.fields select, .fields input { width: 100%; }
.fields p { margin: 0.3rem 0 0; }
.est { max-width: 44rem; margin: 0 0 0.75rem; }
.est th { text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: var(--ink); font-weight: 500; }
.est td { color: var(--ink-2); }
.spend { margin: 0.75rem 0; font-size: 0.92rem; }
.meter { display: block; height: 0.4rem; max-width: 24rem; margin-top: 0.4rem; background: var(--bone-2); border-radius: 999px; overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--volt); }
.refusal { padding: 0.75rem 1rem; border: 1px solid var(--warn); border-left-width: 4px; border-radius: var(--radius-sm); background: var(--paper); color: var(--ink); }
.setup { display: grid; gap: 0.75rem; padding: 0; list-style: none; counter-reset: s; margin: 0 0 2rem; max-width: 44rem; }
.setup li { counter-increment: s; padding: 1rem 1.25rem 1rem 3rem; position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-2); box-shadow: var(--shadow-1); }
.setup li::before { content: counter(s); position: absolute; left: 1rem; top: 1rem; font-weight: 700; color: var(--ink-3); }
.setup li.now { border-color: var(--volt); color: var(--ink); }
.setup li.now::before { color: var(--volt); }
.agrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); margin: 0 0 2rem; }
.acard { position: relative; display: grid; align-content: start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; min-width: 0; box-shadow: var(--shadow-1); }
.acard-media { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; background: var(--bone-2); }
/* A landscape ad keeps the grid's card shape and shows its whole picture, letterboxed, rather than its middle third. */
.acard-media.wide { object-fit: contain; background: var(--ink); }
.acard-body { display: grid; justify-items: start; gap: 0.3rem; padding: 0.7rem; overflow-wrap: anywhere; font-size: 0.92rem; }
.acard.s-needs { border: 2px solid var(--volt); }
.acard.s-running::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 0.35rem; background: repeating-linear-gradient(135deg, var(--warn) 0 0.5rem, transparent 0.5rem 1rem); }
.acard.s-failed::before { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 1.6rem 1.6rem 0; border-color: transparent var(--err) transparent transparent; z-index: 1; }
.tag { display: inline-block; padding: 0.05rem 0.5rem; border-radius: var(--radius-xs); background: var(--ink); color: var(--paper); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.ws { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 1fr); align-items: start; }
.canvas { min-width: 0; }
.player, .still-img { display: block; width: 100%; max-width: 26rem; aspect-ratio: 9 / 16; object-fit: cover; background: var(--ink); border-radius: var(--radius); }
/* A landscape ad (lib/ugc/aspect.ts): its own shape, wider, never cropped to a phone frame. */
.player.wide { max-width: 48rem; aspect-ratio: 16 / 9; object-fit: contain; }
.still { margin: 0; }
.still-img { background: var(--bone-2); aspect-ratio: 1; max-width: 32rem; }
.still-img.wide { aspect-ratio: 16 / 9; max-width: 48rem; object-fit: contain; background: var(--ink); }
.ph.big { aspect-ratio: 1; max-width: 32rem; border-radius: var(--radius); padding: 1rem; text-align: center; }
.side-panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; overflow-wrap: anywhere; box-shadow: var(--shadow-1); }
.side-panel h1 { font-size: 1.5rem; }
.stages { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.35rem; }
.st { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0 0.5rem; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.9rem; }
.st-n { grid-row: span 2; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--bone-2); font-weight: 600; font-size: 0.8rem; }
.st-l { font-weight: 600; }
.st-s { color: var(--ink-2); font-size: 0.85rem; }
.st.done .st-n { background: var(--ok); color: #fff; }
.st.run { border-color: var(--warn); }
.st.run .st-n { background: var(--warn); color: #fff; }
.st.next { border-color: var(--volt); }
.st.next .st-n { background: var(--volt); color: #fff; }
.st.fail { border-color: var(--err); }
.st.fail .st-n { background: var(--err); color: #fff; }
.st.skip { color: var(--ink-3); border-style: dashed; }
.failure { padding: 0.75rem 1rem; border: 1px solid var(--err); border-radius: var(--radius-sm); margin: 0 0 0.75rem; }
.failure .pre { margin: 0.5rem 0; }
.money { font-size: 0.92rem; }
.kvs { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 0.75rem; margin: 0; font-size: 0.9rem; }
.kvs dt { color: var(--ink-3); }
.kvs dd { margin: 0; }
.cast { border: 0; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); }
.cast legend { font-weight: 600; margin-bottom: 0.5rem; padding: 0; }
.cast-opt { display: grid; gap: 0.3rem; margin: 0; padding: 0.4rem; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; color: var(--ink); }
.cast-opt:has(input:checked) { border-color: var(--volt); }
.cast-opt input { justify-self: start; }
.cast-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--radius-sm); display: block; }
/* A landscape run's presenters and composite, shown whole: the framing is what the seller is approving. */
.cast-img.wide { aspect-ratio: 16 / 9; object-fit: contain; background: var(--ink); }
@media (max-width: 52rem) {
  .ws { grid-template-columns: 1fr; }
  /* The canvas stays the object, but at most 45% of a phone screen, so its controls are reachable. */
  .ws .player, .ws .still-img, .ws .ph.big { max-height: 45vh; width: auto; max-width: 100%; margin-inline: auto; }
  .ws .cast .cast-img { max-height: none; }
}
.meter-fill.w0 { width: 0%; }
.meter-fill.w5 { width: 5%; }
.meter-fill.w10 { width: 10%; }
.meter-fill.w15 { width: 15%; }
.meter-fill.w20 { width: 20%; }
.meter-fill.w25 { width: 25%; }
.meter-fill.w30 { width: 30%; }
.meter-fill.w35 { width: 35%; }
.meter-fill.w40 { width: 40%; }
.meter-fill.w45 { width: 45%; }
.meter-fill.w50 { width: 50%; }
.meter-fill.w55 { width: 55%; }
.meter-fill.w60 { width: 60%; }
.meter-fill.w65 { width: 65%; }
.meter-fill.w70 { width: 70%; }
.meter-fill.w75 { width: 75%; }
.meter-fill.w80 { width: 80%; }
.meter-fill.w85 { width: 85%; }
.meter-fill.w90 { width: 90%; }
.meter-fill.w95 { width: 95%; }
.meter-fill.w100 { width: 100%; }
/* ── ship (server/portal-ship.ts): calendar, connections, scheduling, analytics ── */
.calnav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: 0.75rem; margin: 0 0 0.5rem; }
.calnav a:last-child { justify-self: end; text-align: right; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 1rem; }
.dow { background: var(--bone-2); padding: 0.4rem; font-size: 0.75rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.day { background: var(--paper); min-height: 6.5rem; padding: 0.35rem; display: grid; align-content: start; gap: 0.25rem; min-width: 0; }
.day.out { background: var(--bone); color: var(--ink-3); }
.day.today { box-shadow: inset 0 0 0 2px var(--volt); }
.day .n { font-size: 0.8rem; font-weight: 600; }
.day .dfull { display: none; font-size: 0.85rem; font-weight: 600; }
.chip-post { display: grid; padding: 0.2rem 0.35rem; border-radius: var(--radius-xs); border-left: 3px solid var(--line-2); background: var(--bone-2); font-size: 0.75rem; text-decoration: none; overflow-wrap: anywhere; line-height: 1.3; }
.chip-post i { font-style: normal; color: var(--ink-2); }
.chip-post.ready { border-left-color: var(--ok); }
.chip-post.failed { border-left-color: var(--err); }
.chip-post.running { border-left-color: var(--ink-3); }
.chip-post:focus-visible { outline: 2px solid var(--volt); outline-offset: 1px; }
.conns { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); margin: 0 0 1rem; }
.conn { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; min-width: 0; overflow-wrap: anywhere; box-shadow: var(--shadow-1); }
.conn-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.conn-actions form { margin: 0; }
mark.disclosure { background: #fff3c4; color: var(--ink); padding: 0 0.15rem; border-radius: 0.2rem; }
.plainset { border: 0; padding: 0; margin: 0.5rem 0 0; }
.plainset legend { font-size: 0.85rem; color: var(--ink-2); padding: 0; }
.schedule input[type="datetime-local"] { padding: 0.55rem 0.6rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); font: inherit; max-width: 100%; }
/* :focus-within: Chrome focuses a segment INSIDE a date-time field, so the field itself never matches :focus or :focus-visible. */
.schedule input[type="datetime-local"]:focus-within, input[type="checkbox"]:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
/* The caption's emoji picker (compose.js). The panel wraps; each emoji is a 2.75rem target for a thumb. */
.schedule .emoji-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0.25rem; position: relative; }
.schedule .emoji-panel { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); gap: 0.25rem; padding: 0.5rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); max-height: 12rem; overflow-y: auto; }
.schedule .emoji-panel[hidden] { display: none; }
.schedule .emoji-panel button { min-height: 2.75rem; font-size: 1.35rem; line-height: 1; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; }
.schedule .emoji-panel button:hover { background: var(--line); }
.schedule .emoji-panel button:focus-visible { outline: 2px solid var(--volt); outline-offset: 1px; }
.schedule .btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* TikTok's required post settings (portal-ship.ts tiktokPanel). */
.schedule .tt-opts { margin: 0.75rem 0; padding: 0.75rem 0.9rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
.schedule .tt-opts[hidden], .schedule .tt-commercial[hidden] { display: none; }
.schedule .tt-opts legend { font-weight: 600; padding: 0 0.25rem; }
.schedule .tt-opts select { display: block; margin: 0.25rem 0 0.5rem; padding: 0.55rem 0.6rem; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); font: inherit; max-width: 100%; }
.schedule .tt-opts select:focus-visible { outline: 2px solid var(--volt); outline-offset: 2px; }
.schedule .tt-commercial { margin-left: 1.6rem; }
.schedule .tt-sub { margin: 0.5rem 0 0.1rem; }
.schedule .tt-consent { margin-top: 0.6rem; }
.tz { margin: 0 0 1rem; font-size: 0.9rem; }
.bars { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.4rem; max-width: 40rem; }
.bars li { display: grid; grid-template-columns: 7rem 1fr auto; gap: 0.75rem; align-items: center; font-size: 0.9rem; }
.bars .meter { max-width: none; margin: 0; }
.bar-v { color: var(--ink-2); white-space: nowrap; }
@media (max-width: 40rem) {
  .cal { grid-template-columns: 1fr; }
  /* One column on a phone: only the days that have posts, each still labelled by its date. */
  .dow, .day:not(:has(.chip-post)) { display: none; }
  .day { min-height: 0; }
  .day .n { display: none; }
  .day .dfull { display: block; }
  .bars li { grid-template-columns: 5rem 1fr; }
  .bar-v { grid-column: 2; }
}
.charts.one { grid-template-columns: minmax(0, 40rem); }
/* ── account (server/portal-account.ts) ── */
.acct-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); margin: 0 0 2rem; }
.acct-link { display: grid; gap: 0.2rem; padding: 0.9rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow-1); }
.table-wrap.compact table { min-width: 0; }
@media (max-width: 40rem) { .table-wrap.compact .opt { display: none; } }
/* ── help (server/portal-help.ts) ── */
.toc { margin: 1rem 0 1.5rem; }
.rail .soon { font-size: 0.6rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); line-height: 1; }
.rail a[aria-current="page"] .soon { color: var(--volt-2); border-color: currentColor; }
.article { max-width: 44rem; margin: 0 0 1.75rem; padding-top: 0.25rem; }
.article ol, .article ul { padding-left: 1.2rem; }
.article li { margin: 0.35rem 0; }

/* ── customer portal: the shell extras, Home, Ads, Help (PR 2a) ── */
/* the phone's "More" page (portal.ts menuPage) */
.menu { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); margin: 0 0 1.5rem; }
.menu-item { display: flex; align-items: center; gap: 0.9rem; min-height: 4rem; padding: 0.75rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); text-decoration: none; }
.menu-item > svg { width: 1.4rem; height: 1.4rem; flex: 0 0 auto; color: var(--volt); }
.menu-item > span { display: grid; gap: 0.1rem; min-width: 0; }
.menu-item b { font-weight: 600; }
.menu-title { display: flex; align-items: center; gap: 0.5rem; }
.menu-item .pill { font-size: 0.6875rem; padding: 0 0.5rem; }
.menu-out { margin: 0; }

/* shared bits for Home, Ads and Help */
.btn-lg { min-height: 3.25rem; padding: 0.7rem 1.5rem; font-size: 1rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin: 2.25rem 0 1rem; }
.section-head h2 { margin: 0; }
.side-h { font-size: 1.0625rem; margin: 0 0 0.75rem; }
.empty.compact { padding: 1.5rem; gap: 0.35rem; }
.empty.compact::before { display: none; }

/* ── home: the status strip ── */
.stats { display: grid; gap: 0.75rem; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); margin: 0 0 1.5rem; }
.stat { display: grid; align-content: start; gap: 0.2rem; min-width: 0; padding: 0.9rem 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); text-decoration: none; color: var(--ink); }
a.stat { transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease); }
a.stat:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.stat-l { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
a.stat .stat-l::after, .stat-money a.stat-l::after { content: " \2192"; color: var(--volt); }
.stat-money a.stat-l { display: inline-flex; align-items: center; justify-self: start; min-height: 2.75rem; margin: -0.7rem 0 -0.55rem; }
.stat-v { font-family: var(--display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-of { font-size: 1.05rem; font-weight: 600; color: var(--ink-3); }
.stat-s { font-size: 0.8125rem; color: var(--ink-3); }
.stat .meter { max-width: none; margin: 0.35rem 0 0.25rem; height: 0.45rem; }
.stat.attn { border-color: var(--volt); box-shadow: 0 0 0 3px var(--volt-soft), var(--shadow-1); }
.stat.attn .stat-v { color: var(--volt-2); }
.stat.warn .meter-fill { background: var(--warn); }
.stat-warn { margin-top: 0.35rem; padding: 0.35rem 0.6rem; border-radius: var(--radius-xs); background: var(--warn-soft); color: var(--warn); font-size: 0.8125rem; }
.stat-warn a { color: var(--ink); font-weight: 600; }
.stat.failed .stat-v { color: var(--ink-3); }
.stat.failed .stat-s { color: var(--err); }

/* ── home: the composer beside what needs the seller ── */
.home { display: grid; gap: 1rem 1.5rem; grid-template-columns: minmax(0, 1fr) 20.5rem; grid-template-rows: auto 1fr; grid-template-areas: "main needs" "main setup"; align-items: start; }
.home.no-needs { grid-template-areas: "main setup" "main setup"; }
.home.no-setup { grid-template-areas: "main needs" "main needs"; }
.home.solo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "main"; }
.home-main { grid-area: main; min-width: 0; }
.home > .needs-card { grid-area: needs; min-width: 0; }
.home > .setup-card { grid-area: setup; min-width: 0; }
.home .composer { margin: 0; padding: 1.75rem; box-shadow: var(--shadow-2); }
.composer-head { margin: 0 0 1.25rem; }
.composer-head h1 { margin: 0 0 0.35rem; }
.composer-head .lede { margin: 0; font-size: 1rem; }
.fmt { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 0.5rem; }
.fmt-card { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0.9rem; align-items: center; min-height: 6.5rem; padding: 0.6rem 0.9rem 0.6rem 0.6rem; background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.fmt-card:hover { border-color: var(--ink-3); }
.fmt-card.on { border-color: var(--volt); background: linear-gradient(180deg, var(--paper), var(--mist)); box-shadow: 0 0 0 3px var(--volt-soft); }
.fmt-img { width: 4.5rem; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--radius-sm); background: var(--bone-2); display: block; }
.fmt-body { display: grid; gap: 0.2rem; min-width: 0; }
.fmt-body b { font-family: var(--display); font-size: 1.0625rem; letter-spacing: -0.01em; }
.fmt-line { font-size: 0.8125rem; color: var(--ink-2); line-height: 1.4; }
.fmt-state { justify-self: start; margin-top: 0.2rem; padding: 0.05rem 0.55rem; border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.75rem; font-weight: 600; color: var(--ink-2); }
.fmt-card.on .fmt-state { background: var(--volt); border-color: var(--volt); color: var(--volt-ink); }
.compose-form .fields { margin-top: 0.25rem; }
.compose-foot { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.compose-foot .h3 { margin: 0 0 0.5rem; }
.compose-go .spend { margin-top: 0; }
.go { margin: 0.25rem 0 0.5rem; }
.go .btn { width: 100%; }
/* The price list: one line a step, the amount on the right, no grey header band. */
.est { max-width: none; margin: 0; font-size: 0.875rem; }
.est th, .est td { background: none; padding: 0.5rem 0; border-bottom: 1px dashed var(--line); vertical-align: baseline; }
.est tbody tr:hover td { background: none; }
.est th { font-size: 0.875rem; font-weight: 500; color: var(--ink); letter-spacing: 0; text-transform: none; padding-right: 1rem; }
.est td { text-align: right; white-space: nowrap; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.est-note { display: block; font-size: 0.75rem; font-weight: 400; color: var(--ink-3); }
.est tr:last-child th, .est tr:last-child td { border-bottom: 0; }

/* the needs-you list and the setup / next card, beside the composer */
.needs-card, .setup-card { padding: 1.1rem 1.1rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.needs-card { border-top: 3px solid var(--volt); }
.todos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.todo { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0 0.35rem 0.75rem; border-left: 3px solid var(--volt); font-size: 0.9rem; line-height: 1.35; }
.todo.bad { border-left-color: var(--err); }
.todo > span { min-width: 0; overflow-wrap: anywhere; }
.todo .btn { flex: 0 0 auto; }
.todo-more { margin: 0.75rem 0 0; font-size: 0.875rem; font-weight: 600; }
.todo-more a { color: var(--volt-2); }
.gs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.gs-head h2 { margin: 0; font-size: 1.0625rem; }
.gs-count { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.gs-meter { max-width: none; margin: 0.5rem 0 0.75rem; }
.gs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.gs-step { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: 0.4rem 0.6rem; align-items: start; padding: 0.55rem 0; border-top: 1px solid var(--line); }
.gs-step .gs-mark { margin-top: 0.1rem; }
.gs-step:first-child { border-top: 0; }
.gs-mark { width: 1.3rem; height: 1.3rem; border-radius: 999px; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; line-height: 1; }
.gs-step.is-done .gs-mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.gs-step.is-done .gs-mark::before { content: "\2713"; }
.gs-step.is-unknown .gs-mark { border-style: dashed; border-color: var(--warn); color: var(--warn); }
.gs-step.is-unknown .gs-mark::before { content: "?"; }
.gs-text { display: grid; gap: 0.05rem; min-width: 0; font-size: 0.9rem; }
.gs-step.is-done .gs-text b { font-weight: 500; color: var(--ink-2); }
.gs-state { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); }
.gs-step.is-done .gs-state { color: var(--ok); }
.gs-step.is-unknown .gs-state { color: var(--warn); }
.gs-step .btn { grid-column: 2; justify-self: start; padding-inline: 0.9rem; font-size: 0.875rem; }

/* ── home: the first run ── */
.hero { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; padding: 2.25rem; background: linear-gradient(150deg, var(--paper) 30%, var(--mist)); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-2); }
.hero h1 { font-size: 2.75rem; line-height: 1.05; margin: 0 0 0.6rem; }
.hero .lede { margin: 0 0 1.25rem; }
.hero-copy p:last-child { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.path-step { position: relative; display: grid; align-content: start; gap: 0.25rem; padding: 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.path-step .eyebrow { margin: 0.35rem 0 0; }
.path-step b { font-family: var(--display); font-size: 1.0625rem; }
.path-step.now { border-color: var(--volt); box-shadow: 0 0 0 3px var(--volt-soft); }
.path-n { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--bone-2); font-weight: 700; color: var(--ink-2); }
.path-step.now .path-n { background: var(--volt); color: var(--volt-ink); }
.path-step:not(:last-child)::after { content: "\2192"; position: absolute; right: -0.7rem; top: 1.45rem; z-index: 1; display: grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 0.75rem; color: var(--ink-3); }

/* ── examples: three to a row, a poster beside its caption ── */
.xgrid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 2rem; }
.xcard { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: 0.6rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); text-decoration: none; color: var(--ink); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease); }
.xcard:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.xcard-media { width: 100%; height: auto; aspect-ratio: 9 / 16; object-fit: cover; border-radius: var(--radius-sm); background: var(--bone-2); display: block; }
.xcard-body { display: grid; justify-items: start; gap: 0.3rem; min-width: 0; }
.xcard-body b { font-family: var(--display); font-size: 1.125rem; letter-spacing: -0.01em; line-height: 1.2; }
.xcard-meta { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.section-head + .agrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }

/* ── Ads: tabs with counts, one toolbar row ── */
.app .seg { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 1rem; padding: 0.3rem; background: var(--bone-2); border-radius: 999px; width: fit-content; max-width: 100%; }
.app .seg-tab { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0 1rem; border-radius: 999px; text-decoration: none; font-size: 0.9rem; font-weight: 500; color: var(--ink-2); }
.app .seg-tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.app .seg-tab.on { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.app .seg-n { min-width: 1.5rem; padding: 0 0.4rem; border-radius: 999px; background: var(--paper); font-size: 0.75rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.app .seg-tab.on .seg-n { background: var(--volt-soft); color: var(--volt-2); }
.app .seg-ex { margin-left: 0.5rem; }
.app .toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 0 1.25rem; padding: 0.6rem 0.75rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0; }
.filter { display: inline-flex; align-items: center; gap: 0.5rem; }
.filter label { margin: 0; font-size: 0.8125rem; }
.filter select { min-width: 10rem; }
.first-ad { padding: 1.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.first-ad h2 { font-size: 1.25rem; }
.fmt-row { max-width: 44rem; margin: 1rem 0; }

/* ── Help: search and articles beside contact and setup ── */
.help { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 20.5rem; align-items: start; }
.help-main { min-width: 0; max-width: 46rem; }
.help-side { display: grid; gap: 1rem; min-width: 0; position: sticky; top: 5rem; }
.help-search { margin: 0 0 1.5rem; }
.help-search label { margin-top: 0; }
.help-search-row { display: flex; gap: 0.5rem; }
.help-search-row input { flex: 1; min-width: 0; }
/* Five topics: the always-on disclosure across the top, then two by two. */
.topics { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.topics .topic-first { order: -1; grid-column: 1 / -1; }
.topic-note { background: var(--mist); }
.topic .eyebrow { margin: 0; color: var(--volt-2); }
.topic { display: grid; align-content: start; gap: 0.25rem; height: 100%; padding: 0.9rem 1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); text-decoration: none; }
.topic:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.topic b { font-family: var(--display); font-size: 1rem; }
.topic-note { border-color: var(--volt); }
.help-count { margin: 0 0 1rem; color: var(--ink-2); }
.help-main .article { max-width: none; scroll-margin-top: 5rem; padding: 1.25rem 1.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.help-main .article.callout { background: var(--mist); border-color: var(--mist-2); border-left: 4px solid var(--volt); }
.callout-quote { margin: 0.25rem 0 0.9rem; padding: 0.75rem 1rem; background: var(--paper); border-radius: var(--radius-sm); font-weight: 600; color: var(--ink); }
.help-contact { padding: 1.25rem; background: var(--ink); color: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.help-contact h2 { font-size: 1.25rem; }
.help-contact a:not(.btn) { color: var(--paper); font-weight: 600; }
.help-contact a:focus-visible { outline-color: var(--paper); }
.help-contact p:last-child { margin: 0; }
.help-gs h2 { font-size: 1.0625rem; }

/* ── the run workspace (type C): the object on a stage at the left, its controls at the right ── */
.ws { grid-template-columns: minmax(0, 1.5fr) minmax(19rem, 1fr); }
.ws > .canvas { display: grid; justify-items: center; align-content: start; gap: 1rem; min-height: 32rem; padding: 1.5rem; background: linear-gradient(160deg, var(--mist), var(--bone-2)); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); }
.ws > .canvas > * { margin: 0; }
.ws > .canvas .player { box-shadow: var(--shadow-2); }
.ws > .canvas .still { display: grid; justify-items: center; gap: 0.6rem; width: 100%; }
.ws > .canvas .still-img { box-shadow: var(--shadow-2); }
.ws > .canvas form { width: 100%; }
.ws > .canvas form > p { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 1rem 0 0; }
.ws .cast { grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }
.ws .cast legend { font-family: var(--display); font-size: 1.125rem; margin-bottom: 0.75rem; }
.side-panel { position: sticky; top: 5rem; }
.st.skipped { color: var(--ink-3); border-style: dashed; background: transparent; }
.side-panel form { margin: 0 0 0.75rem; }
.side-panel .money { margin: 1rem 0 0; padding-top: 0.75rem; border-top: 1px solid var(--line); }
@media (max-width: 52rem) {
  .ws { grid-template-columns: minmax(0, 1fr); }
  .ws > .canvas { min-height: 0; padding: 0.75rem; }
  .side-panel { position: static; }
}

@media (max-width: 80rem) {
  .home, .help { grid-template-columns: minmax(0, 1fr); }
  .home, .home.no-needs, .home.no-setup { grid-template-rows: none; grid-template-areas: "needs" "main" "setup"; }
  .help-side { position: static; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); align-items: start; }
  .help-main { max-width: none; }
  .xgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 64rem) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-money { grid-column: 1 / -1; }
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .stats { gap: 0.5rem; }
  .stat { padding: 0.7rem 0.75rem; }
  .stat-v { font-size: 1.4rem; }
  .stat:not(.stat-money):not(.failed) .stat-s { display: none; }
  .home .composer { padding: 1.1rem; }
  .fmt { grid-template-columns: minmax(0, 1fr); }
  .fmt-card { min-height: 0; grid-template-columns: 3.25rem minmax(0, 1fr); }
  .fmt-img { width: 3.25rem; }
  .compose-foot { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 1.25rem; gap: 1.25rem; }
  .hero h1 { font-size: 2rem; }
  .path { grid-template-columns: minmax(0, 1fr); }
  .path-step { grid-template-columns: 2rem minmax(0, 1fr); column-gap: 0.75rem; }
  .path-step > :not(.path-n) { grid-column: 2; }
  .path-n { grid-row: span 3; }
  .path-step .eyebrow { margin: 0; }
  .path-step:not(:last-child)::after { right: auto; left: 1.35rem; top: auto; bottom: -0.95rem; content: "\2193"; }
  .xgrid { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .agrid, .section-head + .agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .acard-body { padding: 0.55rem; font-size: 0.875rem; }
  .xcard { grid-template-columns: 5rem minmax(0, 1fr); }
.app .seg { border-radius: var(--radius); width: 100%; }
.app .seg-tab { padding: 0 0.7rem; }
.app .seg-ex { margin-left: 0; }
  /* Two filters side by side, then Filter and the view toggle side by side: three short rows became two. */
.app .toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; }
  .filters { display: contents; }
  .filter { display: grid; gap: 0.2rem; min-width: 0; }
  .filter select { width: 100%; min-width: 0; }
.app .toolbar > .muted { grid-column: 1 / -1; }
  .help-main .article { padding: 1rem; }
  .topics { grid-template-columns: minmax(0, 1fr); }
}

/* ── customer portal: Products, Calendar, Analytics, Activity, Account and Billing (PR 2b) ──
   Built on base.css tokens and components (.panel, .pill, .meter, .empty, .kpi, .chart). Nothing here redefines them. */

/* Tabs as links (portal-account.ts segmented()): a query string each, no script. */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 14px; background: var(--bone-2); border: 1px solid var(--line); }
.segmented a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 1rem; border-radius: 11px; font-size: 0.875rem; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.segmented a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.6); }
.segmented a[aria-current="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-1); }

/* shared bits */
.stack { max-width: 34rem; }
.stack > label:first-of-type, .stack > input[type="hidden"] + label { margin-top: 0; }
.form-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 1.1rem 0 0; }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.field-row > div { min-width: 0; }
.field-row label { margin-top: 0; }
.facts-list { margin: 0; display: grid; }
.facts-list > div { display: grid; grid-template-columns: minmax(6rem, 36%) minmax(0, 1fr); gap: 0.25rem 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.facts-list > div:first-child { padding-top: 0; }
.facts-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts-list dt { color: var(--ink-3); font-size: 0.875rem; }
.facts-list dd { margin: 0; }
.table-wrap.flush { border: 0; border-radius: 0; box-shadow: none; margin: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.panel.danger { border-color: rgba(179, 38, 30, 0.35); }
.panel.danger .panel-head h2 { color: var(--err); }
.back { margin: 0 0 0.75rem; }
.back a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.back a:hover { color: var(--ink); }

/* ── the account hub: sub-nav on the left, the section on the right ── */
.hub { display: grid; grid-template-columns: 15rem minmax(0, 1fr); grid-template-areas: "nav head" "nav main"; gap: 0 2rem; align-items: start; }
.hub-head { grid-area: head; }
.hub-nav { grid-area: nav; position: sticky; top: 4.75rem; display: grid; gap: 0.2rem; padding: 0.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.hub-main { grid-area: main; display: grid; gap: 1.25rem; min-width: 0; }
.hub-link { display: flex; align-items: flex-start; gap: 0.7rem; min-height: 2.75rem; padding: 0.6rem 0.7rem; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.hub-link svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; margin-top: 0.15rem; }
.hub-link > span { display: grid; gap: 0.05rem; min-width: 0; }
.hub-link b { font-weight: 600; font-size: 0.9375rem; color: var(--ink); }
.hub-sub { font-size: 0.8125rem; color: var(--ink-3); line-height: 1.35; }
.hub-link:hover { background: var(--bone-2); }
.hub-link[aria-current="page"] { background: var(--volt-soft); }
.hub-link[aria-current="page"] b, .hub-link[aria-current="page"] svg { color: var(--volt-2); }
.hub-cols { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.hub-failed h2 { font-size: 1.0625rem; }

/* billing & usage */
.bill-big { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.bill-big b { font-family: var(--display); font-size: 2.25rem; letter-spacing: -0.03em; line-height: 1.1; }
.bill-big span { color: var(--ink-2); }
/* Monthly plans (Billing & usage): one card per plan; yours is marked in words and by its border. */
.plan-cards { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: 0.75rem; }
.plan-card { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.plan-card.mine { border-color: var(--line-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.plan-card .plan-name { font-size: 1rem; }
.plan-card .plan-price { font-family: var(--display); font-size: 1.5rem; letter-spacing: -0.02em; }
.plan-card .plan-limit { color: var(--ink-2); font-size: 0.875rem; flex: 1 1 auto; }
.plan-card form, .plan-card .pill { margin-top: 0.5rem; align-self: flex-start; }
.plan-cards + p { margin-top: 0.85rem; }
.plan-manage { margin-top: 0.75rem; }
.plan-manage p { margin: 0.35rem 0 0; }
.meter.bill-meter { max-width: none; height: 0.65rem; margin: 0.85rem 0 1.1rem; }
.meter.bill-meter.hot .meter-fill { background: var(--warn); }
.bill-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 0.9rem; }
.bill-split > div { padding: 0.7rem 0.85rem; border-radius: var(--radius-sm); background: var(--bone); border: 1px solid var(--line); }
.bill-split dt { font-size: 0.8125rem; color: var(--ink-3); }
.bill-split dd { margin: 0.15rem 0 0; font-family: var(--display); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.bill-warn { margin: 0.75rem 0 0; padding: 0.7rem 0.9rem; border: 1px solid rgba(138, 90, 0, 0.3); border-left: 4px solid var(--warn); border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--ink); font-size: 0.9rem; }
.bill-warn b { color: var(--warn); }
.bill-rows { list-style: none; margin: 0 0 0.5rem; padding: 0; display: grid; gap: 0.7rem; }
.bill-rows li { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; font-size: 0.9rem; }
.bill-rows .meter { max-width: none; margin: 0; }
.bill-v { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.bill-v .muted { font-weight: 400; }

/* security: signed-in devices */
.sess-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sess { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.sess:first-child { padding-top: 0; }
.sess-main { display: grid; gap: 0.1rem; flex: 1 1 16rem; min-width: 0; }
.sess-ua { overflow-wrap: anywhere; }
.sess form { margin: 0; }
.pill.muted-pill { color: var(--ink-3); }
.sess-ended { margin-top: 0.75rem; }
.sess-ended .sess { opacity: 0.8; }

/* integrations: a card per platform, its state in words */
.conn-count { margin: 0; color: var(--ink-2); }
.conn-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.conn-card { display: grid; align-content: start; gap: 0.6rem; min-width: 0; padding: 1.1rem 1.15rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow-wrap: anywhere; }
.conn-card p { margin: 0; }
.conn-top { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.conn-top h2 { margin: 0; flex: 1 1 auto; }
.conn-mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; border-radius: 10px; background: var(--bone-2); color: var(--ink-2); font-family: var(--display); font-weight: 700; font-size: 0.85rem; }
.conn-card.on .conn-mark { background: var(--volt-soft); color: var(--volt-2); }
.conn-card.needs { border-color: rgba(179, 38, 30, 0.35); }
.conn-card.needs .conn-mark { background: var(--err-soft); color: var(--err); }
.conn-who { display: grid; gap: 0.1rem; }

/* ── products: one import form beside what it needs, then the catalogue ── */
.imp { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: 1.25rem; align-items: start; margin: 0 0 2.25rem; }
.imp-form .panel-head { flex-wrap: wrap; }
.imp-form .panel-body label:first-of-type { margin-top: 0; }
.inline-field { display: flex; gap: 0.5rem; align-items: stretch; }
.inline-field input { flex: 1 1 auto; min-width: 0; }
/* Upload a product: price and its currency on one row; the currency select stays narrow. */
.up-price { display: grid; grid-template-columns: minmax(0, 12rem) minmax(0, 7rem); gap: 0.75rem; }
.up-price .stack { gap: 0.25rem; }
@media (max-width: 22rem) { .up-price { grid-template-columns: minmax(0, 1fr); } }
.rule-note { margin: 0.6rem 0 0; font-size: 0.8125rem; color: var(--ink-3); max-width: 38rem; }
.confirm-step p:first-child { margin-top: 0; }
.need-list { list-style: none; margin: 0 0 0.9rem; padding: 0; display: grid; gap: 0.7rem; font-size: 0.9rem; color: var(--ink-2); }
.need-list li { position: relative; padding-left: 1.1rem; }
.need-list li::before { content: ""; position: absolute; left: 0; top: 0.55rem; width: 0.4rem; height: 0.4rem; border-radius: 999px; background: var(--volt); }
.need-list b { color: var(--ink); font-weight: 600; }
.imp-need .panel-body > p:last-of-type { margin-bottom: 0; }
.imp-sub { margin: 1.1rem 0 0.4rem; font-family: var(--font); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.conn-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; font-size: 0.875rem; overflow-wrap: anywhere; }
.cat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.cat-head h2 { margin: 0; }
.cat-head .segmented { margin-left: auto; }
.prod-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); }
.prod-card { display: grid; grid-template-rows: auto 1fr; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; box-shadow: var(--shadow-1); transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease); }
.prod-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.prod-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bone-2); }
.prod-media .prod-img, .prod-media .ph { display: grid; width: 100%; height: 100%; object-fit: cover; }
.prod-src { position: absolute; left: 0.6rem; top: 0.6rem; padding: 0.15rem 0.55rem; border-radius: 999px; background: rgba(23, 19, 14, 0.8); color: var(--paper); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.prod-body { display: grid; align-content: start; gap: 0.35rem; padding: 0.85rem 1rem 1rem; }
.prod-name { font-family: var(--display); font-size: 1.0625rem; letter-spacing: -0.01em; line-height: 1.25; overflow-wrap: anywhere; }
.prod-meta { display: flex; flex-wrap: wrap; gap: 0.1rem 0.4rem; font-size: 0.8125rem; color: var(--ink-2); }
.prod-meta span + span::before { content: "·"; margin-right: 0.4rem; color: var(--ink-3); }
.ready-line { display: inline-flex; align-items: flex-start; gap: 0.4rem; font-size: 0.8125rem; font-weight: 500; line-height: 1.35; }
.ready-line::before { content: ""; width: 0.5rem; height: 0.5rem; margin-top: 0.3rem; flex: 0 0 auto; border-radius: 999px; background: currentColor; }
.ready-line.ok { color: var(--ok); }
.ready-line.no { color: var(--warn); }
/* one product */
.pd, .pd-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 1fr); gap: 1.25rem; align-items: start; margin: 0 0 1.25rem; }
.pd-gallery { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }
.pd-gallery figure { margin: 0; }
.pd-gallery img, .pd-gallery .ph { display: grid; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bone-2); }
.pd-gallery figcaption { margin-top: 0.3rem; font-size: 0.8125rem; color: var(--ink-2); }
.pd-side { display: grid; gap: 1.25rem; min-width: 0; }
.pd-runs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.pd-runs li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pd .facts-list > div { grid-template-columns: 6.5rem minmax(0, 1fr); }

/* ── calendar: one toolbar, the month beside the schedule queue ── */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding: 0.6rem 0.75rem; margin: 0 0 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.cal-month { display: flex; align-items: center; gap: 0.4rem; }
.btn.cal-step { min-width: 2.75rem; min-height: 2.75rem; padding: 0; font-size: 1.05rem; }
.cal-title { margin: 0; min-width: 10rem; text-align: center; font-size: 1.25rem; }
.cal-tz { flex: 1 1 14rem; margin: 0; color: var(--ink-2); }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; gap: 1.25rem; align-items: start; }
.cal-layout .queue { grid-column: 2; grid-row: 1; position: sticky; top: 4.75rem; }
.cal-main { grid-column: 1; grid-row: 1; min-width: 0; }
.cal-main .cal { margin: 0 0 0.75rem; box-shadow: var(--shadow-1); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 0 0 1rem; color: var(--ink-2); }
.cal-legend .lg { display: inline-flex; align-items: center; gap: 0.4rem; }
.cal-legend .lg::before { content: ""; width: 0.8rem; height: 0.8rem; border-radius: 3px; background: var(--bone-2); border-left: 3px solid var(--line-2); }
.cal-legend .lg.ready::before { border-left-color: var(--ok); }
.cal-legend .lg.running::before { border-left-color: var(--ink-3); }
.cal-legend .lg.failed::before { border-left-color: var(--err); }
.cal-legend .lg.today::before { background: var(--paper); border: 0; box-shadow: inset 0 0 0 2px var(--volt); }
.cal-phone-none { display: none; }
.cal-list { margin: 0 0 1rem; }
.queue .panel-body { padding: 1rem; }
.q-group { margin: 1.1rem 0 0.5rem; font-family: var(--font); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.queue .panel-body > .q-group:first-child { margin-top: 0; }
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.q-item { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); align-items: center; gap: 0.65rem; min-height: 3.5rem; padding: 0.45rem 0.55rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; transition: border-color 0.15s var(--ease), background 0.15s var(--ease); }
.q-item:hover { border-color: var(--line-2); background: var(--bone); }
.q-thumb { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 8px; object-fit: cover; background: var(--bone-2); }
.q-initial { background: var(--volt-soft); color: var(--volt-2); font-family: var(--display); font-weight: 700; }
.q-body { display: grid; gap: 0.05rem; min-width: 0; font-size: 0.9rem; overflow-wrap: anywhere; line-height: 1.3; }
.q-body .small { color: var(--ink-2); }
.q-item .pill, .q-go { grid-column: 2; justify-self: start; }
.q-item .pill { font-size: 0.75rem; padding: 0.05rem 0.5rem; }
.q-item > .q-thumb { grid-row: span 2; align-self: start; }
.q-go { font-size: 0.8125rem; font-weight: 600; color: var(--volt-2); }
.q-empty { display: grid; gap: 0.5rem; }
.q-empty > b { font-family: var(--display); font-size: 1.0625rem; }
.q-empty p { margin: 0; }

/* ── analytics ── */
.an-kpi { align-content: start; }
.delta { font-size: 0.8125rem; color: var(--ink-3); }
td.when { white-space: nowrap; }
tfoot th, tfoot td { background: none; border-top: 1px solid var(--line-2); border-bottom: 0; }
.conn-state { margin: 0; }
.kpis.an-kpis { margin: 0 0 0.6rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.an-note { margin: 0 0 1.5rem; color: var(--ink-2); }
.an-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 1fr); gap: 1.25rem; align-items: start; margin: 0 0 1.25rem; }
.an-grid .chart { margin: 0; }
.an-grid .bars { margin: 0; max-width: none; }
.an-grid + .panel { margin: 0 0 1rem; }
.an-empty { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.an-empty .chart { margin: 1rem 0 0; padding: 0; border: 0; box-shadow: none; }
.an-empty table th[scope="row"] { font-size: 0.9375rem; text-transform: none; letter-spacing: 0; color: var(--ink); background: none; font-weight: 600; }

/* ── activity: grouped by day, the kind of each event said in a word ── */
.act-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin: 0 0 1.5rem; }
.act-search { display: flex; gap: 0.5rem; flex: 1 1 16rem; max-width: 24rem; margin: 0; }
.act-search input { flex: 1 1 auto; min-width: 0; }
.act-day { margin: 0 0 1.5rem; }
.act-date { margin: 0 0 0.5rem; font-family: var(--font); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.act-list { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.act-item { display: grid; grid-template-columns: 3.75rem 5.25rem minmax(0, 1fr); gap: 0.75rem; align-items: baseline; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.act-item:last-child { border-bottom: 0; }
.act-item time { color: var(--ink-3); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.act-kind { justify-self: start; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--bone-2); color: var(--ink-2); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.act-item.bad { box-shadow: inset 3px 0 0 var(--err); }
.act-item.bad .act-kind { background: var(--err-soft); color: var(--err); }
.act-text { overflow-wrap: anywhere; }
.act-text a { margin-left: 0.25rem; color: var(--volt-2); font-weight: 600; font-size: 0.875rem; white-space: nowrap; }

/* two columns inside the hub once there is room for them */
@media (min-width: 76rem) {
  .hub-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-cols.wide-first { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}
@media (max-width: 60rem) {
  .cal-layout, .an-grid, .an-empty, .imp, .pd, .pd-cols { grid-template-columns: minmax(0, 1fr); }
  /* The queue is first in the source, so a narrow screen reads what is coming up before the month. */
  .cal-layout .queue { grid-column: auto; grid-row: auto; position: static; }
  .cal-main { grid-column: auto; grid-row: auto; }
}
@media (max-width: 52rem) {
  .hub { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "nav" "main"; }
  .hub-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 1.25rem; }
  .hub-sub { display: none; }
  .hub-link { align-items: center; padding: 0.5rem 0.6rem; }
  .hub-link svg { margin-top: 0; }
  .hub-link b { font-size: 0.875rem; }
}
@media (max-width: 40rem) {
  .facts-list > div, .pd .facts-list > div { grid-template-columns: minmax(0, 1fr); }
  .bill-split { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .bill-split > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
  .bill-split dd { margin: 0; }
  .bill-rows li { grid-template-columns: minmax(0, 1fr) auto; gap: 0.3rem 0.75rem; }
  .bill-rows .meter { grid-column: 1 / -1; grid-row: 2; }
  .inline-field { flex-direction: column; }
  .cat-head .segmented { margin-left: 0; }
  .cal-toolbar { padding: 0.6rem; }
  .cal-toolbar > .btn-primary { width: 100%; }
  .cal-title { min-width: 0; flex: 1 1 auto; font-size: 1.125rem; }
  .cal-month { flex: 1 1 100%; }
  .cal.no-posts { display: none; }
  .cal-phone-none { display: block; margin: 0 0 1rem; }
  .act-item { grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0.2rem 0.6rem; padding: 0.7rem 0.8rem; }
  .act-kind, .act-text { grid-column: 2; }
  .act-search { max-width: none; }
}
/* The designed empty chart inside the analytics empty state: a paper band behind its sentence, so the rules do not strike it through. */
.an-empty .chart-empty { background: linear-gradient(var(--paper), var(--paper)) center / 100% 4.4rem no-repeat, repeating-linear-gradient(0deg, transparent 0 1.9rem, var(--line) 1.9rem calc(1.9rem + 1px)); }
.an-empty td:last-child { white-space: nowrap; }
.del-form { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.panel.danger .facts-list dt { color: var(--ink); font-weight: 600; }
.an-table td:first-child { min-width: 8.5rem; }
.an-grid + .panel .panel-head { flex-wrap: wrap; }
@media (max-width: 40rem) {
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .prod-body { padding: 0.7rem 0.75rem 0.8rem; }
  .prod-name { font-size: 0.9375rem; }
  .prod-src { left: 0.4rem; top: 0.4rem; font-size: 0.625rem; }
}
.an-empty tbody tr:last-child th { border-bottom: 0; }

/* ── Replies (portal-replies.ts): rules, accounts, the feed, the rule editor ── */
.rp-kpis { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.rp-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); align-items: start; }
.rp-main, .rp-side { display: grid; gap: 1.25rem; min-width: 0; }
.rp-rules, .rp-feed, .rp-accts, .rp-limits { list-style: none; margin: 0; padding: 0; }
.rp-rules { display: grid; gap: 0.6rem; margin-top: 0.75rem; }
.rp-rule { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: start; padding: 0.85rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.rp-rule.off { background: var(--bone); }
.rp-rule.off .rp-rule-main { color: var(--ink-2); }
.rp-n { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 999px; background: var(--bone-2); font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.rp-rule-main { min-width: 0; }
.rp-rule-main p { margin: 0; }
.rp-rule-main p + p { margin-top: 0.25rem; }
.rp-rule-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.rp-rule-head .strong { font-weight: 600; }
.rp-reply { color: var(--ink-2); border-left: 2px solid var(--line-2); padding-left: 0.6rem; overflow-wrap: anywhere; white-space: pre-line; }
.rp-rule-side { display: grid; justify-items: end; gap: 0.4rem; text-align: right; }
.rp-rule-actions { display: flex; gap: 0.35rem; }
.rp-accts { display: grid; gap: 0.75rem; }
.rp-acct { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem 0.75rem; align-items: center; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.rp-acct:last-child { border-bottom: 0; padding-bottom: 0; }
.rp-acct-name { display: grid; min-width: 0; overflow-wrap: anywhere; }
.rp-acct-note { grid-column: 1 / -1; }
.rp-acct > form, .rp-acct > .btn { grid-column: 1 / -1; justify-self: start; }
.rp-limits { display: grid; gap: 0.6rem; }
.rp-limits b { color: var(--ink); }
.rp-feed { display: grid; gap: 0.5rem; margin-top: 0.85rem; }
.rp-feed li { padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.rp-feed p { margin: 0.3rem 0 0; }
.rp-feed-top { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.rp-said { font-size: 0.95rem; overflow-wrap: anywhere; white-space: pre-line; }
.rp-edit { display: grid; gap: 1.25rem; max-width: 46rem; }
.rp-set { border: 0; padding: 0; margin: 1rem 0 0; min-width: 0; }
.rp-set legend { font-weight: 600; font-size: 0.9375rem; padding: 0; margin-bottom: 0.5rem; }
.rp-choices { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.rp-choice { display: flex; gap: 0.6rem; align-items: flex-start; min-height: 2.75rem; padding: 0.7rem 0.8rem; margin: 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; font-weight: 400; }
.rp-choice input { margin-top: 0.2rem; flex: 0 0 auto; }
.rp-choice span { display: grid; gap: 0.15rem; min-width: 0; }
.rp-choice:has(input:checked) { border-color: var(--volt); box-shadow: 0 0 0 1px var(--volt); }
.rp-choice:has(input:focus-visible) { outline: 2px solid var(--volt); outline-offset: 2px; }
.rp-set.has-err .rp-choice { border-color: var(--err); }
@media (max-width: 64rem) {
  /* One column: the accounts (with the button that makes rules work) before the rules, the platforms' limits last. */
  .rp-grid { display: flex; flex-direction: column; }
  .rp-main, .rp-side { display: contents; }
  .rp-grid #accounts { order: 1; }
  .rp-grid #rules { order: 2; }
  .rp-grid #feed { order: 3; }
  .rp-grid #limits { order: 4; }
  .rp-side > p { order: 5; }
}
@media (max-width: 40rem) {
  .rp-rule { grid-template-columns: 1.75rem minmax(0, 1fr); padding: 0.75rem; }
  .rp-rule-side { grid-column: 1 / -1; justify-items: start; text-align: left; grid-template-columns: minmax(0, 1fr) auto; align-items: center; width: 100%; }
}

/* ── Boost (portal-boost.ts) ── */
.bo-kpis { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.bo-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); align-items: start; }
.bo-col { display: grid; gap: 1.25rem; min-width: 0; }
.bo-connect { max-width: 40rem; margin: 0 0 1.25rem; }
.bo-connect h2 { margin-top: 0; }
.bo-steps { margin: 0.75rem 0 1rem; padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.bo-list, .bo-ready, .bo-accts { list-style: none; margin: 0; padding: 0; }
.bo-list { display: grid; gap: 0.6rem; }
.bo-row { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr) auto; gap: 0.85rem; align-items: start; padding: 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.bo-row .q-thumb { width: 3.5rem; height: 3.5rem; }
.bo-main { min-width: 0; }
.bo-main p { margin: 0; }
.bo-main p + p { margin-top: 0.25rem; }
.bo-title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; overflow-wrap: anywhere; }
.bo-ctl { display: grid; justify-items: end; min-width: 0; }
.bo-start { display: grid; gap: 0.4rem; justify-items: end; max-width: 15rem; }
.bo-start .check { margin: 0; text-align: left; }
.bo-ready { display: grid; gap: 0.5rem; }
.bo-ready li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; }
.bo-ready .q-thumb { width: 3rem; height: 3rem; }
.bo-ready-name { font-weight: 600; overflow-wrap: anywhere; }
.bo-accts { display: grid; gap: 0.4rem; margin: 0.5rem 0 0; overflow-wrap: anywhere; }
.bo-conn-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.bo-pick-go { margin-top: 0.75rem; }
.bo-switch > summary { cursor: pointer; font-size: 0.9rem; margin-top: 0.5rem; }
.bo-ad { margin: 0 0 0.75rem; display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: 0.85rem; align-items: center; padding: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bone); }
.bo-ad .q-thumb { width: 4rem; height: 4rem; }
.bo-ad p { margin: 0; }
@media (max-width: 64rem) {
  .bo-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .bo-row { grid-template-columns: 3rem minmax(0, 1fr); }
  .bo-row .q-thumb { width: 3rem; height: 3rem; }
  .bo-ctl { grid-column: 1 / -1; justify-items: stretch; }
  .bo-start { max-width: none; justify-items: stretch; }
}

/* ── Clone & voices (server/portal-studio.ts) ─────────────────────────────── */
.st-panels { display: grid; gap: 1.25rem; }
.st-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.st-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.st-item:not(:has(.st-face)) { grid-template-columns: minmax(0, 1fr) auto auto; }
.st-face { width: 3.25rem; height: 3.25rem; border-radius: 50%; object-fit: cover; background: var(--line); }
.st-none { display: block; }
.st-name { display: grid; gap: 0.15rem; min-width: 0; }
.st-name b, .st-name .small { overflow-wrap: anywhere; }
/* A fixed width, not a percentage: in an auto grid column a percentage resolves against nothing and the player collapses to 0px. */
.st-audio { width: 16rem; max-width: 100%; height: 2.25rem; }
.vo-listen { margin-top: 0.5rem; }
.vo-listen > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; padding: 0.25rem 0; }
.vo-listen > summary:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.vo-listen .st-list { margin-top: 0.5rem; }
/* The composer column is narrow: a player in an auto grid column collapses to nothing, so each row stacks. */
.vo-listen .st-item, .vo-listen .st-item:not(:has(.st-face)) { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
.vo-listen .st-audio { width: 100%; }
.st-form { max-width: 40rem; }
.st-read { padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: var(--paper-2, #f3f0ea); }
.st-script { margin: 0.5rem 0 0; font-size: 1rem; line-height: 1.6; }
.st-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.st-rec[hidden], .st-rec [hidden] { display: none !important; }
@media (max-width: 40rem) {
  .st-item, .st-item:not(:has(.st-face)) { grid-template-columns: minmax(0, 1fr) auto; }
  .st-item .st-audio { grid-column: 1 / -1; width: 100%; }
  .st-face { grid-row: span 1; }
}

/* Two-step sign-in (server/portal-mfa.ts) */
.mfa-qr { width: 220px; max-width: 100%; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mfa-qr svg { display: block; width: 100%; height: auto; }
.mfa-key { font-size: 0.95rem; letter-spacing: 0.02em; overflow-wrap: anywhere; word-break: normal; }
.mfa-codes { columns: 2; column-gap: 2rem; padding-left: 1.2rem; margin: 0; }
.mfa-codes li { margin: 0.2rem 0; break-inside: avoid; }
.mfa-codes code { font-size: 1rem; letter-spacing: 0.03em; }
@media (max-width: 30rem) { .mfa-codes { columns: 1; } }

/* ── admin shell (server/admin.ts): the same brand, denser; a grouped, icon-led sidebar ── */
.admin-app { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.1rem; padding: 1.25rem 0.75rem 1rem; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(12px); }
.side .logo { padding: 0 0.6rem 1rem; }
.side-group { margin: 1rem 0 0.3rem 0.75rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.side a.nav { display: flex; align-items: center; gap: 0.65rem; min-height: 2.5rem; padding: 0 0.75rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-2); font-size: 0.9375rem; font-weight: 500; transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.side a.nav svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.side a.nav:hover { background: var(--bone-2); color: var(--ink); }
.side a.nav[aria-current="page"] { background: var(--volt-soft); color: var(--volt-2); font-weight: 600; }
.side .spacer { flex: 1; min-height: 1rem; }
.page.wide { max-width: 92rem; }
@media (max-width: 52rem) {
  /* Rows sized to content: a short page must not stretch the nav strip to fill the screen. */
  .admin-app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  /* One scrolling row of nav: two wrapped rows cost a third of a phone screen before any content. */
  .side { position: sticky; z-index: 6; height: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; align-items: center; gap: 0.25rem; padding: 0.5rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.94); }
  .side .logo { flex: 0 0 auto; padding: 0 0.5rem 0 0; }
  .side .logo-word, .side .logo-tag { display: none; }
  .side-group, .side .spacer { display: none; }
  .side a.nav { flex: 0 0 auto; min-height: 2.5rem; }
  /* It scrolls sideways: the right edge fades so the clipped item reads as "more this way", not as the end. */
  .side { scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); padding-right: 3rem; }
  .side::-webkit-scrollbar { display: none; }
  .admin-app .topbar { position: static; }
  .page.wide { padding: 1.25rem 1rem 3rem; }
}

/* ── admin pages (PR 3): dense operator screens in the same system. Tokens from base.css; pills, panels, meters,
   .empty and .page-head reused as they are. Page rules are scoped to .admin-app or to admin-only classes. ── */
.admin-app .page-head { margin-bottom: 1.25rem; }
.admin-app .page-head h1 { font-size: 1.75rem; }
.admin-app .small { font-size: 0.8125rem; }
.admin-app .crumb { margin: 0 0 0.75rem; font-size: 0.875rem; }
.admin-app .crumb a { color: var(--ink-2); text-decoration: none; }
.admin-app .crumb a:hover { color: var(--ink); text-decoration: underline; }
.admin-app .footnote { margin: 1.5rem 0 0; font-size: 0.8125rem; color: var(--ink-3); }
.admin-app .scope { margin: 0 0 0.75rem; font-size: 0.8125rem; color: var(--ink-2); }
.admin-app .panel { margin: 0 0 1rem; }
.admin-app .panel-head { padding: 0.75rem 1.1rem; }
.admin-app .panel-body { padding: 1rem 1.1rem; }
.admin-app .panel-failed { border-color: var(--err); }
.admin-app .panel-failed .panel-head { background: var(--err-soft); color: var(--err); }
.admin-app .pills { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin: 0; }
.admin-app .pill { font-size: 0.75rem; padding: 0.1rem 0.55rem; }
.admin-app .sub { display: block; margin-top: 0.1rem; font-size: 0.8125rem; color: var(--ink-3); overflow-wrap: anywhere; }
.admin-app .strong { font-weight: 600; }
td.nowrap .sub, .admin-app .sub.nowrap { white-space: nowrap; overflow-wrap: normal; }
.admin-app .nowrap { white-space: nowrap; }
.admin-app code { font-size: 0.8125rem; overflow-wrap: anywhere; }
/* A row action is 36px where a mouse points, 44px where a finger does. */
@media (pointer: coarse) { .admin-app .btn-sm { min-height: 2.75rem; } }

/* A failed read: loud, and worded so it can never be mistaken for "nothing here". */
.load-failed { display: grid; gap: 0.2rem; margin: 0 0 1rem; padding: 0.85rem 1rem; border: 1px solid var(--err); border-left-width: 4px; border-radius: var(--radius-sm); background: var(--err-soft); color: var(--ink); }
.load-failed b { color: var(--err); }
.panel > .load-failed { margin: 0.75rem 1.1rem; }

/* ── tabs as links, a segmented range control, one toolbar row of filters ── */
.atabs { display: flex; gap: 0.25rem; margin: 0 0 0.75rem; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.atabs::-webkit-scrollbar { display: none; }
.atabs a { display: inline-flex; align-items: center; gap: 0.4rem; flex: 0 0 auto; min-height: 2.75rem; padding: 0 0.85rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-2); font-size: 0.9rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.atabs a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.atabs a[aria-current="page"] { color: var(--volt-2); border-bottom-color: var(--volt); font-weight: 600; }
.atabs .n { min-width: 1.5rem; padding: 0 0.4rem; border-radius: 999px; background: var(--bone-2); color: var(--ink-2); font-size: 0.75rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.atabs a[aria-current="page"] .n { background: var(--volt-soft); color: var(--volt-2); }
.admin-app .seg { display: inline-flex; padding: 0.2rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bone-2); }
.admin-app .seg a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1rem; border-radius: 999px; color: var(--ink-2); font-size: 0.875rem; font-weight: 500; text-decoration: none; }
.admin-app .seg a:hover { color: var(--ink); }
.admin-app .seg a[aria-current="page"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }
.admin-app .toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin: 0 0 1rem; padding: 0.75rem 0.9rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.admin-app .toolbar .field { display: grid; gap: 0.2rem; min-width: 0; }
.admin-app .toolbar .field.grow { flex: 1 1 14rem; }
.admin-app .toolbar label { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); }
.admin-app .toolbar input, .admin-app .toolbar select { min-height: 2.5rem; padding: 0.4rem 0.7rem; font-size: 0.9rem; }
.admin-app .toolbar input[type="text"] { width: 12rem; max-width: 100%; }
.admin-app .toolbar .field.grow input { width: 100%; }
.admin-app .toolbar .btn-sm { min-height: 2.5rem; }
.admin-app .toolbar-note { flex: 1 0 100%; margin: 0; font-size: 0.8125rem; }

/* ── dense tables: every admin list. They scroll inside .table-wrap, never the page. ── */
.admin-app .table-wrap { margin: 0 0 1rem; border-radius: var(--radius-sm); }
.admin-app .table-wrap.flush { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.table-wrap table.dense { min-width: 46rem; font-size: 0.875rem; }
table.dense th { padding: 0.5rem 0.65rem; font-size: 0.6875rem; white-space: nowrap; }
table.dense td { padding: 0.5rem 0.65rem; vertical-align: top; }
table.dense td.num, table.dense th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dense td.fail { min-width: 13rem; max-width: 22rem; color: var(--ink-2); font-size: 0.8125rem; }
table.dense td.act { text-align: right; white-space: nowrap; }
table.dense tr.row-failed td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.flag { display: block; width: fit-content; margin-top: 0.3rem; padding: 0 0.45rem; border-radius: var(--radius-xs); background: var(--warn-soft); color: var(--warn); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.admin-app .meter { max-width: 8rem; height: 0.3rem; margin-top: 0.3rem; }
.meter-fill.hot { background: var(--warn); }
.meter-fill.over { background: var(--err); }

/* ── dashboard: the worklist first, then the period, then charts beside the activity ── */
.wl { list-style: none; margin: 0; padding: 0; }
.wl li + li { border-top: 1px solid var(--line); }
.wl a { display: grid; grid-template-columns: 4.75rem 2.25rem minmax(0, 1fr) auto auto; align-items: center; gap: 0.75rem; min-height: 3rem; padding: 0.45rem 1.1rem; text-decoration: none; color: var(--ink); }
.wl a:hover { background: var(--bone); }
.wl a:hover .wl-t { text-decoration: underline; text-decoration-color: var(--volt); }
.wl .pill { justify-self: start; }
.wl-n { font-family: var(--display); font-size: 1.35rem; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.wl-t { font-weight: 500; }
.wl-age { color: var(--ink-3); font-size: 0.8125rem; white-space: nowrap; }
.wl-go { color: var(--volt-2); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.wl-clear { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.9rem 1.1rem; color: var(--ink-2); }
.panel-body > .wl-clear { padding: 0; }
.band { margin: 0 0 1rem; }
.band-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin: 0 0 0.6rem; }
.band-head h2 { margin: 0; font-size: 1.0625rem; }
.kpi-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.kpi-row .kpi { flex: 1 1 9.5rem; min-width: 0; display: grid; align-content: start; gap: 0.1rem; padding: 0.8rem 1rem; text-decoration: none; color: var(--ink); }
.kpi-row .kpi-l { order: -1; font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); }
.kpi-row .kpi-v { font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-row .kpi-d { font-size: 0.75rem; color: var(--ink-3); }
.kpi-row .kpi.lead { flex: 1.35 1 12rem; }
.kpi-row .kpi.lead .kpi-v { font-size: 1.9rem; }
.kpi-row .kpi.bad .kpi-v { color: var(--err); }
.kpi-row a.kpi:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.dash-grid.solo { grid-template-columns: minmax(0, 1fr); }
.panel-note { margin: 0.75rem 1.1rem 0; }
.swipe-hint { display: none; }
.dash-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(18rem, 26rem); align-items: start; }
.charts-col { display: grid; gap: 1rem; min-width: 0; }
.charts-col .load-failed { margin: 0; }
.act { list-style: none; margin: 0; padding: 0; }
.act li { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.45rem 1.1rem; font-size: 0.875rem; border-top: 1px solid var(--line); }
.act li:first-child { border-top: 0; }
.act-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.act-t a { text-decoration: none; }
.act-t a:hover { text-decoration: underline; }
.act time { flex: 0 0 auto; color: var(--ink-3); font-size: 0.75rem; white-space: nowrap; }
.kind { flex: 0 0 4.75rem; padding: 0 0.4rem; border-radius: var(--radius-xs); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; background: var(--bone-2); color: var(--ink-2); }
.kind.k-run { background: var(--volt-soft); color: var(--volt-2); }
.kind.k-post { background: var(--ok-soft); color: var(--ok); }
.kind.k-customer { background: var(--warn-soft); color: var(--warn); }
.panel > .empty { margin: 0.75rem 1.1rem; box-shadow: none; }

/* ── a record: the object as canvas, its actions beside it (customer 360, run) ── */
.record { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main actions" "facts facts"; gap: 1rem 1.5rem; margin: 0 0 1rem; padding: 1.1rem 1.25rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.record:not(:has(.record-facts)) { grid-template-areas: "main actions"; }
.record-main { grid-area: main; display: flex; gap: 0.9rem; align-items: flex-start; min-width: 0; }
.record-id { display: grid; gap: 0.35rem; min-width: 0; }
.record-id h1 { margin: 0; font-size: 1.6rem; overflow-wrap: anywhere; }
.record-id p { margin: 0; overflow-wrap: anywhere; }
.record-id .eyebrow { margin: 0; }
.record .avatar { display: grid; place-items: center; flex: 0 0 auto; width: 3.25rem; height: 3.25rem; border-radius: 999px; background: var(--volt-soft); color: var(--volt-2); font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.record-actions { grid-area: actions; display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; gap: 0.4rem; max-width: 30rem; }
.record-facts { grid-area: facts; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem 1.25rem; margin: 0; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.record-facts dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); }
.record-facts dd { margin: 0.15rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ws360 { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); align-items: start; }
.ws-main, .ws-side { display: grid; align-content: start; min-width: 0; }
.blockers { list-style: none; margin: 0; padding: 0; }
.blockers li { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.5rem 0; font-size: 0.9rem; border-top: 1px solid var(--line); }
.blockers li:first-child { border-top: 0; padding-top: 0; }
.blockers .pill { flex: 0 0 auto; }
.causes { list-style: none; margin: 0; padding: 0; font-size: 0.875rem; }
.causes li { padding: 0.5rem 1.1rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.causes li:first-child { border-top: 0; }
.causes b { display: inline-block; min-width: 2rem; font-variant-numeric: tabular-nums; color: var(--err); }
.assets { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.asset { display: flex; gap: 0.6rem; align-items: center; min-width: 0; font-size: 0.8125rem; }
.asset img { width: 3.5rem; height: 3.5rem; flex: 0 0 auto; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--line); background: var(--bone-2); }
.asset span { display: grid; min-width: 0; overflow-wrap: anywhere; }
.scenes { margin: 0; padding-left: 1.2rem; }
.admin-app .pre { max-height: 22rem; overflow: auto; }
.admin-app .kvs dd { overflow-wrap: anywhere; min-width: 0; }
.form-end { margin: 1rem 0 0; }

@media (max-width: 64rem) {
  .dash-grid, .ws360 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .admin-app .page-head h1 { font-size: 1.5rem; }
  /* The count and what it counts on one line; severity and age above them, Open beside them. */
  .wl a { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "sev sev age" "n t go"; gap: 0.3rem 0.5rem; padding: 0.65rem 1rem; align-items: baseline; }
  .wl .pill { grid-area: sev; }
  .wl-n { grid-area: n; text-align: left; font-size: 1.15rem; line-height: 1.2; }
  .wl-t { grid-area: t; }
  .wl-age { grid-area: age; justify-self: end; }
  .wl-go { grid-area: go; }
  .wl-panel .panel-head .muted.small { display: none; }
  .swipe-hint { display: block; margin: 0 0 0.4rem; font-size: 0.75rem; color: var(--ink-3); }
  /* The first column stays put while the rest scrolls, so every row keeps its name. */
  table.dense th:first-child, table.dense td:first-child { position: sticky; left: 0; z-index: 1; background: var(--paper); box-shadow: 1px 0 0 var(--line); }
  table.dense th:first-child { background: var(--bone); }
  table.dense tr.row-failed td:first-child { box-shadow: inset 3px 0 0 var(--err), 1px 0 0 var(--line); }
  .kpi-row .kpi, .kpi-row .kpi.lead { flex: 1 1 calc(50% - 0.375rem); }
  .kpi-row .kpi.lead .kpi-v { font-size: 1.5rem; }
  .record { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "facts" "actions"; padding: 1rem; }
  .record:not(:has(.record-facts)) { grid-template-areas: "main" "actions"; }
  .record-actions { justify-content: flex-start; max-width: none; }
  .record-facts { grid-template-columns: 1fr 1fr; }
.admin-app .toolbar .field { flex: 1 1 calc(50% - 0.4rem); }
.admin-app .toolbar .field.grow { flex: 1 1 100%; }
.admin-app .toolbar select, .admin-app .toolbar input[type="text"] { width: 100%; }
  .act li { flex-wrap: wrap; }
  /* The tab row scrolls sideways on a phone; the right edge fades so a clipped tab reads as "more this way". */
  .atabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 2rem; }
}
