/*
 * Rails asset manifest. Under Propshaft `*= require` is inert, so the DS and
 * component stylesheets are pulled in via CSS @import (Propshaft rewrites each
 * url() to its digested path). Wired into the layout with a single
 * stylesheet_link_tag "application".
 */
@import url("/assets/design-system-090ef4b8.css");
@import url("/assets/components-2a3237ec.css");
@import url("/assets/vendor/tom-select-855df737.css"); /* #682: Tom Select agent picker (vendored; colors re-skinned below) */
@import url("/assets/vendor/codemirror-30a1d1b8.css"); /* #684: CodeMirror JSON editor (vendored; colors re-skinned below) */

/* ===== console shell (port of ui_kits/console/ConsoleShell.jsx) ===== */
.console-shell{display:flex;min-height:100vh;background:var(--bg-page);color:var(--text-primary);font:var(--type-body)}
/* skip-to-content (REVIEW_28 a11y fix): off-screen until keyboard focus */
.skip-link{position:absolute;left:8px;top:8px;z-index:100;transform:translateY(-200%);padding:8px 12px;background:var(--bg-surface);color:var(--text-primary);font:var(--type-ui);border:1px solid var(--border-default);border-radius:var(--radius-control);text-decoration:none}
.skip-link:focus{transform:none;box-shadow:var(--ring-focus)}
.side-nav{width:var(--sidebar-w);flex:0 0 auto;border-right:1px solid var(--border-subtle);background:var(--bg-subtle);display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.side-nav__brand{height:var(--topbar-h);display:flex;align-items:center;gap:8px;padding:0 16px;border-bottom:1px solid var(--border-subtle)}
/* #440: the wordmark is a link to the overview — keep the wordmark look (no
   underline/link color from the base anchor rule in tokens/base.css). */
.side-nav__brand .wordmark{font:var(--weight-medium) var(--text-16)/1 var(--font-sans);letter-spacing:-0.03em;color:inherit;text-decoration:none}
.side-nav__brand .wordmark b{color:var(--accent);font-weight:var(--weight-medium)}
.side-nav__brand .tag{font:var(--type-mono-sm);color:var(--text-tertiary)}
/* #440: a long nav scrolls INTERNALLY (min-height:0 lets the flex child
   shrink below its content) so the footer stays pinned at the viewport
   bottom; no double scrollbar since .side-nav is exactly 100vh tall. */
.side-nav__nav{flex:1;min-height:0;overflow-y:auto;padding:14px 8px;display:flex;flex-direction:column;gap:18px}
.side-nav__group{display:flex;flex-direction:column;gap:2px}
.side-nav__group-label{font:var(--type-eyebrow);letter-spacing:var(--track-caps);text-transform:uppercase;color:var(--text-tertiary);padding:0 8px 6px}
.side-nav__link{display:flex;align-items:center;gap:9px;height:30px;padding:0 8px;border:0;border-radius:var(--radius-2);cursor:pointer;background:transparent;color:var(--text-secondary);font:var(--type-ui);text-align:left;text-decoration:none;transition:var(--transition-control)}
.side-nav__link:hover{background:var(--bg-hover);color:var(--text-primary)}
.side-nav__link.is-active{background:var(--bg-active);color:var(--text-primary)}
.side-nav__footer{padding:10px 12px;border-top:1px solid var(--border-subtle);display:flex;flex-direction:column;gap:8px}
.side-nav__ref{display:flex;align-items:center;gap:8px;font:var(--type-ui);color:var(--text-secondary);text-decoration:none}
.side-nav__ref:hover{color:var(--text-primary)}
.side-nav__user-link{display:block;color:inherit;text-decoration:none}
.side-nav__user{display:flex;align-items:center;gap:8px;padding-top:8px;border-top:1px solid var(--border-subtle)}
.side-nav__avatar{width:22px;height:22px;border-radius:var(--radius-2);background:var(--gray-950);color:#fff;font:var(--type-mono-sm);display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}
.side-nav__user-meta{flex:1;min-width:0}
.side-nav__user-email{font:var(--type-ui);overflow:hidden;text-overflow:ellipsis}
.side-nav__user-tier{font:var(--type-mono-sm);color:var(--text-tertiary)}
.top-bar{height:var(--topbar-h);flex:0 0 auto;display:flex;align-items:center;gap:12px;padding:0 20px;border-bottom:1px solid var(--border-subtle);background:var(--bg-page)}
.top-bar__crumbs{flex:1;min-width:0;display:flex;align-items:center;gap:8px}
.top-bar__title{font:var(--type-ui);font-size:var(--text-14)}
.top-bar__actions{display:flex;align-items:center;gap:8px}
.console-main{flex:1;min-width:0;display:flex;flex-direction:column}

/* ===== auth shell (port of ui_kits/console/AuthScreens.jsx) ===== */
.auth-shell{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;background:var(--bg-subtle);color:var(--text-primary);font:var(--type-body);padding:24px 16px}
.auth-shell__brand{display:flex;align-items:center;gap:8px}
.auth-shell__brand .wordmark{font:var(--weight-medium) var(--text-20)/1 var(--font-sans);letter-spacing:-0.03em}
.auth-shell__brand .wordmark b{color:var(--accent);font-weight:var(--weight-medium)}
.auth-shell__brand .tag{font:var(--type-mono-sm);color:var(--text-tertiary)}
/* auth-card wraps yield so each auth screen renders inside a centered card */
.auth-card{width:380px;max-width:100%;background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-surface);padding:24px}
.auth-shell__foot{font:var(--type-mono-sm);color:var(--text-tertiary)}
/* ===== auth screens (#173): the .auth-form/.auth-field rhythm every auth view
   renders (login/signup/confirm/MFA) — title/body/alert spacing, stacked fields
   with breathing room, and the submit button separated from the last input
   (the "no space between input and button" complaint). Mirrors the .field*
   rules below so the two rhythms stay identical. ===== */
.auth-form{display:flex;flex-direction:column;gap:14px}
.auth-form__title{font:var(--type-h2);margin:0}
.auth-form__hint{font:var(--type-body-sm);color:var(--text-secondary);margin:0}
.auth-form__alert{padding:9px 12px;border-radius:var(--radius-2);font:var(--type-body-sm);background:var(--status-err-bg);color:var(--status-err)}
.auth-form__body{display:flex;flex-direction:column;gap:12px}
.auth-form__body .ds-btn{margin-top:4px}
.auth-form__alt{font:var(--type-body-sm);color:var(--text-secondary)}
.auth-form__alt a{color:var(--accent)}
/* #794: button_to emits a block-level <form class="button_to"> — inline it so
   the resend button sits right next to the "Didn't receive the code?" hint. */
.auth-form__alt form.button_to{display:inline}
.auth-field{display:flex;flex-direction:column;gap:5px}
.auth-field + .auth-field{margin-top:6px}
.auth-field__label{font:var(--type-caption);color:var(--text-secondary);font-weight:500}
.auth-field__error{font:var(--type-caption);color:var(--status-err);min-height:0}
.auth-field[data-invalid] .ds-input{border-color:var(--status-err);box-shadow:var(--ring-focus)}

/* theme toggle: the glyph reflects the opposite of the active theme (swap on data-theme) */
.theme-toggle .ds-icon:last-child{display:none}
html[data-theme="dark"] .theme-toggle .ds-icon:first-child{display:none}
html[data-theme="dark"] .theme-toggle .ds-icon:last-child{display:inline-block}

/* locale menu (#616): JS-free <details> dropdown beside the theme toggle —
   languages icon button (ghost/sm) opens a small option card; relative
   positioning anchors the absolutely-placed list to the icon button. */
.locale-menu{position:relative}
.locale-menu__summary{list-style:none;cursor:pointer}
.locale-menu__summary::-webkit-details-marker{display:none}
.locale-menu__body{position:absolute;top:calc(100% + 6px);right:0;z-index:30;min-width:170px;display:flex;flex-direction:column;gap:2px;padding:6px;background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-surface);box-shadow:var(--shadow-md)}
.locale-menu__item{width:100%;justify-content:flex-start;font:var(--type-caption)}
.locale-menu__badge{margin-left:auto;color:var(--text-tertiary)}

/* ===== console screens (W4·T1) — content layout for the six product screens.
   Reuses ds-input/ds-btn/ds-badge; no new components are introduced. ===== */
.screen{padding:24px 32px;max-width:1080px;width:100%}
/* #614: opt-in per-screen modifier — drops the 1080px cap so a screen can
   use the full viewport width; base .screen (and every other screen) untouched. */
.screen--fluid{max-width:none}
/* #342 follow-up (owner review): direct screen children carry no vertical
   margins of their own (.screen__row/.card have none), so stacked sections
   visually touched — e.g. Overview's metric row against the Daily volume
   card. One collapsing sibling margin restores a uniform 20px rhythm (it
   collapses with .screen__head's own margin-bottom — no doubling). */
.screen > * + *{margin-top:20px}
.screen__head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px}
.screen__head h1{font:var(--type-h2);margin:0}
.screen__head p{font:var(--type-body-sm);color:var(--text-secondary);margin:4px 0 0}
.screen__row{display:grid;grid-template-columns:1fr;gap:20px}
@media(min-width:960px){.screen__row--2{grid-template-columns:1fr 1fr}.screen__row--aside{grid-template-columns:1.6fr 1fr}.screen__row--stack>.agent-preview{grid-column:2;grid-row:1/span 3}
/* #475 (manual review): on the edit flow's testers step the interstitial
   used to auto-place into the narrow aside — the empty PATCH form kept the
   wide column and the preview dropped below it. Definite columns put the
   testers card in the main column and the preview in the aside on EVERY
   step (the empty form auto-flows to an invisible row). Stays inside this
   block: below 960px the row is one 1fr column and a definite column 2
   would open a phantom implicit track. */
.screen__row--aside>.agent-preview{grid-column:2}.screen__row--aside>[data-form-steps-target="testers"]{grid-column:1}}
@media(min-width:760px){.screen__row--3{grid-template-columns:1fr 1fr 1fr}
/* #629 (manual review): the overview top row carries the balance metric
   next to sent/delivered/failed; below the breakpoint the cards stack 1-col
   like every other row. #632 (REVIEW_2, visual): fixed repeat(4,1fr) squeezed
   each track to ~97px at a 768px viewport (248px sidebar) and the 30px mono
   balance value (~157px + 36px card padding) clipped to "€1,25" inside the
   card's own undiscoverable overflow scroll. auto-fit/minmax(200px) tracks
   keep every track ≥200px (no clipping at any width) and reflow the row
   instead — 2×2 on tablets, 4-across only once the viewport truly fits it;
   with billing off the empty 4th track collapses so 3 cards fill the row. */
.screen__row--4{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}}
.card{background:var(--bg-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-surface);padding:18px;overflow-x:auto}
/* #637 (manual review): inside a .screen--fluid root (events) every card
   spans the viewport; .card--cap restores the base .screen 1080px cap —
   only the results list should be fluid, not the filter card. */
.card--cap{max-width:1080px}
/* #806 (fixes-3 W1·T1): .card{overflow-x:auto} computes overflow-y:auto
   too, making the events filters card a scroll container that clipped the
   absolutely-positioned Tom Select agent dropdown at the card edge (same
   mechanism #380 fixed for form fieldsets — those are <fieldset>, this is
   a <section>). The filters card holds no wide tables, so it opts out of
   the scroll container; the dropdown keeps its own internal 200px
   .ts-dropdown-content scrollbar for long agent lists. */
.card--no-clip{overflow:visible}
.card__title{font:var(--type-ui);font-weight:var(--weight-medium);margin:0 0 12px}
.card__sub{font:var(--type-mono-sm);color:var(--text-tertiary);margin:0 0 12px}
.card__actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}
/* #491 (review-4): right-aligned in-cell action group (agent show testers
   table; consumed by wave-2 sibling screens), mirroring .card__actions. */
.row-actions{display:flex;gap:8px;justify-content:flex-end;align-items:center}
/* forms reuse the auth-field rhythm but inline (two-up where it fits) */
.form-grid{display:grid;grid-template-columns:1fr;gap:14px}
fieldset{border:0;padding:0;margin:0;min-width:0}
legend{padding:0}
/* #368.11: a fieldset legend straddles the top border by default (the border
   passes through the legend's middle), so the Agent fieldset's border sat
   ~9px lower than the plain-card Preview aside in the same grid row — "the
   preview square is not aligned with the agent square". Floating the legend
   drops the straddle: it renders INSIDE the border like the aside's
   card__title and both card borders share the grid-row top. width:100%
   keeps the following content below the legend. */
fieldset.card>legend{float:left;width:100%}
/* #380 REVIEW_1 (gui interaction, critical): form fieldsets hold no wide
   tables (#194's overflow-x reason) but DO hold the #350 autocomplete
   listbox — overflow-x:auto computes overflow-y:auto too, clipping the
   absolutely-positioned dropdown at the card edge (~1 of 5 options visible
   at every viewport). Fieldsets drop the scroll container; flow-root keeps
   containing the floated legend without clipping. */
fieldset.card{display:flow-root;overflow:visible}
@media(min-width:760px){.form-grid--2{grid-template-columns:1fr 1fr}}
/* #791 (manual review): the events filter form regrids onto six 1fr tracks —
   from and to hug one track each (1/6), phone_number spans two (1/3) and the
   right third stays EMPTY (auto-flow would otherwise pull the agent select up
   into it, so the row-2 fields pin grid-row:2); every other field defaults to
   span 2 (thirds rhythm). Below 760px the single-column stack applies. */
@media(min-width:760px){.form-grid--6{grid-template-columns:repeat(6,1fr)}.form-grid--6>.field{grid-column:span 2}.form-grid--6>[data-field="from"],.form-grid--6>[data-field="to"]{grid-column:span 1}.form-grid--6>[data-field="agent_id"],.form-grid--6>[data-field="event"],.form-grid--6>[data-field="tracking"]{grid-row:2}}
/* #805 (fixes-3 W1·T2): no date-input width pin — the app's only type=date
   inputs (the events from/to fields) fill their 1/6 .form-grid--6 tracks via
   the base .ds-input width:100%, so the to input's right edge aligns with
   the agent select spanning tracks 1-2 of row 2 below it. */
/* #775: min-width:0 — as a grid item the field's automatic minimum is its
   min-content, so a long selected agent name blew the form-grid track out to
   the text width instead of ellipsizing (same fix as fieldset above). */
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
/* #791 (manual review): every .field ends with an EMPTY .field__error span,
   but .field's 5px flex gap still opens after it — the field's bottom edge sat
   5px below the input's, so bottom-aligned controls (the top-up form's
   align-self:end "Continue to payment" submit) dropped below the input. An
   empty span reserves no space by contract (min-height:0) — drop it from
   layout entirely. Filling the span (an API error) restores it. */
.field__error:empty{display:none}
.field__label{font:var(--type-caption);color:var(--text-secondary);font-weight:500}
.field__error{font:var(--type-caption);color:var(--status-err);min-height:0}
.field[data-invalid] .ds-input{border-color:var(--status-err);box-shadow:var(--ring-focus)}
.ds-input{height:var(--control-h);padding:0 10px;font:var(--type-ui);color:var(--text-primary);
  background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-control);width:100%}
.ds-input:focus{outline:none;box-shadow:var(--ring-focus)}
textarea.ds-input{height:auto;padding:8px 10px;resize:vertical;line-height:1.4}
select.ds-input{appearance:none}
/* #805: ds-switch — the design-system toggle (Switch.jsx geometry): a 32×18
   pill with a 12px knob. State rides [aria-checked="true"] ONLY (no parallel
   is-on class) so the no-JS full-page PATCH and the upcoming async Stimulus
   layer share one truth. ON = --bg-inverse track / --text-inverse knob at
   left:16px; OFF = --bg-inset track, --border-default border, --text-tertiary
   knob at left:2px; focus matches .ds-input (--ring-focus). */
.ds-switch{position:relative;width:32px;height:18px;padding:0;cursor:pointer;vertical-align:middle;border-radius:9px;background:var(--bg-inset);border:1px solid var(--border-default);transition:var(--transition-control)}
.ds-switch:focus{outline:none;box-shadow:var(--ring-focus)}
.ds-switch__knob{position:absolute;left:2px;top:2px;width:12px;height:12px;border-radius:50%;background:var(--text-tertiary);transition:left var(--dur-fast) var(--ease-out)}
.ds-switch[aria-checked="true"]{background:var(--bg-inverse);border-color:var(--bg-inverse)}
.ds-switch[aria-checked="true"]>.ds-switch__knob{left:16px;background:var(--text-inverse)}
/* #805 (GUI review R1/R2): button_to renders a BLOCK-level form.button_to, so
   the state text wrapped to a second line BELOW the switch inside .kv__v —
   inline the form so the text sits beside the pill (nowrap keeps it there). */
.kv__v .button_to{display:inline-block;vertical-align:middle}
.ds-switch__state{margin-left:8px;white-space:nowrap}
/* tables */
.ds-table{width:100%;border-collapse:collapse;font:var(--type-body-sm)}
/* #614: opt-in modifier — the table sizes to its content and may exceed the
   card width; .card{overflow-x:auto} (#194) remains the horizontal scroll
   container, so long mono columns scroll instead of being squeezed. */
.ds-table--grow{width:max-content;min-width:100%}
/* #756: opt-in modifier — clips mono cells at 16ch (a 26-char ULID no longer
   pushes the table past the card width) with the full value recoverable via
   the cell's title attribute. Keeps the nowrap; #194's in-card scroll stays
   as the small-viewport safety net. */
.ds-table--clip td.mono{max-width:16ch;overflow:hidden;text-overflow:ellipsis}
.ds-table th,.ds-table td{text-align:left;vertical-align:middle;padding:9px 10px;border-bottom:1px solid var(--border-subtle);white-space:nowrap} /* #750: middle — mixed-height cells (logo, badges, buttons) share one centerline */
.ds-table th{font:var(--type-caption);text-transform:uppercase;letter-spacing:var(--track-caps);color:var(--text-tertiary);font-weight:500}
.ds-table td.mono,.ds-table th.mono{font:var(--type-mono-sm)}
/* paging + inline bits */
.pager{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}
.empty{padding:24px;text-align:center;color:var(--text-tertiary);font:var(--type-body-sm)}
.kv{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid var(--border-subtle);font:var(--type-body-sm)}
.kv:last-child{border-bottom:0}
.kv__k{color:var(--text-secondary)}.kv__v{font:var(--type-mono-sm)}
/* #886: copy-to-clipboard icon on the api-id row — check glyph swaps in
   while copied (same pattern as the theme-toggle's icon pair). */
.copy-btn{vertical-align:middle;margin-left:6px}
.copy-btn [data-icon="check"]{display:none}
.copy-btn [data-icon="check"]{display:none}
/* 0,4,0 so the :hover color rule (0,3,0) can't grey out the copied state —
   the cursor is still on the button right after clicking. */
.ds-icon-btn.copy-btn.copied,
.ds-icon-btn.copy-btn.copied:hover{color:var(--status-ok)}
.copy-btn.copied [data-icon="copy"]{display:none}
.copy-btn.copied [data-icon="check"]{display:inline-block}
.muted{color:var(--text-tertiary);font:var(--type-body-sm)}
.flash{padding:9px 12px;border-radius:var(--radius-2);font:var(--type-body-sm);margin-bottom:14px}
.flash--alert{background:var(--status-err-bg);color:var(--status-err)}.flash--notice{background:var(--status-ok-bg);color:var(--status-ok)}
/* handset preview (Send, #311) — a FAITHFUL render of the subscriber's RCS
   client, ported from rcs-relay-ui-design/components/messaging/HandsetPreview.jsx
   (built against Google's RBM X-Platform Playbook, uploads/refs-…-jfun.pdf).
   The interior deliberately uses the PLATFORMS' hardcoded palettes, not Open
   RCS tokens: the point is to show the OS surface, not our brand. The handset
   scheme follows the console data-theme (light/dark); the platform is pure
   CSS off data-platform, so the switch never rewrites the DOM. */
.handset-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.handset-head .card__title{margin:0}
.handset-switch{display:inline-flex;gap:2px;padding:2px;border:1px solid var(--border-default);border-radius:var(--radius-pill);background:var(--bg-surface)}
.handset-switch__btn{border:0;background:transparent;color:var(--text-secondary);font:var(--type-ui);height:30px;padding:0 14px;border-radius:var(--radius-pill);cursor:pointer}
.handset-switch__btn:hover{color:var(--text-primary);background:var(--bg-hover)}
.handset-switch__btn[aria-pressed="true"]{background:var(--bg-active);color:var(--text-primary);font-weight:500}

/* frame + Android (Google Messages) palette, light scheme (base/default).
   aspect-ratio is the member-pinned device ratio (161.15×74.24 mm ≈ 2.17:1):
   with height auto the flex column's min-content floor lets the handset GROW
   with content, but it never collapses below the ratio — a real device shape. */
.handset{
  --hs-screen:#FFFFFF;--hs-chrome:#EEF1F6;--hs-chrome-line:transparent;--hs-in-bg:#EEF1F6;--hs-in-fg:#1B1C1E;
  --hs-dim:#5F6368;--hs-faint:#747775;--hs-tint:#0B57D0;--hs-card:#EEF1F6;
  --hs-field:#EEF1F6;--hs-bar:#1B1C1E;--hs-accent-soft:#C2F0C7;--hs-bezel:#1B1B1E;
  --hs-card-line:#DADCE0;--hs-pill:#FFFFFF;--hs-glyph:#0B57D0;--hs-media:#E8EAED;--hs-line:#E8EAED;
  position:relative;display:flex;flex-direction:column;width:min(340px,100%);min-width:264px;margin:0 auto;
  aspect-ratio:74.24/161.15;
  background:var(--hs-screen);color:var(--hs-in-fg);
  font-family:Roboto,"Noto Sans",system-ui,sans-serif;font-size:14px;
  border:9px solid var(--hs-bezel);border-radius:32px;box-shadow:var(--shadow-lg);overflow:hidden;
}
/* iOS 26 palette + geometry (Liquid Glass chrome) */
.handset[data-platform="ios"]{
  --hs-screen:#FFFFFF;--hs-chrome:rgba(255,255,255,.86);--hs-chrome-line:rgba(0,0,0,.10);--hs-in-bg:#E9E9EB;--hs-in-fg:#000000;
  --hs-dim:#6C6C70;--hs-faint:#8E8E93;--hs-tint:#0A7CFF;--hs-card:#FFFFFF;
  --hs-field:#FFFFFF;--hs-bar:#000000;
  --hs-card-line:rgba(0,0,0,.12);--hs-pill:#FFFFFF;--hs-glyph:#0A7CFF;--hs-media:#E9E9EB;--hs-line:rgba(0,0,0,.08);
  font-family:-apple-system,"SF Pro Text","Helvetica Neue",system-ui,sans-serif;border-radius:44px;
}
/* dark handset schemes, still platform-accurate (a dark console shows a dark handset) */
[data-theme="dark"] .handset{
  --hs-screen:#131316;--hs-chrome:#1B1C20;--hs-in-bg:#26282D;--hs-in-fg:#E3E3E6;
  --hs-dim:#9AA0A6;--hs-faint:#8E9297;--hs-tint:#A8C7FA;--hs-card:#26282D;
  --hs-field:#26282D;--hs-bar:#E3E3E6;--hs-accent-soft:#1E4620;--hs-bezel:#3A3A3E;
  --hs-card-line:#3C4043;--hs-pill:#202124;--hs-glyph:#A8C7FA;--hs-media:#303134;--hs-line:#3C4043;
}
[data-theme="dark"] .handset[data-platform="ios"]{
  --hs-screen:#000000;--hs-chrome:rgba(28,28,30,.86);--hs-chrome-line:rgba(255,255,255,.14);--hs-in-bg:#26262A;--hs-in-fg:#FFFFFF;
  --hs-dim:#98989F;--hs-faint:#8E8E93;--hs-tint:#4C9DFF;--hs-card:#1C1C1E;
  --hs-field:#1C1C1E;--hs-bar:#FFFFFF;
  --hs-card-line:rgba(255,255,255,.16);--hs-pill:#1C1C1E;--hs-glyph:#4C9DFF;--hs-media:#2C2C2E;--hs-line:rgba(255,255,255,.14);
}

/* camera affordance: Android hole-punch dot → iOS Dynamic Island pill (bezel-black in any scheme) */
.handset__island{position:absolute;top:9px;left:50%;transform:translateX(-50%);width:11px;height:11px;border-radius:999px;background:#000;z-index:2}
.handset[data-platform="ios"] .handset__island{top:8px;width:82px;height:22px}

/* status bar: clock (+ DND bell on iOS) left, signal/wifi/battery right */
.handset__statusbar{display:flex;align-items:center;justify-content:space-between;padding:9px 16px 3px;font-size:12px;font-weight:600}
.handset[data-platform="ios"] .handset__statusbar{padding:11px 22px 3px}
.handset__clock{display:inline-flex;align-items:center;gap:4px}
.handset__bell{display:none}
.handset[data-platform="ios"] .handset__bell{display:inline-flex}
.handset__signals{display:inline-flex;align-items:center;gap:5px}

/* thread header — Google Messages app bar (back + overflow only: the agent
   identity lives in the hero below, per the RBM rich-card anatomy reference) */
.handset__header{display:flex;align-items:center;gap:11px;padding:5px 14px 10px;background:var(--hs-chrome);color:var(--hs-in-fg)}
.handset__header--android{justify-content:space-between;padding:6px 14px 2px}
.handset__logo{display:grid;place-items:center;flex:0 0 auto;width:28px;height:28px;border-radius:8px;background:var(--hs-tint);color:#fff}
/* Android agent hero (RBM anatomy): centered placeholder logo tile, name with
   the blue verified rosette, description — on the chrome surface */
.handset__hero{display:flex;flex-direction:column;align-items:center;gap:3px;padding:4px 16px 14px;background:var(--hs-chrome);text-align:center}
.handset__hero-logo{display:grid;place-items:center;flex:0 0 auto;width:64px;height:64px;border-radius:16px;margin-bottom:7px;background:var(--hs-tint);color:#fff}
.handset__hero-name{display:inline-flex;align-items:center;gap:6px;max-width:100%;font-size:17px;font-weight:500;line-height:1.3;color:var(--hs-in-fg)}
.handset__hero-name .handset__name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.handset__hero-name [data-icon]{flex:0 0 auto;color:var(--hs-tint)}
.handset__hero-desc{font-size:12px;line-height:1.35;color:var(--hs-dim)}
/* iOS 26: back circle — logo tile over a floating name capsule — spacer */
.handset[data-platform="ios"] .handset__header{gap:0;padding:2px 12px 8px;backdrop-filter:blur(12px);border-bottom:0.5px solid var(--hs-chrome-line)}
.handset__back{display:grid;place-items:center;width:30px;height:30px;border-radius:999px;background:var(--hs-card);box-shadow:0 1px 4px rgba(0,0,0,.12)}
.handset__id{display:flex;flex-direction:column;align-items:center;min-width:0}
.handset__capsule{display:inline-flex;align-items:center;gap:3px;max-width:180px;margin-top:-4px;padding:3px 9px;border-radius:999px;background:var(--hs-card);box-shadow:0 1px 4px rgba(0,0,0,.12);font-size:11px;font-weight:700;letter-spacing:-0.01em;white-space:nowrap}
.handset__capsule .handset__name{min-width:0;overflow:hidden;text-overflow:ellipsis}
/* pure-CSS platform toggles (the switch only flips data-platform) */
.handset__header--ios{display:none}
.handset[data-platform="ios"] .handset__header--ios{display:grid}
.handset[data-platform="ios"] .handset__header--ios{grid-template-columns:30px 1fr 30px}
.handset[data-platform="ios"] .handset__header--android{display:none}

/* thread: the message is a plain incoming TEXT bubble on BOTH platforms (the
   send page authors text messages only — no rich card, #311 round 4). One
   shared element; CSS skins it per platform off data-platform. */
.handset__thread{flex:1;min-height:0;display:flex;flex-direction:column;gap:5px;padding:10px 12px 12px;background:var(--hs-screen);overflow-y:auto;scrollbar-width:none}
/* scrollable column: children keep their natural height (a shrinkable card
   would clip its own content — overflow:hidden zeroes its min-content floor) */
.handset__thread>*{flex:0 0 auto}
.handset[data-platform="ios"] .handset__thread{gap:3px}
.handset__day{align-self:center;margin:6px 0 8px;font-size:11px;font-weight:500;color:var(--hs-faint)}
/* pre-wrap: typed line breaks survive in the preview, as on a real client
   (gui-review interaction finding) */
.handset__bubble{flex:0 0 auto;align-self:flex-start;max-width:78%;padding:9px 14px 10px;border-radius:18px 18px 18px 4px;background:var(--hs-in-bg);color:var(--hs-in-fg);font-size:14px;line-height:1.4;word-break:break-word;white-space:pre-wrap}
.handset[data-platform="ios"] .handset__bubble{padding:7px 12px 8px;border-radius:19px 19px 19px 5px;font-size:15px;line-height:1.29;letter-spacing:-0.01em}
/* message slot (#721 W2·T1): the dispatcher partial renders bubble OR card
   inside it; display:contents keeps both direct flex items of the thread */
.handset__message{display:contents}

/* standalone rich card (#721 W2·T1): Google Messages card anatomy at the
   bubble position — pill surface, hairline outline, center-cropped media
   (RBM 112/168/264 dp at the 340px frame's ~0.9 dp scale → 105/158/248px;
   default = MEDIUM), line-clamped title/description, full-width stacked
   suggestion buttons with hairline separators and tinted text. Horizontal
   cards lay the media out as a side thumbnail (order flips it right). */
.handset__rcard{flex:0 0 auto;align-self:flex-start;width:78%;overflow:hidden;border:1px solid var(--hs-card-line);border-radius:18px;background:var(--hs-pill);color:var(--hs-in-fg);font-size:14px;line-height:1.4;word-break:break-word}
.handset__rcard--horizontal{display:flex;flex-wrap:wrap}
.handset__rcard--thumb-right .handset__rcard-media{order:2}
.handset__rcard-media{display:block;width:100%;height:158px;object-fit:cover;background:var(--hs-media)}
.handset__rcard--short .handset__rcard-media{height:105px}
.handset__rcard--medium .handset__rcard-media{height:158px}
.handset__rcard--tall .handset__rcard-media{height:248px}
.handset__rcard--horizontal .handset__rcard-media{flex:0 0 40%;width:40%;height:auto;align-self:stretch}
.handset__rcard-body{display:flex;flex-direction:column;gap:3px;padding:12px 14px}
.handset__rcard--horizontal .handset__rcard-body{flex:1;min-width:0}
.handset__rcard-title{font-weight:500;line-height:1.3;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.handset__rcard-desc{font-size:13px;color:var(--hs-dim);display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}
.handset__rcard-suggs{display:flex;flex-direction:column}
.handset__rcard--horizontal .handset__rcard-suggs{flex-basis:100%}
.handset__sugg{display:flex;align-items:center;gap:8px;width:100%;padding:10px 14px;border:0;border-top:1px solid var(--hs-line);background:var(--hs-pill);color:var(--hs-tint);font:inherit;font-size:14px;font-weight:500;text-align:left;cursor:default}
.handset__sugg-icon{display:inline-flex;flex:0 0 auto;color:var(--hs-glyph)}
/* carousel rich card (#721 W3·T1): horizontally scrollable row of
   equal-height cards — full-bleed past the thread padding so the next card
   peeks, scrollbar hidden like the thread. Cards are narrow frames around
   the shared rcard anatomy: SMALL ~120 dp → 112px, MEDIUM ~232 dp → 218px
   (capped at 75% of the thread so the next card still peeks); a fixed media
   height + flexing body keep every card the same height; per-card suggestion
   stacks. */
.handset__carousel{display:flex;align-items:stretch;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 -12px;padding:0 12px}
.handset__carousel::-webkit-scrollbar{display:none}
.handset__carousel-card{flex:0 0 auto;display:flex;flex-direction:column;width:112px;max-width:75%;overflow:hidden;border:1px solid var(--hs-card-line);border-radius:18px;background:var(--hs-pill);color:var(--hs-in-fg);font-size:13px;line-height:1.4;word-break:break-word}
.handset__carousel--medium .handset__carousel-card{width:218px}
.handset__carousel-card .handset__rcard-media{height:84px;flex:0 0 auto}
.handset__carousel-card .handset__rcard-body{flex:1;min-width:0;padding:10px 12px}
/* top-level suggestion chips (#721 W4·T1): the horizontally scrollable pill
   row Google Messages docks between the thread and the composer for a TEXT
   message (replies plain, actions with their glyph). The slot wrapper is
   display:contents — the row is a direct flex item of the frame, and an empty
   slot (no suggestions, non-text kinds) leaves no husk. Chips clamp to one
   line like the card title/description clamps. */
.handset__chips-slot{display:contents}
.handset__chips{flex:0 0 auto;display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:0 12px 10px}
.handset__chips::-webkit-scrollbar{display:none}
.handset__chip{flex:0 0 auto;display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:8px 14px;border:1px solid var(--hs-card-line);border-radius:999px;background:var(--hs-pill);color:var(--hs-tint);font:inherit;font-size:14px;font-weight:500;text-align:left;cursor:default}
.handset__chip-icon{display:inline-flex;flex:0 0 auto;color:var(--hs-glyph)}
.handset__chip-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* hardening (#721 W4·T1): a broken media URL swaps the img for the placeholder
   tile — it keeps the .handset__rcard-media sizing classes, only centering the
   glyph; an empty card gets the localized line instead of a blank frame */
.handset__media-fallback{display:grid;place-items:center;color:var(--hs-faint)}
.handset__rcard-empty{display:block;padding:12px 14px;color:var(--hs-dim);font-size:13px}
/* no scroll animation on the handset scrollers — reduced-motion users get
   gesture-driven scrolling only (carousel + chips) */
@media (prefers-reduced-motion:reduce){.handset__carousel,.handset__chips{scroll-behavior:auto}}
/* the Android-only chrome (agent hero, day divider) hides on iOS */
.handset[data-platform="ios"] :is(.handset__hero,.handset__day){display:none}

/* composer chrome (decorative — the real input is the console form) */
.handset__composer{align-items:center;gap:9px;padding:7px 11px 5px;background:var(--hs-chrome);color:var(--hs-in-fg)}
.handset__composer--android{display:flex}
.handset__composer--ios{display:none}
.handset[data-platform="ios"] .handset__composer--android{display:none}
.handset[data-platform="ios"] .handset__composer--ios{display:flex}
.handset[data-platform="ios"] .handset__composer{gap:8px;padding:7px 11px 4px;backdrop-filter:blur(12px)}
.handset__cfield{flex:1;display:flex;align-items:center;gap:9px;height:38px;padding:0 12px;border-radius:999px;background:var(--hs-field);font-size:13px;color:var(--hs-dim)}
.handset__chint{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.handset__cfab{display:grid;place-items:center;flex:0 0 auto;width:38px;height:38px;border-radius:999px;background:var(--hs-accent-soft);color:var(--hs-in-fg)}
.handset__composer--ios .handset__cbtn{display:grid;place-items:center;width:30px;height:30px;border-radius:999px;background:var(--hs-card);box-shadow:0 1px 4px rgba(0,0,0,.10)}
.handset__composer--ios .handset__cfield{justify-content:space-between;height:32px;background:var(--hs-card);box-shadow:0 1px 4px rgba(0,0,0,.10);color:var(--hs-faint)}

/* home indicator / gesture pill */
.handset__home{display:block;width:96px;height:3px;margin:3px auto 6px;border-radius:999px;background:var(--hs-bar);opacity:.5}
.handset[data-platform="ios"] .handset__home{width:118px;height:4px;margin:4px auto 7px;opacity:1}

/* ===== agents index table (#443): the Name cell links to the agent page
   (no Manage column) with a 24px logo thumb; empty tile = dot fallback ===== */
.agent-name{display:inline-flex;align-items:center;gap:8px;color:var(--text-accent);text-decoration:none}
/* #750: inside .ds-table the inline-flex link's baseline is its bottom edge
   when the row carries an <img> (no text) — lift it onto the td centerline. */
.ds-table .agent-name{vertical-align:middle}
.agent-name:hover .agent-name__text{text-decoration:underline}
.agent-name__logo{width:24px;height:24px;border-radius:var(--radius-2);object-fit:cover;flex:none}
span.agent-name__logo{display:inline-flex;align-items:center;justify-content:center;background:var(--gray-950);color:#fff;font:var(--type-mono-sm)}

/* ===== agent form widgets (#354 W1.1) ===== */
/* char counter under agent_name/agent_description (driven by minlength/maxlength) */
.field__counter{font:var(--type-caption);color:var(--text-tertiary)}
/* #350 (W2.1): create-only company autocomplete. The wrapper is the
   .form-grid--2 grid child and anchors the absolute dropdown card under the
   input (the .field inside keeps its own rhythm); existing tokens only.
   #392: the card is bordered by the DS --hairline instead of --border-default
   and the shadow drops to --shadow-sm (elevation.css doctrine: depth comes
   from the 1px line, not the blur).
   #399: margin:0 is load-bearing — without it the UA default
   ul{margin-block:1em} pushes the absolute card 1em off its anchor. The
   vertical anchor itself (input bottom) is pinned by the controller's
   place(); top:100% here is only the pre-JS fallback. */
.company-autocomplete{position:relative}
.company-autocomplete__results{position:absolute;top:100%;margin:0;left:0;right:0;z-index:20;padding:6px;list-style:none;max-height:320px;overflow-y:auto;background:var(--bg-surface);border:var(--hairline);border-radius:var(--radius-2);box-shadow:var(--shadow-sm)}
.company-autocomplete__option{display:flex;flex-direction:column;gap:2px;padding:8px;border-radius:var(--radius-2);cursor:pointer;font:var(--type-body-sm);color:var(--text-primary)}
.company-autocomplete__option.is-active,.company-autocomplete__option:hover{background:var(--bg-hover);box-shadow:var(--ring-focus)}
.company-autocomplete__meta{font:var(--type-caption);color:var(--text-tertiary)}
/* color combo field: one .ds-input-styled wrapper — round swatch left,
   borderless hex input, native picker affordance right */
.color-field{display:flex;align-items:center;gap:8px;padding:0 8px}
.color-field:focus-within{box-shadow:var(--ring-focus)}
.color-field__swatch{flex:0 0 auto;width:20px;height:20px;border-radius:999px;border:1px solid var(--border-default);background:var(--bg-subtle)}
.color-field__hex{flex:1;min-width:0;height:100%;padding:0;border:0;background:transparent;font:var(--type-mono-sm);color:var(--text-primary)}
.color-field__hex:focus{outline:none}
.color-field__picker{flex:0 0 auto;width:26px;height:26px;padding:0;border:0;border-radius:999px;background:transparent;cursor:pointer}
.color-field__picker::-webkit-color-swatch-wrapper{padding:0}
.color-field__picker::-webkit-color-swatch{border:1px solid var(--border-default);border-radius:999px}
.color-field__picker::-moz-color-swatch{border:1px solid var(--border-default);border-radius:999px}
/* asset URL field: live thumbnail + image-spec hint (relay IMAGE_SPECS).
   #366.5: the logo thumb renders at the spec's real 1:1 ratio (224×224);
   the banner keeps its 1440×448 ≈ 3.2:1 box. */
.asset-field__thumb{margin-top:4px;width:56px;height:56px;object-fit:cover;border-radius:var(--radius-2);border:1px solid var(--border-subtle)}
.asset-field__thumb--banner{width:160px;height:50px}
.asset-field__specs{font:var(--type-mono-sm)}
/* W2.2 slot: the upload BUTTON markup is the sibling task's — the full-width
   tinted style ships now so W2.2 only renders class="ds-btn asset-field__upload". */
.asset-field__upload{width:100%;margin-top:6px;background:var(--bg-active);border-color:transparent;color:var(--accent)}
.asset-field__upload:hover{background:var(--bg-hover);color:var(--accent-hover)}

/* #856: the wizard's carrier checkbox rows — the label stretches so every
   status badge lands on the same right column whatever the name length. */
.carriers-step__row{display:flex;align-items:center;gap:8px}
.carriers-step__row label{flex:1}

/* #366.11: the edit form's 2-step flow hides a step/preview via [hidden] —
   display rules would otherwise beat the UA [hidden] rule (#191 lesson). */
.form-grid[hidden],.agent-preview[hidden]{display:none}

/* #366.12: launch-confirmation modal (dialog controller) — fixed overlay +
   centred panel, same shape as the docs-search dialog. */
.modal{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.4);display:flex;align-items:center;justify-content:center;padding:20px}
.modal[hidden]{display:none}
.modal__panel{width:min(440px,92vw);background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-card);box-shadow:var(--shadow-lg);padding:20px}
.modal__panel .card__actions{justify-content:flex-end}
/* #772 W1-T2 (#774): the launch modal's freeze warning — token red, same source as .field__error */
.modal__warn{color:var(--status-err)}

/* ===== agent info-sheet preview (agents form, #354 W1.1) — the Google
   Messages agent sheet (owner screenshot 2026-09-04), NOT the /send
   conversation handset. Metrics from rcs-relay-ui-design
   HandsetPreview.jsx AndroidAgent (92px hero, 46px logo tile breaking the
   hero edge by 26px, 50×38 tonal pills, 13px details card). Platform
   literals, not console tokens — same convention as the #311 handset. ===== */
.agent-preview{position:sticky;top:20px;align-self:start}
.agent-phone{
  --ap-sheet:#F0F4F9;--ap-card:#FFFFFF;--ap-fg:#1B1C1E;--ap-dim:#5F6368;--ap-faint:#9AA0A6;
  --ap-tint:#0B57D0;--ap-line:#E1E3E6;--ap-hero:#202124;--ap-bar:#1B1C1E;
  position:relative;display:flex;flex-direction:column;width:min(320px,100%);margin:0 auto;
  /* #366.7: standard smartphone ratio floor (19.5:9 at the 320px preview
     width ≈ 693px) even when only a few detail rows have values. */
  min-height:693px;
  background:var(--ap-sheet);color:var(--ap-fg);
  font-family:Roboto,"Noto Sans",system-ui,sans-serif;font-size:14px;
  border:9px solid #1B1B1E;border-radius:32px;box-shadow:var(--shadow-lg);overflow:hidden;
}
[data-theme="dark"] .agent-phone{
  --ap-sheet:#131316;--ap-card:#1B1C20;--ap-fg:#E3E3E6;--ap-dim:#9AA0A6;--ap-faint:#8E9297;
  --ap-tint:#A8C7FA;--ap-line:#2A2B2F;--ap-hero:#0B0C0E;--ap-bar:#E3E3E6;
}
.agent-phone__island{position:absolute;top:9px;left:50%;transform:translateX(-50%);width:11px;height:11px;border-radius:999px;background:#000;z-index:2}
.agent-phone__statusbar{display:flex;align-items:center;justify-content:space-between;padding:9px 16px 3px;font-size:12px;font-weight:600}
.agent-phone__signals{display:inline-flex;align-items:center;gap:5px}
.agent-phone__back{padding:6px 14px;color:var(--ap-fg)}
/* hero: the banner image, or the dark "hero · 1440×448" placeholder */
.agent-phone__hero{position:relative;height:92px;background:var(--ap-hero);display:grid;place-items:center}
.agent-phone__banner{width:100%;height:92px;object-fit:cover;display:block}
.agent-phone__hero-placeholder{font-size:11px;color:var(--ap-faint);letter-spacing:.02em}
/* logo tile breaks the hero's bottom edge (letter tile until a logo URL).
   #368.7: position:relative activates the z-index — without it the
   POSITIONED hero paints over the tile's 26px overlap. #368.5: the tile
   takes the agent color (--agent-tint), not just the action-pill icons.
   #368.14: the 3px sheet-colored frame is gone (owner: "remove the border
   around the logo") — radius + crop stay. */
.agent-phone__logo{display:grid;place-items:center;width:46px;height:46px;margin:-26px auto 0;position:relative;
  border-radius:12px;background:var(--agent-tint,var(--ap-tint));color:#fff;overflow:hidden;z-index:1}
.agent-phone__logo-letter{font-size:18px;font-weight:600}
.agent-phone__logo img{width:100%;height:100%;object-fit:cover}
.agent-phone__id{display:flex;flex-direction:column;align-items:center;gap:2px;padding:8px 16px 12px;text-align:center}
.agent-phone__name{font-size:16px;font-weight:500;line-height:1.3}
.agent-phone__desc{font-size:12px;line-height:1.35;color:var(--ap-dim)}
/* tonal action pills: 50×38, 17px icon (inline svg) + 10.5px label below;
   the agent color tints the icons via --agent-tint */
.agent-phone__actions{display:flex;justify-content:center;gap:10px;padding:2px 16px 14px}
.agent-phone__action{display:flex;flex-direction:column;align-items:center;gap:4px}
.agent-phone__pill{display:grid;place-items:center;width:50px;height:38px;border-radius:999px;background:var(--ap-card);color:var(--agent-tint,var(--ap-tint))}
.agent-phone__action-label{font-size:10.5px;color:var(--ap-dim)}
/* details cards: value-over-label rows; a row stays hidden until its value exists */
.agent-phone__details{display:flex;flex-direction:column;margin:0 12px;background:var(--ap-card);border-radius:13px;overflow:hidden}
.agent-phone__details + .agent-phone__details{margin-top:10px}
.agent-phone__row{display:flex;align-items:center;gap:12px;padding:10px 14px;border-bottom:1px solid var(--ap-line)}
.agent-phone__row:last-child{border-bottom:0}
.agent-phone__row>svg,.agent-phone__row>[data-icon]{flex:0 0 auto;color:var(--ap-dim)}
.agent-phone__meta{display:flex;flex-direction:column;min-width:0}
.agent-phone__value{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agent-phone__label{font-size:11px;color:var(--ap-dim)}
/* display:flex/block above would beat the UA [hidden] rule — restore it
   (the #191 dialog lesson): rows/thumbs start hidden until a value exists. */
.agent-phone :is(.agent-phone__row,img)[hidden]{display:none}
.agent-phone__gesture{width:96px;height:3px;margin:10px auto 6px;border-radius:999px;background:var(--ap-bar);opacity:.5}
/* drawer (Events detail) — lightweight stand-in for a DS Drawer component */
.ds-drawer{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.4)}
.ds-drawer__panel{position:absolute;top:0;right:0;height:100%;width:380px;max-width:90vw;background:var(--bg-surface);border-left:1px solid var(--border-subtle);padding:18px;overflow:auto;box-shadow:var(--elevation-2,var(--shadow-card))}
.ds-drawer__head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
/* #449 (plan #439 W1·T10): past 1392px (1080px .screen cap + 2×32px padding
   + 248px sidebar) the main column stops stretching, so give the event-detail
   panel its full double width; below that the 380px/90vw base applies. */
@media(min-width:1392px){.ds-drawer__panel{width:760px;max-width:calc(100vw - 248px)}}

/* ===== Overview dashboard (W2·T1, #168) — metric cards + pure-CSS stacked
   bar chart from the zero-filled by_date series (no chart library, no Node
   build). Heights are data-driven inline styles; colors are tokens. ===== */
.metric{display:flex;flex-direction:column;gap:8px}
.metric__label{font:var(--type-caption);font-weight:500;text-transform:uppercase;letter-spacing:var(--track-caps);color:var(--text-tertiary)}
.metric__value{font-family:var(--font-mono);font-size:var(--text-30);font-weight:var(--weight-medium);letter-spacing:-0.02em;line-height:1.3}
.metric__sub{font:var(--type-mono-sm);color:var(--text-secondary)}
.bars{display:flex;align-items:flex-end;gap:10px}
.bars__day{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.bars__group{display:flex;align-items:flex-end;gap:2px;height:120px}
.bars__bar{flex:1;min-width:2px;border-radius:var(--radius-1) var(--radius-1) 0 0}
.bars__bar--sent{background:var(--bg-active)}
.bars__bar--delivered{background:var(--accent)}
.bars__bar--failed{background:var(--status-err)}
.bars__label{font:var(--type-mono-sm);font-size:10px;color:var(--text-tertiary);text-align:center}
.bars__legend{display:flex;gap:16px;margin-top:12px}
.bars__legend span{display:inline-flex;align-items:center;gap:6px;font:var(--type-mono-sm);color:var(--text-tertiary)}
.bars__swatch{width:8px;height:8px;border-radius:var(--radius-1);flex:none}
.bars__swatch--sent{background:var(--bg-active)}
.bars__swatch--delivered{background:var(--accent)}
.bars__swatch--failed{background:var(--status-err)}
/* display:flex above would beat the UA [hidden] rule (the #191 dialog
   lesson): the overview-chart controller hides the no-JS fallback below the
   canvas via [hidden] — restore it so the fallback can't paint a second
   chart (#626). */
.bars[hidden],.bars__legend[hidden]{display:none}

/* ===== responsive shell (REVIEW_28 fix): the fixed 248px sidebar starved the
   content column below 768px (~127px at 375px) and every console screen
   overflowed. The nav collapses off-canvas behind the .nav-toggle hamburger;
   wide tables scroll inside their cards instead of the page — the base
   `.card{overflow-x:auto}` rule (REVIEW_2 critical, #194) covers ALL widths:
   cards stay their own scroll container and grid items past 768px too. ===== */
.nav-toggle{display:none;flex-direction:column;align-items:center}
.nav-toggle .nav-toggle__bar{width:16px;height:2px;background:currentColor;border-radius:1px}
.nav-toggle .nav-toggle__bar + .nav-toggle__bar{margin-top:3px}
/* scrim painted whenever an off-canvas nav is open — base scope so it covers
   the docs tree drawer at ≤820px (#310), not only the console nav at ≤767px;
   the attribute is only ever set while a toggle is visible, so it can't fire
   on desktop. */
body[data-nav-open]::before{content:"";position:fixed;inset:0;z-index:55;background:rgba(0,0,0,.4)}
@media(max-width:767px){
.nav-toggle{display:inline-flex}
.side-nav{position:fixed;top:0;bottom:0;left:0;z-index:60;transform:translateX(-100%);transition:transform var(--transition-control);box-shadow:var(--elevation-2,var(--shadow-card))}
body[data-nav-open] .side-nav{transform:none}
.top-bar{padding:0 12px}
.top-bar__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* #342 follow-up: the TopBar Send CTA goes icon-only on phones so the
   hamburger + crumbs + toggles cannot overflow (aria-label stays). */
.top-bar__send-label{display:none}
.screen{padding:16px}
.kv__v{overflow-wrap:anywhere}
}
/* ===== in-page section nav + stacked sections (Account, W2·T3): anchor jump
   links over stacked cards; fieldset reset so `disabled` locks a whole form. */
.section-nav{display:flex;gap:2px;margin-bottom:20px;border-bottom:1px solid var(--border-subtle)}
.section-nav a{padding:7px 10px;font:var(--type-ui);color:var(--text-secondary);text-decoration:none;border-bottom:2px solid transparent;margin-bottom:-1px}
.section-nav a:hover{color:var(--text-primary)}
.section-nav a:focus-visible{outline:none;box-shadow:var(--ring-focus)}
.section__title{font:var(--type-ui);font-weight:var(--weight-medium);margin:0 0 10px}
#general,#api,#usage{scroll-margin-top:16px}
fieldset.form-grid{border:0;padding:0;margin:0;min-width:0}
.topup-amounts{display:flex;flex-wrap:wrap;gap:8px}
/* #426/#777: GUI review — "Continue to payment" sits NEXT TO the amount
   field (row 1, hugging the input's right edge, baseline-aligned with the
   control) and the presets under both (row 2), but the DOM order stays
   actions→presets (the implicit-Enter default button — REVIEW_3 in
   billing.html.erb; implicit submission walks tree order, never visual
   order). form-grid is a single 1fr-column grid, so .topup-form switches
   to two columns and places its three unchanged children explicitly: tree
   order untouched. */
.topup-form{grid-template-columns:auto 1fr}
.topup-form>.field{grid-row:1;grid-column:1}
.topup-form>.card__actions{grid-row:1;grid-column:2;align-self:end;margin-top:0;justify-content:flex-start}
.topup-form>.topup-amounts{grid-row:2;grid-column:1/-1}
.topup-form #amount{width:12ch;max-width:100%}
/* #780/#805 (fixes-3 W2·T1): the auto-topup config form lays its three EUR
   fields and the actions (Save + cross-form Replace/Save card) on ONE flex
   line ≥760px — button bottoms aligned with the control bottoms (same
   approach as .topup-form>.card__actions); flex-wrap lets narrow viewports
   stack cleanly. */
/* #816: the read-only summary (status switch, saved card, spent this month)
   must read as a separate block from the editable config fields — the empty
   control-less #auto-topup-setup form adds no height, so the gap is only the
   kv row's 7px padding; 14px on top matches the in-card block rhythm. */
.auto-topup-form{margin-top:14px}
.auto-topup-form__row{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end}
.auto-topup-form__row>.card__actions{margin-top:0}
.auto-topup-form input[type="number"].ds-input{width:12ch;max-width:100%}
/* #310: five presets wrap 4+1 in a flex row at 375px — on narrow viewports
   they become an equal-width 3+2 grid. CSS-only: the REVIEW_3 DOM order
   (primary button first, then presets) must stay untouched. */
@media(max-width:480px){
.topup-amounts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.topup-amounts .ds-btn{width:100%}
}
.card__actions--start{justify-content:flex-start}

/* ===== docs site (public API reference — port of ui_kits/docs, issue #169).
   Distinct from the console shell: sticky header + 320px endpoint tree +
   680px prose column + 196px on-this-page rail. ===== */
.docs-shell{min-height:100vh;background:var(--bg-page);color:var(--text-primary);font:var(--type-body)}
.docs-header{position:sticky;top:0;z-index:20;height:var(--topbar-h);display:flex;align-items:center;gap:16px;padding:0 24px;border-bottom:1px solid var(--border-subtle);background:var(--bg-page)}
.docs-header__wordmark{font:var(--weight-medium) var(--text-16)/1 var(--font-sans);letter-spacing:-0.03em;color:var(--text-primary);text-decoration:none}
.docs-header__wordmark b{color:var(--accent);font-weight:var(--weight-medium)}
.docs-header__tag{font:var(--type-mono-sm);color:var(--text-tertiary)}
.docs-header__spacer{flex:1}
.docs-search__btn{display:inline-flex;align-items:center;gap:8px;height:28px;padding:0 8px 0 10px;border:1px solid var(--border-default);border-radius:var(--radius-2);background:var(--bg-surface);color:var(--text-tertiary);font:var(--type-ui);cursor:pointer}
.docs-search__kbd{font:var(--type-mono-sm);border:1px solid var(--border-subtle);border-radius:3px;padding:1px 4px}
/* #816: the Swagger UI link is a visual twin of the back link — shared rules. */
.docs-header__back,.docs-header__swagger{font:var(--type-body-sm);color:var(--text-secondary);text-decoration:none}
.docs-header__back:hover,.docs-header__swagger:hover{color:var(--text-primary)}
.docs-body{display:flex;align-items:stretch}
.docs-tree{width:320px;flex:0 0 auto;padding:24px 16px;border-right:1px solid var(--border-subtle);display:flex;flex-direction:column;gap:18px}
.docs-tree__label{display:block;font:var(--type-eyebrow);letter-spacing:var(--track-caps);text-transform:uppercase;color:var(--text-tertiary);padding-bottom:6px}
.docs-tree__items{display:flex;flex-direction:column;gap:3px;border-left:1px solid var(--border-subtle);padding-left:14px}
.docs-tree__link{display:flex;align-items:center;gap:8px;padding:4px 0 4px 14px;margin-left:-15px;border-left:1px solid transparent;color:var(--text-secondary);font:var(--type-body-sm);text-decoration:none;transition:var(--transition-control)}
.docs-tree__link:hover{color:var(--text-primary)}
.docs-tree__link.is-active{border-left-color:var(--accent);color:var(--text-primary);font-weight:var(--weight-medium)}
.docs-tree__link .ds-method{flex-shrink:0}
.docs-tree__path{font:var(--type-mono-sm);color:inherit;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}
.docs-content{flex:1;min-width:0}
.docs-page{display:flex;align-items:stretch}
.docs-article{flex:1;min-width:0;max-width:var(--prose-max);padding:32px 24px 64px;display:flex;flex-direction:column;gap:20px}
.docs-rail{width:196px;flex:0 0 auto;padding:32px 20px;position:sticky;top:var(--topbar-h);align-self:flex-start;display:flex;flex-direction:column;gap:7px}
.docs-rail__label{font:var(--type-eyebrow);letter-spacing:var(--track-caps);text-transform:uppercase;color:var(--text-tertiary);margin-bottom:3px}
.docs-rail a{font:var(--type-caption);color:var(--text-secondary);text-decoration:none}
.docs-rail a:hover{color:var(--text-primary)}
.docs-eyebrow{font:var(--type-eyebrow);letter-spacing:var(--track-caps);text-transform:uppercase;color:var(--text-tertiary)}
.docs-h1{font:var(--type-h1);letter-spacing:var(--track-heading);margin:0}
.docs-h2{font:var(--type-h2);letter-spacing:var(--track-heading);margin:8px 0 0;border-top:1px solid var(--border-subtle);padding-top:20px}
.docs-h2--first{border-top:0;padding-top:0}
.docs-opline{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.docs-opline__path{font:var(--type-mono-sm);color:var(--text-primary);overflow-wrap:anywhere}
.docs-desc{margin:0;color:var(--text-secondary);white-space:pre-line}
.docs-desc code,.docs-desc-cell code{background:var(--code-inline-bg);padding:2px 5px;border-radius:3px}
.docs-desc-cell{color:var(--text-secondary)}
.docs-code{margin:0;background:var(--code-bg);color:var(--code-text);border:1px solid var(--code-border);border-radius:var(--radius-card);padding:12px 14px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--border-subtle) transparent;font:var(--type-mono-sm);white-space:pre}
.docs-example__title{margin:0;font:var(--type-ui);color:var(--text-tertiary)}
.docs-callout{display:block;padding:12px 14px;background:var(--bg-subtle);border:1px solid var(--border-subtle);border-radius:var(--radius-card);color:var(--text-secondary);font:var(--type-body-sm)}
/* docs tables scroll in their own box (like console .card) instead of
   forcing the page wide on phones; display:block makes the table element
   itself the scroll container. */
.docs-article .ds-table{display:block;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--border-subtle) transparent}
/* ⌘K dialog */
.docs-search__dialog{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.4);display:flex;align-items:flex-start;justify-content:center;padding-top:12vh}
/* the base display:flex beats the UA [hidden] rule — without this override
   the dialog renders permanently open and intercepts every click (#191). */
.docs-search__dialog[hidden]{display:none}
/* Panel aligns to the article column (#441): same --prose-max width token
   as .docs-article, left edge on the 320px tree boundary; the auto right
   margin soaks up the overlay's free space, which makes the dialog's
   justify-content:center inert in that axis (no DOM change, no vertical move
   — 12vh padding-top keeps the drop position). Width shares the ⌘K button's
   reserved formula (#484 bar/panel/article parity). */
.docs-search__panel{width:min(var(--prose-max),calc(100vw - 672px));margin-left:320px;margin-right:auto;background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-card);box-shadow:var(--shadow-lg);display:flex;flex-direction:column;overflow:hidden}
.docs-search__input{margin:10px}
.docs-search__results{display:flex;flex-direction:column;max-height:50vh;overflow-y:auto;padding:0 6px 8px}
.docs-search__hit{display:flex;align-items:center;gap:10px;padding:8px;border-radius:var(--radius-2);color:var(--text-secondary);font:var(--type-body-sm);text-decoration:none}
.docs-search__hit.is-selected,.docs-search__hit:hover{background:var(--bg-hover);color:var(--text-primary)}
.docs-search__hit code{font:var(--type-mono-sm);color:var(--text-tertiary);margin-left:auto}
.docs-search__empty{padding:12px;color:var(--text-tertiary);font:var(--type-body-sm)}
/* #475 (manual review): the ⌘K button aligns with the article column like
   the panel (#441) — left edge on the 320px tree boundary. The header is
   position:sticky (a containing block), so absolute + left:320px lands it
   at viewport x=320, the panel's own margin-left. Out of the flex flow:
   the spacer still pushes "Back to console" right. ≤820px keeps the flex
   flow — the panel re-centers there too. #484: the button also spans the
   article column via the panel's exact width formula, so bar, panel, and
   article share widths; border-box keeps the 1px border inside. */
/* #475/#484: the ⌘K button sits on the 320px tree boundary and spans the
   article column. #832 (visual critical): the W2·T1 Swagger link consumed the
   row's slack, so the absolute button extended under the right-hand links at
   ~821–1310px (back link clipped at 1280×800). The width reserves the link
   cluster (back + Swagger + locale toggle + gaps ≈ 300px) on top of the
   352px tree+padding, so the field degrades — shrinks — instead of ever
   overlapping the links; ≥1352px prose-max still caps it at the column. */
@media(min-width:821px){.docs-search__btn{position:absolute;left:320px;top:50%;transform:translateY(-50%);width:min(var(--prose-max),calc(100vw - 672px));box-sizing:border-box}}
/* docs responsive: drop the rail, then send the tree off-canvas (#310 — it
   used to vanish with display:none, leaving ⌘K as the only way to browse
   endpoints). Same contract as the console side nav: fixed panel restored by
   body[data-nav-open], base-scope scrim, Escape/scrim closed by the mobile-nav
   controller hosted on the docs <body>. Tree links navigate with a full page
   load, which resets the attribute. */
@media(max-width:1080px){.docs-rail{display:none}}
@media(max-width:820px){
.docs-tree-toggle{display:inline-flex}
.docs-tree{position:fixed;top:0;bottom:0;left:0;z-index:60;width:300px;max-width:85vw;background:var(--bg-page);overflow-y:auto;transform:translateX(-100%);transition:transform var(--transition-control);box-shadow:var(--elevation-2,var(--shadow-card))}
body[data-nav-open] .docs-tree{transform:none}
/* tree off-canvas → the article starts at the viewport edge, so the ⌘K
   panel falls back to the centered overlay (#441). */
.docs-search__panel{width:min(560px,90vw);margin:0}
}
/* phones: let the header reflow (fixed height + no wrap made "Back to
   console" collide with the brand block) and drop the non-essential tag. */
@media(max-width:640px){
  .docs-header{height:auto;min-height:var(--topbar-h);flex-wrap:wrap;padding:10px 16px;gap:6px 12px}
  .docs-header__tag{display:none}
}

/* #615: Chart.js daily-volume chart — fixed height, responsive width (the
   controller renders into the canvas; .bars above is the no-JS fallback). */
.chart{position:relative;height:280px;width:100%}
.chart canvas{display:block}
/* #615: screen-reader-only utility (the chart's data-table alternative). */
.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}

/* ===== /send agent picker (#682): Tom Select skin. vendor/tom-select.css
   ships upstream verbatim with hardcoded light colors — every color here is
   re-sourced from design tokens so the picker survives the dark theme. The
   control mirrors .ds-input (control height, token border/radius); rows are
   a 24px→20px logo tile (monogram fallback, same contract as the agents
   index) + public name over a muted internal-name line. ===== */
.ts-wrapper .ts-control{height:var(--control-h);min-height:var(--control-h);padding:0 30px 0 10px;background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-control);box-shadow:none;color:var(--text-primary);font:var(--type-ui)}
.ts-wrapper .ts-control:hover{border-color:var(--border-strong)}
/* #775: vendored .ts-control is flex-wrap:wrap with no align-items — focusing
   re-enters the search input into the flow and wraps the selected item onto a
   top line ("jumps up"). Single mode stays one centered line; .agent-select__item
   already has min-width:0, so long names still ellipsize. Multi mode keeps wrap. */
.ts-wrapper.single .ts-control{flex-wrap:nowrap;align-items:center}
.ts-wrapper.single .ts-control>input{min-width:0}
/* #691: Tom Select copies the control's classes onto its wrapper
   (addClasses(wrapper, …, classes, …)) — the wrapper picks up .ds-input and
   draws a second bordered box around the skinned .ts-control. Strip the
   copied box so .ts-control stays the one bordered control, and put the
   focus ring on the wrapper so it wraps the whole control (a ring on the
   inner control read as a nested border inside the wrapper's box). */
.ts-wrapper.ds-input{height:auto;padding:0;border:0;border-radius:0}
.ts-wrapper.focus{border-color:var(--border-focus);box-shadow:var(--ring-focus)}
.ts-control>input{color:var(--text-primary);font:var(--type-ui)}
.ts-wrapper.single .ts-control::after{border-color:var(--text-tertiary) transparent transparent transparent}
.ts-wrapper.single.dropdown-active .ts-control::after{border-color:transparent transparent var(--text-tertiary) transparent}
.ts-dropdown{background:var(--bg-surface);border:1px solid var(--border-default);border-radius:var(--radius-control);box-shadow:var(--shadow-md);color:var(--text-primary)}
.ts-dropdown .option{color:var(--text-primary)}
.ts-dropdown .active{background:var(--bg-hover);color:var(--text-primary)}
.ts-dropdown [data-selectable] .highlight{background:var(--accent-subtle);color:var(--text-primary)}
.ts-dropdown .no-results{color:var(--text-tertiary)}
.agent-select__option,.agent-select__item{display:flex;align-items:center;gap:8px;min-width:0}
.agent-select__logo{width:20px;height:20px;border-radius:var(--radius-2);object-fit:cover;flex:none}
span.agent-select__logo--fallback{display:inline-flex;align-items:center;justify-content:center;background:var(--bg-inverse);color:var(--text-inverse);font:var(--type-mono-sm)}
.agent-select__text{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.agent-select__name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.agent-select__internal{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--type-caption);color:var(--text-tertiary)}
/* the 34px control stays one line — the muted internal name is dropdown-only */
.agent-select__item .agent-select__internal{display:none}

/* ===== /send CodeMirror (#684): JSON editor. vendor/codemirror.css ships
   upstream verbatim with hardcoded light colors — the "orcs" theme below
   re-sources every color from design tokens so the editor survives the dark
   theme. The wrapper mirrors .ds-input (token border/radius); height follows
   the content like the textarea it replaced. JSON: values accent, keys
   primary, numbers muted (javascript mode marks JSON keys cm-string
   cm-property — the later .cm-property rule wins). ===== */
.cm-s-orcs.CodeMirror{height:auto;min-height:calc(var(--control-h) + 12px);background:var(--bg-surface);color:var(--text-primary);font:var(--type-mono);border:1px solid var(--border-default);border-radius:var(--radius-control)}
.cm-s-orcs .CodeMirror-cursor{border-left:1px solid var(--text-primary)}
.cm-s-orcs .CodeMirror-selected{background:var(--bg-active)}
.cm-s-orcs .CodeMirror-focused .CodeMirror-selected{background:var(--bg-active)}
.cm-s-orcs .CodeMirror-gutters{background:var(--bg-surface);border-right:0}
.cm-s-orcs .CodeMirror-matchingbracket{color:var(--text-accent);border-bottom:1px solid var(--text-accent);background:none}
.cm-s-orcs .cm-string{color:var(--text-accent)}
.cm-s-orcs .cm-property{color:var(--text-primary)}
.cm-s-orcs .cm-number{color:var(--text-secondary)}
.cm-s-orcs .cm-atom{color:var(--text-accent)}
