/* Layout: top bar, then a step column beside a sticky preview column; stacks on phones */
:root {
  --bg: #f2f4f7; --panel: #ffffff; --fg: #1c2331; --muted: #5d677a; --line: #d9dee8;
  --accent: #1d3f8f; --accent-fg: #ffffff; --accent-soft: #e3eaf8; --warn: #9a5b00; --warn-soft: #fdf1dc; --ok: #1f7a4a; --ok-soft: #e1f3e8; --danger: #b42318;
  --f-display: 'Kalam', 'Comic Sans MS', cursive; --f-body: 'Atkinson Hyperlegible', system-ui, sans-serif; --f-mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12161f; --panel: #1a202c; --fg: #e6e9f0; --muted: #9aa4b8; --line: #2c3446; --accent: #8fb0ff; --accent-fg: #0f1730; --accent-soft: #22304d;
    --warn: #f0b354; --warn-soft: #3a2c14; --ok: #6cd39b; --ok-soft: #173326; --danger: #ff8a80; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--f-body); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between;
  padding: 10px max(16px, env(safe-area-inset-left)); background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 8px; }
.logo { font: 700 24px/1 var(--f-display); color: var(--accent); }
.brand .sub { color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.proj { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1 1 420px; }
.proj select { max-width: 220px; } .proj input { max-width: 260px; }
.who { display: flex; gap: 8px; align-items: center; }
.muted { color: var(--muted); font-size: 13px; }
.cols { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 18px; align-items: start;
  padding: 18px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); }
@media (max-width: 920px) { .cols { grid-template-columns: minmax(0, 1fr); } .sticky { position: static !important; } }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sticky { position: sticky; top: 74px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
h2 { margin: 0; font: 700 18px/1.3 var(--f-body); display: flex; align-items: center; gap: 10px; text-wrap: balance; }
h3 { margin: 4px 0 0; font: 700 13px/1.3 var(--f-body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 14px var(--f-mono); }
label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
input, textarea, select { font: inherit; font-size: 14px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; } .mono { font-family: var(--f-mono); font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1 1 130px; }
.narrow { max-width: 170px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
button, .button, .file-btn { font: 700 14px var(--f-body); border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); padding: 8px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.file-btn { flex: 0 0 auto !important; flex-direction: row; color: var(--fg); }
button:hover, .file-btn:hover, .button:hover { border-color: var(--accent); }
button.primary, .button { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 6px 8px; }
button.wide { width: 100%; }
button:disabled { opacity: .5; cursor: not-allowed; }
.status { font-size: 13px; color: var(--muted); align-self: center; min-height: 1.2em; margin: 0; }
.err { color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.sub-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.items { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) auto; gap: 6px; align-items: center; }
.item.hl { grid-template-columns: minmax(0, .9fr) 108px minmax(0, 1.3fr) auto; }
@media (max-width: 600px) { .item, .item.hl { grid-template-columns: minmax(0, 1fr) auto; } .item > :nth-child(2), .item.hl > :nth-child(2), .item.hl > :nth-child(3) { grid-column: 1; } }
details { border-top: 1px dashed var(--line); padding-top: 10px; }
summary { cursor: pointer; font-size: 13px; color: var(--accent); font-weight: 700; }
.check { flex-direction: row !important; align-items: center; gap: 8px; color: var(--fg); font-size: 14px; flex: 0 0 auto !important; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.gallery button { padding: 0; aspect-ratio: 2 / 3; overflow: hidden; border-width: 2px; background: var(--bg); }
.gallery.small button { aspect-ratio: 1; background: repeating-conic-gradient(var(--bg) 0 25%, var(--line) 0 50%) 0 0 / 14px 14px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery.small img { object-fit: contain; }
.gallery button[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.stage { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
canvas#cv { display: block; width: 100%; height: auto; aspect-ratio: 1080 / 1350; }
.player { display: flex; gap: 8px; align-items: center; }
.player input { flex: 1; }
.time { font: 13px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.notes li { padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); }
.notes li.ok { background: var(--ok-soft); color: var(--ok); }
.bar-p { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.bar-p > i { display: block; height: 100%; width: 0; background: var(--accent); }
video { width: 100%; border-radius: 10px; background: #000; }
#av-video { max-width: 260px; }
/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left)); }
.login form { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0; font: 700 34px/1 var(--f-display); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
