:root {
    color-scheme: dark;
    --page-bg: #111318;
    --panel: rgba(22, 27, 34, 0.82);
    --panel-strong: rgba(16, 20, 27, 0.94);
    --panel-soft: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text-main: #f7f8fb;
    --text-muted: rgba(247, 248, 251, 0.68);
    --text-soft: rgba(247, 248, 251, 0.5);
    --accent: #4dd7c8;
    --accent-2: #ffb45c;
    --accent-3: #8fb3ff;
    --accent-rgb: 77, 215, 200;
    --accent-2-rgb: 255, 180, 92;
    --accent-3-rgb: 143, 179, 255;
    --theme-page-rgb: 17, 19, 24;
    --theme-panel-rgb: 16, 20, 27;
    --theme-panel: #10141b;
    --accent-glow: rgba(77, 215, 200, 0.34);
    --danger: #ff7087;
    --success: #84f2a8;
    --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page-bg);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    margin: 0;
    min-height: 100vh;
    width: 100%;
    color: var(--text-main);
    background:
        radial-gradient(circle at 18% 8%, rgba(var(--accent-rgb), 0.28), transparent 34%),
        radial-gradient(circle at 86% 82%, rgba(var(--accent-2-rgb), 0.22), transparent 32%),
        linear-gradient(180deg, rgba(var(--theme-page-rgb), 1) 0%, #101218 58%, rgba(var(--theme-panel-rgb), 0.95) 100%);
    overflow-x: hidden;
    transition: background 0.45s ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.18) 0 1px, transparent 1.6px),
        radial-gradient(circle, rgba(var(--accent-3-rgb), 0.14) 0 1px, transparent 1.8px),
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 0 1px, transparent 1.7px);
    background-size: 42px 42px, 42px 42px, 180px 180px, 240px 240px, 300px 300px;
    background-position: 0 0, 0 0, 20px 28px, 80px 120px, 120px 56px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.62), transparent 78%);
    opacity: 0.62;
    animation: grid-drift 72s linear infinite;
}

body::after {
    content: "";
    position: fixed;
    inset: -24vmax;
    pointer-events: none;
    background:
        radial-gradient(circle at 24% 32%, rgba(var(--accent-rgb), 0.16), transparent 22vmax),
        radial-gradient(circle at 78% 64%, rgba(var(--accent-2-rgb), 0.12), transparent 24vmax),
        radial-gradient(circle at 52% 82%, rgba(var(--accent-3-rgb), 0.1), transparent 20vmax);
    filter: blur(36px);
    opacity: 0.42;
    transform: translate3d(0, 0, 0);
    animation: ambient-drift 84s ease-in-out infinite alternate;
}

@keyframes grid-drift {
    from {
        background-position: 0 0, 0 0, 20px 28px, 80px 120px, 120px 56px;
    }
    to {
        background-position: 12px 12px, -12px 12px, 32px 18px, 92px 128px, 108px 66px;
    }
}

@keyframes ambient-drift {
    0% {
        transform: translate3d(-0.6%, -0.4%, 0) scale(1);
    }
    50% {
        transform: translate3d(0.8%, 0.6%, 0) scale(1.02);
    }
    100% {
        transform: translate3d(0.2%, 0.9%, 0) scale(1.03);
    }
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

input {
    cursor: text;
    user-select: text;
}

button:focus-visible,
input:focus-visible,
.station-card:focus-visible,
.library-station:focus-visible,
.library-tab:focus-visible,
.category-chip:focus-visible,
.coverflow-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: content-box;
}

.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    padding: clamp(14px, 3vw, 40px);
    display: grid;
    place-items: center;
}

.player-layout {
    position: relative;
    isolation: isolate;
    width: min(1340px, 100%);
    height: clamp(560px, calc(100vh - 118px), 700px);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    overflow: visible;
}

.sidebar-wrap {
    flex-shrink: 0;
    width: 392px;
    margin-right: 18px;
    overflow: visible;
    will-change: width, margin-right;
    transition:
        width 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        margin-right 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.player-layout.library-collapsed .sidebar-wrap {
    width: 0;
    margin-right: 0;
}

.station-library {
    position: relative;
    min-width: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: grid;
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(var(--theme-panel-rgb), 0.84), rgba(255,255,255,0.035)),
        linear-gradient(140deg, rgba(var(--accent-rgb), 0.1), transparent 52%);
    box-shadow: 0 24px 64px rgba(0,0,0,0.32);
    backdrop-filter: blur(24px) saturate(130%);
    overflow: hidden;
    transform-origin: left center;
    will-change: transform, opacity;
    transition:
        opacity 0.38s ease,
        transform 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.38s ease;
}

.player-layout.library-collapsed .station-library {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-18px) scale(0.97);
    filter: blur(5px);
}

.library-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.library-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.library-eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.library-top h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1;
}

.library-close {
    display: inline-flex;
}

.library-search {
    min-width: 0;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(255,255,255,0.065);
    color: var(--text-muted);
}

.library-filter-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(56px, 1fr);
    gap: 10px;
    position: relative;
    z-index: 3;
    overflow: visible;
    max-height: 160px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 0.28s ease, opacity 0.2s ease, transform 0.2s ease, margin 0.2s ease;
}

.library-filter-grid > .library-search {
    grid-column: 1 / -1;
}

.library-filter-grid .library-select-trigger {
    height: 42px;
    gap: 9px;
    padding: 0 12px;
}

.library-filter-grid .library-select-value {
    font-size: 0.86rem;
    font-weight: 800;
}

.library-filter-grid .library-select-caret {
    margin-left: auto;
}

.library-filter-grid .library-select-flag,
.library-filter-grid .library-select-sort-icon {
    opacity: 0.9;
}

.library-filter-grid .library-select-prefix {
    display: none;
}

.station-library.filters-collapsed .library-filter-grid {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.library-select-sort-icon {
    flex: 0 0 auto;
    opacity: 0.7;
}

.library-select {
    min-width: 0;
    position: relative;
}

.library-select.open {
    z-index: 18;
}

.library-select-trigger {
    width: 100%;
    min-width: 0;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 0 14px;
    border: 1px solid rgba(var(--accent-rgb), 0.26);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04)),
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-3-rgb), 0.08));
    color: var(--text-main);
    font: inherit;
    text-align: left;
    box-shadow: 0 12px 28px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.1);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.library-select-flag,
.library-select-option-flag {
    flex: 0 0 auto;
    width: 1.4rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1;
}

.library-select-option-flag-img {
    display: block;
    width: 1.4rem;
    height: 1rem;
    object-fit: cover;
    border-radius: 2px;
}

.library-select-trigger:hover,
.library-select.open .library-select-trigger {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.5);
    box-shadow: 0 16px 32px rgba(0,0,0,0.2), 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.library-select-prefix {
    flex: 0 0 auto;
    color: var(--text-soft);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.library-select-value {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 850;
}

.library-select-caret {
    flex: 0 0 auto;
    opacity: 0.8;
}

.library-select-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 12;
    width: 100%;
    max-height: 280px;
    padding: 8px;
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(16, 20, 27, 0.96), rgba(16, 20, 27, 0.9)),
        rgba(255,255,255,0.04);
    box-shadow: 0 24px 48px rgba(0,0,0,0.34);
    backdrop-filter: blur(20px) saturate(130%);
    overflow: auto;
    display: none;
}

.library-select-menu.open {
    display: grid;
    gap: 6px;
}

.library-filter-settings-btn {
    width: 100%;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(var(--accent-rgb), 0.26);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04)),
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-3-rgb), 0.08));
    color: var(--text-main);
    box-shadow: 0 12px 28px rgba(0,0,0,0.16), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.library-filter-settings-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.5);
    box-shadow: 0 16px 32px rgba(0,0,0,0.2), 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.advanced-filters-modal {
    width: min(620px, 100%);
}

.advanced-filters-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.advanced-filters-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.advanced-filters-grid .library-select-prefix {
    display: none;
}

.advanced-filters-grid .library-select-trigger,
.advanced-filters-grid .library-select-toggle {
    height: 46px;
}

.advanced-filters-grid .library-select-toggle {
    justify-content: flex-start;
}

.advanced-filters-grid .library-select-toggle.active {
    border-color: rgba(var(--accent-rgb), 0.5);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04)),
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-3-rgb), 0.1));
    box-shadow: 0 16px 32px rgba(0,0,0,0.2), 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.advanced-filters-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.library-select-manage-btn {
    width: 100%;
    min-height: 38px;
    margin-top: 4px;
    padding: 0 12px;
    border: 1px dashed rgba(var(--accent-rgb), 0.24);
    border-radius: 12px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-main);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 800;
    text-align: left;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.library-select-manage-btn:hover {
    border-color: rgba(var(--accent-rgb), 0.4);
    background: rgba(var(--accent-rgb), 0.14);
    transform: translateY(-1px);
}

.library-select-option {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    text-align: left;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.library-select-option-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-select-option:hover {
    border-color: rgba(var(--accent-rgb), 0.24);
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--text-main);
    transform: translateX(1px);
}

.library-select-option.active {
    border-color: rgba(var(--accent-rgb), 0.42);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-3-rgb), 0.12));
    color: var(--text-main);
}

.library-select-option:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.library-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 0.92rem;
}

.library-search input::placeholder {
    color: var(--text-soft);
}

.library-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.library-tab {
    min-width: 0;
    min-height: 40px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(255,255,255,0.055);
    color: var(--text-muted);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.library-tab-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    opacity: 0.9;
}

.library-tab-icon svg {
    width: 100%;
    height: 100%;
}

.library-tab:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    color: var(--text-main);
}

.library-tab.active {
    border-color: rgba(var(--accent-rgb), 0.48);
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--text-main);
    box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.12);
}

.category-list {
    display: none;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.station-library.show-categories .category-list {
    display: flex;
}

.category-chip {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.category-chip.active {
    border-color: rgba(var(--accent-rgb), 0.5);
    background: rgba(var(--accent-rgb), 0.16);
    color: var(--text-main);
}

.library-summary {
    min-height: 18px;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.library-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.library-pagination-info {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.library-page-btn {
    min-width: 88px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 11px;
    background: rgba(255,255,255,0.055);
    color: var(--text-main);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, opacity 0.16s ease;
}

.library-page-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(255,255,255,0.085);
}

.library-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.library-page-btn svg {
    flex: 0 0 auto;
}

.library-list {
    min-height: 0;
    margin: 0;
    padding: 2px 8px 2px 0;
    list-style: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-rgb), 0.72) rgba(255,255,255,0.06);
    mask-image: linear-gradient(to bottom, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.library-list::-webkit-scrollbar {
    width: 12px;
}

.library-list::-webkit-scrollbar-track {
    margin-block: 6px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-3-rgb), 0.08)),
        rgba(255,255,255,0.045);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}

.library-list::-webkit-scrollbar-thumb {
    min-height: 56px;
    border: 3px solid transparent;
    border-radius: 999px;
    background:
        linear-gradient(180deg, var(--accent), var(--accent-3)) padding-box,
        rgba(255,255,255,0.12) border-box;
    box-shadow:
        0 0 16px rgba(var(--accent-rgb), 0.24),
        inset 0 0 0 1px rgba(255,255,255,0.18);
}

.library-list::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(180deg, var(--accent), var(--accent-2)) padding-box,
        rgba(255,255,255,0.18) border-box;
}

.library-empty {
    padding: 18px 14px;
    border: 1px dashed rgba(255,255,255,0.16);
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.35;
    background: rgba(255,255,255,0.035);
}

.library-station {
    width: 100%;
    min-width: 0;
    min-height: 72px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 34px;
    gap: 11px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 17px;
    background: rgba(255,255,255,0.052);
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.library-station:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(255,255,255,0.085);
}

.library-station.current {
    border-color: rgba(var(--accent-rgb), 0.56);
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-3-rgb), 0.1)),
        rgba(255,255,255,0.05);
}

.library-station-logo,
.library-station-fallback {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
}

.library-station-logo {
    object-fit: contain;
    padding: 7px;
}

.library-station-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 850;
}

.library-station-copy {
    min-width: 0;
    display: grid;
    gap: 6px;
    overflow: hidden;
}

.library-station-title-row {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.library-station-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.94rem;
    font-weight: 850;
    line-height: 1.12;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-station-meta {
    display: flex;
    flex-wrap: nowrap;
    min-width: 0;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    overflow: hidden;
}

.library-station-country,
.library-station-tech {
    flex: 0 0 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.library-station-tech {
    color: var(--text-soft);
}

.library-station-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.station-info-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 132, 132, 0.32);
    border-radius: 999px;
    background: rgba(255, 132, 132, 0.14);
    color: #ffc2c2;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    user-select: none;
}

.station-info-indicator:focus-visible {
    outline: 2px solid rgba(255, 184, 184, 0.62);
    outline-offset: 2px;
}

.station-info-indicator-inline {
    flex: 0 0 auto;
}

.station-info-indicator-inline.station-info-indicator-neutral {
    margin-top: 1px;
}

.station-info-indicator-neutral {
    border-color: rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    color: var(--text-soft);
}

.station-info-indicator-neutral:hover {
    border-color: rgba(var(--accent-rgb), 0.32);
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--text-main);
}

.favorite-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 12px;
    background: rgba(255,255,255,0.055);
    color: var(--text-soft);
    font-size: 1.06rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.14s ease, color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.favorite-btn:hover {
    transform: scale(1.05);
    color: var(--text-main);
}

.favorite-btn.active {
    border-color: rgba(var(--accent-2-rgb), 0.48);
    background: rgba(var(--accent-2-rgb), 0.14);
    color: var(--accent-2);
}

.starfield {
    display: none;
}

.starfield-plane {
    position: absolute;
    inset: -8%;
    transform-style: preserve-3d;
    animation: starfield-tilt 18s ease-in-out infinite alternate;
}

.star {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--star-size);
    height: var(--star-size);
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    box-shadow:
        0 0 12px rgba(255,255,255,0.72),
        0 0 28px rgba(var(--accent-rgb),0.52);
    opacity: 0;
    transform-style: preserve-3d;
    animation: star-tunnel var(--star-duration) linear infinite;
    animation-delay: var(--star-delay);
}

.star::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--star-size) * 7);
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, currentColor, transparent);
    opacity: 0.38;
    transform: translate(-100%, -50%);
}

.star:nth-child(3n) {
    color: rgba(var(--accent-rgb),0.95);
    background: rgba(var(--accent-rgb),0.86);
    box-shadow: 0 0 16px rgba(var(--accent-rgb),0.76);
}

.star:nth-child(4n) {
    color: rgba(var(--accent-2-rgb),0.9);
    background: rgba(var(--accent-2-rgb),0.72);
    box-shadow: 0 0 16px rgba(var(--accent-2-rgb),0.58);
}

.star:nth-child(7n) {
    filter: blur(1px);
}

@keyframes starfield-tilt {
    from {
        transform: rotateX(7deg) rotateY(-10deg) translateX(-1.2%);
    }
    to {
        transform: rotateX(-4deg) rotateY(11deg) translateX(1.5%);
    }
}

@keyframes star-tunnel {
    0% {
        opacity: 0;
        transform: translate3d(var(--x0), var(--y0), -680px) scale(0.22);
    }
    12% {
        opacity: 0.36;
    }
    58% {
        opacity: 0.92;
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--x1), var(--y1), 260px) scale(1.65);
    }
}

.glass-card {
    position: relative;
    z-index: 2;
    overflow: hidden;
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch;
    margin-bottom: 0;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(300px, 0.92fr) minmax(340px, 1.08fr);
    grid-template-areas:
        "header header"
        "artwork info"
        "artwork controls"
        "artwork volume"
        "artwork session"
        "quickpick quickpick"
        "legal legal";
    gap: 18px 28px;
    align-items: start;
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(var(--accent-rgb), 0.1), transparent 42%),
        linear-gradient(315deg, rgba(var(--accent-2-rgb), 0.08), transparent 36%),
        linear-gradient(180deg, rgba(var(--theme-panel-rgb), 0.72), rgba(255,255,255,0.03));
    box-shadow: var(--shadow);
    backdrop-filter: blur(26px) saturate(135%);
    transform: translateY(-4px) scale(0.993);
    transform-origin: center center;
    will-change: transform;
    transition:
        background 0.45s ease,
        border-color 0.45s ease,
        box-shadow 0.46s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
}

.player-layout.library-collapsed .glass-card {
    transform: translateY(0) scale(1);
    box-shadow: 0 24px 56px rgba(0,0,0,0.28);
}

.glass-card > :not(.starfield):not(.overlay) {
    position: relative;
    z-index: 2;
}

.glass-card > .overlay {
    position: fixed;
    z-index: 1000;
}

header {
    grid-area: header;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand-block {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.18);
}

.brand-copy {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.app-title {
    min-width: 0;
    font-size: clamp(1rem, 2vw, 1.18rem);
    font-weight: 800;
    letter-spacing: 0;
    color: var(--text-main);
}

.datetime {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    color: var(--text-muted);
    white-space: nowrap;
}

.datetime-time {
    color: var(--text-main);
    font-size: 0.98rem;
    font-weight: 850;
}

.datetime-date {
    font-size: 0.82rem;
    font-weight: 700;
}

.header-icons-left {
    order: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.header-close {
    display: none;
}

.icon-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.065);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
    -webkit-app-region: no-drag;
}

.icon-btn:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.11);
}

.icon-btn.small {
    width: 40px;
    height: 40px;
}

.artwork-section {
    grid-area: artwork;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.artwork-stack {
    width: min(100%, 410px);
    display: grid;
    justify-items: center;
    gap: 18px;
}

.quickpick-section {
    grid-area: quickpick;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.legal-links {
    grid-area: legal;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-top: 8px;
}

.legal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.legal-link[data-variant="about"] {
    color: var(--accent-3);
}

.legal-link[data-variant="docs"] {
    color: var(--accent-2);
}

.legal-link[data-variant="privacy"] {
    color: var(--text-muted);
}

.legal-link:hover {
    color: var(--text-main);
    border-color: rgba(var(--accent-rgb), 0.35);
    background: rgba(var(--accent-rgb), 0.09);
    transform: translateY(-1px);
}

.legal-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-color: rgba(var(--accent-rgb), 0.35);
}

.artwork-container {
    width: min(100%, 360px);
    aspect-ratio: 1;
    padding: 10px;
    border-radius: 32px;
    background: linear-gradient(145deg, rgba(255,255,255,0.16), rgba(255,255,255,0.04));
    border: 1px solid var(--border);
    box-shadow: 0 28px 72px rgba(0,0,0,0.36);
}

.artwork-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 24px;
    isolation: isolate;
    cursor: pointer;
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.9), rgba(var(--accent-3-rgb), 0.72) 48%, rgba(var(--accent-2-rgb), 0.86));
    box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.26);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.45s ease;
}

.artwork-placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(120deg, rgba(255,255,255,0.26), transparent 34%),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 12px);
    opacity: 0.62;
    animation: artwork-sheen 9s ease-in-out infinite alternate;
}

.artwork-placeholder::after {
    content: "";
    position: absolute;
    inset: -18%;
    border-radius: inherit;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    mix-blend-mode: screen;
    transform: translate3d(-10%, -10%, 0) rotate(0deg);
    filter: blur(0.5px) drop-shadow(0 0 16px rgba(255,255,255,0.26));
    background:
        linear-gradient(120deg, transparent 28%, rgba(255,255,255,0.24) 42%, rgba(255,255,255,0.86) 50%, rgba(255,255,255,0.26) 58%, transparent 72%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.74), transparent 60%);
}

.artwork-placeholder.shine-sweep::after {
    opacity: 1;
    animation: artwork-shine-sweep 2.6s ease-out forwards;
}

.artwork-placeholder.shine-glint::after {
    opacity: 1;
    background:
        radial-gradient(circle at 22% 28%, rgba(255,255,255,0.92) 0 8%, transparent 13%),
        radial-gradient(circle at 72% 34%, rgba(var(--accent-3-rgb), 0.56) 0 10%, transparent 16%),
        radial-gradient(circle at 52% 58%, rgba(255,255,255,0.24), transparent 36%);
    animation: artwork-shine-glint 2.2s ease-out forwards;
}

.artwork-placeholder.shine-flare::after {
    opacity: 1;
    background:
        radial-gradient(circle at 48% 42%, rgba(255,255,255,0.95) 0 4%, transparent 12%),
        radial-gradient(circle at 52% 48%, rgba(255,255,255,0.30) 0 18%, transparent 42%),
        linear-gradient(135deg, transparent 35%, rgba(var(--accent-rgb), 0.34) 50%, transparent 66%);
    animation: artwork-shine-flare 2.4s ease-out forwards;
}

@keyframes artwork-shine-sweep {
    0% {
        opacity: 0;
        transform: translate3d(-26%, -10%, 0) rotate(11deg);
    }
    12% {
        opacity: 0.95;
    }
    58% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate3d(26%, 10%, 0) rotate(11deg);
    }
}

@keyframes artwork-shine-glint {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }
    18% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.06);
    }
}

@keyframes artwork-shine-flare {
    0% {
        opacity: 0;
        transform: scale(0.84);
    }
    18% {
        opacity: 0.95;
        transform: scale(1);
    }
    60% {
        opacity: 0.55;
    }
    100% {
        opacity: 0;
        transform: scale(1.12);
    }
}

@keyframes artwork-sheen {
    from {
        transform: translateX(-3%) translateY(-2%);
        opacity: 0.5;
    }
    to {
        transform: translateX(4%) translateY(3%);
        opacity: 0.72;
    }
}

.artwork-placeholder:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 55px rgba(0, 0, 0, 0.2), 0 18px 42px rgba(var(--accent-rgb), 0.18);
}

.station-logo-img {
    position: relative;
    z-index: 2;
    width: 88%;
    height: 88%;
    object-fit: contain;
    padding: 14px;
    border-radius: 18px;
    cursor: pointer;
}

.station-logo-text {
    position: relative;
    z-index: 2;
    max-width: 88%;
    color: var(--text-main);
    font-size: clamp(2.2rem, 8vw, 4.2rem);
    font-weight: 850;
    line-height: 1;
    text-align: center;
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.36);
    cursor: pointer;
}

.station-logo-text.logo-name {
    font-size: clamp(1.5rem, 4.8vw, 2.8rem);
    line-height: 1.05;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.artwork-coverflow {
    position: relative;
    width: 100%;
    max-width: none;
    height: 128px;
    overflow: hidden;
    -webkit-app-region: no-drag;
}

.artwork-coverflow-stage {
    position: absolute;
    inset: 0 44px;
    z-index: 1;
    perspective: 900px;
    transform-style: preserve-3d;
}

.coverflow-item {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 92px;
    height: 82px;
    border-radius: 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(0,0,0,0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
    will-change: transform, opacity;
}

.coverflow-item.selected {
    background: rgba(var(--accent-rgb), 0.16);
    border-color: rgba(var(--accent-rgb), 0.48);
    box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18);
}

.coverflow-item:not(.selected):hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.28);
}

/* ── Coverflow sparkle effects (box-shadow / border — no ::after needed) ── */

.coverflow-item.icon-flash,
.coverflow-item.icon-gradient-sweep,
.coverflow-item.icon-glow-pulse {
    /* Disable transition so CSS animation isn't fought by transition interpolation */
    transition: none !important;
}

.coverflow-item.icon-flash {
    animation: icon-flash 0.8s ease-out forwards;
}

.coverflow-item.icon-gradient-sweep {
    animation: icon-gradient-sweep 1.1s ease-out forwards;
}

.coverflow-item.icon-glow-pulse {
    animation: icon-glow-pulse 1.4s ease-out forwards;
}

/* Selected variants — start/end from the accent-tinted baseline */
.coverflow-item.selected.icon-flash {
    animation: icon-flash-selected 0.8s ease-out forwards;
}
.coverflow-item.selected.icon-gradient-sweep {
    animation: icon-gradient-sweep-selected 1.1s ease-out forwards;
}
.coverflow-item.selected.icon-glow-pulse {
    animation: icon-glow-pulse-selected 1.4s ease-out forwards;
}

/* Non-selected */
@keyframes icon-flash {
    0%   { box-shadow: 0 12px 28px rgba(0,0,0,0.28); border-color: var(--border); }
    20%  { box-shadow: 0 0 0 3px rgba(255,255,255,0.9), 0 0 22px 4px rgba(255,255,255,0.55); border-color: rgba(255,255,255,0.95); }
    55%  { box-shadow: 0 0 0 2px rgba(255,255,255,0.4), 0 0 12px 2px rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); }
    100% { box-shadow: 0 12px 28px rgba(0,0,0,0.28); border-color: var(--border); }
}

@keyframes icon-gradient-sweep {
    0%   { box-shadow: 0 12px 28px rgba(0,0,0,0.28); border-color: var(--border); background: rgba(255,255,255,0.08); }
    15%  { border-color: rgba(var(--accent-rgb), 0.9); }
    40%  { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.8), 0 0 24px 6px rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 1); }
    80%  { box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.3), 0 12px 28px rgba(0,0,0,0.28); background: rgba(255,255,255,0.08); }
    100% { box-shadow: 0 12px 28px rgba(0,0,0,0.28); border-color: var(--border); background: rgba(255,255,255,0.08); }
}

@keyframes icon-glow-pulse {
    0%   { box-shadow: 0 12px 28px rgba(0,0,0,0.28); border-color: var(--border); }
    30%  { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.85), 0 0 28px 8px rgba(var(--accent-rgb), 0.5); border-color: rgba(var(--accent-rgb), 1); }
    65%  { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.4), 0 8px 28px rgba(var(--accent-rgb), 0.25); border-color: rgba(var(--accent-rgb), 0.55); }
    100% { box-shadow: 0 12px 28px rgba(0,0,0,0.28); border-color: var(--border); }
}

/* Selected variants */
@keyframes icon-flash-selected {
    0%   { box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 0.48); }
    20%  { box-shadow: 0 0 0 3px rgba(255,255,255,0.95), 0 0 26px 6px rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.95); }
    55%  { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.6), 0 0 16px 3px rgba(var(--accent-rgb), 0.35); border-color: rgba(var(--accent-rgb), 0.75); }
    100% { box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 0.48); }
}

@keyframes icon-gradient-sweep-selected {
    0%   { box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 0.48); }
    40%  { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 1), 0 0 32px 8px rgba(var(--accent-rgb), 0.6); border-color: rgba(var(--accent-rgb), 1); }
    100% { box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 0.48); }
}

@keyframes icon-glow-pulse-selected {
    0%   { box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 0.48); }
    30%  { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 1), 0 0 32px 10px rgba(var(--accent-rgb), 0.65); border-color: rgba(var(--accent-rgb), 1); }
    65%  { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.55), 0 8px 28px rgba(var(--accent-rgb), 0.38); border-color: rgba(var(--accent-rgb), 0.7); }
    100% { box-shadow: 0 14px 34px rgba(var(--accent-rgb), 0.18); border-color: rgba(var(--accent-rgb), 0.48); }
}

.coverflow-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.coverflow-item.fallback {
    padding: 10px;
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.08;
    text-align: center;
}

.coverflow-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(12, 15, 20, 0.68);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
    transform: translateY(-50%);
}

.coverflow-arrow.left { left: 0; }
.coverflow-arrow.right { right: 0; }

.track-info {
    grid-area: info;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.track-info h2 {
    width: 100%;
    margin: 0;
    font-size: clamp(2.1rem, 4.5vw, 3.1rem);
    font-weight: 850;
    line-height: 0.96;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

#now-playing {
    width: 100%;
    min-height: 58px;
    margin-top: 18px;
}

#now-playing .now-artist,
#now-playing .now-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#now-playing .now-artist {
    color: var(--accent);
    font-size: clamp(1rem, 2vw, 1.18rem);
    font-weight: 800;
}

#now-playing .now-title {
    margin-top: 3px;
    color: var(--text-main);
    font-size: clamp(0.96rem, 1.6vw, 1.08rem);
    font-weight: 600;
}

#now-playing.hidden {
    visibility: hidden;
}

.track-info p {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.station-meta-row {
    width: 100%;
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.station-health-summary {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 0;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
}

.station-health-summary-info {
    border-color: rgba(255, 132, 132, 0.34);
    background: rgba(255, 132, 132, 0.14);
    color: #ffd0d0;
}

.station-health-summary-healthy {
    border-color: rgba(132,242,168,0.34);
    background: rgba(132,242,168,0.14);
    color: #b6ffd0;
}

.station-health-summary-warning {
    border-color: rgba(255, 184, 77, 0.34);
    background: rgba(255, 184, 77, 0.14);
    color: #ffd99a;
}

.station-health-summary-proxy {
    border-color: rgba(255, 132, 132, 0.32);
    background: rgba(255, 132, 132, 0.14);
    color: #ffc2c2;
}

.station-health-detail {
    margin-top: 7px;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.35;
    max-width: 54ch;
}

.station-health-detail-warning {
    color: #ffd99a;
}

.station-health-detail-proxy {
    color: #ffc2c2;
}

.session-summary-btn {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-3-rgb), 0.08)),
        rgba(255,255,255,0.045);
    color: var(--text-main);
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.session-summary-section {
    grid-area: session;
}

.session-summary-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.34);
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}

.session-summary-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: var(--accent);
}

.session-summary-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.session-summary-label {
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 850;
}

.session-summary-text {
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-scheduler-btn {
    position: relative;
}

.session-scheduler-btn.session-active {
    border-color: rgba(var(--accent-rgb), 0.42);
    background: rgba(var(--accent-rgb), 0.14);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.08), 0 10px 22px rgba(var(--accent-rgb), 0.16);
}

.session-scheduler-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.85);
}

.session-scheduler-modal {
    width: min(760px, 100%);
    gap: 18px;
    padding: 26px;
    border-color: rgba(var(--accent-rgb), 0.18);
    background:
        radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(var(--accent-3-rgb), 0.12), transparent 32%),
        var(--panel-strong);
}

.session-scheduler-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.session-scheduler-eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.session-scheduler-intro {
    max-width: 52ch;
    margin: 10px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.session-scheduler-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.session-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 22px;
    background: rgba(255,255,255,0.045);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.session-panel-sleep {
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.08), transparent 55%),
        rgba(255,255,255,0.045);
}

.session-panel-wake {
    background:
        linear-gradient(180deg, rgba(var(--accent-3-rgb), 0.1), transparent 55%),
        rgba(255,255,255,0.045);
}

.session-panel-heading {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.session-panel-icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    color: var(--accent);
}

.session-panel-heading h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.02rem;
    font-weight: 850;
}

.session-panel-heading p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.45;
}

.session-tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.session-chip,
.session-link-btn {
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    font: inherit;
    font-weight: 800;
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.session-chip {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.8rem;
}

.session-chip.secondary {
    color: var(--text-soft);
}

.session-chip.active,
.session-chip:hover,
.session-link-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.4);
    background: rgba(var(--accent-rgb), 0.14);
    box-shadow: 0 10px 18px rgba(0,0,0,0.12);
}

.session-tool-status {
    margin-top: 14px;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
}

.session-tool-status-strong {
    color: var(--text-main);
}

.session-scheduler-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.session-scheduler-footnote {
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.4;
}

.session-scheduler-footer .btn {
    width: auto;
    min-width: 140px;
}

.song-history-panel {
    width: 100%;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    background: rgba(255,255,255,0.045);
}

.song-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.song-history-header h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 850;
}

.session-link-btn {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.74rem;
}

.song-history-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.song-history-item {
    min-width: 0;
}

.song-history-track {
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-history-meta {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 700;
}

.status-indicator-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1;
}

.managed-catalog-status {
    margin-top: 8px;
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.quickpick-sync-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: min(340px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 24;
    text-align: left;
}

.quickpick-sync-info .managed-catalog-status,
.quickpick-sync-info .catalog-sync-history {
    margin-top: 0;
}

.catalog-sync-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    width: fit-content;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: none;
}

.catalog-sync-status.is-warning {
    color: #ff9db0;
}

.catalog-sync-status-time {
    color: var(--text-muted);
    font-weight: 700;
}

.catalog-sync-status-time:not(:empty)::before {
    content: "·";
    margin-right: 8px;
    color: var(--text-soft);
}

.catalog-sync-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7);
}

.catalog-sync-status.is-warning::before {
    background: var(--danger);
    box-shadow: 0 0 10px rgba(255, 112, 135, 0.7);
}

.catalog-sync-history {
    color: var(--text-soft);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

@media (max-width: 760px) {
    .quickpick-sync-info {
        display: none !important;
    }
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 12px var(--success);
}

.engine-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.engine-badge svg {
    width: 13px;
    height: 13px;
}

.engine-cast {
    border-color: rgba(143,179,255,0.48);
    box-shadow: 0 0 14px rgba(143,179,255,0.12);
}

.engine-airplay {
    border-color: rgba(77,215,200,0.52);
    box-shadow: 0 0 14px rgba(77,215,200,0.14);
}

.engine-html {
    border-color: rgba(255,255,255,0.18);
}

.cast-output-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.cast-output-label {
    color: var(--text-soft);
    font-size: 0.8rem;
}

.cast-output-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.07);
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
}

.cast-output-toggle[aria-pressed="true"] {
    border-color: rgba(132,242,168,0.5);
    background: rgba(132,242,168,0.12);
    color: var(--success);
}

.controls-section {
    grid-area: controls;
    display: grid;
    grid-template-columns: 64px 96px 64px;
    justify-content: center;
    align-items: center;
    gap: 18px;
}

.control-btn {
    border: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.control-btn:hover {
    transform: translateY(-2px);
}

.control-btn:active {
    transform: scale(0.96);
}

.control-btn.secondary {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
}

.control-btn.primary {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    background: linear-gradient(145deg, var(--accent), var(--accent-3));
    box-shadow: 0 18px 42px rgba(var(--accent-rgb), 0.24), inset 0 1px 0 rgba(255,255,255,0.28);
}

.control-btn.primary.playing {
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% {
        box-shadow: 0 18px 42px rgba(var(--accent-rgb), 0.24), 0 0 0 0 rgba(var(--accent-rgb), 0.34);
    }
    50% {
        box-shadow: 0 18px 42px rgba(var(--accent-rgb), 0.24), 0 0 0 10px rgba(var(--accent-rgb), 0);
    }
}

.icon-container {
    position: relative;
    width: 34px;
    height: 34px;
}

.icon-container svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.volume-section {
    grid-area: volume;
    width: 100%;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
}

.slider-container {
    min-width: 0;
}

input[type=range] {
    width: 100%;
    height: 28px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

input[type=range]::-webkit-slider-runnable-track {
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
}

input[type=range]::-webkit-slider-thumb {
    width: 19px;
    height: 19px;
    margin-top: -6px;
    border: 3px solid var(--page-bg);
    border-radius: 50%;
    background: var(--accent);
    -webkit-appearance: none;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.24), 0 8px 16px rgba(0,0,0,0.24);
}

#volume-value {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    text-align: right;
}

.install-prompt-banner {
    display: none;
}

.hidden {
    display: none !important;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(7, 10, 14, 0.68);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    width: min(860px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    display: flex;
    flex-direction: column;
    padding: 22px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    color: var(--text-main);
    animation: pop 0.2s ease;
}

@keyframes pop {
    from { transform: translateY(10px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal h2 {
    margin: 0 0 16px;
    font-size: clamp(1.18rem, 2.5vw, 1.5rem);
    font-weight: 850;
    letter-spacing: 0;
}

.shortcut-help-modal {
    max-width: min(460px, calc(100vw - 32px));
}

.shortcut-help-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.shortcut-help-list li {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(255,255,255,0.045);
}

.shortcut-help-list kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    border-radius: 10px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 850;
}

.device-list {
    list-style: none;
    padding: 2px;
    margin: 0 0 18px;
    overflow-y: auto;
}

.stations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}

.station-card,
.device {
    list-style: none;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.055);
    transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.station-card {
    min-height: 88px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    cursor: pointer;
}

.station-card:hover,
.device:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    background: rgba(255,255,255,0.09);
}

.station-card.selected {
    border-color: rgba(var(--accent-rgb), 0.52);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-3-rgb), 0.12));
}

.station-card-left {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.station-card-logo,
.station-card-fallback {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
}

.station-card-logo {
    object-fit: contain;
    padding: 8px;
}

.station-card-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 850;
}

.station-card-body {
    min-width: 0;
}

.station-card-title {
    color: var(--text-main);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.12;
}

.station-card-sub {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.station-card-health {
    margin-top: 7px;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.2;
}

.station-card-health-healthy {
    border-color: rgba(132,242,168,0.34);
    background: rgba(132,242,168,0.14);
    color: #b6ffd0;
}

.station-card-health-warning {
    border-color: rgba(255, 184, 77, 0.34);
    background: rgba(255, 184, 77, 0.14);
    color: #ffd99a;
}

.station-card-health-proxy {
    border-color: rgba(255, 132, 132, 0.32);
    background: rgba(255, 132, 132, 0.14);
    color: #ffc2c2;
}

.device {
    margin-bottom: 10px;
    padding: 13px 14px;
    border-radius: 14px;
}

.device-main {
    color: var(--text-main);
    font-size: 0.94rem;
    font-weight: 800;
}

.device-sub {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.editor-station-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.editor-station-copy {
    min-width: 0;
}

.editor-station-actions,
.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.editor-tools .btn {
    flex: 1 1 160px;
}

.hidden-file-input {
    display: none;
}

.editor-note {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.editor-note strong {
    color: var(--text-main);
}

.editor-note-subtle {
    margin-top: -4px;
    font-size: 0.78rem;
}

.editor-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: -4px 0 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.editor-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.country-selection-modal {
    width: min(780px, 100%);
}

.country-selection-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.country-selection-search {
    margin: 0;
}

.country-selection-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.country-selection-actions .btn {
    min-width: 148px;
}

.country-selection-list {
    max-height: min(48vh, 420px);
    padding-right: 4px;
}

.country-selection-item {
    margin-bottom: 8px;
    padding: 0;
    overflow: hidden;
}

.country-selection-option {
    display: grid;
    grid-template-columns: 18px 1.4rem minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px 14px;
    cursor: pointer;
}

.country-selection-option input {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--accent);
}

.country-selection-option input:disabled {
    cursor: not-allowed;
}

.country-selection-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1rem;
    margin-top: 3px;
    font-size: 1rem;
    line-height: 1;
    flex: 0 0 auto;
}

.country-selection-flag-img {
    display: block;
    width: 1.4rem;
    height: 1rem;
    object-fit: cover;
    border-radius: 2px;
}

.country-selection-copy {
    min-width: 0;
}

.country-selection-footer {
    justify-content: flex-end;
    margin-top: 8px;
}

.field-row {
    margin-bottom: 10px;
}

.modal input,
.modal textarea,
.modal select {
    width: 100%;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.06);
    color: var(--text-main);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.modal input::placeholder,
.modal textarea::placeholder {
    color: var(--text-soft);
}

.btn {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-main);
    background: rgba(255,255,255,0.09);
    font-weight: 800;
    transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(255,255,255,0.13);
}

.btn.cancel {
    width: 100%;
    color: #0c1819;
    background: var(--accent);
}

.btn.secondary {
    background: rgba(255,255,255,0.08);
}

.btn.edit-btn {
    color: #071314;
    background: var(--accent);
}

.btn.delete-btn {
    background: rgba(255, 112, 135, 0.16);
    color: #ffd3db;
    border-color: rgba(255, 112, 135, 0.25);
}

#add-station-form {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
}

.cast-btn,
.install-btn {
    width: auto;
    padding: 0 12px;
    gap: 8px;
}

.cast-btn span,
.install-btn span {
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1;
}

.cast-btn:not(.cast-ready) {
    color: var(--text-soft);
}

.cast-btn.cast-active,
.cast-btn.cast-ready:hover {
    border-color: rgba(143,179,255,0.5);
    background: rgba(143,179,255,0.14);
}

.cast-btn.cast-airplay-active,
.cast-btn.cast-airplay-active:hover {
    border-color: rgba(77,215,200,0.56);
    background: rgba(77,215,200,0.15);
}

@media (max-width: 1100px) {
    body.library-open {
        overflow: hidden;
    }

    .player-layout {
        height: auto;
        min-height: min(720px, calc(100vh - 48px));
        width: min(1060px, 100%);
    }

    .player-layout.library-collapsed {
        width: min(1060px, 100%);
    }

    .sidebar-wrap {
        display: contents;
    }

    .station-library {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 1200;
        min-height: 0;
        height: auto;
        max-height: min(82vh, 720px);
        grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
        padding: 18px;
        border-radius: 24px;
        transform: translateY(calc(100% + 24px));
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.24s ease, opacity 0.24s ease, visibility 0.24s ease;
    }

    .station-library.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .library-close {
        display: inline-flex;
    }

    .library-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-height: 780px) and (min-width: 761px) {
    .player-layout {
        height: calc(100vh - 72px);
    }

    .glass-card {
        grid-template-columns: minmax(250px, 0.8fr) minmax(300px, 1.2fr);
        grid-template-areas:
            "header header"
            "artwork info"
            "artwork controls"
            "artwork volume"
            "artwork session"
            "quickpick quickpick"
            "legal legal";
        gap: 14px 22px;
        padding: 22px;
    }

    .artwork-container {
        width: min(100%, 300px);
        padding: 8px;
        border-radius: 26px;
    }

    .artwork-placeholder {
        border-radius: 20px;
    }

    .station-logo-img {
        padding: 10px;
    }

    .track-info h2 {
        font-size: clamp(1.9rem, 4vw, 2.8rem);
    }

    .station-meta-row {
        margin-top: 10px;
        gap: 8px;
    }

    .session-summary-btn {
        padding: 11px;
    }

    .song-history-panel {
        margin-top: 12px;
        padding: 12px;
    }

    .controls-section {
        grid-template-columns: 56px 84px 56px;
        gap: 14px;
        margin-top: 8px;
    }

    .control-btn.secondary {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    .control-btn.primary {
        width: 84px;
        height: 84px;
        border-radius: 24px;
    }

    .icon-container {
        width: 30px;
        height: 30px;
    }

    .volume-section {
        grid-template-columns: 38px minmax(0, 1fr) 44px;
        gap: 10px;
    }

    .quickpick-section {
        align-self: end;
    }

    .artwork-coverflow {
        height: 108px;
    }

    .coverflow-item {
        width: 82px;
        height: 72px;
        border-radius: 18px;
    }

    .coverflow-item img {
        padding: 8px;
    }

    .legal-links {
        margin-top: 0;
    }
}

@media (max-height: 700px) and (min-width: 761px) {
    .player-layout {
        height: calc(100vh - 32px);
        width: min(1280px, 100%);
    }

    .glass-card {
        grid-template-columns: minmax(220px, 0.78fr) minmax(300px, 1.22fr);
        grid-template-areas:
            "header header"
            "artwork info"
            "artwork controls"
            "artwork volume"
            "artwork session"
            "quickpick quickpick"
            "legal legal";
        gap: 12px 18px;
        padding: 18px 20px;
    }

    .header-top-row {
        gap: 12px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 12px;
    }

    .brand-copy {
        gap: 10px;
    }

    .app-title {
        font-size: 1rem;
    }

    .datetime-time {
        font-size: 0.9rem;
    }

    .datetime-date {
        font-size: 0.76rem;
    }

    .icon-btn {
        width: 38px;
        height: 38px;
        border-radius: 11px;
    }

    .artwork-container {
        width: min(100%, 260px);
        padding: 7px;
        border-radius: 22px;
    }

    .artwork-placeholder {
        border-radius: 18px;
    }

    .track-info h2 {
        font-size: clamp(1.7rem, 3.6vw, 2.5rem);
        line-height: 0.94;
    }

    #now-playing {
        min-height: 44px;
        margin-top: 12px;
    }

    .track-info p {
        margin-top: 9px;
        font-size: 0.9rem;
    }

    .station-meta-row {
        margin-top: 9px;
        gap: 7px;
    }

    .station-health-summary {
        padding: 4px 9px;
        font-size: 0.72rem;
    }

    .status-indicator-wrap {
        gap: 7px;
        font-size: 0.76rem;
    }

    .engine-badge {
        padding: 4px 8px;
        font-size: 0.68rem;
    }

    .station-health-detail {
        margin-top: 6px;
        font-size: 0.78rem;
    }

    .song-history-panel {
        margin-top: 10px;
        padding: 10px 12px;
    }

    .song-history-list {
        gap: 8px;
    }

    .controls-section {
        grid-template-columns: 48px 72px 48px;
        gap: 12px;
        margin-top: 12px;
    }

    .control-btn.secondary {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .control-btn.primary {
        width: 72px;
        height: 72px;
        border-radius: 22px;
    }

    .icon-container {
        width: 26px;
        height: 26px;
    }

    .volume-section {
        grid-template-columns: 36px minmax(0, 1fr) 42px;
        gap: 8px;
        margin-top: 2px;
    }

    .session-summary-btn {
        padding: 10px 11px;
        border-radius: 16px;
    }

    .session-summary-icon {
        width: 34px;
        height: 34px;
        border-radius: 11px;
    }

    .session-summary-label {
        font-size: 0.8rem;
    }

    .session-summary-text {
        font-size: 0.72rem;
    }

    .artwork-coverflow {
        height: 88px;
    }

    .coverflow-item {
        width: 70px;
        height: 62px;
        border-radius: 16px;
    }

    .coverflow-item img {
        padding: 7px;
    }

    .legal-link {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 760px) {
    body {
        overflow: hidden;
    }

    .app-container {
        align-items: stretch;
        padding: 0;
        min-height: 100dvh;
    }

    .player-layout {
        width: 100%;
        min-height: 0;
        height: 100dvh;
    }

    .glass-card {
        height: 100dvh;
        min-height: 100dvh;
        width: 100%;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto auto auto;
        grid-template-areas:
            "header"
            "artwork"
            "info"
            "controls"
            "volume"
            "session"
            "quickpick"
            "legal";
        gap: 9px;
        padding: 10px 12px 108px;
        border-radius: 22px;
        overflow: hidden;
    }

    .header-top-row {
        gap: 8px;
    }

    .brand-block {
        gap: 8px;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 11px;
    }

    .app-title {
        font-size: 0.96rem;
    }

    .datetime {
        gap: 5px;
    }

    .datetime-time {
        font-size: 0.88rem;
    }

    .datetime-date {
        font-size: 0.72rem;
    }

    .header-icons-left {
        gap: 4px;
    }

    .library-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .library-tab {
        min-height: 36px;
        border-radius: 11px;
    }

    .library-tab-icon {
        width: 17px;
        height: 17px;
    }

    .station-library {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
        max-height: 86vh;
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
        padding: 15px;
        border-radius: 22px;
        gap: 11px;
        grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    }

    .library-top h2 {
        font-size: 1.18rem;
    }

    .library-tabs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .library-filter-grid {
        grid-template-columns: 1fr;
    }

    .session-scheduler-grid {
        grid-template-columns: 1fr;
    }

    .session-scheduler-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .session-scheduler-footer .btn {
        width: 100%;
    }

    .library-select-menu {
        max-height: 240px;
    }

    .library-list {
        -webkit-overflow-scrolling: touch;
        mask-image: none;
        padding-right: 0;
        padding-bottom: 10px;
    }

    .library-tab {
        min-width: 0;
        min-height: 34px;
    }

    .library-station {
        min-height: 66px;
        grid-template-columns: 44px minmax(0, 1fr) 32px;
        gap: 9px;
        padding: 9px;
        border-radius: 15px;
    }

    .library-station-logo,
    .library-station-fallback {
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .favorite-btn {
        width: 32px;
        height: 32px;
        border-radius: 11px;
    }

    .brand-block {
        gap: 9px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 12px;
    }

    .brand-copy {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .app-title {
        font-size: 1rem;
    }

    .datetime {
        gap: 7px;
    }

    .datetime-time {
        font-size: 0.92rem;
    }

    .datetime-date {
        font-size: 0.76rem;
    }

    .header-icons-left {
        gap: 6px;
    }

    #edit-stations-btn,
    #install-app-btn {
        display: none;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .cast-btn,
    .install-btn {
        width: 40px;
        min-width: 40px;
        padding: 0;
    }

    .cast-btn span,
    .install-btn span {
        display: none;
    }

    .artwork-section {
        align-self: center;
    }

    #station-health-detail {
        display: none !important;
    }

    .artwork-stack {
        width: 100%;
        gap: 6px;
    }

    .artwork-container {
        width: min(34vw, 132px, 22dvh);
        max-height: min(132px, 22dvh);
        padding: 4px;
        border-radius: 18px;
    }

    .artwork-placeholder {
        border-radius: 16px;
    }

    .station-logo-img {
        width: 72%;
        height: 72%;
        padding: 6px;
    }

    .station-logo-text {
        font-size: clamp(1rem, 4.8vw, 1.55rem);
    }

    .artwork-coverflow {
        width: min(100%, calc(100vw - 42px));
        height: 72px;
        margin-inline: auto;
    }

    .artwork-coverflow-stage {
        inset: 0 38px;
    }

    .coverflow-item {
        width: 60px;
        height: 52px;
        border-radius: 14px;
    }

    .coverflow-item.fallback {
        font-size: 0.66rem;
    }

    .coverflow-arrow {
        width: 32px;
        height: 32px;
        background: rgba(12, 15, 20, 0.78);
    }

    .track-info {
        min-height: 72px;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .track-info h2 {
        font-size: clamp(1.45rem, 8vw, 2.25rem);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: clip;
    }

    .track-info h2.station-title-marquee {
        overflow: hidden;
    }

    .track-info h2.station-title-marquee .station-title-track {
        display: inline-flex;
        width: max-content;
        animation: station-title-scroll 10s linear infinite;
        will-change: transform;
    }

    .track-info h2 .station-title-text,
    .track-info h2 .station-title-copy {
        display: inline-block;
        white-space: nowrap;
    }

    .track-info p {
        display: none;
    }

    #now-playing {
        min-height: 34px;
        margin-top: 8px;
    }

    .status-indicator-wrap,
    .cast-output-row {
        justify-content: center;
    }

    .controls-section {
        grid-template-columns: 50px 72px 50px;
        justify-content: center;
        gap: 10px;
    }

    .control-btn.secondary {
        width: 50px;
        height: 50px;
        border-radius: 15px;
    }

    .control-btn.primary {
        width: 72px;
        height: 72px;
        border-radius: 20px;
    }

    .volume-section {
        grid-template-columns: 36px minmax(0, 1fr) 38px;
        gap: 8px;
        padding-bottom: 0;
    }

    .volume-section #volume-value {
        font-size: 0.78rem;
    }

    .quickpick-section {
        align-self: end;
    }

    .quickpick-section .artwork-coverflow {
        max-width: 100%;
    }

    .legal-links {
        justify-content: center;
        margin-top: 0;
    }

    .legal-link {
        width: 30px;
        height: 30px;
    }

    .install-prompt-banner {
        display: flex;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        z-index: 9999;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 10px 12px;
        max-width: 640px;
        margin: 0 auto;
        border: 1px solid rgba(var(--accent-rgb), 0.22);
        border-radius: 16px;
        background:
            linear-gradient(145deg, rgba(var(--theme-panel-rgb), 0.94), rgba(255,255,255,0.06)),
            linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-3-rgb), 0.1));
        box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
        backdrop-filter: blur(20px) saturate(130%);
    }

    .install-prompt-banner.hidden {
        display: none;
    }

    .install-prompt-copy {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .install-prompt-copy strong {
        color: var(--text-main);
        font-size: 0.92rem;
        font-weight: 850;
    }

    .install-prompt-copy span {
        color: var(--text-muted);
        font-size: 0.76rem;
        line-height: 1.2;
    }

    .install-prompt-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .install-prompt-action,
    .install-prompt-dismiss {
        min-height: 36px;
        padding: 0 11px;
        border-radius: 11px;
    }

    .install-prompt-action {
        color: #0c1819;
        background: var(--accent);
    }

    .overlay {
        align-items: end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
        padding: 18px;
        border-inline: none;
        border-bottom: none;
    }

    .stations-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .editor-station-row {
        align-items: stretch;
        flex-direction: column;
    }

    .country-selection-toolbar {
        grid-template-columns: 1fr;
    }

    .country-selection-actions {
        width: 100%;
    }

    .country-selection-actions .btn {
        flex: 1;
        min-width: 0;
    }

    .editor-station-actions,
    .editor-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .editor-station-actions .btn,
    .editor-actions .btn,
    .editor-tools .btn {
        flex: 1;
    }
}

@keyframes station-title-scroll {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-50%, 0, 0);
    }
}

@media (min-width: 761px) and (max-width: 980px) {
    .glass-card {
        grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
        gap: 16px 22px;
    }

    .artwork-container {
        width: min(100%, 320px);
    }

    .track-info h2 {
        font-size: clamp(2rem, 5vw, 3.7rem);
    }
}

@media (min-width: 761px) and (max-height: 860px) {
    #station-subtitle,
    #managed-catalog-status,
    #cast-output-row,
    #station-health-detail {
        display: none !important;
    }

    .quickpick-sync-info {
        min-height: 44px;
        margin-top: 10px;
    }

    .artwork-container {
        width: min(100%, 360px);
    }

    .track-info h2 {
        font-size: clamp(1.9rem, 4vw, 2.8rem);
    }

    .status-indicator-wrap {
        margin-top: 10px;
    }

    .station-health-summary {
        margin-top: 8px;
    }
}

@media (max-width: 760px) and (max-height: 650px) {
    .artwork-container {
        width: min(26vw, 100px, 16dvh);
    }

    .artwork-coverflow {
        height: 56px;
    }

    .coverflow-item {
        width: 50px;
        height: 44px;
    }

    .track-info {
        min-height: 72px;
    }

    .track-info h2 {
        font-size: clamp(1.25rem, 7vw, 1.8rem);
    }
}

@media (max-width: 380px) {
    .glass-card {
        padding: 13px;
    }

    .artwork-container {
        width: min(47vw, 238px);
    }

    .artwork-coverflow {
        height: 80px;
    }

    .coverflow-item {
        width: 62px;
        height: 56px;
        font-size: 0.66rem;
    }

    .controls-section {
        grid-template-columns: 52px 76px 52px;
        gap: 12px;
    }

    .control-btn.secondary {
        width: 52px;
        height: 52px;
    }

    .control-btn.primary {
        width: 76px;
        height: 76px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
