:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --ink: #0f1b33;
  --muted: #5b6780;
  --line: #dde4f0;
  --primary: #0a4bd6;
  --primary-ink: #ffffff;
  --bar: #0a4bd6;
  --bar-soft: #7ea2ee;
  --unheard: #c62828;
  --ok: #2e7d32;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1222;
    --surface: #131c31;
    --ink: #e6ecf8;
    --muted: #93a0bb;
    --line: #243152;
    --primary: #5b95ff;
    --primary-ink: #04122e;
    --bar: #5b95ff;
    --bar-soft: #2f4f8f;
    --unheard: #ff6b6b;
    --ok: #7cc47f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
.top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: linear-gradient(120deg, #1e90fe, #0a3bb5 55%, #001865); color: #fff;
}
.logo { width: 42px; height: 42px; border-radius: 10px; }
.brand { display: flex; flex-direction: column; line-height: 1.1; margin-right: auto; }
.brand strong { font-size: 18px; }
.brand span { opacity: .8; font-size: 12px; letter-spacing: .08em; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav button { background: transparent; border: 0; color: #fff; opacity: .8; padding: 8px 12px; border-radius: 999px; font: inherit; cursor: pointer; }
nav button.active, nav button:hover { opacity: 1; background: rgba(255,255,255,.18); }
main { max-width: 1040px; margin: 0 auto; padding: 16px; }
h1, h2, h3 { margin: 0 0 12px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h3 small { color: var(--muted); font-weight: normal; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow-x: auto; }
.narrow { max-width: 380px; margin: 48px auto; text-align: center; }
.narrow-left { max-width: 420px; }
.logo-big { width: 96px; height: 96px; border-radius: 22px; margin-bottom: 12px; }
form label { display: block; text-align: left; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
input, select { width: 100%; padding: 10px 12px; margin-top: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
button.primary { background: var(--primary); color: var(--primary-ink); border: 0; padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; }
button.ghost, .btn { background: transparent; border: 1px solid var(--line); color: var(--ink); padding: 8px 14px; border-radius: 999px; font: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.error { color: var(--unheard); min-height: 1em; }
.muted { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile b { display: block; font-size: 28px; }
.tile span { color: var(--muted); font-size: 13px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--line); }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.bars .bar { width: min(22px, 70%); background: var(--bar-soft); border-radius: 4px 4px 0 0; min-height: 0; }
.bars .col.today .bar { background: var(--bar); }
.bars .col:hover .bar { outline: 2px solid var(--ink); outline-offset: 1px; }
.bars .tip { display: none; position: absolute; bottom: 100%; background: var(--ink); color: var(--surface); padding: 4px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.bars .col:hover .tip { display: block; }
.axis { display: flex; gap: 2px; margin-top: 4px; }
.axis span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
table.kv { width: 100%; border-collapse: collapse; }
table.kv td { padding: 5px 0; border-bottom: 1px solid var(--line); }
table.kv td:last-child { text-align: right; font-weight: 600; }
table.kv tr.sub td:first-child { padding-left: 14px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; margin: 0; }
.filters select { width: auto; margin: 0; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: var(--surface); color: var(--ink); font-size: 14px; margin: 0; }
.chip input { width: auto; margin: 0; }
.unlock { display: grid; gap: 8px; }
.unlock .row { display: flex; gap: 8px; flex-wrap: wrap; }
.unlock .row input { flex: 1 1 220px; margin: 0; }
.unlock.ok { border-color: var(--ok); }
.unlock.ok .error { display: none; }
.list .item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.item .head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.item .name { font-weight: 700; margin-right: auto; }
.item .meta { color: var(--muted); font-size: 13px; }
.item .dot { color: var(--unheard); }
.item .heard { color: var(--muted); }
.item .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.item audio { width: 100%; margin-top: 10px; }
.item .tx { font-style: italic; margin-top: 8px; }
table.calls { width: 100%; border-collapse: collapse; min-width: 560px; }
table.calls th, table.calls td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.calls th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.code { font: 700 34px/1.2 ui-monospace, monospace; letter-spacing: .18em; margin-top: 14px; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 999px; }
@media (max-width: 600px) {
  nav { width: 100%; justify-content: space-between; }
  nav button { padding: 8px 8px; }
}
