:root{
  --bg:#0B0C0E; --surface:#15171A; --surface2:#111315; --line:#1E2125; --line2:#23262B;
  --txt:#EDEEF0; --mut:#9AA0A6; --accent:#2EC4B6; --rec:#E5484D; --bad:#FF6B6E;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%}
body{
  background:var(--bg);color:var(--txt);
  font-family:Rubik,system-ui,-apple-system,"Segoe UI",sans-serif;
  direction:rtl;display:flex;flex-direction:column;min-height:100dvh;
}
button{font:inherit;color:inherit;cursor:pointer}
svg{flex:none}

header{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:calc(14px + env(safe-area-inset-top)) 16px 12px;border-bottom:1px solid var(--line)
}
.brand{display:flex;align-items:center;gap:10px}
header h1{font-size:1.2rem;margin:0;font-weight:700;letter-spacing:-.01em}
.dot{width:10px;height:10px;border-radius:50%;background:#3A3F45}
body.rec .dot{background:var(--rec)}
.pair{
  display:flex;align-items:center;gap:6px;font-size:.82rem;color:var(--mut);
  background:var(--surface);border:1px solid var(--line2);border-radius:99px;padding:6px 12px
}
.pair b{color:var(--txt);font-weight:500}

.toolbar{display:flex;gap:8px;padding:12px 16px}
.tb{
  flex:1;height:44px;border-radius:12px;border:1px solid var(--line2);background:var(--surface);
  font-size:.92rem;font-weight:600;display:flex;align-items:center;justify-content:center;gap:6px
}
.tb.wide{flex:1.4}
.tb.on{border-color:var(--accent);background:rgba(46,196,182,.12);color:var(--accent)}

main{flex:1;display:flex;flex-direction:column;padding:4px 16px 12px;min-height:0}
#caps{flex:1;overflow-y:auto;min-height:0;scroll-behavior:smooth;display:flex;flex-direction:column}
#caps>:first-child{margin-top:auto}
.line{
  background:var(--surface);border:1px solid var(--line);border-radius:16px;
  padding:14px 16px;margin:5px 0;line-height:1.4
}
.line .he{font-size:var(--fs,1.4rem);font-weight:600}
.line .ru{direction:ltr;text-align:left;color:var(--mut);font-size:.82rem;margin-top:6px;display:none}
body.showru .line .ru,.line.interim .he:empty+.ru{display:block}
.line.interim{background:transparent;border:1px dashed #33383E}
.line.interim .he{color:#B8BDC3}
.empty{margin:auto;text-align:center;color:var(--mut);display:flex;flex-direction:column;align-items:center;gap:14px;padding:20px 16px}
.empty .ico{
  width:64px;height:64px;border-radius:20px;background:var(--surface);border:1px solid var(--line2);
  display:grid;place-items:center
}
.empty h2{margin:0;color:var(--txt);font-size:1.35rem;font-weight:600;line-height:1.35}
.empty p{margin:0;font-size:.95rem;line-height:1.5;max-width:260px}

.foot{
  background:var(--surface2);border-top:1px solid var(--line);
  padding:16px 16px calc(20px + env(safe-area-inset-bottom));
  display:flex;flex-direction:column;align-items:center;gap:8px
}
.mic{
  width:76px;height:76px;border-radius:50%;border:0;background:var(--accent);color:var(--bg);
  display:grid;place-items:center
}
.mic .stop{display:none;width:22px;height:22px;border-radius:5px;background:#fff}
.mic.rec{background:var(--rec);animation:ring 1.4s infinite}
.mic.rec .stop{display:block}
.mic.rec svg{display:none}
@keyframes ring{0%{box-shadow:0 0 0 0 rgba(229,72,77,.45)}100%{box-shadow:0 0 0 22px rgba(229,72,77,0)}}
#state{display:flex;align-items:center;gap:8px;color:var(--mut);font-size:.9rem}
.bars{display:none;align-items:flex-end;gap:3px;height:14px}
.bars i{width:3px;border-radius:2px;background:var(--rec);animation:bar 1s ease-in-out infinite}
.bars i:nth-child(1){height:6px}
.bars i:nth-child(2){height:14px;animation-delay:.2s}
.bars i:nth-child(3){height:9px;animation-delay:.4s}
@keyframes bar{50%{transform:scaleY(.4)}}
body.rec .bars{display:flex}
.err{color:var(--bad);font-weight:600;font-size:.9rem;text-align:center}
.err:empty{display:none}
@media (prefers-reduced-motion:reduce){.mic.rec,.bars i{animation:none}}
