/* Tavia voice playground. Tokens copied from the Tavia Labs site; dark mode via prefers-color-scheme. */
:root {
  --ink: #0B1F24;
  --lagoon: #0E7C74;
  --lagoon-dark: #0B5F59;
  --sunrise: #F08A3C;
  --mist: #F4F7F5;
  --white: #FFFFFF;
  --slate: #3D5257;
  --line: #DDE6E2;
  --line-strong: #B9CBC6;
  --tint: #E2EFEC;
  --error: #B42318;
  --bg: var(--mist);
  --surface: var(--white);
  --text: var(--ink);
  --muted: var(--slate);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Manrope', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181818;
    --surface: #272727;
    --text: #F4F7F5;
    --muted: #B5C9C5;
    --line: #3A3A3A;
    --line-strong: #555555;
    --tint: #1F3533;
    --error: #F97066;
  }
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 24px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; line-height: 36px; letter-spacing: -.02em; }
h2 { font-size: 20px; line-height: 28px; letter-spacing: -.01em; }
h3 { font-size: 14px; line-height: 20px; text-transform: uppercase; letter-spacing: .08em; color: var(--lagoon); }
a { color: var(--lagoon); text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--sunrise); outline-offset: 2px; border-radius: 8px; }
.mono { font-family: var(--mono); }
.small { font-size: 14px; line-height: 20px; }
.xs { font-size: 12px; line-height: 16px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 8px; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--white); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px; border: 1px solid transparent; border-radius: 12px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease);
}
.btn-primary { background: var(--lagoon); color: var(--white); }
.btn-primary:hover { background: var(--lagoon-dark); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--tint); }
.btn-ghost[aria-pressed="true"] { background: var(--tint); border-color: var(--lagoon); }
.btn-small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand-word { font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -.03em; }
.brand-word span { font-weight: 500; color: var(--lagoon); }
.shell { display: grid; grid-template-columns: 1fr; max-width: 1200px; margin: 0 auto; }
.nav { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.nav ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; }
.nav a:hover { background: var(--tint); color: var(--text); }
.nav a[aria-current] { background: var(--tint); color: var(--text); }
.nav-group { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 4px 0; }
.main { padding: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 900px) {
  .shell { grid-template-columns: 240px 1fr; }
  .nav { border-bottom: 0; border-right: 1px solid var(--line); min-height: calc(100vh - 61px); }
  .nav ul { flex-direction: column; }
}

.banner { padding: 12px 16px; border-radius: 12px; font-weight: 600; border: 1px solid var(--line); }
.banner[data-tone="ok"] { background: var(--tint); color: var(--text); border-color: var(--lagoon); }
.banner[data-tone="warn"] { background: rgba(240, 138, 60, .15); border-color: var(--sunrise); }
.banner[data-tone="off"] { background: var(--surface); color: var(--muted); }
.note { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 14px; line-height: 20px; font-weight: 600; }
input[type=text], input[type=password] {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; width: 100%;
}
.check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--lagoon); }
.error, .field-error { color: var(--error); font-weight: 600; }
.badge { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--tint); color: var(--lagoon); font-size: 12px; line-height: 20px; font-weight: 600; }
.live { min-height: 72px; max-height: 320px; overflow-y: auto; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 18px; line-height: 28px; }
.history p { margin: 0 0 4px; }
.final { color: var(--text); }
.partial { color: var(--muted); }
.turns { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.turns th, .turns td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

.inspector { display: flex; flex-direction: column; gap: 12px; }
.turn { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.lanes { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lane { display: grid; grid-template-columns: 1fr; gap: 4px; }
@media (min-width: 640px) { .lane { grid-template-columns: 180px 1fr; } }
.lane-label { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; }
.lane-events { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { padding: 2px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; }
.chip-final { border-color: var(--lagoon); }
.chip-partial { color: var(--muted); }
.chip-provisional { opacity: 0.5; }

body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* STT upload */
.dropzone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; cursor: pointer; }
.dropzone.over, .dropzone:focus-within { border-color: var(--lagoon); background: var(--tint); }
progress { width: 100%; accent-color: var(--lagoon); }
