/* the one-question-at-a-time form (colours and fonts come from the page's :root) */
body { padding-top: calc(16px + env(safe-area-inset-top, 0px)); min-height: 100dvh; }
main.form { max-width: 680px; min-height: calc(100dvh - 72px); gap: 0; }

.bar-top { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 8px 0 12px; display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 26px; }
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

#screen { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 20px 0; }
#screen.in { animation: rise .24s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #screen.in { animation: none; } .progress i { transition: none; } }

.q-num { font-family: var(--mono); font-size: .78rem; color: var(--accent); letter-spacing: .04em; }
.q-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.55rem, 5.4vw, 2.2rem); line-height: 1.12; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.q-hint { color: var(--muted); font-size: 1rem; margin-top: -8px; }

.inp { width: 100%; font: inherit; font-size: 1.1rem; color: var(--fg); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px; outline: none; }
.inp:focus { border-color: var(--accent); }
.inp::placeholder { color: var(--muted); opacity: .7; }
textarea.inp { min-height: 150px; resize: vertical; line-height: 1.5; font-size: 1rem; }
textarea.inp.short { min-height: 84px; }

.opts { display: flex; flex-direction: column; gap: 9px; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; font-size: 1.03rem; font-weight: 500; color: var(--fg); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 15px; cursor: pointer; }
.opt:hover { border-color: var(--accent); }
.opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt .box { flex: none; width: 20px; height: 20px; border: 2px solid var(--muted); border-radius: 50%; display: grid; place-items: center; }
.opt.multi .box { border-radius: 5px; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-pressed="true"] .box { border-color: var(--accent); background: var(--accent); }
.opt[aria-pressed="true"] .box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }

.foot { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 calc(8px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 10px; }
.foot .grow { flex: 1; min-width: 0; color: var(--muted); font-size: .82rem; }
.btn { font: inherit; font-weight: 600; font-size: 1rem; border-radius: 11px; padding: 11px 22px; border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; }
.btn.go { background: var(--accent); color: #fff; }
.btn.go:hover { filter: brightness(1.07); }
.btn.back { background: none; color: var(--muted); border-color: var(--line); padding: 11px 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.err { color: var(--accent); font-size: .92rem; font-weight: 500; min-height: 0; }
.err:empty { display: none; }

.brief { display: flex; flex-direction: column; gap: 16px; }
#screen.top { justify-content: flex-start; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; }
.field label span { font-weight: 400; color: var(--muted); font-size: .9rem; margin-left: 6px; }
.field .inp { font-size: 1rem; padding: 11px 13px; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 26px 16px; border: 2px dashed var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); }
.drop b { font-size: 1.05rem; }
.drop small { color: var(--muted); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.file video, .file img { width: 54px; height: 96px; object-fit: cover; border-radius: 7px; background: #000; flex: none; }
.file img { height: 72px; }
.file .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file small { color: var(--muted); }
.file .ok { color: var(--accent); font-weight: 600; }
.up-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.link-btn { background: none; border: 0; padding: 4px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); text-decoration: underline; cursor: pointer; flex: none; }
.link-btn:hover { color: var(--accent); }
.files { display: flex; flex-direction: column; gap: 8px; }

.check-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; font: inherit; color: var(--fg); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 11px 14px; text-align: left; cursor: pointer; }
.check-row:last-child { border-bottom: 0; }
.check-row:hover { background: var(--accent-soft); }
.check-row em { font-style: normal; font-size: .85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.check-row.miss em { color: var(--accent); }

.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.bar-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.help { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); text-decoration: none; }
.help:hover, .help:focus-visible { color: var(--accent); border-color: var(--accent); }
.help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help svg { width: 18px; height: 18px; }

/* a reel's screen: the Instagram-style preview beside what is left to fill in. Yellow = still to do */
.treel { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }
.tcol { min-width: 0; display: flex; justify-content: center; }
.tside { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 620px) { .treel { grid-template-columns: minmax(0, 1fr); } }
.tdrop { height: min(66vh, 600px); height: min(66dvh, 600px); aspect-ratio: 667 / 1280; max-width: 100%; display: flex; }
.tdrop .drop { flex: 1; min-width: 0; position: relative; }
.tig { --u: .5px; position: relative; flex: none; height: min(66vh, 600px); height: min(66dvh, 600px); aspect-ratio: 667 / 1280; max-width: 100%; overflow: hidden; border-radius: 12px; background: #000; cursor: pointer; }
.tig video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tig.wide video { object-fit: contain; }
.tig-o { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tig text { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.tig-pl { position: absolute; left: 50%; top: 50%; width: 13.4%; aspect-ratio: 1; border-radius: 50%; background: rgba(22, 22, 24, .48); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13); transform: translate(-50%, -50%) scale(.9); opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; display: grid; place-items: center; }
.tig.paused .tig-pl { opacity: 1; transform: translate(-50%, -50%); }
.tig.noplay .tig-pl { display: none; }
.tig-pl svg { width: 30%; fill: #fff; transform: translateX(6%); }
.tig-no { display: none; position: absolute; left: 10%; right: 14%; top: 42%; text-align: center; color: #fff; font-size: 13px; line-height: 1.4; }
.tig.noplay .tig-no { display: block; }
.tig-song, .tig-cap { position: absolute; z-index: 2; height: 3.6%; padding: 0; border: 0; background: none; color: #fff; text-align: left; cursor: text; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 2px rgba(0, 0, 0, .5); font: 400 calc(var(--u) * 21.7) / 1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, Arial, sans-serif; }
.tig-song { left: 17.54%; right: 14%; top: 91.7%; }
.tig-cap { left: 3.84%; right: 14%; top: 95.3%; }
.tig-song:hover, .tig-cap:hover { background: rgba(255, 255, 255, .1); border-radius: 4px; }
.tig-song.todo, .tig-cap.todo { color: #f2c14e; font-weight: 600; }
.tig-song:focus-visible, .tig-cap:focus-visible { outline: 1.5px solid #f2c14e; border-radius: 4px; }
.tig.edsong .tig-song, .tig.edcap .tig-cap { visibility: hidden; }
.tig-ed { position: absolute; z-index: 4; left: 2.4%; right: 13%; box-sizing: border-box; margin: 0; padding: 7px 9px; border: 1px solid #f2c14e99; border-radius: 8px; outline: none; background: rgba(15, 15, 18, .9); color: #fff; font: 400 16px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif; cursor: text; }
.tig-ed::placeholder { color: #f2c14e; opacity: .75; }
.tig-ed.song { top: calc(93.5% - 19px); height: 38px; }
.tig-ed.cap { bottom: 1.4%; height: 30%; resize: none; }
.tig-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .3); pointer-events: none; z-index: 3; }
.tig-bar i { position: absolute; inset: 0; background: #fff; transform: scaleX(0); transform-origin: 0 0; }
.tig.drag .tig-bar { height: 5px; }
.tig-seek { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; z-index: 3; cursor: pointer; touch-action: none; }
.tig-up { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 5; }
.tig-up .file { background: rgba(15, 15, 18, .88); border-color: transparent; color: #fff; padding: 8px 10px; }
.tig-up .file small { color: #cfcfd6; }
.tig-up:empty { display: none; }

.tbtns { display: flex; align-items: center; gap: 8px; }
.tchip { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: 100%; height: 36px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--fg); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 0 13px; cursor: pointer; white-space: nowrap; }
.tchip[hidden] { display: none; }
.tchip svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tchip:hover:not(:disabled) { border-color: var(--accent); }
.tchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tchip:disabled { opacity: .55; cursor: default; }
.tchip.todo { color: #b7860b; border-color: #e0ad2b; background: #e0ad2b1f; }
.inp.todo { border-color: #e0ad2b; background: #e0ad2b14; }
.inp.todo::placeholder { color: #b7860b; opacity: .9; }
.inp.todo:focus { border-color: #e0ad2b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tchip.todo { color: #f2c14e; } :root:not([data-theme="light"]) .inp.todo::placeholder { color: #f2c14e; opacity: .7; } }
:root[data-theme="dark"] .tchip.todo { color: #f2c14e; }
:root[data-theme="dark"] .inp.todo::placeholder { color: #f2c14e; opacity: .7; }
.trep { width: 36px; height: 36px; flex: none; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.trep[hidden] { display: none; }
.trep svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trep:hover { color: var(--accent); border-color: var(--accent); }
.trep:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea.inp.twhy { min-height: 130px; }

/* the cover picker */
.tcov { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: #000d; }
.tcov-b { width: min(440px, 100%); box-sizing: border-box; padding: 14px 16px 18px; border-radius: 16px; border: 1px solid #ffffff14; background: #0c0f14; color: #fff; }
.tcov-top { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.tcov-x, .tcov-ok { width: 42px; height: 42px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tcov-x { border: 1px solid #2a2e36; background: #171a20; color: #fff; }
.tcov-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tcov-ok { border: 0; background: #4ea3f2; color: #fff; box-shadow: 0 4px 14px #4ea3f240; }
.tcov-ok svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tcov-x:focus-visible, .tcov-ok:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tcov-v { display: flex; justify-content: center; margin: 0 0 20px; }
.tcov-v video { display: block; height: min(56vh, 540px); height: min(56dvh, 540px); max-width: 100%; aspect-ratio: 9 / 16; border-radius: 18px; background: #000; object-fit: contain; }
.tcov-f { position: relative; margin: 0 4px; padding: 5px 0; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.tcov-f.drag { cursor: grabbing; }
.tcov-fr { position: relative; display: flex; height: 64px; border-radius: 9px; overflow: hidden; background: #1a1d22; }
.tcov-fr::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(12, 15, 20, .64); box-shadow: inset 0 0 0 1px #ffffff2e; pointer-events: none; }
.tcov-fr canvas { flex: 1 1 0; min-width: 0; height: 100%; display: block; opacity: 0; transition: opacity .25s; }
.tcov-fr canvas.on { opacity: 1; }
.tcov-w { position: absolute; left: 0; top: 1.5px; bottom: 1.5px; width: 47px; box-sizing: border-box; border: 3.5px solid #495df4; border-radius: 11px; background: #000; overflow: hidden; pointer-events: none; box-shadow: 0 2px 12px #000a; will-change: transform; }
.tcov-w canvas { display: block; width: 100%; height: 100%; border-radius: 7px; }

/* a phone: the whole preview fits between the title and the buttons, so the song and caption are on screen; their letters stay readable */
@media (max-width: 620px) {
  .tig, .tdrop { height: clamp(420px, calc(100vh - 264px), 640px); height: clamp(420px, calc(100dvh - 264px), 640px); }
  .tig-song, .tig-cap { font-size: max(11px, calc(var(--u) * 21.7)); }
  .foot .grow { font-size: .74rem; }
}
.foot .grow { line-height: 1.25; }

.trep.on { color: var(--accent); border-color: var(--accent); }
.tinfob { margin: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tinfo-x { flex: none; width: 24px; height: 24px; margin: -2px -4px 0 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.tinfo-x:hover { color: var(--fg); background: rgba(127, 127, 127, .18); }
.tinfo-x:focus-visible { outline: 2px solid var(--accent); }
.tinfo-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.tinfob[hidden] { display: none; }
.thead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.thead .q-title { min-width: 0; font-size: clamp(1.15rem, 3.6vw, 1.45rem); }
.thead-btns { display: flex; align-items: center; gap: 8px; flex: none; }

/* support: a small window under its icon */
button.help { padding: 0; font: inherit; cursor: pointer; }
.help.on { color: var(--accent); border-color: var(--accent); }
.sup { position: relative; display: inline-flex; flex: none; }
.sup-m { position: absolute; right: 0; top: calc(100% + 8px); width: min(270px, calc(100vw - 32px)); box-sizing: border-box; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, .38); animation: rise .14s ease-out; }
.sup-m[hidden] { display: none; }
.sup-h { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px 4px; font-size: .95rem; }
.sup-x { width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.sup-x:hover { color: var(--fg); background: rgba(127, 127, 127, .18); }
.sup-x:focus-visible { outline: 2px solid var(--accent); }
.sup-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sup-a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg); text-decoration: none; }
.sup-a:hover { border-color: var(--accent); }
.sup-a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sup-a svg { width: 26px; height: 26px; flex: none; }
.sup-a span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sup-a b { font-size: .92rem; font-weight: 600; }
.sup-a small { color: var(--muted); font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .sup-m { animation: none; } }

/* the brief's 4 facts: side by side, or 2 + 2 when they don't fit */
.facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
}
