:root {
  --bg: #f6f6f9;
  --panel: #ffffff;
  --panel-2: #f1f1f6;
  --line: #e4e4ec;
  --line-2: #d6d6e2;
  --text: #16161f;
  --text-2: #55566a;
  --text-3: #8a8ba0;
  --accent: #5b4cf0;
  --accent-2: #7a6cf7;
  --accent-soft: #ecebff;
  --accent-ink: #3d2fc9;
  --good: #16a34a;
  --good-soft: #e7f7ed;
  --warn: #c2780a;
  --warn-soft: #fdf3e2;
  --bad: #dc2626;
  --bad-soft: #fdecec;
  --sidebar: #111120;
  --sidebar-2: #1b1b2e;
  --sidebar-text: #c9c9dc;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 4px 16px rgba(20, 20, 40, .05);
  --shadow-lg: 0 20px 60px rgba(10, 10, 30, .25);
  --radius: 14px;
  /* Chart series: validated reference categorical slots 1-3 (dataviz skill). */
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Nirmala UI", "Noto Sans Telugu", sans-serif;
  --font-te: "Nirmala UI", "Noto Sans Telugu", "Gautami", var(--font);
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d16;
    --panel: #151522;
    --panel-2: #1c1c2c;
    --line: #26263a;
    --line-2: #33334c;
    --text: #ececf5;
    --text-2: #a9a9c0;
    --text-3: #71718c;
    --accent: #8175ff;
    --accent-2: #9a90ff;
    --accent-soft: #24214a;
    --accent-ink: #b9b2ff;
    --good: #34d27a;
    --good-soft: #10291c;
    --warn: #f0a93b;
    --warn-soft: #2d2210;
    --bad: #f87171;
    --bad-soft: #2f1414;
    --sidebar: #0a0a12;
    --sidebar-2: #161625;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.te { font-family: var(--font-te); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 22px; }
.logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font: 700 22px var(--font-te); color: #fff; background: linear-gradient(135deg, #7a6cf7, #e0569b); box-shadow: 0 6px 18px rgba(122, 108, 247, .35); }
.brand-name { color: #fff; font-weight: 650; font-size: 15px; letter-spacing: .1px; }
.brand-sub { font-size: 12px; color: #8d8da8; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; gap: 11px; align-items: center; padding: 9px 12px; border-radius: 9px; color: var(--sidebar-text); font-weight: 500; transition: background .15s, color .15s; }
.sidebar nav a:hover { background: var(--sidebar-2); color: #fff; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(122, 108, 247, .22), rgba(122, 108, 247, .08)); color: #fff; box-shadow: inset 2px 0 0 #8f84ff; }
.sidebar nav .sep { height: 1px; background: #23233a; margin: 10px 8px; }
.engine { margin-top: auto; background: var(--sidebar-2); border: 1px solid #25253c; border-radius: 12px; padding: 12px; font-size: 12.5px; }
.engine .row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.engine .label { color: #8d8da8; }
.engine .val { color: #e7e7f3; font-weight: 550; }
.engine .bar { height: 5px; background: #2a2a44; border-radius: 3px; overflow: hidden; margin: 6px 0 10px; }
.engine .bar > i { display: block; height: 100%; background: linear-gradient(90deg, #7a6cf7, #e0569b); }
.engine .line { display: flex; justify-content: space-between; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #666; flex: none; }
.dot.ok { background: #34d27a; box-shadow: 0 0 0 3px rgba(52, 210, 122, .18); }
.dot.busy { background: #f0a93b; box-shadow: 0 0 0 3px rgba(240, 169, 59, .2); animation: pulse 1.2s infinite; }
.dot.bad { background: #f87171; }
.dot.off { background: #55556d; }
@keyframes pulse { 50% { opacity: .45; } }

main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 32px 6px; }
.topbar h1 { font-size: 22px; margin: 0; font-weight: 680; letter-spacing: -.2px; }
.topbar .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.actions { display: flex; gap: 8px; }
#view { padding: 16px 32px 48px; max-width: 1320px; }

/* ------------------------------------------------------------------ pieces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 640; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.card h3 .muted { font-weight: 450; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 16px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat { position: relative; overflow: hidden; }
.stat .k { color: var(--text-2); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.stat .k .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.5px; margin-top: 12px; }
.stat .d { color: var(--text-3); font-size: 12px; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--panel); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 560; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(91, 76, 240, .3); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn.icon { padding: 7px; }
.btn .i { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input { width: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.7; }
textarea.te { font-size: 16px; }
input[type=range] { accent-color: var(--accent); width: 100%; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 2px; }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 560; font-size: 13px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--panel-2); color: var(--text-2); white-space: nowrap; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }

.chip { border: 1px solid var(--line-2); background: var(--panel); border-radius: 20px; padding: 4px 11px; font-size: 12.5px; cursor: pointer; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: var(--accent); }

code, .code { font-family: var(--mono); font-size: 12.5px; }
code.inl { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
pre.code { background: #0f0f1b; color: #e4e4f2; padding: 16px 18px; border-radius: 12px; overflow-x: auto; margin: 0; line-height: 1.6; position: relative; }
pre.code .c { color: #7c7c9c; } pre.code .s { color: #a5e0a0; } pre.code .k { color: #b3a8ff; }
.codewrap { position: relative; }
.codewrap .copy { position: absolute; top: 10px; right: 10px; background: #26263c; color: #d6d6ea; border-color: #34344f; }

/* table */
.tbl-wrap { overflow-x: auto; margin: 0 -20px -20px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; padding: 10px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 36px 20px; color: var(--text-3); }
.empty .i { width: 34px; height: 34px; stroke-width: 1.4; margin-bottom: 8px; color: var(--text-3); }

/* quota bar */
.qbar { height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; min-width: 110px; }
.qbar > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.qbar.warn > i { background: var(--warn); } .qbar.bad > i { background: var(--bad); }

/* ------------------------------------------------------------------ voices */
.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.voice { display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, transform .15s; }
.voice:hover { border-color: var(--line-2); }
.voice .head { display: flex; gap: 12px; align-items: center; }
.avatar { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; flex: none; text-transform: uppercase; }
.voice .name { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice .meta { color: var(--text-3); font-size: 12.5px; }
.voice .tx { font-family: var(--font-te); color: var(--text-2); font-size: 13.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 43px; }
.voice .foot { display: flex; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto; }
.new-voice { border: 2px dashed var(--line-2); background: transparent; box-shadow: none; display: grid; place-items: center; text-align: center; cursor: pointer; min-height: 220px; color: var(--text-2); }
.new-voice:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.new-voice .plus { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin: 0 auto 10px; }

/* wave player */
.wp { display: flex; gap: 10px; align-items: center; min-width: 0; }
.wp .play { width: 38px; height: 38px; border-radius: 50%; border: 0; flex: none; display: grid; place-items: center; cursor: pointer; background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(91, 76, 240, .3); }
.wp .play:hover { filter: brightness(1.08); }
.wp .play .i { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.wp.sm .play { width: 30px; height: 30px; box-shadow: none; }
.wp.sm .play .i { width: 13px; height: 13px; }
.wp canvas { flex: 1; min-width: 0; height: 40px; cursor: pointer; display: block; }
.wp.sm canvas { height: 28px; }
.wp .t { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }

/* clone wizard */
.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-weight: 560; font-size: 13px; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; }
.step.on { color: var(--text); } .step.on .n { background: var(--accent); color: #fff; border-color: transparent; }
.step.done .n { background: var(--good); color: #fff; border-color: transparent; }
.step + .step::before { content: ""; width: 26px; height: 1px; background: var(--line-2); margin-right: 2px; }
.drop { display: block; border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 42px 20px; text-align: center; cursor: pointer; transition: all .15s; background: var(--panel); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .big { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--accent-soft); color: var(--accent); }
.drop .big .i { width: 26px; height: 26px; }
.drop h4 { margin: 0 0 4px; font-size: 16px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rec { display: flex; align-items: center; justify-content: center; gap: 12px; }
.rec .btn.recording { background: var(--bad); color: #fff; border-color: transparent; }
.rec .timer { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 48px; }
.region-wrap { position: relative; user-select: none; }
.region-wrap canvas { width: 100%; height: 96px; display: block; cursor: grab; border-radius: 10px; background: var(--panel-2); }
.region-wrap canvas:active { cursor: grabbing; }
.axis { display: flex; justify-content: space-between; color: var(--text-3); font-size: 11.5px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.quality { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.q { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; }
.q .k { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.q .v { font-weight: 650; font-size: 16px; margin-top: 2px; display: flex; gap: 8px; align-items: center; }
.note { border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.note .i { margin-top: 1px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.info { background: var(--accent-soft); color: var(--accent-ink); }
.note.good { background: var(--good-soft); color: var(--good); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note p { margin: 0; }
.busy-box { display: flex; gap: 14px; align-items: center; padding: 22px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.btn .spinner { width: 15px; height: 15px; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.locked { opacity: .45; pointer-events: none; filter: grayscale(.4); }

/* studio */
.composer textarea { min-height: 170px; }
.counter { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 600; }
.spoken { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; font-family: var(--font-te); font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.settings .field { margin: 0; }
.range-val { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.output-empty { display: grid; place-items: center; text-align: center; min-height: 190px; color: var(--text-3); }
.output-empty .i { width: 40px; height: 40px; stroke-width: 1.3; margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.kv .q .v { font-size: 15px; }
.hist { display: flex; flex-direction: column; }
.hist .item { display: grid; grid-template-columns: minmax(0, 1fr) 190px auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hist .item:last-child { border-bottom: 0; }
.hist .txt { font-family: var(--font-te); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-pick { display: flex; gap: 10px; align-items: center; }
.voice-pick .avatar { width: 38px; height: 38px; font-size: 15px; border-radius: 11px; }
.voice-pick select { flex: 1; }

/* keys */
.key-once { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.key-once code { flex: 1; word-break: break-all; font-size: 13.5px; }
.voices-select { display: flex; flex-wrap: wrap; gap: 8px; max-height: 150px; overflow: auto; padding: 2px; }
.voices-select label { display: flex; gap: 6px; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.voices-select label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* chart */
.chart svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart .bar:hover { opacity: .8; }

/* chart tooltip + operator pages */
.viz-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 8px 11px; font-size: 12.5px; min-width: 140px; }
.viz-tip b { display: block; margin-bottom: 4px; font-weight: 650; }
.viz-tip .r { display: flex; gap: 8px; align-items: center; justify-content: space-between; color: var(--text-2); }
.viz-tip .r i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.viz-tip .r span:last-child { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.chart .hit { cursor: default; }
.chart .hit:hover + .col-hl, .chart .col-hl.on { opacity: 1; }
.tbl tr.click { cursor: pointer; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-head .avatar { width: 64px; height: 64px; font-size: 26px; border-radius: 18px; }
.profile-head h2 { margin: 0; font-size: 20px; }
.kvlist { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; }
.kvlist dt { color: var(--text-3); }
.kvlist dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.timeline { display: flex; flex-direction: column; }
.timeline .ev { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: start; }
.timeline .ev:last-child { border-bottom: 0; }
.timeline .ev .pip { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--line-2); }
.timeline .ev .pip.accent { background: var(--accent); } .timeline .ev .pip.good { background: var(--good); }
.timeline .ev .pip.warn { background: var(--warn); } .timeline .ev .pip.bad { background: var(--bad); }
.share { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--panel-2); }
.share > i { display: block; height: 100%; }
.legend-inline { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* docs */
.docs h2 { font-size: 17px; margin: 0 0 6px; }
.docs p { color: var(--text-2); margin: 0 0 12px; }
.endpoint { display: flex; gap: 10px; align-items: center; font-family: var(--mono); font-size: 13.5px; margin-bottom: 8px; }
.method { font-weight: 700; font-size: 11.5px; padding: 3px 8px; border-radius: 6px; font-family: var(--mono); }
.method.get { background: var(--good-soft); color: var(--good); }
.method.post { background: var(--accent-soft); color: var(--accent-ink); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { background: none; border: 0; padding: 8px 14px; cursor: pointer; color: var(--text-3); font-weight: 580; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.params td:first-child { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }

/* modal + toast */
.overlay { position: fixed; inset: 0; background: rgba(10, 10, 25, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; animation: rise .18s ease-out; }
.modal header { padding: 20px 22px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.modal header h2 { margin: 0; font-size: 18px; }
.modal header p { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }
.modal .body { padding: 18px 22px; }
.modal footer { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px) scale(.98); opacity: 0; } }
#toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--good); box-shadow: var(--shadow-lg); border-radius: 12px; padding: 12px 16px; min-width: 260px; max-width: 420px; animation: rise .2s; font-size: 13.5px; }
.toast.err { border-left-color: var(--bad); }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .engine { margin-top: 16px; }
  #view, .topbar { padding-left: 16px; padding-right: 16px; }
  .kv, .quality { grid-template-columns: 1fr 1fr; }
  .hist .item { grid-template-columns: 1fr; }
}
