:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --line: #d9dde3;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --ok: #1a7f37;
  --warn: #9a6700;
  --bad: #cf222e;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --card: #181c22;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --line: #2c333d;
    --accent: #4c8dff;
    --accent-text: #0b0e12;
    --ok: #3fb950;
    --warn: #d29922;
    --bad: #f85149;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header, main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

header { padding-top: 20px; }
h1 { font-size: 1.35rem; margin: 0 0 6px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }

.note { color: var(--muted); margin: 0 0 12px; font-size: 0.93rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}

dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 12px 0;
  font-size: 0.92rem;
}
dl:empty { display: none; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.button:disabled, .button[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

.file { position: relative; overflow: hidden; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

video {
  display: block;
  width: 100%;
  max-height: 60vh;
  margin: 12px 0 4px;
  background: #000;
  border-radius: 8px;
}

.range {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin: 12px 0;
}
.range label { color: var(--muted); font-size: 0.92rem; }
input[type="number"], select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

@media (min-width: 560px) {
  .range { grid-template-columns: 9rem 1fr auto; align-items: center; }
  #audio-choice.range { grid-template-columns: 9rem 1fr; }
}

.snap {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg);
  border-radius: 4px;
  font-size: 0.93rem;
}
.snap:empty { display: none; }

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

progress { width: 100%; height: 12px; margin-top: 12px; }

.status { margin: 8px 0 0; font-size: 0.93rem; }
.status:empty { display: none; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  padding: 8px;
  margin-bottom: 8px;
}
