:root {
  --bg: #1b1d1f;
  --panel: #2a2d31;
  --line: #3a4048;
  --text: #ececec;
  --muted: #aeb6c0;
  --teal: #2fbfb3;
  --good: #8dffb0;
  --bad: #ff8d93;
  --amber: #e2a33a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.app { width: min(1180px, calc(100% - 20px)); margin: 0 auto; padding: 16px 0 32px; }
.topbar, .lesson, .edit-toolbar, .action-row, .top-controls, .task-nav {
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
}
.topbar { margin-bottom: 14px; }
h1, h2 { margin: 0; letter-spacing: -0.03em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.12rem; }
.tagline, .lesson-note, .eyebrow, #tool-readout, #clip-readout { color: var(--muted); }
.tagline, .eyebrow { margin: 2px 0 0; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.chip, .btn, .modes button, .task-nav button {
  border: 1px solid var(--line); background: #333; color: var(--text);
  border-radius: 999px; padding: 8px 12px; text-decoration: none;
}
.btn.primary { background: var(--teal); color: #06211e; border-color: var(--teal); font-weight: 700; }
.btn.ghost { background: transparent; }
.lesson, .edit-window {
  background: var(--panel); border: 1px solid #191b1e; border-radius: 12px; padding: 14px;
}
.lesson { align-items: flex-start; }
.lesson-copy { flex: 1; min-width: 0; }
#task-detail { margin: 6px 0 0; line-height: 1.45; }
.result { min-height: 1.3em; margin: 8px 0 0; font-weight: 700; }
.result.is-good { color: var(--good); }
.result.is-bad { color: var(--bad); }
.lesson-actions { align-items: flex-end; flex-direction: column; }
.task-nav { justify-content: flex-end; flex-wrap: wrap; }
.task-nav button.is-on { border-color: var(--teal); }
.task-nav button.is-solved { color: var(--good); }
.lesson-note { margin: 10px 2px; }
.edit-toolbar { margin-bottom: 8px; }
.modes { gap: 6px; }
.modes button.is-on { background: #d7e26a; color: #222; border-color: #d7e26a; font-weight: 700; }
#tool-readout { margin: 0; font-weight: 650; }
.timeline-scroll { overflow-x: auto; background: #23262a; border-radius: 8px; }
#timeline { width: 100%; min-width: 760px; display: block; touch-action: none; user-select: none; }
#timeline.is-select { cursor: text; }
#timeline.is-grab { cursor: grab; }
#timeline.is-grabbing { cursor: grabbing; }
#timeline.is-trim-start { cursor: w-resize; }
#timeline.is-trim-end { cursor: e-resize; }
#timeline.is-fade { cursor: crosshair; }
#clip-readout { margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.spot-dialog {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: grid; place-items: center; z-index: 5;
}
.spot-dialog form {
  background: #2c3138; border-radius: 12px; padding: 16px; width: min(360px, calc(100% - 24px));
  display: flex; flex-direction: column; gap: 12px;
}
.spot-dialog label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.spot-dialog input {
  background: #15171a; border: 1px solid #111; border-radius: 6px; padding: 8px;
}
@media (max-width: 720px) {
  .topbar, .lesson { flex-direction: column; align-items: stretch; }
}
