/* HealthPlanChat agency portal + HPC admin: one design system for both.
   2026-11-13 redesign: Geist type, cool zinc neutrals, hairline borders, near-flat surfaces, one green accent.
   2026-11-20: accent and gradient follow the Health Plan Chat logo (deep green to teal); the logo is the real mark (hpc-mark.png).
   A green-to-teal gradient is used sparingly: the logo mark, the active menu item, the sign-in art, a faint glow at
   the top of the app and the Save button once something changed. Light and dark come from the same tokens. */
:root {
  /* neutrals (cool zinc) */
  --bg: oklch(98.5% .002 250); --surface: oklch(100% 0 0); --surface-2: oklch(97.3% .003 255); --surface-3: oklch(94.8% .004 258);
  --fg: oklch(20.5% .008 262); --fg-2: oklch(37% .01 262); --muted: oklch(51% .012 260);
  --border: oklch(92.4% .004 260); --border-strong: oklch(87.5% .006 260);
  /* accent: --accent carries white text (4.6:1); --accent-strong is for text and links on light surfaces;
     --accent-vivid is decoration only (glows, dots, the progress fill) */
  --accent: oklch(50% .085 164); --accent-strong: oklch(44% .075 164); --accent-soft: oklch(96.4% .022 168); --accent-fg: oklch(100% 0 0);
  --accent-vivid: oklch(66% .09 172);
  --grad-a: oklch(68% .075 178); --grad-b: oklch(46% .08 160);
  --grad: linear-gradient(135deg, var(--grad-a), var(--grad-b));
  --primary: oklch(21% .008 262); --primary-hover: oklch(30% .01 262); --primary-fg: oklch(99% 0 0);
  --ring: color-mix(in oklab, var(--accent) 22%, transparent);
  --focus: color-mix(in oklab, var(--accent) 70%, transparent);
  --ok: oklch(50% .12 155); --ok-soft: oklch(96.5% .035 155);
  --warn: oklch(52% .12 62); --warn-soft: oklch(96.6% .04 82);
  --bad: oklch(54% .19 25); --bad-soft: oklch(96.6% .022 25);
  --info: oklch(52% .14 258); --info-soft: oklch(96.6% .02 258);
  --violet: oklch(52% .16 292); --violet-soft: oklch(96.6% .024 292);
  --env-local: oklch(32% .02 262); --env-staging: oklch(82% .14 85); --env-staging-fg: oklch(30% .06 70); --env-production: oklch(48% .18 25);
  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 18px;
  --sh-xs: 0 1px 1px oklch(20% .01 260 / .03);
  --sh-sm: 0 1px 2px oklch(20% .01 260 / .045);
  --sh-md: 0 1px 2px oklch(20% .01 260 / .04), 0 10px 24px -8px oklch(20% .015 260 / .12);
  --sh-lg: 0 2px 6px oklch(20% .01 260 / .06), 0 24px 56px -12px oklch(20% .02 260 / .28);
  --glass: color-mix(in oklab, var(--bg) 84%, transparent);
  --t: 150ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --font: Geist, Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-w: 256px; --env-h: 0px;  /* the environment band shows only in local development (common.js) */
  --viz: oklch(55% .085 166);   /* chart marks: >= 3:1 against the card surface */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(15.5% .005 262); --surface: oklch(19.2% .006 262); --surface-2: oklch(21.6% .007 262); --surface-3: oklch(25.5% .008 262);
    --fg: oklch(96.5% .003 262); --fg-2: oklch(84% .007 262); --muted: oklch(68.5% .01 262);
    --border: oklch(100% 0 0 / .075); --border-strong: oklch(100% 0 0 / .13);
    --accent: oklch(74% .1 168); --accent-strong: oklch(80% .09 170); --accent-soft: oklch(28% .04 168); --accent-fg: oklch(17% .02 170);
    --accent-vivid: oklch(76% .1 172);
    --grad-a: oklch(74% .08 178); --grad-b: oklch(58% .09 162);
    --primary: oklch(95% .004 262); --primary-hover: oklch(100% 0 0); --primary-fg: oklch(17% .008 262);
    --ring: color-mix(in oklab, var(--accent) 28%, transparent);
    --ok: oklch(78% .12 155); --ok-soft: oklch(28% .05 158);
    --warn: oklch(83% .12 80); --warn-soft: oklch(29% .05 70);
    --bad: oklch(75% .15 25); --bad-soft: oklch(29% .06 25);
    --info: oklch(79% .1 258); --info-soft: oklch(28% .05 260);
    --violet: oklch(79% .12 292); --violet-soft: oklch(29% .06 292);
    --viz: oklch(70% .09 170);
    --sh-xs: inset 0 1px 0 oklch(100% 0 0 / .03); --sh-sm: inset 0 1px 0 oklch(100% 0 0 / .035), 0 1px 2px oklch(0% 0 0 / .3);
    --sh-md: inset 0 1px 0 oklch(100% 0 0 / .04), 0 12px 28px -8px oklch(0% 0 0 / .55); --sh-lg: 0 24px 64px -12px oklch(0% 0 0 / .7);
    color-scheme: dark;
  }
}

/* -- base ------------------------------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14.5px/1.55 var(--font); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
/* a faint teal and green glow at the top of every page */
body::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 560px; z-index: -1; pointer-events: none;
  background: radial-gradient(46% 62% at 22% -14%, color-mix(in oklab, var(--grad-a) 15%, transparent), transparent 72%),
              radial-gradient(40% 58% at 82% -20%, color-mix(in oklab, var(--grad-b) 10%, transparent), transparent 72%); }
::selection { background: color-mix(in oklab, var(--accent) 24%, transparent); }
a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
  transition: color var(--t), text-decoration-color var(--t); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { box-shadow: none; outline: none; }
h1, h2, h3 { color: var(--fg); }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.024em; margin: 0; }
h2 { font-size: 15px; line-height: 1.35; font-weight: 600; letter-spacing: -.012em; margin: 0 0 .75rem; }
h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; margin: 1.25rem 0 .5rem; }
h1[tabindex="-1"]:focus { box-shadow: none; }
p { margin: 0 0 .75rem; }
b, strong { font-weight: 600; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 90; border-radius: var(--r-sm); box-shadow: var(--sh-md); }
.skip:focus { left: 1rem; top: .5rem; }
.muted { color: var(--muted); }
.muted.small, p.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.45; }
p.lede { color: var(--fg-2); font-size: 15px; max-width: 70ch; }
svg.icon { flex: none; display: inline-block; vertical-align: middle; }

/* Environment strip: local development only (staging and production show none, 2026-11-13). */
.env { position: sticky; top: 0; z-index: 40; height: var(--env-h); display: none; align-items: center; justify-content: center; gap: .6rem;
  font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: #fff; background: var(--env-local); padding: 0 16px; white-space: nowrap; overflow: hidden; }
.env[data-env="local"] { display: flex; }
.env::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .8; flex: none; }
.env[data-env="staging"] { background: var(--env-staging); color: var(--env-staging-fg); }
.env[data-env="production"] { background: var(--env-production); }
.env small { font-weight: 500; letter-spacing: 0; opacity: .85; overflow: hidden; text-overflow: ellipsis; }

/* -- app shell: sidebar + content ------------------------------------------------------------------ */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--env-h)); }
.sidebar { position: sticky; top: var(--env-h); height: calc(100vh - var(--env-h)); display: flex; flex-direction: column; gap: 2px;
  background: transparent; border-right: 1px solid var(--border); padding: 12px 12px 0; overflow-y: auto; z-index: 30;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 14px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.logo:hover { color: var(--fg); }
.logo-mark { width: 32px; height: 32px; flex: none; display: block; object-fit: contain; }
.logo-text { display: grid; line-height: 1.2; }
.logo-text b { font-size: 14.5px; font-weight: 650; letter-spacing: -.015em; }
.logo-text small { color: var(--muted); font-size: 12px; font-weight: 450; }
.org { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 7px 8px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--sh-xs); min-width: 0; }
.org .avatar { width: 30px; height: 30px; }
.org > div { display: grid; min-width: 0; line-height: 1.3; flex: 1; }
.org b { font-weight: 550; font-size: 13.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org small { color: var(--muted); font-size: 12px; }
.sb-nav { flex: 1; display: grid; align-content: start; gap: 10px; padding-top: 2px; }
.sb-nav .nav-group + .nav-group { padding-top: 10px; border-top: 1px solid color-mix(in oklab, var(--border) 70%, transparent); }
.nav-label { margin: 0 0 4px 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sb-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; min-height: 33px; padding: 5px 10px; border-radius: 8px; color: var(--fg-2);
  text-decoration: none; font-weight: 500; font-size: 13.5px; letter-spacing: -.005em; transition: background-color var(--t), color var(--t); }
.nav-item svg { width: 17px; height: 17px; color: var(--muted); transition: color var(--t); }
.nav-item:hover { background: color-mix(in oklab, var(--fg) 5%, transparent); color: var(--fg); }
.nav-item:focus-visible { outline-offset: -2px; }
.nav-item:hover svg { color: var(--fg-2); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--accent); }
.nav-item[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--grad-a), var(--grad-b)); }
.nav-item .count { margin-left: auto; font-size: 11.5px; font-weight: 600; line-height: 18px; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 0 7px;
  font-variant-numeric: tabular-nums; }
.nav-item .count[data-badge="onboarding"] { color: var(--accent-strong); background: var(--accent-soft); }
/* The menu: Settings folds away; the user footer stays in view. */
.nav-toggle { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 10px); background: none; border: 0; cursor: pointer;
  padding: 2px 6px 2px 0; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-radius: 6px; }
.nav-toggle:hover { color: var(--fg); }
.nav-toggle svg { transition: transform var(--t); }
.nav-group.open .nav-toggle svg { transform: rotate(90deg); }
.sb-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; margin: 10px -12px 0; padding: 10px 12px 12px 14px;
  border-top: 1px solid var(--border); background: var(--bg); min-width: 0; }
.sb-foot .who { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.sb-foot .who b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-foot .who small { color: var(--muted); font-size: 12px; }
.content { min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.topbar { display: none; }
main { --main-px: 40px; --main-pt: 32px; width: 100%; max-width: 1160px; margin: 0 auto; padding: var(--main-pt) var(--main-px) 96px; min-width: 0; }
main > * + * { margin-top: 20px; }
main > .page-header + * { margin-top: 24px; }
.scrim { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: min(300px, 86vw); transform: translateX(-102%); background: var(--bg);
    transition: transform .22s var(--ease); box-shadow: var(--sh-lg); z-index: 60; visibility: hidden; }
  .app.nav-open .sidebar { transform: none; visibility: visible; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; background: oklch(15% .01 262 / .42); z-index: 55; backdrop-filter: blur(3px); }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: var(--env-h); z-index: 20; height: 52px; padding: 0 10px;
    background: var(--glass); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
  .topbar-title { font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { --main-px: 16px; --main-pt: 20px; padding: var(--main-pt) var(--main-px) 72px; }
}
@media (min-width: 901px) { .sidebar .sb-close { display: none; } }

/* -- page header ------------------------------------------------------------------------------------ */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.page-header .titles { min-width: 0; max-width: 76ch; }
.page-header .eyebrow { display: inline-flex; align-items: center; gap: 6px; height: 20px; margin-bottom: 8px; font-size: 13px; color: var(--muted);
  text-decoration: none; font-weight: 500; transition: color var(--t); }
.page-header .eyebrow:hover { color: var(--fg); }
.page-header .eyebrow svg { transition: transform var(--t); }
.page-header .eyebrow:hover svg { transform: translateX(-2px); }
.page-header .subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; max-width: 72ch; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.page-header .actions { margin-left: auto; }   /* a wrapped actions row stays on the right */

/* A page with one "Save changes" (changeTracker in common.js): its header sticks to the top while the page scrolls,
   on frosted glass from edge to edge. When it sticks, a back link above the title scrolls away first. Nothing in the
   header moves when the page turns dirty: the note and Discard keep their place while hidden. */
.savebar { display: inline-flex; align-items: center; gap: 8px; }
.savebar .unsaved { display: inline-flex; align-items: center; gap: 8px; margin-right: 2px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.savebar .unsaved::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: var(--accent-vivid); flex: none;
  animation: unsaved-pulse 1.8s ease-out infinite; }
@keyframes unsaved-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent-vivid) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent-vivid) 0%, transparent); } }
@media (min-width: 641px) {
  .page-header:has(.savebar) { position: sticky; top: var(--env-h); z-index: 15; margin: 0 calc(var(--main-px) * -1) -16px; padding: 14px var(--main-px) 16px;
    background: var(--glass); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
  /* the same glass and hairline beyond main's width on wide screens (nothing scrolls there, so no blur needed) */
  .page-header:has(.savebar)::before, .page-header:has(.savebar)::after { content: ""; position: absolute; top: 0; bottom: -1px; width: 100vw; pointer-events: none;
    background: var(--glass); border-bottom: 1px solid var(--border); }
  .page-header:has(.savebar)::before { right: 100%; }
  .page-header:has(.savebar)::after { left: 100%; }
  /* first on the page: the glass starts at the top edge, the title stays where every other page has it, and once stuck
     14px of padding stay above the title (the back link, if any, scrolls away) */
  .page-header:has(.savebar):first-child { margin-top: calc(var(--main-pt) * -1); padding-top: var(--main-pt); top: calc(var(--env-h) - var(--main-pt) + 14px); }
  .page-header:has(.savebar):first-child:has(.eyebrow) { top: calc(var(--env-h) - var(--main-pt) - 20px); }
  .savebar > [hidden] { display: inline-flex !important; visibility: hidden; }
  /* other page actions too (agent page): they get a full-width toolbar row under the title, Save on the right */
  .page-header:has(.savebar):has(.actions > :not(.savebar)) .actions { flex: 1 0 100%; }
  .page-header .actions > .savebar:not(:first-child) { margin-left: auto; }
  /* the agent page wraps its header in a short block: let the header stick through the whole page */
  .agent-page > .stack-sm:has(> .page-header .savebar) { display: contents; }
}
@media (min-width: 1001px) {   /* Cai's side panel sits just under the stuck header (title, subtitle, toolbar row) */
  .agent-page:has(.page-header .savebar) .cai-side { top: calc(var(--env-h) + 146px); max-height: calc(100dvh - var(--env-h) - 162px); }
}
@media (min-width: 641px) and (max-width: 900px) {   /* under the 52px menu bar */
  .page-header:has(.savebar) { top: calc(var(--env-h) + 52px); }
  .page-header:has(.savebar):first-child, .page-header:has(.savebar):first-child:has(.eyebrow) { top: calc(var(--env-h) + 52px - var(--main-pt) + 14px); }
}
/* phones: nothing sticks at the top; the save group floats at the bottom of the screen and widens once something changed */
@media (max-width: 640px) {
  .savebar { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 58; justify-content: flex-end; gap: 4px;
    padding: 6px; border-radius: 16px; background: color-mix(in oklab, var(--surface) 84%, transparent);
    backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border: 1px solid var(--border-strong); box-shadow: var(--sh-lg); }
  .savebar.dirty { left: 12px; padding-left: 14px; animation: bar-up .2s var(--ease); }
  .savebar .unsaved { margin-right: auto; font-size: 12.5px; }
  .savebar .btn.ghost { padding: 0 10px; }
  .savebar .btn.save { min-width: 0; }
  main:has(.savebar) { padding-bottom: 120px; }
  body:has(.savebar) .toast { bottom: 84px; }
}
@media (max-width: 370px) { .savebar .unsaved { font-size: 0; gap: 0; } }
@keyframes bar-up { from { transform: translateY(12px); opacity: .4; } to { transform: none; opacity: 1; } }

/* -- cards ------------------------------------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-xs); padding: 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-sub { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 18px 20px 0; margin-bottom: 14px; }
.card.flush .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid .card + .card { margin-top: 0; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.split .card + .card { margin-top: 0; }
.split.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 900px) { .split, .split.wide-left { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .grid.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .grid.stats .card { padding: 14px; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.gap { margin-top: 20px; }
.below { margin-bottom: 20px; }
/* Cards that hold one long form stay at a readable width instead of leaving a ragged empty right side. */
.card:has(> form.stack.wide), .card:has(> form.stack:not(.wide)) { max-width: 840px; }

/* KPI tiles: label, big number, a small tinted icon on the right */
.kpi { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: flex-start; gap: 12px; text-decoration: none; color: inherit;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.kpi > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; min-width: 0; }
a.kpi:hover { border-color: var(--border-strong); box-shadow: var(--sh-md); color: inherit; transform: translateY(-1px); }
.kpi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, currentColor 14%, transparent); }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-icon.info { background: var(--info-soft); color: var(--info); }
.kpi-icon.violet { background: var(--violet-soft); color: var(--violet); }
.kpi-icon.warn { background: var(--warn-soft); color: var(--warn); }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-label { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.35; }
@media (max-width: 520px) { .kpi { flex-direction: column; gap: 10px; } .kpi-icon { width: 28px; height: 28px; border-radius: 8px; } .kpi-value { font-size: 24px; } }
.stat { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* -- buttons ---------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 550; line-height: 1; letter-spacing: -.005em;
  height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--sh-xs);
  transition: background-color var(--t), border-color var(--t), box-shadow var(--t), color var(--t), opacity var(--t), transform 80ms ease; }
.btn:hover { background: var(--surface-2); color: var(--fg); border-color: color-mix(in oklab, var(--fg) 16%, var(--border-strong)); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: transparent;
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / .12), 0 1px 2px oklch(20% .01 262 / .2), 0 0 0 1px var(--primary); }
.btn.primary:hover { background: var(--primary-hover); color: var(--primary-fg); box-shadow: inset 0 1px 0 oklch(100% 0 0 / .12), 0 2px 6px oklch(20% .01 262 / .18), 0 0 0 1px var(--primary-hover); }
.btn.accent { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--fg-2); }
.btn.ghost:hover { background: color-mix(in oklab, var(--fg) 6%, transparent); color: var(--fg); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in oklab, var(--bad) 30%, var(--border)); }
.btn.small { height: 30px; padding: 0 10px; gap: 5px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon.after { margin-right: -3px; }
/* "Save changes": quiet grey until a field changes, then the accent with a soft glow */
.btn.save { min-width: 9.5rem; }
.btn.save:not([disabled]) { color: var(--accent-fg); border-color: transparent;
  background: linear-gradient(180deg, oklch(100% 0 0 / .14), oklch(100% 0 0 / 0)) var(--accent);
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / .18), 0 0 0 1px color-mix(in oklab, var(--accent) 80%, transparent),
    0 0 0 4px color-mix(in oklab, var(--accent-vivid) 16%, transparent), 0 6px 18px -6px color-mix(in oklab, var(--grad-b) 45%, transparent),
    0 4px 14px -4px color-mix(in oklab, var(--accent-vivid) 55%, transparent); }
.btn.save:not([disabled]):hover { background-color: color-mix(in oklab, var(--accent) 88%, var(--fg)); color: var(--accent-fg); }
.btn.save[disabled] { opacity: 1; background: var(--surface-3); color: var(--muted); border-color: transparent; box-shadow: none; cursor: default; }
.savebar.dirty .btn.save[disabled] { background: var(--accent); color: var(--accent-fg); opacity: .7; cursor: progress; }  /* saving */
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; flex: none; transition: background-color var(--t), color var(--t); }
.icon-btn:hover { background: color-mix(in oklab, var(--fg) 6%, transparent); color: var(--fg); }

/* -- forms ------------------------------------------------------------------------------------------ */
form.stack { display: grid; gap: 16px; max-width: 560px; }
form.stack.wide { max-width: 760px; }
form.stack.calendars { max-width: none; }                        /* Integrations > Google: the calendars table */
form.stack.calendars td input[type="number"] { width: 5.5rem; }
form.stack > button { justify-self: start; min-width: 9rem; }
form.stack > .row { align-items: flex-start; }
form.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
label { display: grid; gap: 6px; align-content: start; font-weight: 500; font-size: 13.5px; color: var(--fg); min-width: 0; }
label.check { display: flex; align-items: center; gap: 9px; font-weight: 400; font-size: 14px; color: var(--fg-2); cursor: pointer; }
input, select, textarea { font: inherit; font-size: 14px; font-weight: 400; color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 0 12px; height: 38px; min-width: 0; box-shadow: var(--sh-xs);
  transition: border-color var(--t), box-shadow var(--t), background-color var(--t); }
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
input[type="file"] { padding: 6px; height: auto; }
input[type="checkbox"], input[type="radio"] { height: 16px; width: 16px; padding: 0; margin: 0; box-shadow: none; accent-color: var(--accent); flex: none; cursor: pointer; }
input::placeholder, textarea::placeholder { color: color-mix(in oklab, var(--muted) 78%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in oklab, var(--fg) 22%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .5; }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23898c94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
fieldset { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px 14px; margin: 0; display: grid; gap: 8px; }
legend { font-weight: 500; font-size: 13.5px; padding: 0 6px; }
fieldset.plain-fieldset { border: 0; padding: 0; }
fieldset.plain-fieldset > legend { padding: 0; margin-bottom: 8px; }
.days { display: flex; gap: 8px; flex-wrap: wrap; }
.days label.check { border: 1px solid var(--border-strong); border-radius: 99px; padding: 5px 12px 5px 9px; background: var(--surface); font-size: 13.5px;
  transition: border-color var(--t), background-color var(--t), color var(--t); }
.days label.check:hover { border-color: color-mix(in oklab, var(--fg) 22%, var(--border-strong)); }
.days label.check:has(input:checked) { border-color: color-mix(in oklab, var(--accent) 70%, transparent); background: var(--accent-soft); color: var(--fg); }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-grid, .form-grid.three { grid-template-columns: minmax(0, 1fr); } }

/* Touch screens: 44px targets. */
@media (pointer: coarse) {
  .btn, .btn.small { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  input, select { height: 44px; }
  input[type="checkbox"], input[type="radio"] { height: 20px; width: 20px; }
  .nav-item { min-height: 44px; }
}

/* -- tables ----------------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-xs); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { height: 36px; padding-top: 0; padding-bottom: 0; font-size: 11.5px; font-weight: 550; text-transform: uppercase; letter-spacing: .055em; color: var(--muted);
  background: var(--surface-2); white-space: nowrap; }
td { height: 44px; color: var(--fg-2); }
td:first-child { color: var(--fg); font-weight: 500; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable td { transition: background-color var(--t); }
tr.clickable:hover td { background: var(--surface-2); }
tr.clickable:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.cell-person > span:last-child { overflow: hidden; text-overflow: ellipsis; }
/* Table column options (see HPC.table): keep dates, emails and buttons on one line, give long text room. */
th.nowrap, td.nowrap { white-space: nowrap; }
td.wrap { min-width: 150px; max-width: 340px; }
th.end, td.end { text-align: right; white-space: nowrap; width: 1%; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.plain, td.plain:first-child { font-weight: 400; color: var(--fg-2); }
td.mono { font-family: var(--mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
td details summary { white-space: nowrap; color: var(--accent-strong); font-weight: 550; font-size: 13px; }
td details[open] { min-width: 260px; }
td .token { white-space: pre-wrap; max-width: 460px; margin: 0; }
td .row { gap: 6px; }
.card .table-wrap { box-shadow: none; }
.card > .table-wrap, .card > .hint + .table-wrap { margin-top: 4px; }
.card > .table-wrap + * { margin-top: 16px; }
.cell-stack { display: grid; gap: 4px; justify-items: start; }
span.nowrap { white-space: nowrap; }
/* Clickable rows show it. */
th.row-go, td.row-go { width: 32px; padding-left: 0; text-align: right; color: var(--muted); }
td.row-go svg { transition: transform var(--t), color var(--t); }
tr.clickable:hover td.row-go { color: var(--fg); }
tr.clickable:hover td.row-go svg { transform: translateX(2px); }
/* Tables become stacked rows on phones, so no column is hidden off to the side. */
@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; }
  table.stacks thead { display: none; }
  table.stacks, table.stacks tbody, table.stacks tr, table.stacks td { display: block; width: 100%; }
  table.stacks tr { position: relative; padding: 12px 40px 12px 14px; border-bottom: 1px solid var(--border); }
  table.stacks tr:last-child { border-bottom: 0; }
  table.stacks td { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: auto; padding: 3px 0; border: 0; text-align: right; }
  table.stacks td::before { content: attr(data-label); flex: none; text-align: left; color: var(--muted); font-size: 12.5px; font-weight: 500; }
  table.stacks td:first-child { justify-content: flex-start; text-align: left; font-size: 14.5px; padding-bottom: 6px; }
  table.stacks td:first-child::before, table.stacks td:not([data-label])::before { display: none; }
  table.stacks td.row-go { position: absolute; right: 12px; top: 14px; width: auto; padding: 0; }
  table.stacks td.num { justify-content: space-between; }
  table.stacks tr.clickable:hover td { background: transparent; }
  table.stacks tr.clickable:hover { background: var(--surface-2); }
}

/* -- badges, avatars, callouts ----------------------------------------------------------------------- */
.chip, .badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; border-radius: 99px; padding: 0 9px 0 8px; font-size: 12px; font-weight: 550;
  line-height: 1; letter-spacing: 0; white-space: nowrap; background: var(--surface-3); color: var(--fg-2); border: 0;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, currentColor 13%, transparent); }
.chip::before, .badge::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex: none; }
.chip.ok, .badge.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn, .badge.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad, .badge.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info, .badge.info { background: var(--info-soft); color: var(--info); }
.chip.plain { padding: 0 9px; }
.chip.plain::before { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 99px; display: inline-grid; place-items: center; flex: none; font-size: 11.5px; font-weight: 600;
  color: oklch(36% .07 var(--h, 180)); background: oklch(93% .042 var(--h, 180)); letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px oklch(36% .07 var(--h, 180) / .1); }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; border-radius: 12px; }
.avatar.square { border-radius: 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: oklch(89% .06 var(--h, 180)); background: oklch(32% .06 var(--h, 180));
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / .06); } }
.callout { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r); padding: 11px 14px; color: var(--fg-2); font-size: 13.5px; line-height: 1.5;
  background: color-mix(in oklab, var(--info) 6%, var(--surface)); border: 1px solid color-mix(in oklab, var(--info) 20%, var(--border)); }
.callout > svg { color: var(--info); margin-top: 1px; width: 17px; height: 17px; }
.callout b, .callout strong { color: var(--fg); }
.callout.warn { background: color-mix(in oklab, var(--warn) 7%, var(--surface)); border-color: color-mix(in oklab, var(--warn) 26%, var(--border)); }
.callout.warn > svg { color: var(--warn); }
.callout.ok { background: color-mix(in oklab, var(--ok) 6%, var(--surface)); border-color: color-mix(in oklab, var(--ok) 22%, var(--border)); display: block; }
.callout p:last-child { margin-bottom: 0; }
.card > .callout:not(:last-child) { margin-bottom: 14px; }
/* Test sessions opened from the admin's Test workspace (2026-11-07): always visible above the page. */
.callout.test-session { margin: 12px clamp(12px, 3vw, 28px) 0; border-radius: var(--r); }
.token { font-family: var(--mono); font-size: 12.5px; word-break: break-all; background: var(--surface-2); border: 1px solid var(--border); padding: 8px 10px; border-radius: var(--r-sm); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li + li { margin-top: .4rem; }
ul.reasons { margin: .35rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 13px; }
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 10px 24px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; color: var(--fg); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; } dl.kv dd { margin-bottom: 8px; } }
details summary { cursor: pointer; font-weight: 550; color: var(--fg); }
details summary:hover { color: var(--accent-strong); }
details[open] summary { margin-bottom: 10px; }

/* -- lists of things (agents, features, steps) -------------------------------------------------------- */
.item-list { display: grid; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); min-width: 0; text-decoration: none; color: inherit; }
.item:first-child { border-top: 0; padding-top: 2px; }
.item .item-main { display: grid; min-width: 0; flex: 1; line-height: 1.4; }
.item .item-main b { font-weight: 550; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--t); }
.item .item-main small { color: var(--muted); font-size: 13px; }
a.item:hover b { color: var(--accent-strong); }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; }
.feature { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); }
.feature .tick { width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.feature.on .tick { background: var(--ok-soft); color: var(--ok); }
.feature.on { color: var(--fg); }
.agent-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.agent-grid .card + .card { margin-top: 0; }
.agent-card { display: grid; gap: 16px; text-decoration: none; color: inherit; transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
a.agent-card:hover { border-color: var(--border-strong); box-shadow: var(--sh-md); transform: translateY(-1px); color: inherit; }
.agent-card .top { display: flex; align-items: center; gap: 12px; }
.agent-card .top > div { display: grid; min-width: 0; flex: 1; }
.agent-card .top b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.agent-card .top small { color: var(--muted); font-size: 13px; }
.agent-card .meta { display: grid; gap: 8px; font-size: 13.5px; color: var(--fg-2); padding-top: 14px; border-top: 1px solid var(--border); }
.agent-card .meta span { display: flex; align-items: center; gap: 9px; }
.agent-card .meta svg { color: var(--muted); }
.agent-open { display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; font-weight: 550; font-size: 13.5px; color: var(--accent-strong); }
.agent-open svg { transition: transform var(--t); }
.agent-card:hover .agent-open { color: var(--accent); }
.agent-card:hover .agent-open svg { transform: translateX(2px); }
.bot-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff;
  background: linear-gradient(140deg, oklch(70% .13 166), oklch(50% .11 198)); box-shadow: inset 0 1px 0 oklch(100% 0 0 / .28), inset 0 0 0 1px oklch(100% 0 0 / .06); }
.bot-mark.outbound { background: linear-gradient(140deg, oklch(68% .15 292), oklch(48% .17 268)); }
.bot-mark.sm { width: 32px; height: 32px; border-radius: 9px; }
.bot-mark.sm svg { width: 17px; height: 17px; }

/* Setup checklist */
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 4px 0 6px; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-vivid)); transition: width .3s var(--ease); }
ol.checklist { list-style: none; margin: 8px 0 0; padding: 0; }
ol.checklist li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
ol.checklist li:first-child { border-top: 0; }
ol.checklist .step-dot, .ob-answers .step-dot { width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border-strong); color: var(--muted); background: var(--surface); font-variant-numeric: tabular-nums; }
ol.checklist li.done .step-dot, .ob-answers li.done .step-dot { border-color: transparent; background: var(--ok); color: var(--surface); }
ol.checklist .step-text { flex: 1; color: var(--fg); font-weight: 500; }
ol.checklist li.done .step-text { color: var(--muted); font-weight: 400; text-decoration: line-through; text-decoration-color: var(--border-strong); }
ol.steps { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
ol.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; color: var(--fg-2); }
ol.steps li::before { content: counter(s); width: 22px; height: 22px; margin-top: 1px; border-radius: 99px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; font-size: 12px; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 18%, transparent); }

/* Empty states */
.empty { padding: 40px 24px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 6px; }
.empty .empty-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); margin-bottom: 8px; }
.empty b { color: var(--fg); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.empty p { margin: 0; max-width: 52ch; font-size: 14px; }
.empty .row { margin-top: 12px; }

/* Big number + breakdown (campaign audience) */
.big { font-size: 40px; font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.breakdown { display: grid; gap: 8px; margin-top: 14px; }
.breakdown div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--fg-2); padding-bottom: 8px; border-bottom: 1px dashed var(--border-strong); }
.breakdown div:last-child { border-bottom: 0; padding-bottom: 0; }
.breakdown b { color: var(--fg); font-variant-numeric: tabular-nums; }

/* -- sign-in ---------------------------------------------------------------------------------------- */
.auth { min-height: calc(100vh - var(--env-h)); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; overflow: hidden; isolation: isolate; color: oklch(95% .008 260); padding: 44px 56px; display: flex; flex-direction: column;
  justify-content: space-between; border-right: 1px solid oklch(100% 0 0 / .06);
  background: radial-gradient(62% 52% at 12% 8%, oklch(68% .08 178 / .55), transparent 70%),
              radial-gradient(58% 58% at 96% 92%, oklch(46% .09 160 / .7), transparent 72%),
              radial-gradient(40% 36% at 70% 30%, oklch(58% .07 190 / .25), transparent 72%),
              linear-gradient(160deg, oklch(20% .03 175), oklch(15% .025 165)); }
/* dot grid, fading out toward the edges */
.auth-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(oklch(100% 0 0 / .22) 1px, transparent 1.5px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 40% 45%, #000 25%, transparent 78%); mask-image: radial-gradient(ellipse 75% 65% at 40% 45%, #000 25%, transparent 78%); }
/* concentric rings and a soft conic glow on the right */
.auth-brand::after { content: ""; position: absolute; z-index: -1; pointer-events: none; width: 760px; aspect-ratio: 1; right: -300px; top: 50%; translate: 0 -50%; border-radius: 50%;
  background: repeating-radial-gradient(circle at center, transparent 0 55px, oklch(100% 0 0 / .07) 55px 56px),
              conic-gradient(from 210deg, oklch(68% .08 178 / .0), oklch(68% .08 178 / .35), oklch(50% .09 160 / .4), oklch(68% .08 178 / .0) 70%);
  -webkit-mask-image: radial-gradient(circle, transparent 6%, #000 28%, transparent 70%); mask-image: radial-gradient(circle, transparent 6%, #000 28%, transparent 70%); }
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .logo, .auth-brand .logo:hover { color: #fff; }
.auth-brand .logo-text small { color: oklch(84% .015 175); }
.auth-brand .logo-mark { width: 40px; height: 40px; }
.auth-brand h1 { color: #fff; font-size: 38px; line-height: 1.1; letter-spacing: -.035em; font-weight: 600; max-width: 15ch; margin-bottom: 16px; text-wrap: balance; }
.auth-brand p { color: oklch(86% .012 260); font-size: 15.5px; line-height: 1.55; max-width: 42ch; }
.auth-points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 10px; max-width: 400px; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: oklch(92% .01 260); font-size: 14.5px; padding: 10px 14px; border-radius: 12px;
  background: oklch(100% 0 0 / .05); border: 1px solid oklch(100% 0 0 / .08); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.auth-points svg { color: oklch(84% .08 175); }
.auth-foot { font-size: 12.5px; color: oklch(76% .015 260); margin: 0; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(408px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 32px; box-shadow: var(--sh-md); }
.auth-card h1 { margin-bottom: 6px; font-size: 24px; }
.auth-card .subtitle { color: var(--muted); margin-bottom: 24px; }
.auth-card form.stack { max-width: none; }
.auth-card form.stack > button { justify-self: stretch; height: 40px; }
.auth-mobile-logo { display: none; margin-bottom: 24px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-form { align-items: start; padding: 40px 16px; }
  .auth-mobile-logo { display: flex; }
}
@media (max-width: 520px) { .auth-card { padding: 24px 20px; } }

/* -- toast, loading, misc ----------------------------------------------------------------------------- */
.toast { position: fixed; left: 50%; translate: -50% 0; bottom: 24px; z-index: 80; width: max-content; max-width: min(520px, calc(100vw - 32px));
  display: flex; gap: 10px; align-items: center; padding: 10px 18px 10px 14px; border-radius: 22px; font-size: 13.5px; font-weight: 500; line-height: 1.4;
  background: oklch(21% .01 262 / .9); color: oklch(97% .003 262); border: 1px solid oklch(100% 0 0 / .1);
  backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); box-shadow: var(--sh-lg); animation: toast-in .2s var(--ease); }
.toast > svg { color: oklch(80% .13 168); }
.toast.error { background: oklch(44% .16 25 / .95); color: #fff; }
.toast.error > svg { color: #fff; }
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.skeleton { display: grid; gap: 16px; }
.skeleton i { display: block; border-radius: var(--r); background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 34px; width: min(340px, 100%); }
.dir { display: inline-flex; align-items: center; gap: 6px; }
.dir svg { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
.center-text { text-align: center; }

/* Choice cards (agent type, routing, booking method) and the agency picker */
.choices { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .choices { grid-template-columns: minmax(0, 1fr); } }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); cursor: pointer;
  background: var(--surface); font-weight: 400; transition: border-color var(--t), box-shadow var(--t), background-color var(--t); }
.choice:hover { border-color: color-mix(in oklab, var(--fg) 24%, var(--border-strong)); }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 13%, transparent); }
.choice:has(input:disabled) { cursor: default; }
.choice input { margin-top: 3px; }
.choice b { display: block; font-weight: 550; color: var(--fg); margin-bottom: 2px; }
.choice small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.picker { padding: 6px 14px; }
button.item { width: 100%; background: none; border: 0; border-top: 1px solid var(--border); font: inherit; text-align: left; cursor: pointer; padding: 12px 4px; color: inherit; }
button.item:first-child { border-top: 0; }
button.item:hover b { color: var(--accent-strong); }
button.item > svg { color: var(--muted); }

/* Admin pages still build plain headings: keep their rhythm close to the portal's page header. */
main > h1 + p.lede, main > h1 + p { margin-top: 6px; }
main > p:first-child + h1 { margin-top: 10px; }
main > h2 { margin-top: 28px; margin-bottom: -4px; }

/* Outbound pilot console: a notification's plain-text body. */
.note-body { white-space: pre-wrap; font: inherit; margin: 4px 0 0; color: var(--muted, inherit); }
/* Outbound pilot console: long words wrap, card buttons wrap onto a second line on a phone. */
.pilot-callout li { overflow-wrap: anywhere; }
.pilot-card .card-head { flex-wrap: wrap; gap: 8px; }
.pilot-card .card-head .row { flex-wrap: wrap; }

/* Self-service setup (setup.js) */
.setup-fields { display: grid; gap: 12px; margin-bottom: 10px; }
.choice-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-tile { display: flex; gap: 10px; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--r); padding: 10px 14px; cursor: pointer;
  background: var(--surface); min-width: 0; font-weight: 500; transition: border-color var(--t), background-color var(--t), box-shadow var(--t); }
.choice-tile:hover { border-color: color-mix(in oklab, var(--fg) 24%, var(--border-strong)); }
.choice-tile:has(input:checked) { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 6%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 13%, transparent); }
.choice-tile input { width: 17px; height: 17px; accent-color: var(--accent); }
.test-call-status:empty { display: none; }
.test-call-status { margin-top: 8px; }
/* Ava / Cai chat */
.ava-log:empty { display: none; }
.ava-log { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; margin-top: 12px; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--r); background: var(--surface-2); scrollbar-width: thin; }
.ava-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.ava-msg.ava { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.ava-msg.me { align-self: flex-end; background: var(--accent-soft); color: var(--fg); border: 1px solid color-mix(in oklab, var(--accent) 16%, transparent); border-bottom-right-radius: 5px; }
.ava-form { display: flex; gap: 8px; margin-top: 10px; }
.ava-form[hidden] { display: none; }
.ava-form input { flex: 1; min-width: 0; }

/* Insights (insights.js): one accent hue per chart (each chart is one series), thin marks, hairline axes. */
.insights { display: grid; gap: 20px; transition: opacity var(--t); }
.insights.is-loading { opacity: .55; pointer-events: none; }
.insights > .page-header { margin-bottom: 4px; }
.insights .kpi-value { font-variant-numeric: normal; }
.insights .grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.stack-sm { display: grid; gap: 10px; }
.card-pad { padding: 8px 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-row .filter { display: grid; gap: 4px; min-width: 0; }
.filter-row select { min-width: 0; max-width: 100%; }
.viz { position: relative; }
.cols-frame { position: relative; height: 160px; border-bottom: 1px solid var(--border-strong); padding-top: 18px; }
.cols-frame::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; border-top: 1px dashed var(--border); }
.col-max { position: absolute; top: 0; left: 0; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cols { display: grid; gap: 2px; height: 100%; align-items: end; }
.col-slot { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; padding: 0; border: 0; background: transparent; cursor: pointer;
  min-width: 0; border-radius: 4px 4px 0 0; transition: background-color var(--t); }
.col-slot:hover, .col-slot:focus-visible { background: var(--surface-2); }
.col-slot:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.col-bar { display: block; width: 100%; max-width: 24px; background: var(--viz); border-radius: 4px 4px 0 0; }
.col-bar.dim, .bar-fill.dim { background: var(--border-strong); }
.col-bar.on, .bar-fill.on { background: var(--viz); }
.col-peak { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 11.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.col-ticks { display: grid; gap: 2px; margin-top: 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-ticks span { white-space: nowrap; overflow: visible; }
.viz-tip { position: absolute; transform: translate(-50%, -100%); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--sh-md);
  border-radius: var(--r-sm); padding: 6px 10px; font-size: 12.5px; display: grid; gap: 1px; pointer-events: none; white-space: nowrap; z-index: 2; }
.viz-tip[hidden] { display: none; }
.viz-tip span { color: var(--muted); }
.viz-table { margin-top: 10px; font-size: 13.5px; }
.viz-table summary { cursor: pointer; color: var(--muted); }
.bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bar-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) 5.5em; gap: 12px; align-items: center; padding: 7px 8px; border: 0;
  border-radius: var(--r-sm); background: transparent; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: background-color var(--t); }
.bar-row:hover, .bar-row:focus-visible { background: var(--surface-2); }
.bar-row[aria-pressed="true"] { background: var(--accent-soft); }
.bar-name { overflow-wrap: anywhere; }
.bar-track { display: block; height: 8px; border-radius: 99px; background: color-mix(in oklab, var(--border) 60%, transparent); }
.bar-fill { display: block; height: 100%; background: var(--viz); border-radius: 99px; }
.bar-val { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 520px) {
  .bar-row { grid-template-columns: minmax(0, 1fr) 5.5em; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
}
.attn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.attn-row { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: border-color var(--t), background-color var(--t); }
.attn-row:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.attn-row[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.attn-row:disabled { color: var(--muted); cursor: default; }
.call-detail { scroll-margin-top: 48px; }
.transcript { margin-top: 12px; display: grid; gap: 8px; }
.transcript-turns { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 520px; overflow: auto; }
.transcript-turns li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 6px 8px; border-radius: 6px; }
.transcript-turns li.turn-caller { background: var(--surface-2, rgba(127, 127, 127, 0.08)); }
.transcript-turns .turn-who { font-size: 12px; font-weight: 600; color: var(--muted, inherit); padding-top: 2px; }
.transcript-turns .turn-text { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 560px) { .transcript-turns li { grid-template-columns: 1fr; gap: 2px; } }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px 24px; padding: 14px 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-xs); }
.mini-stat { display: grid; gap: 2px; min-width: 120px; }
.mini-stat b { font-size: 17px; font-weight: 600; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.mini-stat span { color: var(--muted); font-size: 13px; }
.grid.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Onboarding (setup.js): two ways in, one step at a time sliding in from the right. */
.onboarding { overflow-x: clip; display: grid; gap: 24px; min-width: 0; }
.onboarding.narrow { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
.onboarding.narrow .ob-choices, .onboarding.narrow .ob-step, .onboarding.narrow .ob-progress { max-width: none; }
.ob-choices { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); max-width: 860px; }
.ob-choice { display: flex; align-items: center; gap: 14px; text-align: left; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  color: inherit; font: inherit; cursor: pointer; box-shadow: var(--sh-xs); transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.ob-choice:hover, .ob-choice:focus-visible { border-color: color-mix(in oklab, var(--accent) 60%, var(--border)); box-shadow: var(--sh-md); transform: translateY(-1px); }
.ob-choice.primary { border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in oklab, var(--grad-a) 12%, transparent), transparent 60%), var(--surface); }
.ob-choice > span:nth-child(2) { display: grid; gap: 4px; flex: 1; min-width: 0; }
.ob-choice b { font-size: 16px; letter-spacing: -.01em; }
.ob-choice small { color: var(--muted); line-height: 1.45; font-size: 13.5px; }
.ob-choice > .icon:last-child { color: var(--muted); flex: none; }
.ob-choice-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 18%, transparent); }
.cai-head .ob-choice-icon { width: 32px; height: 32px; border-radius: 9px; color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 oklch(100% 0 0 / .28); }
.ob-progress { display: grid; gap: 6px; max-width: 720px; }
.ob-step { max-width: 720px; display: grid; gap: 6px; }
.ob-step h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.ob-step .setup-fields { margin: 14px 0 6px; }
.eyebrow-text { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); }
.ob-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.ob-step.next { animation: ob-in-next .32s var(--ease); }
.ob-step.prev { animation: ob-in-prev .32s var(--ease); }
@keyframes ob-in-next { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes ob-in-prev { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
.ob-answers { list-style: none; margin: 0; padding: 0; display: grid; }
.ob-answers li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.ob-answers li:first-child { border-top: 0; }
.ob-answer { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ob-answer small { overflow-wrap: anywhere; }
.ob-cai { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.ob-cai .card + .card { margin-top: 0; }
@media (max-width: 900px) { .ob-cai { grid-template-columns: minmax(0, 1fr); } }
.ob-next { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ob-next li { display: flex; gap: 10px; align-items: flex-start; }
.ob-next .icon { color: var(--accent-strong); margin-top: 2px; flex: none; }
/* Onboarding start view (2026-11-13): centred, the two ways as full cards, then what gets set up. */
.onboarding.start { max-width: 1040px; margin-left: auto; margin-right: auto; width: 100%; }
.ob-start { min-height: calc(100vh - 150px); display: grid; align-content: center; gap: 32px; padding-block: 16px; }
.ob-hero { text-align: center; display: grid; gap: 10px; justify-items: center; }
.ob-hero h1 { margin: 0; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; }
.ob-hero p { margin: 0; color: var(--muted); font-size: 16px; max-width: 52ch; }
.ob-paths { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.ob-paths.single { max-width: 520px; width: 100%; margin-left: auto; margin-right: auto; }
.ob-path { position: relative; display: grid; gap: 12px; align-content: start; justify-items: start; text-align: left; padding: 26px; border: 1px solid var(--border);
  border-radius: var(--r-xl); background: var(--surface); color: inherit; font: inherit; cursor: pointer; box-shadow: var(--sh-xs);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t); }
.ob-path:hover, .ob-path:focus-visible { border-color: color-mix(in oklab, var(--accent) 60%, var(--border)); box-shadow: var(--sh-md); transform: translateY(-2px); }
.ob-path.primary { border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
  background: radial-gradient(110% 80% at 0% 0%, color-mix(in oklab, var(--grad-a) 14%, transparent), transparent 62%),
              radial-gradient(90% 70% at 100% 0%, color-mix(in oklab, var(--grad-b) 9%, transparent), transparent 60%), var(--surface); }
.ob-path .ob-choice-icon { width: 46px; height: 46px; border-radius: 12px; }
.ob-path.primary .ob-choice-icon { color: #fff; background: var(--grad); box-shadow: inset 0 1px 0 oklch(100% 0 0 / .28), 0 8px 18px -8px color-mix(in oklab, var(--grad-b) 60%, transparent); }
.ob-path-title { font-size: 18px; letter-spacing: -.015em; }
.ob-path-text { color: var(--muted); line-height: 1.5; }
.ob-path-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.ob-path-points li { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--fg-2); }
.ob-path-points .icon { color: var(--accent-strong); flex: none; }
.ob-path-cta { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 550; color: var(--accent-strong); }
.ob-path-cta svg { transition: transform var(--t); }
.ob-path:hover .ob-path-cta svg { transform: translateX(3px); }
.ob-preview-wrap { display: grid; gap: 12px; }
.ob-preview-wrap h2 { margin: 0; text-align: center; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ob-preview { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); }
.ob-preview li { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.ob-preview li > span:last-child { display: grid; gap: 3px; min-width: 0; }
.ob-preview b { font-size: 14px; }
.ob-preview small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.ob-preview-num { width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; flex: none; background: var(--accent-soft);
  color: var(--accent-strong); font-weight: 600; font-size: 12px; }
.ob-preview li.done .ob-preview-num { background: var(--accent); color: var(--accent-fg); }
@media (max-width: 720px) { .ob-start { min-height: 0; } .ob-path { padding: 20px; } }

/* The agent page (agent.js): the agent on the left, Cai in a side panel on the right. */
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }
.stack > .card + .card, .stack > * + .card { margin-top: 0; }
.agent-page { display: grid; gap: 24px; min-width: 0; }
.agent-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); align-items: start; }
.agent-layout .card + .card { margin-top: 0; }
.agent-layout > .stack { gap: 16px; }
@media (max-width: 1000px) { .agent-layout { grid-template-columns: minmax(0, 1fr); } }
.agent-hero { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.agent-hero .item-main { display: grid; flex: 1; min-width: 200px; }
.agent-hero .item-main small { color: var(--muted); }
.cai-side { position: sticky; top: calc(var(--env-h) + 16px); display: grid; gap: 10px; max-height: calc(100dvh - var(--env-h) - 32px);
  grid-template-rows: auto minmax(0, 1fr) auto auto auto; }
.cai-head { display: flex; align-items: center; gap: 10px; }
.cai-head > span:nth-child(2) { display: grid; line-height: 1.3; }
.cai-head small { font-size: 12.5px; }
.cai-head .icon-btn { margin-left: auto; }
.cai-log { margin-top: 0; max-height: none; min-height: 220px; overflow-y: auto; }
.cai-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.cai-suggest[hidden] { display: none; }
.chip-btn { border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-2); border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 12.5px;
  cursor: pointer; transition: border-color var(--t), color var(--t), background-color var(--t); }
.chip-btn:hover, .chip-btn:focus-visible { border-color: color-mix(in oklab, var(--accent) 60%, transparent); background: var(--accent-soft); color: var(--fg); }
.cai-form { display: flex; gap: 8px; align-items: flex-end; }
.cai-form textarea { flex: 1; min-width: 0; resize: vertical; min-height: 64px; }
.tool-list, .locked-rules, .history { list-style: none; margin: 0; padding: 0; display: grid; }
.tool-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.tool-row:first-child { border-top: 0; padding-top: 0; }
.tool-row.unavailable .tool-text b { color: var(--muted); }
.tool-text { display: grid; gap: 2px; flex: 1; min-width: 220px; }
.tool-text b { font-weight: 550; }
.tool-text small { font-size: 13px; }
.tool-control { display: grid; gap: 8px; justify-items: end; }
.tool-setting[hidden] { display: none; }
.tool-setting input { width: 170px; }
/* On/off switches drawn from the checkbox itself */
.switch { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 500; font-size: 13.5px; }
.switch input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; margin: 0; border-radius: 99px; cursor: pointer; border: 0;
  background: var(--border-strong) radial-gradient(circle, #fff 0 7px, transparent 7.5px) no-repeat left 1px center / 20px 20px;
  box-shadow: inset 0 0 0 1px oklch(0% 0 0 / .04); transition: background-color var(--t), background-position var(--t); }
.switch input[type="checkbox"]:checked { background-color: var(--accent); background-position: right 1px center; }
.switch input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }
.locked-rules { gap: 8px; }
.locked-rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--fg-2); }
.locked-rules .icon { color: var(--ok); flex: none; margin-top: 3px; }
.history li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--border); }
.history li:first-child { border-top: 0; }
.history-main { min-width: 0; overflow-wrap: anywhere; }
.card.flash { animation: card-flash 1.8s ease-out; }
@keyframes card-flash { 0%, 30% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px var(--ring); background: color-mix(in oklab, var(--accent) 6%, var(--surface)); }
  100% { box-shadow: var(--sh-xs); background: var(--surface); } }
.agent-main textarea, .cai-form textarea { width: 100%; box-sizing: border-box; }
.agent-main .card .row input { flex: 1; min-width: 0; max-width: 320px; }
/* the number it answers, and the locked part of a Retell-built agent's prompt */
.phone-number { font-family: var(--mono); font-size: 17px; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.agent-main details pre.note-body { max-height: 420px; overflow: auto; margin-top: 8px; font-size: 13.5px; }
.agent-main details summary { cursor: pointer; font-weight: 550; }
.only-narrow { display: none; }
@media (max-width: 1000px) {
  .cai-side { position: static; max-height: none; grid-template-rows: none; display: none; scroll-margin-top: 48px; }
  .cai-log { max-height: 360px; }
  .only-narrow { display: inline-flex; }
  /* Cai opens as a sheet on phones and tablets */
  .cai-side.sheet-open { display: grid; position: fixed; left: 0; right: 0; top: auto; bottom: 0; height: min(86dvh, 720px); max-height: none; z-index: 70;
    margin: 0; border-radius: 20px 20px 0 0; box-shadow: var(--sh-lg); grid-template-rows: auto minmax(0, 1fr) auto auto auto;
    animation: sheet-up .24s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
  .cai-side.sheet-open .cai-log { max-height: none; min-height: 0; }
  body.sheet-lock { overflow: hidden; }
  body.sheet-lock::after { content: ""; position: fixed; inset: 0; background: oklch(15% .01 262 / .45); z-index: 65; backdrop-filter: blur(2px); }
}
.how-to { margin: 0 0 4px; padding-left: 1.3rem; display: grid; gap: 6px; color: var(--fg-2); }

/* One slim line when an email address needs confirming. */
.slim-note { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 6px 16px; font-size: 13.5px;
  background: color-mix(in oklab, var(--warn) 8%, var(--bg)); color: var(--fg); border-bottom: 1px solid color-mix(in oklab, var(--warn) 25%, var(--border)); }
.slim-note .icon { color: var(--warn); }

/* Home: one list of next steps. */
.next-list { list-style: none; margin: 0; padding: 0; display: grid; }
.next-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.next-row:first-child { border-top: 0; padding-top: 2px; }
.next-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--fg-2);
  border: 1px solid var(--border); }
.next-row.primary .next-icon { background: var(--accent-soft); color: var(--accent-strong); border-color: color-mix(in oklab, var(--accent) 18%, transparent); }
.next-text { display: grid; gap: 3px; flex: 1; min-width: 0; }
.next-text b { font-weight: 550; }
.next-text small { color: var(--muted); font-size: 13px; }
.next-text .progress { max-width: 340px; margin-top: 6px; }
@media (max-width: 640px) { .next-row { flex-wrap: wrap; } .next-row > .btn, .next-row > .chip { margin-left: 52px; } }

/* Motion off when asked. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card.flash { box-shadow: 0 0 0 2px var(--accent); }
}

/* -- appointments calendar (calendar.js, 2026-11-13): month and week views, a day panel, list ------------------ */
.cal { display: grid; gap: 14px; }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cal-nav .row { gap: 2px; }
.cal-title { margin: 0 0 0 4px; font-size: 1.15rem; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.icon-btn.flip svg { transform: rotate(180deg); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--border); }
.seg button { font: inherit; font-size: .82rem; font-weight: 550; color: var(--muted); background: transparent; border: 0; border-radius: 7px;
  padding: 5px 12px; cursor: pointer; transition: background var(--t) var(--ease), color var(--t) var(--ease); }
.seg button:hover { color: var(--fg); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--sh-sm), 0 0 0 1px var(--border); }
.cal-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal-body.list { display: block; }
.cal-main { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }

/* month */
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-head span { padding: 10px 12px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(108px, auto); }
.cal-day { position: relative; padding: 8px 8px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background var(--t) var(--ease); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:nth-last-child(-n+7) { border-bottom: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { background: color-mix(in oklab, var(--surface-2) 60%, transparent); }
.cal-day.out .cal-num { color: color-mix(in oklab, var(--muted) 70%, transparent); }
.cal-day-hit { position: absolute; inset: 0; border: 0; background: transparent; cursor: pointer; border-radius: 0; z-index: 0; }
.cal-day-hit:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); border-radius: 0; }
.cal-num { position: relative; z-index: 1; pointer-events: none; align-self: flex-start; display: grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; font-size: .82rem; font-weight: 550; color: var(--fg-2);
  font-variant-numeric: tabular-nums; }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-fg); }
.cal-day.selected { background: var(--accent-soft); }
.cal-day.selected::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1.5px var(--accent); pointer-events: none; }
.cal-day-events { position: relative; z-index: 1; display: grid; gap: 3px; min-width: 0; }
.cal-more { font-size: .72rem; font-weight: 550; color: var(--muted); padding-left: 6px; pointer-events: none; }
.cal-dots { display: none; position: relative; z-index: 1; gap: 3px; pointer-events: none; }
.cal-dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--accent); }

/* an appointment chip (month) or block (week) */
.cal-event { --c: var(--accent); --cs: var(--accent-soft); display: flex; align-items: baseline; gap: 6px; min-width: 0; width: 100%;
  font: inherit; font-size: .74rem; line-height: 1.25; text-align: left; cursor: pointer; color: var(--fg);
  background: var(--cs); border: 0; border-left: 3px solid var(--c); border-radius: 6px; padding: 3px 6px;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.cal-event:hover { box-shadow: var(--sh-sm); transform: translateY(-1px); }
.cal-event-time { flex: none; font-weight: 600; color: var(--c); font-variant-numeric: tabular-nums; }
.cal-event-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tone-warn { --c: var(--warn); --cs: var(--warn-soft); }
.tone-bad { --c: var(--bad); --cs: var(--bad-soft); }
.tone-muted { --c: var(--muted); --cs: var(--surface-3); }
.tone-muted .cal-event-name { text-decoration: line-through; color: var(--muted); }
.cal-dots i.tone-warn { background: var(--warn); } .cal-dots i.tone-bad { background: var(--bad); } .cal-dots i.tone-muted { background: var(--muted); }

/* week */
.cal-week-head { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-week-day { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; font: inherit; background: transparent; border: 0;
  border-left: 1px solid var(--border); cursor: pointer; color: var(--fg-2); }
.cal-week-day small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-week-day b { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 99px; font-size: 1rem; font-weight: 600; }
.cal-week-day:hover b { background: var(--surface-3); }
.cal-week-day.today b { background: var(--accent); color: var(--accent-fg); }
.cal-week-day.selected { background: var(--accent-soft); }
.cal-week-scroll { max-height: 620px; overflow-y: auto; }
.cal-week-allday { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal-allday-label { font-size: 11px; color: var(--muted); padding: 6px 4px; align-self: center; text-align: right; }
.cal-allday-cell { display: flex; flex-direction: column; gap: 2px; padding: 3px; min-width: 0; border-left: 1px solid var(--border); }
.cal-week-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); position: relative;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--border) calc(var(--hour) - 1px), var(--border) var(--hour)); }
.cal-gutter { display: grid; grid-auto-rows: var(--hour); }
.cal-gutter span { font-size: .7rem; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-.55em); font-variant-numeric: tabular-nums; }
.cal-gutter span:first-child { visibility: hidden; }
.cal-col { position: relative; border-left: 1px solid var(--border); cursor: pointer; }
.cal-col.selected { background: color-mix(in oklab, var(--accent-soft) 70%, transparent); }
.cal-col .cal-event { position: absolute; left: 4px; right: 4px; width: auto; align-items: center; gap: 5px; padding: 0 7px; overflow: hidden; }
.cal-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 99px; background: var(--bad); }

/* day panel */
.cal-panel { position: sticky; top: calc(var(--env-h) + 16px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px; display: grid; gap: 12px; }
.cal-panel-head { display: grid; gap: 2px; }
.cal-panel-head b { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.cal-agenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-agenda li { --c: var(--accent); display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 10px 12px;
  border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); position: relative; overflow: hidden; }
.cal-agenda li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.cal-agenda-time b { font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c); }
.cal-agenda-main { display: grid; gap: 3px; min-width: 0; }
.cal-agenda-main > .row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.cal-agenda-main small { font-size: .78rem; }
.cal-empty { display: grid; justify-items: center; gap: 6px; padding: 24px 8px; color: var(--muted); text-align: center; }
.cal-empty p { margin: 0; font-size: .85rem; }

@media (max-width: 1100px) { .cal-body { grid-template-columns: minmax(0, 1fr); } .cal-panel { position: static; } }
@media (max-width: 700px) {
  .cal-grid { grid-auto-rows: minmax(58px, auto); }
  .cal-day { padding: 6px 4px; align-items: center; }
  .cal-num { align-self: center; }
  .cal-day-events, .cal-more { display: none; }
  .cal-dots { display: flex; }
  .cal-head span { padding: 8px 2px; text-align: center; font-size: 10px; }
  .cal-week-head, .cal-week-grid, .cal-week-allday { grid-template-columns: 40px repeat(7, minmax(0, 1fr)); }
  .cal-col .cal-event-name { display: none; }
  .cal-toolbar { gap: 8px; }
}

/* Integrations > Calendly (2026-11-16): booking status banner, first-run steps, event type picker. */
.calendly-status { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r); padding: 14px 16px; border: 1px solid transparent; margin-bottom: 18px; }
.calendly-status > svg { margin-top: 2px; flex: none; }
.calendly-status b { display: block; font-weight: 600; margin-bottom: 2px; }
.calendly-status p { margin: 0; color: var(--fg-2); font-size: .9rem; line-height: 1.45; }
.calendly-status .btn { margin-top: 10px; }
.calendly-status.on { background: var(--ok-soft); border-color: color-mix(in oklch, var(--ok) 22%, transparent); }
.calendly-status.on > svg { color: var(--ok); }
.calendly-status.todo { background: var(--info-soft); border-color: color-mix(in oklch, var(--info) 22%, transparent); }
.calendly-status.todo > svg { color: var(--info); }
.calendly-status.off { background: var(--warn-soft); border-color: color-mix(in oklch, var(--warn) 22%, transparent); }
.calendly-status.off > svg { color: var(--warn); }
.calendly-intro p { margin: 0 0 10px; color: var(--fg-2); }
.calendly-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: 6px; color: var(--fg); font-size: .92rem; }
form.stack.calendly-picker { max-width: 760px; }
form.stack.calendly-picker td input[type="number"] { width: 4.5rem; }
form.stack.calendly-picker td small { display: block; margin-top: 2px; }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .choices.three { grid-template-columns: minmax(0, 1fr); } }
.warn-text { color: var(--warn); }
/* Integrations: a proposed integration's preview (Kizen BOSS, 2026-11-19) */
.mono-block { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--subtle, rgba(127,127,127,.08)); border-radius: 8px; padding: 12px; margin: 0; max-height: 360px; overflow: auto; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* Sheet rows (test): a real spreadsheet-wide table that scrolls sideways inside its card, never the page */
.sheet-wrap { max-width: 100%; }
.sheet-table { border-collapse: collapse; font-size: 13px; min-width: max-content; }
.sheet-table th, .sheet-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.sheet-table th { position: sticky; top: 0; background: var(--surface); font-weight: 600; }
.sheet-table td.sheet-notes { min-width: 280px; max-width: 420px; white-space: pre-line; }


/* Grouped form sections (campaign form, contact fields) - 2026-11-23 */
.form-section { border-top: 1px solid var(--border); padding-top: 16px; display: grid; gap: 14px; }
.form-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-section-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.form-section-head .hint { font-size: 12.5px; }
.row.chips { gap: 6px; flex-wrap: wrap; }
dl.kv + .form-section { margin-top: 18px; }
.call-detail dl.kv + div { margin-top: 18px; }

/* Agent page voice picker (2026-11-23) */
.voice-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
@media (max-width: 520px) { .voice-row { grid-template-columns: minmax(0, 1fr); } }

/* Voicemail drops (2026-11-26): the message's {fields}, highlighted where each contact's detail goes. */
.field-token { display: inline; padding: 1px 7px; border-radius: 6px; font-weight: 600; white-space: nowrap;
  background: color-mix(in oklab, var(--accent) 12%, var(--surface)); color: var(--accent); }
.script-view { line-height: 1.75; margin: 0 0 12px; }
.script-box { font: inherit; line-height: 1.6; }
.field-chips { gap: 6px; flex-wrap: wrap; align-items: center; }
