:root {
  --bg: 16, 17, 20;
  --bg-2: 24, 24, 31;
  --bg-3: 34, 36, 45;
  --stroke: 34, 36, 45;
  --text: 252, 252, 252;
  --text-2: 185, 185, 200;
  --text-3: 120, 122, 141;
  --accent: 255, 149, 46;
  --green: 49, 227, 172;
  --red: 237, 58, 122;
  --amber: 250, 204, 21;
}
* { box-sizing: border-box; margin: 0; }
html, body { background: rgb(var(--bg)); color: rgb(var(--text)); }
body {
  font: 500 12px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: -.012em; overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
.top {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid rgb(var(--stroke)); background: rgb(var(--bg-2));
  position: sticky; top: 0; z-index: 2; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-right: auto; }
.brand img { width: 20px; height: 20px; }
.btn {
  height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid rgb(var(--stroke));
  background: rgb(var(--bg-3)); cursor: pointer; transition: transform .15s cubic-bezier(.34,1.56,.64,1), background .15s ease;
}
.btn:active { transform: scale(.95); }
.btn.main { background: rgb(var(--accent)); color: rgb(var(--bg)); border-color: transparent; }
.seg { display: flex; border: 1px solid rgb(var(--stroke)); border-radius: 8px; overflow: hidden; }
.seg button { height: 26px; padding: 0 10px; background: none; border: 0; color: rgb(var(--text-3)); cursor: pointer; }
.seg button.on { background: rgb(var(--bg-3)); color: rgb(var(--text)); }
.switch { display: flex; align-items: center; gap: 8px; cursor: pointer; color: rgb(var(--text-2)); }
.switch i { width: 30px; height: 16px; border-radius: 999px; background: rgb(var(--bg-3)); position: relative; transition: background .15s ease; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: rgb(var(--text-3)); transition: left .15s ease, background .15s ease; }
.switch.on i { background: rgba(var(--green), .25); }
.switch.on i::after { left: 16px; background: rgb(var(--green)); }
main { padding: 16px; display: grid; gap: 16px; max-width: 1400px; margin: 0 auto; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stat { background: rgb(var(--bg-2)); border: 1px solid rgb(var(--stroke)); border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 20px; font-weight: 500; }
.stat span { color: rgb(var(--text-3)); font-size: 11px; }
.panel { background: rgb(var(--bg-2)); border: 1px solid rgb(var(--stroke)); border-radius: 8px; min-width: 0; }
.panel h2 { font-size: 12px; font-weight: 500; color: rgb(var(--text-2)); padding: 10px 12px; border-bottom: 1px solid rgb(var(--stroke)); }
.grid2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgb(var(--stroke)) transparent; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { text-align: left; color: rgb(var(--text-3)); font-weight: 500; font-size: 11px; padding: 6px 12px; }
td { padding: 7px 12px; border-top: 1px solid rgb(var(--stroke)); }
tbody tr { cursor: pointer; transition: background .15s ease; }
tbody tr:hover { background: rgb(var(--bg-3)); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.dim { color: rgb(var(--text-3)); }
.chip { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 11px; background: rgba(var(--text-3), .2); color: rgb(var(--text-2)); }
.chip.good { background: rgba(var(--green), .2); color: rgb(var(--green)); }
.chip.bad { background: rgba(var(--red), .2); color: rgb(var(--red)); }
.chip.warn { background: rgba(var(--amber), .2); color: rgb(var(--amber)); }
.chip.hot { background: rgba(var(--accent), .2); color: rgb(var(--accent)); }
.list { padding: 6px 0; }
.list div { display: flex; justify-content: space-between; padding: 4px 12px; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: rgb(var(--bg-2));
  border-left: 1px solid rgb(var(--stroke)); transform: translateX(100%); transition: transform .2s ease;
  z-index: 3; display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid rgb(var(--stroke)); }
.drawer .body { padding: 12px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 8px; }
.kv span:nth-child(odd) { color: rgb(var(--text-3)); }
audio { width: 100%; height: 32px; }
.turn { padding: 6px 8px; border-radius: 6px; background: rgb(var(--bg-3)); }
.turn.user { background: rgba(var(--accent), .12); }
.turn small { display: block; color: rgb(var(--text-3)); font-size: 11px; margin-bottom: 2px; }
.empty { padding: 16px 12px; color: rgb(var(--text-3)); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(320px, 100%); display: grid; gap: 10px; background: rgb(var(--bg-2)); border: 1px solid rgb(var(--stroke)); border-radius: 12px; padding: 20px; }
.login input { height: 32px; padding: 0 10px; border-radius: 4px; border: 1px solid rgb(var(--stroke)); background: rgb(var(--bg)); }
.login .err { color: rgb(var(--red)); }
@media (max-width: 800px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:last-child { grid-column: span 2; }
  .grid2 { grid-template-columns: 1fr; }
}
