/* Pixel Fetch Pro — design tokens */
:root {
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #f0efeb; --surface-3: #e7e5df;
  --ink: #15161a; --ink-2: #4a4c55; --ink-3: #80828c; --line: #e2e0da; --line-2: #d3d1ca;
  --accent: #2b5cff; --accent-ink: #ffffff; --accent-soft: #e7edff; --accent-2: #1d44d6;
  --ok: #138a4f; --ok-soft: #e2f5ea; --warn: #a86300; --warn-soft: #fdf1dc; --err: #c8312b; --err-soft: #fde7e5;
  --ig: #d6246e; --pin: #e60023;
  --radius: 14px; --radius-sm: 9px; --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(20,20,30,.05), 0 6px 24px -10px rgba(20,20,40,.12);
  --shadow-lg: 0 24px 64px -20px rgba(20,20,40,.35);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0e11; --surface: #15171b; --surface-2: #1b1e23; --surface-3: #252830;
    --ink: #f1f1f3; --ink-2: #b4b6be; --ink-3: #7d808a; --line: #262930; --line-2: #33363e;
    --accent: #5b82ff; --accent-ink: #0b0c10; --accent-soft: #1a2342; --accent-2: #86a2ff;
    --ok: #3ccf86; --ok-soft: #10281c; --warn: #f2b14c; --warn-soft: #2c2210; --err: #ff6b63; --err-soft: #321514;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px -12px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0e11; --surface: #15171b; --surface-2: #1b1e23; --surface-3: #252830;
  --ink: #f1f1f3; --ink-2: #b4b6be; --ink-3: #7d808a; --line: #262930; --line-2: #33363e;
  --accent: #5b82ff; --accent-ink: #0b0c10; --accent-soft: #1a2342; --accent-2: #86a2ff;
  --ok: #3ccf86; --ok-soft: #10281c; --warn: #f2b14c; --warn-soft: #2c2210; --err: #ff6b63; --err-soft: #321514;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 28px -12px rgba(0,0,0,.6); --shadow-lg: 0 24px 64px -16px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); font-size: .86em; }
.muted { color: var(--ink-3); } .small { font-size: 13px; } .hidden { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: -.02em; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.brand small { font-weight: 600; color: var(--ink-3); font-size: 11px; border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 7px; letter-spacing: .02em; }
.nav { display: flex; gap: 2px; margin-left: 10px; }
.nav a { color: var(--ink-2); padding: 7px 11px; border-radius: 9px; font-size: 14px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.spacer { flex: 1; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.status-dot.ok { background: var(--ok); } .status-dot.warn { background: var(--warn); } .status-dot.err { background: var(--err); }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px 80px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--err); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 50px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn .icon { width: 16px; height: 16px; }

/* hero / input */
.hero { padding: 56px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.02; letter-spacing: -.045em; margin: 0 0 14px; font-weight: 750; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: var(--ink-2); font-size: clamp(15px, 2.2vw, 18px); max-width: 600px; margin: 0 auto; }
.composer { max-width: 760px; margin: 28px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 10px; text-align: left; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), var(--shadow); }
.composer.drag { border-style: dashed; border-color: var(--accent); }
.composer textarea { width: 100%; resize: none; border: 0; outline: 0; background: transparent; padding: 12px 12px 6px; font-size: 16px; min-height: 52px; max-height: 260px; line-height: 1.5; }
.composer textarea::placeholder { color: var(--ink-3); }
.composer-bar { display: flex; align-items: center; gap: 6px; padding: 4px 4px 2px; flex-wrap: wrap; }
.composer-bar .grow { flex: 1; min-width: 8px; }
.detect { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 6px; min-height: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.ig .dot { background: var(--ig); } .chip.pin .dot { background: var(--pin); } .chip.bad { color: var(--err); background: var(--err-soft); border-color: transparent; }
.chip.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.hint-row { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 16px; color: var(--ink-3); font-size: 13px; }
.hint-row span { display: inline-flex; gap: 6px; align-items: center; }
.history { max-width: 760px; margin: 8px auto 0; text-align: left; }
.history-list { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; box-shadow: var(--shadow); }
.history-list button { text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-list button:hover { background: var(--surface-2); color: var(--ink); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 48px auto 0; max-width: 1000px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature h3 { margin: 10px 0 4px; font-size: 15px; letter-spacing: -.01em; }
.feature p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.feature .fi { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.notice { max-width: 760px; margin: 28px auto 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.sessions { max-width: 760px; margin: 30px auto 0; }
.sessions h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 8px; }
.session-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; cursor: pointer; }
.session-row:hover { border-color: var(--line-2); }

/* workspace */
.ws-head { display: flex; align-items: flex-start; gap: 16px; padding: 26px 0 14px; flex-wrap: wrap; }
.ws-head h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.ws-head .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.ws-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.progress.done > i { background: var(--ok); }
.countdown { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.countdown.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.countdown.crit { background: var(--err-soft); color: var(--err); border-color: transparent; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.queue { margin-bottom: 18px; }
.queue-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.queue-head b { font-size: 14px; }
.queue-list { max-height: 360px; overflow: auto; }
.job { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job .url { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.job .stage { font-size: 12.5px; color: var(--ink-3); }
.job .stage.err { color: var(--err); }
.job-actions { display: flex; gap: 2px; }
.job-actions .iconbtn { width: 30px; height: 30px; }
.job-actions .icon { width: 15px; height: 15px; }
.spin { width: 16px; height: 16px; border: 2px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sicon { width: 18px; height: 18px; display: grid; place-items: center; }
.sicon.ok { color: var(--ok); } .sicon.err { color: var(--err); } .sicon.wait { color: var(--ink-3); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0 14px; position: sticky; top: 59px; z-index: 10; background: var(--bg); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
select.sel { height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 30px 0 10px; font-size: 13px; font-weight: 600; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; position: relative; transition: border-color .15s, box-shadow .15s; }
.card:hover { box-shadow: var(--shadow); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.thumb { aspect-ratio: 4/5; background: var(--surface-2) repeating-conic-gradient(var(--surface-3) 0 25%, transparent 0 50%) 50% / 16px 16px; position: relative; cursor: zoom-in; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.thumb .play span { width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #fff; }
.thumb .noprev { position: absolute; inset: 0; display: grid; place-items: center; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.check { position: absolute; top: 10px; left: 10px; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.9); border: 1.5px solid rgba(0,0,0,.15); display: grid; place-items: center; cursor: pointer; z-index: 2; color: transparent; }
.card.selected .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.badges { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.badge { background: rgba(10,10,14,.72); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; letter-spacing: .02em; backdrop-filter: blur(4px); }
.card-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.card-meta { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; font-size: 13px; }
.card-meta b { font-variant-numeric: tabular-nums; font-size: 13.5px; }
.card-sub { font-size: 12px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card-actions { display: flex; gap: 6px; }
.card-actions .btn { flex: 1; }
.integrity { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--ok); }
.integrity.remux { color: var(--accent); }
.dupe { font-size: 11px; color: var(--warn); font-weight: 700; }

.gallery.list { grid-template-columns: 1fr; gap: 8px; }
.gallery.list .card { flex-direction: row; align-items: center; }
.gallery.list .thumb { width: 92px; height: 92px; aspect-ratio: auto; flex: none; }
.gallery.list .card-body { flex: 1; flex-direction: row; align-items: center; flex-wrap: wrap; }
.gallery.list .card-meta { flex: 1; min-width: 200px; flex-direction: column; gap: 0; }
.gallery.list .card-actions .btn { flex: none; }
.gallery.list .badges { display: none; }
.gallery.list .check { top: 8px; left: 8px; width: 22px; height: 22px; }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty svg { width: 46px; height: 46px; margin: 0 auto 10px; color: var(--line-2); }
.expired-box { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--ink-2); margin-bottom: 18px; }

.sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; justify-content: center; transform: translateY(110%); transition: transform .2s ease; }
.sticky-actions.show { transform: none; }
.sticky-actions .count { font-size: 13.5px; font-weight: 600; margin-right: auto; max-width: 1240px; }

/* drawer + dialogs */
.scrim { position: fixed; inset: 0; background: rgba(8,8,12,.45); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 61; transform: translateX(105%); transition: transform .25s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-body { overflow: auto; padding: 14px; flex: 1; }
.drawer-prev { background: var(--surface-2); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; max-height: 46vh; }
.drawer-prev img, .drawer-prev video { max-height: 46vh; width: auto; object-fit: contain; }
.sec { margin-top: 18px; }
.sec h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 0; font-size: 13.5px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv > div { padding: 7px 11px; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.kv > div:nth-child(odd) { color: var(--ink-3); background: var(--surface-2); }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.variants { display: flex; flex-direction: column; gap: 6px; }
.variant { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; font-size: 13.5px; }
.variant.current { border-color: var(--accent); background: var(--accent-soft); }
.variant .grow { flex: 1; }
details.meta { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 6px; overflow: hidden; }
details.meta summary { padding: 9px 12px; cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; display: flex; justify-content: space-between; }
details.meta summary::-webkit-details-marker { display: none; }
details.meta[open] summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
details.meta .kv { border: 0; border-radius: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; }
.callout { padding: 11px 13px; border-radius: 11px; font-size: 13.5px; background: var(--surface-2); color: var(--ink-2); }
.callout.ok { background: var(--ok-soft); color: var(--ok); } .callout.warn { background: var(--warn-soft); color: var(--warn); }

dialog { border: 0; padding: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(520px, calc(100% - 24px)); max-height: calc(100dvh - 40px); }
dialog::backdrop { background: rgba(8,8,12,.5); }
.dlg-head { display: flex; align-items: center; padding: 16px 18px 6px; } .dlg-head h3 { margin: 0; flex: 1; font-size: 18px; letter-spacing: -.02em; }
.dlg-body { padding: 8px 18px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--ink-3); }
.input { height: 40px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 0 12px; font-size: 14px; width: 100%; }
.input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
textarea.input { height: auto; padding: 10px 12px; min-height: 120px; resize: vertical; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.switch input { width: 40px; height: 24px; appearance: none; background: var(--surface-3); border-radius: 99px; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--accent); } .switch input:checked::after { transform: translateX(16px); }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(5,5,8,.94); z-index: 80; display: none; flex-direction: column; color: #fff; }
.lightbox.show { display: flex; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.lb-top .iconbtn { color: #ddd; } .lb-top .iconbtn:hover { background: rgba(255,255,255,.1); color: #fff; }
.lb-stage { flex: 1; overflow: auto; display: grid; place-items: center; touch-action: pan-x pan-y pinch-zoom; }
.lb-stage img, .lb-stage video { max-width: 100vw; max-height: calc(100dvh - 120px); object-fit: contain; cursor: zoom-in; }
.lb-stage.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.12); border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lb-cap { text-align: center; font-size: 13px; color: #bbb; padding: 8px 14px 16px; }

/* toasts, banners */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(440px, calc(100% - 24px)); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow-lg); animation: rise .2s ease; width: 100%; display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--err); color: #fff; } .toast.warn { background: var(--warn); color: #111; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.banner { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 13.5px; padding: 8px 16px; font-weight: 600; }

/* pages */
.page { max-width: 820px; margin: 0 auto; padding: 40px 0; }
.page h1 { font-size: 34px; letter-spacing: -.035em; margin: 0 0 8px; }
.page h2 { font-size: 19px; letter-spacing: -.02em; margin: 30px 0 8px; }
.page p, .page li { color: var(--ink-2); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; }
.status-grid { display: grid; gap: 12px; }
.plat { padding: 16px; }
.plat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plat-head h3 { margin: 0; font-size: 17px; flex: 1; }
.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.cap { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 8px 10px; background: var(--surface-2); border-radius: 9px; }
kbd { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td, table.simple th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }

footer.foot { border-top: 1px solid var(--line); padding: 22px 16px calc(80px + env(safe-area-inset-bottom)); color: var(--ink-3); font-size: 13px; }
footer.foot .in { max-width: 1240px; margin: 0 auto; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
footer.foot a { color: var(--ink-2); }

@media (max-width: 760px) {
  .nav { display: none; }
  .hero { padding-top: 34px; }
  .composer textarea { font-size: 16px; }
  .composer-bar .btn.primary { flex: 1 0 100%; height: 48px; order: 10; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-actions .btn .lbl { display: none; }
  .ws-actions { margin-left: 0; width: 100%; }
  .toolbar { top: 59px; }
  .kv { grid-template-columns: 110px 1fr; }
  .lb-nav { display: none; }
  .mobile-nav { display: flex !important; }
}
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
.mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 4px 12px; font-weight: 600; }
.mobile-nav a[aria-current="page"] { color: var(--accent); }
.mobile-nav a:hover { text-decoration: none; }
@media (max-width: 760px) { body.has-sticky .mobile-nav { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
body:not(.adv) .adv-only { display: none !important; }
