:root {
  --bg: #fff; --fg: #1b1d21; --muted: #6b7280; --panel: #f3f4f6; --line: #d6d9de;
  --accent: #2563eb; --accent-fg: #fff; --plot: #2563eb; --cut: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a; --fg: #e6e8eb; --muted: #9aa0a9; --panel: #1d2026; --line: #343841;
    --accent: #5b8def; --accent-fg: #0b0d10; --plot: #5b8def; --cut: #f87171;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.4 system-ui, sans-serif; display: flex; flex-direction: column; }
header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
header h1 { font-size: 15px; margin: 0; }
header label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
header input[type=number], header select { width: 72px; padding: 3px 4px; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; }
header select { width: auto; }
#tone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
#tone label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
#tone input[type=number], #tone select { width: 78px; padding: 3px 4px; background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; }
#tone select { width: auto; }
#tone fieldset { display: contents; }
#tone .lvl { display: flex; align-items: center; gap: 4px; }
#tone button { padding: 3px 10px; }
button, .btn { background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 4px; padding: 6px 12px; font: inherit; cursor: pointer; }
#status { color: var(--muted); margin-left: auto; }
main { flex: 1; min-height: 0; display: flex; }
#shots { width: 280px; flex: none; overflow-y: auto; border-right: 1px solid var(--line); margin: 0; padding: 0; list-style: none; }
#shots li { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
#shots li:hover { background: var(--panel); }
#shots li[aria-selected=true] { background: var(--accent); color: var(--accent-fg); }
#shots canvas { width: 80px; height: 45px; background: var(--panel); flex: none; border-radius: 2px; }
#shots .meta { font-size: 12px; opacity: .85; }
#viewer { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px 16px; gap: 10px; }
#stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--panel); border-radius: 6px; overflow: hidden; }
#frame { max-width: 100%; max-height: 100%; object-fit: contain; }
#controls { display: flex; align-items: center; gap: 12px; }
#scrub { flex: 1; }
#info { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22ch; text-align: right; }
#plot { width: 100%; height: 90px; background: var(--panel); border-radius: 6px; cursor: crosshair; }
#empty { margin: auto; color: var(--muted); text-align: center; }
@media (max-width: 700px) {
  main { flex-direction: column; }
  #shots { width: auto; height: 35%; border-right: 0; border-bottom: 1px solid var(--line); }
}
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
