/* Voice Exchanger. Copyright (c) 2026 OptimaTech Labs, LLC */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #1a1a19;
  --ink-2: #3d3d3a;
  --muted: #73726c;
  --line: #e8e7e3;
  --line-2: #d6d5d0;
  --head: #f7f7f5;
  --accent: #2b2b29;
  --accent-hover: #000000;
  --accent-ink: #ffffff;
  --accent-soft: #efeeea;
  --side: #f5f4f1;
  --side-2: #f5f4f1;
  --side-line: #e6e5e0;
  --side-ink: #2b2b29;
  --side-muted: #8a8983;
  --side-active: #e9e8e3;
  --side-hover: #eeede9;
  --steel: #2b2b29;
  --rec: #c2412d;
  --ok: #3d7a4f;
  --ok-soft: #e6f0e8;
  --warn: #8c6514;
  --warn-soft: #f6eedb;
  --bad-soft: #f8e5e1;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624;
    --panel: #2b2b29;
    --ink: #ecebe6;
    --ink-2: #c9c8c2;
    --muted: #9b9a93;
    --line: #3a3a37;
    --line-2: #4a4a46;
    --head: #30302d;
    --accent: #ecebe6;
    --accent-hover: #ffffff;
    --accent-ink: #1a1a19;
    --accent-soft: #3a3a37;
    --side: #1f1f1e;
    --side-2: #1f1f1e;
    --side-line: #333331;
    --side-ink: #e2e1dc;
    --side-muted: #8f8e88;
    --side-active: #34342f;
    --side-hover: #2b2b28;
    --steel: #ecebe6;
    --ok: #86b894;
    --ok-soft: #29342c;
    --warn: #d4b26a;
    --warn-soft: #3a3324;
    --bad-soft: #42291f;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  display: grid; grid-template-columns: 232px 1fr;
}
button, input, select { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 12px; }
.grow { flex: 1; }

/* sidebar */
.side {
  background: var(--side); color: var(--side-ink); border-right: 1px solid var(--side-line); display: flex; flex-direction: column;
  padding: 18px 12px; -webkit-app-region: drag;
}
.side button { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 8px 22px; border-bottom: 1px solid var(--side-line); margin-bottom: 14px; }
.mark { width: 30px; height: 30px; padding: 5px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); stroke-width: 2.2; flex: none; }
.product { font-weight: 650; color: var(--side-ink); font-size: 14px; letter-spacing: -.01em; }
.org { font-size: 11px; color: var(--side-muted); }
.tabs { display: flex; flex-direction: column; gap: 2px; }
.tabs button {
  display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--side-ink);
  padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px;
}
.tabs button svg { width: 17px; height: 17px; opacity: .75; }
.tabs button:hover { background: var(--side-hover); }
.tabs button[aria-selected="true"] { background: var(--side-active); color: var(--side-ink); font-weight: 600; }
.tabs button[aria-selected="true"] svg { opacity: 1; }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 6px; }
.conn { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.conn.ok .dot { background: #22c55e; }
.conn.bad .dot { background: #ef4444; }
.ver { font-size: 11px; color: var(--side-muted); }

/* page */
.shell { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.pagebar {
  display: flex; align-items: baseline; gap: 14px; padding: 18px 28px; background: var(--panel);
  border-bottom: 1px solid var(--line); -webkit-app-region: drag;
}
.pagebar h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.pagehint { color: var(--muted); }
main { flex: 1; overflow: auto; padding: 24px 28px 32px; }
.tab { max-width: 1180px; display: flex; flex-direction: column; gap: 20px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .grid { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; min-width: 0; }
.panel.narrow { max-width: 560px; }
.panel-h { background: transparent; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.panel-h h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.panel-b { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 1px 7px; }

/* capture */
.capture { display: flex; align-items: center; gap: 14px; }
.rec {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.rec span { width: 16px; height: 16px; border-radius: 50%; background: var(--rec); transition: all .15s; }
.rec.on { border-color: var(--rec); box-shadow: 0 0 0 4px var(--bad-soft); }
.rec.on span { border-radius: 3px; width: 14px; height: 14px; }
.rec-label { font-weight: 600; }
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 18px; cursor: pointer; color: var(--ink-2);
  background: var(--head);
}
.drop svg { width: 20px; height: 20px; color: var(--muted); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
audio { width: 100%; height: 34px; }
.src { display: flex; flex-direction: column; gap: 8px; }
.file { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
input:not([type]), input[type="password"], input[list], select, textarea {
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; align-self: flex-start; }
.seg button { border: 0; background: var(--panel); padding: 6px 18px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* tables */
.table-wrap { overflow-x: auto; }
.panel-b .table-wrap { border: 1px solid var(--line); border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  background: var(--head); padding: 8px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.voice { cursor: pointer; }
.table tr.voice:hover td { background: var(--head); }
.table tr.voice[aria-selected="true"] td { background: var(--accent-soft); }
.table tr.voice[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.vname { font-weight: 600; }
.vsub { font-size: 11.5px; color: var(--muted); }
.group td { background: var(--head); font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ready { background: var(--ok-soft); color: var(--ok); }
.badge.training { background: var(--warn-soft); color: var(--warn); }
.badge.failed { background: var(--bad-soft); color: var(--rec); }
.table audio { min-width: 220px; }
.btn {
  border: 1px solid var(--line-2); background: var(--panel); border-radius: 8px; padding: 5px 12px; cursor: pointer; font-weight: 600;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.primary {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 9px 18px;
  font-weight: 600; cursor: pointer; align-self: flex-start; min-width: 140px;
}
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary:disabled { opacity: .45; cursor: default; }
.primary.busy { opacity: .75; cursor: progress; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: 12px; font-weight: 600; }
.err { color: var(--rec); background: var(--bad-soft); padding: 8px 12px; border-radius: 8px; font-size: 12.5px; }

.clips { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.clips:empty { display: none; }
.clips li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.clips li:last-child { border-bottom: 0; }
.clips li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter, .bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter div, .bar div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.bar { min-width: 140px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; padding: 12px 14px; background: var(--head); border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); }
.consent input { margin-top: 3px; accent-color: var(--accent); }
.credits { font-size: 11.5px; margin: 0; }
.vcell { display: flex; align-items: center; gap: 10px; }
.play {
  width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.play svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.play:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, var(--accent-ink) 35%, transparent); border-top-color: var(--accent-ink);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .track { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; position: relative; }
.progress .track div {
  position: absolute; top: 0; bottom: 0; width: 35%; border-radius: 99px; background: var(--accent);
  animation: slide 1.3s ease-in-out infinite;
}
@keyframes slide { from { left: -35%; } to { left: 100%; } }
.xl { font-size: 12px; color: var(--ink-2); margin-top: 4px; max-width: 360px; }
.xl span { color: var(--muted); font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats > div { background: var(--head); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.stat { font-size: 22px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.badge.live { background: var(--bad-soft); color: var(--rec); }
.badge.idle { background: var(--head); color: var(--muted); }
select { background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; width: 100%; }

.sendbar { border-bottom: 1px solid var(--line); }
.sendbar .field { max-width: 520px; margin: 0; }
.playcell { display: flex; align-items: center; gap: 10px; }
.playto { display: inline-flex; align-items: center; gap: 6px; }
.playto svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
textarea { font: inherit; color: var(--ink); resize: vertical; min-height: 140px; line-height: 1.5; }
.cablebtn { align-self: flex-start; margin-top: 4px; }
.nosink select, .nosink label, .nosink .cablebtn { display: none; }
.cableguide { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-top: 6px; background: var(--side); }
.cableguide ol { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.cableguide .dl { text-decoration: none; display: inline-flex; align-items: center; }
.callsel { display: none !important; }
.callstatus { margin: 0 0 12px; }
.callsetup .field { margin: 0; gap: 0; }
.callsetup .cablebtn, .callsetup .cableguide { margin: 0 0 12px; }
#callTest { white-space: nowrap; flex: none; }
.primary.big { padding: 11px 22px; font-size: 14px; }
.callsay { align-items: stretch; }
.callsay textarea { min-height: 52px; flex: 1; }
.callapp { width: auto; min-width: 200px; }
.appsteps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.appsteps b { font-weight: 600; }
#callLiveBox .meter { margin-top: 14px; }
.ok-text { color: var(--ok); font-weight: 600; }
.bad-text { color: var(--rec); font-weight: 600; }
