/* ══════════════════════════════════════════════════════════════
   MixMint UX layer v2 — motion, polish & accessibility system.
   Theme-aware: built entirely on the design tokens in base.html,
   so dark + light themes inherit everything automatically.
   Loaded on EVERY page via base.html after style.css.
   ══════════════════════════════════════════════════════════════ */

/* ── Scroll progress bar (JS sets --scroll) ─────────────────── */
#ux-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: calc(var(--scroll, 0) * 100%);
    background: linear-gradient(90deg, var(--accent-mint), var(--accent-blue));
    box-shadow: var(--shadow-glow);
    z-index: 99990;
    pointer-events: none;
}

/* ── Scroll-triggered reveal (JS adds .in on intersect) ─────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px) scale(0.99);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}
[data-reveal].in {
    opacity: 1;
    transform: none;
}
[data-reveal="left"] { transform: translateX(-30px); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal="zoom"] { transform: scale(0.94); }
[data-reveal].in { transform: none; }

/* ── Card lift (grids of tracks/albums/DJs) ─────────────────── */
.lift {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    border-color: color-mix(in srgb, var(--accent-mint) 40%, transparent);
}
.lift:active { transform: translateY(-1px) scale(0.995); }

/* ── Button sheen sweep ─────────────────────────────────────── */
.btn-mm { position: relative; overflow: hidden; isolation: isolate; }
.btn-mm::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 60%);
    transform: translateX(-120%);
    transition: transform 0.6s ease;
    pointer-events: none;
}
.btn-mm:hover::after { transform: translateX(120%); }
.btn-mm:active { transform: scale(0.98); }
.btn-mm:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-mm:disabled::after { display: none; }

/* ── Focus visibility (keyboard users) ──────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--accent-mint);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ── Text selection + scrollbar ─────────────────────────────── */
::selection { background: var(--accent-mint); color: #000; }
* { scrollbar-width: thin; scrollbar-color: var(--accent-mint) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--accent-mint) 45%, transparent);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: var(--accent-mint);
    background-clip: content-box;
    border: 2px solid transparent;
}

/* ── Skeleton shimmer (loading states) ──────────────────────── */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-elevated);
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.07) 50%, transparent 80%);
    animation: ux-shimmer 1.6s infinite;
}
@keyframes ux-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ── Toast upgrades ─────────────────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 99995;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(92vw, 360px);
}
.toast-item {
    animation: ux-toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow-card);
}
@keyframes ux-toast-in {
    from { opacity: 0; transform: translateX(30px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

/* ── Animated gradient headline helper ──────────────────────── */
.grad-text {
    background: linear-gradient(100deg, var(--text-primary) 20%, var(--accent-mint) 50%, var(--text-primary) 80%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: ux-grad-pan 7s linear infinite;
}
@keyframes ux-grad-pan {
    to { background-position: 220% center; }
}

/* ── Floating ambient blobs (hero sections) ─────────────────── */
.ux-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(90px);
    opacity: 0.16;
    pointer-events: none;
    animation: ux-float 11s ease-in-out infinite alternate;
}
@keyframes ux-float {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(46px, -30px) scale(1.12); }
}

/* ── Marquee strip (announcements/offers) ───────────────────── */
.ux-marquee { overflow: hidden; white-space: nowrap; }
.ux-marquee > span {
    display: inline-block;
    padding-right: 3rem;
    animation: ux-marquee 22s linear infinite;
}
@keyframes ux-marquee {
    to { transform: translateX(-50%); }
}

/* ── Back-to-top button ─────────────────────────────────────── */
#ux-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 5.5rem;
    z-index: 99990;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--accent-mint);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
#ux-to-top.show { opacity: 1; transform: none; pointer-events: auto; }
#ux-to-top:hover { border-color: var(--accent-mint); }

/* ── Number counter pop ─────────────────────────────────────── */
[data-count].counted { animation: ux-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes ux-pop {
    0% { transform: scale(0.85); }
    60% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* ── Image treatment ────────────────────────────────────────── */
img { -webkit-user-drag: none; }
.img-frame { overflow: hidden; border-radius: inherit; }
.img-frame img { transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease; }
.img-frame:hover img { transform: scale(1.05); }

/* ── Form polish ────────────────────────────────────────────── */
.input-mm { transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.input-mm:focus {
    border-color: var(--accent-mint);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-mint) 22%, transparent);
    outline: none;
}
.input-mm::placeholder { opacity: 0.45; }

/* ── Table row hover (dashboards) ───────────────────────────── */
tbody tr { transition: background-color 0.18s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--accent-mint) 5%, transparent); }

/* ── Page-enter fade (applies once per load) ────────────────── */
main#main { animation: ux-page-in 0.45s ease both; }
@keyframes ux-page-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ── Respect reduced motion: design must never depend on it ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
    }
    [data-reveal] { opacity: 1; transform: none; }
    main#main { animation: none; }
    .ux-marquee > span { animation: none; }
}

/* ══════════════════════════════════════════════════════════════
   UX layer v3 — checkout, library, mobile tab bar, a11y polish.
   ══════════════════════════════════════════════════════════════ */

/* Theme colours now animate only while the theme is switching
   (the old global `* { transition }` made every hover/scroll repaint). */
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* WCAG AA: light-theme muted text was 4.1:1 on cream; now ≥ 4.6:1. */
:root[data-theme="light"] { --text-muted: #625848; }

/* ── Spinner + busy buttons ─────────────────────────────────── */
.mm-spinner {
    width: 16px; height: 16px; flex: 0 0 16px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%; display: inline-block;
    animation: mm-spin 0.7s linear infinite;
}
@keyframes mm-spin { to { transform: rotate(360deg); } }
.btn-mm.is-busy { cursor: progress; }
.btn-mm.is-busy:hover { transform: none; }

/* ── Payment overlay ────────────────────────────────────────── */
#mm-pay-overlay {
    position: fixed; inset: 0; z-index: 100000;
    display: grid; place-items: center; padding: 24px;
    background: color-mix(in srgb, var(--bg-base) 82%, transparent);
    backdrop-filter: blur(10px);
}
#mm-pay-overlay[hidden] { display: none; }
#mm-pay-overlay .mm-pay-card {
    width: min(420px, 100%); text-align: center;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 36px 28px; box-shadow: var(--shadow-card);
    animation: ux-page-in 0.35s ease both;
}
.mm-pay-icon { width: 72px; height: 72px; margin: 0 auto 18px; }
.mm-pay-icon circle { fill: none; stroke: var(--border); stroke-width: 4; }
.mm-pay-icon .ring { stroke: var(--accent-mint); stroke-dasharray: 190; stroke-dashoffset: 190; stroke-linecap: round; }
.mm-pay-icon .tick { fill: none; stroke: var(--accent-mint); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 60; stroke-dashoffset: 60; }
#mm-pay-overlay[data-state="pending"] .ring { animation: mm-ring-spin 1.1s linear infinite; stroke-dashoffset: 120; transform-origin: center; }
#mm-pay-overlay[data-state="success"] .ring { animation: mm-draw 0.6s ease forwards; }
#mm-pay-overlay[data-state="success"] .tick { animation: mm-draw 0.35s 0.45s ease forwards; }
#mm-pay-overlay[data-state="pending"] [data-close] { display: none; }
@keyframes mm-draw { to { stroke-dashoffset: 0; } }
@keyframes mm-ring-spin { to { transform: rotate(360deg); } }

/* ── Status badges (library / dashboards) ───────────────────── */
.mm-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
    padding: 4px 10px; border-radius: 999px; white-space: nowrap;
    background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border);
}
.mm-badge--ok { color: var(--accent-mint); border-color: color-mix(in srgb, var(--accent-mint) 35%, transparent);
    background: color-mix(in srgb, var(--accent-mint) 10%, transparent); }
.mm-badge--warn { color: var(--accent-amber); border-color: color-mix(in srgb, var(--accent-amber) 35%, transparent);
    background: color-mix(in srgb, var(--accent-amber) 10%, transparent); }
.mm-badge--bad { color: var(--accent-red); border-color: color-mix(in srgb, var(--accent-red) 35%, transparent);
    background: color-mix(in srgb, var(--accent-red) 10%, transparent); }

/* ── Segmented tabs ─────────────────────────────────────────── */
.mm-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px;
    background: var(--bg-surface); border: 1px solid var(--border); }
.mm-tab { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--text-muted);
    padding: 8px 16px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; min-height: 40px; }
.mm-tab[aria-selected="true"] { background: var(--bg-elevated); color: var(--text-primary); box-shadow: var(--shadow-card); }

/* ── Empty states ───────────────────────────────────────────── */
.mm-empty { text-align: center; padding: 56px 20px; border: 1px dashed var(--border); border-radius: 16px;
    color: var(--text-muted); }
.mm-empty h3 { color: var(--text-primary); font-size: 20px; margin: 12px 0 6px; }

/* ── Library rows ───────────────────────────────────────────── */
.mm-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center;
    padding: 14px 16px; border-radius: 14px; background: var(--bg-surface); border: 1px solid var(--border); }
.mm-row + .mm-row { margin-top: 10px; }
.mm-row__art { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--bg-elevated); }
.mm-row__meta { min-width: 0; }
.mm-row__title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-row__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 640px) {
    .mm-row { grid-template-columns: 48px 1fr; }
    .mm-row__art { width: 48px; height: 48px; }
    .mm-row__actions { grid-column: 1 / -1; justify-content: stretch; }
    .mm-row__actions > * { flex: 1 1 auto; }
}

/* ── Cart tier progress ─────────────────────────────────────── */
.mm-progress { height: 8px; border-radius: 999px; background: var(--bg-elevated); overflow: hidden; }
.mm-progress > span { display: block; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-mint), var(--accent-blue)); transition: width 0.5s ease; }

/* ── Password field reveal ──────────────────────────────────── */
.mm-field { position: relative; }
.mm-field .mm-reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    min-width: 44px; min-height: 36px; border: 0; background: transparent; color: var(--text-muted);
    font-family: var(--font-mono); font-size: 11px; cursor: pointer; border-radius: 8px; }
.mm-field .mm-reveal:hover { color: var(--accent-mint); }
.mm-field-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.mm-field-hint[data-state="bad"] { color: var(--accent-red); }
.mm-field-hint[data-state="ok"] { color: var(--accent-mint); }

/* ── Mobile bottom tab bar (logged-in) ──────────────────────── */
.mm-tabbar { display: none; }
@media (max-width: 767px) {
    .mm-tabbar {
        display: grid; grid-template-columns: repeat(4, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--bg-base) 92%, transparent); backdrop-filter: blur(14px);
        border-top: 1px solid var(--border);
    }
    .mm-tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        min-height: 52px; border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--text-muted);
        text-decoration: none; }
    .mm-tabbar a svg { width: 22px; height: 22px; }
    .mm-tabbar a[aria-current="page"] { color: var(--accent-mint); background: color-mix(in srgb, var(--accent-mint) 8%, transparent); }
    body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    body.has-tabbar #ux-to-top { bottom: calc(84px + env(safe-area-inset-bottom)); }
    .toast-container { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ── Touch targets ≥ 44px on small screens ─────────────────── */
@media (pointer: coarse) {
    .btn-mm { min-height: 48px; }
    .input-mm { min-height: 48px; font-size: 16px; } /* 16px stops iOS zoom-on-focus */
}

/* ── Visually hidden (screen-reader only) ──────────────────── */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
    .mm-spinner, #mm-pay-overlay .ring, #mm-pay-overlay .tick, .mesh-blob, main { animation: none !important; }
    .mm-progress > span { transition: none; }
}

/* ── Mobile sticky buy bar (track / album pages) ────────────── */
.mm-buybar { position: fixed; left: 12px; right: 12px; z-index: 59;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 10px 10px 16px; border-radius: 16px;
    background: color-mix(in srgb, var(--bg-surface) 94%, transparent); backdrop-filter: blur(14px);
    border: 1px solid var(--border); box-shadow: var(--shadow-card); }
.mm-buybar[hidden] { display: none; }
body.has-tabbar .mm-buybar { bottom: calc(80px + env(safe-area-inset-bottom)); }

/* ══════════════════════════════════════════════════════════════
   UX layer v4 — layout safety, contrast, touch targets, polish.
   ══════════════════════════════════════════════════════════════ */

/* No sideways scrolling on any page. Decorative glows/blobs and the
   ticker used to push pages 30–200px wider than the screen on phones. */
html, body { overflow-x: clip; max-width: 100%; }
.mesh-gradient, .noise-overlay { inset: 0; width: 100%; overflow: hidden; }
main#main { overflow-x: clip; }
h1, h2, h3, h4, .mm-wrap { overflow-wrap: anywhere; word-break: normal; hyphens: auto; }

/* WCAG AA contrast for secondary text in both themes (was 3.3–3.8:1 in dark). */
:root[data-theme="dark"] { --text-muted: #9494A8; }
:root[data-theme="light"] { --text-muted: #5A5040; --accent-mint: #006B4A; --accent-amber: #8F5B00; --border-focus: #006B4A; }

/* Links inside running text must be distinguishable without colour. */
main p a:not(.btn-mm), main li a:not(.btn-mm), .notice-info a, .notice-warning a { text-decoration: underline; text-underline-offset: 3px; }

/* Buttons never wrap their label onto two lines. */
.btn-mm { white-space: nowrap; }
@media (max-width: 380px) { .btn-mm { white-space: normal; } }

/* Comfortable touch targets on phones (≥ 40px) for links in nav, footer and breadcrumbs. */
@media (max-width: 768px) {
    .mm-footer a, .mm-breadcrumb a, nav[aria-label="Breadcrumb"] a { display: inline-flex; align-items: center; min-height: 40px; min-width: 40px; }
    .mm-footer ul { row-gap: 2px; }
}

/* Section headers: label and "View all" on one baseline. */
.mm-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.mm-section-head h2 { margin: 0; }
.mm-section-head a { display: inline-flex; align-items: center; min-height: 40px; font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.mm-section-head a:hover { color: var(--accent-mint); }

/* Initials avatar used when a DJ has no photo. */
.mm-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 9999px;
    background: color-mix(in srgb, var(--accent-mint) 16%, var(--bg-elevated)); color: var(--accent-mint);
    font-family: var(--font-display, inherit); font-weight: 700; letter-spacing: 0.02em; }

/* Free items get a clear badge instead of "₹0". */
.mm-free { color: var(--accent-mint); font-weight: 700; }

/* Empty states. */
.mm-empty { text-align: center; padding: 48px 24px; border: 1px dashed var(--border); border-radius: 16px; color: var(--text-muted); }
.mm-empty h3 { color: var(--text-primary); font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.mm-empty .btn-mm { margin-top: 18px; }

/* Skeleton shimmer for loading lists. */
.mm-skeleton { background: linear-gradient(90deg, var(--bg-elevated) 25%, color-mix(in srgb, var(--bg-elevated) 70%, var(--text-muted)) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%; animation: mm-shimmer 1.4s ease-in-out infinite; border-radius: 8px; }
@keyframes mm-shimmer { to { background-position: -200% 0; } }

/* If JavaScript is slow or blocked, reveal-on-scroll content must still show. */
html:not(.js-ready) [data-reveal] { opacity: 1; transform: none; }

/* Stat cards: numbers never overflow their card. */
.mm-stat-value { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Explore search: input and button stack cleanly on phones. */
.mm-search { display: flex; gap: 10px; align-items: stretch; }
.mm-search input { flex: 1 1 auto; min-width: 0; }
@media (max-width: 640px) { .mm-search { flex-direction: column; } .mm-search .btn-mm { width: 100%; } }

@media (prefers-reduced-motion: reduce) { .mm-skeleton { animation: none; } }

/* Light theme: headings/labels hard-coded as white text were invisible on cream
   backgrounds (1.04:1). Keep white only on coloured surfaces and buttons. */
:root[data-theme="light"] .text-white:not([class*="bg-"]):not(.btn-mm):not(.btn-mm *):not([class*="bg-"] > *):not(.toast *),
:root[data-theme="light"] .hover\:text-white:hover:not(.btn-mm),
:root[data-theme="light"] .group:hover .group-hover\:text-white { color: var(--text-primary); }
:root[data-theme="light"] input.text-white, :root[data-theme="light"] textarea.text-white { color: var(--text-primary); }

/* ── Settings sections (account, store profile) ── */
.mm-card-section { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
@media (min-width: 640px) { .mm-card-section { padding: 28px; } }

/* ── Floating Help button + panel ── */
.mm-help { position: fixed; right: 16px; bottom: 16px; z-index: 60; }
.mm-help-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 999px;
    background: var(--text-primary); color: var(--bg-base); font-weight: 700; font-size: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18); transition: transform .15s ease; }
.mm-help-btn:hover { transform: translateY(-1px); }
.mm-help-btn:focus-visible { outline: 2px solid var(--accent-mint); outline-offset: 3px; }
.mm-help-panel { position: absolute; right: 0; bottom: 60px; width: min(380px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 120px));
    overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25); outline: none; }
@media (max-width: 767px) {
  /* sit above the phone tab bar */
  body:has(.mm-tabbar) .mm-help { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .mm-help-btn { height: 44px; padding: 0 14px; }
  .mm-help-btn span { display: none; }
  .mm-help-panel { position: fixed; left: 16px; right: 16px; width: auto; bottom: calc(136px + env(safe-area-inset-bottom)); max-height: calc(100vh - 200px); }
}
@media print { .mm-help { display: none; } }
@media (max-width: 767px) {
  /* product pages: keep Help above the sticky Buy bar */
  body:has(.mm-buybar:not([hidden])) .mm-help { bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.has-tabbar:has(.mm-buybar:not([hidden])) .mm-help { bottom: calc(148px + env(safe-area-inset-bottom)); }
}

/* ── Release cards (catalogue) ── */
.mm-rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) { .mm-rgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1024px) { .mm-rgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }
.mm-rcard { position: relative; display: flex; flex-direction: column; background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.mm-rcard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent-mint) 45%, var(--border)); box-shadow: var(--shadow-card); }
.mm-rcard-art { position: relative; aspect-ratio: 1; background: var(--bg-elevated); overflow: hidden; }
.mm-rcard-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.mm-rcard:hover .mm-rcard-art img { transform: scale(1.04); }
.mm-rcard-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-mint) 22%, var(--bg-elevated)), var(--bg-elevated)); }
.mm-rcard-ph span { font-family: var(--font-display); font-size: 44px; font-weight: 700; color: var(--text-muted); }
.mm-badge { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
    background: color-mix(in srgb, var(--bg-base) 82%, transparent); color: var(--text-primary); backdrop-filter: blur(6px); }
.mm-badge + .mm-badge { left: auto; right: 8px; }
.mm-badge-hot { background: var(--accent-amber); color: #000; }
.mm-badge-pro { background: var(--accent-mint); color: var(--bg-base); }
.mm-rcard { container-type: inline-size; }
.mm-rcard-play { position: absolute; right: 10px; top: calc(100cqw - 54px); z-index: 2; width: 44px; height: 44px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center; background: var(--accent-mint); color: var(--bg-base);
    box-shadow: 0 6px 18px rgba(0,0,0,.25); transition: transform .15s ease; }
.mm-rcard-play:hover { transform: scale(1.06); }
.mm-rcard-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mm-rcard-title { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm-rcard-title a:hover { color: var(--accent-mint); }
.mm-rcard-meta { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-rcard-meta a:hover { text-decoration: underline; }
.mm-rcard-price { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; }
.mm-rcard-price strong { font-family: var(--font-mono); font-size: 16px; color: var(--accent-mint); }
.mm-rcard-price s { color: var(--text-muted); }
.mm-rcard-price em { font-style: normal; font-weight: 700; font-size: 11px; color: var(--accent-amber); }

/* ── Chips / tabs row ── */
.mm-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.mm-chips::-webkit-scrollbar { display: none; }
.mm-chip { flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); display: inline-flex; align-items: center;
    font-size: 13px; font-weight: 600; color: var(--text-muted); background: var(--bg-surface); white-space: nowrap; }
.mm-chip:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent-mint) 40%, var(--border)); }
.mm-chip[aria-current="page"], .mm-chip.is-on { background: var(--text-primary); color: var(--bg-base); border-color: var(--text-primary); }

/* ── Preview pop-up ── */
.mm-preview { width: min(720px, calc(100vw - 24px)); padding: 16px; }
.mm-preview-box { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.mm-preview-box[data-kind="instagram"] { aspect-ratio: 9 / 16; width: min(100%, calc(70vh * 9 / 16)); margin: 0 auto; }
.mm-preview-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Trust strip ── */
.mm-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 13px; color: var(--text-muted); }
.mm-trust span { display: inline-flex; align-items: center; gap: 6px; }
.mm-trust svg { color: var(--accent-mint); }

/* ── Dialogs (guest checkout) ── */
.mm-dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 18px; padding: 22px;
    background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.mm-dialog::backdrop { background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
