/* Booth — the interpreter's booth, in blue.
   Deep navy ink and steel-blue "glass" on cool quiet neutrals; one amber tally light for whatever is
   live right now (live status, the dub, the start button). Bricolage Grotesque for display, Figtree
   for text and subtitles, JetBrains Mono for timecodes. */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --soft: #e3e8ef;
  --text: #0f1e33;
  --text-2: #34445a;
  --muted: #4d5c6e;
  --dim: #8e9aa8;
  --line: rgba(15, 30, 51, 0.08);
  --line-2: rgba(15, 30, 51, 0.14);

  /* brand scale: steel-blue glass (400) to booth navy (700) */
  --brand-50: #eaf0f6;
  --brand-100: #d3dfeb;
  --brand-300: #8ca9c8;
  --brand-400: #2f5d8c;
  --brand-500: #24497a;
  --brand-700: #0f1e33;
  --sky-400: #7fa3c9;
  --sky-500: #4e7aa8;
  /* the tally light, and a darker amber for amber text on light grounds */
  --orange: #f0a21b;
  --amber-ink: #8a5a00;
  --ok: #19a463;
  --warn: #d9480f;

  --grad: linear-gradient(0deg, var(--brand-700), var(--brand-700));
  --grad-deep: linear-gradient(160deg, #0f1e33 0%, #1a3150 100%);
  --display: "Bricolage Grotesque", "Figtree", "Segoe UI", system-ui, sans-serif;

  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;

  --shadow-1: 0 1px 2px rgba(10, 12, 40, 0.04), 0 4px 16px rgba(10, 12, 40, 0.04);
  --shadow-2: 0 2px 6px rgba(10, 12, 40, 0.05), 0 18px 48px rgba(15, 30, 51, 0.10);

  --font: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--brand-500); }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; font-family: var(--display); font-weight: 700; text-wrap: balance; }
h1 { font-size: 32px; line-height: 1.2; font-weight: 600; }
h2 { font-size: 26px; line-height: 1.25; font-weight: 600; }
h3 { font-size: 17px; line-height: 1.35; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 0; }
.link { color: var(--brand-500); text-decoration: underline; text-underline-offset: 3px; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- ambient background ---------- */


.view { position: relative; z-index: 1; min-height: 100vh; }

/* ---------- reveal ---------- */

.reveal { animation: reveal 0.7s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- buttons ---------- */

.btn {
  --h: 44px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 20px; border: 0; border-radius: var(--r-sm);
  font: 500 15px/1 var(--font); color: var(--text); background: transparent; cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s, color 0.2s, opacity 0.2s;
  overflow: hidden; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; }
.btn--lg { --h: 52px; font-size: 16px; padding: 0 24px; }
.btn--sm { --h: 34px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.btn--block { width: 100%; }

.btn--primary { color: #fff; background: var(--grad); box-shadow: 0 6px 20px -6px rgba(47, 93, 140, 0.55); }
.btn--primary::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
}
.btn--primary:hover { box-shadow: 0 10px 28px -8px rgba(47, 93, 140, 0.75); transform: translateY(-1px); }
.btn--primary:hover::after { transform: translateX(120%); transition: transform 0.9s var(--ease); }
.btn--primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn--primary:disabled::after { display: none; }

.btn--soft { background: var(--soft); }
.btn--soft:hover { background: #e4e4e8; }
.btn--ghost { background: transparent; border: 1px solid var(--line-2); }
.btn--ghost:hover { border-color: var(--brand-300); color: var(--brand-500); background: var(--brand-50); }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn--soft.is-loading::before { border-color: rgba(0, 0, 0, 0.15); border-top-color: var(--brand-500); }
.oauth-block { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.oauth-block .btn--primary { margin-top: 0; }
.g-logo { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #fff; }
.signin-note { font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); text-align: left; }
.btn-icon-img { box-sizing: content-box; width: 16px; height: 18px; padding: 4px 5px; border-radius: 8px; background: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--soft); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn--lg { width: 48px; height: 48px; border-radius: 50%; color: #fff; background: var(--text); }
.icon-btn--lg:hover { background: var(--brand-500); color: #fff; }

/* ---------- inputs ---------- */

.field {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus-within { border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(47, 93, 140, 0.12); }
.field-icon { color: var(--dim); display: grid; }
.field input { flex: 1; border: 0; outline: 0; font: 400 15px var(--font); background: transparent; color: var(--text); min-width: 0; }
.field input::placeholder { color: var(--dim); }

.select { position: relative; display: block; flex: 1; min-width: 0; }
.select-label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px 2px; }
.select select {
  width: 100%; height: 52px; padding: 0 40px 0 14px; appearance: none; -webkit-appearance: none;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  font: 500 15px var(--font); color: var(--text); cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%236e7080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.select select:hover { border-color: var(--brand-300); }
.select select:focus { outline: 0; border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(47, 93, 140, 0.12); }

/* language picker */
.lp { position: relative; }
.lp-btn {
  width: 100%; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--text);
  font: 500 15px var(--font); cursor: pointer; text-align: left; transition: border-color 0.2s, box-shadow 0.2s;
}
.lp-btn:hover { border-color: var(--brand-300); }
.lp-btn:focus-visible, .lp.is-open .lp-btn { outline: 0; border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(47, 93, 140, 0.12); }
.lp-flag { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--soft); box-shadow: 0 0 0 1px var(--line); }
.lp-flag.is-missing { visibility: hidden; }
.lp-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; white-space: nowrap; }
.lp-text .lp-label { overflow: hidden; text-overflow: ellipsis; }
.lp-text .lp-native { display: none; }
.lp-chev { flex: none; color: var(--muted); transition: transform 0.3s var(--ease); }
.lp.is-open .lp-chev { transform: rotate(180deg); }
.lp.bump .lp-btn .lp-flag { animation: pop-flag 0.4s var(--spring); }
@keyframes pop-flag { from { transform: scale(0.6); } }

.lp-pop {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; width: max(100%, 300px);
  padding: 8px; border-radius: var(--r-md); background: var(--surface); box-shadow: 0 2px 6px rgba(10, 12, 40, 0.06), 0 24px 56px rgba(15, 30, 51, 0.16);
  border: 1px solid var(--line); transform-origin: top left; animation: lp-in 0.28s var(--ease);
}
.lang-row .select:last-child .lp-pop { left: auto; right: 0; transform-origin: top right; }
@keyframes lp-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.lp-search {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-bottom: 6px;
  border-radius: 10px; background: var(--surface-2); color: var(--muted);
}
.lp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 14px var(--font); color: var(--text); }
.lp-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ced6df transparent; }
.lp-list li[data-code] {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  font-size: 14px; animation: lp-item 0.3s var(--ease) both; animation-delay: calc(var(--i) * 12ms);
}
@keyframes lp-item { from { opacity: 0; transform: translateX(-4px); } }
.lp-list li .lp-flag { width: 20px; height: 20px; }
.lp-list li .lp-label { font-weight: 500; white-space: nowrap; }
.lp-list li .lp-native { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-list li .lp-code { font-size: 11px; color: var(--dim); }
.lp-list li.is-active { background: var(--brand-50); }
.lp-list li[aria-selected="true"] .lp-label { color: var(--brand-500); }
.lp-list li[aria-selected="true"]::after {
  content: ""; width: 6px; height: 10px; margin: -3px 2px 0 0; border: solid var(--brand-500); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.lp-empty { padding: 16px 10px; color: var(--muted); font-size: 14px; text-align: center; }

/* voice picker */
.vp.is-locked .vp-btn { cursor: not-allowed; background: var(--surface-2); border-style: dashed; }
.vp.is-locked .vp-btn:hover { border-color: var(--line-2); }
.vp.is-locked .lp-chev { opacity: 0.3; }
.vp.is-locked .vp-avatar { background: var(--brand-400); }
.vp-row { display: flex; gap: 8px; }
.vp-row .vp-btn { flex: 1; min-width: 0; }
.vp-btn .lp-text { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.25; }
.vp-sub { font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.vp-avatar, .vp-play {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-500); font-size: 12px; font-weight: 600;
}
.vp-btn .vp-avatar { background: var(--grad); color: #fff; }
.vp-play { border: 0; cursor: pointer; position: relative; transition: background 0.2s, color 0.2s, transform 0.2s var(--spring); }
.vp-play:hover { background: var(--grad); color: #fff; transform: scale(1.08); }
.vp-play--lg { width: 52px; height: 52px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); color: var(--brand-500); }
.vp-play--lg:hover { border-color: var(--brand-300); transform: none; }
.vp-play .eq { display: none; align-items: flex-end; gap: 2px; height: 12px; }
.vp-play .eq i { width: 3px; border-radius: 2px; background: currentColor; animation: eqb 0.9s ease-in-out infinite; }
.vp-play .eq i:nth-child(2) { animation-delay: -0.3s; }
.vp-play .eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eqb { 0%, 100% { height: 3px; } 50% { height: 12px; } }
.vp-play.is-playing { background: var(--grad); color: #fff; }
.vp-play.is-playing .i-play { display: none; }
.vp-play.is-playing .eq { display: flex; }
.vp-pop { width: max(100%, 360px); }
.vp-list { max-height: 340px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ced6df transparent; }
.vp-group { padding: 12px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.vp-hint { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.vp-item {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 10px; cursor: pointer;
  animation: lp-item 0.3s var(--ease) both; animation-delay: calc(var(--i) * 12ms);
}
.vp-item:hover { background: var(--brand-50); }
.vp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.vp-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-item .lp-code { font-size: 11px; color: var(--dim); }
.vp-item[aria-selected="true"] .vp-name { color: var(--brand-500); }
.vp-item[aria-selected="true"]::after {
  content: ""; flex: none; width: 6px; height: 10px; margin: -3px 4px 0 0; border: solid var(--brand-500); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.vp-more {
  width: 100%; margin-top: 6px; padding: 10px; border: 1px dashed var(--line-2); border-radius: 10px; background: transparent;
  font: 500 13px var(--font); color: var(--brand-500); cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.vp-more:hover { background: var(--brand-50); border-color: var(--brand-300); }
.vp-loading { display: flex; align-items: center; gap: 10px; padding: 18px 10px; color: var(--muted); font-size: 14px; }

.switch { position: relative; flex: none; width: 44px; height: 26px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #d9d9de; transition: background 0.25s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.35s var(--spring);
}
.switch input:checked + span { background: var(--orange); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand-400); outline-offset: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 500;
}
.chip--brand { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 8px;
  background: var(--brand-50); color: var(--brand-500); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}

.tag--beta { height: 20px; padding: 0 7px; margin-left: 6px; font-size: 10.5px; vertical-align: 2px; background: #fdf1dc; color: var(--amber-ink); }
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }

/* ============================================================
   SIGN IN
   ============================================================ */

.view--signin { display: grid; grid-template-columns: minmax(420px, 720px) 1fr; }
.signin-card {
  position: relative; margin: 8px; min-height: calc(100vh - 16px); padding: 40px 24px 28px;
  background: var(--surface); border-radius: var(--r-xl); display: flex; flex-direction: column; align-items: center;
  box-shadow: var(--shadow-1); animation: reveal 0.6s var(--ease) both;
}
.signin-body { width: 100%; max-width: 360px; margin: auto 0; display: flex; flex-direction: column; gap: 16px; text-align: center; padding: 40px 0; }
.signin-body h1 { margin-bottom: -6px; }
.signin-body .btn--primary { margin-top: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.keys summary { list-style: none; width: 100%; }
.keys summary::-webkit-details-marker { display: none; }
.keys[open] summary { background: transparent; color: var(--muted); height: 32px; font-size: 14px; }
.keys-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; text-align: left; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.form-error {
  padding: 12px 14px; border-radius: var(--r-sm); background: #fff1ec; color: var(--warn);
  font-size: 14px; text-align: left; animation: shake 0.45s var(--ease);
}
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.signin-foot { font-size: 13px; }

.signin-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 40px; gap: 22px; text-align: center; }
.hero-title { font-size: 44px; line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; }
.hero-sub { max-width: 460px; font-size: 16px; }

.demo { width: min(560px, 100%); margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.demo-screen {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden;
  background:
    radial-gradient(70% 90% at 15% 10%, rgba(127, 163, 201, 0.55), transparent 60%),
    radial-gradient(60% 80% at 90% 100%, rgba(240, 162, 27, 0.16), transparent 60%),
    var(--grad-deep);
  box-shadow: var(--shadow-2);
  animation: floaty 7s ease-in-out infinite;
}
.demo-screen::before {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
}
@keyframes floaty { 50% { transform: translateY(-6px); } }
.demo-badge {
  position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 8px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(10px); color: #fff; font: 600 11px var(--mono); letter-spacing: 0.08em;
}
.demo-wave { position: absolute; left: 0; right: 0; top: 30%; display: flex; justify-content: center; align-items: center; gap: 5px; height: 70px; }
.demo-wave i {
  width: 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.8); height: 20%;
  animation: eq 1.1s ease-in-out infinite; animation-delay: calc(var(--n, 0) * -0.09s);
}
.demo-wave i:nth-child(3n) { animation-duration: 0.9s; }
.demo-wave i:nth-child(4n+1) { animation-duration: 1.3s; }
.demo-wave i:nth-child(5n+2) { animation-duration: 0.75s; }
@keyframes eq { 0%, 100% { height: 14%; opacity: 0.55; } 50% { height: 92%; opacity: 1; } }
.demo-sub { position: absolute; left: 6%; right: 6%; bottom: 7%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.demo-sub-src { min-height: 20px; color: rgba(255, 255, 255, 0.75); font-size: 14px; }
.demo-sub-dst {
  min-height: 34px; padding: 6px 14px; border-radius: 10px; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(8px);
  color: #fff; font-size: 18px; font-weight: 500; opacity: 0; transition: opacity 0.3s;
}
.demo-sub-dst.is-in { opacity: 1; }
.demo-langs { display: flex; align-items: center; gap: 12px; }
.demo-arrow { color: var(--brand-500); display: grid; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }

.features { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; max-width: 680px; }
.features li { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; color: var(--text-2); }
.feat-ico { color: var(--brand-500); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, 0.7); }

/* ============================================================
   APP
   ============================================================ */

.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  height: 64px; padding: 0 24px; background: rgba(242, 242, 242, 0.72); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
}
.topbar-spacer { flex: 1; }
.balance {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text-2);
  white-space: nowrap; animation: reveal 0.5s var(--ease) both;
}
.balance svg { color: var(--brand-500); }
.balance-sub { color: var(--muted); font-weight: 400; }
.balance.is-low { background: #fff1ec; border-color: #ffd2c2; color: var(--warn); }
.balance.is-low svg { color: var(--warn); }
.user { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 4px 0 4px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 12px; font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 14px; font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stage { max-width: 1320px; margin: 0 auto; padding: 24px 24px 48px; }

/* ---------- setup ---------- */

.stage--setup { max-width: 1080px; padding-top: 28px; }
.setup-head { text-align: center; max-width: 640px; margin: 0 auto 24px; display: flex; flex-direction: column; gap: 6px; }
.setup-head h1 { font-size: 34px; letter-spacing: -0.02em; }
.setup-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: stretch; }

.dropzone {
  --mx: 50%; --my: 50%;
  position: relative; min-height: 380px; display: grid; place-items: center; padding: 28px; cursor: pointer;
  outline: none; overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.dropzone::before {
  content: ""; position: absolute; inset: 12px; border-radius: 18px; pointer-events: none;
  background:
    linear-gradient(90deg, var(--brand-300) 50%, transparent 0) top / 14px 1.5px repeat-x,
    linear-gradient(90deg, var(--brand-300) 50%, transparent 0) bottom / 14px 1.5px repeat-x,
    linear-gradient(0deg, var(--brand-300) 50%, transparent 0) left / 1.5px 14px repeat-y,
    linear-gradient(0deg, var(--brand-300) 50%, transparent 0) right / 1.5px 14px repeat-y;
  opacity: 0.55; transition: opacity 0.3s;
}
.dropzone::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(320px circle at var(--mx) var(--my), rgba(47, 93, 140, 0.10), transparent 70%);
}
.dropzone:hover::after, .dropzone:focus-visible::after { opacity: 1; }
.dropzone:hover::before { opacity: 0.9; animation: march 1s linear infinite; }
.dropzone.is-drag { transform: scale(1.01); box-shadow: var(--shadow-2); }
.dropzone.is-drag::before { opacity: 1; animation: march 0.5s linear infinite; }
.dropzone.is-drag .dz-icon { transform: translateY(-6px) scale(1.06); }
.dropzone.has-file::before { opacity: 0; animation: none; }
@keyframes march {
  to { background-position: 14px 0, -14px 100%, 0 -14px, 100% 14px; }
}
.dz-empty { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.dz-icon {
  width: 88px; height: 88px; border-radius: 26px; display: grid; place-items: center; margin-bottom: 6px;
  color: #fff; background: var(--grad); box-shadow: 0 16px 36px -12px rgba(47, 93, 140, 0.6);
  transition: transform 0.4s var(--spring);
}
.dz-icon svg { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }

.dz-or { display: flex; align-items: center; gap: 10px; width: min(420px, 100%); margin-top: 10px; color: var(--dim); font-size: 12.5px; }
.dz-or::before, .dz-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dz-url {
  display: flex; align-items: center; gap: 6px; width: min(460px, 100%); height: 44px; padding: 0 5px 0 12px; cursor: text;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); transition: border-color 0.2s, box-shadow 0.2s;
}
.dz-url:focus-within { border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(47, 93, 140, 0.12); }
.dz-url.is-error { border-color: #f3a58c; animation: shake 0.45s var(--ease); }
.dz-url-icon { display: grid; color: var(--dim); }
.dz-url input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 14px var(--font); color: var(--text); }
.dz-url .btn { flex: none; }
.dz-url-hint { max-width: 460px; font-size: 12px; }
.dz-url-error { max-width: 460px; padding: 10px 12px; border-radius: 10px; background: #fff1ec; color: var(--warn); font-size: 13px; text-align: left; animation: reveal 0.3s var(--ease) both; }
.dz-file { position: relative; z-index: 1; width: 100%; display: flex; flex-direction: column; gap: 18px; animation: reveal 0.5s var(--ease) both; }
.dz-preview {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden;
  background: var(--grad-deep); display: grid; place-items: center;
}
.dz-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-audio-art { color: rgba(255, 255, 255, 0.85); }
.dz-duration {
  position: absolute; right: 12px; bottom: 12px; padding: 4px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; backdrop-filter: blur(6px);
}
.dz-meta { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; }
.dz-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-meta .btn { grid-row: 1 / 3; grid-column: 2; }

.settings { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.lang-row { display: flex; align-items: flex-end; gap: 8px; }
.swap {
  flex: none; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.swap:hover { border-color: var(--brand-300); color: var(--brand-500); }
.swap.spin svg { animation: swapspin 0.5s var(--ease); }
@keyframes swapspin { from { transform: rotate(-180deg); } }

.opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.adv { border-top: 1px solid var(--line); margin-top: -14px; }
.adv summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 0; list-style: none; cursor: pointer; user-select: none;
}
.adv summary::-webkit-details-marker { display: none; }
.adv-title { font-weight: 500; }
.adv-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.adv-chip { height: 22px; padding: 0 8px; border-radius: 7px; background: var(--brand-50); color: var(--brand-500); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; animation: pop-flag 0.35s var(--spring); }
.adv-chev { color: var(--muted); transition: transform 0.3s var(--ease); }
.adv[open] .adv-chev { transform: rotate(180deg); }
.adv[open]:not(.is-closing) .adv-chips { opacity: 0; }
.adv-chips { transition: opacity 0.25s; }
.adv.is-closing .adv-chev { transform: none; }
.adv-body { padding-bottom: 2px; }
.adv-body .opt:first-child { border-top: 0; padding-top: 0; }
.opt-title { font-weight: 500; }
.estimate { margin-top: auto; padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface-2); line-height: 1.45; }
.estimate.is-warn { background: #fff4ec; color: var(--warn); }

/* ---------- live ---------- */

.stage--live { padding-top: 16px; padding-bottom: 24px; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; height: calc(100vh - 64px - 40px); min-height: 600px; }
.player-col { display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.player {
  position: relative; flex: 1; min-height: 280px; overflow: hidden; background: #07081a; border-radius: var(--r-lg);
  animation: reveal 0.6s var(--ease) both; box-shadow: var(--shadow-2);
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%; pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
}
.audio-only-art {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 15% 10%;
  background: radial-gradient(70% 90% at 20% 10%, rgba(127, 163, 201, 0.45), transparent 60%), var(--grad-deep);
}
.audio-only-art canvas { width: 100%; height: 60%; }

.player-top { position: absolute; z-index: 3; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; }
.status-pill, .lang-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 10px;
  background: rgba(10, 10, 20, 0.5); backdrop-filter: blur(12px); color: #fff; font-size: 13px; font-weight: 500;
}
.lang-pill { font-size: 12px; letter-spacing: 0.06em; }
.player-top-right { display: inline-flex; align-items: center; gap: 8px; }
.replay-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px;
  background: rgba(240, 162, 27, 0.92); color: #0f1e33; font-size: 12.5px; font-weight: 500; backdrop-filter: blur(12px);
  animation: reveal 0.5s var(--ease) both;
}
.status-pill[data-state="replay"] .live-dot { background: var(--orange); animation: none; }
.player.is-replay .progress-bar, .is-replay-controls .progress-bar { cursor: pointer; }
.progress-track { position: relative; padding: 6px 0; margin: -6px 0; }
.is-replay-controls .progress-track { cursor: pointer; touch-action: none; }
.is-replay-controls .progress-bar { transition: height 0.15s; }
.is-replay-controls .progress-track:hover .progress-bar { height: 8px; }
.progress-tip {
  position: absolute; bottom: calc(100% + 2px); transform: translateX(-50%); padding: 3px 7px; border-radius: 6px;
  background: var(--text); color: #fff; font-size: 11px; pointer-events: none; opacity: 0; transition: opacity 0.15s; white-space: nowrap;
}
.is-replay-controls .progress-track:hover .progress-tip { opacity: 1; }
.is-replay-controls #progress-play::after {
  content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1px var(--line-2), 0 2px 6px rgba(15, 30, 51, 0.3); opacity: 0; transition: opacity 0.15s;
}
.is-replay-controls .progress-track:hover #progress-play::after { opacity: 1; }
.progress-bar { overflow: visible; }
.is-replay-controls #progress-sent { background: var(--soft); }
.transcript.is-replay .tr-item { cursor: pointer; }
.transcript.is-replay .tr-item:hover { background: var(--surface-2); }
.tr-item.is-current { background: var(--brand-50); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #f0a21b; box-shadow: 0 0 0 0 rgba(240, 162, 27, 0.6); animation: pulse 1.6s infinite; }
.status-pill[data-state="connecting"] .live-dot, .status-pill[data-state="buffering"] .live-dot, .status-pill[data-state="rebuffering"] .live-dot { background: var(--sky-400); animation-name: pulse-blue; }
.status-pill[data-state="paused"] .live-dot { background: #ffcc00; animation: none; }
.status-pill[data-state="finishing"] .live-dot { background: var(--sky-400); animation-name: pulse-blue; }
.status-pill[data-state="done"] .live-dot { background: #34c759; animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(240, 162, 27, 0); } 100% { box-shadow: 0 0 0 0 rgba(240, 162, 27, 0); } }
@keyframes pulse-blue { 0% { box-shadow: 0 0 0 0 rgba(127, 163, 201, 0.7); } 70% { box-shadow: 0 0 0 8px rgba(127, 163, 201, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 163, 201, 0); } }

/* warm-up overlay */
.warmup {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 40px;
  background: radial-gradient(60% 80% at 30% 20%, rgba(47, 93, 140, 0.55), transparent 70%), rgba(7, 8, 26, 0.86);
  backdrop-filter: blur(18px); color: #fff; transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.warmup.is-done { opacity: 0; visibility: hidden; }
.warmup-ring { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.warmup-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.warmup-ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: rgba(255, 255, 255, 0.12); }
.ring-fg { stroke: var(--sky-400); stroke-linecap: round; stroke-dasharray: 80 400; transform-origin: center; animation: ringspin 1.4s linear infinite; }
.warmup:has(#warmup-count:not(:empty)) .ring-fg { animation: none; transition: stroke-dashoffset 0.15s linear; }
@keyframes ringspin { to { transform: rotate(360deg); } }
#warmup-count { font-size: 38px; font-weight: 500; }
.warmup-note { min-height: 18px; margin: 2px 0 0 34px; font-size: 12px; color: var(--sky-400); }
.warmup-logo { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.75; } }
.warmup-steps { display: flex; flex-direction: column; gap: 14px; }
.wstep { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255, 255, 255, 0.4); transition: color 0.4s; }
.wstep i { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.25); transition: all 0.4s var(--ease); }
.wstep.is-active { color: #fff; }
.wstep.is-active i { border-color: var(--sky-400); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.wstep.is-done { color: rgba(255, 255, 255, 0.85); }
.wstep.is-done i { border-color: transparent; background: var(--grad); }
.wstep.is-done i::after {
  content: ""; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg); animation: pop 0.35s var(--spring);
}
@keyframes pop { from { transform: rotate(45deg) scale(0); } }

/* subtitles */
.subtitle {
  position: absolute; z-index: 3; left: 6%; right: 6%; bottom: 28px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; opacity: 0; transform: translateY(8px); transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); pointer-events: none;
}
.subtitle.is-visible { opacity: 1; transform: none; }
.subtitle-src { color: rgba(255, 255, 255, 0.78); font-size: 15px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); max-width: 900px; }
.subtitle-src:empty, .subtitle-dst:empty { display: none; }
.subtitle-dst {
  max-width: 900px; padding: 8px 16px; border-radius: 12px; background: rgba(8, 8, 20, 0.62); backdrop-filter: blur(10px);
  color: #fff; font-size: clamp(17px, 1.7vw, 24px); font-weight: 500; line-height: 1.35; box-decoration-break: clone;
}
.w { display: inline-block; opacity: 0; transform: translateY(6px); filter: blur(3px); }
.is-in .w, .tr-dst .w { animation: word 0.45s var(--ease) forwards; animation-delay: calc(var(--i) * 28ms); }
@keyframes word { to { opacity: 1; transform: none; filter: none; } }

/* controls */
.controls { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: var(--r-md); animation: reveal 0.6s var(--ease) both; animation-delay: 80ms; }
#btn-play .i-play { display: none; }
#btn-play.is-paused .i-play { display: block; }
#btn-play.is-paused .i-pause { display: none; }
.progress { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.progress-bar { position: relative; height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.progress-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width 0.25s linear; }
#progress-sent { background: var(--brand-100); }
#progress-play { background: var(--brand-400); }
.progress-time { display: flex; justify-content: space-between; color: var(--muted); }

.mix { position: relative; display: inline-flex; padding: 3px; border-radius: 12px; background: var(--soft); }
.seg {
  position: relative; z-index: 1; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent;
  font: 500 13.5px var(--font); color: var(--muted); cursor: pointer; transition: color 0.25s; min-width: 98px;
}
.seg.is-active { color: var(--text); }
.seg-glider {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px; background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); transition: transform 0.4s var(--spring);
}
.mix[data-mix="dub"] .seg-glider { transform: translateX(100%); }

.meters { display: grid; grid-template-columns: 1fr 1fr 130px 130px; gap: 14px; animation: reveal 0.6s var(--ease) both; animation-delay: 140ms; }
.meter { padding: 12px 14px; border-radius: var(--r-md); display: flex; flex-direction: column; gap: 8px; }
.meter-head { display: flex; justify-content: space-between; align-items: center; }
.meter canvas { width: 100%; height: 34px; display: block; }
.stat { justify-content: space-between; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
.vol svg { flex: none; transition: color 0.2s; }
.vol:hover svg { color: var(--brand-500); }
.vol.is-muted .vol-wave { opacity: 0.2; }
.vol-val { width: 34px; text-align: right; color: var(--text-2); }
.vol input {
  --p: 50%;
  flex: 1; min-width: 0; height: 18px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer;
}
.vol input::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--brand-400), var(--sky-400)) 0 / var(--p) 100% no-repeat, var(--soft); }
.vol input::-moz-range-track { height: 4px; border-radius: 99px; background: var(--soft); }
.vol input::-moz-range-progress { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--brand-400), var(--sky-400)); }
.vol input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 1px var(--line-2), 0 2px 6px rgba(15, 30, 51, 0.25); transition: transform 0.2s var(--spring);
}
.vol input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--line-2), 0 2px 6px rgba(15, 30, 51, 0.25); }
.vol input:hover::-webkit-slider-thumb, .vol input:active::-webkit-slider-thumb { transform: scale(1.25); }
.vol input:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 2px; border-radius: 4px; }
.stat-val { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }

/* transcript */
.transcript { display: flex; flex-direction: column; min-height: 0; overflow: hidden; animation: reveal 0.6s var(--ease) both; animation-delay: 120ms; }
.transcript-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--soft); }
.tab { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; font: 500 12.5px var(--font); color: var(--muted); cursor: pointer; transition: all 0.2s; }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.transcript-body { position: relative; flex: 1; overflow-y: auto; padding: 8px 10px 20px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #ced6df transparent; }
.transcript-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }

.tr-item {
  position: relative; display: grid; grid-template-columns: 44px 1fr; column-gap: 8px; row-gap: 4px;
  padding: 12px 10px; border-radius: 14px; animation: slidein 0.5s var(--ease) both;
}
.tr-item.flash { animation: slidein 0.5s var(--ease) both, flash 1.6s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateY(10px); } }
@keyframes flash { 0% { background: var(--brand-50); } 100% { background: transparent; } }
.tr-time { grid-row: 1 / 3; padding-top: 2px; font-size: 11.5px; color: var(--dim); }
.tr-src { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.tr-dst { font-size: 15.5px; color: var(--text); font-weight: 500; line-height: 1.45; min-height: 22px; }
.tr-item:not(.has-dst) .tr-dst { opacity: 0.8; }
.is-partial {
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 40%, var(--brand-300) 50%, var(--muted) 60%, var(--muted) 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.8s linear infinite;
}
.demo-sub-src.is-partial { background-image: linear-gradient(90deg, rgba(255,255,255,.6) 0%, rgba(255,255,255,.6) 40%, #fff 50%, rgba(255,255,255,.6) 60%, rgba(255,255,255,.6) 100%); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

.transcript-body[data-view="dst"] .tr-src { display: none; }
.transcript-body[data-view="src"] .tr-dst { display: none; }
.transcript-body[data-view="src"] .tr-src { color: var(--text); font-size: 15px; }

.typing { display: inline-flex; gap: 4px; align-items: center; height: 22px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-300); animation: dot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

.transcript-foot { padding: 12px 14px; border-top: 1px solid var(--line); }
.dl { display: flex; flex-wrap: wrap; gap: 6px; }

/* done sheet */
.done-sheet {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(242, 242, 242, 0.55); backdrop-filter: blur(10px); animation: fade 0.4s var(--ease) both;
}
@keyframes fade { from { opacity: 0; } }
.done-card {
  width: min(480px, 100%); padding: 36px 32px 28px; border-radius: var(--r-xl); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: var(--shadow-2);
  animation: popin 0.55s var(--spring) both;
}
@keyframes popin { from { opacity: 0; transform: scale(0.92) translateY(10px); } }
.done-check { width: 72px; height: 72px; margin-bottom: 6px; }
.done-check svg { width: 100%; height: 100%; }
.done-check circle { fill: none; stroke: var(--brand-400); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 0.7s var(--ease) 0.15s forwards; }
.done-check path { fill: none; stroke: var(--brand-400); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.45s var(--ease) 0.7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* rewind during live */
.player-top-left { display: inline-flex; align-items: center; gap: 8px; }
.golive {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 0; border-radius: 10px; cursor: pointer;
  background: #f0a21b; color: #0f1e33; font: 600 13px var(--font); box-shadow: 0 6px 18px -6px rgba(240, 162, 27, 0.7);
  animation: reveal 0.4s var(--ease) both; transition: transform 0.2s var(--spring);
}
.golive:hover { transform: scale(1.04); }
.golive .live-dot { background: #fff; }
.status-pill[data-state="timeshift"] .live-dot { background: var(--orange); animation: none; }
#progress-live {
  position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #f0a21b;
  box-shadow: 0 0 0 3px rgba(240, 162, 27, 0.25); pointer-events: none;
}
.is-live-seekable .progress-track { cursor: pointer; touch-action: none; }
.is-live-seekable .progress-track:hover .progress-bar { height: 8px; }
.is-live-seekable .progress-track:hover .progress-tip { opacity: 1; }
.transcript { position: relative; }
.tr-live {
  position: absolute; z-index: 5; left: 50%; bottom: 72px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--text); color: #fff; font: 500 13px var(--font); box-shadow: 0 10px 28px -8px rgba(10, 12, 40, 0.5);
  animation: trlive 0.35s var(--spring) both;
}
.tr-live:hover { background: var(--brand-500); }
@keyframes trlive { from { opacity: 0; transform: translate(-50%, 10px) scale(0.92); } }

/* speakers */
.spk-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.spk-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--soft); }
.spk { height: 26px; min-width: 36px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; font: 500 12.5px var(--font); color: var(--muted); cursor: pointer; transition: all 0.2s; }
.spk.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* glossaries */
.gloss-manage {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 4px 9px; border-radius: 8px;
  background: var(--brand-50); color: var(--brand-500); font-size: 12.5px; font-weight: 500; text-decoration: none; transition: background 0.2s;
}
.gloss-manage:hover { background: var(--brand-100); color: var(--brand-700); }
.gloss { margin: -4px 0 8px; }
.gloss-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; scrollbar-width: thin; }
.gl-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.gl-item:hover { border-color: var(--brand-300); }
.gl-item:has(input:checked) { border-color: var(--brand-400); background: var(--brand-50); }
.gl-item input { width: 16px; height: 16px; accent-color: var(--brand-500); flex: none; }
.gl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.gl-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-meta { font-size: 11.5px; color: var(--muted); }
.gl-type { flex: none; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center; background: var(--soft); color: var(--text-2); }
.gl-type--translation { background: #e8f1ff; color: #1f5fd1; }
.gl-type--asr_hot { background: #eaf8ef; color: #16824e; }
.gl-type--asr { background: #fff4e6; color: #b45309; }
.gloss-note { margin-top: 6px; line-height: 1.4; }
.gloss-empty { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--muted); }

/* API key help */
.keyhelp {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--brand-100); border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-50), #f3f6ff); cursor: pointer; text-align: left; font: inherit; color: var(--text);
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s;
}
.keyhelp:hover { transform: translateY(-1px); border-color: var(--brand-300); box-shadow: 0 10px 26px -12px rgba(47, 93, 140, 0.5); }
.keyhelp-thumbs { position: relative; flex: none; width: 74px; height: 52px; }
.keyhelp-thumbs img {
  position: absolute; width: 50px; height: 36px; object-fit: cover; object-position: left top; border-radius: 7px;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(10, 12, 40, 0.18); transition: transform 0.3s var(--spring);
}
.keyhelp-thumbs img:nth-child(1) { left: 0; top: 0; transform: rotate(-6deg); }
.keyhelp-thumbs img:nth-child(2) { left: 12px; top: 8px; transform: rotate(2deg); }
.keyhelp-thumbs img:nth-child(3) { left: 24px; top: 14px; transform: rotate(7deg); }
.keyhelp:hover .keyhelp-thumbs img:nth-child(1) { transform: rotate(-10deg) translate(-3px, -2px); }
.keyhelp:hover .keyhelp-thumbs img:nth-child(3) { transform: rotate(11deg) translate(3px, 1px); }
.keyhelp-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.keyhelp-text b { font-size: 14.5px; font-weight: 600; color: var(--brand-700); }
.keyhelp-go { flex: none; color: var(--brand-500); transition: transform 0.2s var(--ease); }
.keyhelp:hover .keyhelp-go { transform: translateX(3px); }
.field-eye { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--dim); cursor: pointer; }
.field-eye:hover, .field-eye.is-on { color: var(--brand-500); background: var(--brand-50); }
.field.is-filled { border-color: rgba(25, 164, 99, 0.45); }
.field.is-filled .field-icon { color: var(--ok); }

.guide-card { position: relative; width: min(760px, 100%); text-align: left; align-items: stretch; gap: 14px; padding: 28px; }
.guide-close { position: absolute; top: 14px; right: 14px; }
.guide-head .tag { gap: 4px; }
a.btn { text-decoration: none; }
a.btn:hover { color: inherit; }
.guide-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.guide-dots { display: flex; gap: 6px; }
.guide-dots i { flex: 1; height: 4px; border-radius: 99px; background: var(--soft); overflow: hidden; position: relative; }
.guide-dots i::after { content: ""; position: absolute; inset: 0; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease); }
.guide-dots i.is-on::after { transform: scaleX(1); }
.guide-stage {
  display: grid; place-items: center; height: min(360px, 48vh); padding: 16px; border-radius: 18px;
  background: radial-gradient(70% 90% at 20% 0%, var(--brand-50), transparent 70%), var(--surface-2); overflow: hidden;
}
.guide-shot { margin: 0; max-width: 100%; }
.guide-shot img {
  display: block; max-width: 100%; max-height: calc(min(360px, 48vh) - 32px); border-radius: 12px; box-shadow: 0 18px 44px -16px rgba(15, 30, 51, 0.35), 0 0 0 1px var(--line);
  cursor: zoom-in; transition: transform 0.35s var(--ease);
}
.guide-shot.is-zoom img { cursor: zoom-out; transform: scale(1.5); transform-origin: var(--zx, 50%) var(--zy, 50%); }
.guide-shot.in-next { animation: gin 0.45s var(--ease) both; }
.guide-shot.in-prev { animation: gin-prev 0.45s var(--ease) both; }
@keyframes gin { from { opacity: 0; transform: translateX(40px) scale(0.98); } }
@keyframes gin-prev { from { opacity: 0; transform: translateX(-40px) scale(0.98); } }
.guide-text h3 { font-size: 19px; }
.guide-text p { margin-top: 4px; line-height: 1.5; }
.guide-text kbd { font: 500 12.5px var(--mono); padding: 1px 6px; border-radius: 6px; background: var(--soft); color: var(--text); }
.guide-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.guide-actions #guide-back { margin-right: auto; }

/* export */
.export-card { text-align: left; align-items: stretch; width: min(520px, 100%); }
.export-card h2, .export-card > p { text-align: center; }
.export-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.xopt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 14px;
  cursor: pointer; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.xopt:hover { border-color: var(--brand-300); }
.xopt input { position: absolute; opacity: 0; pointer-events: none; }
.xopt:has(input:checked) { border-color: var(--brand-400); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(47, 93, 140, 0.12); }
.xopt:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.xopt-ico { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); color: var(--brand-500); transition: background 0.2s, color 0.2s; }
.xopt:has(input:checked) .xopt-ico { background: var(--grad); color: #fff; }
.xopt-text { display: flex; flex-direction: column; line-height: 1.35; }
.xopt-text b { font-weight: 500; }
.xprogress { margin-top: 6px; display: flex; flex-direction: column; gap: 8px; animation: reveal 0.35s var(--ease) both; }
.xprogress-label { display: flex; justify-content: space-between; font-size: 13.5px; }
.xprogress .progress-bar { height: 8px; }
#xbar { background: var(--brand-400); }
#xbar.is-indeterminate { width: 30% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { left: -30%; } to { left: 100%; } }
.export-card .done-actions { justify-content: flex-end; }

/* still-watching */
.still-ring { position: relative; width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 4px; }
.still-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.still-ring circle { fill: none; stroke-width: 7; }
.still-ring .ring-bg { stroke: var(--soft); }
.still-fg { stroke: var(--brand-400); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.still-ring span { font-size: 22px; font-weight: 500; }
#file-duration.is-live { background: #f0a21b; color: #0f1e33; }

/* exits */
.lp-pop.is-leaving { animation: lp-out 0.15s ease-in forwards; pointer-events: none; }
@keyframes lp-out { to { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.done-sheet.is-leaving { animation: fade-out 0.22s ease-in forwards; pointer-events: none; }
.done-sheet.is-leaving .done-card { animation: pop-out 0.22s ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-out { to { opacity: 0; transform: scale(0.96) translateY(6px); } }

/* skeletons */
.skel {
  border-radius: var(--r-sm); color: transparent !important;
  background: linear-gradient(90deg, #e6ebf1 0%, #f2f5f8 40%, #e6ebf1 80%) 0 0 / 200% 100%;
  animation: skel 1.3s ease-in-out infinite;
}
@keyframes skel { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.skel-row { height: 44px; border-radius: 12px; }
.skel-row + .skel-row { margin-top: 6px; }

.signin-skel { display: none; flex-direction: column; gap: 16px; margin-top: 18px; }
.signin-body.is-checking .signin-skel { display: flex; }
.signin-body.is-checking #oauth-block, .signin-body.is-checking #keys { display: none; }
.select > select { display: none; }
.lp-skel { height: 52px; }
.user.is-loading .user-name { color: transparent; border-radius: 6px; background: linear-gradient(90deg, #e6ebf1, #f2f5f8, #e6ebf1) 0 0 / 200% 100%; animation: skel 1.3s ease-in-out infinite; }
.user.is-loading .avatar { background: #e6ebf1; color: transparent; }
.balance.is-loading span { color: transparent; border-radius: 6px; background: linear-gradient(90deg, #e6ebf1, #f2f5f8, #e6ebf1) 0 0 / 200% 100%; animation: skel 1.3s ease-in-out infinite; }
.dz-preview.is-loading::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0) 100%) 0 0 / 200% 100%;
  animation: skel 1.1s ease-in-out infinite;
}
.vp-play.is-loading .i-play, .vp-play.is-loading .eq { display: none; }
.vp-play.is-loading::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }

/* toast */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 14px; background: var(--text); color: #fff; font-size: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25); transform: translate(-50%, 20px); opacity: 0;
  transition: transform 0.35s var(--spring), opacity 0.25s;
}
.toast.is-in { transform: translate(-50%, 0); opacity: 1; }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1100px) {
  .view--signin { grid-template-columns: 1fr; }
  .signin-card { min-height: auto; }
  .signin-hero { padding: 32px 16px 48px; }
  .live-grid { grid-template-columns: 1fr; height: auto; }
  .player { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
  .transcript { height: 520px; }
}

@media (max-width: 820px) {
  .setup-grid { grid-template-columns: 1fr; }
  .setup-head h1 { font-size: 30px; }
  .hero-title { font-size: 32px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meters { grid-template-columns: 1fr 1fr; }
  .controls { flex-wrap: wrap; }
  .progress { order: 3; flex-basis: 100%; }
  .user-name, .tag { display: none; }
  .topbar { padding: 0 16px; gap: 10px; }
  .stage { padding-left: 16px; padding-right: 16px; }
  .warmup { flex-direction: column; gap: 20px; }
  .dropzone { min-height: 300px; }
  .lang-row { flex-direction: column; align-items: stretch; }
  .lang-row .select { width: 100%; }
  .swap { align-self: center; margin: 0; transform: rotate(90deg); }
  .demo-wave { top: 20%; height: 44px; }
  .demo-sub-dst { font-size: 15px; }
  .demo-sub-src { font-size: 12px; }
  .warmup-ring { width: 84px; height: 84px; }
  #warmup-count { font-size: 28px; }
  .wstep { font-size: 13px; }
}

@media (max-width: 520px) {
  .topbar .logo img + img { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- accounts (email + password) ---------- */
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 12px; background: var(--soft); margin-top: 6px; }
.auth-tab {
  position: relative; z-index: 1; height: 38px; border: 0; background: transparent; border-radius: 9px;
  font: 500 14px var(--font); color: var(--muted); cursor: pointer; transition: color 0.25s;
}
.auth-tab.is-active { color: var(--text); }
.auth-glider {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px; background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); transition: transform 0.4s var(--spring);
}
.auth-tabs[data-mode="register"] .auth-glider { transform: translateX(100%); }
.auth-form .field--name { animation: reveal 0.35s var(--ease) both; }
.auth-form .btn--primary { margin-top: 6px; }
.balance-sub { color: var(--muted); font-weight: 400; }
.estimate b { color: var(--text); font-weight: 600; }

/* ---------- Booth wordmark ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -0.045em; }
.logo--lg .wordmark { font-size: 34px; }
.logo:hover { color: var(--text); }
/* the start button carries the tally light */
#btn-start svg { color: var(--orange); }

/* ---------- sign-in extras, top bar links ---------- */
.btn--google { gap: 10px; text-decoration: none; color: var(--text); }
.oauth-block { display: flex; flex-direction: column; gap: 14px; }
.site-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.site-links a { color: var(--muted); text-decoration: none; }
.site-links a:hover { color: var(--brand-400); text-decoration: underline; }
.topbar-link { font-size: 14px; font-weight: 500; color: var(--text-2); text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.topbar-link:hover { background: var(--surface); color: var(--brand-400); }
