:root {
    /* Colors - Refined Modern Palette */
    --bg-dark: #0a0a0f;
    --bg-panel: #121218;
    --bg-hover: #1a1a24;
    --bg-card: #16161e;
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-glow: rgba(249, 115, 22, 0.25);
    --text-main: #fafafa;
    --text-muted: #71717a;
    --text-subtle: #52525b;
    --icon-color: var(--text-muted);
    --border: #27272a;
    --border-subtle: #1f1f28;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --info: #3b82f6;

    /* Focus ring (keyboard / assistive tech) */
    --focus-ring: rgba(249, 115, 22, 0.55);
    --focus-ring-width: 2px;
    --focus-ring-offset: 2px;

    /* Dimensions */
    --player-height: 88px;
    --nav-height: 64px;
    --sidebar-width: 260px;
    --safe-area-bottom: env(safe-area-inset-bottom);
    --header-height: 64px;
    --footer-height: 32px;

    /* Typography Scale */
    --font-xs: 0.75rem;
    --font-sm: 0.8125rem;
    --font-base: 0.9375rem;
    --font-lg: 1.0625rem;
    --font-xl: 1.375rem;
    --font-2xl: 1.75rem;
    --font-3xl: 2.25rem;

    /* Spacing System (4px baseline) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    --m-bg-base: var(--bg-dark);
    --m-bg-dark: var(--bg-dark);
    --m-bg-panel: var(--bg-panel);
    --m-bg-card: var(--bg-card);
    --m-bg-card-hover: var(--bg-hover);
    --m-bg-hover: var(--bg-hover);

    --m-primary: var(--primary);
    --m-primary-hover: var(--primary-hover);
    --m-primary-glow: var(--primary-glow);

    --m-text-main: var(--text-main);
    --m-text-secondary: var(--text-main);
    --m-text-muted: var(--text-muted);
    --m-text-subtle: var(--text-subtle);

    --m-border: var(--border-subtle);
    --m-border-strong: var(--border);

    --m-success: var(--success);
    --m-danger: var(--danger);
    --m-warning: var(--warning);

    --m-radius-xs: var(--radius-sm);
    --m-radius-sm: var(--radius-sm);
    --m-radius-md: var(--radius-md);
    --m-radius-lg: var(--radius-lg);
    --m-radius-xl: var(--radius-xl);
    --m-radius-full: var(--radius-full);

    --m-shadow-xs: var(--shadow-sm);
    --m-shadow-sm: var(--shadow-sm);
    --m-shadow-md: var(--shadow-md);
    --m-shadow-lg: var(--shadow-lg);
    --m-shadow-player: var(--shadow-lg);

    --m-font-xs: var(--font-xs);
    --m-font-sm: var(--font-sm);
    --m-font-base: var(--font-base);
    --m-font-lg: var(--font-lg);
    --m-font-xl: var(--font-xl);

    --m-space-1: var(--space-1);
    --m-space-2: var(--space-2);
    --m-space-3: var(--space-3);
    --m-space-4: var(--space-4);
    --m-space-5: var(--space-5);
    --m-space-6: var(--space-6);
    --m-space-8: var(--space-8);
    --m-space-10: var(--space-10);
    --m-space-12: var(--space-12);

    --m-safe-area-bottom: var(--safe-area-bottom);
    --m-safe-bottom: var(--safe-area-bottom);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

body { 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    height: 100vh; 
    height: 100dvh; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    font-size: var(--font-base);
    line-height: 1.5;
    padding-bottom: var(--footer-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 50ms ease;
        --transition-base: 50ms ease;
        --transition-slow: 50ms ease;
    }
}

/* Focus visibility — avoid mouse-click outline flash */
:focus:not(:focus-visible) {
    outline: none;
}

:is(
    button,
    .btn,
    .btn-icon,
    .btn-ghost,
    .btn-primary,
    .btn-secondary,
    a[href],
    [role="button"],
    input:not([type="hidden"]):not([type="range"]),
    textarea,
    select,
    .field-password__toggle
):focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

input[type="range"]:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.search-input:focus-visible,
.search-clear:focus-visible {
    outline: none;
}

/* Typography */
h1, h2, h3 { 
    font-weight: 700; 
    letter-spacing: -0.02em; 
    line-height: 1.2; 
    color: var(--text-main);
}

h1 { font-size: var(--font-2xl); }
h2 { font-size: var(--font-xl); }
h3 { font-size: var(--font-lg); }

.text-sm { font-size: var(--font-sm); color: var(--text-muted); }
.text-xs { font-size: var(--font-xs); color: var(--text-muted); }

.font-semibold { font-weight: 600; }
.text-primary { color: var(--primary); }

.artist-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
    z-index: 2;
    position: relative;
}

.artist-link:hover {
    color: white;
    text-decoration: underline;
    text-decoration-color: var(--primary);
}

/* Layout Utilities */
.flex { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
}

/* Responsive 3-field filter rows (bookings, messages inbox, etc.) */
.tw-dashboard-filters {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}
.tw-dashboard-filters > div {
    min-width: 0;
}
.tw-dashboard-filters .input,
.tw-dashboard-filters input.input,
.tw-dashboard-filters select.input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
@media (min-width: 640px) {
    .tw-dashboard-filters {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    }
}

/* Appearance cards: stack on phones, side-by-side from tablet up */
.tw-appearance-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}
.tw-appearance-row__meta {
    min-width: 0;
    width: 100%;
}
.tw-appearance-row__meta .text-sm {
    word-break: normal;
    overflow-wrap: break-word;
}
.tw-appearance-row__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    align-items: center;
}
@media (min-width: 720px) {
    .tw-appearance-row {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
    }
    .tw-appearance-row__meta {
        flex: 1;
        min-width: 0;
    }
    .tw-appearance-row__actions {
        width: auto;
        justify-content: flex-end;
        flex-shrink: 0;
    }
}

/* Public profile CTA row — full-width stack on small screens */
.profile-visitor-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 var(--space-4);
    gap: var(--space-2);
    margin: var(--space-6) 0;
}
.profile-visitor-actions .btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    box-sizing: border-box;
}
@media (min-width: 520px) {
    .profile-visitor-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: stretch;
    }
    .profile-visitor-actions .btn {
        width: auto;
        flex: 1 1 auto;
        min-width: min(100%, 140px);
        max-width: 100%;
    }
}

/* Artist dashboard — Top Performing Tracks */
.tw-dash-track-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tw-dash-track-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.2rem 0;
}

.tw-dash-track-rank {
    flex: 0 0 20px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    font-size: 0.875rem;
    line-height: 1;
}

.tw-dash-track-cover {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
}

.tw-dash-track-text {
    flex: 1 1 0;
    min-width: 0;
}

.tw-dash-track-title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.tw-dash-track-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tw-dash-track-tail {
    flex: 0 1 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    padding-left: 6px;
}

.tw-dash-track-likes {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tw-dash-track-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.tw-dash-track-btn.btn-icon {
    flex-shrink: 0;
}

/* Conversation view (messages) — layout + composer avoid global input double-chrome */
.tw-chat-shell {
    display: flex;
    flex-direction: column;
    min-height: min(58dvh, 520px);
    max-height: calc(100dvh - var(--header-height) - var(--player-height) - var(--nav-height) - env(safe-area-inset-bottom, 0px) - 28px);
}

.tw-chat-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-subtle);
}

.tw-chat-header-back {
    flex-shrink: 0;
}

.tw-chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tw-chat-header-text {
    min-width: 0;
    flex: 1;
}

.tw-chat-header-text h3 {
    margin: 0;
    font-size: var(--font-lg);
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tw-chat-subtitle {
    display: block;
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
}

.tw-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-height: 140px;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.tw-chat-form {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    padding-top: var(--space-3);
    margin-top: auto;
}

/* Mobile chat: pin header + composer, scroll only messages */
html.is-mobile .tw-chat-shell {
    position: relative;
    height: calc(100dvh - var(--m-header-height) - var(--m-player-height) - var(--m-nav-height) - env(safe-area-inset-bottom, 0px));
    max-height: none;
    min-height: 0;
}

html.is-mobile .tw-chat-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg-dark);
    padding-top: var(--space-2);
    /* keep the border visible when stuck */
    box-shadow: 0 1px 0 var(--border-subtle);
}

html.is-mobile .tw-chat-form {
    position: sticky;
    bottom: 0;
    z-index: 5;
    background: var(--bg-dark);
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
    box-shadow: 0 -1px 0 var(--border-subtle);
}

html.is-mobile .tw-chat-messages {
    /* breathing room so last message isn't hidden behind the composer */
    padding-bottom: calc(var(--space-3) + 56px);
}

/* Force a fixed chat viewport on mobile so only message list scrolls */
html.is-mobile #main-view.tw-chat-view {
    overflow: hidden;
}

html.is-mobile #main-view.tw-chat-view .tw-chat-shell {
    position: fixed;
    top: var(--m-header-height);
    left: 0;
    right: 0;
    bottom: calc(var(--m-player-height) + var(--m-nav-height) + env(safe-area-inset-bottom, 0px));
    height: auto;
    min-height: 0;
    max-height: none;
    padding-left: var(--space-3);
    padding-right: var(--space-3);
    background: var(--bg-dark);
    z-index: 5;
}

html.is-mobile #main-view.tw-chat-view .tw-chat-header {
    margin-bottom: var(--space-2);
}

html.is-mobile #main-view.tw-chat-view .tw-chat-form {
    margin-top: 0;
}

/* DAWson — fixed viewport under mobile header / above player + nav (immersive fullscreen uses mobile.css) */
html.is-mobile:not(.tw-dawson-fullscreen) #main-view.tw-dawson-embed {
    overflow: hidden;
    padding: 0;
    position: relative;
}

html.is-mobile:not(.tw-dawson-fullscreen) #main-view.tw-dawson-embed .tw-dawson-iframe {
    position: fixed;
    top: var(--m-header-height);
    left: 0;
    right: 0;
    bottom: calc(var(--m-player-height) + var(--m-nav-height) + env(safe-area-inset-bottom, 0px));
    width: 100%;
    height: auto;
    min-height: 0;
    flex: none;
    z-index: 5;
}

input.tw-chat-composer.tw-chat-composer,
#chat-input.tw-chat-composer {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    height: auto;
    padding: 12px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border) !important;
    background: var(--bg-card) !important;
    color: var(--text-main) !important;
    font-size: max(16px, var(--font-base)) !important;
    line-height: 1.35;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

#chat-input.tw-chat-composer:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.18) !important;
}

.tw-chat-send {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-auto { margin-top: auto; }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3 { padding-top: var(--space-3); padding-bottom: var(--space-3); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.hidden { display: none !important; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.cursor-pointer { cursor: pointer; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.font-bold { font-weight: 700; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.min-width-0 { min-width: 0; }
.bg-panel { background: var(--bg-panel); }
.bg-hover { background: var(--bg-hover); }
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.self-end { align-self: flex-end; }
.justify-start { justify-content: flex-start; }
.max-w-xs { max-width: 320px; }

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    transition: all var(--transition-base);
    touch-action: manipulation;
    font-family: inherit;
}

/* Interactive Elements */
.btn {
    padding: 0 var(--space-5);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: 44px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    color: white;
    background: var(--bg-hover);
}

.btn-secondary {
    background: var(--bg-hover);
    color: white;
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-panel);
    border-color: var(--text-subtle);
}

.btn-sm {
    min-height: 36px;
    padding: 0 var(--space-4);
    font-size: var(--font-xs);
    border-radius: var(--radius-md);
}

.btn-icon {
    padding: var(--space-2);
    border-radius: var(--radius-full);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-color);
    transition: all var(--transition-fast);
    touch-action: manipulation;
}
.btn-icon:hover {
    background: var(--bg-hover);
    color: white;
}
.btn-icon i {
    font-size: 22px;
}

.btn:focus-visible,
.btn-icon:focus-visible,
.nav-item:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Like Button Animation */
@keyframes likeBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.4); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.like-anim {
    animation: likeBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-anim {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Playing Indicator (Sound Wave) */
.playing-indicator {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    height: 16px;
    width: 16px;
}

.playing-indicator .bar {
    background-color: var(--primary);
    width: 3px;
    border-radius: 2px;
    animation: soundWave 1s ease-in-out infinite;
}

.playing-indicator .bar:nth-child(1) { height: 6px; animation-delay: 0.0s; }
.playing-indicator .bar:nth-child(2) { height: 10px; animation-delay: 0.2s; }
.playing-indicator .bar:nth-child(3) { height: 8px; animation-delay: 0.4s; }

.playing-indicator.paused .bar {
    animation-play-state: paused;
    height: 4px !important; /* Flatten when paused */
    transition: height 0.2s ease;
}

@keyframes soundWave {
    0% { height: 4px; }
    50% { height: 14px; }
    100% { height: 4px; }
}

/* Form Elements */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0 var(--space-4);
    border-radius: var(--radius-md);
    width: 100%;
    outline: none;
    font-size: var(--font-base);
    min-height: 48px;
    transition: all var(--transition-fast);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
input::placeholder { color: var(--text-subtle); }

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border);
}

textarea {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    width: 100%;
    outline: none;
    font-size: var(--font-base);
    transition: all var(--transition-fast);
    resize: vertical;
    font-family: inherit;
    min-height: 100px;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
textarea::placeholder { color: var(--text-subtle); }

/* Auth Screen */
#auth-screen { position: absolute; inset: 0; z-index: 100; background: var(--bg-dark); display: flex; justify-content: center; align-items: center; padding: var(--space-4); padding-bottom: calc(var(--space-4) + var(--footer-height) + var(--safe-area-bottom)); }
#auth-screen::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at top, rgba(249, 115, 22, 0.08) 0%, transparent 60%); pointer-events: none; }
.auth-card { background: var(--bg-panel); padding: var(--space-8); border-radius: var(--radius-xl); width: 100%; max-width: 420px; box-shadow: var(--shadow-lg), 0 0 60px rgba(249, 115, 22, 0.1); border: 1px solid var(--border-subtle); position: relative; }
.auth-toggle { margin-top: var(--space-6); text-align: center; font-size: var(--font-sm); color: var(--text-muted); }
.auth-toggle span { color: var(--primary); cursor: pointer; font-weight: 600; }

/* License Footer */
#license-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--footer-height) + var(--safe-area-bottom));
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 90;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    padding-bottom: var(--safe-area-bottom);
}

/* App Layout */
#app-container { display: flex; flex: 1; overflow: hidden; height: calc(100vh - var(--player-height) - var(--footer-height) - var(--safe-area-bottom)); align-items: stretch; }

html.is-mobile #sidebar { display: none !important; }
html.is-mobile #app-container { display: flex; height: calc(100dvh - var(--player-height) - var(--nav-height) - var(--footer-height) - env(safe-area-inset-bottom)); }
html.is-mobile #main-view { width: 100%; padding: var(--space-4); }
html.is-mobile #bottom-nav { display: flex !important; }

html.is-mobile .song-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

html.is-mobile .song-card {
    padding: var(--space-3);
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

html.is-mobile .song-card .cover-art {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    background: var(--bg-hover);
    overflow: hidden;
    position: relative;
    box-shadow: none;
}

html.is-mobile .song-card .cover-art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

html.is-mobile .song-card .song-title {
    font-size: var(--font-sm);
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
    min-height: 2.5em;
    max-height: 2.5em;
}

html.is-mobile .song-card .song-artist {
    font-size: var(--font-xs);
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.3em;
    max-height: 1.3em;
}

/* Sidebar */
#sidebar { width: var(--sidebar-width); background: var(--bg-dark); border-right: 1px solid var(--border-subtle); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-6); overflow-y: auto; z-index: 20; }
.logo { font-size: 1.4rem; font-weight: 800; color: white; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; }
.logo img { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.logo i { color: var(--primary); }
.nav-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); color: var(--text-muted); cursor: pointer; transition: all var(--transition-fast); font-weight: 500; font-size: var(--font-sm); min-height: 44px; }
.nav-item:hover { color: white; background: var(--bg-hover); }
.nav-item.active { color: white; background: var(--bg-hover); }
.nav-item.active::before { content: ''; position: absolute; left: 0; width: 3px; height: 24px; background: var(--primary); border-radius: 0 2px 2px 0; }
.nav-item i { font-size: 1.25rem; }
.nav-section h3 { font-size: var(--font-xs); text-transform: uppercase; color: var(--text-subtle); margin-bottom: var(--space-3); letter-spacing: 0.5px; padding-left: var(--space-2); font-weight: 600; }

/* Main Content */
#main-view { flex: 1; min-width: 0; overflow-y: auto; padding: var(--space-8); background: linear-gradient(180deg, var(--bg-hover) 0%, var(--bg-dark) 30%); -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }

/* DAWson — fill main column (iframes ignore flex-grow; use absolute fill) */
#main-view.tw-dawson-embed {
    position: relative;
    padding: 0;
    overflow: hidden;
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    background: var(--bg-dark);
}

#main-view.tw-dawson-embed .tw-dawson-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    border: 0;
    background: var(--bg-dark);
    display: block;
}

/* Desktop: hide sidebar so DAWson uses full app width (class toggled from JS) */
html.tw-dawson-fullscreen:not(.is-mobile) #sidebar {
    display: none !important;
}

html.tw-dawson-fullscreen:not(.is-mobile) #main-view.tw-dawson-embed {
    width: 100%;
    max-width: none;
}

/* Top-left hover band: back control stays hidden until pointer (or Tab focus) is near */
#main-view.tw-dawson-embed .tw-dawson-exit-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 104px;
    height: 76px;
    z-index: 25;
    pointer-events: auto;
}

#main-view.tw-dawson-embed .tw-dawson-exit-fab {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: rgba(12, 12, 18, 0.88);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, background var(--transition-fast);
}

#main-view.tw-dawson-embed .tw-dawson-exit-zone:hover .tw-dawson-exit-fab,
#main-view.tw-dawson-embed .tw-dawson-exit-zone:focus-within .tw-dawson-exit-fab {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#main-view.tw-dawson-embed .tw-dawson-exit-fab:hover {
    background: var(--bg-hover);
}

/* DAWson: collapse mini player by default; reclaim vertical space on desktop */
html.tw-dawson-page:not(.tw-dawson-player-expanded) #app-container {
    height: calc(100vh - var(--footer-height) - var(--safe-area-bottom));
}

html.tw-dawson-page:not(.tw-dawson-player-expanded) #player-bar {
    height: 0 !important;
    min-height: 0;
    padding: 0 !important;
    margin: 0;
    border: none;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
}

html.tw-dawson-page.tw-dawson-player-expanded #player-bar {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

html.tw-dawson-page.tw-dawson-player-expanded #tw-dawson-player-reveal {
    display: none !important;
}

#tw-dawson-player-reveal.tw-dawson-player-reveal {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--footer-height) + var(--safe-area-bottom) + 10px);
    z-index: 165;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: rgba(12, 12, 18, 0.92);
    color: var(--text-main);
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    transition: background var(--transition-fast);
}

#tw-dawson-player-reveal.tw-dawson-player-reveal:hover {
    background: var(--bg-hover);
}

#btn-dawson-minimize-player,
.tw-dawson-minimize-player-mobile {
    display: none !important;
}

html.tw-dawson-page.tw-dawson-player-expanded:not(.is-mobile) #btn-dawson-minimize-player {
    display: inline-flex !important;
}

html.is-mobile.tw-dawson-page.tw-dawson-player-expanded .tw-dawson-minimize-player-mobile {
    display: inline-flex !important;
}

/* Mobile: slide fixed player bar off-screen when DAWson player is collapsed */
html.is-mobile.tw-dawson-page:not(.tw-dawson-player-expanded) #player-bar {
    height: var(--m-player-height) !important;
    min-height: var(--m-player-height) !important;
    padding: inherit;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    overflow: visible;
    transform: translateY(calc(100% + 16px));
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
}

html.is-mobile.tw-dawson-page.tw-dawson-player-expanded #player-bar {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

html.is-mobile.tw-dawson-page:not(.tw-dawson-player-expanded):not(.tw-dawson-fullscreen) #main-view.tw-dawson-embed .tw-dawson-iframe {
    bottom: calc(var(--m-nav-height) + env(safe-area-inset-bottom, 0px));
}

.view-header { margin-bottom: var(--space-8); display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: var(--space-4); }
.view-title { font-size: var(--font-2xl); font-weight: 700; margin-bottom: var(--space-1); }

/* Grids & Lists */
.song-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-6); }
.song-card { background: var(--bg-card); padding: var(--space-4); border-radius: var(--radius-lg); transition: all var(--transition-base); cursor: pointer; position: relative; border: 1px solid transparent; }
.song-card:hover { background: var(--bg-hover); transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border); }
.song-card:hover .cover-art { transform: scale(1.03); }
.cover-art { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-md); margin-bottom: var(--space-3); background: var(--bg-hover); box-shadow: var(--shadow-md); transition: transform var(--transition-base); }

.song-row { display: grid; grid-template-columns: 40px 4fr 3fr 2fr 1fr; align-items: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); color: var(--text-muted); font-size: var(--font-sm); min-height: 56px; transition: background var(--transition-fast); }
.song-row:hover { background: var(--bg-hover); color: white; }
.song-row.active { color: var(--primary); background: rgba(249, 115, 22, 0.08); }
.song-row.active .song-title { color: var(--primary); }

/* Player Bar */
#player-bar {
    height: var(--player-height);
    background: linear-gradient(180deg, var(--bg-panel) 0%, rgba(18, 18, 24, 0.95) 100%);
    border-top: 1px solid var(--border-subtle);
    padding: 0 var(--space-6);
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    z-index: 160;
    position: relative;
    backdrop-filter: blur(12px);
}

.track-info { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.player-track-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
    justify-content: center;
}
.track-info > .flex-col,
.track-info > .player-track-meta { min-width: 0; flex: 1; justify-content: center; }
.player-inline-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
}
.player-like-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}
#player-title.player-track-title,
.player-track-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-weight: 600;
    font-size: 0.9rem;
}
#player-artist.player-track-artist,
.player-track-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.track-thumb { width: 56px; height: 56px; border-radius: var(--radius-md); object-fit: cover; background: var(--bg-hover); flex-shrink: 0; box-shadow: var(--shadow-md); transition: transform var(--transition-fast); }
.track-thumb:hover { transform: scale(1.05); }

.player-controls { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); width: 100%; }
.player-controls-mobile { display: none; }
.control-buttons { display: flex; align-items: center; gap: var(--space-5); }
#player-bar .control-buttons .btn-icon {
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
}
#player-bar .control-buttons .btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}
#player-bar .control-buttons .btn-icon:active {
    transform: scale(0.96);
}
.play-pause-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: white; display: flex; justify-content: center; align-items: center; font-size: 1.2rem; transition: all var(--transition-fast); box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4); }
.play-pause-btn:hover { transform: scale(1.06); box-shadow: 0 6px 20px rgba(249, 115, 22, 0.5); }
.play-pause-btn:active { transform: scale(0.98); }

.progress-container { width: 100%; display: flex; align-items: center; gap: var(--space-3); font-size: var(--font-xs); color: var(--text-muted); max-width: 600px; }
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 32px; border: none; padding: 0; margin: 0; min-height: auto; width: 100%; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { background: var(--bg-hover); height: 4px; border-radius: 2px; width: 100%; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; background: white; height: 14px; width: 14px; border-radius: 50%; margin-top: -5px; box-shadow: 0 2px 8px rgba(0,0,0,0.4); transition: transform var(--transition-fast); }
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.2); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.4); }

#player-bar input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, var(--border-subtle) 0%, var(--bg-hover) 100%);
    height: 5px;
    border-radius: 3px;
}
#player-bar input[type="range"]::-webkit-slider-thumb {
    background: var(--primary);
    height: 14px;
    width: 14px;
    margin-top: -5px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 2px 10px rgba(0, 0, 0, 0.45);
}
#player-bar input[type="range"]::-moz-range-track {
    background: linear-gradient(90deg, var(--border-subtle) 0%, var(--bg-hover) 100%);
    height: 5px;
    border-radius: 3px;
}
#player-bar input[type="range"]::-moz-range-thumb {
    background: var(--primary);
    height: 14px;
    width: 14px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 2px 10px rgba(0, 0, 0, 0.45);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.fullscreen-player-overlay {
    position: fixed;
    inset: 0;
    z-index: 170;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.fullscreen-player-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    opacity: 0;
    transition: opacity 180ms ease;
}

.fullscreen-player-panel {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.98);
    padding: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(16px);
    opacity: 0;
    transition: transform 180ms ease, opacity 180ms ease;
}

.fullscreen-player-overlay.is-open .fullscreen-player-backdrop { opacity: 1; }
.fullscreen-player-overlay.is-open .fullscreen-player-panel { opacity: 1; transform: translateY(0); }

.fullscreen-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.fullscreen-player-header-left {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.fullscreen-player-grid {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
}

.fullscreen-player-art {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fullscreen-player-cover {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1;
    border-radius: 16px;
    object-fit: cover;
    background: var(--bg-hover);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.fullscreen-player-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.fullscreen-player-secondary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.fullscreen-player-secondary-left,
.fullscreen-player-secondary-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fullscreen-player-like-count {
    min-width: 18px;
    font-variant-numeric: tabular-nums;
}

.fullscreen-player-meta {
    min-width: 0;
}

#fullscreen-player-title {
    font-size: 2rem;
    line-height: 1.15;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fullscreen-player-artist {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fullscreen-player-timeline {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.fullscreen-player-time {
    width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.fullscreen-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.fullscreen-player-controls .play-pause-btn {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
}

.fullscreen-player-volume {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
}

.fullscreen-player-hint {
    text-align: center;
    color: var(--text-subtle);
    font-size: 0.75rem;
}

@media (max-width: 900px) {
    .fullscreen-player-grid {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 20px;
    }
    #fullscreen-player-cover { max-width: 420px; }
    #fullscreen-player-title { font-size: 1.6rem; }
}

@media (max-width: 600px) {
    .fullscreen-player-secondary {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        gap: 10px;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .fullscreen-player-secondary::-webkit-scrollbar { display: none; }
    .fullscreen-player-secondary-left,
    .fullscreen-player-secondary-right {
        flex-wrap: nowrap;
        gap: 8px;
        flex: 0 0 auto;
    }
    .fullscreen-player-like-count {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fullscreen-player-backdrop,
    .fullscreen-player-panel {
        transition: none;
    }
}

/* Dashboard */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-8); }
.stat-card { background: var(--bg-card); padding: var(--space-5); border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); transition: all var(--transition-base); }
.stat-card:hover { border-color: var(--border); transform: translateY(-2px); }
.stat-value { font-size: 2rem; font-weight: 700; color: white; margin-top: var(--space-2); }

/* Special */
.liked-playlist-gradient { background: linear-gradient(135deg, #7c3aed, #22c55e); display: flex; align-items: center; justify-content: center; }
.badge-pro { background: linear-gradient(135deg, #f59e0b, #f97316); color: black; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.65rem; font-weight: 700; margin-left: 0.5rem; letter-spacing: 0.5px; text-transform: uppercase; }
.admin-badge { background: var(--danger); color: white; padding: 3px 8px; border-radius: var(--radius-sm); font-size: 0.65rem; font-weight: 600; margin-left: 0.5rem; text-transform: uppercase; }

/* Trackwall Music Awards (profile) */
.profile-award-badges-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: var(--space-3);
    padding: 0 var(--space-4);
}
.profile-award-badges-wrap--desktop {
    justify-content: flex-start;
    margin-top: var(--space-2);
    padding: 0;
}
.profile-award-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    width: 100%;
    max-width: 100%;
}
.profile-award-badges-wrap--desktop .profile-award-badges {
    justify-content: flex-start;
}
.profile-award-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-xs);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    max-width: 100%;
}
.profile-award-badge .ph {
    flex-shrink: 0;
    font-size: 0.9rem;
}
.profile-award-badge__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.profile-award-badge--winner {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(249, 115, 22, 0.15));
    border-color: rgba(251, 191, 36, 0.45);
    color: var(--text-main);
}
.profile-award-badge--finalist {
    background: rgba(113, 113, 122, 0.2);
    border-color: var(--border);
    color: var(--text-main);
}
.profile-award-badge--nominee {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--text-muted);
}
/* Trackwall Music Awards (public hub) */
.tma-page {
    position: relative;
    margin: calc(var(--space-8) * -1) calc(var(--space-8) * -1) 0;
    padding: var(--space-6) var(--space-8) var(--space-10);
    min-height: min(70vh, 640px);
    background:
        radial-gradient(ellipse 120% 80% at 50% -20%, rgba(249, 115, 22, 0.18), transparent 55%),
        radial-gradient(ellipse 90% 50% at 100% 40%, rgba(251, 191, 36, 0.08), transparent 50%),
        radial-gradient(ellipse 70% 40% at 0% 60%, rgba(249, 115, 22, 0.06), transparent 45%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.tma-page::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 80% 60% at 50% 100%, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
    border-radius: inherit;
}
.tma-page > .tma-view {
    position: relative;
    z-index: 1;
}

/* Global `button` resets border/background — override for TMA tabs */
.tma-view {
    padding-bottom: 2rem;
    max-width: 840px;
    margin: 0 auto;
}
@media (min-width: 1100px) {
    .tma-view {
        max-width: 960px;
    }
}

.tma-ceremony-hero {
    position: relative;
    text-align: center;
    padding: var(--space-6) var(--space-4) var(--space-8);
    margin-bottom: var(--space-6);
}
.tma-ceremony-hero__ambient {
    position: absolute;
    inset: -12% -8% auto;
    height: 140%;
    background: radial-gradient(circle at 50% 30%, rgba(251, 191, 36, 0.12), transparent 55%);
    pointer-events: none;
}
.tma-ceremony-hero__mesh {
    position: absolute;
    inset: -20% -15% -10%;
    pointer-events: none;
    opacity: 0.45;
    background:
        radial-gradient(ellipse 100% 80% at 20% 20%, rgba(249, 115, 22, 0.14), transparent 50%),
        radial-gradient(ellipse 70% 50% at 80% 60%, rgba(251, 191, 36, 0.08), transparent 45%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(194, 65, 12, 0.1), transparent 40%);
}
.tma-ceremony-hero__grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
}
.tma-ceremony-medallion {
    position: relative;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(30, 27, 20, 0.9), var(--bg-panel));
    border: 2px solid rgba(251, 191, 36, 0.45);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 12px 40px rgba(249, 115, 22, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.tma-ceremony-medallion .ph {
    font-size: 2rem;
    background: linear-gradient(135deg, #fde68a, var(--primary), #ea580c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 2px 8px rgba(249, 115, 22, 0.35));
}
@media (prefers-reduced-motion: no-preference) {
    .tma-ceremony-medallion {
        animation: tmaMedallionGlow 5s ease-in-out infinite;
    }
}
@keyframes tmaMedallionGlow {
    0%,
    100% {
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.06),
            0 12px 40px rgba(249, 115, 22, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(251, 191, 36, 0.2),
            0 16px 48px rgba(249, 115, 22, 0.32),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}
.tma-ceremony-eyebrow {
    position: relative;
    font-size: var(--font-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin: 0 0 var(--space-2);
}
.tma-ceremony-title {
    position: relative;
    font-size: clamp(1.65rem, 4.5vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 var(--space-4);
    background: linear-gradient(105deg, #fef3c7 0%, #fbbf24 28%, var(--primary) 62%, #c2410c 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}
.tma-ceremony-sub {
    position: relative;
    max-width: 36rem;
    margin: 0 auto;
    line-height: 1.55;
}
.tma-ceremony-sub p {
    margin: 0;
    color: var(--text-muted);
}
.tma-ceremony-sub strong {
    color: var(--text-main);
}
.tma-ceremony-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.tma-ceremony-loading__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: tmaLivePulse 1.2s ease-in-out infinite;
}

.tma-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: var(--space-6);
    padding: 5px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(251, 191, 36, 0.15);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
#main-view button.tma-tab,
button.tma-tab {
    flex: 1 1 0;
    min-width: 0;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted) !important;
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    text-align: center;
    line-height: 1.25;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.tma-tab__icon {
    font-size: 1.05rem;
    opacity: 0.85;
}
#main-view button.tma-tab:hover,
button.tma-tab:hover {
    color: var(--text-main) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}
#main-view button.tma-tab--active,
button.tma-tab--active {
    color: var(--text-main) !important;
    background: linear-gradient(180deg, rgba(42, 38, 32, 0.95), var(--bg-panel)) !important;
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.35),
        0 4px 20px rgba(0, 0, 0, 0.35);
}
#main-view button.tma-tab--active .tma-tab__icon,
button.tma-tab--active .tma-tab__icon {
    color: #fbbf24;
    opacity: 1;
}

.tma-controls-strip {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 320px;
    margin-bottom: var(--space-6);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-subtle);
}
.tma-controls-strip__label {
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.tma-year-select {
    max-width: 100%;
    width: 100%;
    min-height: 44px;
}

.tma-panel--soft {
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-subtle);
    margin-bottom: var(--space-4);
}
.tma-panel--error {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.06);
}

.tma-cat-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg) !important;
}
.tma-cat-card::before {
    content: '';
    display: block;
    height: 3px;
    margin: -1rem -1rem 1rem -1rem;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.75), var(--primary), rgba(251, 191, 36, 0.5), transparent);
    opacity: 0.9;
}
@supports (backdrop-filter: blur(8px)) {
    .tma-cat-card--race,
    .tma-cat-card--results {
        backdrop-filter: blur(8px);
    }
}
@media (prefers-reduced-motion: no-preference) {
    .tma-cat-card--race:not(.tma-cat-card--revealed),
    .tma-cat-card--results:not(.tma-cat-card--revealed) {
        opacity: 0;
        transform: translateY(14px);
    }
    .tma-cat-card--race.tma-cat-card--revealed,
    .tma-cat-card--results.tma-cat-card--revealed {
        opacity: 1;
        transform: translateY(0);
        transition:
            opacity 0.5s ease,
            transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    }
}
.tma-cat-card--race,
.tma-cat-card--results {
    transition:
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}
.tma-cat-card--race:hover,
.tma-cat-card--results:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.38);
}
.tma-rows {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.tma-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition:
        background 0.15s ease,
        transform 0.2s ease;
    min-width: 0;
}
.tma-row:hover {
    background: var(--bg-hover);
}
@media (prefers-reduced-motion: no-preference) {
    .tma-row:hover {
        transform: translateX(3px);
    }
}
.tma-row:focus {
    outline: none;
}
.tma-row:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.65);
    outline-offset: 2px;
}
.tma-rank {
    font-weight: 700;
    width: 2.25rem;
    min-width: 2.25rem;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: right;
}
.tma-rank--gold {
    color: #fde68a;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
}
.tma-rank--silver {
    color: #e2e8f0;
}
.tma-rank--bronze {
    color: #fdba74;
}
.tma-row--result .tma-rank-spacer {
    width: 2.25rem;
    min-width: 2.25rem;
    flex-shrink: 0;
}
.tma-row--winner {
    border-left: 3px solid rgba(251, 191, 36, 0.85);
    padding-left: calc(0.5rem - 3px);
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), transparent 60%);
}
.tma-row--winner:hover {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), var(--bg-hover) 55%);
}
.tma-avatar-wrap {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: var(--bg-hover);
}
.tma-view .tma-avatar-wrap .tma-avatar {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}
.tma-row--chasing-lead .tma-avatar-wrap {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}
.tma-row-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.tma-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.3;
}
.tma-metric {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.tma-hero {
    position: relative;
    margin-bottom: var(--space-6);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.tma-hero--live {
    padding: var(--space-5) var(--space-5) var(--space-4);
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.14), rgba(249, 115, 22, 0.06) 40%, var(--bg-panel) 100%);
    border: 1px solid rgba(251, 191, 36, 0.32);
    box-shadow: 0 8px 40px rgba(249, 115, 22, 0.12);
}
@media (prefers-reduced-motion: no-preference) {
    .tma-hero--live::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(
            100deg,
            transparent 0%,
            rgba(255, 255, 255, 0.04) 45%,
            transparent 55%
        );
        background-size: 200% 100%;
        animation: tmaHeroShimmer 8s ease-in-out infinite;
        pointer-events: none;
    }
}
@keyframes tmaHeroShimmer {
    0%,
    100% {
        background-position: 100% 0;
    }
    50% {
        background-position: 0% 0;
    }
}
.tma-hero--final {
    padding: var(--space-5) var(--space-5) var(--space-4);
    background: linear-gradient(155deg, rgba(113, 113, 122, 0.12), rgba(249, 115, 22, 0.06) 50%, var(--bg-panel) 100%);
    border: 1px solid rgba(251, 191, 36, 0.22);
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.28);
}
.tma-hero-final-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.tma-final-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(249, 115, 22, 0.1));
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.4);
}
.tma-final-pill .ph {
    font-size: 0.95rem;
}
.tma-hero-live-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.tma-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.38);
}
.tma-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ef4444;
    animation: tmaLivePulse 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .tma-live-dot,
    .tma-ceremony-loading__dot {
        animation: none;
    }
    .tma-ceremony-medallion {
        animation: none !important;
    }
    .tma-hero--live::before {
        display: none;
    }
}
@keyframes tmaLivePulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.45;
        transform: scale(0.88);
    }
}
.tma-hero-season {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}
.tma-hero-tagline {
    position: relative;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
}
.tma-hero-tagline strong {
    color: var(--text-main);
}
.tma-hero-meta {
    position: relative;
    margin: 0.2rem 0 0 0;
}
.tma-hero-chips {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.85rem 0;
    padding: 0;
    list-style: none;
}
.tma-hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
}
.tma-hero-chip__icon {
    font-size: 0.85rem;
    color: rgba(251, 191, 36, 0.9);
}
.tma-cat-nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 0 var(--space-5) 0;
    padding: 0.5rem 0;
    margin-left: calc(var(--space-2) * -1);
    margin-right: calc(var(--space-2) * -1);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.tma-cat-nav::-webkit-scrollbar {
    height: 4px;
}
.tma-cat-nav::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.25);
    border-radius: 4px;
}
#main-view button.tma-cat-nav__chip,
button.tma-cat-nav__chip {
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(0, 0, 0, 0.25) !important;
    color: var(--text-muted) !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    padding: 0.45rem 0.75rem !important;
    border-radius: 999px !important;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}
#main-view button.tma-cat-nav__chip:hover,
button.tma-cat-nav__chip:hover {
    color: var(--text-main) !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}
#main-view button.tma-cat-nav__chip--active,
button.tma-cat-nav__chip--active {
    color: var(--text-main) !important;
    border-color: rgba(251, 191, 36, 0.55) !important;
    background: linear-gradient(180deg, rgba(42, 38, 32, 0.95), var(--bg-panel)) !important;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
}
.tma-podium {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    padding: 0.5rem 0 0.25rem;
}
@media (min-width: 520px) {
    .tma-podium {
        gap: 0.75rem;
    }
}
.tma-podium-slot {
    flex: 1 1 0;
    min-width: 0;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.35rem;
    padding: 0.65rem 0.4rem 0.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.12) 100%);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}
.tma-podium-slot:hover {
    border-color: rgba(251, 191, 36, 0.35);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(0, 0, 0, 0.18) 100%);
}
.tma-podium-slot:focus {
    outline: none;
}
.tma-podium-slot:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.75);
    outline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
    .tma-podium-slot:hover {
        transform: translateY(-2px);
    }
    .tma-podium-slot--gold {
        transform: translateY(-4px);
    }
    .tma-podium-slot--gold:hover {
        transform: translateY(-6px);
    }
}
.tma-podium-slot--gold {
    padding-top: 0.85rem;
    padding-bottom: 0.95rem;
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: 0 10px 36px rgba(249, 115, 22, 0.12);
}
.tma-podium-slot--silver,
.tma-podium-slot--bronze {
    padding-top: 0.5rem;
    opacity: 0.96;
}
.tma-podium-slot--chasing {
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}
@media (prefers-reduced-motion: no-preference) {
    .tma-podium-slot--chasing {
        animation: tmaPodiumLeadPulse 2.8s ease-in-out infinite;
    }
}
@keyframes tmaPodiumLeadPulse {
    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.18);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.35);
    }
}
.tma-podium-rank {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
.tma-podium-avatar-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-subtle);
    background: var(--bg-hover);
    flex-shrink: 0;
}
.tma-podium-slot--gold .tma-podium-avatar-wrap {
    width: 72px;
    height: 72px;
    border-color: rgba(251, 191, 36, 0.45);
}
@media (min-width: 520px) {
    .tma-podium-avatar-wrap {
        width: 64px;
        height: 64px;
    }
    .tma-podium-slot--gold .tma-podium-avatar-wrap {
        width: 80px;
        height: 80px;
    }
}
.tma-podium-avatar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tma-podium-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    width: 100%;
    align-items: center;
}
.tma-podium-name {
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.25;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tma-podium-metric {
    font-size: 0.65rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tma-podium-slot .tma-pace-badge,
.tma-podium-slot .tma-tier-badge {
    font-size: 0.58rem;
    padding: 0.2rem 0.45rem;
}
.tma-rows--rest {
    margin-top: 0.15rem;
}
.tma-fan-vote--cta {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(251, 191, 36, 0.28) !important;
    box-shadow: 0 14px 48px rgba(249, 115, 22, 0.1);
    background: linear-gradient(155deg, rgba(251, 191, 36, 0.1) 0%, var(--bg-panel) 55%) !important;
}
.tma-fan-vote--cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.85), var(--primary), transparent);
    pointer-events: none;
}
.tma-fan-vote__head {
    margin-bottom: 0.75rem;
}
.tma-fan-vote__title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-main);
}
.tma-fan-vote__title-icon {
    font-size: 1.15rem;
    color: rgba(251, 191, 36, 0.95);
}
.tma-fan-vote__lede {
    margin: 0.35rem 0 0 0;
}
.tma-fan-vote__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}
.tma-fan-vote__pill {
    flex: 1 1 auto;
    min-width: 5.5rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.tma-fan-vote__pill-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.tma-fan-vote__pill-value {
    font-size: 1.15rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
}
.tma-fan-vote__pill--rem .tma-fan-vote__pill-value {
    color: #fbbf24;
}
.tma-fan-vote__meter-wrap {
    margin-bottom: 0.75rem;
}
.tma-fan-vote__meter {
    height: 6px;
    border-radius: 99px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.tma-fan-vote__meter-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.5), var(--primary));
    transition: width 0.35s ease;
}
.tma-fan-vote__fine {
    position: relative;
}
.tma-fan-vote__form {
    position: relative;
    max-width: 420px;
}
.tma-fan-vote__submit {
    margin-top: 0.25rem;
}
.tma-fan-vote--guest .tma-fan-vote__head {
    margin-bottom: 0.5rem;
}
.tma-rules-details {
    border: 1px solid rgba(251, 191, 36, 0.14);
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.12);
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.tma-rules-details__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--space-4) var(--space-5);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text-main);
    user-select: none;
    transition: background 0.15s ease;
}
.tma-rules-details__summary::-webkit-details-marker {
    display: none;
}
.tma-rules-details__summary::marker {
    display: none;
}
.tma-rules-details__summary:hover {
    background: rgba(255, 255, 255, 0.04);
}
.tma-rules-details__chevron {
    font-size: 1rem;
    color: rgba(251, 191, 36, 0.9);
    transition: transform 0.2s ease;
}
.tma-rules-details[open] .tma-rules-details__chevron {
    transform: rotate(90deg);
}
.tma-rules-details .tma-rules-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}
.tma-rules-details .tma-rules-card::before {
    display: none;
}
.tma-cat-card--race {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, var(--bg-panel) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.tma-cat-card--results {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, var(--bg-panel) 100%);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
}
.tma-cat-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-main);
}

.tma-cat-card--highlight {
    outline: 2px solid rgba(249, 115, 22, 0.75);
    box-shadow: 0 0 0 6px rgba(249, 115, 22, 0.14);
}
.tma-cat-icon {
    color: var(--primary);
    font-size: 1.1rem;
}
.tma-row--chasing-lead {
    border-left: 3px solid rgba(251, 191, 36, 0.9);
    padding-left: calc(0.5rem - 3px);
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.08), transparent 55%);
}
.tma-pace-badge {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    align-self: center;
}
.tma-pace-leading {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(249, 115, 22, 0.1));
}
.tma-pace-contender {
    color: var(--text-main);
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(113, 113, 122, 0.14);
}
.tma-pace-mix {
    color: var(--text-muted);
    border-color: var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}
.tma-tier-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    align-self: center;
}
.tma-tier-winner {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(249, 115, 22, 0.12));
    border-color: rgba(251, 191, 36, 0.45);
}
.tma-tier-finalist {
    background: rgba(113, 113, 122, 0.15);
}
.tma-tier-nominee {
    color: var(--text-muted);
    border-color: var(--border-subtle);
}

.tma-rules-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(251, 191, 36, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, var(--bg-panel) 100%);
}
.tma-rules-card::before {
    content: '';
    display: block;
    height: 3px;
    margin: -1.5rem -1.5rem 1.25rem -1.5rem;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.6), var(--primary), transparent);
}
.tma-rules-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 var(--space-4);
    letter-spacing: 0.02em;
}
.tma-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    line-height: 1.55;
}
.tma-rules-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: 0;
    margin: 0;
}
.tma-rules-list__icon {
    flex-shrink: 0;
    margin-top: 0.15rem;
    font-size: 1rem;
    color: rgba(251, 191, 36, 0.85);
}
.tma-rules-list code {
    font-size: 0.85em;
}

html.is-mobile .tma-page {
    /* Stay inside #main-view padding (negative margins broke layout vs safe-area / 360px rules). */
    margin: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: var(--space-5) var(--space-3) var(--space-8);
    min-height: min(56vh, 520px);
    border-radius: var(--radius-lg);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 12px 36px rgba(0, 0, 0, 0.28);
}

@media (prefers-reduced-motion: reduce) {
    .tma-fan-vote__meter-fill {
        transition: none;
    }
    .tma-cat-card--race:not(.tma-cat-card--revealed),
    .tma-cat-card--results:not(.tma-cat-card--revealed) {
        opacity: 1 !important;
        transform: none !important;
    }
    .tma-cat-card--race.tma-cat-card--revealed,
    .tma-cat-card--results.tma-cat-card--revealed {
        transition: none;
    }
    .tma-row:hover {
        transform: none;
    }
    .tma-rules-details__chevron {
        transition: none;
    }
}

/* Modals */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 200; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(12px); padding: var(--space-4); }
.modal { background: var(--bg-panel); width: 100%; max-width: 480px; padding: var(--space-6); border-radius: var(--radius-xl); border: 1px solid var(--border); max-height: 90vh; overflow-y: auto; animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: var(--shadow-lg); }
.modal h2 { font-size: var(--font-xl); margin-bottom: var(--space-4); }
@keyframes modalPop { from { transform: scale(0.95) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

#dynamic-modal-overlay.modal-overlay { z-index: 9999; }
.modal--dynamic { position: relative; width: auto; max-width: 90vw; }
.modal--dynamic > .btn-icon { position: absolute; top: 12px; right: 12px; z-index: 1; }

/* Dynamic modal layout primitives (notifications, etc.) */
.modal--stack {
    min-width: min(100%, 300px);
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
    gap: var(--space-3);
    flex-shrink: 0;
}

.modal-header-row h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-lg);
    font-weight: 700;
}

.modal-header-row .btn-ghost.btn--compact {
    font-size: var(--font-sm);
}

.modal-body--scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: var(--space-1);
}

.modal-empty-state {
    padding: var(--space-8) var(--space-3);
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.modal-empty-state--tight {
    padding: var(--space-6) var(--space-2);
}

.modal-empty-state__icon {
    font-size: 2rem;
    opacity: 0.5;
}

/* Notification list (dynamic modal) */
.tw-notif-item {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-1);
    transition: background var(--transition-base);
}

.tw-notif-item:hover {
    background: var(--bg-hover);
}

.tw-notif-item--unread {
    background: rgba(234, 88, 12, 0.05);
}

.tw-notif-item__row {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.tw-notif-item__icon-wrap {
    padding: var(--space-2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tw-notif-item__icon-wrap--success { background: color-mix(in srgb, var(--success) 18%, transparent); }
.tw-notif-item__icon-wrap--error { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.tw-notif-item__icon-wrap--warning { background: color-mix(in srgb, var(--warning) 18%, transparent); }
.tw-notif-item__icon-wrap--info { background: color-mix(in srgb, var(--info) 18%, transparent); }

.tw-notif-item__icon {
    font-size: 1.2rem;
}

.tw-notif-item__icon--success { color: var(--success); }
.tw-notif-item__icon--error { color: var(--danger); }
.tw-notif-item__icon--warning { color: var(--warning); }
.tw-notif-item__icon--info { color: var(--info); }

.tw-notif-item__body {
    flex: 1;
    min-width: 0;
}

.tw-notif-item__title {
    font-weight: 600;
    font-size: 0.95rem;
}

.tw-notif-item__title--read {
    color: var(--text-muted);
}

.tw-notif-item__title--unread {
    color: var(--text-main);
}

.tw-notif-item__msg {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
    line-height: 1.4;
}

.tw-notif-item__time {
    font-size: 0.7rem;
    color: var(--text-subtle);
    margin-top: var(--space-1);
}

.tw-notif-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 6px;
    box-shadow: 0 0 8px var(--primary-glow);
    flex-shrink: 0;
}

/* Auth / landing helpers */
.field-password {
    position: relative;
    display: block;
    width: 100%;
}

.field-password input[type="password"],
.field-password input[type="text"] {
    padding-right: 40px;
}

.field-password__toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: var(--space-1);
}

.auth-muted-lead {
    line-height: 1.5;
}

.auth-feedback-line {
    line-height: 1.45;
}

.auth-link {
    cursor: pointer;
    color: var(--primary);
}

.auth-toggle-spaced {
    margin-top: 0.75rem;
}

.auth-email-confirm {
    text-align: center;
}

.auth-email-confirm__icon-wrap {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-6);
}

.auth-email-confirm__icon {
    font-size: 2.5rem;
    color: var(--success);
}

.header-actions .btn--install-pwa {
    color: var(--primary);
    margin-right: var(--space-2);
}

.hero-buttons .btn-secondary[href] {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

/* Booking request detail (dynamic modal) */
.tw-booking-detail {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.tw-booking-detail > h3 {
    padding-right: 44px;
}

.tw-booking-detail-header {
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.tw-booking-detail-who {
    flex: 1 1 200px;
    min-width: 0;
}

.tw-booking-email {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tw-booking-detail-loc {
    flex: 0 1 auto;
    max-width: 100%;
    text-align: right;
    overflow-wrap: anywhere;
}

.tw-booking-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tw-booking-grid-2 > .tw-booking-field {
    min-width: 0;
}

.tw-booking-field label {
    display: block;
    margin-bottom: 4px;
}

.tw-booking-field .input,
.tw-booking-field select.input {
    width: 100%;
    max-width: 100%;
}

.tw-booking-detail-card {
    min-width: 0;
}

.tw-booking-message {
    white-space: pre-wrap;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tw-booking-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-width: 0;
    margin-top: 14px;
}

.tw-booking-detail-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    justify-content: center;
    text-align: center;
}

/* Queue modal — bottom-sheet on mobile (class from JS), full-width scrollable list */
.modal--queue-sheet.modal--dynamic {
    width: 100%;
    max-width: 100%;
    max-height: min(92vh, 900px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    margin-top: auto;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
}

.modal--queue-sheet.modal--dynamic .queue-modal-root--mobile {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    /* Avoid flex:1 chain without definite height — it collapsed the list to 0px */
}

.modal--queue-sheet .queue-modal-body--mobile {
    width: 100%;
    max-height: min(58vh, 520px);
    min-height: 160px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: var(--radius-md);
}

.queue-modal-item {
    padding: 12px 6px 14px;
    border-bottom: 1px solid var(--border);
}

.queue-modal-item--active {
    background: rgba(249, 115, 22, 0.08);
    border-radius: var(--radius-md);
    margin: 4px 0;
    padding: 12px 8px 14px;
}

.queue-modal-item-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    width: 100%;
    cursor: pointer;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    -webkit-tap-highlight-color: transparent;
    border-radius: var(--radius-sm);
}

.queue-modal-item-main:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.queue-modal-item-main:active {
    opacity: 0.9;
}

.queue-modal-item-art {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.queue-modal-item-text {
    flex: 1;
    min-width: 0;
}

.queue-modal-now-pill {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 4px;
}

.queue-modal-item-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.queue-modal-item-title--active {
    color: var(--primary);
}

.queue-modal-item-artist {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.queue-modal-item-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: stretch;
    gap: 6px;
    margin-top: 10px;
    padding-left: 60px;
}

.queue-modal-tool.btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding-left: 0;
    padding-right: 0;
    border-radius: 10px;
}

.queue-modal-tool i {
    font-size: 1.15rem;
}

/* Dock queue sheet to bottom of screen (streaming-app style) */
#dynamic-modal-overlay.modal-overlay:has(.modal--queue-sheet) {
    padding: 0;
    align-items: flex-end;
    justify-content: center;
}

.modal--video { width: min(960px, 92vw); max-width: 960px; overflow: hidden; }
.tw-video-modal { display: flex; flex-direction: column; gap: var(--space-4); }
.tw-video-heading { font-weight: 700; font-size: 1.1rem; padding-right: 48px; }
.tw-video-embed {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    min-height: 220px;
    max-height: min(70vh, 560px);
}
.tw-video-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
@supports (aspect-ratio: 16 / 9) {
    .tw-video-embed { padding-top: 0; }
}
.tw-video-actions { display: flex; justify-content: flex-end; }

/* Lyrics Overlay */
#lyrics-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.98);
    z-index: 150;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Lyrics Styles */
.lyric-line {
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    opacity: 0.5;
}

.lyric-line:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    opacity: 0.8;
}

.lyric-line.active {
    color: white;
    font-weight: 700;
    transform: scale(1.05);
    opacity: 1;
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.5);
}

/* Toasts */
#toast-container { position: fixed; bottom: 100px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 2000; pointer-events: none; }
.toast { background: var(--bg-panel); color: white; padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border-left: 4px solid var(--primary); box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; display: flex; align-items: center; gap: var(--space-3); pointer-events: auto; min-width: 280px; border: 1px solid var(--border-subtle); }
.toast--info { border-left-color: var(--primary); }
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Bottom Navigation - Hidden by default, shown on mobile via media query */
#bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-area-bottom));
    background: var(--bg-panel);
    border-top: 1px solid var(--border-subtle);
    z-index: 150;
    padding-bottom: var(--safe-area-bottom);
}

#mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 140;
    height: var(--header-height);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 var(--space-4);
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.mobile-header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.mobile-header-brand img {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.mobile-header-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#mobile-header-title {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mobile-header-subtitle {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.mobile-header-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-panel);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-header-avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ================= RESPONSIVE ================= */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    :root { --sidebar-width: 200px; --space-8: 24px; }
    .song-row { grid-template-columns: 40px 3fr 2fr 1fr; }
    .song-row > *:nth-child(3) { display: none; }
    .stats-cards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
    .modal { max-width: 90%; }
}

/* Mobile */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
        --player-height: 64px;
        --nav-height: 56px;
        --space-8: 16px;
        --footer-height: 0px;
    }

    html, body {
        overflow: hidden;
        height: 100%;
        height: 100dvh;
    }

    body {
        padding-bottom: 0;
    }

    #license-footer {
        display: none;
    }

    #sidebar { display: none; }

    #app-container {
        height: calc(100dvh - var(--player-height) - var(--nav-height) - var(--footer-height));
        height: calc(100dvh - var(--player-height) - var(--nav-height) - var(--footer-height) - env(safe-area-inset-bottom));
    }

    #main-view {
        padding: var(--space-4);
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    html.is-mobile #mobile-header {
        display: flex;
    }

    html.is-mobile #player-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--nav-height) + var(--safe-area-bottom));
        z-index: 155;
        grid-template-columns: 1fr;
        padding: 0 var(--space-4);
    }

    html.is-mobile #player-bar .player-controls {
        display: none;
    }

    html.is-mobile #player-bar .player-controls-mobile {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        margin-left: auto;
        padding: 0;
    }

    html.is-mobile #player-bar .track-thumb {
        width: 44px;
        height: 44px;
    }

    html.is-mobile #player-bar .track-info {
        gap: var(--space-3);
    }

    html.is-mobile #player-bar .track-info > .player-inline-actions,
    html.is-mobile #player-bar > .flex.justify-end {
        display: none;
    }

    html.is-mobile #toast-container {
        bottom: calc(var(--nav-height) + var(--player-height) + 24px);
        right: 12px;
        left: 12px;
        align-items: stretch;
    }

    html.is-mobile .toast {
        min-width: unset;
        width: 100%;
    }

    .mobile-song-row {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3);
        border-radius: var(--radius-lg);
        background: var(--bg-panel);
        border: 1px solid var(--border-subtle);
        min-height: 64px;
        margin-bottom: var(--space-2);
    }

    .mobile-song-row:last-child {
        margin-bottom: 0;
    }

    .mobile-song-row:active {
        background: var(--bg-hover);
    }

    .mobile-song-row-cover {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-md);
        object-fit: cover;
        background: var(--bg-hover);
        flex-shrink: 0;
    }

    .mobile-song-row-main {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-song-row-title {
        font-weight: 700;
        font-size: var(--font-base);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-song-row-subtitle {
        font-size: var(--font-sm);
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-song-row-actions {
        display: flex;
        align-items: center;
        gap: var(--space-2);
        flex-shrink: 0;
    }

    .mobile-quick-actions-grid {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        max-height: 58vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-menu-item {
        width: 100%;
        display: flex;
        align-items: center;
        gap: var(--space-3);
        padding: var(--space-3) var(--space-4);
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        min-height: 52px;
        font-weight: 600;
    }

    .mobile-menu-item:active {
        background: var(--bg-hover);
        transform: scale(0.99);
    }

    .mobile-menu-item i {
        font-size: 1.25rem;
        color: var(--text-muted);
    }

    .mobile-menu-item.danger {
        color: var(--danger);
    }

    .mobile-menu-item.danger i {
        color: var(--danger);
    }

    .mobile-menu-item.accent {
        color: var(--primary);
    }

    .mobile-menu-item.accent i {
        color: var(--primary);
    }

    .admin-tabs-scroll {
        display: flex;
        gap: var(--space-2);
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: var(--space-2);
    }

    .admin-tabs-scroll::-webkit-scrollbar {
        display: none;
    }



    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        margin-bottom: var(--space-5);
    }

    .view-title {
        font-size: var(--font-xl);
        font-weight: 700;
    }

    .search-container {
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        gap: var(--space-2);
        background: var(--bg-card);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-full);
        padding: 0 var(--space-3);
        min-height: 52px;
        box-sizing: border-box;
    }

    .search-container:focus-within {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
    }

    .search-icon {
        color: var(--text-muted);
        font-size: 1.15rem;
        flex-shrink: 0;
    }

    .search-input {
        flex: 1;
        min-width: 0;
        background: transparent !important;
        border: none !important;
        padding: 0;
        min-height: 44px;
        box-shadow: none !important;
        -webkit-appearance: none;
        appearance: none;
    }

    .search-input:focus {
        border: none !important;
        box-shadow: none !important;
        outline: none;
    }

    .search-clear {
        width: 36px;
        height: 36px;
        border-radius: 9999px;
        background: rgba(255,255,255,0.06);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .search-clear:active {
        background: rgba(255,255,255,0.1);
        transform: scale(0.96);
    }

    /* Bottom Navigation */
    #bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(var(--nav-height) + var(--safe-area-bottom));
        background: var(--bg-dark);
        border-top: 1px solid var(--border-subtle);
        justify-content: flex-start;
        align-items: center;
        z-index: 150;
        padding: 0 var(--space-1);
        padding-bottom: var(--safe-area-bottom);
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        overscroll-behavior-x: contain;
    }

    #bottom-nav::-webkit-scrollbar { display: none; }

    #bottom-nav::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
    }

    #bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: var(--space-2);
        color: var(--text-muted);
        font-size: 0.625rem;
        font-weight: 500;
        letter-spacing: 0.02em;
        min-height: 48px;
        min-width: 48px;
        flex: 1 0 48px;
        border-radius: var(--radius-md);
        transition: all var(--transition-fast);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        white-space: nowrap;
    }

    #bottom-nav .nav-item:active {
        transform: scale(0.88);
    }

    #bottom-nav .nav-item:hover, #bottom-nav .nav-item.active { 
        color: var(--primary);
        background: transparent;
    }

    #bottom-nav .nav-item.active::before {
        display: none;
    }

    #bottom-nav .nav-item i {
        font-size: 1.35rem;
    }

    /* Song Grid - Mobile */
    .song-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .song-card {
        padding: var(--space-3);
    }

    .song-card .cover-art {
        margin-bottom: var(--space-2);
    }

    .song-card .font-semibold {
        font-size: var(--font-sm);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Song Row - Mobile */
    .song-row {
        grid-template-columns: 32px 1fr auto;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
        min-height: 52px;
        font-size: var(--font-xs);
    }

    .song-row > *:nth-child(3),
    .song-row > *:nth-child(4),
    .song-row > *:nth-child(5) {
        display: none;
    }

    .song-row .flex.gap-2 {
        gap: var(--space-2);
    }

    .song-row .flex.gap-2 img {
        width: 36px;
        height: 36px;
    }

    .song-row .song-title {
        font-size: var(--font-sm);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .song-row .btn-icon {
        min-width: 44px;
        min-height: 44px;
        padding: var(--space-1);
    }

    .song-row .btn-icon i {
        font-size: 18px;
    }

    /* Player Bar - Mobile */
    #player-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--footer-height) + var(--safe-area-bottom) + var(--nav-height));
        grid-template-columns: 1fr auto;
        grid-template-rows: 1fr auto;
        gap: 0;
        padding: 0 var(--space-3);
        height: var(--player-height);
        z-index: 160;
    }

    #player-bar .track-info {
        gap: var(--space-3);
        min-width: 0;
        flex: 1;
        flex-wrap: wrap;
        align-items: center;
        align-content: center;
    }

    .track-thumb {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
        border-radius: 10px;
    }

    #player-title.player-track-title,
    .player-track-title {
        font-size: var(--font-sm);
        font-weight: 600;
    }

    #player-artist.player-track-artist,
    .player-track-artist {
        font-size: var(--font-xs);
    }

    /* Like/playlist row wraps under meta on narrow layouts */
    #player-bar .track-info .player-inline-actions {
        flex-basis: 100%;
        width: 100%;
        padding-top: var(--space-1);
        padding-bottom: var(--space-2);
        gap: var(--space-1);
        justify-content: flex-start;
    }

    #player-bar .track-info .player-inline-actions .btn-icon {
        min-width: 36px;
        min-height: 36px;
    }

    #player-bar .track-info .player-inline-actions .btn-icon i {
        font-size: 16px;
    }

    /* Hide desktop controls on mobile */
    .player-controls,
    #player-bar .flex.justify-end {
        display: none !important;
    }

    /* Mobile transport controls */
    .player-controls-mobile {
        display: flex;
        align-items: center;
        gap: var(--space-1);
        grid-column: 2;
        grid-row: 1;
    }

    .player-controls-mobile .btn-icon {
        min-width: 38px;
        min-height: 38px;
        padding: var(--space-1);
    }

    .player-controls-mobile .btn-icon i {
        font-size: 18px;
    }

    .player-controls-mobile .play-pause-btn {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    /* Progress bar floats at very bottom, above nav */
    .progress-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 0;
        background: transparent;
        pointer-events: none;
        z-index: 0;
    }

    .progress-container #progress-bar {
        position: absolute;
        bottom: calc(var(--player-height) - 8px);
        left: 0;
        right: 0;
        width: 100%;
        height: 3px;
        background: transparent;
        -webkit-appearance: none;
        appearance: none;
        pointer-events: auto;
        z-index: 1;
    }

    .progress-container #progress-bar::-webkit-slider-runnable-track {
        height: 3px;
        background: var(--bg-hover);
        border-radius: 2px;
    }

    .progress-container #progress-bar::-webkit-slider-thumb {
        display: none;
    }

    .progress-container #progress-bar:active::-webkit-slider-thumb {
        display: block;
        position: absolute;
        bottom: -5px;
        left: var(--seek-pos, 0%);
        transform: translateX(-50%);
        width: 12px;
        height: 12px;
    }

    .progress-container .time-label {
        display: none;
    }

    #current-time, #total-time {
        display: none;
    }

    /* Stats Cards */
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
        margin-bottom: var(--space-6);
    }

    .stat-card {
        padding: var(--space-4);
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Modals - Mobile */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        width: 100%;
        padding: var(--space-5);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-height: 90vh;
        animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .auth-card {
        padding: var(--space-5);
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-width: 100%;
    }

    /* Forms - Mobile */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select {
        min-height: 52px;
        font-size: 16px;
    }

    textarea {
        min-height: 120px;
    }

    /* Charts - Mobile */
    .chart-scroll-container {
        margin-left: calc(-1 * var(--space-4));
        margin-right: calc(-1 * var(--space-4));
        padding-left: var(--space-4);
        padding-right: var(--space-4);
        padding-bottom: var(--space-4);
    }

    .chart-card {
        min-width: 140px;
        height: 140px;
    }

    /* Toasts - Mobile */
    #toast-container {
        bottom: calc(var(--player-height) + var(--nav-height) + var(--space-4));
        right: var(--space-4);
        left: var(--space-4);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Lyrics Overlay - Mobile */
    #lyrics-overlay {
        padding: var(--space-4);
        padding-top: calc(var(--space-4) + env(safe-area-inset-top, 0px));
        padding-bottom: calc(var(--space-4) + var(--player-height) + var(--nav-height) + env(safe-area-inset-bottom, 0px));
        padding-left: max(var(--space-4), env(safe-area-inset-left, 0px));
        padding-right: max(var(--space-4), env(safe-area-inset-right, 0px));
    }

    .lyric-line {
        font-size: 1.2rem;
        padding: var(--space-2) var(--space-3);
    }

    /* Profile Header - Mobile */
    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: var(--space-4);
    }

    .profile-header img {
        width: 100px;
        height: 100px;
    }

    /* Dashboard - Mobile */
    #main-view .view-header .flex {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    #main-view .view-header .btn {
        padding: 0 var(--space-3);
        min-height: 40px;
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
        font-size: var(--font-xs);
    }
}

/* Small Mobile (< 400px) */
@media (max-width: 400px) {
    .song-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-2);
    }

    .song-card {
        padding: var(--space-2);
    }

    .view-title {
        font-size: var(--font-lg);
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    #bottom-nav .nav-item {
        min-width: 44px;
        font-size: 0.55rem;
    }

    #bottom-nav .nav-item i {
        font-size: 1.25rem;
    }

    .chart-card {
        min-width: 120px;
        height: 120px;
    }
}

/* Landscape Mobile */
@media (max-width: 1024px) and (orientation: landscape) {
    :root {
        --player-height: 60px;
        --nav-height: 48px;
    }

    #player-bar {
        grid-template-columns: 1fr 2fr 1fr;
    }

    .player-controls {
        display: flex;
    }

    #bottom-nav {
        bottom: calc(var(--footer-height) + var(--safe-area-bottom));
    }

    #app-container {
        height: calc(100dvh - var(--player-height) - var(--nav-height) - var(--footer-height) - env(safe-area-inset-bottom));
    }
}

/* High DPI Mobile */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .song-row, .song-card {
        transform: translateZ(0);
    }
}

/* --- Online Presence Indicators --- */
.online-indicator {
    width: 12px;
    height: 12px;
    background-color: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-panel);
    display: inline-block;
}
.online-indicator-wrapper {
    position: relative;
    display: inline-block;
}
.online-indicator-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background-color: var(--success);
    border-radius: 50%;
    border: 2px solid var(--bg-panel);
    display: none;
    z-index: 10;
}
.online-indicator-badge.is-online {
    display: block;
}
.online-indicator-wrapper img {
    display: block;
}

/* ================= SKELETON LOADERS ================= */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton,
.skeleton-text,
.skeleton-text-sm,
.skeleton-box,
.skeleton-card {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    width: 60%;
    border-radius: 4px;
}

.skeleton-text-sm {
    height: 10px;
    width: 40%;
    border-radius: 4px;
}

.skeleton-box {
    border-radius: var(--radius-md);
}

.skeleton-card {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
}

.skeleton-row {
    opacity: 0.6;
    pointer-events: none;
}

/* ================= REUSABLE UI COMPONENTS ================= */

/* --- Media Card (Top Singles, Albums in horizontal scroll) --- */
/* Use .chart-card.media-card for higher specificity over charts.css */
.chart-card.media-card {
    width: 160px;
    min-width: 160px;
    height: auto;
    align-items: stretch;
    text-align: center;
    padding: var(--space-3);
    justify-content: flex-start;
    gap: var(--space-2);
    flex-shrink: 0;
    overflow: visible;
}

.media-card-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-md);
    display: block;
}

.media-card-body {
    width: 100%;
    min-width: 0;
    padding-top: var(--space-2);
    position: relative;
    z-index: 2;
}

.media-card-title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.6em;
}

.media-card-subtitle {
    font-size: var(--font-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card-cover {
    position: relative;
    z-index: 2;
}

.media-card-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 3;
    color: white;
}

/* --- Guest Banner --- */
.guest-banner {
    background: linear-gradient(135deg, #18181b 0%, #27272a 100%);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    border: 1px solid var(--primary);
    margin-bottom: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: flex-start;
}

.guest-banner h3 {
    margin-bottom: var(--space-2);
}

.guest-banner p {
    color: var(--text-muted);
    font-size: var(--font-sm);
}

/* --- Desktop Search Input --- */
.search-input-desktop {
    margin-bottom: var(--space-8);
    padding: var(--space-4);
    font-size: 1.2rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius-lg);
    width: 100%;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input-desktop:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-input-desktop::placeholder {
    color: var(--text-subtle);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.4;
    display: block;
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: var(--font-sm);
    max-width: 280px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Section Heading --- */
.section-heading {
    margin-bottom: var(--space-4);
    font-size: inherit;
}

/* ================= PLAYER BAR POLISH ================= */

/* Active track fill color for range inputs */
input[type="range"]::-webkit-slider-runnable-track {
    background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--range-progress, 0%), var(--bg-hover) var(--range-progress, 0%), var(--bg-hover) 100%);
}

input[type="range"]::-moz-range-track {
    background: var(--bg-hover);
    height: 4px;
    border-radius: 2px;
}

input[type="range"]::-moz-range-progress {
    background: var(--primary);
    height: 4px;
    border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
    background: white;
    height: 14px;
    width: 14px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ================= TOAST EXIT ANIMATION ================= */
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast.removing {
    animation: slideOut 0.25s ease forwards;
}

/* ================= PAGE VIEW TRANSITION ================= */
@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

#main-view > * {
    animation: viewFadeIn 0.2s ease;
}

/* ================= SAVED HEART OVERLAY ================= */
.saved-heart {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #ec4899;
    font-size: 1.2rem;
}

/* ================= PROFILE SECTION POLISH ================= */
.profile-header img {
    border: 4px solid var(--bg-panel);
}

/* ================= ACCOUNT SETTINGS LIST ================= */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-8);
    max-width: 400px;
}

.settings-btn {
    background: var(--bg-hover);
    color: white;
    width: 100%;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-5);
    min-height: 44px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-sm);
    transition: all var(--transition-fast);
    border: none;
    cursor: pointer;
}

.settings-btn:hover {
    background: var(--bg-card);
    transform: translateY(-1px);
}

.settings-btn i {
    margin-right: var(--space-2);
}

.settings-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.settings-btn.danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

.settings-btn:disabled {
    background: #9ca3af;
    color: #374151;
    cursor: not-allowed;
    transform: none;
}

/* ================= COLLABORATION STYLES ================= */

/* Collaboration Cards */
.collab-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.collab-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.collab-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.collab-card-title {
    font-weight: 600;
    font-size: var(--font-base);
    color: var(--text-main);
    margin: 0;
}

.collab-card-status {
    font-size: var(--font-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-weight: 500;
    text-transform: uppercase;
}

.collab-status-pending {
    background: rgba(234, 179, 8, 0.2);
    color: var(--warning);
}

.collab-status-active {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.collab-status-completed {
    background: rgba(113, 113, 122, 0.2);
    color: var(--text-muted);
}

.collab-status-cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Collaboration Avatars */
.collab-avatars {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.collab-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg-panel);
    object-fit: cover;
    transition: all var(--transition-fast);
}

.collab-avatar:hover {
    transform: scale(1.1);
    z-index: 10;
}

.collab-more {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 2px solid var(--bg-panel);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 600;
}

/* Collaboration Chips */
.collab-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: var(--bg-hover);
    padding: 4px 8px;
    border-radius: 16px;
    font-size: var(--font-xs);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
}

.collab-chip img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

.collab-chip-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    margin-left: 2px;
}

.collab-chip-remove:hover {
    color: var(--danger);
}

/* Collaboration Modal */
.collab-modal {
    max-width: 500px;
    width: 90%;
}

.collab-search-container {
    position: relative;
}

.collab-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.collab-search-result {
    padding: var(--space-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.collab-search-result:hover {
    background: var(--bg-hover);
}

.collab-search-result:last-child {
    border-bottom: none;
}

.collab-search-result img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.collab-search-result-info {
    flex: 1;
}

.collab-search-result-name {
    font-weight: 500;
    font-size: var(--font-sm);
    color: var(--text-main);
}

.collab-search-result-username {
    font-size: var(--font-xs);
    color: var(--text-muted);
}

/* Collaboration Actions */
.collab-actions {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-4);
}

.collab-actions .btn {
    flex: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .collab-card {
        padding: var(--space-3);
    }
    
    .collab-avatars {
        gap: var(--space-1);
    }
    
    .collab-avatar {
        width: 28px;
        height: 28px;
    }
    
    .collab-more {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    
    .collab-actions {
        flex-direction: column;
    }
    
    .collab-modal {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* BeatWall — hazard-stripe tape (no repeating label text) */
.beatwall-view {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: min(72vh, 620px);
    padding: var(--space-10) var(--space-4) var(--space-12);
    overflow: hidden;
    isolation: isolate;
}

.beatwall-tape {
    --beatwall-stripe: 18px;
    position: absolute;
    left: -25%;
    width: 150%;
    height: 52px;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    border-top: 2px solid rgba(0, 0, 0, 0.45);
    border-bottom: 2px solid rgba(0, 0, 0, 0.45);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    background: repeating-linear-gradient(
        -45deg,
        #0a0a0c 0,
        #0a0a0c calc(var(--beatwall-stripe) * 0.5),
        #e2b80a calc(var(--beatwall-stripe) * 0.5),
        #e2b80a calc(var(--beatwall-stripe) * 1)
    );
    background-size: calc(var(--beatwall-stripe) * 1.414) calc(var(--beatwall-stripe) * 1.414);
    animation: beatwall-stripe-drift 14s linear infinite;
    opacity: 0;
    transform: translateY(-160%) rotate(-5deg);
    transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.45s ease;
}

.beatwall-tape--top {
    top: 10%;
}

.beatwall-tape--bottom {
    top: auto;
    bottom: 10%;
    transform: translateY(160%) rotate(4deg);
    animation-direction: reverse;
    animation-duration: 18s;
}

.beatwall-view--visible .beatwall-tape--top {
    opacity: 1;
    transform: translateY(0) rotate(-5deg);
}

.beatwall-view--visible .beatwall-tape--bottom {
    opacity: 1;
    transform: translateY(0) rotate(4deg);
}

@keyframes beatwall-stripe-drift {
    to {
        background-position: calc(var(--beatwall-stripe) * 1.414) 0;
    }
}

.beatwall-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
    text-align: center;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.5s ease 0.12s,
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}

.beatwall-view--visible .beatwall-card {
    opacity: 1;
    transform: translateY(0);
}

.beatwall-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-4);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--warning);
    background: rgba(234, 179, 8, 0.12);
    border-radius: var(--radius-full);
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.beatwall-title {
    margin: 0 0 var(--space-4);
    font-size: var(--font-3xl);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.beatwall-lead {
    margin: 0 0 var(--space-3);
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.45;
}

.beatwall-body {
    margin: 0;
    font-size: var(--font-base);
    color: var(--text-muted);
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    .beatwall-tape,
    .beatwall-card {
        transition: none;
    }

    .beatwall-tape {
        animation: none;
    }

    .beatwall-view--visible .beatwall-tape,
    .beatwall-view--visible .beatwall-card {
        opacity: 1;
        transform: none;
    }
}
