/* VoiceLogic.
 *
 * Two brand colours, sampled from the supplied artwork rather than
 * guessed at:
 *
 *   #00adb5  teal — the brand, and the primary here
 *   #132a3a  deep navy — the ink, and the dark theme's ground
 *
 * The teal does more work than the purple it replaces, because it is
 * legible on white and on the navy. The old palette needed a lifted
 * substitute in dark mode; this one needs a lighter tint for large
 * areas and nothing else.
 *
 * The status colours are not from the brand palette, because a brand has
 * no opinion about what "this call was refused" should look like. They
 * are picked to sit beside the teal without arguing with it — the danger
 * red in particular is warmed slightly, because a cold red beside a cold
 * teal reads as a second brand colour.
 *
 * --copper and --blue are kept as aliases: they are old accent names
 * still referenced in a few places, and pointing them at brand colours
 * is cheaper and safer than renaming every usage.
 */
:root{
  --ground:#f4f6f8; --surface:#fff; --surface-2:#eef2f4;
  --ink:#132a3a; --ink-2:#4a5c69; --ink-3:#788893;
  --rule:#dde4e8;
  --brand:#00adb5; --brand-2:#00939a; --brand-3:#4cc5cb;
  --brand-wash:#e6f7f8;
  --accent:#00adb5; --accent-ink:#007d84;
  --copper:#007d84; --blue:#00939a;
  --ok:#1f7a4d; --ok-bg:#e2f3ea;
  --warn:#8a5a12; --warn-bg:#f9efdd;
  --danger:#b02f20; --danger-bg:#fae3e0;
  --radius:12px; --radius-sm:8px;
  --shadow:0 1px 2px rgba(19,42,58,.04);
  --shadow-lift:0 2px 4px rgba(19,42,58,.08), 0 8px 24px rgba(19,42,58,.08);
  /* The sidebar is the brand navy in both themes. */
  --side:#132a3a; --side-2:#1b3747; --side-3:#254152;
  --side-ink:#dce6ec; --side-ink-2:#a9bcc7; --side-ink-3:#8fa4b1; --side-on:#5fdde3;
  --field:#fff; --field-rule:#cdd8de; --row-hover:#f7fafb;
  /* Names older rules use. They were never defined, so the borders and
     colours written with them silently came out as nothing. */
  --line:var(--rule); --muted:var(--ink-3); --card:var(--surface);
  --card-2:var(--surface-2); --soft:var(--surface-2); --accent-soft:var(--brand-wash);
  --line-strong:#9aa4b0;
}
@media (prefers-color-scheme:dark){
  :root{
    /* The brand navy as the ground, so the dark theme is the brand
     * rather than a neutral grey with a logo on it. */
    --ground:#0d1a24; --surface:#132a3a; --surface-2:#1b3747;
    --ink:#e8eef2; --ink-2:#a3b4be; --ink-3:#7a8b96;
    --rule:#254152;
    /* The teal needs barely any lifting to carry on a dark ground,
     * which is the whole reason it works harder than the purple. */
    --brand:#2bc6cd; --brand-2:#4cd3d9; --brand-3:#1aa3aa;
    --brand-wash:#15323f;
    --accent:#2bc6cd; --accent-ink:#5fdde3;
    --copper:#5fdde3; --blue:#4cd3d9;
    --ok:#5fc08c; --ok-bg:#12302220;
    --warn:#d9a441; --warn-bg:#33281020;
    --danger:#e08075; --danger-bg:#3a1d1920;
    --shadow:0 1px 2px rgba(0,0,0,.3);
    --shadow-lift:0 2px 4px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
    /* Darker than the cards, so the sidebar still reads as a column. */
    --side:#0a1620; --side-2:#132a3a; --side-3:#1b3747;
    --field:#0d1a24; --field-rule:#2c4a5c; --row-hover:#173342;
    --line-strong:#4a6474;
  }
}

*{box-sizing:border-box}
body{
  margin:0; background:var(--ground); color:var(--ink);
  /* Inter is the brand typeface. The fallback stack matters more than usual
   * here: this portal is often reached over a customer VPN with no route to
   * Google, and a page that waits on a font it will never get is worse than
   * one that renders in Segoe. */
  font:14.5px/1.5 Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  -webkit-font-smoothing:antialiased;
}
code{font-family:ui-monospace,Consolas,monospace;font-size:.92em}
/* Bold for titles, medium for subtitles, regular for body — the hierarchy
 * the brand guidelines set out. */
h1{font-size:1.5rem;font-weight:700;margin:0 0 .2rem;letter-spacing:-.02em;color:var(--ink)}
h2{font-size:1.05rem;font-weight:600;margin:0 0 .6rem}
h3{font-weight:600}
.muted{color:var(--ink-3);margin:0}
.right{text-align:right}
.nowrap{white-space:nowrap}

/* ── the shell: sidebar and content column ───────────────────────────── */

/* A grid rather than a flex row, because the sidebar is a fixed column and
   the content takes what is left — which is exactly what grid columns say
   and what flex only approximates with basis and shrink rules. */
.shell{display:grid;grid-template-columns:248px 1fr;min-height:100vh}

/* The brand navy, with the page somebody is on lit in teal. A dark
   column is what makes the content beside it read as the page, rather
   than as one more white panel among several. */
.sidenav{
  display:flex;flex-direction:column;gap:.15rem;
  background:var(--side);color:var(--side-ink-2);
  padding:18px 12px 14px;
  /* Stays put while the content scrolls. A navigation that scrolls away
     is one somebody scrolls back up to find. */
  position:sticky;top:0;height:100vh;overflow-y:auto;
  scrollbar-width:thin;scrollbar-color:var(--side-3) transparent;
}
.sidenav .brand{padding:4px 10px 16px;color:#fff}

/* Which customer this is, at the top where somebody checks it. */
.cust{margin:0 4px 14px;padding:10px 12px;background:var(--side-2);border-radius:10px;font-size:13px;line-height:1.35}
.cust b{display:block;color:#fff;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cust span{color:var(--side-ink-3);font-size:12px}

.sidenav nav{display:flex;flex-direction:column;gap:2px;flex:1}

/* Every link in the sidebar, whether loose or inside a group. */
.sidenav nav a{
  display:flex;align-items:center;gap:10px;padding:6px 10px;border-radius:8px;
  color:var(--side-ink-2);text-decoration:none;font-size:13.5px;
}
.sidenav nav a:hover{background:var(--side-2);color:#fff}
/* The page somebody is on. A tinted block rather than bold text: at this
   size weight alone is easy to miss, and the point of a sidebar is that
   you can see where you are without reading. */
.sidenav nav a[aria-current="page"]{background:rgba(0,173,181,.16);color:var(--side-on);font-weight:500}
.sidenav nav a .badge{margin-left:auto}

/* A group heading: its icon, its name, a chevron that turns. */
.navgroup > summary{
  list-style:none;cursor:pointer;display:flex;align-items:center;gap:10px;
  padding:8px 10px;border-radius:8px;font-size:14px;font-weight:500;color:var(--side-ink);
}
.navgroup > summary::-webkit-details-marker{display:none}
.navgroup > summary::after{
  content:"";margin-left:auto;width:.38rem;height:.38rem;
  border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;
  transform:rotate(-45deg);transition:transform .15s;opacity:.55;
}
.navgroup[open] > summary::after{transform:rotate(45deg)}
.navgroup > summary:hover{background:var(--side-2)}
/* Indented to line up with the heading's text, past its icon. */
.sidenav nav .navgroup > a{padding-left:40px}

/* A loose link, styled as a heading so the left edge stays straight. */
.sidenav nav .navlink{font-size:14px;font-weight:500;color:var(--side-ink);padding:8px 10px}
.sidenav nav .navlink:hover{color:#fff}

svg.ic{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.navsep{height:1px;background:var(--side-3);margin:10px 8px}

/* The heading above VoiceLogic's own pages. Not a details element: these
   are links that staff use constantly and there is nothing to be gained
   by hiding them. */
.navsection{
  padding:14px 10px 6px;font-size:11px;font-weight:600;
  letter-spacing:.08em;text-transform:uppercase;color:var(--side-ink-3);
  border-top:1px solid var(--side-3);margin-top:10px;
}

.sidenav-foot{
  display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;
  padding:12px 10px 0;border-top:1px solid var(--side-3);margin-top:10px;
}
.sidenav-foot .who{color:var(--side-ink);font-size:13px;text-decoration:none;border-radius:6px;padding:2px 4px;margin-left:-4px}
.sidenav-foot a.who:hover,.sidenav-foot a.who[aria-current="page"]{color:#fff;background:var(--side-2)}
.sidenav-foot .help{display:flex;align-items:center;gap:6px;flex-basis:100%;order:-1;color:var(--side-ink);font-size:13px;text-decoration:none;border-radius:6px;padding:4px 4px;margin:0 0 2px -4px}
.sidenav-foot .help .ic{width:15px;height:15px}
.sidenav-foot .help:hover{color:#fff;background:var(--side-2)}
.sidenav-foot .linkish{color:var(--side-ink-3);font-size:13px;margin-left:auto}
.sidenav-foot .linkish:hover{color:#fff}

/* The content column. */
.main-col{min-width:0;display:flex;flex-direction:column}
/* Only on a narrow screen, where it holds the button that opens the
   drawer. On a desktop the sidebar already says which customer this is. */
.topbar{
  display:none;align-items:center;gap:.75rem;
  padding:.7rem 1rem;background:var(--surface);
  border-bottom:1px solid var(--rule);
  position:sticky;top:0;z-index:30;
}
.nav-open{display:flex;cursor:pointer;color:var(--ink-2);padding:.2rem;border-radius:var(--radius-sm)}
.nav-open:hover{background:var(--surface-2);color:var(--ink)}

/* The checkbox that opens the drawer, and the sheet that closes it.
   Hidden rather than display:none on the input: a display:none control is
   not focusable, and the label has to be able to reach it. */
.navtoggle{position:absolute;opacity:0;pointer-events:none;width:0;height:0}
.nav-scrim{display:none}

@media (max-width:900px){
  .shell{grid-template-columns:1fr}
  .sidenav{
    position:fixed;inset:0 auto 0 0;width:260px;z-index:60;
    transform:translateX(-100%);transition:transform .18s ease-out;
    box-shadow:var(--shadow-lift);
  }
  .navtoggle:checked ~ .shell .sidenav{transform:none}
  .navtoggle:checked ~ .shell .nav-scrim{
    display:block;position:fixed;inset:0;z-index:50;
    background:rgb(19 42 58 / .45);
  }
  .topbar{display:flex}
  main{padding:20px 16px 48px}
  /* Focusing the checkbox with the keyboard rings the hamburger, because
     that is the control somebody can actually see. */
  .navtoggle:focus-visible ~ .shell .nav-open{outline:2px solid var(--brand);outline-offset:2px}
}

/* Honour a request for no animation: a drawer that slides for somebody who
   has asked things not to move is a drawer that makes them unwell. */
@media (prefers-reduced-motion:reduce){
  .sidenav{transition:none}
  .navgroup > summary::after{transition:none}
}

.brand{display:flex;align-items:center;text-decoration:none}
.brand img{height:22px;width:auto;display:block}
/* The logo, inlined by the brand partial so it follows the theme.
 *
 * Two tones, which is the brand's own treatment: the icon in teal, the
 * wordmark in the page's ink. On the sign-in lockup the slogan is
 * lighter still, because at that size it is a caption rather than a
 * second headline. */
.brand{display:flex;align-items:center;gap:.5rem;text-decoration:none;color:var(--ink)}
.brand .logo-mark{height:22px;width:auto;color:var(--brand);flex:none}
.brand .logo-wordmark{height:17px;width:auto;flex:none}
/* The wordmark is set in the brand's own geometric face, which already
 * carries the identity — so it is not also tinted. Two teal elements
 * side by side is a logo arguing with itself. */
.logo-lockup{display:block;height:auto}
.logo-lockup .brand-mark{fill:var(--brand)}
.logo-lockup .brand-slogan{fill:var(--ink-3)}

.crumb{color:var(--ink-3);font-size:.9rem;white-space:nowrap}
.who{color:var(--ink-3);font-size:.85rem}
.inline{display:inline}
.linkish{background:none;border:0;color:var(--ink-2);cursor:pointer;font-size:.9rem;padding:0}
.linkish:hover{color:var(--copper)}

/* Inside the content column now rather than against the whole window, so
   the measure is capped and the column is what centres it. */
main{max-width:1240px;width:100%;margin:0 auto;padding:28px 36px 60px}
.head{display:flex;align-items:flex-start;gap:1rem;margin-bottom:22px}
.head>div{flex:1}
.head .btn{margin-left:auto}
.head .muted{margin-top:2px}
/* Tabs across a whole page rather than inside a card: larger, and the
   panels hold cards of their own, so no rule above them. */
.page-tabs{margin-top:0}
.page-tabs > label{font-size:1rem;padding:.6rem 1.1rem}
.page-tabs > .tab-panel{border-top:1px solid var(--rule);padding-top:1.2rem}

/* A white panel on the grey ground: no coloured stripe, one hairline, the
   faintest shadow. The stripe down every card made every card look like a
   warning. */
.card{
  background:var(--surface);border:1px solid var(--rule);
  border-radius:var(--radius);padding:18px 20px;margin-bottom:16px;
  box-shadow:var(--shadow);
  /* A data table wider than the window used to push the whole page
     sideways, so every page scrolled horizontally on a laptop. It
     scrolls inside its own card instead. */
  overflow-x:auto;
}
.card.narrow{max-width:380px;margin:12vh auto}
.card.secret{border-left:3px solid var(--warn);background:var(--warn-bg)}
.logo{text-align:center;margin-bottom:.3rem}
.card.narrow .muted{text-align:center;margin-bottom:1.2rem}
.card > h2:first-child{margin-top:0}

/* Tables: a tinted header row, roomy cells, a quiet hover. */
table{width:100%;border-collapse:collapse;font-size:14px}
th{
  text-align:left;font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;
  color:var(--ink-3);padding:10px 14px;background:var(--surface-2);border-bottom:1px solid var(--rule);
}
td{padding:11px 14px;border-bottom:1px solid var(--rule);vertical-align:middle}
tbody tr:hover > td{background:var(--row-hover)}
tr:last-child td{border-bottom:0}
/* A table straight inside a card runs to the card's edges, so the header
   band reads as a stripe across the panel rather than a box inside it. */
.card > table,.card > form > table{width:calc(100% + 40px);margin-left:-20px;margin-right:-20px}
.card > table:last-child,.card > form:last-child > table:last-child{margin-bottom:-18px}
.card > table:first-child,.card > form:first-child > table:first-child{margin-top:-18px}
.card > table tr > :first-child,.card > form > table tr > :first-child{padding-left:20px}
.card > table tr > :last-child,.card > form > table tr > :last-child{padding-right:20px}

/* Labels sit above their fields, which run the width of their column. */
label{display:block;margin-bottom:14px;font-size:12.5px;font-weight:500;color:var(--ink-2)}
/* The hidden attribute means display:none, but only in the browser's own
   stylesheet — any author rule setting display beats it. The rule above
   is exactly such a rule, so every hidden <label> on this site stayed
   visible: the agent form showed an OpenAI voice list and an ElevenLabs
   one at the same time, with no way to tell which it would use. */
[hidden]{display:none !important}
input[type=text],input[type=email],input[type=password],input[type=number],
input[type=search],input[type=tel],input[type=url],input:not([type]),
textarea,label > select{
  display:block;width:100%;margin-top:5px;padding:8px 10px;
  background:var(--field);color:var(--ink);
  border:1px solid var(--field-rule);border-radius:var(--radius-sm);
  font:inherit;font-size:14px;font-weight:400;
}
input:disabled{opacity:.6}
/* Textareas were never styled, because nothing used one until an agent
   needed a page of instructions. Left alone a browser gives them a 20x2
   box in the middle of a full-width form, which reads as broken rather
   than as unstyled. */
textarea{resize:vertical;line-height:1.5}
/* A field with focus gets the brand border and a soft ring, rather than
   the browser's own outline sitting on top of the border. */
input:focus,textarea:focus,select:focus{
  outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(0,173,181,.18);
}
label small{display:block;margin-top:4px;font-size:12px;font-weight:400;color:var(--ink-3)}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0 16px}
.checks{display:flex;flex-wrap:wrap;gap:1rem;margin:.4rem 0 1rem}
.check{display:flex;align-items:center;gap:8px;margin:0 0 14px;font-size:13.5px;font-weight:400;color:var(--ink-2)}
.checks .check,.row-form .check{margin:0}
.check input{width:auto;margin:0}
input[type=checkbox],input[type=radio]{accent-color:var(--brand)}
.actions{display:flex;gap:.6rem;margin-top:.4rem;flex-wrap:wrap}
.note{
  background:var(--surface-2);border-radius:var(--radius-sm);padding:10px 12px;
  font-size:13px;color:var(--ink-2);margin:0 0 1rem;
}

/* Buttons: white with a hairline, or the brand for the one that matters. */
.btn{
  display:inline-flex;align-items:center;gap:6px;padding:7px 13px;border-radius:9px;
  border:1px solid var(--rule);background:var(--surface);color:var(--ink);
  font:inherit;font-size:13.5px;font-weight:500;line-height:1.4;
  cursor:pointer;text-decoration:none;white-space:nowrap;
}
/* A label styled as a button (it opens a panel or a row) is still a
   label, and labels carry a bottom margin for the form fields under them. */
label.btn{margin-bottom:0}
.btn:hover{border-color:var(--field-rule);background:var(--surface-2)}
.btn.primary{background:var(--brand);border-color:var(--brand);color:var(--brand-on,#fff)}
.btn.primary:hover{background:var(--brand);filter:brightness(.92)}
.btn.small,.btn.sm{padding:4px 10px;font-size:12.5px;border-radius:8px}
.btn.ghost{border-color:transparent;background:none;color:var(--ink-2)}
.btn.ghost:hover{background:var(--surface-2);color:var(--ink)}
.btn.danger{background:var(--surface);color:var(--danger);border-color:var(--rule)}
.btn.danger:hover{background:var(--danger-bg);border-color:var(--danger)}
.btn.ghost.danger{background:none;border-color:transparent}
.btn.ghost.danger:hover{background:var(--danger-bg)}
button[type=submit]{
  padding:8px 15px;border-radius:9px;border:1px solid var(--brand);
  background:var(--brand);color:var(--brand-on,#fff);font:inherit;font-size:13.5px;font-weight:500;cursor:pointer;
}
button[type=submit]:hover{filter:brightness(.92)}
/* One visible focus ring everywhere, in the accent, so keyboard users can
 * see where they are. */
a:focus-visible,button:focus-visible,summary:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;border-radius:3px;
}

/* Status badges. Coloured ones carry a dot, so the state still reads to
   somebody who cannot tell the colours apart from the words beside them. */
.pill{
  display:inline-flex;align-items:center;gap:6px;padding:2px 9px;border-radius:999px;
  font-size:12px;font-weight:500;line-height:1.5;white-space:nowrap;
  background:var(--surface-2);color:var(--ink-2);
}
.pill.ok{background:var(--ok-bg);color:var(--ok)}
.pill.warn{background:var(--warn-bg);color:var(--warn)}
.pill.danger{background:var(--danger-bg);color:var(--danger)}
.pill.brand{background:var(--brand-wash);color:var(--accent-ink)}
.pill.ok::before,.pill.warn::before,.pill.danger::before,.pill.brand::before{
  content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none;
}

.error{
  background:var(--danger-bg);color:var(--danger);
  padding:.55rem .75rem;border-radius:var(--radius-sm);font-size:.88rem;margin:0 0 1rem;
}
dl{display:grid;grid-template-columns:auto 1fr;gap:.35rem 1rem;margin:.8rem 0}
dt{color:var(--ink-3);font-size:.8rem}
dd{margin:0}
code.big{font-size:1.05rem;font-weight:600;user-select:all}

/* A select on its own — in a table row, beside a button — stays the size
   of its longest option. Inside a label it runs the width, like the
   fields around it (the rule above). */
select{
  padding:6px 9px;background:var(--field);color:var(--ink);
  border:1px solid var(--field-rule);border-radius:var(--radius-sm);font:inherit;font-size:13.5px;
}
.inline-form{display:inline}
td.small,.small{font-size:.8rem}

.row-form{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}
.row-form input[type=email]{width:auto;min-width:200px;margin:0}
.row-form .check{white-space:nowrap}
.row-form > label{margin-bottom:0}
/* A text box on a one-line form takes the room that is left beside its
   button, rather than the whole line with the button pushed under it. */
.row-form > input:not([type=hidden]):not([type=checkbox]):not([type=time]):not([type=date]){
  flex:1 1 180px;width:auto;margin:0;
}
.row-form .check input[type=time],.row-form .check input[type=date]{margin-left:4px}
audio{height:32px;max-width:230px;vertical-align:middle}
h2{margin-top:1.6rem}

h3{font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--ink-3);margin:1.4rem 0 .5rem}
.row-form select{min-width:180px}

input[type=time],input[type=date]{
  width:auto;margin:0;padding:6px 9px;background:var(--field);color:var(--ink);
  border:1px solid var(--field-rule);border-radius:var(--radius-sm);font:inherit;font-size:13.5px;
}
label > input[type=time],label > input[type=date]{display:block;margin-top:5px}
input[type=file]{margin-top:5px;font-size:13px}

.meter{height:8px;background:var(--surface-2);border-radius:var(--radius-sm);overflow:hidden;max-width:240px}
.meter span{display:block;height:100%;background:var(--ok);transition:width .2s}
.meter span.hot{background:var(--danger)}

/* Transcripts are long and already wrapped by the speech provider, so they
   get a readable measure rather than the monospace block a <pre> defaults
   to. Wrapped, because a transcript has no line structure worth preserving. */
.transcript{
  white-space:pre-wrap;word-wrap:break-word;font:inherit;line-height:1.55;
  max-height:26rem;overflow-y:auto;margin:0;padding:.75rem .9rem;
  background:var(--surface-2);border:1px solid var(--rule);border-radius:var(--radius-sm);
}

/* ── sign in ─────────────────────────────────────────────────────────── */
.signin{margin-top:8vh}
/* The full lockup, icon and slogan included: this is the one page with
   room for it, and the one where somebody wants to be sure what they are
   signing in to. */
/* The heading block is centred and the form below it is not, which is
   the convention for a sign-in page — and it is set here explicitly
   rather than left to inheritance, because the paragraph was arriving
   centred from somewhere no stylesheet rule accounted for. Stating it
   beats a 20px mystery. */
.signin-head{text-align:center;margin-bottom:1.4rem}
.signin-head .logo-lockup{width:100%;max-width:230px;margin:0 auto .5rem}
.signin-head .muted{font-size:.92rem}
.signin form{text-align:left}
.signin button[type=submit]{width:100%;margin-top:.4rem}

/* ── team presence ───────────────────────────────────────────────────── */
.team-filter{
  width:100%;max-width:420px;margin:0 0 .9rem;padding:.45rem .6rem;
  background:var(--ground);color:var(--ink);
  border:1px solid var(--rule);border-radius:var(--radius-sm);font:inherit;font-size:.9rem;
}
.team{display:grid;gap:.7rem;grid-template-columns:repeat(auto-fill,minmax(168px,1fr))}
.person{
  border:1px solid var(--rule);border-radius:6px;padding:.75rem;
  background:var(--surface);text-align:center;
}
.person.me{border-color:var(--brand);background:var(--surface-2)}
.avatar{position:relative;width:46px;height:46px;margin:0 auto .5rem}
.avatar span{
  display:flex;align-items:center;justify-content:center;
  width:46px;height:46px;border-radius:50%;
  background:var(--brand-3);color:#fff;font-weight:600;font-size:.95rem;
}
/* The dot is a shorthand, never the only signal: the state is written
   underneath in words, because a colour alone is no use to somebody who
   cannot tell red from green. */
.avatar .dot{
  position:absolute;right:0;bottom:0;width:13px;height:13px;border-radius:50%;
  border:2px solid var(--surface);background:var(--ink-3);
}
.dot.ok{background:#1f9d55}
.dot.busy{background:#c0392b}
.dot.ring{background:#e0a800;animation:pulse 1.2s ease-in-out infinite}
.dot.dnd{background:#8e44ad}
.dot.fwd{background:var(--accent)}
.dot.idle{background:var(--ink-3)}
.dot.off{background:transparent;border-color:var(--ink-3)}
@keyframes pulse{50%{opacity:.35}}
/* Honour a reduced-motion preference: a flashing dot on a page somebody
   leaves open all day is exactly what that setting is for. */
@media (prefers-reduced-motion:reduce){.dot.ring{animation:none}}
.person .who{font-size:.88rem;font-weight:500;line-height:1.3}
.person .who .muted{font-weight:400}
.person .state{font-size:.76rem;color:var(--ink-3);margin:.15rem 0 .5rem}
.person .state.ok{color:#1f7a4d}
.person .state.busy{color:var(--danger)}
.person .state.off{color:var(--ink-3);font-style:italic}
.person .acts{display:flex;gap:.3rem;justify-content:center}

/* ── browser softphone ───────────────────────────────────────────────── */
/* Narrow and centred. A dial pad spread across a desktop monitor is harder
   to use than one the size of the thing it imitates. */
.webphone .wp-dial{max-width:300px;margin:0 auto 1.4rem}
.wp-status{
  display:flex;align-items:center;gap:.5rem;justify-content:center;
  margin-bottom:1rem;font-size:.9rem
}
.wp-status .dot{
  position:static;width:10px;height:10px;border-radius:50%;
  border:2px solid var(--surface);flex:0 0 auto
}
.wp-status .small{margin-left:auto;font-size:.78rem}
#wp-number{
  width:100%;text-align:center;font-size:1.35rem;letter-spacing:.04em;
  padding:.6rem;margin-bottom:.7rem
}
.wp-keys{display:grid;grid-template-columns:repeat(3,1fr);gap:.45rem}
.wp-keys .key{
  padding:.55rem 0;font-size:1.25rem;line-height:1.1;cursor:pointer;
  background:var(--surface-2);color:var(--ink);
  border:1px solid var(--line);border-radius:10px
}
.wp-keys .key small{display:block;font-size:.56rem;letter-spacing:.09em;color:var(--ink-3)}
.wp-keys .key:hover{border-color:var(--brand)}
.wp-keys .key:active{background:var(--line)}
.wp-actions{display:flex;gap:.45rem;margin-top:.7rem}
.wp-actions .btn{flex:1}
.wp-actions .btn.small{flex:0 0 auto}
/* Green for call, because that is what a telephone looks like everywhere
   else and this is not the place to be original. */
.btn.wp-green{background:#1f9d55;border-color:#1f9d55}
.btn.wp-green:hover{background:#198045;border-color:#198045}
#wp-note{min-height:1.2em;text-align:center;margin:.5rem 0 0}

/* ── wallboard ───────────────────────────────────────────────────────── */
/* Sized to be read from across a room, not from a desk. Everything scales
   with the viewport width so the same page works on a laptop and on a
   television without a second layout. */
.wallboard{display:grid;gap:1.1rem}
.wb-head .actions{margin-left:auto}
.wb-big{display:grid;gap:.8rem;grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.wb-stat{
  background:var(--surface);border:1px solid var(--rule);border-radius:14px;
  padding:1.1rem .8rem;text-align:center
}
.wb-stat .n{
  display:block;font-size:clamp(2.6rem,7vw,5.5rem);line-height:1;
  font-weight:600;letter-spacing:-.02em;color:var(--brand)
}
.wb-stat .l{
  display:block;margin-top:.35rem;font-size:.8rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--ink-3)
}
.wb-stat.wb-warn{border-color:var(--warn);background:var(--warn-bg)}
.wb-stat.wb-warn .n{color:var(--warn)}
.wb-stat.wb-bad{border-color:var(--danger);background:var(--danger-bg)}
.wb-stat.wb-bad .n{color:var(--danger)}

.wallboard h2{
  font-size:.82rem;letter-spacing:.16em;text-transform:uppercase;
  color:var(--ink-3);margin:0 0 .5rem;font-weight:600
}
.wallboard h2 small{
  display:block;letter-spacing:0;text-transform:none;font-size:.82rem;
  color:var(--ink-2);margin-top:.2rem;font-weight:400
}
.wb-row{display:grid;gap:.6rem;grid-template-columns:repeat(auto-fit,minmax(118px,1fr))}
.wb-small{
  background:var(--surface);border:1px solid var(--rule);border-radius:10px;
  padding:.65rem .5rem;text-align:center
}
.wb-small .n{display:block;font-size:clamp(1.3rem,2.6vw,2rem);font-weight:600;line-height:1.1}
.wb-small .l{display:block;font-size:.72rem;color:var(--ink-3);margin-top:.15rem}

.wb-qgrid{display:grid;gap:.7rem;grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.wb-queue{
  background:var(--surface);border:1px solid var(--rule);border-radius:12px;
  padding:.8rem .9rem;border-left-width:6px
}
/* Three states, and only three. A wallboard with a gradient of severity is
   a wallboard nobody can read at a glance. */
.wb-queue.fine{border-left-color:var(--ok)}
.wb-queue.busy{border-left-color:var(--warn);background:var(--warn-bg)}
.wb-queue.bad{border-left-color:var(--danger);background:var(--danger-bg)}
.wb-qname{font-weight:600;font-size:1.05rem;margin-bottom:.2rem}
.wb-qwait{font-size:.9rem;color:var(--ink-2)}
.wb-qwait .n{font-size:1.9rem;font-weight:600;color:var(--ink);margin-right:.25rem}
.wb-qmeta{
  display:flex;flex-wrap:wrap;gap:.2rem .9rem;margin-top:.3rem;
  font-size:.78rem;color:var(--ink-3)
}

.wb-people{display:flex;flex-wrap:wrap;gap:.4rem}
.wb-person{
  display:flex;align-items:center;gap:.4rem;
  background:var(--surface);border:1px solid var(--rule);border-radius:999px;
  padding:.3rem .75rem;font-size:.86rem
}
.wb-person .dot{position:static;width:9px;height:9px;border-radius:50%;border:0;flex:0 0 auto}
.wb-person.off{opacity:.55}
.wb-pname{font-weight:500}
.wb-pnum{color:var(--ink-3);font-size:.78rem}

.wb-quiet{color:var(--ink-3);font-style:italic;margin:0}
.wb-asof{margin:0;font-size:.74rem;color:var(--ink-3);text-align:right}

/* The alarm is a border on the whole board, not a flash: something that
   blinks in an office all afternoon gets covered with a sticky note. */
.wallboard.alarm{
  outline:3px solid var(--danger);outline-offset:8px;border-radius:16px
}

/* Full screen: the page is the board, nothing else. */
body.wb-tv header,
body.wb-tv .wb-head,
body.wb-tv footer{display:none}
body.wb-tv main{max-width:none;padding:1.2rem}
body.wb-tv .wb-stat .n{font-size:clamp(3.5rem,9vw,8rem)}

/* ── trunks and number stock ─────────────────────────────────────────── */
.trunk-head{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:.6rem}
.trunk-head h2{margin:0;font-size:1.1rem}
.trunk-head .dot{position:static;width:11px;height:11px;border-radius:50%;border:0;flex:0 0 auto}
.trunk-head .state{font-size:.82rem;color:var(--ink-2)}
.trunk-head .state.ok{color:#1f7a4d}
.trunk-head .state.busy{color:var(--danger)}
.trunk-head .btn{margin-left:auto}
.trunk-facts{display:grid;gap:.4rem 1.2rem;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));margin:0 0 .6rem}
.trunk-facts dt{font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3)}
.trunk-facts dd{margin:0;font-size:.9rem}
.warn-text{color:var(--warn)}
.note.warn{color:var(--warn);background:var(--warn-bg);border-radius:8px;padding:.5rem .7rem}

.did-add{display:flex;gap:.5rem;align-items:flex-end;flex-wrap:wrap;margin:.6rem 0}
.did-add label{display:flex;flex-direction:column;font-size:.76rem;color:var(--ink-3)}
.did-table{width:100%;border-collapse:collapse;font-size:.88rem}
.did-table th{text-align:left;font-size:.72rem;letter-spacing:.08em;
  text-transform:uppercase;color:var(--ink-3);padding:.3rem .4rem}
.did-table td{padding:.25rem .4rem;border-top:1px solid var(--rule)}
.did-table tr.free code{color:var(--ok)}
.did-table form{margin:0}
.did-table select{font-size:.85rem;padding:.2rem}
details.dids summary{cursor:pointer;font-weight:500;margin:.3rem 0}

/* ── asterisk log ────────────────────────────────────────────────────── */
.log-filter .grid{gap:.6rem}
.log-filter label{font-size:.78rem}
.log-counts{display:grid;gap:.6rem;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));margin-bottom:1rem}
.log-offenders,.log-table{width:100%;border-collapse:collapse;font-size:.84rem}
.log-offenders th,.log-table th{
  text-align:left;font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;
  color:var(--ink-3);padding:.3rem .5rem;position:sticky;top:0;background:var(--ground)
}
.log-offenders td,.log-table td{padding:.3rem .5rem;border-top:1px solid var(--rule);vertical-align:top}
.log-offenders tr.bad td{background:var(--danger-bg)}
.log-table{background:var(--surface);border:1px solid var(--rule);border-radius:10px}
/* Monospace for the time and the message: a log is read by scanning down a
   column, and a proportional font makes the columns wander. */
.log-table .t{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap;color:var(--ink-3)}
.log-table .lv{white-space:nowrap;font-size:.76rem;font-weight:600;color:var(--ink-2)}
.log-table .src{white-space:nowrap;font-size:.78rem}
.log-table .msg{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.8rem;
  white-space:pre-wrap;word-break:break-word}
.log-table tr.warn .lv{color:var(--warn)}
.log-table tr.bad .lv{color:var(--danger)}
.log-table tr.bad{background:var(--danger-bg)}
.log-table tr.ok .lv{color:var(--ok)}
.log-more{text-align:center;margin:.8rem 0}

/* ── CRM ─────────────────────────────────────────────────────────────── */
.crm-status{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.crm-status .dot{position:static;width:11px;height:11px;border-radius:50%;border:0;flex:0 0 auto}
.crm-status .crm-right{margin-left:auto}
.crm-redirect{display:inline-block;padding:.35rem .6rem;background:var(--surface-2);
  border-radius:6px;word-break:break-all}
.note.ok-note{color:var(--ok);background:var(--ok-bg);border-radius:8px;padding:.5rem .7rem}

/* ── grouped navigation ──────────────────────────────────────────────── */
/* The dropdown menus are gone with the top bar. Their rules went with
   them rather than being left behind: dead CSS is the sort of thing
   somebody copies next time they need something similar. */

/* Choosing which board a screen shows, from the board itself. */
.wb-switch{font-size:.86rem;padding:.25rem .4rem;margin-right:.5rem}
.wb-pick{display:grid;gap:1.2rem;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin:.8rem 0}
.wb-pick h3{font-size:.8rem;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3);margin:0 0 .3rem}

/* ── chat ────────────────────────────────────────────────────────────── */
.chat{display:grid;grid-template-columns:minmax(200px,260px) 1fr;gap:1rem;align-items:start}
@media (max-width:720px){.chat{grid-template-columns:1fr}}
.chat-side{background:var(--surface);border:1px solid var(--rule);border-radius:12px;padding:.8rem}
.chat-side h3{font-size:.72rem;letter-spacing:.1em;text-transform:uppercase;
  color:var(--ink-3);margin:.8rem 0 .4rem}
.chat-side h3:first-child{margin-top:0}
.chat-conv{display:block;padding:.4rem .5rem;border-radius:8px;margin-bottom:.2rem}
.chat-conv:hover{background:var(--surface-2)}
.chat-conv.here{background:var(--surface-2);border-left:3px solid var(--brand)}
.chat-who{font-weight:500}
.chat-last{display:block;font-size:.76rem;color:var(--ink-3);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-start{margin:0}
.chat-start .linkish{padding:.25rem .5rem;font-size:.88rem}
.chat-group{margin-top:.6rem}
.chat-group summary{cursor:pointer;font-size:.86rem;color:var(--ink-2)}

.chat-main{background:var(--surface);border:1px solid var(--rule);border-radius:12px;
  display:flex;flex-direction:column;min-height:60vh}
.chat-head{padding:.7rem .9rem;border-bottom:1px solid var(--rule);
  display:flex;gap:.6rem;align-items:baseline;flex-wrap:wrap}
/* Scrolls on its own so the composer stays put while the history grows. */
.chat-messages{flex:1;overflow-y:auto;max-height:60vh;padding:.8rem .9rem;
  display:flex;flex-direction:column;gap:.35rem}
.chat-day{align-self:center;font-size:.72rem;color:var(--ink-3);
  background:var(--surface-2);border-radius:999px;padding:.1rem .6rem;margin:.5rem 0 .2rem}
.chat-msg{display:flex}
.chat-msg.mine{justify-content:flex-end}
.chat-bubble{max-width:min(70%,42rem);background:var(--surface-2);
  border-radius:12px;padding:.4rem .6rem;font-size:.9rem}
.chat-msg.mine .chat-bubble{background:var(--brand);color:var(--brand-on,#fff)}
.chat-from{display:block;font-size:.72rem;color:var(--ink-3);font-weight:600}
.chat-body{white-space:pre-wrap;word-break:break-word}
.chat-when{display:block;font-size:.68rem;opacity:.65;text-align:right}
.chat-compose{display:flex;gap:.5rem;padding:.7rem .9rem;border-top:1px solid var(--rule)}
.chat-compose input[name=body]{flex:1}
.chat-empty{padding:2rem;text-align:center}

/* The unread badge, in the navigation and beside a conversation. */
.badge{display:inline-block;min-width:1.1rem;padding:0 .3rem;margin-left:.3rem;
  background:var(--danger);color:#fff;border-radius:999px;
  font-size:.7rem;line-height:1.3rem;text-align:center;font-weight:600}

/* Meeting rooms. A card per room, and the useful part is the list of who
   is in it — so an occupied room is marked rather than left to be spotted
   by reading the number in a pill. */
.meetings{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:1rem}
.meeting.busy{border-color:var(--ok)}
.meeting-head{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem}
.meeting-head h2{margin:0 0 .15rem}
.meeting-head p{margin:0}
.meeting-state{display:flex;flex-direction:column;align-items:flex-end;gap:.3rem;flex-shrink:0}
.pill.small{font-size:.7rem;padding:.05rem .35rem}
.meeting-people{list-style:none;margin:.8rem 0 0;padding:.6rem 0 0;border-top:1px solid var(--line)}
.meeting-people li{display:flex;align-items:center;gap:.5rem;padding:.2rem 0}
.meeting-people .who{font-weight:500}
.meeting-actions{display:flex;align-items:center;gap:.5rem;margin-top:.8rem;flex-wrap:wrap}
.meeting-edit{margin-top:.2rem}
.meeting-edit summary{cursor:pointer;color:var(--muted);font-size:.85rem}
.meeting-edit form{margin-top:.6rem}

/* The video call. A grid of whoever is sending video, with your own
   picture small in the corner — the usual arrangement, because anything
   else makes people hunt for the thing they expect. */
.wp-video{position:relative;margin-top:1rem;background:#111;border-radius:8px;padding:.5rem}
.wp-remotes{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:.5rem;min-height:180px}
.wp-tile{position:relative;background:#000;border-radius:6px;overflow:hidden;aspect-ratio:16/9}
.wp-tile video{width:100%;height:100%;object-fit:cover;display:block}
.wp-self{position:absolute;right:1rem;bottom:1rem;width:160px}
.wp-self video{width:100%;border-radius:6px;background:#000;display:block;
  /* Mirrored, because an unmirrored preview of yourself reads as wrong to
     everybody who has ever used a mirror. Only the preview: what is sent
     is not flipped. */
  transform:scaleX(-1)}
.wp-video-actions{display:flex;gap:.3rem;margin-top:.3rem;justify-content:flex-end}
.wp-video-opt{margin-top:.6rem}
@media (max-width:600px){
  .wp-self{position:static;width:auto;margin-top:.5rem}
}

/* Tabs without script.
   A radio per tab, its label styled as the tab, and the panel shown by a
   sibling selector. They work before any JavaScript has run, and because
   the radios are inside the form the browser keeps the open tab across an
   htmx swap — which a scripted version would lose on every save. */
.tabs{margin-top:.8rem}
.tabs > input[type=radio]{position:absolute;opacity:0;pointer-events:none}
.tabs > label{display:inline-block;padding:.45rem .85rem;margin:0;cursor:pointer;
  border-bottom:2px solid transparent;color:var(--ink-3);font-size:13.5px;font-weight:500}
.tabs > label:hover{color:var(--ink)}
.tabs > input[type=radio]:checked + label{color:var(--brand);
  border-bottom-color:var(--brand);font-weight:500}
.tabs > input[type=radio]:focus-visible + label{outline:2px solid var(--brand);outline-offset:2px}
.tab-panel{display:none;padding:1rem 0 .2rem;border-top:1px solid var(--line);margin-top:-2px}
/* Each radio shows the panel that many siblings along, one rule per
   position, so a page can have as many tabs as there are rules. There
   were five rules and seven agent tabs: Recent calls and Messages opened
   blank. Twelve now, and a test fails when a page outgrows them. */
.tabs > input:nth-of-type(1):checked ~ .tab-panel:nth-of-type(1),
.tabs > input:nth-of-type(2):checked ~ .tab-panel:nth-of-type(2),
.tabs > input:nth-of-type(3):checked ~ .tab-panel:nth-of-type(3),
.tabs > input:nth-of-type(4):checked ~ .tab-panel:nth-of-type(4),
.tabs > input:nth-of-type(5):checked ~ .tab-panel:nth-of-type(5),
.tabs > input:nth-of-type(6):checked ~ .tab-panel:nth-of-type(6),
.tabs > input:nth-of-type(7):checked ~ .tab-panel:nth-of-type(7),
.tabs > input:nth-of-type(8):checked ~ .tab-panel:nth-of-type(8),
.tabs > input:nth-of-type(9):checked ~ .tab-panel:nth-of-type(9),
.tabs > input:nth-of-type(10):checked ~ .tab-panel:nth-of-type(10),
.tabs > input:nth-of-type(11):checked ~ .tab-panel:nth-of-type(11),
.tabs > input:nth-of-type(12):checked ~ .tab-panel:nth-of-type(12){display:block}
.agent textarea.mono{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.85rem}
.topics .did-add{align-items:flex-end}

/* Looking at somebody else's pages.
   Deliberately loud and full width. The failure this guards against is an
   administrator forgetting they are in it and reading a page as though it
   were their own, so it has to be impossible to overlook and the way out
   has to be in it. */
.viewing-banner{
  display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.6rem 1rem;background:var(--warn-bg);color:var(--warn);
  border-bottom:2px solid var(--warn);font-size:.9rem;
}
.viewing-banner strong{font-weight:600}

/* ── call flow diagram ──────────────────────────────────────────────── */
/* Server-rendered SVG. Colours come from the same variables as the rest
   of the portal so the diagram follows the theme rather than carrying its
   own palette around. */
.flow-card { overflow-x: auto; }
.flow { max-width: 100%; height: auto; display: block; }

.flow-node rect {
  fill: var(--card, #fff);
  stroke: var(--line, #d7dbe0);
  stroke-width: 1.5;
}
.flow-node .flow-label  { font-size: 13px; font-weight: 600; fill: var(--ink, #1c2126); }
.flow-node .flow-detail { font-size: 11px; fill: var(--muted, #6b7580); }

.flow-node.entry rect { fill: var(--accent-soft, #eef4ff); stroke: var(--accent, #2f6fdb); }
.flow-node.agent rect { stroke: var(--accent, #2f6fdb); stroke-dasharray: 5 3; }
.flow-node.term  rect { fill: var(--soft, #f5f7f9); }
.flow-node.end   rect { fill: var(--soft, #f5f7f9); stroke-dasharray: 3 3; }
/* The one that matters: a destination that no longer exists. A call
   reaching it is cut off, and this is the whole reason to look at the
   page. */
.flow-node.bad rect   { fill: #fdeceb; stroke: #c0392b; stroke-width: 2; }
.flow-node.bad .flow-label { fill: #91251a; }

.flow-line {
  fill: none;
  stroke: var(--line-strong, #9aa4b0);
  stroke-width: 1.5;
}
.flow-line.loop { stroke-dasharray: 4 4; }
.flow-arrow { fill: var(--line-strong, #9aa4b0); }
.flow-edge-label {
  font-size: 10.5px;
  fill: var(--muted, #6b7580);
  paint-order: stroke;
  stroke: var(--card, #fff);
  stroke-width: 3px;
}

.flow-steps { margin: 0; padding-left: 1.3rem; }
.flow-steps li { margin: 0.25rem 0; }
.flow-steps .muted { margin-left: 0.4rem; }

.problems { border-left: 3px solid #c0392b; }
.problems ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

@media (prefers-color-scheme: dark) {
  .flow-node.bad rect { fill: #3b1f1c; stroke: #e06a5c; }
  .flow-node.bad .flow-label { fill: #f3b4ac; }
}

/* Platform page. The key, when it is on screen, is meant to be selected
   and copied in one go — so it is big, monospaced and on its own line
   rather than wrapped into a sentence where half of it gets missed. */
.key-reveal code{
  display:block;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:1.05rem;letter-spacing:.02em;word-break:break-all;
  padding:.6rem .7rem;margin:.4rem 0;border-radius:6px;
  background:var(--card-2,#f4f6f8);border:1px solid var(--line,#dde3e8);
  user-select:all;
}
.key-form{max-width:32rem}
dl.facts{display:grid;gap:.35rem;margin:.6rem 0 1rem}
dl.facts>div{display:flex;gap:.6rem;align-items:baseline}
dl.facts dt{min-width:10rem;color:var(--muted,#667);font-size:.85rem}
dl.facts dd{margin:0}

/* The installer's output, read back after the fact. Monospaced and
   scrolled rather than wrapped: these lines are column-aligned, and a
   wrapped one is harder to read than a clipped one. */
pre.log{
  max-height:22rem;overflow:auto;white-space:pre;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.78rem;
  line-height:1.45;padding:.6rem .7rem;border-radius:6px;
  background:var(--card-2,#f4f6f8);border:1px solid var(--line,#dde3e8);
}
.card.staged{margin:.8rem 0;border-left:3px solid var(--ok,#2a7)}
details.rollback,details.runlog{margin-top:.9rem}
details.rollback summary,details.runlog summary{cursor:pointer;font-size:.9rem}

/* The per-handset button editor, in front of the page rather than
   somewhere below the table. */
dialog.editor-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
  overflow: auto;
}
dialog.editor-dialog::backdrop { background: rgba(15, 23, 42, .45); }
dialog.editor-dialog > div > .card { margin: 0; box-shadow: none; }
dialog.editor-dialog .meeting-head { position: relative; }
dialog.editor-dialog .dialog-close { position: absolute; top: 0; right: 0; }

/* The "Saved" notice. Small, bottom right, gone in two seconds. */
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--side);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
  z-index: 1000;
}
#toast.show { opacity: 1; transform: none; }

/* An agent call's transcript, under its recording. */
pre.transcript {
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
  margin: 6px 0 0;
}

/* A link to copy, with its button beside it. */
.copy-row{display:flex;gap:.5rem;align-items:center}
.copy-row input{flex:1;min-width:0}

/* ── page patterns: slide-over, edit rows, stats, filters, play ───────── */

/* A panel that slides in from the right, for a form that is used now and
   then and should not sit open on the page all the time. A checkbox opens
   it, the same as the menu drawer, so it works before any script does. */
.overtoggle,.edittoggle{position:absolute;opacity:0;pointer-events:none;width:0;height:0;margin:0}
.over-scrim{display:none;position:fixed;inset:0;z-index:70;margin:0;background:rgb(19 42 58 / .35)}
.over{
  position:fixed;top:0;right:0;z-index:71;height:100vh;width:440px;max-width:100vw;
  background:var(--surface);box-shadow:-12px 0 40px rgba(19,42,58,.18);
  display:flex;flex-direction:column;
  transform:translateX(105%);visibility:hidden;transition:transform .2s ease-out,visibility .2s;
}
.over.wide{width:620px}
.overtoggle:checked ~ .over-scrim{display:block}
.overtoggle:checked ~ .over{transform:none;visibility:visible}
.overtoggle:focus-visible ~ .head label[for]{outline:2px solid var(--brand);outline-offset:2px}
.over > form{display:flex;flex-direction:column;flex:1;min-height:0}
.over-h{display:flex;align-items:center;gap:10px;padding:16px 22px;border-bottom:1px solid var(--rule)}
.over-h h2{margin:0;font-size:17px}
.over-h .btn{margin-left:auto}
.over-b{flex:1;overflow-y:auto;padding:20px 22px}
.over-b .card{box-shadow:none}
.over-f{display:flex;gap:8px;justify-content:flex-end;padding:14px 22px;border-top:1px solid var(--rule)}
@media (prefers-reduced-motion:reduce){.over{transition:none}}

/* Choosing a role: each one a card with what it means written on it, so
   the explanation is where the choice is rather than in a list below. */
.field-label{font-size:12.5px;font-weight:500;color:var(--ink-2);margin-bottom:6px}
.rolepick{display:grid;gap:8px;margin-bottom:14px}
.rolepick label{display:flex;gap:10px;align-items:flex-start;margin:0;padding:12px;border:1px solid var(--rule);border-radius:10px;cursor:pointer}
.rolepick label:hover{border-color:var(--field-rule)}
.rolepick label:has(input:checked){border-color:var(--brand);background:var(--brand-wash)}
.rolepick input{margin-top:3px}
.rolepick b{display:block;font-size:13.5px;color:var(--ink)}
.rolepick small{display:block;font-size:12.5px;font-weight:400;color:var(--ink-3)}

/* A name with its detail underneath, in one cell. */
td.ident b{display:block;font-weight:600}
td.ident span{display:block;color:var(--ink-3);font-size:12.5px}
td.narrow{width:1%}
.rowact{display:flex;gap:4px;justify-content:flex-end;align-items:center}
.rowact form{margin:0}

/* A row's settings, closed until its Edit button opens them. The button
   is a label for a hidden checkbox in the row; the row after it shows
   while that box is ticked. A save redraws the table, which closes it. */
.edittoggle:checked + label{background:var(--brand-wash);color:var(--accent-ink)}
.edittoggle:focus-visible + label{outline:2px solid var(--brand);outline-offset:2px}
tr.edit{display:none}
tr:has(.edittoggle:checked) + tr.edit{display:table-row}
tr.edit > td,tbody tr.edit:hover > td{background:var(--surface-2);padding-top:16px;padding-bottom:16px}
.edit-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end}
.edit-actions{flex-wrap:wrap}
.edit-actions .check{margin:0}
.grow{flex:1}

/* One line of help across the foot of a card. */
.card > .help{margin:0 -20px -18px;padding:12px 20px;border-top:1px solid var(--rule);color:var(--ink-3);font-size:13px}

.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:16px}
.card.stat{padding:14px 16px;margin:0}
.stat b{display:block;font-size:22px;font-weight:700;letter-spacing:-.02em}
.stat span{color:var(--ink-3);font-size:12.5px}

/* A filter bar: a search box with its icon in it, and a segmented choice. */
.card.filters-card{padding:12px 16px}
.filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.filters > *{margin:0}
.search{
  flex:1;min-width:220px;display:flex;align-items:center;gap:8px;margin:0;padding:0 10px;
  border:1px solid var(--field-rule);border-radius:9px;background:var(--field);color:var(--ink-3);
}
.search:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px rgba(0,173,181,.18)}
.search input[type=search]{border:0;margin:0;padding:8px 0;background:none;box-shadow:none;outline:none}
.seg{display:inline-flex;background:var(--surface-2);border-radius:9px;padding:3px}
.seg label{margin:0;cursor:pointer}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg span{display:block;padding:5px 11px;border-radius:7px;font-size:12.5px;font-weight:500;color:var(--ink-2)}
.seg label:has(input:checked) span{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(19,42,58,.12)}
.seg label:has(input:focus-visible) span{outline:2px solid var(--brand);outline-offset:1px}

/* Which way a call went, as a small tile. */
.dir{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:8px;background:var(--brand-wash);color:var(--accent-ink)}
.dir .ic{width:15px;height:15px}
.dir.out{background:#eef1fb;color:#3c55a5}
.dir.int{background:var(--surface-2);color:var(--ink-2)}
@media (prefers-color-scheme:dark){.dir.out{background:#1d2a4a;color:#9fb3f0}}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* A recording's play button, a bar to jump with, and the time. */
.play{
  display:inline-flex;align-items:center;gap:8px;padding:3px 10px 3px 4px;
  border:1px solid var(--rule);border-radius:999px;background:var(--surface);font-size:12.5px;white-space:nowrap;
}
.play-btn{
  width:22px;height:22px;border-radius:50%;border:0;padding:0;cursor:pointer;
  background:var(--brand);color:#fff;display:grid;place-items:center;
}
.play-btn::before{content:"";margin-left:2px;border-left:7px solid currentColor;border-top:4.5px solid transparent;border-bottom:4.5px solid transparent}
.play.on .play-btn::before{margin:0;width:8px;height:9px;border:0;border-left:2.5px solid currentColor;border-right:2.5px solid currentColor}
.play-bar{width:60px;height:4px;border-radius:2px;background:var(--surface-2);cursor:pointer;overflow:hidden}
.play-bar i{display:block;height:100%;width:0;background:var(--brand)}
.play-time{font-variant-numeric:tabular-nums;color:var(--ink-2);min-width:2.6em}
.play.err .play-btn{background:var(--ink-3);cursor:default}
.play audio{display:none}

/* Buttons that each open a small form beneath them, the buttons staying
   in one row. Each is a label for a hidden checkbox, the same as the Edit
   buttons, and a save redraws the list, which closes them. */
.adders{margin:14px 0}
.addtoggle{position:absolute;opacity:0;pointer-events:none;width:0;height:0;margin:0}
.adder-buttons{display:flex;flex-wrap:wrap;gap:8px}
.adders > form{display:none;margin-top:10px;padding:12px 14px;background:var(--surface-2);border-radius:var(--radius-sm)}
.adders > input:nth-of-type(1):checked ~ form:nth-of-type(1),
.adders > input:nth-of-type(2):checked ~ form:nth-of-type(2),
.adders > input:nth-of-type(3):checked ~ form:nth-of-type(3){display:flex}
.adders > input:nth-of-type(1):checked ~ .adder-buttons label:nth-of-type(1),
.adders > input:nth-of-type(2):checked ~ .adder-buttons label:nth-of-type(2),
.adders > input:nth-of-type(3):checked ~ .adder-buttons label:nth-of-type(3){
  background:var(--brand-wash);color:var(--accent-ink);border-color:var(--brand);
}
.adders > input:nth-of-type(1):focus-visible ~ .adder-buttons label:nth-of-type(1),
.adders > input:nth-of-type(2):focus-visible ~ .adder-buttons label:nth-of-type(2),
.adders > input:nth-of-type(3):focus-visible ~ .adder-buttons label:nth-of-type(3){
  outline:2px solid var(--brand);outline-offset:2px;
}
.days{display:flex;flex-wrap:wrap;gap:4px}
.days .check{padding:4px 8px;border:1px solid var(--rule);border-radius:7px;background:var(--surface);font-size:12.5px;gap:5px}
.days .check:has(input:checked){border-color:var(--brand);background:var(--brand-wash)}

/* Long help, cut to its first line with a More beside it. The page's
   script does the cutting, so without it every note is shown in full. */
.note.clamp{display:flex;gap:10px;align-items:baseline}
.note.clamp > .note-text{flex:1;min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1;overflow:hidden}
.note.clamp.open > .note-text{display:block;-webkit-line-clamp:unset}
.note-more{flex:none;background:none;border:0;padding:0;font:inherit;font-weight:500;color:var(--accent-ink);cursor:pointer}
.note-more:hover{text-decoration:underline}

/* ── two-step sign-in ─────────────────────────────────────────────────── */
.setup-steps{padding-left:1.2em;margin:0}
.setup-steps > li{margin:0 0 16px;max-width:60ch}
.setup-steps .qr{margin:10px 0 6px}
.setup-steps .qr img{display:block;border-radius:8px;background:#fff;padding:8px;border:1px solid var(--rule)}
code.secret{font-size:13px;letter-spacing:.06em;user-select:all}
.recovery-codes{list-style:none;padding:0;margin:12px 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px;max-width:520px}
.recovery-codes li{background:var(--surface-2);border-radius:8px;padding:8px 10px;text-align:center}
.recovery-codes code{font-size:14px;letter-spacing:.04em;user-select:all}

/* A reseller's branding (whitelabel.go): its logo or name in the menu
   and on the sign-in page, and its support details above the menu's foot. */
.brand .brand-logo{height:28px;width:auto;max-width:180px;display:block}
.brand .brand-name{font-weight:600;font-size:17px;color:#fff;letter-spacing:-.01em}
.signin-head .signin-logo{display:block;max-width:230px;max-height:90px;margin:0 auto .6rem}
.signin-head .signin-name{margin:0 0 .4rem;color:var(--brand)}
.signin-provider{text-align:center;margin-top:1rem}
.brand-support{margin:8px 10px;padding:10px 12px;border-radius:var(--radius-sm);background:var(--side-2);
  color:var(--side-ink-2);font-size:12.5px;display:flex;flex-direction:column;gap:2px}
.brand-support b{color:var(--side-ink)}
.brand-support a{color:var(--side-ink);text-decoration:none}
.brand-support a:hover{text-decoration:underline}
.brand-support small{color:var(--side-ink-3);margin-top:4px}
