:root {
  --bg: #0d0e12; --panel: #16171d; --panel2: #1e2028; --panel3: #262935; --line: #2a2d38;
  --text: #eceef4; --muted: #9196a6; --faint: #5d6272;
  --accent: #7c5cff; --accent2: #22c55e; --warn: #f59e0b; --bad: #ef4444;
  --radius: 16px; --header: 64px; --tabbar: 0px; --playerbar: 0px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f4f5f8; --panel: #fff; --panel2: #eef0f4; --panel3: #e3e6ec; --line: #e1e3ea;
          --text: #15171e; --muted: #5f6577; --faint: #9aa0ae; color-scheme: light; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; }
.icon { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }

/* ---------- header / navigation */
header.top { position: sticky; top: 0; z-index: 20; height: var(--header); display: flex; align-items: center; gap: 22px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #3b82f6); display: grid; place-items: center; }
.logo svg { width: 18px; height: 18px; }
nav.main { display: flex; gap: 4px; }
nav.main a { text-decoration: none; color: var(--muted); padding: 8px 14px; border-radius: 10px; font-weight: 500; }
nav.main a:hover { color: var(--text); background: var(--panel2); }
nav.main a.on { color: var(--text); background: var(--panel3); }
header .search { margin-left: auto; position: relative; width: min(320px, 40vw); }
header .search input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  padding: 0 12px 0 36px; font: inherit; }
header .search input:focus { outline: none; border-color: var(--accent); }
header .search .icon { position: absolute; left: 10px; top: 9px; width: 18px; height: 18px; color: var(--muted); }
nav.tabbar { display: none; }

@media (max-width: 760px) {
  :root { --header: 56px; --tabbar: 62px; }
  header.top { padding: 0 14px; gap: 12px; }
  nav.main { display: none; }
  header .search { width: auto; flex: 1; }
  nav.tabbar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); }
  nav.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    text-decoration: none; font-size: 11px; color: var(--muted); }
  nav.tabbar a.on { color: var(--accent); }
  nav.tabbar .icon { width: 22px; height: 22px; }
}

main { max-width: 1400px; margin: 0 auto; padding: 24px 24px calc(60px + var(--tabbar) + var(--playerbar)); min-height: 70vh; }
@media (max-width: 760px) { main { padding: 16px 14px calc(30px + var(--tabbar) + var(--playerbar)); } }

h1.page { font-size: 28px; letter-spacing: -.02em; margin: 4px 0 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h1.page .sub { font-size: 15px; font-weight: 400; color: var(--muted); }
h2.row { font-size: 18px; margin: 30px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
h2.row a { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
h2.row a:hover { color: var(--text); }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 50px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); cursor: pointer; text-decoration: none; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--bad); }
.btn.icon-only { width: 38px; padding: 0; justify-content: center; }
.btn .icon { width: 18px; height: 18px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--panel2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }

/* ---------- start */
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #2b2350, #141522); border: 1px solid var(--line); }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: transform .4s, opacity .3s; }
.tile:hover img { transform: scale(1.05); opacity: .7; }
.tile .lbl { position: absolute; left: 16px; bottom: 14px; right: 16px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px;
  text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.tile .lbl .icon { width: 24px; height: 24px; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0,0,0,.6)); }
.tile .lbl { z-index: 1; }

.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; scrollbar-width: thin; }
.scroller > * { scroll-snap-align: start; }
.scroller.small { grid-auto-columns: 150px; }
@media (min-width: 1100px) { .scroller { grid-auto-columns: calc((100% - 48px) / 5); } .scroller.small { grid-auto-columns: calc((100% - 84px) / 8); } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.two { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.total { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.total b { font-size: 22px; }
.bar { height: 8px; border-radius: 99px; background: var(--panel3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #3b82f6); border-radius: 99px; }
.disks { display: grid; gap: 10px; margin-top: 16px; }
.disk { background: var(--panel2); border-radius: 12px; padding: 12px 14px; }
.disk .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
.disk .meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.disk.ssd .bar > i { background: linear-gradient(90deg, var(--accent2), #14b8a6); }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 99px; font-weight: 600; }
.ok { background: color-mix(in srgb, var(--accent2) 18%, transparent); color: var(--accent2); }
.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.idle { background: var(--panel3); color: var(--muted); }
.howto ol { margin: 10px 0 0; padding-left: 20px; }
.howto li { margin: 6px 0; }
.howto .tabs { margin-bottom: 14px; }
code, .copy { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; background: var(--panel2); padding: 2px 8px; border-radius: 6px; }
.copy { border: 1px solid var(--line); cursor: pointer; }
.copy:hover { border-color: var(--accent); }
details { margin-top: 10px; color: var(--muted); }
details summary { cursor: pointer; }
.note { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- media cards (films, series, albums, music) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 14px; }
.cards.square { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 560px) { .cards { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; } .cards.square { grid-template-columns: repeat(2, 1fr); } }
.card { display: block; text-decoration: none; cursor: pointer; min-width: 0; border: 0; background: none; padding: 0; text-align: left; }
.card .art { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: var(--panel2); }
.cards.square .card .art, .scroller.small .card .art { aspect-ratio: 1; }
.card .art img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card .art .play, .card .art .prog, .card .art .tag { z-index: 2; }
.card:hover .art img { transform: scale(1.04); }
.card .art .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.card .art .ph .icon { width: 40px; height: 40px; }
.card .art .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.25); }
.card .art .play span { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.92); color: #111; display: grid; place-items: center; }
.card:hover .art .play { opacity: 1; }
.card .art .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.card .art .prog i { display: block; height: 100%; background: var(--accent); }
.card .art .tag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.65); color: #fff; padding: 2px 7px; border-radius: 6px; }
.card .t { margin-top: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- photos */
.month { margin: 26px 0 10px; font-size: 17px; font-weight: 700; position: sticky; top: var(--header); z-index: 5; padding: 8px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.month:first-child { margin-top: 0; }
.month .muted { font-weight: 400; font-size: 14px; margin-left: 8px; }
.jrow { display: flex; gap: 4px; margin-bottom: 4px; }
.ph-item { position: relative; overflow: hidden; background: var(--panel2); cursor: pointer; border-radius: 4px; flex: none; }
.ph-item img { width: 100%; height: 100%; object-fit: cover; }
.ph-item:hover img { filter: brightness(1.08); }
.ph-item .vid { position: absolute; right: 6px; bottom: 6px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(0,0,0,.6);
  border-radius: 6px; padding: 1px 6px; display: flex; align-items: center; gap: 3px; }
.ph-item .vid .icon { width: 12px; height: 12px; }
.ph-item .raw { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 800; color: #fff; background: rgba(0,0,0,.6); border-radius: 4px; padding: 0 5px; }
.grid-sq { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px; }
@media (max-width: 560px) { .grid-sq { grid-template-columns: repeat(3, 1fr); gap: 2px; } }
.grid-sq .ph-item { aspect-ratio: 1; border-radius: 2px; }
.sentinel { height: 40px; }

/* ---------- lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; color: #fff; user-select: none; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(rgba(0,0,0,.7), transparent); z-index: 2; transition: opacity .25s; }
.lb-top .info { flex: 1; min-width: 0; }
.lb-top .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-top .info span { font-size: 13px; opacity: .75; }
.lb-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; cursor: pointer; text-decoration: none; }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-stage { flex: 1; display: grid; place-items: center; overflow: hidden; touch-action: pan-y pinch-zoom; }
.lb-stage img { max-width: 100%; max-height: 100vh; object-fit: contain; }
.lb-stage .spinner { position: absolute; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
.lightbox.idle .lb-top, .lightbox.idle .lb-nav { opacity: 0; }
@media (hover: none) { .lb-nav { display: none; } }

/* ---------- video player */
.player { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; user-select: none; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player .subs { position: absolute; left: 5%; right: 5%; bottom: 12%; text-align: center; pointer-events: none; transition: bottom .25s; }
.player .subs span { display: inline; font-size: clamp(18px, 3.2vw, 38px); line-height: 1.35; background: rgba(0,0,0,.55); padding: 2px 10px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone; white-space: pre-line; text-shadow: 0 1px 2px #000; border-radius: 4px; }
.player.ui .subs { bottom: 120px; }
.pl-top, .pl-bottom { position: absolute; left: 0; right: 0; padding: 14px 18px; transition: opacity .3s; z-index: 2; }
.pl-top { top: 0; display: flex; align-items: center; gap: 12px; background: linear-gradient(rgba(0,0,0,.75), transparent); }
.pl-top .title { flex: 1; min-width: 0; }
.pl-top .title b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-top .title span { font-size: 13px; opacity: .7; }
.pl-bottom { bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,.85)); padding-top: 50px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.player:not(.ui) .pl-top, .player:not(.ui) .pl-bottom, .player:not(.ui) .pl-center { opacity: 0; pointer-events: none; }
.player:not(.ui) { cursor: none; }
.pl-seek { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.pl-seek .track { position: absolute; left: 0; right: 0; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); transition: height .15s; }
.pl-seek:hover .track { height: 6px; }
.pl-seek .buf { position: absolute; left: 0; height: 100%; background: rgba(255,255,255,.35); border-radius: 4px; }
.pl-seek .cur { position: absolute; left: 0; height: 100%; background: var(--accent); border-radius: 4px; }
.pl-seek .knob { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translateX(-50%); box-shadow: 0 0 0 4px rgba(124,92,255,.35); }
.pl-seek .hover { position: absolute; bottom: 24px; transform: translateX(-50%); background: rgba(0,0,0,.8); padding: 2px 8px; border-radius: 6px; font-size: 13px; display: none; }
.pl-seek:hover .hover { display: block; }
.pl-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pl-row .time { font-variant-numeric: tabular-nums; font-size: 14px; opacity: .9; margin: 0 8px; }
.pl-row .spacer { flex: 1; }
.pl-b { height: 42px; min-width: 42px; padding: 0 10px; border-radius: 10px; border: 0; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: 14px; }
.pl-b:hover { background: rgba(255,255,255,.14); }
.pl-b .icon { width: 22px; height: 22px; }
.pl-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity .3s; }
.pl-center .big { pointer-events: auto; width: 76px; height: 76px; border-radius: 50%; background: rgba(0,0,0,.5); border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; }
.pl-center .big .icon { width: 36px; height: 36px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pl-loading { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.pl-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(20,20,28,.92); padding: 20px 24px; border-radius: 14px; text-align: center; max-width: 90%; }
.pl-next { position: absolute; right: 20px; bottom: 120px; background: rgba(20,20,28,.9); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; z-index: 3; }
.menu-pop { position: absolute; bottom: 70px; right: 18px; background: rgba(22,23,30,.97); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 6px; min-width: 220px; z-index: 4; max-height: 60vh; overflow: auto; }
.menu-pop h4 { margin: 6px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; }
.menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; color: #fff; text-align: left; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.menu-pop button:hover { background: rgba(255,255,255,.1); }
.menu-pop button .chk { width: 18px; opacity: 0; }
.menu-pop button.on .chk { opacity: 1; color: var(--accent); }
@media (max-width: 560px) { .pl-row .hide-sm { display: none; } }

/* ---------- series / tracks lists */
.hero-show { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: end; margin-bottom: 24px; }
@media (max-width: 760px) { .hero-show { grid-template-columns: 1fr; } }
.hero-show .art { aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: var(--panel2); }
.hero-show .art img { width: 100%; height: 100%; object-fit: cover; }
.hero-show h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -.02em; }
.hero-show .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.eps { display: grid; gap: 6px; }
.ep { display: grid; grid-template-columns: 180px 1fr auto; gap: 16px; align-items: center; padding: 8px; border-radius: 12px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.ep:hover { background: var(--panel2); }
.ep .art { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--panel2); }
.ep .art img { width: 100%; height: 100%; object-fit: cover; }
.ep .art .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.ep .art .prog i { display: block; height: 100%; background: var(--accent); }
.ep .t { font-weight: 600; }
.ep .s { color: var(--muted); font-size: 13px; }
.ep .done { color: var(--accent2); }
@media (max-width: 560px) { .ep { grid-template-columns: 120px 1fr; } .ep > :last-child { display: none; } }

.tracks { display: grid; }
.trk { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.trk:hover { background: var(--panel2); }
.trk .n { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.trk.on { color: var(--accent); }
.trk.on .n { color: var(--accent); }
.trk .s { color: var(--muted); font-size: 13px; }
.trk .d { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 14px; }

/* ---------- music player bar */
.mbar { position: fixed; z-index: 25; left: 0; right: 0; bottom: var(--tabbar); height: 76px; display: flex; align-items: center; gap: 14px; padding: 0 18px;
  background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
@media (max-width: 760px) { .mbar { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); height: 64px; padding: 0 10px; gap: 10px; } }
.mbar .cov { width: 50px; height: 50px; border-radius: 8px; background: var(--panel2); overflow: hidden; flex: none; }
.mbar .cov img { width: 100%; height: 100%; object-fit: cover; }
.mbar .meta { min-width: 0; flex: 0 1 260px; }
.mbar .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar .meta span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbar .ctl { display: flex; align-items: center; gap: 2px; }
.mbar .ctl button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; cursor: pointer; }
.mbar .ctl button:hover { background: var(--panel2); }
.mbar .ctl .pp { background: var(--text); color: var(--bg); }
.mbar .ctl .pp:hover { background: var(--text); filter: brightness(.9); }
.mbar .prog { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mbar input[type=range] { flex: 1; accent-color: var(--accent); }
.mbar .x { border: 0; background: none; cursor: pointer; color: var(--muted); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
@media (max-width: 760px) { .mbar .prog span, .mbar .ctl .prev { display: none; } .mbar .prog { position: absolute; left: 0; right: 0; top: -9px; } .mbar .meta { flex: 1; } }

/* ---------- files */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 20px; font-weight: 700; margin: 4px 0 16px; letter-spacing: -.01em; }
.crumbs a { text-decoration: none; padding: 2px 6px; border-radius: 8px; color: var(--muted); }
.crumbs a:hover { background: var(--panel2); color: var(--text); }
.crumbs a:last-child { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.flist { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.frow { display: grid; grid-template-columns: 34px 44px 1fr 110px 150px 44px; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--line); cursor: pointer; }
.frow:first-child { border-top: 0; }
.frow:hover { background: var(--panel2); }
.frow.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.frow.head { cursor: default; color: var(--muted); font-size: 13px; font-weight: 600; background: var(--panel); }
.frow.head:hover { background: var(--panel); }
.frow .ic { width: 40px; height: 40px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--panel2); color: var(--muted); }
.frow .ic img { width: 100%; height: 100%; object-fit: cover; }
.frow .ic.dir { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.frow .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.frow .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.frow .sz, .frow .dt { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.frow input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.frow .more { width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.frow .more:hover { background: var(--panel3); color: var(--text); }
.flist.search .frow { grid-template-columns: 44px 1fr 110px 150px; }
@media (max-width: 760px) { .frow { grid-template-columns: 30px 44px 1fr 40px; } .frow .sz, .frow .dt { display: none; } .flist.search .frow { grid-template-columns: 44px 1fr; } }
.selbar { position: sticky; top: calc(var(--header) + 8px); z-index: 6; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px;
  background: var(--panel3); border-radius: 12px; }
.drop { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--accent) 25%, rgba(0,0,0,.6)); display: grid; place-items: center; pointer-events: none; }
.drop div { border: 3px dashed #fff; border-radius: 24px; padding: 50px 70px; color: #fff; font-size: 22px; font-weight: 700; text-align: center; }

/* ---------- uploads */
.uploads { position: fixed; z-index: 50; right: 18px; bottom: calc(18px + var(--tabbar) + var(--playerbar)); width: min(380px, calc(100vw - 36px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.4); overflow: hidden; }
.uploads .hd { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-weight: 600; }
.uploads .hd span { flex: 1; }
.uploads .hd button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.uploads .bd { max-height: 240px; overflow: auto; border-top: 1px solid var(--line); }
.uploads .it { padding: 8px 14px; font-size: 13px; }
.uploads .it .n { display: flex; justify-content: space-between; gap: 10px; }
.uploads .it .n span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploads .it .bar { height: 4px; margin-top: 5px; }
.uploads .it.err { color: var(--bad); }
.uploads .it.done .bar > i { background: var(--accent2); }

/* ---------- dialogs, menus, toast */
.dlg-back { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(460px, 100%); box-shadow: 0 30px 70px rgba(0,0,0,.5); max-height: 85vh; display: flex; flex-direction: column; }
.dlg h3 { margin: 0 0 8px; font-size: 18px; }
.dlg p { margin: 0 0 14px; color: var(--muted); }
.dlg input[type=text] { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 0 12px; font: inherit; }
.dlg input[type=text]:focus { outline: none; border-color: var(--accent); }
.dlg .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg .picker { overflow: auto; border: 1px solid var(--line); border-radius: 10px; min-height: 200px; }
.dlg .picker button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; text-align: left; }
.dlg .picker button:first-child { border-top: 0; }
.dlg .picker button:hover { background: var(--panel2); }
.ctx { position: fixed; z-index: 95; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 200px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.ctx button:hover { background: var(--panel2); }
.ctx button.danger { color: var(--bad); }
.toast { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--tabbar) + var(--playerbar)); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; font-weight: 500; display: flex; gap: 14px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: calc(100vw - 30px); }
.toast button { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; }
.player ~ .toast { z-index: 100; }
.loading { display: grid; place-items: center; padding: 60px; }
.loading .spinner { border-color: var(--panel3); border-top-color: var(--accent); }

/* ---------- header button, forms, hints */
.hdr-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); flex: none; }
.hdr-btn:hover, .hdr-btn.on { color: var(--text); background: var(--panel3); }
.field { width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 0 12px; font: inherit; }
.field:focus { outline: none; border-color: var(--accent); }
select.field { width: auto; padding-right: 8px; }
.btn.wide { width: 100%; justify-content: center; height: 44px; }
.btn:disabled { opacity: .6; cursor: default; }
.icon.xs { width: 13px; height: 13px; }
.small { font-size: 13px; }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; margin: 10px 0; font-size: 14px; }
.hint .icon { width: 18px; height: 18px; margin-top: 2px; }
.hint a { color: inherit; font-weight: 600; }
.hint.ok span, .hint.warn span, .hint.bad span { color: var(--text); }
.panel h2 .icon { width: 20px; height: 20px; vertical-align: -3px; margin-right: 4px; color: var(--accent); }
.panel ol, .panel ul { padding-left: 20px; } .panel li { margin: 5px 0; }
.urlbox { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.urlbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; padding: 9px 12px; }
.step { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--panel2); margin: 8px 0; opacity: .55; }
.step.on { opacity: 1; outline: 1px solid var(--accent); }
.step > span { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.step .btn { margin-top: 10px; }
.spinner.sm { display: inline-block; width: 14px; height: 14px; border-width: 2px; border-color: var(--panel3); border-top-color: var(--accent); vertical-align: -2px; margin-right: 6px; }
.pwform { display: grid; gap: 10px; max-width: 420px; }
.pwform .btn { justify-self: start; }
.panel .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.howto .tabs { flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 4px; margin: 4px 6px 0 0; }

/* share dialog + list */
.dlg h3 .icon { vertical-align: -3px; color: var(--accent); }
.dlg .links { display: grid; gap: 8px; margin: 4px 0 12px; max-height: 34vh; overflow: auto; }
.slink { display: flex; gap: 6px; align-items: center; background: var(--panel2); border-radius: 10px; padding: 8px 10px; }
.slink .u { flex: 1; min-width: 0; }
.slink code { display: block; padding: 0; background: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newlink { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.chk { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.row-l { display: flex; gap: 10px; align-items: center; }
.srow { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-top: 1px solid var(--line); }
.srow:first-child { border-top: 0; }
.srow .ic { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--panel2); color: var(--muted); }
.srow .ic.dir { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.srow .nm { min-width: 0; } .srow .nm b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .nm small { display: block; color: var(--muted); font-size: 12px; }
.srow .b { display: flex; gap: 6px; }
@media (max-width: 560px) { .srow { grid-template-columns: 40px 1fr; } .srow .b { grid-column: 2; } }

/* login screen (internet) and password page of share links */
.login { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.login.inline { position: static; min-height: 60vh; background: none; }
.login form { width: min(380px, 100%); display: grid; gap: 12px; text-align: center; }
.login h1 { margin: 0; font-size: 24px; }
.login p { margin: 0; }
.login .err { color: var(--bad); min-height: 1.2em; font-size: 14px; }
.logo.big { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto; color: #fff; }
.logo.big .icon { width: 26px; height: 26px; }

/* public share page */
.sharepage header.top .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70vw; }
.sharepage main { padding-bottom: 60px; }
.sharepage .flist.search .frow { grid-template-columns: 44px 1fr 44px; }
.sh-file { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr; gap: 28px; align-items: start; }
@media (max-width: 760px) { .sh-file { grid-template-columns: 1fr; } }
.sh-file .pv { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; min-height: 240px; }
.pv-img, .pv-media { width: 100%; max-height: 75vh; object-fit: contain; background: #000; }
.pv-icon { color: var(--faint); padding: 60px; } .pv-icon .icon { width: 72px; height: 72px; }
.pv-audio { display: grid; gap: 18px; justify-items: center; padding: 40px 20px; color: var(--accent); width: 100%; }
.pv-audio .icon { width: 64px; height: 64px; } .pv-audio audio { width: 100%; }
.sh-meta h1 { margin: 0 0 4px; font-size: 24px; word-break: break-word; }
.sh-meta .actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 10px; }
.panel h2.row:has(> svg.icon:first-child) { justify-content: flex-start; gap: 6px; }
.dlg .links { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
