:root {
  --bg: #111318; --bg2: #181b22; --bg3: #222631; --line: #2c3140;
  --text: #e8eaf0; --muted: #9aa1b2; --accent: #7aa2ff; --accent2: #3ccf91;
  --danger: #ff6b6b; --warn: #ffc36b; --radius: 12px;
  --sidebar: 220px; --bottom: 64px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0; font-weight: 650; }
h2 { font-size: 17px; margin: 24px 0 10px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- кнопки и поля ---------- */
.btn { background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #4a5166; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b1020; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; width: 100%; outline: none; }
.input:focus { border-color: var(--accent); }
label.field { display: block; margin: 10px 0; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.check { display: flex; gap: 8px; align-items: center; margin: 10px 0; cursor: pointer; }
.chip { padding: 6px 12px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line);
  cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip.active { background: var(--accent); color: #0b1020; border-color: var(--accent); font-weight: 600; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* ---------- каркас ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); flex-shrink: 0; border-right: 1px solid var(--line); padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--bg); }
.logo { font-weight: 800; font-size: 20px; padding: 0 10px 18px; letter-spacing: .5px; }
.logo span { color: var(--accent); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--text); margin-bottom: 2px; }
.nav a:hover { background: var(--bg2); }
.nav a.active { background: var(--bg3); color: var(--accent); }
  border-radius: 6px; padding: 0 5px; }
.nav .sep { height: 1px; background: var(--line); margin: 12px 6px; }
.nav .ico { width: 22px; text-align: center; }
.main { flex: 1; min-width: 0; padding: 20px 24px 40px; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.bottomnav { display: none; }

@media (max-width: 820px) {
  .sidebar { display: none; }
  .main { padding: 14px 10px calc(var(--bottom) + 20px + env(safe-area-inset-bottom)); }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    height: calc(var(--bottom) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(17,19,24,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11px; color: var(--muted); gap: 2px; }
  .bottomnav a .ico { font-size: 20px; }
  .bottomnav a.active { color: var(--accent); }
  h1 { font-size: 19px; }
}

/* ---------- таймлайн ---------- */
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.month-title { position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 70%, transparent);
  padding: 14px 2px 8px; font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px; }
@media (max-width: 820px) { .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 2px; } }
.tile { position: relative; aspect-ratio: 1; background: var(--bg3); overflow: hidden; cursor: pointer;
  border-radius: 4px; user-select: none; -webkit-user-select: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tile:hover img { transform: scale(1.03); }
.tile .badge { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.65); padding: 1px 6px;
  border-radius: 6px; font-size: 12px; }
.tile .fav { position: absolute; left: 6px; bottom: 4px; color: var(--warn); font-size: 14px;
  text-shadow: 0 0 4px #000; }
.tile .sel { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.3); display: none; }
.selecting .tile .sel { display: block; }
.tile.selected .sel { background: var(--accent); border-color: var(--accent); }
.tile.selected::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--accent);
  border-radius: 4px; pointer-events: none; }
.tile.selected .sel::after { content: "✓"; color: #0b1020; font-size: 13px; font-weight: 800;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sentinel { height: 40px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 48px; margin-bottom: 10px; }

.selbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 40;
  background: var(--bg3); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px;
  display: flex; gap: 6px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  max-width: calc(100vw - 20px); overflow-x: auto; }
@media (max-width: 820px) { .selbar { bottom: calc(var(--bottom) + 10px + env(safe-area-inset-bottom)); } }

.months { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0 4px; scrollbar-width: none; }
.months::-webkit-scrollbar { display: none; }

/* ---------- альбомы ---------- */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
@media (max-width: 820px) { .albums { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.album { cursor: pointer; }
.album .cover { aspect-ratio: 1; border-radius: var(--radius); background: var(--bg3) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 40px; color: #4a5166; }
.album .t { margin-top: 8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album .s { font-size: 13px; color: var(--muted); }

/* ---------- хранилища ---------- */
.vaults { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.vault .name { font-weight: 600; font-size: 16px; }

/* ---------- загрузка ---------- */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 20px; text-align: center;
  cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--accent); background: rgba(122,162,255,.06); }
.uplist { margin-top: 14px; font-size: 14px; }
.uplist div { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.uplist .st { margin-left: auto; white-space: nowrap; }
.progress { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin-top: 12px; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* ---------- просмотрщик ---------- */
.viewer { position: fixed; inset: 0; z-index: 100; background: #000; display: flex; }
.viewer .stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center;
  min-width: 0; touch-action: pan-y; }
.viewer .stage img, .viewer .stage video { max-width: 100%; max-height: 100vh; object-fit: contain; }
.viewer .vbar { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 4px; padding: 10px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(rgba(0,0,0,.7), transparent); z-index: 2; align-items: center; }
.viewer .vbar .btn { background: rgba(30,30,30,.6); border-color: transparent; }
.viewer .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; font-size: 28px;
  background: rgba(30,30,30,.5); border: none; width: 48px; height: 64px; border-radius: 10px; cursor: pointer; }
.viewer .nav-btn.prev { left: 10px; } .viewer .nav-btn.next { right: 10px; }
@media (max-width: 820px) { .viewer .nav-btn { display: none; } }
.viewer .info { width: 340px; background: var(--bg2); border-left: 1px solid var(--line); overflow-y: auto;
  padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); }
@media (max-width: 820px) {
  .viewer { flex-direction: column; }
  .viewer .info { width: 100%; max-height: 55vh; border-left: none; border-top: 1px solid var(--line); }
  .viewer .stage img, .viewer .stage video { max-height: 100%; }
}
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; margin: 12px 0; }
.kv div:nth-child(odd) { color: var(--muted); }
.kv div { word-break: break-word; }

/* ---------- модалки, тосты ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200; display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; width: 100%;
  max-width: 440px; max-height: 90vh; overflow-y: auto; padding: 20px; }
.modal h3 { margin: 0 0 12px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.pick-list { max-height: 300px; overflow-y: auto; margin: 8px 0; }
.pick-list button { display: flex; width: 100%; text-align: left; padding: 10px; border-radius: 10px;
  background: transparent; border: none; cursor: pointer; gap: 10px; align-items: center; }
.pick-list button:hover { background: var(--bg3); }
.toasts { position: fixed; top: 16px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  max-width: 340px; box-shadow: 0 8px 20px rgba(0,0,0,.4); animation: fade .2s; }
.toast.err { border-color: var(--danger); }
@keyframes fade { from { opacity: 0; transform: translateY(-6px); } }

.auth { max-width: 360px; margin: 12vh auto; padding: 0 16px; }
.auth .logo { text-align: center; font-size: 30px; padding-bottom: 6px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl td, table.tbl th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
pre.log { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px;
  font-size: 12px; max-height: 240px; overflow: auto; white-space: pre-wrap; }

/* ---------- ползунок таймлайна ---------- */
.tile.ph { cursor: default; background: var(--bg2); }
.has-scrubber { padding-right: 64px; }
.scrubber { position: fixed; right: 0; top: 16px; bottom: 16px; width: 56px; z-index: 20; cursor: ns-resize;
  touch-action: none; user-select: none; -webkit-user-select: none; }
.scrub-marks { position: absolute; inset: 0; pointer-events: none; }
.scrub-year { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11px; color: var(--muted);
  transition: color .15s; }
.scrub-dot { position: absolute; right: 18px; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: #4a5166; }
.scrubber:hover .scrub-year, .scrubber.active .scrub-year { color: var(--text); }
.scrub-handle { position: absolute; right: 4px; width: 48px; height: 3px; margin-top: -1px; border-radius: 2px;
  background: var(--accent); pointer-events: none; box-shadow: 0 0 6px rgba(122,162,255,.6); }
.scrub-tip { position: absolute; right: 62px; transform: translateY(-50%); background: var(--bg3); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 10px; white-space: nowrap; font-size: 14px; font-weight: 600; pointer-events: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.45); }
@media (max-width: 820px) {
  .has-scrubber { padding-right: 10px; }
  .scrubber { top: 70px; bottom: calc(var(--bottom) + 12px + env(safe-area-inset-bottom)); width: 44px;
    opacity: 0; pointer-events: none; transition: opacity .3s; }
  .scrubber.visible, .scrubber.active { opacity: 1; pointer-events: auto; }
  .scrub-year { display: none; }
  .scrubber.active .scrub-year { display: block; background: rgba(17,19,24,.85); padding: 0 4px; border-radius: 4px; right: 40px; }
  .scrub-dot { display: none; }
  .scrub-handle { right: 0; width: 34px; height: 40px; margin-top: -20px; border-radius: 20px 0 0 20px;
    background: var(--bg3); border: 1px solid var(--line); border-right: none; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
  .scrub-handle::after { content: "⇅"; position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; color: var(--accent); font-size: 18px; }
  .scrub-tip { right: 48px; }
}

/* ---------- дата на плитке, папки ---------- */
.tile .date { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 6px 4px; font-size: 11.5px;
  color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.dated .badge { bottom: auto; top: 6px; }
.tile.dated .fav { bottom: auto; top: 4px; }
.selecting .tile.dated .fav { display: none; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 14px; padding: 4px 2px; min-width: 0; }
.folders .cover { position: relative; background-color: var(--bg3); }
.folders .cover::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(transparent 55%, rgba(0,0,0,.55)); }
.folders .folder-ico { position: absolute; left: 10px; bottom: 8px; font-size: 22px; z-index: 1; }

/* ---------- дубли ---------- */
.badge-n { margin-left: auto; background: var(--bg3); color: var(--muted); border-radius: 99px; padding: 0 7px;
  font-size: 11px; font-weight: 700; line-height: 18px; }
.badge-n.hot { background: var(--warn); color: #1a1200; }
.bottomnav a { position: relative; }
.bottomnav .badge-n { position: absolute; top: 6px; left: 50%; margin-left: 8px; padding: 0 5px; }
.dups { display: flex; flex-direction: column; gap: 12px; }
.dup.busy { opacity: .5; pointer-events: none; }
.dup-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dup-img { position: relative; aspect-ratio: 4/3; background: var(--bg3); border-radius: 8px; overflow: hidden;
  cursor: zoom-in; margin-top: 4px; }
.dup-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dup-img .badge { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.65); padding: 1px 6px;
  border-radius: 6px; font-size: 12px; }
@media (min-width: 1200px) { .dups { display: grid; grid-template-columns: 1fr 1fr; } }
.tile .badge.raw { font-size: 10px; font-weight: 700; letter-spacing: .5px; color: var(--warn); }
.tile .rate { position: absolute; right: 6px; bottom: 5px; color: var(--warn); font-size: 11px; letter-spacing: -1px;
  text-shadow: 0 0 3px #000; pointer-events: none; }
.tile.dated .rate { bottom: 22px; }
.stars { color: var(--warn); letter-spacing: 1px; }
.tile .corner { position: absolute; top: 5px; left: 6px; display: flex; gap: 4px; align-items: center; pointer-events: none; }
.tile .corner .fav-c { color: var(--warn); font-size: 14px; text-shadow: 0 0 4px #000; }
.selecting .tile .corner { display: none; }
.ai-tag { background: rgba(155, 92, 255, .9); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px;
  border-radius: 6px; letter-spacing: .3px; }
.kv .ai-tag { font-size: 12px; font-weight: 600; }

/* ---------- фильмы и сериалы ---------- */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
@media (max-width: 820px) { .posters { grid-template-columns: repeat(3, 1fr); gap: 12px 8px; } }
.poster-card { cursor: pointer; min-width: 0; }
.poster-card .t { margin-top: 7px; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poster-card .s { font-size: 12px; color: var(--muted); }
.poster { position: relative; aspect-ratio: 2/3; border-radius: 10px; background: var(--bg3) center/cover no-repeat;
  overflow: hidden; transition: transform .15s; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.poster-card:hover .poster { transform: translateY(-3px); }
.poster-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 10px; font-weight: 700; color: var(--muted); background: linear-gradient(160deg, #2a2f3d, #171a22); }
.p-badge { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.7); border-radius: 99px; padding: 1px 7px; font-size: 12px; }
.p-badge.done { background: var(--accent2); color: #062; font-weight: 800; }
.p-badge.prep { right: auto; left: 6px; }
.p-badge.lock { top: auto; bottom: 6px; }
.cont-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.cont-card { flex: 0 0 260px; cursor: pointer; }
@media (max-width: 820px) { .cont-card { flex-basis: 200px; } }
.cont-card .t { margin-top: 6px; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cont-card .s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cont-img, .ep-img { position: relative; aspect-ratio: 16/9; border-radius: 8px; background: var(--bg3) center/cover no-repeat; overflow: hidden; }
.play-ico { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px;
  color: #fff; text-shadow: 0 2px 10px #000; opacity: .85; }
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.25); }
.bar > div { height: 100%; background: var(--danger); }
.hero { position: relative; margin: -20px -24px 0; padding: 28px 24px 24px; background: var(--bg2); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--bg) center/cover no-repeat; background-image: var(--bg);
  opacity: .28; filter: blur(2px); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 20%, transparent 80%),
  linear-gradient(0deg, var(--bg) 0%, transparent 40%); }
.hero-in { position: relative; z-index: 1; display: flex; gap: 24px; align-items: flex-start; }
.poster.big { width: 220px; flex-shrink: 0; }
.overview { max-width: 760px; line-height: 1.5; color: #cfd3dc; }
@media (max-width: 820px) {
  .hero { margin: -14px -10px 0; padding: 16px 12px; }
  .hero-in { flex-direction: column; gap: 12px; }
  .poster.big { width: 130px; }
}
.episodes { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.ep { display: flex; gap: 14px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.ep.watched .ep-title { color: var(--muted); }
.ep .ep-img { width: 200px; flex-shrink: 0; cursor: pointer; }
.ep-title { font-weight: 600; margin-bottom: 3px; }
.ep-actions { flex-shrink: 0; }
@media (max-width: 820px) {
  .ep { flex-wrap: wrap; }
  .ep .ep-img { width: 130px; }
  .ep-actions { width: 100%; justify-content: flex-end; }
}
.player { position: fixed; inset: 0; z-index: 150; background: #000; display: flex; flex-direction: column; }
.player video { flex: 1; width: 100%; min-height: 0; background: #000; }
.player-top { display: flex; gap: 10px; align-items: center; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
  color: #ddd; background: linear-gradient(rgba(0,0,0,.8), transparent); }
.player-top .btn { background: rgba(40,40,40,.8); border-color: transparent; }
.next-box { position: absolute; right: 24px; bottom: 90px; z-index: 2; }
.vup { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.vup-row { padding: 10px 14px; }
.vup-row.ok .progress > div { background: var(--accent2); }
.vup-row.err .progress > div { background: var(--danger); }
.vup-row .progress { margin: 8px 0 6px; }

/* ---------- книги ---------- */
.book-cover { aspect-ratio: 2/3; }
.book-ph { flex-direction: column; gap: 8px; font-family: Georgia, serif; background: linear-gradient(160deg, #3a3226, #1d1a14); color: #e9dfc8; }
.p-badge.fmt { top: auto; bottom: 8px; right: 6px; font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.book-card .bar { height: 5px; }
.read-bar { height: 5px; border-radius: 3px; background: var(--bg3); overflow: hidden; margin-top: 12px; max-width: 420px; }
.read-bar > div { height: 100%; background: var(--accent); transition: width .2s; }
.ep.current { border-color: var(--accent); }
.reader { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; background: var(--rbg); color: var(--rfg); }
.reader.theme-light { --rbg: #ffffff; --rfg: #1d1d1f; --rbar: #f2f2f4; }
.reader.theme-sepia { --rbg: #f4ecd8; --rfg: #3b2f1e; --rbar: #e9dfc6; }
.reader.theme-dark { --rbg: #15171c; --rfg: #d6d6d6; --rbar: #1e2128; }
.reader-top, .reader-bottom { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--rbar);
  border-color: rgba(127,127,127,.2); }
.reader-top { padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid rgba(127,127,127,.2); }
.reader-bottom { padding-bottom: calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(127,127,127,.2); }
.reader-bottom .read-bar { margin: 0; max-width: none; }
.reader .btn { background: transparent; border-color: rgba(127,127,127,.35); color: var(--rfg); }
.reader .muted { color: inherit; opacity: .6; }
.reader .input { background: transparent; color: var(--rfg); }
.reader-frame { flex: 1; width: 100%; border: 0; background: var(--rbg); min-height: 0; }
.reader-frame.pdf { background: #525659; }
.comic-stage { flex: 1; display: flex; align-items: center; justify-content: center; background: #000; min-height: 0; cursor: pointer; user-select: none; }
.comic-page { max-width: 100%; max-height: 100%; object-fit: contain; }
.toc button { font-size: 14px; }
.reader-box { flex: 1; min-height: 0; width: 100%; margin: 0 auto; display: flex; }
.reader-box .reader-frame { flex: 1; }
.reader.paged .reader-frame { cursor: pointer; }
.reader-info { white-space: nowrap; }

/* ---------- полки и стеллажи ---------- */
.books-layout { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; }
.books-aside { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding-right: 4px; }
.books-main { min-width: 0; }
.books-shelves-btn { display: none; }
@media (max-width: 1000px) {
  .books-layout { grid-template-columns: 1fr; }
  .books-aside { display: none; }
  .books-shelves-btn { display: inline-flex; }
}
.shelves { font-size: 14px; }
.shelf-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; }
.shelf-item a { color: var(--text); }
.shelf-item:hover { background: var(--bg2); }
.shelf-item.active { background: var(--bg3); }
.shelf-item.active a { color: var(--accent); }
.shelf-sub { padding-left: 16px; }
.rack { margin-top: 6px; }
.shelf-menu { padding: 2px 7px; opacity: .55; font-size: 13px; }
.shelf-item:hover .shelf-menu { opacity: 1; }
.shelf-chip { display: inline-flex; align-items: center; gap: 2px; padding-right: 4px; }
.book-card .sel { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff;
  background: rgba(0,0,0,.3); display: none; }
.selecting .book-card .sel { display: block; }
.book-card.selected .poster { outline: 3px solid var(--accent); outline-offset: 2px; }
.book-card.selected .sel { background: var(--accent); border-color: var(--accent); }
.books-tbl tr[data-book] { cursor: pointer; }
.books-tbl tr[data-book]:hover td { background: var(--bg2); }
.books-tbl .sel-cell { width: 26px; }
.books-tbl .tick { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.selecting .books-tbl .tick { display: inline-block; }
.books-tbl tr.selected .tick { background: var(--accent); border-color: var(--accent); }
.books-tbl tr.selected td { background: rgba(122,162,255,.08); }
@media (max-width: 820px) { .hide-m { display: none; } }

/* Dropbox → PocketBook */
.p-badge.dev { top: auto; bottom: 8px; right: auto; left: 6px; }
.dbx-steps { line-height: 1.7; padding-left: 20px; }
.dbx-steps code, .dbx-card code { background: var(--panel2, rgba(127,127,127,.15)); padding: 1px 5px; border-radius: 5px; }
.pick-shelf { display: flex; flex-direction: column; gap: 12px; width: min(400px, 76vw); max-width: 100%; }
.pick-new .input { box-sizing: border-box; }
.pick-shelf .pick-group { padding: 8px 10px 2px; }
.pick-new { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.pick-shelf .pick-list + .pick-new { margin-top: 2px; }
.pick-shelf .pick-list:empty + .pick-new, .pick-shelf > .pick-new:first-child { border-top: 0; padding-top: 0; }
.pick-new .input { width: 100%; }
.pick-new .row select.input { flex: 1; width: auto; min-width: 0; }
.pick-new .row .btn { margin-left: auto; }
@media (max-width: 600px) { .pick-new .row > span.small.muted:not(.grow) { display: none; } }

/* меню действий */
.action-menu { display: flex; flex-direction: column; gap: 6px; width: min(420px, 80vw); max-width: 100%; }
.action-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); color: var(--text); cursor: pointer; font: inherit; }
.action-item:hover { background: var(--bg3); border-color: var(--accent); }
.action-item .ai-icon { font-size: 20px; width: 28px; text-align: center; flex: none; }
.action-item .ai-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.action-item .ai-label { font-weight: 600; }
.action-item .ai-hint { font-size: 12px; color: var(--muted); }
.action-item .ai-arrow { color: var(--muted); font-size: 20px; }
.action-item.danger { margin-top: 8px; border-color: rgba(255,90,90,.35); }
.action-item.danger .ai-label { color: var(--danger); }
.action-item.danger:hover { background: rgba(255,90,90,.08); border-color: var(--danger); }
.dbx-err { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--danger); border-radius: 10px; background: rgba(255,90,90,.07); font-size: 14px; line-height: 1.5; }
.chip.locked { opacity: .6; }
.vault-chips { margin-top: 8px; align-items: center; }
.book-card .p-badge.lock { top: 6px; bottom: auto; }
.book-card .p-badge.done { right: auto; left: 6px; }
.enc-box { margin: 6px 0; }
.enc-warn { margin: 6px 0 4px 26px; padding: 10px 12px; border: 1px solid var(--warn); border-radius: 10px;
  background: rgba(255,195,107,.07); font-size: 13px; line-height: 1.5; }

/* ===== подвал меню: версия ===== */
@media (min-width: 821px) { .sidebar { display: flex; flex-direction: column; } }
.vfoot { margin-top: auto; padding-top: 12px; }
.version-foot { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0;
  color: var(--muted); font: inherit; font-size: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.version-foot:hover { background: var(--bg2); color: var(--text); }
.about h4 { margin: 16px 0 6px; }
.about details { margin: 4px 0; }
.about summary { cursor: pointer; }
.about ul { margin: 4px 0 8px; padding-left: 20px; }

/* ===== музыка ===== */
.poster.square { aspect-ratio: 1; }
.poster.square.big { width: 200px; flex: none; }
.sq-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 820px) { .sq-grid { grid-template-columns: repeat(2, 1fr); } }
.album-card { position: relative; }
.card-play { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--accent); color: #0b1020; font-size: 16px; cursor: pointer; opacity: 0; transition: opacity .15s;
  box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.album-card:hover .card-play { opacity: 1; }
@media (hover: none) { .card-play { opacity: .9; } }
.album-hero { display: flex; gap: 20px; align-items: flex-end; margin: 10px 0 6px; }
@media (max-width: 820px) { .album-hero .poster.square.big { width: 120px; } }
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.artist-card { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; color: var(--text); }
.artist-card:hover { background: var(--bg2); }
.artist-img { width: 56px; height: 56px; border-radius: 50%; background: var(--bg3) center/cover; display: flex;
  align-items: center; justify-content: center; font-size: 22px; flex: none; }
.tracks { display: flex; flex-direction: column; }
.track-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; cursor: pointer; user-select: none; }
.track-row:hover { background: var(--bg2); }
.track-row.playing .tr-title { color: var(--accent); }
.track-row.selected { background: rgba(122,162,255,.14); }
.track-row.dragging { opacity: .4; }
.tr-n { width: 28px; text-align: right; font-size: 13px; flex: none; }
.tr-n .eq, .tr-n .tick { display: none; }
.track-row.playing .tr-n .num { display: none; }
.track-row.playing .tr-n .eq { display: inline; color: var(--accent); }
.tracks.selecting .tr-n .num, .tracks.selecting .tr-n .eq { display: none; }
.tracks.selecting .tr-n .tick { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); vertical-align: middle; }
.tracks.selecting .track-row.selected .tick { background: var(--accent); border-color: var(--accent); }
.tr-cover { width: 40px; height: 40px; border-radius: 6px; background: var(--bg3) center/cover; flex: none; display: flex;
  align-items: center; justify-content: center; }
.tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tr-title { font-size: 15px; }
.tr-dur { width: 48px; text-align: right; flex: none; }
.tr-menu { flex: none; }

.mplayer { position: fixed; left: var(--sidebar); right: 0; bottom: 0; z-index: 35; height: 72px; display: flex; align-items: center;
  gap: 12px; padding: 0 16px; background: rgba(20,22,29,.97); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
body.has-player .main { padding-bottom: 100px; }
body.has-player .selbar { bottom: 92px; }
.pl-cover { width: 48px; height: 48px; border-radius: 8px; background: var(--bg3) center/cover; flex: none; display: flex;
  align-items: center; justify-content: center; }
.pl-info { width: 220px; min-width: 0; }
.pl-title { font-weight: 600; font-size: 14px; }
.pl-ctrl { display: flex; align-items: center; gap: 2px; }
.pl-btn { background: none; border: 0; color: var(--text); font-size: 18px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
.pl-btn:hover { background: var(--bg3); }
.pl-btn.big { width: 46px; height: 46px; background: var(--text); color: #111; font-size: 18px; }
.pl-btn.on { color: var(--accent); }
.pl-seekbox { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.pl-seek { flex: 1; accent-color: var(--accent); }
.pl-vol { width: 90px; accent-color: var(--accent); }
.pl-time { white-space: nowrap; }
@media (max-width: 820px) {
  .mplayer { left: 0; bottom: calc(var(--bottom) + env(safe-area-inset-bottom)); height: auto; flex-wrap: wrap; padding: 8px 10px 6px; gap: 8px; }
  .pl-info { flex: 1; width: auto; }
  .pl-seekbox { order: 10; flex-basis: 100%; }
  .pl-btn { width: 34px; height: 34px; font-size: 16px; }
  .pl-btn.big { width: 40px; height: 40px; }
  body.has-player .main { padding-bottom: calc(var(--bottom) + 130px); }
  body.has-player .selbar { bottom: calc(var(--bottom) + 120px); }
}
.queue-list { max-height: 60vh; overflow-y: auto; min-width: min(460px, 80vw); }
.q-row { display: flex; align-items: center; gap: 6px; border-radius: 8px; }
.q-row.cur { background: var(--bg3); }
.q-play { text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px; cursor: pointer; }

/* ===== ссылки ===== */
.link-add { margin: 6px 0 10px; }
.link-add .input.grow { min-width: 240px; flex: 1; }
.links { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.link-card { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.link-card.read .link-title { color: var(--muted); }
.link-img { width: 150px; height: 96px; border-radius: 10px; background: var(--bg3) center/cover; flex: none; display: flex;
  align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: var(--muted); }
.link-body { flex: 1; min-width: 0; }
.link-title { font-weight: 600; font-size: 15px; color: var(--text); display: block; margin-bottom: 2px; word-break: break-word; }
.link-title:hover { color: var(--accent); }
.link-desc { margin-top: 6px; color: #c4c9d6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link-note { margin-top: 6px; color: var(--warn); }
.link-actions { display: flex; flex-direction: column; gap: 2px; flex: none; }
.link-actions .on { color: var(--warn); }
.chip.sm { padding: 2px 8px; font-size: 12px; }
@media (max-width: 820px) {
  .link-card { flex-wrap: wrap; }
  .link-img { width: 88px; height: 64px; font-size: 24px; }
  .link-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}

/* ===== заметки ===== */
.notes-grid { columns: 280px; column-gap: 12px; margin-top: 10px; }
.note-card { break-inside: avoid; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg2); cursor: pointer; }
.note-card:hover { border-color: #3d4458; }
.note-card .pin { opacity: .3; }
.note-card .pin.on, .btn.on { opacity: 1; }
.note-prev { max-height: 340px; overflow: hidden; font-size: 14px; }
.c-yellow { background: #3a3420 !important; border-color: #5a4f26 !important; }
.c-green { background: #1f3428 !important; border-color: #2b5038 !important; }
.c-blue { background: #1e2b42 !important; border-color: #2c4264 !important; }
.c-pink { background: #3b2230 !important; border-color: #5c3349 !important; }
.c-purple { background: #2d2540 !important; border-color: #47386a !important; }
.c-gray { background: #2a2d35 !important; border-color: #3f434e !important; }
.color-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg2); cursor: pointer; }
.color-dot.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(122,162,255,.3); }
.note-title { font-size: 18px; font-weight: 600; flex: 1; min-width: 160px; }
.note-tools { margin: 4px 0 8px; gap: 2px; }
.note-editor { display: grid; gap: 12px; min-height: 60vh; }
.note-editor.mode-split { grid-template-columns: 1fr 1fr; }
.note-editor.mode-edit .note-preview, .note-editor.mode-view .note-body { display: none; }
.note-body { min-height: 60vh; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.55; }
.note-preview { padding: 6px 14px; border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 75vh; }
.note-meta { margin-top: 12px; align-items: flex-end; }
@media (max-width: 820px) { .note-editor.mode-split { grid-template-columns: 1fr; } }
.md { line-height: 1.55; word-wrap: break-word; }
.md h2, .md h3, .md h4, .md h5 { margin: 10px 0 6px; line-height: 1.25; }
.md h2 { font-size: 1.35em; } .md h3 { font-size: 1.15em; } .md h4, .md h5 { font-size: 1em; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md li.task { list-style: none; margin-left: -20px; }
.md li.task.done { color: var(--muted); text-decoration: line-through; }
.md input[type=checkbox] { accent-color: var(--accent); vertical-align: -2px; }
.md code { background: rgba(127,127,127,.18); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.md pre { background: #0c0e12; padding: 10px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 6px 0; padding: 2px 12px; border-left: 3px solid var(--accent); color: #c4c9d6; }
.md mark { background: #6b5a1a; color: inherit; padding: 0 2px; border-radius: 3px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.tg-code { font: 700 34px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 6px; text-align: center;
  padding: 14px; margin-top: 12px; border: 1px dashed var(--accent); border-radius: 12px; user-select: all; }
.bot-admin, .feature-admin { padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
input.switch { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--bg3); position: relative;
  cursor: pointer; transition: background .15s; flex: none; border: 1px solid var(--line); }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #cfd3dc; transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(16px); background: #fff; }
input.switch:disabled { opacity: .4; cursor: default; }
.tg-step { padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; } .tg-check { width: min(560px, 78vw); max-width: 100%; }
/* пользователи */
.users-tbl td { vertical-align: middle; }
.u-blocked td:first-child { text-decoration: line-through; color: var(--muted); }
.u-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 12px; color: var(--danger); border: 1px solid var(--danger); }
.feature-off { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 14px; color: var(--muted); }
/* музыка → папки */
.folder-bar { align-items: center; margin: 4px 0 12px; }
.folder-crumbs { font-size: 15px; }
.folder-crumbs a { color: var(--accent); text-decoration: none; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.folder-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.folder-card:hover { border-color: var(--accent); }
.folder-card .fc-icon { font-size: 26px; }
.folder-pick { max-height: 46vh; overflow: auto; }
.folder-pick button.cur { outline: 1px solid var(--accent); }
/* синхронизация с диском */
.sync-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sync-browse { max-height: 32vh; overflow: auto; }
.sync-new { width: auto; }
/* широкие окна: создание синхронизации/бэкапа, ход работы, снимки */
.modal:has(.sync-new), .modal:has(.sync-run) { max-width: 680px; }
.bk-scope { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.bk-scope .check { margin: 6px 0; }
.bk-vaults { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; margin: 2px 0 8px 26px; }
.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 600px) { .bk-grid { grid-template-columns: 1fr; } .bk-vaults { margin-left: 0; } }
.sync-run { width: min(620px, 84vw); max-width: 100%; }
.sync-progress { height: 6px; border-radius: 3px; background: var(--line); margin: 10px 0; overflow: hidden; }
.sync-progress > div { height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.sync-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sync-line { margin: 4px 0; }
.sync-asks { margin: 12px 0 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; max-height: 34vh; overflow: auto; }
.sync-ask { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); min-width: 0; }
.sync-ask .grow { min-width: 0; }
.sync-ask select { width: auto; max-width: 190px; }
.sync-notes { margin: 10px 0; overflow-wrap: anywhere; }
.sync-notes summary { cursor: pointer; font-size: 14px; }
@media (max-width: 600px) { .sync-cols { grid-template-columns: 1fr; } }
/* бэкап снимками */
.bk-row .sync-progress { margin: 6px 0 0; }
.bk-snaps { max-height: 50vh; overflow: auto; }
.bk-snaps .sync-ask:first-child { border-top: 0; }
/* меню: разделы с подпунктами */
.nav-group { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; margin-bottom: 2px; }
.nav-group:hover { background: var(--bg2); }
.nav-group.here:not(.open) { background: var(--bg3); color: var(--accent); }
.nav-group .chev { color: var(--muted); transition: transform .15s; }
.nav-group.open .chev { transform: rotate(90deg); }
.nav-sub { margin: 0 0 6px 16px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-sub a { padding: 6px 10px; font-size: 14px; }
/* дубли фильмов, книг, музыки */
.dup-files { padding: 12px 14px; }
.dupf-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; min-width: 0; }
.dupf-row a { color: var(--text); font-weight: 600; }
/* поделено */
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.sh-grid .tile { aspect-ratio: 1; position: relative; }
.sh-off { filter: grayscale(1); opacity: .55; cursor: not-allowed !important; }
.tile.sh-off { background: var(--bg3); display: flex; align-items: center; justify-content: center; flex-direction: column; }
.sh-locked { font-size: 28px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.poster .sh-locked, .album .cover .sh-locked { background: var(--bg3); }
.sh-name { position: absolute; left: 6px; right: 6px; bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.sh-list { display: grid; gap: 10px; max-width: 760px; }
.sh-item { padding: 12px 14px; cursor: pointer; overflow-wrap: anywhere; }
.share-dlg { width: min(460px, 82vw); }
.vault-share { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.sh-off-soft { opacity: .7; }
/* кнопки внизу панели информации (всегда видны) */
.viewer .info { display: flex; flex-direction: column; }

.info-actions { position: sticky; bottom: -16px; margin: auto -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg2); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-actions .btn { justify-content: center; text-align: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.info-actions .btn[disabled] { opacity: .45; cursor: default; }

/* ---------- пользователь в меню и «Ещё» на телефоне ---------- */
.nav-user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; text-align: left; }
.nav-user:hover { background: var(--bg2); }
.nav-user .chev { color: var(--muted); }
.drawer-back { display: none; }
@media (max-width: 820px) {
  .layout.drawer-open .sidebar { display: block; position: fixed; z-index: 45; left: 0; top: 0; bottom: 0;
    width: min(320px, 84vw); height: auto; padding-bottom: calc(var(--bottom) + 20px + env(safe-area-inset-bottom));
    box-shadow: 0 0 40px rgba(0,0,0,.5); }
  .layout.drawer-open .drawer-back { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.5); }
}

.mnav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
a.btn.disabled { opacity: .5; pointer-events: none; }
.track-row.found { background: rgba(122,162,255,.22); transition: background .6s; }

/* метка «без архива» */
.noarch { display: inline-block; font-size: 10px; font-weight: 600; line-height: 1.5; padding: 0 6px; margin-left: 6px;
  border-radius: 99px; color: var(--warn); border: 1px solid currentColor; white-space: nowrap; vertical-align: middle; }
.tile .noarch { position: absolute; top: 5px; right: 5px; margin: 0; background: rgba(0,0,0,.65); pointer-events: none; }
.poster-card .s .noarch { margin-left: 4px; }

/* корзина */
.trash-tabs .chip { white-space: nowrap; }
.trash-n { margin-left: 6px; font-size: 11px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.15); }
.chip.active .trash-n { background: rgba(0,0,0,.18); }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.trash-row:hover, .trash-row.selected { background: var(--bg2); }
.trash-cover { width: 40px; height: 40px; flex: none; border-radius: 6px; background: var(--bg2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 18px; }
.trash-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.bk-h { font-size: 15px; margin: 18px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }

/* плеер на весь экран */
.pl-open { cursor: pointer; }
.fplayer { position: fixed; inset: 0; z-index: 160; display: flex; flex-direction: column; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); background: #0b0c10; color: #fff;
  overflow: hidden; transform: translateY(100%); transition: transform .25s ease; touch-action: pan-x; }
.fplayer.show { transform: none; }
body.fp-open { overflow: hidden; }
.fp-bg { position: absolute; inset: -60px; background: #222 center/cover; filter: blur(60px) saturate(1.4) brightness(.45); transform: scale(1.1); z-index: -1; }
.fp-top { width: 100%; max-width: 560px; display: flex; align-items: center; gap: 10px; }
.fp-src { flex: 1; text-align: center; min-width: 0; line-height: 1.3; }
.fp-art { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: 18px 0; }
.fp-cover { width: min(78vw, 46vh, 460px); aspect-ratio: 1; border-radius: 14px; background: #2a2c35 center/cover;
  box-shadow: 0 20px 60px rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; font-size: 72px; }
.fp-meta { width: 100%; max-width: 560px; text-align: center; }
.fp-title { font-size: 24px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.fp-artist { margin-top: 6px; font-size: 16px; color: rgba(255,255,255,.72); overflow-wrap: anywhere; }
.fp-artist a { color: inherit; text-decoration: none; }
.fp-artist a:hover { text-decoration: underline; }
.fp-seekbox { width: 100%; max-width: 560px; margin-top: 22px; }
.fp-seek { --p: 0%; width: 100%; height: 22px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.fp-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px;
  background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,.25) var(--p)); }
.fp-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; border: 0; }
.fp-seek::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); }
.fp-seek::-moz-range-progress { height: 6px; border-radius: 3px; background: #fff; }
.fp-seek::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; }
.fp-times { display: flex; justify-content: space-between; color: rgba(255,255,255,.65); margin-top: 2px; font-variant-numeric: tabular-nums; }
.fp-ctrl { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.fp-btn { position: relative; background: none; border: 0; color: #fff; width: 60px; height: 60px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: .9; }
@media (hover: hover) { .fp-btn:hover { background: rgba(255,255,255,.1); opacity: 1; } }
.fp-btn:active { transform: scale(.94); }
.fp-btn.sm { width: 46px; height: 46px; }
.fp-btn.on { color: var(--accent); opacity: 1; }
.fp-one { position: absolute; font-size: 10px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.fp-play { width: 84px; height: 84px; border-radius: 50%; border: 0; background: #fff; color: #111; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.fp-play:active { transform: scale(.95); }
.fp-extra { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; gap: 10px; }
.fp-vol { flex: 1; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.8); max-width: 260px; }
.fp-vol input { flex: 1; accent-color: #fff; }
.fp-ten { position: absolute; font-size: 8px; font-weight: 800; top: 53%; left: 50%; transform: translate(-50%, -50%); }
@media (max-width: 820px) {
  .fplayer { padding-left: 18px; padding-right: 18px; }
  .fp-vol.hide-m { display: none; }
  .fp-title { font-size: 21px; }
  .fp-btn { width: 54px; height: 54px; }
  .fp-play { width: 76px; height: 76px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .fplayer { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto auto auto; column-gap: 28px; align-items: center; }
  .fp-top { grid-column: 1 / -1; max-width: none; }
  .fp-art { grid-row: 2 / 6; padding: 8px 0; }
  .fp-cover { width: min(40vw, 62vh); }
}
