:root {
  --bg: #f6f8f7; --card: #ffffff; --ink: #142019; --muted: #6b7a72; --line: #e3e9e5;
  --accent: #1F7A5A; --accent-soft: #E7F3ED; --live: #e5484d; --shadow: 0 10px 40px rgba(20,30,25,.10);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0d1512; --card: #14201b; --ink: #e8efe9; --muted: #8fa39a; --line: #24322b; --accent: #4CB58C; --accent-soft: #163027; --shadow: 0 10px 40px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif; display: flex; align-items: center; justify-content: center; padding: 16px; }
#stt { width: 100%; max-width: 680px; }
.s-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 22px 22px 18px; }
.s-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.s-mark { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; background: linear-gradient(135deg,#1F7A5A,#b58b2a); color: #fff; font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.s-title { font-weight: 800; font-size: 18px; }
.s-sub { color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.5; }
.s-auth { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.s-langseg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.s-langseg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; padding: 6px 10px; cursor: pointer; }
.s-langseg button.on { background: var(--accent); color: #fff; }
.s-authbtn { border: 1px solid var(--accent); color: var(--accent); background: transparent; border-radius: 10px; padding: 6px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-status { min-height: 20px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.s-out { min-height: 180px; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-size: 18px; line-height: 2; background: var(--bg); unicode-bidi: plaintext; text-align: start; white-space: pre-wrap; word-break: break-word; }
.s-out.empty::before { content: attr(data-ph); color: var(--muted); font-size: 15px; }
.s-partial { color: var(--muted); }
.s-bar { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.s-mic { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 15px; padding: 12px 20px; cursor: pointer; }
.s-mic .s-mic-ico { width: 16px; height: 16px; border-radius: 50%; background: #fff; display: inline-block; }
#stt.live .s-mic { background: var(--live); }
#stt.live .s-mic .s-mic-ico { animation: pulse 1s infinite; }
.s-mic.busy { opacity: .7; pointer-events: none; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.6); opacity: .5; } }
.s-btn { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 12px; font: inherit; font-size: 14px; padding: 11px 14px; cursor: pointer; }
.s-btn:hover { background: var(--bg); }
.s-note { color: var(--muted); font-size: 12px; margin-top: 12px; line-height: 1.6; }
.s-small { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; border-top: 1px dashed var(--line); padding-top: 10px; }
.s-small .s-models { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.s-small .s-models:hover { text-decoration: underline; }
