/* ══════════════════════════════════════════════
   OpenTune Web — Custom Styles
   Complementa Tailwind CSS con estilos glassmórficos,
   dialogs, animaciones y componentes personalizados.
   ══════════════════════════════════════════════ */

/* ─── Base ─── */
html {
    scroll-behavior: smooth;
}

*, ::before, ::after {
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

/* ─── Material Symbols ─── */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ─── Glass Card ─── */
.glass-card {
    background: rgba(20, 19, 23, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Ambient Glow ─── */
.ambient-glow {
    box-shadow: 0 0 40px 0 rgba(208, 188, 255, 0.15);
}

/* ─── Feature Icon Wrapper ─── */
.feature-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

/* ─── Version Chips ─── */
.version-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    background-color: rgba(43, 41, 45, 0.8);
    color: #cac4d0;
    font-size: 11px;
    font-weight: 500;
    font-family: 'Be Vietnam Pro', sans-serif;
    line-height: 16px;
}

.version-chip--stable {
    background-color: rgba(239, 184, 200, 0.18);
    color: #ffd9e3;
}

.version-chip--beta {
    background-color: rgba(74, 67, 89, 0.6);
    color: #ccc2dc;
}

.version-chip--alpha {
    background-color: rgba(208, 188, 255, 0.15);
    color: #e9ddff;
}

.version-chip--latest {
    background-color: rgba(208, 188, 255, 0.18);
    color: #d0bcff;
}

/* ─── Footer Chips ─── */
.footer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9999px;
    border: 1px solid rgba(73, 69, 79, 0.5);
    color: #948f9a;
    font-size: 13px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.footer-chip:hover {
    border-color: rgba(208, 188, 255, 0.4);
    color: #d0bcff;
    background: rgba(208, 188, 255, 0.07);
    transform: translateY(-1px);
}

/* ─── Developer Chip Animation ─── */
.developer-chip {
    animation: shine 3.5s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.8; transform: scale(1.04); }
}

/* ══════════════════════════════════════════════
   GLASS DIALOGS
   ══════════════════════════════════════════════ */

.glass-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(90vw, 480px);
    max-height: 85vh;
    border: none;
    border-radius: 2rem;
    background: rgba(18, 17, 22, 0.88);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e1e7;
    overflow: hidden;
    padding: 0;
    box-shadow:
        0 30px 70px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(208, 188, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-dialog--large {
    width: min(90vw, 600px);
}

.glass-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Dialog layout */
.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0;
    gap: 12px;
}

.dialog-content {
    padding: 20px 24px;
}

.dialog-content--scroll {
    overflow-y: auto;
    max-height: 58vh;
}

.dialog-content--scroll::-webkit-scrollbar {
    width: 4px;
}
.dialog-content--scroll::-webkit-scrollbar-track {
    background: transparent;
}
.dialog-content--scroll::-webkit-scrollbar-thumb {
    background: rgba(208, 188, 255, 0.25);
    border-radius: 2px;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 24px 24px;
}

/* Dialog buttons */
.dialog-icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: #cac4d0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.dialog-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dialog-text-btn {
    background: transparent;
    border: none;
    color: #d0bcff;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s;
}

.dialog-text-btn:hover {
    background: rgba(208, 188, 255, 0.1);
}

.dialog-filled-btn {
    background: #d0bcff;
    border: none;
    color: #37265e;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 24px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
}

.dialog-filled-btn:hover {
    filter: brightness(1.1);
}

.dialog-filled-btn:active {
    transform: scale(0.96);
}

/* Dialog list items (language) */
.dialog-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 1rem;
    color: #e5e1e7;
    font-family: 'Be Vietnam Pro', sans-serif;
    transition: background 0.2s;
    cursor: pointer;
}

.dialog-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.flag-icon {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   LOADING INDICATOR
   ══════════════════════════════════════════════ */

.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 56px 40px;
}

.circular-progress {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(208, 188, 255, 0.18);
    border-top: 3px solid #d0bcff;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════
   MARKDOWN BODY (changelog)
   ══════════════════════════════════════════════ */

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: #e5e1e7;
    font-family: 'Epilogue', sans-serif;
    margin: 20px 0 10px;
}

.markdown-body h1 { font-size: 1.4rem; font-weight: 700; }
.markdown-body h2 { font-size: 1.15rem; font-weight: 600; }
.markdown-body h3 { font-size: 1rem; font-weight: 600; }

.markdown-body p {
    color: #cac4d0;
    line-height: 1.75;
    margin: 8px 0;
}

.markdown-body ul,
.markdown-body ol {
    color: #cac4d0;
    padding-left: 22px;
    margin: 8px 0;
    line-height: 1.75;
}

.markdown-body li {
    margin: 4px 0;
}

.markdown-body code {
    background: rgba(208, 188, 255, 0.12);
    color: #d0bcff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.82em;
    font-family: ui-monospace, 'Courier New', monospace;
}

.markdown-body pre {
    background: rgba(14, 14, 17, 0.7);
    border: 1px solid rgba(73, 69, 79, 0.4);
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
    margin: 12px 0;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
    color: #e5e1e7;
}

.markdown-body a {
    color: #d0bcff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.markdown-body a:hover {
    color: #e9ddff;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid rgba(73, 69, 79, 0.5);
    margin: 20px 0;
}

/* Changelog meta header */
.changelog-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(73, 69, 79, 0.4);
}

.changelog-date {
    font-size: 13px;
    color: #948f9a;
    font-family: 'Be Vietnam Pro', sans-serif;
}

/* ══════════════════════════════════════════════
   VERSION LIST (versions dialog)
   ══════════════════════════════════════════════ */

.version-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 12px;
    border-bottom: 1px solid rgba(73, 69, 79, 0.3);
}

.version-list-item:last-child {
    border-bottom: none;
}

.version-list-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.version-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.version-tag {
    font-size: 15px;
    font-weight: 500;
    color: #e5e1e7;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.version-date {
    font-size: 12px;
    color: #948f9a;
    font-family: 'Be Vietnam Pro', sans-serif;
}

.version-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(43, 41, 45, 0.8);
    color: #e5e1e7;
    border: 1px solid rgba(73, 69, 79, 0.4);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Be Vietnam Pro', sans-serif;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.version-dl-btn:hover {
    background: rgba(53, 52, 56, 0.9);
    border-color: rgba(208, 188, 255, 0.3);
    color: #d0bcff;
}

/* ══════════════════════════════════════════════
   DISABLED CARD (Windows)
   ══════════════════════════════════════════════ */

.disabled-card {
    position: relative;
    overflow: hidden;
    cursor: not-allowed;
    user-select: none;
    -webkit-user-select: none;
}

/* Diagonal stripe overlay */
.disabled-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 14px,
        rgba(255, 255, 255, 0.018) 14px,
        rgba(255, 255, 255, 0.018) 28px
    );
    pointer-events: none;
    z-index: 0;
}

.disabled-card__inner {
    position: relative;
    z-index: 1;
    opacity: 0.5;
    pointer-events: none;
}

/* ══════════════════════════════════════════════
   SCROLLBAR (global)
   ══════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(208, 188, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(208, 188, 255, 0.38);
}

/* ══════════════════════════════════════════════
   FOCUS VISIBLE
   ══════════════════════════════════════════════ */

:focus-visible {
    outline: 2px solid #d0bcff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ══════════════════════════════════════════════
   LIGHT MODE OVERRIDES
   (activa con root.classList.add('light-mode'))
   ══════════════════════════════════════════════ */

:root.light-mode {
    --lm-bg:           #FEF7FF;
    --lm-on-bg:        #1D1B20;
    --lm-surface:      #FEF7FF;
    --lm-on-surface:   #1D1B20;
    --lm-sc-low:       #F7F2FA;
    --lm-sc:           #F3EDF7;
    --lm-sc-high:      #ECE6F0;
    --lm-sc-highest:   #E6E0E9;
    --lm-primary:      #6750A4;
    --lm-on-primary:   #FFFFFF;
    --lm-pc:           #EADDFF;
    --lm-on-pc:        #21005D;
    --lm-sec-c:        #E8DEF8;
    --lm-on-sec-c:     #1D192B;
    --lm-on-sv:        #49454F;
    --lm-ov:           #CAC4D0;
}

:root.light-mode body {
    background-color: var(--lm-bg);
    color: var(--lm-on-bg);
}

:root.light-mode .bg-background    { background-color: var(--lm-bg) !important; }
:root.light-mode .bg-surface       { background-color: var(--lm-surface) !important; }
:root.light-mode .bg-surface-container-lowest { background-color: var(--lm-sc-low) !important; }
:root.light-mode .bg-surface-container-high   { background-color: var(--lm-sc-high) !important; }
:root.light-mode .bg-surface-container-highest{ background-color: var(--lm-sc-highest) !important; }
:root.light-mode .bg-primary-container        { background-color: var(--lm-pc) !important; }
:root.light-mode .bg-secondary-container      { background-color: var(--lm-sec-c) !important; }
:root.light-mode .bg-primary       { background-color: var(--lm-primary) !important; }

:root.light-mode .text-on-surface         { color: var(--lm-on-surface) !important; }
:root.light-mode .text-on-surface-variant { color: var(--lm-on-sv) !important; }
:root.light-mode .text-on-background      { color: var(--lm-on-bg) !important; }
:root.light-mode .text-on-primary         { color: var(--lm-on-primary) !important; }
:root.light-mode .text-on-primary-container { color: var(--lm-on-pc) !important; }
:root.light-mode .text-on-secondary-container { color: var(--lm-on-sec-c) !important; }
:root.light-mode .text-primary            { color: var(--lm-primary) !important; }
:root.light-mode .text-violet-300         { color: var(--lm-primary) !important; }
:root.light-mode .text-slate-400          { color: var(--lm-on-sv) !important; }
:root.light-mode .text-slate-500          { color: #79747E !important; }
:root.light-mode .text-slate-100          { color: var(--lm-on-surface) !important; }
:root.light-mode .text-surface            { color: var(--lm-surface) !important; }

:root.light-mode .border-outline-variant  { border-color: var(--lm-ov) !important; }
:root.light-mode .border-white\/10        { border-color: rgba(0, 0, 0, 0.08) !important; }
:root.light-mode .border-white\/5         { border-color: rgba(0, 0, 0, 0.05) !important; }

:root.light-mode .bg-slate-950\/65 { background-color: rgba(254, 247, 255, 0.82) !important; }
:root.light-mode .bg-slate-950     { background-color: #F7F2FA !important; }

:root.light-mode .glass-card {
    background: rgba(255, 255, 255, 0.65);
    border-color: rgba(0, 0, 0, 0.06);
}

:root.light-mode .glass-dialog {
    background: rgba(240, 236, 248, 0.92);
    border-color: rgba(0, 0, 0, 0.08);
    color: #1D1B20;
}

:root.light-mode .glass-dialog::backdrop {
    background: rgba(0, 0, 0, 0.42);
}

:root.light-mode .dialog-text-btn  { color: var(--lm-primary); }
:root.light-mode .dialog-text-btn:hover { background: rgba(103, 80, 164, 0.1); }
:root.light-mode .dialog-icon-btn   { color: var(--lm-on-sv); }
:root.light-mode .dialog-icon-btn:hover { background: rgba(0,0,0,0.06); }
:root.light-mode .dialog-list-item  { color: var(--lm-on-surface); }
:root.light-mode .dialog-list-item:hover { background: rgba(0,0,0,0.05); }
:root.light-mode .dialog-filled-btn { background: var(--lm-primary); color: var(--lm-on-primary); }

:root.light-mode .footer-chip {
    border-color: rgba(0, 0, 0, 0.12);
    color: #49454F;
}
:root.light-mode .footer-chip:hover {
    border-color: var(--lm-primary);
    color: var(--lm-primary);
    background: rgba(103, 80, 164, 0.06);
}

:root.light-mode .circular-progress {
    border-color: rgba(103, 80, 164, 0.18);
    border-top-color: var(--lm-primary);
}

:root.light-mode .version-chip {
    background-color: rgba(231, 224, 236, 0.9);
    color: #49454F;
}

:root.light-mode .version-dl-btn {
    background: rgba(231, 224, 236, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1D1B20;
}
:root.light-mode .version-dl-btn:hover {
    border-color: var(--lm-primary);
    color: var(--lm-primary);
}

:root.light-mode .markdown-body h1,
:root.light-mode .markdown-body h2,
:root.light-mode .markdown-body h3 { color: #1D1B20; }
:root.light-mode .markdown-body p,
:root.light-mode .markdown-body li  { color: #49454F; }
:root.light-mode .markdown-body code {
    background: rgba(103, 80, 164, 0.1);
    color: var(--lm-primary);
}
:root.light-mode .markdown-body a   { color: var(--lm-primary); }

:root.light-mode .ambient-glow {
    box-shadow: 0 0 40px 0 rgba(103, 80, 164, 0.18);
}

:root.light-mode .from-surface {
    --tw-gradient-from: #FEF7FF var(--tw-gradient-from-position);
}

/* ══════════════════════════════════════════════
   ACCESSIBILITY & PERFORMANCE
   ══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .glass-card {
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.25);
    }
    .glass-dialog {
        border-width: 2px;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE FIXES
   ══════════════════════════════════════════════ */

@media (max-width: 640px) {
    .glass-dialog {
        width: 92vw;
        border-radius: 1.5rem;
        max-height: 88vh;
    }

    .dialog-header {
        padding: 20px 18px 0;
    }

    .dialog-content {
        padding: 16px 18px;
    }

    .dialog-actions {
        padding: 0 18px 20px;
    }
}

@media (max-width: 480px) {
    .version-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .version-dl-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ─── Screenshots Accordion ─── */
#screenshots-content {
    max-height: 2000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                margin 0.3s ease;
}

#screenshots-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
    margin: 0;
    padding: 0;
}

#screenshots-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#screenshots-icon.rotated {
    transform: rotate(180deg);
}

#screenshots-header:hover #screenshots-toggle {
    background: rgba(255, 255, 255, 0.08);
}

.screenshots-shell {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(208, 188, 255, 0.18), transparent 36%),
        radial-gradient(circle at bottom right, rgba(204, 194, 220, 0.14), transparent 32%),
        rgba(20, 19, 23, 0.55);
}

.screenshots-carousel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
}

.screenshots-hero-panel {
    min-width: 0;
}

.screenshots-chip {
    color: #e9ddff;
    background: rgba(208, 188, 255, 0.12);
    border: 1px solid rgba(208, 188, 255, 0.2);
}

.screenshots-counter {
    min-width: 110px;
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
}

.screenshots-stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.screenshots-viewport {
    overflow: hidden;
    min-width: 0;
}

.screenshots-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform;
}

.screenshots-slide {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.screenshots-device-frame {
    position: relative;
    width: min(100%, 360px);
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(53, 52, 56, 0.72), rgba(28, 27, 31, 0.9));
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.screenshots-device-frame::before {
    content: "";
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 34%;
    height: 18px;
    border-radius: 999px;
    background: rgba(20, 19, 23, 0.85);
    z-index: 2;
}

.screenshots-device-frame img {
    display: block;
}

.screenshots-nav-button {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
    color: #e5e1e7;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.screenshots-nav-button:hover {
    transform: scale(1.04);
    background: rgba(208, 188, 255, 0.14);
    border-color: rgba(208, 188, 255, 0.24);
}

.screenshots-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
}

.screenshots-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.screenshots-indicator {
    min-width: 54px;
    height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #cac4d0;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.screenshots-indicator.is-active {
    background: rgba(208, 188, 255, 0.18);
    border-color: rgba(208, 188, 255, 0.32);
    color: #e9ddff;
    box-shadow: 0 10px 30px rgba(208, 188, 255, 0.16);
}

.screenshots-preview-rail {
    display: grid;
    gap: 14px;
    align-content: start;
}

.screenshots-preview-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    text-align: left;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.screenshots-preview-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.06);
}

.screenshots-preview-card.is-active {
    background: rgba(208, 188, 255, 0.12);
    border-color: rgba(208, 188, 255, 0.24);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

.screenshots-preview-thumb {
    width: 74px;
    aspect-ratio: 9 / 16;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

@media (min-width: 1024px) {
    .screenshots-carousel-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(260px, 320px);
        gap: 32px;
        align-items: start;
    }
}

@media (max-width: 767px) {
    .screenshots-stage {
        grid-template-columns: minmax(0, 1fr);
    }

    .screenshots-nav-button {
        width: 48px;
        height: 48px;
    }

    .screenshots-stage .screenshots-nav-button:first-child {
        order: 2;
        justify-self: start;
    }

    .screenshots-stage .screenshots-nav-button:last-child {
        order: 3;
        justify-self: end;
        margin-top: -48px;
    }

    .screenshots-viewport {
        order: 1;
    }

    .screenshots-footer {
        margin-top: 18px;
    }
}

:root.light-mode .screenshots-shell {
    background:
        radial-gradient(circle at top left, rgba(103, 80, 164, 0.12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(98, 91, 113, 0.12), transparent 28%),
        rgba(255, 255, 255, 0.72);
}

:root.light-mode .screenshots-chip,
:root.light-mode .screenshots-indicator.is-active,
:root.light-mode .screenshots-preview-card.is-active {
    background: rgba(103, 80, 164, 0.12);
    border-color: rgba(103, 80, 164, 0.2);
    color: #4f378b;
}

:root.light-mode .screenshots-counter,
:root.light-mode .screenshots-nav-button,
:root.light-mode .screenshots-indicator,
:root.light-mode .screenshots-preview-card {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 0, 0, 0.06);
    color: #49454f;
}

    @keyframes spin {
      to { transform: rotate(360deg); }
    }


    /* ============================================
   PARTICLE BACKGROUND (Ultra discreto - M3)
   ============================================ */

.particle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* Más difuminado */
}

/* Partícula 1 */
.particle-1 {
    width: 60vw;
    height: 60vw;
    top: -30vh;
    right: -20vw;
    background: var(--md-sys-color-primary, #d0bcff);
    opacity: 0.08; /* Muy sutil */
}

/* Partícula 2 */
.particle-2 {
    width: 50vw;
    height: 50vw;
    bottom: -25vh;
    left: -20vw;
    background: var(--md-sys-color-secondary, #ccc2dc);
    opacity: 0.06;
}

/* Partícula 3 */
.particle-3 {
    width: 40vw;
    height: 40vw;
    top: 50%;
    right: -15vw;
    background: var(--md-sys-color-tertiary, #ffd9e3);
    opacity: 0.05;
}

/* Partícula 4 (muy tenue, solo para rellenar) */
.particle-4 {
    width: 70vw;
    height: 70vw;
    bottom: -40vh;
    left: -30vw;
    background: var(--md-sys-color-primary-container, #d0bcff);
    opacity: 0.04;
}

/* Partícula 5 (casi invisible) */
.particle-5 {
    width: 30vw;
    height: 30vw;
    top: 20%;
    left: -5vw;
    background: var(--md-sys-color-secondary-container, #4a4359);
    opacity: 0.06;
}

/* Responsive */
@media (max-width: 768px) {
    .particle {
        filter: blur(60px);
    }
    
    .particle-1, .particle-2, .particle-3, .particle-4, .particle-5 {
        width: 80vw;
        height: 80vw;
    }
    
    .particle-1, .particle-2, .particle-3, .particle-4, .particle-5 {
        opacity: 0.05; /* Aún más sutiles en móvil */
    }
}

/* ══════════════════════════════════════════════
   MATERIAL 3 EXPRESSIVE — MotionScheme + Shapes
   ══════════════════════════════════════════════ */

/* Animatable custom properties (allows springs to be interpolated) */
@property --spring-x {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}
@property --spring-y {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}
@property --spring-scale {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}
@property --shape-radius {
  syntax: '<percentage>';
  inherits: true;
  initial-value: 18%;
}

/* M3E MotionScheme — easings as CSS custom properties so any transition can use them */
:root {
  --m3e-easing-standard:        cubic-bezier(0.2, 0, 0, 1);
  --m3e-easing-standard-emph:   cubic-bezier(0.3, 0, 0, 1);
  --m3e-easing-emphasized:      cubic-bezier(0.2, 0, 0, 1);
  --m3e-easing-emphasized-decel:cubic-bezier(0.05, 0.7, 0.1, 1);
  --m3e-easing-emphasized-accel:cubic-bezier(0.3, 0, 0.8, 0.15);

  /* Spring easings (overshoot for organic feel) */
  --m3e-spring-fast:            cubic-bezier(0.34, 1.56, 0.64, 1);
  --m3e-spring-normal:          cubic-bezier(0.34, 1.3, 0.64, 1);
  --m3e-spring-slow:            cubic-bezier(0.34, 1.1, 0.64, 1);
  --m3e-spring-emph:            cubic-bezier(0.2, 0, 0, 1);

  /* M3E duration tokens */
  --m3e-dur-short1:  50ms;
  --m3e-dur-short2:  100ms;
  --m3e-dur-short3:  150ms;
  --m3e-dur-short4:  200ms;
  --m3e-dur-med1:    250ms;
  --m3e-dur-med2:    300ms;
  --m3e-dur-med3:    350ms;
  --m3e-dur-long1:   400ms;
  --m3e-dur-long2:   450ms;
  --m3e-dur-long3:   500ms;
  --m3e-dur-long4:   550ms;
  --m3e-dur-extra1:  600ms;
  --m3e-dur-extra2:  700ms;
  --m3e-dur-extra3:  800ms;
  --m3e-dur-extra4:  900ms;

  /* M3E Shape corner-family tokens */
  --m3e-shape-none:    0;
  --m3e-shape-xs:      4px;
  --m3e-shape-sm:      8px;
  --m3e-shape-md:      12px;
  --m3e-shape-lg:      16px;
  --m3e-shape-xl:      28px;
  --m3e-shape-2xl:     32px;
  --m3e-shape-3xl:     48px;
  --m3e-shape-pill:    999px;
  --m3e-shape-squircle: 32% / 18%;

  /* M3E Elevation tokens (tonal, no shadow) */
  --m3e-elev-0: 0 0 0 0 rgba(0,0,0,0);
  --m3e-elev-1: 0 1px 2px 0 rgba(0,0,0,0.30), 0 1px 3px 1px rgba(0,0,0,0.15);
  --m3e-elev-2: 0 1px 2px 0 rgba(0,0,0,0.30), 0 2px 6px 2px rgba(0,0,0,0.15);
  --m3e-elev-3: 0 1px 3px 0 rgba(0,0,0,0.30), 0 4px 8px 3px rgba(0,0,0,0.15);
  --m3e-elev-4: 0 2px 3px 0 rgba(0,0,0,0.30), 0 6px 10px 4px rgba(0,0,0,0.15);
  --m3e-elev-5: 0 4px 4px 0 rgba(0,0,0,0.30), 0 8px 12px 6px rgba(0,0,0,0.15);
}

/* ─── M3E Shapes (utility class system) ─── */
.shape-squircle { border-radius: var(--m3e-shape-squircle); }
.shape-pill     { border-radius: var(--m3e-shape-pill); }
.shape-coin     { border-radius: 50%; }
.shape-gem      { border-radius: 20% 80% 80% 20% / 20% 20% 80% 80%; }
.shape-fan      { border-radius: 0% 100% 0% 100% / 50% 50% 50% 50%; }
.shape-clover4  { border-radius: 50% 50% 0% 50% / 50% 50% 0% 50%; }
.shape-pebble   { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
.shape-xs       { border-radius: var(--m3e-shape-xs); }
.shape-sm       { border-radius: var(--m3e-shape-sm); }
.shape-md       { border-radius: var(--m3e-shape-md); }
.shape-lg       { border-radius: var(--m3e-shape-lg); }
.shape-xl       { border-radius: var(--m3e-shape-xl); }
.shape-2xl      { border-radius: var(--m3e-shape-2xl); }
.shape-3xl      { border-radius: var(--m3e-shape-3xl); }

/* ══════════════════════════════════════════════
   M3E FLOATING TOOLBAR (horizontal)
   ══════════════════════════════════════════════ */

.m3e-floating-toolbar {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  padding: 6px;
  background: color-mix(in srgb, var(--md-sys-color-surface-container, #2b292d) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant, #49454f) 50%, transparent);
  border-radius: var(--m3e-shape-2xl);
  box-shadow: var(--m3e-elev-2);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: box-shadow var(--m3e-dur-med2) var(--m3e-easing-standard),
              transform  var(--m3e-dur-med2) var(--m3e-spring-normal),
              background-color var(--m3e-dur-short4) var(--m3e-easing-standard);
}

.m3e-floating-toolbar:hover {
  box-shadow: var(--m3e-elev-3);
}

.m3e-floating-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font: 500 16px/20px "Roboto Flex", system-ui, sans-serif;
  letter-spacing: 0.1px;
  color: var(--md-sys-color-on-surface, #e5e1e7);
  background: transparent;
  border: 0;
  border-radius: calc(var(--m3e-shape-2xl) - 8px);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--m3e-dur-short4) var(--m3e-easing-standard),
              color var(--m3e-dur-short4) var(--m3e-easing-standard),
              transform var(--m3e-dur-short2) var(--m3e-spring-fast);
}

.m3e-floating-toolbar__btn > .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.m3e-floating-toolbar__btn:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface, #e5e1e7) 8%, transparent);
}

.m3e-floating-toolbar__btn:active {
  transform: scale(0.97);
}

.m3e-floating-toolbar__btn--primary {
  background: var(--md-sys-color-primary, #d0bcff);
  color: var(--md-sys-color-on-primary, #37265e);
}

.m3e-floating-toolbar__btn--primary:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary, #d0bcff) 88%, white 12%);
}

.m3e-floating-toolbar__divider {
  width: 1px;
  margin: 8px 4px;
  background: color-mix(in srgb, var(--md-sys-color-outline-variant, #49454f) 60%, transparent);
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .m3e-floating-toolbar { flex-wrap: wrap; }
  .m3e-floating-toolbar__btn { padding: 12px 18px; font-size: 15px; }
  .m3e-floating-toolbar__divider { display: none; }
}

/* ══════════════════════════════════════════════
   M3E SPLIT BUTTON
   ══════════════════════════════════════════════ */

.m3e-split-button {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--m3e-shape-pill);
  background: var(--md-sys-color-primary, #d0bcff);
  color: var(--md-sys-color-on-primary, #37265e);
  box-shadow: var(--m3e-elev-1);
  transition: box-shadow var(--m3e-dur-short4) var(--m3e-easing-standard),
              transform var(--m3e-dur-short2) var(--m3e-spring-fast);
  isolation: isolate;
}

.m3e-split-button:hover { box-shadow: var(--m3e-elev-2); }
.m3e-split-button:active { transform: scale(0.98); }

.m3e-split-button__primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  min-width: 168px;
  font: 500 14px/20px "Roboto Flex", system-ui, sans-serif;
  color: inherit;
  text-decoration: none;
  border-radius: var(--m3e-shape-pill) 0 0 var(--m3e-shape-pill);
  white-space: nowrap;
  transition: background-color var(--m3e-dur-short4) var(--m3e-easing-standard);
}

.m3e-split-button__primary:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-primary, #37265e) 8%, transparent);
}

.m3e-split-button__primary > .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.m3e-split-button__divider {
  width: 1px;
  margin: 8px 0;
  background: color-mix(in srgb, var(--md-sys-color-on-primary, #37265e) 22%, transparent);
  flex-shrink: 0;
}

.m3e-split-button__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  padding: 0;
  background: transparent;
  color: inherit;
  border: 0;
  border-radius: 0 var(--m3e-shape-pill) var(--m3e-shape-pill) 0;
  cursor: pointer;
  transition: background-color var(--m3e-dur-short4) var(--m3e-easing-standard);
}

.m3e-split-button__toggle:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-primary, #37265e) 8%, transparent);
}

.m3e-split-button__toggle > .material-symbols-outlined {
  font-size: 22px;
  transition: transform var(--m3e-dur-med1) var(--m3e-spring-normal);
}

.m3e-split-button[data-open="true"] .m3e-split-button__toggle > .material-symbols-outlined {
  transform: rotate(180deg);
}

.m3e-split-button__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--md-sys-color-surface-container, #2b292d);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant, #49454f) 50%, transparent);
  border-radius: var(--m3e-shape-lg);
  box-shadow: var(--m3e-elev-3);
  z-index: 60;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transform-origin: top right;
  transition: opacity var(--m3e-dur-short4) var(--m3e-easing-standard),
              transform var(--m3e-dur-med1) var(--m3e-spring-normal);
}

.m3e-split-button__menu[data-open="true"] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.m3e-split-button__menu[hidden] { display: none; }

.m3e-split-button__menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  font: 500 14px/20px "Roboto Flex", system-ui, sans-serif;
  color: var(--md-sys-color-on-surface, #e5e1e7);
  background: transparent;
  border: 0;
  border-radius: calc(var(--m3e-shape-lg) - 8px);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background-color var(--m3e-dur-short2) var(--m3e-easing-standard);
}

.m3e-split-button__menu-item:hover {
  background: color-mix(in srgb, var(--md-sys-color-on-surface, #e5e1e7) 8%, transparent);
}

.m3e-split-button__menu-item > .material-symbols-outlined {
  font-size: 20px;
  color: var(--md-sys-color-on-surface-variant, #cac4d0);
}

.m3e-split-button__menu-sep {
  height: 1px;
  margin: 6px 8px;
  background: color-mix(in srgb, var(--md-sys-color-outline-variant, #49454f) 60%, transparent);
  list-style: none;
}

/* ══════════════════════════════════════════════
   M3E BUTTON GROUP (segmented control)
   ══════════════════════════════════════════════ */

.m3e-button-group {
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--m3e-shape-pill);
  background: color-mix(in srgb, var(--md-sys-color-surface-container, #2b292d) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant, #49454f) 50%, transparent);
  overflow: hidden;
  padding: 3px;
  gap: 0;
}

.m3e-button-group__item {
  position: relative;
  padding: 8px 18px;
  font: 500 13px/18px "Roboto Flex", system-ui, sans-serif;
  color: var(--md-sys-color-on-surface-variant, #cac4d0);
  background: transparent;
  border: 0;
  border-radius: var(--m3e-shape-pill);
  cursor: pointer;
  transition: background-color var(--m3e-dur-short4) var(--m3e-easing-standard),
              color var(--m3e-dur-short4) var(--m3e-easing-standard),
              transform var(--m3e-dur-short2) var(--m3e-spring-fast);
  white-space: nowrap;
}

.m3e-button-group__item:hover:not(:disabled):not(.is-selected) {
  background: color-mix(in srgb, var(--md-sys-color-on-surface, #e5e1e7) 6%, transparent);
  color: var(--md-sys-color-on-surface, #e5e1e7);
}

.m3e-button-group__item:active:not(:disabled) {
  transform: scale(0.96);
}

.m3e-button-group__item.is-selected {
  background: var(--md-sys-color-secondary-container, #4a4359);
  color: var(--md-sys-color-on-secondary-container, #e8def8);
  box-shadow: var(--m3e-elev-1);
}

.m3e-button-group__item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════
   M3E FAB MENU
   ══════════════════════════════════════════════ */

.m3e-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 16px;
  pointer-events: none;
}

.m3e-fab__primary {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--m3e-shape-lg);
  background: var(--md-sys-color-primary-container, #d0bcff);
  color: var(--md-sys-color-on-primary-container, #21005d);
  border: 0;
  cursor: pointer;
  box-shadow: var(--m3e-elev-3);
  transition: box-shadow var(--m3e-dur-short4) var(--m3e-easing-standard),
              transform var(--m3e-dur-med1) var(--m3e-spring-normal),
              background-color var(--m3e-dur-short4) var(--m3e-easing-standard);
}

.m3e-fab__primary:hover { box-shadow: var(--m3e-elev-4); }
.m3e-fab__primary:active { transform: scale(0.94); }

.m3e-fab__primary > .material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  transition: transform var(--m3e-dur-med1) var(--m3e-spring-normal),
              opacity var(--m3e-dur-short2) var(--m3e-easing-standard);
}

.m3e-fab__icon-close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}

.m3e-fab__icon-add {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.m3e-fab[data-open="true"] .m3e-fab__icon-add {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
}

.m3e-fab[data-open="true"] .m3e-fab__icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.m3e-fab__items {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  margin-bottom: 4px;
}

.m3e-fab__item {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  opacity: 0;
  transform: translateY(12px) scale(0.85);
  transition: opacity var(--m3e-dur-short4) var(--m3e-easing-standard),
              transform var(--m3e-dur-med1) var(--m3e-spring-normal);
}

.m3e-fab[data-open="true"] .m3e-fab__item {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger reveal on open */
.m3e-fab[data-open="true"] .m3e-fab__item:nth-child(1) { transition-delay: 30ms; }
.m3e-fab[data-open="true"] .m3e-fab__item:nth-child(2) { transition-delay: 60ms; }
.m3e-fab[data-open="true"] .m3e-fab__item:nth-child(3) { transition-delay: 90ms; }

.m3e-fab__item-label {
  background: var(--md-sys-color-inverse-surface, #313034);
  color: var(--md-sys-color-inverse-on-surface, #f5eff7);
  font: 500 13px/18px "Roboto Flex", system-ui, sans-serif;
  padding: 6px 12px;
  border-radius: var(--m3e-shape-sm);
  box-shadow: var(--m3e-elev-1);
  white-space: nowrap;
}

.m3e-fab__item-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--m3e-shape-md);
  background: var(--md-sys-color-primary-container, #d0bcff);
  color: var(--md-sys-color-on-primary-container, #21005d);
  box-shadow: var(--m3e-elev-2);
  transition: transform var(--m3e-dur-short2) var(--m3e-spring-fast),
              background-color var(--m3e-dur-short2) var(--m3e-easing-standard);
}

.m3e-fab__item:hover .m3e-fab__item-icon {
  background: color-mix(in srgb, var(--md-sys-color-primary-container, #d0bcff) 80%, white 20%);
  transform: scale(1.06);
}

.m3e-fab__item-icon > .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

@media (max-width: 640px) {
  .m3e-fab { right: 16px; bottom: 16px; }
}

/* ══════════════════════════════════════════════
   M3E LOADING INDICATOR
   ══════════════════════════════════════════════ */

.m3e-loading-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 56px;
  height: 56px;
}

.m3e-loading-indicator__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--md-sys-color-primary, #d0bcff);
  color: var(--md-sys-color-primary, #d0bcff);
  animation: m3e-loading-pulse 1.1s var(--m3e-spring-fast) infinite;
}

.m3e-loading-indicator__dot:nth-child(2) { animation-delay: 0.12s; }
.m3e-loading-indicator__dot:nth-child(3) { animation-delay: 0.24s; }

@keyframes m3e-loading-pulse {
  0%, 100% { transform: scale(0.55); opacity: 0.35; }
  50%      { transform: scale(1);    opacity: 1; }
}

/* Old circular-progress is still defined for any code that referenced it directly,
   but the M3E component above is the preferred indicator. */
.circular-progress { display: none; }

/* ══════════════════════════════════════════════
   DIALOG @starting-style (entrada con spring)
   ══════════════════════════════════════════════ */

.glass-dialog {
  /* allow-discrete lets us animate the dialog's open state */
  transition: opacity var(--m3e-dur-med2) var(--m3e-easing-standard),
              transform var(--m3e-dur-med3) var(--m3e-spring-normal),
              overlay var(--m3e-dur-med2) var(--m3e-easing-standard) allow-discrete,
              display var(--m3e-dur-med2) var(--m3e-easing-standard) allow-discrete;
}

.glass-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.glass-dialog {
  opacity: 0;
  transform: translateY(24px) scale(0.96);
}

@starting-style {
  .glass-dialog[open] {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
}

.glass-dialog::backdrop {
  transition: background-color var(--m3e-dur-med2) var(--m3e-easing-standard),
              backdrop-filter var(--m3e-dur-med2) var(--m3e-easing-standard);
}

@starting-style {
  .glass-dialog[open]::backdrop {
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
}

/* ══════════════════════════════════════════════
   VIEW TRANSITIONS (cross-page morph)
   ══════════════════════════════════════════════ */

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: m3e-fade-out var(--m3e-dur-short4) var(--m3e-easing-standard) forwards;
}

::view-transition-new(root) {
  animation: m3e-fade-in var(--m3e-dur-med3) var(--m3e-spring-normal) forwards;
}

@keyframes m3e-fade-out {
  to { opacity: 0; transform: translateY(-8px); }
}

@keyframes m3e-fade-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* ══════════════════════════════════════════════
   REFINED prefers-reduced-motion
   (respeta springs pero baja amplitud, en lugar de matar todo)
   ══════════════════════════════════════════════ */

@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;
  }
  /* M3E: still keep a tiny spring for expressiveness, but no overshoot */
  :root {
    --m3e-spring-fast:   cubic-bezier(0.2, 0, 0, 1);
    --m3e-spring-normal: cubic-bezier(0.2, 0, 0, 1);
    --m3e-spring-slow:   cubic-bezier(0.2, 0, 0, 1);
  }
}

/* ══════════════════════════════════════════════
   LIGHT MODE OVERRIDES — M3E components
   ══════════════════════════════════════════════ */

:root.light-mode .m3e-floating-toolbar {
  background: color-mix(in srgb, var(--lm-sc, #F3EDF7) 92%, transparent);
  border-color: color-mix(in srgb, var(--lm-ov, #CAC4D0) 50%, transparent);
}

:root.light-mode .m3e-floating-toolbar__btn { color: var(--lm-on-surface, #1D1B20); }
:root.light-mode .m3e-floating-toolbar__btn:hover {
  background: color-mix(in srgb, var(--lm-on-surface, #1D1B20) 8%, transparent);
}
:root.light-mode .m3e-floating-toolbar__btn--primary {
  background: var(--lm-primary, #6750A4);
  color: var(--lm-on-primary, #FFFFFF);
}
:root.light-mode .m3e-floating-toolbar__btn--primary:hover {
  background: color-mix(in srgb, var(--lm-primary, #6750A4) 88%, black 12%);
}

:root.light-mode .m3e-split-button {
  background: var(--lm-primary, #6750A4);
  color: var(--lm-on-primary, #FFFFFF);
}
:root.light-mode .m3e-split-button__divider {
  background: color-mix(in srgb, var(--lm-on-primary, #FFFFFF) 22%, transparent);
}
:root.light-mode .m3e-split-button__menu {
  background: var(--lm-sc, #F3EDF7);
  border-color: color-mix(in srgb, var(--lm-ov, #CAC4D0) 50%, transparent);
}
:root.light-mode .m3e-split-button__menu-item { color: var(--lm-on-surface, #1D1B20); }
:root.light-mode .m3e-split-button__menu-item:hover {
  background: color-mix(in srgb, var(--lm-on-surface, #1D1B20) 8%, transparent);
}
:root.light-mode .m3e-split-button__menu-item > .material-symbols-outlined {
  color: var(--lm-on-sv, #49454F);
}

:root.light-mode .m3e-button-group {
  background: color-mix(in srgb, var(--lm-sc, #F3EDF7) 92%, transparent);
  border-color: color-mix(in srgb, var(--lm-ov, #CAC4D0) 50%, transparent);
}
:root.light-mode .m3e-button-group__item { color: var(--lm-on-sv, #49454F); }
:root.light-mode .m3e-button-group__item:hover:not(:disabled):not(.is-selected) {
  background: color-mix(in srgb, var(--lm-on-surface, #1D1B20) 6%, transparent);
  color: var(--lm-on-surface, #1D1B20);
}
:root.light-mode .m3e-button-group__item.is-selected {
  background: var(--lm-sec-c, #E8DEF8);
  color: var(--lm-on-sec-c, #1D192B);
}

:root.light-mode .m3e-fab__primary {
  background: var(--lm-pc, #EADDFF);
  color: var(--lm-on-pc, #21005D);
}
:root.light-mode .m3e-fab__item-label {
  background: var(--lm-on-surface, #1D1B20);
  color: var(--lm-surface, #FEF7FF);
}
:root.light-mode .m3e-fab__item-icon {
  background: var(--lm-pc, #EADDFF);
  color: var(--lm-on-pc, #21005D);
}
:root.light-mode .m3e-fab__item:hover .m3e-fab__item-icon {
  background: color-mix(in srgb, var(--lm-pc, #EADDFF) 80%, black 20%);
}

:root.light-mode .m3e-loading-indicator__dot {
  background: var(--lm-primary, #6750A4);
}
