/*
 * Каркас приложения — точно по мастер-исходнику дизайна (Фономатика.dc.html).
 * Топбар (72px, лого слева) → строка [сайдбар 84px][контент] → мини-плеер (76px).
 * Брейкпоинт 720px: сайдбар → нижняя таб-навигация.
 */

.app__boot {
    display: flex; align-items: center; justify-content: center;
    height: 100vh; color: var(--text-muted);
}

.app {
    display: flex; flex-direction: column;
    height: 100vh; overflow: hidden;
    background: var(--bg); color: var(--text);
}

/* ---------- Топбар (полная ширина, лого слева) ---------- */
.topbar {
    height: 72px; flex-shrink: 0;
    display: flex; align-items: center; gap: 28px;
    padding: 0 32px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--bg); z-index: 30;
}
.topbar__logo {
    display: flex; align-items: center; gap: 10px; cursor: pointer; flex-shrink: 0;
    font-size: 19px; font-weight: 800; letter-spacing: -0.01em; color: var(--text);
}
.topbar__logo svg { width: 24px; height: 24px; }
.topbar__search { position: relative; flex: 1; max-width: 560px; }
.topbar__search-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none; display: flex;
}
.topbar__search-icon svg { width: 16px; height: 16px; }
.topbar__search .input { padding: 10px 14px 10px 38px; }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.topbar-round-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: transparent; color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background var(--transition);
}
.topbar-round-btn:hover { background: var(--bg-hover); }
.topbar-round-btn svg { width: 20px; height: 20px; }

/* Пилюля-триггер «Новая версия» в топбаре (уведомление о переезде music→music2). */
.whatsnew-pill {
    display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
    height: 34px; padding: 0 12px; border-radius: var(--radius-pill);
    border: 1px solid var(--accent); background: var(--accent-soft);
    color: var(--accent); font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background var(--transition);
    white-space: nowrap;
}
.whatsnew-pill:hover { background: var(--accent); color: var(--accent-contrast); }
.whatsnew-pill svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
    /* На узких экранах — только иконка, чтобы не теснить топбар. */
    .whatsnew-pill { padding: 0; width: 34px; justify-content: center; }
    .whatsnew-pill__label { display: none; }
}
.avatar {
    width: 38px; height: 38px; border-radius: 50%; border: none;
    background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
    cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Маркер непрочитанного (ответ поддержки/сообщение по заказу) поверх аватара */
.avatar-badge {
    position: absolute; top: -1px; right: -1px; width: 11px; height: 11px;
    border-radius: 50%; background: var(--danger); border: 2px solid var(--bg-surface);
    pointer-events: none;
}

/* Live-dropdown поиска */
.search-dropdown {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    overflow: hidden; max-height: 70vh; overflow-y: auto;
}
.search-dropdown__group-title {
    padding: 10px 14px 4px; font-size: 11px; font-weight: 800;
    letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted);
}
.search-dropdown__item {
    padding: 7px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer;
    width: 100%; border: none; background: none; color: var(--text); text-align: left; font: inherit;
}
.search-dropdown__item:hover { background: var(--bg-hover); }
/* По дизайну: миниатюра-обложка + две строки (название / подзаголовок) */
.search-dropdown__cover {
    width: 38px; height: 38px; border-radius: 8px; flex-shrink: 0;
    background: linear-gradient(135deg, hsl(var(--hue,240) 60% 42%), hsl(calc(var(--hue,240) + 42) 55% 24%));
}
.search-dropdown__text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.search-dropdown__name {
    font-size: 14px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-dropdown__sub {
    font-size: 12.5px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-dropdown__more {
    padding: 12px 14px; text-align: center; font-size: 13px; font-weight: 700;
    color: var(--accent); cursor: pointer; border-top: 1px solid var(--border);
    width: 100%; background: none; border-left: none; border-right: none; border-bottom: none;
}
.search-dropdown__more:hover { background: var(--bg-hover); }

/* Меню пользователя */
.user-menu {
    position: absolute; top: calc(100% + 10px); right: 0; width: 230px; z-index: 40;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,0.4); overflow: hidden; padding: 8px;
}
.user-menu__head { padding: 12px 12px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu__item {
    padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500;
    width: 100%; border: none; background: none; color: var(--text); text-align: left;
}
.user-menu__item:hover { background: var(--bg-hover); }
.user-menu__item--danger { color: var(--danger); }
.user-menu__sep { height: 1px; background: var(--border); margin: 6px 4px; }
.user-menu__tariff {
    font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
    background: var(--surface); color: var(--text-muted);
}
.user-menu__tariff--business {
    background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}

/* ---------- Средняя строка: сайдбар + контент ---------- */
.app__body { display: flex; flex: 1; min-height: 0; }

.sidebar {
    width: 84px; flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 20px 0; border-right: 1px solid var(--border);
}
.nav-item {
    width: 56px; height: 56px; border-radius: 14px; border: none; background: transparent;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    cursor: pointer; color: var(--text-muted); transition: background var(--transition), color var(--transition);
}
.nav-item span { font-size: 11px; font-weight: 600; }
.nav-item svg { width: 21px; height: 21px; }
.nav-item:hover { color: var(--text-secondary); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Контент ---------- */
.main {
    flex: 1; min-width: 0; overflow-y: auto;
    padding: 32px 40px 100px;
}
.main__inner { max-width: none; }
.screen-section { margin-bottom: 36px; }
.screen-section__title { font-size: 21px; font-weight: 800; margin-bottom: 4px; }
.screen-section__subtitle { font-size: 13.5px; color: var(--text-muted); margin-bottom: 16px; }
.pill-btn {
    background: transparent; border: 1px solid var(--border-strong); color: var(--text);
    border-radius: 999px; padding: 9px 18px; font-size: 13px; font-weight: 600;
    cursor: pointer; margin-bottom: 36px; transition: background var(--transition);
}
.pill-btn:hover { background: var(--bg-hover); }

/* Переключатель сортировки — блок «Все плейлисты» каталога (screens/catalog.js) */
.sort-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.sort-tabs__btn {
    background: transparent; border: 1px solid var(--border-strong); color: var(--text-secondary);
    border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.sort-tabs__btn:hover { background: var(--bg-hover); }
.sort-tabs__btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* Hero-баннер «Мой фон» */
.hero {
    background: linear-gradient(120deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, #17c2c2) 100%);
    border-radius: 18px; padding: 26px 30px; margin-bottom: 36px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.hero__title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: #fff; }
.hero__title svg { width: 20px; height: 20px; }
.hero__subtitle { font-size: 14px; color: rgba(255,255,255,0.85); margin-top: 6px; }
.hero__btn {
    background: #fff; color: #141518; border: none; border-radius: 10px;
    padding: 12px 22px; font-weight: 700; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.hero__btn svg { width: 14px; height: 14px; }
.hero__btn:hover { opacity: 0.9; }
.hero__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hero__btn--ghost {
    background: rgba(255,255,255,0.14); color: #fff;
    border: 1px solid rgba(255,255,255,0.45);
}
.hero__btn--ghost:hover { background: rgba(255,255,255,0.24); opacity: 1; }

/* Модалка настроек «Моего фона» */
/* width НЕ задаём в vw: у .track-modal padding 20px с каждой стороны, поэтому
   calc(100vw - 32px) оказывался на 8px шире контейнера и карточка вылезала
   за его границы (правый край подвала с кнопкой обрезался). Ширину даёт
   .track-modal__card (width:100%), здесь только предел. */
.rp-card { max-width: 560px; }
.rp-body { padding: 4px 18px 6px; max-height: min(62vh, 560px); overflow-y: auto; }
.rp-group { margin: 14px 0 18px; }
.rp-label { font-size: 13.5px; font-weight: 700; margin-bottom: 9px; }
.rp-label__hint { font-weight: 500; font-size: 12px; color: var(--text-muted); margin-left: 4px; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.rp-chips:empty { display: none; }
.rp-chips--sug { margin-top: 8px; }
.rp-search { margin-top: 10px; height: 36px; font-size: 13px; }
.rp-chip {
    border: 1px solid var(--border, rgba(128,128,128,0.35)); background: var(--bg-elevated);
    color: var(--text-secondary); border-radius: 99px; padding: 6px 12px;
    font-size: 12.5px; font-weight: 600; cursor: pointer; line-height: 1.2;
}
.rp-chip:hover { background: var(--bg-hover); color: inherit; }
.rp-chip__hint { font-weight: 500; font-size: 11px; opacity: 0.65; margin-left: 2px; }
.rp-chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast, #fff); }
.rp-chip.is-on .rp-chip__hint { opacity: 0.85; }
.rp-chip.is-on-danger { background: color-mix(in srgb, #d64545 18%, var(--bg-elevated)); border-color: #d64545; color: #d64545; }
.rp-chip--add { border-style: dashed; }
.rp-chip--muted { opacity: 0.35; }
/* Ползунок длительности «Моего фона» (2026-09-24) + честная оценка пула */
.rp-duration { display: flex; align-items: center; gap: 12px; }
.rp-duration__range { flex: 1; accent-color: var(--accent); }
.rp-duration__val { font-size: 13px; font-weight: 700; min-width: 64px; text-align: right; flex-shrink: 0; }
.rp-duration__estimate { font-size: 12.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.4; }
.rp-duration__estimate--warn { color: var(--warning); }
/* flex-wrap — страховка для очень узких экранов (320px): кнопки перенесутся,
   а не обрежутся по краю */
.rp-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 18px 16px; border-top: 1px solid var(--border, rgba(128,128,128,0.2)); }

/* Баннер апгрейда до Бизнес (только free-тариф) — прозрачный фон с акцентным
   контуром, отличается от заливного hero, но не спорит с ним по цвету. */
.upgrade-banner {
    background: transparent; border: 1.5px solid var(--accent);
    border-radius: 18px; padding: 26px 30px; margin-bottom: 36px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.upgrade-banner__badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800;
    padding: 4px 11px; border-radius: 999px; margin-bottom: 12px;
    background: var(--surface); color: var(--text-muted);
}
.upgrade-banner__badge svg { width: 12px; height: 12px; }
.upgrade-banner__title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; color: var(--text); }
.upgrade-banner__title svg { width: 18px; height: 18px; color: var(--accent); }
.upgrade-banner__features { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 16px; }
.upgrade-banner__feature { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.upgrade-banner__feature svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
.upgrade-banner__cta { flex-shrink: 0; padding: 13px 24px; font-size: 14.5px; }

/* Сетка карточек */
.card-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    margin-bottom: 36px;
}

/* ---------- Мини-плеер (полная ширина, 76px) ---------- */
.mini-player {
    position: fixed; left: 0; right: 0; bottom: 0; height: 76px; z-index: 25;
    background: var(--bg-elevated); border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 20px; padding: 0 24px;
    transform: translateY(100%); transition: transform var(--transition);
}
.mini-player.is-visible { transform: translateY(0); }
.mini-player__progress {
    position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--border); cursor: pointer;
}
.mini-player__progress-fill {
    position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); width: 0; pointer-events: none;
}
.mini-player__progress-thumb {
    position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    transform: translateY(-50%) scale(0); transition: transform .15s ease;
}
.mini-player__progress:hover .mini-player__progress-thumb {
    transform: translateY(-50%) scale(1);
}
.mini-player__progress.is-dragging .mini-player__progress-thumb {
    transform: translateY(-50%) scale(1.25);
}
.mini-player__track { display: flex; align-items: center; gap: 14px; width: 260px; flex-shrink: 0; min-width: 0; cursor: pointer; }
.mini-player__cover {
    width: 48px; height: 48px; border-radius: 8px; flex-shrink: 0;
    background: linear-gradient(135deg, hsl(var(--hue,240) 60% 40%), hsl(calc(var(--hue,240) + 42) 55% 22%));
}
.mini-player__title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-player__title svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; color: var(--accent); }
.mini-player__subtitle { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Кольцо дневного лимита (Free) среди иконок мини-плеера — depletes по часовой,
   цвет меняется по мере приближения к нулю (см. daily-limit.js). */
.mini-player__limit-track { stroke: var(--border); }
.mini-player__limit-arc {
    stroke: var(--accent); transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}
.mini-player__limit.is-warning .mini-player__limit-arc { stroke: var(--warning); }
.mini-player__limit.is-critical .mini-player__limit-arc { stroke: var(--danger); }
.mini-player__center { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 520px; margin: 0 auto; }
.mini-player__controls { display: flex; align-items: center; gap: 20px; }
/* Ширина = .mini-player__track (260px) — иначе средний flex:1-блок с
   транспортом центрируется не по странице, а по остатку между разными по
   ширине боковыми блоками и уезжает в сторону (замечено заказчиком 2026-09-24). */
.mini-player__extra { display: flex; align-items: center; gap: 16px; width: 260px; justify-content: flex-end; flex-shrink: 0; }
.mp-btn {
    background: none; border: none; color: var(--text-secondary); cursor: pointer; display: flex;
    align-items: center; justify-content: center; padding: 0;
    transition: color var(--transition);
}
.mp-btn:hover { color: var(--text); }
/* Недоступно на бесплатном тарифе: приглушено, клик оставлен для toast-подсказки */
.mp-btn.is-disabled, .mp-btn.is-disabled:hover { color: var(--text-muted); opacity: 0.45; }
.player-screen__bar.is-disabled { cursor: default; opacity: 0.55; }
.mp-btn svg { width: 19px; height: 19px; }
.mp-btn--sm svg { width: 17px; height: 17px; }
.mini-player__play {
    width: 36px; height: 36px; border-radius: 50%; background: var(--accent); border: none;
    color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.mini-player__play svg { width: 18px; height: 18px; }
.mini-player__play:hover { background: color-mix(in srgb, var(--accent) 85%, black); }

/* ---------- Нижняя навигация (мобильная) ---------- */
.bottom-nav { display: none; }

/* ---------- Мобильный брейкпоинт ---------- */
.mobile-only { display: none; }

@media (max-width: 720px) {
    .topbar { height: 58px; gap: 8px; padding: 0 12px; }
    .topbar__logo { font-size: 15px; }
    .topbar__search { display: none; }          /* на мобильном поиск — иконкой */
    .topbar__spacer { display: none; }
    .topbar__actions { margin-left: auto; }      /* иконки к правому краю */
    .mobile-only { display: flex; }
    .sidebar { display: none; }
    .main { padding: 16px 16px calc(150px + env(safe-area-inset-bottom)); }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; }
    /* Узкая колонка: меньше отступов и чуть компактнее заголовок, чтобы длинные
       названия («Заблокированные») помещались, не вылезая за карточку */
    .my-tile { padding: 16px; min-height: 150px; }
    .my-tile__title { font-size: 14.5px; }

    /* Нижняя навигация — фиксированная высота, чтобы над ней ровно встал мини-плеер */
    .bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 26;
        height: calc(62px + env(safe-area-inset-bottom));
        align-items: center; justify-content: space-around;
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg-elevated); border-top: 1px solid var(--border);
    }
    .bottom-nav .nav-item { flex: 1; width: auto; height: auto; padding: 6px; gap: 4px; }
    .bottom-nav .nav-item svg { width: 20px; height: 20px; }

    /* Мобильный мини-плеер над навигацией: [play next] [название] [очередь громкость развернуть] */
    .mini-player {
        bottom: calc(62px + env(safe-area-inset-bottom)); height: 60px; padding: 0 14px; gap: 12px;
    }
    .mini-player__cover { display: none; }
    .mini-player__center { order: 1; flex: none; max-width: none; margin: 0; }
    .mini-player__controls { gap: 10px; }
    .mini-player__controls [data-act="prev"] { display: none; }
    .mini-player__play { width: 40px; height: 40px; }
    .mini-player__play svg { width: 20px; height: 20px; }
    .mini-player__track { order: 2; width: auto; flex: 1; }
    .mini-player__title { font-size: 13px; }
    .mini-player__subtitle { font-size: 11.5px; }
    .mini-player__extra { order: 3; display: flex; width: auto; gap: 14px; }

    .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
    .hero__btn { width: 100%; justify-content: center; }
}

/* ---------- Экран плейлиста ---------- */
.playlist-header { display: flex; gap: 28px; margin-bottom: 32px; align-items: flex-end; }
.playlist-header__cover {
    width: 220px; height: 220px; flex-shrink: 0; border-radius: 16px; overflow: hidden;
    background: linear-gradient(135deg, hsl(var(--hue,240) 60% 40%), hsl(calc(var(--hue,240) + 42) 55% 22%));
}
.playlist-header__info { flex: 1; min-width: 0; }
.playlist-header__eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.playlist-header__eyebrow--personal { color: var(--accent); }
.playlist-header__eyebrow--custom-order { color: var(--success); }
.playlist-header__title { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 6px; }
.playlist-header__meta { font-size: 13.5px; color: var(--text-muted); margin: 8px 0 20px; }
.playlist-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px;
    color: var(--text-muted); cursor: pointer; margin-bottom: 14px; font-weight: 600;
    background: none; border: none;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 15px; height: 15px; }
.track-list { display: flex; flex-direction: column; }

@media (max-width: 720px) {
    .playlist-header { flex-direction: column; align-items: stretch; gap: 16px; }
    .playlist-header__cover { width: 100%; height: auto; aspect-ratio: 1/1; }
    .playlist-header__title { font-size: 26px; }
    .playlist-header__actions { flex-direction: column; }
    .playlist-header__actions .btn { width: 100%; }

    /* Hero «Мой фон»: в строку кнопки не влезают — заголовок сверху, кнопки под
       ним. flex-wrap + min-width: на 360px+ они стоят парой, на совсем узких
       «Запустить» переносится на строку ниже вместо ухода за край экрана. */
    .hero { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px 18px; }
    .hero__title { font-size: 17px; }
    .hero__actions { width: 100%; flex-wrap: wrap; }
    .hero__btn { flex: 1 1 140px; justify-content: center; padding: 12px 16px; }
}

/* ---------- Экран входа ---------- */
.login-screen {
    position: fixed; inset: 0; z-index: 60; background: var(--bg);
    display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto;
}
.login-card {
    width: 100%; max-width: 420px; background: var(--bg-elevated);
    border: 1px solid var(--border); border-radius: 20px; padding: 40px 36px;
}
.login-card__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.login-card__brand svg { width: 26px; height: 26px; }
.login-card__tagline { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }
.login-card__title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.login-card__lead { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5; }
.login-card__label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.login-card__agree {
    display: flex; align-items: flex-start; gap: 10px; font-size: 13px;
    color: var(--text-secondary); line-height: 1.5; margin-bottom: 24px;
}
.login-card__agree input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.login-card__agree a { color: var(--accent); text-decoration: none; }
.login-card__agree a:hover { text-decoration: underline; }
.login-card__hint { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 20px; line-height: 1.5; }
.login-card__back { display: block; margin: 16px auto 0; background: none; border: none; color: var(--text-secondary); font-size: 13px; cursor: pointer; }
.login-card__back:hover { color: var(--text); }

/* ---------- Полноэкранный плеер ---------- */
.player-screen {
    position: fixed; inset: 0; z-index: 50; background: var(--bg);
    display: flex; flex-direction: column; padding: 24px 32px 36px;
}
.player-screen__head { display: flex; align-items: center; justify-content: space-between; }
.player-screen__head .mp-btn svg { width: 20px; height: 20px; }
.player-screen__subtitle { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.player-screen__body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.player-screen__viz {
    position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
    pointer-events: none;
}
.player-screen__cover-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.player-screen__cover {
    width: min(46vh, 360px); aspect-ratio: 1/1; border-radius: 20px;
    background: linear-gradient(135deg, hsl(var(--hue,240) 60% 40%), hsl(calc(var(--hue,240) + 42) 55% 22%));
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.player-screen__queue { flex: 1; min-height: 0; overflow-y: auto; max-width: 640px; width: 100%; margin: 0 auto; padding: 4px 0 12px; }
.player-screen__panel { max-width: 640px; width: 100%; margin: 0 auto; flex-shrink: 0; display: flex; flex-direction: column; background: var(--bg); }
.player-screen__titlerow { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.player-screen__titlerow .mp-btn { color: var(--text-muted); flex-shrink: 0; }
.player-screen__titlerow .mp-btn:hover { color: var(--text); }
.player-screen__titlerow .mp-btn.is-active { color: var(--accent); }
.player-screen__titlerow .mp-btn[data-act="dislike"].is-active { color: var(--danger); }
.player-screen__now { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.player-screen__title { max-width: 100%; font-size: 19px; font-weight: 800; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-screen__nowsub { display: none; max-width: 100%; font-size: 13px; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-screen__bar {
    /* Зона захвата шире видимой полосы — удобнее попасть мышкой в тонкую линию. */
    height: 16px; display: flex; align-items: center; position: relative; cursor: pointer;
}
.player-screen__bar-track {
    position: relative; width: 100%; height: 6px; border-radius: 3px; background: var(--border);
}
.player-screen__bar-fill {
    position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); width: 0; border-radius: 3px;
}
.player-screen__bar-thumb {
    position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    transform: translateY(-50%) scale(0); transition: transform .15s ease; pointer-events: none;
}
.player-screen__bar:hover .player-screen__bar-thumb {
    transform: translateY(-50%) scale(1);
}
.player-screen__bar.is-dragging .player-screen__bar-thumb {
    transform: translateY(-50%) scale(1.25);
}
.player-screen__times { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }
.player-screen__controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 24px; }
.player-screen__controls .mp-btn { color: var(--text); }
.player-screen__controls .mp-btn svg { width: 24px; height: 24px; }
.player-screen__controls .mp-btn[data-act="shuffle"] svg,
.player-screen__controls .mp-btn[data-act="repeat"] svg { width: 18px; height: 18px; }
.player-screen__controls .mp-btn[data-act="shuffle"],
.player-screen__controls .mp-btn[data-act="repeat"] { color: var(--text-secondary); }
.player-screen__controls .mp-btn.is-active { color: var(--accent); }
.player-screen__queue-head { display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.player-screen__queue-list { display: flex; flex-direction: column; gap: 2px; }
/* Играющий трек в очереди — подсветка фоном (как в макете) */
.player-screen__queue-list .track-row.is-playing { background: var(--bg-hover); }
.player-screen__play {
    width: 62px; height: 62px; border-radius: 50%; background: var(--accent); border: none; color: #fff;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.player-screen__play svg { width: 28px; height: 28px; }
.player-screen__play:hover { background: color-mix(in srgb, var(--accent) 85%, black); }
.player-screen__toggle { text-align: center; margin-top: 28px; }
.player-screen__toggle .btn svg { width: 15px; height: 15px; }

/* Мобильный полноэкранный плеер: контролы над названием, свои отступы (README) */
@media (max-width: 720px) {
    .player-screen { padding: 16px 16px 24px; }
    .player-screen__head { margin-bottom: 6px; }
    .player-screen__cover { width: min(62vw, 320px); }
    .player-screen__subtitle { display: none; }        /* на мобильном — под названием, не в шапке */
    .player-screen__nowsub { display: block; }
    .player-screen__panel { padding-top: 10px; }
    .player-screen__controls { order: 1; margin-top: 6px; margin-bottom: 16px; gap: 22px; }
    .player-screen__titlerow { order: 2; margin-bottom: 12px; }
    .player-screen__bar { order: 3; }
    .player-screen__times { order: 4; }
    .player-screen__toggle { order: 5; margin-top: 18px; }
    .player-screen__queue { padding-bottom: 6px; }
}

/* ---------- Полноэкранный поиск (мобильный) ---------- */
.search-overlay {
    position: fixed; inset: 0; z-index: 900;
    background: var(--bg); padding: 12px; display: none; flex-direction: column; gap: 12px;
}
.search-overlay.is-open { display: flex; }
.search-overlay__bar { display: flex; align-items: center; gap: 8px; }
.search-overlay__bar .topbar__search { display: block; }
.search-overlay__results { flex: 1; overflow-y: auto; }
.search-overlay__results .search-dropdown__item { padding: 12px 14px; }

/* ---------- Хаб «Моё» (плитки) ---------- */
.my-tile {
    position: relative;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px;
    padding: 22px; cursor: pointer; min-height: 170px; display: flex; flex-direction: column;
    transition: transform var(--transition), border-color var(--transition);
}
.my-tile:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.my-tile__lock {
    position: absolute; top: 14px; right: 14px;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
    color: hsl(45 90% 45%); background: hsl(45 90% 55% / 0.14);
    padding: 3px 8px; border-radius: 999px;
}
.my-tile__lock svg { width: 12px; height: 12px; }
.my-tile__icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.my-tile__icon svg { width: 20px; height: 20px; }
/* Блок текста тянется на всю высоту: заголовок вверху (одинаковый уровень у всех
   карточек, независимо от длины описания), значение прижато к низу */
.my-tile__body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.my-tile__title { font-size: 16px; font-weight: 700; margin-top: 14px; overflow-wrap: break-word; }
.my-tile__sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.my-tile__value { font-size: 13.5px; color: var(--accent); font-weight: 700; margin-top: auto; padding-top: 8px; }

/* Заголовок секции избранного */
.fav-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.fav-section-head__title { font-size: 18px; font-weight: 800; }
.fav-section-head__count { font-size: 14px; color: var(--text-muted); }
.track-row__remove:hover { color: var(--danger); }

/* ---------- Личный кабинет ---------- */
.profile { max-width: 680px; }
.profile-info { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 6px 20px; margin-bottom: 24px; }
.profile-info__row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; font-size: 13.5px; }
.profile-info__row + .profile-info__row { border-top: 1px solid var(--border); }
.profile-info__row span { color: var(--text-muted); }
.profile-info__row b { font-weight: 600; }

/* ---------- Настройки ---------- */
.settings { max-width: 640px; display: flex; flex-direction: column; gap: 20px; }
.settings-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.settings-card__title { font-size: 15.5px; font-weight: 800; color: var(--accent); margin-bottom: 18px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.settings-row + .settings-row { margin-top: 20px; }
.settings-row__title { font-size: 14px; font-weight: 600; }
.settings-row__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.settings-row.is-disabled { opacity: 0.5; }
.settings-select {
    background: var(--input-bg); border: 1px solid var(--border); border-radius: 8px;
    padding: 9px 12px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer;
}
.settings-slider { display: flex; align-items: center; gap: 12px; }
.settings-slider input[type="range"] { accent-color: var(--accent); width: 140px; }
.settings-slider__val { font-size: 13.5px; font-weight: 700; color: var(--accent); width: 52px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
    padding: 0; transition: transform var(--transition); position: relative;
    box-shadow: 0 0 0 1px var(--border) inset;
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active { border-color: var(--text); transform: scale(1.1); }
.settings-stat { display: flex; align-items: center; justify-content: space-between; }
.settings-stat__val { font-size: 14px; font-weight: 700; }
.settings__version { font-size: 12.5px; color: var(--text-muted); text-align: center; padding-top: 4px; }

/* Тумблер */
.switch {
    width: 46px; height: 26px; border-radius: 999px; border: none; cursor: pointer;
    background: var(--border-strong); position: relative; transition: background var(--transition); flex-shrink: 0;
}
.switch.is-on { background: var(--accent); }
.switch__knob {
    position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; transition: transform var(--transition);
}
.switch.is-on .switch__knob { transform: translateX(20px); }

.btn-danger {
    background: transparent; color: var(--danger); border: 1px solid var(--danger);
    border-radius: 9px; padding: 10px 18px; font-weight: 700; font-size: 13.5px; cursor: pointer;
    transition: background var(--transition);
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px);
    z-index: 1000; max-width: 90vw; padding: 12px 20px; border-radius: 999px;
    background: var(--text); color: var(--bg); font-weight: 600; font-size: 13.5px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.3); opacity: 0; pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) { .toast { bottom: 140px; } }

/* ---------- Лицензия (/license/{token}) ---------- */
.license-page { display: flex; justify-content: center; padding: 8px 0 40px; }
.license-page--guest { min-height: 100vh; align-items: flex-start; padding: 40px 16px; overflow-y: auto; background: var(--bg); }
.license-card {
    width: 100%; max-width: 640px; background: var(--bg-elevated);
    border: 1px solid var(--border); border-radius: 16px; padding: 32px 34px 26px;
}
.license-card__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; margin-bottom: 18px; }
.license-card__brand svg { width: 22px; height: 22px; color: var(--accent); }
.license-card__badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
    background: color-mix(in srgb, var(--success, #2ecc71) 14%, transparent);
    color: var(--success, #2ecc71); font-weight: 700; font-size: 13px; margin-bottom: 18px;
}
.license-card__badge svg { width: 15px; height: 15px; }
.license-card__badge--expired {
    background: color-mix(in srgb, var(--danger, #e74c3c) 14%, transparent);
    color: var(--danger, #e74c3c);
}
.license-card__title { font-size: 22px; font-weight: 800; line-height: 1.25; margin: 0 0 4px; }
.license-card__subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 22px; }
.license-card__grid { display: grid; gap: 10px; margin-bottom: 8px; }
.license-card__row { display: flex; justify-content: space-between; gap: 18px; font-size: 14px; border-bottom: 1px dashed var(--border); padding-bottom: 9px; }
.license-card__row span { color: var(--text-muted); flex-shrink: 0; }
.license-card__row b { text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.license-card__section { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 22px 0 10px; }
.license-card__list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-secondary); line-height: 1.65; }
.license-card__tracks { display: flex; flex-direction: column; gap: 2px; }
.license-card__track { display: flex; align-items: center; gap: 12px; font-size: 13.5px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.license-card__track:last-child { border-bottom: none; }
.license-card__track-n { color: var(--text-muted); min-width: 22px; text-align: right; }
.license-card__track-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.license-card__track-dur { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.license-card__actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.license-card__actions .btn { text-decoration: none; }
.license-card__footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); line-height: 1.6; text-align: center; }
@media (max-width: 720px) { .license-card { padding: 22px 18px 18px; } }

/* ---------- Поиск: страница результатов ---------- */
.search-genres { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 36px; }
.search-genre-chip {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    padding: 12px 18px; border-radius: 12px;
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
    font: inherit; transition: background var(--transition), border-color var(--transition);
}
.search-genre-chip:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.search-genre-chip svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }
.search-genre-chip__name { font-size: 14px; font-weight: 700; }
.search-genre-chip__count { font-size: 12.5px; color: var(--text-muted); }

/* ---------- Диалог переноса воспроизведения (лимит точек) ---------- */
.takeover-device {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    font-size: 13.5px; font-weight: 600;
}
.takeover-device svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.takeover-device__when { margin-left: auto; color: var(--text-muted); font-weight: 500; font-size: 12.5px; }

/* ---------- Настройки: активные точки воспроизведения ---------- */
/* Воздух и над разделительной чертой (padding), и под ней (margin) —
   иначе черта слипается со следующей строкой «Сессии входа» */
.settings-sessions { padding: 0 0 18px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.settings-session__mine {
    display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
    background: var(--accent-soft, color-mix(in srgb, var(--accent) 15%, transparent));
    color: var(--accent); font-size: 11px; font-weight: 700; vertical-align: 1px;
}
.settings-session__track {
    display: block; font-size: 12px; color: var(--text-muted); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.settings-session__kill {
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
    border: none; background: transparent; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.settings-session__kill:hover { color: var(--danger); background: var(--bg-hover); }
.settings-session__kill svg { width: 14px; height: 14px; }
.settings-session__kill:disabled { opacity: 0.4; cursor: default; }
