/*
 * Folkava site styles on top of bootstrap.rtl.min.css (5.3.3).
 *
 * Look (2026-10-18, after the user pointed at mrtehran.app): a neutral charcoal music app. The artwork is
 * the only colour; the chrome is flat and quiet: white text on #1c1b21, grey secondary text, white primary
 * buttons, 10px corners, big bold section titles, generous spacing. The brand gold stays on the logo and a
 * few small marks. A light scheme mirrors it in neutral greys.
 * The scheme follows the device unless <html data-theme="light|dark"> is set (folkava_theme cookie, ui.js).
 * Every colour goes through the tokens below; components never use raw colours (except placeholder
 * artwork tones, which are the same in both schemes).
 * Contrast on --bg (dark): --text 17.1:1, --text-2 9.3:1, --muted 6.0:1. (light): 17.2:1, 6.7:1, 5.1:1.
 */

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-wght.woff2") format("woff2-variations"), url("../fonts/Vazirmatn-wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- tokens ---------- */

:root {
    /* Brand palette (logo and small marks) */
    --fk-green: #182820;
    --fk-gold: #d8b875;
    --fk-cream: #f5f0e6;
    --fk-brick: #b85c42;
    --fk-deep: #26392d;
    /* Shade under text that sits on a photo (region tiles): the same in both schemes, like the photo. */
    --scrim-rgb: 0, 0, 0;

    --radius: 10px;
    --radius-sm: 8px;
    --radius-lg: 14px;
    --ease: cubic-bezier(.2, .7, .2, 1);

    --gutter: clamp(16px, 2.5vw, 24px);
    --sidebar-w: 240px;
    --header-h: 64px;
    --player-h: 80px;
    --mini-h: 64px;
    --tabbar-h: 56px;

    /* Motion: one rhythm everywhere (fast = state change, base = enter/hover, slow = sheets and pages). */
    --dur-fast: 150ms;
    --dur: 260ms;
    --dur-slow: 420ms;
    --spring: cubic-bezier(.34, 1.3, .64, 1);

    --bs-body-font-family: "Vazirmatn", Tahoma, sans-serif;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-body-line-height: 1.65;
    --bs-link-color: var(--text);
    --bs-link-hover-color: var(--accent);
    --bs-border-color: var(--line);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--muted);
}

/* Dark scheme: the default, and the explicit choice. */
:root, :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1c1b21;
    --bg-rgb: 28, 27, 33;
    --bg-2: #1c1b21;
    --surface: #26252c;
    --surface-2: #2f2e36;
    --surface-3: #3a3942;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --text: #ffffff;
    --text-2: rgba(255, 255, 255, .72);
    --muted: rgba(255, 255, 255, .55);
    --gold: #d8b875;
    --gold-2: #e7cd95;
    --gold-3: #c9a964;
    --on-gold: #182820;
    /* A warm coral is the one lively colour of the chrome: play buttons, progress, the active item. */
    --accent: #ff7a63;
    --accent-rgb: 255, 122, 99;
    --accent-soft: rgba(255, 122, 99, .12);
    --accent-line: rgba(255, 122, 99, .4);
    --play: #ff6b57;
    --play-2: #ff8a79;
    --on-play: #ffffff;
    --primary: #ffffff;
    --primary-2: #e9e9ee;
    --on-primary: #121117;
    --heart: #ff4d6d;
    --danger: #ff8a80;
    --danger-bg: rgba(255, 107, 107, .14);
    --ok: #7bd88f;
    --ok-bg: rgba(123, 216, 143, .14);
    --chip: rgba(255, 255, 255, .08);
    --chip-hover: rgba(255, 255, 255, .14);
    --bar: rgba(28, 27, 33, .92);
    --tabbar: #141318;
    --player-bg: #141318;
    --mini-bg: #2a2930;
    --hero-a: #2a2931;
    --hero-b: #1c1b21;
    --promo-a: #35292d;
    --promo-b: #232229;
    --inverse: #ffffff;
    --on-inverse: #121117;
    --range-track: rgba(255, 255, 255, .22);
    --cover-line: rgba(255, 255, 255, .07);
    --ambient: 62, 62, 72;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-card: 0 10px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
}

/* Light scheme: the device prefers it and nothing else was chosen, or it was chosen explicitly.
   (The block is repeated because a media query cannot join a selector list.) */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg: #f5f5f7;
        --bg-rgb: 245, 245, 247;
        --bg-2: #f5f5f7;
        --surface: #ffffff;
        --surface-2: #ececf0;
        --surface-3: #e0e0e6;
        --line: rgba(18, 17, 23, .08);
        --line-strong: rgba(18, 17, 23, .16);
        --text: #121117;
        --text-2: rgba(18, 17, 23, .7);
        --muted: rgba(18, 17, 23, .62);
        --gold: #d8b875;
        --gold-2: #e2c687;
        --gold-3: #c9a964;
        --on-gold: #182820;
        --accent: #e04a33;
        --accent-rgb: 224, 74, 51;
        --accent-soft: rgba(224, 74, 51, .08);
        --accent-line: rgba(224, 74, 51, .35);
        --play: #f2563f;
        --play-2: #ff6f5a;
        --on-play: #ffffff;
        --primary: #121117;
        --primary-2: #2a2930;
        --on-primary: #ffffff;
        --heart: #e23b5f;
        --danger: #c62828;
        --danger-bg: rgba(198, 40, 40, .1);
        --ok: #2e7d32;
        --ok-bg: rgba(46, 125, 50, .1);
        --chip: rgba(18, 17, 23, .06);
        --chip-hover: rgba(18, 17, 23, .12);
        --bar: rgba(245, 245, 247, .9);
        --tabbar: #ffffff;
        --player-bg: #ffffff;
        --mini-bg: #ffffff;
        --hero-a: #e6e6ec;
        --hero-b: #f5f5f7;
        --promo-a: #ffffff;
        --promo-b: #f0f0f4;
        --inverse: #121117;
        --on-inverse: #ffffff;
        --range-track: rgba(18, 17, 23, .18);
        --cover-line: rgba(18, 17, 23, .08);
        --ambient: 200, 200, 210;
        --shadow: 0 10px 30px rgba(18, 17, 23, .1);
        --shadow-card: 0 10px 24px rgba(18, 17, 23, .14);
        --shadow-lg: 0 24px 60px rgba(18, 17, 23, .18);
    }
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f5f7;
    --bg-rgb: 245, 245, 247;
    --bg-2: #f5f5f7;
    --surface: #ffffff;
    --surface-2: #ececf0;
    --surface-3: #e0e0e6;
    --line: rgba(18, 17, 23, .08);
    --line-strong: rgba(18, 17, 23, .16);
    --text: #121117;
    --text-2: rgba(18, 17, 23, .7);
    --muted: rgba(18, 17, 23, .62);
    --gold: #d8b875;
    --gold-2: #e2c687;
    --gold-3: #c9a964;
    --on-gold: #182820;
    --accent: #e04a33;
    --accent-rgb: 224, 74, 51;
    --accent-soft: rgba(224, 74, 51, .08);
    --accent-line: rgba(224, 74, 51, .35);
    --play: #f2563f;
    --play-2: #ff6f5a;
    --on-play: #ffffff;
    --primary: #121117;
    --primary-2: #2a2930;
    --on-primary: #ffffff;
    --heart: #e23b5f;
    --danger: #c62828;
    --danger-bg: rgba(198, 40, 40, .1);
    --ok: #2e7d32;
    --ok-bg: rgba(46, 125, 50, .1);
    --chip: rgba(18, 17, 23, .06);
    --chip-hover: rgba(18, 17, 23, .12);
    --bar: rgba(245, 245, 247, .9);
    --tabbar: #ffffff;
    --player-bg: #ffffff;
    --mini-bg: #ffffff;
    --hero-a: #e6e6ec;
    --hero-b: #f5f5f7;
    --promo-a: #ffffff;
    --promo-b: #f0f0f4;
    --inverse: #121117;
    --on-inverse: #ffffff;
    --range-track: rgba(18, 17, 23, .18);
    --cover-line: rgba(18, 17, 23, .08);
    --ambient: 200, 200, 210;
    --shadow: 0 10px 30px rgba(18, 17, 23, .1);
    --shadow-card: 0 10px 24px rgba(18, 17, 23, .14);
    --shadow-lg: 0 24px 60px rgba(18, 17, 23, .18);
}

/* ---------- base ---------- */

html { background: var(--bg); transition: background-color .3s var(--ease); }
body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-size: .95rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color .3s var(--ease), color .3s var(--ease);
}
/* The rest of the chrome eases between the schemes too (backgrounds and text colour only; the
   reduced-motion rule turns every transition off). */
.site-header, .sidebar, .tab-bar, .player { transition: background-color .3s var(--ease); }
::selection { background: var(--accent-soft); }

/* Thin, quiet scrollbars on the page's own scroll containers (the sideways carousels hide theirs with
   their own, later rules). */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { border-radius: 8px; background: var(--surface-3); }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }
::-webkit-scrollbar-track { background: transparent; }

a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--accent); }

h1, h2, h3 { font-weight: 800; letter-spacing: 0; line-height: 1.3; color: var(--text); text-wrap: balance; }
button, [role="button"], a { touch-action: manipulation; }

.container { max-width: 1480px; padding-inline: var(--gutter); }

.nowrap { white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.logo { width: 30px; height: 30px; flex: none; }

/* Round icon button (theme toggle, close buttons, back and forward) */
.icon-btn {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: background-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .4; cursor: default; }
.icon-btn--sm { width: 34px; height: 34px; }
.icon-btn--sm .icon { width: 18px; height: 18px; }

/* ---------- focus and accessibility ---------- */

/* Keyboard focus: one accent ring on every interactive element (links, buttons, form controls, cards that
   are links); pointer focus keeps the browser default, which these controls mostly turn off themselves. */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

.skip-link {
    position: absolute;
    top: -100px;
    inset-inline-start: 1rem;
    z-index: 2000;
    padding: .6rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
}
.skip-link:focus { top: 1rem; color: var(--on-primary); }

/* ---------- partial-navigation progress bar ---------- */

.nav-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 1100;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right center;
    opacity: 0;
    pointer-events: none;
}
.nav-progress.is-active { opacity: 1; transform: scaleX(.8); transition: transform 2.5s var(--ease); }
.nav-progress.is-done { opacity: 0; transform: scaleX(1); transition: transform .2s, opacity .4s .2s; }

/* ---------- app shell ---------- */

.app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.app__main { display: flex; flex-direction: column; min-width: 0; }

.sidebar { display: none; }

@media (min-width: 992px) {
    .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        height: 100dvh;
        padding: 1.1rem 0 1rem;
        overflow-y: auto;
        background: var(--bg-2);
        border-inline-end: 1px solid var(--line);
        scrollbar-width: thin;
    }
    body.has-player .sidebar { height: calc(100dvh - var(--player-h)); }
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-height: 44px;
    padding-inline: 1.4rem;
    color: var(--text);
    text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand__name { font-size: 1.3rem; font-weight: 900; letter-spacing: -.01em; }

.site-nav__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.site-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .85rem;
    min-height: 40px;
    padding: .4rem 1.4rem;
    color: var(--text-2);
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--dur-fast), color var(--dur-fast);
}
.site-nav__link .icon { width: 1.3em; height: 1.3em; }
.site-nav__link:hover { color: var(--text); background: var(--surface); }
.site-nav__link[aria-current="page"] { color: var(--text); background: var(--surface); }
.site-nav__link[aria-current="page"] .icon { color: var(--accent); }
.site-nav__link[aria-current="page"]::before { content: ""; position: absolute; inset-inline-start: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }

.sidebar__heading { margin: 0 0 .25rem; padding-inline: 1.4rem; font-size: .72rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; }

.sidebar__promo {
    display: grid;
    gap: .2rem;
    margin: auto 1rem 0;
    padding: .9rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: background-color var(--dur-fast);
}
.sidebar__promo:hover { color: var(--text); background: var(--surface-2); }
.sidebar__promo-icon { color: var(--gold); }
.sidebar__promo-title { font-size: .92rem; font-weight: 800; }
.sidebar__promo-text { font-size: .8rem; color: var(--muted); line-height: 1.55; }

/* Top bar */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: var(--header-h);
    padding: .6rem var(--gutter);
    background: var(--bar);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}
.brand--compact { padding-inline: 0; }
.brand--compact .logo { width: 28px; height: 28px; }
.brand--compact .brand__name { font-size: 1.15rem; }
@media (min-width: 992px) { .brand--compact { display: none; } }

/* Back and forward (desktop): the browser history, through partial navigation */
.site-header__history { display: none; gap: .5rem; }
@media (min-width: 992px) { .site-header__history { display: flex; } }

.site-search {
    position: relative;
    display: none;
    flex: 0 1 24rem;
    align-items: center;
}
@media (min-width: 768px) { .site-search { display: flex; } }
.site-search__icon { position: absolute; inset-inline-start: .85rem; color: var(--muted); pointer-events: none; }
.site-search__input {
    width: 100%;
    min-height: 40px;
    padding-block: .35rem;
    padding-inline: 2.5rem .9rem;   /* the icon sits at the start */
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: .9rem;
    transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.site-search__input::placeholder { color: var(--muted); opacity: 1; }
.site-search__input:hover { background: var(--surface-2); }
.site-search__input:focus { border-color: var(--accent-line); background: var(--surface-2); }
.site-search__input:focus:not(:focus-visible) { outline: none; }

.site-header__tools { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }

.site-header__plans {
    display: none;
    align-items: center;
    gap: .4rem;
    min-height: 36px;
    padding: .25rem .95rem;
    border-radius: 999px;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 800;
    font-size: .85rem;
    text-decoration: none;
    transition: background-color var(--dur-fast), transform var(--dur-fast) var(--spring);
}
.site-header__plans:hover { color: var(--on-primary); background: var(--primary-2); }
.site-header__plans:active { transform: scale(.97); }
@media (min-width: 768px) { .site-header__plans { display: inline-flex; } }

/* Theme toggle: the sun shows in the dark scheme (what you switch to), the moon in the light one. */
.theme-toggle__sun, .theme-toggle__moon { display: grid; place-items: center; }
.theme-toggle__moon { display: none; }
:root[data-theme="light"] .theme-toggle__sun { display: none; }
:root[data-theme="light"] .theme-toggle__moon { display: grid; }
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .theme-toggle__sun { display: none; }
    :root:not([data-theme="dark"]) .theme-toggle__moon { display: grid; }
}

.site-account {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 38px;
    padding-block: .25rem;
    padding-inline: .35rem .9rem;   /* round icon at the start, text at the end */
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 800;
    font-size: .85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--dur-fast);
}
.site-account .icon { width: 24px; height: 24px; }
.site-account:hover { color: var(--text); background: var(--surface-3); }
.site-account[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--accent-line); }

/* Phone and tablet header: solid (nothing to blur and repaint while scrolling) and lighter: the round theme
   button and an icon-only account button (its label stays for assistive technology). */
@media (max-width: 991.98px) {
    .site-header { min-height: 56px; padding-block: .45rem; background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
    .site-header__tools { gap: .4rem; }
    .site-account { position: relative; width: 40px; padding-inline: 0; justify-content: center; }
    .site-account [data-account-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}
/* The installed app (PWA) on a phone has no browser back button, so the header's back button shows there. */
@media (display-mode: standalone) and (max-width: 991.98px) {
    .site-header__history { display: flex; }
    .site-header__history [data-history="forward"] { display: none; }
}

/* A faint warm wash at the top of every page, so the charcoal is not dead flat. */
.site-main { flex: 1; padding-bottom: 3rem; background: linear-gradient(180deg, rgba(var(--accent-rgb), .06), rgba(var(--accent-rgb), 0) 420px); }

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 2rem;
    padding: 1.75rem var(--gutter);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .82rem;
}
.site-footer__brand { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-weight: 800; color: var(--text-2); }
.site-footer__brand .logo { width: 22px; height: 22px; }
.site-footer__tagline { font-weight: 400; color: var(--muted); }
.site-footer__tagline::before { content: "·"; margin-inline-end: .5rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer__links a { color: var(--muted); text-decoration: none; }
.site-footer__links a:hover { color: var(--text); }

/* Mobile tab bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--tabbar);
    border-top: 1px solid var(--line);
}
.tab-bar__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
    text-decoration: none;
}
.tab-bar__link .icon { width: 24px; height: 24px; transition: transform var(--dur) var(--spring); }
.tab-bar__icon { display: grid; }
.tab-bar__icon--fill { display: none; }
.tab-bar__link:hover { color: var(--text); }
.tab-bar__link[aria-current="page"] { color: var(--accent); }
.tab-bar__link[aria-current="page"] .icon { transform: translateY(-1px); stroke-width: 2.5; }   /* the search icon, which has no filled twin, gets bolder */
.tab-bar__link[aria-current="page"] .tab-bar__icon--fill { display: grid; }
.tab-bar__link[aria-current="page"] .tab-bar__icon--fill + span { margin-top: 0; }
.tab-bar__link[aria-current="page"] .tab-bar__icon:not(.tab-bar__icon--fill):has(+ .tab-bar__icon--fill) { display: none; }
@media (min-width: 992px) { .tab-bar { display: none; } }
@media (max-width: 991.98px) { body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); } }

/* ---------- buttons ---------- */

.btn { border-radius: 999px; font-weight: 800; font-size: .9rem; min-height: 40px; padding-inline: 1.2rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--spring); }
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 34px; padding-inline: .9rem; font-size: .85rem; }
.btn-lg { min-height: 46px; padding-inline: 1.5rem; font-size: .95rem; }
/* Primary: a white pill (dark) / a black pill (light), like the reference's "Get App". */
.btn-brand {
    --bs-btn-bg: var(--primary);
    --bs-btn-color: var(--on-primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-2);
    --bs-btn-hover-color: var(--on-primary);
    --bs-btn-hover-border-color: var(--primary-2);
    --bs-btn-active-bg: var(--primary-2);
    --bs-btn-active-color: var(--on-primary);
    --bs-btn-active-border-color: var(--primary-2);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-color: var(--on-primary);
    --bs-btn-disabled-border-color: var(--primary);
}
.btn-outline-brand, .btn-ghost {
    --bs-btn-color: var(--text);
    --bs-btn-bg: var(--surface-2);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: var(--surface-3);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: var(--surface-3);
    --bs-btn-active-color: var(--text);
    --bs-btn-active-border-color: transparent;
}

.eyebrow, .hero__eyebrow { margin: 0 0 .3rem; color: var(--accent); font-size: .8rem; font-weight: 800; letter-spacing: .02em; }

/* ---------- hero (pages without artwork) ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding-block: 2.25rem 2.5rem;
    background: linear-gradient(180deg, var(--hero-a), var(--bg));
}
.hero .container { position: relative; z-index: 1; }
.hero__title { margin: 0 0 .6rem; font-size: clamp(1.5rem, 3.8vw, 2.3rem); font-weight: 800; color: var(--text); }
.hero__text { max-width: 40rem; margin: 0 0 1.25rem; color: var(--text-2); font-size: 1rem; }
.hero--compact { padding-block: 1.75rem 2rem; }

/* ---------- ad placements (partials/ad-slot.php; nothing renders without an ad) ---------- */

.ad { position: relative; margin: 0 0 1.75rem; }
.ad__link { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); outline: 1px solid var(--cover-line); outline-offset: -1px; }
.ad__image { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 1; transition: transform var(--dur-slow) var(--ease); }
@media (min-width: 992px) { .ad--home_top .ad__image, .ad--home_middle .ad__image, .ad--track .ad__image { aspect-ratio: 4 / 1; } }   /* a leaderboard, not a hero */
.ad__link:hover .ad__image { transform: scale(1.02); }
.ad__label { position: absolute; top: .5rem; inset-inline-start: .5rem; padding: .1rem .5rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .68rem; font-weight: 700; }
.ad__sponsor { display: block; margin-top: .35rem; color: var(--muted); font-size: .74rem; }
.ad--home_top { margin-top: .25rem; }
.ad--sidebar { margin: auto 1rem 1rem; }
.ad--sidebar .ad__image { aspect-ratio: 1.6 / 1; }
.ad--sidebar + .sidebar__promo { margin-top: 0; }
@media (max-width: 575.98px) {
    .ad__image { aspect-ratio: 2 / 1; }
    .ad { margin-bottom: 1.5rem; }
}

/* ---------- "for you" (home, signed in): quick cards filled by account.js ---------- */

.for-you { padding-top: 1.25rem; }
.for-you:not([hidden]) + .featured { padding-top: .75rem; }
.for-you__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .for-you__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; } }
.for-you__card {
    position: relative;
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    min-height: 56px;
    padding: 0 .6rem 0 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--dur-fast);
}
.for-you__card:hover { color: var(--text); background: var(--surface-2); }
.for-you__art { position: relative; display: grid; place-items: center; flex: none; width: 56px; height: 56px; overflow: hidden; background: var(--surface-3); color: var(--text-2); }
.for-you__art img { width: 100%; height: 100%; object-fit: cover; }
.for-you__art .icon { width: 22px; height: 22px; }
.for-you__art--region { color: inherit; font-size: 1.3rem; font-weight: 900; }
.for-you__art--region::before { content: ""; position: absolute; inset: 0; background: var(--motif, none) center / 64px 64px repeat; opacity: .22; }
.for-you__text { display: flex; flex-direction: column; min-width: 0; }
.for-you__label { font-size: .7rem; font-weight: 700; color: var(--accent); }
.for-you__title { overflow: hidden; font-size: .88rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- featured row (home): landscape artwork cards ---------- */

.featured { padding-top: 1.25rem; margin-bottom: 1.75rem; }
.featured__list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(84vw, 368px);
    gap: 1rem;
    margin: 0 calc(-1 * var(--gutter));
    padding: .25rem var(--gutter) .5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    list-style: none;
}
.featured__list::-webkit-scrollbar { display: none; }
@media (min-width: 992px) { .featured__list { grid-auto-columns: minmax(300px, calc((100% - 2rem) / 3)); } }
.featured-card { position: relative; scroll-snap-align: start; }
.featured-card__art {
    position: relative;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
}
.featured-card__art .cover { width: 100%; height: 100%; border-radius: 0; box-shadow: none; transition: transform var(--dur-slow) var(--ease); }
.featured-card__art .cover--placeholder > span { font-size: clamp(2.5rem, 6vw, 4rem); }
/* A landscape banner fills the card; without one the square artwork sits centred over a blurred copy. */
.featured-card__banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.featured-card__blur { position: absolute; inset: -20%; width: 140%; height: 140%; object-fit: cover; filter: blur(28px) saturate(1.2); opacity: .85; }
.featured-card__square { position: absolute; top: 50%; left: 50%; height: 78%; aspect-ratio: 1; overflow: hidden; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transform: translate(-50%, -50%); }
.featured-card__square .cover { border-radius: 8px; }
.featured-card:hover .featured-card__art .cover, .featured-card:hover .featured-card__banner { transform: scale(1.03); }
.featured-card__title { display: block; margin-top: .65rem; color: var(--text); font-size: .95rem; font-weight: 800; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-card__title:hover { color: var(--text); }
.featured-card__sub { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-card__eyebrow { position: absolute; top: .6rem; inset-inline-start: .6rem; z-index: 2; padding: .15rem .6rem; border-radius: 999px; background: var(--play); color: var(--on-play); font-size: .72rem; font-weight: 800; }
.featured-card .mcard__play { bottom: .75rem; inset-inline-end: .75rem; }

/* ---------- detail headers (track, album, artist, region) ---------- */

/* A faint wash of the artwork's colour behind the header (ui.js sets --ambient from the cover). */
.detail-hero { position: relative; padding-block: clamp(1.25rem, 3vw, 2rem) .5rem; background: linear-gradient(180deg, rgba(var(--ambient), .14), rgba(var(--ambient), 0) 80%); transition: background-color var(--dur); }
.detail-hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; }
.detail-hero__body { flex: 1 1 18rem; min-width: 0; }
.detail-hero__title { margin: 0 0 .4rem; font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.detail-hero__artists { margin: 0 0 .3rem; font-size: .95rem; font-weight: 700; color: var(--text); }
/* The Latin name ("Behnam Hasanzadeh – Booye Gham") under the title: quiet, but on the page for Finglish searches. */
.detail-hero__latin { margin: 0 0 .35rem; color: var(--muted); font-size: .82rem; letter-spacing: .01em; }
.detail-hero__artists a { color: inherit; }
.detail-hero__artists a:hover { color: var(--accent); text-decoration: underline; }
.detail-hero__meta { margin: 0; color: var(--text-2); font-size: .9rem; }
.detail-hero__meta a { color: var(--text); }
.detail-hero__text { max-width: 44rem; margin: .6rem 0 0; color: var(--text-2); font-size: .92rem; }
/* Phones: a centered column with a big cover (as in the reference's song page). */
@media (max-width: 575.98px) {
    .detail-hero { padding-block: 1.25rem .25rem; }
    .detail-hero__row { flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
    .detail-hero__body { flex: 0 1 auto; width: 100%; }   /* the 18rem basis is for the row layout, not the column */
    .detail-hero__title { font-size: 1.6rem; }
    .detail-hero__meta { font-size: .86rem; }
    .detail-hero__row .cover--xl { width: min(62vw, 240px); }
    .detail-hero__row .region-badge { width: 140px; }
    .breadcrumbs { justify-content: center; }
    .page-head .breadcrumbs { justify-content: flex-start; }   /* list pages keep their heading on the start side */
    .detail-hero .chip-list { justify-content: center; }
    /* A chip row that scrolls sideways stays centred only while it fits (plain centring would cut its start). */
    .detail-hero .chip-list--scroll { justify-content: safe center; }
}

/* Plays and likes under a track title: one quiet line */
.detail-hero__stats { display: flex; flex-wrap: wrap; gap: .25rem .6rem; margin: .5rem 0 0; color: var(--text-2); font-size: .86rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-pill { display: inline-flex; align-items: center; gap: .3rem; }
.stat-pill + .stat-pill::before { content: "·"; margin-inline-end: .35rem; color: var(--muted); }
.stat-pill .icon { width: .95em; height: .95em; color: var(--muted); }
@media (max-width: 575.98px) { .detail-hero__stats { justify-content: center; } }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .3rem; font-size: .8rem; font-weight: 700; color: var(--muted); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }
.breadcrumbs > * + *::before { content: "·"; margin-inline-end: .4rem; color: var(--muted); }

.region-badge {
    display: grid;
    place-items: center;
    flex: none;
    width: clamp(100px, 14vw, 160px);
    aspect-ratio: 1;
    border-radius: var(--radius);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
}

/* Play, like, share and download under a header */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.actions--page { margin: 1rem 0 1.75rem; }
/* Phones: one centered row; the play pill keeps its label, the other actions become round icon buttons
   (their labels stay for assistive technology). */
@media (max-width: 575.98px) {
    .actions--page { justify-content: center; gap: .5rem; margin: .9rem 0 1.5rem; }
    .actions--page .fav-btn--hero { width: 44px; padding: 0; }
    .actions--page .fav-btn--hero > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- covers ---------- */

.cover { display: block; object-fit: cover; background: var(--surface-2); }
img.cover { outline: 1px solid var(--cover-line); outline-offset: -1px; }   /* keeps dark artwork apart from the dark page */
.cover--sm { width: 48px; height: 48px; border-radius: 6px; flex: none; }
.cover--fluid { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius); }
.cover--xl {
    flex: none;
    width: clamp(160px, 22vw, 240px);
    height: auto;
    aspect-ratio: 1;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}
.cover--round { border-radius: 50%; }
.cover--placeholder {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    font-weight: 900;
}
/* A quiet woven texture on placeholder artwork, so rows of covers do not look flat. */
.cover--placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 45%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 14px);
}
.cover--placeholder > span { position: relative; font-size: 1.1rem; line-height: 1; }
.cover--fluid.cover--placeholder > span { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.cover--xl.cover--placeholder > span { font-size: clamp(3rem, 6vw, 4.5rem); }
.cover--tone-0 { background: linear-gradient(140deg, #3d5c47, #182820); color: #d8b875; }
.cover--tone-1 { background: linear-gradient(140deg, #c46a4e, #6e3424); color: var(--fk-cream); }
.cover--tone-2 { background: linear-gradient(140deg, #4f7a5d, #22392b); color: var(--fk-cream); }
.cover--tone-3 { background: linear-gradient(140deg, #e3c584, #a7853f); color: var(--fk-green); }
.cover--tone-4 { background: linear-gradient(140deg, #2b3d31, #101a14); color: #d8b875; }
.cover--tone-5 { background: linear-gradient(140deg, #7a5470, #3a2537); color: var(--fk-cream); }

/* ---------- cards and rows of cards ---------- */

.mcard { position: relative; }
.mcard__art { position: relative; margin-bottom: .6rem; border-radius: var(--radius); }
.mcard__art .cover { transition: transform var(--dur-slow) var(--ease), filter var(--dur) var(--ease); }
.mcard:hover .mcard__art .cover { filter: brightness(.85); }
.mcard__rank {
    position: absolute;
    top: .5rem;
    inset-inline-start: .5rem;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding-inline: .4rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: .78rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}
.mcard__stats { display: flex; gap: .6rem; margin-top: .15rem; color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.mcard__stats > span { display: inline-flex; align-items: center; gap: .25rem; }
.mcard__stats .icon { width: .95em; height: .95em; }
.mcard__title {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: .92rem;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mcard__title:hover { color: var(--text); }
.mcard__sub {
    display: block;
    overflow: hidden;
    margin-top: .05rem;
    color: var(--muted);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mcard__sub a { position: relative; z-index: 2; color: inherit; text-decoration: none; }
.mcard__sub a:hover { color: var(--text); text-decoration: underline; }
.mcard--round { text-align: center; }
.mcard--round .mcard__art { padding: .25rem; }
.mcard--round .cover { outline: 2px solid transparent; outline-offset: 3px; transition: outline-color var(--dur-fast), filter var(--dur) var(--ease); }
.mcard--round:hover .cover { outline-color: var(--accent-line); }

/* The play button on artwork: white, appears on hover (always on touch screens) */
.mcard__play {
    position: absolute;
    bottom: .6rem;
    inset-inline-end: .6rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--play);
    color: var(--on-play);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .4);
    opacity: 0;
    transform: translateY(8px);
    cursor: pointer;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--spring), background-color var(--dur-fast);
}
.mcard__play:hover { background: var(--play-2); }
.mcard__play .icon { width: 18px; height: 18px; }
.mcard:hover .mcard__play, .mcard__play:focus-visible, .mcard__play.is-current { opacity: 1; transform: none; }
.mcard__play:hover { transform: scale(1.06); }
.mcard__play:active { transform: scale(.94); }
@media (hover: none) {
    .mcard__play { opacity: 1; transform: none; width: 34px; height: 34px; }
    .mcard__play .icon { width: 15px; height: 15px; }
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.25rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 1.5rem 1.25rem; } }
.card-grid--regions { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
/* Phones: smaller card type, three cards per row in grids, no count line under cards. */
@media (max-width: 575.98px) {
    .mcard__title { font-size: .86rem; }
    .mcard__sub { font-size: .76rem; }
    .mcard__stats { display: none; }
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 1rem .75rem; }
    .card-grid--regions { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
}

/* A row: a big title, "show all" and arrows in the head; the list scrolls sideways and bleeds to the edge. */
.shelf { margin-bottom: 2.25rem; }
.shelf__head { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.shelf__title { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.5rem); font-weight: 800; }
@media (max-width: 575.98px) {
    .shelf { margin-bottom: 2rem; }
    .shelf__head { margin-bottom: .7rem; }
}
.shelf__tools { display: flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
.shelf__more {
    display: inline-flex;
    align-items: center;
    gap: .15rem;
    min-height: 34px;
    padding: .2rem .5rem .2rem .8rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--dur-fast), background-color var(--dur-fast);
}
.shelf__more .icon { width: 1.1em; height: 1.1em; }
.shelf__more:hover { color: var(--text); background: var(--surface); }

/* Segmented control of a row with tabs (trends: this week / this month / all time) */
.segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--surface);
}
.segmented__btn {
    min-height: 30px;
    padding: .1rem .75rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color var(--dur-fast), color var(--dur-fast);
}
.segmented__btn:hover { color: var(--text); }
.segmented__btn[aria-selected="true"], .segmented__btn[aria-current="page"] { background: var(--inverse); color: var(--on-inverse); }
.segmented--links { margin: .75rem 0 .25rem; }
.segmented--links .segmented__btn { display: inline-flex; align-items: center; text-decoration: none; }
.shelf__panel[hidden] { display: none; }
@media (max-width: 575.98px) {
    .shelf__head { flex-wrap: wrap; }
    .shelf__head .segmented { order: 3; width: 100%; justify-content: flex-start; margin-top: .25rem; }
    .shelf__head .segmented__btn { flex: 1; }
}

.shelf__arrows { display: none; gap: .4rem; }
@media (hover: hover) and (min-width: 768px) { .shelf__arrows { display: flex; } }
.shelf--fits .shelf__arrows { display: none; }
.shelf__arrow {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: background-color var(--dur-fast), opacity var(--dur-fast);
}
.shelf__arrow:hover:not(:disabled) { background: var(--surface-3); }
.shelf__arrow:disabled { opacity: .3; cursor: default; }

.shelf__list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(118px, 32vw, 176px);
    gap: .85rem;
    margin: 0 calc(-1 * var(--gutter));
    padding: .25rem var(--gutter) .5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    list-style: none;
}
@media (min-width: 992px) { .shelf__list { grid-auto-columns: 176px; gap: 1.25rem; } }
.shelf__list::-webkit-scrollbar { display: none; }
.shelf__list > li { scroll-snap-align: start; }
.shelf__list--wide { grid-auto-columns: clamp(150px, 42vw, 200px); gap: .75rem; }

/* Entrance: cards and rows rise in one after another (the first twelve stagger, the rest come together). */
.shelf__list > li, .card-grid > li, .track-list > li, .featured__list > li { animation: fk-rise var(--dur-slow) var(--ease) both; animation-delay: calc(var(--i, 12) * 28ms); }
.shelf__list > li:nth-child(1), .card-grid > li:nth-child(1), .track-list > li:nth-child(1), .featured__list > li:nth-child(1) { --i: 0; }
.shelf__list > li:nth-child(2), .card-grid > li:nth-child(2), .track-list > li:nth-child(2), .featured__list > li:nth-child(2) { --i: 1; }
.shelf__list > li:nth-child(3), .card-grid > li:nth-child(3), .track-list > li:nth-child(3), .featured__list > li:nth-child(3) { --i: 2; }
.shelf__list > li:nth-child(4), .card-grid > li:nth-child(4), .track-list > li:nth-child(4), .featured__list > li:nth-child(4) { --i: 3; }
.shelf__list > li:nth-child(5), .card-grid > li:nth-child(5), .track-list > li:nth-child(5) { --i: 4; }
.shelf__list > li:nth-child(6), .card-grid > li:nth-child(6), .track-list > li:nth-child(6) { --i: 5; }
.shelf__list > li:nth-child(7), .card-grid > li:nth-child(7), .track-list > li:nth-child(7) { --i: 6; }
.shelf__list > li:nth-child(8), .card-grid > li:nth-child(8), .track-list > li:nth-child(8) { --i: 7; }
.shelf__list > li:nth-child(9), .card-grid > li:nth-child(9), .track-list > li:nth-child(9) { --i: 8; }
.shelf__list > li:nth-child(10), .card-grid > li:nth-child(10), .track-list > li:nth-child(10) { --i: 9; }
.shelf__list > li:nth-child(11), .card-grid > li:nth-child(11), .track-list > li:nth-child(11) { --i: 10; }
.shelf__list > li:nth-child(12), .card-grid > li:nth-child(12), .track-list > li:nth-child(12) { --i: 11; }
@keyframes fk-rise { from { opacity: 0; transform: translateY(10px); } }
/* New page content after partial navigation fades in once (nav.js toggles the class). */
.site-main.is-entering { animation: fk-fade var(--dur) var(--ease) both; }
@keyframes fk-fade { from { opacity: 0; } }

/* Region tiles. The whole tile is the link: the name's stretched-link covers the tile, so the name and count
   must not be positioned (a positioned name would hold the overlay to its own box). The motif and the big
   initial sit behind the text through the tile's own stacking context (isolation + z-index: -1). */
.region-card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 104px;
    padding: .85rem 1rem;
    overflow: hidden;
    border-radius: var(--radius);
    transition: transform var(--dur) var(--spring), filter var(--dur) var(--ease);
}
.region-card:hover { filter: brightness(1.08); }
.region-card:active { transform: scale(.98); }
.region-card__name { font-size: 1.05rem; font-weight: 900; color: inherit; text-decoration: none; }
.region-card__name:hover { color: inherit; }
.region-card__count { font-size: .78rem; font-weight: 700; opacity: .85; }
.region-card__mark {
    position: absolute;
    z-index: -1;
    top: -.15em;
    inset-inline-end: -.05em;
    font-size: 5.5rem;
    font-weight: 900;
    line-height: 1;
    opacity: .16;
    transform: rotate(-12deg);
    pointer-events: none;
}
.region-card--tone-0 { background: linear-gradient(135deg, #3d5c47, #182820); color: var(--fk-cream); }
.region-card--tone-1 { background: linear-gradient(135deg, #c46a4e, #7a3a28); color: #fff; }
.region-card--tone-2 { background: linear-gradient(135deg, #4f7a5d, #26392d); color: var(--fk-cream); }
.region-card--tone-3 { background: linear-gradient(135deg, #e3c584, #b08c45); color: var(--fk-green); }
.region-card--tone-4 { background: linear-gradient(135deg, #34503f, #121d17); color: var(--fk-cream); }
.region-card--tone-5 { background: linear-gradient(135deg, #8a5f7e, #3f2a3c); color: var(--fk-cream); }

/* Regional motifs: a simple geometric pattern drawn from each region's textiles (web/img/motifs/<slug>.svg,
   white lines on a transparent tile) repeated at low opacity over the tile's tone; templates set data-motif. */
.region-card::before, .region-badge::before { content: ""; position: absolute; inset: 0; background: var(--motif, none) center / 96px 96px repeat; opacity: .16; pointer-events: none; }
.region-card::before { z-index: -1; }
.region-badge { position: relative; overflow: hidden; }
.region-badge > span { position: relative; z-index: 1; }
/* A region with a cover image (admin: taxonomy): the photo fills the tile under a shade instead of the motif. */
.region-card__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.region-card--image { color: var(--fk-cream); }
.region-card--image::before { background: linear-gradient(to top, rgba(var(--scrim-rgb), .72), rgba(var(--scrim-rgb), .08) 80%); opacity: 1; }
.region-card--image .region-card__mark { display: none; }
[data-motif="mazandarani"] { --motif: url("../img/motifs/mazandarani.svg"); }
[data-motif="gilaki"] { --motif: url("../img/motifs/gilaki.svg"); }
[data-motif="kurdish"] { --motif: url("../img/motifs/kurdish.svg"); }
[data-motif="lori"] { --motif: url("../img/motifs/lori.svg"); }
[data-motif="bakhtiari"] { --motif: url("../img/motifs/bakhtiari.svg"); }
[data-motif="azeri"] { --motif: url("../img/motifs/azeri.svg"); }
[data-motif="baluchi"] { --motif: url("../img/motifs/baluchi.svg"); }
[data-motif="khorasani"] { --motif: url("../img/motifs/khorasani.svg"); }
[data-motif="bandari"] { --motif: url("../img/motifs/bandari.svg"); }
[data-motif="turkmen"] { --motif: url("../img/motifs/turkmen.svg"); }
[data-motif="talysh"] { --motif: url("../img/motifs/talysh.svg"); }
[data-motif="qashqai"] { --motif: url("../img/motifs/qashqai.svg"); }
[data-motif="sistani"] { --motif: url("../img/motifs/sistani.svg"); }

/* Subscription banner between rows */
.promo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .85rem 1.25rem;
    margin: .25rem 0 2rem;
    position: relative;
    overflow: hidden;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--promo-a), var(--promo-b));
    color: var(--text);
    text-decoration: none;
    transition: filter var(--dur-fast);
}
/* A faint kilim pattern across the banner (the same motif files as the region tiles). */
.promo::before { content: ""; position: absolute; inset: 0; background: url("../img/motifs/kurdish.svg") center / 110px 110px repeat; opacity: .07; pointer-events: none; }
.promo > * { position: relative; }
.promo:hover { color: var(--text); filter: brightness(1.08); }
.promo__icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--on-gold); }
.promo__icon .icon { width: 22px; height: 22px; }
.promo__text { display: grid; gap: .15rem; flex: 1 1 18rem; }
.promo__title { font-size: 1.02rem; font-weight: 800; }
.promo__sub { color: var(--text-2); font-size: .88rem; }
.promo__cta { pointer-events: none; }
@media (max-width: 575.98px) {
    .promo { gap: .6rem .85rem; margin-bottom: 1.75rem; padding: .9rem 1rem; border-radius: var(--radius); }
    .promo__icon { width: 40px; height: 40px; }
    .promo__icon .icon { width: 20px; height: 20px; }
    .promo__title { font-size: .95rem; }
    .promo__sub { font-size: .82rem; }
    .promo__cta { width: 100%; min-height: 38px; }
}

/* ---------- page structure ---------- */

.page-sections { padding-top: 1.25rem; }
.page-section { margin-bottom: 2.25rem; }
.page-head { margin: .5rem 0 1.5rem; }
.page-title { margin-bottom: .3rem; font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 800; }
.page-lead { max-width: 44rem; margin: 0; color: var(--text-2); font-size: .92rem; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .75rem; }
.section-title { margin: 0 0 .75rem; font-size: clamp(1.25rem, 2.2vw, 1.5rem); font-weight: 800; }
.section-head .section-title { margin-bottom: 0; }
.section-more { color: var(--muted); font-weight: 800; white-space: nowrap; }
.section-count { color: var(--muted); white-space: nowrap; font-size: .9rem; }

.prose { max-width: 46rem; color: var(--text-2); line-height: 1.9; }

.chip-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: .15rem .75rem;
    border-radius: 999px;
    background: var(--chip);
    color: var(--text);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
a.chip:hover { color: var(--text); background: var(--chip-hover); }
.chip.is-active { background: var(--inverse); color: var(--on-inverse); }
a.chip.is-active:hover { background: var(--inverse); color: var(--on-inverse); }
/* How many tracks a genre chip leads to. */
.chip__count { margin-inline-start: .35rem; color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.chip.is-active .chip__count { color: inherit; opacity: .7; }
/* Bigger chips for a row of their own (home: genres). */
.chip-list--big .chip { min-height: 40px; padding: .3rem 1.05rem; font-size: .92rem; }
.detail-hero__chips { margin-top: .9rem; }
.section-head .segmented--links { margin: 0; }
/* A long filter row (trends) scrolls sideways on phones instead of wrapping into several lines. */
@media (max-width: 575.98px) {
    .chip-list--scroll { flex-wrap: nowrap; margin-inline: calc(-1 * var(--gutter)); padding: .1rem var(--gutter) .35rem; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
    .chip-list--scroll::-webkit-scrollbar { display: none; }
    .chip-list--scroll > li { flex: none; }
}

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .75rem; margin: 0; }
.facts > div { padding: .85rem 1rem; border-radius: var(--radius); background: var(--surface); }
.facts dt { font-size: .8rem; font-weight: 700; color: var(--muted); }
.facts dd { margin: 0; font-weight: 800; }
@media (max-width: 575.98px) {
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
    .facts > div { padding: .6rem .8rem; }
    .facts dt { font-size: .74rem; }
    .facts dd { font-size: .9rem; overflow-wrap: anywhere; }
}

.lyrics-block .section-head { max-width: 40rem; }
.lyrics {
    max-width: 40rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 1.05rem;
    line-height: 2.1;
    white-space: pre-line;
}

/* ---------- track list: each row a quiet card ---------- */

.track-list { display: flex; flex-direction: column; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.track-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 60px;
    padding: .4rem .75rem .4rem .6rem;
    border-radius: var(--radius);
    background: var(--surface);
    transition: background-color var(--dur-fast);
}
.track-row:hover { background: var(--surface-2); }
.track-row__number { width: 1.5rem; flex: none; text-align: center; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
/* Ranked lists (trends): big quiet numerals; the top three rows get a larger cover and title. */
.track-row__number--rank { width: 2.2rem; font-size: 1.35rem; font-weight: 900; color: var(--muted); }
.track-row--top { min-height: 76px; }
.track-row--top .track-row__number--rank { font-size: 1.7rem; color: var(--accent); }
.track-row--top .cover--sm { width: 64px; height: 64px; border-radius: 8px; }
.track-row--top .track-row__title { font-size: 1.05rem; }
.track-row__main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.track-row__likes { display: inline-flex; align-items: center; gap: .1rem; flex: none; }
.fav-count { min-width: 1.2rem; color: var(--muted); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.track-row__title {
    overflow: hidden;
    color: var(--text);
    font-size: .95rem;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.track-row__title:hover { color: var(--text); }
.track-row__artists, .track-row__note {
    overflow: hidden;
    color: var(--muted);
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.track-row__artists a, .track-row__region { position: relative; z-index: 2; }
.track-row__artists a { color: inherit; text-decoration: none; }
.track-row__artists a:hover { color: var(--text); text-decoration: underline; }
.track-row__region { font-size: .76rem; min-height: 26px; }
.track-row__duration { flex: none; min-width: 2.6rem; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
@media (max-width: 575.98px) {
    .track-row { gap: .5rem; padding-inline: .5rem .4rem; }
    .track-row__region { display: none; }
    /* Rows with artwork: the play button sits on the thumbnail (as in the reference), which leaves the title
       its room. The rank stays first; browsers without :has() keep the side-by-side layout. */
    .track-row:has(> .cover--sm) .track-row__number--rank { order: -2; }
    .track-row:has(> .cover--sm) > .cover--sm { order: -1; }
    .track-row:has(> .cover--sm) .play-btn--row {
        width: 48px;
        height: 48px;
        margin-inline-start: calc(-48px - .5rem);
        border-radius: 6px;
        background: rgba(0, 0, 0, .35);
        color: #fff;
    }
    .track-row:has(> .cover--sm) .play-btn--row .icon { width: 18px; height: 18px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
    .track-row:has(> .cover--sm) .play-btn--row.is-current { background: rgba(0, 0, 0, .55); color: #fff; }
    .track-row--top:has(> .cover--sm) .play-btn--row { width: 64px; height: 64px; margin-inline-start: calc(-64px - .5rem); border-radius: 8px; }
    .track-row--top .track-row__number--rank { font-size: 1.4rem; }
}
@media (max-width: 399.98px) { .track-row__duration { display: none; } }

/* Play buttons */
.play-btn {
    position: relative;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: transform var(--dur-fast) var(--spring), background-color var(--dur-fast), color var(--dur-fast);
}
.play-btn--row { width: 36px; height: 36px; color: var(--text); }
.play-btn--row .icon { width: 16px; height: 16px; }
.track-row:hover .play-btn--row { background: var(--surface-3); }
.play-btn--row.is-current { background: var(--play); color: var(--on-play); }
.play-btn:active { transform: scale(.94); }
/* The big one under a header: white round button, like the reference. */
.play-btn--hero {
    grid-auto-flow: column;
    gap: .5rem;
    min-height: 48px;
    padding: 0 1.4rem;
    border-radius: 999px;
    background: var(--play);
    color: var(--on-play);
    font-size: .95rem;
    font-weight: 900;
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), .3);
}
.play-btn--hero .icon { width: 20px; height: 20px; }
.play-btn--hero:hover { background: var(--play-2); transform: scale(1.03); }

/* The track that is playing: round buttons show three moving bars instead of the play icon;
   the wide hero button (icon beside text) just pulses its icon. */
.play-btn--hero[aria-pressed="true"] .icon { animation: fk-pulse 1.4s ease-in-out infinite; }
@keyframes fk-pulse { 50% { opacity: .5; } }
.play-btn--row[aria-pressed="true"], .mcard__play[aria-pressed="true"] { position: relative; }
.play-btn--row[aria-pressed="true"] .icon, .mcard__play[aria-pressed="true"] .icon { opacity: 0; }
.play-btn--row[aria-pressed="true"]::after, .mcard__play[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    transform: translate(-50%, -50%);
    background:
        linear-gradient(currentColor, currentColor) 0 100% / 3px 50% no-repeat,
        linear-gradient(currentColor, currentColor) 50% 100% / 3px 100% no-repeat,
        linear-gradient(currentColor, currentColor) 100% 100% / 3px 70% no-repeat;
    animation: fk-eq .9s ease-in-out infinite alternate;
}
@keyframes fk-eq {
    to {
        background-size: 3px 95%, 3px 40%, 3px 75%;
    }
}

/* Favorite (heart), add to playlist, share and download buttons */
.fav-btn {
    position: relative;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color var(--dur-fast), background-color var(--dur-fast), transform var(--dur-fast) var(--spring);
}
.fav-btn .icon { width: 18px; height: 18px; }
.fav-btn:hover { color: var(--text); background: var(--surface-3); }
.fav-btn:active { transform: scale(.92); }
.fav-btn[aria-pressed="true"] { color: var(--heart); }
.fav-btn[aria-pressed="true"] .icon path { fill: currentColor; }
.fav-btn.is-popping .icon { animation: fk-pop var(--dur-slow) var(--spring); }
@keyframes fk-pop { 40% { transform: scale(1.35); } }
.fav-btn--hero {
    width: auto;
    height: 44px;
    grid-auto-flow: column;
    gap: .45rem;
    padding: 0 1.1rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-size: .9rem;
    font-weight: 800;
}
.fav-btn--hero:hover { background: var(--surface-3); }
.fav-btn--hero[aria-pressed="true"] { color: var(--heart); }

/* ---------- search page ---------- */

.search-form { max-width: 44rem; margin-top: 1rem; }
.search-form__row { position: relative; display: flex; gap: .5rem; }
.search-form__icon { position: absolute; top: 50%; inset-inline-start: 1.1rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-form__icon .icon { width: 1.4em; height: 1.4em; }
.search-form__input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding-block: .45rem;
    padding-inline: 3rem 1.1rem;   /* the icon sits at the start */
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
}
.search-form__input::placeholder { color: var(--muted); opacity: 1; }
.search-form__input:focus { border-color: var(--accent-line); background: var(--surface-2); }
.search-form__input:focus:not(:focus-visible) { outline: none; }
.search-form .btn { min-height: 48px; }
.form-hint { margin: .5rem 0 0; font-size: .86rem; color: var(--muted); }
.form-error { margin: .5rem 0 0; font-weight: 800; color: var(--danger); }

/* Live search suggestions */
.suggest {
    position: absolute;
    top: calc(100% + .4rem);
    inset-inline: 0;
    z-index: 1010;
    max-height: min(60vh, 26rem);
    margin: 0;
    padding: .35rem;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: fk-rise var(--dur) var(--ease);
}
.suggest[hidden] { display: none; }
.suggest__item {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-height: 44px;
    padding: .35rem .5rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: background-color var(--dur-fast);
}
.suggest__item:hover, .suggest [aria-selected="true"] .suggest__item { background: var(--surface-2); color: var(--text); }
.suggest__cover {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(140deg, #3d5c47, #182820);
    color: #d8b875;
    font-size: .85rem;
    font-weight: 900;
}
.suggest__cover--round { border-radius: 50%; }
.suggest__cover img { width: 100%; height: 100%; object-fit: cover; }
.suggest__text { display: flex; flex-direction: column; min-width: 0; }
.suggest__name, .suggest__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest__name { font-size: .9rem; font-weight: 800; }
.suggest__meta { font-size: .76rem; color: var(--muted); }
.suggest__item--all { justify-content: center; margin-top: .15rem; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--text-2); font-size: .85rem; font-weight: 800; }
/* Placeholder rows while the request is in flight (ui.js); the shimmer stops under reduced motion. */
.suggest__skeleton { padding: .2rem .5rem; pointer-events: none; }
.suggest__skeleton .skeleton__row { margin-block: .5rem; }
.suggest__skeleton .skeleton__dot { width: 34px; height: 34px; border-radius: 6px; }   /* square, like the covers */
.suggest__skeleton .skeleton__bar { max-width: 18rem; }

/* ---------- pager, empty, error ---------- */

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1.25rem; margin-top: 1.25rem; }
.pager__link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    min-height: 40px;
    padding: .3rem 1.1rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}
.pager__link:hover { color: var(--text); background: var(--surface-3); }
.pager__status { color: var(--muted); }
/* "Show more": ui.js turns a list's pager into this one button (the next page is appended to the list). */
.pager__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(100%, 14rem);
    min-height: 44px;
    padding: .4rem 1.4rem;
    border: 0;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
    transition: background-color var(--dur-fast);
}
.pager__more:hover { background: var(--surface-3); }
.pager__more[aria-busy="true"] { opacity: .65; cursor: progress; }
/* Phones: one compact row, "قبل · ۲ از ۵ · بعد" (the word "صفحه‌ی" is dropped; the links keep it in aria-label). */
@media (max-width: 575.98px) {
    .pager { flex-wrap: nowrap; gap: .6rem; font-size: .85rem; }
    .pager__link { min-height: 36px; padding: .25rem .85rem; white-space: nowrap; }
    .pager__status { white-space: nowrap; }
    .pager__long { display: none; }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 2.5rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
    color: var(--muted);
}
/* The muted icon sits in a soft disc, like the reference's empty shelves. */
.empty-state__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: .35rem;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
}
.empty-state__icon .icon { width: 26px; height: 26px; }
.empty-state__title { margin: 0; font-weight: 800; color: var(--text); }
.empty-state__text { margin: 0; }
.empty-state .btn { margin-top: .5rem; }

.error-page { text-align: center; padding-top: 3rem; }
.error-page__code { margin: 0; font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 900; line-height: 1; color: var(--text-2); }
.error-page .page-lead { margin: .5rem auto 1.5rem; }
.error-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }

/* ---------- player ---------- */

/* Desktop: a bar along the bottom with the track on the start side, controls and seek in the middle,
   queue and volume on the end side. Transport controls and the seek bar are left-to-right, as in every
   music app. The cover's colour (--ambient, ui.js) tints the start of the bar a little. */
body.has-player { padding-bottom: var(--player-h); }
.player {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1050;
    height: var(--player-h);
    padding: 0 1rem env(safe-area-inset-bottom);
    background: linear-gradient(to left, rgba(var(--ambient), .18), transparent 40%), var(--player-bg);
    border-top: 1px solid var(--line);
    color: var(--text);
    --fill: 0%;
}
.player__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    height: 100%;
}
.player__info { display: flex; align-items: center; gap: .8rem; min-width: 0; color: inherit; text-decoration: none; }
.player__info:hover { color: inherit; }
.player__info:hover .player__title { text-decoration: underline; }
.player__cover {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(140deg, #3d5c47, #182820);
    color: #d8b875;
    font-weight: 900;
    font-size: 1.2rem;
}
.player__cover img { width: 100%; height: 100%; object-fit: cover; }
.player__text { display: flex; flex-direction: column; min-width: 0; }
.player__title, .player__artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player__title { font-size: .92rem; font-weight: 800; }
.player__artist { font-size: .8rem; color: var(--muted); }
.player__expand { display: none; }

.player__center { display: flex; flex-direction: column; align-items: center; gap: .15rem; min-width: 0; }
.player__controls { display: flex; align-items: center; gap: .5rem; }
.player__btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: color var(--dur-fast), transform var(--dur-fast) var(--spring), background-color var(--dur-fast);
}
.player__btn .icon { width: 20px; height: 20px; }
.player__btn:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.player__btn:active:not(:disabled) { transform: scale(.92); }
.player__btn:disabled { opacity: .35; cursor: default; }
.player__btn--main { width: 42px; height: 42px; background: var(--play); color: var(--on-play); }
.player__btn--main:hover:not(:disabled) { color: var(--on-play); background: var(--play-2); transform: scale(1.06); }
/* Shuffle and repeat at the ends of the transport row: quiet until on; "on" is the text colour and a dot,
   repeat-one adds a small "۱". */
.player__btn--side { position: relative; width: 34px; height: 34px; color: var(--muted); }
.player__btn--side .icon { width: 18px; height: 18px; }
.player__btn--side[aria-pressed="true"], .player__btn--repeat:not([data-mode="off"]) { color: var(--accent); }
.player__btn--side[aria-pressed="true"]::after, .player__btn--repeat:not([data-mode="off"])::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.player__btn-badge { position: absolute; top: 3px; right: 2px; display: none; min-width: 13px; height: 13px; padding: 0 3px; border-radius: 7px; background: var(--text); color: var(--bg); font-size: 9px; font-weight: 900; line-height: 13px; text-align: center; }
.player__btn--repeat[data-mode="one"] .player__btn-badge { display: block; }
.player__seek { display: flex; align-items: center; gap: .6rem; width: 100%; max-width: 40rem; direction: ltr; }
.player__time { flex: none; min-width: 2.4rem; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }

/* Range inputs: thin bar, white fill from the left (the input is dir="ltr"), knob on hover. */
.player__range {
    flex: 1;
    height: 18px;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.player__range::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--play) var(--fill), var(--range-track) var(--fill));
}
.player__range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--range-track); }
.player__range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--play); }
.player__range::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
    margin-top: -4px;   /* centers the 12px thumb on the 4px track: (12-4)/2 = 4 */
    border: 0;
    border-radius: 50%;
    background: var(--text);
    box-shadow: 0 0 0 0 transparent;
    opacity: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: opacity .15s, box-shadow .15s;
}
.player__range::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--text);
    box-shadow: 0 0 0 0 transparent;
}
.player__range:hover::-webkit-slider-thumb, 
.player__range:focus-visible::-webkit-slider-thumb { 
    opacity: 1;
    box-shadow: 0 0 0 16px transparent; /* 44px touch target: 12px + (2 × 16px) = 44px */
}
.player__range:hover::-moz-range-thumb,
.player__range:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 16px transparent;
}
.player__range--volume { --fill: 100%; }

.player__volume { display: flex; align-items: center; justify-content: flex-start; gap: .25rem; }
.player__volume .player__range { max-width: 8rem; }
.player__status { position: absolute; bottom: calc(100% + .5rem); inset-inline: 0; width: max-content; max-width: calc(100% - 2rem); margin: 0 auto; padding: .45rem 1rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: .85rem; box-shadow: var(--shadow); }
.player__status:empty { display: none; }
.player.is-error .player__status { color: var(--danger); font-weight: 800; }
.player.is-loading .player__btn--main { opacity: .7; }

/* Queue panel: on desktop a popover above the bar on the end side (where its button is), on mobile a full
   sheet. Entries are buttons; the current one is tinted; auto-added entries come after a divider. */
.player__queue {
    position: absolute;
    bottom: calc(100% + .5rem);
    inset-inline-end: 1rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 2rem));
    max-height: min(60vh, 520px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: fk-rise var(--dur) var(--ease);
}
.player__queue[hidden] { display: none; }
.player__queue-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .5rem .5rem .9rem; border-bottom: 1px solid var(--line); }
.player__queue-title { font-size: .95rem; font-weight: 900; }
.player__queue-count { margin-inline-end: auto; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.player__queue-list { margin: 0; padding: .35rem; overflow-y: auto; overscroll-behavior: contain; list-style: none; scrollbar-width: thin; }
.player__queue-item button {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .35rem .5rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: start;
    cursor: pointer;
    transition: background-color var(--dur-fast);
}
.player__queue-item button:hover { background: var(--surface-2); }
.player__queue-item.is-current button { background: var(--surface-3); }
.player__queue-cover {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(140deg, #3d5c47, #182820);
    color: #d8b875;
    font-size: .9rem;
    font-weight: 900;
}
.player__queue-cover img { width: 100%; height: 100%; object-fit: cover; }
.player__queue-text { display: flex; flex-direction: column; min-width: 0; }
.player__queue-name, .player__queue-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player__queue-name { font-size: .88rem; font-weight: 800; }
.player__queue-artist { font-size: .78rem; color: var(--muted); }
.player__queue-divider { padding: .6rem .6rem .25rem; color: var(--muted); font-size: .74rem; font-weight: 800; }

/* The full "now playing" view is for mobile only. */
.player__sheet { display: none; }

@media (max-width: 991.98px) {
    /* Mini player above the tab bar: cover, title, play and next; the progress is a thin line on its bottom edge. */
    body.has-player { padding-bottom: calc(var(--tabbar-h) + var(--mini-h) + .5rem + env(safe-area-inset-bottom)); }
    .player {
        bottom: calc(var(--tabbar-h) + .4rem + env(safe-area-inset-bottom));
        inset-inline: .5rem;
        height: var(--mini-h);
        padding: 0 .5rem;
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: linear-gradient(to left, rgba(var(--ambient), .3), transparent 60%), var(--mini-bg);
        box-shadow: var(--shadow);
        overflow: visible;
    }
    .player__row { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
    .player__cover { position: relative; width: 42px; height: 42px; }
    /* Three moving bars over the mini cover while the track plays (player.js sets is-playing). */
    .player.is-playing .player__cover::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .38); }
    .player.is-playing .player__cover::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 16px;
        height: 16px;
        transform: translate(-50%, -50%);
        background:
            linear-gradient(#fff, #fff) 0 100% / 3px 50% no-repeat,
            linear-gradient(#fff, #fff) 50% 100% / 3px 100% no-repeat,
            linear-gradient(#fff, #fff) 100% 100% / 3px 70% no-repeat;
        animation: fk-eq .9s ease-in-out infinite alternate;
    }
    .player__title { font-size: .88rem; }
    .player__artist { font-size: .76rem; }
    .player__center { flex-direction: row; }
    .player__btn--prev, .player__btn--side, .player__time, .player__volume { display: none; }
    .player__btn--main { width: 38px; height: 38px; }
    /* The progress line sits inside the card along its bottom edge; the line itself is seekable (a 44px
       invisible thumb rides it), the rest of the card still opens the full view. */
    .player__seek { position: absolute; inset-inline: .75rem; bottom: 3px; z-index: 2; width: auto; max-width: none; }   /* width from the insets, not 100% (that pushed it past the card's edge) */
    .player__seek .player__range { height: 4px; }
    .player__seek .player__range::-webkit-slider-runnable-track { height: 2px; }
    .player__seek .player__range::-moz-range-track, .player__seek .player__range::-moz-range-progress { height: 2px; }
    /* The thumb stays invisible but is a 44px touch target so the thin line can be grabbed. */
    .player__seek .player__range::-webkit-slider-thumb { width: 44px; height: 44px; margin-top: -21px; background: transparent; opacity: 1; }
    .player__seek .player__range::-moz-range-thumb { width: 44px; height: 44px; background: transparent; }
    /* A transparent button over the mini player opens the full view; the controls and the seek stay on top of it. */
    .player__expand { display: block; position: absolute; inset: 0; z-index: 1; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
    .player__controls { position: relative; z-index: 2; }

    /* Full view, laid out like the reference's player page: artwork, a row with plays / title / likes, the
       seek bar with the times under it, shuffle / previous / play / next / repeat, and a row of actions. It
       does not scroll: the artwork takes what height is left. The queue and the lyrics are in a glass panel
       whose head peeks at the bottom (--sheet-peek) and which scrolls up over the view. */
    .player__sheet {
        --sheet-peek: 76px;
        position: fixed;
        inset: 0;
        z-index: 1070;
        display: flex;
        flex-direction: column;
        padding: calc(env(safe-area-inset-top) + .5rem) 1.5rem calc(env(safe-area-inset-bottom) + var(--sheet-peek) + .75rem);
        overflow: hidden;
        background: var(--bg);
        color: var(--text);
        animation: fk-sheet-in var(--dur-slow) var(--ease);
    }
    .player__sheet[hidden] { display: none; }
    .player__sheet-art { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
    .player__sheet-art img { width: 100%; height: 60%; object-fit: cover; filter: blur(48px) saturate(1.3); transform: scale(1.3); opacity: .45; }
    .player__sheet-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(var(--bg-rgb), .1), rgba(var(--bg-rgb), .9) 55%, var(--bg) 75%); }
    .player__sheet > :not(.player__sheet-art) { position: relative; z-index: 1; }
    .player__sheet-head { display: flex; align-items: center; gap: .75rem; min-height: 48px; margin-bottom: .5rem; }
    .player__sheet-head .icon-btn { background: rgba(var(--bg-rgb), .35); }
    .player__sheet-label { display: flex; flex: 1; flex-direction: column; align-items: center; min-width: 0; color: var(--muted); font-size: .72rem; font-weight: 700; text-align: center; }
    .player__sheet-source { max-width: 100%; overflow: hidden; color: var(--text); font-size: .88rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
    .player__sheet-source:empty { display: none; }
    /* The artwork fills the height the other rows leave (square, never wider than the view). */
    .player__sheet-body { display: grid; flex: 1 1 0; grid-template-rows: minmax(0, 1fr); place-items: center; min-height: 0; }
    .player__sheet-cover {
        display: grid;
        place-items: center;
        width: auto;
        height: min(100%, 100vw - 3rem);
        max-width: 100%;
        aspect-ratio: 1;
        overflow: hidden;
        border-radius: var(--radius);
        background: linear-gradient(140deg, #3d5c47, #182820);
        color: #d8b875;
        font-size: clamp(3rem, 18vw, 6rem);
        font-weight: 900;
        box-shadow: var(--shadow-lg);
    }
    .player__sheet-cover img { width: 100%; height: 100%; object-fit: cover; }
    /* plays | title and artist | likes */
    .player__sheet-info { display: grid; grid-template-columns: minmax(3rem, 1fr) minmax(0, auto) minmax(3rem, 1fr); align-items: center; gap: .5rem; margin: .9rem 0 .4rem; }
    .player__sheet-stat { display: flex; flex-direction: column; align-items: center; gap: .05rem; color: var(--muted); font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; }
    .player__sheet-stat:first-child { justify-self: start; }
    .player__sheet-stat:last-child { justify-self: end; }
    .player__sheet-stat.is-quiet { visibility: hidden; }   /* a play count under ten (player.js) */
    .player__sheet-stat > .icon { width: 22px; height: 22px; margin-bottom: .25rem; color: var(--text-2); }
    .player__sheet-stat .fav-btn { width: 40px; height: 40px; color: var(--text-2); }
    .player__sheet-stat .fav-btn .icon { width: 22px; height: 22px; }
    .player__sheet-text { display: flex; flex-direction: column; align-items: center; gap: .1rem; min-width: 0; text-align: center; }
    .player__sheet-title { max-width: 100%; overflow: hidden; margin: 0; color: var(--text); font-size: 1.05rem; font-weight: 900; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
    .player__sheet-title:hover { color: var(--text); text-decoration: underline; }
    .player__sheet-artist { max-width: 100%; overflow: hidden; margin: 0; color: var(--muted); font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
    /* Seek bar first (times under it), then the transport row with shuffle and repeat at its ends. */
    .player__sheet-controls .player__center { flex-direction: column; gap: 1.1rem; width: 100%; }
    /* width: 100% again (the mini player's rule above made it auto, which shrank it to the input's default). */
    .player__sheet-controls .player__seek { order: -1; position: static; display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "range range" "cur dur"; gap: .15rem .5rem; width: 100%; max-width: none; pointer-events: auto; }
    .player__sheet-controls .player__seek .player__range { width: 100%; }
    .player__sheet-controls .player__seek .player__range { grid-area: range; height: 24px; }
    .player__sheet-controls .player__seek .player__range::-webkit-slider-runnable-track { height: 4px; }
    .player__sheet-controls .player__seek .player__range::-moz-range-track, .player__sheet-controls .player__seek .player__range::-moz-range-progress { height: 4px; }
    /* The same 44px invisible hit area, showing the usual 14px dot. */
    .player__sheet-controls .player__seek .player__range::-webkit-slider-thumb { width: 44px; height: 44px; margin-top: -20px; background: radial-gradient(circle, var(--text) 7px, transparent 7.5px); opacity: 1; }
    .player__sheet-controls .player__seek .player__range::-moz-range-thumb { width: 44px; height: 44px; background: radial-gradient(circle, var(--text) 7px, transparent 7.5px); }
    .player__sheet-controls .player__time { display: block; color: var(--text-2); font-size: .76rem; }
    .player__sheet-controls .player__time[data-current] { grid-area: cur; text-align: left; }
    .player__sheet-controls .player__time[data-duration] { grid-area: dur; text-align: right; }
    .player__sheet-controls .player__controls { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; max-width: 22rem; margin: 0 auto; }
    .player__sheet-controls .player__btn { width: 48px; height: 48px; }
    .player__sheet-controls .player__btn .icon { width: 26px; height: 26px; }
    .player__sheet-controls .player__btn--prev, .player__sheet-controls .player__btn--side { display: grid; }
    .player__sheet-controls .player__btn--side .icon { width: 22px; height: 22px; }
    .player__sheet-controls .player__btn--main { width: 64px; height: 64px; box-shadow: 0 10px 24px rgba(var(--accent-rgb), .35); }
    .player__sheet-controls .player__btn--main .icon { width: 30px; height: 30px; }
    /* add to playlist, artist page, share, queue */
    .player__sheet-actions { display: flex; align-items: center; justify-content: space-evenly; margin: .8rem 0 0; }
    .player__action { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); text-decoration: none; cursor: pointer; transition: color var(--dur-fast), background-color var(--dur-fast); }
    .player__action .icon { width: 22px; height: 22px; }
    .player__action:hover { color: var(--text); background: var(--surface-2); }
    /* The glass panel. The drawer covers the view under its head and scrolls; its empty top (::before) lets
       taps through to the player (pointer-events), so only the panel itself takes touches and scrolls. */
    .player__sheet > .player__sheet-drawer {
        position: absolute;
        inset: calc(env(safe-area-inset-top) + 3.5rem + 8px) 0 0;
        z-index: 2;
        overflow-y: auto;
        overscroll-behavior: contain;
        scroll-snap-type: y proximity;
        scrollbar-width: none;
        pointer-events: none;
    }
    .player__sheet-drawer::-webkit-scrollbar { display: none; }
    .player__sheet-drawer::before { content: ""; display: block; height: calc(100% - var(--sheet-peek) - env(safe-area-inset-bottom)); scroll-snap-align: start; }
    .player__sheet-panel {
        position: relative;
        min-height: 100%;
        padding: 0 1rem calc(env(safe-area-inset-bottom) + 1rem);
        border-top: 1px solid var(--line);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        background: rgba(var(--bg-rgb), .55);
        -webkit-backdrop-filter: blur(28px) saturate(1.4);
        backdrop-filter: blur(28px) saturate(1.4);
        pointer-events: auto;
        scroll-snap-align: start;
    }
    /* Handle and tabs; they stay on top while the list scrolls under them. */
    .player__sheet-panel-head {
        position: sticky;
        top: 0;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: var(--sheet-peek);
        margin: 0 -1rem;
        padding: .15rem 1rem .6rem;
        border-radius: inherit;
        background: rgba(var(--bg-rgb), .35);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
    .player__sheet-handle { position: relative; width: 64px; height: 24px; padding: 0; border: 0; background: transparent; cursor: pointer; }
    .player__sheet-handle::before { content: ""; position: absolute; top: 10px; inset-inline: 0; width: 36px; height: 4px; margin-inline: auto; border-radius: 999px; background: var(--muted); opacity: .7; }
    .player__sheet-tabs { background: rgba(var(--bg-rgb), .45); }
    /* Lyrics tab: the whole text, centred. */
    .player__lyrics { padding: .75rem .25rem 1rem; }
    .player__lyrics[hidden] { display: none; }
    .player__lyrics-text { margin: 0; color: var(--text); font-size: 1.05rem; line-height: 2.1; text-align: center; white-space: pre-line; }
    /* Queue tab: translucent cards (player.js moves the queue panel in while the full view is open). */
    .player__sheet .player__queue { position: static; display: flex; flex-direction: column; width: auto; max-height: none; margin-top: .35rem; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; animation: none; }
    .player__sheet .player__queue[hidden] { display: none; }
    .player__sheet .player__queue-head { display: none; }
    .player__sheet .player__queue-list { display: flex; flex-direction: column; gap: .4rem; padding: 0; overflow: visible; }
    .player__sheet .player__queue-item button { min-height: 58px; padding: .45rem .6rem; border-radius: var(--radius); background: rgba(var(--bg-rgb), .35); }
    .player__sheet .player__queue-item button:hover { background: rgba(var(--bg-rgb), .5); }
    .player__sheet .player__queue-item.is-current button { background: rgba(var(--accent-rgb), .2); }
    .player__sheet .player__queue-cover { width: 44px; height: 44px; }
    .player__sheet .player__queue-divider { padding: .75rem .25rem .1rem; }
    body.player-open { overflow: hidden; }
    .player__btn--queue { display: none; }
}
@keyframes fk-sheet-in { from { transform: translateY(100%); } }

/* ---------- forms (account) ---------- */

.auth { display: flex; justify-content: center; padding: 2.5rem 0 3rem; }
.auth__card {
    width: min(100% - 2rem, 26rem);
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.auth__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto .75rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
}
.auth__icon .icon { width: 26px; height: 26px; }
.auth__title { margin-bottom: .3rem; font-size: 1.4rem; font-weight: 800; text-align: center; }
.auth__lead { margin-bottom: 1.25rem; color: var(--text-2); font-size: .92rem; text-align: center; }
.auth__aside { margin: 1rem 0 0; text-align: center; }
.auth__aside a, .auth__switch a { color: var(--text); font-weight: 700; }
.auth__switch { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); text-align: center; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form__submit { width: 100%; margin-top: .25rem; }
.auth-form.is-busy .auth-form__submit { cursor: progress; opacity: .75; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field__label { font-weight: 800; font-size: .92rem; }
.field__optional { font-size: .85rem; font-weight: 400; color: var(--muted); }
.field__control { position: relative; display: flex; }
.field__input {
    width: 100%;
    min-height: 46px;
    padding: .5rem .9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;   /* 16px: no zoom on focus in iOS */
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field__input::placeholder { color: var(--muted); }
.field__input:focus { border-color: var(--accent); box-shadow: 0 0 0 .2rem var(--accent-soft); }
.field__input:focus:not(:focus-visible) { outline: none; }
.field__input[readonly] { background: var(--surface-2); color: var(--muted); }
.field__input[aria-invalid="true"] { border-color: var(--danger); }
.field__input[autocomplete="one-time-code"] { font-size: 1.5rem; font-weight: 800; letter-spacing: .5em; text-align: center; }
.field__control--password .field__input { padding-inline-end: 3.25rem; }
.field__toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: .25rem;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transform: translateY(-50%);
}
.field__toggle:hover { color: var(--text); background: var(--surface-2); }
.field__eye-off { display: none; }
.field__toggle[aria-pressed="true"] .field__eye { display: none; }
.field__toggle[aria-pressed="true"] .field__eye-off { display: inline; }
.field__hint { margin: 0; font-size: .85rem; color: var(--muted); }
.field__error { margin: 0; font-size: .88rem; font-weight: 800; color: var(--danger); }
.field__error:empty { display: none; }

.form-alert, .form-success { margin: 0; padding: .7rem .95rem; border-radius: var(--radius); font-weight: 800; }
.form-alert { background: var(--danger-bg); color: var(--danger); }
.form-success { background: var(--ok-bg); color: var(--ok); }

.otp-sent { margin: 0; padding: .75rem .95rem; border-radius: var(--radius); background: var(--surface-2); text-align: center; }
.otp-sent__mobile { font-weight: 900; }
.otp-debug { margin: 0; padding: .5rem .95rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); font-size: .88rem; text-align: center; color: var(--text-2); }
.otp-actions { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 0; color: var(--muted); }
.link-btn {
    min-height: 44px;
    padding: 0 .25rem;
    border: 0;
    background: none;
    color: var(--text);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: .2em;
    cursor: pointer;
}
.link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* ---------- account pages ---------- */

.account-hero { position: relative; padding-block: 1.75rem 1.25rem; }
.account-hero__title { margin: 0; font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 800; overflow-wrap: anywhere; }
.account-hero__lead { max-width: 46rem; margin: .3rem 0 0; color: var(--text-2); font-size: .92rem; }

.account-nav { display: flex; gap: .4rem; margin-top: .25rem; padding: .25rem .1rem .6rem; overflow-x: auto; scrollbar-width: none; }
.account-nav::-webkit-scrollbar { display: none; }
.account-nav__link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex: none;
    min-height: 38px;
    padding: .3rem .9rem;
    border: 0;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    font-size: .88rem;
    text-decoration: none;
    cursor: pointer;
}
.account-nav__link:hover { color: var(--text); background: var(--surface-2); }
.account-nav__link[aria-current="page"] { background: var(--inverse); color: var(--on-inverse); }
.account-nav__logout { margin-inline-start: auto; color: var(--danger); }
.account-nav__logout .icon { transform: scaleX(-1); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; margin: 0 0 2.25rem; padding: 0; list-style: none; }
.stat-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon value" "icon label";
    align-items: center;
    column-gap: .85rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: background-color var(--dur-fast);
}
.stat-card:hover { color: var(--text); background: var(--surface-2); }
.stat-card__icon { grid-area: icon; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); color: var(--text); }
.stat-card__value { grid-area: value; font-size: 1.4rem; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card__label { grid-area: label; font-size: .86rem; color: var(--muted); }
@media (max-width: 575.98px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
    .stat-card { grid-template-columns: 1fr; grid-template-areas: "icon" "value" "label"; justify-items: center; row-gap: .2rem; padding: .85rem .4rem; text-align: center; }
    .stat-card__icon { width: 38px; height: 38px; }
    .stat-card__value { font-size: 1.3rem; }
    .stat-card__label { font-size: .78rem; line-height: 1.4; }
}

.session-list { display: flex; flex-direction: column; gap: .5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.session-card { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--surface); }
.session-card.is-current { box-shadow: inset 0 0 0 2px var(--accent-line); }
.session-card__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-3); color: var(--text); }
.session-card__body { flex: 1; min-width: 0; }
.session-card__device { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; font-weight: 800; }
.session-card__meta { margin: .15rem 0 0; font-size: .86rem; color: var(--muted); }
.badge-current { padding: .1rem .6rem; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: .76rem; font-weight: 900; }
@media (max-width: 575.98px) {
    .session-card { flex-wrap: wrap; }
    .session-card .btn { margin-inline-start: auto; }
}

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; align-items: start; }
.settings-card { padding: 1.5rem; border-radius: var(--radius); background: var(--surface); }
.settings-card__title { margin-bottom: 1rem; font-size: 1.1rem; }
.settings-card .auth-form__submit { width: auto; align-self: flex-start; }

/* ---------- playlists: picker dialog and forms ---------- */

.picker { position: fixed; inset: 0; z-index: 1090; display: grid; place-items: end center; }
.picker[hidden] { display: none; }
.picker__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: fk-fade var(--dur) var(--ease); }
.picker__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 30rem);
    max-height: min(80vh, 36rem);
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: fk-sheet-in var(--dur-slow) var(--ease);
}
@media (min-width: 768px) {
    .picker { place-items: center; }
    .picker__panel { border-radius: var(--radius-lg); padding-bottom: 1rem; animation: fk-rise var(--dur) var(--ease); }
}
.picker__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.picker__title { margin: 0; font-size: 1.05rem; }
.picker__new { display: flex; gap: .5rem; margin-bottom: .5rem; }
.picker__new .field__input { flex: 1; min-height: 42px; }
.picker__new.is-busy { opacity: .7; }
.picker__list { margin: .25rem 0 0; padding: 0; overflow-y: auto; list-style: none; }
.picker__empty { padding: .75rem .25rem; color: var(--muted); font-size: .9rem; }
.picker__item {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    min-height: 46px;
    padding: .4rem .6rem;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text);
    text-align: start;
    cursor: pointer;
    transition: background-color var(--dur-fast);
}
.picker__item:hover { background: var(--surface-2); }
.picker__item.is-busy { opacity: .6; }
.picker__name { flex: 1; min-width: 0; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.picker__meta { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.picker__mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); color: transparent; transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.picker__mark .icon { width: 15px; height: 15px; }
.picker__item[aria-pressed="true"] .picker__mark { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
body.picker-open { overflow: hidden; }

.playlist-form { max-width: 34rem; margin-bottom: 1.5rem; }
.playlist-form__row { display: flex; align-items: flex-end; gap: .5rem; }
.playlist-form__row .field { flex: 1; }
.playlist-form__submit { width: auto; margin: 0 0 1.55rem; }
.playlist-delete { color: var(--danger); margin-inline-start: auto; }

/* ---------- plans and payments ---------- */

.sub-banner {
    margin: 0 0 1.5rem;
    padding: .85rem 1.1rem;
    border-inline-start: 4px solid var(--gold);
    border-radius: var(--radius);
    background: var(--surface);
    font-weight: 700;
}

.gateway-choice { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 1.25rem; padding: 0; border: 0; }
.gateway-choice__legend { float: none; width: auto; margin: 0; font-size: 1rem; font-weight: 800; }
.gateway-choice__option {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    min-height: 44px;
    padding: .3rem .95rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
}
.gateway-choice__option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.gateway-choice__option input { accent-color: var(--text); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding: 1.25rem 1.15rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: background-color var(--dur-fast);
}
.plan-card:hover { background: var(--surface-2); }
.plan-card__name { margin: 0; font-size: 1.1rem; }
.plan-card__price { display: flex; align-items: baseline; gap: .4rem; margin: .2rem 0 0; color: var(--text); }
.plan-card__amount { font-size: 1.9rem; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.plan-card__unit { font-weight: 800; }
.plan-card__period { margin: 0; color: var(--muted); }
.plan-card__monthly { white-space: nowrap; }
.plan-card__description { margin: 0; color: var(--text-2); }
.plan-card__features { display: flex; flex-direction: column; gap: .4rem; margin: .5rem 0 1rem; padding: 0; list-style: none; color: var(--text-2); }
.plan-card__features li { display: flex; align-items: flex-start; gap: .5rem; }
.plan-card__features .icon { margin-top: .2em; color: var(--gold); }
.plan-card__buy { margin-top: auto; width: 100%; }
.plan-card__buy.is-busy { cursor: progress; opacity: .75; }

.faq details { margin-bottom: .5rem; padding: .85rem 1.1rem; border-radius: var(--radius); background: var(--surface); }
.faq summary { min-height: 28px; font-weight: 800; cursor: pointer; }
.faq details p { margin: .5rem 0 0; color: var(--text-2); }

.result-card__icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto .85rem; border-radius: 50%; }
.result-card__icon .icon { width: 36px; height: 36px; }
.result-card--paid .result-card__icon { background: var(--ok-bg); color: var(--ok); }
.result-card--pending .result-card__icon { background: var(--surface-2); color: var(--text); }
.result-card--failed .result-card__icon { background: var(--danger-bg); color: var(--danger); }
.result-card__facts { display: grid; gap: .45rem; margin: 0 0 1.25rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--bg); }
.result-card__facts > div { display: flex; justify-content: space-between; gap: 1rem; }
.result-card__facts dt { font-weight: 700; color: var(--muted); }
.result-card__facts dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.result-card__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }

.sub-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.25rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--surface);
}
.sub-status.is-active { box-shadow: inset 0 0 0 1px var(--accent-line); }
.sub-status__icon { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--surface-3); color: var(--muted); }
.sub-status.is-active .sub-status__icon { background: var(--gold); color: var(--on-gold); }
.sub-status__body { flex: 1 1 16rem; min-width: 0; }
.sub-status__title { margin: 0 0 .2rem; font-size: 1.1rem; }
.sub-status__text { margin: 0; color: var(--text-2); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: start; white-space: nowrap; }
.data-table th { font-size: .82rem; color: var(--muted); font-weight: 800; }
.data-table tr:last-child td { border-bottom: 0; }
.status-pill { display: inline-block; padding: .1rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 800; }
.status-pill.is-ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.is-wait { background: var(--surface-3); color: var(--text); }
.status-pill.is-bad { background: var(--danger-bg); color: var(--danger); }
.status-pill.is-muted { background: var(--surface-3); color: var(--muted); }

/* ---------- toast ---------- */

.fk-toast {
    position: fixed;
    inset-inline: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 1060;
    max-width: 26rem;
    margin-inline: auto;
    padding: .8rem 1.1rem;
    border-radius: var(--radius);
    background: var(--inverse);
    color: var(--on-inverse);
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.fk-toast.is-visible { opacity: 1; transform: none; }
.fk-toast.is-error { background: #f2c6b9; color: #4a1d12; }
body.has-player .fk-toast { bottom: calc(var(--player-h) + 1rem); }
@media (max-width: 991.98px) {
    .fk-toast { bottom: calc(var(--tabbar-h) + 1rem + env(safe-area-inset-bottom)); }
    body.has-player .fk-toast { bottom: calc(var(--tabbar-h) + var(--mini-h) + 1.25rem + env(safe-area-inset-bottom)); }
}

/* ---------- loading state during partial navigation ---------- */

#main[aria-busy="true"] { opacity: .55; transition: opacity .2s .15s; }
#main[aria-busy="true"] .skeleton { opacity: 1; }

/* Skeleton of the next page (nav.js shows it when a page takes more than 400 ms) */
.skeleton { padding-top: 1.5rem; }
.skeleton__bar, .skeleton__art, .skeleton__dot {
    border-radius: 8px;
    background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: fk-shimmer 1.2s linear infinite;
}
.skeleton__bar { height: 14px; margin-bottom: .6rem; width: 60%; }
.skeleton__bar--title { height: 26px; width: 35%; margin-bottom: .8rem; }
.skeleton__bar--lead { width: 50%; margin-bottom: 1.5rem; }
.skeleton__bar--short { width: 40%; }
.skeleton__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: .75rem; margin-bottom: 1.75rem; }
.skeleton__card .skeleton__bar { width: 85%; }
.skeleton__art { aspect-ratio: 1; margin-bottom: .6rem; border-radius: 10px; }
.skeleton__row { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.skeleton__row .skeleton__bar { flex: 1; max-width: 22rem; margin: 0; }
.skeleton__dot { flex: none; width: 36px; height: 36px; border-radius: 50%; }
@keyframes fk-shimmer { to { background-position: -200% 0; } }

/* ---------- shared card hover and press ---------- */
/* One quiet treatment for every clickable card or row: a small lift with the card shadow on hover and a
   soft press on activation. The transform transition lives here so hover and press never fight each other. */
.mcard__art, .featured-card__art, .track-row, .for-you__card, .player__queue-item button, .stat-card, .plan-card {
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background-color var(--dur-fast);
}
.mcard:hover .mcard__art, .featured-card:hover .featured-card__art, .track-row:hover, .for-you__card:hover, .stat-card:hover, .plan-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}
.player__queue-item button:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.mcard:active .mcard__art, .featured-card:active .featured-card__art, .track-row:active, .for-you__card:active,
.player__queue-item button:active, .stat-card:active, .plan-card:active {
    transform: scale(.97);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
    .region-card:hover, .stat-card:hover, .plan-card:hover, .mcard__play, .btn-brand:hover, .play-btn--hero:hover, .mcard:hover .mcard__art .cover, .featured-card:hover .featured-card__art .cover,
    .mcard:hover .mcard__art, .featured-card:hover .featured-card__art, .track-row:hover, .for-you__card:hover, .player__queue-item button:hover,
    .mcard:active .mcard__art, .featured-card:active .featured-card__art, .track-row:active, .for-you__card:active, .player__queue-item button:active, .stat-card:active, .plan-card:active { transform: none; }
    .shelf__list > li, .card-grid > li, .track-list > li, .featured__list > li, .site-main.is-entering { animation: none; opacity: 1; }
    .skeleton__bar, .skeleton__art, .skeleton__dot { animation: none; background: var(--surface-2); }
    .play-btn--row[aria-pressed="true"] .icon, .mcard__play[aria-pressed="true"] .icon, .play-btn--hero[aria-pressed="true"] .icon { opacity: .55; }
    .play-btn--row[aria-pressed="true"]::after, .mcard__play[aria-pressed="true"]::after { display: none; }
}
