/**
 * WPMediaVerse — Frontend Styles
 *
 * Base styles for templates, shortcodes, and unstyled blocks.
 * Mobile-first. RTL-ready via [dir="rtl"] overrides.
 * Dark mode via BuddyNext [data-theme="dark"] token cascade.
 *
 * @package WPMediaVerse
 */

/* ==========================================================================
   0. Design Tokens
   ========================================================================== */

:root {
    /* Typography — BuddyNext first, then system stack fallback */
    --mvs-font: var(--font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    --mvs-font-heading: var(--font-display, var(--mvs-font));

    /* Brand — BuddyX Pro → BuddyNext → fallback */
    --mvs-primary: var(--color-theme-primary, var(--brand, #0073aa));
    --mvs-primary-hover: var(--color-theme-primary, var(--brand-hover, #005a87));
    --mvs-primary-rgb: 0, 115, 170;
    --mvs-danger: var(--red, #d63638);
    --mvs-danger-rgb: 214, 54, 56;
    --mvs-success: var(--green, #44b700);
    --mvs-success-rgb: 68, 183, 0;
    --mvs-warning: #b58105;
    --mvs-warning-rgb: 181, 129, 5;

    /* Semantic backgrounds — derived tints (work in light + dark via alpha) */
    --mvs-info-bg: rgba(var(--mvs-primary-rgb), 0.08);
    --mvs-info-bg-light: rgba(var(--mvs-primary-rgb), 0.04);
    --mvs-info-border: rgba(var(--mvs-primary-rgb), 0.30);
    --mvs-success-bg: rgba(var(--mvs-success-rgb), 0.10);
    --mvs-warning-bg: rgba(var(--mvs-warning-rgb), 0.12);
    --mvs-danger-bg: rgba(var(--mvs-danger-rgb), 0.10);

    /* Surfaces — BuddyX Pro → BuddyNext → fallback */
    --mvs-bg: var(--color-theme-white-box, var(--bg, #ffffff));
    --mvs-surface: var(--global-body-lightcolor, var(--bg-subtle, #f6f7f7));
    --mvs-surface-2: var(--global-body-lightcolor, var(--bg-hover, #eeeeee));
    --mvs-overlay: rgba(0, 0, 0, 0.72);
    --mvs-bg-muted: var(--global-body-lightcolor, #f9fafb);

    /* Text — BuddyX Pro → BuddyNext → fallback */
    --mvs-text: var(--global-title-color, var(--text-1, #1e1e1e));
    --mvs-text-secondary: var(--global-font-color, var(--text-2, #646970));
    --mvs-text-muted: var(--color-meta, var(--text-3, #a7aaad));

    /* Borders & Shadows — BuddyX Pro → BuddyNext → fallback */
    --mvs-border: var(--global-border-color, var(--border, #dcdcde));
    --mvs-border-light: var(--border-soft, #e9e9ea);
    --mvs-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.10);
    --mvs-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.14);
    --mvs-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.18);

    /* Radii — BuddyNext first, then hardcoded fallback */
    --mvs-radius-sm: var(--r-sm, 6px);
    --mvs-radius-md: var(--r-md, 8px);
    --mvs-radius-lg: var(--r-lg, 12px);
    --mvs-radius-pill: var(--r-full, 100px);

    /* Breakpoints (reference only — used in @media rules) */
    --mvs-bp-mobile: 480px;
    --mvs-bp-tablet: 768px;
    --mvs-bp-desktop: 1024px;

    /* ─── Mobile UX guideline tokens (see docs/MOBILE_UX_GUIDELINE.md §2.2) ── */

    /* Touch target floor — Apple HIG / WCAG 2.5.5 (AAA). Every interactive
       element below the desktop breakpoint must clear this in both axes. */
    --mvs-touch-min: 44px;

    /* Spacing scale — mirrors theme.json so PHP and CSS share one ramp. */
    --mvs-space-1: 0.25rem;  /*  4px */
    --mvs-space-2: 0.5rem;   /*  8px */
    --mvs-space-3: 1rem;     /* 16px — base gutter */
    --mvs-space-4: 1.5rem;   /* 24px */
    --mvs-space-5: 2rem;     /* 32px */
    --mvs-space-6: 3rem;     /* 48px */
    --mvs-space-7: 4rem;     /* 64px */

    /* Z-index layers — never use bare integers in plugin CSS. */
    --mvs-z-base:    1;
    --mvs-z-sticky:  50;
    --mvs-z-fab:     100;
    --mvs-z-overlay: 200;
    --mvs-z-modal:   300;
    --mvs-z-toast:   400;
    --mvs-z-tooltip: 500;

    /* Motion */
    --mvs-duration-fast: 120ms;
    --mvs-duration-base: 200ms;
    --mvs-duration-slow: 320ms;
    --mvs-easing: cubic-bezier(0.2, 0, 0, 1);

    /* FAB sizing + safe area so floating elements never overlap content. */
    --mvs-fab-size:   48px;
    --mvs-fab-offset: 16px;
    --mvs-fab-safe:   calc(var(--mvs-fab-size) + var(--mvs-fab-offset) * 2);
}

/* Dark mode: theme-controlled only (no prefers-color-scheme).
   Supports both signals:
   - [data-theme="dark"] on <html> (BuddyNext, generic themes)
   - .dark-mode on <html> or <body> (BuddyX / BuddyX Pro)
   When BuddyX is active its own --color-* vars cascade through the
   :root mapping above, so we only set hardcoded values for sites
   without a dark-mode-aware parent theme. */
[data-theme="dark"],
html.dark-mode,
body.dark-mode {
    --mvs-bg: var(--color-theme-white-box, #121212);
    --mvs-surface: var(--global-body-lightcolor, #1e1e1e);
    --mvs-surface-2: var(--global-body-lightcolor, #2a2a2a);
    --mvs-text: var(--global-title-color, #f0f0f0);
    --mvs-text-secondary: var(--global-font-color, #b0b0b0);
    --mvs-text-muted: var(--color-meta, #888888);
    --mvs-border: var(--global-border-color, #363636);
    --mvs-border-light: #2e2e2e;
    --mvs-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
    --mvs-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --mvs-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
    --mvs-warning: #f0b73a;
    --mvs-info-bg: rgba(var(--mvs-primary-rgb), 0.18);
    --mvs-info-bg-light: rgba(var(--mvs-primary-rgb), 0.10);
    --mvs-success-bg: rgba(var(--mvs-success-rgb), 0.18);
    --mvs-warning-bg: rgba(240, 183, 58, 0.15);
    --mvs-danger-bg: rgba(var(--mvs-danger-rgb), 0.18);
}

/* ==========================================================================
   0a. Type Reset — lock down all typography inside MVS templates.
       Follows BuddyNext type scale. Works with or without BuddyNext.
   ========================================================================== */

/* WordPress defers global-styles-inline-css to <body> when Interactivity API
   script modules are used. This overrides theme body font-size rules that loaded
   in <head>. We reset body font-size on MVS pages to the theme's own CSS variable
   (--font-size-regular) if available, falling back to 1rem. This ensures consistent
   typography regardless of stylesheet load order. */
body.mvs-page {
    font-size: var(--font-size-regular, 1rem);
}

/* Scope: all MVS template wrappers use these classes.
   font-family set here so BuddyNext's Inter/Plus Jakarta Sans carries through. */
.mvs-single-media,
.mvs-single-album,
.mvs-single-collection,
.mvs-explore,
.mvs-dashboard,
.mvs-profile-edit {
    font-family: var(--mvs-font);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--mvs-text);
}

/* Heading reset within any MVS template — uses display font for headings */
.mvs-single-media h1,
.mvs-single-album h1,
.mvs-single-collection h1,
.mvs-explore h1,
.mvs-dashboard h1,
.mvs-profile-edit h1 {
    font-family: var(--mvs-font-heading);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5em;
}

.mvs-single-media h2,
.mvs-single-album h2,
.mvs-single-collection h2,
.mvs-explore h2,
.mvs-dashboard h2,
.mvs-profile-edit h2 {
    font-family: var(--mvs-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.5em;
}

.mvs-single-media h3,
.mvs-single-album h3,
.mvs-single-collection h3,
.mvs-explore h3,
.mvs-dashboard h3,
.mvs-profile-edit h3 {
    font-family: var(--mvs-font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 0.5em;
}

.mvs-single-media h4,
.mvs-single-album h4,
.mvs-single-collection h4,
.mvs-explore h4,
.mvs-dashboard h4,
.mvs-profile-edit h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.5em;
}

/* Form elements inherit font from wrapper */
.mvs-single-media button,
.mvs-single-media input,
.mvs-single-media select,
.mvs-single-media textarea,
.mvs-dashboard button,
.mvs-dashboard input,
.mvs-dashboard select,
.mvs-dashboard textarea,
.mvs-profile-edit button,
.mvs-profile-edit input,
.mvs-profile-edit select,
.mvs-profile-edit textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ==========================================================================
   0c. Mobile UX base layer
       Defined by docs/MOBILE_UX_GUIDELINE.md. Lives here so every template
       inherits Apple-quality defaults without per-page CSS overrides.
   ========================================================================== */

/* §3.1 — Universal touch-target floor below the desktop breakpoint.
   Every interactive element clears 44×44 in both axes, expanding via padding
   when the visible chip is smaller. */
@media (max-width: 1023px) /* var(--mvs-bp-desktop) */ {
    .mvs-page .mvs-btn,
    .mvs-page .mvs-icon-btn,
    .mvs-page .mvs-fab,
    .mvs-page .mvs-tab,
    .mvs-page .mvs-action-icon,
    .mvs-page .mvs-toast-close,
    .mvs-page .mvs-modal-close,
    .mvs-page .mvs-back-link,
    .mvs-page .mvs-tag-pill,
    .mvs-single-media .mvs-btn,
    .mvs-single-album .mvs-btn,
    .mvs-profile-edit .mvs-btn,
    .mvs-dashboard .mvs-btn {
        min-height: var(--mvs-touch-min);
        min-width: var(--mvs-touch-min);
    }
    /* Small chips/tags expand their hit area via padding instead of growing
       the visible bubble. */
    .mvs-page .mvs-tag-pill {
        display: inline-flex;
        align-items: center;
    }
}

/* §6 — Back link component for every detail page header. */
.mvs-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--mvs-space-2);
    color: var(--mvs-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1;
    padding: var(--mvs-space-2) var(--mvs-space-3) var(--mvs-space-2) var(--mvs-space-2);
    margin-bottom: var(--mvs-space-3);
    border-radius: var(--mvs-radius-md);
    transition: color var(--mvs-duration-fast) var(--mvs-easing),
                background var(--mvs-duration-fast) var(--mvs-easing);
}

.mvs-back-link:hover,
.mvs-back-link:focus-visible {
    color: var(--mvs-primary);
    background: var(--mvs-info-bg-light);
}

.mvs-back-link i,
.mvs-back-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 767px) /* var(--mvs-bp-tablet) */ {
    /* Hide textual label — keep the chevron only.
       The screen-reader label stays via aria-label on the anchor. */
    .mvs-back-link__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .mvs-back-link {
        padding: var(--mvs-space-2);
    }
}

/* §7 — FAB safe area: every page that hosts a FAB pads its bottom so content
   never sits behind it. iOS notch supported via env(safe-area-inset-bottom). */
.mvs-page,
.mvs-single-media,
.mvs-single-album,
.mvs-single-collection,
.mvs-profile-edit,
.mvs-explore,
.mvs-dashboard {
    padding-bottom: calc(var(--mvs-fab-safe) + env(safe-area-inset-bottom, 0px));
}

/* §4.1/§4.2 — Icon-collapse buttons: text-and-icon control that collapses to
   icon-only below the tablet breakpoint and exposes a CSS-only tooltip. */
.mvs-btn--icon-collapse {
    display: inline-flex;
    align-items: center;
    gap: var(--mvs-space-2);
    position: relative;
}

.mvs-btn--icon-collapse i,
.mvs-btn--icon-collapse svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 767px) /* var(--mvs-bp-tablet) */ {
    .mvs-btn--icon-collapse .mvs-btn__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .mvs-btn--icon-collapse {
        padding-inline: var(--mvs-space-2);
        gap: 0;
        justify-content: center;
    }
}

/* CSS-only tooltip: shows on :hover (mouse) and :focus-visible (touch + kb).
   Pages set data-mvs-tooltip="Label" on any element to opt in. */
[data-mvs-tooltip] {
    position: relative;
}

[data-mvs-tooltip]::after {
    content: attr(data-mvs-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--mvs-text);
    color: var(--mvs-bg);
    font-size: 0.75rem;
    line-height: 1;
    padding: var(--mvs-space-2) var(--mvs-space-2);
    border-radius: var(--mvs-radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--mvs-duration-fast) var(--mvs-easing),
                transform var(--mvs-duration-fast) var(--mvs-easing);
    z-index: var(--mvs-z-tooltip);
}

[data-mvs-tooltip]:hover::after,
[data-mvs-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    [data-mvs-tooltip]::after { transition: none; }
}

/* §-skeleton — Loading shimmer placeholders.
   Drop-in component for any "waiting on REST" surface. Pages add the
   .mvs-skeleton class to a sized box; the shimmer animation pulses across.
   Reduced motion swaps to a static muted background. */
.mvs-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--mvs-surface);
    border-radius: var(--mvs-radius-md);
    isolation: isolate;
}

.mvs-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: mvs-skeleton-shimmer 1.4s var(--mvs-easing) infinite;
}

[data-theme="dark"] .mvs-skeleton::after,
html.dark-mode .mvs-skeleton::after,
body.dark-mode .mvs-skeleton::after {
    background: linear-gradient(
        90deg,
        transparent 0,
        rgba(255, 255, 255, 0.06) 50%,
        transparent 100%
    );
}

@keyframes mvs-skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

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

.mvs-skeleton--text {
    height: 0.875rem;
    margin-bottom: 0.5rem;
    border-radius: var(--mvs-radius-sm);
}

.mvs-skeleton--text:last-child {
    margin-bottom: 0;
    width: 60%;
}

.mvs-skeleton--avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.mvs-skeleton--thumb {
    aspect-ratio: 1 / 1;
    border-radius: var(--mvs-radius-md);
}

.mvs-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--mvs-space-2);
}

@media (min-width: 768px) /* var(--mvs-bp-tablet) */ {
    .mvs-skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: var(--mvs-space-3);
    }
}

/* §5 — Tab strip pattern: horizontal scroll with edge-fade mask + scroll-snap.
   Components opt in by adding the .mvs-tabs-strip class. */
.mvs-tabs-strip {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Edge-fade telegraphs that more tabs exist beyond the right edge. */
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
    mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
}

.mvs-tabs-strip::-webkit-scrollbar { display: none; }

.mvs-tabs-strip > * {
    scroll-snap-align: start;
    flex: 0 0 auto;
}

/* When the strip fits without scrolling, drop the mask so the right edge is solid. */
@supports selector(:has(*)) {
    .mvs-tabs-strip:not(:hover):not(:focus-within):where(:not([data-overflow="true"])) {
        /* Re-enabled by JS via [data-overflow="true"] when scrollWidth > clientWidth. */
    }
}

/* ==========================================================================
   0b. Profile Header Card (explore grid filtered by user)
   ========================================================================== */

.mvs-profile-header-card {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    padding: 32px;
    margin-bottom: 24px;
    background: var(--mvs-surface);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mvs-profile-header-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--mvs-surface-2);
}

.mvs-profile-header-info {
    flex: 1;
    min-width: 0;
}

.mvs-profile-header-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mvs-profile-header-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.mvs-follow-toggle {
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.mvs-follow-toggle--following {
    background: var(--mvs-surface-2);
    color: var(--mvs-text);
    border: 1px solid var(--mvs-border);
}

.mvs-follow-toggle--following:hover {
    background: var(--mvs-danger-bg);
    color: var(--mvs-danger);
    border-color: var(--mvs-danger);
}

.mvs-follow-toggle:disabled {
    opacity: 0.6;
    cursor: wait;
}

.mvs-message-btn {
    transition: background 0.15s;
}

.mvs-profile-header-stats {
    display: flex;
    gap: 28px;
    font-size: 0.9375rem;
    color: var(--mvs-text-secondary);
    margin-bottom: 12px;
}

.mvs-profile-header-stats span {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.mvs-profile-header-stats strong {
    color: var(--mvs-text);
    font-size: 1.125rem;
    font-weight: 700;
}

.mvs-profile-header-bio {
    margin: 0;
    color: var(--mvs-text);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 600px;
}

@media (max-width: 640px) {
    .mvs-profile-header-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding: 24px 16px;
    }

    .mvs-profile-header-avatar {
        width: 96px;
        height: 96px;
    }

    .mvs-profile-header-top {
        justify-content: center;
    }

    .mvs-profile-header-stats {
        justify-content: center;
    }

    .mvs-profile-header-bio {
        max-width: 100%;
    }
}

/* ==========================================================================
   1. Single Media Template
   ========================================================================== */

.mvs-single-media {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 16px;
}

.mvs-media-article {
    background: var(--mvs-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mvs-media-header {
    padding: 16px 24px;
}

.mvs-media-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.mvs-media-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mvs-media-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mvs-media-author-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mvs-media-author-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--mvs-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mvs-media-author-name:hover {
    color: var(--mvs-primary);
}

.mvs-media-date {
    font-size: 0.8125rem;
    color: var(--mvs-text-muted);
}

.mvs-media-sep {
    margin: 0 2px;
}

.mvs-media-title {
    margin: 0;
    font-size: 1.5em;
    line-height: 1.3;
}

/* Media Content */
.mvs-media-content {
    padding: 0;
}

.mvs-media-image {
    width: 100%;
    background: var(--mvs-surface-2);
}

.mvs-media-image img {
    display: block;
    width: 100%;
    height: auto;
}

.mvs-media-video {
    width: 100%;
    background: var(--mvs-overlay);
}

.mvs-media-video video {
    display: block;
    width: 100%;
    height: auto;
}

.mvs-media-audio {
    padding: 16px 24px;
}

.mvs-media-audio audio {
    width: 100%;
}

.mvs-media-description {
    padding: 12px 16px 0;
    line-height: 1.6;
    color: var(--mvs-text);
    font-size: 0.9375rem;
}

.mvs-media-description p:first-child {
    margin-top: 0;
}

/* Footer & Tags */
.mvs-media-footer {
    padding: 8px 16px 16px;
}

.mvs-media-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mvs-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--mvs-info-bg);
    border-radius: 16px;
    font-size: 0.8125rem;
    color: var(--mvs-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.mvs-tag:hover {
    background: var(--mvs-primary);
    color: var(--mvs-bg);
}

/* ==========================================================================
   2. Album Template
   ========================================================================== */

.mvs-single-album {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.mvs-album-article {
    background: var(--mvs-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 24px;
}

.mvs-album-header {
    margin-bottom: 24px;
}

.mvs-album-title {
    margin: 0 0 8px;
    font-size: 1.75em;
}

.mvs-album-description {
    color: var(--mvs-text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.mvs-album-count {
    display: inline-block;
    padding: 4px 12px;
    background: var(--mvs-surface-2);
    border-radius: 16px;
    font-size: 0.85em;
    color: var(--mvs-text-secondary);
}

/* ==========================================================================
   3. Explore / Archive Template
   ========================================================================== */

.mvs-explore-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.mvs-explore-header {
    margin-bottom: 24px;
}

.mvs-explore-header h1 {
    margin: 0;
    font-size: 1.75em;
}

/* ==========================================================================
   4. Media Grid (shared by explore, album, shortcodes)
   ========================================================================== */

.mvs-media-grid {
    display: grid;
    gap: 16px;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.mvs-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.mvs-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.mvs-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.mvs-cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1024px) {

    .mvs-cols-5 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {

    .mvs-cols-3,
    .mvs-cols-4,
    .mvs-cols-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {

    .mvs-cols-2,
    .mvs-cols-3,
    .mvs-cols-4,
    .mvs-cols-5 {
        grid-template-columns: 1fr;
    }
}

.mvs-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--mvs-surface-2);
    aspect-ratio: 1;
    min-width: 0;
}

.mvs-grid-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.mvs-grid-item img,
.mvs-grid-item .mvs-grid-video-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    background: #0f1014;
}

.mvs-grid-item:hover img,
.mvs-grid-item:hover .mvs-grid-video-preview {
    transform: scale(1.05);
}

.mvs-grid-item .mvs-grid-video-preview {
    pointer-events: none;
}

.mvs-grid--original .mvs-grid-item {
    aspect-ratio: auto;
}

.mvs-grid--original .mvs-grid-item img {
    height: auto;
}

.mvs-grid--original .mvs-dashboard-card-thumb {
    aspect-ratio: auto;
}

.mvs-grid--original .mvs-dashboard-card-thumb img {
    height: auto;
    object-fit: contain;
}

.mvs-grid-item-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--mvs-text-muted);
}

.mvs-grid-item-placeholder .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.mvs-grid-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: var(--mvs-bg);
    font-size: 0.9em;
    opacity: 0;
    transition: opacity 0.3s;
}

.mvs-grid-item:hover .mvs-grid-item-overlay,
.mvs-grid-item-link:hover .mvs-grid-item-overlay {
    opacity: 1;
}

.mvs-grid-item-stats {
    display: flex;
    gap: 16px;
    font-size: 1.1em;
    font-weight: 700;
}

.mvs-grid-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mvs-grid-item-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Instagram-like feed: author row below each card */
.mvs-feed {
    gap: 6px;
}

.mvs-feed .mvs-grid-item {
    aspect-ratio: auto;
    border-radius: 4px;
    overflow: hidden;
    background: var(--mvs-bg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mvs-feed .mvs-grid-item-link {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
}

.mvs-feed .mvs-grid-item-overlay {
    pointer-events: none;
}

.mvs-grid-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--mvs-bg);
    font-size: 0.85em;
}

.mvs-grid-avatar {
    border-radius: 50%;
    width: 24px !important;
    height: 24px !important;
}

.mvs-grid-item-author {
    font-weight: 600;
    color: var(--mvs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -- Album badge (carousel indicator) in feed */
.mvs-album-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--mvs-bg);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    pointer-events: none;
    z-index: 2;
}

.mvs-album-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--mvs-bg);
}

/* -- Gallery badge (multi-image group indicator) */
.mvs-gallery-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--mvs-surface);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    pointer-events: none;
    z-index: 2;
}

.mvs-gallery-badge .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--mvs-surface);
}

/* ==========================================================================
   5. Pagination
   ========================================================================== */

.mvs-pagination {
    margin-top: 32px;
    text-align: center;
}

.mvs-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mvs-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    background: var(--mvs-surface-2);
    border-radius: 4px;
    text-decoration: none;
    color: var(--mvs-text);
    font-size: 0.9em;
    transition: background 0.2s;
}

.mvs-pagination .page-numbers.current,
.mvs-pagination .page-numbers:hover {
    background: var(--mvs-primary);
    color: var(--mvs-bg);
}

/* ==========================================================================
   6. Empty State
   ========================================================================== */

.mvs-no-media {
    text-align: center;
    padding: 48px 24px;
    color: var(--mvs-text-muted);
    font-size: 1.1em;
}

/* ==========================================================================
   9. Story Viewer
   ========================================================================== */

.mvs-story-viewer {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    background: var(--mvs-overlay);
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 9/16;
}

.mvs-story-viewer img,
.mvs-story-viewer video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mvs-story-progress {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

.mvs-story-progress-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    overflow: hidden;
}

.mvs-story-progress-fill {
    height: 100%;
    background: var(--mvs-bg);
    width: 0;
    transition: width linear;
}

.mvs-story-header {
    position: absolute;
    top: 24px;
    left: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--mvs-bg);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.mvs-story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 1;
    cursor: pointer;
    background: none;
    border: none;
}

.mvs-story-nav--prev {
    left: 0;
}

.mvs-story-nav--next {
    right: 0;
}

/* ==========================================================================
   10. Stats Cards
   ========================================================================== */

.mvs-stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.mvs-stat-card {
    background: var(--mvs-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.mvs-stat-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: var(--mvs-primary);
    line-height: 1.2;
}

.mvs-stat-label {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
    color: var(--mvs-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   11. Lock Overlay (Paywall)
   ========================================================================== */

.mvs-lock-overlay {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.mvs-lock-preview {
    filter: blur(8px);
    pointer-events: none;
}

.mvs-lock-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 32px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    z-index: 2;
    max-width: 360px;
    width: 90%;
}

.mvs-lock-icon {
    font-size: 36px;
    color: var(--mvs-primary);
    margin-bottom: 12px;
}

.mvs-lock-title {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 8px;
}

.mvs-lock-message {
    color: var(--mvs-text-secondary);
    font-size: 0.9em;
    margin-bottom: 16px;
    line-height: 1.5;
}

.mvs-lock-button {
    display: inline-block;
    padding: 10px 24px;
    background: var(--mvs-primary);
    color: var(--mvs-bg);
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.mvs-lock-button:hover {
    background: var(--mvs-primary-hover);
    color: var(--mvs-bg);
}

/* ==========================================================================
   12. Social Interactions Bar (for Step 47d)
   ========================================================================== */

.mvs-social-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 24px;
    border-top: 1px solid var(--mvs-border-light);
}

.mvs-reactions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mvs-social-bar button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--mvs-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--mvs-text-secondary);
    transition: all 0.2s;
}

.mvs-social-bar button:hover {
    background: none;
    border: 1px solid var(--mvs-primary);
    color: var(--mvs-primary);
}

.mvs-social-bar__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mvs-social-bar button.active {
    background: var(--mvs-primary);
    border-color: var(--mvs-primary);
    color: var(--mvs-bg);
}

.mvs-social-bar .mvs-count {
    font-weight: 600;
}

.mvs-social-bar button.mvs-view-count {
    color: var(--mvs-text-muted);
    font-size: 0.85em;
}

.mvs-social-actions {
    display: flex;
    align-items: center;
    padding: 8px 24px 12px;
}

.mvs-social-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mvs-social-actions .mvs-view-count {
    flex: 1;
    text-align: center;
}

.mvs-social-actions-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mvs-social-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--mvs-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--mvs-text-secondary);
    transition: all 0.2s;
}

.mvs-social-actions button:hover,
.mvs-social-actions button:focus {
    background: none;
    color: var(--mvs-primary);
    border: 1px solid var(--mvs-primary);
}

.mvs-social-actions button.active {
    background: var(--mvs-primary);
    border-color: var(--mvs-primary);
    color: var(--mvs-bg);
}

@media (max-width: 767px) /* var(--mvs-bp-tablet) */ {
    /* Hide the view count on mobile to reclaim space — it's a passive metric. */
    .mvs-single-media .mvs-social-actions .mvs-view-count {
        display: none;
    }
}

/* ==========================================================================
   13. Comments Section (for Step 47d)
   ========================================================================== */

.mvs-comments-section {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--mvs-border-light);
}

.mvs-comments-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--mvs-text);
}

.mvs-comment-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.mvs-comment-form textarea {
    flex: 1;
    padding: 10px 12px;
    background-color: var(--mvs-bg);
    border: 1px solid var(--mvs-border);
    border-radius: 8px;
    resize: none;
    min-height: 40px;
    font-family: inherit;
    font-size: 0.875rem;
}

.mvs-comment-form button {
    padding: 10px 16px;
    background: var(--mvs-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    align-self: flex-end;
    transition: background 0.2s;
}

.mvs-comment-form button:hover {
    background: var(--mvs-primary-hover);
}

.mvs-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mvs-comment-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--mvs-border-light, #e5e7eb);
}

.mvs-comment-item:last-child {
    border-bottom: none;
}

.mvs-comment-avatar-link {
    flex-shrink: 0;
    display: block;
    line-height: 0;
    text-decoration: none;
}

.mvs-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.mvs-comment-body-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mvs-comment-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.mvs-comment-author-link {
    text-decoration: none;
    color: inherit;
}

.mvs-comment-author-link:hover .mvs-comment-author {
    text-decoration: underline;
}

.mvs-comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--mvs-text, #111827);
}

.mvs-comment-date {
    font-size: 12px;
    color: var(--mvs-text-muted, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

.mvs-comment-text {
    font-size: 14px;
    line-height: 1.55;
    color: var(--mvs-text, #111827);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.mvs-comment-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.mvs-comment-actions .mvs-btn--small {
    padding: 4px 10px;
    font-size: 12px;
}

/* ==========================================================================
   14. Dashboard
   ========================================================================== */

.mvs-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.mvs-dashboard-header h1 {
    margin: 0 0 20px;
    font-size: 1.75em;
}

.mvs-dashboard-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--mvs-border-light);
    margin-bottom: 24px;
}

.mvs-dashboard-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--mvs-text);
    opacity: 0.75;
    transition: all 0.2s;
}

.mvs-dashboard-tab:hover,
.mvs-dashboard-tab:focus,
.mvs-dashboard-tab.active {
    opacity: 1;
}

.mvs-dashboard-tab:hover,
.mvs-dashboard-tab:focus {
    color: var(--mvs-primary);
    background: none;
    border: none;
    border-bottom: 2px solid var(--mvs-primary);
    border-radius: 0;
}

.mvs-dashboard-tab:first-child {
    padding-left: 0;
}

.mvs-dashboard-tab.active {
    color: var(--mvs-primary);
    border-bottom-color: var(--mvs-primary);
}

.mvs-dashboard-panel {
    min-height: 200px;
}

/* Interactivity API uses [hidden] attribute for show/hide */
.mvs-dashboard-panel[hidden] {
    display: none !important;
}

.mvs-dashboard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* .mvs-btn canonical definition lives in the "Shared button styles" block
 * further down (around line 4727). The legacy block that was here — with
 * different padding (10px 20px vs 0.625rem 1.25rem) — has been removed so
 * button dimensions are deterministic and don't drift based on stylesheet
 * load order. Danger + small modifiers remain here as they're only defined
 * in this place. */

.mvs-btn--danger {
    background: var(--mvs-danger);
    color: var(--mvs-on-danger, #ffffff);
    border: none;
}

.mvs-btn--danger:hover,
.mvs-btn--danger:focus,
.mvs-btn--danger:visited {
    background: var(--mvs-danger);
    color: var(--mvs-on-danger, #ffffff);
    filter: brightness(0.92);
    border: none;
}

.mvs-btn--small {
    padding: 6px 12px;
    font-size: 0.8em;
}

/* Dashboard Grid — default responsive auto-fill when no column-count class
   is applied; when the template emits `.mvs-cols-N` alongside it (as driven
   by the mvs_grid_columns setting), the compound-selector overrides below
   win by source order and honour the chosen column count. */
.mvs-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.mvs-dashboard-grid.mvs-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mvs-dashboard-grid.mvs-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mvs-dashboard-grid.mvs-cols-4 { grid-template-columns: repeat(4, 1fr); }
.mvs-dashboard-grid.mvs-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Narrow-viewport collapse mirrors the .mvs-media-grid behaviour so the
   user never ends up with a 5-col grid squished on mobile. */
@media (max-width: 1024px) {
    .mvs-dashboard-grid.mvs-cols-5 { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .mvs-dashboard-grid.mvs-cols-3,
    .mvs-dashboard-grid.mvs-cols-4,
    .mvs-dashboard-grid.mvs-cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .mvs-dashboard-grid.mvs-cols-2,
    .mvs-dashboard-grid.mvs-cols-3,
    .mvs-dashboard-grid.mvs-cols-4,
    .mvs-dashboard-grid.mvs-cols-5 { grid-template-columns: 1fr; }
}

.mvs-dashboard-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--mvs-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.mvs-dashboard-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mvs-dashboard-card-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1;
    background: var(--mvs-surface-2);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.mvs-dashboard-card-thumb img:not([hidden]),
.mvs-dashboard-card-thumb video:not([hidden]) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mvs-dashboard-card-thumb img[hidden],
.mvs-dashboard-card-thumb video[hidden] {
    display: none !important;
}

.mvs-dashboard-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mvs-dashboard-card-title {
    display: block;
    font-weight: 600;
    font-size: 0.9em;
    margin: 0 0 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--mvs-text);
    text-decoration: none;
}

a.mvs-dashboard-card-title:hover {
    color: var(--mvs-primary);
}

.mvs-dashboard-card-meta {
    font-size: 0.8em;
    color: var(--mvs-text-muted);
    margin-bottom: 8px;
}

.mvs-dashboard-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}

.mvs-privacy-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mvs-privacy-badge--public {
    background: var(--mvs-success-bg);
    color: var(--mvs-success);
}

.mvs-privacy-badge--members {
    background: var(--mvs-warning-bg);
    color: var(--mvs-warning);
}

.mvs-privacy-badge--private {
    background: var(--mvs-danger-bg);
    color: var(--mvs-danger);
}

/* Load More */
.mvs-load-more-wrap {
    text-align: center;
    margin-top: 24px;
}

/* ==========================================================================
   15. Modal
   ========================================================================== */

.mvs-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--mvs-overlay);
    z-index: var(--mvs-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Allow taps outside the panel to dismiss without scrolling the body. */
    overscroll-behavior: contain;
}

.mvs-modal {
    background: var(--mvs-bg);
    border-radius: var(--mvs-radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--mvs-shadow-lg);
    position: relative;
}

/* §11 — Bottom-sheet on mobile.
   Modal slides up from the bottom edge with a drag handle, max 90vh,
   safe-area-inset honored for iOS home indicator. Animation respects
   prefers-reduced-motion. */
@media (max-width: 767px) /* var(--mvs-bp-tablet) */ {
    .mvs-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .mvs-modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--mvs-radius-lg) var(--mvs-radius-lg) 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
        animation: mvs-modal-slide-up var(--mvs-duration-base) var(--mvs-easing) both;
    }

    /* Drag handle pill — pure CSS, no JS dismiss yet but gives the affordance. */
    .mvs-modal::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        background: var(--mvs-text-muted);
        opacity: 0.5;
        border-radius: var(--mvs-radius-pill);
        margin: 8px auto 0;
        flex-shrink: 0;
    }
}

@keyframes mvs-modal-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mvs-modal {
        animation: none !important;
    }
}

.mvs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--mvs-border-light);
}

.mvs-modal-header h2 {
    margin: 0;
    font-size: 1.2em;
}

.mvs-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--mvs-text-muted);
    padding: 0;
    line-height: 1;
}

.mvs-modal-close:hover {
    background: none;
    border: none;
    color: var(--mvs-text);
}

.mvs-modal-body {
    padding: 24px;
}

.mvs-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--mvs-border-light);
}

/* Form Fields */
.mvs-field {
    margin-bottom: 16px;
}

.mvs-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--mvs-text);
}

.mvs-field input[type="text"],
.mvs-field textarea,
.mvs-field select {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--mvs-bg);
    border: 1px solid var(--mvs-border);
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    box-sizing: border-box;
}

.mvs-field textarea {
    resize: vertical;
    min-height: 80px;
}

.mvs-field select {
    max-width: 200px;
}

/* ==========================================================================
   16. Tag Input
   ========================================================================== */

.mvs-tag-input-wrap {
    position: relative;
}

.mvs-tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--mvs-border);
    border-radius: 6px;
    min-height: 38px;
    align-items: center;
    cursor: text;
}

.mvs-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--mvs-primary);
    color: var(--mvs-bg);
    border-radius: 12px;
    font-size: 0.8em;
}

.mvs-tag-pill-remove {
    background: none;
    border: none;
    color: var(--mvs-bg);
    cursor: pointer;
    font-size: 1em;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.mvs-tag-pill-remove:hover {
    opacity: 1;
}

.mvs-tag-text-input {
    border: none !important;
    outline: none;
    padding: 2px 4px !important;
    font-size: 0.9em;
    min-width: 80px;
    flex: 1;
}

.mvs-tag-text-input:focus-visible {
    outline: 2px solid var(--mvs-primary, #0073aa);
    outline-offset: -2px;
}

.mvs-tag-text-input:focus-visible {
    outline: 2px solid var(--mvs-primary);
    outline-offset: -2px;
    border-radius: 2px;
}

.mvs-tag-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--mvs-bg);
    border: 1px solid var(--mvs-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    max-height: 160px;
    overflow-y: auto;
}

.mvs-tag-autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9em;
}

.mvs-tag-autocomplete-item:hover {
    background: var(--mvs-info-bg);
    color: var(--mvs-primary);
}

/* ==========================================================================
   17. Confirm Dialog
   ========================================================================== */

.mvs-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mvs-confirm {
    background: var(--mvs-bg);
    border-radius: 12px;
    padding: 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.mvs-confirm p {
    margin: 0 0 20px;
    font-size: 1em;
    color: var(--mvs-text);
}

.mvs-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.mvs-report-reason-select {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin: 12px 0;
    font-size: 14px;
    border: 1px solid var(--mvs-border);
    border-radius: 6px;
    background-color: var(--mvs-surface-2);
    color: var(--mvs-text);
}

/* ==========================================================================
   18. Toast Notification
   ========================================================================== */

.mvs-toast {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    padding: 12px 24px;
    background: var(--mvs-text);
    color: var(--mvs-bg);
    border-radius: var(--mvs-radius-md);
    font-size: 0.9em;
    z-index: var(--mvs-z-toast);
    box-shadow: var(--mvs-shadow-md);
    animation: mvsToastIn var(--mvs-duration-base) var(--mvs-easing);
    /* Honor the FAB safe area so toasts never collide with the upload button. */
}

@media (max-width: 767px) /* var(--mvs-bp-tablet) */ {
    .mvs-toast {
        /* On mobile, sit above both the FAB safe area and the home indicator. */
        bottom: calc(var(--mvs-fab-safe) + 8px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        left: 16px;
        max-width: none;
        text-align: center;
    }
}

.mvs-toast--success {
    background: var(--mvs-success);
}

.mvs-toast--error {
    background: var(--mvs-danger);
}

@keyframes mvsToastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Interactivity API [hidden] overrides
   Elements with display:flex/fixed need explicit [hidden] rules because
   data-wp-bind--hidden toggles the HTML hidden attribute.
   ========================================================================== */

.mvs-modal-overlay[hidden],
.mvs-confirm-overlay[hidden],
.mvs-toast[hidden],
.mvs-inline-edit[hidden],
.mvs-dashboard-upload-fields[hidden],
.mvs-dashboard-upload-status[hidden],
.mvs-tag-autocomplete[hidden],
.mvs-load-more-wrap[hidden],
.mvs-no-media[hidden] {
    display: none !important;
}

/* ==========================================================================
   19. Media Picker (for album creation)
   ========================================================================== */

.mvs-media-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--mvs-border-light);
    border-radius: 6px;
    margin-top: 8px;
}

.mvs-media-picker-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.mvs-media-picker-item.selected {
    border-color: var(--mvs-primary);
}

.mvs-media-picker-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mvs-media-picker-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: var(--mvs-primary);
    color: var(--mvs-bg);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.75em;
    font-weight: 700;
}

.mvs-media-picker-item.selected .mvs-media-picker-check {
    display: flex;
}

/* ==========================================================================
   20. Owner Actions (on single pages)
   ========================================================================== */

.mvs-owner-actions {
    display: inline-flex;
    gap: 6px;
}

.mvs-collection-card-info .mvs-owner-actions {
    display: flex;
    margin-left: 0;
    padding: 12px 0 0;
}

/* Inline edit form on single pages */
.mvs-inline-edit {
    padding: 16px 24px;
    border-top: 1px solid var(--mvs-border-light);
    background: var(--mvs-surface-2);
}

.mvs-inline-edit .mvs-field {
    margin-bottom: 12px;
}

.mvs-inline-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ==========================================================================
   21. Explore Search + Tag Cloud
   ========================================================================== */

.mvs-explore-search {
    margin-bottom: 24px;
}

.mvs-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.mvs-tag-cloud-item {
    display: inline-block;
    padding: 4px 14px;
    background: var(--mvs-surface-2);
    border-radius: 16px;
    font-size: 0.85em;
    color: var(--mvs-text);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.mvs-tag-cloud-item:hover,
.mvs-tag-cloud-item.active {
    background: var(--mvs-primary);
    color: var(--mvs-bg);
}

/* ==========================================================================
   22. Upload Form Enhancement
   ========================================================================== */

.mvs-upload-fields {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mvs-upload-fields input[type="text"],
.mvs-upload-fields textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--mvs-border);
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    box-sizing: border-box;
}

.mvs-upload-fields textarea {
    resize: vertical;
    min-height: 60px;
}

/* ==========================================================================
   23. Dashboard Inline Upload
   ========================================================================== */

.mvs-dashboard-upload {
    margin-bottom: 24px;
    background: var(--mvs-bg, #fff);
    border: 1px solid var(--mvs-border, #dcdcde);
    border-radius: 12px;
    padding: 20px;
}

.mvs-dashboard-dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 1rem;
    padding: 28px 20px;
    border: 2px dashed var(--mvs-border-light);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--mvs-surface-2);
}

.mvs-dashboard-dropzone:hover {
    border-color: var(--mvs-primary);
    background: var(--mvs-info-bg);
}

.mvs-dashboard-dropzone.mvs-drag-active {
    border-color: var(--mvs-primary);
    background: var(--mvs-info-bg);
    border-style: solid;
}

.mvs-dashboard-dropzone-icon {
    font-size: 1.5em;
    line-height: 1;
}

.mvs-dashboard-dropzone-label {
    font-size: 0.95em;
    color: var(--mvs-text-secondary);
}

.mvs-dashboard-upload-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    background: var(--mvs-surface-2);
    border-radius: 6px;
}

.mvs-dashboard-upload-fields input[type="text"],
.mvs-dashboard-upload-fields textarea,
.mvs-dashboard-upload-fields select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--mvs-border);
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    box-sizing: border-box;
}

.mvs-dashboard-upload-fields textarea {
    resize: vertical;
    min-height: 60px;
}

.mvs-dashboard-upload-row {
    display: flex;
    gap: 10px;
}

.mvs-dashboard-upload-row input {
    flex: 1;
}

.mvs-dashboard-upload-row select {
    max-width: 160px;
}

.mvs-dashboard-upload-status {
    margin-top: 12px;
    font-size: 0.9em;
    color: var(--mvs-primary);
    font-weight: 600;
}

.mvs-dashboard-upload-status:empty {
    display: none;
}

@media (max-width: 600px) {
    .mvs-dashboard-dropzone {
        flex-direction: column;
        padding: 20px;
    }

    .mvs-dashboard-upload-row {
        flex-direction: column;
    }

    .mvs-dashboard-upload-row select {
        max-width: 100%;
    }
}

/* ==========================================================================
   15. Empty State (shared)
   ========================================================================== */

.mvs-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--mvs-text-secondary);
}

.mvs-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--mvs-border-light);
    display: block;
    margin: 0 auto 12px;
}

.mvs-empty-state p {
    font-size: 1em;
    margin: 8px 0 0;
    color: var(--mvs-text-muted);
}

/* Section 16 "BuddyPress Profile Media Tab" — removed. Rules were
 * unscoped duplicates of scoped versions already in bp-integration.css:
 *   .mvs-bp-profile-actions     → bp-integration.css section 'Action /
 *                                  toolbar row'
 *   .mvs-bp-dropzone +           → bp-integration.css section 'Upload
 *     .mvs-bp-dropzone-text        surface'
 *   .mvs-bp-upload-status +      → bp-integration.css section 'Upload
 *     --success                    surface'
 *   .mvs-bp-upload-wrap          → see dedicated rules below (this file
 *                                  keeps its copy because
 *                                  templates/album.php reuses the class
 *                                  in a non-BP context).
 */

/* Section 24 "BuddyPress Activity Media" — all rules moved to
 * bp-integration.css (see "Activity stream — media images" and
 * "Activity stream — multi-image grid" sections). The broad
 * `img:not(.avatar):not(.emoji)` catch-all was also narrowed to match
 * only /media/ permalinks during the move, so theme-injected classless
 * images (Reign's .bp-group-preview-cover, etc.) no longer get
 * constrained by our rules. Section header retained as placeholder for
 * the pending sequential renumbering in a later commit. */

/* Activity form controls (attach-media button, preview grid, privacy
 * select, upload state) moved to bp-integration.css. See that file's
 * "Activity form — attach-media button, preview grid, privacy select"
 * section. Only the shared @keyframes stays here since it's referenced
 * by multiple non-BP spinners too. */
@keyframes mvs-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── 25. Activity Media Lightbox ── (moved to frontend.css Lightbox
 *         social sidebar section; see bottom of file).
 *
 * Sections 26–28 (Inline Album Creation / Inline Upload / Single Album
 * View) moved to bp-integration.css for the BP-only rules
 * (.mvs-bp-album-form, .mvs-bp-album-msg, .mvs-bp-back-link,
 * .mvs-btn-primary, .mvs-btn-secondary).
 *
 * The .mvs-bp-upload-* classes remain here, unscoped, because
 * templates/album.php (non-BP single-album view) reuses the same
 * markup for its "Add Media" inline upload panel. Renaming to
 * .mvs-inline-upload-* would be cleaner but is deferred to avoid
 * touching PHP/JS in this CSS-only migration.
 */

.mvs-bp-upload-wrap {
    margin: 16px 0;
    padding: 20px;
    background: var(--mvs-bg);
    border: 1px solid var(--mvs-border);
    border-radius: 8px;
}

.mvs-bp-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.mvs-bp-upload-thumb {
    width: 80px;
    text-align: center;
}

.mvs-bp-upload-thumb img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--mvs-border);
}

.mvs-bp-upload-thumb-name {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--mvs-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mvs-bp-upload-form-actions {
    margin-top: 12px;
}

.mvs-bp-upload-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    background: var(--mvs-info-bg);
    color: var(--mvs-primary);
}

.mvs-bp-upload-status--success {
    background: var(--mvs-success-bg);
    color: var(--mvs-success);
}

/* Used only by templates/album.php (single-album view, Add Media panel). */
.mvs-album-upload-section {
    margin: 16px 0;
}

/* Section 26 "Group Media Sub-Tabs" — removed. Unscoped duplicates of
 * scoped versions already in bp-integration.css section 'Sub-tab row
 * (Media / Albums)':
 *   .mvs-bp-sub-tabs, .mvs-bp-sub-tab, .mvs-bp-sub-tab:hover,
 *   .mvs-bp-sub-tab.active
 *
 * Section 27 "Activity Media Thumbnails (Video/Audio)" — moved to
 * bp-integration.css section 'Activity stream — video thumbnails,
 * placeholders, audio cards', scoped under #buddypress. All
 * .mvs-activity-media--video / --audio / --placeholder rules plus the
 * play icon, vid-link, audio icon/info/title/meta supporting classes.
 */

/* ==========================================================================
   28. Enhanced Single Media Player
   ========================================================================== */

.mvs-media-video video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.mvs-audio-info {
    padding: 12px 24px 0;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.9em;
    color: var(--mvs-text-secondary);
}

.mvs-audio-artist {
    font-weight: 600;
    color: var(--mvs-text);
}

.mvs-audio-album::before {
    content: "\00b7";
    margin: 0 4px;
}

.mvs-media-audio audio {
    display: block;
    width: 100%;
    margin-top: 8px;
}

/* ==========================================================================
   29. Album Grid Items (Video/Audio)
   ========================================================================== */

.mvs-grid-item {
    position: relative;
}

.mvs-grid-item a {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.mvs-grid-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 2;
    pointer-events: none;
    transition: background 0.2s, transform 0.2s;
}

.mvs-grid-play-icon svg {
    width: 22px;
    height: 22px;
    /* Optical centering — the play triangle isn't centered in its bounding box. */
    margin-left: 2px;
}

.mvs-grid-item a:hover .mvs-grid-play-icon {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.05);
}

/* Unified placeholder frame — audio + video + generic all share aspect ratio
   and centering so grids never collapse based on media type. Specific
   gradients layered via the --video / --audio / --generic modifiers. */
.mvs-grid-item-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, #1a2332, #0a0a0a);
}

.mvs-grid-item-placeholder svg {
    width: 34%;
    height: 34%;
    max-width: 72px;
    max-height: 72px;
    opacity: 0.9;
}

.mvs-grid-item-placeholder--video {
    background: linear-gradient(135deg, #0d2137, #0a0a0a);
    aspect-ratio: 16 / 9;
}

.mvs-grid-item-placeholder--audio {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.mvs-grid-item-placeholder--generic {
    background: linear-gradient(135deg, #2b3544, #1a1f2b);
}

.mvs-grid-audio-icon,
.mvs-grid-generic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    line-height: 0;
}

.mvs-grid-audio-icon svg,
.mvs-grid-generic-icon svg {
    width: 34%;
    height: 34%;
    max-width: 72px;
    max-height: 72px;
}

/* ==========================================================================
   30. Playlist UI
   ========================================================================== */

.mvs-playlist {
    max-width: 700px;
    margin: 20px auto;
    background: var(--mvs-surface-2);
    border: 1px solid var(--mvs-border);
    border-radius: 8px;
    overflow: hidden;
}

.mvs-playlist-player {
    padding: 16px 20px;
    background: var(--mvs-text);
}

.mvs-playlist-player audio {
    width: 100%;
}

.mvs-playlist-now-playing {
    padding: 10px 20px;
    background: var(--mvs-text);
    color: var(--mvs-bg);
    font-size: 0.95em;
    font-weight: 600;
    min-height: 20px;
}

.mvs-playlist-tracks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mvs-playlist-track {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--mvs-border-light);
    transition: background 0.15s;
}

.mvs-playlist-track:last-child {
    border-bottom: none;
}

.mvs-playlist-track:hover {
    background: var(--mvs-surface-2);
}

.mvs-playlist-track--active {
    background: var(--mvs-info-bg);
}

.mvs-playlist-track--active:hover {
    background: var(--mvs-info-bg-light);
}

.mvs-playlist-track-btn {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    min-width: 0;
}

.mvs-playlist-track-num {
    width: 28px;
    text-align: center;
    color: var(--mvs-text-muted);
    font-size: 0.85em;
    flex-shrink: 0;
}

.mvs-playlist-track--active .mvs-playlist-track-num {
    color: var(--mvs-primary);
    font-weight: 700;
}

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

.mvs-playlist-track-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mvs-playlist-track-artist {
    font-size: 0.82em;
    color: var(--mvs-text-muted);
}

.mvs-playlist-track-duration {
    color: var(--mvs-text-muted);
    font-size: 0.85em;
    flex-shrink: 0;
}

.mvs-playlist-track-link {
    padding: 12px 14px;
    color: var(--mvs-text-muted);
    text-decoration: none;
    font-size: 1.1em;
}

.mvs-playlist-track-link:hover {
    color: var(--mvs-primary);
}

/* ==========================================================================
   27. Collections & Rule Builder
   ========================================================================== */

.mvs-collection-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--mvs-surface-2);
    border-bottom: 1px solid var(--mvs-border-light);
}

/* --- Collection Single Page --- */

.mvs-single-collection {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 0;
}

/* Info Card */
.mvs-collection-card-info {
    background: var(--mvs-bg);
    border: 1px solid var(--mvs-border-light);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.mvs-collection-card-title {
    margin: 0 0 12px;
    font-size: 1.6em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--mvs-text);
}

.mvs-collection-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: var(--mvs-text-secondary);
}

.mvs-collection-meta-author {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mvs-collection-meta-author a {
    color: var(--mvs-danger);
    text-decoration: none;
    font-weight: 500;
}

.mvs-collection-meta-author a:hover {
    text-decoration: underline;
}

.mvs-collection-avatar {
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.mvs-collection-meta-text {
    color: var(--mvs-text-secondary);
}

.mvs-collection-card-desc {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--mvs-surface-2);
    color: var(--mvs-text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
}

.mvs-collection-card-desc p {
    margin: 0;
}

/* Search bar — reuses .mvs-explore-search layout */
.mvs-collection-search {
    margin-bottom: 24px;
}

.mvs-collection-search form {
    display: flex;
    gap: 0;
}

.mvs-collection-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--mvs-border-light);
    border-radius: 8px 0 0 8px;
    font-size: 0.95em;
    background: var(--mvs-bg);
    transition: border-color 0.2s;
}

.mvs-collection-search-input:focus {
    outline: none;
    border-color: var(--mvs-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.mvs-collection-search-btn {
    padding: 10px 20px;
    border: 1px solid var(--mvs-primary);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: var(--mvs-primary);
    color: var(--mvs-bg);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.mvs-collection-search-btn:hover {
    background: var(--mvs-primary-hover);
}

/* Rules display (inline in meta) */
.mvs-collection-card-meta .mvs-rule-pill {
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.85em;
    background: var(--mvs-surface-2);
    color: var(--mvs-text-secondary);
    font-weight: 500;
}

.mvs-collection-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--mvs-info-bg);
    color: var(--mvs-primary);
}

.mvs-collection-count {
    font-size: 0.85em;
    color: var(--mvs-text-secondary);
}

.mvs-collection-rules-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.mvs-rule-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    background: rgba(var(--mvs-primary-rgb), 0.15);
    color: var(--mvs-primary);
    border: 1px solid rgba(var(--mvs-primary-rgb), 0.30);
}

/* Type toggle */
.mvs-collection-type-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--mvs-border);
    border-radius: 6px;
    overflow: hidden;
    width: fit-content;
}

.mvs-toggle-btn {
    padding: 8px 20px;
    border: none;
    background: var(--mvs-bg);
    cursor: pointer;
    font-size: 0.9em;
    color: var(--mvs-text-secondary);
    transition: background 0.15s, color 0.15s;
}

.mvs-toggle-btn:not(:last-child) {
    border-right: 1px solid var(--mvs-border);
}

.mvs-toggle-btn.active {
    background: var(--mvs-primary);
    color: var(--mvs-bg);
}

.mvs-field-hint {
    margin-top: 6px;
    font-size: 0.85em;
    color: var(--mvs-text-muted);
    font-style: italic;
}

/* Rule builder */
.mvs-rules-builder {
    margin-top: 16px;
}

.mvs-rules-builder>label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
}

.mvs-rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.mvs-rule-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mvs-rule-row select,
.mvs-rule-row input {
    padding: 8px 10px;
    border: 1px solid var(--mvs-border);
    border-radius: 4px;
    font-size: 0.9em;
}

.mvs-rule-key {
    min-width: 140px;
    flex: 0 0 auto;
}

.mvs-rule-value,
.mvs-rule-value-text {
    flex: 1;
    min-width: 120px;
}

.mvs-rule-remove {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid var(--mvs-border);
    border-radius: 4px;
    background: var(--mvs-bg);
    color: var(--mvs-danger);
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.mvs-rule-remove:hover,
.mvs-rule-remove:focus {
    background: var(--mvs-danger-bg);
    color: var(--mvs-danger);
    border-color: var(--mvs-danger);
}

.mvs-rules-preview {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--mvs-success-bg);
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--mvs-success);
    font-weight: 500;
}

/* Wide modal variant for collection rule builder */
.mvs-modal--wide {
    max-width: 680px;
}

@media (max-width: 600px) {
    .mvs-rule-row {
        flex-wrap: wrap;
    }

    .mvs-rule-key {
        min-width: 100%;
    }
}

/* Section 27 "Theme Compatibility — Reign / BuddyBoss / Generic"
 * removed. Audit summary:
 *
 *  - .theme-flavor scoped rules — dead: no PHP/JS/template in the plugin
 *    emits .theme-flavor, and no theme adds it to <body>. Every rule was
 *    a no-op.
 *  - .mvs-bp-upload-btn scoped rules — dead: the upload button is
 *    emitted with id="mvs-bp-upload-btn" and class="mvs-btn", never with
 *    class="mvs-bp-upload-btn". Rules were also no-ops.
 *  - .buddyboss-theme .mvs-upload-dropzone / .mvs-upload-block —
 *    .mvs-upload-* only appears inside the media-upload Gutenberg block,
 *    which doesn't render inside BP surfaces; the rule never matched.
 *    Additionally, a dangling `.theme-flavor` selector with no rule body
 *    on the line above was silently hijacking this selector list, so the
 *    rules were doubly broken.
 *  - .buddyboss-theme #mvs-activity-media-btn — redundant with the
 *    consolidated #mvs-activity-media-btn rule now in bp-integration.css
 *    (same display/align/gap values).
 *  - .wb-reign-theme #whats-new-form #mvs-activity-media-btn margin-left
 *    — the only live theme-compat rule. Moved to bp-integration.css
 *    (Theme compatibility section) with the selector updated to scope
 *    on .mvs-activity-media-btn-wrap since that's now the flex row
 *    anchor (button no longer lays out on its own).
 *  - .mvs-bp-upload-btn, #mvs-activity-media-btn { max-width: 100% } —
 *    the button now lives inside .mvs-activity-media-btn-wrap which
 *    already has width: 100%; box-sizing: border-box on all button
 *    children via box-sizing: border-box inheritance from the baseline
 *    reset in bp-integration.css. No longer needed.
 */

/* ==========================================================================
   26. Album Placeholder
   ========================================================================== */

.mvs-grid-item-placeholder--album {
    background: linear-gradient(135deg, #6c757d, #495057);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mvs-grid-album-icon {
    font-size: 36px;
    opacity: 0.8;
}

.mvs-grid-item-placeholder--collection {
    background: linear-gradient(135deg, #4a90d9, #357abd);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mvs-grid-collection-icon {
    font-size: 36px;
    opacity: 0.8;
}

.mvs-collection-card .mvs-collection-type-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mvs-collection-card .mvs-dashboard-card-thumb {
    position: relative;
}

.mvs-collection-card .mvs-dashboard-card-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mvs-collection-card .mvs-collection-rules-preview {
    max-height: 52px;
    overflow: hidden;
}

/* ==========================================================================
   27. Notification Bell
   ========================================================================== */

.mvs-dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mvs-dashboard-heading {
    font-size: 1.4em;
    font-weight: 700;
}

.mvs-notification-bell {
    position: relative;
    cursor: pointer;
    margin-left: auto;
    user-select: none;
}

.mvs-notification-bell-icon {
    font-size: 1.4em;
}

.mvs-notification-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--mvs-danger);
    color: var(--mvs-bg);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
}

.mvs-notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--mvs-bg, #fff);
    border: 1px solid var(--mvs-border, #ddd);
    border-radius: 8px;
    box-shadow: var(--mvs-shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.18));
    z-index: 998;
    margin-top: 8px;
}

.mvs-notification-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mvs-border-light);
}

.mvs-notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mvs-notification-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--mvs-surface-2);
    font-size: 0.9em;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mvs-notification-item:last-child {
    border-bottom: none;
}

.mvs-notification-unread {
    background: var(--mvs-info-bg);
}

.mvs-notification-time {
    color: var(--mvs-text-muted);
    font-size: 0.8em;
}

.mvs-notification-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--mvs-text-muted);
    margin: 0;
}

/* ==========================================================================
   28. Comment Edit/Delete Actions
   (Base layout rules for .mvs-comment-header/.mvs-comment-avatar/
   .mvs-comment-actions live in section 13. Only edit-form-specific
   styles belong here.)
   ========================================================================== */

.mvs-comment-edit-form {
    margin-top: 6px;
}

.mvs-comment-edit-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--mvs-border);
    border-radius: 4px;
    font-size: 0.9em;
    resize: vertical;
    box-sizing: border-box;
}

.mvs-comment-edit-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

/* ==========================================================================
   29. Follow Button
   ========================================================================== */

.mvs-follow-btn-wrap {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.mvs-follow-btn {
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s;
    background: var(--mvs-primary);
    /* Always use --mvs-on-primary (#fff) here; never --mvs-bg which flips
       to dark in dark-mode themes and becomes unreadable on the red bg. */
    color: var(--mvs-on-primary, #ffffff);
    border: 1px solid var(--mvs-primary);
}

.mvs-follow-btn:hover {
    background: var(--mvs-primary-hover);
    border-color: var(--mvs-primary-hover);
    color: var(--mvs-on-primary, #ffffff);
}

.mvs-follow-btn.active {
    background: var(--mvs-bg);
    color: var(--mvs-text);
    border-color: var(--mvs-border);
}

.mvs-follow-btn.active:hover {
    background: var(--mvs-surface-2);
    border-color: var(--mvs-border);
}

/* ==========================================================================
   30. Album Cover Picker
   ========================================================================== */

.mvs-media-picker-item {
    position: relative;
}

.mvs-media-picker-cover-btn {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--mvs-bg);
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
}

.mvs-media-picker-item:hover .mvs-media-picker-cover-btn {
    opacity: 1;
}

.mvs-media-picker-cover-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--mvs-primary);
    color: var(--mvs-bg);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    z-index: 3;
}

.mvs-media-picker-cover {
    outline: 3px solid var(--mvs-primary);
    outline-offset: -3px;
}

/* ==========================================================================
   27. Grid Pagination
   ========================================================================== */

.mvs-grid-pagination {
    margin-top: 24px;
    text-align: center;
}

.mvs-grid-pagination-info {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--mvs-text-secondary);
}

.mvs-grid-pagination-links ul {
    display: flex;
    justify-content: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.mvs-grid-pagination-links li {
    margin: 0;
}

.mvs-grid-pagination-links a,
.mvs-grid-pagination-links span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--mvs-border);
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    color: var(--mvs-text);
    background: var(--mvs-bg);
    transition: all 0.15s;
}

.mvs-grid-pagination-links a:hover {
    background: var(--mvs-surface-2);
    border-color: var(--mvs-border-light);
}

.mvs-grid-pagination-links .current {
    background: var(--mvs-primary);
    color: var(--mvs-bg);
    border-color: var(--mvs-primary);
    font-weight: 600;
}

.mvs-grid-pagination-links .dots {
    border-color: transparent;
    background: transparent;
}

/* ==========================================================================
   28. Upload Form Fixes
   ========================================================================== */

.mvs-upload-block {
    max-width: 680px;
    margin: 0 auto;
}

.mvs-upload-dropzone {
    border: 2px dashed var(--mvs-border);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--mvs-surface-2);
}

.mvs-upload-dropzone:hover,
.mvs-upload-dropzone.mvs-dragover {
    border-color: var(--mvs-primary);
    background: var(--mvs-info-bg);
}

.mvs-upload-icon {
    color: var(--mvs-text-muted);
    margin-bottom: 12px;
}

.mvs-upload-text {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--mvs-text-secondary);
}

.mvs-upload-input {
    display: none;
}

.mvs-upload-privacy {
    margin-top: 12px;
    padding: 6px 12px;
    border: 1px solid var(--mvs-border);
    border-radius: 4px;
    font-size: 13px;
}

.mvs-upload-fields {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mvs-upload-fields input,
.mvs-upload-fields textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--mvs-border);
    border-radius: 4px;
    font-size: 13px;
}

/* Section 29 "BP Activity Media Button Alignment" — all rules moved to
 * bp-integration.css. Section header retained as a placeholder so
 * renumbering in a later commit stays mechanical. */

/* ==========================================================================
   30. Single Media Page Fixes
   ========================================================================== */

.mvs-media-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.mvs-social-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 16px;
    border-top: 1px solid var(--mvs-border-light);
}

.mvs-reactions {
    display: flex;
    gap: 4px;
}

.mvs-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 10px;
    border: 1px solid var(--mvs-border-light);
    border-radius: 20px;
    background: var(--mvs-bg);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.mvs-reaction-btn:hover,
.mvs-reaction-btn.active {
    background: var(--mvs-info-bg);
    border-color: var(--mvs-primary);
}

.mvs-reaction-btn .mvs-count {
    font-size: 12px;
    color: var(--mvs-text-secondary);
}

.mvs-social-bar button.active .mvs-count {
    color: var(--mvs-bg);
}

/* Read-only reactions for logged-out users */
.mvs-reactions--readonly .mvs-reaction-btn {
    cursor: default;
    opacity: 0.7;
    pointer-events: none;
}

.mvs-favorite-btn {
    padding: 5px 12px;
    border: 1px solid var(--mvs-border-light);
    border-radius: 20px;
    background: var(--mvs-bg);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.mvs-favorite-btn:hover,
.mvs-favorite-btn.active {
    background: var(--mvs-danger-bg);
    border-color: var(--mvs-danger);
    color: var(--mvs-danger);
}

.mvs-share-btn {
    padding: 5px 12px;
    border: 1px solid var(--mvs-border-light);
    border-radius: 20px;
    background: var(--mvs-bg);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.mvs-share-btn:hover {
    border-color: var(--mvs-primary);
    color: var(--mvs-primary);
}

.mvs-view-count {
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--mvs-text-muted);
}

/* Single Media Responsive */
@media (max-width: 680px) {
    .mvs-single-media {
        padding: 0;
    }

    .mvs-media-article {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}

@media (max-width: 480px) {
    .mvs-media-header {
        padding: 12px;
    }

    .mvs-media-title {
        font-size: 1.25em;
    }

    .mvs-social-bar {
        padding: 10px 12px;
        gap: 6px;
    }

    .mvs-reaction-btn {
        padding: 4px 8px;
        font-size: 13px;
    }

    .mvs-comments-section {
        padding: 10px 12px 12px;
    }

    .mvs-media-description {
        padding: 10px 12px 0;
    }

    .mvs-media-footer {
        padding: 6px 12px 12px;
    }
}

/* ==========================================================================
   31. Explore Page Grid Fixes
   ========================================================================== */

@media (max-width: 768px) {}

@media (max-width: 480px) {}

/* ==========================================================================
   32. Profile Header (Dashboard) & Profile Edit
   ========================================================================== */

/* Dashboard Profile Header */
.mvs-dashboard-profile-header {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--mvs-surface-2);
    border: 1px solid var(--mvs-border, #dcdcde);
    border-radius: 12px;
}

.mvs-dashboard-profile-view {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mvs-dashboard-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.mvs-dashboard-profile-info {
    flex: 1;
    min-width: 0;
}

.mvs-dashboard-profile-name {
    font-size: 1.125rem;
    margin: 0 0 0.125rem;
    font-weight: 600;
}

.mvs-dashboard-profile-bio {
    font-size: 0.8125rem;
    color: var(--mvs-text-secondary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mvs-dashboard-profile-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mvs-dashboard-profile-actions .mvs-btn {
    font-size: 0.875rem;
}

.mvs-dashboard-profile-edit-btn {
    flex-shrink: 0;
}

/* Inline Edit Form */
.mvs-dashboard-profile-edit-form {
    padding-top: 0.5rem;
}

.mvs-profile-form-inline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mvs-profile-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.mvs-profile-form-actions {
    display: flex;
    gap: 0.5rem;
}

/* Standalone Profile Edit Page */
.mvs-profile-edit {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.mvs-profile-edit h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Messages */
.mvs-profile-message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.mvs-profile-message--success {
    background: var(--mvs-success-bg);
    color: var(--mvs-success);
    border: 1px solid #c3e6cb;
}

.mvs-profile-message--error {
    background: var(--mvs-danger-bg);
    color: var(--mvs-danger);
    border: 1px solid #f5c6cb;
}

/* Avatar Section */
.mvs-profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--mvs-surface-2);
    border-radius: 12px;
}

.mvs-profile-avatar-preview {
    flex-shrink: 0;
}

.mvs-profile-avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--mvs-surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mvs-profile-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mvs-profile-avatar-upload-label {
    cursor: pointer;
    display: inline-block;
}

.mvs-profile-avatar-input {
    display: none;
}

.mvs-profile-avatar-remove {
    font-size: 0.8125rem;
    color: var(--mvs-danger);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.mvs-profile-avatar-remove:hover {
    text-decoration: underline;
}

.mvs-profile-avatar-hint {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
}

/* Form Fields */
.mvs-profile-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.mvs-profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.mvs-profile-field label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--mvs-text);
}

.mvs-profile-field input[type="text"],
.mvs-profile-field textarea {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--mvs-border-light);
    border-radius: 6px;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.mvs-profile-field input[type="text"]:focus,
.mvs-profile-field textarea:focus {
    border-color: var(--mvs-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

.mvs-profile-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Actions */
.mvs-profile-actions {
    margin-top: 0.5rem;
}

/* Shared button styles (used across profile and dashboard) */
.mvs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

/* Icon sizing inside any .mvs-btn. Lucide's default <svg> is 24x24; at
 * that size it towers over 14px label text. Cap to 16px and inherit
 * the button color so the icon pairs properly with the label. The
 * `[data-lucide]` selector covers the brief moment before
 * lucide.createIcons() swaps the <i> placeholder for <svg>. */
.mvs-btn svg,
.mvs-btn [data-lucide] {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    flex-shrink: 0;
    color: inherit;
}

/* Small-variant buttons use smaller labels, so scale the icon down too. */
.mvs-btn.mvs-btn--small svg,
.mvs-btn.mvs-btn--sm svg,
.mvs-btn.mvs-btn--small [data-lucide],
.mvs-btn.mvs-btn--sm [data-lucide] {
    width: 14px;
    height: 14px;
}

.mvs-btn--primary {
    background: var(--mvs-primary);
    /* Always readable on the brand primary background — never use a theme
       surface/bg token here; those flip to dark in dark-mode themes. */
    color: var(--mvs-on-primary, #ffffff);
    border-color: var(--mvs-primary);
}

.mvs-btn--primary:hover,
.mvs-btn--primary:focus,
.mvs-btn--primary:visited {
    background: var(--mvs-primary-hover);
    color: var(--mvs-on-primary, #ffffff);
}

.mvs-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Secondary buttons inherit theme button tokens.
   BuddyX Pro / BuddyX expose dedicated button vars that flip per mode:
   --button-background-color, --button-text-color, --button-border-color
   (and matching :hover variants). We use those directly — no hardcoding. */
.mvs-btn.mvs-btn--secondary {
    background: var(--button-background-color, var(--mvs-surface-2));
    color: var(--button-text-color, var(--mvs-text));
    border: 1px solid var(--button-border-color, var(--mvs-border));
}

.mvs-btn.mvs-btn--secondary:hover,
.mvs-btn.mvs-btn--secondary:focus {
    background: var(--button-background-hover-color, var(--mvs-border));
    color: var(--button-text-hover-color, var(--mvs-text));
    border-color: var(--button-border-hover-color, var(--mvs-border));
}

/* Secondary button icons keep a neutral, theme-agnostic color — some themes
   expose --button-text-color in red/accent, which leaked into lucide SVG fill
   (e.g. Report flag rendered red). Matches the lightbox action convention. */
.mvs-btn.mvs-btn--secondary svg,
.mvs-btn.mvs-btn--secondary [data-lucide] {
    color: var(--mvs-text-secondary);
}

.mvs-btn.mvs-btn--secondary:hover svg,
.mvs-btn.mvs-btn--secondary:focus svg,
.mvs-btn.mvs-btn--secondary:hover [data-lucide],
.mvs-btn.mvs-btn--secondary:focus [data-lucide] {
    color: var(--mvs-text);
}

.mvs-btn--text {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--mvs-text-secondary);
    transition: background 0.15s, color 0.15s;
}

.mvs-btn--text:hover {
    background: rgba(214, 54, 56, 0.08);
    color: var(--mvs-danger);
    border: none;
}

/* Mobile */
@media (max-width: 480px) {
    .mvs-profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }

    .mvs-profile-avatar-actions {
        align-items: center;
    }

    .mvs-profile-avatar-remove {
        text-align: center;
    }

    .mvs-dashboard-profile-view {
        flex-wrap: wrap;
    }

    .mvs-dashboard-profile-actions {
        flex: 0 0 100%;
        flex-wrap: wrap;
    }

    .mvs-profile-field-row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   33a. Search Tabs & User Search
   ========================================================================== */

.mvs-search-bar {
    display: flex;
    align-items: center;
    background: var(--mvs-bg);
    border: 1.5px solid var(--mvs-border-light);
    border-radius: 100px;
    padding: 5px 5px 5px 6px;
    gap: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-width: 600px;
}

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

.mvs-search-mode {
    display: flex;
    background: var(--mvs-surface-2);
    border-radius: 100px;
    padding: 2px;
    flex-shrink: 0;
    gap: 2px;
}

.mvs-search-mode-btn {
    padding: 5px 14px;
    border: none;
    background: transparent;
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--mvs-text-secondary);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.mvs-search-mode-btn.active {
    background: var(--mvs-bg);
    color: var(--mvs-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.mvs-search-field {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0 12px;
    gap: 8px;
    min-width: 0;
}

.mvs-search-icon {
    width: 16px;
    height: 16px;
    color: var(--mvs-text-muted);
    flex-shrink: 0;
}

.mvs-search-field input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--mvs-text);
    padding: 6px 0;
    min-width: 0;
}

.mvs-search-field input#mvs-search-input:focus {
    outline: none;
}

.mvs-search-field input:focus-visible {
    outline: 2px solid var(--mvs-primary, #0073aa);
    outline-offset: -2px;
}

.mvs-search-field input:focus-visible {
    outline: 2px solid var(--mvs-primary);
    outline-offset: -2px;
    border-radius: 2px;
}

.mvs-search-field input::placeholder {
    color: var(--mvs-text-muted);
}

.mvs-user-search-results {
    margin-top: 12px;
}

.mvs-user-search-empty {
    text-align: center;
    color: var(--mvs-text-secondary);
    padding: 16px;
}

.mvs-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--mvs-border);
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mvs-user-card:hover {
    border-color: var(--mvs-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.mvs-user-card-avatar {
    border-radius: 50%;
    object-fit: cover;
}

.mvs-user-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mvs-user-card-info strong {
    font-size: 0.9375rem;
    color: var(--mvs-text);
}

.mvs-user-card-info span {
    font-size: 0.8125rem;
    color: var(--mvs-text-muted);
}

/* Login prompt links styled like buttons */
.mvs-login-prompt {
    opacity: 0.7;
    cursor: pointer;
    text-decoration: none;
}

.mvs-login-to-comment {
    text-align: center;
    padding: 12px;
    color: var(--mvs-text-secondary);
}

.mvs-login-to-comment a {
    color: var(--mvs-primary);
}

/* ==========================================================================
   33. Logged-Out CTA Banner
   ========================================================================== */

.mvs-logged-out-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--mvs-bg);
    padding: 14px 24px;
    border-radius: 8px;
    margin: 0 auto 20px;
    max-width: 1200px;
    position: relative;
}

.wb-grid>.mvs-logged-out-banner {
    flex: 0 0 100%;
}

.mvs-logged-out-banner__content {
    font-size: 0.9375rem;
}

.mvs-logged-out-banner__content strong {
    font-weight: 700;
}

.mvs-logged-out-banner__actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-right: 15px;
}

.mvs-logged-out-banner__actions .mvs-btn--primary {
    background: var(--mvs-bg);
    color: #667eea;
    border: none;
}

.mvs-logged-out-banner__actions .mvs-btn--secondary {
    background: transparent;
    color: var(--mvs-bg);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.mvs-logged-out-banner__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    position: absolute;
    top: 18px;
    right: 8px;
}

.mvs-logged-out-banner__close:hover {
    color: var(--mvs-bg);
    background: none;
    border: none;
}

@media (max-width: 600px) {
    .mvs-logged-out-banner {
        flex-direction: column;
        text-align: center;
        padding: 16px 20px 20px;
    }
}

/* ==========================================================================
   34. Frontend Empty States
   ========================================================================== */

.mvs-empty-state-frontend {
    text-align: center;
    padding: 48px 24px;
    color: var(--mvs-text-secondary);
}

.mvs-empty-state-icon {
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
    opacity: 0.7;
}

.mvs-empty-state-frontend h3 {
    margin: 0 0 8px;
    font-size: 1.125rem;
    color: var(--mvs-text);
}

.mvs-empty-state-frontend p {
    margin: 0 0 16px;
    font-size: 0.9375rem;
    color: var(--mvs-text-secondary);
}

/* -----------------------------------------------------------------------
   Plugin-branded 404 (mvs-empty-state-frontend--404)
   Uses the same design language as the auth gate — centered card with a
   gradient accent, circular icon halo, and popular-tag row below the
   primary CTA.
   ----------------------------------------------------------------------- */
.mvs-archive--404 {
    display: flex;
    justify-content: center;
    padding: clamp(32px, 8vw, 96px) 16px;
}

.mvs-empty-state-frontend--404 {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0;
    padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px);
    background: var(--mvs-surface, #fff);
    border-radius: var(--mvs-radius-lg, 16px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 18px 48px -12px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.mvs-empty-state-frontend--404::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--mvs-primary, #0073aa) 0%,
        #6a5acd 50%,
        #ff6aa6 100%);
}

.mvs-empty-state-frontend__glyph {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(var(--mvs-primary-rgb, 0, 115, 170), 0.08);
    color: var(--mvs-primary, #0073aa);
    z-index: 1;
}

.mvs-empty-state-frontend__glyph svg {
    width: 44px;
    height: 44px;
    stroke-width: 1.75;
}

.mvs-empty-state-frontend__title {
    margin: 0 0 12px;
    font-family: var(--mvs-font-heading, inherit);
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 700;
    line-height: 1.25;
    color: var(--mvs-text, #1e1e1e);
}

.mvs-empty-state-frontend__lede {
    margin: 0 auto 28px;
    max-width: 420px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--mvs-text-secondary, #646970);
}

.mvs-empty-state-frontend--404 .mvs-empty-state-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.mvs-empty-state-frontend--404 .mvs-btn--primary {
    min-width: 200px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
}

.mvs-empty-state-frontend__tags-label {
    margin: 12px 0 10px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mvs-text-muted, #a7aaad);
}

.mvs-empty-state-frontend--404 .mvs-empty-state-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.mvs-empty-state-frontend--404 .mvs-tag-cloud-item {
    padding: 6px 14px;
    border-radius: var(--mvs-radius-pill, 100px);
    background: var(--mvs-surface-2, #f6f7f7);
    color: var(--mvs-text, #1e1e1e);
    font-size: 13px;
    text-decoration: none;
    transition: background 150ms ease, color 150ms ease;
}

.mvs-empty-state-frontend--404 .mvs-tag-cloud-item:hover,
.mvs-empty-state-frontend--404 .mvs-tag-cloud-item:focus-visible {
    background: rgba(var(--mvs-primary-rgb, 0, 115, 170), 0.08);
    color: var(--mvs-primary, #0073aa);
}

@media (max-width: 640px) {
    .mvs-archive--404 {
        padding: 24px 12px 48px;
    }
    .mvs-empty-state-frontend--404 {
        padding: 28px 20px 32px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.15);
    }
    .mvs-empty-state-frontend__glyph {
        width: 72px;
        height: 72px;
        margin-bottom: 16px;
    }
    .mvs-empty-state-frontend__glyph svg {
        width: 40px;
        height: 40px;
    }
    .mvs-empty-state-frontend--404 .mvs-btn--primary {
        width: 100%;
        min-width: 0;
    }
}

/* ==========================================================================
   34b. Profile Completion Prompt
   ========================================================================== */

.mvs-profile-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--mvs-warning-bg);
    border: 1px solid var(--mvs-warning);
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    position: relative;
}

.mvs-profile-prompt-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.mvs-profile-prompt-text {
    flex: 1;
    color: var(--mvs-warning);
}

.mvs-profile-prompt-text .mvs-dashboard-profile-edit-btn {
    background: transparent;
    color: var(--mvs-warning);
    font-weight: 700;
    text-decoration: underline;
    border: 0;
    padding: 0;
}

.mvs-profile-prompt-text .mvs-dashboard-profile-edit-btn:hover,
.mvs-profile-prompt-text .mvs-dashboard-profile-edit-btn:focus {
    background: transparent;
    color: var(--mvs-primary);
    border: 0;
    padding: 0;
    box-shadow: none;
}

.mvs-profile-prompt-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--mvs-warning);
    padding: 4px;
    line-height: 1;
}

.mvs-profile-prompt-close:hover,
.mvs-profile-prompt-close:focus {
    color: var(--mvs-primary);
    background: none;
    border: none;
}

/* ==========================================================================
   35. Accessibility — Focus & Reduced Motion
   ========================================================================== */

/* Visible focus ring on all interactive elements */
.mvs-btn:focus-visible,
.mvs-reaction-btn:focus-visible,
.mvs-favorite-btn:focus-visible,
.mvs-share-btn:focus-visible,
.mvs-follow-btn:focus-visible,
.mvs-dashboard-tab:focus-visible,
.mvs-comment-form button:focus-visible,
.mvs-comment-form textarea:focus-visible,
.mvs-tag-cloud-item:focus-visible,
.mvs-notification-bell:focus-visible,
.mvs-modal-close:focus-visible,
.mvs-dashboard-dropzone:focus-visible {
    outline: 2px solid var(--mvs-primary);
    outline-offset: 2px;
}

/* Focus trap visual — modals */
.mvs-modal:focus-within {
    box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.15);
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ==========================================================================
   36. Mobile Touch Targets & Responsiveness
   ========================================================================== */

@media (max-width: 768px) {

    /* Ensure minimum 44px touch targets */
    .mvs-reaction-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 10px;
    }

    .mvs-favorite-btn,
    .mvs-share-btn {
        min-height: 44px;
        padding: 10px 14px;
    }

    .mvs-follow-btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    /* Increase spacing between action buttons */
    .mvs-social-actions {
        gap: 8px;
    }

    .mvs-social-actions-left {
        gap: 8px;
    }

    /* Sticky dashboard tabs — mobile guideline §5.2 */
    .mvs-dashboard-tabs {
        position: sticky;
        top: 0;
        z-index: var(--mvs-z-sticky);
        background: var(--mvs-bg);
        padding: 8px 0;
        border-bottom: 1px solid var(--mvs-border);
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -ms-overflow-style: none;
        /* Edge-fade so users see there are more tabs to swipe to. */
        -webkit-mask-image: linear-gradient(to right,
            black 0,
            black calc(100% - 24px),
            transparent 100%);
        mask-image: linear-gradient(to right,
            black 0,
            black calc(100% - 24px),
            transparent 100%);
    }

    .mvs-dashboard-tabs::-webkit-scrollbar { display: none; }

    .mvs-dashboard-tabs > .mvs-dashboard-tab {
        scroll-snap-align: start;
    }

    .mvs-dashboard-tab {
        min-height: 44px;
    }

    /* Prevent horizontal overflow on long text */
    .mvs-media-title {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .mvs-media-author-name {
        max-width: 150px;
    }

    .mvs-grid-item-info {
        max-width: 100%;
        overflow: hidden;
    }

    .mvs-grid-item-author {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    /* Single media — sticky bottom action bar */
    .mvs-social-bar {
        position: sticky;
        bottom: 0;
        background: var(--mvs-bg);
        border-top: 1px solid var(--mvs-border);
        padding: 8px 16px;
        margin: 0 -16px;
        z-index: 5;
    }

    .mvs-social-actions {
        flex-wrap: wrap;
    }

    /* Notification bell touch target */
    .mvs-notification-bell {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Upload dropzone larger on mobile */
    .mvs-dashboard-dropzone {
        min-height: 120px;
    }

    /* Tag cloud horizontal scroll */
    .mvs-tag-cloud {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .mvs-tag-cloud-item {
        min-height: 36px;
        padding: 6px 12px;
    }

    /* Modal full-screen on mobile */
    .mvs-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }

    .mvs-modal-body {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* Bottom navigation bar for mobile logged-in users */
@media (max-width: 600px) {
    .mvs-explore-header h1 {
        font-size: 1.25rem;
    }

    .mvs-explore-search input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .mvs-media-grid.mvs-cols-3,
    .mvs-media-grid.mvs-cols-4,
    .mvs-media-grid.mvs-cols-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .mvs-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mvs-dashboard-card-actions {
        flex-wrap: wrap;
    }

    /* Comment form stacked on mobile */
    .mvs-comment-form {
        flex-direction: column;
    }

    .mvs-comment-form button {
        align-self: flex-end;
    }
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

[dir="rtl"] [dir="rtl"] [dir="rtl"] [dir="rtl"] [dir="rtl"] .mvs-grid-item-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .mvs-grid-item-overlay {
    text-align: right;
}

[dir="rtl"] .mvs-search-bar {
    flex-direction: row-reverse;
}

[dir="rtl"] .mvs-search-field {
    flex-direction: row-reverse;
}

[dir="rtl"] .mvs-activity-media-remove {
    right: auto;
    left: 4px;
}

[dir="rtl"] .mvs-explore-header {
    text-align: right;
}

[dir="rtl"] .mvs-tag-cloud {
    direction: rtl;
}

[dir="rtl"] [dir="rtl"] [dir="rtl"] .mvs-logged-out-banner__content {
    text-align: right;
}

[dir="rtl"] .mvs-logged-out-banner__close {
    right: auto;
    left: 16px;
}

[dir="rtl"] .mvs-chat-trigger {
    right: auto;
    left: 20px;
}

[dir="rtl"] .mvs-bp-album-form,
[dir="rtl"] .mvs-bp-album-msg {
    text-align: right;
}

/* ==========================================================================
   Mobile — Search Bar Responsive Fixes
   ========================================================================== */

@media (max-width: 768px) {
    .mvs-search-bar {
        max-width: 100%;
    }

    .mvs-search-mode-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .mvs-explore-header h1 {
        font-size: 1.25rem;
    }

    .mvs-search-bar {
        border-radius: var(--mvs-radius-lg);
        padding: 4px;
    }

    .mvs-search-mode {
        display: none;
        /* Collapsed on very small screens — defaults to media mode */
    }
}


/* ── Lightbox social sidebar ───────────────────────────────────────── */
.mvs-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #000;
    display: flex;
    align-items: stretch;
    animation: mvs-fade-in 0.2s ease;
}

.mvs-lightbox {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    background: var(--mvs-surface);
    border-radius: 0;
    overflow: hidden;
    animation: mvs-slide-up 0.3s ease;
}

.mvs-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, .5);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--mvs-surface);
}

.mvs-lightbox-close:hover {
    background: rgba(0, 0, 0, .7);
}

.mvs-lightbox-close svg {
    width: 20px;
    height: 20px;
}

.mvs-lightbox-loading {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mvs-lightbox-media {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.mvs-lightbox-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.mvs-lightbox-media img[hidden],
.mvs-lightbox-media video[hidden],
.mvs-lightbox-media audio[hidden] {
    display: none !important;
}

.mvs-lightbox-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 0;
    background: #000;
}

.mvs-lightbox-audio {
    width: min(400px, 80%);
    display: block;
    border-radius: 12px;
    padding: 8px;
    filter: invert(1);
}

.mvs-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .85);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.mvs-lightbox-nav:hover {
    background: var(--mvs-surface);
}

.mvs-lightbox-nav--prev {
    left: 12px;
}

.mvs-lightbox-nav--next {
    right: 12px;
}

.mvs-lightbox-position {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, .6);
    color: var(--mvs-surface);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
}

/* Sidebar */
.mvs-lightbox-sidebar {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--mvs-border-light);
    overflow-y: auto;
    background: var(--mvs-surface);
}

.mvs-lightbox-author {
    padding: 14px 16px;
    border-bottom: 1px solid var(--mvs-border-light);
}

.mvs-lightbox-author-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.mvs-lightbox-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.mvs-lightbox-stats {
    padding: 6px 16px;
    font-size: 13px;
    color: var(--mvs-text-secondary);
}

.mvs-lightbox-reactions {
    display: flex;
    gap: 2px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--mvs-border-light);
}

.mvs-lightbox-reaction {
    background: none;
    border: 1px solid var(--mvs-border);
    border-radius: 20px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all .15s;
}

.mvs-lightbox-reaction>span:empty {
    display: none;
}

.mvs-lightbox-reaction:hover {
    background: var(--mvs-surface-2);
    border-color: var(--mvs-border-light);
}

.mvs-lightbox-reaction.active {
    background: var(--mvs-info-bg);
    border-color: var(--mvs-primary);
    color: var(--mvs-primary);
}

.mvs-lightbox-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mvs-border-light);
}

.mvs-lightbox-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 12px;
    text-align: center;
    border-radius: 6px;
    text-decoration: none;
    color: var(--mvs-text);
}

.mvs-lightbox-action:hover,
.mvs-lightbox-action:focus {
    background: var(--mvs-surface-2);
    color: var(--mvs-text);
    border: none;
}

.mvs-lightbox-action.active {
    color: var(--mvs-danger);
}

.mvs-lightbox-action [data-lucide],
.mvs-lightbox-action svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.mvs-lightbox-action--report {
    margin-left: auto;
    color: var(--mvs-text-secondary);
    font-size: 13px;
}

.mvs-lightbox-action--report:hover {
    color: var(--mvs-danger);
    background: var(--mvs-danger-bg);
}

.mvs-lightbox-desc {
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-bottom: 1px solid var(--mvs-border-light);
}

.mvs-lightbox-desc strong {
    margin-right: 6px;
}

.mvs-lightbox-comments {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mvs-lightbox-comments-heading {
    margin: 0;
    padding: 14px 16px 8px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--mvs-text-muted, #6b7280);
    border-bottom: 1px solid var(--mvs-border-light, #e5e7eb);
}

.mvs-lightbox-comment-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    margin: 0;
    list-style: none;
}

.mvs-lightbox-comment {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mvs-border-light, #e5e7eb);
}

.mvs-lightbox-comment:last-child {
    border-bottom: none;
}

.mvs-lightbox-comment-avatar-link {
    flex-shrink: 0;
    display: block;
    text-decoration: none;
    line-height: 0;
}

.mvs-lightbox-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.mvs-lightbox-comment-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mvs-lightbox-comment-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.mvs-lightbox-comment-author-link {
    text-decoration: none;
    color: inherit;
}

.mvs-lightbox-comment-author-link:hover .mvs-lightbox-comment-author {
    text-decoration: underline;
}

.mvs-lightbox-comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--mvs-text, #111827);
}

.mvs-lightbox-comment-time {
    font-size: 12px;
    color: var(--mvs-text-muted, #6b7280);
    white-space: nowrap;
    flex-shrink: 0;
}

.mvs-lightbox-comment-content {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--mvs-text, #111827);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.mvs-lightbox-no-comments {
    color: var(--mvs-text-muted, #6b7280);
    font-size: 14px;
    text-align: center;
    padding: 32px 16px;
    margin: 0;
}

.mvs-lightbox-view-all-comments {
    display: block;
    text-align: center;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--mvs-primary, #E35656);
    text-decoration: none;
    border-top: 1px solid var(--mvs-border-light, #e5e7eb);
}

.mvs-lightbox-view-all-comments:hover {
    background: var(--mvs-bg-muted, #f9fafb);
}

.mvs-lightbox-comment-form {
    display: flex;
    gap: 0;
    border-top: 1px solid var(--mvs-border-light, #e5e7eb);
    padding: 0;
    background: #fff;
}

.mvs-lightbox-comment-input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
    min-width: 0;
}

.mvs-lightbox-comment-input:focus-visible {
    outline: 2px solid var(--mvs-primary, #E35656);
    outline-offset: -2px;
}

.mvs-lightbox-comment-post {
    background: var(--mvs-primary, #E35656);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: filter 0.15s ease;
}

.mvs-lightbox-comment-post:disabled {
    background: var(--mvs-border-light, #e5e7eb);
    color: var(--mvs-text-muted, #6b7280);
    cursor: default;
}

.mvs-lightbox-comment-post:not(:disabled):hover {
    filter: brightness(0.92);
    color: #ffffff;
}

@media (max-width: 768px) {
    .mvs-lightbox {
        flex-direction: column;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
    }

    .mvs-lightbox-media {
        flex: 1;
        min-height: 0;
    }

    .mvs-lightbox-sidebar {
        width: 100%;
        flex: 0 0 45%;
        border-left: none;
        border-top: 1px solid var(--mvs-border-light);
    }
}
/* Replace-file row inside edit modal */
.mvs-replace-file-row {
    padding: 0 24px 12px;
    border-top: 1px solid var(--mvs-border-light);
    margin-top: 12px;
    padding-top: 12px;
}

.mvs-replace-file-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mvs-replace-file-hint {
    color: var(--mvs-text-secondary);
    font-size: 12px;
    margin-left: 8px;
}

/* -----------------------------------------------------------------------
   Auth gate — premium empty-state shown on plugin pages that require login
   (e.g. /my-media/ dashboard shortcode while logged out).
   ----------------------------------------------------------------------- */
.mvs-auth-gate {
    display: flex;
    justify-content: center;
    padding: clamp(32px, 8vw, 96px) 16px;
}

.mvs-auth-gate__card {
    position: relative;
    width: 100%;
    max-width: 560px;
    padding: clamp(32px, 5vw, 56px) clamp(24px, 4vw, 48px);
    background: var(--mvs-surface, #fff);
    border-radius: var(--mvs-radius-lg, 16px);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 18px 48px -12px rgba(15, 23, 42, 0.18);
    text-align: center;
    overflow: hidden;
    color: var(--mvs-primary);
}

.mvs-auth-gate__card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--mvs-primary, #0073aa) 0%,
        #6a5acd 50%,
        #ff6aa6 100%);
}

.mvs-auth-gate__card::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -120px;
    top: -140px;
    background: radial-gradient(circle,
        rgba(var(--mvs-primary-rgb, 0, 115, 170), 0.08) 0%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.mvs-auth-gate__glyph {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: rgba(var(--mvs-primary-rgb, 0, 115, 170), 0.08);
    color: var(--mvs-primary, #0073aa);
    z-index: 1;
}

.mvs-auth-gate__glyph svg {
    width: 44px;
    height: 44px;
    stroke-width: 1.75;
}

.mvs-auth-gate__title {
    position: relative;
    margin: 0 0 12px;
    font-family: var(--mvs-font-heading, inherit);
    font-size: clamp(22px, 2.6vw, 28px);
    font-weight: 700;
    line-height: 1.25;
    color: var(--mvs-text, #1e1e1e);
    z-index: 1;
}

.mvs-auth-gate__lede {
    position: relative;
    margin: 0 auto 28px;
    max-width: 420px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--mvs-text-secondary, #646970);
    z-index: 1;
}

.mvs-auth-gate__benefits {
    position: relative;
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
    text-align: left;
    display: grid;
    gap: 12px;
    z-index: 1;
}

.mvs-auth-gate__benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--mvs-surface-2, #f6f7f7);
    border-radius: var(--mvs-radius-md, 10px);
    font-size: 14px;
    color: var(--mvs-text, #1e1e1e);
    line-height: 1.4;
}

.mvs-auth-gate__benefit-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mvs-surface, #fff);
    border-radius: 50%;
    color: var(--mvs-primary, #0073aa);
    line-height: 1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.mvs-auth-gate__benefit-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.mvs-auth-gate__actions {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 1;
}

.mvs-auth-gate__primary {
    min-width: 240px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.mvs-auth-gate__secondary {
    font-size: 14px;
    color: var(--mvs-text-secondary, #646970);
    text-decoration: none;
    transition: color 150ms ease;
}

.mvs-auth-gate__secondary:hover,
.mvs-auth-gate__secondary:focus-visible {
    color: var(--mvs-primary, #0073aa);
}

.mvs-auth-gate__secondary strong {
    color: var(--mvs-primary, #0073aa);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 640px) {
    .mvs-auth-gate {
        padding: 24px 12px 48px;
    }
    .mvs-auth-gate__card {
        padding: 28px 20px 32px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.15);
    }
    .mvs-auth-gate__glyph {
        width: 72px;
        height: 72px;
        margin-bottom: 16px;
    }
    .mvs-auth-gate__glyph svg {
        width: 44px;
        height: 44px;
    }
    .mvs-auth-gate__primary {
        width: 100%;
        min-width: 0;
    }
}

@media (prefers-color-scheme: dark) {
    .mvs-auth-gate__card {
        background: var(--mvs-surface, #1e1e1e);
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.2),
            0 18px 48px -12px rgba(0, 0, 0, 0.55);
    }
}

/* Album cover hint inside FAB upload modal (album mode, files selected). */
.mvs-modal-album-cover-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 8px;
    background: var(--mvs-surface-2, #f5f5f5);
    border-left: 3px solid var(--mvs-primary, #2271b1);
    border-radius: 4px;
    font-size: 13px;
    color: var(--mvs-text-secondary, #555);
}
.mvs-modal-album-cover-hint[hidden] { display: none; }
.mvs-modal-album-cover-hint svg {
    flex-shrink: 0;
    color: var(--mvs-primary, #2271b1);
}
@media (max-width: 640px) {
    .mvs-modal-album-cover-hint { font-size: 12px; padding: 6px 10px; }
}

/* ============================================================================
   Single album page — cover selection overlay (owner only).
   Renders a "Set as cover" button on each image tile and a "Cover" badge on
   the current cover. Pairs with templates/album.php inline JS that PUTs to
   /albums/{id}/cover. set_cover() is atomic (adds the media to the album in
   the same request if not already there), so no client-side ordering needed.
   ============================================================================ */
.mvs-album-item-wrap {
    position: relative;
    display: block;
}

.mvs-album-cover-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mvs-surface, #fff);
    background: var(--mvs-primary, #2271b1);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.mvs-album-set-cover {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--mvs-surface, #fff);
    background: rgba(17, 17, 17, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.mvs-album-item-wrap:hover .mvs-album-set-cover,
.mvs-album-set-cover:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.mvs-album-set-cover:hover,
.mvs-album-set-cover:focus-visible {
    background: var(--mvs-primary, #2271b1);
    border-color: var(--mvs-primary, #2271b1);
    outline: none;
}

.mvs-album-set-cover[disabled] {
    opacity: 0.7;
    cursor: progress;
}

.mvs-album-set-cover .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 1;
}

@media (max-width: 640px) {
    .mvs-album-set-cover {
        /* Mobile: always visible (no hover). */
        opacity: 1;
        transform: none;
        padding: 4px 8px;
        font-size: 11px;
    }
    .mvs-album-cover-badge {
        padding: 3px 8px;
        font-size: 10px;
    }
}
