/* ============================================
   CSS VARIABLES - DARK MODE
   ============================================ */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1E1E1E;
    --bg-tertiary: #383838;
    --bg-elevated: #4a4a4a;
    --text-primary: #ffffff;
    --text-secondary: #d0d0d0;  /* Improved contrast from #c0c0c0 */
    --text-muted: #9a9a9a;      /* Improved contrast from #808080 */
    --accent: #e91e8c;
    --accent-hover: #ff2d9d;
    --accent-glow: rgba(233, 30, 140, 0.3);
    --border: #555555;
    --success: #1db954;
    --apple-music-color: #fc3c44;
    --spotify-color: #1DB954;
    --deezer-color: #FF6600;
    --delete-color: #dc3545;
    --gold: #f5c518;
    --gold-bg: rgba(245, 197, 24, 0.12);
    --silver: #b4b8c4;
    --silver-bg: rgba(180, 184, 196, 0.10);
    --bronze: #cd7f32;
    --bronze-bg: rgba(205, 127, 50, 0.10);
    --focus-ring: rgba(233, 30, 140, 0.6);
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* App-like: lock the page to the device width — no horizontal pan/zoom.
       iOS needs overflow-x on <html> (not just <body>) to stop fixed off-screen
       elements (e.g. the closed sidebar) from making the page pannable. */
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    overscroll-behavior-x: none;
}

/* ============================================
   GLOBAL FOCUS STYLES (Accessibility)
   ============================================ */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

/* Skip to main content link for keyboard users */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 10px;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: 280px;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

/* Sticky header containing logo and user profile */
.sidebar-header {
    flex-shrink: 0;
    background-color: var(--bg-secondary);
}

/* Scrollable content area below the header */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Custom scrollbar for webkit browsers */
    scrollbar-width: thin;
    scrollbar-color: var(--bg-elevated) var(--bg-secondary);
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: var(--bg-elevated);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

.logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 16px;
}

/* Sidebar section headers for clear grouping */
.sidebar-section-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);  /* Improved from --text-muted for better contrast */
    padding: 8px 16px 6px;
    margin: 0;
}

/* Sidebar divider - hidden for cleaner look */
.sidebar-divider {
    display: none;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.nav-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background-color: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-item i:first-child {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Icon combo for sparkles + music note - sidebar */
.nav-item .icon-combo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.nav-item .icon-combo i:first-child {
    font-size: 11px;
}

.nav-item .icon-combo i:last-child {
    font-size: 7px;
    margin-left: -2px;
}

.nav-item span:not(.nav-badge) {
    flex: 1;
    white-space: nowrap;
}

.nav-badge {
    background-color: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    min-width: 20px;
    text-align: center;
}

.pin-icon {
    font-size: 12px;
    opacity: 0.4;
    transform: rotate(45deg);
    transition: all 0.3s;
    margin-left: 8px;
    cursor: pointer;
    padding: 4px;
    z-index: 2;
    position: relative;
}

.pin-icon:hover {
    opacity: 0.8;
    color: var(--accent);
}

.pin-icon.active,
.pin-icon.pinned {
    color: var(--accent);
    opacity: 1;
    transform: rotate(0deg);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    margin: 0 12px 24px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 12px;
}

/* Credits hint in sidebar - no background box, just text aligned with nav items */
.credits-hint {
    margin: 8px 0 0;
    padding: 8px 16px;
    background: none;
    border: none;
}

.credits-hint__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.credits-hint__title span {
    color: var(--accent);
    font-weight: 700;
}

.credits-hint__reset {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: auto;
}

.credits-hint__text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.credits-hint__icons {
    color: var(--accent);
    font-size: 11px;
}

.credits-hint__icons .fa-music {
    font-size: 0.8em;
    margin-left: 1px;
}

.credits-hint--empty {
    background: none;
    border: none;
}

.credits-hint--empty .credits-hint__title {
    color: var(--text-muted);
}

.credits-hint--empty .credits-hint__title span {
    color: var(--text-muted);
}

/* Song Discovery tooltip on the button itself */
.song-discovery-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    width: 220px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.song-discovery-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--border);
}

#whatsPlayingButton:hover .song-discovery-tooltip,
#whatsPlayingButton:focus-visible .song-discovery-tooltip {
    opacity: 1;
    visibility: visible;
}

.song-discovery-tooltip__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.song-discovery-tooltip__text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.song-discovery-tooltip__credits {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

/* Activity feed in sidebar - compact to reduce vertical space */
.activity-feed {
    margin: 0 16px;
    padding: 8px 0;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.activity-feed__message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.activity-feed__message.visible {
    opacity: 1;
}

.activity-feed__icon {
    font-size: 11px;
    flex-shrink: 0;
    line-height: 1.4;
    color: var(--accent);
}

.activity-feed__text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.activity-feed__text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-feed__text .activity-station {
    color: var(--accent);
}

.sidebar-spacer {
    flex: 1;
}

/* Sidebar footer section */
.sidebar-footer-section {
    padding-bottom: 12px;
}

/* Help links - smaller and more compact */
.help-links .nav-item {
    font-size: 0.8rem;
    padding: 6px 12px;
    gap: 8px;
}

.help-links .nav-item i:first-child {
    width: 16px;
    font-size: 0.75rem;
}

/* Sidebar social links */
.sidebar-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-top: 1px solid var(--border);
    margin: 0 12px 12px 12px;
}

.sidebar-social .social-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 16px;
    border-radius: 6px;
}

.sidebar-social .social-icon:hover {
    color: var(--accent);
    background-color: var(--bg-tertiary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    /* min-width:0 is essential: as a flex child its default min-width:auto lets
       it grow to its content's min-content width. A tab with long titles (Songs)
       then blows the column up to ~1700px → everything overflows right and the
       centred player lands off-screen. min-width:0 keeps it at the viewport. */
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
    height: 100vh;
    /* Scroll container on desktop so the articles section below the two-column
       row is reachable. overflow-x stays hidden to keep the page from panning. */
    overflow-y: auto;
    overflow-x: hidden;
}

.user-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.user-stats {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-rank {
    font-size: 10px;
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   CONTENT AREA
   ============================================ */
.content-area {
    /* Natural height (not a locked 100vh) so the articles section can sit below
       it and the whole .main-content scrolls. Was flex:1; height:100vh; overflow:hidden. */
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    gap: 24px;
    padding: 32px;
    overflow: visible;
}

/* ============================================
   NOW PLAYING SECTION
   ============================================ */
.now-playing {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    overflow-y: auto;
}

.player-card {
    background-color: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    /* Fixed height to prevent layout shift */
    height: 680px;
    max-height: 680px;
    overflow: hidden;
    transition: height 0.3s ease, max-height 0.3s ease;
}

.player-card.expanded {
    height: auto;
    max-height: 900px;
    overflow: visible;
}

.station-artwork {
    width: 220px;
    height: 220px;
    /* Welcome/default state: dark with a soft pink glow rising from the bottom, so
       the pink "Surprise me" hero pops. Per-station colour takes over once playing. */
    background:
        radial-gradient(120% 90% at 50% 115%, rgba(233, 30, 140, 0.30), transparent 62%),
        linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: background 0.8s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.station-artwork:hover:not(.loading) {
    transform: scale(1.02);
    box-shadow: 0 8px 32px rgba(233, 30, 140, 0.3);
}

.station-artwork:active:not(.loading) {
    transform: scale(0.98);
}

/* Disable click interactions while loading */
.station-artwork.loading {
    cursor: wait;
    pointer-events: none;
}

/* Smooth color cycling during loading */
.station-artwork.color-cycling {
    transition: background 0.8s ease;
}

/* Loading message overlay inside artwork */
.loading-message-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    z-index: 2;
}

.loading-message-overlay p {
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    color: #fff;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
    animation: fade-swap 1s ease-in-out;
}

.station-artwork::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Hide the overlay when station is playing */
.station-artwork.has-station::before {
    opacity: 0;
}

/* Pink glowing dot indicator when station is playing */
.station-artwork::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 0 0 var(--accent);
    transition: opacity 0.3s ease;
    animation: none;
    z-index: 10;
}

/* Show the pink dot when audio is playing */
.station-artwork.playing::after {
    opacity: 1;
    box-shadow: 0 0 3px rgba(233, 30, 140, 0.6);
}

/* Welcome message for default state */
.welcome-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    z-index: 1;
}

.welcome-message {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.welcome-message:hover {
    transform: scale(1.05);
}

.welcome-message:active {
    transform: scale(0.98);
}

/* Welcome hero: the artwork square is one big "Surprise me" shuffle target with
   benefit-led copy — the fastest, lowest-cost path to a first listen. */
.welcome-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.welcome-hero__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    /* Soft pink glow lifts the logo off the dark artwork (echoes the old orb). */
    filter: drop-shadow(0 4px 14px rgba(233, 30, 140, 0.35));
}

.welcome-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    text-align: center;
}

.welcome-hero__promise {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
    max-width: 22ch;
}

/* Loading spinner inside artwork */
.loading-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.spinner-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 4px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin-ring 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    border-top-color: #ff4da6;
    animation-delay: -0.3s;
    animation-duration: 1.2s;
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    border-top-color: #ff6b35;
    animation-delay: -0.6s;
    animation-duration: 0.9s;
}

@keyframes spin-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Station name container inside artwork */
.station-name-container {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2;
    text-align: center;
}

.station-name-container .station-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 0;
    line-height: 1.3;
    max-height: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* The card is a fixed-height column, so whatever height this block leaves over
   decides where the controls below it land. Making it the one elastic item lets
   it swallow every difference in chip-row and description length, which is what
   keeps the shuffle button anchored instead of moving on each shuffle. The slack
   collects below the description (justify-content) so the expand chevron stays
   under the text rather than drifting down to the controls. */
.station-info {
    text-align: center;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.station-meta {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 24px;
}

.station-desc-viewport {
    height: 90px;
    overflow-y: auto;
    margin-top: 0;
    /* Shrinkable as a safety valve: if the chip row ever wraps to two lines the
       description gives up the space (and scrolls) rather than the block below
       it colliding with the controls. */
    flex-shrink: 1;
    min-height: 0;
    transition: height 0.3s ease;
}

.station-desc-viewport.expanded {
    height: auto;
    max-height: 200px;
}

.station-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    /* Limit to 4 lines with ellipsis by default */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.station-description.loading {
    color: var(--accent);
    font-style: italic;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes fade-swap {
    0% { opacity: 0; transform: translateY(4px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0.7; transform: translateY(-2px); }
}

.station-desc-viewport.expanded .station-description {
    display: block;
    -webkit-line-clamp: unset;
}

.expand-desc-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    margin-top: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    flex-shrink: 0;
}

.expand-desc-btn:hover {
    color: var(--accent-hover);
    transform: scale(1.1);
}

.expand-desc-btn i {
    transition: transform 0.3s ease;
}

.expand-desc-btn.expanded i {
    transform: rotate(180deg);
}

/* Custom scrollbar for description */
.station-desc-viewport::-webkit-scrollbar {
    width: 4px;
}

.station-desc-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.station-desc-viewport::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 2px;
}

/* ============================================
   STREAMING INDICATOR
   ============================================ */
.streaming-indicator {
    display: inline-flex;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.streaming-dots {
    display: flex;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.3;
}

/* Static dots (default - no station playing) */
.streaming-indicator .dot {
    opacity: 0.3;
    animation: none;
}

/* Loading state - windmill rotation */
.streaming-indicator.loading .streaming-dots {
    position: relative;
    width: 26px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.streaming-indicator.loading .dot {
    position: absolute;
    opacity: 1;
    animation: none;
    width: 6px;
    height: 6px;
}

/* Position dots in a triangle, then rotate the whole container */
.streaming-indicator.loading .dot:nth-child(1) {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.streaming-indicator.loading .dot:nth-child(2) {
    bottom: 0;
    left: 3px;
}

.streaming-indicator.loading .dot:nth-child(3) {
    bottom: 0;
    right: 3px;
}

.streaming-indicator.loading .streaming-dots {
    animation: dot-windmill 2s infinite linear;
}

@keyframes dot-windmill {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(720deg);
    }
}

/* Playing state - bounce animation */
.streaming-indicator.active .dot {
    animation: bounce 1s infinite;
    opacity: 1;
}

.streaming-indicator.active .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.streaming-indicator.active .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ============================================
   PLAYER CONTROLS
   ============================================ */
/* Sits at the bottom of the fixed-height card: .station-info above absorbs the
   slack, and these never shrink, so the buttons hold one position. */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    flex-shrink: 0;
}

.control-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    color: var(--text-primary);
    font-size: 18px;
}

.control-btn:hover {
    background-color: var(--bg-elevated);
    transform: scale(1.05);
}

/* Control button labels - visible on hover */
.control-btn[data-label]::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 100;
    border: 1px solid var(--border);
}

.control-btn[data-label]:hover::after,
.control-btn[data-label]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.control-btn.primary {
    width: 88px;
    height: 88px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    box-shadow: 0 8px 32px var(--accent-glow);
    font-size: 32px;
}

.control-btn.primary:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px var(--accent-glow);
}

/* Primary button is THE hero - make it stand out more */
.control-btn.primary::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    opacity: 0.3;
    z-index: -1;
    animation: hero-pulse 2s ease-in-out infinite;
}

@keyframes hero-pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.15; }
}

.control-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 600;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-secondary);
}

/* Song identifier spinner - centered inside the identify button */
.song-identifier-spinner {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    z-index: 10;
}

/* Hide icons and show spinner when identifying */
#whatsPlayingButton.identifying > i,
#whatsPlayingButton.identifying > .badge {
    visibility: hidden;
}

#whatsPlayingButton.identifying .song-identifier-spinner {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip for Identify Song button - using data-label pattern now */
#whatsPlayingButton {
    position: relative;
}

/* ============================================
   VOLUME CONTROL
   ============================================ */
.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 0 8px;
    color: var(--text-secondary);
}

.volume-control i {
    font-size: 16px;
    flex-shrink: 0;
}

/* Make volume icon a clickable mute button */
.volume-mute-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -8px;
}

.volume-mute-btn:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.volume-mute-btn[aria-pressed="true"] {
    color: var(--accent);
}

.volume-slider-container {
    flex: 1;
    position: relative;
}

.volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-elevated);
    border-radius: 2px;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ============================================
   STATION ACTIONS
   ============================================ */
.station-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-shrink: 0;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: none;
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn i {
    font-size: 14px;
}

.action-btn:hover {
    background-color: var(--bg-elevated);
}

.action-btn.active,
.action-btn.saved {
    color: var(--accent);
    background-color: rgba(233, 30, 140, 0.15);
}

.action-btn.active i,
.action-btn.saved i {
    color: var(--accent);
}

/* ============================================
   DISCOVERY SECTION
   ============================================ */
.discovery-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 620px;
    overflow: hidden;
    position: sticky;
    top: 0;
    align-self: flex-start;
    max-height: 100vh;
    height: 680px;
}

/* Tab Toggle Button Bar */
.tab-toggle-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 14px 16px;
    background-color: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.tab-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 12px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.tab-toggle-btn i {
    font-size: 12px;
}

.tab-toggle-btn .icon-combo {
    display: inline-flex;
    align-items: center;
}

.tab-toggle-btn .icon-combo i:first-child {
    font-size: 11px;
}

.tab-toggle-btn .icon-combo i:last-child {
    font-size: 8px;
    margin-left: 1px;
}

.tab-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
    background-color: var(--bg-tertiary);
}

.tab-toggle-btn.active {
    color: #ffffff;
    background-color: #FF2E9D;
    border-color: #FF2E9D;
    font-weight: 500;
}

/* Tab glow animation for feedback when saving/discovering */
.tab-toggle-btn.tab-glow {
    animation: tabGlow 1.5s ease-out;
}

@keyframes tabGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(233, 30, 140, 0.7);
    }
    30% {
        box-shadow: 0 0 12px 4px rgba(233, 30, 140, 0.6);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(233, 30, 140, 0);
    }
}

/* Legacy - keep for any remaining references */
.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   TAB CONTENT
   ============================================ */
.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.tab-content.active {
    display: flex;
}

/* ============================================
   DISCOVERY TABLE
   ============================================ */
.discovery-table {
    flex: 1;
    background-color: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Legacy table-header kept for any JS references */
.table-header {
    display: none;
}

/* Tab description / subheading */
.tab-description {
    padding: 12px 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background-color: var(--bg-secondary);
}

/* Songs tab header with toggle */
.songs-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tab-description-text {
    flex: 1;
}

.songs-toggle {
    display: flex;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}

.songs-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    height: 22px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.songs-toggle-btn i {
    font-size: 9px;
}

.songs-toggle-btn span {
    font-weight: 500;
}

.songs-toggle-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

.songs-toggle-btn.active {
    background-color: var(--accent);
    color: white;
}

@media (max-width: 480px) {
    .songs-toggle-btn span {
        display: none;
    }

    .songs-toggle-btn {
        padding: 3px 6px;
    }
}

/* Songs views */
.songs-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.songs-view.active {
    display: flex;
}

/* Community song rows - 3 columns (track info, station, links) */
.song-row-community {
    grid-template-columns: 2fr 1fr 80px !important;
}

/* My songs rows - 4 columns (time ago, track info, station, links) */
.song-row-my {
    grid-template-columns: 60px 2fr 1fr 80px !important;
}

/* ============================================
   SAVED STATIONS STYLES (matching History design)
   ============================================ */
/* Saved station row: time ago first, then station name, then stats, then heart */
#saved-tab .table-row {
    display: grid;
    grid-template-columns: 50px 1fr 60px 36px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
}

#saved-tab .table-row:last-child {
    border-bottom: none;
}

#saved-tab .table-row.clickable-row {
    cursor: pointer;
}

#saved-tab .table-row:hover {
    background-color: var(--bg-tertiary);
}

.saved-time-ago {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.saved-station-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.saved-station-name .station-chip {
    max-width: fit-content;
}

/* Saved stations description with column headers */
.saved-description {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.saved-col-headers {
    display: flex;
    gap: 16px;
    margin-right: 42px;
}

.saved-col-headers span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
}

.saved-col-headers span i {
    font-size: 9px;
    color: var(--accent);
    margin-right: 4px;
}

.saved-stats-row {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
}

.saved-stat-item {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
}

/* Saved heart / remove button */
.saved-heart {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.saved-heart:hover {
    color: #FF2E9D;
    background-color: rgba(255, 46, 157, 0.1);
}

.saved-heart.liked {
    color: #FF2E9D;
}

.saved-heart.liked:hover {
    opacity: 0.7;
}

/* Time ago cell (for songs) */
.time-ago-cell {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Listened cell with icon */
.listened-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.listened-cell i {
    font-size: 11px;
    color: var(--text-muted);
}

/* Saved ago cell */
.saved-ago-cell {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* Row actions cell */
.row-actions-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

/* Icon button for actions */
.icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    transition: all 0.2s;
    opacity: 0;
}

.table-row:hover .icon-btn {
    opacity: 1;
}

.icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.icon-btn.delete-btn:hover {
    color: var(--delete-color);
}

.station-name-cell-wrapper {
    min-width: 0;
}

.table-body {
    flex: 1;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

/* Table legend for explaining icons */
.table-legend {
    display: flex;
    gap: 20px;
    padding: 12px 20px;
    border-top: 1px solid rgba(85, 85, 85, 0.3);
    font-size: 11px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-item i {
    font-size: 12px;
}

/* Load More button */
.load-more-container {
    padding: 16px 20px;
    text-align: center;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.load-more-btn:hover:not(:disabled) {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--accent);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.load-more-btn i {
    font-size: 11px;
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 120px 80px;
    gap: 16px;
    padding: 14px 20px;
    align-items: center;
    transition: background-color 0.15s, transform 0.15s;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
    cursor: pointer;
    position: relative;
}

.table-row:last-child {
    border-bottom: none;
}

/* All grid cells must have min-width:0 so text truncation works */
.table-row > *,
.table-header > * {
    min-width: 0;
}

.table-row:hover {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
}

/* Play indicator on hover */
.table-row::before {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    color: var(--accent);
    font-size: 10px;
    transition: opacity 0.15s;
}

.table-row:hover::before {
    opacity: 1;
}

.table-row.active {
    background-color: rgba(233, 30, 140, 0.1);
    position: relative;
}

.table-row.active::before {
    opacity: 1;
    animation: pulse-icon 1.5s ease-in-out infinite;
}

/* Lighten the radio icon on active rows */
.table-row.active .station-chip__icon {
    filter: brightness(1.4);
    animation: icon-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes icon-glow {
    0%, 100% {
        filter: brightness(1.4);
    }
    50% {
        filter: brightness(1.8);
    }
}

/* Row number - hidden by default (removed numbering) */
.row-number {
    display: none;
}

.track-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.track-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-tag {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color 0.2s;
}

.station-tag:hover {
    color: var(--accent);
}

.station-cell {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Saved stations specific */
.station-name-cell {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.station-name-cell:hover {
    color: var(--accent);
}

.station-timer-cell {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    color: var(--text-muted);
}

/* Track links */
.track-links {
    display: flex;
    gap: 8px;
    flex: none;
    justify-content: flex-end;
    align-items: center;
}

.link-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-decoration: none;
}

.link-btn:hover {
    background-color: var(--bg-elevated);
    transform: scale(1.1);
}

.link-btn i {
    font-size: 14px;
}

.link-btn.apple i {
    color: var(--apple-music-color);
}

.link-btn.spotify i {
    color: var(--spotify-color);
}

.link-btn.deezer i {
    color: var(--deezer-color);
}

/* Legacy streaming link styles */
.streaming-link-community {
    margin-right: 8px;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s;
    display: inline-block;
}

.streaming-link-community.fa-apple { color: var(--apple-music-color); }
.streaming-link-community.fa-apple:hover { color: #ff5a5f; transform: scale(1.1); }
.streaming-link-community.fa-spotify { color: var(--spotify-color); }
.streaming-link-community.fa-spotify:hover { color: #1ed760; transform: scale(1.1); }
.streaming-link-community.fa-deezer { color: var(--deezer-color); }
.streaming-link-community.fa-deezer:hover { color: #ff8800; transform: scale(1.1); }

/* Row actions */
.row-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.remove-btn,
.song-delete-icon,
.station-delete-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 14px;
}

.table-row:hover .remove-btn,
.table-row:hover .song-delete-icon,
.table-row:hover .station-delete-icon {
    opacity: 1;
}

.remove-btn:hover,
.song-delete-icon:hover,
.station-delete-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--delete-color);
}

/* Station action button in table */
.station-action-button {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.station-action-button:hover {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    text-align: center;
}

/* Loading placeholder */
.loading-placeholder,
.table-center-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
    grid-column: 1 / -1;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.bounce-animation {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 8px 32px var(--accent-glow); }
    70% { transform: scale(1.05); box-shadow: 0 8px 32px var(--accent-glow), 0 0 0 15px rgba(233, 30, 140, 0); }
    100% { transform: scale(1); box-shadow: 0 8px 32px var(--accent-glow); }
}

/* (song rows render with no entrance animation) */

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================
   NOTIFICATIONS (Toast-style)
   ============================================ */
.song-notification-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.7);
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.song-notification {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 32px 28px 28px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: modalFadeIn 0.3s ease-out forwards;
    max-width: 600px;
    width: 90%;
    pointer-events: auto;
    position: relative;
}

.notification-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.notification-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.notification-icon {
    font-size: 48px;
    color: var(--accent);
    margin-bottom: 8px;
}

.song-notification-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    text-align: center;
}

.song-notification-artist {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
    text-align: center;
    margin-bottom: 8px;
}

.notification-station {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 8px 0;
}

.notification-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.2s;
}

.notification-links a:hover {
    background-color: var(--bg-elevated);
    transform: scale(1.1);
}

.notification-links a .fa-apple {
    color: var(--apple-music-color);
}

.notification-links a .fa-spotify {
    color: var(--spotify-color);
}

.notification-links a .fa-deezer {
    color: var(--deezer-color);
}

.notification-redirect-btn {
    background-color: var(--accent);
    color: var(--text-primary);
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.notification-redirect-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 30, 140, 0.3);
}

@keyframes toastSlide {
    0% { opacity: 0; transform: translateY(-20px); }
    8% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

@keyframes modalFadeIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* ============================================
   MODALS
   ============================================ */
.result-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-secondary);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border);
}

.result-modal h2 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 20px;
}

.result-modal h3 {
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 16px;
}

.result-modal p {
    margin: 10px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Share Modal - Compact Design */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.share-modal-content {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    max-width: 340px;
    width: 90%;
    border: 1px solid var(--border);
    animation: modalSlideIn 0.25s ease;
}

.share-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.share-modal-close:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.share-modal-title {
    margin: 0 0 20px 0;
    text-align: center;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    padding-right: 20px;
}

.copy-link-container {
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-link-input {
    flex-grow: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 0;
}

.copy-button {
    padding: 10px 14px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.copy-button:hover {
    background-color: var(--accent-hover);
}

.copy-button.copied-state {
    background-color: var(--success) !important;
}

.share-icons-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.share-icon-link {
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s;
}

.share-icon-link:hover {
    transform: translateY(-2px);
}

.share-icon {
    font-size: 18px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.share-icon:hover {
    background-color: var(--bg-elevated);
}

.share-icon-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ============================================
   LEADERBOARD
   ============================================ */
/* ============================================
   UNIFIED STATION CHIP
   ============================================ */
.station-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    background: var(--bg-elevated);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    max-width: 100%;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}
.station-chip:hover {
    background: rgba(233, 30, 140, 0.08);
    border-color: rgba(233, 30, 140, 0.25);
    transform: translateY(-1px);
}
.station-chip:hover .station-chip__name {
    color: var(--accent);
}
.station-chip__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff6b35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.station-chip__icon i {
    font-size: 9px;
    color: white;
}
.station-chip__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}

/* Compact variant for discovery tables */
.station-chip--compact {
    padding: 3px 10px 3px 3px;
    gap: 6px;
}
.station-chip--compact .station-chip__icon {
    width: 20px;
    height: 20px;
}
.station-chip--compact .station-chip__icon i {
    font-size: 8px;
}
.station-chip--compact .station-chip__name {
    font-size: 12px;
}

/* ============================================
   RANK MEDAL BADGES
   ============================================ */
.rank-medal {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    margin: 0 auto;
}
.rank-medal--gold {
    background: var(--gold-bg);
    color: var(--gold);
    border: 1.5px solid rgba(245, 197, 24, 0.3);
}
.rank-medal--silver {
    background: var(--silver-bg);
    color: var(--silver);
    border: 1.5px solid rgba(180, 184, 196, 0.2);
}
.rank-medal--bronze {
    background: var(--bronze-bg);
    color: var(--bronze);
    border: 1.5px solid rgba(205, 127, 50, 0.2);
}



/* ============================================
   LEADERBOARD STYLES
   ============================================ */
/* Leaderboard row: single row layout for cleaner design.
   Three cells: the station unit (elastic), the heat pill, the save heart. */
#leaderboard-tab .table-row {
    display: grid;
    grid-template-columns: 1fr auto 36px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
}

#leaderboard-tab .table-row.clickable-row {
    cursor: pointer;
}

.leaderboard-station-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.leaderboard-station-name .station-chip {
    max-width: fit-content;
}

.leaderboard-rank {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 18px;
    text-align: center;
}

#leaderboard-tab .table-row:hover {
    background-color: var(--bg-tertiary);
}

/* Leaderboard description with column headers */
.leaderboard-description {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.leaderboard-col-headers {
    display: grid;
    grid-template-columns: 60px 76px 56px 50px;
    gap: 16px;  /* Increased gap to prevent column misreading */
    margin-right: 42px;
}

.leaderboard-col-headers span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
    padding-left: 4px;  /* Visual separation */
    border-left: 1px solid transparent;  /* Potential future separator */
}

.leaderboard-col-headers span i {
    font-size: 9px;
    color: var(--accent);
    margin-right: 4px;
}

.leaderboard-stats-row {
    display: grid;
    grid-template-columns: 60px 76px 56px 50px;
    gap: 16px;  /* Match header gap */
    align-items: center;
    flex-shrink: 0;
}

.leaderboard-stat-item {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
}

/* Heart / save button */
.leaderboard-heart {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.leaderboard-heart:hover {
    color: #FF2E9D;
    background-color: rgba(255, 46, 157, 0.1);
}

.leaderboard-heart.liked {
    color: #FF2E9D;
}

.leaderboard-heart.liked:hover {
    opacity: 0.7;
}

/* Add subtle divider between leaderboard rows */
#leaderboard-tab .table-row {
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
}

#leaderboard-tab .table-row:last-child {
    border-bottom: none;
}

/* ============================================
   HISTORY STYLES
   ============================================ */
/* History row: time ago first, then station name, then stats, then heart */
#history-tab .table-row {
    display: grid;
    grid-template-columns: 50px 1fr 60px 36px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
}

#history-tab .table-row:last-child {
    border-bottom: none;
}

#history-tab .table-row.clickable-row {
    cursor: pointer;
}

#history-tab .table-row:hover {
    background-color: var(--bg-tertiary);
}

.history-time-ago {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.history-station-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.history-station-name .station-chip {
    max-width: fit-content;
}

/* History description with column headers */
.history-description {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Refresh button for history */
.refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    margin-left: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 12px;
    vertical-align: middle;
}

.refresh-btn:hover {
    color: var(--accent);
    background-color: rgba(255, 46, 157, 0.1);
}

.refresh-btn.spinning i {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.history-col-headers {
    display: flex;
    gap: 16px;
    margin-right: 42px;
}

.history-col-headers span {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: help;
}

.history-col-headers span i {
    font-size: 9px;
    color: var(--accent);
    margin-right: 4px;
}

.history-stats-row {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.history-stat-item {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.history-stat-item i {
    font-size: 11px;
    color: var(--accent);
}

/* History heart / save button */
.history-heart {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-heart:hover {
    color: #FF2E9D;
    background-color: rgba(255, 46, 157, 0.1);
}

.history-heart.liked {
    color: #FF2E9D;
}

.history-heart.liked:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {
    /* Toggle bar compact on mobile */
    .tab-toggle-bar {
        gap: 4px;
        padding: 10px 12px;
    }

    .tab-toggle-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 5px;
    }

    /* Hide the text labels on mobile — every tab now has an <i> icon. */
    .tab-toggle-btn span {
        display: none;
    }

    .tab-toggle-btn i {
        font-size: 16px;
    }

    /* Hide column headers and stats on mobile - cleaner layout */
    .leaderboard-col-headers,
    .leaderboard-stats-row,
    .history-col-headers,
    .history-stats-row,
    .history-time-ago,
    .saved-col-headers,
    .saved-stats-row,
    .saved-time-ago {
        display: none !important;
    }

    /* Leaderboard rows - simple layout: station name + heart */
    #leaderboard-tab .table-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
    }

    .leaderboard-station-name {
        flex: 1;
        min-width: 0;
    }

    .leaderboard-station-name .station-chip {
        max-width: 100%;
    }

    .leaderboard-station-name .station-chip__name {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }

    .leaderboard-heart {
        flex-shrink: 0;
    }

    /* History rows - simple layout: station name + heart */
    #history-tab .table-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
    }

    .history-station-name {
        flex: 1;
        min-width: 0;
    }

    .history-station-name .station-chip {
        max-width: 100%;
    }

    .history-station-name .station-chip__name {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }

    .history-heart {
        flex-shrink: 0;
    }

    /* Make station chip more compact on mobile but allow text to wrap */
    .station-chip {
        padding: 4px 8px 4px 4px;
        gap: 6px;
    }
    .station-chip__icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    .station-chip__icon i {
        font-size: 8px;
    }
    .station-chip__name {
        font-size: 12px;
    }

    /* Community songs rows */
    .song-row-community {
        grid-template-columns: 1fr 80px 60px !important;
    }

    .song-row-community .station-cell {
        display: none;
    }

    /* My songs rows - 3 columns on tablet (time ago, track, links) */
    .song-row-my {
        grid-template-columns: 50px 1fr 60px !important;
    }

    .song-row-my .station-cell {
        display: none;
    }

    /* Saved station rows - simple layout: station name + heart */
    #saved-tab .table-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
    }

    .saved-station-name {
        flex: 1;
        min-width: 0;
    }

    .saved-station-name .station-chip {
        max-width: 100%;
    }

    .saved-station-name .station-chip__name {
        white-space: normal;
        word-break: break-word;
        line-height: 1.3;
    }

    .saved-heart {
        flex-shrink: 0;
    }

    /* Make action icons always visible on touch devices */
    .icon-btn,
    .remove-btn,
    .song-delete-icon,
    .station-delete-icon {
        opacity: 0.6;
    }
}

@media (max-width: 480px) {
    .tab-toggle-bar {
        gap: 3px;
        padding: 8px 10px;
    }

    .tab-toggle-btn {
        padding: 7px 10px;
    }

    /* Smaller padding on very small screens */
    #leaderboard-tab .table-row,
    #history-tab .table-row,
    #saved-tab .table-row {
        padding: 10px 12px;
    }

    .leaderboard-heart,
    .history-heart,
    .saved-heart {
        font-size: 14px;
        padding: 5px;
    }

    .rank-medal {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* ============================================
   COLLAPSIBLE SIDEBAR RAIL (desktop)
   The sidebar starts collapsed to a slim icon rail (logo + nav icons + level
   avatar) and expands over the content as an overlay. Mobile (<=1024px) keeps
   its own slide-in behaviour, so these rules are scoped to >=1025px.
   ============================================ */
.sidebar-rail-toggle {
    display: none;          /* shown only on desktop (see media query) */
    position: absolute;
    top: 18px;
    right: -13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    font-size: 13px;
    transition: background 0.2s ease;
}
.sidebar-rail-toggle:hover { background: var(--accent); border-color: var(--accent); }

@media (min-width: 1025px) {
    .sidebar { transition: width 0.25s ease; }
    .sidebar-rail-toggle { display: flex; }

    /* --- Collapsed rail (default) --- */
    .sidebar.collapsed { width: 68px; }
    /* Content sits beside the rail; expanding the panel overlays, so the margin
       stays at the rail width and the layout never shifts. */
    .main-content { margin-left: 68px; }

    .sidebar.collapsed .logo { justify-content: center; padding: 22px 0; }
    .sidebar.collapsed .logo-text { display: none; }

    /* User profile: keep only the level avatar, centered */
    .sidebar.collapsed .user-profile { padding: 0 0 12px; }
    .sidebar.collapsed .user-profile-header,
    .sidebar.collapsed .user-info { display: none; }
    .sidebar.collapsed .user-profile-main { justify-content: center; }
    .sidebar.collapsed .user-avatar { width: 40px; height: 40px; }

    /* Nav: icon-only, centered; hide labels, pins and badges */
    .sidebar.collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .pin-icon { display: none; }
    /* !important to beat the inline style.display JS sets when a count exists */
    .sidebar.collapsed .nav-badge { display: none !important; }

    /* Hide the verbose sections entirely while collapsed */
    .sidebar.collapsed .sidebar-section-header,
    .sidebar.collapsed .sidebar-divider,
    .sidebar.collapsed .activity-feed,
    .sidebar.collapsed .credits-hint,
    .sidebar.collapsed .help-links,
    .sidebar.collapsed .sidebar-social { display: none; }

    /* --- Expanded (overlay over the content) --- */
    .sidebar:not(.collapsed) {
        width: 280px;
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55);
    }
    .sidebar.collapsed .sidebar-rail-toggle i { transform: rotate(0deg); }
    .sidebar:not(.collapsed) .sidebar-rail-toggle i { transform: rotate(180deg); }
}

/* Center the player + table block in the freed-up space (row layout only) */
@media (min-width: 1201px) {
    .content-area { justify-content: center; }
    .discovery-section { flex: 0 1 620px; }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .main-content {
        height: auto;
        overflow: visible;
    }

    .content-area {
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding-bottom: 32px;
    }

    .now-playing {
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        position: static;
        max-height: none;
        overflow: visible;
    }

    .discovery-section {
        position: static;
        max-height: none;
        max-width: none;
        height: auto;
        overflow: visible;
        width: 100%;
    }

    .tab-content {
        overflow: visible;
    }

    .discovery-table {
        overflow: visible;
    }

    .table-body {
        overflow: visible;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        /* visibility:hidden when closed removes the off-screen fixed panel from
           the pannable area on iOS; delayed so the slide-out still animates. */
        visibility: hidden;
        transition: transform 0.3s ease, visibility 0s linear 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.3s ease, visibility 0s linear 0s;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .main-content {
        height: auto;
        overflow: visible;
    }

    .content-area {
        gap: 20px;
        height: auto;
        overflow: visible;
        /* Tighter side padding on phones so the cards use the width and the
           left "black gap" shrinks. */
        padding: 10px 10px 20px;
    }

    .now-playing,
    .discovery-section {
        position: static;
        max-height: none;
        height: auto;
        overflow: visible;
    }

    .player-card {
        padding: 24px;
        height: auto;
        max-height: none;
        min-height: auto;
    }

    .station-artwork {
        width: 180px;
        height: 180px;
    }

    /* Scale the welcome hero down so it fits the smaller 180px square. */
    .welcome-message {
        padding: 18px;
    }

    .welcome-hero {
        gap: 7px;
    }

    .welcome-hero__logo {
        width: 52px;
        height: 52px;
    }

    .welcome-text {
        font-size: 20px;
    }

    .welcome-hero__promise {
        font-size: 11px;
    }

    .control-btn.primary {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }

    .control-btn {
        width: 46px;
        height: 46px;
        font-size: 16px;
    }

    .section-title {
        font-size: 22px;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1.5fr 1fr 80px 50px;
        gap: 12px;
        padding: 10px 16px;
    }

    .song-row-new {
        grid-template-columns: 1.5fr 1fr 80px !important;
    }

    #mySongsTableBody .song-row-new {
        grid-template-columns: 1.5fr 1fr 80px !important;
    }

}

@media (max-width: 480px) {
    /* Hide station cell on very small screens */
    .song-row-community .station-cell,
    .song-row-my .station-cell {
        display: none;
    }

    /* Generic table row rules - but not for our stacked layouts */
    .table-header {
        grid-template-columns: 1fr 60px 40px;
        gap: 8px;
        padding: 9px 12px;
    }

    /* Community songs on very small screens */
    .song-row-community {
        grid-template-columns: 1fr 60px !important;
    }

    /* My songs - hide time ago on very small, 2 columns (track, links) */
    .song-row-my {
        grid-template-columns: 1fr 60px !important;
    }

    .song-row-my .time-ago-cell {
        display: none;
    }

    .station-name {
        font-size: 18px;
    }

    .station-artwork {
        width: 160px;
        height: 160px;
    }

    .station-artwork i {
        font-size: 48px;
    }

    .action-btn span {
        display: none;
    }

    .action-btn {
        padding: 12px 20px;
    }
}

/* ============================================
   MOBILE MENU TOGGLE (add via JS if needed)
   ============================================ */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    border: none;
    cursor: pointer;
    z-index: 200;
    box-shadow: 0 4px 20px var(--accent-glow);
    color: white;
    font-size: 24px;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   USER PROFILE SECTION (Updated)
   ============================================ */
.user-profile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    margin: 0 12px 12px 12px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    position: relative;
}

.user-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.display-username {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.user-profile-main {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.login-logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}

.login-logout-btn:hover {
    color: var(--accent);
}

/* ============================================
   AUTH MODAL (Login/Signup)
   ============================================ */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    background-color: var(--bg-secondary);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    max-width: 420px;
    width: 90%;
    border: 1px solid var(--border);
}

.auth-modal-content h2 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 24px;
    text-align: center;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
    margin-bottom: 24px;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--text-primary);
}

.social-login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.social-login-btn:hover {
    background-color: var(--bg-elevated);
    border-color: var(--text-muted);
}

.social-login-btn.google i {
    color: #ea4335;
    font-size: 18px;
}

.social-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

.auth-divider span {
    padding: 0 16px;
}

#emailLoginForm {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    width: 100%;
}

#emailLoginForm input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

#emailLoginForm input:focus {
    outline: none;
    border-color: var(--accent);
}

#emailLoginForm input::placeholder {
    color: var(--text-muted);
}

.auth-error {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--delete-color);
    color: var(--delete-color);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
}

.auth-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.forgot-password-link {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 16px;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link:hover {
    color: var(--accent);
}

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 20px;
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ============================================
   ACCOUNT MODAL
   ============================================ */
.account-modal-content {
    max-width: 420px;
    padding: 24px 28px;
    max-height: 85vh;
    overflow-y: auto;
    /* A long email or username must never widen the modal into a sideways
       scroll — the row below is taught to wrap, this hides any residue. */
    overflow-x: hidden;
}

.account-modal-content h2 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 20px;
}

.account-modal-content h3 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Account Login Prompt */
.account-login-prompt {
    text-align: center;
    padding: 30px 20px;
}

.account-login-prompt i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.account-login-prompt p {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 20px;
}

/* "Already have an account? Sign in" — the small way out under the Sign Up
   plate. It must not compete with it. */
.account-login-prompt__alt {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.account-login-prompt__alt a {
    color: var(--accent, var(--text-primary));
    font-weight: 600;
    text-decoration: underline;
}

/* The constraint line under a field, said once so the error never has to. */
.form-hint {
    display: block;
    margin: 6px 2px 0;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

/* Account Sections */
.account-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.account-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* A quiet switch. Deliberately small and unlabelled on its own: the account
   row beside it is the label, exactly like every other row in this panel. */
.rs-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.rs-switch input {
    /* Off-screen rather than display:none, so it still takes keyboard focus
       and still announces itself as a checkbox. */
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.rs-switch__track {
    display: block;
    position: relative;
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    transition: background-color .18s ease, border-color .18s ease;
}

.rs-switch__knob {
    position: absolute;
    top: 50%;
    left: 3px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--text-secondary);
    transition: transform .18s ease, background-color .18s ease;
}

.rs-switch input:checked + .rs-switch__track {
    background: var(--accent);
    border-color: var(--accent);
}

.rs-switch input:checked + .rs-switch__track .rs-switch__knob {
    background: #ffffff;
    transform: translateX(14px);
}

.rs-switch input:focus-visible + .rs-switch__track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.rs-switch input:disabled + .rs-switch__track { opacity: .5; }

/* The sentence under the toggle. It has to be there — it is what the toggle
   promises — but it is a footnote, not a paragraph, so it stays at the size of
   the row labels and never darker than them. */
.account-note {
    margin: 6px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Saving confirmation. Deliberately NOT .form-feedback: that draws a bordered,
   filled plate, which on a row this quiet announced the toggle louder than the
   toggle does. Plain text that says its piece and goes. */
.account-status {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
}
.account-status.success { color: var(--accent); }
.account-status.error { color: var(--delete-color); }

/* The account actions row. Small, side by side, auto width: logging out,
   changing a password and deleting an account are all rare, and one full-width
   plate each turned the foot of the panel into its loudest region. */
.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.account-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.account-actions__break { flex: 0 0 100%; height: 2px; }

.account-btn i { font-size: 11px; }
.account-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.account-btn--danger { color: var(--delete-color); border-color: var(--delete-color); }
.account-btn--danger:hover { background: var(--delete-color); border-color: var(--delete-color); color: #ffffff; }

/* Account Rows */
.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.account-label {
    color: var(--text-muted);
    font-size: 13px;
}

.account-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    /* Flex children keep min-width:auto by default, so an unbreakable string
       (an email) forced the modal wider than the screen. Shrink and wrap. */
    min-width: 0;
    overflow-wrap: anywhere;
}

.account-edit-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.account-edit-btn:hover {
    color: var(--accent);
    background-color: var(--bg-tertiary);
}

/* Email Verification Notice */
.verification-notice {
    background-color: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.verification-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffc107;
    font-size: 13px;
    margin-bottom: 8px;
}

.verification-message i {
    font-size: 16px;
}

.resend-verification-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 6px;
    color: #ffc107;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.resend-verification-btn:hover {
    background-color: rgba(255, 193, 7, 0.3);
    border-color: #ffc107;
}

.resend-verification-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Account Stats Grid */
.account-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat-box {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 10px;
    color: var(--text-muted);
}

/* Account Action Buttons */
.account-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.account-action-btn:hover {
    background-color: var(--bg-elevated);
    border-color: var(--text-muted);
}

.account-action-btn.danger {
    color: var(--delete-color);
    border-color: var(--delete-color);
    background-color: rgba(220, 53, 69, 0.1);
}

.account-action-btn.danger:hover {
    background-color: rgba(220, 53, 69, 0.2);
}

/* Danger Zone */
.danger-zone {
    border-top: 1px solid var(--delete-color) !important;
    padding-top: 16px !important;
    margin-top: 16px !important;
    border-bottom: none !important;
}

/* Back Button */
.back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
    font-family: inherit;
}

.back-btn:hover {
    color: var(--accent);
}

/* Form Description */
.form-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Form Feedback */
.form-feedback {
    font-size: 13px;
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: 6px;
    display: none;
}

.form-feedback:not(:empty) {
    display: block;
}

.form-feedback.success {
    color: var(--success);
    background-color: rgba(29, 185, 84, 0.1);
    border: 1px solid var(--success);
}

.form-feedback.error {
    color: var(--delete-color);
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--delete-color);
}

/* Delete Warning */
.delete-warning {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid var(--delete-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.delete-warning i {
    color: var(--delete-color);
    font-size: 24px;
    margin-bottom: 12px;
    display: block;
}

.delete-warning p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 14px;
}

.delete-warning ul {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0;
    padding-left: 20px;
}

.delete-warning li {
    margin-bottom: 4px;
}

.delete-confirm-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.delete-confirm-text strong {
    color: var(--delete-color);
}

/* Danger Button */
.danger-btn {
    background: var(--delete-color) !important;
    border: none;
}

.danger-btn:hover {
    background: #c82333 !important;
}

.danger-btn:disabled {
    background: var(--bg-tertiary) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

/* Account Modal Input Styling */
#accountModal input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

#accountModal input:focus {
    outline: none;
    border-color: var(--accent);
}

#accountModal input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   MODAL RESPONSIVE STYLES
   ============================================ */

/* Tablet - reduce padding slightly */
@media (max-width: 768px) {
    .auth-modal-content {
        padding: 32px 24px;
        width: 92%;
    }

    .account-modal-content {
        max-width: 90%;
        padding: 20px;
    }

    .auth-modal-content h2 {
        font-size: 22px;
    }

    .account-modal-content h2 {
        font-size: 18px;
    }

    .account-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .stat-box {
        padding: 8px 4px;
    }

    .stat-value {
        font-size: 14px;
    }

    .stat-label {
        font-size: 9px;
    }
}

/* Mobile - optimize for small screens */
@media (max-width: 480px) {
    .auth-modal {
        padding: 12px;
        align-items: flex-start;
        padding-top: 40px;
    }

    .auth-modal-content {
        padding: 20px 16px;
        width: 100%;
        max-width: 100%;
        border-radius: 12px;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .account-modal-content {
        max-width: 100%;
        padding: 18px 14px;
    }

    .auth-modal-content h2 {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .account-modal-content h2 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .account-modal-content h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .auth-subtitle {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .close-modal {
        top: 10px;
        right: 10px;
        font-size: 22px;
        width: 26px;
        height: 26px;
    }

    /* Form elements sizing */
    .social-login-btn,
    .auth-submit-btn,
    .account-action-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    #emailLoginForm input,
    #accountModal input {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Account rows */
    .account-row {
        padding: 5px 0;
    }

    .account-label,
    .account-value {
        font-size: 12px;
    }

    /* Stats grid - keep 4 columns compact */
    .account-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .stat-box {
        padding: 8px 2px;
    }

    .stat-value {
        font-size: 13px;
    }

    .stat-label {
        font-size: 8px;
    }

    /* Verification notice */
    .verification-notice {
        padding: 8px;
        margin: 8px 0;
    }

    .verification-message {
        font-size: 11px;
    }

    .verification-message i {
        font-size: 12px;
    }

    .resend-verification-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    /* Account section spacing */
    .account-section {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .account-login-prompt {
        padding: 16px 12px;
    }

    .account-login-prompt i {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .account-login-prompt p {
        font-size: 13px;
        margin-bottom: 12px;
    }

    /* Form feedback */
    .form-feedback {
        font-size: 11px;
        padding: 6px 10px;
        margin: 8px 0;
    }

    /* Delete warning */
    .delete-warning {
        padding: 12px;
        margin-bottom: 12px;
    }

    .delete-warning i {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .delete-warning p {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .delete-warning ul {
        font-size: 11px;
    }

    .delete-confirm-text {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .danger-zone {
        padding-top: 12px !important;
        margin-top: 12px !important;
    }
}

/* ============================================
   IMPROVED EMPTY STATES
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state__icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.empty-state__icon i {
    font-size: 32px;
    color: var(--text-muted);
}

.empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state__text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 280px;
    margin-bottom: 20px;
}

.empty-state__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), #ff4da6);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.empty-state__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

/* ============================================
   STATION NAME TOOLTIP (full name on hover)
   ============================================ */
.station-chip__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
    position: relative;
}

/* Show full name tooltip on hover for truncated names */
.station-chip[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
}

/* Extra small screens - ultra compact */
@media (max-width: 360px) {
    .auth-modal {
        padding: 8px;
        padding-top: 40px;
    }

    .auth-modal-content,
    .account-modal-content {
        padding: 20px 16px;
    }

    .account-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .stat-box {
        padding: 10px 6px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .account-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .account-value {
        width: 100%;
    }
}

/* ============================================
   v0.0.17 — UNIFIED TABLES (station unit, time column)
   ============================================ */

/* Every table row becomes a flex track. Scoped to .discovery-table and forced
   so it overrides the old per-table grid layouts regardless of specificity. */
.discovery-table .table-row {
    display: flex !important;
    align-items: center;
    gap: 12px;
}
.table-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* First column: rank (Trending only) */
.row-rank {
    width: 22px;
    flex: none;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
}
.row-rank.r1 { color: var(--gold); }
.row-rank.r2 { color: var(--silver); }
.row-rank.r3 { color: var(--bronze); }

/* Relative time ("4h ago" / "Last played") — folded into the station sub-line as
   a chip instead of a separate left column (v0.0.23). Frees the row width and keeps
   the time dimension on phones, where the old .row-when column was hidden. */
.su-when {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}
.su-when i { color: var(--text-muted); }
.su-when[data-tip] { cursor: inherit; }

/* Meta line between the name and the sub-line: the country flag (first) + a
   single genre tag (e.g. "🇫🇷 Hip Hop"). Plain muted text (tags stored lowercase
   -> capitalize for display). */
.station-unit__tags { margin-top: 0; line-height: 1.15; display: flex; align-items: center; gap: 6px; }
.su-tags {
    font-size: 11.5px;
    color: var(--text-secondary);
    text-transform: capitalize;
    white-space: nowrap;
}

/* Neutral newspaper icon beside the station name, linking to the station's
   /radio/ article (opens in a new tab). Only rendered for stations that have a
   published article. */
.su-article {
    flex: none;
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease;
}
.su-article:hover { color: var(--text-primary); }

/* Player: country + genre-tag chips (plus an optional article link) shown as a
   neutral row directly under the artwork square. flex-wrap keeps chips side by
   side, stacking only when very narrow. Collapses entirely when empty. */
.player-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: -8px;
    /* One chip row is always reserved, even on the welcome screen and on stations
       with no country/tag, so the description below keeps a fixed position
       instead of jumping up into the gap. 23px = one .pm-chip (11px text at 1.35
       line-height + 3px padding + 1px border, top and bottom). */
    min-height: 23px;
    flex-shrink: 0;
}
.pm-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1.35;
    white-space: nowrap;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
}
.pm-chip--tag { text-transform: capitalize; }
/* Article link chip: neutral newspaper icon + small external-link glyph, opens
   the station's /radio/ article in a new tab. */
.pm-chip--article {
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.pm-chip--article:hover { color: var(--text-primary); border-color: var(--text-muted); }
.pm-chip--article i { font-size: 13px; }
/* External-link glyph, deliberately smaller than the newspaper icon. Higher
   specificity than `.pm-chip--article i` above so the smaller size wins. */
.pm-chip--article .pm-ext { font-size: 9px; opacity: 0.7; }

/* Shared station unit (square + name + sub-line) */
.station-unit {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    flex: 1;
}
.station-square {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex: none;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.station-square img { width: 100%; height: 100%; object-fit: cover; }
.station-unit__meta { min-width: 0; }
.station-unit__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    line-height: 1.2;
}
.station-unit__name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
/* Country flag sits next to the name (full name on hover) */
.su-flag { flex: none; font-size: 13px; line-height: 1; cursor: inherit; }
.station-unit__sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 1px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    white-space: nowrap;
    overflow: hidden;
}
.station-unit__sub i { font-size: 10px; margin-right: 3px; opacity: 0.8; }
.station-unit__sub:empty { display: none; }
.station-unit__sub .sep {
    width: 3px; height: 3px; border-radius: 50%;
    background: var(--text-muted); opacity: 0.55; flex: none;
}

/* Listening time value (right of the name) */
.row-listentime {
    flex: none;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}
.row-listentime i { font-size: 11px; color: var(--text-muted); }
.row-listentime:empty { display: none; }

/* The Trending rows used to open with a filled play/stop circle. It was removed:
   the whole row is already the tap target, and the transport belongs to the
   player — a second stop control in the list only competed with it. The row's
   own hover/active states carry the affordance now. */

/* Right-aligned heat score (Trending): one flame + 0-100 index. Colour grades by
   tier: hot (>=80) accent, warm (50-79), mild (<50). Inert — no hover card, and
   `cursor: inherit` keeps it reading as part of the row's play target. */
.row-heat {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    cursor: inherit;
}
.row-heat i { font-size: 14px; }
.row-heat__num { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 14px; }
.row-heat.heat-hot {
    background: rgba(233, 30, 140, 0.12);
    border-color: rgba(233, 30, 140, 0.3);
}
.row-heat.heat-hot i { color: var(--accent-hover); }
.row-heat.heat-hot .row-heat__num { color: var(--accent-hover); }
.row-heat.heat-warm i,
.row-heat.heat-warm .row-heat__num { color: #cf6f9b; }
.row-heat.heat-mild i { color: var(--text-muted); }
.row-heat.heat-mild .row-heat__num { color: var(--text-secondary); }

/* Trend arrow folded into the heat pill (left of the flame). Replaces the old
   left-hand rank+trend badge — rows are already sorted, so the rank number was
   redundant; the arrow now reads against the score it modifies (▲ rising). */
.row-heat__trend {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.row-heat.trend-up   .row-heat__trend { color: var(--accent-hover); }
.row-heat.trend-down .row-heat__trend { color: var(--text-secondary); }
.row-heat.trend-new  .row-heat__trend {
    color: var(--accent-hover);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.3px;
}

/* The heat pill no longer opens a hover card — the score stands on its own and
   the tab names carry the "who does this data belong to" job instead. The old
   `.heat-card` breakdown rules were removed with it (v105). */

/* Right-aligned single stat (History / Saved): listening-time headline with a
   relative date label beneath it. */
.row-stat { flex: none; text-align: right; line-height: 1.2; }
.row-stat__num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}
.row-stat__num i { font-size: 11px; color: var(--text-muted); }
.row-stat__label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: inherit;
    margin-top: 1px;
}

/* Trend arrow (Trending only) */
.row-trend {
    font-size: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    flex: none;
    width: 30px;
    text-align: center;
}
.row-trend.up { color: var(--success); }
.row-trend.down { color: #ff5a5a; }
.row-trend.same { color: var(--text-muted); }
.row-trend.new { color: var(--accent); }

/* Songs tables (Trending Songs / My Songs).

   ⚠️ The STATION owns the canonical `.station-unit` here — square + name +
   sub-line, exactly as in My Stations / History. An earlier pass gave that shape
   to the *track*, which reads as a station and made the two families of tables
   contradict each other. The TRACK is a distinct object instead: a pill on the
   meta line carrying its title, its artist and its streaming links, so
   everything about it (including where to play it) is one thing.

   Replaced `.song-line*`, itself the replacement for `.row-song*`. */
.song-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin-top: 4px;
    padding: 6px 5px 6px 11px;
    border: 1px solid rgba(85, 85, 85, 0.45);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
}
.song-pill > i { font-size: 10px; color: var(--accent); flex: none; opacity: 0.9; }
/* Title over artist on phones, NOT side by side: sharing one line truncated the
   artist to "Lorez …" there. Each gets the pill's full width instead. */
.song-pill__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.song-pill__title {
    font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.3;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.song-pill__artist {
    font-size: 11.5px; color: var(--text-muted); line-height: 1.3;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Pinned to the pill's right edge so they line up down the table. Smaller than
   the app's other icon buttons because they sit inside the pill's padding. */
.song-pill__links { gap: 4px; margin-left: auto; }
.song-pill__links .link-btn { width: 26px; height: 26px; }
.song-pill__links .link-btn i { font-size: 12px; }

/* From a tablet up there is width to spare, so the pill folds back to ONE line
   and the row loses ~23px of height (108 → 85px). The two-line stack exists to
   save the artist from being ellipsised on a phone; where nothing is squeezed,
   it only costs vertical space. 700px is where the meta column clears ~600px,
   which is more than the longest title + artist in the table needs. */
@media (min-width: 700px) {
    .song-pill__text { flex-direction: row; align-items: baseline; gap: 8px; }
    /* The artist gives way first — the title is the thing being looked for. */
    .song-pill__artist { flex-shrink: 4; }

    /* ⚠️ Folding the text is NOT what makes the row shorter: the pill's height is
       set by its LINKS (26px + 12px padding = 40px), which is taller than two
       stacked text lines. Measured at 980px: the fold alone took the row from
       108 to 102px; the padding and the buttons take it to 94px. */
    .song-pill { padding-top: 3px; padding-bottom: 3px; }
    .song-pill__links .link-btn { width: 24px; height: 24px; }

    /* And the third line goes: the meta column is ~600px here, so a whole line
       for "from <user> · 2w ago" — two short chips — is waste. It rides at the
       end of the station-name line instead, right-aligned. 94 → 77px, against
       63px for a My Stations row, so the songs tables now sit at a comparable
       density instead of half again as tall.
       Grid rather than markup, so the DOM order (and the phone layout) is
       untouched; `.rs-app`-prefixed to outrank the base `.station-unit__sub`
       rule that lands later in this file. */
    .rs-app .song-row-community .station-unit__meta,
    .rs-app .song-row-my .station-unit__meta {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "name sub" "pill pill";
        column-gap: 14px;
        align-items: baseline;
    }
    .rs-app .song-row-community .station-unit__name,
    .rs-app .song-row-my .station-unit__name { grid-area: name; }
    .rs-app .song-row-community .song-pill,
    .rs-app .song-row-my .song-pill { grid-area: pill; }
    .rs-app .song-row-community .station-unit__sub,
    .rs-app .song-row-my .station-unit__sub {
        grid-area: sub; margin-top: 0; justify-content: flex-end;
    }
}

/* "from <user>" — the listener who first identified the track (Trending Songs
   only). Accent-coloured so the row reads as somebody's find. */
.song-from { display: flex; align-items: center; gap: 4px; min-width: 0; }
.song-from__lead { flex: none; opacity: 0.65; }
.song-user { color: var(--accent); min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* History refresh — small top-right corner icon (replaces the old header) */
.table-actions { display: flex; justify-content: flex-end; padding: 8px 10px 2px; }
.refresh-icon-btn {
    width: 30px; height: 30px; border: none; border-radius: 8px;
    background: transparent; color: var(--text-muted); cursor: pointer;
    display: grid; place-items: center; font-size: 13px; transition: .15s;
}
.refresh-icon-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.refresh-icon-btn.refreshing i,
.refresh-icon-btn .fa-spin { animation: rs-spin .8s linear infinite; }
@keyframes rs-spin { to { transform: rotate(360deg); } }

/* ============================================
   TABLE FOOTER (per-tab caption / legend)
   ============================================ */
.table-footer {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    border-top: 1px solid rgba(85, 85, 85, 0.3);
    background: var(--bg-secondary);
}
.table-footer__text {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
}
/* Real (Font Awesome) icons in the footer, matched to the in-row icon style */
.table-footer__text i {
    font-size: 11px;
    opacity: 0.85;
}

/* History refresh button — now lives in the footer, right-aligned */
.refresh-footer-btn {
    flex: none;
    width: 30px; height: 30px;
    border: none; border-radius: 8px;
    background: transparent; color: var(--text-muted);
    cursor: pointer; display: grid; place-items: center;
    font-size: 13px; transition: .15s;
}
.refresh-footer-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.refresh-footer-btn.spinning i { animation: rs-spin .8s linear infinite; }

/* Sub-line metric chips carry data-tip tooltips but follow the row's cursor
   (no help "?" cursor) */
.su-stat { cursor: inherit; }
/* Listening-time chip lives in the sub-line; hidden on desktop (time shown in
   its own .row-listentime column) and revealed on phones (see ≤600px block).
   Its leading separator (.su-time-sep) toggles with it to avoid a dangling dot. */
.su-time, .su-time-sep { display: none; }
.su-time i { color: var(--text-muted); }

/* ============================================
   CUSTOM TOOLTIP (driven by tooltip.js)
   ============================================ */
.rs-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    max-width: 240px;
    background: #0c0c0c;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .12s ease, transform .12s ease;
}
.rs-tooltip.show { opacity: 1; transform: translateY(0); }
/* Rich (HTML) tooltip — the card supplies its own padding/width */
.rs-tooltip.rich { padding: 0; max-width: 240px; font-weight: 400; }
.rs-tooltip::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom: 0;
    border-top-color: #0c0c0c;
}
.rs-tooltip.below::after {
    bottom: auto;
    top: -5px;
    border-top: 0;
    border-bottom: 5px solid #0c0c0c;
}

@media (max-width: 600px) {
    .station-square { width: 36px; height: 36px; font-size: 15px; }

    /* sub-line (songs tables' time chip) a touch smaller on narrow phones */
    .station-unit__sub { gap: 7px; font-size: 11px; flex-wrap: nowrap; }

    /* Phones — Songs tables. The track pill stacks title over artist and the
       station keeps its own line above, so nothing here competes for width the
       way the old side-by-side layout did: the only phone tweak is the clock
       glyph, redundant beside "2w ago". */
    .song-row-community .station-unit__sub .su-when i,
    .song-row-my .station-unit__sub .su-when i { display: none; }
}

/* ============================================
   RADIO STATION ARTICLES SECTION (homepage, below player + tables)
   ============================================ */
.articles-section {
    width: 100%;
    max-width: 1024px;          /* = player 380 + gap 24 + table 620; aligns under the block */
    margin: -16px auto 0;       /* pull up to tighten the gap under the player + tables */
    box-sizing: border-box;
    padding: 0 32px 48px;
}

/* Search bar (icon left, input, small arrow submit right) */
.articles-search {
    margin-bottom: 20px;
}

.articles-search__field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 6px 4px 12px;
}

.articles-search__field > i {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Wrapping token area: search-term chips flow left of the text box and wrap
   to a new line when the field fills up. */
.articles-search__tokens {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.articles-search__input {
    flex: 1 1 120px;
    min-width: 120px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    padding: 7px 0;
}

/* A committed search term (multiple terms search as an OR / union). */
.articles-search__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 3px 3px 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.25;
}

.articles-search__chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.articles-search__chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.articles-search__chip-remove:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.articles-search__input::placeholder {
    color: var(--text-muted);
}

/* No accent focus box on this search field (the field's own border is enough). */
.articles-search__input:focus,
.articles-search__input:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Recolor the native clear (×) to match the arrow button (muted). */
.articles-search__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    cursor: pointer;
    background-color: var(--text-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.articles-search__input::-webkit-search-cancel-button:hover {
    background-color: var(--text-primary);
}

.articles-search__submit {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.articles-search__submit:hover {
    color: var(--text-primary);
}

/* "Browse all" moved below the cards */
.articles-footer {
    margin-top: 28px;
    text-align: center;
}

.articles-browse-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.articles-browse-all:hover {
    color: var(--accent-hover);
}

/* Card grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 900px) {
    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

.articles-loading {
    grid-column: 1 / -1;
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
}

/* While a fetch is in flight, dim the existing cards in place instead of
   wiping them to a loading state (which collapsed the section and flashed). */
.articles-grid.is-loading {
    opacity: 0.55;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.rs-article-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.rs-article-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(233, 30, 140, 0.15);
}

.rs-article-card__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    background: var(--bg-tertiary);
    overflow: hidden;
    text-decoration: none;
}

.rs-article-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rs-article-card__fallback {
    display: none;
    font-size: 2rem;
    color: var(--text-muted);
}

.rs-article-card__media.is-fallback .rs-article-card__fallback {
    display: block;
}

.rs-article-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
}

.rs-article-card__tag {
    align-self: flex-start;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 4px;
}

.rs-article-card__station {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rs-article-card__title {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 600;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rs-article-card__title:hover {
    color: var(--accent);
}

.rs-article-card__meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.rs-article-card__date {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rs-article-card__sep {
    opacity: 0.6;
}

.rs-article-card__listen {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.rs-article-card__listen:hover {
    background: var(--accent);
    color: #fff;
}

.articles-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-muted);
}

.articles-empty__icon {
    font-size: 2rem;
    color: var(--border);
    margin-bottom: 10px;
}

.articles-empty__text {
    margin: 0;
}

/* Desktop: drop the side padding so the cards sit flush with the centered
   player + table block (both are 1024px wide and centered in .main-content). */
@media (min-width: 1201px) {
    .articles-section {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Match .content-area's side padding once the columns stack. */
@media (max-width: 1024px) {
    .articles-section {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 768px) {
    .articles-section {
        padding: 20px 10px 32px;
    }
}

/* ============================================================================
   Level momentum meter (sidebar profile) + level-up reward pop-out
   ============================================================================ */

/* Momentum meter under the profile: progress toward the next tier */
.level-momentum {
    margin-top: 4px;
}
.level-momentum__track {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.level-momentum__track > i {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left;
    transform: scaleX(0);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #f5701e 82%, #f0c33c);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.level-momentum__label {
    margin-top: 5px;
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    font-variant-numeric: tabular-nums;
}
.level-momentum__flame {
    font-size: 11px;
}
/* The collapsed 68px rail is too narrow for the meter — show it only when expanded */
.sidebar.collapsed .level-momentum {
    display: none;
}

/* Top Shufflers leaderboard (sidebar): rank + badge + name + live level */
.top-shufflers {
    list-style: none;
    margin: 0;
    padding: 2px 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sidebar.collapsed .top-shufflers {
    display: none;
}
.shuffler {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px;
    border-radius: 8px;
}
.shuffler__rank {
    flex: 0 0 auto;
    width: 15px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.shuffler:nth-child(1) .shuffler__rank { color: #f0c33c; }
.shuffler:nth-child(2) .shuffler__rank { color: #cfd3d8; }
.shuffler:nth-child(3) .shuffler__rank { color: #d69a5c; }
.shuffler__badge {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 50%;
}
.shuffler__name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shuffler__level {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
}

/* The reward: a small box that emerges from the profile (positioned by levels.js) */
.level-reward {
    --reward-tier: #f0c33c;
    position: fixed;
    left: 300px;
    top: 120px;
    z-index: 1200;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: linear-gradient(180deg, #262024, #1b1618);
    border: 1px solid rgba(233, 30, 140, 0.4);
    border-radius: 16px;
    padding: 16px 16px 15px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateX(-14px) scale(0.94);
    transform-origin: left top;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.38s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.level-reward.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.level-reward__pointer {
    position: absolute;
    left: -8px;
    top: 34px;
    width: 14px;
    height: 14px;
    background: #262024;
    border-left: 1px solid rgba(233, 30, 140, 0.4);
    border-bottom: 1px solid rgba(233, 30, 140, 0.4);
    transform: rotate(45deg);
}
.level-reward__eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent-hover);
    margin-bottom: 11px;
}
.level-reward__row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.level-reward__badge {
    width: 74px;
    height: 74px;
    flex: 0 0 auto;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 36%, rgba(233, 30, 140, 0.28), transparent 68%), #100e0d;
    border: 1px solid rgba(255, 210, 74, 0.25);
}
.level-reward__badge img {
    width: 88%;
    height: 88%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
    animation: reward-pop 0.75s cubic-bezier(0.2, 1.5, 0.35, 1) both;
}
@keyframes reward-pop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: scale(1); }
}
.level-reward__title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}
.level-reward__title b {
    font-weight: 900;
    color: var(--reward-tier);
}
.level-reward__sub {
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}
.level-reward__cta {
    margin-top: 14px;
    width: 100%;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, var(--accent-hover), var(--accent));
    border: none;
    border-radius: 11px;
    padding: 10px;
}
.level-reward__cta:hover { filter: brightness(1.06); }
.level-reward__cta:active { transform: translateY(1px); }

/* On narrow screens, present it as a centered bottom sheet instead */
.level-reward.is-sheet {
    left: 50% !important;
    top: auto !important;
    bottom: 20px;
    transform: translateX(-50%) translateY(16px) scale(0.96);
    width: min(360px, calc(100vw - 24px));
}
.level-reward.is-sheet.is-visible {
    transform: translateX(-50%);
}
.level-reward.is-sheet .level-reward__pointer {
    display: none;
}

#levelRewardConfetti {
    position: fixed;
    inset: 0;
    z-index: 1190;
    pointer-events: none;
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .level-reward,
    .level-reward__badge img,
    .level-momentum__track > i {
        transition: none;
        animation: none;
    }
}

/* ============================================================================
   BROADCAST-LOG REDESIGN (v0.0.42) — mobile #1d + desktop #3b
   A dark, typographic "broadcast log". Inter for prose, JetBrains Mono for every
   number / code / uppercase label. New layout lives under .rs-app; old sidebar /
   .main-content / .station-artwork rules are inert (those classes left the DOM).
   Reused classes (.player-card, .table-row, .tab-toggle-btn, .credits-hint …)
   are overridden here with higher specificity (.rs-app …).
   ============================================================================ */
:root {
    --rs-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --rs-hair: rgba(85, 85, 85, .30);
    --rs-hair-soft: rgba(85, 85, 85, .22);
    --rs-dim: #555555;
    --rs-heat-grad: linear-gradient(90deg, #e91e8c, #ff6b35);
    --rs-accent-grad: linear-gradient(135deg, #e91e8c, #ff4da6);
    --rs-glow: 0 8px 26px rgba(233, 30, 140, .32);
    --rs-warm: #cf6f9b;
    --rs-mild: #d0d0d0;
}

/* ---- App shell -------------------------------------------------------- */
.rs-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-primary);
    overflow: hidden;
}

/* Header (desktop) / app bar (mobile) */
.rs-header {
    flex: none;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 58px;
    padding: 0 22px;
    border-bottom: 1px solid var(--rs-hair);
    background: var(--bg-primary);
}
.rs-wordmark {
    font-family: var(--rs-mono);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2.6px;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
}
.rs-wordmark__slash { color: var(--accent); }

.rs-search { flex: 1; max-width: 420px; margin: 0; }
.rs-search .rs-search__field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}
.rs-search .rs-search__field > .fa-search { color: var(--text-muted); font-size: 12px; }
.rs-search .articles-search__tokens { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rs-search .articles-search__input {
    flex: 1; min-width: 80px; border: 0; background: transparent; outline: none;
    color: var(--text-primary); font-family: 'Inter', sans-serif; font-size: 12.5px;
}
.rs-search .articles-search__input::placeholder { color: var(--text-muted); }
.rs-search .articles-search__submit {
    border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
    padding: 2px 4px; font-size: 12px;
}
.rs-search .articles-search__submit:hover { color: var(--accent); }

.rs-header__spacer { flex: 1; }

.rs-usermeta { display: flex; align-items: center; gap: 14px; }
.rs-meta { font-family: var(--rs-mono); font-size: 10.5px; letter-spacing: 1.2px; white-space: nowrap; }
.rs-meta--shf { color: var(--text-muted); }
.rs-meta--id { color: var(--accent-hover); }

.rs-user { position: relative; display: flex; align-items: center; }
.rs-login-btn {
    padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border);
    background: transparent; color: var(--text-secondary); cursor: pointer;
    font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600;
}
.rs-login-btn:hover { border-color: var(--accent); color: var(--text-primary); }
/* Shown to EVERYONE, including anonymous visitors. They have a level and a rank
   like anyone else (the great majority of the 2,076 ranked users are anonymous)
   and used to see neither: this block was gated behind .is-logged-in, i.e. visible
   to 39 of 7,851 users. Anonymous visitors get the block AND the Log in button. */
.rs-user__btn {
    display: flex; align-items: center; gap: 9px; padding: 3px 8px 3px 3px;
    border: 0; background: transparent; cursor: pointer; border-radius: 999px;
}
.rs-user__btn:hover { background: var(--bg-secondary); }
.rs-user__badge { width: 30px; height: 30px; border-radius: 50%; object-fit: contain; }
.rs-user__name { font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 600; color: var(--text-secondary); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Logged-in state (class toggled by tabs.js): only the Log in button reacts now. */
.rs-app.is-logged-in .rs-login-btn { display: none; }
/* "Log out" is meaningless to a visitor who was never logged in. */
.rs-app:not(.is-logged-in) #menuLogout { display: none; }

/* --- RS-LEVELRING: the badge as a progress gauge ---------------------------
   The fox badge was decorative. The ring turns it into a status object -- the arc
   is progress toward the next tier -- so the icon answers "how close am I?"
   without costing a pixel of extra header space. Geometry is r=20 in a 44x44 box;
   levels.js sets stroke-dashoffset from level.progress.fraction. */
.rs-levelring { position: relative; display: inline-flex; flex: 0 0 auto; width: 40px; height: 40px; }
.rs-levelring__svg {
    position: absolute; inset: 0; width: 100%; height: 100%;
    transform: rotate(-90deg);            /* start the arc at 12 o'clock */
}
.rs-levelring__track,
.rs-levelring__fill { fill: none; stroke-width: 2.5; }
.rs-levelring__track { stroke: var(--rs-hair); }
.rs-levelring__fill {
    stroke: var(--accent); stroke-linecap: round;
    transition: stroke-dashoffset .5s ease;
}
/* ⚠️ Size the badge explicitly. The first cut used `inset: 5px; width: auto` —
   but for a REPLACED element an auto width resolves to the intrinsic size and the
   opposing offset is dropped (over-constrained), so the badge did not sit in the
   ring at all: it rendered empty. Centre it and give it real dimensions.
   28px clears the stroke: r=20 of a 44 box scaled to 40px leaves ~34px inside. */
.rs-levelring .rs-user__badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
}

/* Username over "TIER · #rank" */
.rs-user__id { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.15; }
.rs-user__level {
    font-family: var(--rs-mono); font-size: 9.5px; letter-spacing: 1px;
    color: var(--accent); white-space: nowrap;
}
.rs-user__level:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
    .rs-levelring__fill { transition: none; }
}

/* Phones: keep the ring -- it IS the level -- and drop the text column; the header
   already carries a wordmark and a shuffle count at 375px. */
@media (max-width: 620px) {
    .rs-user__id { display: none; }
    .rs-user__btn { gap: 0; padding: 3px; }
}

.rs-usermenu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 200;
    min-width: 184px; padding: 6px; border-radius: 10px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .5); display: flex; flex-direction: column;
}
.rs-usermenu[hidden] { display: none; }
.rs-usermenu__item {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0;
    background: transparent; color: var(--text-secondary); cursor: pointer;
    font-family: 'Inter', sans-serif; font-size: 13px; text-align: left; text-decoration: none;
    border-radius: 7px;
}
.rs-usermenu__item i { width: 15px; text-align: center; color: var(--text-muted); }
.rs-usermenu__item:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ---- Body: three columns --------------------------------------------- */
.rs-body { flex: 1; display: flex; min-height: 0; }

/* ---- LEFT: player ----------------------------------------------------- */
.rs-app .rs-player-col {
    width: 400px; flex: none; padding: 24px; position: relative; overflow: hidden;
    border-right: 1px solid var(--rs-hair); background: var(--bg-primary);
}
.rs-app .player-card {
    /* reset the old fixed-height card */
    all: unset;
    display: flex; flex-direction: column; height: 100%; box-sizing: border-box;
    position: relative; z-index: 1;
}
.rs-hero { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.rs-hero__glow {
    position: absolute; top: -120px; right: -90px; width: 280px; height: 280px;
    filter: blur(60px); opacity: .4; pointer-events: none; z-index: 0;
    background: radial-gradient(circle, var(--rs-station-color, #e91e8c), transparent 70%);
    transition: background .8s ease;
}

.rs-hero__eyebrow-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rs-hero__eyebrow { display: inline-flex; align-items: center; gap: 7px; font-family: var(--rs-mono); font-weight: 600; font-size: 10px; letter-spacing: 1.9px; text-transform: uppercase; color: var(--text-secondary); }
.rs-hero__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px var(--accent); }
.rs-hero.is-standby .rs-hero__dot { background: transparent; box-shadow: none; border: 1px solid var(--text-muted); }
.rs-hero__timer { font-family: var(--rs-mono); font-size: 9.5px; letter-spacing: .5px; color: var(--text-muted); white-space: nowrap; }
.rs-hero__standby { display: none; margin-top: 6px; font-family: var(--rs-mono); font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); }
.rs-hero.is-standby .rs-hero__standby { display: block; }

.rs-hero__name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 44px; line-height: 1.02; letter-spacing: -1.8px; margin-top: 22px; color: var(--text-primary); text-wrap: pretty; }

.rs-app .player-meta {
    all: unset;
    display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 12px;
    font-family: 'Inter', sans-serif; font-size: 13px; color: var(--text-secondary);
}
.rs-app .player-meta:empty { display: none; }
.rs-app .player-meta .pm-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--rs-dim); }
.rs-app .player-meta .pm-flame { display: inline-flex; align-items: center; gap: 4px; font-family: var(--rs-mono); font-weight: 600; font-size: 12px; color: var(--accent-hover); }
.rs-app .player-meta .pm-article { color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.rs-app .player-meta .pm-article:hover { color: var(--accent); }

/* Meta row: the flag/country/genre/heat chips + the equalizer, on one line */
.rs-hero__metarow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.rs-app .rs-hero__metarow .player-meta { margin-top: 0; }

/* Equalizer — a small "now playing" indicator, INLINE with the meta and sized to the
   tags (~13px). Shown ONLY while playing. */
.rs-eq { display: none; align-items: flex-end; gap: 2px; height: 13px; }
.rs-hero.is-playing .rs-eq { display: inline-flex; }
.rs-eq > i { width: 2.5px; height: 13px; border-radius: 1px; transform-origin: bottom; background: var(--accent); animation: rs-eq 1s ease-in-out infinite; }
.rs-eq > i:nth-child(3n+1) { background: #e91e8c; }
.rs-eq > i:nth-child(3n+2) { background: #ff6b35; }
.rs-eq > i:nth-child(3n+3) { background: #ff4da6; }
.rs-eq > i:nth-child(1) { animation-delay: 0s; }
.rs-eq > i:nth-child(2) { animation-delay: .16s; animation-duration: 1.15s; }
.rs-eq > i:nth-child(3) { animation-delay: .32s; animation-duration: 1.3s; }
.rs-eq > i:nth-child(4) { animation-delay: .1s; }
.rs-eq > i:nth-child(5) { animation-delay: .26s; animation-duration: 1.15s; }
.rs-eq > i:nth-child(6) { animation-delay: .42s; animation-duration: 1.3s; }
@keyframes rs-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* Layout stability: the controls sit at the BOTTOM of the player column and never
   move. The top block flexes to fill everything above them, and inside it the
   description viewport is the elastic item — so the description takes all the free
   space up to just above the buttons, whatever the station. */
.rs-hero__top {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0;
}
.rs-hero__name, .rs-hero__metarow, .rs-hero__tuning { flex: none; }

/* TUNING: hide name/meta/desc, show the rotating loading line (eq already hidden) */
.rs-hero.is-tuning .rs-hero__name,
.rs-hero.is-tuning .rs-hero__metarow,
.rs-hero.is-tuning .rs-hero__descwrap,
.rs-hero.is-tuning .expand-desc-btn { display: none; }
.rs-hero__tuning { min-height: 96px; display: flex; align-items: center; margin-top: 18px; }
.rs-hero__tuning p { font-family: 'Inter', sans-serif; font-style: italic; font-size: 15px; line-height: 1.4; color: var(--accent-hover); animation: rs-text 1.5s ease-in-out infinite; }
@keyframes rs-text { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

.rs-app .station-desc-viewport { all: unset; display: block; margin-top: 14px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.rs-app .station-desc-viewport::-webkit-scrollbar { width: 0; height: 0; }
.rs-hero__desc { font-family: 'Inter', sans-serif; font-size: 13px; line-height: 1.65; color: var(--text-muted); margin: 0; }
/* the description scrolls within its bounded box; the expand chevron is no longer used */
.rs-app .expand-desc-btn { display: none !important; }

/* Controls — never shrink: all the slack is taken by the description above them */
.rs-controls { flex: none; display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.rs-iconbtn {
    width: 58px; height: 58px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; border: 1px solid var(--border); background: var(--bg-secondary);
    color: var(--text-primary); cursor: pointer; font-size: 16px; transition: background .15s ease, border-color .15s ease;
}
.rs-iconbtn:hover { background: var(--bg-tertiary); }
/* Control icon buttons are icon-only; hide any text label (e.g. #saveButton's "Save Station") */
.rs-controls .rs-iconbtn span { display: none; }
.rs-savebtn.saved { border-color: rgba(233, 30, 140, .5); background: rgba(233, 30, 140, .14); color: var(--accent); }
.rs-btn-primary {
    flex: 1; height: 58px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    border: 0; border-radius: 12px; background: var(--rs-accent-grad); box-shadow: var(--rs-glow);
    color: #fff; cursor: pointer; position: relative; overflow: hidden;
    font-family: var(--rs-mono); font-weight: 700; font-size: 13px; letter-spacing: 1.6px; text-transform: uppercase;
}
.rs-btn-primary i { font-size: 16px; }
.rs-btn-primary.disabled, .rs-btn-primary:disabled { opacity: .6; cursor: default; }
.rs-btn-primary .rs-shuffle-spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.rs-btn-primary.loading i, .rs-btn-primary.loading .rs-btn-primary__label { display: none; }
.rs-btn-primary.loading .rs-shuffle-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Shuffle deck — the desktop translation of the mobile bottom bar: Shuffle gets its
   own surface at the foot of the column (full-bleed hairline + a slight lift off the
   column ground) so it reads as "next station", not as another player control. The
   negative margins cancel .rs-player-col's 24px padding so the strip runs edge to edge
   and sits flush with the bottom of the column. */
.rs-deck {
    flex: none; position: relative; z-index: 1;
    margin: 18px -24px -24px; padding: 16px 24px 24px;
    border-top: 1px solid var(--rs-hair); background: rgba(255, 255, 255, .025);
}
/* flex:none so the hero column can't stretch it vertically; the base .rs-btn-primary
   flex:1 still applies to the mobile bottom-bar copy. */
.rs-shufflebtn { flex: none; width: 100%; }

/* Identify is now a small icon button in the control row: ✨ + ♪, no label, no credit count */
.rs-identifybtn { gap: 1px; }
.rs-identifybtn i.bi { font-size: 17px; }
.rs-identifybtn .rs-identifybtn__note { font-size: 11px; }
.rs-identifybtn:disabled, .rs-identifybtn.disabled { opacity: .5; cursor: not-allowed; }
.rs-identifybtn:disabled:hover { background: var(--bg-secondary); }

.rs-app .volume-control.rs-volume { all: unset; flex: none; display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.rs-app .rs-volume .volume-mute-btn { background: transparent; border: 0; color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 4px; }
.rs-app .rs-volume .volume-mute-btn:hover { color: var(--text-primary); }
.rs-app .rs-volume .volume-slider-container { flex: 1; }
.rs-app .rs-volume .volume-slider { width: 100%; }

/* ---- CENTRE: the log -------------------------------------------------- */
.rs-log { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-primary); }
.rs-tabstrip {
    flex: none; position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 0 20px; background: var(--bg-primary); border-bottom: 1px solid var(--rs-hair);
}
.rs-tabstrip__tabs { flex: 1 1 auto; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.rs-tabstrip__tabs::-webkit-scrollbar { width: 0; height: 0; }
.rs-app .rs-tabstrip .tab-toggle-btn {
    all: unset; box-sizing: border-box; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
    padding: 14px 12px 12px; border-bottom: 2px solid transparent;
    font-family: var(--rs-mono); font-weight: 600; font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted);
}
.rs-app .rs-tabstrip .tab-toggle-btn.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.rs-app .rs-tabstrip .tab-toggle-btn:hover { color: var(--text-secondary); }
/* Labels stay visible on every breakpoint (overrides the old icon-only mobile rule),
   and each tab now carries a Bootstrap Icons glyph before its name: flame /
   beamed notes for the two Trending tabs, heart / note / clock for the three
   "My" ones. Sized a touch above the 10.5px mono label so the glyph reads at the
   same optical weight; it dims with the label and lights up on the active tab. */
.rs-app .rs-tabstrip .tab-toggle-btn span { display: inline; }
.rs-app .rs-tabstrip .tab-toggle-btn i { font-size: 13px; line-height: 1; opacity: .75; }
.rs-app .rs-tabstrip .tab-toggle-btn:hover i,
.rs-app .rs-tabstrip .tab-toggle-btn.active i { opacity: 1; }
/* The selected tab's icon turns accent pink — the same colour as the underline
   below it, so the strip's active marker reads as one thing top and bottom. */
.rs-app .rs-tabstrip .tab-toggle-btn.active i { color: var(--accent); }
/* Splits the strip into its two families: the two "Trending" (community) tabs,
   then the three "My" (personal) ones. The names already carry the distinction —
   this just makes the grouping visible before anything is read. `flex: none` so
   the horizontally-scrolling strip can't squash it to nothing. */
.rs-tabstrip__div { flex: none; align-self: center; width: 1px; height: 18px; margin: 0 10px; background: var(--rs-hair); }
/* `.rs-tabbadge` (the saved-stations / your-songs counts) was removed in v106 —
   the tab names carry the meaning and the counts added noise. The JS that fed
   them is guarded on the element and is now an inert no-op. */
.rs-tabstrip__meta { flex: none; font-family: var(--rs-mono); font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--rs-dim); white-space: nowrap; }

.rs-log__scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.rs-log__scroll::-webkit-scrollbar { width: 0; height: 0; }
.rs-app .tab-content { display: none; }
.rs-app .tab-content.active { display: block; }
/* Each tab fills the scroll viewport so the articles block stays pinned below the
   fold on every tab — otherwise a short/loading tab (e.g. History before it loads)
   lets the articles jump up into view for a moment ("flash"). Resolves to 0 on
   mobile (the scroller is auto-height there), so mobile is unaffected. */
.rs-app .rs-log__scroll > .tab-content.active { min-height: 100%; }
.rs-app .discovery-table { all: unset; display: block; }
.rs-app .table-body { all: unset; display: block; }
.rs-app .loading-placeholder { padding: 22px 20px; font-family: var(--rs-mono); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--rs-dim); }

/* Trending column grid (desktop) shared by header + rows */
.rs-colhead, .rs-app .rs-trow {
    display: grid; align-items: center;
    grid-template-columns: 30px minmax(210px, 1fr) 100px 74px 82px 112px 30px; gap: 10px;
    padding: 11px 20px;
}
.rs-colhead { border-bottom: 1px solid var(--rs-hair); }
.rs-colhead > span { font-family: var(--rs-mono); font-weight: 600; font-size: 9.5px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--rs-dim); }
.rs-colhead__48h, .rs-colhead__listeners, .rs-colhead__heat { text-align: right; }

.rs-app .rs-trow { border-bottom: 1px solid var(--rs-hair-soft); cursor: pointer; transition: background .15s ease; }
.rs-app .rs-trow:hover { background: rgba(255, 255, 255, .03); }
.rs-app .rs-trow.active { background: rgba(233, 30, 140, .07); }
.rs-trow__rank { font-family: var(--rs-mono); font-weight: 600; font-size: 13px; color: var(--rs-dim); text-align: right; }
.rs-trow__station { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rs-sq { flex: none; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.rs-trow__namewrap { min-width: 0; }
.rs-trow__name { display: flex; align-items: center; gap: 6px; min-width: 0; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14.5px; color: var(--text-primary); }
.rs-trow__nametext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-trow__name .su-flag { font-size: 12px; }
.rs-trow__name .su-article { color: var(--text-muted); font-size: 12px; }
.rs-trow__country { font-family: 'Inter', sans-serif; font-size: 11px; color: var(--text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-trow__mobilesub { display: none; }
.rs-trow__genre { font-family: var(--rs-mono); font-weight: 500; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-trow__48h, .rs-trow__listeners { font-family: var(--rs-mono); font-weight: 500; font-size: 12px; color: var(--text-secondary); text-align: right; }
.rs-trow__heat { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.rs-heatbar { flex: 1; max-width: 66px; height: 3px; border-radius: 2px; background: #2e2e2e; overflow: hidden; }
.rs-heatbar > i { display: block; height: 100%; background: var(--rs-heat-grad); }
.rs-heat-num { font-family: var(--rs-mono); font-weight: 700; font-size: 15px; }
.rs-heat-num.heat-hot { color: var(--accent-hover); }
.rs-heat-num.heat-warm { color: var(--rs-warm); }
.rs-heat-num.heat-mild { color: var(--rs-mild); }
.rs-trow .leaderboard-heart, .rs-app .rs-trow .leaderboard-heart {
    all: unset; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    color: var(--text-muted); font-size: 15px; padding: 6px;
}
.rs-trow .leaderboard-heart.liked { color: var(--accent); }
.rs-trow__mgenre { display: none; }

/* Generic rows (History / Saved / Songs) — simpler flex rhythm */
.rs-app .table-row:not(.rs-trow) {
    display: flex; align-items: center; gap: 11px; padding: 11px 20px;
    border-bottom: 1px solid var(--rs-hair-soft); cursor: pointer; transition: background .15s ease;
}
.rs-app .table-row:not(.rs-trow):hover { background: rgba(255, 255, 255, .03); }
.rs-app .table-row.active { background: rgba(233, 30, 140, .07); }
.rs-app .table-row .station-unit { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; }
.rs-app .station-unit__meta { min-width: 0; flex: 1; }
.rs-app .station-square { flex: none; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.rs-app .station-unit__name { display: flex; align-items: center; gap: 6px; min-width: 0; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.rs-app .station-unit__name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-app .station-unit__tags { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-family: var(--rs-mono); font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); }
.rs-app .station-unit__sub { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-family: var(--rs-mono); font-size: 10px; letter-spacing: .5px; color: var(--text-muted); }
.rs-app .row-stat { flex: none; text-align: right; }
.rs-app .row-stat__num { font-family: var(--rs-mono); font-weight: 600; font-size: 12px; color: var(--text-secondary); }
.rs-app .row-stat__label { font-family: var(--rs-mono); font-size: 9px; letter-spacing: .4px; text-transform: uppercase; color: var(--rs-dim); margin-top: 2px; }
.rs-app .saved-heart, .rs-app .history-heart { all: unset; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); font-size: 15px; padding: 6px; }
.rs-app .saved-heart.liked, .rs-app .history-heart.liked { color: var(--accent); }

/* Table footer (footnote) */
.rs-app .table-footer { all: unset; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 20px; }
.rs-app .table-footer__text { font-family: var(--rs-mono); font-size: 10px; line-height: 1.6; letter-spacing: .4px; text-transform: uppercase; color: var(--rs-dim); }
.rs-app .refresh-footer-btn { all: unset; cursor: pointer; color: var(--text-muted); font-size: 12px; padding: 4px; }
.rs-app .refresh-footer-btn:hover { color: var(--accent); }
.rs-app .load-more-container { padding: 14px 20px 4px; }
.rs-app .load-more-btn { all: unset; box-sizing: border-box; display: block; width: 100%; text-align: center; padding: 11px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; font-family: var(--rs-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.rs-app .load-more-btn:hover { border-color: var(--accent); color: var(--text-primary); }

/* Articles block at the bottom of the log */
.rs-app .articles-section.rs-articles { all: unset; display: block; padding: 26px 22px 30px; }
.rs-articles__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.rs-articles__label { font-family: var(--rs-mono); font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--rs-dim); }
.rs-app .rs-articles__all { font-family: var(--rs-mono); font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.rs-app .articles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rs-app .articles-loading, .rs-app .articles-empty__text { font-family: var(--rs-mono); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: var(--rs-dim); }

/* ---- RIGHT: Your Panel (collapsible) ---------------------------------- */
.rs-app .rs-panel { width: 272px; flex: none; border-left: 1px solid var(--rs-hair); background: var(--bg-primary); overflow-y: auto; scrollbar-width: none; transition: width .2s ease; }
.rs-app .rs-panel::-webkit-scrollbar { width: 0; }
.rs-panel__expanded { padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.rs-panel__rail { display: none; }
.rs-app .rs-panel.collapsed { width: 58px; }
.rs-app .rs-panel.collapsed .rs-panel__expanded { display: none; }
.rs-app .rs-panel.collapsed .rs-panel__rail { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 0; }

.rs-panel__head { display: flex; align-items: center; justify-content: space-between; }
.rs-panel__title { font-family: var(--rs-mono); font-weight: 600; font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--rs-dim); }
.rs-panel__toggle { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-muted); cursor: pointer; font-size: 12px; }
.rs-panel__toggle:hover { color: var(--text-primary); border-color: var(--accent); }
.rs-panel__rail .rs-panel__toggle { width: 36px; height: 36px; border-radius: 9px; }
.rs-panel__raildiv { width: 24px; height: 1px; background: rgba(85, 85, 85, .4); }
.rs-railicon { position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-muted); font-size: 15px; }
.rs-railicon .bi-stars { color: var(--accent-hover); }
.rs-railicon__badge { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); border: 2px solid var(--bg-primary); color: #fff; font-family: var(--rs-mono); font-size: 9px; display: flex; align-items: center; justify-content: center; }
.rs-railbadge { width: 26px; height: 26px; border-radius: 50%; object-fit: contain; }

/* Song discovery card (reuses .credits-hint id) */
.rs-app .credits-hint.rs-discovery { all: unset; display: block; padding: 14px 15px; border-radius: 10px; border: 1px solid rgba(233, 30, 140, .3); background: rgba(233, 30, 140, .08); }
.rs-discovery__head { display: flex; align-items: center; justify-content: space-between; }
.rs-discovery__eyebrow { font-family: var(--rs-mono); font-weight: 600; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-hover); }
.rs-discovery__reset { font-family: var(--rs-mono); font-size: 9.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); }
.rs-app .rs-discovery__count { all: unset; display: block; margin: 8px 0 6px; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 12px; color: var(--text-secondary); }
.rs-app .rs-discovery__count b { font-family: var(--rs-mono); font-weight: 700; font-size: 24px; color: var(--text-primary); margin-right: 6px; }
.rs-app .rs-discovery .credits-hint__text { font-family: 'Inter', sans-serif; font-size: 11.5px; line-height: 1.55; color: var(--text-muted); }

/* Level card */
.rs-levelcard { display: grid; grid-template-columns: 34px 1fr; grid-template-areas: "badge info" "track track" "streak streak"; align-items: center; gap: 10px 12px; padding: 14px 15px; border-radius: 10px; background: var(--bg-secondary); }
.rs-levelcard__badge { grid-area: badge; width: 34px; height: 34px; border-radius: 50%; object-fit: contain; }
.rs-levelcard__info { grid-area: info; min-width: 0; }
.rs-levelcard__name { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px; color: var(--text-primary); }
.rs-levelcard__prog { font-family: var(--rs-mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.rs-levelcard__track { grid-area: track; height: 5px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; }
.rs-levelcard__track > i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0); background: var(--rs-heat-grad); transition: transform .4s ease; }
.rs-levelcard__streak { grid-area: streak; font-family: 'Inter', sans-serif; font-size: 11.5px; color: var(--text-secondary); }

.rs-panel__section { display: flex; flex-direction: column; gap: 11px; }
.rs-panel__label { font-family: var(--rs-mono); font-weight: 600; font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--rs-dim); }

/* Top shufflers + activity: rely on existing component styles, minor tuning */
.rs-app .top-shufflers { all: unset; display: flex; flex-direction: column; gap: 11px; list-style: none; }
.rs-app .top-shufflers .shuffler { display: flex; align-items: center; gap: 10px; }
.rs-app .shuffler__rank { font-family: var(--rs-mono); font-weight: 600; font-size: 11px; color: var(--rs-dim); width: 14px; }
.rs-app .top-shufflers .shuffler:nth-child(1) .shuffler__rank { color: var(--gold); }
.rs-app .top-shufflers .shuffler:nth-child(2) .shuffler__rank { color: var(--silver); }
.rs-app .top-shufflers .shuffler:nth-child(3) .shuffler__rank { color: var(--bronze); }
.rs-app .shuffler__badge { width: 24px; height: 24px; border-radius: 50%; object-fit: contain; }
.rs-app .shuffler__name { flex: 1; min-width: 0; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-app .shuffler__level { font-family: var(--rs-mono); font-weight: 600; font-size: 11px; color: var(--text-muted); }
.rs-app .activity-feed { all: unset; display: flex; flex-direction: column; gap: 13px; }
.rs-app .activity-feed__message { display: flex; align-items: flex-start; gap: 9px; }
.rs-app .activity-feed__icon { flex: none; width: 13px; text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.rs-app .activity-feed__text { font-family: 'Inter', sans-serif; font-size: 11.5px; line-height: 1.45; color: var(--text-secondary); }

/* ---- MOBILE BOTTOM BAR (hidden on desktop) ---------------------------- */
.rs-bottombar { display: none; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 1180px) {
    .rs-colhead__listeners, .rs-app .rs-trow__listeners { display: none; }
    .rs-colhead, .rs-app .rs-trow { grid-template-columns: 30px minmax(200px, 1fr) 100px 74px 112px 30px; }
}
@media (max-width: 1040px) {
    .rs-colhead__genre, .rs-app .rs-trow__genre { display: none; }
    .rs-colhead, .rs-app .rs-trow { grid-template-columns: 30px minmax(180px, 1fr) 74px 112px 30px; }
    /* Right panel defaults collapsed under 1024 */
}

/* Mobile: fall back to the #1d single-column player */
@media (max-width: 900px) {
    .rs-app { height: auto; min-height: 100dvh; overflow: visible; }
    .rs-header { position: sticky; top: 0; z-index: 50; height: auto; gap: 10px; padding: 6px 16px 10px; flex-wrap: wrap; }
    .rs-wordmark { font-size: 11px; letter-spacing: 2.4px; }
    .rs-search { display: none; }
    .rs-header__spacer { display: none; }
    .rs-usermeta { gap: 12px; margin-left: auto; }
    .rs-meta { font-size: 10px; }

    .rs-body { flex-direction: column; min-height: 0; }
    .rs-app .rs-player-col { width: auto; padding: 18px 16px 16px; border-right: 0; border-bottom: 1px solid var(--rs-hair); }
    .rs-app .player-card { height: auto; }
    .rs-hero__name { font-size: 31px; letter-spacing: -1.1px; margin-top: 12px; }
    .rs-hero__desc { font-size: 12.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .rs-eq { height: 12px; }
    .rs-eq > i { height: 12px; }

    /* ---- The hero's top region is a FIXED-height slot on mobile ----------
       Two things used to resize the card mid-interaction: TUNING hides the
       name/meta/description and swaps in the loading line (so the card shrank
       on every Play and every Shuffle, then grew back), and the restored name
       itself is one line for some stations and two for others (so it jumped
       again on the next shuffle). The slot is now sized once, to the tallest
       loaded state, and everything inside is clipped to fit it:

           12 name margin + 64 name (2 lines @ 31px/1.02)
         + 12 meta margin + 18 meta
         + 14 desc margin + 40 desc (2 clamped lines)
         = --rs-hero-nameh + 96px

       Content shorter than the slot leaves its slack at the BOTTOM of the
       column, so a one-line name still sits tight against its meta row — the
       air lands above the controls instead of inside the text. The tuning line
       flexes to fill the same box. Nothing below the hero ever moves. */
    .rs-hero { --rs-hero-nameh: 64px; }
    .rs-hero__top { flex: none; height: calc(var(--rs-hero-nameh) + 96px); overflow: hidden; }
    .rs-hero__name {
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        max-height: var(--rs-hero-nameh); overflow: hidden;
    }
    /* One line of chips, clipped — a wrapped second line would push the
       description out of the slot. */
    .rs-hero__metarow { height: 18px; overflow: hidden; }
    .rs-hero__tuning { flex: 1 1 auto; margin-top: 0; min-height: 0; }
    .rs-app .station-desc-viewport { flex: none; max-height: none; height: 40px; overflow: hidden; }
    .rs-app .volume-control.rs-volume { display: none; }
    /* control row: play / save / share / identify; the big Shuffle lives in the bottom
       bar, so the whole deck strip goes with it */
    .rs-deck { display: none; }
    .rs-iconbtn { width: 44px; height: 44px; }

    /* Log fills the width; panel is dropped on mobile */
    .rs-app .rs-panel { display: none; }
    .rs-log { min-height: 0; }
    .rs-tabstrip { position: static; }
    .rs-tabstrip__meta { display: none; }
    .rs-log__scroll { overflow: visible; }

    /* Trending rows: no square, no separate columns — name block + heat + heart */
    .rs-colhead { display: none; }
    .rs-app .rs-trow { grid-template-columns: 20px 1fr 34px 34px; gap: 11px; padding: 11px 16px; }
    .rs-sq { display: none; }
    .rs-trow__genre, .rs-trow__48h, .rs-trow__listeners, .rs-trow__country { display: none; }
    .rs-trow__mobilesub { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
    /* Fixed 74px track (spec) so the genre text can't shrink it to zero */
    .rs-trow__mobilesub .rs-heatbar { flex: none; width: 74px; max-width: none; }
    .rs-trow__mgenre { display: inline-block; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--rs-mono); font-size: 10px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-muted); }
    .rs-trow__heat { gap: 0; }
    .rs-trow__heat .rs-heatbar { display: none; }
    .rs-app .table-row:not(.rs-trow) { padding: 11px 16px; }
    .rs-app .articles-section.rs-articles { display: none; }
    .rs-app .articles-section.rs-articles.is-open { display: block; padding: 18px 16px 26px; }
    .rs-app .articles-grid { grid-template-columns: 1fr; }

    /* Bottom action bar */
    .rs-bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 10px; padding: 10px 14px 22px; background: var(--bg-primary); border-top: 1px solid var(--rs-hair); }
    .rs-bottombar__primary { height: 54px; }
    .rs-bottombar__aux { width: 54px; height: 54px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); cursor: pointer; font-size: 16px; }
    .rs-body { padding-bottom: 88px; }
}

@media (max-width: 520px) {
    /* Smaller type — the name slot shrinks with it so the two stay in step
       (2 lines @ 27px/1.02 = 56px). */
    .rs-hero__name { font-size: 27px; }
    .rs-hero { --rs-hero-nameh: 56px; }
}

/* Reduced motion: freeze eq + tuning pulse, keep colour transitions */
@media (prefers-reduced-motion: reduce) {
    .rs-eq > i { animation: none !important; transform: scaleY(.5); }
    .rs-hero__tuning p { animation: none; opacity: 1; }
    .rs-btn-primary .rs-shuffle-spinner { animation-duration: 1.6s; }
}

/* ============================================================================
   SEARCH RESULTS — dropdown (desktop) + sheet (mobile)              [search.js]
   The header field shows what it found as you type. Rows carry the station
   name, its country and its first genre tag — nothing else, so the row reads
   as one tap to play. Shared row styles (.rs-dd__*) serve both surfaces.
   ============================================================================ */

/* The <form> is the anchor the panel hangs off. */
.rs-search { position: relative; }

/* Slimmer header field: the base .articles-search__input carries 7px of vertical
   padding for the standalone article search, which made this 50px inside a 58px
   header. 39px here — and a chip is exactly 25px, so committing one can't grow it. */
.rs-search .rs-search__field { padding: 6px 12px; }
.rs-search .articles-search__input { padding: 4px 0; }
/* the base arrow button is a fixed 32px box — it, not the text, set the height */
.rs-search .articles-search__submit { width: 26px; height: 26px; }
.rs-search.is-open .rs-search__field {
    border-color: var(--accent);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.rs-dd {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    z-index: 70;
    max-height: 380px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #131314;
    border: 1px solid var(--accent);
    border-top-color: var(--rs-hair);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .6);
}
.rs-dd[hidden] { display: none; }
.rs-dd.is-loading { opacity: .6; }
.rs-dd::-webkit-scrollbar { width: 8px; }
.rs-dd::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 8px; }

.rs-dd__group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 13px 6px;
    font-family: var(--rs-mono);
    font-size: 9.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--rs-dim);
}
.rs-dd__group span:last-child { color: #3f3f3f; }

.rs-dd__row {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 8px 13px;
    border: 0;
    border-left: 2px solid transparent;
    background: transparent;
    color: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.rs-dd__row:hover,
.rs-dd__row.is-active {
    background: #1b1b1d;
    border-left-color: var(--accent);
}
.rs-dd__row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.rs-dd__play,
.rs-dd__art {
    flex: none;
    display: grid;
    place-items: center;
    color: var(--text-primary);
}
.rs-dd__play {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    font-size: 9px;
}
.rs-dd__row:hover .rs-dd__play,
.rs-dd__row.is-active .rs-dd__play { background: var(--bg-elevated); }
.rs-dd__art {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    background: #232326;
    color: var(--text-muted);
    font-size: 10px;
}

.rs-dd__main { flex: 1; min-width: 0; }
.rs-dd__name {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rs-dd__name mark { background: transparent; color: var(--accent-hover); font-weight: 700; }
.rs-dd__sub {
    display: block;
    margin-top: 2px;
    font-family: var(--rs-mono);
    font-size: 9.5px;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rs-dd__sub mark { background: transparent; color: var(--accent-hover); }
.rs-dd__sub--station { color: var(--accent-hover); }
.rs-dd__sep {
    display: inline-block;
    width: 3px;
    height: 3px;
    margin: 0 7px;
    border-radius: 50%;
    background: #3a3a3a;
    vertical-align: middle;
}

/* Idle (focused, nothing typed) + empty states */
.rs-dd__sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 13px 10px; }
.rs-dd__chip {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--rs-hair);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--rs-mono);
    font-size: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
    cursor: pointer;
}
.rs-dd__chip:hover { border-color: var(--accent); color: var(--text-primary); }
.rs-dd__hint { margin: 0; padding: 0 13px 14px; font-size: 12px; color: var(--rs-dim); }
.rs-dd__hint b { color: var(--text-muted); font-weight: 600; }
.rs-dd__hint i { font-style: normal; color: var(--accent-hover); }

/* Pinned under the results: names the key that adds a term, and spells the
   combination out once there is more than one so the AND is visible. */
.rs-dd__foot {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 13px;
    background: #0f0f10;
    border-top: 1px solid var(--rs-hair);
    font-family: var(--rs-mono);
    font-size: 9.5px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--rs-dim);
}
.rs-dd__combo { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.rs-dd__combo-term {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(233, 30, 140, .14);
    color: #ffb8dd;
    white-space: nowrap;
}
.rs-dd__combo i { font-style: normal; color: var(--rs-dim); }
.rs-dd__combo--empty { color: var(--rs-dim); }
.rs-dd__key { flex: none; display: flex; align-items: center; gap: 6px; }
.rs-dd__key kbd {
    display: inline-block;
    min-width: 16px;
    padding: 1px 5px;
    border-radius: 4px;
    text-align: center;
    background: #1e1e20;
    border: 1px solid var(--rs-hair);
    color: var(--text-secondary);
    font-family: var(--rs-mono);
    font-size: 9.5px;
}
.rs-dd__empty { padding: 22px 16px 8px; text-align: center; }
.rs-dd__empty p { margin: 0; font-size: 13px; color: var(--text-muted); }
.rs-dd__empty .rs-dd__hint { padding: 6px 0 16px; }

/* ---- Mobile sheet ------------------------------------------------------ */
.rs-sheet {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    transform: translateY(100%);
    transition: transform .26s cubic-bezier(.22, .7, .3, 1);
}
.rs-sheet[hidden] { display: none; }
.rs-sheet.is-open { transform: translateY(0); }
body.rs-sheet-open { overflow: hidden; }

.rs-sheet__top {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 12px;
    padding-top: max(14px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--rs-hair);
}
.rs-sheet__field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
}
.rs-sheet__field > i { color: var(--text-muted); font-size: 13px; }
/* chips + input share the field and wrap together, like the header search */
.rs-sheet__tokens {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.rs-sheet__field .articles-search__chip {
    font-size: 12.5px;
    padding: 3px 6px 3px 9px;
}
.rs-sheet__field .articles-search__chip-remove { font-size: 10px; }
.rs-sheet__input {
    flex: 1;
    /* wraps to its own line rather than being squeezed by the chips beside it */
    min-width: 120px;
    border: 0;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;            /* 16px keeps iOS from zooming the field on focus */
}
.rs-sheet__input::placeholder { color: var(--text-muted); }
/* The field's own accent border already shows focus — without this the global
   input:focus-visible ring draws a second pink box inside the first. */
.rs-sheet__input:focus,
.rs-sheet__input:focus-visible {
    outline: none;
    box-shadow: none;
}
.rs-sheet__cancel {
    flex: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 2px;
}

/* the shared .rs-dd rules above give it the panel look; undo the popover chrome */
.rs-dd.rs-sheet__list {
    position: static;
    flex: 1 1 auto;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.rs-sheet__list .rs-dd__row { padding: 11px 14px; }
.rs-sheet__list .rs-dd__play { width: 34px; height: 34px; font-size: 10px; }
.rs-sheet__list .rs-dd__name { font-size: 14.5px; }
.rs-sheet__list .rs-dd__group { padding: 12px 14px 6px; }
.rs-sheet__list .rs-dd__sugg { padding: 2px 14px 10px; }
.rs-sheet__list .rs-dd__hint { padding: 0 14px 14px; }

.rs-sheet__foot {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--rs-hair);
    background: #0f0f10;
    font-family: var(--rs-mono);
    font-size: 9.5px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--rs-dim);
}
.rs-sheet__foot a { color: var(--text-muted); text-decoration: none; }
.rs-sheet__foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    .rs-sheet { transition: none; }
}

/* ============================================================================
   COMMUNITY RANK (v0.0.50)
   Header chip + the neighbour board in the account modal. Fed by levels.js
   loadUserRank() <- api/user-rank.php <- the hourly user_ranks snapshot.
   ========================================================================== */

/* The standalone "#42 RANK" header chip that used to live here is gone: the rank
   moved into the header identity block, under the username, where it sits with the
   tier name instead of competing with it. See RS-LEVELRING below. */

/* --- Neighbour board (account modal) ------------------------------------- */
.rank-summary {
    font-family: var(--rs-mono);
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.rank-board {
    list-style: none;
    margin: 0 0 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rankrow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
}

/* The user's own row is the anchor of the whole board — it has to be findable
   at a glance among five near-identical rows. */
.rankrow--you {
    background-color: rgba(233, 30, 140, 0.08);
    border-color: var(--accent);
}

.rankrow__pos {
    flex: 0 0 auto;
    min-width: 26px;
    text-align: right;
    font-family: var(--rs-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.rankrow--you .rankrow__pos { color: var(--accent); }

.rankrow__badge {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 50%;
}

.rankrow__name {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rankrow--you .rankrow__name { font-weight: 700; }

.rankrow__level {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.rank-hint {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-muted);
}


/* --- Trending row: "N listeners · LastName" -------------------------------
   Rides in the existing .station-unit__sub line, next to the other sub chips.
   leaderboard.js only emits it above MIN_SHOWN_LISTENERS, so there is no
   "hidden" state to style here. */
.su-listeners {
    display: inline-flex;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}
.su-listeners i { color: var(--text-muted); }

/* The name is the social half of the line, so it reads a step brighter than the
   count — and it is the part allowed to ellipsise when the row runs out of room. */
.su-lastlistener {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Phones: the count carries the social proof on its own; the name is the first
   thing to go when the row is 335px wide. */
@media (max-width: 600px) {
    .su-lastlistener { display: none; }
}

/* --- Account modal: "Your Level" -----------------------------------------
   The detail the header ring cannot state on its own. Deliberately not a
   tooltip: a hover bubble never opens under a finger, so on mobile the ring
   would have been decoration with no explanation anywhere. This section is the
   explanation, and it renders identically on both sizes. */
.account-level__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.account-level__badge {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.account-level__id { min-width: 0; }

.account-level__name {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.account-level__sub {
    margin-top: 3px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--text-muted);
}

/* The meter is the v0.0.40 .level-momentum block, reused as-is: levels.js has
   been feeding these ids all along, they simply had no markup to write into
   after the right panel was removed. */
.account-level .level-momentum { margin-top: 0; }

@media (max-width: 480px) {
    .account-level__badge { width: 46px; height: 46px; }
    .account-level__name { font-size: 17px; }
    .account-level__head { gap: 11px; }
}

/* --- Rank movement: the arrow, and the caret that kept the dropdown --------
   The tier name changes rarely; the position changes every rebuild. The arrow is
   what makes the header feel alive, so it gets the colour. */
.rs-trend {
    font-family: var(--rs-mono);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0;
    margin-left: 5px;
}
.rs-trend--up   { color: var(--accent); }
/* Down is deliberately NOT red: slipping is an invitation to listen, not an error. */
.rs-trend--down { color: var(--text-secondary); }

/* The avatar opens the profile now, so the dropdown needs its own affordance. */
.rs-user__more {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0;
    border: 0; border-radius: 50%;
    background: transparent; color: var(--text-muted);
    font-size: 10px; cursor: pointer;
}
.rs-user__more:hover { background: var(--bg-secondary); color: var(--text-primary); }


/* Signup consent notice — see api/email-send.php. The account carries
   marketing_opt_in = 1 by default and every marketing message ships a working
   one-click unsubscribe, which is what makes a notice (rather than a forced
   checkbox) the honest way to say this. */
.auth-consent {
    margin: -4px 0 14px;
    font-size: 12px;
    line-height: 18px;
    color: var(--text-muted);
}
