/* Summon Studio v5 — the one stylesheet. Dark default, light under [data-theme="light"]. */

:root {
  --bg:#121110; --surface:#1a1917; --surface-2:#23211e; --surface-3:#2d2a26;
  --line:#312e2a; --line-2:#46413b;
  --text:#f0eae1; --text-2:#b3ab9f; --text-3:#928b80;
  --primary:#f0eae1; --primary-ink:#151311;
  --ok:#58c18b; --ok-bg:rgba(88,193,139,.12);
  --note:#c39ceb; --edit:#8ea3da; --cut:#ef5a52;
  --warn-ink:#f3d684; --danger:#ef5a52; --danger-ink:#ff9b93;
  --shadow:0 10px 30px rgba(0,0,0,.45);
  --fd:'Eczar',Georgia,serif;
  --fu:'Atkinson Hyperlegible',system-ui,sans-serif;
  --fm:'IBM Plex Mono',ui-monospace,monospace;
  --r1:6px; --r2:10px; --r3:12px; --r4:16px; --pill:999px;
  --c:#928b80;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg:#f5f2ec; --surface:#fffdf9; --surface-2:#eeeae2; --surface-3:#e3ddd2;
  --line:#e1dbd1; --line-2:#c9c2b6;
  --text:#1d1b18; --text-2:#56504a; --text-3:#6a645b;
  --primary:#1d1b18; --primary-ink:#fbf8f3;
  --ok:#2f9a62; --ok-bg:#dcf3e5;
  --note:#8a5bc2; --edit:#5770b4; --cut:#cf3a33;
  --warn-ink:#8a6a00; --danger:#cf3a33; --danger-ink:#8c1d18;
  --shadow:0 2px 4px rgba(40,30,20,.06),0 12px 28px rgba(40,30,20,.12);
  color-scheme: light;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--fu); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--fd); font-weight: 600; margin: 0; line-height: 1.12; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--fm); font-size: 12px; }
.muted { color: var(--text-3); }
.lbl { font-size: 13px; font-weight: 700; color: var(--text-2); }
.rule { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.field { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.fan { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.footer { padding: 8px 24px 12px; border-top: 1px solid var(--line); }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--r3); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: 700 15px/1 var(--fu); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .4; cursor: default; pointer-events: none; }
.btn.htmx-request { opacity: .6; pointer-events: none; }
.link { border: 0; background: transparent; color: var(--text-2); font: 700 13px/1 var(--fu); text-decoration: underline; cursor: pointer; padding: 4px 0; }
.input { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: var(--r3); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 400 16px/1.45 var(--fu); display: block; }
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--text); }
.input[aria-invalid="true"] { border-color: var(--danger); }
textarea.input { resize: vertical; }
select.input { cursor: pointer; }

/* ---------- desktop chrome ---------- */
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.nav { display: flex; gap: 2px; }
.nav a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--r1); color: var(--text-2); text-decoration: none; font-weight: 700; font-size: 14px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.me { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 12px 0 4px; border-radius: var(--pill); border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; color: var(--text-2); }
.av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex: none; font: 700 11px/1 var(--fu); color: #151311; }
.page { flex: 1; width: 100%; margin: 0 auto; padding: 22px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.tabs { display: none; }

/* ---------- login ---------- */
.login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 16px; }
.login form { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.login h1 { font: 700 38px/1.05 var(--fd); letter-spacing: -.01em; }
.login .input, .login .btn { min-height: 52px; font-size: 17px; width: 100%; }
.login .footer { border: 0; text-align: center; }

/* ---------- home ---------- */
.home { max-width: 620px; padding-top: 48px; gap: 24px; }
.home h1 { font-size: 40px; }
.trow { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 4px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.trow:hover { background: var(--surface); }
.tmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tt { font-weight: 700; font-size: 16px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm { font-size: 14px; color: var(--text-2); }
.tm.late { color: var(--danger-ink); font-weight: 700; }
.chev { color: var(--text-3); font-size: 22px; line-height: 1; }
.empty { display: flex; flex-direction: column; gap: 6px; padding: 28px 20px; border-radius: var(--r4); border: 1.5px dashed var(--line-2); text-align: center; }
.other { display: flex; align-items: center; gap: 10px; min-height: 48px; color: var(--text-2); text-decoration: none; font-size: 15px; }

/* ---------- board ---------- */
body.board-body { height: 100vh; min-height: 620px; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 24px 0; }
.board-head h1 { font-size: 32px; }
.board-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 24px 0; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: 700 13px/1 var(--fu); cursor: pointer; text-decoration: none; flex: none; }
.chip[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--text); }
.chip .n { font: 500 12px/1 var(--fm); color: var(--text-3); }
.sw { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--text-2); position: relative; }
.sw input { position: absolute; opacity: 0; width: 40px; height: 24px; margin: 0; cursor: pointer; }
.sw .t { position: relative; width: 40px; height: 24px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); }
.sw .t::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform .15s; }
.sw input:checked + .t { background: var(--text); border-color: var(--text); }
.sw input:checked + .t::after { transform: translateX(16px); background: var(--bg); }
.sw input:focus-visible + .t { outline: 2px solid var(--text); outline-offset: 2px; }
.board-scroll { flex: 1; min-height: 0; overflow-x: auto; padding: 16px 24px 12px; }
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 18px; height: 100%; }
.col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.colhead { display: flex; align-items: center; gap: 8px; padding: 0 4px 10px; border-bottom: 2px solid var(--line-2); }
.col.focus .colhead { border-bottom-color: var(--text); }
.colhead h2 { font: 700 14px/1.2 var(--fu); }
.colhead .mono { margin-left: auto; color: var(--text-3); }
.colbody { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px 2px 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.tile { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r2); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.tile:hover { border-color: var(--text-3); }
.tile.ghost { background: transparent; border-style: dashed; }
.tile-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.tile-card { font-weight: 700; font-size: 15px; line-height: 1.25; }
.tile-meta { font-size: 11px; color: var(--text-3); }
.col-empty { padding: 14px 10px; border: 1.5px dashed var(--line-2); border-radius: var(--r2); color: var(--text-3); font-size: 13px; text-align: center; }
.art { position: relative; display: block; width: 42px; aspect-ratio: 63/88; border-radius: 4px; overflow: hidden; flex: none; background: linear-gradient(162deg, color-mix(in oklab, var(--c) 60%, #000), color-mix(in oklab, var(--c) 22%, #2a2724) 58%, #24211e); }
.art img { width: 100%; height: 100%; object-fit: cover; }
.art.cover { aspect-ratio: 9/16; }
.art.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-2); }
.no-art .art { display: none; }

/* ---------- stage screens ---------- */
.stagebar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.stagebar .name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.tracker { padding: 10px 24px 14px; border-bottom: 1px solid var(--line); }
.trk6 { display: flex; list-style: none; margin: 0 auto; padding: 22px 0 0; max-width: 900px; }
.trk6 li { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.trk6 li::before { content: ""; position: absolute; top: 7px; right: 50%; width: 100%; height: 2px; background: var(--line-2); }
.trk6 li:first-child::before { display: none; }
.trk6 li.done::before, .trk6 li.cur::before, .trk6 li.live::before { background: var(--text-3); }
.trk6 i { position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px dashed var(--line-2); }
.trk6 li.done i { background: var(--text-2); border: 2px solid var(--text-2); }
.trk6 li.cur i { border: 2px solid var(--text); box-shadow: 0 0 0 4px color-mix(in oklab, var(--text) 18%, transparent); background: radial-gradient(circle, var(--text) 0 3px, var(--bg) 3.5px); }
.trk6 li.live i { background: var(--ok); border: 2px solid var(--ok); }
.trk6 b { font-size: 12px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.trk6 li.cur b { color: var(--text); font-size: 13px; }
.trk6 li.done b, .trk6 li.live b { color: var(--text-2); }
.loopb { position: absolute; left: 0; top: -22px; transform: translateX(-50%); z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--bg); font: 600 11px/1.4 var(--fm); color: var(--text-2); white-space: nowrap; }
.trk6 .tstep { display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit; text-decoration: none; border-radius: var(--r2); padding: 0 6px 2px; }
.trk6 .tstep:hover b, .trk6 .tstep:focus-visible b { color: var(--text); text-decoration: underline; }
.trk6 li.viewing i { box-shadow: 0 0 0 4px color-mix(in oklab, var(--text) 18%, transparent); }
.trk6 li.viewing b { color: var(--text); }
.trk { display: none; }

.dmain { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; display: flex; gap: 48px; align-items: flex-start; padding: 24px 24px 0; }
.dvid { width: 300px; flex: none; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; padding-bottom: 24px; }
.dpanel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.stage { display: flex; flex-direction: column; gap: 8px; }
.eyebrow { font: 500 12px/1.2 var(--fm); color: var(--text-3); }
.stage h1 { font-size: 34px; }
.todo { font-size: 17px; line-height: 1.4; }
.actbar { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: 14px 0 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.actbar .btn.primary { min-width: 240px; }
.actrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.card { padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.info { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r3); background: var(--surface-2); font-size: 14px; line-height: 1.4; }
.info svg { flex: none; margin-top: 1px; }
.warn { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r3); font-size: 14px; font-weight: 700; line-height: 1.35; text-decoration: none; }
.warn svg { flex: none; }
.warn.y { background: color-mix(in oklab, #E3A92B 20%, transparent); color: var(--warn-ink); }
.warn.r { background: color-mix(in oklab, #ef5a52 18%, transparent); color: var(--danger-ink); }
.warn small { display: block; font-weight: 400; color: var(--text-2); font-size: 13px; }
.okbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r3); background: var(--ok-bg); font-size: 15px; font-weight: 700; }
.pip { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font: 700 11px/1 var(--fm); color: #151311; flex: none; }
.pips { display: inline-flex; gap: 3px; flex-wrap: wrap; }

/* the 9:16 video */
.vid { position: relative; display: block; width: 100%; aspect-ratio: 9/16; border: 0; padding: 0; border-radius: var(--r4); overflow: hidden; background: #15130F; box-shadow: var(--shadow); }
.vid video, .vid > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid .ground { position: absolute; inset: 0; container-type: inline-size; overflow: hidden; }
.vid .ground::before { content: ""; position: absolute; inset: -50%; background-image: linear-gradient(rgba(240,234,225,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(240,234,225,.07) 1px, transparent 1px); background-size: calc(100cqw / 18) calc(100cqw / 18); }
.vid .ground.diamond::before { transform: rotate(45deg); }
.vid .hero { position: absolute; left: 21%; top: 20%; width: 58%; aspect-ratio: 63/88; border-radius: 4.5%/3.2%; transform: rotate(-3deg); overflow: hidden; background: linear-gradient(162deg, color-mix(in oklab, var(--c) 60%, #000), color-mix(in oklab, var(--c) 22%, #2a2724) 58%, #24211e); box-shadow: 0 0 0 2px #0b0a09, 0 12px 28px rgba(0,0,0,.6); }
.vid .hero img { width: 100%; height: 100%; object-fit: cover; }
.vnote { position: absolute; left: 0; right: 0; bottom: 7%; text-align: center; font: 600 11px/1 var(--fm); color: rgba(244,239,231,.75); z-index: 1; }
.vtag { position: absolute; left: 10px; top: 10px; z-index: 1; padding: 3px 7px; border-radius: 6px; background: rgba(10,9,8,.72); color: #f4efe7; font: 500 11px/1.2 var(--fm); }
.vid .play { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; border: 0; background: transparent; cursor: pointer; width: 100%; }
.vid .play span { width: 60px; height: 60px; border-radius: 50%; background: rgba(10,9,8,.6); display: grid; place-items: center; color: #fff; }
.vid.playing .play span { opacity: 0; }
.ov { position: absolute; pointer-events: none; z-index: 2; }
.ov-dot { border-radius: 50%; aspect-ratio: 1; background: rgba(244,239,231,.82); }
.ov-line { height: 1.4%; border-radius: 4px; background: rgba(244,239,231,.82); }
.ov-bar { left: 0; right: 0; background: rgba(10,9,8,.62); display: flex; align-items: center; justify-content: center; color: rgba(244,239,231,.9); font: 600 11px/1 var(--fu); }
.ctrls { display: flex; flex-direction: column; gap: 10px; }
.scrub { display: flex; align-items: center; gap: 10px; }
.scrub input { flex: 1; accent-color: var(--text); cursor: pointer; }
.preview-as { display: flex; align-items: center; gap: 8px; }
.preview-as select { min-height: 38px; padding: 6px 10px; font-size: 14px; }
.ctrls .playbtn { display: none; }

/* review: script lines */
.lines { list-style: none; margin: 0 -6px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ln { position: relative; border-radius: var(--r3); transition: background .2s; }
.ln.on { background: color-mix(in oklab, var(--c) 14%, var(--surface)); box-shadow: inset 4px 0 0 var(--c); }
.lprog { position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 1px; background: color-mix(in oklab, var(--c) 30%, transparent); overflow: hidden; display: none; }
.ln.on .lprog { display: block; }
.lprog i { display: block; height: 100%; width: 0; background: var(--c); }
.lrow { display: flex; align-items: flex-start; gap: 2px; }
.lbtn { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: baseline; border: 0; background: transparent; padding: 10px 6px 10px 12px; text-align: left; cursor: pointer; color: var(--text-2); font: 400 17px/1.4 var(--fu); }
.ln.on .lbtn { color: var(--text); }
.lbtn .mono { flex: none; width: 34px; color: var(--text-3); }
.ln.on .lbtn .mono { color: var(--text); font-weight: 600; }
.ln.cut .tx { text-decoration: line-through; text-decoration-color: var(--cut); text-decoration-thickness: 2px; color: var(--text-3); }
.mk { width: 8px; height: 8px; border-radius: 50%; flex: none; align-self: center; background: var(--edit); }
.chgd { flex: none; align-self: center; font: 600 10px/1 var(--fm); letter-spacing: .04em; text-transform: uppercase; padding: 4px 6px; border-radius: 5px; background: color-mix(in oklab, var(--edit) 28%, transparent); color: var(--text); }
.tools { display: flex; gap: 2px; padding: 5px 4px 0 0; flex: none; }
.ib { width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); display: grid; place-items: center; cursor: pointer; }
.ib:hover { background: var(--surface-2); color: var(--text); }
.ib.on { background: var(--surface-2); color: var(--text); }
.ib.x { color: var(--cut); }
.sub { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px 58px; }
.sub:empty { display: none; }
.cm { padding: 8px 10px; border-radius: 10px; background: color-mix(in oklab, var(--note) 16%, transparent); font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.was { font-size: 13px; color: var(--text-3); }
.since { display: flex; flex-direction: column; gap: 10px; }
.since ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.since li { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.since .tick { flex: none; font-weight: 700; width: 18px; text-align: center; }
.since .ok { color: var(--ok); } .since .no { color: var(--warn-ink); }

/* changes requested */
.fi { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fi .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fi.handled .txt { opacity: .55; }
.kind { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font: 600 11px/1 var(--fm); letter-spacing: .04em; text-transform: uppercase; }
.k-edit { background: color-mix(in oklab, var(--edit) 24%, transparent); }
.k-cut { background: color-mix(in oklab, var(--cut) 22%, transparent); }
.k-comment, .k-note { background: color-mix(in oklab, var(--note) 24%, transparent); }
.hs { margin-left: auto; font-size: 13px; font-weight: 700; }
.hs.ok { color: var(--ok); } .hs.no { color: var(--warn-ink); }
.reason { font-size: 14px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.cutx { text-decoration: line-through; text-decoration-color: var(--cut); color: var(--text-3); }

/* approved / scheduled / live */
.pchip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 13px; border-radius: var(--pill); border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: 700 14px/1 var(--fu); cursor: pointer; position: relative; }
.pchip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pchip:has(input:checked) { background: var(--text); color: var(--bg); border-color: var(--text); }
.pchip:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.prow2 { display: flex; flex-direction: column; gap: 6px; padding: 10px 0 12px; border-bottom: 1px solid var(--line); }
.pchk { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; font-size: 16px; }
.pchk input { width: 22px; height: 22px; margin: 0; accent-color: var(--ok); cursor: pointer; flex: none; }
.pst2 { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--text-3); }
.pst2.ok { color: var(--ok); }
.pline { display: flex; align-items: center; gap: 8px; padding-left: 34px; }
.pline .input { min-height: 42px; }
.plink { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.lockrow { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.lockrow svg { flex: none; margin-top: 2px; color: var(--text-2); }
.nextrow { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r3); border: 1px solid var(--line-2); text-decoration: none; color: var(--text); }

/* ---------- series ---------- */
.narrow { max-width: 820px; }
.srow { display: flex; align-items: center; gap: 16px; padding: 18px 8px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); border-radius: 8px; }
.srow:hover { background: var(--surface); }
.bigdot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.swatch { position: relative; width: 38px; height: 38px; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 38px; height: 38px; border-radius: 50%; background: var(--c); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 4px; }
.ep { display: grid; grid-template-columns: 24px 40px 32px minmax(0, 1fr) 140px 108px; gap: 12px; align-items: center; padding: 10px 8px; border-bottom: 1px solid var(--line); border-radius: 8px; user-select: none; }
.ep[draggable="true"] { cursor: grab; }
.ep:hover { background: var(--surface); }
.ep.dragging { opacity: .35; }
.ep.over { box-shadow: inset 0 3px 0 var(--text); }
.ep .art { width: 32px; border-radius: 3px; }
.ep .grip { display: grid; place-items: center; color: var(--text-3); }
.ep .name { color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep .name:hover { text-decoration: underline; }
.ep .st { font-size: 13px; font-weight: 700; color: var(--text-2); }
.ep .st.live { color: var(--ok); }
.moves { display: flex; gap: 2px; justify-content: flex-end; opacity: .45; }
.ep:hover .moves, .moves:focus-within { opacity: 1; }
.mv { width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.mv:hover { background: var(--surface-2); }
.mv[disabled] { opacity: .3; cursor: default; }
.rm-confirm { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: color-mix(in oklab, #ef5a52 14%, transparent); font-size: 14px; }
.rm-confirm span { flex: 1; min-width: 200px; }

/* ---------- add an episode ---------- */
.add-layout { display: flex; gap: 28px; align-items: flex-start; }
.add-search { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.fgrp { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fgrp > .lbl { margin-right: 2px; white-space: nowrap; min-width: 92px; }
.fc { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; min-width: 36px; padding: 0 11px; border-radius: var(--pill); border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: 700 13px/1 var(--fu); cursor: pointer; position: relative; }
.fc input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.fc:has(input:checked) { background: var(--text); color: var(--bg); border-color: var(--text); }
.fc:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.fc.pipc { padding: 0; width: 36px; }
.fc .pip { width: 20px; height: 20px; font-size: 10px; }
.sw2 { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.sw2 input { width: 18px; height: 18px; accent-color: var(--text); margin: 0; cursor: pointer; }
.preset { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; border-radius: var(--pill); background: var(--surface-2); font-size: 13px; font-weight: 700; cursor: pointer; }
.preset input { width: 16px; height: 16px; accent-color: var(--text); margin: 0; }
.qline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 500 12px/1.4 var(--fm); color: var(--text-3); }
.qline code { font: 500 12px/1.4 var(--fm); color: var(--text-2); background: var(--surface); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--line); word-break: break-all; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
.rtile { display: flex; flex-direction: column; gap: 6px; border: 0; background: transparent; padding: 0; text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.rtile .art { width: 100%; border-radius: 8px; }
.rtile[aria-pressed="true"] .art { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.rtile .pip { width: 18px; height: 18px; font-size: 9.5px; }
.tname { font-weight: 700; font-size: 14px; line-height: 1.25; }
.ttype { font-size: 12px; color: var(--text-3); line-height: 1.3; }
.bdg { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 2px 6px; border-radius: 5px; font-size: 11px; font-weight: 700; line-height: 1.3; }
.bdg.y { background: color-mix(in oklab, #E3A92B 22%, transparent); color: var(--warn-ink); }
.bdg.r { background: color-mix(in oklab, #ef5a52 20%, transparent); color: var(--danger-ink); }
.bdg.n { background: var(--ok-bg); color: var(--ok); }
.side { width: 360px; flex: none; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--r4); background: var(--surface); border: 1px solid var(--line); }
.side .art { width: 110px; border-radius: var(--r3); }
.noresult { padding: 30px 20px; border-radius: 14px; border: 1.5px dashed var(--line-2); text-align: center; color: var(--text-2); }
.filters-toggle, .sheet-close { display: none; }
.hide-phone { display: inline; }

/* ---------- cards ---------- */
.binder { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 26px 18px; padding-top: 8px; }
.binder figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.binder .art { width: 100%; border-radius: 8px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r2); background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; font-weight: 700; max-width: 380px; animation: toast-in .18s ease-out; }

.toast svg { color: var(--ok); flex: none; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- phone (iPhone 16 Pro / 17: 402×874) ---------- */
@media (max-width: 760px) {
  body { font-size: 16px; padding-bottom: env(safe-area-inset-bottom); }
  .btn { min-height: 48px; font-size: 16px; }
  .btn.small { min-height: 38px; }
  .page { padding: 16px 16px 24px; }
  .top { display: none; }
  .tabs { position: sticky; bottom: 0; z-index: 30; display: flex; padding: 4px 8px calc(env(safe-area-inset-bottom) + 4px); border-top: 1px solid var(--line); background: var(--bg); }
  .tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; color: var(--text-3); text-decoration: none; font: 700 11px/1 var(--fu); }
  .tabs a[aria-current="page"] { color: var(--text); }
  .page-top { padding-top: calc(env(safe-area-inset-top) + 8px); }
  .footer { border: 0; padding: 8px 16px 12px; }

  .home { padding-top: calc(env(safe-area-inset-top) + 24px); }
  .home h1 { font-size: 32px; }
  .home .btn.primary { min-height: 54px; font-size: 17px; }

  body.board-body { height: auto; min-height: 100vh; }
  .board-head { padding: calc(env(safe-area-inset-top) + 12px) 16px 0; }
  .board-head h1 { font-size: 30px; }
  .board-head .btn.primary { order: 3; width: 100%; min-height: 54px; font-size: 17px; }
  .board-filters { padding: 12px 16px 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .board-filters .sw { margin-left: 0 !important; flex: none; }
  .board-scroll { overflow: visible; padding: 8px 16px 12px; }
  .board { display: flex; flex-direction: column; gap: 18px; height: auto; }
  .colhead { border-bottom: 0; padding: 6px 0; }
  .colhead h2 { font: 700 13px/1 var(--fu); letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
  .colbody { overflow: visible; padding: 0; gap: 0; }
  .tile { min-height: 64px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; align-items: center; }
  .tile.ghost { border-style: solid; }
  .tile .art { width: 36px; }
  .col-empty { padding: 10px 0 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; }

  /* stage screens: header, pinned player, scrolling body, dock */
  .stagebar { padding: calc(env(safe-area-inset-top) + 8px) 16px 10px; gap: 6px 10px; }
  .stagebar .me { display: none; }
  .stagebar .name { flex: 1; font-size: 15px; }
  .stagebar .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tracker { padding: 0 16px 10px; }
  .trk6 { display: none; }
  .trk { display: flex; gap: 4px; }
  .trk span, .trk a { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); }
  .trk a { position: relative; }
  .trk a::after { content: ""; position: absolute; inset: -10px 0; } /* bigger tap target */
  .trk .done { background-color: var(--text-3); } .trk .cur { background-color: var(--text); } .trk .live { background-color: var(--ok); }
  .trk .viewing { box-shadow: inset 0 0 0 1px var(--text); }
  .dmain { flex-direction: column; gap: 0; padding: 0; }
  .dvid { position: sticky; top: 0; z-index: 10; width: 100%; flex-direction: row; gap: 12px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .dvid .vid { width: 118px; flex: none; border-radius: var(--r3); }
  .dvid.static .vid { width: 96px; }
  .dvid .ctrls { flex: 1; min-width: 0; justify-content: center; gap: 9px; }
  .ctrls .playbtn { display: inline-flex; }
  .preview-as { flex-direction: column; align-items: stretch; gap: 4px; }
  .dpanel { padding: 16px 16px 0; gap: 16px; }
  .stage h1 { font-size: 28px; }
  .actbar { position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); }
  .actbar .actrow { flex-wrap: nowrap; }
  .actbar .actrow .btn { flex: 1; min-width: 0; }
  .actbar .actrow .btn.ghost { flex: 0 0 auto; }
  .actbar .btn.primary { min-height: 52px; font-size: 17px; min-width: 0; }
  .sub { padding-left: 12px; }
  .lbtn { font-size: 16px; }

  .ep { grid-template-columns: 34px 28px minmax(0, 1fr) auto; gap: 10px; }
  .ep .grip, .ep .st { display: none; }
  .page h1 { font-size: 28px !important; }
  .ep .moves { opacity: 1; }
  .mv { width: 36px; height: 36px; }

  .add-layout { flex-direction: column; }
  .filters-toggle { display: inline-flex; }
  .hide-phone { display: none; }
  .filters:not(.open) { display: none !important; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; width: auto; max-height: 86vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 10px 16px calc(env(safe-area-inset-bottom) + 16px); box-shadow: 0 -10px 30px rgba(0,0,0,.4); }
  .side.empty-sel { display: none; }
  .sheet-close { display: block; align-self: center; width: 40px; height: 5px; border: 0; border-radius: 3px; background: var(--line-2); padding: 0; cursor: pointer; }
  .toast-wrap { left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 90px); }
}
