:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a1d23;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, #e8eefc 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0f4f8 0%, transparent 50%),
    var(--bg);
}

.app {
  width: min(880px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

.video-panel {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  background: var(--surface);
}

.header h1 {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.banner {
  border: 1px solid #f5d0b5;
  background: #fff7ed;
  color: #9a3412;
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.banner code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86em;
}

.hint-inline {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: #9ca3af;
  margin-left: 0.35rem;
}

.enable-mic {
  width: 100%;
  margin-bottom: 0.9rem;
}

.enable-mic[hidden] {
  display: none;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem 1.25rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.video-wrap {
  position: relative;
  background: #0f1218;
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

video {
  display: block;
  max-width: 100%;
  max-height: min(36vh, 420px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #0f1218;
}

.empty-hint {
  position: absolute;
  margin: 0;
  color: #9ca3af;
  font-size: 0.95rem;
  pointer-events: none;
}

.transport {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.timecode {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
}

.scrubber {
  width: 100%;
  margin-top: 0.75rem;
  accent-color: var(--accent);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.field span {
  font-size: 0.85rem;
  color: var(--muted);
}

select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.gain-field em {
  font-style: normal;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.gain-slider {
  width: 100%;
  accent-color: var(--accent);
}

.meter-wrap {
  height: 8px;
  background: #eef1f5;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.meter {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width 60ms linear;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn,
.file-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover:not(:disabled),
.file-btn:hover {
  background: #f8fafc;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-record {
  min-width: 6.5rem;
}

.btn-record.is-recording {
  background: var(--danger-soft);
  border-color: #fecaca;
  color: var(--danger);
}

.status {
  font-size: 0.85rem;
  color: var(--muted);
}

.status.live {
  color: var(--danger);
  font-weight: 600;
}

.takes {
  margin-top: 1.15rem;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

.takes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.takes-head h3 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.takes-count {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.takes-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.takes-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.take-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  background: #fafbfc;
}

.take-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}

.take-title {
  font-weight: 600;
}

.take-detail {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.take-preview {
  width: 100%;
  height: 32px;
  margin-bottom: 0.55rem;
}

.take-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

@media (max-width: 560px) {
  .app {
    width: min(880px, calc(100% - 1rem));
    margin: 0.75rem auto 2rem;
    gap: 0.85rem;
  }

  .header h1 {
    font-size: 1.35rem;
  }

  .subtitle {
    font-size: 0.85rem;
  }

  .video-panel {
    top: 0.4rem;
    padding: 0.7rem 0.75rem 0.8rem;
  }

  .video-panel .panel-head {
    margin-bottom: 0.5rem;
  }

  .hint-inline {
    display: none;
  }

  .video-wrap {
    min-height: 88px;
  }

  video {
    max-height: min(28vh, 220px);
  }

  .transport {
    margin-top: 0.55rem;
    gap: 0.35rem;
  }

  .transport .btn {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
  }

  .scrubber {
    margin-top: 0.45rem;
  }

  .timecode {
    margin-left: 0;
    width: 100%;
    font-size: 0.82rem;
  }
}
