/* MM review gallery — brand tokens, mobile first. Light + dark via prefers-color-scheme. */
:root {
  --yellow: #FDD500; --magenta: #FE00FE; --cyan: #0AE9EF; --green: #3CE20E; --red: #ED1C24; --black: #000; --white: #fff;
  --accent: var(--yellow);
  --bg: #fff; --ink: #000; --surface: #fff; --muted: #5A5A5A; --line: #D9D9D9; --tint: #F4F4F4; --tint2: #E9E9E9;
  --font-ui: "Nunito Sans", "Avenir Next", Avenir, Helvetica, Arial, sans-serif;
  --font-head: Archivo, Amplitude, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "PT Mono", Menlo, Consolas, monospace;
  --tap: 44px;
  --radius: 6px;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0E0E0E; --ink: #fff; --surface: #161616; --muted: #A3A3A3; --line: #2E2E2E; --tint: #1C1C1C; --tint2: #262626; }
}
:root[data-theme="dark"] { --bg: #0E0E0E; --ink: #fff; --surface: #161616; --muted: #A3A3A3; --line: #2E2E2E; --tint: #1C1C1C; --tint2: #262626; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.45; min-height: 100dvh; }
body.lb-open { overflow: hidden; }
img { max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--font-mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* brand bar */
.bar { display: grid; grid-template-columns: repeat(6, 1fr); height: 6px; position: relative; z-index: 3; }
.bar i { display: block; }
.bar i:nth-child(1), .bar i:nth-child(4) { background: var(--yellow); }
.bar i:nth-child(2), .bar i:nth-child(5) { background: var(--magenta); }
.bar i:nth-child(3), .bar i:nth-child(6) { background: var(--cyan); }

/* icons */
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; flex: none; }
.ic.filled { fill: currentColor; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: 999px; border: 2px solid var(--ink); font-weight: 700; background: var(--surface); color: var(--ink); white-space: nowrap; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #000; }
.btn.ghost { border-color: var(--line); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.ib { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: 999px; color: inherit; }
.ib:hover { background: rgba(127,127,127,.18); }

/* ---------- PIN gate ---------- */
.gate { position: relative; min-height: calc(100dvh - 6px); background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px 56px; overflow: hidden; }
.gate-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .28; filter: saturate(.7); }
.gate-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.2), #000 90%); }
.gate-card { position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.gate-mark { width: 150px; height: auto; margin: 0 auto 8px; display: block; }
.gate-client { margin: 0; font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #bbb; }
.gate-title { margin: 0 0 10px; font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: clamp(26px, 6vw, 40px); line-height: 1.05; text-wrap: balance; }
.gate form { display: flex; flex-direction: column; gap: 12px; }
.gate label { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 13px; color: #bbb; }
.gate input { height: 52px; border-radius: var(--radius); border: 2px solid #333; background: #111; color: #fff; padding: 0 14px; font-size: 18px; }
.gate input#pin { font-family: var(--font-mono); font-size: 26px; letter-spacing: .35em; text-align: center; }
.gate input:focus { border-color: var(--accent); outline: none; }
.gate .btn { margin-top: 6px; height: 52px; font-size: 16px; }
.gate-msg { min-height: 22px; margin: 0; color: var(--red); font-weight: 700; }
.gate-msg.ok { color: var(--cyan); }
.gate-presented { margin: 6px 0 0; display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #777; }
.gate-lockup { width: 140px; height: auto; display: block; }
.gate-foot { position: absolute; bottom: 18px; font-family: var(--font-mono); font-size: 12px; color: #777; }
.shake { animation: shake .45s; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }

/* ---------- header ---------- */
.head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "left right" "center center"; gap: 10px 16px; align-items: center; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.head-left { grid-area: left; display: flex; align-items: center; gap: 12px; min-width: 0; }
.head-left img { height: 40px; width: auto; max-width: 140px; object-fit: contain; }
.client-name { font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: 17px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-center { grid-area: center; text-align: left; min-width: 0; }
.head-center h1 { margin: 0; font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: clamp(18px, 3vw, 26px); line-height: 1.1; }
.head-center p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.head-right { grid-area: right; display: flex; align-items: center; gap: 10px; justify-self: end; }
.wordmark { font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: 20px; letter-spacing: .04em; }
.head-right .x { color: var(--muted); font-size: 16px; }
.wd-w { height: 22px; width: auto; display: block; }
.wd-w path { fill: var(--magenta); }
@media (min-width: 760px) {
  .head { grid-template-columns: 1fr auto 1fr; grid-template-areas: "left center right"; padding: 16px 28px; }
  .head-center { text-align: center; }
  .wordmark { font-size: 24px; }
  .wd-w { height: 26px; }
}

/* hero */
.hero { position: relative; height: 30vh; min-height: 180px; background: #000; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 16px; color: #fff; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.65)); }
.hero-title h2 { margin: 0; font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: clamp(22px, 4.5vw, 44px); line-height: 1; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.hero-title p { margin: 6px 0 0; font-family: var(--font-mono); font-size: 12.5px; opacity: .85; }
@media (min-width: 760px) { .hero { height: 40vh; } .hero-title { padding: 60px 28px 22px; } }

/* banner */
.banner { background: var(--cyan); color: #000; font-size: 13.5px; padding: 8px 18px; text-align: center; font-weight: 600; }

/* ---------- finished images (gallery.finals): yellow field, black ink, one folder, one zip ---------- */
.finals { padding: 14px 12px 4px; }
.finals-card { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon body" "cta cta"; gap: 10px 14px; align-items: center;
  background: var(--yellow); color: #000; border-radius: 12px; padding: 16px 16px 14px; }
.finals-icon { grid-area: icon; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; }
.finals-icon .ic { width: 64px; height: 64px; stroke-width: 6; }
.finals-body { grid-area: body; min-width: 0; }
.finals-kicker { margin: 0; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(0,0,0,.65); }
.finals-name { margin: 2px 0 0; font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: clamp(20px, 3.2vw, 28px); line-height: 1.05; overflow-wrap: anywhere; }
.finals-meta { margin: 6px 0 0; font-size: 12.5px; color: rgba(0,0,0,.8); }
.finals-note { margin: 8px 0 0; font-size: 14px; max-width: 60ch; white-space: pre-wrap; }
.finals-cta { grid-area: cta; display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.finals-dl { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 999px;
  background: #000; color: var(--yellow); font-weight: 800; font-size: 16px; text-decoration: none; white-space: nowrap; border: 2px solid #000; }
.finals-dl .ic { width: 24px; height: 24px; }
.finals-dl small { font-size: 12px; font-weight: 400; opacity: .8; }
.finals-dl:hover { background: #1a1a1a; }
.finals-dl:focus-visible { outline: 3px solid #000; outline-offset: 3px; }
.finals-hint { margin: 0; text-align: center; font-size: 11.5px; color: rgba(0,0,0,.65); }
.finals-singles { margin: 8px 4px 0; color: var(--ink); }
.finals-singles summary { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 10px 0 6px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 14px; list-style: none; user-select: none; }
.finals-singles summary::-webkit-details-marker { display: none; }
.finals-singles summary .ic { width: 16px; height: 16px; transition: transform .15s; }
.finals-singles[open] summary .ic { transform: rotate(90deg); }
.finals-singles summary:hover { background: var(--tint); }
.finals-singles summary .n { font-size: 12px; color: var(--muted); }
.finals-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; padding: 8px 0 6px; }
.finals-list a { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-family: var(--font-mono); font-size: 12.5px; min-width: 0; background: var(--surface); }
.finals-list a:hover { border-color: var(--ink); }
.finals-list a .ic { width: 18px; height: 18px; flex: none; }
.finals-list .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finals-list .fsize { flex: none; color: var(--muted); font-size: 11.5px; }
@media (min-width: 760px) {
  .finals { padding: 18px 28px 6px; }
  .finals-card { grid-template-columns: auto 1fr auto; grid-template-areas: "icon body cta"; padding: 20px 24px; gap: 12px 20px; }
  .finals-icon, .finals-icon .ic { width: 80px; height: 80px; }
  .finals-cta { align-items: center; }
  .finals-singles { margin: 8px 8px 0; }
}

/* filters */
.filters { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; }
.filter-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
.filter-row::-webkit-scrollbar { display: none; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; color: var(--ink); }
.fbtn .n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.fbtn:hover { background: var(--tint); }
.fbtn[aria-pressed="true"] { background: var(--accent); color: #000; }
.fbtn[aria-pressed="true"] .n { color: #000; opacity: .7; }
.kind-row { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.kind-row .fbtn { min-height: 32px; font-size: 13px; }
.filters-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.namebtn { font-size: 13px; color: var(--muted); min-height: 38px; padding: 0 8px; border-radius: 999px; }
.namebtn b { color: var(--ink); }
.namebtn:hover { background: var(--tint); }
@media (max-width: 600px) { .filters-right { width: 100%; justify-content: space-between; } }

/* grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 14px 12px 40px; }
@media (max-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 8px 8px 40px; } }
.tile { display: flex; flex-direction: column; gap: 6px; text-align: left; border-radius: var(--radius); background: var(--surface); min-width: 0; }
.tile:focus-visible { outline-offset: 3px; }
.thumb { position: relative; aspect-ratio: 3 / 2; background: var(--tint); border-radius: var(--radius); overflow: hidden; border: 2px solid transparent; transition: transform .15s; }
.tile:hover .thumb { transform: translateY(-2px); }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tile.is-fav .thumb { border-color: var(--magenta); }
.tile.is-approved .thumb { border-color: var(--cyan); }
.tile.is-rejected .thumb { border-color: var(--red); }
.tile.is-rejected .thumb img { opacity: .45; }
.thumb .play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; }
.thumb .play .ic { width: 24px; height: 24px; }
.thumb .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.7); color: #fff; font-family: var(--font-mono); font-size: 11.5px; padding: 2px 6px; border-radius: 4px; }
.tile-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 2px; min-width: 0; }
.tname { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.badges { display: flex; gap: 4px; flex: none; }
.b { display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 5px; border-radius: 999px; font-family: var(--font-mono); font-size: 11px; color: #000; }
.b .ic { width: 12px; height: 12px; stroke-width: 9; }
.b.fav { background: var(--magenta); }
.b.ok { background: var(--cyan); }
.b.no { background: var(--red); color: #fff; }
.b.cm { background: var(--tint2); color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.foot button, .foot a { color: var(--ink); font-family: var(--font-ui); font-weight: 700; }
.foot-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.foot-lockup { width: 120px; height: auto; display: block; flex: none; }
@media (max-width: 600px) { .foot-brand { flex-direction: column; align-items: flex-start; gap: 6px; } }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 50; background: #000; color: #fff; display: grid; height: 100dvh;
  grid-template-columns: 1fr; grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "markbar" "stage" "vctl" "actions"; }
.lb-top { grid-area: top; display: flex; align-items: center; gap: 6px; padding: 4px 6px; padding-top: max(4px, env(safe-area-inset-top)); min-height: 52px; }
.lb-name { font-size: 12.5px; color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.lb-pos { font-size: 12px; color: #888; }
.lb-stage { grid-area: stage; position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.lb-stage.grab { cursor: grab; }
.media-box { position: absolute; transform-origin: center center; will-change: transform; }
.media-box img, .media-box video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #000; }
.media-box video { object-fit: contain; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mcanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 72px; display: flex; align-items: center; justify-content: center; color: #fff; opacity: .7; z-index: 2; }
.lb-nav:hover { opacity: 1; background: rgba(255,255,255,.08); }
.lb-nav.prev { left: 0; } .lb-nav.next { right: 0; }
.lb-nav .ic { width: 30px; height: 30px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.8)); }
@media (hover: none) { .lb-nav { display: none; } }
.lb-hint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11.5px; color: #bbb; background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.lb-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #888; font-family: var(--font-mono); font-size: 12px; pointer-events: none; }

/* markup toolbar */
.lb-markbar { grid-area: markbar; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 10px; background: #141414; border-top: 1px solid #222; border-bottom: 1px solid #222; }
.mgroup { display: flex; align-items: center; gap: 2px; }
.mgroup + .mgroup { margin-left: 4px; }
.mtool { width: var(--tap); height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #ddd; }
.mtool[aria-pressed="true"] { background: #fff; color: #000; }
.mtool .ic { width: 22px; height: 22px; }
.sw { width: 30px; height: 30px; border-radius: 999px; border: 3px solid transparent; margin: 0 3px; padding: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.sw[aria-pressed="true"] { border-color: #fff; }
.wbtn { width: 40px; height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #ddd; }
.wbtn i { display: block; background: currentColor; border-radius: 999px; }
.wbtn[aria-pressed="true"] { background: #fff; color: #000; }
.mspacer { flex: 1; }
.mtext { color: #ddd; padding: 0 12px; height: 40px; border-radius: 8px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.mtext:hover { background: #222; }
.mtext.save { background: var(--accent); color: #000; }

/* video controls */
.lb-video-controls { grid-area: vctl; display: flex; align-items: center; gap: 4px; padding: 4px 8px; background: #0a0a0a; border-top: 1px solid #1c1c1c; }
.lb-video-controls .ib { color: #eee; width: 40px; height: 40px; }
.lb-video-controls .ib .ic { width: 20px; height: 20px; }
.scrub { position: relative; flex: 1; height: 40px; display: flex; align-items: center; margin: 0 6px; }
.scrub-track { position: absolute; left: 0; right: 0; height: 6px; top: 17px; background: #333; border-radius: 3px; pointer-events: none; }
.scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; width: 0; }
.scrub-markers { position: absolute; left: 0; right: 0; top: -6px; height: 18px; }
.marker { position: absolute; top: 0; width: 12px; height: 18px; margin-left: -6px; pointer-events: auto; cursor: pointer; }
.marker::before { content: ""; position: absolute; left: 3px; top: 0; width: 6px; height: 18px; background: var(--magenta); border-radius: 3px; box-shadow: 0 0 0 1px #000; }
.marker.has-markup::before { background: var(--cyan); }
.scrub input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 40px; background: transparent; margin: 0; cursor: pointer; }
.scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 999px; background: #fff; border: 2px solid #000; box-shadow: 0 0 0 1px #fff; }
.scrub input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 999px; background: #fff; border: 2px solid #000; }
.scrub input[type=range]::-moz-range-track { background: transparent; }
.v-tc { font-size: 13px; color: #eee; padding: 0 6px; min-width: 96px; text-align: center; }
.v-frame { font-family: var(--font-mono); font-size: 12px; color: #eee; width: 40px; height: 40px; border-radius: 8px; }
.v-frame:hover { background: #222; }
@media (max-width: 600px) { .v-tc { min-width: 0; font-size: 12px; } .lb-video-controls .ib.opt { display: none; } }

/* actions */
.lb-actions { grid-area: actions; display: flex; align-items: center; justify-content: center; gap: 2px; padding: 6px 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); background: #0a0a0a; border-top: 1px solid #1c1c1c; }
.act { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 56px; height: 50px; border-radius: 10px; color: #ddd; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; padding: 0 6px; }
.act .ic { width: 22px; height: 22px; }
.act:hover { background: #1d1d1d; }
.act[aria-pressed="true"] { color: #000; }
.act.fav[aria-pressed="true"] { background: var(--magenta); }
.act.ok[aria-pressed="true"] { background: var(--cyan); }
.act.no[aria-pressed="true"] { background: var(--red); color: #fff; }
.act .cnt { position: absolute; }
.act-wrap { position: relative; }
.act-badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--yellow); color: #000; font-family: var(--font-mono); font-size: 10px; display: flex; align-items: center; justify-content: center; }
@media (min-width: 600px) { .act { flex-direction: row; gap: 8px; font-size: 13px; min-width: 0; padding: 0 14px; height: 44px; } }

/* comments panel */
.lb-panel { grid-area: panel; background: var(--surface); color: var(--ink); display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.thread { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0; -webkit-overflow-scrolling: touch; }
.thread-empty { color: var(--muted); font-size: 13.5px; padding: 20px 4px; text-align: center; }
.c { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--bg); }
.c.is-shown { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.c-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.c-head b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.c-head .c-time { margin-left: auto; white-space: nowrap; }
.c-del { width: 30px; height: 30px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.c-del:hover { color: var(--red); background: var(--tint); }
.c-del .ic { width: 16px; height: 16px; }
.c-text { margin: 6px 0 0; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; }
.c-tc { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 8px; border-radius: 4px; background: var(--tint2); font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.c-tc:hover { background: var(--accent); color: #000; }
.c-mk { display: block; width: 100%; margin-top: 8px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #000; text-align: left; }
.c-mk svg { display: block; width: 100%; height: auto; }
.c-mk span { display: block; padding: 4px 8px; font-size: 12px; color: var(--muted); background: var(--surface); }
.cform { border-top: 1px solid var(--line); padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; }
.cform textarea { width: 100%; min-height: 64px; max-height: 160px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); color: var(--ink); }
.cform textarea:focus { border-color: var(--accent); outline: none; }
.cform-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 10px; border-radius: 999px; font-family: var(--font-mono); font-size: 12px; background: var(--tint2); }
.chip.mk { background: var(--accent); color: #000; }
.chip .ib { width: 24px; height: 24px; }
.chip .ib .ic { width: 12px; height: 12px; }
.cform .btn { margin-left: auto; }

@media (min-width: 900px) {
  .lb { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "top panel" "markbar panel" "stage panel" "vctl panel" "actions panel"; }
  .lb.panel-closed { grid-template-columns: minmax(0, 1fr) 0; }
  .lb.panel-closed .lb-panel { display: none; }
  .panel-head .ib { display: none; }
}
@media (max-width: 899px) {
  .lb-panel { position: fixed; left: 0; right: 0; bottom: 0; height: 70dvh; z-index: 60; border-radius: 16px 16px 0 0; border-left: 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5); transform: translateY(105%); transition: transform .22s ease-out; }
  .lb.panel-open .lb-panel { transform: translateY(0); }
  .lb-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4); }
}

/* ---------- modal + toast ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal { width: 100%; max-width: 520px; max-height: 90dvh; overflow: auto; background: var(--surface); color: var(--ink); border-radius: 16px 16px 0 0; padding: 20px 20px; padding-bottom: max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
@media (min-width: 600px) { .modal-wrap { align-items: center; padding: 20px; } .modal { border-radius: 14px; } }
.modal h3 { margin: 0; font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: 20px; }
.modal p { margin: 0; }
.modal input[type=text] { width: 100%; height: 48px; border: 2px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--bg); font-size: 16px; }
.modal input[type=text]:focus { border-color: var(--accent); outline: none; }
.modal-btns { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sum div { border-radius: 8px; padding: 10px 8px; text-align: center; background: var(--tint); }
.sum b { display: block; font-family: var(--font-head); font-weight: 800; font-stretch: 125%; font-size: 24px; line-height: 1; }
.sum span { font-size: 11.5px; color: var(--muted); font-family: var(--font-mono); }
.sum .fav { background: var(--magenta); color: #000; } .sum .fav span { color: #000; }
.sum .ok { background: var(--cyan); color: #000; } .sum .ok span { color: #000; }
.sum .no { background: var(--red); color: #fff; } .sum .no span { color: #fff; }
.sumlist { font-family: var(--font-mono); font-size: 12px; color: var(--muted); max-height: 30vh; overflow: auto; white-space: pre-wrap; }
.dl-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.dl-list a { font-family: var(--font-mono); font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); z-index: 200; background: #111; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; box-shadow: var(--shadow); border: 1px solid #333; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.fatal { padding: 60px 20px; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
