:root {
  color-scheme: light;
  --paper: #fff;
  --background: #eff2f1;
  --ink: #152924;
  --muted: #4b625a;
  --line: #ccd9d2;
  --accent: #155e4c;
  --dark: #122e26;
  color: var(--ink);
  background: var(--background);
  font: 16px/1.5 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.frame { width: min(100% - 1.6rem, 51rem); margin-inline: auto; }
header { background: var(--dark); color: #f4f9f6; border-bottom: .3rem solid #70aa91; padding: 1.7rem 0 1.5rem; }
header p { color: #cfdfd6; margin: .25rem 0; }
.eyebrow { font-size: .88rem; font-weight: 650; }
h1 { margin: .2rem 0; font-size: clamp(2rem, 7vw, 3rem); line-height: 1.1; letter-spacing: -.04em; }
h2 { font-size: 1.4rem; margin: 0 0 .35rem; letter-spacing: -.02em; }
p { margin: .3rem 0 .65rem; }
nav { position: sticky; top: 0; z-index: 1; background: var(--paper); border-bottom: 1px solid var(--line); }
.nav { display: flex; overflow-x: auto; gap: .45rem 1rem; padding: .55rem 0; }
a { color: var(--accent); text-underline-offset: .17em; }
.nav a { font-weight: 650; white-space: nowrap; }
main { padding: 1rem 0 2rem; }
section { scroll-margin-top: 3.75rem; background: var(--paper); border: 1px solid var(--line); border-radius: .6rem; padding: 1rem; margin-bottom: .95rem; }
.section-title, .buttons { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.section-title { justify-content: space-between; }
.buttons { margin-block: .6rem; }
button, input, select, textarea { font: inherit; color: var(--ink); }
button, input, select, textarea { background: #fff; border: 1px solid #94ab9f; border-radius: .36rem; padding: .45rem .58rem; }
button { min-height: 44px; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--accent); border-color: var(--accent); color: white; }
:focus-visible { outline: 3px solid #338b70; outline-offset: 2px; }
audio { display: block; width: 100%; margin-block: .65rem; }
.metrics { margin: .55rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .45rem; }
.metrics > div { padding: .4rem .55rem; background: #edf4f0; border-radius: .3rem; }
.metrics dt, .state { font-weight: 650; }
.metrics dt { color: var(--muted); font-size: .9rem; }
.metrics dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.state { background: #dfefe7; border-radius: .25rem; padding: .1rem .45rem; }
.seek input { width: 6rem; }
.error { color: #8e2318; font-weight: 650; }
details { margin: .6rem 0; }
summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.mono { font: .88rem/1.55 ui-monospace, monospace; }
.loop-view { background: #172a23; width: min(100%, 344px); aspect-ratio: 16/9; }
.loop-view img, .loop-view video { display: block; width: 100%; height: 100%; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .55rem; margin-block: .75rem; }
form label { display: block; font-weight: 620; }
form input, form textarea, form select { display: block; width: 100%; margin-top: .25rem; font-weight: 400; }
form textarea { resize: vertical; }
.check { border-top: 1px solid var(--line); padding-block: .55rem; display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 1.1fr); gap: .45rem .65rem; }
.check p { margin: .15rem 0; color: var(--muted); font-size: .94rem; }
.check-note { grid-column: 1/-1; }
#events { padding-left: 1.5rem; font: .85rem/1.5 ui-monospace, monospace; overflow-wrap: anywhere; }
#save-state { color: var(--muted); font-size: .93rem; }
@media (max-width: 480px) {
  .check, .fields { grid-template-columns: 1fr; }
  section { padding: .75rem; }
}
