/* Ackora CX - Customer Experience Platform
   Developed by Ackora.
   Copyright (c) 2026 Ackora. All rights reserved.
   Author: Jonathon Loya Alarcon. Proprietary - see LICENSE and NOTICE.
   Removal of this notice is a license violation and fails the build.
   Console design tokens shared with the PSTN Relay, Fax Server and POTS Verifier consoles. Strict CSP: this file
   is the only stylesheet; no inline style attributes. */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --panel-2: #f0f2f5; --text: #1b1f24; --muted: #5d6673;
  --border: #dde1e6; --accent: #1f5fd1; --accent-text: #ffffff;
  --ok: #1a7f45; --ok-bg: #e3f4ea; --warn: #9a6200; --warn-bg: #fdf1dc; --bad: #b42318; --bad-bg: #fde8e7;
  --info: #1f5fd1; --info-bg: #e5edfb; --neutral-bg: #eceef1; --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111418; --panel: #181c21; --panel-2: #20252c; --text: #e7eaee; --muted: #98a2ae; --border: #2c323a;
    --accent: #5b8def; --accent-text: #0b0e12; --ok: #5cc98a; --ok-bg: #173324; --warn: #e7b35a; --warn-bg: #3a2c12;
    --bad: #f07b72; --bad-bg: #3d1a18; --info: #7ea6f2; --info-bg: #1b2a44; --neutral-bg: #262b32; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111418; --panel: #181c21; --panel-2: #20252c; --text: #e7eaee; --muted: #98a2ae; --border: #2c323a;
  --accent: #5b8def; --accent-text: #0b0e12; --ok: #5cc98a; --ok-bg: #173324; --warn: #e7b35a; --warn-bg: #3a2c12;
  --bad: #f07b72; --bad-bg: #3d1a18; --info: #7ea6f2; --info-bg: #1b2a44; --neutral-bg: #262b32; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
/* The footer standard (rule 2.8): a flex column at least the viewport tall; the sign-in area (and the console
   shell) take what the footer leaves, so the footer stays on screen at 375x812 however many lines it wraps to.
   Never subtract a footer height from 100vh. */
body { display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 20px; font-weight: 600; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gap8 { gap: 8px; } .mt16 { margin-top: 16px; } .mt8 { margin-top: 8px; } .grow { flex: 1; } .spacer { flex: 1; }
.wrap { overflow-x: auto; }
.break { word-break: break-all; }

/* shell */
.shell { flex: 1 0 auto; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--border); padding: 18px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.brand-name { font-weight: 600; line-height: 1.15; } .brand-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.nav-toggle { display: none; margin-left: auto; }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); }
nav a:hover { background: var(--panel-2); }
nav a.active { background: var(--info-bg); color: var(--info); font-weight: 600; }
.nav-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 14px 10px 4px; }
.sidebar-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); display: grid; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.health { display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; font-size: 12.5px; }
main { padding: 22px 28px 48px; min-width: 0; }
footer.attrib { flex: 0 0 auto; text-align: center; color: var(--muted); font-size: 11.5px; padding: 12px 16px; }

/* page */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card + .card, .grid + .card, .card + .grid { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 12px; } .tile .v { font-size: 22px; font-weight: 600; margin-top: 2px; }
.tile .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--panel-2); }
td.num { font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 18px; text-align: center; }

/* badges, buttons */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--neutral-bg); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
button, .btn { font: inherit; font-size: 13.5px; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
button:hover { background: var(--panel-2); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); background: var(--panel); }
button.sm { padding: 4px 9px; font-size: 12.5px; }
button:disabled { opacity: .55; cursor: default; }

/* forms */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.field textarea { min-height: 76px; resize: vertical; }
.field textarea.tall { min-height: 160px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 3px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding-top: 22px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks .check { padding-top: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.filters input, .filters select { font: inherit; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.error { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }
.warnings { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.warnings:empty { display: none; }

/* sign-in */
.login { flex: 1 0 auto; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(420px, 100%); padding: 24px; }
.login .brand { padding: 0 0 16px; }
.login .field + .field { margin-top: 10px; }
.login-alt { margin-top: 12px; text-align: center; }
.login-alt .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
#auth-panel h2 { margin-bottom: 10px; }
#auth-panel .field + .field { margin-top: 10px; }

/* dialog */
dialog { width: 780px; max-width: 94vw; border: 1px solid var(--border); border-radius: 10px; padding: 0; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dialog-body { padding: 16px 18px; max-height: 70vh; overflow: auto; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.secret { font-family: var(--mono); font-size: 15px; padding: 12px; background: var(--panel-2); border-radius: 6px; word-break: break-all; }

/* personas */
.dept { margin-top: 16px; }
.dept:first-child { margin-top: 0; }
.persona-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.persona-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--panel); cursor: pointer; }
.persona-card:hover { background: var(--panel-2); }
.persona-card .pname { font-weight: 600; font-size: 15px; }
.persona-card .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.prewrap { white-space: pre-wrap; }

/* transcripts */
.transcript { display: grid; gap: 10px; }
.turn { border-left: 3px solid var(--border); padding: 4px 0 4px 12px; }
.turn.user { border-left-color: var(--info); }
.turn.assistant { border-left-color: var(--ok); }
.turn.notice { border-left-color: var(--warn); }
.turn .who { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.turn .said { margin-top: 2px; white-space: pre-wrap; }
.turn .unsaid { color: var(--muted); text-decoration: line-through; }
.turn .timings { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.liveview { max-height: 40vh; overflow: auto; font-family: var(--mono); font-size: 12px; }
.liveview div { padding: 2px 0; border-bottom: 1px dashed var(--border); white-space: pre-wrap; word-break: break-word; }

/* logs */
.logbox { max-height: 68vh; overflow: auto; font-family: var(--mono); font-size: 12.5px; }
.logline { padding: 3px 0; border-bottom: 1px solid var(--border); white-space: pre-wrap; word-break: break-word; }
.logline .tm { color: var(--muted); margin-right: 8px; }
.lv { display: inline-block; min-width: 62px; font-weight: 600; margin-right: 6px; }
.lv.DEBUG { color: var(--muted); } .lv.INFO { color: var(--info); } .lv.WARNING { color: var(--warn); } .lv.ERROR, .lv.CRITICAL { color: var(--bad); }
audio { width: 100%; max-width: 420px; }

/* toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 420px; }
.toast.error { background: var(--bad); color: #fff; }

/* the shared libraries' fragments (ackora-users 1.1: Testers, two-factor sign-in) */
.form-error { grid-column: 1 / -1; color: var(--bad); font-size: 13px; }
.form-error:empty { display: none; }
.form-error ul { margin: 4px 0 0; padding-left: 18px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 16px; border-radius: var(--radius);
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); font-size: 13px; }
.banner.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
body > #ackora-env-banner { margin: 0; border-radius: 0; border-width: 0 0 1px; justify-content: center; flex: 0 0 auto; }
.subform { padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); }
.subform h3 { margin-bottom: 8px; }
.subform .check + .check { margin-top: 6px; }
.radios { display: grid; gap: 6px; }
.radios .check, .check.full, .subform .check, .full > .check, .form > .check.full { padding-top: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.m0 { margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
input[readonly] { color: var(--muted); }
td .actions button, td .actions .btn { padding: 4px 9px; font-size: 12.5px; }
.tester-banner { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn); }
.tester-banner strong { letter-spacing: .06em; }
.shell > .ackora-role-banner { grid-column: 1 / -1; margin: 0; border-radius: 0; border-width: 0 0 1px; }
.qr { display: inline-grid; place-items: center; background: #ffffff; padding: 12px; border-radius: 6px;
  border: 1px solid var(--border); min-width: 224px; min-height: 224px; }
.qr svg { display: block; width: 200px; height: 200px; }
.mfa-enrol ol { margin: 0 0 4px; padding-left: 18px; }
.mfa-enrol .secret { margin-top: 8px; letter-spacing: .08em; }
.form textarea { width: 100%; font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--text); min-height: 70px; }

/* persona studio (v0.2): avatars, voice samples, training, guidance, the conversation player */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.strong { font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }
.lint { margin: 6px 0 0; padding-left: 18px; color: var(--text); }
.note { color: var(--muted); font-size: 12px; }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; vertical-align: middle;
  background: #5d6673; color: #ffffff; font-weight: 600; line-height: 1; user-select: none; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar.has-img { background: var(--panel-2); }
.avatar-96 { width: 96px; height: 96px; font-size: 36px; }
.avatar-32 { width: 32px; height: 32px; font-size: 13px; }
/* The monogram's colour comes from the department (white text, each at least 4.5:1). */
.avatar.dept-SAL { background: #9a3412; } .avatar.dept-ONB { background: #6d28d9; } .avatar.dept-SUP { background: #1d4ed8; }
.avatar.dept-PM { background: #0f766e; } .avatar.dept-SVC { background: #15803d; } .avatar.dept-TEC { background: #be123c; }
.avatar.dept-NOC { background: #334155; }
.avatar.has-img.dept-SAL, .avatar.has-img.dept-ONB, .avatar.has-img.dept-SUP, .avatar.has-img.dept-PM, .avatar.has-img.dept-SVC,
.avatar.has-img.dept-TEC, .avatar.has-img.dept-NOC { background: var(--panel-2); }
.identity-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.identity-head .grow { min-width: 160px; }
.avatar-pick { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.avatar-pick .field { min-width: 0; }
.avatar-pick input[type=file] { max-width: 100%; }
.persona-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.persona-card .row { flex-wrap: nowrap; } .persona-card .pname { min-width: 0; overflow-wrap: anywhere; }
.thumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.thumb-link { display: inline-flex; border-radius: 50%; }
fieldset.seg { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.seg legend { padding: 0; margin-bottom: 4px; font-size: 12.5px; font-weight: 600; }
.seg-opts { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.opt input[type=radio], .opt input[type=checkbox], .field .opt input[type=radio], .field .opt input[type=checkbox] { width: auto; flex: none; margin: 0; }
.opt.disabled { color: var(--muted); cursor: default; }
.opt select { font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); }
.opt.attest { align-items: flex-start; }
.opt.attest input { margin-top: 3px; flex: none; }
.sample { display: grid; gap: 10px; }
.sample h3 { margin: 0; }
.sample .banner, .convo .banner { margin: 0; }
.sample audio, .convo audio { width: 100%; max-width: none; }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 2px; }
.field textarea[rows] { min-height: 0; }
/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs [role="tab"] { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 12px; color: var(--muted); white-space: nowrap; }
.tabs [role="tab"]:hover { background: var(--panel-2); }
.tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabpanel:focus { outline: none; }
.tabpanel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* the training conversation: the admin (as the customer) on the right, the persona on the left */
.chat { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: min(760px, 92%); min-width: 0; }
.msg.admin { align-self: flex-end; }
.msg.persona { align-self: flex-start; display: flex; gap: 10px; align-items: flex-start; }
.msg-body { min-width: 0; flex: 1; }
.bubble { padding: 8px 12px; border-radius: 12px; overflow-wrap: anywhere; }
.msg.admin .bubble { background: var(--info-bg); border-bottom-right-radius: 3px; }
.msg.persona .bubble { background: var(--panel-2); border-bottom-left-radius: 3px; }
.msg .who { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 2px; }
.msg .said { white-space: pre-wrap; }
.msg.tool { align-self: flex-start; margin-left: 42px; padding-left: 8px; border-left: 2px solid var(--border);
  font-family: var(--mono); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.msg.pending { opacity: .65; }
.msg-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.msg-tools button[aria-pressed="true"] { background: var(--info-bg); border-color: var(--info); color: var(--info); }
.metrics { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.typing { font-size: 12.5px; color: var(--muted); }
.fb-list { display: grid; gap: 4px; margin-top: 6px; }
.fb-list:empty { display: none; }
.fb-item { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fb-text { color: var(--text); overflow-wrap: anywhere; }
.fb-form { margin-top: 8px; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); display: grid; gap: 10px; background: var(--panel); }
.fb-form .form { margin: 0; }
details.pron summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.composer { display: grid; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.composer textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); min-height: 60px; resize: vertical; }
.composer .hint { color: var(--muted); font-size: 12px; }
.ptt { touch-action: none; user-select: none; -webkit-user-select: none; }
.ptt[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #ffffff; }
/* review queues and replay */
.queue { display: grid; gap: 12px; }
.case, .replay { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; min-width: 0; }
.ctx { display: grid; gap: 3px; font-size: 13px; overflow-wrap: anywhere; }
.ctx .speaker { font-weight: 600; color: var(--muted); }
.expected { background: var(--ok-bg); border: 1px solid var(--ok); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; }
.said-was { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; }
.msg.persona.notice .bubble { border: 1px dashed var(--border); }
.doc { white-space: pre-wrap; background: var(--panel-2); border-radius: 6px; padding: 10px 12px; max-height: 50vh; overflow: auto; overflow-wrap: anywhere; }
.doc.clip { max-height: 160px; }
.refs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.replay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.replay-cell { border: 1px solid var(--border); border-radius: 6px; padding: 10px; min-width: 0; display: grid; gap: 6px; align-content: start; overflow-wrap: anywhere; }
.replay-cell.expected { background: var(--ok-bg); border-color: var(--ok); }
.replay-cell.failed { border-color: var(--bad); }
/* the call page's Conversation player */
.convo { display: grid; gap: 8px; }
.convo .card-head { margin-bottom: 2px; }
.convo-controls { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.caption { padding: 8px 10px; border-radius: 6px; background: var(--panel-2); min-height: 2.8em; overflow-wrap: anywhere; }
.turn .seek { padding: 0 7px; font-size: 11px; line-height: 18px; }
.turn.current { background: var(--info-bg); border-left-color: var(--accent); }

/* persona roster (v0.2.1): names, the routing editor, live calls */
.mb10 { margin-bottom: 10px; } .mt4 { margin-top: 4px; }
.stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
ol.steps { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
ol.rotation { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; counter-reset: rot; }
ol.rotation li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; counter-increment: rot; min-width: 0; }
ol.rotation li::before { content: counter(rot) "."; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.5em; }
.badge.live { background: var(--ok-bg); color: var(--ok); }
.badge.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  margin-right: 5px; vertical-align: 1px; animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .badge.live::before { animation: none; } }
h1 .live-slot .badge { vertical-align: middle; font-weight: 600; }
.live-slot:empty { display: none; }
.persona-card .meta:has(> .live-slot:empty) { display: none; }
ul.live-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.live-chip { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; }
.live-chip .grow { min-width: 0; }
.live-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }

/* persona voices (v0.2.2): the Voice section, voice design, the freeze dialog, the gates, the Voices page */
.badge.wrap { white-space: normal; text-align: left; line-height: 1.35; overflow-wrap: anywhere; }
.voice-now { display: grid; gap: 10px; }
.voice-now .banner { margin: 0; flex-wrap: wrap; }
.voice-plays { display: grid; gap: 6px; }
.voice-plays audio, .cand audio, .cand-summary audio, .attest-qs audio { width: 100%; max-width: none; }
ul.gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gate { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.gate-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.gate .warnings { margin: 0; }
ol.gate-lines { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
ul.plain { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
details > summary { cursor: pointer; }
.design .form { margin: 0; }
.candidates h3 { margin-bottom: 8px; }
.round + .round { margin-top: 14px; }
.round h3 { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.round h3:focus, .card h2[tabindex]:focus { outline: none; }
.round h3:focus-visible, .card h2[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cand { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; align-content: start; min-width: 0; overflow-wrap: anywhere; }
.cand.in-use { border-color: var(--ok); background: var(--ok-bg); }
.attest-qs { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.attest-qs h3 { margin: 0; }
.attest-qs fieldset.seg legend { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.attest-qs .warnings { margin: 0; }
button[aria-busy="true"] { opacity: .7; cursor: progress; }
progress { display: block; width: 100%; height: 10px; accent-color: var(--accent); }
ul.job-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
ul.job-items li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-width: 0; }
.filters .opt { font-size: 13px; }

/* notice templates and voice tuning (v0.2.3): the editor's slot chips, rule checks and counters, the version diff, the
   voice-settings sliders and the A/B preview, unfreezable candidates */
.banner.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.slot-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
button.chip { font-family: var(--mono); font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--info-bg); color: var(--info); border-color: var(--info); }
button.chip:hover { background: var(--panel-2); }
.field textarea.notice-text { min-height: 150px; line-height: 1.5; }
.counters { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.counters .warn { color: var(--warn); font-weight: 600; } .counters .bad { color: var(--bad); font-weight: 600; } .counters .good { color: var(--ok); }
.checks-box { min-height: 20px; }
.rule-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.rule-list li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.rule-list li.err { color: var(--bad); } .rule-list li.warn { color: var(--warn); }
.rule-id { font-family: var(--mono); font-size: 11.5px; padding: 0 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); flex: none; }
.bad-text { color: var(--bad); } .good-text { color: var(--ok); }
.diff { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel-2); border-radius: 6px; padding: 10px 12px; line-height: 1.7; }
.diff ins { background: var(--ok-bg); color: var(--ok); text-decoration: underline; text-decoration-thickness: 2px; }
.diff del { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
.diff ins, .diff del { padding: 0 2px; border-radius: 3px; }
.diff del + ins, .diff ins + del { margin-left: 3px; }
.actions.wrap-ok { flex-wrap: wrap; white-space: normal; }
.voice-settings .form { margin-top: 4px; }
.slider { display: grid; gap: 2px; align-content: start; min-width: 0; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.field.slider .slider-head label { margin-bottom: 0; }
.slider output { font-size: 13px; font-variant-numeric: tabular-nums; }
.field.slider input[type=range] { width: 100%; padding: 0; border: 0; background: none; accent-color: var(--accent); margin: 4px 0 0; }
.slider-ends { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); }
/* review fix 2026-10-13: the "Natural pause" checkbox sits beside its words (.field label / .field input would make
   the label a block and stretch the box across the column) */
.field.slider label.check { display: flex; align-items: center; gap: 8px; padding-top: 0; margin: 2px 0 0; font-weight: 400; font-size: 13px; }
.field.slider label.check input[type=checkbox] { width: auto; flex: none; margin: 0; padding: 0; }
.ab-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ab audio { width: 100%; max-width: none; }
.cand.unfreezable { border-style: dashed; border-color: var(--bad); }

/* identity editing (v0.2.4): the rename's publish choice, "Callers still hear …", the gender dialog's numbered steps,
   and the prompt to design a voice after a gender change */
.banner.heard, .banner.design-prompt { flex-wrap: wrap; }
.banner .grow { min-width: 0; overflow-wrap: anywhere; }
.publish-choice { display: grid; gap: 6px; }
.publish-choice .opt, .gender-step .opt { align-items: flex-start; }
.publish-choice .opt input, .gender-step .opt input[type=checkbox] { margin-top: 3px; }
.gender-step { display: grid; gap: 8px; min-width: 0; padding-top: 10px; border-top: 1px solid var(--border); }
.gender-step h3 { margin: 0; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--text); }
.gender-step .subform { margin-top: 2px; }
ul.consequences { margin: 0; padding-left: 20px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.design-prompt-box:empty { display: none; }
.design-prompt-box .banner { margin: 0 0 10px; }

@media (max-width: 960px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
/* Phones (375x812): the sidebar becomes a top bar whose menu folds away; one column everywhere. */
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand { padding: 0; }
  .nav-toggle { display: inline-block; }
  nav, .sidebar-foot { display: none; }
  .sidebar.open nav { display: flex; margin-top: 10px; }
  .sidebar.open .sidebar-foot { display: grid; margin-top: 10px; }
  .nav-group { padding-top: 8px; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .form { grid-template-columns: 1fr; }
  main { padding: 14px 12px 32px; }
  .login .card { padding: 20px 18px; }
  .page-head .actions { margin-left: 0; }
  .msg { max-width: 100%; }
  .msg.admin { max-width: 92%; }
  .msg.tool { margin-left: 0; }
  .identity-head { gap: 12px; }
  .convo-controls { gap: 8px 14px; }
  /* A stacked table (the departments page): each row a card, each cell captioned by its column (data-label). */
  table.stacked thead { display: none; }
  table.stacked, table.stacked tbody, table.stacked tr, table.stacked td { display: block; width: 100%; }
  table.stacked tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.stacked td { border: 0; padding: 3px 0; }
  table.stacked td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); }
  table.stacked td:first-child::before { display: none; }
}
.dept-cell { flex-wrap: wrap; justify-content: space-between; }
