:root {
  color-scheme: light dark;
  --bg: #f6f5f2; --panel: #fff; --text: #1d1d1b; --muted: #6b6a66; --line: #dcdad4;
  --accent: #1f5fbf; --accent-text: #fff; --ok: #1d7a3a; --error: #b3261e;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --panel: #20201e; --text: #ecebe7; --muted: #a09f9a; --line: #3a3a37;
    --accent: #6ea2ff; --accent-text: #0b1a33; --ok: #6fcf8a; --error: #ff8a80; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* the display rules below must not show hidden elements */
body { margin: 0; background: var(--bg); color: var(--text); }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.note { color: var(--muted); font-size: .9rem; }
.error { color: var(--error); }
.ok { color: var(--ok); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); background: var(--panel); }
.top form { margin: 0; }
.spacer { flex: 1; }

.layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 50px); }
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } .works ul { max-height: 30vh; } }

.works { border-right: 1px solid var(--line); padding: 1rem; background: var(--panel); }
.works input { width: 100%; padding: .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: inherit; font: inherit; }
.works ul { list-style: none; margin: .75rem 0 0; padding: 0; max-height: calc(100vh - 140px); overflow: auto; }
.works li a { display: flex; gap: .4rem; align-items: center; width: 100%; text-align: left; padding: .45rem .5rem;
  border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
.works li a:hover { background: var(--bg); }
.works li a[aria-current="true"] { background: var(--accent); color: var(--accent-text); }
.badge { margin-left: auto; font-size: .75rem; padding: 0 .4rem; border-radius: 4px; border: 1px solid currentColor; opacity: .8; }
.badge.muted + .badge, .badge + .badge.muted { margin-left: 0; }

main { padding: 1.5rem; max-width: 980px; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
video, img { display: block; max-width: 100%; border-radius: 6px; background: #000; }
#source-video, #current-video { max-height: 360px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 760px) { .pair { grid-template-columns: 1fr; } }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
#thumb-current, #thumb-preview { max-height: 160px; margin: .5rem 0; }

.field { margin: .75rem 0; }
.field label { display: flex; justify-content: space-between; font-size: .9rem; }
.field input[type="range"] { width: 100%; }
.check { display: block; margin: .5rem 0; }
.row { display: flex; gap: .5rem; flex-wrap: wrap; }
progress { width: 100%; margin-top: .75rem; }

.button { display: inline-block; padding: .55rem 1rem; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent);
  color: var(--accent-text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button.secondary { background: none; color: var(--accent); }
.button:disabled { opacity: .5; cursor: default; }
.link { border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

.signin main { max-width: 420px; margin: 15vh auto; text-align: center; }
