/* «Волна» — тёмный музыкальный плеер */
:root {
  --bg: #121212;
  --bg-elev: #1e1e1e;
  --card: #1e1e1e;
  --card-2: #282828;
  --card-hover: #2f2f2f;
  --text: #ffffff;
  --text-2: #b3b3b3;
  --text-3: #7a7a7a;
  --accent: #1ed760;
  --accent-press: #1aa34a;
  --on-accent: #000000;
  --line: rgba(255, 255, 255, .08);
  --danger: #f15e6c;
  --radius: 8px;
  --radius-lg: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sat: max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --tabbar-h: 58px;
  --mini-h: 56px;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #f4f4f4;
  --card: #f2f2f2;
  --card-2: #e8e8e8;
  --card-hover: #e0e0e0;
  --text: #121212;
  --text-2: #5c5c5c;
  --text-3: #8e8e8e;
  --accent: #14b350;
  --accent-press: #108f40;
  --line: rgba(0, 0, 0, .08);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; }
.hidden { display: none !important; }

/* ---------- иконки ---------- */
svg.i { width: 24px; height: 24px; fill: currentColor; flex: none; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); transition: transform .15s var(--ease), color .15s; }
.icon-btn:active { transform: scale(.88); }
.icon-btn.big svg.i { width: 30px; height: 30px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.on::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin-top: 30px; }
.icon-btn { position: relative; }

/* ---------- раскладка ---------- */
#app { min-height: 100%; }
#views { padding-bottom: calc(var(--tabbar-h) + var(--sab) + 16px); }
body.has-mini #views { padding-bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--sab) + 24px); }
.view { min-height: 100vh; padding: calc(var(--sat) + 12px) 16px 0; animation: viewIn .28s var(--ease); }
.view.back-anim { animation: viewBack .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes viewBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.view.tab-anim { animation: fadeIn .22s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 14px; }
h2 { font-size: 21px; font-weight: 800; letter-spacing: -.015em; margin: 26px 0 12px; }

/* ---------- шапка главной ---------- */
.home-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 32px; padding: 0 14px; border-radius: 16px; background: var(--card-2); color: var(--text); font-size: 14px; white-space: nowrap; transition: background .2s, color .2s, transform .12s; }
.chip:active { transform: scale(.95); }
.chip.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* ---------- плитки 2×4 ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; align-items: center; gap: 0; height: 56px; background: var(--card-2); border-radius: 6px; overflow: hidden; text-align: left; transition: background .15s, transform .12s var(--ease); }
.tile:active { transform: scale(.97); background: var(--card-hover); }
.tile .cov { width: 56px; height: 56px; flex: none; }
.tile b { flex: 1; min-width: 0; padding: 0 10px; font-size: 13px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile.playing b { color: var(--accent); }

/* ---------- обложки ---------- */
.cov { background: var(--card-2) center/cover no-repeat; position: relative; overflow: hidden; }
.cov img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.cov img.ok { opacity: 1; }
.cov .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); }
.cov .ph svg.i { width: 40%; height: 40%; }
.cov.liked { background: linear-gradient(135deg, #0d7a6f, #1ed760 60%, #c8f560); }
.cov.liked .ph { color: #fff; }
.cov.mosaic { display: grid; grid-template-columns: 1fr 1fr; }
.cov.mosaic img { opacity: 1; }

/* ---------- карусели ---------- */
.carousel { display: flex; gap: 14px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.card { flex: none; width: 140px; scroll-snap-align: start; text-align: left; transition: transform .12s var(--ease); }
.card:active { transform: scale(.96); }
.card .cov { width: 140px; height: 140px; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.card .ct { margin-top: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cs { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.card.playing .ct { color: var(--accent); }

/* ---------- список треков ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 7px 0; text-align: left; width: 100%; border-radius: 6px; transition: background .15s; }
.row:active { background: var(--card); }
.row .cov { width: 48px; height: 48px; border-radius: 4px; flex: none; }
.row.round .cov { border-radius: 50%; }
.row .rm { flex: 1; min-width: 0; }
.row .rt { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .rs { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.row .rs svg.i { width: 14px; height: 14px; color: var(--accent); }
.row.playing .rt { color: var(--accent); }
.row .more { width: 36px; height: 36px; color: var(--text-2); }
.row .num { width: 22px; text-align: center; color: var(--text-2); font-size: 14px; flex: none; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
.paused .eq i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

/* ---------- поиск ---------- */
.searchbox { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: calc(var(--sat) + 8px) 16px 10px; margin: calc(-1 * (var(--sat) + 12px)) -16px 6px; }
.field { display: flex; align-items: center; gap: 10px; height: 46px; background: var(--text); color: #121212; border-radius: 8px; padding: 0 12px; }
html[data-theme="light"] .field { background: var(--card-2); color: var(--text); }
.field svg.i { color: #555; }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: inherit; height: 100%; }
.field button { color: #555; }
.empty { text-align: center; color: var(--text-2); padding: 48px 20px; }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

/* ---------- кнопки ---------- */
.btn { height: 44px; padding: 0 22px; border-radius: 22px; background: var(--accent); color: var(--on-accent); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; justify-content: center; transition: transform .12s var(--ease), background .15s; }
.btn:active { transform: scale(.96); background: var(--accent-press); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--text-3); }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .5; }

/* ---------- заголовок плейлиста ---------- */
.topbar { display: flex; align-items: center; gap: 8px; margin: -4px -8px 4px; min-height: 40px; }
.topbar .icon-btn { color: var(--text); }
.pl-head { display: flex; flex-direction: column; align-items: center; padding: 6px 0 14px; position: relative; }
.pl-head::before { content: ""; position: absolute; inset: -200px -16px -20px; background: linear-gradient(to bottom, var(--hero, #2a4a3a), transparent); opacity: .55; z-index: -1; pointer-events: none; }
.pl-head .cov { width: 200px; height: 200px; border-radius: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.pl-title { align-self: stretch; font-size: 24px; font-weight: 800; margin: 18px 0 4px; letter-spacing: -.015em; }
.pl-sub { align-self: stretch; color: var(--text-2); font-size: 13px; }
.pl-actions { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; }
.pl-actions .spacer { flex: 1; }
.fab { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transition: transform .12s var(--ease); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.fab:active { transform: scale(.92); }
.fab svg.i { width: 28px; height: 28px; }

/* ---------- медиатека ---------- */
.lib-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.lib-head h1 { margin: 0; flex: 1; font-size: 24px; }
.lib-head .icon-btn { color: var(--text); }
.sortbar { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: 13px; margin: 12px 0 4px; }
.sortbar button { display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-size: 13px; font-weight: 600; }

/* ---------- добавление ---------- */
.add-hint { color: var(--text-2); font-size: 14px; margin: -6px 0 14px; }
.add-form { display: flex; gap: 8px; }
.add-form .field { flex: 1; }
.add-form .btn { height: 46px; border-radius: 8px; padding: 0 16px; }
.job { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border-radius: 10px; margin-bottom: 8px; animation: fadeIn .25s var(--ease); }
.job .jm { flex: 1; min-width: 0; }
.job .jt { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job .js { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.job .js.err { color: var(--danger); white-space: pre-line; }
.job .bar { height: 3px; background: var(--card-2); border-radius: 2px; margin-top: 7px; overflow: hidden; }
.job .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.job .bar.indet i { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.job .st { width: 28px; height: 28px; display: grid; place-items: center; color: var(--accent); }
.job .st.err { color: var(--danger); }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--card-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result .btn { flex: none; }
.result .cov { width: 64px; height: 48px; }

/* ---------- мини-плеер ---------- */
.mini {
  position: fixed; left: 8px; right: 8px; z-index: 20;
  bottom: calc(var(--tabbar-h) + var(--sab) + 4px);
  height: var(--mini-h); display: flex; align-items: center; gap: 2px; padding: 0 4px 0 8px;
  background: var(--mini-bg, #3a3a3a); border-radius: 8px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  transition: background .6s, transform .3s var(--ease), opacity .3s;
  animation: miniIn .35s var(--ease);
}
@keyframes miniIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.mini-hit { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.mini-hit:active { opacity: .85; }
.mini-btn { width: 44px; height: 44px; flex: none; }
.mini-cover { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: var(--card-2); flex: none; }
.mini-meta { flex: 1; min-width: 0; }
.mini-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.mini-artist { font-size: 12px; color: rgba(255, 255, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .icon-btn { color: #fff; }
.mini .icon-btn.on { color: var(--accent); }
.mini .icon-btn.on::after { display: none; }
.mini-progress { position: absolute; left: 8px; right: 8px; bottom: 0; height: 2px; background: rgba(255, 255, 255, .2); border-radius: 1px; overflow: hidden; }
.mini-progress i { display: block; height: 100%; width: 0; background: #fff; }

/* ---------- нижняя навигация ---------- */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 19;
  height: calc(var(--tabbar-h) + var(--sab)); padding-bottom: var(--sab);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: linear-gradient(to top, var(--bg) 55%, color-mix(in srgb, var(--bg) 0%, transparent));
}
#tabbar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(0,0,0,.6), transparent); pointer-events: none; }
html[data-theme="light"] #tabbar::before { background: none; }
#tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--text-2); transition: color .15s; }
#tabbar button.active { color: var(--text); }
#tabbar button:active .ti { transform: scale(.85); }
#tabbar .ti { display: grid; transition: transform .15s var(--ease); }
#tabbar .ti svg.i { width: 26px; height: 26px; }

/* ---------- полноэкранный плеер ---------- */
.player {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  transform: translateY(100%); transition: transform .38s var(--ease); visibility: hidden;
  color: #fff;
}
.player.open { transform: none; visibility: visible; }
.player.dragging { transition: none; }
.player-bg { position: absolute; inset: 0; background: linear-gradient(to bottom, var(--pbg, #3a3a3a) 0%, #121212 85%); transition: background .8s; }
.player-inner { position: relative; height: 100%; display: flex; flex-direction: column; padding: calc(var(--sat) + 8px) 24px calc(var(--sab) + 16px); max-width: 520px; margin: 0 auto; }
.player-head { display: flex; align-items: center; justify-content: space-between; }
.player-head .icon-btn { color: #fff; }
.player-src { text-align: center; min-width: 0; flex: 1; }
.player-src small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.player-src b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-art { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 20px 0; }
.player-art img { width: 100%; max-width: min(100%, 52vh); aspect-ratio: 1; object-fit: cover; border-radius: 8px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); background: #282828; transition: transform .35s var(--ease); }
.player.paused .player-art img { transform: scale(.94); }
.player-meta { display: flex; align-items: center; gap: 12px; }
.pm-text { flex: 1; min-width: 0; }
.player-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 15px; color: rgba(255, 255, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.player-meta .icon-btn { color: rgba(255, 255, 255, .85); }
.player-meta .icon-btn.on { color: var(--accent); }
.player-meta .icon-btn.on::after { display: none; }
.seek { margin-top: 18px; }
.seek input { width: 100%; height: 20px; margin: 0; -webkit-appearance: none; appearance: none; background: transparent; --p: 0%; }
.seek input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, #fff var(--p), rgba(255, 255, 255, .25) var(--p)); }
.seek input::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; margin-top: -4.5px; border: 0; }
.seek input::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.seek input::-moz-range-progress { height: 4px; border-radius: 2px; background: #fff; }
.seek input::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }
.seek-times { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255, 255, 255, .65); margin-top: 4px; font-variant-numeric: tabular-nums; }
.controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.controls .icon-btn { color: #fff; width: 48px; height: 48px; }
.controls .icon-btn.big svg.i { width: 36px; height: 36px; }
.controls .icon-btn[data-act="shuffle"], .controls .icon-btn[data-act="repeat"] { color: rgba(255, 255, 255, .8); }
.controls .icon-btn.on { color: var(--accent) !important; }
.play-btn { width: 68px; height: 68px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; transition: transform .12s var(--ease); }
.play-btn:active { transform: scale(.92); }
.play-btn svg.i { width: 34px; height: 34px; }
.player-foot { display: flex; justify-content: space-between; margin-top: 18px; }
.player-foot .icon-btn { color: rgba(255, 255, 255, .8); }
.badge-one { position: absolute; font-size: 8px; font-weight: 800; top: 9px; right: 10px; }

/* ---------- нижний лист ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto;
  background: var(--bg-elev); border-radius: 14px 14px 0 0; padding: 6px 16px calc(var(--sab) + 16px);
  animation: sheetIn .32s var(--ease); max-width: 640px; margin: 0 auto;
}
.sheet.closing .sheet-panel { animation: sheetOut .22s var(--ease) forwards; }
.sheet.closing .sheet-backdrop { animation: fade .22s reverse forwards; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--text-3); margin: 4px auto 10px; opacity: .6; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-head .cov { width: 48px; height: 48px; border-radius: 4px; }
.sheet-head .rt { font-weight: 700; }
.sheet-head .rs { color: var(--text-2); font-size: 13px; }
.sheet-title { font-weight: 800; font-size: 18px; margin: 4px 0 10px; }
.act { display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 2px; text-align: left; font-size: 16px; border-radius: 6px; }
.act:active { background: var(--card-2); }
.act svg.i { color: var(--text-2); }
.act.danger, .act.danger svg.i { color: var(--danger); }
.act.on svg.i { color: var(--accent); }
.sheet .field { margin: 6px 0 14px; }
.sheet-btns { display: flex; gap: 10px; justify-content: flex-end; }
.q-label { font-size: 13px; color: var(--text-2); font-weight: 700; margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; z-index: 80; bottom: calc(var(--tabbar-h) + var(--mini-h) + var(--sab) + 18px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 8px; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- экран входа ---------- */
.gate { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; gap: 10px; }
.gate img { width: 88px; height: 88px; margin-bottom: 10px; }
.gate h1 { margin: 0; }
.gate p { color: var(--text-2); margin: 0; max-width: 320px; }

/* скелетоны */
.sk { background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }

@media (min-width: 700px) {
  .view { max-width: 900px; margin: 0 auto; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .card, .card .cov { width: 170px; }
  .card .cov { height: 170px; }
}
@media (hover: hover) {
  .tile:hover, .row:hover { background: var(--card-hover); }
  .row:hover { background: var(--card); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- v4: аккаунт, поиск по источникам, выбор, загрузка ---------- */
.avatar { position: relative; overflow: hidden; padding: 0; border: 0; cursor: pointer; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.account { display: flex; align-items: center; gap: 14px; padding: 6px 0 14px; }
.acc-name { font-size: 18px; font-weight: 800; }
.acc-name small { font-weight: 500; color: var(--text-2); font-size: 14px; }
.quota { padding: 4px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.qbar { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.qbar i { display: block; height: 100%; background: var(--accent); }
.hint { color: var(--text-2); font-size: 13px; }
p.hint { margin: 8px 0; }
h2.sec { display: flex; align-items: baseline; gap: 8px; }
h2.sec small { font-size: 13px; color: var(--text-2); font-weight: 600; }
.src-chips { margin: 0 -16px 8px; padding: 0 16px; }
.src-chips .chip { height: 30px; font-size: 13px; }
.web-status { min-height: 18px; margin: 2px 0 6px; }
.rs .src { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 1px 5px; border-radius: 4px; background: var(--card-2); color: var(--text-2); text-transform: uppercase; }
.rs .tag { flex: none; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.rs .hrt { display: inline-flex; }
.rs > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.web-row .cov { border-radius: 4px; }
.web-row .icon-btn { width: 40px; height: 40px; color: var(--text); flex: none; }
.web-row .add { color: var(--accent); }
.web-row .add.done { color: var(--accent); }
.web-row .add.dis { opacity: .35; }
.web-row .spin { width: 18px; height: 18px; }
.upload-tile { display: flex; align-items: center; gap: 14px; width: 100%; margin: 14px 0 4px; padding: 14px; text-align: left; border-radius: 10px; background: var(--card); transition: background .15s, transform .12s var(--ease); }
.upload-tile:active { transform: scale(.98); background: var(--card-2); }
.upload-tile svg.i { width: 30px; height: 30px; color: var(--accent); }
.upload-tile b { display: block; }
.upload-tile small { color: var(--text-2); font-size: 12px; }
.sortbar .up { color: var(--accent); }
.cov.own { background: linear-gradient(135deg, #3a1c71, #d76d77 55%, #ffaf7b); }
.cov.own .ph { color: #fff; }
.player-badge { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.15); color: #fff; }
.player-foot .icon-btn.hidden { display: none; }
.seek input:disabled { opacity: .5; }
.check { width: 24px; height: 24px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--text-3); display: grid; place-items: center; color: transparent; transition: background .15s, box-shadow .15s; }
.check svg.i { width: 16px; height: 16px; }
.check.on { background: var(--accent); box-shadow: none; color: var(--on-accent); }
.selbar {
  position: fixed; left: 8px; right: 8px; z-index: 25; bottom: calc(var(--tabbar-h) + var(--sab) + 4px);
  height: var(--mini-h); display: flex; align-items: center; gap: 8px; padding: 0 8px;
  background: var(--card-2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.45); animation: miniIn .3s var(--ease);
}
.selbar .spacer { flex: 1; }
.selbar .icon-btn { color: var(--text); }
body.selecting #mini { visibility: hidden; }

/* ---------- v5: лимиты и админ-раздел ---------- */
.limits { padding: 2px 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.limits .quota { border: 0; padding: 6px 0; margin: 0; }
.qrow { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.qrow span:last-child { color: var(--text-2); font-variant-numeric: tabular-nums; }
.qbar.warn i { background: #f5a524; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.stat-grid > div { background: var(--card); border-radius: 10px; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.stat-grid b { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-grid span { font-size: 11px; color: var(--text-2); line-height: 1.2; }
.mode-desc { margin: 6px 0 10px; }
.users .avatar { width: 40px; height: 40px; flex: none; }
.users .rt small { font-weight: 400; }
.rs .tag.ban { background: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--danger); }
@media (max-width: 360px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

.gate-btns { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; margin: 14px 0 6px; }
.gate-btns .btn { width: 100%; text-decoration: none; }
.gate .hint { max-width: 320px; }
