/* 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:10px; --radius-sm:7px;
  --shadow:0 1px 2px rgba(19,42,58,.06), 0 2px 8px rgba(19,42,58,.05);
  --shadow-lift:0 2px 4px rgba(19,42,58,.08), 0 8px 24px rgba(19,42,58,.08);
}
@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), 0 2px 8px rgba(0,0,0,.25);
    --shadow-lift:0 2px 4px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
  }
}

*{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:15px/1.55 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:238px 1fr;min-height:100vh}

.sidenav{
  display:flex;flex-direction:column;gap:.2rem;
  background:var(--surface);border-right:1px solid var(--rule);
  padding:1rem .75rem .75rem;
  /* 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;
}
.sidenav .brand{padding:.1rem .4rem 1rem}
.sidenav nav{display:flex;flex-direction:column;gap:.1rem;flex:1}

/* Every link in the sidebar, whether loose or inside a group. */
.sidenav nav a{
  display:block;padding:.4rem .55rem;border-radius:var(--radius-sm);
  color:var(--ink-2);text-decoration:none;font-size:.88rem;
}
.sidenav nav a:hover{background:var(--surface-2);color:var(--ink)}
/* 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:var(--brand-wash);color:var(--brand);font-weight:600;
}

/* A group heading. Looks like a label, behaves like a button. */
.navgroup > summary{
  list-style:none;cursor:pointer;
  padding:.4rem .55rem;border-radius:var(--radius-sm);
  font-size:.72rem;font-weight:600;letter-spacing:.07em;text-transform:uppercase;
  color:var(--ink-3);display:flex;align-items:center;gap:.4rem;
}
.navgroup > summary::-webkit-details-marker{display:none}
.navgroup > summary::after{
  content:"";margin-left:auto;width:.42rem;height:.42rem;
  border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;
  transform:rotate(-45deg);transition:transform .15s;opacity:.8;
}
.navgroup[open] > summary::after{transform:rotate(45deg)}
.navgroup > summary:hover{color:var(--ink-2);background:var(--surface-2)}
.navgroup > a{margin-left:.5rem}

/* A loose link that is not in a group sits level with the group headings,
   so the left edge of the list stays straight. */
.sidenav nav .navlink{font-size:.88rem}

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

.sidenav-foot{
  display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;
  padding:.7rem .55rem 0;border-top:1px solid var(--rule);margin-top:.4rem;
}

/* The content column. */
.main-col{min-width:0;display:flex;flex-direction:column}
.topbar{
  display:flex;align-items:center;gap:.75rem;
  padding:.7rem 1.2rem;background:var(--surface);
  border-bottom:1px solid var(--rule);
  position:sticky;top:0;z-index:30;
}
/* The hamburger only exists on a narrow screen. */
.nav-open{display:none;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);
  }
  .nav-open{display:flex}
  /* 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:1100px;width:100%;margin:0 auto;padding:1.6rem 1.4rem 4rem}
.head{display:flex;align-items:flex-start;gap:1rem;margin-bottom:1rem}
.head>div{flex:1}
.head .btn{margin-left:auto}

.card{
  background:var(--surface);border:1px solid var(--rule);
  border-radius:var(--radius);padding:1.1rem 1.25rem;margin-bottom:1rem;
  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.form{border-left:3px solid var(--copper)}
.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}

table{width:100%;border-collapse:collapse;font-size:.9rem}
th{
  text-align:left;font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;
  color:var(--ink-3);padding:.5rem .6rem;border-bottom:1px solid var(--rule);
}
td{padding:.65rem .6rem;border-bottom:1px solid var(--rule);vertical-align:middle}
tbody tr:hover{background:var(--brand-wash)}
tr:last-child td{border-bottom:0}

label{display:block;margin-bottom:.8rem;font-size:.85rem;color:var(--ink-2)}
input[type=text],input[type=email],input[type=password],input[type=number],
input:not([type]){
  display:block;width:100%;margin-top:.25rem;padding:.5rem .6rem;
  background:var(--ground);color:var(--ink);
  border:1px solid var(--rule);border-radius:var(--radius-sm);font:inherit;
}
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{
  display:block;width:100%;margin-top:.25rem;padding:.5rem .6rem;
  background:var(--ground);color:var(--ink);
  border:1px solid var(--rule);border-radius:var(--radius-sm);font:inherit;
  resize:vertical;
}
textarea:focus{outline:2px solid var(--copper);outline-offset:1px}
input:focus{outline:2px solid var(--copper);outline-offset:1px}
label small{display:block;margin-top:.25rem;font-size:.75rem}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:0 1rem}
.checks{display:flex;flex-wrap:wrap;gap:1rem;margin:.4rem 0 1rem}
.check{display:flex;align-items:center;gap:.4rem;margin:0}
.check input{width:auto;margin:0}
.actions{display:flex;gap:.6rem;margin-top:.4rem}
.note{
  background:var(--surface-2);border-radius:var(--radius-sm);padding:.6rem .8rem;
  font-size:.85rem;color:var(--ink-2);margin:0 0 1rem;
}

.btn{
  display:inline-block;padding:.5rem .9rem;border-radius:var(--radius-sm);
  border:1px solid var(--rule);background:var(--surface-2);color:var(--ink);
  font:inherit;font-size:.85rem;cursor:pointer;text-decoration:none;
}
.btn:hover{border-color:var(--brand)}
/* Primary actions are the brand purple, not the cyan. The cyan is an accent
 * and loses its job the moment every button is wearing it. */
.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn.primary:hover{filter:brightness(1.12)}
.btn.small{padding:.3rem .55rem;font-size:.78rem}
.btn.danger{color:var(--danger);border-color:var(--danger)}
button[type=submit]{
  padding:.5rem .9rem;border-radius:var(--radius-sm);border:1px solid var(--brand);
  background:var(--brand);color:#fff;font:inherit;font-weight:500;cursor:pointer;
}
button[type=submit]:hover{filter:brightness(1.12)}
/* One visible focus ring everywhere, in the accent, so keyboard users can
 * see where they are. */
a:focus-visible,button:focus-visible,input:focus-visible,
select:focus-visible,textarea:focus-visible,summary:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;border-radius:3px;
}

.pill{
  display:inline-block;padding:.1rem .45rem;border-radius:10px;
  font-size:.72rem;background:var(--surface-2);color:var(--ink-3);
}
.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)}

.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}

select{
  padding:.35rem .5rem;background:var(--ground);color:var(--ink);
  border:1px solid var(--rule);border-radius:var(--radius-sm);font:inherit;font-size:.85rem;
}
select:focus{outline:2px solid var(--copper);outline-offset:1px}
.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{margin:0;white-space:nowrap}
audio{height:32px;max-width:230px;vertical-align:middle}
h2{margin-top:1.6rem}

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

input[type=time],input[type=date]{
  width:auto;margin:0;padding:.35rem .5rem;background:var(--ground);color:var(--ink);
  border:1px solid var(--rule);border-radius:var(--radius-sm);font:inherit;font-size:.85rem;
}
input[type=file]{margin-top:.25rem;font-size:.85rem}

.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}

/* A hairline of brand colour down the left of every card. Cheap, and it
   stops a page of white boxes looking like anybody's admin panel. */
.card{border-left:3px solid var(--brand-3)}
.card.form{border-left-color:var(--brand)}

/* ── 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:#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:.4rem .8rem;cursor:pointer;
  border-bottom:2px solid transparent;color:var(--muted);font-size:.9rem}
.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. Five tabs, so five
   rules; adding a sixth means adding a rule, which is the cost of not
   using script here. */
.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){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}
