/* =============================================================================
   CoreCuity HQ — operator command center.
   Aesthetic: mission-control terminal. Layered near-black, a faint blueprint-dot
   field, hairline rules, MONOSPACE TABULAR NUMERALS as the signature, a single
   gold *signal* accent, semantic status language, a live pulse. Self-contained,
   no external assets. Mobile <768 / tablet 768–1023 / desktop ≥1024.
   ========================================================================== */

:root {
  /* Surfaces — layered near-black */
  --bg:        #07090c;
  --surface:   #0c0f14;
  --surface-2: #11151b;
  --elevated:  #161b22;
  --inset:     #090b0e;

  /* Hairlines */
  --line:      rgba(255,255,255,.07);
  --line-2:    rgba(255,255,255,.12);
  --line-3:    rgba(255,255,255,.18);

  /* Ink */
  --text:      #e9eef4;
  --dim:       #97a4b3;
  --faint:     #606b7b;

  /* Gold signal (used sparingly) */
  --gold:      #d4af37;
  --gold-bright:#e7c65a;
  --gold-dim:  #9c7c25;
  --gold-soft: rgba(212,175,55,.12);
  --gold-line: rgba(212,175,55,.32);

  /* Status */
  --ok:        #45d18a;  --ok-soft:   rgba(69,209,138,.13);  --ok-line: rgba(69,209,138,.32);
  --warn:      #e0a64b;  --warn-soft: rgba(224,166,75,.13);  --warn-line: rgba(224,166,75,.32);
  --danger:    #f0675a;  --danger-soft: rgba(240,103,90,.13);--danger-line: rgba(240,103,90,.34);
  --info:      #5aa9e6;  --info-soft: rgba(90,169,230,.12);  --info-line: rgba(90,169,230,.32);
  --model:     #b694ff;  --model-soft: rgba(182,148,255,.12);

  --radius:    10px;
  --radius-sm: 7px;
  --radius-lg: 14px;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --t:   160ms cubic-bezier(.4,0,.2,1);
  --maxw: 1320px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  background:
    /* faint blueprint dot field — the mission-control signature texture */
    radial-gradient(rgba(255,255,255,.022) 1px, transparent 1px) 0 0 / 22px 22px,
    radial-gradient(900px 520px at 88% -8%, rgba(212,175,55,.045), transparent 60%),
    radial-gradient(820px 460px at -8% 108%, rgba(90,169,230,.035), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Every metric, id, timestamp and code reads in tabular mono — the signature. */
.cell-mono, .meta-item .val.mono, .tenant-card .slug, .agent-row .model,
.stat .v, .tenant-card .nums b, .evt .when, .badge, .code-block,
.scope-pill, .num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "zero" 1; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ── Global icon sizing — NO inline <use> svg can ever render unsized again.
   (This is the root fix for the giant logout-icon bug.) ─────────────────────── */
svg { fill: currentColor; }
.btn svg, .scope-pill svg, .detail-back svg, button svg, a svg, .icon {
  width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -2px;
}
.navlink svg { width: 18px; height: 18px; opacity: .8; }
.navlink.active svg { opacity: 1; }

/* ── Boot ───────────────────────────────────────────────────────────────────── */
.boot { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.boot-mark { font-family: var(--mono); font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--faint); font-size: 12px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Login ──────────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 384px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  padding: 36px 32px; box-shadow: 0 24px 70px rgba(0,0,0,.55);
  animation: rise var(--t);
}
.login-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .7; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.login-card .wordmark { font-size: 25px; }
.login-card .sub { color: var(--faint); font-size: 12.5px; margin: 8px 0 26px; font-family: var(--mono); letter-spacing: .01em; }

.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); margin-bottom: 8px; }
input[type="password"], input[type="text"] {
  width: 100%; padding: 11px 13px; background: var(--inset);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--text); font-size: 15px; font-family: var(--sans);
  transition: border-color var(--t), box-shadow var(--t);
}
input::placeholder { color: var(--faint); letter-spacing: .1em; }
input:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 15px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; font-weight: 600; font-size: 13.5px;
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
}
.btn:active { transform: translateY(1px); }
.btn-gold { width: 100%; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: #1a1407; border-color: var(--gold-dim); letter-spacing: .01em; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-gold:disabled { opacity: .55; cursor: default; filter: none; }
.btn-ghost { background: transparent; color: var(--dim); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--line-3); background: var(--surface-2); }
.form-error { color: var(--danger); font-size: 12.5px; min-height: 17px; margin: 2px 0 12px; font-weight: 500; }

/* ── Wordmark ───────────────────────────────────────────────────────────────── */
.wordmark { display: inline-flex; align-items: baseline; gap: 1px; font-weight: 700; font-size: 18px; letter-spacing: -.015em; }
.wordmark .core { color: var(--text); }
.wordmark .cuity { color: var(--gold); }
.wordmark .dot { color: var(--gold); }

/* ── Shell ──────────────────────────────────────────────────────────────────── */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px; height: 54px;
  background: rgba(8,10,13,.78); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-2);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line) 30%, transparent 70%); opacity: .5; }
.topbar .wordmark { font-size: 16px; }
.topbar .spacer { flex: 1; }

/* env / scope chip with a live pulse — the "fleet online" signal */
.scope-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); background: var(--gold-soft);
  border: 1px solid var(--gold-line); border-radius: 999px; padding: 4px 11px 4px 9px;
}
.scope-pill .glyph { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 var(--gold); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(212,175,55,.5); } 70% { box-shadow: 0 0 0 6px rgba(212,175,55,0); } 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); } }

.body { display: flex; flex: 1; min-height: 0; width: 100%; max-width: var(--maxw); margin: 0 auto; }

/* Sidebar */
.sidenav { width: 212px; flex-shrink: 0; padding: 16px 12px; border-right: 1px solid var(--line); }
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--dim); font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px; transition: background var(--t), color var(--t);
}
.navlink:hover { background: var(--surface-2); color: var(--text); }
.navlink.active { background: var(--gold-soft); color: var(--gold); box-shadow: inset 2px 0 0 var(--gold); }

main { flex: 1; min-width: 0; padding: 24px clamp(16px, 3vw, 32px) 40px; }
.tabbar { display: none; }

/* ── Page header ────────────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 650; margin: 0; letter-spacing: -.015em; }
.page-head .lead { color: var(--faint); font-size: 13px; margin: 5px 0 0; max-width: 64ch; }
.head-actions { display: flex; align-items: center; gap: 10px; }

/* ── Panels ─────────────────────────────────────────────────────────────────── */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 16px 18px; }
.panel-title { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--faint); font-weight: 600; margin: 0 0 13px; }

/* ── Stat readout strip ─────────────────────────────────────────────────────── */
.stat-grid { display: grid; gap: 12px; margin-bottom: 20px; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr)); }
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 15px; transition: border-color var(--t), background var(--t);
}
.stat::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: var(--line-3); }
.stat:hover { border-color: var(--line-2); }
.stat .k { font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .15em; }
.stat .v { font-family: var(--mono); font-size: 30px; font-weight: 600; margin-top: 8px; letter-spacing: -.02em; line-height: 1; color: var(--text); }
.stat .v.accent { color: var(--gold); }
.stat .v.danger { color: var(--danger); }
.stat .foot { font-size: 11.5px; color: var(--faint); margin-top: 7px; }
.stat:has(.v.accent)::before { background: var(--gold); }
.stat:has(.v.danger)::before { background: var(--danger); }

/* ── Overview two-column ────────────────────────────────────────────────────── */
.cols { display: grid; gap: 16px; grid-template-columns: 1.5fr 1fr; align-items: start; }

/* Tenant cards */
.tenant-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); }
.tenant-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 15px; cursor: pointer; transition: border-color var(--t), background var(--t); }
.tenant-card:hover { border-color: var(--gold-line); background: var(--elevated); }
.tenant-card .name { font-weight: 650; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.tenant-card .slug { font-family: var(--mono); font-size: 10.5px; color: var(--faint); letter-spacing: .04em; margin-top: 2px; }
.tenant-card .nums { display: flex; gap: 20px; margin-top: 12px; }
.tenant-card .nums b { display: block; font-family: var(--mono); font-size: 18px; font-weight: 600; }
.tenant-card .nums span { font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }

/* Agent roster */
.agent-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.agent-row:last-child { border-bottom: none; }
.avatar { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: 12px; background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-line); }
.agent-row .who { min-width: 0; flex: 1; }
.agent-row .who .nm { font-weight: 600; font-size: 13.5px; }
.agent-row .who .rl { font-family: var(--mono); font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.agent-row .model { font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* Health pill */
.health-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); }
.health-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.health-pill.ok { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
.health-pill.ok .dot { background: var(--ok); animation: pulse-ok 2.4s ease-out infinite; }
@keyframes pulse-ok { 0% { box-shadow: 0 0 0 0 rgba(69,209,138,.5); } 70% { box-shadow: 0 0 0 6px rgba(69,209,138,0); } 100% { box-shadow: 0 0 0 0 rgba(69,209,138,0); } }
.health-pill.down { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.health-pill.down .dot { background: var(--danger); }

/* ── Toolbar ────────────────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.select, .input-sm { background: var(--surface); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--radius-sm); padding: 7px 11px; font-size: 13px; transition: border-color var(--t); }
.select:focus, .input-sm:focus { outline: none; border-color: var(--gold-dim); }
.input-sm { min-width: 200px; }
.muted-count { color: var(--faint); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.row { display: grid; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--t); }
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-2); }
.row.head { cursor: default; background: transparent; position: sticky; top: 54px; z-index: 2; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); font-weight: 600; background: var(--surface); border-bottom: 1px solid var(--line-2); }
.row.head:hover { background: var(--surface); }
.convo-row { grid-template-columns: 1.3fr 0.7fr 2.4fr auto; }
.customer-row { grid-template-columns: 1.2fr 2.6fr auto; }

.cell-strong { font-weight: 600; font-size: 13.5px; }
.cell-mono { font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin-top: 3px; letter-spacing: .01em; }
.cell-dim { color: var(--dim); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview { color: var(--dim); font-size: 12.5px; }
.preview .lbl { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.metrics { display: flex; gap: 7px; align-items: center; justify-self: end; }

/* Tags + badges */
.tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 5px; background: var(--surface-2); color: var(--dim); border: 1px solid var(--line-2); white-space: nowrap; }
.tag.chan-voice { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.tag.chan-text, .tag.chan-whatsapp { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.badge { font-family: var(--mono); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px; letter-spacing: .02em; }
.badge.deny { color: var(--danger); background: var(--danger-soft); border: 1px solid var(--danger-line); }
.badge.err  { color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); }
.badge.tools { color: var(--dim); background: var(--surface-2); border: 1px solid var(--line-2); }
.chev { color: var(--faint); font-size: 17px; line-height: 1; transition: transform var(--t), color var(--t); }
.row:hover .chev { color: var(--gold); transform: translateX(2px); }

/* ── Conversation detail ────────────────────────────────────────────────────── */
.detail-back { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--dim); font-size: 12.5px; margin-bottom: 16px; background: none; border: none; padding: 0; transition: color var(--t); }
.detail-back:hover { color: var(--gold); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-bottom: 18px; padding: 13px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.meta-item { font-size: 12.5px; }
.meta-item .lbl { color: var(--faint); text-transform: uppercase; letter-spacing: .12em; font-family: var(--mono); font-size: 9.5px; display: block; margin-bottom: 2px; }
.meta-item .val { color: var(--text); font-weight: 500; }
.meta-item .val.mono { font-family: var(--mono); font-size: 12px; color: var(--gold); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pane { display: flex; flex-direction: column; min-height: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--faint); font-weight: 600; margin-bottom: 11px; }

/* Transcript */
.transcript { background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 11px; max-height: 70vh; overflow: auto; }
.bubble { max-width: 86%; }
.bubble .who { font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 4px; padding: 0 3px; }
.bubble .body { padding: 9px 12px; border-radius: 11px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.bubble .ts { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 4px; padding: 0 3px; }
.bubble.customer { align-self: flex-start; }
.bubble.customer .body { background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-left-radius: 3px; }
.bubble.agent { align-self: flex-end; text-align: right; }
.bubble.agent .who, .bubble.agent .ts { text-align: right; }
.bubble.agent .body { background: var(--gold-soft); border: 1px solid var(--gold-line); border-bottom-right-radius: 3px; text-align: left; color: #f3ecd8; }

/* Audit trace */
.trace { background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 4px; max-height: 70vh; overflow: auto; }
.evt { display: grid; grid-template-columns: 56px 12px 1fr; gap: 9px; padding: 6px 10px; align-items: start; border-left: 2px solid transparent; }
.evt:hover { background: rgba(255,255,255,.022); }
.evt .when { font-family: var(--mono); font-size: 10px; color: var(--faint); padding-top: 2px; }
.evt .marker { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--line-3); box-shadow: 0 0 0 1px var(--line-3); }
.evt .content { min-width: 0; }
.evt .etype { font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; }
.evt .edesc { font-size: 12px; color: var(--dim); margin-top: 2px; word-break: break-word; }
.evt .edesc code { font-family: var(--mono); font-size: 11px; color: var(--text); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.evt .kvs { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; }
.evt .kv { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.evt .kv b { color: var(--dim); font-weight: 600; }

.evt.t-turn .marker { background: var(--info); box-shadow: 0 0 0 1px var(--info); }
.evt.t-turn .etype { color: var(--info); }
.evt.t-tool .marker { background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.evt.t-tool .etype { color: var(--gold); }
.evt.t-allow { border-left-color: var(--ok-line); }
.evt.t-allow .marker { background: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.evt.t-allow .etype { color: var(--ok); }
.evt.t-deny { border-left-color: var(--danger-line); background: var(--danger-soft); }
.evt.t-deny .marker { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.evt.t-deny .etype { color: var(--danger); }
.evt.t-model .marker { background: var(--model); box-shadow: 0 0 0 1px var(--model); }
.evt.t-model .etype { color: var(--model); }
.evt.t-error { border-left-color: var(--warn-line); background: var(--warn-soft); }
.evt.t-error .marker { background: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.evt.t-error .etype { color: var(--warn); }
.evt.t-life .etype { color: var(--faint); }

/* ── ACL pretty print ───────────────────────────────────────────────────────── */
.code-block { background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; overflow: auto; max-height: 78vh; font-family: var(--mono); font-size: 12px; line-height: 1.7; white-space: pre; tab-size: 2; color: var(--dim); }
.code-block .jk { color: var(--gold); }
.code-block .js { color: var(--ok); }
.code-block .jn { color: var(--info); }
.code-block .jb { color: var(--model); }
.code-block .jp { color: var(--faint); }

/* ── States ─────────────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 46px 20px; color: var(--faint); }
.empty .big { font-size: 14px; color: var(--dim); margin-bottom: 4px; font-weight: 600; }
.empty .small { font-size: 12.5px; }
.error-box { border: 1px solid var(--danger-line); background: var(--danger-soft); color: #f5a79e; border-radius: var(--radius); padding: 13px 16px; font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.error-box .btn-ghost { color: #f5a79e; border-color: var(--danger-line); }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-line { height: 13px; margin: 9px 0; }
.sk-card { height: 90px; }
.sk-stat { height: 92px; }

.fade-in { animation: fade var(--t); }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .cols { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .transcript, .trace { max-height: none; }
}
@media (max-width: 767px) {
  .topbar { height: 52px; padding: 0 14px; }
  .sidenav { display: none; }
  main { padding: 18px 14px 86px; }
  .row.head { top: 52px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: rgba(8,10,13,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--line-2); padding: 6px 4px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .tabbar .navlink { flex: 1; flex-direction: column; gap: 3px; padding: 7px 2px; margin: 0; font-size: 10px; justify-content: center; }
  .tabbar .navlink.active { box-shadow: none; }
  .tabbar .navlink svg { width: 20px; height: 20px; }
  .convo-row { grid-template-columns: 1fr auto; gap: 8px; }
  .convo-row .chan-cell, .convo-row .preview-cell { display: none; }
  .customer-row { grid-template-columns: 1fr auto; }
  .customer-row .preview-cell { display: none; }
  .row.head { display: none; }
  .stat .v { font-size: 26px; }
  .detail-meta { gap: 6px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .skeleton::after { animation: none; }
}
