/* ============================================================
   MVKVN Discord Admin — iOS/macOS Settings style (desktop-first).
   Дизайн-система перенесена из TG-админки MVKVN (admin.css),
   адаптирована под ПК: sidebar + main + compact media-bar.
   Тёмная тема по умолчанию, светлая — [data-theme="light"].
   ============================================================ */
:root {
    --bg:        #000000;
    --bg-2:      #1c1c1e;
    --bg-3:      #2c2c2e;
    --sep:       rgba(255,255,255,.10);
    --text:      #ffffff;
    --text-2:    #ebebf5;
    --text-3:    rgba(235,235,245,.6);
    --text-4:    rgba(235,235,245,.3);
    --accent:    #0a84ff;
    --green:     #30d158;
    --red:       #ff453a;
    --orange:    #ff9f0a;
    --yellow:    #ffd60a;
    --r:         12px;
    --row-h:     46px;
    --pad:       16px;
    --hdr-h:     52px;
    --sbw:       260px;          /* ширина сайдбара */
    --bph:       88px;           /* высота нижнего плеера */
    --safe-b:    env(safe-area-inset-bottom, 0px);
    --ico-blue:  #0a84ff; --ico-green:#30d158; --ico-red:#ff453a;
    --ico-orange:#ff9f0a; --ico-purple:#bf5af2; --ico-teal:#40c8e0;
    --ico-pink:#ff375f; --ico-gray:#8e8e93; --ico-indigo:#5e5ce6;
}
[data-theme="light"] {
    --bg:        #f2f2f7;
    --bg-2:      #ffffff;
    --bg-3:      #e5e5ea;
    --sep:       rgba(60,60,67,.13);
    --text:      #000000;
    --text-2:    #1c1c1e;
    --text-3:    rgba(60,60,67,.6);
    --text-4:    rgba(60,60,67,.3);
    --accent:    #007aff;
    --green:     #34c759; --red:#ff3b30; --orange:#ff9500; --yellow:#ffcc00;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html, body {
    margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text);
    font: 15px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text",
          system-ui, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* ── App shell: sidebar + main ─────────────────────────────── */
.app-shell { display: grid; grid-template-columns: var(--sbw) 1fr; height: 100vh; }

.sidebar {
    background: var(--bg); border-right: .5px solid var(--sep);
    display: flex; flex-direction: column; min-height: 0; z-index: 40;
}
.sidebar-brand { padding: 18px 16px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.sb-brand-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sb-collapse { background: none; border: 0; color: #fff; font-size: 20px; line-height: 1; padding: 2px 4px;
    cursor: pointer; opacity: .85; flex-shrink: 0; }
.sb-collapse:hover { opacity: 1; }
.sidebar-brand .b1 { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.sidebar-brand .b2 { font-size: 12px; color: var(--text-3); }
.sidebar-search { margin: 0 12px 8px; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-item {
    display: flex; align-items: center; gap: 11px; width: 100%;
    background: none; border: 0; text-align: left; color: var(--text);
    padding: 8px 10px; border-radius: 9px; min-height: 40px; transition: background .12s;
}
.sidebar-item:hover { background: var(--bg-2); }
.sidebar-item.active { background: var(--bg-3); }
.sidebar-item.active .row-title { color: var(--accent); font-weight: 600; }
.sidebar-item .row-ico { width: 26px; height: 26px; font-size: 15px; border-radius: 6px; }
.sidebar-user {
    border-top: .5px solid var(--sep); padding: 12px; display: flex;
    flex-direction: column; gap: 8px;
}
.sidebar-user .su-row { display: flex; align-items: center; gap: 8px; }
.sidebar-user .su-name { font-weight: 600; font-size: 14px; }

/* ── Main: topbar + page ───────────────────────────────────── */
.main-shell { display: flex; flex-direction: column; min-width: 0; height: 100vh; position: relative; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 24px 8px; flex-shrink: 0;
}
.topbar .t-left { min-width: 0; }
.topbar .t-title { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.topbar .t-meta { font-size: 13px; color: var(--text-3); margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .t-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-4); }
.online-dot.ok { background: var(--green); }
.online-dot.bad { background: var(--red); }
.icon-btn { background: var(--bg-2); border: 0; color: var(--accent); width: 36px; height: 36px;
    border-radius: 9px; font-size: 16px; display: grid; place-items: center; }
.burger { display: none; }

.page { max-width: 1100px; width: 100%; margin: 0 auto; padding: 6px 8px calc(var(--bph) + 28px);
    overflow-y: auto; flex: 1; min-height: 0; }
.page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-items: start; }
.intro { color: var(--text-3); font-size: 13px; line-height: 1.4; padding: 6px 16px 10px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page > * { animation: fadeIn .18s ease; }

/* ── Group (iOS grouped card) ──────────────────────────────── */
.group { margin: 18px 16px 0; }
.group.tight { margin-top: 8px; }
.group-hdr { color: var(--text-3); font-size: 13px; font-weight: 400;
    text-transform: uppercase; letter-spacing: .3px; padding: 0 4px 7px; }
.group-body { background: var(--bg-2); border-radius: var(--r); overflow: hidden; }
.group-ftr { color: var(--text-3); font-size: 13px; padding: 7px 4px 0; }

/* ── Row ───────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 12px; min-height: var(--row-h);
    padding: 8px 16px 8px 14px; position: relative; background: var(--bg-2); }
.group-body > * { position: relative; }
.group-body > * + *::before { content: ""; position: absolute; left: 52px; right: 0; top: 0;
    height: .5px; background: var(--sep); pointer-events: none; z-index: 1; }
.row.tap { transition: background .12s; }
.row.tap:hover { background: var(--bg-3); }
.row-ico { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 17px; color: #fff; background: var(--ico-gray); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 15px; color: var(--text); }
.row-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.row-val { color: var(--text-3); font-size: 15px; max-width: 52%; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.row-chev { color: var(--text-4); flex-shrink: 0; font-size: 16px; }
.row.danger .row-title { color: var(--red); }
.row.center { justify-content: center; }
.row.center .row-title { color: var(--accent); font-weight: 500; }
.row.center.danger .row-title { color: var(--red); }
.row[disabled], .row.is-disabled { opacity: .45; pointer-events: none; }

/* ── Toggle (iOS switch) ───────────────────────────────────── */
.sw { width: 51px; height: 31px; border-radius: 999px; flex-shrink: 0; background: var(--bg-3);
    position: relative; transition: background .2s; border: 0; padding: 0; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.sw.on { background: var(--green); }
.sw.on::after { transform: translateX(20px); }

/* ── Slider ────────────────────────────────────────────────── */
.slider-row { display: block; padding: 12px 16px 14px 14px; min-height: 44px; }
.slider-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.slider-val { color: var(--text); font-variant-numeric: tabular-nums; font-size: 15px; }
input[type=range].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
    border-radius: 2px; background: var(--bg-3); outline: none; margin: 6px 0 2px; }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; }
input[type=range].slider::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; }
input[type=range].slider:disabled { opacity: .55; }

/* ── Segmented control ─────────────────────────────────────── */
.seg-row { padding: 10px 16px 12px; }
.seg-row .row-title { margin-bottom: 8px; }
.seg { display: flex; background: var(--bg-3); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; color: var(--text-2); padding: 8px 4px;
    border-radius: 7px; font-size: 13px; min-height: 36px; transition: background .15s; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }

/* ── Badges / chips ────────────────────────────────────────── */
.scope { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .4px; padding: 2px 6px; border-radius: 5px; margin-left: 6px; vertical-align: middle; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.badge.owner { background: rgba(255,214,10,.2); color: var(--yellow); }
.badge.admin, .badge.full { background: rgba(48,209,88,.2); color: var(--green); }
.badge.viewer, .badge.limited { background: rgba(10,132,255,.2); color: #4aa3ff; }
.badge.view { background: rgba(142,142,147,.25); color: #aeaeb2; }
.badge.off { background: rgba(255,69,58,.2); color: var(--red); }
.badge.on { background: rgba(48,209,88,.2); color: var(--green); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; background: var(--bg-3);
    color: var(--text-2); border: 0; padding: 4px 10px; border-radius: 999px; }

/* ── Status cards ──────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 16px 0; }
.stat-card { background: var(--bg-2); border-radius: var(--r); padding: 12px 14px; display: flex;
    flex-direction: column; justify-content: space-between; min-height: 84px; min-width: 0; }
.stat-card .lbl { color: var(--text-3); font-size: 12px; }
.stat-card .val { font-size: 34px; font-weight: 700; margin-top: 8px; letter-spacing: -.5px;
    font-variant-numeric: tabular-nums; line-height: 1.05; white-space: nowrap; overflow: hidden; }
.stat-card .val.ok { color: var(--green); }
.stat-card .val.warn { color: var(--orange); }
.stat-card .val.bad { color: var(--red); }
.warn-card { display: flex; gap: 10px; align-items: center; margin: 14px 16px 0;
    background: rgba(255,159,10,.14); border: .5px solid rgba(255,159,10,.4); border-radius: var(--r);
    padding: 11px 14px; color: var(--orange); font-size: 14px; }

/* ── Search ────────────────────────────────────────────────── */
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--bg-2);
    border-radius: 10px; padding: 8px 12px; }
.search-ico { opacity: .5; font-size: 14px; line-height: 1; }
.search-input { flex: 1; background: none; border: 0; color: var(--text); font-size: 15px; outline: none; min-width: 0; }
.search-input::placeholder { color: var(--text-3); }

/* ── Inputs / buttons ──────────────────────────────────────── */
.row input.inp, .row .qadd { background: var(--bg-3); border: 0; border-radius: 8px; color: var(--text);
    padding: 8px 10px; font-size: 15px; outline: none; }
.row input.inp { width: 130px; text-align: right; }
.row .qadd { flex: 1; min-width: 0; text-align: left; }
.numf { background: var(--bg-3); border: 0; border-radius: 8px; color: var(--text); padding: 7px 8px;
    font-size: 15px; text-align: center; width: 84px; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 9px; padding: 8px 14px;
    font-size: 15px; font-weight: 600; min-height: 38px; }
.btn.ghost { background: var(--bg-3); color: var(--accent); }
.btn.red { background: var(--red); }
.btn.sm { padding: 6px 10px; font-size: 13px; min-height: 32px; }
.btn:disabled { opacity: .5; }

/* ── Bottom sheet / confirm ────────────────────────────────── */
.sheet-back { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5);
    display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.sheet-back.show { opacity: 1; }
.sheet { background: var(--bg-2); width: 100%; max-width: 520px; border-radius: 16px 16px 0 0;
    padding: 20px 18px; padding-bottom: calc(18px + var(--safe-b)); transform: translateY(100%); transition: transform .25s ease; }
.sheet-back.show .sheet { transform: translateY(0); }
.sheet-title { font-size: 18px; font-weight: 700; text-align: center; }
.sheet-body { color: var(--text-3); font-size: 14px; text-align: center; margin: 10px 0 0; line-height: 1.4; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.sheet-actions .btn { width: 100%; min-height: 48px; font-size: 17px; }
.field { width: 100%; background: var(--bg-3); border: 0; border-radius: 10px; color: var(--text);
    font-size: 16px; padding: 13px 14px; outline: none; }
.field::placeholder { color: var(--text-3); }
.field-lbl { font-size: 12px; color: var(--text-3); margin: 0 0 4px 2px; }
.field-group { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; }
.sheet-list { max-height: 50vh; overflow-y: auto; margin: 6px -4px 0; }
.sheet-opt { display: flex; align-items: center; gap: 10px; padding: 12px 8px; border-radius: 8px;
    border-bottom: .5px solid var(--sep); }
.sheet-opt:hover { background: var(--bg-3); }
.sheet-opt .check { color: var(--accent); width: 22px; }
/* Desktop: шит = centered modal (на мобиле — bottom-sheet) */
@media (min-width: 760px) {
    .sheet-back { align-items: center; }
    .sheet { border-radius: 16px; transform: translateY(16px) scale(.98); }
    .sheet-back.show .sheet { transform: none; }
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(var(--bph) + 22px);
    transform: translateX(-50%) translateY(20px); background: rgba(40,40,42,.96); color: #fff;
    padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 200; opacity: 0;
    pointer-events: none; transition: opacity .2s, transform .2s; max-width: 84%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── States ────────────────────────────────────────────────── */
.state { text-align: center; color: var(--text-3); padding: 56px 24px; }
.state .em { font-size: 34px; margin-bottom: 10px; }
.state .st-title { color: var(--text-2); font-weight: 600; margin-bottom: 4px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--bg-3); border-top-color: var(--accent);
    border-radius: 50%; animation: spin .8s linear infinite; margin: 56px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--bg-3), var(--bg-2)); background-size: 200% 100%;
    animation: shimmer 1.2s infinite; border-radius: var(--r); height: 54px; margin: 12px 16px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Log box ───────────────────────────────────────────────── */
.log-box { white-space: pre-wrap; word-break: break-word; padding: 12px 14px;
    font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2);
    max-height: 56vh; overflow-y: auto; }
.log-box .err { color: #ff8f87; }
.log-box .warn { color: #ffd479; }

/* ── Voice avatar ──────────────────────────────────────────── */
.voice-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; background: var(--ico-gray) center/cover;
    display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 600; }

/* ── Player media card ─────────────────────────────────────── */
.media-card { display: flex; gap: 16px; padding: 16px; background: var(--bg-2); align-items: center; flex-wrap: wrap; }
.media-cover { width: 132px; height: 132px; border-radius: 12px; flex-shrink: 0; background: var(--bg-3) center/cover;
    display: grid; place-items: center; color: var(--text-4); font-size: 40px; }
.media-info { flex: 1; min-width: 200px; }
.media-info .mt { font-size: 20px; font-weight: 700; line-height: 1.2; }
.media-meta { color: var(--text-3); font-size: 13px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.source-badge { padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: lowercase;
    background: rgba(10,132,255,.18); color: #4aa3ff; }
.seek { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.seek .tt { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 40px; }
.seek .tt.r { text-align: right; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
.ctl-row .btn { background: var(--bg-3); color: var(--text); }
.ctl-row .btn.accent { background: var(--accent); color: #fff; }
.ctl-row .btn.red { background: rgba(255,69,58,.16); color: var(--red); }

/* ── Bottom player (compact media bar) ─────────────────────── */
.bottom-player { position: fixed; left: var(--sbw); right: 0; bottom: 0; height: var(--bph); z-index: 30;
    background: color-mix(in srgb, var(--bg-2) 88%, transparent); backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep);
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; padding: 0 20px; }
.bp-track { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bp-cover { width: 52px; height: 52px; border-radius: 9px; flex-shrink: 0; background: var(--bg-3) center/cover;
    display: grid; place-items: center; color: var(--text-4); }
.bp-meta { min-width: 0; }
.bp-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.bp-ctl { display: flex; align-items: center; gap: 6px; justify-self: center; }
.bp-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg-3); color: var(--text);
    font-size: 15px; display: grid; place-items: center; }
.bp-btn.main { width: 44px; height: 44px; background: var(--accent); color: #fff; font-size: 17px; }
.bp-right { display: flex; align-items: center; gap: 12px; justify-self: end; color: var(--text-3); font-size: 13px; }
.bp-vol { width: 120px; }
.bp-seek { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--bg-3); touch-action: none; }
.bp-seek.tap { cursor: pointer; }
.bp-seek.tap:hover { height: 7px; }
.bp-seek > span { display: block; height: 100%; background: var(--accent); width: 0; pointer-events: none; }

/* ── Login ─────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .l1 { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.login-logo .l2 { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* ── Responsive (mobile fallback ≤760px) ───────────────────── */
@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 250px; transform: translateX(-100%);
        transition: transform .25s; }
    .app-shell.nav-open .sidebar { transform: none; }
    .app-shell.nav-open .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.5); }
    .burger { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
        border: 0; background: var(--bg-2); color: var(--text); font-size: 17px; }
    .topbar { padding: 14px 16px 8px; }
    .topbar .t-title { font-size: 23px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .page-grid { grid-template-columns: 1fr; }
    .bottom-player { left: 0; }
}

/* ── Bottom player extras (Spotify-style) ──────────────────── */
.bp-track.tap { cursor: pointer; }
.bp-ctl { gap: 8px; }
.bp-btn.act { color: var(--accent); }
.bp-btn.ghost-btn { background: none; font-size: 16px; }
.vol-val { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.bp-q { font-size: 13px; white-space: nowrap; }

/* ── Sidebar: подразделы + сворачивание ────────────────────── */
.nav-section { color: var(--text-4); font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; padding: 14px 14px 4px; }
.sidebar-nav > .nav-section:first-child { padding-top: 4px; }
.app-shell { transition: grid-template-columns .3s cubic-bezier(.3,.7,.7,.3); }
.sidebar { transition: transform .3s cubic-bezier(.3,.7,.7,.3); }
.app-shell.nav-collapsed { grid-template-columns: 0 1fr; }
.app-shell.nav-collapsed .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--sbw);
    transform: translateX(-100%); overflow: hidden; }
.app-shell.nav-collapsed .main-shell { grid-column: 2; }   /* держим контент во 2-й колонке, не уезжает в нулевую */
.app-shell.nav-collapsed .bottom-player { left: 0; }
.app-shell.nav-collapsed .burger { display: grid; place-items: center; width: 36px; height: 36px;
    border-radius: 9px; border: 0; background: var(--bg-2); color: var(--text); font-size: 17px; }

/* ── Player page: настоящие медиа-кнопки ───────────────────── */
.player-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 16px 4px; }
.pc-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--bg-2); color: var(--text);
    font-size: 20px; display: grid; place-items: center; transition: transform .1s, background .15s; }
.pc-btn:hover { background: var(--bg-3); transform: scale(1.07); }
.pc-btn:active { transform: scale(.94); }
.pc-btn.main { width: 64px; height: 64px; background: var(--accent); color: #fff; font-size: 24px; }

/* ── Bottom player: уезжает вниз на странице «Плеер» ───────── */
.bottom-player { transition: transform .45s cubic-bezier(.3,.7,.7,.3), left .3s cubic-bezier(.3,.7,.7,.3); }
.bottom-player.tucked { transform: translateY(130%); }

@media (max-width: 760px) {
    #collapse-btn { display: none; }   /* на мобиле — бургер, кнопка сворачивания не нужна */
}

/* ── Dashboard tiles (Win8/Metro: два вертикальных окошка) ──── */
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 18px 16px 0; align-items: stretch; }
.dash-tiles.single { grid-template-columns: 1fr; }
.dash-tile { background: var(--bg-2); border-radius: 8px; padding: 16px 16px 18px; display: flex; flex-direction: column; min-width: 0; }
.tile-hdr { color: var(--text-3); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }

.tile-player { align-items: center; text-align: center; }
.pt-cover { width: 124px; height: 124px; border-radius: 10px; flex-shrink: 0; background: var(--bg-3) center/cover; cursor: pointer;
    display: grid; place-items: center; color: var(--text-4); font-size: 42px; transition: transform .12s; }
.pt-cover:hover { transform: scale(1.04); }
.pt-title { font-weight: 700; font-size: 15px; margin-top: 12px; line-height: 1.25; max-width: 100%; overflow: hidden;
    text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pt-sub { color: var(--text-3); font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pt-ctl { display: flex; gap: 10px; margin-top: auto; padding-top: 16px; }

.tile-voice { align-items: center; text-align: center; }
.vt-rows { display: flex; flex-direction: column; justify-content: center; gap: 20px; width: 100%; flex: 1; }
.vt-row { display: flex; justify-content: center; gap: 22px; }
.pc-btn.sm { width: 40px; height: 40px; font-size: 15px; }
.pc-btn.sm.main { width: 46px; height: 46px; font-size: 17px; }

/* ── Очередь: кнопки действий (играть · выше · ниже · убрать) ── */
.q-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.qbtn { width: 28px; height: 28px; border-radius: 7px; border: 0; background: var(--bg-3); color: var(--text-2);
    font-size: 13px; line-height: 1; display: grid; place-items: center; cursor: pointer; transition: background .12s, transform .08s; }
.qbtn:hover { background: var(--accent); color: #fff; }
.qbtn:active { transform: scale(.88); }
.qbtn.main { background: var(--accent); color: #fff; }
.qbtn.main:hover { filter: brightness(1.12); }
.qbtn.danger:hover { background: var(--red); color: #fff; }
.qbtn.off { opacity: .28; pointer-events: none; }
.qgrip { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; flex-shrink: 0;
    color: var(--text-4); font-size: 16px; cursor: grab; touch-action: none; user-select: none; }
.qgrip:hover { color: var(--text-2); }
.qgrip:active { cursor: grabbing; }
.qrow { transition: transform .16s cubic-bezier(.2,.7,.4,1); }
.qrow.qdrag { transition: none; position: relative; z-index: 6; background: var(--bg-3); border-radius: 9px;
    box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.group-body.sorting { overflow: visible; }
.group-body.sorting > * + *::before { opacity: 0; }   /* разделители не мельтешат при перетаскивании */

/* ── Плеер: громкость и повтор в стиле кнопок управления (не карточки-настройки) ── */
.player-volume { display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 14px auto 4px; max-width: 420px; padding: 9px 18px; background: var(--bg-2); border-radius: 999px; }
.player-volume input.slider { flex: 1; width: auto; min-width: 0; }
.pv-ico { font-size: 16px; line-height: 1; flex-shrink: 0; }
.pv-val { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; flex-shrink: 0; }
.player-loop { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 12px 16px 6px; flex-wrap: wrap; }
.pl-ico { font-size: 16px; opacity: .65; margin-right: 2px; }
.lpbtn { padding: 9px 18px; border-radius: 999px; border: 0; background: var(--bg-2); color: var(--text-2);
    font-size: 14px; font-weight: 600; cursor: pointer; transition: background .12s, color .12s, transform .1s; }
.lpbtn:hover { background: var(--bg-3); }
.lpbtn:active { transform: scale(.95); }
.lpbtn.on { background: var(--accent); color: #fff; }

.vw-member { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 132px; }
.vw-ava { width: 116px; height: 116px; border-radius: 50%; flex-shrink: 0; background: var(--ico-gray) center/cover;
    display: grid; place-items: center; color: #fff; font-size: 38px; font-weight: 600; box-shadow: 0 0 0 3px transparent; }
.vw-ava.bot { box-shadow: 0 0 0 3px var(--accent); }
.vw-ava.muted { opacity: .55; }
.vw-name { font-size: 13px; max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.vw-time { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ── Dashboard: геро «сейчас играет» ───────────────────────── */
.hero { position: relative; margin: 16px 16px 0; border-radius: 16px; overflow: hidden; color: #fff;
    display: flex; gap: 22px; padding: 22px; align-items: center; min-height: 172px; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; background: center/cover;
    filter: blur(44px) saturate(1.5) brightness(.55); transform: scale(1.25); opacity: .6; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(115deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.28) 55%, rgba(0,0,0,.5) 100%); }
.hero.idle { color: var(--text); background: var(--bg-2); min-height: 128px; }
.hero.idle::after { display: none; }
.hero-cover { width: 132px; height: 132px; border-radius: 14px; flex-shrink: 0; background: var(--bg-3) center/cover;
    display: grid; place-items: center; font-size: 46px; color: rgba(255,255,255,.5); box-shadow: 0 14px 36px rgba(0,0,0,.55); }
.hero.idle .hero-cover { box-shadow: none; opacity: .6; color: var(--text-4); }
.hero-cover.tap { cursor: pointer; transition: transform .2s; }
.hero-cover.tap:hover { transform: scale(1.04); }
.hero-body { flex: 1; min-width: 0; }
.hero-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; opacity: .85; }
.hero-title { font-size: 27px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; margin-top: 7px;
    overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hero-sub { font-size: 14px; opacity: .82; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-seek { display: flex; align-items: center; gap: 11px; margin-top: 17px; }
.hero-time { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.hero-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.2); overflow: hidden; }
.hero.idle .hero-bar { background: var(--bg-3); }
.hero-fill { display: block; height: 100%; border-radius: 3px; background: #fff; transition: width .25s linear; }
.hero-bar.seekable { cursor: pointer; touch-action: none; transition: height .12s; }
.hero-bar.seekable:hover { height: 9px; }
.hero-bar.seekable .hero-fill { transition: none; }   /* перемотка должна следовать за пальцем мгновенно */
.hero-ctl { display: flex; align-items: center; gap: 11px; margin-top: 17px; }
.hero-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff;
    font-size: 16px; display: grid; place-items: center; transition: background .15s, transform .1s; }
.hero-btn:hover { background: rgba(255,255,255,.3); }
.hero-btn:active { transform: scale(.9); }
.hero-btn.main { width: 50px; height: 50px; background: #fff; color: #000; font-size: 19px; }
.hero-btn.main:hover { background: rgba(255,255,255,.85); }
.hero-btn.ghost { background: rgba(255,255,255,.08); }
.hero-cta { border: 0; border-radius: 999px; padding: 11px 20px; background: var(--accent); color: #fff; font-weight: 600;
    font-size: 14px; cursor: pointer; transition: filter .15s; }
.hero-cta:hover { filter: brightness(1.1); }

/* ── Dashboard: стат-чипы с иконкой ────────────────────────── */
.dash-stats { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
.stat-card.stat-rich { flex-direction: row; align-items: center; gap: 12px; padding: 13px 14px; }
.stat-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.stat-rich .stat-tx { display: flex; flex-direction: column; min-width: 0; align-items: flex-end; text-align: right; }
.stat-rich .val { font-size: 22px; font-weight: 800; margin-top: 0; line-height: 1; letter-spacing: -.3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-rich .lbl { font-size: 11px; margin-top: 6px; }

/* карточки сервисов на странице «Ключи» */
.svc-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 9px; }
.svc-name { flex: 1; font-size: 16px; font-weight: 700; letter-spacing: -.2px; color: var(--text); }
.svc-head .row-ico { width: 30px; height: 30px; font-size: 16px; }

/* ── Dashboard: «дальше в очереди» ─────────────────────────── */
.tile-queue { text-align: left; }
.qn-list { display: flex; flex-direction: column; gap: 11px; }
.qn-item { display: flex; align-items: center; gap: 11px; min-width: 0; }
.qn-cover { width: 46px; height: 46px; border-radius: 9px; flex-shrink: 0; background: var(--bg-3) center/cover;
    display: grid; place-items: center; color: var(--text-4); font-size: 18px; }
.qn-meta { min-width: 0; flex: 1; }
.qn-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qn-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.qn-more { font-size: 13px; color: var(--accent); cursor: pointer; padding-top: 3px; }
.tile-empty { color: var(--text-3); font-size: 14px; padding: 10px 0; }

/* ── Dashboard: «недавно играло» (лента обложек) ───────────── */
.tile-recent { margin: 12px 16px 0; }   /* отдельный тайл (не в .dash-tiles) — выравниваем поля как у всех */
.recent-strip { display: flex; gap: 13px; overflow-x: auto; scroll-snap-type: x proximity; }
.recent-card { width: 106px; flex-shrink: 0; scroll-snap-align: start; }
.recent-cover { width: 106px; height: 106px; border-radius: 11px; background: var(--bg-3) center/cover;
    display: grid; place-items: center; color: var(--text-4); font-size: 30px; }
.recent-title { font-size: 12px; font-weight: 600; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }

@media (max-width: 760px) { .dash-tiles { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
    .hero { flex-direction: column; text-align: center; padding: 20px 16px; }
    .hero-seek, .hero-ctl { justify-content: center; }
    .hero-title { font-size: 23px; }
    .hero-sub { white-space: normal; }
    /* большие кружки войса не влезают в узкий тайл — ужимаем, но держим крупными */
    .vw-ava { width: 86px; height: 86px; font-size: 30px; }
    .vw-member { width: 96px; }
    .vt-row { gap: 12px; }
}
.bp-btn:disabled { opacity: .4; cursor: default; }

/* ── Fullscreen player (Spotify-style now playing) ─────────── */
.full-player {
    position: fixed; inset: 0; z-index: 90; background: var(--bg);
    display: flex; flex-direction: column; opacity: 0; pointer-events: none;
    transform: translateY(2%); transition: opacity .22s ease, transform .22s ease;
}
.full-player.show { opacity: 1; pointer-events: auto; transform: none; }
.fp-top { display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px; flex-shrink: 0; }
.fp-ctx { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .6px; }
.fp-icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg-2);
    color: var(--text); font-size: 18px; display: grid; place-items: center; }
.fp-icon:hover { background: var(--bg-3); }
.fp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 22px; padding: 8px 24px calc(30px + var(--safe-b));
    max-width: 600px; width: 100%; margin: 0 auto; }
.fp-cover { width: min(46vh, 86vw); height: min(46vh, 86vw); border-radius: 16px;
    background: var(--bg-3) center/cover; display: grid; place-items: center;
    font-size: 64px; color: var(--text-4); box-shadow: 0 22px 60px rgba(0,0,0,.5); flex-shrink: 0; }
.fp-info { width: 100%; }
.fp-title { font-size: 26px; font-weight: 800; line-height: 1.15; overflow: hidden;
    text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fp-artist { color: var(--text-3); font-size: 15px; margin-top: 6px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
.fp-seekbar { display: flex; align-items: center; gap: 12px; width: 100%; }
.fp-tt { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 42px; }
.fp-tt.r { text-align: right; }
.fp-controls { display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; }
.fp-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: none; color: var(--text);
    font-size: 22px; display: grid; place-items: center; transition: transform .1s; }
.fp-btn:hover { transform: scale(1.08); }
.fp-btn.main { width: 64px; height: 64px; background: #fff; color: #000; font-size: 24px; }
.fp-btn.act { color: var(--accent); }
.fp-btn:disabled { opacity: .4; cursor: default; transform: none; }
.fp-volrow { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--text-3); font-size: 13px; }
.fp-vol { flex: 1; }
@media (max-width: 760px) {
    .fp-title { font-size: 22px; }
    .fp-cover { width: min(40vh, 82vw); height: min(40vh, 82vw); }
    .fp-btn { width: 48px; height: 48px; }
    .fp-btn.main { width: 60px; height: 60px; }
}
