:root {
  --bg: #f8fafd; --surface: #ffffff; --surface2: #f0f4f9; --hover: #e9eef6; --sel: #c2e7ff; --sel-fg: #001d35;
  --text: #1f1f1f; --muted: #5f6368; --line: #dadce0; --accent: #0b57d0; --accent-soft: #d3e3fd;
  --danger: #b3261e; --shadow: 0 1px 3px rgba(0,0,0,.15), 0 4px 12px rgba(0,0,0,.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131314; --surface: #1e1f20; --surface2: #282a2c; --hover: #333537; --sel: #004a77; --sel-fg: #c2e7ff;
    --text: #e3e3e3; --muted: #a8abaf; --line: #444746; --accent: #a8c7fa; --accent-soft: #0842a0;
    --danger: #f2b8b5; --shadow: 0 1px 3px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 "Google Sans", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
button { font: inherit; color: inherit; }
input, select { font: inherit; color: var(--text); }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--danger); min-height: 1.2em; font-size: 13px; }

.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 18px; border-radius: 20px; cursor: pointer; font-weight: 500; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); color: var(--surface); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.text { border-color: transparent; background: none; color: var(--accent); }
.btn.text:hover { background: var(--accent-soft); }
.icon-btn { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--surface); padding: 40px 36px; border-radius: 28px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.login-card input { padding: 13px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); outline: none; }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.remember { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.login-card p { margin: 0 0 6px; }

/* layout */
.app { display: grid; grid-template-columns: 256px 1fr; grid-template-rows: 64px 1fr; height: 100vh; height: 100dvh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; color: var(--text); width: 232px; padding-left: 4px; }
.brand svg { width: 36px; height: 36px; fill: #1a73e8; }
.brand.big { font-size: 28px; width: auto; }
.brand.big svg { width: 44px; height: 44px; }
.search { flex: 1; max-width: 720px; display: flex; align-items: center; gap: 10px; background: var(--surface2); border-radius: 28px; padding: 0 16px; height: 48px; }
.search:focus-within { background: var(--surface); box-shadow: var(--shadow); }
.search svg { color: var(--muted); }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; min-width: 0; }
.top-actions { margin-left: auto; display: flex; gap: 4px; }
.menu-btn { display: none; }

.sidebar { padding: 8px 16px 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.new-btn { display: inline-flex; align-items: center; gap: 12px; padding: 16px 22px 16px 16px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: var(--shadow); font-weight: 500; cursor: pointer; align-self: flex-start; margin: 0 0 16px 4px; }
.new-btn:hover { background: var(--hover); }
.sidebar nav a { display: flex; align-items: center; gap: 14px; padding: 0 16px; height: 34px; border-radius: 17px; }
.sidebar nav a svg { width: 20px; height: 20px; color: var(--muted); }
.sidebar nav a:hover { background: var(--hover); }
.sidebar nav a.active { background: var(--sel); color: var(--sel-fg); font-weight: 600; }
.sidebar nav a.active svg { color: var(--sel-fg); }
.storage { margin-top: 18px; padding: 0 16px; }
.storage .bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.storage .bar div { height: 100%; background: var(--accent); width: 0; transition: width .4s; }

.main { background: var(--surface); border-radius: 16px 16px 0 0; margin-right: 16px; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.main-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 6px 24px; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; font-size: 22px; min-width: 0; flex: 1; }
.crumbs a, .crumbs span.cur { padding: 4px 12px; border-radius: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.crumbs a:hover { background: var(--hover); }
.crumbs a.drop-over { background: var(--sel); }
.crumbs .sep { color: var(--muted); }
.crumbs .sep svg { width: 20px; height: 20px; vertical-align: middle; }
.sort { display: flex; align-items: center; gap: 2px; }
.sort select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 8px; }
.selbar { display: flex; align-items: center; gap: 6px; margin: 4px 16px 0; padding: 2px 8px; background: var(--surface2); border-radius: 24px; min-height: 44px; }
.selbar span { font-weight: 500; margin-right: 8px; }
.sel-actions { display: flex; flex-wrap: wrap; }
.content { flex: 1; overflow-y: auto; padding: 8px 16px 96px 24px; outline: none; }

.section-title { font-weight: 500; margin: 18px 0 12px; color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.item { user-select: none; -webkit-user-select: none; cursor: default; }
.folder-card { display: flex; align-items: center; gap: 14px; padding: 0 12px 0 16px; height: 48px; background: var(--surface2); border-radius: 12px; }
.folder-card .name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card { background: var(--surface2); border-radius: 12px; padding: 0 8px 8px; display: flex; flex-direction: column; }
.file-card .head { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 4px 0 8px; }
.file-card .head .name { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card .thumb { aspect-ratio: 4 / 3; border-radius: 6px; background: var(--surface); display: grid; place-items: center; overflow: hidden; }
.file-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-card .thumb svg { width: 64px; height: 64px; }
.item:hover .folder-card, .item:hover.file-card { background: var(--hover); }
.item.selected .folder-card, .item.selected.file-card { background: var(--sel); color: var(--sel-fg); }
.item.drop-over .folder-card, .row.drop-over { outline: 2px solid var(--accent); }
.item .more { opacity: .0; width: 32px; height: 32px; }
.item:hover .more, .item.selected .more { opacity: 1; }
.ficon { width: 22px; height: 22px; }

.list { width: 100%; border-collapse: collapse; table-layout: fixed; }
.list th { text-align: left; font-weight: 500; color: var(--text); padding: 10px 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; cursor: pointer; white-space: nowrap; }
.list td { padding: 0 8px; height: 48px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.list td.n { color: var(--text); }
.list td.n div { display: flex; align-items: center; gap: 14px; overflow: hidden; }
.list td.n span { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.list .row:hover td { background: var(--hover); }
.list .row.selected td { background: var(--sel); color: var(--sel-fg); }
.list .c-date { width: 170px; } .list .c-size { width: 110px; } .list .c-loc { width: 28%; } .list .c-act { width: 52px; }

.empty { text-align: center; padding: 80px 16px; color: var(--muted); }
.empty svg { width: 120px; height: 120px; opacity: .35; }
.empty h3 { color: var(--text); font-weight: 500; margin: 8px 0 4px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

.drop-hint { position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: 16px; background: color-mix(in srgb, var(--accent-soft) 45%, transparent); display: none; align-items: flex-end; justify-content: center; padding-bottom: 40px; pointer-events: none; z-index: 5; }
.drop-hint div { background: var(--accent); color: var(--surface); padding: 12px 22px; border-radius: 24px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow); }
.drop-hint svg { fill: var(--surface); }
.main.dragging .drop-hint { display: flex; }

/* menu */
.menu { position: fixed; z-index: 50; background: var(--surface2); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 0; min-width: 220px; }
.menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 0 16px; height: 36px; border: 0; background: none; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu button svg { width: 20px; height: 20px; color: var(--muted); }
.menu button.danger, .menu button.danger svg { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }

/* uploads panel */
.uploads { position: fixed; right: 24px; bottom: 0; width: 360px; max-width: calc(100vw - 32px); background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: var(--shadow); z-index: 40; overflow: hidden; }
.up-head { display: flex; align-items: center; padding: 6px 8px 6px 20px; background: var(--surface2); font-weight: 500; }
.up-head span { flex: 1; }
.up-list { max-height: 300px; overflow-y: auto; }
.uploads.min .up-list { display: none; }
.uploads.min #upMin { transform: rotate(180deg); }
.up-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 20px; }
.up-item .info { flex: 1; min-width: 0; }
.up-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-item .pbar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.up-item .pbar div { height: 100%; background: var(--accent); width: 0; }
.up-item .st { font-size: 12px; color: var(--muted); }
.up-item.done .st { color: #188038; }
.up-item.failed .st { color: var(--danger); }
.up-item .icon-btn { width: 32px; height: 32px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.dialog { background: var(--surface); border-radius: 28px; padding: 24px; width: min(420px, 100%); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; max-height: 90vh; }
.dialog h2 { margin: 0; font-size: 22px; font-weight: 400; }
.dialog input[type=text] { padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); outline: none; width: 100%; }
.dialog input[type=text]:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog p { margin: 0; color: var(--muted); }
.picker { border: 1px solid var(--line); border-radius: 8px; overflow-y: auto; min-height: 220px; max-height: 45vh; }
.picker .ph { display: flex; align-items: center; gap: 6px; padding: 6px; border-bottom: 1px solid var(--line); font-weight: 500; }
.picker .ph span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker .pr { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 40px; cursor: pointer; }
.picker .pr:hover { background: var(--hover); }
.picker .pr.disabled { opacity: .4; pointer-events: none; }
.picker .pr span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; font-size: 13px; }

/* viewer */
.viewer { position: fixed; inset: 0; background: rgba(10,10,10,.92); z-index: 55; display: flex; flex-direction: column; color: #fff; }
.viewer .vh { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
.viewer .vh .title { flex: 1; display: flex; align-items: center; gap: 12px; overflow: hidden; font-size: 16px; }
.viewer .vh .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .icon-btn { color: #e3e3e3; }
.viewer .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.viewer .vb { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 64px 24px; position: relative; }
.viewer .vb img, .viewer .vb video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .vb iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 4px; }
.viewer .vb pre { background: #1e1f20; color: #e3e3e3; padding: 20px; border-radius: 8px; overflow: auto; max-width: 1000px; width: 100%; max-height: 100%; margin: 0; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; background: rgba(0,0,0,.5); }
.viewer .nav.prev { left: 8px; } .viewer .nav.next { right: 8px; }
.viewer .nofile { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; background: #2a2a2a; padding: 32px 48px; border-radius: 12px; }
.viewer .nofile svg { width: 72px; height: 72px; }

.toasts { position: fixed; left: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { background: #303030; color: #f2f2f2; padding: 12px 18px; border-radius: 6px; box-shadow: var(--shadow); max-width: 420px; animation: tin .15s ease-out; }
.toast.err { color: #ffb4ab; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .menu-btn { display: inline-grid; }
  .brand { width: auto; }
  .brand span { display: none; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 270px; background: var(--bg); z-index: 45; box-shadow: var(--shadow); padding-top: 24px; transform: translateX(-105%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .main { margin: 0; border-radius: 16px 16px 0 0; }
  .main-head { padding-left: 12px; }
  .crumbs { font-size: 18px; }
  .content { padding: 8px 12px 96px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .list .c-date, .list .c-loc { display: none; }
  .viewer .vb { padding: 0 8px 16px; }
  .item .more { opacity: 1; }
  .sort select { max-width: 110px; }
}

/* ---------- video ---------- */
.btn svg { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
kbd { font: 11px ui-monospace, monospace; border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; opacity: .6; margin-left: 4px; }
.vthumb { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.playbadge { position: absolute; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; }
.playbadge svg { width: 24px !important; height: 24px !important; fill: #fff; }

.viewer .vb-video { padding: 0 16px 8px; }
.viewer .vb-video video { width: 100%; height: 100%; background: #000; border-radius: 6px; }
.v-err { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; background: #2a2a2a; padding: 28px 36px; border-radius: 12px; max-width: 520px; }
.v-err svg { width: 48px; height: 48px; fill: #f2b8b5; }
.v-err .muted { color: #bbb; }
.v-err .row { margin-top: 6px; }
.v-err .btn svg { width: 18px; height: 18px; fill: currentColor; }
.vpanel { background: #1b1b1c; border-top: 1px solid #333; padding: 10px 20px 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; color: #e3e3e3; }
.vinfo { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { background: #2c2d2f; color: #c4c7c5; border-radius: 6px; padding: 3px 9px; font-size: 12px; }
.chip.warn { color: #f2b8b5; }
.vinfo-actions { margin-left: auto; display: flex; gap: 6px; }
.vpanel .btn { background: #2c2d2f; border-color: #444; color: #e3e3e3; }
.vpanel .btn:hover { background: #3a3b3d; }
.vpanel .btn.on { background: #004a77; border-color: #004a77; color: #c2e7ff; }
.vpanel .btn.primary { background: #a8c7fa; color: #062e6f; border-color: transparent; }
.vpanel .btn svg { fill: currentColor; }

.tl { position: relative; user-select: none; -webkit-user-select: none; }
.tl-track { position: relative; height: 34px; cursor: pointer; touch-action: none; }
.tl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 4px; background: #444; border-radius: 2px; }
.tl-fill { position: absolute; left: 0; top: 15px; height: 4px; background: #8ab4f8; border-radius: 2px; pointer-events: none; }
.tl-track:hover::before, .tl-track:hover .tl-fill { top: 14px; height: 6px; }
.tl-sel { position: absolute; top: 6px; height: 22px; background: rgba(253, 214, 99, .28); border-top: 2px solid #fdd663; border-bottom: 2px solid #fdd663; pointer-events: none; }
.tl-kf { position: absolute; top: 4px; height: 26px; width: 0; border-left: 2px dashed #f28b82; pointer-events: none; }
.tl-h { position: absolute; top: 0; width: 14px; height: 34px; margin-left: -7px; background: #fdd663; border-radius: 4px; cursor: ew-resize; z-index: 2; display: flex; align-items: flex-end; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.tl-h::after { content: ""; position: absolute; top: 10px; bottom: 10px; left: 6px; width: 2px; background: rgba(0,0,0,.35); }
.tl-h span { position: absolute; top: -16px; font-size: 9px; font-weight: 700; color: #fdd663; letter-spacing: .5px; }
.tl-play { position: absolute; top: 3px; width: 3px; height: 28px; margin-left: -1px; background: #fff; border-radius: 2px; pointer-events: none; z-index: 3; box-shadow: 0 0 3px rgba(0,0,0,.6); }
.tl-tip { position: fixed; z-index: 80; background: #000; border: 1px solid #555; border-radius: 6px; padding: 3px; display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: none; z-index: 5; box-shadow: 0 4px 16px rgba(0,0,0,.6); }
.tl-tip span { font: 12px ui-monospace, Menlo, monospace; padding: 0 6px 2px; }
.tl-img { border-radius: 4px; background-repeat: no-repeat; }
.tl-times { display: flex; justify-content: space-between; font: 12px ui-monospace, Menlo, monospace; color: #aaa; gap: 12px; }
.tl-msg { font-family: inherit; color: #8ab4f8; }

.clipbox { background: #232425; border: 1px solid #3a3a3a; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.cb-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; }
.cb-field label { display: block; font-size: 12px; color: #aaa; margin-bottom: 4px; }
.cb-in { display: flex; gap: 6px; }
.cb-in input { width: 100%; min-width: 0; background: #131314; border: 1px solid #444; color: #fff; border-radius: 8px; padding: 6px 10px; font: 14px ui-monospace, Menlo, monospace; }
.cb-in input:focus { outline: none; border-color: #a8c7fa; }
.cb-in .btn { white-space: nowrap; }
.cb-len { font: 600 18px ui-monospace, Menlo, monospace; color: #fdd663; padding-top: 4px; }
.cb-opts { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.seg { display: inline-flex; border: 1px solid #444; border-radius: 10px; overflow: hidden; }
.seg button { background: none; border: 0; padding: 7px 16px; cursor: pointer; display: flex; flex-direction: column; align-items: flex-start; color: #c4c7c5; text-align: left; }
.seg button + button { border-left: 1px solid #444; }
.seg button small { font-size: 11px; color: #999; }
.seg button.on { background: #004a77; color: #c2e7ff; }
.seg button.on small { color: #9fc8e8; }
.cb-fmt { display: flex; align-items: center; gap: 8px; color: #aaa; font-size: 13px; }
.cb-fmt select { background: #131314; color: #fff; border: 1px solid #444; border-radius: 8px; padding: 6px 8px; }
.cb-hint { display: flex; gap: 10px; font-size: 13px; color: #c4c7c5; line-height: 1.45; }
.cb-hint svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.cb-hint svg.hi { fill: #81c995; } .cb-hint svg.hw { fill: #fdd663; }
.cb-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* convert dialog */
.opts { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt.disabled { opacity: .5; cursor: not-allowed; }
.opt input { margin-top: 3px; accent-color: var(--accent); }
.dialog .small { font-size: 12px; }

/* jobs in activity panel */
.up-item .jb { display: flex; gap: 2px; margin: 4px 0 0 -10px; }
.up-item .jb:empty { display: none; }
.btn.text.sm { padding: 3px 10px; }
.pbar.indet div { width: 30% !important; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { margin-left: -30%; } to { margin-left: 100%; } }

@media (max-width: 800px) {
  .vpanel { padding: 8px 12px 12px; }
  .cb-grid { grid-template-columns: 1fr; }
  .cb-in .btn kbd, .vpanel kbd { display: none; }
  .vinfo .chip:nth-child(n+4) { display: none; }
  .tl-h { width: 20px; margin-left: -10px; }
  .seg button { padding: 6px 10px; }
}

/* viewer: solid backdrop, panel scrolls on small screens */
.viewer { background: #0f0f10; }
.viewer .vb-video { min-height: 32vh; }
.vpanel { max-height: 62vh; overflow-y: auto; flex: none; }
@media (max-width: 800px) {
  .viewer .vh { gap: 0; padding: 6px 4px; }
  .viewer .vh .title { font-size: 14px; gap: 8px; }
  .viewer .vh a.icon-btn, #vPrev, #vNext { display: none; }
  .viewer .vb-video { padding: 0 0 6px; min-height: 28vh; }
  .viewer .vb-video video { border-radius: 0; }
  .v-err { padding: 16px; gap: 6px; margin: 8px; }
  .v-err > svg { width: 32px; height: 32px; }
  .vpanel { max-height: 58vh; }
  .vinfo-actions { margin-left: 0; width: 100%; }
  .vinfo-actions .btn { flex: 1; }
}
