:root {
  color-scheme: light;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --blue: #2563EB;
  --blue-light: #EFF6FF;
  --bg: #F7F8FB;
  --card-bg: #FFFFFF;
  --border: #E5E7EB;
  --text: #0F172A;
  --text-soft: #475569;
  --text-faint: #94A3B8;
  --green: #16A34A;
  --red: #DC2626;
  --amber: #D97706;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }

.shell { display: flex; min-height: 100vh; }

.sidenav {
  width: 230px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidenav-brand {
  font-weight: 800;
  font-size: 15px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidenav-list { list-style: none; margin: 0; padding: 8px 12px; }
.sidenav-list li { margin-bottom: 2px; }
.sidenav-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-soft);
}
.sidenav-list a:hover { background: var(--blue-light); color: var(--blue); }
.sidenav-list a.active { background: var(--blue-light); color: var(--blue); }
.sidenav-list a.soon { color: var(--text-faint); }
.sidenav-list a.soon:hover { background: var(--bg); color: var(--text-faint); }
.pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--border);
  color: var(--text-soft);
  padding: 2px 6px;
  border-radius: 999px;
}

.content { flex: 1; padding: 32px 40px; max-width: 960px; }

h1 { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.subtitle { color: var(--text-soft); margin: 0 0 28px; font-size: 14px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 20px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-faint); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-draft { background: #F1F5F9; color: var(--text-soft); }
.badge-script_ready { background: var(--blue-light); color: var(--blue); }
.badge-voiceover_ready { background: #ECFDF5; color: var(--green); }
.badge-error { background: #FEF2F2; color: var(--red); }
.badge-uploaded { background: #F1F5F9; color: var(--text-soft); }
.badge-rendering { background: #FFFBEB; color: var(--amber); }
.badge-done { background: #ECFDF5; color: var(--green); }

.video-wrap { position: relative; width: 100%; background: #000; border-radius: 8px; overflow: hidden; }
.video-wrap video { width: 100%; display: block; }
.draw-overlay { position: absolute; inset: 0; cursor: crosshair; pointer-events: none; }
.draw-overlay.active { pointer-events: auto; background: rgba(37, 99, 235, 0.04); }
.marquee { position: absolute; border: 2px dashed var(--blue); background: rgba(37, 99, 235, 0.15); display: none; pointer-events: none; }

label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input[type=text], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; min-height: 70px; }

.radio-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0; }
.radio-row input[type=radio], .radio-row input[type=checkbox] { width: auto; }
.hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

input[type=range] {
  width: 100%;
  height: 20px;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}
input[type=range]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
}
input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}

.duration-estimate { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.export-progress { display: none; margin-top: 10px; width: 220px; }
.export-progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.export-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--blue);
  border-radius: 999px;
}
.export-progress-label { font-size: 12px; color: var(--text-faint); margin-top: 4px; }

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font);
}
button:hover, .btn:hover { background: #1D4ED8; }
button.secondary, .btn.secondary { background: #fff; color: var(--text); border: 1px solid var(--border); }
button.secondary:hover, .btn.secondary:hover { background: var(--bg); }
button:disabled { background: var(--border); color: var(--text-faint); cursor: not-allowed; }

.notice { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.notice-error { background: #FEF2F2; color: var(--red); border: 1px solid #FECACA; }
.notice-warn { background: #FFFBEB; color: var(--amber); border: 1px solid #FDE68A; }

.beat { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; background: #FAFBFC; }
.beat-label { font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; margin-bottom: 8px; }

.empty { color: var(--text-faint); font-size: 14px; padding: 20px 0; text-align: center; }

audio { width: 100%; margin-top: 8px; }
