/* A painted living-room wall: the TV hangs in the middle, the pictures hang around it. */
@font-face { font-family: "Bricolage"; src: url(/fonts/display.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(/fonts/text.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(/fonts/text-bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --wall: #1c3a32;
  --wall-deep: #142b25;
  --wall-light: #2a4f44;
  --panel: #18332c;
  --lamp: #f5bf4f;
  --lamp-deep: #d99a22;
  --ink-on-lamp: #2a1d05;
  --text: #f6f1e4;
  --muted: #bccbc0;
  --line: rgba(246, 241, 228, 0.22);
  --mat: #f3ecdb;
  --frame: #0f0d0a;
  --alert: #ffa98c;
  --live: #ff5a45;
  --ok: #a9e3b7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  color: var(--text);
  font: 400 17px/1.5 "Atkinson", system-ui, sans-serif;
  background: radial-gradient(90vmax 60vmax at 30% 12vmax, #2c5548 0%, transparent 70%), var(--wall);
  background-attachment: fixed;
}
h1, h2 { font-family: "Bricolage", "Atkinson", sans-serif; font-weight: 700; margin: 0; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(34px, 5vw, 60px); line-height: 1.04; }
h2 { font-size: 25px; line-height: 1.2; }
p { margin: 0; }
button { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
.lede { color: var(--muted); margin-top: 10px; }
.lede.small { font-size: 15px; }
.hint { color: var(--muted); font-size: 15px; }
.error { color: var(--alert); margin-top: 12px; }
.loading { min-height: 100dvh; padding: 24px; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.loading .primary { width: auto; min-width: 180px; }
.no-script { padding: 24px; text-align: center; color: var(--muted); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; display: block; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }

/* ---- buttons ---- */
.primary {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 60px; padding: 14px 22px;
  background: var(--lamp); color: var(--ink-on-lamp);
  font: 700 19px/1.2 "Atkinson", sans-serif;
  border: 0; border-radius: 6px; cursor: pointer; text-align: center;
  box-shadow: 0 3px 0 var(--lamp-deep);
  transition: transform 90ms, box-shadow 90ms, background 150ms;
}
.primary:hover { background: #ffcc62; }
.primary:active { transform: translateY(3px); box-shadow: none; }
.primary[disabled] { opacity: 0.5; cursor: default; }
.primary.small { width: auto; min-height: 46px; padding: 10px 18px; font-size: 16px; }
.quiet { min-height: 46px; padding: 9px 16px; background: transparent; font: 700 16px "Atkinson", sans-serif; border: 1px solid rgba(246, 241, 228, 0.35); border-radius: 6px; cursor: pointer; }
.quiet:hover { background: rgba(246, 241, 228, 0.1); }
.quiet.on { background: var(--text); color: var(--wall-deep); border-color: var(--text); }
.quiet.confirm { background: var(--alert); color: #3b1206; border-color: var(--alert); }
.link { background: none; border: 0; padding: 8px 2px; color: var(--muted); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--text); }
.back { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 12px -6px; padding: 6px 8px 6px 2px; background: none; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; }
.back:hover { color: var(--text); }
.back svg { width: 18px; height: 18px; }
.icon-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.icon-btn:hover:not([disabled]) { background: rgba(246, 241, 228, 0.1); }
.icon-btn[disabled] { opacity: 0.3; cursor: default; }

/* ---- the TV ---- */
.tv-wrap { min-width: 0; }
.tv {
  position: relative;
  background: linear-gradient(#26231f, #0f0d0b);
  padding: clamp(6px, 1vw, 12px) clamp(6px, 1vw, 12px) clamp(12px, 1.8vw, 20px);
  border-radius: 10px;
  box-shadow: 0 30px 70px -20px rgba(4, 16, 12, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.screen { position: relative; aspect-ratio: 16 / 9; background: #050505; overflow: hidden; border-radius: 2px; }
.screen-layer { position: absolute; inset: 0; }
.screen-layer img, .screen-layer video { display: block; width: 100%; height: 100%; object-fit: cover; }
.screen-layer video { object-fit: contain; background: #000; }
.led { position: absolute; right: 16px; bottom: clamp(4px, 0.6vw, 7px); width: 6px; height: 6px; border-radius: 50%; background: #4b4b47; }
.led.on { background: #8fe29f; box-shadow: 0 0 7px #8fe29f; }
.led.busy { background: var(--lamp); box-shadow: 0 0 7px var(--lamp); }
.stand { width: 28%; height: clamp(8px, 1.3vw, 16px); margin: 0 auto; background: linear-gradient(#0f0d0b, #1a1714); clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%); }
.primary.wake { position: absolute; inset: 0; margin: auto; width: fit-content; height: fit-content; gap: 10px; padding: 12px 24px; }
.primary.wake[disabled] { opacity: 0.7; }
.tv-caption { margin-top: 12px; min-height: 26px; color: var(--muted); text-align: center; }
.live-tag {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 8px; border-radius: 3px;
  background: var(--live); color: #fff;
  font-size: 14px; font-weight: 700; line-height: 1.5;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* ---- sign in ---- */
.signin { min-height: 100dvh; display: grid; gap: 32px; align-content: center; max-width: 1120px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px 40px; }
.signin-tv { max-width: 560px; width: 100%; margin: 0 auto; }
.signin-panel { position: relative; min-width: 0; overflow: hidden; padding: 4px; margin: -4px; }
@media (min-width: 900px) {
  .signin { grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: center; }
}
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.choice {
  min-height: 64px; padding: 10px 14px;
  background: var(--wall-deep); color: var(--text);
  font: 700 19px/1.2 "Atkinson", sans-serif;
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.choice:hover:not([disabled]) { background: var(--lamp); border-color: var(--lamp); color: var(--ink-on-lamp); }
.choice[disabled] { opacity: 0.55; cursor: default; }
.clock { color: var(--lamp); font-family: "Bricolage", sans-serif; font-size: 1.2em; font-variant-numeric: tabular-nums; }

/* ---- shell and tabs ---- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(16px, calc((100% - 1208px) / 2)) 10px; background: rgba(20, 43, 37, 0.86); backdrop-filter: blur(8px); }
.tabs { display: inline-flex; padding: 4px; background: var(--wall-deep); border-radius: 8px; }
.tab { position: relative; min-height: 44px; padding: 8px 18px; background: none; border: 0; border-radius: 5px; font-weight: 700; font-size: 16px; color: var(--muted); cursor: pointer; }
.tab.on { color: var(--ink-on-lamp); }
.tab-pill { position: absolute; inset: 0; background: var(--lamp); border-radius: 5px; }
.tab-label { position: relative; }
.pages { position: relative; overflow-x: clip; }
.page { max-width: 1240px; margin: 0 auto; padding: 18px 16px 110px; }
.leaving { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; }

/* ---- TV tab ---- */
.stage { display: grid; gap: 22px; align-items: center; }
@media (min-width: 900px) { .stage { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 56px; padding-top: 16px; } }
.actions { min-width: 0; }
.pick { margin-top: 22px; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drag-hint { margin-top: 12px; text-align: center; }
@media (hover: none) { .drag-hint { display: none; } }

.tray { margin-top: 18px; display: grid; gap: 10px; }
.tray li { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.peek { width: 64px; height: 36px; object-fit: cover; background: var(--wall-deep); border-radius: 2px; display: block; }
.who { min-width: 0; }
.name { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 6px; background: var(--wall-deep); border-radius: 3px; overflow: hidden; margin-top: 5px; }
.fill { height: 100%; width: 0; background: var(--lamp); transition: width 160ms linear; }
.tray li.done .fill { background: var(--ok); }
.job-stage { display: flex; justify-content: space-between; gap: 10px; margin-top: 1px; font-size: 14px; line-height: 1.35; color: var(--text); }
.job-stage > span:first-child { display: flex; align-items: center; gap: 5px; }
.job-stage svg { width: 15px; height: 15px; flex: none; color: var(--ok); stroke-width: 3; }
.job-stage.bad { color: var(--alert); }
.job-stage .pct { flex: none; font-variant-numeric: tabular-nums; font-weight: 700; }
.note { font-size: 14px; color: var(--alert); margin-top: 3px; }

.band { margin-top: 44px; }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.coming { margin-top: 14px; display: grid; gap: 10px; }
.coming li { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; padding: 8px; background: var(--wall-deep); border-radius: 6px; }
.coming-thumb { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 2px; font-size: 12px; }
.coming-text { min-width: 0; display: flex; flex-direction: column; }
.coming-text span { color: var(--muted); font-size: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.recent { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
@media (min-width: 760px) { .recent { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 26px; } }

/* ---- framed pictures ---- */
.piece { display: block; width: 100%; padding: 0; margin: 0; background: none; border: 0; text-align: left; cursor: pointer; }
.piece-static { margin: 0; }
.piece-frame {
  display: block; position: relative;
  padding: clamp(5px, 0.9vw, 10px);
  background: var(--mat);
  border: 3px solid var(--frame);
  box-shadow: 0 12px 22px -10px rgba(4, 16, 12, 0.9);
  transition: transform 160ms, box-shadow 160ms;
}
/* Pictures on a real wall are never quite level. */
.piece:nth-child(3n + 1) .piece-frame { transform: rotate(-0.5deg); }
.piece:nth-child(4n + 2) .piece-frame { transform: rotate(0.4deg); }
.piece:hover .piece-frame, .piece:focus-visible .piece-frame { transform: rotate(0) translateY(-3px); }
.piece.selected .piece-frame { transform: rotate(0) scale(0.96); box-shadow: 0 0 0 4px var(--lamp); }
.piece-image, .thumb-empty { display: block; aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: #d9d1bd; }
.thumb-empty { display: flex; align-items: center; justify-content: center; color: #4e4a3e; font-size: 13px; text-align: center; padding: 6px; }
.piece-preview { position: absolute; inset: clamp(5px, 0.9vw, 10px); width: calc(100% - 2 * clamp(5px, 0.9vw, 10px)); height: calc(100% - 2 * clamp(5px, 0.9vw, 10px)); object-fit: cover; pointer-events: none; opacity: 0; }
.piece:hover .piece-preview[src] { opacity: 1; }
.play { position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; background: rgba(15, 13, 10, 0.72); border-radius: 50%; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.play::after { content: ""; margin-left: 3px; border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff; }
.piece:hover .piece-preview[src] ~ .play { opacity: 0; }
.tick { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: rgba(15, 13, 10, 0.55); border: 2px solid #fff; border-radius: 50%; color: var(--ink-on-lamp); }
.piece.selected .tick { background: var(--lamp); border-color: var(--lamp); }
.tick svg { width: 18px; height: 18px; stroke-width: 3; }
.piece-note { display: block; margin-top: 9px; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
small { display: block; font-size: 14px; color: var(--muted); }
.tone-live { color: #ff9a8b; font-weight: 700; }
.tone-soon, .tone-wait { color: var(--lamp); }
.tone-bad { color: var(--alert); }

/* ---- gallery tab ---- */
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gallery-head h1 { font-size: clamp(30px, 4vw, 44px); }
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.filter { position: relative; min-height: 42px; padding: 7px 14px; background: none; border: 0; border-radius: 5px; font-size: 15px; font-weight: 700; color: var(--muted); cursor: pointer; }
.filter:hover { color: var(--text); }
.filter.on { color: var(--wall-deep); }
.filter-pill { position: absolute; inset: 0; background: var(--text); border-radius: 5px; }
.filter-label { position: relative; }
.empty-note { margin-top: 32px; color: var(--muted); }
.gallery { margin-top: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 26px; } }
@media (min-width: 1040px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 32px; } }
.selection-bar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 12;
  width: min(640px, calc(100vw - 24px)); margin-left: calc(min(640px, 100vw - 24px) / -2);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 12px 14px; background: var(--wall-deep);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
}
.selection-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- dialogs ---- */
.modal { padding: 0; border: 0; color: var(--text); background: var(--panel); overflow: hidden; }
.modal::backdrop { background: rgba(7, 15, 13, 0.72); }
.display { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); margin: auto; border-radius: 12px; box-shadow: 0 40px 90px -20px #000; overflow-y: auto; overflow-x: hidden; }
.display-strip { display: flex; background: #07100d; height: 150px; }
.strip-cell { position: relative; flex: 1 1 0; min-width: 0; height: 100%; overflow: hidden; }
.strip-back { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(18px) brightness(0.55); transform: scale(1.2); }
.strip-front { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.more { flex: 0 0 70px; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.display-body { padding: 22px 20px 16px; }
.display-options { display: grid; gap: 10px; margin-top: 18px; }
.option { display: block; width: 100%; padding: 13px 16px; text-align: left; background: var(--wall-deep); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: background 120ms; }
.option:hover { background: var(--wall-light); }
.option strong { display: block; font-size: 18px; line-height: 1.3; }
.option span { display: block; color: var(--muted); font-size: 15px; }
.option.main { background: var(--lamp); border-color: var(--lamp); color: var(--ink-on-lamp); box-shadow: 0 3px 0 var(--lamp-deep); }
.option.main:hover { background: #ffcc62; }
.option.main span { color: #5c4312; }
.dismiss { display: block; margin: 12px auto 0; }

.picker { margin-top: 14px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 6px 14px; background: var(--wall-deep); border: 1px solid var(--line); border-radius: 20px; font-size: 15px; cursor: pointer; }
.chip:hover { background: var(--wall-light); }
.picker-grid { display: grid; gap: 16px; margin-top: 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; margin-top: 4px; }
.cal-dow { text-align: center; color: var(--muted); font-size: 13px; padding: 4px 0; }
.cal-day { height: 44px; padding: 0; background: none; border: 0; border-radius: 6px; font-size: 16px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cal-day:hover:not([disabled]) { background: var(--wall-light); }
.cal-day[disabled] { color: rgba(188, 203, 192, 0.35); cursor: default; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--line); }
.cal-day.selected { background: var(--lamp); color: var(--ink-on-lamp); font-weight: 700; }
.clockface { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; background: var(--wall-deep); border-radius: 8px; }
.stepper { display: flex; flex-direction: column; align-items: center; }
.stepper button { display: flex; align-items: center; justify-content: center; width: 54px; height: 36px; background: none; border: 0; border-radius: 6px; cursor: pointer; }
.stepper button:hover { background: var(--wall-light); }
.stepper output { font: 700 30px/1.2 "Bricolage", sans-serif; font-variant-numeric: tabular-nums; }
.colon { font: 700 30px "Bricolage", sans-serif; }
.ampm { display: grid; gap: 4px; margin-left: 8px; }
.ampm button { min-width: 56px; min-height: 40px; background: none; border: 1px solid var(--line); border-radius: 6px; font-weight: 700; font-size: 15px; cursor: pointer; }
.ampm button.on { background: var(--lamp); border-color: var(--lamp); color: var(--ink-on-lamp); }
.schedule { margin-top: 14px; min-height: 54px; font-size: 17px; }

/* ---- full view ---- */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; background: #070b0a; }
.viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.viewer-stage { position: relative; min-height: 0; overflow: hidden; }
.viewer-media { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.viewer-media img, .viewer-media video { max-width: 100%; max-height: 100%; display: block; }
.viewer-empty { color: var(--muted); padding: 24px; text-align: center; }
.viewer-bar { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: var(--wall-deep); }
.viewer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.viewer-nav, .viewer-close { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; background: rgba(7, 11, 10, 0.62); color: #fff; border: 0; border-radius: 50%; cursor: pointer; }
.viewer-nav:hover, .viewer-close:hover { background: rgba(7, 11, 10, 0.92); }
.viewer-nav { top: calc(50% - 26px); }
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }
.viewer-close { top: max(12px, env(safe-area-inset-top)); right: 12px; }

/* ---- the rotation strip ---- */
.band.first { margin-top: 30px; }
.strip-hint { margin-top: 4px; }
.strip { display: flex; gap: 16px; margin: 12px -16px 0; padding: 8px 16px 14px; overflow-x: auto; }
.strip-item { flex: 0 0 clamp(150px, 19vw, 230px); padding: 0; background: none; border: 0; text-align: left; cursor: grab; touch-action: pan-x; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.strip-item:active { cursor: grabbing; }
.strip-item img { pointer-events: none; }
.strip-item .piece-frame { transition: transform 140ms; }
.strip-item:hover .piece-frame { transform: translateY(-3px); }
.strip-name { display: block; margin-top: 7px; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 50; width: 160px; pointer-events: none; }
.tv.ready { box-shadow: 0 0 0 4px var(--lamp), 0 0 90px rgba(245, 191, 79, 0.5); }

/* ---- sound question ---- */
.sound { width: min(460px, calc(100vw - 24px)); margin: auto; border-radius: 12px; box-shadow: 0 40px 90px -20px #000; }
.sound-peek { display: block; width: 100%; height: 170px; object-fit: contain; background: #07100d; }
.sound-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sound-options .option { text-align: center; min-height: 60px; }

/* ---- who's signed in ---- */
.whoami { display: flex; align-items: center; gap: 10px; }
.admin-tag { padding: 1px 8px; background: var(--wall-light); border-radius: 3px; font-size: 13px; font-weight: 700; }

/* ---- drop and toast ---- */
.dropveil { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; padding: 36px; pointer-events: none; background: rgba(10, 24, 20, 0.55); box-shadow: inset 0 0 0 6px var(--lamp); }
.dropveil span { padding: 14px 24px; background: var(--lamp); color: var(--ink-on-lamp); font: 700 22px "Bricolage", sans-serif; border-radius: 6px; }
.toast-slot { position: fixed; left: 0; right: 0; bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px)); z-index: 40; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.toast { max-width: 560px; padding: 11px 16px; background: var(--text); color: var(--wall-deep); font-weight: 700; font-size: 16px; line-height: 1.35; border-radius: 6px; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.7); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
  .piece .piece-frame { transform: none !important; }
}

/* ---- checkboxes ---- */
.check { display: flex; align-items: center; gap: 11px; min-height: 44px; font-size: 15px; line-height: 1.3; color: var(--text); text-align: left; cursor: pointer; }
.check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check .box { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 1.5px solid var(--muted); border-radius: 5px; color: var(--ink-on-lamp); transition: background-color 120ms, border-color 120ms; }
.check .box svg { width: 16px; height: 16px; stroke-width: 3; }
.check:hover .box { border-color: var(--text); }
.check input:checked + .box { background: var(--lamp); border-color: var(--lamp); }
.check input:focus-visible + .box { outline: 3px solid var(--lamp); outline-offset: 3px; }
.check.off { color: var(--muted); cursor: default; }
.check.off .box { opacity: 0.65; }
.actions .check { margin-top: 10px; }
.display-body .check { margin-top: 10px; }
.viewer-bar .check { min-height: 34px; margin-top: 4px; font-size: 14px; }

/* ---- scrollbars ---- */
html { scrollbar-gutter: stable; }
@supports selector(::-webkit-scrollbar) {
  ::-webkit-scrollbar { width: 13px; height: 13px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-corner { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(240, 233, 216, 0.26); background-clip: padding-box; border: 3.5px solid transparent; border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background-color: rgba(240, 233, 216, 0.5); }
  ::-webkit-scrollbar-thumb:active { background-color: var(--lamp); }
  .strip::-webkit-scrollbar-track { margin: 0 16px; background: rgba(240, 233, 216, 0.07); background-clip: padding-box; border: 3.5px solid transparent; border-radius: 999px; }
}
@supports not selector(::-webkit-scrollbar) {
  html, .strip, .display { scrollbar-width: thin; scrollbar-color: rgba(240, 233, 216, 0.34) transparent; }
}

/* ---- on its way ---- */
.fill.busy { width: 35%; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.spinner { flex: none; width: 18px; height: 18px; border: 2.5px solid rgba(246, 241, 228, 0.3); border-top-color: var(--lamp); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .fill.busy { width: 100%; animation: none; opacity: 0.55; }
  .spinner { animation-duration: 3s; }
}
.screen-status { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 28px); padding: 9px 16px; background: rgba(7, 15, 13, 0.86); color: var(--text); border-radius: 999px; font-size: 15px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.screen-play { position: absolute; left: 12px; bottom: 12px; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; color: #fff; background: rgba(7, 15, 13, 0.72); border: 0; border-radius: 50%; cursor: pointer; transition: background-color 120ms; }
.screen-play:hover { background: rgba(7, 15, 13, 0.92); }
.screen-play svg { width: 20px; height: 20px; fill: currentColor; stroke-width: 2.6; }

/* ---- adding from a link ---- */
.link-form { margin-top: 18px; }
.link-label { display: block; margin-bottom: 7px; font-size: 15px; color: var(--muted); }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1 1 auto; min-width: 0; min-height: 46px; padding: 9px 12px; color: var(--text); font: inherit; font-size: 16px; background: var(--wall-deep); border: 1px solid var(--line); border-radius: 6px; }
.link-row input::placeholder { color: var(--muted); opacity: 0.8; }
.link-row input:focus-visible { outline: 3px solid var(--lamp); outline-offset: 1px; }
.link-row input[aria-invalid="true"] { border-color: var(--alert); }
.link-row .quiet { flex: none; }
.link-row .quiet[disabled] { opacity: 0.5; cursor: default; }

/* ---- adding many ---- */
.gallery-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.file-label { display: inline-flex; align-items: center; }
.gallery-actions:has(.file:focus-visible) .file-label { outline: 3px solid var(--lamp); outline-offset: 2px; }
.bulk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.bulk-grid img, .bulk-more { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #07100d; border-radius: 3px; }
.bulk-more { display: flex; align-items: center; justify-content: center; font-weight: 700; }
.bulk-bar { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 35; display: flex; align-items: center; gap: 18px; width: min(560px, calc(100vw - 24px)); margin-left: calc(min(560px, 100vw - 24px) / -2); padding: 13px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 50px -20px #000; }
.bulk-bar .who { flex: 1 1 auto; }

/* ---- remote ---- */
.tv-column { min-width: 0; }
.remote-row { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.remote-key { display: grid; place-items: center; width: 46px; height: 46px; padding: 0; color: var(--text); background: var(--wall-deep); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: background-color 120ms; }
.remote-key:hover:not([disabled]) { background: var(--wall-light); }
.remote-key[disabled] { opacity: 0.4; cursor: default; }

/* ---- captions and birthdays ---- */
.caption-field { margin-top: 14px; }
.caption-field label { display: block; margin-bottom: 6px; font-size: 15px; color: var(--muted); }
.caption-field input { width: 100%; min-height: 44px; padding: 8px 12px; color: var(--text); font: inherit; font-size: 16px; background: var(--wall-deep); border: 1px solid var(--line); border-radius: 6px; box-sizing: border-box; }
.caption-field input::placeholder { color: var(--muted); opacity: 0.8; }
.caption-field input:focus-visible { outline: 3px solid var(--lamp); outline-offset: 1px; }
.birthday-note { margin: 4px 0 14px; padding: 11px 16px; color: var(--ink-on-lamp); font-weight: 700; background: var(--lamp); border-radius: 8px; }
.selection-actions { flex-wrap: wrap; justify-content: flex-end; }
