:root {
  color-scheme: light;
  --bg-primary: #fafaf7;
  --bg-secondary: #f2f2ee;
  --text-primary: #1a1a1a;
  --text-secondary: #71717a;
  --text-tertiary: #a1a1aa;
  --divider: #e4e4e1;
  --accent: #f0a868;
  --accent-muted: #f0a86833;
  --shadow: rgba(30, 25, 18, 0.12);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0a0a0b;
  --bg-secondary: #141416;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #52525b;
  --divider: #27272a;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 10%, var(--accent-muted), transparent 34rem),
    var(--bg-primary);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 22px clamp(20px, 5vw, 56px);
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  color: var(--text-primary);
  display: inline-flex;
  font-weight: 650;
  gap: 10px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  border-radius: 10px;
  height: 34px;
  width: 34px;
}

.toolbar {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.ghost-button,
.link-button {
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  padding: 8px 10px;
}

.ghost-button {
  border: 1px solid var(--divider);
  border-radius: 999px;
  min-width: 64px;
}

.link-button:hover,
.ghost-button:hover {
  color: var(--text-primary);
}

.shell {
  min-height: 100vh;
  padding: 108px clamp(20px, 5vw, 56px) 48px;
}

.landing,
.recorder {
  margin: 0 auto;
  width: min(920px, 100%);
}

.landing {
  align-items: center;
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  min-height: calc(100vh - 180px);
}

.auth-loading .landing,
.auth-loading .recorder,
.auth-loading .usage-panel {
  visibility: hidden;
}

.logo {
  border-radius: 18px;
  box-shadow: 0 18px 50px var(--shadow);
  height: 72px;
  margin-bottom: 28px;
  width: 72px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  margin: 0 0 16px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 5.6rem);
  letter-spacing: -0.075em;
  line-height: 0.92;
  margin: 0;
  max-width: 780px;
}

.lead {
  color: var(--text-secondary);
  font-size: 1.12rem;
  line-height: 1.7;
  margin: 24px 0 0;
  max-width: 620px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  border: 1px solid var(--divider);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  padding: 13px 20px;
  text-decoration: none;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #16110a;
}

.fine-print {
  color: var(--text-tertiary);
  font-size: 0.92rem;
  margin-top: 14px;
}

.landing-wave {
  align-items: center;
  display: flex;
  gap: 12px;
  height: 220px;
  justify-content: center;
}

.landing-wave span {
  background: var(--accent);
  border-radius: 999px;
  display: block;
  opacity: 0.72;
  width: 10px;
}

.landing-wave span:nth-child(1) { height: 34px; opacity: 0.22; }
.landing-wave span:nth-child(2) { height: 72px; opacity: 0.34; }
.landing-wave span:nth-child(3) { height: 128px; opacity: 0.48; }
.landing-wave span:nth-child(4) { height: 188px; opacity: 0.86; }
.landing-wave span:nth-child(5) { height: 156px; opacity: 0.66; }
.landing-wave span:nth-child(6) { height: 92px; opacity: 0.42; }
.landing-wave span:nth-child(7) { height: 52px; opacity: 0.3; }
.landing-wave span:nth-child(8) { height: 26px; opacity: 0.2; }

.recorder {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 180px);
  text-align: center;
}

.quota-strip {
  background: var(--bg-secondary);
  border: 1px solid var(--divider);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 42px;
  padding: 8px 14px;
}

.quota-strip.low,
.banner.warn {
  background: var(--accent-muted);
  border-color: transparent;
  color: var(--text-primary);
}

.timer {
  font-size: clamp(4rem, 14vw, 6.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 200;
  letter-spacing: -0.08em;
  line-height: 0.92;
}

.status-line {
  color: var(--text-secondary);
  margin: 20px 0 22px;
}

.waveform {
  height: 120px;
  max-width: 720px;
  width: 100%;
}

.transcript {
  color: var(--text-primary);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  line-height: 1.55;
  margin: 26px 0 28px;
  max-width: 760px;
  min-height: 74px;
  overflow-wrap: anywhere;
  text-align: left;
  width: 100%;
}

.transcript:empty::before {
  color: var(--text-tertiary);
  content: attr(data-placeholder);
}

.record-button {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #16110a;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  min-width: 148px;
  padding: 17px 34px;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.record-button.recording {
  background: transparent;
  color: var(--text-primary);
}

.record-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.recorder-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 16px;
}

.banner {
  border: 1px solid var(--divider);
  border-radius: 18px;
  margin: 4px 0 22px;
  max-width: 760px;
  padding: 14px 18px;
  text-align: left;
  width: 100%;
}

.banner.error {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--text-primary);
}

.usage-panel {
  background: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
  border: 1px solid var(--divider);
  border-radius: 28px;
  box-shadow: 0 24px 80px var(--shadow);
  margin: 24px auto 0;
  padding: 24px;
  width: min(760px, 100%);
}

.panel-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.panel-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.05em;
  margin: 0;
}

.muted {
  color: var(--text-secondary);
}

.meter {
  background: var(--divider);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.meter-fill {
  background: var(--accent);
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 0 24px;
}

.field-label {
  color: var(--text-secondary);
  display: block;
  font-size: 0.95rem;
  margin: 18px 0 8px;
}

.field-input {
  background: var(--bg-primary);
  border: 1px solid var(--divider);
  border-radius: 16px;
  color: var(--text-primary);
  font: inherit;
  padding: 14px;
  resize: vertical;
  width: 100%;
}

.field-input:focus {
  border-color: var(--accent);
  outline: none;
}

.stats div,
.usage-row {
  background: var(--bg-primary);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 14px;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  font-size: 1.42rem;
  font-variant-numeric: tabular-nums;
  font-weight: 300;
}

.stats span {
  color: var(--text-secondary);
  font-size: 0.86rem;
  margin-top: 6px;
}

.usage-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto auto;
  margin-top: 8px;
}

.usage-row span {
  color: var(--text-secondary);
}

.hidden {
  display: none !important;
}

@media (max-width: 780px) {
  .topbar {
    padding: 16px 18px;
  }

  .brand span {
    display: none;
  }

  .shell {
    padding: 92px 18px 36px;
  }

  .landing {
    display: block;
    min-height: auto;
  }

  .landing-wave {
    height: 140px;
    margin-top: 36px;
  }

  .recorder {
    min-height: calc(100vh - 128px);
  }

  .quota-strip {
    margin-bottom: 34px;
  }

  .transcript {
    text-align: center;
  }

  .stats,
  .usage-row {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
