[hidden] { display: none !important; }
:root {
  --bg: #f4f1ea; --card: #ffffff; --ink: #1d232b; --muted: #6b7380; --line: #e2ddd2;
  --accent: #1f3a5f; --accent-ink: #fff; --live: #c0392b; --ok: #2e7d4f;
  --fs: 1.35rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161c; --card: #1b2129; --ink: #eef1f5; --muted: #98a2b0; --line: #2a323d;
          --accent: #8fb3e0; --accent-ink: #0d1420; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink);
       font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
header { display: flex; justify-content: space-between; align-items: center;
         padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
         background: var(--accent); color: var(--accent-ink); }
.brand { font-weight: 700; letter-spacing: .02em; }
.pill { font-size: .8rem; padding: 3px 10px; border-radius: 99px; background: rgba(255,255,255,.18); }
.pill.on::before { content: "● "; color: #6fe39b; }
.pill.live::before { content: "● "; color: #ff6b5b; }
.pill.off::before { content: "● "; color: #f5c84b; }

main { max-width: 760px; margin: 0 auto; padding: 12px 12px 110px; display: flex; flex-direction: column; gap: 12px;
       height: calc(100% - 52px); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; overflow: hidden; }
.panel-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 4px; }
.lang-tag { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.hint { font-size: .8rem; color: var(--muted); }
.source { flex: 0 0 auto; max-height: 26vh; display: flex; flex-direction: column; }
.target { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.text { overflow-y: auto; scroll-behavior: smooth; }
.text.small { font-size: calc(var(--fs) * .72); color: var(--muted); }
.text.big { font-size: var(--fs); flex: 1; }
.text p { margin: 0 0 .55em; }
.text .new { animation: fade .5s ease; }
.text .interim { color: var(--muted); font-style: italic; opacity: .8; }
.text .pending { color: var(--muted); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.waiting { color: var(--muted); text-align: center; margin: auto; padding: 24px; }

.picker { display: flex; align-items: center; gap: 10px; }
.picker label { font-weight: 600; white-space: nowrap; }
.picker select { flex: 1; font-size: 1.05rem; padding: 10px 12px; border-radius: 10px;
                 border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.size { display: flex; gap: 4px; }
.size button { font-size: .95rem; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line);
               background: var(--card); color: var(--ink); }

.sound { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom));
         display: flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 99px; border: 0;
         font-size: 1.05rem; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }
.sound.muted { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.sound.on { background: var(--ok); color: #fff; }

/* speaker page */
.speaker main { max-width: 820px; height: auto; padding-bottom: 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.big-btn { font-size: 1.2rem; font-weight: 700; padding: 16px 28px; border-radius: 12px; border: 0; cursor: pointer;
           background: var(--accent); color: var(--accent-ink); }
.big-btn.stop { background: var(--live); color: #fff; }
.big-btn:disabled { opacity: .5; cursor: default; }
input[type=password], input[type=text] { font-size: 1.1rem; padding: 12px; border-radius: 10px; width: 140px;
           border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.stat { font-size: 2rem; font-weight: 700; }
.muted-t { color: var(--muted); font-size: .9rem; }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; flex: 1; min-width: 120px; }
.meter > div { height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.warn { background: #fff3cd; color: #6b4e00; border-radius: 10px; padding: 10px 12px; }
@media (prefers-color-scheme: dark) { .warn { background: #3a3110; color: #f5d97a; } }
.qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr img { width: 150px; height: 150px; background: #fff; border-radius: 10px; padding: 6px; }
.chips span { display: inline-block; padding: 2px 10px; margin: 2px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: .85rem; }
#live { min-height: 160px; max-height: 50vh; font-size: 1.15rem; }

.mic-note { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom));
            max-width: 92%; padding: 12px 18px; border-radius: 14px; background: var(--card); color: var(--muted);
            border: 1px solid var(--line); font-size: .95rem; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.12); }

.light-note { color: var(--muted); opacity: .75; font-size: .85rem; margin: 6px 0 0; }
.chips span b { font-weight: 700; }
