/* =============================================================================
   v106: Design-system cascade (read-me)

   Every component on the site resolves through this order, top wins:

     1. Base tokens          - :root CSS custom properties (defined here)
                               e.g. --brand-primary, --feature-01, --utility-success,
                                    --sk-card, --sk-fill, --sk-chrome

     2. Component tokens     - per-component vars emitted by Theme.php from the
                               admin Theme tab (see Theme::getCSSVariables()):
                                 --section-*   - .section, .card
                                 --tile-*      - .stat-card, .song-card, .home-newest-card
                                 --input-*     - inputs, selects, textareas, .search-field
                                 --button-*    - .btn
                                 --pill-*      - .tab, .badge
                                 --alert-*     - .alert and semantic variants
                                 --table-*     - every <table> and .table
                                 --page-*      - .container width + padding + bg
                                 --navbar-*    - .header, .main-nav, .site-header
                                 --footer-*    - .footer, .site-footer

     3. State modifiers      - :hover, :focus, :disabled, .active, [data-theme="dark"]
                               use color-mix or shade functions against the tokens
                               above - never hardcoded hexes.

     4. Scope overrides      - .toolbar, .filter-row, .tabs containers set LAYOUT ONLY
                               (flex, width, margin, height). They must not override
                               colour / font-size / radius / background - those come
                               from the global rules above.

   Hard rules:
     - No raw #hex in component styles outside of :root defaults. Reference a token.
     - No !important except on documented layout-only toolbar overrides.
     - Dark mode is :root[data-theme="dark"] over the same tokens; don't fork colours.

   Admin moves the theme by editing Brand / Theme tabs in /branding. Every page
   picks up the change without touching per-page CSS.
   ============================================================================= */
/**
 * muzooi "SOFT-HEAVY" skin
 * Layer that sits on top of app.css, loaded after the Theme CSS variables so it wins.
 *
 * Direction: heavy, extra-wide display type; big soft rounded cards floating on a
 * warm-to-periwinkle gradient; black pill CTAs; pastel blocks (lime, peach, lavender,
 * mustard) with coral/orange pops and the odd playful shape.
 *
 * Fonts: Archivo (expanded, 800-900) for display, Bricolage Grotesque for everything else.
 */
/* ============================================
   Tokens
   ============================================ */
:root:root{
    /* ============================================================
       v167 SKIN: EVERY colour alias here now resolves through the
       palette emitted by Theme.php. No hardcoded hexes - admin picks
       in Theme > Colors drive the whole skin.

       Pages still using var(--sk-pink) etc. follow the palette too.
       --primary / --surface / --background / --text aliases are
       emitted by Theme.php itself now (legacy alias block), so this
       file DOES NOT re-declare them. The old re-point block that
       forced blue/pink hexes onto --primary is gone.
       ============================================================ */

    /* -- Skin colour names aliased to palette -- */
    --sk-ink:        var(--color-text,       #1f2937);
    --sk-ink-soft:   var(--color-text-muted, #4a4b53);
    --sk-chrome:      var(--chrome-bg,        var(--color-primary, #40026f));
    --sk-chrome-text: var(--chrome-text,      var(--color-primary-reverse, #ffffff));
    --sk-cream:      var(--color-background,          #f4efe6);
    --sk-periwinkle: var(--color-background-accent,   var(--color-background-subtle, #c7d2ff));
    --sk-card:       var(--color-surface,             #ffffff);
    --sk-fill:       var(--color-surface-subtle,      #f2efe9);
    /* Named accents inherit matching feature-* / utility-* slots. */
    --sk-lime:       var(--color-feature-1,  #d4ff4b);
    --sk-coral:      var(--color-utility-3,  #ef4444);
    --sk-orange:     var(--color-feature-4,  #ff5b1f);
    --sk-mustard:    var(--color-feature-4,  #ffd93d);
    --sk-peach:      var(--color-feature-2-subtle, #f6e4d4);
    --sk-lavender:   var(--color-feature-3-subtle, #dedbff);
    --sk-mint:       var(--color-utility-1-subtle, #d5f3e2);
    --sk-sky:        var(--color-feature-3-subtle, #d8e6ff);
    --sk-blue:       var(--color-utility-4,  #1f5cff);
    --sk-purple:     var(--color-primary,    #40026f);
    --sk-purple-soft:var(--color-primary-highlight, #8b5cf6);
    --sk-pink:       var(--color-secondary,  #f40252);
    --sk-pink-dark:  var(--color-secondary-bold, #c00140);
    --sk-pink-soft:  var(--color-secondary-subtle, #ffe3ec);
    --sk-green:      var(--color-utility-1,  #18b26b);

    /* -- Structure (unchanged) -- */
    --sk-r-xl: 32px;
    --sk-r: 26px;
    --sk-r-md: 18px;
    --sk-r-sm: 14px;
    --sk-gap: 24px;
    --section-gap: var(--sk-gap);
    --sk-nav-h: 44px;
    --sk-shadow: none;
    --sk-shadow-sm: none;
    --sk-shadow-lg: none;
    --sk-hair: rgba(17, 18, 22, .08);
    --sk-display: var(--font-family-headings, 'Archivo', 'Bricolage Grotesque', system-ui, sans-serif);
    --sk-body:    var(--font-family,          'Bricolage Grotesque', system-ui, -apple-system, sans-serif);

    /* v167: --primary/--primary-hover/--primary-dark/--primary-light/
       --primary-contrast/--primary-rgb come from Theme.php's legacy
       alias block, which resolves them through --color-primary-*
       variants. This file no longer forces them to a hex.

       Other legacy aliases (--background, --surface, --text, --border,
       --success, --danger, --warning, etc) also resolve through Theme.
       The only thing this block needs to add is container-level
       aliases a few older inline-styled pages still read. */
    --bg-primary:   var(--color-surface,          #ffffff);
    --bg-secondary: var(--color-surface-subtle,   #f2efe9);
    --bg-tertiary:  var(--color-background-subtle,#f8f6f2);
    --card-bg:      var(--color-surface,          #ffffff);
    --modal-bg:     var(--color-surface,          #ffffff);
    --dropdown-bg:  var(--color-surface,          #ffffff);

    /* v167: text-secondary / gray-50 / gray-100 / gray-200 kept as
       muted neutrals; now source from palette subtle variants so
       they shift with the chosen surface colour. */
    --text-secondary: var(--color-text-muted, #4a4b53);
    --gray-50:  var(--color-surface-subtle,    #f8f6f2);
    --gray-100: var(--color-surface-subtle,    #f2efe9);
    --gray-200: var(--color-surface-bold,      #e6e2da);

    --radius-lg: var(--sk-r);
    --radius-md: var(--sk-r-md);
    --radius-sm: var(--sk-r-sm);
    --form-radius: var(--sk-r-sm);
    --input-height: 54px;
    --input-height-sm: 44px;
    --input-height-lg: 62px;
    --shadow-sm: var(--sk-shadow-sm);
    --shadow:    var(--sk-shadow-sm);
    --shadow-md: var(--sk-shadow);
    --shadow-lg: var(--sk-shadow-lg);
}
:root:root[data-theme="dark"]{
    /* v167: dark mode. Only the --sk-* neutrals that have no palette
       equivalent (the near-black surface stack) are overridden here.
       Everything colour-related comes from the palette emitted by
       Theme.php; the design-system dark-mode block (Theme page) can
       further override --color-surface / --color-background. */

    /* Near-black surface stack, kept hardcoded so dark mode stays
       dark regardless of admin picks. Admin can further tune via
       color_surface_dark / color_background_dark settings which
       Theme.php emits as :root[data-theme="dark"] overrides for
       --color-surface and --color-background. */
    --sk-cream:      var(--color-background, #0b0b0c);
    --sk-periwinkle: var(--color-background-accent, #141415);
    --sk-card:       var(--color-surface,    #171718);
    --sk-fill:       var(--color-surface-subtle, #222224);
    --sk-peach:      #2a2622;
    --sk-lavender:   #252328;
    --sk-mint:       #19271f;
    --sk-sky:        #1e2124;
    --sk-hair: rgba(255, 255, 255, .08);
    --sk-shadow: none;
    --sk-shadow-sm: none;
    --sk-shadow-lg: none;

    /* v167: --primary/-hover/-dark/-light/-contrast/-rgb come from Theme's
       legacy alias block (which resolves through --color-primary). This
       file DOES NOT force a dark-mode pink override any more - the admin's
       palette picks apply in dark mode too, so brand consistency wins. If
       an install genuinely wants a brighter primary in dark mode, that's a
       Theme setting (color_primary_dark override), not a skin force. */

    /* Container-level aliases for surface stack (dark values). */
    --bg-primary:   var(--color-surface,        #171718);
    --bg-secondary: var(--color-surface-subtle, #222224);
    --bg-tertiary:  #1c1c1e;
    --surface-hover:#1f1f21;
    --card-bg:      var(--color-surface,        #171718);
    --modal-bg:     var(--color-surface,        #171718);
    --dropdown-bg:  var(--color-surface,        #171718);

    --text:           var(--color-text,       #f3f1ec);
    --text-secondary: var(--color-text-muted, #b6b3ad);
    --text-muted:     var(--color-text-muted, #7e7b76);
    --white:          var(--color-surface,    #171718);
    --gray-50:  #1c1c1e;
    --gray-100: var(--color-surface-subtle, #222224);
    --gray-200: #2e2e31;
}
/* ============================================
   Base + type
   ============================================ */
/* v105: full-page background - html now matches body so the gradient covers
   the whole viewport including behind the nav and footer. Chrome defaults to
   transparent (set in the v103 block below) so the gradient shows through. */
html{
    min-height: 100%;
    background: var(--page-background, linear-gradient(180deg, var(--sk-cream) 0%, var(--sk-periwinkle) 100%));
}
html body{
    font-family: var(--sk-body);
    font-weight: 450;
    font-optical-sizing: auto;
    color: var(--text);
    /* v99: page background is admin-controllable. Theme emits --page-background
       as either a solid colour or a linear gradient, based on the Background Type
       setting in admin > Branding > Colors. The fallback keeps the pre-v99 cream->
       periwinkle gradient so existing installs look the same on first load. */
    background: var(--page-background, linear-gradient(180deg,
        var(--background, var(--sk-cream)) 0%,
        var(--background, var(--sk-cream)) 18%,
        var(--background-accent, var(--sk-periwinkle)) 100%)) fixed;
    letter-spacing: -0.005em;
}
/* v99.2: in dark mode, stack a translucent dark layer over the admin page
   background so the admin's chosen hue still bleeds through (keeping the brand
   feel) but the overall surface reads as dark. The overlay is ~82% opaque at
   the top of a near-black so even a brightly coloured admin pick looks dark-
   mode-appropriate. The --page-background variable itself is unchanged, so
   light mode remains faithful to the admin pick. */
/* The selector MUST be ":root[data-theme='dark'] body" NOT "...html body" -
   :root IS the html element, so asking for a descendant html matches nothing.
   That earlier typo is why dark mode wasn't darkening the admin background. */
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]) body{
        background:
            linear-gradient(rgba(10, 10, 12, 0.88), rgba(10, 10, 12, 0.88)),
            var(--page-background, linear-gradient(180deg,
                var(--background, var(--sk-cream)) 0%,
                var(--background, var(--sk-cream)) 18%,
                var(--background-accent, var(--sk-periwinkle)) 100%))
            fixed !important;
    }}
:root[data-theme="dark"] body{
    background:
        linear-gradient(rgba(10, 10, 12, 0.88), rgba(10, 10, 12, 0.88)),
        var(--page-background, linear-gradient(180deg,
            var(--background, var(--sk-cream)) 0%,
            var(--background, var(--sk-cream)) 18%,
            var(--background-accent, var(--sk-periwinkle)) 100%))
        fixed !important;
}
h1, h2,
.page-title,
.stat-value, .stat-card-value{
    font-family: var(--sk-display);
    font-stretch: 125%;
    font-variation-settings: "wdth" 125;
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.0;
    color: var(--text);
}
h3, h4,
.section-title, .card-title, .modal-title, .empty-state-title{
    font-family: var(--sk-body);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--text);
}
/* v99.2: section + card titles are admin-controllable (Branding > Typography) */
.section-title, .card-title{
    font-family: var(--section-title-font, var(--sk-body));
    font-size: var(--section-title-size, 18px);
}
/* v99: hN font-size reads Theme's heading_size_scale first, falls back to
   responsive clamps. Admin > Branding > Typography > Heading Size Scale
   writes --heading-h1-size etc. via Theme::getCSSVariables(). */
h1{ font-size: var(--heading-h1-size, clamp(34px, 5.4vw, 60px)); }
h2{ font-size: var(--heading-h2-size, clamp(24px, 3.2vw, 34px)); }
h3{ font-size: var(--heading-h3-size, 21px); }
h5, h6{ font-family: var(--sk-body); font-weight: 700; }
a{ font-weight: 600; }
a:not([class]):hover{ text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
::selection{ background: var(--sk-lime); color: var(--sk-ink); }
hr{ border-top: 1px solid var(--sk-hair); }
:focus-visible{
    outline: 3px solid var(--sk-blue);
    outline-offset: 3px;
}
.text-muted{ color: var(--text-muted) !important; }
/* ============================================
   Page header
   ============================================ */
.page-content{ padding-top: 44px; padding-bottom: 72px; }
.page-header,
.dashboard-greeting{ margin-bottom: var(--sk-gap) !important; }
.page-title{
    /* v99: all three controlled by admin > Branding > Typography. --page-title-font
       and --page-title-size come from Theme::getCSSVariables; --page-title-sparkle
       toggles the decorative mark on/off. Fallbacks match the pre-v99 look. */
    font-family: var(--page-title-font, var(--sk-display));
    font-size: var(--page-title-size, clamp(36px, 6vw, 66px));
    margin: 0 0 12px;
}
/* playful four-point sparkle after big titles */
.page-title::after{
    content: "";
    display: var(--page-title-sparkle, inline-block);
    width: .5em;
    height: .5em;
    margin-left: .18em;
    vertical-align: .55em;
    background: var(--sk-orange);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c.7 6.6 5.4 11.3 12 12-6.6.7-11.3 5.4-12 12-.7-6.6-5.4-11.3-12-12C6.6 11.3 11.3 6.6 12 0z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0c.7 6.6 5.4 11.3 12 12-6.6.7-11.3 5.4-12 12-.7-6.6-5.4-11.3-12-12C6.6 11.3 11.3 6.6 12 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.page-subtitle{
    font-size: 18px;
    font-weight: 450;
    color: var(--text-secondary);
    max-width: 60ch;
}
/* ============================================
   Header: floating rounded bar
   ============================================ */
/* v125: navbar tokens now target .header-inner (the actual visible pill)
   instead of .header (the transparent wrapper). bg + radius + padding + max-width
   all read admin values from Theme > Navbar. */
.logo span{
    font-family: var(--sk-display);
    font-stretch: 125%;
    font-variation-settings: "wdth" 125;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.04em;
}
.logo-image{ height: var(--header-logo-size, 34px); }
.nav{ gap: 4px; }
/* Every nav control (links, dropdown toggles, icon buttons, auth button) shares one height */
.nav-link,
.nav-dropdown .nav-dropdown-toggle{
    font-family: var(--sk-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    height: var(--sk-nav-h);
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    transition: background .15s, color .15s;
}
.nav-link:hover,
.nav-dropdown .nav-dropdown-toggle:hover{
    background: var(--sk-fill);
    color: var(--text);
}
/* Active = black pill */
.nav-link.active:not(.nav-icon-link),
.nav-dropdown.active > .nav-dropdown-toggle{
    background: var(--sk-chrome);
    color: var(--sk-chrome-text);
}
[data-theme="dark"] .nav-link.active:not(.nav-icon-link),
[data-theme="dark"] .nav-dropdown.active > .nav-dropdown-toggle{ background: #f3f1ec; color: var(--sk-ink); }
/* Round white icon buttons */
.nav-link.nav-icon-link,
.nav-icon-link{
    width: var(--sk-nav-h);
    height: var(--sk-nav-h);
    padding: 0;
    justify-content: center;
    background: var(--sk-fill);
    color: var(--text);
    font-size: 16px;
}
.nav-icon-link:hover{ background: var(--sk-lime); color: var(--sk-ink); }
/* Guest "Sign In / Register" pill: same height as the nav pills */
.nav-icon-link.active{ background: var(--sk-chrome); color: var(--sk-chrome-text); }
.nav-icon-badge{
    background: var(--sk-coral);
    color: #fff;
    box-shadow: 0 0 0 2px var(--sk-card);
    font-weight: 700;
    font-size: 11px;
}
.credit-badge{
    background: var(--sk-lime);
    color: var(--sk-ink);
    font-weight: 700;
    border: 0;
    border-radius: var(--radius-pill, 999px);
}
.profile-avatar,
.profile-avatar-placeholder{
    box-shadow: 0 0 0 3px var(--sk-card), 0 0 0 5px var(--sk-lime);
}
.profile-avatar-placeholder{
    background: var(--sk-lavender);
    color: var(--text);
    font-weight: 800;
}
/* Dropdowns / menus */
.nav-dropdown-menu,
.admin-menu,
.profile-menu,
.search-dropdown,
.autocomplete-dropdown,
.dropdown-menu{
    /* v134: dropdowns follow the active theme (section bg + radius) rather than
       hardcoded --sk-card / 22px. Shadow kept because dropdowns need elevation. */
    background: var(--section-bg, var(--sk-card));
    color: var(--section-text, var(--text));
    border-radius: var(--section-radius, 22px);
    box-shadow: var(--sk-shadow-lg) !important;
    padding: 8px;
    border: 0;
}
/* v99.1: notifications dropdown keeps the shape but drops the shadow so it
   reads as a flat panel, not a floating card. */
.notifications-menu{
    background: var(--section-bg, var(--sk-card));
    color: var(--section-text, var(--text));
    border: 0;
    border-radius: var(--section-radius, 22px);
    box-shadow: none !important;
    padding: 8px;
}
.nav-dropdown-item,
.admin-menu-item,
.profile-menu-item,
.search-item,
.autocomplete-item{
    font-weight: 550;
    color: var(--text);
}
.nav-dropdown-item:hover,
.admin-menu-item:hover,
.profile-menu-item:hover,
.search-item:hover,
.autocomplete-item:hover{ background: var(--sk-fill); color: var(--text); }
.nav-dropdown-item.active{ background: var(--sk-lime); color: var(--sk-ink); }
.admin-menu-header,
.search-category-header,
.profile-menu-label{
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.profile-menu-header,
.notifications-header{ border-bottom: 1px solid var(--sk-hair); }
.mobile-menu-toggle{
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--sk-fill);
    border: 0;
}
.hamburger-line{ background: var(--text) !important; height: 2.5px; border-radius: var(--radius-xs, 2px); }
/* ============================================
   Buttons: pills
   ============================================ */
.btn,
button.btn,
a.btn{
    font-family: var(--sk-body);
    font-weight: 650;
    font-size: 15px;
    min-height: 50px;
    padding: 0 24px;
    border: 0 !important;
    /* v105: reads Theme > Buttons > Corner radius; 999px keeps the pill look as fallback */
    border-radius: var(--button-radius, 999px);
    box-shadow: none;
    gap: 8px;
    transition: transform .15s ease, background .15s, box-shadow .15s, color .15s;
}
.btn:hover:not(:disabled){ text-decoration: none; }
/* v126: no hover movement */
.btn:active:not(:disabled){ opacity: 0.9; }
/* v126: no click movement */
.btn:disabled{ opacity: .4; }
.btn-primary{ background: var(--sk-chrome); color: var(--sk-chrome-text) !important; }
.btn-primary:hover:not(:disabled){ background: var(--primary-hover, var(--sk-lime)); color: var(--primary-contrast, var(--sk-ink)) !important; }
.btn.btn-secondary{
    background: transparent;
    color: var(--text) !important;
    box-shadow: inset 0 0 0 1px var(--text);
}
.btn.btn-secondary:hover:not(:disabled){ background: var(--text); color: var(--sk-card) !important; }
.btn-success{ background: var(--success, var(--sk-lime)); color: var(--success-contrast, var(--sk-ink)) !important; }
.btn-success:hover:not(:disabled){ background: color-mix(in srgb, var(--success, var(--sk-lime)) 85%, black); }
.btn-danger{ background: var(--danger, var(--sk-coral)); color: var(--danger-contrast, #fff) !important; }
.btn-danger:hover:not(:disabled){ background: color-mix(in srgb, var(--danger, var(--sk-coral)) 85%, black); }
.btn-warning{ background: var(--warning, var(--sk-mustard)); color: var(--warning-contrast, var(--sk-ink)) !important; }
.btn-ghost,
.btn-link{
    background: transparent;
    color: var(--text) !important;
}
.btn-ghost:hover:not(:disabled),
.btn-link:hover:not(:disabled){ background: var(--sk-fill); }
.btn-sm{ min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg{ min-height: 62px; padding: 0 34px; font-size: 17px; }
.btn-icon{ padding: 0; width: 50px; border-radius: 50%; }
.btn-icon.btn-sm{ width: 40px; }
[data-theme="dark"] .btn-primary{ background: #f3f1ec; color: var(--sk-ink) !important; }
[data-theme="dark"] .btn-primary:hover:not(:disabled){ background: var(--sk-lime); }
/* Small round icon buttons used in tables/lists */
.icon-btn,
.action-btn{
    border: 0 !important;
    border-radius: 50%;
    background: var(--sk-fill);
    color: var(--text);
    transition: background .15s, color .15s;
}
.icon-btn:hover,
.action-btn:hover{ background: var(--sk-lime); color: var(--sk-ink); }
/* ============================================
   Cards + sections
   ============================================ */
.section,
.card,
.stat-card{
    background: var(--sk-card);
    border: 0 !important;
    border-radius: var(--sk-r);
    box-shadow: var(--sk-shadow);
}
/* ============================================
   Spacing: one gap (--sk-gap) between every pane, card, tile and grid cell
   ============================================ */
.section,
.card{ margin-bottom: var(--section-gap, var(--sk-gap, 20px)); }
.grid,
.stats-grid,
.stats-grid-3{
    gap: var(--sk-gap) !important;
    margin-bottom: var(--sk-gap);
}
/* Grids of card tiles (rows inside lists like .user-list stay tight on purpose) */
.song-grid, .home-newest-grid, .home-contests-grid, .collections-grid,
.playlists-grid, .posts-grid, .bands-grid, .tracks-grid, .recommendations-grid,
.members-grid, .managers-grid, .merch-grid, .releases-grid, .photos-grid,
.videos-grid, .search-grid, .profile-stats-grid, .shootouts-list, .stats-row{
    gap: var(--sk-gap) !important;
}
/* Tiles inside a grid are spaced by the grid gap, not their own margins */
.grid > .section, .grid > .card,
.grid > * > .section:only-child, .grid > * > .card:only-child,
.stats-grid > *, .stats-grid-3 > *{ margin-bottom: 0; }
/* ~40 templates set their own inline margins on panes (12/16/32px, margin-top
   spacers). Inline styles only lose to !important, so the rule is enforced here. */
.page-content :is(.section, .card, .toolbar, .tabs, .filter-row, .stats-grid, .stats-grid-3, .stats-row, .grid){
    margin-top: 0 !important;
    margin-bottom: var(--sk-gap) !important;
}
.page-content :is(.grid, .stats-grid, .stats-grid-3) > :is(.section, .card, .stat-card),
.page-content :is(.section-header, .card-header, .modal) :is(.tabs, .toolbar),
.page-content :is(.section, .card, .toolbar, .tabs, .filter-row, .stats-grid, .stats-grid-3, .grid):last-child{
    margin-bottom: 0 !important;
}
/* v98: let margin utility classes override the reset above so action bars
   (and other sections with mt-* classes) actually get their intended gap.
   The reset above is deliberately broad to defeat inline margins; these
   overrides restore the standard utility classes for the specific case
   where a section explicitly asks for top spacing. */
.page-content :is(.section, .card).mt-xs{ margin-top: var(--space-xs)  !important; }
.page-content :is(.section, .card).mt-sm{ margin-top: var(--space-sm)  !important; }
.page-content :is(.section, .card).mt-md{ margin-top: var(--space-md)  !important; }
.page-content :is(.section, .card).mt-lg{ margin-top: var(--space-lg)  !important; }
.page-content :is(.section, .card).mt-xl{ margin-top: var(--space-xl)  !important; }
.page-content :is(.section, .card).mt-2xl{ margin-top: var(--space-2xl) !important; }
/* Nothing adds extra space after the last block on a page */
.page-content > :last-child,
.section:last-child, .card:last-child{ margin-bottom: 0; }
.section-header,
.card-header{
    border-bottom: 0;
    padding: 24px 28px 8px;
    min-height: 0;
}
.section-title,
.card-title{ font-size: var(--section-title-size, 18px); font-family: var(--section-title-font, var(--sk-body)); }
.section-body,
.card-body{ padding: 20px 28px 28px; }
.section-footer,
.card-footer{
    border-top: 1px solid var(--sk-hair);
    background: transparent;
    padding: 18px 28px;
}
a.card,
.card.clickable,
.card[onclick]{ transition: transform .2s ease, box-shadow .2s ease; }
a.card:hover,
.card.clickable:hover,
.card[onclick]:hover{
    /* v126: no hover movement */
    box-shadow: var(--sk-shadow-lg);
}
/* Stat cards: pastel blocks, huge wide numbers */
.stat-card{ padding: 24px 26px; border-radius: var(--sk-r); }
.stat-value,
.stat-card-value,
.stat-card .stat-value,
.stat-card .stat-card-value{ font-size: clamp(32px, 4.2vw, 46px); }
.stat-label,
.stat-card-label{
    font-size: 14px;
    font-weight: 550;
    color: var(--text-secondary);
}
/* v99: tile cycle backgrounds are admin-controlled via color_tile_1..4
   (Branding > Colors > Tile 1..4). The --sk-* tokens stay as fallbacks so any
   codepath still using the old names keeps working. */
.stat-card:nth-child(4n+1){ background: var(--tile-1, var(--sk-lime)); }
.stat-card:nth-child(4n+2){ background: var(--tile-2, var(--sk-peach)); }
.stat-card:nth-child(4n+3){ background: var(--tile-3, var(--sk-lavender)); }
.stat-card:nth-child(4n+4){ background: var(--tile-4, var(--sk-mustard)); }
.stat-card:nth-child(4n+1) *,
.stat-card:nth-child(4n+4) *{ color: var(--sk-ink) !important; }
[data-theme="dark"] .stat-card:nth-child(4n+2) *,
[data-theme="dark"] .stat-card:nth-child(4n+3) *{ color: #f3f1ec; }
/* ============================================
   Forms: soft filled fields
   ============================================ */
.form-group > label,
.form-label{
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.form-hint,
.form-text{ font-weight: 450; color: var(--text-muted); }
/* v99.2: visible 1px hair border so inputs still read on white cards (parity
   with the admin section). Padding is set on both sides; font-size stays 16px
   so inputs match across every page of the site. */
/* v102: single global source of truth for every input, select and textarea
   on every page. White background from --input-bg, 1px faint hair border,
   17px text (lifted from 16px per request so the search bar reads a touch
   larger), and consistent 0 18px padding. The toolbar/filter-row/tabs scope
   now only sets layout (flex/margin/width) so this rule wins on colour and
   type. */
html .form-input, html .form-select, html .form-textarea, html .form-control, html input[type="text"], html input[type="email"], html input[type="password"], html input[type="number"], html input[type="url"], html input[type="tel"], html input[type="search"], html input[type="date"], html input[type="time"], html input[type="datetime-local"], html select, html textarea{
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--sk-r-sm);
    font-weight: 500;
    font-size: 17px;
    color: var(--text);
    padding: 0 18px;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
html textarea{ padding-top: 14px; padding-bottom: 14px; }
/* v102: search-field inherits the global input look so it matches selects and
   regular text inputs. font + background + border set by the global rule above;
   this one keeps the pill radius + icon-left padding that make a search bar a
   search bar. */
/* v102: pin a consistent height so inputs, selects and search fields all
   line up visually in any layout. Textareas keep auto height for multi-line
   content. Toolbar/filter-row scope still overrides to 48px via !important
   so pill bars read taller as a whole bar. */
html .form-input, html .form-select, html .form-control, html input[type="text"], html input[type="email"], html input[type="password"], html input[type="number"], html input[type="url"], html input[type="tel"], html input[type="search"], html input[type="date"], html input[type="time"], html input[type="datetime-local"], html select{
    height: 44px;
    line-height: 1;
}
html textarea{ height: auto; }
html .form-input:hover,
html input:hover,
html select:hover,
html textarea:hover{ background-color: var(--input-bg-hover, color-mix(in srgb, var(--input-bg) 85%, var(--text) 5%)); }
html .form-input:focus,
html .form-select:focus,
html .form-textarea:focus,
html .form-control:focus,
html input:focus,
html select:focus,
html textarea:focus{
    outline: none;
    background-color: var(--sk-card);
    border-color: var(--text);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--sk-lime) 55%, transparent);
}
::placeholder{ color: var(--text-muted); opacity: 1; }
html select,
html .form-select{
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23111216' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    padding-right: 46px;
}
[data-theme="dark"] select,
[data-theme="dark"] .form-select{
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23f3f1ec' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
}
input[type="checkbox"],
input[type="radio"]{ accent-color: var(--sk-ink); width: 20px; height: 20px; }
[data-theme="dark"] input[type="checkbox"],
[data-theme="dark"] input[type="radio"]{ accent-color: var(--sk-lime); }
/* Toggle switches */
.switch-slider,
.toggle-slider{ background: var(--gray-200); border: 0; }
.switch input:checked + .switch-slider,
.toggle-switch input:checked + .toggle-slider{ background: var(--sk-chrome); }
[data-theme="dark"] .switch input:checked + .switch-slider,
[data-theme="dark"] .toggle-switch input:checked + .toggle-slider{ background: var(--sk-lime); }
/* ============================================
   Tabs, filter rows, toolbars: segmented pills
   ============================================ */
/* Every bar is a full pill (circular ends), and so is everything inside it */
.tabs,
.toolbar,
.filter-row,
.action-toolbar,
.tabs-responsive .tabs{
    /* v118: background + radius + padding + gap now read Theme > Tab bars tokens.
       Fallbacks preserve the pre-v116 translucent glass look when admin has not
       picked anything. !important removed so admin tokens actually win. */
    background: var(--tabbar-bg, color-mix(in srgb, var(--sk-card) 50%, transparent));
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    backdrop-filter: saturate(140%) blur(8px);
    border: 0;
    border-radius: var(--tabbar-radius, 999px);
    box-shadow: var(--sk-shadow-sm);
    padding: var(--tabbar-padding, 6px);
    gap: var(--tabbar-gap, 4px);
    margin-bottom: var(--sk-gap);
}
/* v126: toolbar-scoped inputs/selects/buttons now read admin radius tokens.
   Was hardcoded 999px !important which was overriding Theme > Text Inputs
   > Corner radius on the songs page search + selects. */
.tabs input, .tabs select,
.toolbar input, .toolbar select,
.filter-row input, .filter-row select{
    border-radius: var(--input-radius, 999px);
}
.tabs .btn, .toolbar .btn, .filter-row .btn{
    border-radius: var(--button-radius, 999px);
}
.toolbar input, .toolbar select,
.filter-row input, .filter-row select{ margin-top: 0; margin-bottom: 0; }
/* song.php's own .action-toolbar rule (grey fill) loads after the skin */
.action-toolbar{ background: var(--sk-card) !important; padding: 6px !important; }
/* app.css paints primary buttons inside bars with --primary (blue); keep them the black pill */
.toolbar .btn-primary,
.filter-row .btn-primary{ background: var(--sk-chrome); color: var(--sk-chrome-text) !important; }
.toolbar .btn-primary:hover:not(:disabled),
.filter-row .btn-primary:hover:not(:disabled){ background: var(--sk-lime); color: var(--sk-ink) !important; }
[data-theme="dark"] .toolbar .btn-primary,
[data-theme="dark"] .filter-row .btn-primary{ background: #f3f1ec; color: var(--sk-ink) !important; }
.section-header .tabs,
.card-header .tabs{
    box-shadow: none;
    background: color-mix(in srgb, var(--sk-fill) 50%, transparent);
    margin-bottom: 0;
}
/* v100: unselected tab text reads --chrome-bg so it matches the colour of the
   selected pill (admin Branding > Colors > Chrome BG). Hover falls through to
   full --text for maximum readability on tab-row backgrounds. */
.tab,
.tabs button:not(.btn),
.filter-row button:not(.btn):not(.btn-icon){
    font-weight: 600;
    /* v108: respects Theme > Pills > Corner radius token */
    border: 0;
    color: var(--chrome-bg, var(--text-secondary));
}
.tab:hover,
.tabs button:not(.btn):hover,
.filter-row button:not(.btn):not(.btn-icon):hover{ background: var(--sk-fill); color: var(--text); }
/* v134: active tab reads pill tokens so admin > Theme > Pills applies.
   No !important so later/more-specific rules can override per surface. */
.tab.active,
.tabs button.active,
.filter-row button.active{
    background: var(--pill-bg, var(--sk-chrome));
    color: var(--pill-text, var(--sk-chrome-text));
}
/* ============================================
   Badges, alerts
   ============================================ */
.badge{
    font-family: var(--sk-body);
    font-weight: 650;
    /* v108: respects Theme > Pills tokens for font-size + radius + padding */
    font-size: var(--pill-font-size, 12.5px);
    letter-spacing: 0;
    text-transform: none;
    padding: var(--pill-padding, 5px 12px);
    border: 0;
    border-radius: var(--pill-radius, 999px);
    background: var(--sk-fill);
    color: var(--text);
}
.badge-primary{ background: var(--sk-chrome); color: var(--sk-chrome-text); }
.badge-success{ background: var(--success-light, var(--sk-mint)); color: var(--success, #0d6b3f); }
.badge-danger{ background: var(--danger, var(--sk-coral)); color: var(--danger-contrast, #fff); }
.badge-warning{ background: var(--warning, var(--sk-mustard)); color: var(--warning-contrast, var(--sk-ink)); }
.badge-info{ background: var(--info-light, var(--sk-sky)); color: var(--info, #1546d6); }
.badge-secondary{ background: var(--sk-fill); color: var(--text-secondary); }
[data-theme="dark"] .badge-primary{ background: #f3f1ec; color: var(--sk-ink); }
[data-theme="dark"] .badge-success{ color: #7ee2ad; }
[data-theme="dark"] .badge-info{ color: #c9d6e3; }
.alert{
    border: 0 !important;
    border-radius: var(--sk-r-md);
    font-weight: 550;
    color: var(--sk-ink);
}
.alert-success{ background: var(--success-light, var(--sk-mint)); }
.alert-danger,
.alert-error{ background: var(--danger-light, #ffe0dc); }
.alert-warning{ background: var(--warning-light, #fdefb8); }
.alert-info{ background: var(--info-light, var(--sk-sky)); }
.alert-success, .alert-danger, .alert-error, .alert-warning, .alert-info{ color: var(--sk-ink) !important; }
[data-theme="dark"] .alert-success, [data-theme="dark"] .alert-danger, [data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-warning, [data-theme="dark"] .alert-info{ color: #f3f1ec !important; }
[data-theme="dark"] .alert-danger, [data-theme="dark"] .alert-error{ background: rgba(255, 90, 78, .18); }
[data-theme="dark"] .alert-warning{ background: rgba(246, 205, 69, .16); }
.text-danger{ color: var(--sk-coral) !important; }
/* ============================================
   Tables
   ============================================ */
.table-wrapper{
    border: 0;
    border-radius: var(--sk-r);
    box-shadow: var(--sk-shadow);
    background: var(--sk-card);
    overflow: hidden;
}
.table th{
    font-family: var(--sk-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border-bottom: 1px solid var(--sk-hair) !important;
}
.table td{ border-bottom: 1px solid var(--sk-hair) !important; }
.table tbody tr:hover{ background: var(--surface-hover); }
/* ============================================
   Modals
   ============================================ */
.modal-overlay[style*="display: flex"],
.modal-overlay[style*="display:flex"],
.modal-overlay.active,
div.modal > .modal-backdrop{
    background: rgba(17, 18, 22, .45);
    backdrop-filter: blur(6px);
}
.modal-overlay .modal,
.modal-content,
div.modal > .modal-content{
    background: var(--sk-card);
    border: 0;
    border-radius: var(--sk-r-xl);
    box-shadow: var(--sk-shadow-lg);
}
/* v99.2: consistent modal padding across the site. All three modal regions
   share the same 32px horizontal padding so content never sits flush to the
   rounded edges. Vertical rhythm scales with the admin space tokens. */
.modal-header{
    padding: 24px 32px 16px;
    border-bottom: 0;
}
.modal-body{
    padding: 8px 32px 24px;
}
.modal-footer{
    padding: 16px 32px 24px;
    border-top: 1px solid var(--sk-hair);
    background: transparent;
}
/* v133: modal-footer always horizontal with Cancel left + Save right */
.modal-footer{
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center;
    gap: var(--space-sm, 12px);
    flex-wrap: wrap;
}
.modal-footer .btn{ width: auto; }
@media (max-width: 480px) {.modal-header{ padding: 22px 20px 14px; }
.modal-body{ padding: 8px 20px 20px; }
.modal-footer{ padding: 14px 20px 22px; }}
.modal-title{ font-size: 20px; }
.modal-close{
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--sk-fill);
    color: var(--text);
}
.modal-close:hover{ background: var(--sk-chrome); color: var(--sk-chrome-text); }
/* ============================================
   Empty states + loading
   ============================================ */
.empty-state{
    background: var(--sk-card);
    border-radius: var(--sk-r);
    box-shadow: var(--sk-shadow-sm);
    padding: 52px 24px;
    position: relative;
    overflow: hidden;
}
/* orange quarter-circle + mustard dot, Design.io style */
.empty-state::before,
.empty-state::after{
    content: "";
    position: absolute;
    pointer-events: none;
}
.empty-state::before{
    width: 120px; height: 120px;
    right: -40px; bottom: -40px;
    border-radius: 50%;
    background: var(--sk-lavender);
}
.empty-state::after{
    width: 22px; height: 22px;
    left: 28px; top: 26px;
    border-radius: 50%;
    background: var(--sk-mustard);
}
.empty-state > *{ position: relative; z-index: 1; }
/* Only an empty state sitting directly on the page is its own card with shapes;
   inside any panel (cards, modals, the messages sidebar...) it's just content */
.empty-state:not(.page-content > .empty-state, .empty-state-standalone){
    background: transparent;
    box-shadow: none;
    padding: 32px 16px;
}
.empty-state:not(.page-content > .empty-state, .empty-state-standalone)::before,
.empty-state:not(.page-content > .empty-state, .empty-state-standalone)::after{ display: none; }
.empty-state-icon{
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    font-size: 32px;
    color: var(--sk-ink) !important;
    background: var(--sk-mustard);
    border-radius: 50% 50% 50% 12px;
}
.empty-state-title{ font-size: 20px; }
.empty-state-message{ color: var(--text-secondary); }
.spinner{
    border-width: 4px !important;
    border-color: var(--gray-200) !important;
    border-top-color: var(--sk-ink) !important;
}
[data-theme="dark"] .spinner{ border-top-color: var(--sk-lime) !important; }
/* ============================================
   Footer: dark rounded block
   ============================================ */
/* v106: footer link colours now reference tokens (no hardcoded #hex) */
.social-links a{
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.social-links a:hover{ background: var(--sk-lime); color: var(--sk-ink); }
/* v98: thumbnail placeholder background - darker than page bg so the
   "no preview" area on vote/vibe cards is clearly a distinct block. */
.song-card-thumbnail,
.no-preview,
.vote-card .song-card-thumbnail{
    background: #d9d3c4 !important;   /* light mode: 2-3 tones darker than cream page bg */
}
[data-theme="dark"] .song-card-thumbnail,
[data-theme="dark"] .no-preview,
[data-theme="dark"] .vote-card .song-card-thumbnail{
    background: #2d2d31 !important;   /* dark mode: distinct from near-black page bg */
}
/* v99: branded placeholder + platform badge + audio-only player container,
   used by the shared song-tile.js helper so every platform's tile looks and
   behaves like YouTube's thumbnail-first, click-to-play UX. */
.song-card-thumbnail-brand{
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #fff;
}
.song-card-thumbnail-brand-content{
    text-align: center;
    pointer-events: none;
}
.song-card-thumbnail-brand-content i{
    font-size: 44px;
    opacity: .9;
    display: block;
    line-height: 1;
}
.song-card-thumbnail-brand-label{
    font-weight: 700;
    font-size: 13px;
    margin-top: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.song-card-platform{
    position: absolute;
    top: var(--space-sm, 8px);
    left: var(--space-sm, 8px);
    background: rgba(0,0,0,0.65);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    pointer-events: none;
}
.song-card-audio-player{
    background: var(--surface, #fff);
    padding: 8px;
    border-radius: 0;
}
.song-card-audio-player iframe{
    width: 100%;
    display: block;
    border: 0;
    min-height: 166px;
}
[data-theme="dark"] .song-card-audio-player{ background: #1c1c1e; }
/* ============================================
   Home hero + CTA: floating rounded panels
   ============================================ */
.hero-fullwidth{
    /* v138: hero follows the admin page width, not a legacy 1040px cap */
    max-width: var(--page-width, 1400px);
    width: calc(100% - 32px);
    margin: 20px auto 0;
    border-radius: var(--sk-r-xl);
    overflow: hidden;
    box-shadow: var(--sk-shadow-lg);
    position: relative;
}
.hero-fullwidth > .container{ padding: 0 48px; }
.hero-fullwidth + .container.page-content{ padding-top: var(--sk-gap); }
.hero-title{
    font-family: var(--sk-display);
    font-stretch: 125%;
    font-variation-settings: "wdth" 125;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: .98;
}
/* Buttons sitting on a dark/image hero or the gradient CTA */
.hero-with-bg .btn-primary,
.cta-section .btn-primary{ background: var(--sk-lime); color: var(--sk-ink) !important; }
.hero-with-bg .btn-primary:hover:not(:disabled),
.cta-section .btn-primary:hover:not(:disabled){ background: #fff; }
.hero-with-bg .btn-secondary,
.cta-section .btn-secondary{
    background: rgba(255, 255, 255, .12);
    color: #fff !important;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
    backdrop-filter: blur(6px);
}
.hero-with-bg .btn-secondary:hover:not(:disabled),
.cta-section .btn-secondary:hover:not(:disabled){ background: #fff; color: var(--sk-ink) !important; }
.cta-section{
    /* v176: radius dropped from this block - canonical .cta-section rule in
       app.css reads --section-radius now. Leaving a !important override here
       would re-pin it. */
    overflow: hidden;
    position: relative;
    background-image: none !important;
    background-color: var(--sk-chrome) !important;
}
/* Design.io-style shapes in the CTA corners */
.cta-section::before,
.cta-section::after{
    content: "";
    position: absolute;
    pointer-events: none;
}
.cta-section::before{
    width: 220px; height: 220px;
    right: -70px; top: -70px;
    border-radius: 0 0 0 100%;
    background: var(--sk-orange);
}
.cta-section::after{
    width: 140px; height: 140px;
    left: -40px; bottom: -60px;
    border-radius: 50%;
    background: var(--sk-mustard);
}
.cta-section > *{ position: relative; z-index: 1; }
.cta-section h2, .cta-section h3{ color: #fff; }
/* ============================================
   Cookie notice: floating pill card
   ============================================ */
.cookie-notice{
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
    max-width: 760px;
    margin: 0 auto;
    background: var(--sk-chrome) !important;
    color: var(--sk-chrome-text) !important;
    border: 0 !important;
    border-radius: var(--radius-xl, 24px) !important;
    box-shadow: var(--sk-shadow-lg) !important;
}
.cookie-notice a{ color: var(--sk-lime); }
.cookie-notice .btn-primary{ background: var(--sk-lime); color: var(--sk-ink) !important; }
.cookie-notice .btn-secondary{ color: #fff !important; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
/* ============================================
   Mobile
   ============================================ */
/* v98: align every interactive element inside a toolbar/filter-row/tabs to
   the 48px tab height so the pill bar looks visually consistent. The
   containing bar itself picks up whatever outer height from the sum of items
   plus 6px padding, so we don't need to touch the wrapper. */
/* v102: unified 48px height + 17px font-size for every control inside a
   toolbar / filter-row / tabs bar, so pills, selects, search fields and
   buttons all line up visually. font-size pinned here because the global
   rule above would otherwise be overridden by the stripped app.css layout
   rules on very narrow specificity ties. */
.tabs .tab, .tabs button:not(.btn-icon), .toolbar .tab, .toolbar button:not(.btn-icon), .toolbar input:not([type="checkbox"]):not([type="radio"]), .toolbar select, .toolbar .form-select, .toolbar .form-control, .filter-row .tab, .filter-row button:not(.btn-icon), .filter-row input:not([type="checkbox"]):not([type="radio"]), .filter-row select, .filter-row .form-select, .filter-row .form-control{
    height: 48px !important;
    min-height: 48px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 17px !important;
}
/* make the search icon re-centre vertically */
/* v98: drop shadows off on tile/card elements per user request.
   Modals, toasts, dropdowns and search results keep their shadows because
   they rely on elevation to separate from the page content. */
.section, .card, .stat-card, .shootout-card, .achievement-card, .song-card, .home-song-row, .home-newest-card, .buzz-card, .leaderboard-item, .trending-song-item, .vote-card, .section:hover, .card:hover, .stat-card:hover, .shootout-card:hover, .achievement-card:hover, .song-card:hover, .home-song-row:hover, .home-newest-card:hover, .buzz-card:hover, .leaderboard-item:hover, .trending-song-item:hover, .vote-card:hover, .icon-btn:hover, .hero-fullwidth, .hero-contained{
    box-shadow: none !important;
}
@media (max-width: 768px) {:root:root{ --sk-gap: 16px; }
/* Tab-only bars stay one-row pills and scroll sideways instead of wrapping */
.tabs:not(:has(input, select)),
    .toolbar:not(:has(input, select)),
    .filter-row:not(:has(input, select)){
        flex-wrap: nowrap !important;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 6px;
    }
.tabs:not(:has(input, select))::-webkit-scrollbar,
    .toolbar:not(:has(input, select))::-webkit-scrollbar,
    .filter-row:not(:has(input, select))::-webkit-scrollbar{ display: none; }
.tabs:not(:has(input, select)) > *,
    .toolbar:not(:has(input, select)) > *,
    .filter-row:not(:has(input, select)) > *{ flex: 0 0 auto !important; white-space: nowrap; }
/* Bars with search boxes/selects wrap on phones: drop the outer bar so each
       control is its own pill rather than one tall rounded rectangle */
.tabs:has(input, select),
    .toolbar:has(input, select),
    .filter-row:has(input, select){
        background: transparent;
        box-shadow: none;
        padding: 0;
        gap: 8px;
    }
/* Plain wrappers (e.g. a "Following only" checkbox label) become their own pill */
.toolbar:has(input, select) > *:not(input, select, .btn, button, :has(input[type="text"], input[type="search"], select)),
    .filter-row:has(input, select) > *:not(input, select, .btn, button, :has(input[type="text"], input[type="search"], select)){
        background: var(--sk-card);
        border-radius: var(--radius-pill, 999px);
        box-shadow: var(--sk-shadow-sm);
        padding: 4px;
    }
/* Search boxes get a full row instead of being squeezed by buttons/selects */
:is(.toolbar, .filter-row, .tabs) > :is(input[type="text"], input[type="search"]),
    :is(.toolbar, .filter-row, .tabs) > :has(input[type="text"], input[type="search"]){
        flex: 1 1 100% !important;
        max-width: none !important;
    }
:is(.toolbar, .filter-row, .tabs) > :has(input[type="text"], input[type="search"]){
        background: transparent;
        box-shadow: none;
        padding: 0;
    }
:is(.toolbar, .filter-row, .tabs) > :has(input[type="text"], input[type="search"]) input{ width: 100%; }
:is(.toolbar, .filter-row):has(input, select) > *{ max-width: 100%; min-width: 0; flex-wrap: wrap; }
/* Song page action bar holds a Share dropdown, so it wraps into separate
       pills instead of scrolling (a scrolling bar would clip the dropdown) */
.action-toolbar{
        flex-wrap: wrap;
        background: transparent !important;
        box-shadow: none;
        padding: 0 !important;
        gap: 8px;
    }
/* Page-header button rows (e.g. Mark all read / Delete) wrap rather than overflow */
.page-header .flex,
    .page-header > div,
    .notifications-actions,
    .notifications-actions > *{ flex-wrap: wrap; gap: 8px; }
.toolbar:has(input, select) input, .toolbar:has(input, select) select,
    .filter-row:has(input, select) input, .filter-row:has(input, select) select{ background-color: var(--sk-card); box-shadow: var(--sk-shadow-sm); }
.page-content{ padding-top: 28px; padding-bottom: 48px; }
/* app.css runs content edge-to-edge on phones; floating cards need a gutter */
.container.page-content,
    .page-content > .container{ padding-left: 14px; padding-right: 14px; }
.section-header, .card-header{ padding: 20px 20px 4px; }
.section-body, .card-body{ padding: 16px 20px 22px; }
.section-footer, .card-footer{ padding: 14px 20px; }
/* backdrop-filter would make the fixed mobile menu size itself to the header bar */
.nav{ background: var(--sk-card); border-radius: var(--radius-xl, 20px); }
.nav.mobile-open{
        top: 80px;
        left: 8px;
        right: 8px;
        bottom: auto;
        max-height: calc(100dvh - 96px);
        padding: 12px;
        border-radius: var(--radius-xl, 24px);
        box-shadow: var(--sk-shadow-lg);
    }
.nav.mobile-open .nav-link{ font-size: 17px; padding: 14px 18px; }
.nav.mobile-open .nav-dropdown-menu{
        box-shadow: none !important;
        border: 0 !important;
        background: transparent;
        padding: 0 0 0 8px;
    }
.nav.mobile-open .mobile-highlight{
        background: var(--sk-chrome);
        color: var(--sk-chrome-text);
        justify-content: center;
        text-align: center;
        margin-top: 8px;
    }
[data-theme="dark"] .nav.mobile-open .mobile-highlight{ background: #f3f1ec; color: var(--sk-ink); }
.hero-fullwidth{ width: calc(100% - 16px); margin: 12px auto 0; border-radius: var(--section-radius, var(--radius-xl, 24px)); } /* v176: section-radius token */
.hero-fullwidth > .container{ padding: 0 20px; }}
@media (prefers-reduced-motion: reduce) {.btn, .nav-link, .card, .icon-btn, input, select, textarea{ transition: none !important; }}
/* ============================================
   v99: simplified song card (browse, my-songs)
   ============================================
   Compact, scannable, one tap to detail. Everything beyond the essentials
   lives on the song detail page; the card does one job: present the song
   and let the viewer play it or dive in. */
.song-card-simple{
    display: flex;
    flex-direction: column;
    background: var(--surface, var(--sk-card));
    border-radius: 16px;
    /* v99.2: overflow visible so meta-row popovers can escape the card. The
       media tile inside clips its own corners via border-radius + overflow. */
    overflow: visible;
    transition: transform 0.15s, box-shadow 0.15s;
}
.song-card-simple:hover{ box-shadow: 0 6px 18px rgba(0,0,0,0.06); }
/* v126: no hover movement */
.song-card-simple > .song-card-thumbnail,
.song-card-simple > .song-card-thumbnail-brand,
.song-card-simple > .song-card-video-player,
.song-card-simple > .song-card-audio-player{
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
}
.song-card-body-simple{
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
/* Title: compact display face, link in body colour */
.song-card-body-simple .song-title{
    font-family: var(--sk-display);
    font-weight: 900;
    font-stretch: 125%;
    font-variation-settings: "wdth" 125;
    letter-spacing: -0.02em;
    font-size: 16px;
    line-height: 1.2;
    margin: 0;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.song-card-body-simple .song-title a{
    color: inherit;
    text-decoration: none;
}
.song-card-body-simple .song-title a:hover{ color: var(--primary); }
/* Artist line: tight under title */
.song-card-body-simple .song-artist{
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.3;
    margin: 0;
}
.song-card-body-simple .song-artist a{
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}
.song-card-body-simple .song-artist a:hover{ color: var(--text); text-decoration: underline; }
/* Meta row: numbers on the left, one open-arrow icon on the right */
.song-meta-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 8px;
}
.song-meta-items{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 0;
}
.song-meta-item{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1;
    position: relative;
    cursor: default;
}
.song-meta-item i{ font-size: 14px; opacity: 0.85; }
.song-meta-item[tabindex="0"], .song-meta-item.ai-meta{ cursor: help; }
/* Shared stat popover - used by Score, AI breakdown, and any stat-tile */
.song-stat-popover{
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--sk-ink);
    color: #fff;
    padding: 10px 14px;
    border-radius: var(--radius-md, 10px);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    width: max-content;
    max-width: 240px;
    white-space: normal;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.22);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 30;
}
.song-stat-popover::after{
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--sk-ink);
}
.song-meta-item:hover .song-stat-popover,
.song-meta-item:focus .song-stat-popover,
.song-meta-item:focus-within .song-stat-popover{ opacity: 1; }
/* "Open" action - round arrow button */
.song-card-open{
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill, 999px);
    background: var(--sk-fill);
    color: var(--text-muted);
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.15s;
    position: relative;
}
.song-card-open:hover{
    background: var(--primary);
    color: var(--primary-contrast, #fff);
    transform: translateX(2px);
}
.song-card-open-danger:hover{ background: var(--danger); color: var(--danger-contrast, #fff); }
.song-card-owner-actions{
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
/* Inline action icons row on the card */
.song-actions-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.song-actions-icons{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}
.song-action-icon{
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill, 999px);
    background: var(--sk-fill);
    color: var(--text-muted);
    border: 0;
    cursor: pointer;
    text-decoration: none;
    font-size: 15px;
    flex-shrink: 0;
    transition: all 0.15s;
    position: relative;
}
.song-action-icon:hover{
    background: var(--primary-light, rgba(244, 2, 82, 0.12));
    color: var(--primary);
    /* v126: no hover movement */
}
.song-action-icon.is-following,
.song-action-icon.follow-artist-btn.is-following{
    background: var(--primary);
    color: var(--primary-contrast, #fff);
}
.song-action-icon-danger:hover{
    background: var(--danger-light, rgba(239, 68, 68, 0.12));
    color: var(--danger);
}
/* Shared single-line popover tooltips for icons and meta items */
[data-tooltip]{ position: relative; }
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after{
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--sk-ink);
    color: #fff;
    padding: 5px 9px;
    border-radius: var(--radius-sm, 6px);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.18);
    z-index: 20;
    pointer-events: none;
}
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before{
    content: "";
    position: absolute;
    bottom: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--sk-ink);
    z-index: 20;
    pointer-events: none;
}
/* Dark-mode polish */
[data-theme="dark"] .song-meta-item.ai-meta .song-stat-popover,
[data-theme="dark"] [data-tooltip]:hover::after,
[data-theme="dark"] [data-tooltip]:focus-visible::after{ background: #f3f1ec; color: #111216; }
[data-theme="dark"] .song-meta-item.ai-meta .song-stat-popover::after,
[data-theme="dark"] [data-tooltip]:hover::before,
[data-theme="dark"] [data-tooltip]:focus-visible::before{ border-top-color: #f3f1ec; }
@media (max-width: 480px) {.song-card-body-simple{ padding: 10px 12px 12px; }
.song-card-body-simple .song-title{ font-size: 15px; }
.song-card-body-simple .song-artist{ font-size: 12px; }
.song-meta-items{ gap: 10px; font-size: 13px; }
.song-action-icon, .song-card-open{ width: 34px; height: 34px; font-size: 14px; }}
/* ============================================
   v99: form group titles + modern app toggle
   ============================================ */
.form-group-title{
    font-family: var(--sk-body);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 24px 0 8px;
    padding: 0;
}
.form-group-title:first-child{ margin-top: 0; }
.app-toggle-row{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-secondary);
    padding-top: 6px;
}
/* v99.2: bumped selector so these beat the generic
   input[type="checkbox"] { width: 20px; height: 20px } rule in this file -
   without this the toggle rendered as a tiny 20x20 checkbox and never showed
   the slider. */
input.app-toggle[type="checkbox"]{
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 44px !important;
    height: 24px !important;
    background: var(--sk-fill);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill, 999px);
    position: relative;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    margin: 0;
    vertical-align: middle;
    accent-color: initial;
}
input.app-toggle[type="checkbox"]::before{
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.15s, background 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input.app-toggle[type="checkbox"]:checked{
    background: var(--chrome-bg, var(--sk-chrome));
    border-color: var(--chrome-bg, var(--sk-chrome));
}
input.app-toggle[type="checkbox"]:checked::before{
    transform: translateX(20px);
}
input.app-toggle[type="checkbox"]:focus-visible{
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* ============================================
   v99.2: ellipsis view menu (competitions tabs)
   ============================================ */
.comp-view-menu{
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0 4px;
}
.comp-view-toggle{
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill, 999px);
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s, color 0.15s;
}
.comp-view-toggle:hover,
.comp-view-toggle[aria-expanded="true"]{
    background: var(--sk-fill);
    color: var(--text);
}
.comp-view-dropdown{
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    /* v134: context menu reads theme section tokens */
    background: var(--section-bg, var(--sk-card));
    color: var(--section-text, var(--text));
    border: 0;
    border-radius: var(--section-radius, 14px);
    padding: 6px;
    box-shadow: var(--sk-shadow-lg, 0 10px 30px rgba(0,0,0,0.12));
    /* v99.2: 10000 so it beats toolbars, nav, card hover shadows and anything
       else that might create a stacking context above it. Parent menu wrapper
       also gets isolation + a high stacking priority below. */
    z-index: 10000;
}
.comp-view-menu{
    position: relative;
    /* v104: isolation removed so the dropdown's z-index 10000 escapes to the
       document stacking context instead of being scoped under this menu. */
    z-index: 50;
}
/* v104: any toolbar or tab bar containing an ellipsis menu outranks the
   neighbouring cards/grids below it, so the dropdown always renders above
   them even when the card creates its own stacking context. */
.toolbar:has(.comp-view-menu),
.tabs:has(.comp-view-menu),
.filter-row:has(.comp-view-menu){
    position: relative;
    z-index: 100;
}
/* v104: and for good measure, pin the dropdown itself onto a very high layer
   when open; this also helps if the menu lands inside a transformed card. */
.comp-view-dropdown[data-open="true"],
.comp-view-menu.open .comp-view-dropdown{
    z-index: 100000 !important;
}
.comp-view-item{
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-md, 10px);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}
.comp-view-item:hover{ background: var(--sk-fill); }
.comp-view-item i.fa-check{
    width: 14px;
    opacity: 0;
    color: var(--primary);
}
.comp-view-item.active i.fa-check{ opacity: 1; }
.comp-view-item.active{ color: var(--text); font-weight: 700; }
/* v100: toolbar layout - .toolbar-controls shoves the search to the far right
   so toolbars with tabs + controls (competitions page) do not stack. */
.toolbar > .toolbar-controls{
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 1;
    min-width: 0;
}
/* v102: give search fields room to breathe. In a toolbar (or filter-row) the
   search field grows up to 560px; selects stay at their natural width and
   never shrink. Overrides any inline flex set per page. */
.toolbar > select,
.toolbar > .form-select,
.filter-row > select,
.filter-row > .form-select{
    flex-shrink: 0;
}
@media (max-width: 640px) {.toolbar > .toolbar-controls{
        margin-left: 0;
        width: 100%;
    }}
/* ============================================================
   v103: Design-system centre of truth
   Component tokens wire through to the admin Theme tab. Every rule
   below reads --section-*, --tile-*, --input-*, --button-*, --pill-*,
   --alert-*, --page-*, --navbar-*, --footer-* which are emitted by
   Theme.php and pushed live by the Theme admin preview.
   Each rule falls back to the pre-v103 var so pages without Theme
   coverage still render.
   ============================================================ */
/* v110: container caps page width (no !important so pages with narrower containers keep theirs) */
.container{
    max-width: var(--page-width, 1400px);
    padding-left: var(--page-padding, 24px);
    padding-right: var(--page-padding, 24px);
}
/* v110: Sections + cards. Base radius + background come from the section tokens
   with a safe fallback to the pre-v103 radius-lg. NO forced padding/font-size/
   gap overrides on EVERY section/card - those were stomping per-page layouts.
   The hover-bg rule was also removed because it made every card flash on hover
   even when admin had not set a hover colour. */
.section,
.card{
    border-radius: var(--section-radius, var(--radius-lg, 16px));
    background: var(--section-bg, var(--surface, #ffffff));
    color: var(--section-text, var(--text, #111216));
}
/* opt-in - a page can add class="themed" to also pick up admin padding + gap + font-size */
.section.themed,
.card.themed{
    padding: var(--section-padding, 24px);
    gap: var(--section-gap, 16px);
    font-size: var(--section-font-size, 16px);
}
/* v117: section hover works by default again. Admin pick of @none on
   Theme > Sections > Hover background resolves (via resolveHoverColor) to the
   same value as --section-bg, so hover is silent - no visible change. Any
   other pick tints the surface on hover. */
/* v140: section hover removed - sections never need a hover state */
/* v110: Tile token hookup. Only .stat-card gets the theme bg by default
   (stat tiles ARE the feature-cycle surface). Song cards + home-newest-cards
   keep their original surface look unless they opt in via .themed-tile. No
   !important anywhere so per-page tile customisations still win. */
.stat-card{
    border-radius: var(--tile-radius, var(--radius-lg, 16px));
    background: var(--tile-bg, var(--surface, #ffffff));
    color: var(--tile-text, var(--text, #1f2937));
    padding: var(--tile-padding, 16px);
    font-size: var(--tile-font-size, 14px);
}
.song-card.themed-tile,
.home-newest-card.themed-tile{
    border-radius: var(--tile-radius, var(--radius-lg, 16px));
    background: var(--tile-bg, var(--surface, #ffffff));
    color: var(--tile-text, var(--text, #1f2937));
    padding: var(--tile-padding, 16px);
    font-size: var(--tile-font-size, 14px);
}
.stat-card.has-hover-bg:hover,
.song-card.themed-tile.has-hover-bg:hover,
.home-newest-card.themed-tile.has-hover-bg:hover{
    background: var(--tile-hover-bg, var(--tile-bg, var(--surface, #ffffff)));
}
/* Inputs + selects: input tokens. The v102 global rule stays for colour
   consistency; v103 tokens drive radius + size + horizontal padding here. */
html .form-input, html .form-select, html .form-control, html input[type="text"], html input[type="email"], html input[type="password"], html input[type="number"], html input[type="url"], html input[type="tel"], html input[type="search"], html input[type="date"], html input[type="time"], html input[type="datetime-local"], html textarea{
    border-radius: var(--input-radius, 12px);
    font-size: var(--input-font-size, 17px);
    /* v108: split left + right so selects can keep chevron-room via a dedicated
       rule below without having their full padding overwritten by var(--input-padding). */
    padding-left: var(--input-padding-left, 18px);
    padding-right: var(--input-padding-right, 18px);
    color: var(--input-text-token, var(--text, #111216));
}
/* v131: textareas get vertical padding too so they aren't flush top/bottom */
html textarea{
    padding-top: var(--input-padding-y, 14px);
    padding-bottom: var(--input-padding-y, 14px);
}
/* v108: selects always keep room for the custom chevron SVG. */
html select,
html .form-select{
    padding-left: var(--input-padding-left, 18px);
    padding-right: 46px !important;
    font-size: var(--input-font-size, 17px);
    border-radius: var(--input-radius, 12px);
    color: var(--input-text-token, var(--text, #111216));
}
html .form-input:focus,
html .form-select:focus,
html input:focus,
html select:focus{
    border-color: var(--input-border-token, var(--text, #111216));
}
/* Buttons: button tokens. */
.btn{
    border-radius: var(--button-radius, 12px);
    font-size: var(--button-font-size, 15px);
    padding: var(--button-padding, 0 14px);
}
.btn-primary{
    background: var(--button-bg, var(--primary, #40026f));
    color: var(--button-text, var(--primary-contrast, #ffffff));
}
.btn-primary:hover{
    background: var(--button-hover-bg, var(--primary-hover, var(--primary, #40026f)));
    color: var(--button-text, var(--primary-contrast, #ffffff));
}
/* Pills (.tab + .badge): pill tokens. */
.tab,
.badge{
    font-size: var(--pill-font-size, 14px);
    padding: var(--pill-padding, 0 12px);
}
.tab.active,
.badge-primary{
    background: var(--pill-bg, var(--primary, #40026f));
    color: var(--pill-text, var(--primary-contrast, #ffffff));
}
.tab:hover,
.badge:hover{
    background: var(--pill-hover-bg, var(--pill-bg, var(--primary, #40026f)));
    color: var(--pill-text, var(--primary-contrast, #ffffff));
}
/* Alerts: radius + font + padding + text come from alert tokens; background
   is the semantic colour (success/warning/danger/info) tinted by alpha so
   the page background can show through. */
.alert{
    border-radius: var(--alert-radius, 12px);
    font-size: var(--alert-font-size, 15px);
    padding: var(--alert-padding, 16px);
    color: var(--alert-text, var(--text, #1f2937));
}
.alert-success{
    background: color-mix(in srgb, var(--utility-success, var(--success, #10b981)) calc(var(--alert-bg-alpha, 0.15) * 100%), transparent);
    border-color: var(--utility-success, var(--success, #10b981));
}
.alert-warning{
    background: color-mix(in srgb, var(--utility-warning, var(--warning, #f59e0b)) calc(var(--alert-bg-alpha, 0.15) * 100%), transparent);
    border-color: var(--utility-warning, var(--warning, #f59e0b));
}
.alert-danger{
    background: color-mix(in srgb, var(--utility-danger, var(--danger, #ef4444)) calc(var(--alert-bg-alpha, 0.15) * 100%), transparent);
    border-color: var(--utility-danger, var(--danger, #ef4444));
}
.alert-info{
    background: color-mix(in srgb, var(--utility-info, var(--info, #3b82f6)) calc(var(--alert-bg-alpha, 0.15) * 100%), transparent);
    border-color: var(--utility-info, var(--info, #3b82f6));
}
/* v125: .header / .footer outer elements kept transparent (they are positioning
   wrappers). The admin tokens apply to the inner pills: .header-inner + .footer-inner. */
.main-nav, .site-header{ background: transparent; }
/* Brand palette aliases: so pre-v103 CSS that reads --primary / --secondary
   keeps working even when admin only picks brand-primary / brand-secondary. */
:root{
    --primary: var(--brand-primary, #40026f);
    --secondary: var(--brand-secondary, #f40252);
    /* v109: let --text and --surface fall back to the brand foreground / background
       anchors so any component that still reads --text / --surface stays consistent
       with whatever admin picks on the Brand tab. */
    --text: var(--brand-foreground, #1f2937);
    --surface: var(--brand-background, #ffffff);
    /* v119: the skin-style card + fill tokens also follow brand-background so every
       component in the site - cards, sections, tiles, badges, chip backgrounds -
       pulls from the single admin-controlled anchor. sk-fill stays "a hair darker
       than the card" by mixing a touch of brand-foreground into it. */
    --sk-card: var(--brand-background, #ffffff);
    --sk-fill: color-mix(in srgb, var(--brand-background, #ffffff) 94%, var(--brand-foreground, #1f2937) 6%);
    --primary-contrast: var(--brand-primary-contrast, #ffffff);
    --secondary-contrast: var(--brand-secondary-contrast, #ffffff);
    --primary-dark: var(--brand-primary-bold, #30014f);
    --primary-light: var(--brand-primary-light, #e8ccff);
    --primary-hover: var(--brand-primary-bold, #30014f);
    --tile-1: var(--feature-01, #d4ff4b);
    --tile-2: var(--feature-02, #ffb3d1);
    --tile-3: var(--feature-03, #a8d8ff);
    --tile-4: var(--feature-04, #ffd93d);
    --success: var(--utility-success, #10b981);
    --warning: var(--utility-warning, #f59e0b);
    --danger: var(--utility-danger, #ef4444);
    --info: var(--utility-info, #3b82f6);
}
/* Brand tab helpers: the little bold/light/contrast shade swatches below each
   primary/secondary picker. */
.brand-shade{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}
.brand-shade-swatch{
    display: block;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border);
}
.brand-swatch{
    border: 1px solid var(--border);
}
/* Brand-ref picker (two-mode: dropdown + color input) spacing. */
/* v117: brand-ref picker is now [SWATCH][dropdown] only - one swatch, not two.
   The styled swatch on the left is the single visual indicator (checker for
   transparent, gradient for cycle, hatch for none, hex for everything else).
   When the mode is Custom, clicking the swatch opens the native colour picker
   (the native input is kept in the DOM but hidden). */
.brand-ref-picker{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.brand-ref-picker .brand-ref-swatch{
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--input-radius, 10px);
    background-color: #ffffff;
    background-image: linear-gradient(45deg, rgba(0,0,0,.06) 25%, transparent 25%),
                      linear-gradient(-45deg, rgba(0,0,0,.06) 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, rgba(0,0,0,.06) 75%),
                      linear-gradient(-45deg, transparent 75%, rgba(0,0,0,.06) 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    overflow: hidden;
    position: relative;
    cursor: default;
}
.brand-ref-picker.is-custom .brand-ref-swatch{ cursor: pointer; }
.brand-ref-picker.is-custom .brand-ref-swatch:hover{ box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #40026f) 30%, transparent); }
.brand-ref-picker .brand-ref-swatch::after{
    content: '';
    position: absolute;
    inset: 0;
    background: var(--swatch-fill, transparent);
}
.brand-ref-picker .brand-ref-mode{
    flex: 1 1 auto;
    min-width: 0;
    max-width: 240px;
    height: 44px;
}
.brand-ref-picker .brand-ref-color{
    /* v117: native colour input hidden - swatch is the trigger */
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.brand-slider-value{ color: var(--text-muted); font-size: 13px; }
/* ============================================================
   v104: Simple HTML post editor (watercooler new topic + replies)
   ============================================================ */
.post-editor{
    border: 1px solid var(--border);
    border-radius: var(--input-radius, 12px);
    background: var(--input-bg, #ffffff);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}
.post-editor-tabs{
    display: flex;
    gap: 2px;
    padding: 8px 8px 0;
    background: var(--input-bg, #ffffff);
    border-bottom: 1px solid var(--border);
}
.post-editor-tab{
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm, 8px) 8px 0 0;
    transition: background 0.15s, color 0.15s;
}
.post-editor-tab:hover{ color: var(--text); }
.post-editor-tab.active{
    color: var(--text);
    background: var(--sk-fill, #f2efe9);
}
.post-editor-toolbar{
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 8px;
    background: var(--sk-fill, #f2efe9);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.post-editor-toolbar button{
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm, 6px);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s, color 0.1s;
}
.post-editor-toolbar button:hover{
    background: var(--input-bg, #ffffff);
    color: var(--text);
}
.post-editor-sep{
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}
.post-editor-surface,
.post-editor-preview{
    flex: 1;
    min-height: 360px;
    padding: 20px 24px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    overflow-y: auto;
    outline: none;
    resize: vertical;
}
.post-editor-surface:focus{ outline: none; }
.post-editor-surface h2,
.post-editor-preview h2{ font-size: 1.4rem; margin: 1em 0 0.4em; }
.post-editor-surface h3,
.post-editor-preview h3{ font-size: 1.15rem; margin: 1em 0 0.4em; }
.post-editor-surface blockquote,
.post-editor-preview blockquote{
    border-left: 3px solid var(--primary, #40026f);
    padding: 4px 14px;
    margin: 12px 0;
    color: var(--text-secondary);
    font-style: italic;
}
.post-editor-surface pre,
.post-editor-preview pre{
    background: var(--sk-fill, #f2efe9);
    padding: 12px 14px;
    border-radius: var(--radius-sm, 8px);
    overflow-x: auto;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 14px;
}
.post-editor-surface a,
.post-editor-preview a{
    color: var(--primary, #40026f);
    text-decoration: underline;
}
.post-editor-source{
    display: none !important;
}
/* v110: Tile colour cycle - stat tiles only (song cards + home newest cards
   kept their surface look). No more !important sweeping every tile class. */
:root[data-tile-mode="cycle"] .stat-card:nth-child(4n+1){ background: var(--feature-01); }
:root[data-tile-mode="cycle"] .stat-card:nth-child(4n+2){ background: var(--feature-02); }
:root[data-tile-mode="cycle"] .stat-card:nth-child(4n+3){ background: var(--feature-03); }
:root[data-tile-mode="cycle"] .stat-card:nth-child(4n+4){ background: var(--feature-04); }
/* ============================================================
   v106/v109: Table tokens - every <table> and .table on the site goes through
   the single --table-* set emitted by Theme.php. Admins pick once in
   Theme > Tables and admin, forum, stats and dashboard tables all match.

   v109: the radius + overflow:hidden MUST live on the wrapper, not on the
   table itself - no browser clips th/td corners against a rounded <table>,
   so the admin-set radius had no visible effect. .table-wrapper does the
   clipping, .table stays rectangular inside. For pages that render a bare
   <table> with no wrapper the final rule gives the table itself the radius +
   border so the look still holds (one-pixel compromise on the inner corners).
   ============================================================ */
.table-wrapper{
    border-radius: var(--table-radius, 10px);
    overflow: hidden;
    border: 1px var(--table-border-style, solid) var(--table-border-color, var(--border));
    background: var(--section-bg, var(--surface, #ffffff));
}
table,
.table{
    border-collapse: separate;
    border-spacing: 0;
}
/* A bare <table> not wrapped in .table-wrapper still gets the radius, with the
   known border-radius-vs-table quirk accepted. */
table:not(.table-wrapper > table):not(.table-wrapper table){
    border-radius: var(--table-radius, 10px);
    overflow: hidden;
    border: 1px var(--table-border-style, solid) var(--table-border-color, var(--border));
}
table thead,
.table thead{
    background: var(--table-header-bg, var(--primary, #40026f));
}
table th,
.table th{
    background: var(--table-header-bg, var(--primary, #40026f)) !important;
    color: var(--table-header-text, #ffffff) !important;
    font-size: var(--table-header-size, 12px);
    font-weight: var(--table-header-weight, 700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px var(--table-border-style, solid) var(--table-border-color, var(--border));
}
table td,
.table td{
    border-bottom: 1px var(--table-border-style, solid) var(--table-border-color, var(--border));
    background: transparent;
}
/* Zebra stripes: --table-zebra-bg is 'transparent' when admin toggle is off,
   or a tinted version of the hover colour at low alpha when on. */
table tbody tr:nth-child(even) td,
.table tbody tr:nth-child(even) td{
    background: var(--table-zebra-bg, transparent);
}
table tbody tr:hover td,
.table tbody tr:hover td{
    background: var(--table-row-hover-bg, var(--sk-fill)) !important;
}
/* v106: Post editor additions - Edit HTML view + theme colour menu */
.post-editor-html{
    flex: 1;
    min-height: 360px;
    padding: 16px 20px;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text);
    background: var(--input-bg, #ffffff);
    border: 0;
    outline: none;
    resize: vertical;
    white-space: pre;
    tab-size: 2;
}
.post-editor-color-wrap{
    position: relative;
    display: inline-block;
}
.post-editor-color-menu{
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 100;
    background: var(--surface, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
}
.post-editor-color-item{
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 10px;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm, 6px);
    color: var(--text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.post-editor-color-item:hover{ background: var(--sk-fill, #f2efe9); }
.pe-swatch{
    width: 18px;
    height: 18px;
    border-radius: var(--radius-xs, 4px);
    display: inline-block;
    flex-shrink: 0;
}
/* ============================================================
   v107: Layout widths (header/content/footer) + tile icons + heading spacing
   ============================================================ */
/* The header is a full-bleed strip by default (background covers the viewport)
   with its CONTENT capped by --header-width. Admins can also cap the bg via
   --header-bg-width to make the strip narrower. */
.main-nav, .site-header{
    width: 100%;
    max-width: var(--header-bg-width, 100%);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
}
/* v125: max-width is set directly on .header-inner in the main rule above.
   Only keep the margin-auto so .header-inner centres inside .header. */
/* Same model for the footer */
/* Content width: a tighter cap INSIDE sections for prose + tables. Pages that
   want to use it wrap content in a .content-width wrapper. Defaults keep the
   full width, admins pick a narrower content-width in Theme > Page. */
.content-width{
    max-width: var(--content-width, var(--page-width, 1400px));
    margin-left: auto;
    margin-right: auto;
}
/* v110: Tile icon default - OPT-IN via .tile-icon / .stat-icon / [data-tile-icon].
   The earlier rule grabbed every <i> inside .song-card etc., which painted
   play-button overlays, review action icons and tooltips with the dark-pill
   treatment. Now a page puts .tile-icon on an icon only when it wants the
   look, so nothing changes by default. */
.stat-card .tile-icon,
.stat-card .stat-icon,
.song-card .tile-icon,
.home-newest-card .tile-icon,
[data-tile-icon]{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md, 12px);
    background: color-mix(in srgb, var(--tile-bg, #fff) 65%, #000);
    color: var(--tile-text, #fff);
    margin-bottom: 10px;
    font-size: 18px;
}
/* v110: Admin heading + spacing standardisation - SCOPED to body.admin-page
   (set by admin and branding pages below). Public pages keep their original
   rhythm because the earlier blanket rule was retyping every h1-h5 on every
   .page-content across the whole site. */
body.admin-page .page-content h1,
body.admin-page .page-content h2,
body.admin-page .page-content h3,
body.admin-page .page-content h4,
body.admin-page .page-content h5,
body.admin-page .page-content .section-title,
body.admin-page .page-content .card-title,
body.admin-page .section-body .form-group-title{
    margin-top: var(--heading-top-margin, 18px);
    margin-bottom: 10px;
}
body.admin-page .page-content > :first-child,
body.admin-page .section-body > :first-child,
body.admin-page .card-body > :first-child,
body.admin-page .section-header > :first-child{
    margin-top: 0;
}
/* v115: removed the body.admin-page section/section-body padding overrides -
   they were forcing fixed 18px/20px padding on every admin section, stomping
   on the admin-set --section-padding token. Admin pages now follow the same
   token system as public pages. Form-group margin-bottom kept though. */
body.admin-page .page-content .form-group{
    margin-bottom: 14px;
}
/* ============================================================
   v112: vertical padding + nav + page margin tokens.
   Horizontal is already covered by --*-padding; these layer on vertical.
   ============================================================ */
body{ padding-bottom: var(--page-margin-bottom, 0); }
.page-content{ padding-top: var(--page-margin-top, 0); }
.header{ margin-top: var(--nav-margin-top, 0); }
/* v125: padding now set on .header-inner directly in the main rule above */
/* v153: removed duplicate .footer-inner padding rule - canonical rule above is the single source */
/* v115: Section tokens now apply directly to the padding carriers
   (.section-header / .section-body / .card-header / .card-body) instead of
   a dead .themed gate. Admins picking Section horizontal + vertical padding
   on the Theme tab now actually reshape every section on every page. */
.section > .section-header,
.card > .card-header,
.section > .section-body,
.card > .card-body,
.section > .section-footer,
.card > .card-footer{
    padding: var(--section-padding-y, 20px) var(--section-padding, 28px);
}
.stat-card{
    padding: var(--tile-padding-y, 16px) var(--tile-padding, 16px);
}
html .form-input, html .form-select, html .form-control,
html input[type="text"], html input[type="email"], html input[type="password"],
html input[type="number"], html input[type="url"], html input[type="tel"],
html input[type="search"], html input[type="date"], html input[type="time"],
html input[type="datetime-local"], html textarea{
    padding-top: var(--input-padding-y, 0);
    padding-bottom: var(--input-padding-y, 0);
}
.btn{ padding-top: var(--button-padding-y, 0); padding-bottom: var(--button-padding-y, 0); }
.tab, .badge{ padding-top: var(--pill-padding-y, 0); padding-bottom: var(--pill-padding-y, 0); }
.alert{ padding-top: var(--alert-padding-y, 14px); padding-bottom: var(--alert-padding-y, 14px); }
/* ============================================================
   v118: Canonical section-header framework (universal).
   Every section on every page renders identically through ONE structure:

     .section-header
       .section-head               <- title + subtitle group (always)
         h3.section-title
         p.section-subtitle        <- optional
       .section-head-actions       <- optional, right-aligned action buttons

   Flex row with title-group flexing fully and action-group pinned right.
   No admin-page scoping, no !important - this is the base rule for every
   section-header, so inconsistencies are impossible.
   ============================================================ */
.section-header{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.section-header > .section-head{
    flex: 1 1 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.section-header > .section-head > .section-title{ margin: 0; }
.section-header > .section-head > .section-subtitle{ margin: 0; color: var(--text-muted); font-size: 14px; }
.section-header > .section-head-actions{
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
/* Admin pages: form-group + number input constraints kept from v114 */
body.admin-page .page-content .form-group{ align-self: start; }
body.admin-page .page-content input[type="number"]{ max-width: 120px; }
/* ============================================================
   v116: Tab bar container tokens - .tabs, .toolbar, .filter-row.
   Pills inside still read --pill-* separately.
   ============================================================ */
.tabs,
.toolbar,
.filter-row{
    border-radius: var(--tabbar-radius, 999px);
    background: var(--tabbar-bg, var(--surface, #ffffff));
    padding: var(--tabbar-padding, 6px);
    gap: var(--tabbar-gap, 6px);
}
/* ============================================================
   v117: Navbar link + footer link styling tokens
   ============================================================ */
.nav-link, .nav-dropdown-toggle{
    color: var(--navbar-link, var(--chrome-text, var(--text, #111216)));
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-dropdown-toggle:hover{
    background: var(--navbar-link-hover-bg, transparent);
    color: var(--navbar-link-hover, var(--brand-primary, #40026f));
}
.nav-link.active{
    background: var(--navbar-active-bg, var(--brand-primary, #40026f));
    color: var(--navbar-active-text, #ffffff);
}
/* ============================================================
   v122: Weight tokens wired through to components
   ============================================================ */
h1, h2, h3, .page-title{
    font-weight: var(--heading-weight, 700);
}
.section-title, .card-title{
    font-weight: var(--section-title-weight, 600);
}
.btn, button.btn, a.btn{
    font-weight: var(--button-weight, 650);
}
.tab, .badge{
    font-weight: var(--pill-weight, 600);
}
/* ============================================================
   v123: navbar readability (blur + scrim) + icon controls + tab item
   radius + section header-body gap token
   ============================================================ */
/* v125: scrim + blur now anchor to .header-inner (the visible pill) so they
   actually apply where the nav background shows. The outer .header stays a
   transparent positioning wrapper. */
/* Icon size + colour tokens */
.nav-icon-link, .nav-icon-link i{
    font-size: var(--navbar-icon-size, 20px);
    color: var(--navbar-icon, var(--navbar-link, var(--chrome-text, inherit)));
}
.nav-icon-link:hover, .nav-icon-link:hover i{
    color: var(--navbar-icon-hover, var(--navbar-link-hover, var(--brand-primary, #40026f)));
}
/* Section header bottom gap - the space under intro text */
.section > .section-header,
.card > .card-header{
    padding-bottom: var(--section-head-bottom-gap, 8px) !important;
}
/* ============================================================
   v124: Canonical .page-header rhythm + page title/subtitle flow.
   Every page that uses <div class="page-header"><h1 class="page-title">
   + <p class="page-subtitle"></div> picks up the same vertical rhythm.
   ============================================================ */
.page-content .page-header{
    margin: 0 0 var(--section-gap, 20px);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.page-content .page-header .page-title,
.page-content h1.page-title{
    margin: 0;
    line-height: 1.1;
}
.page-content .page-header .page-subtitle,
.page-content p.page-subtitle{
    margin: 0;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.5;
    max-width: 68ch;
}
/* ============================================================
   v131: Canonical .page-header with actions on the right.
   Pattern:
     <div class="page-header">
       <div class="page-header-main">
         <h1 class="page-title">...</h1>
         <p class="page-subtitle">...</p>
       </div>
       <div class="page-header-actions">...</div>
     </div>
   The :has() switches direction to row with actions on the right.
   ============================================================ */
.page-content .page-header:has(.page-header-actions){
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md, 16px);
}
.page-content .page-header .page-header-main{
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}
.page-content .page-header .page-header-actions{
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex: 0 0 auto;
}
/* v124: footer never bleeds edge-to-edge regardless of legacy saved value.
   Falls back to --page-width when --footer-bg-width is unset. */
/* ============================================================
   v126: page entry animation + dropdown spacing + search/select theming
   ============================================================ */
/* Page fade-in on load */
@keyframes page-in {from{ opacity: 0; transform: translateY(6px); }
to{ opacity: 1; transform: translateY(0); }}
.site-wrapper{
    animation: page-in 0.24s ease-out both;
}
/* Staggered children on grid containers */
@keyframes stagger-in {from{ opacity: 0; transform: translateY(8px); }
to{ opacity: 1; transform: translateY(0); }}
.song-grid > *, .stats-grid > *, .stats-grid-3 > *, .playlists-grid > *{
    animation: stagger-in 0.25s ease-out both;
}
.song-grid > :nth-child(1), .stats-grid > :nth-child(1), .stats-grid-3 > :nth-child(1), .playlists-grid > :nth-child(1){ animation-delay: 0ms; }
.song-grid > :nth-child(2), .stats-grid > :nth-child(2), .stats-grid-3 > :nth-child(2), .playlists-grid > :nth-child(2){ animation-delay: 40ms; }
.song-grid > :nth-child(3), .stats-grid > :nth-child(3), .stats-grid-3 > :nth-child(3), .playlists-grid > :nth-child(3){ animation-delay: 80ms; }
.song-grid > :nth-child(4), .stats-grid > :nth-child(4), .stats-grid-3 > :nth-child(4), .playlists-grid > :nth-child(4){ animation-delay: 120ms; }
.song-grid > :nth-child(5), .playlists-grid > :nth-child(5){ animation-delay: 160ms; }
.song-grid > :nth-child(6), .playlists-grid > :nth-child(6){ animation-delay: 200ms; }
@media (prefers-reduced-motion: reduce) {.site-wrapper, .song-grid > *, .stats-grid > *, .stats-grid-3 > *, .playlists-grid > *{
        animation: none !important;
    }}
/* v127: Nav dropdown item spacing - padding + item gap WITHOUT overriding
   display/visibility. The base skin keeps display: none and switches to block
   on hover; adding display: flex here made every menu render permanently. */
.nav-dropdown-menu{
    padding: 8px;
}
.nav-dropdown-menu > .nav-dropdown-item{
    margin: 0;
}
.nav-dropdown-menu > .nav-dropdown-item + .nav-dropdown-item{
    margin-top: 4px;
}
/* Search bar + toolbar selects fully token-driven (v126 + v127 fix).
   v127: background-color instead of background shorthand so the chevron SVG
   that lives in background-image on selects doesn't get wiped. */
/* v184: exclude .search-field-input so search fields can own their own
   horizontal padding (they need 48px left to clear the icon). Also dropped
   !important from every declaration: the selector itself is specificity
   (0, 4, 1) which is high enough to win against the global input rules in
   app.css (0, 1, 1) and (0, 1, 2), so the !important was belt-and-braces. */
.toolbar input:not([type="checkbox"]):not([type="radio"]):not(.search-field-input), .toolbar select, .toolbar .form-select, .toolbar .form-control, .filter-row input:not([type="checkbox"]):not([type="radio"]):not(.search-field-input), .filter-row select, .filter-row .form-select, .filter-row .form-control{
    background-color: var(--input-bg-token, var(--input-bg, #ffffff));
    color: var(--input-text-token, var(--text, #111216));
    border-radius: var(--input-radius, 999px);
    font-size: var(--input-font-size, 17px);
    padding-left: var(--input-padding-left, 18px);
    padding-right: var(--input-padding-right, 18px);
}
/* search-field keeps its icon padding */
/* selects keep chevron padding */
.toolbar select, .toolbar .form-select,
.filter-row select, .filter-row .form-select{
    padding-right: 46px !important;
}
/* ============================================================
   v129: Thumbnail radii tokens (list / card / avatar)
   ============================================================ */
.trending-song-thumb,
.home-song-thumb,
.home-song-thumb-brand{
    border-radius: var(--thumb-list-radius, 6px) !important;
}
.song-card-thumbnail,
.sotd-thumbnail,
.playlist-cover{
    border-radius: var(--thumb-card-radius, 12px) !important;
    overflow: hidden;
}
.avatar,
.band-logo,
.user-avatar,
.author-avatar,
.mini-avatar{
    border-radius: var(--avatar-radius, 50%) !important;
}
/* v129.1: logo size tokens + icon active state */
.footer-logo-image{ height: var(--footer-logo-size, 48px); }
/* v129.1: nav-icon-link active state wired through token */
.nav-icon-link.active,
.nav-icon-link.is-active,
.nav-icon-link[aria-current="page"]{
    background: var(--navbar-active-bg, var(--brand-primary, #40026f)) !important;
    color: var(--navbar-active-text, #ffffff) !important;
}
.nav-icon-link.active i,
.nav-icon-link.is-active i,
.nav-icon-link[aria-current="page"] i{
    color: var(--navbar-active-text, #ffffff) !important;
}
/* v136: forum/watercooler uses full page-width - sidebar layout handles reading comfort */
/* v134: canonical tab + pill token wiring — these win over earlier rules
   (same specificity, later in the cascade) and use the real theme tokens
   so changes in admin > Theme > Pills + Tab bars apply everywhere. */
.tab,
.tabs > button:not(.btn):not(.btn-icon),
.filter-row > button:not(.btn):not(.btn-icon),
.toolbar > button:not(.btn):not(.btn-icon){
    background: transparent;
    color: var(--pill-text-muted, var(--text-secondary));
    font-size: var(--pill-font-size, 14px);
    padding-left: var(--pill-padding-x, 14px);
    padding-right: var(--pill-padding-x, 14px);
    border: 0;
    transition: background .15s, color .15s;
}
.tab:hover,
.tabs > button:not(.btn):not(.btn-icon):hover,
.filter-row > button:not(.btn):not(.btn-icon):hover,
.toolbar > button:not(.btn):not(.btn-icon):hover{
    background: var(--pill-hover-bg, var(--sk-fill, color-mix(in srgb, var(--pill-bg, var(--primary)) 20%, transparent)));
    color: var(--pill-text, var(--text));
}
.tab.active,
.tabs > button.active:not(.btn):not(.btn-icon),
.filter-row > button.active:not(.btn):not(.btn-icon),
.toolbar > button.active:not(.btn):not(.btn-icon){
    background: var(--pill-bg, var(--primary, #40026f));
    color: var(--pill-text, var(--primary-contrast, #ffffff));
}
/* v134: playlist page uses section tokens instead of hardcoded background */
.songs-section{
    background: var(--section-bg, var(--sk-card, var(--surface))) !important;
    color: var(--section-text, var(--text));
    border-radius: var(--section-radius, var(--radius-lg)) !important;
}
.songs-header{
    padding: var(--section-padding-y, 16px) var(--section-padding, 20px) !important;
    border-bottom: 1px solid var(--sk-hair, var(--border)) !important;
}
.playlist-cover-large{
    border-radius: var(--thumb-card-radius, var(--section-radius, var(--radius-lg))) !important;
}
.playlist-cover-large img{
    border-radius: var(--thumb-card-radius, var(--section-radius, var(--radius-lg))) !important;
}
/* v135: canonical sitewide search field. Every search input across the site
   uses <div class="search-field"><i class="...search-field-icon"></i>
   <input class="search-field-input"></div>, and this block paints them so
   they match everywhere and follow the admin Theme > Text Inputs tokens. */
/* v136: Backstage (forum) two-column layout. Main column holds the topics
   list, sidebar holds the search form, categories and context copy. */
.wc-layout{
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--section-gap, 24px);
    align-items: start;
}
@media (max-width: 960px) {.wc-layout{ grid-template-columns: 1fr; }
.wc-sidebar{ order: -1; }}
.wc-sidebar{
    display: flex;
    flex-direction: column;
    gap: var(--section-gap, 16px);
    position: sticky;
    top: 96px;
}
.wc-sidebar .section-body{
    padding: var(--section-padding, 20px);
}
.wc-sidebar .section-title{ font-size: 15px; }
.wc-search-form{
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.wc-cats{
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wc-cats .wc-cat{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: var(--pill-radius, 8px);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.wc-cats .wc-cat:hover{
    background: var(--sk-fill);
    color: var(--text);
}
.wc-cats .wc-cat.active{
    background: var(--pill-bg, var(--primary));
    color: var(--pill-text, #fff);
}
.wc-cats .wc-cat-count{
    font-size: 12px;
    opacity: 0.7;
}
.wc-cats .wc-cat.active .wc-cat-count{ opacity: 0.85; }
.wc-about-copy p{ margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.wc-about-copy p:last-child{ margin-bottom: 0; }
/* v136: modal-overlay base always fixed + inset 0 so .active always
   centres on the VIEWPORT, not somewhere down the page. The earlier rule
   only applied position when .active was present, which on some surfaces
   let the overlay inherit static positioning and anchor to document flow. */
.modal-overlay{
    position: fixed !important;
    inset: 0;
    z-index: 1000;
    /* hidden by default (base rule above still sets display: none) */
}
/* v140: dark-mode brand anchor overrides.
   The admin-picked --brand-background is typically white, which freezes every
   section/tile/navbar in dark mode. These overrides route the dark palette
   into the same anchors so EVERY brand-tied surface (including --navbar-bg
   when admin leaves it transparent, --section-bg, --sk-card, --sk-fill) flips
   automatically. Admin-picked colours themselves (primary, secondary, feature,
   utility) stay unchanged because they are brand identity, not surface tone. */
:root[data-theme="dark"]{
    --brand-background: #171718;
    --brand-foreground: #f3f1ec;
    --surface: #171718;
    --sk-card: #171718;
    --sk-fill: #222224;
    --section-bg: #171718;
    --tile-bg: #222224;
    --input-bg-token: #222224;
    --input-text-token: #f3f1ec;
    /* Any component that reads --navbar-bg directly keeps its admin colour,
       but transparent + scrim now reads dark correctly from --sk-card above. */
}
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]){
        --brand-background: #171718;
        --brand-foreground: #f3f1ec;
        --surface: #171718;
        --sk-card: #171718;
        --sk-fill: #222224;
        --section-bg: #171718;
        --tile-bg: #222224;
        --input-bg-token: #222224;
        --input-text-token: #f3f1ec;
    }}
/* v141: design-system dark-mode token overrides.
   Only surface + background flip in dark mode. Brand + feature + utility
   colours stay admin-picked because they are identity, not surface tone.
   Component rules read semantic tokens, so flipping these propagates
   automatically to every section/card/tile/input/modal. */
:root[data-theme="dark"]{
    --color-surface: #171718;
    --color-surface-bold: #0b0b0c;
    --color-surface-subtle: #222224;
    --color-surface-highlight: #2a2a2c;
    --color-surface-reverse: #f3f1ec;
    --color-background: #0b0b0c;
    --color-background-bold: #050506;
    --color-background-subtle: #141415;
    --color-background-highlight: #1c1c1e;
    --color-background-reverse: #f3f1ec;
}
@media (prefers-color-scheme: dark) {:root:not([data-theme="light"]){
        --color-surface: #171718;
        --color-surface-bold: #0b0b0c;
        --color-surface-subtle: #222224;
        --color-surface-highlight: #2a2a2c;
        --color-surface-reverse: #f3f1ec;
        --color-background: #0b0b0c;
        --color-background-bold: #050506;
        --color-background-subtle: #141415;
        --color-background-highlight: #1c1c1e;
        --color-background-reverse: #f3f1ec;
    }}
/* v151.1: canonical direct-child spacing inside .page-container.
   Every top-level block inside .page-container (section, card, tabs,
   toolbar, stats-grid, grid, pagination) separates from the next with
   --section-gap. Admin pages used to rely on inline margin utilities
   (mt-lg, mt-xl); this rule means the spacing is uniform without them. */
.page-container > .section,
.page-container > .card,
.page-container > .tabs,
.page-container > .tab-content,
.page-container > .tab-pane,
.page-container > .toolbar,
.page-container > .filter-row,
.page-container > .stats-grid,
.page-container > .stats-grid-3,
.page-container > .grid,
.page-container > .alert,
.page-container > .pagination{
    margin-bottom: var(--section-gap, 20px);
}
.page-container > *:last-child{ margin-bottom: 0; }
/* Same for tab panels that host the content after the tab bar */
.tab-content > .section,
.tab-content > .card,
.tab-pane > .section,
.tab-pane > .card{
    margin-bottom: var(--section-gap, 20px);
}
.tab-content > *:last-child,
.tab-pane > *:last-child{ margin-bottom: 0; }
