@layer portal-base;

/* Phound Developers — one stylesheet for the landing page, the docs and
   the dashboard. The public pages follow phound.app (phound-web-static:
   Inter, zinc greys, Phound blue #3b5bdb with purple #4f39f6 for the main
   call to action); the dashboard, inside .shell, borrows the web app's surfaces
   (phound-app-frontend: pill buttons, soft navy-shadowed cards, its status
   colours) on the same type and blue, so the header, the docs and the
   dashboard read as one site. One colour per message status group
   throughout. */

:root {
  --paper: #ffffff; --surface: #ffffff; --surface-2: #f4f4f5;
  --ink: #0a0a0a; --ink-2: #52525b; --ink-3: #71717a; --nav-ink: #364153;
  --rule: #e4e4e7; --rule-soft: #f3f4f6; --rule-strong: #d4d4d8;
  --signal: #3b5bdb; --signal-ink: #ffffff; --signal-soft: #dbe4ff; --signal-strong: #003d99; --signal-light: #5c7cfa;
  --purple: #4f39f6; --purple-strong: #3d2bc7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --g-sent: #3b5bdb; --g-sent-bg: #e7edff;
  --g-delivered: #047857; --g-delivered-bg: #d1fae5;
  --g-undelivered: #b45309; --g-undelivered-bg: #fef3c7;
  --g-rejected: #b91c1c; --g-rejected-bg: #fee2e2;
  --code-bg: #f4f4f5; --code-panel: #111318; --code-panel-ink: #e4e4e7; --code-panel-rule: #23262d;
  --secret: #fffbeb; --secret-line: #f59e0b;
  --shadow: 0 4px 16px rgba(0,0,0,.06);
  --shadow-lift: 0 12px 32px rgba(0,0,0,.10);
  --radius-card: 16px; --btn-radius: 8px;
  /* The dashboard's type scale: caps labels and meta, hints and secondary
     text, body, card titles, page titles — and big numbers. */
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 28px; --fs-display: 26px;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 72px;
  /* Scalar (the API reference) sits under the sticky header. */
  --scalar-custom-header-height: var(--header-h);
  color-scheme: light;
}

/* The dashboard: the web app's pill buttons always, its card shadow and
   status colours in light mode (dark mode is the site's, below). */
.shell { --btn-radius: 50px; }
@media (prefers-color-scheme: light) {
  .shell {
    --paper: #fbfcfc;
    /* The web app's soft backgrounds; the text a shade darker than its,
       for 4.5:1 on them and on white (its #38a727 is under 3:1). */
    --g-delivered: #237a1a; --g-delivered-bg: #edf9f3;
    --g-undelivered: #a3540a; --g-undelivered-bg: #fef3e2;
    --g-rejected: #c42b2b; --g-rejected-bg: #fdefef;
    --shadow: 0 2px 24px rgba(23,43,77,.08), 0 0 1px rgba(23,43,77,.08);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #09090b; --surface: #18181b; --surface-2: #27272a;
    --ink: #fafafa; --ink-2: #a1a1aa; --ink-3: #71717a; --nav-ink: #d4d4d8;
    --rule: #27272a; --rule-soft: #1f1f23; --rule-strong: #3f3f46;
    --signal: #91a7ff; --signal-ink: #0b1020; --signal-soft: #1e2648; --signal-strong: #bac8ff; --signal-light: #748ffc;
    --purple: #8b7cf8; --purple-strong: #a497fa;
    --warn: #fbbf24; --warn-soft: #2a2110;
    --g-sent: #91a7ff; --g-sent-bg: #1a2142;
    --g-delivered: #34d399; --g-delivered-bg: #0f2a20;
    --g-undelivered: #fbbf24; --g-undelivered-bg: #2a2110;
    --g-rejected: #f87171; --g-rejected-bg: #2c1515;
    --code-bg: #27272a; --code-panel: #0c0d10; --code-panel-rule: #1f2228;
    --secret: #2a2414; --secret-line: #a16207;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px -12px rgba(0,0,0,.7);
    --shadow-lift: 0 12px 32px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

/* Element defaults (links, buttons, code, form fields) live in a layer of
   their own, declared before anything else, so they're the weakest styles on
   the page: every class rule below beats them, and so does Scalar (the API
   reference), whose own styles are layers declared after this one. Unlayered,
   they'd restyle Scalar's sidebar buttons and links. */
@layer portal-base {
a { color: var(--signal); text-underline-offset: 2px; }
a:hover { color: var(--signal-strong); }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }

/* ---- buttons: one shape in three sizes — .small, the default and .lg — and
   a few variants: primary (the default), .quiet, .danger (a quiet one, in
   red), and solid .success and .critical, for placing and ending a call.
   .brand is phound.app's purple, for the header's one main call to action.
   A solid variant only sets the --btn-* colours. phound.app's rounded
   rectangles on the public pages, the web app's pills in the dashboard. ---- */
button, .button { --btn-bg: var(--signal); --btn-hover: var(--signal-strong); --btn-ink: var(--signal-ink);
  font: inherit; font-weight: 600; font-size: var(--fs-md); padding: 8px 18px; border-radius: var(--btn-radius); cursor: pointer;
  border: 1.5px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-ink); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.4; white-space: nowrap;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s; }
button:hover, .button:hover { background: var(--btn-hover); border-color: var(--btn-hover); color: var(--btn-ink); }
button:disabled { opacity: .6; cursor: progress; }
:is(button, .button).brand { --btn-bg: var(--purple); --btn-hover: var(--purple-strong); }
:is(button, .button).brand:hover { box-shadow: 0 4px 16px color-mix(in srgb, var(--purple) 30%, transparent); }
:is(button, .button).success { --btn-bg: var(--g-delivered); --btn-hover: color-mix(in srgb, var(--g-delivered) 85%, #000); }
:is(button, .button).critical { --btn-bg: var(--g-rejected); --btn-hover: color-mix(in srgb, var(--g-rejected) 85%, #000); }
:is(button, .button).quiet { background: var(--surface); color: var(--ink); border-color: var(--rule); }
:is(button, .button).quiet:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-3); box-shadow: var(--shadow); }
:is(button, .button).danger { background: var(--surface); color: var(--g-rejected); border-color: var(--rule); }
:is(button, .button).danger:hover { background: var(--g-rejected-bg); color: var(--g-rejected); border-color: var(--g-rejected-bg); }
:is(button, .button).small { padding: 5px 14px; font-size: var(--fs-sm); }
:is(button, .button).lg { padding: 14px 28px; font-size: 16px; }
:is(button, .button).lg:not(.quiet):hover { transform: translateY(-2px); box-shadow: 0 8px 25px color-mix(in srgb, var(--btn-bg) 35%, transparent); }
:is(button, .button).lg svg.ico { width: 18px; height: 18px; }
.arrow::after { content: "→"; transition: transform .2s; }
.button:hover .arrow::after, .arrow:hover::after { transform: translateX(3px); }

/* ---- code ---- */
code, pre, kbd { font-family: var(--mono); font-size: 13px; }
code { background: var(--code-bg); border-radius: 4px; padding: 1px 5px; }
pre { background: var(--code-bg); border-radius: 7px; padding: 12px 14px; overflow-x: auto; margin: 8px 0 0; line-height: 1.55; }
pre code { background: none; padding: 0; font-size: inherit; }

input:not([type]), input[type=text], input[type=url], input[type=tel], input[type=email], input[type=search], input[type=number],
input[type=datetime-local], select, textarea {
  font: inherit; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 8px;
  background: var(--surface); color: var(--ink); width: 100%; max-width: 480px; }
/* A select as tall as the text field beside it. */
select:not([multiple]) { height: calc(1.6em + 22px); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--signal); outline-offset: -1px; border-color: transparent; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }

/* ---- site header (every page): phound.app's ---- */
.site-header { position: sticky; top: 0; z-index: 20; height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--rule-soft); }
/* Full width on every page, so the logo and nav stay put between the landing page and the sidebar layouts. */
.site-header .inner { height: 100%; display: flex; align-items: center; gap: 36px; padding: 0 24px; }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); white-space: nowrap;
  font-size: 20px; font-weight: 600; letter-spacing: .07px; }
.logo:hover { color: var(--ink); }
.logo img { width: 36px; height: 36px; border-radius: 8px; flex: none; }
.logo span { color: var(--ink-3); font-weight: 500; }
.logo.sm { font-size: 17px; gap: 10px; }
.logo.sm img { width: 28px; height: 28px; border-radius: 7px; }
.site-nav { display: flex; gap: 28px; align-items: center; }
.site-nav a { display: inline-flex; flex-direction: column; color: var(--nav-ink); text-decoration: none; font-size: 16px; letter-spacing: -.31px; transition: color .2s; }
.site-nav a:hover { color: var(--signal); }
.site-nav a.on { color: var(--signal); font-weight: 600; }
/* Reserve the bold width so the active link doesn't push its neighbours. */
.site-nav a::after { content: attr(data-label); font-weight: 600; height: 0; visibility: hidden; overflow: hidden; }
.site-header .end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: var(--ink-2); font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- code panels ---- */
.codepanel { background: var(--code-panel); color: var(--code-panel-ink); border-radius: var(--radius-card); border: 1px solid var(--code-panel-rule);
  box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.codepanel .bar { display: flex; align-items: center; gap: 2px; padding: 0 8px 0 6px; border-bottom: 1px solid var(--code-panel-rule); min-height: 42px; }
.codepanel .bar .label { color: #7f8b99; font: 12px var(--mono); padding: 0 8px; margin-right: auto; }
.codepanel pre { background: none; color: inherit; margin: 0; padding: 16px 18px; border-radius: 0; font-size: 12.8px; white-space: pre; }
.codepanel .tok-k { color: #91a7ff; } .codepanel .tok-s { color: #e8c48a; } .codepanel .tok-c { color: #6b7685; } .codepanel .tok-n { color: #a7b7ff; }
.tab { background: none; border: 0; color: #8b97a6; font: 500 12.5px var(--mono); padding: 11px 10px 10px; border-radius: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { background: none; color: #d7dee7; border-color: transparent; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: #748ffc; }
.copybtn { background: transparent; border: 1px solid var(--code-panel-rule); color: #8b97a6; font: 500 12px var(--sans);
  padding: 3px 9px; border-radius: 6px; }
.copybtn:hover { background: #1b232c; color: #fff; border-color: #2c3642; }
[hidden] { display: none !important; }

/* ---- landing: phound.app's sections ---- */
.wrap { max-width: 1232px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 88px 0 80px; position: relative; overflow: hidden;
  background: radial-gradient(760px 420px at 80% 10%, color-mix(in srgb, var(--signal) 12%, transparent), transparent 70%),
              radial-gradient(560px 320px at 5% 100%, color-mix(in srgb, var(--purple) 8%, transparent), transparent 70%); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 64px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--signal); background: color-mix(in srgb, var(--signal) 10%, transparent); padding: 6px 14px; border-radius: 100px; margin-bottom: 22px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }
.hero h1 { font-size: clamp(2.5rem, 4.2vw, 3.5rem); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 22px; font-weight: 700; }
/* phound.app's .accent: the gradient words of a headline. */
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--signal) 0%, var(--signal-light) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero .lede { font-size: clamp(1.0625rem, 1.8vw, 1.1875rem); color: var(--ink-2); max-width: 34em; margin: 0 0 36px; line-height: 1.6; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .fine { margin-top: 18px; font-size: 14px; color: var(--ink-3); }
.section { padding: 96px 0; }
.section + .section { border-top: 1px solid var(--rule-soft); }
.section h2.title { font-size: clamp(1.75rem, 3.5vw, 2.5rem); letter-spacing: -.02em; line-height: 1.15; margin: 0 0 16px; font-weight: 700; }
.section .intro { color: var(--ink-2); font-size: 1.0625rem; max-width: 40em; margin: 0 0 48px; }
.kicker { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--signal); margin-bottom: 16px; }
/* The landing page's cards: phound.app's grey feature cards. */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.steps4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.steps4 > div, .features > div { background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius-card); padding: 28px; transition: box-shadow .2s; }
.steps4 > div:hover, .features > div:hover { box-shadow: var(--shadow); }
/* Registration comes first and takes days: the one step that can't be skipped. */
.steps4 > div.must { border-color: var(--signal); }
.steps4 { counter-reset: s; }
.steps4 > div::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 10px; background: var(--signal); color: var(--signal-ink); font-weight: 700; font-size: 16px; margin-bottom: 18px; }
.steps4 h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.steps4 p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.features h3 { font-size: 16px; font-weight: 600; margin: 16px 0 8px; }
.features p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.features .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--signal-soft); color: var(--signal); }
.features .ico svg { width: 20px; height: 20px; }
.lifecycle { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.flow { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-card); padding: 28px; box-shadow: var(--shadow); }
.flow ol { list-style: none; margin: 0; padding: 0; }
.flow li { display: grid; grid-template-columns: 22px 1fr; gap: 14px; position: relative; padding-bottom: 18px; }
.flow li:last-child { padding-bottom: 0; }
.flow li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; margin: 6px 0 0 5px; background: var(--c, var(--ink-3));
  box-shadow: 0 0 0 4px var(--cb, var(--surface-2)); }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 10.5px; top: 22px; bottom: 2px; width: 1px; background: var(--rule-strong); }
.flow .ev { font: 500 13px var(--mono); }
.flow .what { color: var(--ink-2); font-size: 14px; }
.flow .finals { display: grid; gap: 8px; margin-top: 8px; }
.flow .final { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 10px; background: var(--cb); }
.flow .final code { background: none; padding: 0; color: var(--c); font-weight: 600; }
.flow .final span { color: var(--ink-2); font-size: 13.5px; }
.docgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.doccard { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border-radius: var(--radius-card);
  padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--rule-soft); transition: transform .3s, box-shadow .3s; }
.doccard:hover { color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.doccard h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.doccard h3::after { content: "→"; color: var(--signal); transition: transform .2s; }
.doccard:hover h3::after { transform: translateX(3px); }
.doccard p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.doccard .tag { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; display: block; }
/* phound.app's deep-blue band (.biz-hero). Always dark, in either theme, so
   its colours are literals rather than tokens that flip. */
.band { color: #fff; border-radius: 24px; padding: 56px; display: flex; gap: 32px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: radial-gradient(600px 300px at 85% 0, rgba(0,102,255,.25), transparent 70%), linear-gradient(160deg, #003d99 0%, #001a4d 55%, #000d26 100%); }
.band h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; font-weight: 700; color: #fff; }
.band p { margin: 0; color: rgba(255,255,255,.72); max-width: 36em; font-size: 1.0625rem; }
.band .button:not(.quiet) { background: #fff; border-color: #fff; color: #001a4d; }
.band .button:not(.quiet):hover { background: #dbe4ff; border-color: #dbe4ff; box-shadow: 0 8px 25px rgba(0,0,0,.25); }
.band .button.quiet { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.3); }
.band .button.quiet:hover { border-color: #fff; background: rgba(255,255,255,.08); box-shadow: none; }
/* phound.app's footer: black, white links. */
.site-footer { background: #0a0a0a; color: rgba(255,255,255,.75); padding: 40px 0; font-size: 14px; margin-top: 24px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer .logo { color: #fff; margin: 0; opacity: 1; }
.site-footer a { color: #fff; opacity: .8; text-decoration: none; margin-left: 22px; font-size: 15px; transition: opacity .2s; }
.site-footer a:hover { opacity: 1; }
.site-footer .legal { flex-basis: 100%; border-top: 1px solid var(--purple); padding-top: 20px; margin-top: 8px; text-align: center; opacity: .75; }

/* ---- side navigation: one look for the docs and the dashboard (and the
   API reference's, through Scalar's variables in reference.html) ---- */
:root { --sidenav-w: 260px; }
.docs-nav, nav.side { position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 24px 16px 40px; background: var(--surface); border-right: 1px solid var(--rule); }
.docs-nav .group, nav.side .group { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
  margin: 24px 0 6px; padding: 0 12px; }
.docs-nav .group:first-child, nav.side .group:first-child { margin-top: 0; }
.docs-nav a, nav.side a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 2px; border-radius: 10px;
  color: var(--nav-ink); text-decoration: none; font-size: 15px; font-weight: 500; transition: background .15s, color .15s; }
.docs-nav a:hover, nav.side a:hover { color: var(--ink); background: var(--surface-2); }
.docs-nav a.on, nav.side a.on { color: var(--signal); background: var(--signal-soft); font-weight: 600; }
nav.side .ico { width: 18px; text-align: center; color: var(--ink-3); }
nav.side a.on .ico { color: var(--signal); }

/* ---- docs ---- */
/* Flush left, like the dashboard's and the API reference's sidebars. */
.docs { display: grid; grid-template-columns: var(--sidenav-w) minmax(0, 1060px) 220px; min-height: calc(100vh - var(--header-h)); }
.doc { padding: 40px 48px 96px; min-width: 0; }
.toc { position: sticky; top: var(--header-h); align-self: start; padding: 40px 24px 40px 0; font-size: 13.5px; }
.toc .head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 10px; }
.toc a { display: block; color: var(--ink-2); text-decoration: none; padding: 4px 0 4px 12px; border-left: 1px solid var(--rule); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--signal); border-left-color: var(--signal); }
.toc a.h3 { padding-left: 24px; font-size: 13px; }
.crumbs { font-size: 13.5px; color: var(--ink-3); margin-bottom: 10px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.5rem); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 14px; font-weight: 700; }
.prose .lead { font-size: 18px; color: var(--ink-2); margin: 0 0 32px; }
.prose h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 48px 0 12px; padding-top: 8px; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h3 { font-size: 18px; font-weight: 600; margin: 32px 0 8px; scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h2 .anchor, .prose h3 .anchor { color: var(--ink-3); text-decoration: none; margin-left: 8px; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose table.endpoints { display: table; }
.prose table.endpoints td.op { width: 1%; white-space: nowrap; }
.prose table.endpoints td.op a { text-decoration: none; }
.prose table.endpoints .verb { display: inline-block; min-width: 4.2em; font: 600 12.5px var(--mono); color: var(--ink-2); }
.prose table.endpoints td.scope-col { width: 1%; white-space: nowrap; text-align: right; }
.prose th { font-size: 13px; color: var(--ink-2); font-weight: 600; background: var(--surface-2); border-bottom-color: var(--rule-strong); }
.prose pre { position: relative; background: var(--code-panel); color: var(--code-panel-ink); padding: 16px 18px;
  border: 1px solid var(--code-panel-rule); margin: 14px 0 18px; font-size: 13px; white-space: pre; border-radius: 12px; }
.prose pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 8px; right: 64px; font: 500 11px var(--mono); color: #6b7685; }
.prose pre .copybtn { position: absolute; top: 7px; right: 8px; }
.prose .codepanel { margin: 14px 0 18px; }
.prose .codepanel pre { border: 0; margin: 0; border-radius: 0; }
.callout { border: 1px solid var(--rule); border-left: 3px solid var(--signal); background: var(--surface-2); border-radius: 12px;
  padding: 12px 16px; margin: 18px 0; font-size: 14.5px; }
.callout strong:first-child { display: block; margin-bottom: 2px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.info { border-left-color: var(--g-sent); background: var(--g-sent-bg); }
.callout p { margin: 4px 0; }
.next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--rule); }
.next a { display: block; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 12px; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--surface); }
.next a:hover { border-color: var(--signal); color: var(--ink); }
.next small { display: block; color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.next .fwd { text-align: right; grid-column: 2; }
.reference { min-height: calc(100vh - var(--header-h)); }

/* ---- dashboard ---- */
.shell { display: grid; grid-template-columns: var(--sidenav-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.shell > * { min-width: 0; }
main.dash { padding: 32px 36px 72px; max-width: 1120px; width: 100%; }
main.dash h1 { font-size: var(--fs-xl); font-weight: 700; margin: 0 0 4px; letter-spacing: -.01em; }
main.dash h2 { font-size: var(--fs-lg); margin: 0 0 4px; }
.sub { color: var(--ink-2); margin: 0 0 24px; max-width: 70ch; }
.card { background: var(--surface); border: 0; border-radius: var(--radius-card); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card > p.sub { margin-bottom: 14px; }
.muted { color: var(--ink-2); } .faint { color: var(--ink-3); }
main.dash table { width: 100%; border-collapse: collapse; margin: 4px 0 0; }
main.dash th, main.dash td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
main.dash tr:last-child td { border-bottom: 0; }
main.dash th { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
main.dash pre { white-space: pre-wrap; word-break: break-all; }
form.inline { display: inline; }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.row select { width: auto; }
.field { margin-bottom: 16px; }
.field label.lbl, .field .lbl { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: 6px; }
.field .hint { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 4px; }
textarea { min-height: 110px; resize: vertical; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-md); padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: 7px; cursor: pointer; background: var(--surface); }
label.check:has(input:checked) { border-color: var(--signal); background: var(--signal-soft); }
label.check input { margin-top: 3px; accent-color: var(--signal); }
label.check small { display: block; color: var(--ink-2); }
label.check code { overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font: var(--fs-xs) var(--mono);
  border: 1px solid var(--rule); color: var(--ink-2); margin: 1px 3px 1px 0; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.b-sent, .b-pending { background: var(--g-sent-bg); color: var(--g-sent); }
.b-unconfirmed, .b-undelivered { background: var(--g-undelivered-bg); color: var(--g-undelivered); }
.b-delivered, .b-valid { background: var(--g-delivered-bg); color: var(--g-delivered); }
.b-failed, .b-rejected, .b-invalid { background: var(--g-rejected-bg); color: var(--g-rejected); }
.b-test, .b-received { background: var(--surface-2); color: var(--ink-2); }
.ok { color: var(--g-delivered); } .bad { color: var(--g-rejected); } .warn { color: var(--warn); }
.notice { border-radius: 12px; padding: 13px 16px; margin-bottom: 18px; border: 1px solid var(--rule); background: var(--surface); }
.notice.error { border-color: var(--g-rejected); background: var(--g-rejected-bg); }
.notice.success { border-color: var(--g-delivered); background: var(--g-delivered-bg); }
.notice.secret { background: var(--secret); border-color: var(--secret-line); }
.notice strong { display: block; margin-bottom: 2px; }
.secretbox { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.secretbox code { font-size: var(--fs-sm); padding: 7px 10px; word-break: break-all; }
/* An empty list. .empty: a line, for a search that matched nothing (with a
   link that clears it) or a section with nothing in the period.
   .empty-state: a first run — what will be here, where it comes from, and
   the one thing to do about it. */
.empty { color: var(--ink-2); padding: 18px 0 6px; text-align: center; }
.empty a { margin-left: 4px; white-space: nowrap; }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 16px 24px; }
.empty-state .ei { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 12px;
  background: var(--surface-2); color: var(--ink-3); }
.empty-state .ei svg.ico { width: 22px; height: 22px; }
.empty-state strong { font-size: var(--fs-md); }
.empty-state p { margin: 4px 0 0; max-width: 46ch; color: var(--ink-2); font-size: var(--fs-sm); }
.empty-state .row { margin-top: 16px; justify-content: center; gap: 8px; }
.empty-state[hidden] { display: none; }
.apierror { color: var(--g-rejected); padding: 6px 0; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 0; }
.dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-sm);
  font-weight: 700; border: 2px solid var(--rule-strong); color: var(--ink-2); }
.done .dot { background: var(--g-delivered); border-color: var(--g-delivered); color: var(--surface); }
.done .title { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }
details.setup > summary { list-style: none; color: inherit; font-size: inherit; }
details.setup > summary::-webkit-details-marker { display: none; }
details.setup > summary h2::after { content: "›"; display: inline-block; margin-left: 8px; color: var(--ink-3); transition: transform .15s; }
details.setup[open] > summary h2::after { transform: rotate(90deg); }
details.setup:not([open]) { padding-block: 18px; }
.progress { height: 6px; background: var(--rule); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; max-width: 360px; }
.progress > div { height: 100%; background: var(--g-delivered); }
.counter { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 4px; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { display: flex; gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--rule); flex-wrap: wrap; }
.timeline li:last-child { border-bottom: 0; }
.spinner { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--rule); border-top-color: var(--signal);
  border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; word-break: break-word; }
/* A message's text as it went: whitespace kept, in a frame. */
.msgtext { white-space: pre-wrap; word-break: break-word; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface-2); font-size: var(--fs-md); line-height: 1.5; }
.msgtext mark.ucs2 { background: var(--warn-soft); color: var(--warn); outline: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 3px; padding: 0 1px; }
.msgmeta { margin: 8px 0 0; color: var(--ink-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border-radius: var(--radius-card); padding: 18px 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .2s; }
a.tile:hover { transform: translateY(-2px); color: var(--ink); }
/* A stat tile: its label, the value with a bar a day beside it, and a note. */
.tile { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tile .top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tile .top { gap: 7px; }
.tile .ti { flex: none; display: grid; place-items: center; color: var(--signal); }
.tile .ti svg.ico { width: 16px; height: 16px; }
.tile .l { color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tile .n { font-size: var(--fs-display); font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.tile .note { color: var(--ink-3); font-size: var(--fs-xs); display: flex; align-items: center; gap: 5px; }
.tile .note.bad { color: var(--g-rejected); font-weight: 600; }
.tile .note svg.ico { width: 13px; height: 13px; }
/* The trend: thin bars on a baseline, 2px apart, the past recessive. */
.spark { flex: none; display: flex; align-items: flex-end; gap: 2px; width: 70px; height: 30px; border-bottom: 1px solid var(--rule); }
.spark .b { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--rule-strong); }
.spark .b.today { background: var(--signal); }
a.tile:hover .spark .b:not(.today) { background: var(--ink-3); }
.signin { max-width: 440px; margin: 72px auto; text-align: center; padding: 0 16px; }
.signin .card { padding: 36px; box-shadow: var(--shadow-lift); }
.signin h1 { font-size: var(--fs-xl); font-weight: 700; margin: 0 0 10px; letter-spacing: -.02em; line-height: 1.2; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .docs { grid-template-columns: var(--sidenav-w) minmax(0, 1fr); }
  .toc { display: none; }
  .docgrid, .steps4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero .wrap, .lifecycle { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .steps4, .features { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --header-h: 56px; }
  .site-header .inner { padding: 0 16px; gap: 14px; }
  .site-nav { display: none; }
  .who, .hide-sm { display: none; }
  .wrap { padding: 0 16px; }
  .hero { padding: 48px 0 44px; }
  .section { padding: 56px 0; }
  .band { padding: 28px 22px; }
  .docgrid, .next { grid-template-columns: minmax(0, 1fr); }
  .next .fwd { grid-column: 1; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--rule); padding: 10px 16px;
    display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
      .doc { padding: 24px 16px 64px; }
  .prose h1 { font-size: 28px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  /* The sidebar becomes a menu from the left, the header's button opening it. */
  nav.side { display: none; position: fixed; inset: 0 auto 0 0; margin: 0; width: min(300px, 85vw); height: 100dvh;
    border: 0; border-right: 1px solid var(--rule); color: inherit; box-shadow: var(--shadow-lift); padding: 20px 14px 40px; }
  nav.side:popover-open { display: block; }
  .menubtn { display: grid; margin-left: -6px; }
  main.dash { padding: 20px 16px 56px; }
  main.dash table { display: block; overflow-x: auto; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .site-footer a { margin: 0 14px 0 0; }
}

/* Registration: a long form in numbered sections, its short fields two
   to a row — long ones (text areas, option grids), headings and the button
   across the whole width. One column on a phone. */
#tcr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; counter-reset: tcr; }
#tcr > :is(h2, details, button, .field:has(textarea, .checks)) { grid-column: 1 / -1; }
#tcr > button { justify-self: start; margin-top: 8px; }
#tcr :is(input, select, textarea) { max-width: none; }
#tcr h2 { display: flex; align-items: center; gap: 10px; margin: 12px 0 16px; padding-top: 24px; border-top: 1px solid var(--rule); }
#tcr h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
#tcr h2::before { counter-increment: tcr; content: counter(tcr); display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--signal-soft); color: var(--signal); font-size: var(--fs-sm); font-weight: 700; }
@media (max-width: 760px) { #tcr { grid-template-columns: minmax(0, 1fr); } }

/* A message in a list (msg-body): thumbnails, then its text on one line. */
.msgbody { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
.msgbody .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msgbody:hover .txt { text-decoration: underline; }
.msgbody .txt.muted { font-style: italic; }
.thumbs { display: inline-flex; gap: 4px; flex: none; align-items: center; }
.thumb { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: var(--surface-2);
  border: 1px solid var(--rule); display: grid; place-items: center; color: var(--ink-3); }
.thumb svg.ico { width: 15px; height: 15px; }
/* A photo covers its thumb's clip icon — until it fails to load (media
   URLs expire), when portal.js hides it and the icon shows. */
.thumb { position: relative; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb img.gone { display: none; }
.thumbs .more { font-size: var(--fs-xs); color: var(--ink-3); }

/* A message's media (message.html). */
.media img { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; }

/* API usage (usage.html): filters, a stacked bar chart of requests per
   interval — successes, 4xx and 5xx in the status colours, a 2px gap
   between bars and segments — and the request log. */
.usage-filters { gap: 8px; margin: 0 0 18px; }
.usage-filters select { width: auto; }
/* A plain inline checkbox, sized like the controls beside it — not
   label.check's option card. */
.usage-filters .toggle { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.usage-filters .toggle input { margin: 0; accent-color: var(--signal); }
.usage-filters .toggle:has(input:disabled) { cursor: default; }
.portal-hidden { margin: -8px 0 18px; font-size: var(--fs-sm); }
.legend { gap: 14px; font-size: var(--fs-sm); color: var(--ink-2); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-ok, .bar-seg-ok { background: var(--signal); }
.sw-4xx, .bar-seg-4xx { background: var(--g-undelivered); }
.sw-5xx, .bar-seg-5xx { background: var(--g-rejected); }
.usage-chart { position: relative; margin: 18px 0 8px; padding-left: 0; }
.usage-chart .peak { position: absolute; top: -4px; left: 0; font-size: var(--fs-xs); color: var(--ink-3); }
.usage-chart .bars { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 16px;
  border-bottom: 1px solid var(--rule); }
.usage-chart .bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; outline: none; }
.usage-chart .bar:hover, .usage-chart .bar:focus-visible { background: var(--rule-soft); }
.usage-chart .stack { width: 100%; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.usage-chart .bar-seg { flex-basis: 0; min-height: 2px; }
/* A bar with any requests stays visible beside a spike. */
.usage-chart .stack:has(.bar-seg) { min-height: 4px; }
/* Dense (7 days hourly, 90 days daily): 2px between 100+ bars would leave
   them no width at all — they touch, as a histogram. */
.usage-chart .bars:has(> .bar:nth-child(49)) { gap: 0; }
.usage-chart .bars:has(> .bar:nth-child(49)) .stack { border-radius: 0; }
.usage-chart .axis { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--ink-3); margin-top: 6px; }
.nowrap { white-space: nowrap; }
/* The request: the widest column, its path wrapped at any character
   only when it must; everything else clipped, the whole of it on hover. */
.requests .req { min-width: 240px; }
.requests .req code { overflow-wrap: anywhere; }
.requests .req .method { white-space: nowrap; font-weight: 600; }
.table-scroll { overflow-x: auto; }
.requests .clip { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom; }
/* The request id is there to be searched for and quoted, so never
   clipped: shown whole, and one click selects all of it. */
.requests .rid { display: inline-block; margin-top: 2px; user-select: all; cursor: text; }

/* The admin page's alerts: severity carries an icon and a word, never
   colour alone. */
.alert-list { list-style: none; margin: 12px 0 0; padding: 0; }
.alert { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: start;
  padding: 12px 0; border-top: 1px solid var(--rule); }
.alert .sev { font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; padding: 2px 9px; border-radius: 999px; justify-self: start; }
.alert.critical .sev { background: var(--g-rejected-bg); color: var(--g-rejected); }
.alert.warning .sev { background: var(--g-undelivered-bg); color: var(--g-undelivered); }
@media (max-width: 640px) { .alert { grid-template-columns: 1fr; } }

/* ---- composers (Live calls, Send): a two-column page — the form on the
   left, what it's doing on the right — built from persona chips, a big
   number field with recent numbers as chips, and option tiles. ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; margin: 0; }
.page-head p.sub { margin: 6px 0 0; max-width: 46em; }
.compose-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.compose-grid > .card { margin-bottom: 0; }
/* Fields as wide as the card, flush with its other controls. */
.compose-grid :is(input, select, textarea) { max-width: none; }
@media (max-width: 960px) { .compose-grid { grid-template-columns: 1fr; } }
.card h2.step { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 10px; }
.card .stepgroup + .stepgroup { margin-top: 22px; }
.stepgroup .hint { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--surface); font-size: var(--fs-md); font-weight: 500; transition: border-color .15s, background .15s, box-shadow .15s; }
.chip:hover { border-color: var(--rule-strong); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--signal); background: var(--signal-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent); }
.chip:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--signal-light), var(--purple)); color: #fff; font-size: var(--fs-sm); font-weight: 700; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }

input.bignum { font: 600 var(--fs-display)/1.2 var(--mono); letter-spacing: .02em; padding: 14px 16px; border-radius: 14px; width: 100%; }
.recent { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.recent .lbl2 { font-size: var(--fs-xs); color: var(--ink-3); margin-right: 2px; }
button.numchip { font: 500 var(--fs-sm) var(--mono); padding: 4px 11px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
button.numchip:hover { border-color: var(--signal); color: var(--signal); background: var(--signal-soft); }

.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .options { grid-template-columns: 1fr; } }
.option { position: relative; display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--rule); background: var(--surface); transition: border-color .15s, background .15s; }
.option:hover { border-color: var(--rule-strong); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option:has(input:checked) { border-color: var(--signal); background: var(--signal-soft); }
.option .oi { flex: none; width: 22px; font-size: 22px; line-height: 1; }
.option strong { display: block; font-size: var(--fs-md); }
.option small { display: block; color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; }
/* A field that only matters for one option, shown with it. */
.reveal { display: none; margin-top: 10px; }
form:has(input[name="target"][value="own"]:checked) .reveal.own { display: block; }

.actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.actions .fine { color: var(--ink-3); font-size: var(--fs-sm); max-width: 30em; }
/* The composer's one action: a large button, lifted off the card. */
.actions :is(button, .button).lg:not(.quiet) { box-shadow: 0 8px 20px -8px var(--btn-bg); }

/* ---- the "now" panel: one call, as it goes ---- */
.now { text-align: center; padding: 30px 24px; min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.now .state { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-top: 18px; }
.now .who { font: 600 var(--fs-display) var(--mono); margin-top: 6px; max-width: none; color: var(--ink); }
.now .via { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 4px; }
.now .timer { font: 500 var(--fs-md) var(--mono); color: var(--ink-2); margin-top: 10px; min-height: 1.4em; }
.now .reason { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 2px; min-height: 1.2em; }
.orb { position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 38px;
  background: var(--surface-2); color: var(--ink-3); }
.orb::before, .orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
.st-ringing .orb { background: var(--g-sent-bg); color: var(--g-sent); }
.st-ringing .orb::before, .st-ringing .orb::after { animation: ring 1.6s ease-out infinite; }
.st-ringing .orb::after { animation-delay: .8s; }
.st-in_progress .orb { background: var(--g-delivered-bg); color: var(--g-delivered); }
.st-in_progress .orb::before { animation: ring 2.4s ease-out infinite; }
.st-completed .orb { background: var(--surface-2); color: var(--ink-3); }
.st-not_answered .orb { background: var(--g-rejected-bg); color: var(--g-rejected); }
@keyframes ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .orb::before, .orb::after { animation: none !important; } }
.now [data-hangup] { margin-top: 22px; }
.now button.critical { box-shadow: 0 8px 20px -8px var(--btn-bg); }
.now .tips { color: var(--ink-2); font-size: var(--fs-sm); max-width: 26em; margin-top: 14px; }

/* ---- the calls list ---- */
.calllist { list-style: none; margin: 0; padding: 0; }
.callrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--rule); }
.callrow:first-child { border-top: 0; }
.callico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: var(--surface-2); color: var(--ink-3); }
.callrow.st-ringing .callico { background: var(--g-sent-bg); color: var(--g-sent); }
.callrow.st-in_progress .callico { background: var(--g-delivered-bg); color: var(--g-delivered); }
.callrow.st-not_answered .callico { background: var(--g-rejected-bg); color: var(--g-rejected); }
.callrow .num { font: 600 var(--fs-md) var(--mono); }
.callrow .meta { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 2px; }
.callrow .dur { font: var(--fs-sm) var(--mono); color: var(--ink-2); text-align: right; min-width: 3.5em; }
.callrow .end { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
@media (max-width: 640px) { .callrow { grid-template-columns: 40px minmax(0, 1fr) auto; } .callrow .dur { display: none; } }
/* In a table row (Messages, a conversation), a smaller direction icon on a
   phone, so it doesn't take the message's room. */
@media (max-width: 640px) { td .callico { width: 28px; height: 28px; } td .callico svg.ico { width: 14px; height: 14px; } }

details.code { margin-top: 4px; }
details.code > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.code > summary::before { content: "›"; display: inline-block; transition: transform .15s; }
details.code[open] > summary::before { transform: rotate(90deg); }
details.code > summary::-webkit-details-marker { display: none; }
details.code pre { margin-top: 12px; }

/* ---- Send: the composer's extras ---- */
select.bigselect { font-size: var(--fs-md); padding: 12px 14px; border-radius: 14px; width: 100%; height: auto; }
.card h2.step .counter { float: right; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: var(--fs-xs); color: var(--ink-3); }
label.drop { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding: 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed var(--rule-strong); background: var(--surface-2); transition: border-color .15s, background .15s; }
label.drop:hover, label.drop:focus-within { border-color: var(--signal); background: var(--signal-soft); }
label.drop .oi { flex: none; width: 22px; font-size: 22px; }
label.drop > span:not(.oi) { flex: 1; min-width: 0; }
label.drop strong { display: block; font-size: var(--fs-md); }
label.drop small { display: block; color: var(--ink-2); font-size: var(--fs-sm); margin-top: 2px; }
/* The picker on a line of its own, under the text. */
label.drop input[type=file] { flex: 1 0 100%; margin-left: 34px; max-width: calc(100% - 34px); font-size: var(--fs-sm); }

/* The attached image, in the attachment box. */
.drop-thumb { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 10px; border: 1px solid var(--rule); }
/* A one-column composer (Send): a readable width, its fields as wide as it. */
.card.narrow { max-width: 760px; }
.card.narrow :is(input, select, textarea) { max-width: none; }

/* Line icons (templates/icons.html), sized by where they sit. */
svg.ico { width: 1em; height: 1em; flex: none; vertical-align: -.125em; }
.orb svg.ico { width: 38px; height: 38px; }
.callico svg.ico { width: 18px; height: 18px; }
.option .oi { color: var(--ink-2); }
.option:has(input:checked) .oi { color: var(--signal); }
.option .oi svg.ico, label.drop .oi svg.ico { width: 22px; height: 22px; }
label.drop .oi { color: var(--ink-2); }
.avatar svg.ico { width: 20px; height: 20px; }

/* The sidebar's line icons (templates/icons.html). */
nav.side span.ico { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: none; }
nav.side svg.ico { width: 18px; height: 18px; stroke-width: 1.85; }
nav.side a:hover .ico { color: var(--ink-2); }
nav.side a.on:hover .ico { color: var(--signal); }

/* ---- named patterns the dashboard pages share ---- */
/* A link that reads as the text it's on (a call's name in Call history). */
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { text-decoration: underline; }

/* Read by screen readers, not shown (a column header an icon explains). */
.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; }

/* A page's views of one list (Conversations: by thread, or every message). */
.viewtabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--rule); }
.viewtabs a { padding: 8px 12px; margin-bottom: -1px; color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm);
  border-bottom: 2px solid transparent; }
.viewtabs a:hover { color: var(--ink); }
.viewtabs a[aria-current="page"] { color: var(--signal); border-bottom-color: var(--signal); font-weight: 600; }
.filterbar { gap: 10px; margin-bottom: 8px; }  /* a list's search and filters, above it */
/* A toolbar's controls — a filter bar's, the usage page's — share one
   compact height, fields and buttons alike. */
:is(.filterbar, .usage-filters, .toolbar) :is(input:not([type=checkbox], [type=radio], [type=hidden]), select) {
  height: 36px; padding: 0 10px; font-size: var(--fs-sm); border-radius: 8px; }
:is(.filterbar, .usage-filters, .toolbar) :is(button, .button) { height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.pager { justify-content: flex-end; gap: 10px; margin-top: 12px; }
.footnote { margin: 8px 0 0; font-size: var(--fs-sm); }  /* a card's closing small print */
.ruled { border-top: 1px solid var(--rule); padding: 14px 0; }  /* an item in a stacked list */
td.manage { text-align: right; min-width: 150px; }  /* a row's actions, opening to a form */
td.manage details { text-align: left; }
.card h2.step .opt { text-transform: none; letter-spacing: 0; font-weight: 500; }
img.round { border-radius: 50%; object-fit: cover; flex: none; }
.hint.bad, .stepgroup .hint.bad { color: var(--g-rejected); }

/* ---- utilities: one declaration each, for the one-off adjustments that
   were inline styles. !important, as an inline style was, so they win over
   the component rule they adjust. Spacing on a 4px grid. ---- */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: 4px !important; } .mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; } .mt-4 { margin-top: 16px !important; }
.mb-2 { margin-bottom: 8px !important; } .mb-3 { margin-bottom: 12px !important; } .mb-5 { margin-bottom: 20px !important; }
.gap-sm { gap: 6px !important; } .gap-md { gap: 10px !important; }
.between { justify-content: space-between !important; } .justify-end { justify-content: flex-end !important; }
.justify-center { justify-content: center !important; }
.items-start { align-items: flex-start !important; } .items-end { align-items: flex-end !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.grow { flex: 1 !important; min-width: 180px !important; } .min-0 { min-width: 0 !important; }
.w-auto { width: auto !important; }
.text-xs { font-size: var(--fs-xs) !important; } .text-sm { font-size: var(--fs-sm) !important; }
.ta-left { text-align: left !important; } .ta-right { text-align: right !important; }
.break-all { word-break: break-all !important; } .pre-line { white-space: pre-line !important; }
.ellipsis { overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }

/* ---- dialogs: a drawer from the right for editing one thing, and the
   confirmation a form with data-confirm asks for (portal.js). Native
   <dialog>: shown as a modal it traps focus and Esc closes it; a drawer the
   server renders open (?edit=, no script) shows the same, without the
   backdrop. ---- */
dialog { color: var(--ink); background: var(--surface); border: 0; padding: 0; }
dialog::backdrop { background: rgb(9 9 11 / .4); }
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100vw); height: 100dvh; max-height: none;
  max-width: none; border-left: 1px solid var(--rule); box-shadow: var(--shadow-lift); z-index: 30; }
dialog.drawer[open] { display: flex; flex-direction: column; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 18px;
  border-bottom: 1px solid var(--rule); }
.drawer-head h2 { font-size: var(--fs-lg); margin: 2px 0 8px; }
.drawer-head h2.mono { font: 600 var(--fs-lg) var(--mono); }
dialog.drawer.wide { width: min(640px, 100vw); }
/* A panel's own section below its form: what it does, and its button. */
.panel-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.panel-section p { margin: 4px 0 12px; color: var(--ink-2); font-size: var(--fs-sm); }
.drawer-body .checks { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
/* The key panel's permissions, a row per resource under its API, each
   with a segmented None / Read / Write to pick its level and the endpoints
   it opens folded below; risky ones marked, and a note shown while any of
   those is picked (where :has works). */
.perms { margin-top: 10px; border: 1px solid var(--rule); border-radius: 9px; overflow: hidden; }
.perms-head { display: flex; justify-content: space-between; padding: 8px 14px; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.perm-group-head, .perm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 16px;
  border-top: 1px solid var(--rule); }
.perm-group-head { padding: 10px 14px; background: var(--surface-2); }
.perm-group-head a { margin-left: 8px; font-size: var(--fs-sm); }
.perm-row { padding: 9px 14px 9px 30px; align-items: start; }
.perm-name { font-size: var(--fs-md); }
.perm-name small { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-2); }
.perm-ops { grid-column: 1 / -1; margin-top: -4px; font-size: var(--fs-sm); color: var(--ink-2); }
.perm-ops summary { cursor: pointer; width: fit-content; }
.perm-ops ul { list-style: none; margin: 4px 0 6px; padding: 0; }
.perm-ops li { display: flex; align-items: baseline; gap: 10px; padding: 2px 0; white-space: nowrap; }
.perm-ops li .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.perm-ops li a { flex: none; text-decoration: none; color: var(--ink); }
.perm-ops .verb { display: inline-block; min-width: 4.2em; font: 600 11.5px var(--mono); color: var(--ink-2); }
.perm-ops p { margin: 2px 0 6px; }
.perm-ops-level { margin-top: 6px; font-weight: 600; color: var(--ink); }
.perm-ops-level code { font-weight: 400; }
.perm-name .pill.risk { margin-left: 6px; font-size: 10px; }
/* Every row's control the same three slots, so they line up: a level a
   resource doesn't have is there, greyed, and can't be picked. */
.seg { display: grid; grid-template-columns: repeat(3, 4.6em); padding: 2px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); }
.seg button, .seg label span, .seg .off { display: block; padding: 3px 0; border: 0; border-radius: 6px; background: none; color: var(--ink-2);
  font: inherit; font-size: var(--fs-sm); text-align: center; cursor: pointer; box-shadow: none; min-height: 0; }
.seg .off { color: var(--rule); cursor: not-allowed; }
.seg label { position: relative; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg input:checked + span, .seg button[aria-pressed="true"] { color: var(--signal); background: var(--signal-soft); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 1px; }
@media (max-width: 560px) { .perm-group-head, .perm-row { grid-template-columns: 1fr; } .perm-row { padding-left: 14px; } }
/* The permissions' filter, in the table's header bar: tinted, borderless
   and small, so it reads as part of the table, not as another field of
   the key like its name above. */
.perms-head.perm-search { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface-2);
  text-transform: none; letter-spacing: 0; font-weight: 400; cursor: text; }
.perm-search .ico { flex: none; width: 15px; height: 15px; color: var(--ink-2); }
.perm-search input[type=search] { max-width: none; padding: 4px 0; border: 0; background: none; font-size: var(--fs-sm); }
.perm-search input[type=search]:focus { outline: none; }
.perms-head.perm-search:focus-within { box-shadow: inset 0 0 0 2px var(--signal); border-radius: 9px 9px 0 0; }
.perm-none { margin: 10px 0 0; font-size: var(--fs-sm); }
.keyform .op-count { margin: 12px 0 0; font-size: var(--fs-sm); }
.pill.risk { border-color: color-mix(in srgb, var(--warn) 45%, var(--rule)); color: var(--warn); background: var(--warn-soft); }
/* The keys table: a key's scopes, a line per API. */
.key-scopes { display: grid; grid-template-columns: 7.5em 1fr; align-items: baseline; gap: 0 6px; }
.key-scopes + .key-scopes { margin-top: 4px; }
.key-scopes .pill { font-family: inherit; }
.key-scopes-api { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 600; }
.key-scopes .pill.risky::before, .risky-count::before { content: "⚠ "; color: var(--warn); }
.risky-mark { color: var(--warn); }
mark { background: var(--warn-soft); color: inherit; border-radius: 2px; padding: 0 1px; font-weight: 600; }
.risky-count { font-size: var(--fs-xs); color: var(--warn); white-space: nowrap; cursor: help; }
.key-scopes-legend { font-size: var(--fs-sm); margin: 10px 0 0; }
.keyform .risk-note { display: none; margin-top: 14px; }
.keyform:has(input[data-risk]:checked) .risk-note { display: block; }
.revoked-keys { margin-top: 16px; }
.revoked-keys table { margin-top: 10px; }
.drawer-body label.check { padding: 8px 10px; }
/* The flow panel shows the fields the picked flow takes (where :has works;
   elsewhere all of them, as labelled). */
@supports selector(:has(*)) {
  .flowform .for-forward, .flowform .for-message { display: none; }
  .flowform:has(option[data-type="forward"]:checked) .for-forward,
  .flowform:has(option[data-type="message"]:checked) .for-message { display: block; }
  .vmform [class^="for-"] { display: none; }
  .vmform:has(option[value="text_auto"]:checked) .for-text_auto,
  .vmform:has(option[value="text"]:checked) .for-text,
  .vmform:has(option[value="url"]:checked) .for-url,
  .vmform:has(option[value="url_record"]:checked) .for-url_record,
  .vmform:has(option[value="url_external"]:checked) .for-url_external { display: block; }
}
.drawer-body { flex: 1; overflow-y: auto; padding: 24px; }
.drawer-body :is(input, select, textarea) { max-width: none; }
.drawer-foot { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--rule); background: var(--surface); }
.eyebrow-sm { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.danger-zone { margin-top: 32px; padding: 16px; border: 1px solid color-mix(in srgb, var(--g-rejected) 35%, var(--rule));
  border-radius: 12px; }
.danger-zone p { margin: 4px 0 12px; color: var(--ink-2); font-size: var(--fs-sm); }
/* An icon-only control: the drawer's close. */
.iconbtn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; color: var(--ink-2); }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn svg.ico { width: 18px; height: 18px; }
dialog.confirm { width: min(420px, calc(100vw - 32px)); border: 1px solid var(--rule); border-radius: var(--radius-card); box-shadow: var(--shadow-lift); }
dialog.confirm form { padding: 24px; }
dialog.confirm h2 { margin: 0 0 6px; font-size: var(--fs-lg); }
dialog.confirm p { margin: 0 0 22px; color: var(--ink-2); }
dialog.confirm p:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  dialog.drawer[open] { transition: translate .22s ease-out; @starting-style { translate: 100% 0; } }
  dialog.confirm[open] { transition: opacity .15s, scale .15s; @starting-style { opacity: 0; scale: .97; } }
  dialog[open]::backdrop { transition: opacity .2s; @starting-style { opacity: 0; } }
}

/* ---- the dashboard's sidebar, a popover (layout.html): in place beside
   the page on a wide screen — the popover's own defaults undone — and a
   menu from the left on a phone (the 760px rule above). ---- */
@media (min-width: 761px) {
  nav.side[popover] { display: block; position: sticky; inset: auto; top: var(--header-h); margin: 0; width: auto;
    height: calc(100vh - var(--header-h)); border: 0; border-right: 1px solid var(--rule); color: inherit; }
}
nav.side::backdrop { background: rgb(9 9 11 / .4); }
@media (prefers-reduced-motion: no-preference) {
  nav.side:popover-open { transition: translate .22s ease-out; @starting-style { translate: -100% 0; } }
}
@media (min-width: 761px) { .menubtn { display: none; } }
button.iconbtn { background: none; border: 0; padding: 0; cursor: pointer; }
button.iconbtn:hover { background: var(--surface-2); color: var(--ink); }

/* ---- the header's account menu: who's signed in, and signing out ---- */
button.acct { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: none; border: 1px solid transparent; color: var(--ink-2); font-weight: 500; font-size: var(--fs-sm); }
button.acct:hover, button.acct:has(+ .menu:popover-open) { background: var(--surface-2); border-color: var(--rule); color: var(--ink); }
button.acct svg.ico { width: 14px; height: 14px; }
.acct-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu[popover] { position: fixed; inset: auto; top: calc(var(--header-h) - 6px); right: 16px; margin: 0; width: 260px;
  padding: 6px; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lift); }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.menu-head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu a, .menu button.menu-item { display: flex; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--ink);
  text-decoration: none; font: inherit; font-size: var(--fs-sm); font-weight: 500; background: none; border: 0; justify-content: flex-start; }
.menu a:hover, .menu button.menu-item:hover { background: var(--surface-2); color: var(--ink); }
.menu form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--rule); }
@media (max-width: 760px) { .acct-name { display: none; } }

/* ---- a message's way to the phone (message.html): accepted, sent to the
   carrier, delivered — a dot each, joined; where it stopped in red, or
   amber for no delivery report. ---- */
.progress-steps { display: flex; list-style: none; margin: 4px 0 16px; padding: 0; }
.progress-steps li { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-weight: 500; font-size: var(--fs-sm); }
.progress-steps li:last-child { flex: none; }
.progress-steps li:not(:last-child)::after { content: ""; flex: 1; height: 2px; margin: 0 12px; border-radius: 2px; background: var(--rule); }
.progress-steps li.ps-done:not(:last-child)::after { background: var(--g-delivered); }
.pdot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--rule-strong); background: var(--surface); }
.pdot::after { content: ""; width: 13px; height: 13px; background: var(--surface);
  mask: var(--mark) center / contain no-repeat; -webkit-mask: var(--mark) center / contain no-repeat; }
.ps-done .pdot { background: var(--g-delivered); border-color: var(--g-delivered);
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.ps-bad .pdot { background: var(--g-rejected); border-color: var(--g-rejected);
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.ps-warn .pdot { background: var(--g-undelivered); border-color: var(--g-undelivered);
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18h.01'/%3E%3C/svg%3E"); }
.ps-now .pdot { border-color: var(--signal); }
.ps-now .pdot::after { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); mask: none; -webkit-mask: none; }
.ps-todo .pdot::after { display: none; }
.ps-todo .plabel { color: var(--ink-3); }
.ps-bad .plabel { color: var(--g-rejected); }
.ps-warn .plabel { color: var(--g-undelivered); }
@media (prefers-reduced-motion: no-preference) { .ps-now .pdot::after { animation: pulse 1.4s ease-in-out infinite; } }
@keyframes pulse { 50% { transform: scale(.6); opacity: .5; } }
@media (max-width: 560px) { .progress-steps li:not(:last-child)::after { margin: 0 6px; } .plabel { font-size: var(--fs-xs); } }

/* ---- call history (calls.html): the calls list, a name in the sans ---- */
.callrow .num.name { font-family: var(--sans); }
.callrow.call-inbound .callico, .callico.dir-inbound { background: var(--g-delivered-bg); color: var(--g-delivered); }
.callrow.call-outbound .callico, .callico.dir-outbound { background: var(--g-sent-bg); color: var(--g-sent); }
/* Its columns line up: duration, when, and the test-send button (or its
   room) — an icon, its label a tooltip, as the call's page has it in full.
   The time sits left, one gap after the right-aligned duration. */
.calllist.history .callrow { grid-template-columns: 40px minmax(0, 1fr) 56px 96px 36px; }
.button.iconbtn { padding: 6px 8px; line-height: 0; }
.calllist.history .when { white-space: nowrap; }
.calllist.history .act { display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .calllist.history .callrow { grid-template-columns: 40px minmax(0, 1fr) auto; } .calllist.history .when { display: none; } }
.vmlist .vmbody { grid-column: 2 / -1; display: grid; gap: 6px; min-width: 0; }
.vmlist audio { width: 100%; max-width: 420px; height: 36px; }
.vmlist .vmtext { margin: 0; overflow-wrap: anywhere; }

/* ---- leaving a page (portal.js): a bar along the top, the list dimmed
   while its next page loads, and a skeleton where a new page will be. The
   bar starts part-filled: Safari may not animate it once the page is
   leaving. ---- */
.navbar-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1000; pointer-events: none; overflow: hidden; visibility: hidden; }
.navbar-progress::before { content: ""; position: absolute; inset: 0; background: var(--signal); transform-origin: left; transform: scaleX(.15); }
.navigating .navbar-progress { visibility: visible; }
.navigating .navbar-progress::before { animation: navbar-fill 8s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes navbar-fill { 0% { transform: scaleX(.15); } 10% { transform: scaleX(.35); } 100% { transform: scaleX(.92); } }
.navigating, .navigating a, .navigating button { cursor: progress; }
main.dash[aria-busy="true"] > :not(.skeleton) { opacity: .55; pointer-events: none; }
.skeleton .sk { border-radius: 8px; background: var(--surface-2); }
.skeleton .sk-title { width: 220px; height: 30px; margin-bottom: 10px; }
.skeleton .sk-sub { width: min(480px, 80%); height: 16px; margin-bottom: 24px; }
.skeleton .sk-row { height: 18px; margin: 14px 0; }
.skeleton .sk-row:nth-child(3n+2) { width: 82%; }
.skeleton .sk-row:nth-child(3n) { width: 64%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton .sk { background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2), var(--rule-strong)) 50%, var(--surface-2) 75%) 0 0 / 200% 100%;
    animation: shimmer 1.2s linear infinite; }
}
@media (prefers-reduced-motion: reduce) { .navigating .navbar-progress::before { animation: none; transform: scaleX(1); opacity: .6; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- "Build this page with the API" (layout.html api-trace) ---- */
details.api-trace { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--rule); }
details.api-trace > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
details.api-trace > summary::-webkit-details-marker { display: none; }
details.api-trace > summary::before { content: "›"; display: inline-block; transition: transform .15s; }
details.api-trace[open] > summary::before { transform: rotate(90deg); }
details.api-trace > p { margin: 10px 0 12px; font-size: var(--fs-sm); }
.api-trace-ops { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: var(--fs-sm); }
.api-trace-ops td { padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.api-trace-ops td.op { min-width: 0; }
.api-trace-ops td.op > div { font-weight: 500; }
.api-trace-ops td.op a { display: block; margin-top: 3px; text-decoration: none; }
.api-trace-ops td.op code { background: none; padding: 0; font-size: 12.5px; overflow-wrap: anywhere; }
.api-trace-ops .verb { display: inline-block; min-width: 3.4em; font: 600 12px var(--mono); color: var(--ink-2); }
.api-trace-ops td.scope-col { width: 1%; white-space: nowrap; text-align: right; }
details.api-trace .codepanel pre { overflow-x: auto; }
@media (max-width: 640px) {
  .api-trace-ops tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .api-trace-ops td { display: block; border: 0; padding: 0; }
  .api-trace-ops td.scope-col { width: auto; text-align: left; margin-top: 6px; }
}
