/* ═══════════════════════════════════════════════════════════════
   Glipter Studio — application design system
   A Zabibu Technika product · Tehillah Kachila
   ═══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;
  --bg: #060911;
  --bg-soft: #0a0f1a;
  --surface: rgba(14, 21, 35, 0.86);
  --surface-solid: #0d1422;
  --surface-2: #131d2f;
  --surface-3: #1a2740;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e9effb;
  --text-soft: #c6d2e8;
  --muted: #93a3bf;
  --faint: #8191a9;
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --accent-ink: #04121d;
  --accent-fill: #38bdf8;
  --accent-fill-ink: #04121d;
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --glow: rgba(56, 189, 248, 0.2);
  --glow-2: rgba(167, 139, 250, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.22);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --header-h: 54px;
  --rail-w: 84px;
  --status-h: 26px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f8;
  --bg-soft: #e5ebf4;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-2: #edf2f9;
  --surface-3: #e0e7f1;
  --border: rgba(15, 23, 42, 0.11);
  --border-strong: rgba(15, 23, 42, 0.22);
  --text: #0b1525;
  --text-soft: #24334d;
  --muted: #4d5d78;
  --faint: #57667d;
  --accent: #0284c7;
  --accent-2: #7c3aed;
  --accent-3: #0891b2;
  --accent-ink: #ffffff;
  --accent-fill: #0369a1;
  --accent-fill-ink: #ffffff;
  --success: #047857;
  --warn: #b45309;
  --danger: #be123c;
  --glow: rgba(2, 132, 199, 0.12);
  --glow-2: rgba(124, 58, 237, 0.09);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.07);
}

/* Studio theme — warm lilac/cream learning-app language, inspired by
   friendly sign-language teaching decks and guided-practice products. */
html[data-theme="studio"] {
  color-scheme: light;
  --bg: #f4ecff;
  --bg-soft: #efe3ff;
  --surface: rgba(255, 253, 248, 0.94);
  --surface-solid: #fffdf8;
  --surface-2: #f7f0ff;
  --surface-3: #e9dcff;
  --border: rgba(42, 23, 69, 0.2);
  --border-strong: rgba(42, 23, 69, 0.52);
  --text: #24133d;
  --text-soft: #3b245c;
  --muted: #5f4a7d;
  --faint: #725e8d;
  --accent: #7c3aed;
  --accent-2: #a78bfa;
  --accent-3: #34d399;
  --accent-ink: #ffffff;
  --accent-fill: #7c3aed;
  --accent-fill-ink: #ffffff;
  --success: #047857;
  --warn: #b45309;
  --danger: #be123c;
  --glow: rgba(167, 139, 250, 0.25);
  --glow-2: rgba(52, 211, 153, 0.2);
  --shadow: 0 24px 70px rgba(58, 28, 100, 0.18);
  --shadow-sm: 5px 5px 0 rgba(42, 23, 69, 0.1);
  --radius: 18px;
  --radius-sm: 12px;
}
html[data-theme="studio"] body {
  background:
    radial-gradient(720px 540px at 4% 4%, rgba(52, 211, 153, 0.38), transparent 58%),
    radial-gradient(900px 680px at 100% -8%, rgba(167, 139, 250, 0.46), transparent 62%),
    radial-gradient(560px 440px at 76% 105%, rgba(244, 114, 182, 0.12), transparent 60%),
    #f4ecff;
}
html[data-theme="studio"] body::before {
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(42, 23, 69, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 23, 69, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 80%);
}
html[data-theme="studio"] .app-bar {
  background: color-mix(in srgb, #fbf7ff 82%, transparent);
  border-bottom: 2px solid var(--border-strong);
}
html[data-theme="studio"] .side-rail {
  background: rgba(255, 253, 248, 0.68);
  border-right: 2px solid var(--border-strong);
}
html[data-theme="studio"] .rail-item.is-active {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--border-strong);
  box-shadow: 2px 2px 0 rgba(42, 23, 69, 0.25);
}
html[data-theme="studio"] .rail-item.is-active .icon { color: #fff; }
html[data-theme="studio"] .panel {
  background: var(--surface-solid);
  border: 2px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 5px 5px 0 rgba(42, 23, 69, 0.1);
}
html[data-theme="studio"] .panel::before { display: none; }
html[data-theme="studio"] .panel-head { border-bottom: 2px solid var(--border); }
html[data-theme="studio"] .btn {
  border-width: 2px;
  border-color: var(--border-strong);
  border-radius: 999px;
  font-weight: 700;
}
html[data-theme="studio"] .btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--border-strong);
  box-shadow: 3px 3px 0 rgba(42, 23, 69, 0.26);
}
html[data-theme="studio"] .btn-primary:hover:not(:disabled) {
  background: #6d28d9;
  box-shadow: 4px 4px 0 rgba(42, 23, 69, 0.26);
}
html[data-theme="studio"] .btn-secondary { background: #fffdf8; }
html[data-theme="studio"] .btn-ghost { border-color: transparent; }
html[data-theme="studio"] .icon-btn {
  border-width: 2px;
  border-color: var(--border-strong);
  background: #fffdf8;
  border-radius: 12px;
}
html[data-theme="studio"] .status-chip {
  border-width: 1.5px;
  border-color: var(--border-strong);
  background: #fffdf8;
  color: var(--muted);
  border-radius: 999px;
}
html[data-theme="studio"] .pill {
  border-width: 1.5px;
  border-color: var(--border-strong);
}
html[data-theme="studio"] .seg { border-radius: 999px; }
html[data-theme="studio"] .seg.is-active { background: var(--accent); color: #fff; }
html[data-theme="studio"] .brand-mark {
  background: linear-gradient(145deg, #34d399, #a78bfa);
  border: 2px solid var(--border-strong);
  box-shadow: 3px 3px 0 rgba(42, 23, 69, 0.25);
}
html[data-theme="studio"] .brand-mark svg { stroke: #24133d; }
html[data-theme="studio"] .brand-text strong span { color: var(--accent); }
html[data-theme="studio"] .camera-stage {
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  margin: 7px 9px 0;
}
html[data-theme="studio"] .stream { background: #f7f0ff; border: 1.5px solid var(--border); }
html[data-theme="studio"] .stream.english { background: #fffdf8; border-color: var(--border-strong); }
html[data-theme="studio"] .confidence-track { background: #e9dcff; border: 1px solid var(--border); }
html[data-theme="studio"] .current-sign { color: var(--accent); text-shadow: none; }
html[data-theme="studio"] .current-sign.is-empty { color: var(--faint); }
html[data-theme="studio"] .session-stats > div { background: #f7f0ff; }
html[data-theme="studio"] .timeline-item { background: #f7f0ff; border: 1.5px solid var(--border); }
html[data-theme="studio"] .camera-menu {
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 4px 4px 0 rgba(42, 23, 69, 0.12);
}
html[data-theme="studio"] .practice-hero {
  border: 2px solid var(--border-strong);
  box-shadow: 5px 5px 0 rgba(42, 23, 69, 0.1);
}
html[data-theme="studio"] .sign-state { border-width: 1.5px; }
html[data-theme="studio"] .details-toggle { color: var(--muted); }
html[data-theme="studio"] .learn-card,
html[data-theme="studio"] .alphabet-card {
  background: #fffdf8;
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 3px 3px 0 rgba(42, 23, 69, 0.12);
}
html[data-theme="studio"] .learn-card.is-active { background: #efe3ff; border-color: var(--accent); }
html[data-theme="studio"] .learn-card:hover,
html[data-theme="studio"] .alphabet-card:hover { transform: translateY(-2px); }
html[data-theme="studio"] .mini-hand { color: var(--text-soft); }
html[data-theme="studio"] .mini-hand line { stroke: var(--text-soft); stroke-width: 4.2; }
html[data-theme="studio"] .mini-hand circle { fill: var(--accent); }
html[data-theme="studio"] .mini-hand .tip { fill: var(--success); }
html[data-theme="studio"] .mini-hand .palm { fill: rgba(52, 211, 153, 0.32); }
html[data-theme="studio"] .learn-svg {
  background: radial-gradient(circle at 50% 40%, rgba(52, 211, 153, 0.15), transparent 70%), #f7f0ff;
  border: 2px solid var(--border-strong);
}
html[data-theme="studio"] .settings-dialog,
html[data-theme="studio"] .command-dialog,
html[data-theme="studio"] .onboarding-dialog {
  border: 2px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 8px 8px 0 rgba(42, 23, 69, 0.15);
}
html[data-theme="studio"] .command-item.is-active { background: #efe3ff; }
html[data-theme="studio"] .status-bar {
  background: #fffdf8;
  border-top: 2px solid var(--border-strong);
  color: var(--muted);
}
html[data-theme="studio"] .error-banner { border: 2px solid #9f1239; }
html[data-theme="studio"] .practice-banner {
  border: 2px solid var(--border-strong);
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.22), rgba(167, 139, 250, 0.16));
}
html[data-theme="studio"] .glyph { background: #fffdf8; border: 1.5px solid var(--border-strong); }
html[data-theme="studio"] .dataset-item,
html[data-theme="studio"] .model-card,
html[data-theme="studio"] .roadmap-item { background: #f7f0ff; border: 1.5px solid var(--border); }
html[data-theme="studio"] .quote { background: #efe3ff; border-left: 4px solid var(--success); }

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 76% -10%, var(--glow), transparent 62%),
    radial-gradient(760px 480px at 4% 8%, var(--glow-2), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, svg, video, canvas { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -0.03em; font-weight: 720; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.1em; height: 1.1em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 26px; height: 26px; stroke-width: 1.5; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 1000;
  transform: translateY(-160%);
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 999px; font-weight: 700; text-decoration: none;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateY(0); }

/* ── App shell ─────────────────────────────────────────────── */
.app-shell { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.app-bar {
  height: var(--header-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 30;
}
.app-bar-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; min-width: max-content; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.18), rgba(167, 139, 250, 0.11));
  border: 1px solid rgba(56, 189, 248, 0.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 6px 18px rgba(56,189,248,0.12);
}
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2.7; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-size: 1.08rem; letter-spacing: -0.04em; }
.brand-text strong span { color: var(--accent); }
.brand-text small { font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.workspace-crumb { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 0.72rem; color: var(--text-soft); white-space: nowrap; }
.crumb-muted { color: var(--faint); }
.crumb-sep { color: var(--faint); }
.tier-chip { font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.12em; color: var(--accent); border: 1px solid rgba(56,189,248,0.28); background: rgba(56,189,248,0.07); padding: 2px 6px; border-radius: 4px; margin-left: 4px; }

.app-bar-status { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.03em; white-space: nowrap;
}
.status-chip .icon { width: 13px; height: 13px; }
.status-chip.running { color: var(--success); border-color: color-mix(in srgb, var(--success) 32%, transparent); background: color-mix(in srgb, var(--success) 7%, transparent); }
.status-chip.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, transparent); }
.status-chip.pill-success { color: var(--success); border-color: color-mix(in srgb, var(--success) 32%, transparent); background: color-mix(in srgb, var(--success) 7%, transparent); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.status-chip.running .status-dot { background: var(--success); box-shadow: 0 0 8px var(--success); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.app-bar-actions { display: flex; align-items: center; gap: 6px; }
.command-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.command-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.command-btn .icon { width: 15px; height: 15px; }
.command-btn kbd { font-family: var(--mono); font-size: 0.56rem; color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px; background: var(--surface-solid); }

.lang-select select {
  appearance: none;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393a3bf' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center;
  border: 1px solid var(--border); color: var(--text); border-radius: 7px;
  padding: 6px 28px 6px 10px; font-family: var(--mono); font-size: 0.66rem;
  max-width: 176px; cursor: pointer;
}
.lang-select select:hover { border-color: var(--border-strong); }

.app-body { flex: 1; display: flex; min-height: 0; }

.side-rail {
  width: var(--rail-w); flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  padding: 8px 7px; border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
}
.rail-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 54px; padding: 7px 4px;
  border: 1px solid transparent; border-radius: 9px;
  background: transparent; color: var(--faint);
  font-size: 0.58rem; font-weight: 600; letter-spacing: 0.01em;
  transition: color 0.16s, background 0.16s, border-color 0.16s;
}
.rail-item .icon { width: 19px; height: 19px; }
.rail-item kbd { display: none; }
.rail-item:hover { color: var(--text-soft); background: var(--surface-2); }
.rail-item.is-active { color: var(--accent); background: rgba(56,189,248,0.08); border-color: rgba(56,189,248,0.2); }
.rail-spacer { flex: 1; }
.rail-foot { text-align: center; font-size: 0.5rem; color: var(--faint); padding: 6px 0 2px; }
.rail-item#rail-settings { min-height: 46px; }

.app-main { flex: 1; min-width: 0; overflow: auto; padding: 12px; }
.app-view { display: flex; flex-direction: column; gap: 12px; min-height: 100%; animation: view-in 0.25s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Panels & controls ────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, white 1%), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; min-height: 0;
  position: relative; overflow: hidden;
}
.panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent); pointer-events: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.panel-head.compact { padding: 9px 12px; }
.panel-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.panel-eyebrow { font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.panel-title h1 { font-size: 1.08rem; letter-spacing: -0.02em; }
.panel-title h2 { font-size: 0.92rem; letter-spacing: -0.01em; }
.panel-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tool-divider { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
  padding: 7px 11px; font-size: 0.76rem; font-weight: 600; white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.15s, border-color 0.15s, opacity 0.15s, box-shadow 0.15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--border-strong); background: var(--surface-3); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn .icon { width: 15px; height: 15px; }
.btn-sm { padding: 6px 9px; font-size: 0.7rem; border-radius: 6px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { padding: 11px 18px; font-size: 0.86rem; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-3)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px rgba(56,189,248,0.18); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--accent), var(--accent-3)); box-shadow: 0 8px 22px rgba(56,189,248,0.26); }
.btn-secondary { background: var(--surface-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.icon-btn-sm { width: 28px; height: 28px; border-radius: 6px; }
.icon-btn .icon { width: 16px; height: 16px; }

.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 0.68rem; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { appearance: none; width: 38px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background 0.16s, border-color 0.16s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.16s var(--ease), background 0.16s; }
.switch input:checked { background: rgba(56,189,248,0.22); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(14px); background: var(--accent); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; }
.seg { border: 0; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 6px; font-size: 0.68rem; font-weight: 650; transition: background 0.15s, color 0.15s; }
.seg:hover { color: var(--text); }
.seg.is-active { background: var(--accent-fill); color: var(--accent-fill-ink); box-shadow: 0 2px 8px rgba(56,189,248,0.22); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.02em; white-space: nowrap; }
.pill-accent { color: var(--accent); border-color: rgba(56,189,248,0.28); background: rgba(56,189,248,0.07); }
.badge { font-family: var(--mono); font-size: 0.58rem; padding: 4px 7px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.badge.pass { color: var(--success); border-color: color-mix(in srgb, var(--success) 32%, transparent); background: color-mix(in srgb, var(--success) 7%, transparent); }
.badge.fail { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.label { font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--faint); }
.label-note { text-transform: none; letter-spacing: 0; color: var(--muted); opacity: 1; }

/* ── Studio layout ────────────────────────────────────────── */
.studio { flex: 1; display: grid; grid-template-columns: minmax(0, 3fr) minmax(340px, 2fr); gap: 12px; min-height: 0; width: 100%; max-width: 1560px; margin: 0 auto; }
.studio-main { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.conversation-panel { height: 100%; max-height: none; }
.talk-thread { flex: 1; max-height: none; }

.camera-panel { flex: 1; min-height: 0; }
.camera-stage {
  position: relative; flex: 1; min-height: 300px; overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(56,189,248,0.07), transparent 55%),
    #03060c;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}
.camera-stage::after {
  content: ""; position: absolute; inset: 6px; z-index: 6; pointer-events: none;
  border: 2px solid transparent; border-radius: 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.camera-panel[data-signal="found"] .camera-stage::after {
  border-color: color-mix(in srgb, var(--success) 52%, transparent);
}
.camera-panel[data-signal="committing"] .camera-stage::after {
  border-color: color-mix(in srgb, var(--warn) 62%, transparent);
}
.camera-panel[data-signal="committed"] .camera-stage::after {
  border-color: color-mix(in srgb, var(--accent) 72%, transparent);
  box-shadow: inset 0 0 34px color-mix(in srgb, var(--accent) 22%, transparent);
}
.live-caption {
  position: absolute; left: 9px; right: 9px; bottom: 9px; z-index: 5;
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px 12px; border-radius: 11px;
  background: rgba(5, 9, 17, 0.8); border: 1px solid rgba(148,163,184,0.22);
  color: #eef4ff; backdrop-filter: blur(12px);
  box-shadow: 0 8px 26px rgba(0,0,0,0.28);
}
.camera-panel.is-idle .live-caption { display: none; }
.live-caption-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.live-caption-head .label { color: #9fb0ca; }
.language-chip {
  padding: 2px 6px; border-radius: 999px; border: 1px solid rgba(148,163,184,0.28);
  color: #cbd5e1; font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.02em;
}
.live-caption-text { font-size: clamp(0.92rem, 2.1vw, 1.18rem); font-weight: 650; line-height: 1.35; min-height: 1.3em; }
.live-caption-text:empty::before { content: attr(data-placeholder); color: #93a3bf; font-weight: 400; font-size: 0.76rem; }
.live-caption .spoken-translation { color: #9fd8ff; font-size: 0.65rem; }
.live-caption-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.live-caption-actions .btn { color: #dce8fb; border-color: rgba(148,163,184,0.2); }
.live-caption-actions .btn:hover { background: rgba(148,163,184,0.12); }
#video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.camera-stage.mirror #video { transform: scaleX(-1); }
#overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.camera-placeholder {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  text-align: center; padding: 18px;
  background:
    radial-gradient(circle at 50% 38%, rgba(56,189,248,0.08), transparent 52%),
    #050912;
  color: #93a3bf;
}
.camera-placeholder strong { color: #e9effb; font-size: 0.94rem; }
.camera-placeholder span { color: #93a3bf; font-size: 0.72rem; max-width: 360px; line-height: 1.5; }
.placeholder-mark { width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center; background: rgba(56,189,248,0.07); border: 1px solid rgba(56,189,248,0.2); color: var(--accent); margin-bottom: 2px; }
.placeholder-mark .icon { width: 28px; height: 28px; stroke-width: 1.4; }
.placeholder-actions { display: flex; gap: 6px; margin-top: 6px; }
.framing-guide { position: absolute; inset: 10%; z-index: 3; pointer-events: none; opacity: 0.35; }
.framing-guide span { position: absolute; width: 24px; height: 24px; border-color: rgba(56, 189, 248, 0.6); border-style: solid; }
.framing-guide span:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; border-radius: 5px 0 0 0; }
.framing-guide span:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; border-radius: 0 5px 0 0; }
.framing-guide span:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; border-radius: 0 0 0 5px; }
.framing-guide span:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; border-radius: 0 0 5px 0; }
.stage-chips { position: absolute; top: 9px; left: 9px; right: 9px; display: flex; flex-wrap: wrap; gap: 5px; z-index: 3; pointer-events: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 5px; background: rgba(6,10,18,0.72); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.16); font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.02em; backdrop-filter: blur(8px); }
.chip-live { color: #86efac; border-color: rgba(52,211,153,0.28); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; animation: pulse 2s infinite; }
.error-banner { position: absolute; left: 9px; right: 9px; top: 9px; z-index: 4; padding: 8px 10px; border-radius: 6px; background: rgba(42,10,18,0.94); border: 1px solid rgba(251,113,133,0.36); color: #fecdd3; font-size: 0.72rem; line-height: 1.45; backdrop-filter: blur(8px); }
.camera-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; flex: 0 0 auto; }
.transport-metrics { display: flex; align-items: center; gap: 14px; }
.transport-metrics > span { display: inline-flex; align-items: baseline; gap: 5px; font-size: 0.66rem; color: var(--muted); }
.transport-metrics b { color: var(--text-soft); font-family: var(--mono); font-size: 0.62rem; font-weight: 600; }
.transport-hint { display: none; font-size: 0.6rem; color: var(--faint); align-items: center; gap: 4px; }
kbd { font-family: var(--mono); font-size: 0.56rem; color: var(--text-soft); border: 1px solid var(--border-strong); border-radius: 3px; padding: 1px 4px; background: var(--surface-3); }

/* Timeline */
.timeline-panel { flex: 0 0 auto; }
.timeline { display: flex; gap: 6px; overflow-x: auto; padding: 9px 12px 11px; min-height: 54px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.timeline-empty { padding: 12px; font-size: 0.7rem; color: var(--faint); }
.timeline-item { flex: 0 0 auto; min-width: 92px; display: flex; flex-direction: column; gap: 2px; padding: 6px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.timeline-item .time { font-family: var(--mono); font-size: 0.52rem; color: var(--faint); }
.timeline-item .sign { font-family: var(--mono); font-size: 0.82rem; font-weight: 800; color: var(--accent); letter-spacing: 0.04em; }
.timeline-item .conf { font-size: 0.55rem; color: var(--muted); }

/* Inspector */
.inspector { min-height: 0; }
.inspector {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(440px, 94vw); display: flex; flex-direction: column;
  background: var(--surface-solid); border-left: 1px solid var(--border-strong);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.24);
}
.inspector.is-closed { display: none; }
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(3, 6, 12, 0.36); backdrop-filter: blur(3px);
}
.drawer-backdrop.hidden { display: none; }
.inspector-scroll { flex: 1; overflow: auto; padding: 12px; }
.current-block { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.current-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.current-main { min-width: 0; }
.current-sign { font-family: var(--mono); font-size: clamp(3.4rem, 6.8vw, 5.6rem); line-height: 0.9; letter-spacing: -0.07em; font-weight: 850; color: var(--accent-2); min-height: 1em; text-shadow: 0 0 42px rgba(167,139,250,0.2); transition: color 0.16s, transform 0.16s var(--ease); }
.current-sign.is-active { color: var(--accent); transform: translateY(-1px); }
.current-sign.is-empty { color: var(--faint); font-size: clamp(2.4rem, 4.4vw, 3.4rem); text-shadow: none; }
.current-sign.is-committed { animation: commit-pop 0.45s var(--ease); }
@keyframes commit-pop {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.045); filter: brightness(1.25); text-shadow: 0 0 55px rgba(56,189,248,0.5); }
  100% { transform: scale(1); filter: brightness(1); }
}
.current-label { color: var(--muted); font-size: 0.72rem; margin-top: 4px; min-height: 1.2em; }
.confidence-wrap { width: 128px; flex: 0 0 auto; padding-top: 3px; }
.confidence-track { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 7px; }
.confidence-fill { height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.2s var(--ease); }
.confidence-value { font-size: 0.68rem; color: var(--text-soft); margin-top: 4px; text-align: right; }
.top3 { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; min-height: 22px; }
.top3 .candidate { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 0.58rem; color: var(--muted); }
.top3 .candidate b { color: var(--text); }
.top3 .candidate.is-best { border-color: rgba(56,189,248,0.3); background: rgba(56,189,248,0.07); color: var(--accent); }

.stream-block { margin-top: 11px; }
.stream-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.stream { font-family: var(--mono); font-size: 0.8rem; line-height: 1.5; padding: 8px 9px; min-height: 40px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; word-break: break-word; }
.stream:empty::before,
.asr-transcript:empty::before { content: attr(data-placeholder); color: var(--faint); font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0; }
.stream.gloss { color: var(--accent); letter-spacing: 0.06em; }
.stream.english { color: var(--text); border-color: var(--border-strong); }
.english-wrap { display: flex; align-items: stretch; gap: 5px; }
.english-wrap .stream { flex: 1; }
.output-actions { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 10px; }
.session-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 12px; background: var(--border); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.session-stats > div { background: var(--surface-2); padding: 7px 8px; display: flex; flex-direction: column; gap: 1px; }
.session-stats strong { font-family: var(--mono); font-size: 0.72rem; }
.lang-note { margin-top: 9px; font-size: 0.62rem; color: var(--faint); line-height: 1.55; }

/* ── Page shells (transcript, learn, about) ───────────────── */
.page-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding: 2px 2px 0; flex: 0 0 auto; }
.page-heading { display: flex; flex-direction: column; gap: 3px; max-width: 860px; }
.page-heading h1 { font-size: clamp(1.45rem, 2.2vw, 1.9rem); }
.page-heading p { color: var(--muted); font-size: 0.74rem; max-width: 720px; }
.toolbar-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.summary-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; flex: 0 0 auto; }
.summary-item { padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); }
.summary-item:last-child { border-right: 0; }
.summary-item strong { font-family: var(--mono); font-size: 0.8rem; }

.transcript-card { flex: 1; min-height: 240px; padding: 10px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 7px; padding: 46px 18px; color: var(--muted); }
.empty-icon { width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--faint); }
.empty-icon .icon { width: 24px; height: 24px; }
.empty-state h3 { color: var(--text); font-size: 0.94rem; }
.empty-state p { max-width: 400px; font-size: 0.72rem; }
.transcript-list { display: flex; flex-direction: column; gap: 5px; }
.transcript-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 90px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.transcript-row .time { font-family: var(--mono); font-size: 0.58rem; color: var(--faint); }
.transcript-row .sign { font-family: var(--mono); font-size: 0.84rem; font-weight: 750; color: var(--accent); letter-spacing: 0.04em; }
.transcript-row .sign small { display: block; font-family: var(--sans); font-size: 0.6rem; font-weight: 400; color: var(--faint); letter-spacing: 0; margin-top: 1px; }
.transcript-row .conf { font-family: var(--mono); font-size: 0.56rem; color: var(--muted); text-align: right; }
.transcript-row .conf b { display: block; color: var(--text-soft); font-size: 0.68rem; }

/* Learn */
.library { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; flex: 1; min-height: 0; }
.library-grid-panel { padding: 10px; overflow: auto; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 7px; }
.learn-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px 7px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); transition: transform 0.15s var(--ease), border-color 0.15s, background 0.15s; }
.learn-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.learn-card.is-active { border-color: var(--accent); background: rgba(56,189,248,0.08); box-shadow: 0 0 0 1px var(--accent); }
.learn-card svg { width: 100%; height: 74px; }
.learn-card strong { font-family: var(--mono); font-size: 0.8rem; }
.learn-card small { font-size: 0.48rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.mini-hand { color: var(--accent); overflow: visible; }
.mini-hand line { stroke: currentColor; stroke-width: 3.8; stroke-linecap: round; }
.mini-hand circle { fill: var(--text-soft); }
.mini-hand .tip { fill: var(--accent); }
.mini-hand .palm { fill: rgba(56,189,248,0.1); stroke: none; }
html[data-theme="light"] .mini-hand .palm { fill: rgba(2,132,199,0.1); }
.learn-detail { padding: 0 12px 12px; overflow: auto; }
.learn-svg { height: 190px; display: grid; place-items: center; margin: 9px 0 4px; border-radius: 8px; background: radial-gradient(circle at 50% 40%, rgba(56,189,248,0.07), transparent 70%), var(--surface-2); border: 1px solid var(--border); }
.learn-svg svg { width: 100%; height: 100%; max-height: 182px; }
.learn-detail h3 { font-family: var(--mono); font-size: 1.9rem; color: var(--accent); margin: 2px 0 5px; }
.learn-detail p { color: var(--muted); font-size: 0.68rem; line-height: 1.55; }
.learn-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 11px 0; }
.learn-meta strong { display: block; font-size: 0.66rem; margin-top: 2px; }
.how-to { flex: 0 0 auto; padding-bottom: 12px; }
.how-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 10px 12px 0; }
.how-grid article { padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }
.step-num { font-family: var(--mono); font-size: 0.54rem; color: var(--accent); letter-spacing: 0.08em; }
.how-grid h3 { margin: 5px 0 3px; font-size: 0.76rem; }
.how-grid p { color: var(--muted); font-size: 0.64rem; line-height: 1.5; }

/* About */
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.about-grid .panel > :not(.panel-head) { margin-left: 13px; margin-right: 13px; }
.about-grid .panel > :last-child { margin-bottom: 13px; }
.about-grid .panel p { color: var(--muted); font-size: 0.72rem; line-height: 1.65; margin-bottom: 7px; }
.quote { margin: 12px 0 4px; padding: 10px 12px; border-left: 2px solid var(--accent); border-radius: 0 7px 7px 0; background: var(--surface-2); color: var(--text-soft); font-size: 0.76rem; line-height: 1.5; }
.quote-note { font-family: var(--mono); font-size: 0.54rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.1em; }
.credit-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.credit-row:last-of-type { border-bottom: 0; }
.credit-avatar { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(56,189,248,0.18), rgba(167,139,250,0.14)); border: 1px solid rgba(56,189,248,0.28); color: var(--accent); font-family: var(--mono); font-weight: 800; font-size: 0.7rem; }
.credit-avatar.alt { background: linear-gradient(145deg, rgba(167,139,250,0.18), rgba(56,189,248,0.1)); color: var(--accent-2); border-color: rgba(167,139,250,0.28); }
.credit-row strong { display: block; font-size: 0.76rem; }
.credit-row span { display: block; font-size: 0.6rem; color: var(--faint); }
.fine-print { font-size: 0.62rem !important; color: var(--muted) !important; line-height: 1.55; }
.pipeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.pipeline li { display: flex; gap: 9px; align-items: flex-start; }
.pipeline li > span { font-family: var(--mono); font-size: 0.54rem; color: var(--accent); padding-top: 1px; }
.pipeline strong { display: block; font-size: 0.72rem; }
.pipeline p { margin: 0 !important; font-size: 0.64rem !important; color: var(--faint) !important; }
.dataset-list { display: flex; flex-direction: column; gap: 5px; }
.dataset-item { padding: 8px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.dataset-item strong { display: block; font-size: 0.68rem; }
.dataset-item span { display: block; font-size: 0.6rem; color: var(--muted); margin-top: 1px; }
.dataset-item a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.dataset-item a:hover { color: var(--text); }
.limit-list { margin: 0; padding-left: 15px; color: var(--muted); font-size: 0.68rem; line-height: 1.65; }
.limit-list li { margin-bottom: 4px; }
.offline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 9px; }
.offline-grid > div { display: flex; flex-direction: column; gap: 1px; padding: 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.offline-grid .icon { color: var(--accent); width: 15px; height: 15px; margin-bottom: 2px; }
.offline-grid strong { font-size: 0.64rem; }
.offline-grid span { font-size: 0.56rem; color: var(--faint); }
.self-test-box { margin-top: 10px; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.self-test-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; background: var(--surface-2); }
.self-test-head strong { display: block; font-size: 0.68rem; margin-top: 1px; }
.self-test-details { max-height: 280px; overflow: auto; padding: 4px 9px 8px; }
.self-test-layer { padding: 7px 0; border-bottom: 1px solid var(--border); }
.self-test-layer:last-child { border-bottom: 0; }
.self-test-layer-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.self-test-layer-head strong { font-size: 0.66rem; }
.self-test-layer-head span { font-family: var(--mono); font-size: 0.58rem; }
.self-test-layer p { font-size: 0.58rem; color: var(--faint); margin-bottom: 3px; }
.self-test-row { display: flex; gap: 6px; align-items: baseline; font-family: var(--mono); font-size: 0.56rem; padding: 2px 0; color: var(--faint); }
.self-test-row .ok { color: var(--success); }
.self-test-row .bad { color: var(--danger); }
.self-test-row .name { color: var(--text-soft); }
.self-test-row .detail { margin-left: auto; color: var(--faint); text-align: right; }
.roadmap { display: flex; flex-direction: column; gap: 5px; }
.roadmap-item { display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); opacity: 0.68; }
.roadmap-item.done { opacity: 1; border-color: color-mix(in srgb, var(--success) 26%, var(--border)); }
.roadmap-item > span { font-family: var(--mono); font-size: 0.54rem; color: var(--faint); min-width: 40px; padding-top: 1px; }
.roadmap-item.done > span { color: var(--success); }
.roadmap-item strong { display: block; font-size: 0.68rem; }
.roadmap-item p { margin: 1px 0 0 !important; font-size: 0.6rem !important; color: var(--faint) !important; }

/* ── Voice bridge ─────────────────────────────────────────── */
.voice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; flex: 1; min-height: 0; }
.voice-card { min-height: 0; }
.voice-stage { padding: 12px; display: flex; flex-direction: column; gap: 9px; flex: 1; min-height: 0; }
.voice-visual { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.asr-wave { display: flex; align-items: center; gap: 3px; height: 30px; width: 58px; flex: 0 0 auto; }
.asr-wave span { width: 4px; height: 7px; border-radius: 2px; background: var(--surface-3); transition: background 0.18s; }
.asr-wave.is-listening span { background: var(--accent); animation: wave 1.05s ease-in-out infinite; }
.asr-wave.is-listening span:nth-child(2) { animation-delay: 0.08s; }
.asr-wave.is-listening span:nth-child(3) { animation-delay: 0.16s; }
.asr-wave.is-listening span:nth-child(4) { animation-delay: 0.24s; }
.asr-wave.is-listening span:nth-child(5) { animation-delay: 0.32s; }
.asr-wave.is-listening span:nth-child(6) { animation-delay: 0.4s; }
.asr-wave.is-listening span:nth-child(7) { animation-delay: 0.48s; }
@keyframes wave { 0%, 100% { height: 6px; opacity: 0.55; } 50% { height: 28px; opacity: 1; } }
.voice-status { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); }
.voice-status.is-listening { color: var(--accent); }
.voice-status.is-error { color: var(--danger); }
.asr-transcript { min-height: 88px; max-height: 190px; overflow: auto; font-size: 0.82rem; }
.asr-transcript .interim { color: var(--faint); }
.voice-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.voice-controls { display: flex; gap: 9px; align-items: flex-end; }
.voice-field { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.voice-field select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font-size: 0.66rem; min-width: 0; }
.voice-field .range-wrap { min-width: 0; }
.mini-select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px; font-size: 0.62rem; max-width: 132px; }
.tts-text { width: 100%; resize: vertical; min-height: 96px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 9px; font-size: 0.8rem; line-height: 1.55; outline: none; }
.tts-text:focus { border-color: var(--accent); }
.quick-phrases { display: flex; flex-wrap: wrap; gap: 4px; }
.quick-phrase { font-size: 0.58rem; padding: 4px 7px; min-height: 28px; min-width: 28px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.quick-phrase:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
@media (max-width: 900px) { .voice-grid { grid-template-columns: 1fr; } }

/* ── Status bar ───────────────────────────────────────────── */
.status-bar {
  height: var(--status-h); flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 0 12px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  font-family: var(--mono); font-size: 0.6rem; color: var(--faint);
  letter-spacing: 0.02em;
}
.status-group { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.status-group .label { font-size: 0.54rem; }
.status-spacer { flex: 1; }

/* ── Settings dialog ──────────────────────────────────────── */
.settings-dialog {
  width: min(560px, calc(100vw - 24px)); max-height: min(84vh, 780px);
  padding: 0; border: 1px solid var(--border-strong); border-radius: 14px;
  background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow);
  overflow: hidden;
}
.settings-dialog::backdrop { background: rgba(2,6,14,0.66); backdrop-filter: blur(5px); }
.settings-form { display: flex; flex-direction: column; max-height: inherit; overflow: auto; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; position: sticky; top: 0; background: var(--surface-solid); z-index: 2; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 1.1rem; }
.settings-group { padding: 11px 18px 4px; border-bottom: 1px solid var(--border); }
.settings-group h3 { font-family: var(--mono); font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); margin-bottom: 3px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span:first-child { display: flex; flex-direction: column; gap: 1px; }
.setting-row strong { font-size: 0.72rem; font-weight: 600; }
.setting-row small { font-size: 0.6rem; color: var(--faint); line-height: 1.4; }
.setting-row select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 0.68rem; }
.setting-row input[type="checkbox"] { appearance: none; width: 34px; height: 19px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; flex: 0 0 auto; transition: background 0.16s, border-color 0.16s; }
.setting-row input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); transition: transform 0.16s var(--ease), background 0.16s; }
.setting-row input[type="checkbox"]:checked { background: rgba(56,189,248,0.22); border-color: var(--accent); }
.setting-row input[type="checkbox"]:checked::after { transform: translateX(15px); background: var(--accent); }
.range-wrap { display: flex; align-items: center; gap: 8px; min-width: 170px; }
.range-wrap input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-wrap output { font-family: var(--mono); font-size: 0.62rem; color: var(--muted); min-width: 34px; text-align: right; }
.dialog-actions { display: flex; justify-content: space-between; gap: 8px; padding: 12px 18px 16px; position: sticky; bottom: 0; background: var(--surface-solid); border-top: 1px solid var(--border); }

/* ── Command palette ──────────────────────────────────────── */
.command-dialog {
  width: min(520px, calc(100vw - 20px)); padding: 0;
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow);
  overflow: hidden;
}
.command-dialog::backdrop { background: rgba(2,6,14,0.58); backdrop-filter: blur(4px); }
.command-box { display: flex; flex-direction: column; max-height: min(68vh, 560px); }
.command-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.command-search .icon { color: var(--accent); width: 17px; height: 17px; }
.command-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 0.86rem; }
.command-search kbd { font-size: 0.52rem; }
.command-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border); }
.command-list { overflow: auto; padding: 4px; }
.command-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; color: var(--text-soft); }
.command-item:hover, .command-item.is-active { background: var(--surface-2); color: var(--text); }
.command-item.is-active { box-shadow: inset 2px 0 0 var(--accent); }
.command-item .icon { width: 15px; height: 15px; color: var(--accent); }
.command-item .cmd-label { flex: 1; font-size: 0.72rem; }
.command-item .cmd-key { font-family: var(--mono); font-size: 0.55rem; color: var(--faint); }
.command-empty { padding: 22px 12px; text-align: center; color: var(--faint); font-size: 0.7rem; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-region { position: fixed; right: 12px; bottom: 34px; z-index: 90; display: flex; flex-direction: column; gap: 5px; max-width: min(340px, calc(100vw - 24px)); }
.toast { display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; border-radius: 7px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); color: var(--text-soft); font-size: 0.7rem; animation: toast-in 0.22s var(--ease) both; }
.toast .icon { color: var(--accent); margin-top: 1px; width: 14px; height: 14px; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.out { animation: toast-out 0.18s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }

.noscript { position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; padding: 30px; background: var(--bg); color: var(--text); text-align: center; }

/* ── Accessibility preferences ────────────────────────────── */
html[data-text-size="large"] { font-size: 17px; }
html[data-text-size="xlarge"] { font-size: 19px; }
html[data-contrast="high"] { --border: rgba(148,163,184,0.4); --border-strong: rgba(203,213,225,0.66); --muted: #cbd5e1; --faint: #94a3b8; }
html[data-contrast="high"][data-theme="light"] { --border: rgba(15,23,42,0.34); --border-strong: rgba(15,23,42,0.54); --muted: #1e293b; --faint: #334155; }
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; } }

/* ── Modern primary flow: camera menu, state, disclosure ──── */
.camera-panel { position: relative; }
.camera-panel.is-idle #start-btn,
.camera-panel.is-idle #stop-btn,
.camera-panel.is-running #start-btn { display: none; }
.camera-panel.is-running #stop-btn { display: inline-flex; }
.camera-footer .transport-metrics > span:not(.privacy-chip) { display: none; }
.camera-panel.is-idle .stage-chips { display: none; }
.camera-panel.is-idle .transport-metrics span:not(.privacy-chip) { display: none; }
.camera-menu {
  position: absolute; top: 52px; right: 10px; z-index: 24;
  width: min(280px, calc(100% - 20px));
  padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface-solid); box-shadow: var(--shadow-sm);
}
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 8px; border-radius: 8px; cursor: pointer;
}
.menu-row:hover { background: var(--surface-2); }
.menu-row > span { display: flex; flex-direction: column; gap: 1px; }
.menu-row strong { font-size: 0.72rem; font-weight: 600; }
.menu-row small { font-size: 0.6rem; color: var(--faint); line-height: 1.4; }
.menu-divider { height: 1px; background: var(--border); margin: 4px 6px; }
.menu-action {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 8px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--text-soft); text-align: left; font-size: 0.72rem;
}
.menu-action:hover { background: var(--surface-2); border-color: var(--border); }
.menu-action .icon { width: 15px; height: 15px; color: var(--accent); }

.sign-state {
  margin-top: 10px; padding: 8px 10px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.7rem; line-height: 1.45;
}
.sign-state.high { color: var(--success); border-color: color-mix(in srgb, var(--success) 30%, var(--border)); background: color-mix(in srgb, var(--success) 7%, var(--surface-2)); }
.sign-state.mid { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, var(--border)); background: color-mix(in srgb, var(--warn) 7%, var(--surface-2)); }
.sign-state.low { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); background: color-mix(in srgb, var(--danger) 7%, var(--surface-2)); }
.confidence-fill[data-state="high"] { background: linear-gradient(90deg, var(--success), #86efac); }
.confidence-fill[data-state="mid"] { background: linear-gradient(90deg, var(--warn), #fcd34d); }
.confidence-fill[data-state="low"] { background: linear-gradient(90deg, var(--danger), #fda4af); }
.confidence-value[data-state="high"] { color: var(--success); }
.confidence-value[data-state="mid"] { color: var(--warn); }
.confidence-value[data-state="low"] { color: var(--danger); }

.primary-output { margin-top: 13px; }
.spoken-translation { margin-top: 4px; color: var(--muted); font-size: 0.66rem; line-height: 1.4; min-height: 0; }
.spoken-translation:empty { display: none; }
.primary-output .stream-head { margin-bottom: 5px; }
.primary-output .stream.english { min-height: 58px; font-size: 0.9rem; }
.primary-link { margin-top: 6px; padding-left: 0; color: var(--accent); }
.primary-link .icon { width: 13px; height: 13px; }

.details-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 44px; margin-top: 14px; padding: 9px 0;
  border: 0; border-top: 1px solid var(--border); background: transparent;
  color: var(--muted); font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.details-toggle:hover { color: var(--text); }
.details-toggle .icon { transition: transform 0.18s var(--ease); }
.details-toggle.is-open .icon { transform: rotate(180deg); }
.inspector-details { padding-top: 2px; }
.inspector-details .top3 { margin-top: 4px; }
.inspector-details .stream-block { margin-top: 12px; }
.inspector-tip { margin-top: 16px; padding: 11px; border: 1px dashed var(--border-strong); border-radius: 8px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tip-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.tip-head .icon { width: 15px; height: 15px; color: var(--accent); }
.tip-head strong { font-size: 0.7rem; }
.inspector-tip p { margin: 0; color: var(--muted); font-size: 0.64rem; line-height: 1.55; }

.privacy-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--success); }
.privacy-chip .icon { width: 13px; height: 13px; }

.practice-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 18px; border: 2px solid var(--border-strong); border-radius: var(--radius);
  background: linear-gradient(105deg, color-mix(in srgb, var(--accent) 9%, var(--surface-solid)), color-mix(in srgb, var(--success) 9%, var(--surface-solid)));
  box-shadow: var(--shadow-sm);
}
.practice-hero-copy { flex: 1; min-width: 0; }
.practice-hero-copy h2 { font-size: 1.35rem; margin-bottom: 3px; }
.practice-hero-copy p { color: var(--muted); font-size: 0.78rem; line-height: 1.55; max-width: 660px; }
.practice-hero-target {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 72px; height: 72px; flex: 0 0 auto;
  border: 2px solid var(--border-strong); border-radius: 50%;
  background: var(--surface-solid); box-shadow: 3px 3px 0 rgba(42, 23, 69, 0.12);
}
.practice-hero-target strong { font-family: var(--mono); font-size: 1.8rem; line-height: 1; color: var(--accent); }
.practice-hero-target .label { font-size: 0.48rem; }

/* ── Practice, onboarding, models, typography, kiosk ──────── */
.practice-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; margin: 0 0 8px;
  border: 1px solid rgba(56,189,248,0.3); border-radius: 8px;
  background: linear-gradient(90deg, rgba(56,189,248,0.1), rgba(167,139,250,0.06));
}
.practice-target { display: flex; align-items: baseline; gap: 6px; }
.practice-target strong { font-family: var(--mono); font-size: 1.5rem; color: var(--accent); line-height: 1; }
.practice-feedback { flex: 1; font-size: 0.78rem; color: var(--text-soft); }
.practice-feedback.is-success { color: var(--success); }
.practice-feedback.is-wrong { color: var(--warn); }
.practice-progress { font-family: var(--mono); font-size: 0.62rem; color: var(--faint); }
.placement-ghost {
  position: absolute; left: 50%; top: 50%; width: min(30%, 240px); height: auto;
  transform: translate(-50%, -50%); z-index: 1; pointer-events: none;
  fill: none; stroke: rgba(56,189,248,0.28); stroke-width: 1.2; stroke-dasharray: 2 3; opacity: 0.75;
}
.camera-stage.is-active .placement-ghost { opacity: 0; }
.placement-cue { display: block; margin-top: 4px; font-family: var(--mono); font-size: 0.6rem; color: #8191a9; letter-spacing: 0.04em; }
.transcript-filters { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding: 0 2px; }
.filter-field { display: flex; flex-direction: column; gap: 3px; }
.filter-field input, .filter-field select {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 8px; font-size: 0.72rem; min-width: 170px;
}
.filter-field input:focus, .filter-field select:focus { border-color: var(--accent); outline: none; }
.transcript-no-match { padding: 28px 12px; text-align: center; color: var(--faint); font-size: 0.74rem; }
.model-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.model-card { padding: 9px 10px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.model-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.model-card-head strong { font-size: 0.72rem; }
.model-card-head span { font-family: var(--mono); font-size: 0.52rem; color: var(--warn); }
.model-metric { display: flex; justify-content: space-between; gap: 8px; font-size: 0.62rem; color: var(--muted); padding: 2px 0; }
.model-metric b { color: var(--text-soft); font-family: var(--mono); font-weight: 600; max-width: 68%; text-align: right; overflow-wrap: anywhere; }
.segment-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.tier-status { display: flex; flex-direction: column; gap: 4px; }
.tier-item { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 0.64rem; color: var(--muted); }
.tier-item strong { color: var(--text-soft); font-weight: 600; }
.tier-item .tier-done { color: var(--success, #34d399); font-family: var(--mono); }
.tier-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.tier-progress div { padding: 7px 8px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); }
.tier-progress .label { display: block; font-size: 0.52rem; }
.tier-progress strong { display: block; margin-top: 2px; font-family: var(--mono); font-size: 0.66rem; color: var(--text-soft); }
.signbank-preview { min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.signbank-preview .mini-hand { width: 52px; height: 62px; }
.signbank-preview strong { font-size: 0.72rem; }
.signbank-preview span { display: block; color: var(--muted); font-size: 0.6rem; }
.signbank-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
.signbank-list { display: flex; flex-direction: column; gap: 4px; max-height: 132px; overflow-y: auto; }
.signbank-list:empty { display: none; }
.signbank-list-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.62rem; color: var(--muted); }
.signbank-list-row strong { color: var(--text-soft); font-family: var(--mono); font-size: 0.62rem; }
.signbank-list-row .status-chip { font-size: 0.5rem; padding: 1px 5px; }
.signbank-sample { display: flex; justify-content: center; padding: 4px 0 8px; }
.signbank-sample svg { width: 84px; height: 100px; }
.form-error { min-height: 1em; margin: 4px 0 0; color: var(--danger, #f87171); font-size: 0.66rem; }
.type-to-sign { flex: 0 0 auto; padding-bottom: 12px; }
.type-to-sign-body { padding: 10px 12px 0; }
.type-field input { width: 100%; }
.glyph-strip { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; min-height: 118px; scrollbar-width: thin; }
.glyph { flex: 0 0 auto; width: 86px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.glyph svg { width: 64px; height: 78px; }
.glyph strong { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); }
.glyph.is-space { width: 26px; min-width: 26px; background: transparent; border: 0; color: var(--faint); }
.glyph.is-unsupported { color: var(--faint); }
.glyph-note { font-size: 0.6rem; color: var(--faint); padding: 0 12px 10px; }
.status-chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.error-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.error-actions { display: flex; gap: 4px; flex: 0 0 auto; }

.onboarding-dialog {
  width: min(480px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--border-strong);
  border-radius: 16px; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow);
}
.onboarding-dialog::backdrop { background: rgba(2,6,14,0.72); backdrop-filter: blur(7px); }
.onboarding-box { padding: 18px; }
.onboarding-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.onboarding-top .eyebrow { margin: 0; }
.onboarding-step { display: none; }
.onboarding-step.is-active { display: block; }
.onboarding-visual { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; margin: 8px 0 12px; background: linear-gradient(145deg, rgba(56,189,248,0.16), rgba(167,139,250,0.1)); border: 1px solid rgba(56,189,248,0.3); }
.onboarding-visual svg { width: 38px; height: 38px; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.onboarding-step h2 { font-size: 1.35rem; margin-bottom: 7px; }
.onboarding-step p { color: var(--muted); font-size: 0.82rem; line-height: 1.6; }
.onboarding-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.onboarding-chips span { font-family: var(--mono); font-size: 0.56rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 4px 7px; background: var(--surface-2); }
.onboarding-actions { margin-top: 10px; }
.onboarding-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.onboarding-dots { display: flex; gap: 5px; }
.onboarding-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3); }
.onboarding-dots span.is-active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.onboarding-note { margin-top: 12px; font-size: 0.58rem; color: var(--faint); line-height: 1.5; }

.kiosk-exit { display: none; position: fixed; top: 12px; right: 12px; z-index: 200; }
.kiosk .app-bar, .kiosk .side-rail, .kiosk .status-bar, .kiosk .timeline-panel { display: none !important; }
.kiosk .app-shell { height: 100dvh; }
.kiosk .app-body { height: 100dvh; }
.kiosk .app-main { padding: 0; overflow: hidden; }
.kiosk .app-view { height: 100dvh; gap: 0; }
.kiosk .studio { max-width: none; height: 100dvh; grid-template-columns: minmax(0, 1fr) 380px; gap: 0; }
.kiosk .panel { border-radius: 0; border-left: 0; border-top: 0; border-bottom: 0; }
.kiosk .camera-panel .panel-head { padding: 10px 14px; }
.kiosk .inspector { border-right: 0; }
.kiosk .kiosk-exit { display: inline-flex; }

/* ── Talk / two-way conversation ─────────────────────────── */
.backend-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2);
  color: var(--accent); font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.04em;
}
.conversation-panel { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; height: 100%; max-height: none; }
.talk-quick { display: flex; gap: 6px; overflow-x: auto; padding: 9px 12px 6px; scrollbar-width: thin; }
.talk-quick .quick-phrase { flex: 0 0 auto; white-space: nowrap; }
.talk-thread {
  display: flex; flex-direction: column; gap: 7px; min-height: 110px; max-height: none;
  flex: 1 1 auto; overflow-y: auto; padding: 4px 12px 10px; scrollbar-width: thin;
}
.talk-empty {
  display: flex; flex-direction: column; gap: 3px; padding: 14px 12px;
  border: 1px dashed var(--border-strong); border-radius: 8px; color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
}
.talk-empty strong { color: var(--text-soft); font-size: 0.76rem; }
.talk-empty span { font-size: 0.68rem; line-height: 1.5; }
.talk-message {
  max-width: 88%; padding: 7px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.talk-message.sign { align-self: flex-start; border-left: 3px solid var(--accent); }
.talk-message.spoken { align-self: flex-end; border-right: 3px solid var(--success); background: color-mix(in srgb, var(--success) 7%, var(--surface-2)); }
.talk-message.system { align-self: center; border-style: dashed; color: var(--muted); }
.talk-message-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.talk-message-head span { font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.talk-chip { color: var(--accent); font-weight: 700; text-transform: none; letter-spacing: 0; }
.talk-message-head time { font-family: var(--mono); font-size: 0.5rem; color: var(--faint); }
.uncertain-word {
  appearance: none; border: 0; padding: 0 1px; background: transparent; color: inherit;
  font: inherit; text-decoration: underline dotted var(--warn); text-underline-offset: 3px; cursor: pointer;
}
.uncertain-word:hover, .uncertain-word:focus-visible { background: color-mix(in srgb, var(--warn) 16%, transparent); border-radius: 3px; }
.thread-expand { display: none; }
@media (min-width: 901px) {
  body.present .studio { grid-template-columns: minmax(0, 1fr) minmax(480px, 1.6fr); }
  body.present .talk-message p { font-size: 1rem; }
  body.present .conversation-panel { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent); }
}
@media (orientation: portrait) and (min-width: 600px) {
  body.face-to-face .conversation-panel { transform: rotate(180deg); }
}
.talk-message p { margin: 0; color: var(--text); font-size: 0.82rem; line-height: 1.45; overflow-wrap: anywhere; }
.talk-message small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.58rem; }
.talk-message .talk-translation { color: var(--accent); font-style: italic; }
.talk-composer { display: flex; gap: 6px; padding: 8px 12px 6px; border-top: 1px solid var(--border); }
.talk-composer input {
  flex: 1; min-width: 0; min-height: 40px; padding: 9px 10px; border-radius: 7px;
  border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text);
  font-family: var(--sans); font-size: 0.78rem;
}
.talk-composer input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.talk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 12px 10px; }
.talk-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.64rem; cursor: pointer; position: relative; min-height: 44px; padding-left: 48px; }
.talk-toggle input { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.talk-toggle::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  transition: background 0.16s, border-color 0.16s;
}
.talk-toggle::after {
  content: ""; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%; background: var(--muted);
  transition: transform 0.16s var(--ease), background 0.16s;
}
.talk-toggle:has(input:checked)::before { background: rgba(56,189,248,0.22); border-color: var(--accent); }
.talk-toggle:has(input:checked)::after { transform: translate(16px, -50%); background: var(--accent); }
.talk-toggle:has(input:focus-visible)::before { outline: 2px solid var(--accent); outline-offset: 2px; }
.talk-sign-preview { padding: 0 12px 10px; }
.talk-sign-preview:empty { display: none; }
.talk-preview-hint { color: var(--faint); font-size: 0.64rem; }
.sign-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.sign-preview-head > span:last-child { color: var(--muted); font-size: 0.58rem; }
.sign-preview-card {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, var(--surface-2));
}
.sign-preview-icon {
  display: grid; place-items: center; width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 50%; background: var(--surface-solid); border: 1px solid var(--border-strong); color: var(--accent);
}
.sign-preview-icon .icon { width: 24px; height: 24px; }
.sign-preview-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sign-preview-copy strong { font-size: 1rem; }
.sign-preview-copy small { color: var(--muted); font-size: 0.58rem; line-height: 1.45; }
.talk-glyphs { min-height: 0; padding-top: 6px; }
.talk-glyphs .glyph { width: 70px; }
.talk-glyphs .glyph svg { width: 50px; height: 62px; }
.talk-actions .is-listening { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
@media (min-width: 701px) {
  .conversation-panel { height: 100%; max-height: none; }
  .talk-thread { flex: 1; max-height: none; }
}
@media (max-width: 700px) {
  .conversation-panel { order: 2; max-height: 46vh; height: auto; overflow: hidden; transition: max-height 0.22s var(--ease); }
  .conversation-panel[data-sheet="peek"] { max-height: 24vh; }
  .conversation-panel[data-sheet="full"] { max-height: 82vh; }
  .thread-expand { display: inline-flex; }
  .inspector { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 86vh; border-left: 0; border-top: 1px solid var(--border-strong); border-radius: 16px 16px 0 0; }
  .inspector { order: 3; }
  .timeline-panel { order: 4; }
  .talk-thread { max-height: none; flex: 1; min-height: 0; }
  .talk-message { max-width: 94%; }
  .talk-quick .quick-phrase { min-width: 44px; }
  .live-caption { left: 6px; right: 6px; bottom: 6px; padding: 8px 10px; }
  .live-caption-text { font-size: 0.88rem; }
  .live-caption-actions .btn { min-height: 36px; padding: 5px 8px; font-size: 0.6rem; }
}

/* ── Simple primary navigation and language picker ───────── */
.status-bar { display: none !important; }
.status-tech { display: none; }
.language-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto; margin-right: auto;
  padding: 7px 11px; min-height: 38px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft);
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.02em;
  cursor: pointer; white-space: nowrap;
}
.language-btn:hover { border-color: var(--border-strong); background: var(--surface-3); color: var(--text); }
.language-btn .icon { width: 15px; height: 15px; color: var(--accent); }
.language-chevron { width: 12px !important; height: 12px !important; color: var(--faint) !important; }
.language-intro { margin: 0 0 10px; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.language-dialog { width: min(530px, calc(100vw - 20px)); }
.language-dialog .setting-row { align-items: flex-start; }
.language-dialog .setting-row select { min-width: 170px; max-width: 240px; }
.language-dialog .dialog-actions { position: static; }
.settings-advanced { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 2px; }
.settings-advanced summary {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; color: var(--muted); font-size: 0.7rem; font-weight: 650;
  cursor: pointer; list-style: none;
}
.settings-advanced summary::-webkit-details-marker { display: none; }
.settings-advanced summary::after { content: "+"; color: var(--accent); font-family: var(--mono); font-size: 0.8rem; }
.settings-advanced[open] summary::after { content: "−"; }
.settings-advanced .setting-row { padding-left: 2px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1240px) {
  .studio { grid-template-columns: minmax(0, 1fr) 330px; }
  .library { grid-template-columns: minmax(0, 1fr) 280px; }
  .how-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1040px) {
  .workspace-crumb { display: none; }
  .studio { grid-template-columns: minmax(0, 1fr) 310px; }
}
@media (max-width: 900px) {
  :root { --rail-w: 64px; }
  .rail-item span { display: none; }
  .rail-item { min-height: 44px; }
  .rail-foot { display: none; }
  .app-main { padding: 9px; }
  .studio { grid-template-columns: 1fr; }
  .studio-main { display: contents; }
  .camera-panel { order: 1; }
  .conversation-panel { order: 2; }
  .inspector { order: 3; min-height: 340px; }
  .timeline-panel { order: 4; }
  .camera-stage { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
  .library { grid-template-columns: 1fr; }
  .learn-detail { order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .app-bar-status .status-chip:first-child { display: none; }
}
@media (min-width: 701px) and (max-width: 900px) {
  .rail-item { position: relative; }
  .rail-item span {
    display: block; position: absolute; left: calc(100% + 7px); top: 50%;
    transform: translateY(-50%) translateX(-4px);
    opacity: 0; pointer-events: none; white-space: nowrap;
    padding: 4px 7px; border: 1px solid var(--border-strong); border-radius: 5px;
    background: var(--surface-solid); color: var(--text-soft); font-size: 0.62rem;
    z-index: 80; transition: opacity 0.15s, transform 0.15s;
  }
  .rail-item:hover span, .rail-item:focus-visible span { opacity: 1; transform: translateY(-50%); }
}

@media (min-width: 370px) and (max-width: 700px) {
  .language-btn { max-width: 170px; }
}
@media (max-width: 700px) {
  :root { --header-h: 50px; }
  body { font-size: 14px; }
  .app-bar { padding: 0 9px; gap: 7px; }
  .language-btn { min-height: 44px; max-width: 118px; padding: 6px 9px; font-size: 0.6rem; }
  .language-btn span { overflow: hidden; text-overflow: ellipsis; }
  .language-btn .language-chevron { display: none; }
  #offline-badge { padding: 6px; }
  #offline-badge #offline-text { display: none; }
  #present-btn, #talk-note { display: none; }
  .talk-sign-preview:has(.talk-preview-hint) { display: none; }
  .conversation-panel { box-shadow: 0 -14px 40px rgba(0,0,0,0.12); }
  .brand-text small { display: none; }
  .app-bar-brand { gap: 8px; }
  .app-bar-status { display: none; }
  .app-bar-actions { gap: 4px; }
  .lang-select select { max-width: 126px; font-size: 0.6rem; padding: 5px 24px 5px 8px; }
  .command-btn kbd { display: none; }
  .command-btn { padding: 6px; }
  .app-body { flex-direction: column; }
  .side-rail {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    width: auto; height: 58px; flex-direction: row; align-items: center; justify-content: space-around;
    padding: 4px 7px calc(4px + env(safe-area-inset-bottom)); gap: 2px;
    border-right: 0; border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(18px);
  }
  .rail-item { flex: 1; min-height: 46px; flex-direction: column; gap: 2px; padding: 4px 2px; }
  .rail-item span { display: block; font-size: 0.52rem; }
  .rail-item#rail-settings { display: none; }
  .rail-spacer { display: none; }
  .app-main { padding: 7px 7px 66px; }
  .camera-stage { aspect-ratio: auto; min-height: 44vh; }
  .app-view { min-height: auto; }
  .studio { display: flex; flex-direction: column; }
  .studio-main { gap: 7px; }
  .panel { border-radius: 10px; }
  .panel-head { padding: 8px 9px; }
  .panel-title h1 { font-size: 0.98rem; }
  .panel-tools { gap: 4px; }
  .panel-tools .switch { display: none; }
  .tool-divider { display: none; }
  .camera-footer { padding: 6px 9px; flex-direction: column; align-items: flex-start; gap: 3px; }
  .transport-hint { display: none; }
  .inspector { min-height: 0; }
  .inspector-scroll { padding: 9px; }
  .current-sign { font-size: clamp(3rem, 16vw, 4.6rem); }
  .current-sign.is-empty { font-size: 2.4rem; }
  .confidence-wrap { width: 104px; }
  .timeline { padding: 7px 9px 9px; }
  .page-toolbar { flex-direction: column; align-items: flex-start; gap: 7px; }
  .toolbar-actions { width: 100%; justify-content: flex-start; }
  .toolbar-actions .btn { flex: 1 1 auto; }
  .summary-panel { grid-template-columns: 1fr 1fr; }
  .summary-item:nth-child(3) { border-left: 0; border-top: 1px solid var(--border); }
  .summary-item:nth-child(4) { border-top: 1px solid var(--border); }
  .transcript-row { grid-template-columns: 44px minmax(0, 1fr) 64px; gap: 6px; padding: 7px; }
  .learn-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .learn-card svg { height: 64px; }
  .how-grid { grid-template-columns: 1fr; padding: 8px 9px 0; }
  .about-grid .panel > :not(.panel-head) { margin-left: 10px; margin-right: 10px; }
  .offline-grid { grid-template-columns: 1fr; }
  .status-bar { display: none; }
  .toast-region { bottom: 68px; }
  .placeholder-actions { flex-direction: column; width: 100%; max-width: 220px; }
  .placeholder-actions .btn { width: 100%; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 44px; padding: 8px 11px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn-sm { width: 44px; height: 44px; }
  .command-btn { min-width: 44px; min-height: 44px; justify-content: center; }
  .brand { min-height: 44px; }
  .lang-select select { min-height: 44px; }
  .switch { min-height: 44px; }
  .switch input { width: 38px; height: 24px; }
  .switch input::after { width: 16px; height: 16px; top: 3px; left: 3px; }
  .switch input:checked::after { transform: translateX(14px); }
  .seg { min-height: 44px; padding: 7px 12px; }
  .quick-phrase { min-height: 44px; }
  .command-item { min-height: 44px; }
  .camera-menu { top: 48px; right: 6px; width: min(260px, calc(100% - 12px)); }
  .practice-hero { flex-wrap: wrap; gap: 12px; padding: 14px; }
  .practice-hero-copy { flex: 1 1 100%; }
  .practice-hero-target { width: 56px; height: 56px; }
  .practice-hero-target strong { font-size: 1.45rem; }
  .practice-hero .btn { flex: 1 1 100%; }
  .transcript-filters { width: 100%; }
  .filter-field { flex: 1 1 100%; }
  .filter-field input, .filter-field select { width: 100%; min-width: 0; }
  .model-cards { grid-template-columns: 1fr; }
  .onboarding-dialog { width: calc(100vw - 16px); }
  .onboarding-box { padding: 14px; }
  .glyph { width: 76px; }
  .glyph svg { width: 58px; height: 70px; }
  .kiosk .studio { grid-template-columns: 1fr; }
  .kiosk .inspector { display: none; }
}
@media (max-width: 380px) {
  .camera-panel .panel-head { flex-wrap: wrap; }
  .camera-panel .panel-tools { width: 100%; justify-content: flex-start; }
  .camera-panel .panel-tools .status-chip { display: none; }
  .camera-stage { aspect-ratio: auto; min-height: 340px; }
  .camera-placeholder .placement-cue { display: none; }
  .camera-placeholder span:not(.placement-cue) { font-size: 0.68rem; }
}

@media (max-width: 430px) {
  .app-bar-actions .btn-ghost { display: none; }
  .lang-select select { max-width: 112px; }
  .stage-chips .chip:nth-child(3), .stage-chips .chip:nth-child(4) { display: none; }
  .session-stats { grid-template-columns: 1fr 1fr; }
  .current-top { flex-direction: column; gap: 8px; }
  .confidence-wrap { width: 100%; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .app-bar, .side-rail, .status-bar, .camera-panel, .timeline-panel, .inspector, .page-toolbar .toolbar-actions,
  .settings-dialog, .command-dialog, .toast-region, .self-test-box { display: none !important; }
  body { background: #fff; color: #000; overflow: visible; }
  .app-shell, .app-body, .app-main, .app-view { display: block; overflow: visible; height: auto; }
  .panel { border-color: #ccc; box-shadow: none; background: #fff; color: #000; }
  .transcript-row { background: #fff; border-color: #ddd; }
  .transcript-row .sign { color: #000; }
}
