@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JBM"; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jbm-cyr.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JBM"; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jbm-lat.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #0c0d0f;
  --bg-2: #101114;
  --surface: #141518;
  --surface-2: #1a1c20;
  --surface-3: #22252a;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #ecebe8;
  --text-2: #b9b8b3;
  --muted: #7d7c78;
  --faint: #55554f;

  --accent: #f3b04a;
  --accent-ink: #1b1407;
  --accent-soft: rgba(243, 176, 74, .12);
  --accent-line: rgba(243, 176, 74, .35);

  --ok: #67d39a;
  --ok-soft: rgba(103, 211, 154, .12);
  --err: #ff6f5f;
  --err-soft: rgba(255, 111, 95, .12);
  --warn: #f3b04a;
  --info: #8fb2ff;
  --info-soft: rgba(143, 178, 255, .12);

  --s1: #8fb2ff; --s2: #f3b04a; --s3: #67d39a; --s4: #d59cff; --s5: #ff8f80;

  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --sans: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JBM", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --side: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  font: 14px/1.55 var(--sans); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--accent); }
a.link:hover, .prose a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, .mono, kbd { font-family: var(--mono); font-size: 12.5px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px;
  overflow: auto; margin: 0; line-height: 1.6; color: var(--text-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 14px 16px; border-right: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 26px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; color: var(--accent-ink); }
.brand-mark svg { width: 18px; height: 18px; stroke-width: 2.2; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); letter-spacing: .02em; }

.nav-group { margin-bottom: 18px; }
.nav-label { font: 500 10.5px/1 var(--mono); color: var(--faint); text-transform: uppercase;
  letter-spacing: .12em; padding: 0 10px 9px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 450; position: relative; transition: background .15s, color .15s; }
.nav a .i { color: var(--muted); transition: color .15s; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a:hover .i { color: var(--text-2); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.nav a.active .i { color: var(--accent); }
.nav a .count { margin-left: auto; font: 500 11px var(--mono); color: var(--muted); }

.side-status { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 6px 4px; display: grid; gap: 9px; }
.sline { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.sline .k { font: 500 10.5px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; width: 30px; }
.sline .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user { display: flex; align-items: center; justify-content: space-between; margin-top: 8px;
  padding: 10px 6px 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.side-user form { margin: 0; }

.main { min-width: 0; padding: 30px 40px 60px; max-width: 1480px; width: 100%; }
.main.full { max-width: none; padding: 0; height: 100vh; overflow: hidden; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.eyebrow { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 8px; }
.page-head .sub { color: var(--muted); margin-top: 6px; max-width: 640px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head .hint { color: var(--muted); font-size: 12.5px; }
.card.flush .card-head { padding: 16px 20px 0; margin-bottom: 8px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .g2, .g4 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 16px; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); } .dim { color: var(--text-2); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.right { text-align: right; } .nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-text { color: var(--err); } .warn-text { color: var(--warn); } .ok-text { color: var(--ok); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); overflow: hidden; }
.kpi { padding: 20px 22px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.kpi .value { font: 500 32px/1.1 var(--mono); letter-spacing: -.04em; margin-top: 12px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 15px; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.kpi .foot { color: var(--muted); font-size: 12px; margin-top: 8px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* ---------- status ---------- */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; white-space: nowrap; color: var(--text-2); }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.st.ok::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.st.err::before { background: var(--err); box-shadow: 0 0 0 3px var(--err-soft); }
.st.warn::before { background: var(--warn); box-shadow: 0 0 0 3px var(--accent-soft); }
.st.info::before { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.st.live::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.dot.ok { background: var(--ok); } .dot.err { background: var(--err); } .dot.warn { background: var(--warn); }
.dot.info { background: var(--info); animation: pulse 1.6s infinite; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.tag.accent { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.tag.ok { border-color: rgba(103,211,154,.3); color: var(--ok); background: var(--ok-soft); }
.tag.mono { font-family: var(--mono); font-size: 11px; }

/* ---------- buttons & forms ---------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px;
  padding: 0 15px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--text); font: 500 13.5px var(--sans); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s; }
.btn:hover, button:hover { background: var(--surface-3); border-color: rgba(255,255,255,.18); }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover, button.primary:hover { background: #f7bf65; border-color: #f7bf65; }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger, button.danger { color: var(--err); }
.btn.danger:hover, button.danger:hover { border-color: rgba(255,111,95,.4); background: var(--err-soft); }
.btn.sm, button.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.icon, button.icon { width: 36px; padding: 0; }
.btn.icon.sm, button.icon.sm { width: 30px; }
button:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-line); outline-offset: 2px; }

input, select, textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--r-sm); padding: 0 12px; height: 38px; font: 14px var(--sans); transition: border-color .15s; }
textarea { padding: 10px 12px; height: auto; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-line); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
input[type="file"] { padding: 7px 10px; }
input[type="range"] { height: auto; padding: 0; background: none; border: 0; accent-color: var(--accent); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d7c78' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
label, .label { display: block; color: var(--text-2); font-size: 12.5px; margin-bottom: 7px; font-weight: 500; }
.field { margin-bottom: 18px; }
.field .help { color: var(--muted); font-size: 12px; margin-top: 6px; }
.check { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 14px; margin: 0 18px 0 0; cursor: pointer; font-weight: 400; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; margin: 0; color: var(--text); font-size: 14px; font-weight: 400; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 34px; height: 20px; border-radius: 20px; background: var(--surface-3); position: relative; transition: background .2s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-2); transition: transform .2s, background .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); background: var(--accent-ink); }

.seg-ctl { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.seg-ctl button, .seg-ctl a { height: 28px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); border-radius: 7px; font-size: 12.5px; display: inline-flex; align-items: center; }
.seg-ctl button:hover, .seg-ctl a:hover { background: var(--surface-2); color: var(--text); }
.seg-ctl .on, .seg-ctl button.on:hover { background: var(--surface-3); color: var(--text); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .search { position: relative; flex: 1; min-width: 260px; max-width: 460px; }
.toolbar .search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { padding-left: 38px; }
.toolbar select, .toolbar input[type="date"] { width: auto; }

.flash { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 22px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13.5px; }
.flash::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.flash.warn::before { background: var(--warn); } .flash.err::before { background: var(--err); }
.flash.err { border-color: rgba(255,111,95,.3); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { font: 500 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .1em; padding-top: 10px; padding-bottom: 10px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(255,255,255,.022); }
td.t { font: 12.5px var(--mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .i { width: 28px; height: 28px; color: var(--faint); margin-bottom: 10px; }

.pager { display: flex; gap: 8px; margin-top: 18px; align-items: center; justify-content: flex-end; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.kv .v { word-break: break-word; }

.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; background: var(--accent); transition: width .6s ease; }
.meter > span.asr { background: var(--info); }
.meter > span.voice { background: var(--s4); }
.meter > span.llm { background: var(--accent); }
.meter > span.other { background: var(--muted); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

.chart-box { position: relative; height: 250px; }
.chart-box.sm { height: 190px; }

/* ---------- list rows ---------- */
.list { display: grid; }
.list-item { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); transition: background .12s; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: rgba(255,255,255,.022); }
.list-item .title { font-weight: 500; }
.list-item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { font: 11px var(--mono); color: var(--faint); }

details > summary { cursor: pointer; color: var(--muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 15px; line-height: 1; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary:hover { color: var(--text); }

.keybox { padding: 14px 16px; border: 1px dashed var(--accent-line); border-radius: var(--r-sm); background: var(--accent-soft); margin-bottom: 18px; word-break: break-all; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { border-right: 1px solid var(--line); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: var(--bg-2); overflow: hidden; position: relative; }
.login-art .wave { display: flex; align-items: center; gap: 5px; height: 160px; }
.login-art .wave span { width: 5px; border-radius: 4px; background: var(--surface-3); }
.login-art .wave span.hot { background: var(--accent); }
.login-art h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; font-weight: 600; max-width: 460px; }
.login-art h2 em { font-style: normal; color: var(--accent); }
.login-form { display: grid; place-items: center; padding: 40px; }
.login-form form { width: 100%; max-width: 340px; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- models ---------- */
.model-section { margin-bottom: 28px; }
.model-section .section-label {
  font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .14em;
  margin: 0 0 12px;
}
.models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .models { grid-template-columns: 1fr; } }
@media (min-width: 1400px) { .models { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.model { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 16px; transition: border-color .2s; }
.model.active { border-color: var(--accent-line); }
.model.active::before { content: ""; position: absolute; inset: -1px; border-radius: var(--r-lg); pointer-events: none;
  box-shadow: 0 0 0 1px var(--accent-line), 0 20px 60px -30px rgba(243,176,74,.35); }
.model-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.model-vendor { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.model-name { font-size: 24px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; margin-top: 8px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.model-name .size { font: 500 15px var(--mono); color: var(--accent); letter-spacing: -.02em; }
.model-tag { color: var(--text-2); max-width: 440px; }
.m-activity { min-height: 1.2em; }
.specs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec { padding: 14px 0 14px 16px; border-left: 1px solid var(--line); }
.spec:first-child { border-left: 0; padding-left: 0; }
.spec .k { font-size: 11.5px; color: var(--muted); }
.spec .v { font: 500 16px var(--mono); margin-top: 4px; letter-spacing: -.02em; }
.spec .v small { font-size: 11.5px; color: var(--muted); margin-left: 2px; }
.feats { display: flex; gap: 6px; flex-wrap: wrap; }
.model-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.progress { position: relative; height: 3px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); transition: width 1s linear; }
.progress.indet > span { width: 30% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { left: -30%; } 100% { left: 100%; } }

.endpoint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); font: 12.5px var(--mono); color: var(--text-2); }
.endpoint .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; height: 100vh; }
.chat.no-right { grid-template-columns: 260px minmax(0, 1fr) 0; }
.chat.no-right .chat-cfg { display: none; }
@media (max-width: 1300px) { .chat { grid-template-columns: 220px minmax(0, 1fr) 0; } .chat .chat-cfg { display: none; }
  .chat.show-cfg .chat-cfg { display: flex; position: fixed; right: 0; top: 0; bottom: 0; width: 320px; z-index: 30; box-shadow: -20px 0 60px rgba(0,0,0,.5); } }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-list .head { padding: 20px 14px 12px; }
.chat-list .items { overflow: auto; padding: 4px 8px 16px; flex: 1; }
.conv { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--r-sm); color: var(--text-2); cursor: pointer; font-size: 13.5px; }
.conv:hover { background: var(--surface); color: var(--text); }
.conv.on { background: var(--surface-2); color: var(--text); }
.conv .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .del { opacity: 0; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.conv:hover .del { opacity: 1; }
.conv .del:hover { color: var(--err); background: transparent; }
.conv-day { font: 500 10.5px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .12em; padding: 14px 10px 6px; }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); min-height: 64px; }
.model-pill { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; }
.model-pill b { font-weight: 600; }
.model-pill .size { font: 500 12px var(--mono); color: var(--accent); }
.chat-scroll { flex: 1; overflow: auto; min-height: 0; }
.thread { max-width: 820px; margin: 0 auto; padding: 32px 28px 40px; }
.msg { margin-bottom: 30px; }
.msg.user { display: flex; justify-content: flex-end; }
.msg.user .bubble { background: var(--surface-2); border: 1px solid var(--line); padding: 12px 16px; border-radius: 16px 16px 4px 16px; max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.msg.ai .who { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.msg.ai .who .av { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 10px var(--mono); }
.msg.ai .who b { color: var(--text); font-weight: 600; }
.msg-meta { display: flex; gap: 14px; align-items: center; margin-top: 12px; font: 11.5px var(--mono); color: var(--faint); flex-wrap: wrap; }
.msg-meta .act { opacity: 0; transition: opacity .15s; display: flex; gap: 2px; }
.msg:hover .msg-meta .act { opacity: 1; }
.msg-meta button { height: 26px; width: 26px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.msg-meta button:hover { background: var(--surface-2); color: var(--text); }
.reasoning { margin-bottom: 14px; border-left: 2px solid var(--line-2); padding-left: 14px; }
.reasoning summary { font-size: 12.5px; }
.reasoning .body { color: var(--muted); font-size: 13px; white-space: pre-wrap; margin-top: 8px; max-height: 340px; overflow: auto; line-height: 1.6; }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 16px; background: var(--accent); vertical-align: -3px; margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.prose { line-height: 1.7; font-size: 14.5px; word-break: break-word; }
.prose > :first-child { margin-top: 0; } .prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 12px; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 22px 0 10px; font-size: 16px; }
.prose h1 { font-size: 19px; } .prose h2 { font-size: 17px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 3px 0; }
.prose li::marker { color: var(--muted); }
.prose code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.prose pre { margin: 0 0 14px; position: relative; }
.prose pre code { background: none; border: 0; padding: 0; color: var(--text); }
.prose pre .code-copy { position: absolute; top: 6px; right: 6px; opacity: 0; background: var(--surface-2); }
.prose pre:hover .code-copy { opacity: 1; }
.prose code[data-lang]::before { content: attr(data-lang); display: block; font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.prose blockquote { margin: 0 0 12px; padding-left: 14px; border-left: 2px solid var(--accent-line); color: var(--text-2); }
.prose table { margin: 0 0 14px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); }
.prose th { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text-2); }
.prose hr { margin: 16px 0; }
.prose strong { font-weight: 650; }

.composer-wrap { padding: 0 28px 22px; }
.composer { max-width: 820px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 10px 10px 10px 16px; transition: border-color .15s; }
.composer:focus-within { border-color: var(--accent-line); }
.composer textarea { border: 0; background: transparent; padding: 6px 0; min-height: 28px; max-height: 260px; resize: none; font-size: 14.5px; }
.composer textarea:focus { outline: none; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.composer-bar .opts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); gap: 6px; }
.chip:hover { background: var(--surface-2); }
.chip.on { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.send { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.composer-note { max-width: 820px; margin: 8px auto 0; text-align: center; font-size: 11.5px; color: var(--faint); }

.welcome { max-width: 680px; margin: 0 auto; padding: 12vh 28px 20px; }
.welcome h1 { font-size: 34px; letter-spacing: -.035em; }
.welcome h1 em { font-style: normal; color: var(--accent); }
.prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
@media (max-width: 900px) { .prompts { grid-template-columns: 1fr; } }
.prompt { text-align: left; height: auto; padding: 14px 16px; display: block; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); white-space: normal; font-weight: 400; }
.prompt:hover { border-color: var(--line-2); background: var(--surface-2); }
.prompt b { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.prompt span { color: var(--muted); font-size: 12.5px; line-height: 1.45; display: block; }

.chat-cfg { border-left: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.chat-cfg .head { padding: 20px 20px 10px; display: flex; justify-content: space-between; align-items: center; }
.chat-cfg .body { padding: 6px 20px 20px; overflow: auto; }
.range-row { display: flex; justify-content: space-between; align-items: baseline; }
.range-row output { font: 12.5px var(--mono); color: var(--text); }

.offline-banner { max-width: 820px; margin: 0 auto 12px; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r); font-size: 13.5px; }

/* ---------- transcript ---------- */
.player { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 4px 0 16px; }
.player audio { width: 100%; height: 40px; border-radius: 10px; }
audio::-webkit-media-controls-panel { background: var(--surface-2); }
.transcripts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.transcript { max-height: 68vh; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.seg { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background .12s; }
.seg:hover { background: var(--surface-2); }
.seg.active { background: var(--accent-soft); }
.seg .ts { font: 11.5px var(--mono); color: var(--faint); padding-top: 3px; }
.seg .who { font-weight: 600; font-size: 12px; margin-bottom: 2px; }
.seg .tx { color: var(--text); line-height: 1.6; }
.spk-1 { color: var(--s1); } .spk-2 { color: var(--s2); } .spk-3 { color: var(--s3); } .spk-4 { color: var(--s4); } .spk-5 { color: var(--s5); }

.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 36px 20px; text-align: center; transition: border-color .15s, background .15s; cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--accent-line); background: var(--accent-soft); }
.drop input { display: none; }
.drop .i { width: 28px; height: 28px; color: var(--accent); margin-bottom: 8px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--surface-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 10px; font-size: 13px; transition: all .25s; z-index: 100; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- voice ---------------------------------------------------------------- */
.voice { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: 100vh; }
.voice-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.voice-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; min-height: 0; padding: 20px; }
.orb-wrap { position: relative; width: min(380px, 52vh); aspect-ratio: 1; }
.orb-wrap canvas { width: 100%; height: 100%; display: block; }
.orb-state { position: absolute; left: 0; right: 0; bottom: -6px; text-align: center; pointer-events: none; }
.orb-label { font-size: 19px; font-weight: 500; letter-spacing: -.01em; }
.orb-sub { color: var(--muted); font-size: 13px; margin-top: 4px; min-height: 20px; }
.voice-controls { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.mic-btn { width: 72px; height: 72px; border-radius: 50%; padding: 0; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); position: relative; }
.mic-btn:hover { background: #f7bf65; border-color: #f7bf65; }
.mic-btn .i { width: 26px; height: 26px; stroke-width: 2; }
.mic-btn .off { display: none; }
.mic-btn.live { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.mic-btn.live:hover { background: var(--surface-3); }
.mic-btn.live .on { display: none; } .mic-btn.live .off { display: inline-flex; }
.mic-btn::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid var(--accent-line); opacity: 0; transition: opacity .2s; }
.mic-btn:not(.live)::after { opacity: 1; animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.92); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
button.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); }
button:disabled { opacity: .35; pointer-events: none; }
.lat { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 64px; }
.lat-main { font: 500 26px/1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 8px; }
.lat-main small { font: 400 12.5px var(--sans); color: var(--muted); letter-spacing: 0; }
.lat-parts { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--muted); }
.lat-parts span { display: inline-flex; align-items: center; gap: 6px; }
.lat-parts i { width: 6px; height: 6px; border-radius: 2px; display: inline-block; }
.lat-parts b { font: 500 12px var(--mono); color: var(--text-2); }
.voice-hint { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--faint); font-size: 12.5px; padding: 0 24px 22px; text-align: center; }
.voice-cfg { position: absolute; top: 64px; right: 16px; width: 440px; max-height: calc(100vh - 90px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.45); z-index: 5; }
.voice-log { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.voice-log .head { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; min-height: 64px; border-bottom: 1px solid var(--line); }
.voice-log .items { flex: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.empty-log { color: var(--faint); font-size: 13px; margin: auto 10px; text-align: center; line-height: 1.6; }
.vl { font-size: 14px; line-height: 1.55; }
.vl .who { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.vl.ai .who { color: var(--accent); }
.vl.me .txt { color: var(--text-2); }
.vl.cut .txt::after { content: " — перебили"; color: var(--faint); font-size: 12px; }
.vl .t { color: var(--faint); letter-spacing: 0; text-transform: none; }
.vl.live .txt::after { content: "▍"; color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 1px; }
.vl.err .txt { color: var(--err); }
.voice-type { display: flex; gap: 6px; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.voice-type input { height: 38px; }

[hidden] { display: none !important; }

/* ---- voices studio ------------------------------------------------------- */
.vs { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.vs-list { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 20px; }
.vs-item { height: auto; justify-content: flex-start; gap: 12px; padding: 10px 12px; text-align: left; background: transparent; border-color: transparent; }
.vs-item:hover { background: var(--surface); }
.vs-item.on { background: var(--surface); border-color: var(--line-2); }
.vs-item .av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.vs-item .av.m { background: var(--info-soft); color: var(--info); }
.vs-item .meta { display: flex; flex-direction: column; min-width: 0; }
.vs-item .meta b { font-weight: 500; }
.vs-item .meta span { font-size: 12px; color: var(--muted); }
.vs-editor { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.vs-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.vs-title { width: 240px; font-size: 18px; font-weight: 600; background: transparent; border-color: transparent; padding-left: 6px; margin-left: -6px; }
.vs-title:hover, .vs-title:focus { border-color: var(--line-2); background: var(--bg-2); }
.vs-sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 28px; }
.vs-preview { display: flex; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.vs-preview button { flex-shrink: 0; }
.vs-player { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.vs-player audio { height: 36px; flex: 1; max-width: 520px; }
.vs-save { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.vs-grid2 { display: grid; grid-template-columns: 1fr auto; gap: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.cands { display: flex; flex-direction: column; gap: 8px; }
.cands:not(:empty) { margin-top: 18px; }
.cand { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.cand.on { border-color: var(--accent-line); background: var(--accent-soft); }
.cand .n { font: 500 12px var(--mono); color: var(--muted); width: 16px; }
.cand audio { height: 34px; flex: 1; min-width: 0; }
.voice-cfg textarea { font-size: 12.5px; line-height: 1.5; }

/* ---------- journal / live monitor ---------- */
.journal-filters { flex-wrap: wrap; gap: 10px; align-items: center; }
.journal-filters .filter-date { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.journal-filters input[type="date"] {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--r-sm); padding: 7px 10px; font: 13px var(--mono);
}
.card.tight { padding: 18px 20px; }
.card.tight .k { font-size: 12px; color: var(--muted); }
.card.tight .big { font-size: 28px; font-weight: 600; letter-spacing: -.03em; margin-top: 6px; }
.live-models { display: flex; flex-direction: column; }
.live-row {
  display: grid; grid-template-columns: minmax(160px, 1.1fr) minmax(0, 2fr) auto;
  gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line);
}
.live-row:first-child { border-top: 0; padding-top: 4px; }
.live-row.busy { background: linear-gradient(90deg, var(--info-soft), transparent); margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.live-name { font-weight: 600; }
.live-act { color: var(--text-2); font-size: 13.5px; }
.tag.info { background: var(--info-soft); color: var(--info); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 22px 18px 40px; }
  .chat { grid-template-columns: 1fr; } .chat-list { display: none; }
  .vs { grid-template-columns: 1fr; } .vs-list { position: static; }
  .voice { grid-template-columns: 1fr; height: auto; } .voice-log { border-left: 0; border-top: 1px solid var(--line); max-height: 60vh; }
}
