/* Clariwyn: shared styles for every page.
   Look: a deep harbor-teal frame (navigation, sign-in) around quiet, cool working surfaces.
   One typeface (Instrument Sans, self-hosted, SIL OFL) with tabular figures for numbers. */

@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/instrument-sans-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/instrument-sans-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: italic; font-weight: 400 700; font-display: swap; src: url('/fonts/instrument-sans-latin-wght-italic.woff2') format('woff2'); }

:root {
  --bg: #e8f0ef;
  /* calm colour layer: sea-glass and slate tints in the brand's teal family, kept clear of the
     signal colours (red, orange, amber, green) and the purple/gold used for approvals and objectives */
  --wash: #cfe2e1;
  --tint: #e6f1f0;
  --tint-line: #d3e3e1;
  --th: #f1f7f6;
  --tile: #f6fbfa;
  --tile-edge: #cfe2e0;
  --tile-ink: #0c3a41;
  --surface: #ffffff;
  --sunken: #f5f8f7;
  --ink: #132322;
  --muted: #586a67;
  --faint: #8a9895;
  --line: #dbe3e1;
  --line-strong: #c3cfcc;
  --brand: #0c3a41;
  --brand-2: #114a52;
  --brand-ink: #e3f1ef;
  --accent: #0a767c;
  --accent-hover: #08646a;
  --accent-ink: #ffffff;
  --accent-soft: #dff0ef;
  --agent: #0a6c74;
  --customer: #8b4a7d;
  --ok: #1d7a4b;
  --ok-bg: #e2f2e8;
  --partial: #94650a;
  --partial-bg: #fbf0d8;
  --critical: #c0352b;
  --critical-bg: #fce8e5;
  --high: #bf5716;
  --high-bg: #fdede0;
  --medium: #866b00;
  --medium-bg: #f7efcf;
  --low: #586a70;
  --low-bg: #eaefef;
  --live: #e0362c;
  --shadow: 0 1px 2px rgba(12, 58, 65, .06), 0 1px 1px rgba(12, 58, 65, .03);
  --shadow-lift: 0 10px 30px rgba(12, 58, 65, .14);
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 8px;
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237d8f8b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --wash: #12302f; --tint: #172b2a; --tint-line: #24403d; --th: #162826; --tile: #142625; --tile-edge: #27423f; --tile-ink: #a9e0da;
    --bg: #0c1514; --surface: #13201f; --sunken: #182826; --ink: #e3ecea; --muted: #97a9a5; --faint: #6c7f7b;
    --line: #233533; --line-strong: #314a47;
    --brand: #08262b; --brand-2: #0e3439; --brand-ink: #d9ebe8;
    --accent: #3cb6b2; --accent-hover: #5cc8c4; --accent-ink: #032220; --accent-soft: #123432;
    --agent: #6ccac5; --customer: #d99ccb;
    --ok: #62cf91; --ok-bg: #143122; --partial: #e6b24f; --partial-bg: #362b12;
    --critical: #ff8a7e; --critical-bg: #3a1a17; --high: #ffaa72; --high-bg: #392417;
    --medium: #e5cc5b; --medium-bg: #322f19; --low: #a6b4b7; --low-bg: #20302e; --live: #ff5a4f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lift: 0 12px 32px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--font); font-feature-settings: 'tnum' 0;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--accent); text-underline-offset: 2px; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .count, .clock, .tile .v, .score-num, .metrics .v, table.data td, .utt .who small { font-variant-numeric: tabular-nums; }

/* The live monitor fills the window; other pages scroll normally. */
html:has(body.monitor), body.monitor { height: 100%; }
body.monitor { display: flex; flex-direction: column; }

h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: var(--ink); margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }
h3 { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 18px 0 6px; }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--sunken); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; line-height: 20px; letter-spacing: 0; }
.count:empty { display: none; }
.muted { color: var(--muted); }
.muted.small { font-size: 12px; font-weight: 400; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- brand ---------- */
.mark {
  width: 22px; height: 22px; flex: none; display: inline-block;
  background: url('/brand/mark.svg') center / contain no-repeat;
}
.nav .mark, .auth-dark .mark { background-image: url('/brand/mark-light.svg'); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 640; font-size: 17px; letter-spacing: -.025em; }

/* ---------- controls ---------- */
button, select, input, textarea { font: inherit; color: var(--ink); }
button, select, input:not([type=checkbox]):not([type=radio]), a.button {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 7px 12px; min-height: 36px; line-height: 20px;
}
input:not([type=checkbox]):not([type=radio]), textarea { padding: 7px 10px; }
textarea { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; background: var(--surface) var(--chev) no-repeat right 11px center; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
button, a.button { cursor: pointer; font-weight: 500; transition: background-color .12s, border-color .12s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
button:hover:not(:disabled), a.button:hover { background: var(--sunken); border-color: var(--faint); }
button:disabled { opacity: .45; cursor: default; }
button.primary, a.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover:not(:disabled), a.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
a.button { text-decoration: none; color: var(--ink); }
button.link { border: 0; background: none; color: var(--muted); padding: 6px 10px; min-height: 0; font-weight: 500; }
button.link:hover:not(:disabled) { color: var(--ink); background: none; }
button.link.small { font-size: 12px; padding: 2px 6px; }
button.link.danger { color: var(--critical); }
kbd { font-family: var(--font); font-size: 11px; font-weight: 600; border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; margin-left: 6px; opacity: .7; }

/* ---------- top navigation ---------- */
.nav {
  display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 56px;
  background: var(--brand); color: var(--brand-ink); position: relative; z-index: 10;
}
.nav .brand { color: #fff; text-decoration: none; }
.nav .links { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav a { color: color-mix(in srgb, var(--brand-ink) 72%, transparent); text-decoration: none; padding: 6px 11px; border-radius: 7px; font-weight: 500; white-space: nowrap; transition: color .12s, background-color .12s; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav a.active { color: #fff; background: rgba(255, 255, 255, .13); }
.nav .brand:hover { background: none; }
.nav .me { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav .who { font-size: 13px; margin-right: 8px; white-space: nowrap; }
.nav .who b { font-weight: 600; color: #fff; }
.nav .role { color: color-mix(in srgb, var(--brand-ink) 60%, transparent); }
.nav button.link { color: color-mix(in srgb, var(--brand-ink) 72%, transparent); white-space: nowrap; }
.nav button.link:hover:not(:disabled) { color: #fff; }
.nav :focus-visible { outline-color: #7fe0d8; }
.trial-bar { background: var(--partial-bg); color: var(--partial); text-align: center; font-size: 13px; font-weight: 500; padding: 5px 12px; }
@media (max-width: 1240px) { .nav { gap: 14px; } .nav a { padding: 6px 8px; } .nav .role { display: none; } }
@media (max-width: 900px) { .nav { gap: 10px; padding: 0 16px; overflow-x: auto; } .nav .who { display: none; } }

/* Operator console: a graphite frame so it never looks like a client's workspace. */
body.operator { --brand: #1f2427; --brand-2: #2a3034; }
.chip.op { background: #fff; color: #1f2427; font-weight: 600; }

/* ---------- live monitor ---------- */
.bar { display: flex; align-items: center; gap: 16px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.bar.toolbar { flex-wrap: nowrap; }
.profile { font-weight: 600; font-size: 14px; color: var(--ink); flex: 0 1 auto; min-width: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; flex: 0 1 auto; }
.bar.toolbar .status { margin-left: 0; }
.status .pill { flex: none; }
@media (max-width: 1300px) { .status .pill { flex: 0 1 auto; min-width: 80px; } }
.status .meter, .status .clock { flex: none; }
@media (max-width: 1180px) { .bar.toolbar { flex-wrap: wrap; } }
.pill { font-size: 12px; font-weight: 500; padding: 3px 10px 3px 20px; border-radius: 99px; background: var(--low-bg); color: var(--muted); position: relative; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.pill::before { content: ''; position: absolute; left: 9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.on { background: var(--ok-bg); color: var(--ok); }
.pill.off { background: var(--partial-bg); color: var(--partial); }
.meter { display: inline-flex; gap: 3px; align-items: flex-end; height: 18px; padding: 0 2px; }
.meter i { display: block; width: 4px; height: 2px; background: var(--faint); border-radius: 2px; transition: height .08s; }
.meter i:first-child { background: var(--agent); }
.meter i:last-child { background: var(--customer); }
.clock { font-size: 18px; font-weight: 600; min-width: 52px; text-align: right; letter-spacing: -.01em; }
.controls { display: flex; gap: 8px; flex: none; }
@media (max-width: 1180px) { .controls { flex-wrap: wrap; } }
.bar.toolbar .controls { margin-left: auto; }

.alert {
  margin: 14px 24px 0; padding: 10px 14px 10px 16px; border-radius: var(--r-md);
  background: var(--critical-bg); color: var(--critical); font-weight: 600;
  box-shadow: inset 4px 0 0 var(--critical); animation: pulse 1.2s ease-in-out 3;
}
@keyframes pulse { 50% { opacity: .6; } }
.after-note { font-size: 12.5px; color: var(--muted); background: var(--sunken); border-radius: var(--r-sm); padding: 8px 10px; margin-bottom: 10px; }

.grid {
  flex: 1; min-height: 0; display: grid; gap: 16px; padding: 16px 24px 24px;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.15fr);
}
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; min-height: 0; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow); }
.panel > h2:first-child { margin-bottom: 14px; }
.empty { color: var(--muted); }

.transcript { flex: 1; overflow-y: auto; padding-right: 4px; margin: 0 -6px; }
.utt { display: grid; grid-template-columns: 78px 1fr; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); }
.utt + .utt { margin-top: 2px; }
.utt .who { font-size: 12.5px; font-weight: 600; padding-top: 1px; }
.utt .who small { display: block; font-weight: 400; color: var(--faint); font-size: 11.5px; margin-top: 1px; }
.utt .text { line-height: 1.55; }
.utt.agent .who { color: var(--agent); }
.utt.customer .who { color: var(--customer); }
.utt.interim .text { color: var(--faint); font-style: italic; }
.utt.flagged { background: var(--critical-bg); box-shadow: inset 3px 0 0 var(--critical); }
.utt.flagged.sev-high { background: var(--high-bg); box-shadow: inset 3px 0 0 var(--high); }
.utt.flagged.sev-medium { background: var(--medium-bg); box-shadow: inset 3px 0 0 var(--medium); }
.utt.flash { outline: 2px solid var(--accent); }
.utt .tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tag { font-size: 11.5px; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--ink); }
.tag:hover { border-color: var(--faint); }
.inject { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.inject input { flex: 1; min-width: 0; }

.checklist-panel { overflow-y: auto; }
.checklist-panel h3:first-of-type { margin-top: 0; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.checklist li:last-child { border-bottom: 0; }
.checklist .icon { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); margin-top: 1px; display: grid; place-items: center; font-size: 10px; font-weight: 700; transition: background-color .2s, border-color .2s; }
.checklist .satisfied .icon { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.checklist .partial .icon { border-color: var(--partial); background: linear-gradient(90deg, var(--partial) 50%, transparent 50%); }
.checklist .declined .icon { background: var(--critical); border-color: var(--critical); color: var(--surface); }
.checklist .overdue .icon { border-color: var(--critical); border-width: 2px; }
.checklist .label { font-weight: 500; }
.checklist .meta { font-size: 12px; color: var(--muted); }
.checklist .overdue .meta { color: var(--critical); font-weight: 500; }
.checklist .evidence { font-size: 12px; color: var(--muted); font-style: italic; }
.checklist li.satisfied .label { color: var(--muted); }

.flags { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.flag { border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; border: 1px solid transparent; box-shadow: inset 3px 0 0 var(--sevc, var(--low)); }
.flag.critical { --sevc: var(--critical); background: var(--critical-bg); }
.flag.high { --sevc: var(--high); background: var(--high-bg); }
.flag.medium { --sevc: var(--medium); background: var(--medium-bg); }
.flag.low { --sevc: var(--low); background: var(--low-bg); }
.flag .head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.flag .title { font-weight: 600; }
.flag .sev { font-size: 11.5px; font-weight: 600; white-space: nowrap; text-transform: capitalize; color: var(--sevc); }
.flag .quote { margin: 6px 0; font-style: italic; color: var(--ink); }
.flag .why { font-size: 13px; color: var(--ink); opacity: .9; }
.flag .fix { font-size: 13px; margin-top: 6px; }
.flag .fix b { font-weight: 600; }
.flag .src { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.flag.new { animation: slidein .3s ease-out; }
.flag.flash { outline: 2px solid var(--accent); }
@keyframes slidein { from { transform: translateY(-6px); opacity: 0; } }
.ai-meta { font-size: 11.5px; color: var(--faint); padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); min-height: 1.5em; }
.ai-meta:empty { display: none; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--r-md); max-width: 90vw; box-shadow: var(--shadow-lift); font-weight: 500; z-index: 50; }
.toast.error { background: var(--critical); color: #fff; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .transcript-panel { grid-column: 1 / -1; height: 50vh; }
}
@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; padding: 12px 16px; }
  .panel { max-height: 70vh; }
  .bar { padding: 10px 16px; }
}

/* Clariwyn Desktop: calls start on their own, so the manual audio controls are hidden. */
body.desktop #mode, body.desktop #btn-start { display: none; }
.desktop-bar { display: flex; align-items: center; gap: 10px; padding: 8px 24px; border-bottom: 1px solid var(--line); background: var(--sunken); font-size: 13.5px; }
.desktop-bar[hidden] { display: none; }
.desktop-bar .spacer { flex: 1; }
.desk-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.desktop-bar.live { background: color-mix(in srgb, var(--live) 7%, var(--surface)); }
.desktop-bar.live .desk-dot { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); animation: desk-pulse 1.6s ease-in-out infinite; }
.desktop-bar.live #desk-status { font-weight: 600; }
.desktop-bar.paused .desk-dot { background: var(--medium); }
.desktop-bar.bad .desk-dot { background: var(--critical); }
@keyframes desk-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--live) 5%, transparent); } }
@media (prefers-reduced-motion: reduce) { .desktop-bar.live .desk-dot, .alert, .flag.new { animation: none; } }

/* ---------- pages ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 650; margin: 0; letter-spacing: -.02em; line-height: 1.2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.back:hover { color: var(--ink); }

.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.section h2 { margin-bottom: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.more-link { font-size: 13px; font-weight: 500; color: var(--accent); text-decoration: none; }
.more-link:hover { text-decoration: underline; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.tile .v { font-size: 30px; font-weight: 650; margin-top: 4px; letter-spacing: -.03em; line-height: 1.15; }
.tile .d { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.tile .d.good { color: var(--ok); }
.tile .d.bad { color: var(--critical); }
.small-v { font-size: 17px !important; padding-top: 8px; letter-spacing: -.01em !important; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { flex: 1; min-width: 200px; padding-left: 34px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%237d8f8b' stroke-width='1.5'/%3E%3Cpath d='m9.5 9.5 3 3' stroke='%237d8f8b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 12px center; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--sunken); }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.row-link { cursor: pointer; }
table.data tr.row-link:hover td, table.data tbody tr:hover td { background: var(--sunken); }
table.data td.num, table.data td.mono { font-size: 13.5px; font-family: var(--font); }
table.data td.nowrap { white-space: nowrap; }
table.data a { color: var(--ink); font-weight: 500; text-decoration: none; }
table.data a:hover { color: var(--accent); text-decoration: underline; }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.table-wrap.flat { border: 0; border-radius: 0; box-shadow: none; margin: 0 -22px -20px; }
.table-wrap.flat table.data th:first-child, .table-wrap.flat table.data td:first-child { padding-left: 22px; }
.table-wrap.flat table.data th:last-child, .table-wrap.flat table.data td:last-child { padding-right: 22px; }
.table-wrap.flat tr:last-child td:first-child { border-bottom-left-radius: var(--r-lg); }
.empty-cell { color: var(--muted); text-align: center; padding: 28px 14px !important; }
.empty-cell:hover, tr:hover .empty-cell { background: none !important; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 1px 9px; line-height: 20px; border-radius: 99px; margin-right: 4px; white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; }
.chip.critical { background: var(--critical-bg); color: var(--critical); }
.chip.high { background: var(--high-bg); color: var(--high); }
.chip.medium { background: var(--medium-bg); color: var(--medium); }
.chip.low, .chip.muted { background: var(--low-bg); color: var(--low); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.live { background: var(--live); color: #fff; }
.meterbar { display: inline-block; width: 64px; height: 6px; background: var(--low-bg); border-radius: 3px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.meterbar span { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.num { font-size: 13.5px; }
.warn { color: var(--critical); font-weight: 500; }
.fw { font-weight: 500; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.two-col .section { margin-bottom: 0; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; font-size: 13px; }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- call detail ---------- */
.call-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.call-meta b { color: var(--ink); font-weight: 600; }
.call-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.call-grid .panel { overflow: visible; }
.call-grid .side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: var(--r-lg); }
.call-grid .side > * { flex: none; }
.call-grid .transcript { overflow: visible; }
.summary-chips { margin-top: 12px; }
@media (max-width: 900px) {
  .call-grid { grid-template-columns: 1fr; }
  .call-grid .side { position: static; max-height: none; }
}

/* ---------- review & notes ---------- */
.signoff { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; box-shadow: var(--shadow); }
.signoff.done { background: var(--ok-bg); color: var(--ok); border-color: transparent; box-shadow: none; font-weight: 500; }
.signoff .primary { margin-left: auto; }
.flag.dismissed { opacity: .55; }
.flag.dismissed .title { text-decoration: line-through; }
.review { margin-top: 10px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--sevc, var(--line)) 35%, transparent); font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.review .by { color: var(--muted); }
.review .rnote { width: 100%; font-size: 13px; }
.review-actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.review-actions input { flex: 1; min-width: 120px; font-size: 13px; min-height: 30px !important; padding: 4px 10px !important; }
.review-actions button { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.notes { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.note { border-left: 3px solid var(--agent); padding: 2px 0 2px 12px; }
.note.private { border-left-color: var(--line-strong); }
.note-head { font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.note-body { white-space: pre-wrap; margin-top: 2px; }
.note-form textarea { width: 100%; padding: 8px 10px; resize: vertical; }
.note-form-row { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 8px; }

/* ---------- sign-in & forms ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--brand);
}
.card { background: var(--surface); border-radius: 18px; padding: 32px; width: 100%; max-width: 410px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.card .brand { font-size: 18px; margin-bottom: 22px; }
.card h1 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin: 0 0 4px; }
.card p.lead { color: var(--muted); margin: 0 0 20px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label, .field .label { font-size: 13px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { padding: 8px 10px; resize: vertical; line-height: 1.5; }
.field textarea.mono { font-family: var(--mono); font-size: 12.5px; }
.field .short { max-width: 140px; }
.field.grow { flex: 1; min-width: 240px; }
form .primary.wide { width: 100%; min-height: 40px; margin-top: 6px; }
.form-error { background: var(--critical-bg); color: var(--critical); border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 14px; font-size: 13px; font-weight: 500; }
.form-error ul { margin: 6px 0 0; padding-left: 18px; }
.form-ok { background: var(--ok-bg); color: var(--ok); border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 14px; font-size: 13px; font-weight: 500; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; }
.callout { background: var(--partial-bg); border-radius: var(--r-md); padding: 12px 14px; margin: 12px 0; }
.callout code { font-family: var(--mono); font-size: 14px; background: var(--surface); padding: 2px 8px; border-radius: 6px; user-select: all; }
.callout.warn { color: var(--ink); font-weight: 400; }
.callout.warn button.small { font-size: 12px; padding: 2px 8px; min-height: 0; }
.small-text { font-size: 13px; margin: -6px 0 12px; }
.small-note { font-size: 13px; margin: 8px 0 16px; }
.lead { font-size: 15px; }
.toggle-row { display: flex; flex-direction: column; gap: 4px; }
.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.plan-bar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 16px; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.plan-bar b { color: var(--ink); font-weight: 600; }

/* ---------- rules editor ---------- */
.savebar {
  position: sticky; top: 10px; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px 10px 16px; margin-bottom: 16px; box-shadow: var(--shadow-lift);
}
.savebar #save-note { flex: 1; min-width: 160px; }
.savebar .dirty, .savebar .warn { color: var(--partial); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rule-card .field label { display: flex; flex-direction: column; gap: 5px; }
.rule-card .field label > * { font-weight: 400; }
.checks { display: flex; gap: 18px; }
.checks label { display: flex !important; flex-direction: row !important; align-items: center; gap: 7px; font-weight: 400; }
.rule-list { display: flex; flex-direction: column; gap: 8px; }
.rule-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); transition: border-color .12s; }
.rule-card:hover { border-color: var(--line-strong); }
.rule-card[open] { border-color: var(--line-strong); box-shadow: var(--shadow); }
.rule-card summary { cursor: pointer; padding: 11px 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; list-style: none; border-radius: var(--r-md); }
.rule-card summary::-webkit-details-marker { display: none; }
.rule-card summary::before { content: ''; width: 14px; height: 14px; flex: none; background: var(--chev) center / 9px no-repeat; transform: rotate(-90deg); transition: transform .15s; }
.rule-card[open] summary::before { transform: none; }
.rc-title { font-weight: 600; margin-right: 4px; }
.rc-stat { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.rc-body { padding: 16px 16px 16px 34px; border-top: 1px solid var(--line); }
.rc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-top: 4px; }
.test-hits { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
details.section > summary { cursor: pointer; list-style: none; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary h2 { margin: 0; }
details.section > summary h2::before { content: ''; display: inline-block; width: 14px; height: 14px; background: var(--chev) center / 9px no-repeat; transform: rotate(-90deg); transition: transform .15s; }
details.section[open] > summary h2::before { transform: none; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } .rc-body { padding-left: 16px; } }

/* ---------- coaching ---------- */
.coaching .coach-top { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 16px; }
.score-block { text-align: center; min-width: 104px; padding: 12px 8px; border-radius: var(--r-md); background: var(--sunken); }
.score-num { font-size: 44px; font-weight: 650; line-height: 1; letter-spacing: -.04em; }
.score-of { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.coach-summary { flex: 1; }
.coach-summary p { margin: 8px 0; }
.chips-row { display: flex; gap: 4px; flex-wrap: wrap; }
.focus { background: var(--accent-soft); border-radius: var(--r-md); padding: 10px 14px; }
.metrics { display: flex; gap: 28px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.metrics div { display: flex; flex-direction: column; }
.metrics .k { font-size: 12.5px; color: var(--muted); }
.metrics .v { font-size: 17px; font-weight: 600; }
.coach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.coaching ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.coaching .muted { font-size: 13px; }
.dim-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.pips { letter-spacing: 2px; color: var(--accent); font-size: 12px; white-space: nowrap; }
.pips .off { color: var(--line-strong); }
.goals li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; }
.goal-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.goal-icon.ok { background: var(--ok-bg); color: var(--ok); }
.goal-icon.medium { background: var(--medium-bg); color: var(--medium); }
.goal-icon.critical { background: var(--critical-bg); color: var(--critical); }
.goal-icon.muted { background: var(--low-bg); color: var(--low); }
.points li { border-left: 3px solid var(--line-strong); padding-left: 12px; }
.points .quote { font-style: italic; margin-top: 2px; }
.points .quote a, .goals a { color: inherit; }
.points .try { font-size: 13px; margin-top: 4px; }
.coaching .src { font-size: 11.5px; color: var(--faint); margin-top: 16px; }
@media (max-width: 800px) { .coach-grid { grid-template-columns: 1fr; } .coaching .coach-top { flex-direction: column; } }

/* ---------- practice call ---------- */
.practice-page { max-width: 920px; }
.practice-page .setup { margin: 0 0 22px; padding-left: 20px; line-height: 1.65; }
.practice-page .setup li { margin-bottom: 6px; }
.practice-page h3 { font-size: 15px; color: var(--ink); margin: 18px 0 10px; }
.practice-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.practice-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); transition: border-color .12s; }
.practice-card:hover { border-color: var(--line-strong); }
.practice-card h3 { margin: 0; color: var(--ink); }
.practice-card p { margin: 0; flex: 1; }
.practice-card .meta { color: var(--muted); font-size: 13px; }
.practice-live { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
.practice-status { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.practice-status .spacer { flex: 1; }
.practice-status .desk-dot { background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); }
.practice-status .meter i { background: var(--agent); }
.practice-script { list-style: none; margin: 0; padding: 12px 14px; max-height: 46vh; overflow-y: auto; }
.practice-script li { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--muted); }
.practice-script li .who { font-size: 12.5px; font-weight: 600; padding-top: 1px; }
.practice-script li.agent .who { color: var(--agent); }
.practice-script li.customer .who { color: var(--customer); }
.practice-script li.past { opacity: .55; }
.practice-script li.current { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.practice-prompt { border-top: 1px solid var(--line); padding: 18px; background: var(--sunken); }
.practice-prompt .who { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.practice-prompt .say { font-size: 21px; line-height: 1.45; font-weight: 500; letter-spacing: -.01em; margin-bottom: 16px; max-width: 70ch; }
.practice-prompt .actions { display: flex; gap: 10px; }
.expect-list { margin: 0 0 18px; padding-left: 0; list-style: none; }
.expect-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.expect-list .flag-item { color: var(--critical); }
.expect-list .ok-item { color: var(--ok); }
.expect-list .note-item { color: var(--muted); }
.practice-page .row-actions { display: flex; gap: 10px; }
@media (max-width: 640px) { .practice-script li { grid-template-columns: 1fr; gap: 2px; } .practice-prompt .say { font-size: 17px; } }

/* ---------- company objectives ---------- */
.objectives-page .lead { margin: 0 0 6px; }
.objectives-page .how { margin: 0 0 10px; padding-left: 20px; line-height: 1.65; }
.objective-list { display: flex; flex-direction: column; gap: 10px; }
.objective { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); }
.objective:focus-within { border-color: var(--line-strong); box-shadow: var(--shadow); }
.objective label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
.objective label.switch { flex-direction: row; align-items: center; gap: 9px; color: var(--ink); font-weight: 400; }
.objective input:not([type]), .objective textarea { font-size: 14px; color: var(--ink); width: 100%; font-weight: 400; }
.objective textarea { padding: 7px 10px; resize: vertical; line-height: 1.5; }
.obj-row { display: flex; gap: 12px; align-items: flex-end; }
.obj-name { flex: 1; }
.obj-actions { display: flex; gap: 2px; padding-bottom: 6px; }

/* ---------- operator: AI services and keys ---------- */
.svc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.svc { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.svc[open] { border-color: var(--line-strong); }
.svc:not(.in-use) summary .svc-name { color: var(--muted); }
.svc summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 11px 14px; flex-wrap: wrap; border-radius: var(--r-md); }
.svc summary::-webkit-details-marker { display: none; }
.svc summary::before { content: ''; width: 14px; height: 14px; flex: none; background: var(--chev) center / 9px no-repeat; transform: rotate(-90deg); transition: transform .15s; }
.svc[open] summary::before { transform: none; }
.svc-name { font-weight: 600; margin-right: 2px; }
.svc-key { margin-left: auto; }
.svc-body { padding: 4px 16px 14px 36px; border-top: 1px solid var(--line); }
.svc-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, 1.3fr); gap: 12px; padding-top: 12px; }
.svc-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; }
.svc-fields input, .svc-fields select { width: 100%; font-weight: 400; }
.svc-endpoint { display: flex; flex-direction: column; gap: 6px; }
.key-row { display: flex; gap: 4px; align-items: center; }
.key-row input { flex: 1; min-width: 0; }
.svc-note { margin: 10px 0 0; }
.svc-test { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.svc-result { font-size: 13px; }
.svc-result.ok { color: var(--ok); font-weight: 500; }
.svc-result.bad { color: var(--critical); font-weight: 500; }
.svc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 16px; }
@media (max-width: 800px) { .svc-fields { grid-template-columns: 1fr; } .svc-body { padding-left: 16px; } }

/* ---------- colour layer ---------- */
/* A sea-glass wash under the navigation that settles into the page colour. */
body:not(.monitor) { background: linear-gradient(180deg, var(--wash) 0, var(--bg) 340px) no-repeat, var(--bg); }
.nav { background: linear-gradient(90deg, var(--brand) 0%, #0f4450 100%); }
body.operator .nav { background: linear-gradient(90deg, #1f2427 0%, #2a3236 100%); }
@media (prefers-color-scheme: dark) { .nav { background: linear-gradient(90deg, var(--brand) 0%, #0b313a 100%); } }

/* Section and panel titles sit on a tinted header strip. */
.section > h2:first-child, .section > .section-head:first-child,
.panel > h2:first-child {
  margin: -20px -22px 16px; padding: 13px 22px; min-height: 52px;
  background: var(--tint); border-bottom: 1px solid var(--tint-line);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.panel > h2:first-child { margin: -18px -18px 14px; padding: 13px 18px; }
.section > .section-head:first-child h2 { margin: 0; }
.section > h2:first-child + .table-wrap.flat, .section > .section-head:first-child + .table-wrap.flat { margin-top: -16px; }
details.section > summary { margin: -20px -22px 0; padding: 14px 22px; background: var(--tint); border-radius: var(--r-lg); }
details.section[open] > summary { border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 1px solid var(--tint-line); margin-bottom: 16px; }
details.section:not([open]) { padding-bottom: 20px; }
details.section:not([open]) > summary { margin-bottom: -20px; }

/* Tables: tinted column headers and row hover. */
table.data th { background: var(--th); }
table.data tr.row-link:hover td, table.data tbody tr:hover td { background: var(--tint); }

/* Summary tiles: soft sea-glass cards with the figure in the brand colour. */
.tile { background: linear-gradient(160deg, var(--tile) 0%, var(--surface) 70%); border-color: var(--tile-edge); }
.tile .v { color: var(--tile-ink); }

/* Live monitor: tinted toolbar and window. */
body.monitor { background: var(--bg); }
.bar.toolbar { background: var(--tint); border-bottom-color: var(--tint-line); }
.desktop-bar { background: var(--th); }

/* Smaller touches */
.savebar { border-color: var(--tint-line); }
.plan-bar, .signoff:not(.done) { background: var(--tint); border-color: var(--tint-line); box-shadow: none; }
.score-block { background: var(--tint); }
.count { background: var(--surface); border-color: var(--tint-line); }
.rule-card summary, .svc summary { transition: background-color .12s; }
.rule-card summary:hover, .svc summary:hover { background: var(--th); }
.rule-card[open] > summary, .svc[open] > summary { background: var(--th); border-radius: var(--r-md) var(--r-md) 0 0; }
.practice-prompt { background: var(--tint); }
.practice-card { background: var(--th); border-color: var(--tint-line); }

/* ---------- Clariwyn sign-in ---------- */
.auth { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.card .brand { font-size: 20px; }
.card .brand .mark { width: 26px; height: 26px; }
.auth::after {
  content: ''; position: absolute; width: 760px; height: 760px; right: -220px; bottom: -260px; pointer-events: none;
  background: url('/brand/mark-light.svg') center / contain no-repeat; opacity: .05;
}
.auth > * { position: relative; z-index: 1; }
.auth-tag { margin: 0; color: rgba(227, 241, 239, .72); font-size: 15px; letter-spacing: .01em; text-align: center; }
body.operator .auth::after { opacity: .03; }

/* ---------- live calls (managers) ---------- */
.live-wrap { max-width: 1440px; }
.live-grid { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.call-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.call-card { transition: opacity .35s, transform .35s; }
.call-card.entering { opacity: 0; transform: translateY(-6px); }
.card-btn {
  width: 100%; text-align: left; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); white-space: normal; font-weight: 400; min-height: 0; line-height: 1.4;
}
.card-btn:hover:not(:disabled) { background: var(--surface); border-color: var(--line-strong); }
.call-card.selected .card-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.call-card.sev-critical .card-btn, .call-card.sev-high .card-btn { background: color-mix(in srgb, var(--critical-bg) 55%, var(--surface)); box-shadow: inset 4px 0 0 var(--critical), var(--shadow); }
.call-card.sev-high .card-btn { background: color-mix(in srgb, var(--high-bg) 60%, var(--surface)); box-shadow: inset 4px 0 0 var(--high), var(--shadow); }
.call-card.sev-medium .card-btn, .call-card.sev-low .card-btn { box-shadow: inset 4px 0 0 var(--medium), var(--shadow); }
.call-card.selected.sev-critical .card-btn, .call-card.selected.sev-high .card-btn, .call-card.selected.sev-medium .card-btn { box-shadow: inset 4px 0 0 var(--critical), 0 0 0 3px var(--accent-soft); }
.call-card.ended { opacity: .62; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--tile-ink); font-weight: 650; font-size: 13.5px; }
.card-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.card-top b { font-weight: 600; font-size: 15px; }
.card-clock { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.card-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent); animation: desk-pulse 1.6s ease-in-out infinite; flex: none; }
.card-progress { height: 5px; border-radius: 3px; background: var(--low-bg); overflow: hidden; }
.card-progress span { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .5s cubic-bezier(.3,.8,.3,1); }
.card-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.card-flags .chip { margin: 0; white-space: normal; }
.card-last { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-last b { font-weight: 600; color: var(--ink); }

.live-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 28px 22px; display: flex; gap: 16px; align-items: center; color: var(--muted); }
.live-empty p { margin: 0; }
.live-empty b { color: var(--ink); }
.pulse-ring { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); animation: ring 2.2s ease-out infinite; }
@keyframes ring { 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.live-detail { padding: 0; position: sticky; top: 16px; height: calc(100vh - 140px); min-height: 460px; }
.detail-empty { display: grid; place-items: center; height: 100%; color: var(--muted); padding: 24px; text-align: center; }
#detail-body { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 20px; background: var(--tint); border-bottom: 1px solid var(--tint-line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.detail-head h2 { margin: 0; font-size: 17px; }
.detail-actions { display: flex; gap: 12px; align-items: center; }
.ended-bar { background: var(--ok-bg); color: var(--ok); font-weight: 500; font-size: 13.5px; padding: 8px 20px; }
.detail-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 270px; }
.live-transcript { overflow-y: auto; padding: 14px 16px; margin: 0; }
.detail-side { border-left: 1px solid var(--line); padding: 14px 16px; overflow-y: auto; background: var(--sunken); }
.detail-side h3 { margin: 4px 0 8px; display: flex; gap: 6px; align-items: center; color: var(--ink); font-size: 13.5px; }
.detail-side h3 + * { margin-bottom: 18px; }
.side-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.side-flag { display: grid; grid-template-columns: 10px 1fr; gap: 8px; align-items: baseline; padding: 7px 9px; border-radius: var(--r-sm); background: var(--surface); }
.side-flag b { display: block; font-weight: 600; font-size: 13.5px; }
.side-flag .small { text-transform: capitalize; }
.side-flag .sev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--low); }
.side-flag.critical { background: var(--critical-bg); color: var(--critical); } .side-flag.critical .sev-dot { background: var(--critical); }
.side-flag.high { background: var(--high-bg); color: var(--high); } .side-flag.high .sev-dot { background: var(--high); }
.side-flag.medium .sev-dot { background: var(--medium); }
.side-flag.fresh { animation: flag-pop .5s cubic-bezier(.2,.9,.3,1.3); }
@keyframes flag-pop { from { transform: scale(.94); opacity: 0; } }
.check-bar { height: 6px; border-radius: 3px; background: var(--low-bg); overflow: hidden; margin-bottom: 10px !important; }
.check-bar span { display: block; height: 100%; background: var(--ok); transition: width .5s; }
.side-check { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.side-check li { display: grid; grid-template-columns: 16px 1fr; gap: 6px; padding: 3px 0; }
.side-check .mk { font-weight: 700; text-align: center; color: var(--faint); }
.side-check li:not(.done):not(.declined):not(.late) .mk::before { content: '○'; font-weight: 400; }
.side-check .done { color: var(--muted); } .side-check .done .mk { color: var(--ok); }
.side-check .declined, .side-check .declined .mk { color: var(--high); }
.side-check .late { color: var(--critical); font-weight: 600; } .side-check .late .mk { color: var(--critical); }
@media (max-width: 1000px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-detail { position: static; height: 70vh; }
  .detail-cols { grid-template-columns: 1fr; }
  .detail-side { border-left: 0; border-top: 1px solid var(--line); max-height: 30vh; }
}

/* ---------- two-step sign-in ---------- */
button.danger:not(.link) { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 35%, var(--line)); }
button.danger:not(.link):hover:not(:disabled) { background: var(--critical-bg); }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 14px; }
.qr { width: 184px; height: 184px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-manual { font-size: 13px; color: var(--muted); text-align: center; }
.qr-manual summary { cursor: pointer; }
.secret-key { display: block; margin-top: 8px; font: 600 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; color: var(--ink); user-select: all; word-break: break-all; }
.code-input { font: 600 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .25em; text-align: center; }
.auth .tf-hint { margin: 12px 0 0; text-align: center; }
.auth .tf-back { display: block; margin: 10px auto 0; }
.recovery-codes { list-style: none; padding: 12px; margin: 4px 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; background: var(--wash, #f4f8f7); border: 1px dashed var(--line-strong); border-radius: 10px; counter-reset: rc; }
.recovery-codes li { font: 600 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; counter-increment: rc; }
.recovery-codes li::before { content: counter(rc) "."; color: var(--muted); font-weight: 400; margin-right: 8px; display: inline-block; width: 1.4em; text-align: right; }
.recovery-codes code { background: none; padding: 0; }
.recovery-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.check-line { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* ---------- security page ---------- */
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.sec-grid > .section { margin: 0; }
.security-page .sec-grid { margin-bottom: 20px; }
.choice-list { display: grid; gap: 8px; margin: 4px 0 14px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--line-strong); }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.choice input { margin-top: 3px; flex: none; }
.choice b { display: block; font-weight: 600; }
.choice small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.row-actions.center { justify-content: center; margin-top: 10px; }
.data tr.inactive td { opacity: .6; }
.data.act-log td { vertical-align: top; }
.data.act-log tr.act-calls td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.data.act-log tr.act-settings td:first-child { box-shadow: inset 3px 0 0 var(--medium); }
#act-filter { width: auto; }
@media (max-width: 860px) { .sec-grid { grid-template-columns: 1fr; } }
.data.act-log th:nth-child(1) { width: 170px; } .data.act-log th:nth-child(2) { width: 220px; }
