/**
 * Antara Web OS shell — menú inicio, widgets y taskbar tray.
 * Capa premium dark + glass; convive con themes existentes vía .os-shell.
 */

:root {
    /* Alto útil del viewport (vh/dvh); en móvil os-shell.js lo fija al abrir el menú (no encoge con el teclado). */
    --os-app-visual-height: 100vh;
    /* Separación del menú inicio respecto a los bordes de la zona útil (topbar / taskbar / viewport) */
    --os-menu-edge-pad: 5px;
    /* Solo arriba: desfase respecto a la topbar (max-height del menú descuenta top + bottom por separado) */
    --os-menu-top-pad: 5px;
    --os-shell-bg: rgba(12, 18, 32, 0.72);
    --os-shell-bg-solid: #0c1220;
    --os-shell-border: rgba(120, 200, 255, 0.12);
    --os-shell-glow: rgba(56, 189, 248, 0.35);
    --os-shell-accent: #38bdf8;
    --os-shell-accent2: #a78bfa;
    --os-shell-ok: #34d399;
    --os-shell-warn: #fbbf24;
    --os-shell-crit: #f87171;
    --os-shell-text: #e8f4ff;
    --os-shell-muted: rgba(232, 244, 255, 0.55);
    --os-shell-radius: 1.25rem;
    --os-shell-radius-lg: 1.5rem;
    /* Columnas del menú inicio (sidebar / widgets); la cabecera desktop usa el ancho de widgets */
    --os-shell-sidebar-w: 220px;
    --os-shell-widgets-w: 318px;
    --os-shell-widgets-min-w: 260px;
    --os-shell-widgets-max-w: 360px;
    /* Reserva bajo la cabecera flotante del menú (cerrar / notas); compacta, ~alto del contenido */
    --os-shell-head-h: 30px;
    /* Cabecera móvil: tabs widget + cerrar */
    --os-head-tab-h: 24px;
    --os-head-tab-pad-x: 7px;
    --os-head-tab-font: 9.5px;
    --os-head-tab-icon: 10px;
    --os-head-close-size: 22px;
    /* Mosaico del menú inicio: celdas cuadradas (sin estirar a barras en panel ancho) */
    --os-start-app-tile-min: 80px;
    --os-start-app-tile-max: 96px;
}

@supports (height: 100dvh) {
    :root {
        --os-app-visual-height: 100dvh;
    }
}

/* ——— Menú inicio (overlay) ——— */
body:not(.mobile-mode) .windows-menu.os-shell,
body.mobile-pc-mode .windows-menu.os-shell {
    /* Debe seguir fixed (main.css); no usar relative aquí o el top/bottom dejan de anclar al viewport */
    position: fixed !important;
    flex-direction: column;
    flex-wrap: nowrap;
    box-sizing: border-box;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    min-height: 0;
    overflow: hidden;
    border-radius: var(--os-shell-radius-lg);
    background: linear-gradient(145deg, rgba(20, 30, 52, 0.88), rgba(8, 12, 24, 0.92));
    border: 1px solid var(--os-shell-border);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 60px rgba(56, 189, 248, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--os-shell-text);
    contain: layout style;
}

/* Escritorio: anclaje top+bottom (sin max-height); el alto fino lo ajusta os-shell.js con body.zoom */
body:not(.mobile-mode) .windows-menu.os-shell {
    height: auto !important;
    max-height: none !important;
}

/* Arriba: --os-menu-top-pad; laterales y bottom: --os-menu-edge-pad (solo escritorio; móvil PC → regla dedicada abajo). */
body:not(.mobile-mode).taskbar-bottom .windows-menu.os-shell {
    top: calc(var(--topbar-height, 60px) + var(--os-menu-top-pad)) !important;
    bottom: calc(var(--taskbar-height, 56px) + var(--os-menu-edge-pad)) !important;
    left: var(--os-menu-edge-pad) !important;
    right: var(--os-menu-edge-pad) !important;
    transform: none !important;
}

/*
 * Teléfono con «modo escritorio» (mobile-pc-mode): el ancho CSS a menudo supera 768px (landscape,
 * zoom bajo, tablets). Las reglas solo dentro de @media (max-width: 768px) no aplican y el menú
 * hereda el layout de escritorio (max-height + huecos). Forzar overlay a todo el viewport.
 */
body.mobile-pc-mode .windows-menu.os-shell {
    top: 0 !important;
    bottom: 0 !important;
    left: env(safe-area-inset-left, 0px) !important;
    right: env(safe-area-inset-right, 0px) !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: calc(5px + env(safe-area-inset-top, 0px)) 0 0 0 !important;
    max-height: none !important;
    min-height: 0;
    transform: none !important;
    z-index: 260 !important;
    pointer-events: auto !important;
    height: auto !important;
    box-sizing: border-box;
}

body.mobile-pc-mode .windows-menu-backdrop {
    position: fixed !important;
    inset: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: var(--os-app-visual-height, 100vh) !important;
    z-index: 250 !important;
    -webkit-tap-highlight-color: transparent;
}

/*
 * Móvil vertical (portrait): el menú debe ocupar todo el alto útil (topbar → taskbar).
 * body:not(.mobile-mode).taskbar-bottom… (escritorio) tiene mayor especificidad que
 * body.mobile-pc-mode… y dejaba un hueco arriba del panel en celular.
 */
@media (orientation: portrait) {
    body.mobile-pc-mode.taskbar-bottom .windows-menu.os-shell,
    body.mobile-pc-mode.taskbar-top .windows-menu.os-shell,
    body.mobile-pc-mode.taskbar-left .windows-menu.os-shell,
    body.mobile-pc-mode.taskbar-right .windows-menu.os-shell {
        top: 0 !important;
        bottom: 0 !important;
        left: env(safe-area-inset-left, 0px) !important;
        right: env(safe-area-inset-right, 0px) !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: env(safe-area-inset-top, 0px) 0 0 0 !important;
        max-height: none !important;
        height: auto !important;
    }
}

body:not(.mobile-mode).taskbar-top .windows-menu.os-shell {
    top: calc(var(--taskbar-height, 56px) + var(--topbar-height, 60px) + var(--os-menu-top-pad)) !important;
    bottom: var(--os-menu-edge-pad) !important;
    left: var(--os-menu-edge-pad) !important;
    right: var(--os-menu-edge-pad) !important;
    transform: none !important;
}

body:not(.mobile-mode).taskbar-left .windows-menu.os-shell {
    top: calc(var(--topbar-height, 60px) + var(--os-menu-top-pad)) !important;
    bottom: calc(var(--taskbar-height, 56px) + var(--os-menu-edge-pad)) !important;
    left: calc(var(--taskbar-height, 56px) + var(--os-menu-edge-pad)) !important;
    right: var(--os-menu-edge-pad) !important;
    transform: none !important;
}

body:not(.mobile-mode).taskbar-right .windows-menu.os-shell {
    top: calc(var(--topbar-height, 60px) + var(--os-menu-top-pad)) !important;
    bottom: calc(var(--taskbar-height, 56px) + var(--os-menu-edge-pad)) !important;
    left: var(--os-menu-edge-pad) !important;
    right: calc(var(--taskbar-height, 56px) + var(--os-menu-edge-pad)) !important;
    transform: none !important;
}

/* Escritorio / tablet ancha: cabecera alineada con el ancho de la columna de widgets */
@media (min-width: 769px) {
    body:not(.mobile-mode) .windows-menu.os-shell {
        /* fixed: el panel queda anclado arriba/abajo (top/bottom en reglas taskbar-*). position:relative rompía ese anclaje. */
        position: fixed !important;
        /* 5px al borde superior del panel; la cabecera flota solo sobre widgets (ver padding-top en .os-shell__widgets). */
        padding-top: var(--os-menu-top-pad, 5px);
    }

    body:not(.mobile-mode) .windows-menu.os-shell .os-shell__head {
        position: absolute;
        top: var(--os-menu-top-pad, 5px);
        right: 0;
        left: auto;
        width: var(--os-shell-widgets-w);
        min-width: var(--os-shell-widgets-min-w);
        max-width: var(--os-shell-widgets-max-w);
        box-sizing: border-box;
        flex: none;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-height: var(--os-shell-head-h);
        padding: 4px 10px;
    }

    /* La cabecera (cerrar / notas) solo cubre la columna de widgets: no desplazar sidebar ni apps. */
    body:not(.mobile-mode) .windows-menu.os-shell .os-shell__body {
        margin-top: 0;
    }

    body:not(.mobile-mode) .windows-menu.os-shell .os-shell__widgets {
        padding-top: calc(var(--os-shell-head-h) + 8px);
    }

    body:not(.mobile-mode) .windows-menu.os-shell .os-shell__sidebar {
        padding-top: 5px;
    }

    body:not(.mobile-mode) .windows-menu.os-shell .os-shell__main {
        padding-top: 5px;
    }

    .windows-menu.os-shell .windows-menu-categories ul {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }
}

.os-shell__head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    padding: 3px 10px;
    min-height: 0;
    line-height: 1;
    box-sizing: border-box;
}

/* ——— Barra de widgets móvil (segmented control, sin solapamiento) ——— */
.os-shell__head-mobile-start {
    display: none;
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-right: auto;
    min-width: 0;
    max-width: 100%;
    padding: 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(0, 0, 0, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.os-mobile-widget-chip {
    display: none;
    flex: 1 1 0;
    flex-direction: row;
    align-items: stretch;
    position: relative;
    min-width: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.os-mobile-widget-chip:active {
    cursor: grabbing;
}

.os-mobile-widget-chip:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 22%;
    bottom: 22%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    pointer-events: none;
    z-index: 2;
}

.os-mobile-widget-chip .os-notes-mobile-open,
.os-mobile-widget-chip .os-system-mobile-open,
.os-mobile-widget-chip .os-weather-mobile-open,
.os-mobile-widget-chip .os-spotify-mobile-open,
.os-mobile-widget-chip .os-media-mobile-open {
    touch-action: manipulation;
    cursor: pointer;
    width: 100%;
    min-width: 0;
    position: relative;
    border: none;
    border-radius: 0;
    box-shadow: none;
    white-space: nowrap;
    transition:
        background 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.os-mobile-widget-chip:first-child .os-notes-mobile-open,
.os-mobile-widget-chip:first-child .os-system-mobile-open,
.os-mobile-widget-chip:first-child .os-weather-mobile-open,
.os-mobile-widget-chip:first-child .os-spotify-mobile-open,
.os-mobile-widget-chip:first-child .os-media-mobile-open {
    border-top-left-radius: 7px;
    border-bottom-left-radius: 7px;
}

.os-mobile-widget-chip:last-child .os-notes-mobile-open,
.os-mobile-widget-chip:last-child .os-system-mobile-open,
.os-mobile-widget-chip:last-child .os-weather-mobile-open,
.os-mobile-widget-chip:last-child .os-spotify-mobile-open,
.os-mobile-widget-chip:last-child .os-media-mobile-open {
    border-top-right-radius: 7px;
    border-bottom-right-radius: 7px;
}

.os-mobile-widget-chip[data-os-widget-key="spotify"] .os-spotify-mobile-open {
    color: #86efac;
}

.os-mobile-widget-chip[data-os-widget-key="weather"] .os-weather-mobile-open {
    color: #6ee7b7;
}

.os-mobile-widget-chip[data-os-widget-key="system"] .os-system-mobile-open {
    color: #c4b5fd;
}

.os-mobile-widget-chip[data-os-widget-key="notes"] .os-notes-mobile-open {
    color: #7dd3fc;
}

.os-mobile-widget-chip[data-os-widget-key="media"] .os-media-mobile-open {
    color: #fcd34d;
}

.os-mobile-widget-chip[data-os-widget-key="spotify"]:hover .os-spotify-mobile-open,
.os-mobile-widget-chip[data-os-widget-key="spotify"]:focus-within .os-spotify-mobile-open {
    background: rgba(29, 185, 84, 0.22);
    color: #bbf7d0;
}

.os-mobile-widget-chip[data-os-widget-key="weather"]:hover .os-weather-mobile-open,
.os-mobile-widget-chip[data-os-widget-key="weather"]:focus-within .os-weather-mobile-open {
    background: rgba(52, 211, 153, 0.2);
    color: #a7f3d0;
}

.os-mobile-widget-chip[data-os-widget-key="system"]:hover .os-system-mobile-open,
.os-mobile-widget-chip[data-os-widget-key="system"]:focus-within .os-system-mobile-open {
    background: rgba(167, 139, 250, 0.2);
    color: #ddd6fe;
}

.os-mobile-widget-chip[data-os-widget-key="notes"]:hover .os-notes-mobile-open,
.os-mobile-widget-chip[data-os-widget-key="notes"]:focus-within .os-notes-mobile-open {
    background: rgba(56, 189, 248, 0.2);
    color: #bae6fd;
}

.os-mobile-widget-chip[data-os-widget-key="media"]:hover .os-media-mobile-open,
.os-mobile-widget-chip[data-os-widget-key="media"]:focus-within .os-media-mobile-open {
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
}

.os-mobile-widget-chip:hover .os-notes-mobile-open,
.os-mobile-widget-chip:hover .os-system-mobile-open,
.os-mobile-widget-chip:hover .os-weather-mobile-open,
.os-mobile-widget-chip:hover .os-spotify-mobile-open,
.os-mobile-widget-chip:hover .os-media-mobile-open,
.os-mobile-widget-chip:focus-within .os-notes-mobile-open,
.os-mobile-widget-chip:focus-within .os-system-mobile-open,
.os-mobile-widget-chip:focus-within .os-weather-mobile-open,
.os-mobile-widget-chip:focus-within .os-spotify-mobile-open,
.os-mobile-widget-chip:focus-within .os-media-mobile-open {
    transform: none;
    filter: none;
}

.os-notes-mobile-open,
.os-system-mobile-open,
.os-weather-mobile-open,
.os-spotify-mobile-open,
.os-media-mobile-open {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    font-size: var(--os-head-tab-font);
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 var(--os-head-tab-pad-x);
    touch-action: manipulation;
}

.os-notes-mobile-open:hover,
.os-system-mobile-open:hover,
.os-weather-mobile-open:hover,
.os-spotify-mobile-open:hover,
.os-media-mobile-open:hover {
    filter: none;
}

.os-notes-mobile-open__label,
.os-system-mobile-open__label,
.os-weather-mobile-open__label,
.os-spotify-mobile-open__label,
.os-media-mobile-open__label {
    font-size: var(--os-head-tab-font);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-shell__body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0;
    overflow: hidden;
    align-items: stretch;
}

.os-shell__sidebar {
    width: var(--os-shell-sidebar-w);
    min-width: 180px;
    min-height: 0;
    align-self: stretch;
    border-right: 1px solid var(--os-shell-border);
    padding: 5px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 0 var(--os-shell-radius) 0 0;
    overflow: hidden;
}

.os-shell__main {
    flex: 1 1 52%;
    min-width: 0;
    min-height: 0;
    align-self: stretch;
    padding: 5px 14px 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.os-shell__widgets {
    width: var(--os-shell-widgets-w);
    min-width: var(--os-shell-widgets-min-w);
    max-width: var(--os-shell-widgets-max-w);
    min-height: 0;
    align-self: stretch;
    border-left: 1px solid var(--os-shell-border);
    padding: 6px 8px 8px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.os-shell__widgets::-webkit-scrollbar {
    width: 3px;
}

.os-shell__widgets::-webkit-scrollbar-track {
    background: transparent;
}

.os-shell__widgets::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    transition: background 0.15s ease;
}

.os-shell__widgets::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Cada card ocupa su altura real; el panel suma el scroll (sin comprimir ni solapar). */
#osWidgetPanel > .os-widget {
    flex: 0 0 auto;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

/* Misma altura (cabecera del menú): cerrar y accesos móviles (notas / sistema / clima / spotify) */
.windows-menu.os-shell .windows-menu-close {
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: var(--os-head-close-size);
    height: var(--os-head-close-size);
    width: var(--os-head-close-size);
    min-width: var(--os-head-close-size);
    max-width: var(--os-head-close-size);
    padding: 0;
    line-height: 1;
    gap: 0;
}

.windows-menu.os-shell .os-notes-mobile-open,
.windows-menu.os-shell .os-system-mobile-open,
.windows-menu.os-shell .os-weather-mobile-open,
.windows-menu.os-shell .os-spotify-mobile-open,
.windows-menu.os-shell .os-media-mobile-open {
    box-sizing: border-box;
    align-items: center;
    min-height: var(--os-head-tab-h);
    height: var(--os-head-tab-h);
    line-height: 1;
    gap: 3px;
}

.windows-menu.os-shell .windows-menu-close {
    position: static;
    margin: 0;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    display: inline-flex;
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.22) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(232, 244, 255, 0.88);
    font-size: 0.72rem;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease;
}

.windows-menu.os-shell .windows-menu-close:hover {
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.28) 0%, rgba(127, 29, 29, 0.35) 100%);
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
    box-shadow:
        0 2px 10px rgba(248, 113, 113, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.windows-menu.os-shell .windows-menu-close i {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    line-height: 1;
    transform: none;
    font-size: 0.72rem;
    pointer-events: none;
}

.windows-menu.os-shell .os-notes-mobile-open i,
.windows-menu.os-shell .os-system-mobile-open i,
.windows-menu.os-shell .os-weather-mobile-open i,
.windows-menu.os-shell .os-spotify-mobile-open i,
.windows-menu.os-shell .os-media-mobile-open i {
    display: block;
    flex: 0 0 auto;
    line-height: 1;
    font-size: var(--os-head-tab-icon);
}

.windows-menu.os-shell .windows-menu-user {
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 6px 0 12px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--os-shell-border);
}

.windows-menu.os-shell .windows-menu-user__avatar-wrap {
    flex-shrink: 0;
    width: 95%;
    max-width: 95%;
    margin-inline: auto;
    aspect-ratio: 1 / 1;
    position: relative;
    container-type: inline-size;
}

.windows-menu.os-shell .windows-menu-user__avatar {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.18);
    display: block;
    box-sizing: border-box;
}

/* display:block/grid en .avatar anula el [hidden] del UA — un solo círculo visible */
.windows-menu.os-shell .windows-menu-user__avatar[hidden],
.windows-menu.os-shell .windows-menu-user__avatar--placeholder[hidden] {
    display: none !important;
}

.windows-menu.os-shell .windows-menu-user__avatar--placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    box-sizing: border-box;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(167, 139, 250, 0.22));
    font-size: clamp(1.5rem, 42cqw, 4rem);
    font-weight: 700;
    color: var(--os-shell-text);
    line-height: 1;
}

.windows-menu.os-shell .windows-menu-user__name {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--os-shell-text);
    line-height: 1.35;
    word-break: break-word;
    max-width: 100%;
}

.windows-menu.os-shell .windows-menu-user__org {
    margin: 0.15rem 0 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--os-shell-text-dim, rgba(200, 230, 255, 0.65));
    line-height: 1.35;
    word-break: break-word;
    max-width: 100%;
}

.windows-menu.os-shell .windows-menu-user__avatar-wrap {
    overflow: hidden;
}
.windows-menu.os-shell .windows-menu-user__avatar-wrap [data-antara-profile-video] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    box-sizing: border-box;
}
.windows-menu.os-shell .windows-menu-user__avatar-wrap [data-antara-profile-video][hidden] {
    display: none !important;
}

.profile-self-dialog {
    max-width: min(420px, 94vw);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    background: linear-gradient(165deg, #111827, #0c1424);
    color: #e2e8f0;
    padding: 0;
}
.profile-self-dialog::backdrop { background: rgba(4, 8, 14, 0.75); }
.profile-self-dialog__inner { padding: 1rem 1.1rem 1.1rem; }
.profile-self-dialog__inner h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.profile-self-dialog__lead { margin: 0 0 0.75rem; font-size: 0.78rem; color: #94a3b8; }
.profile-self-dialog__actions { display: flex; gap: 0.5rem; margin-bottom: 0.65rem; }
.profile-self-dialog__foot { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: flex-end; margin-top: 0.75rem; }
.profile-self-dialog .feedback { min-height: 1.2rem; font-size: 0.75rem; }
.profile-self-dialog .feedback.is-ok { color: #6ee7b7; }

.windows-menu.os-shell .windows-search-wrap {
    margin-bottom: 4px;
}

.windows-menu.os-shell .windows-menu-categories input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--os-shell-border);
    border-radius: 10px;
    padding: 6px 26px 6px 10px;
    font-size: 12px;
    line-height: 1.25;
    color: var(--os-shell-text);
    box-shadow: none;
}

.windows-menu.os-shell .windows-search-clear {
    color: var(--os-shell-muted);
}

.windows-menu.os-shell .windows-menu-categories li {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 10px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: var(--os-shell-text);
}

.windows-menu.os-shell .windows-menu-categories li .os-cat-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 12px;
    flex-shrink: 0;
    background: rgba(56, 189, 248, 0.12);
    color: var(--os-shell-accent);
}

.windows-menu.os-shell .windows-menu-categories li .os-cat-label {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.windows-menu.os-shell .windows-menu-categories li:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--os-shell-border);
}

.windows-menu.os-shell .windows-menu-categories li.active {
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.2), rgba(167, 139, 250, 0.15));
    border-color: rgba(56, 189, 248, 0.35);
    color: #fff;
    font-weight: 700;
}

.windows-menu.os-shell .windows-menu-apps {
    display: grid;
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 4px 2px 8px;
    border: none;
    grid-template-columns: repeat(auto-fill, minmax(var(--os-start-app-tile-min), var(--os-start-app-tile-max)));
    justify-content: start;
    gap: 10px;
    align-content: start;
}

.windows-menu.os-shell .windows-menu-apps .app-item {
    border-radius: 14px;
    padding: 8px 6px 6px;
    min-height: 0;
    aspect-ratio: 1;
    max-width: var(--os-start-app-tile-max);
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
    width: 44px;
    height: 44px;
    max-width: 44px;
    max-height: 44px;
}

.windows-menu.os-shell .windows-menu-apps .app-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 24px var(--os-shell-glow);
    border-color: rgba(56, 189, 248, 0.35);
}

.windows-menu.os-shell .windows-menu-apps .app-item p {
    color: var(--os-shell-text) !important;
    font-size: 11px;
    font-weight: 600;
    min-height: 0;
    padding-top: 4px;
    line-height: 1.2;
}

@media (min-width: 769px) {
    .windows-menu.os-shell .windows-menu-apps {
        padding-top: 2px;
    }
}

.windows-menu.os-shell .windows-menu-footer {
    border-top: 1px solid var(--os-shell-border);
    background: rgba(0, 0, 0, 0.25);
    flex: 0 0 auto;
}

.windows-menu.os-shell .windows-menu-footer__title {
    color: var(--os-shell-muted);
}

.windows-menu.os-shell .windows-menu-footer__link {
    color: var(--os-shell-accent);
}

.windows-menu.os-shell .windows-menu-footer__btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--os-shell-border);
    color: var(--os-shell-text);
}

/* ——— Widgets ——— */
.os-widget {
    border-radius: var(--os-shell-radius);
    padding: 4px 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--os-shell-border);
    flex-shrink: 0;
}

.os-widget__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--os-shell-muted);
    margin: 0 0 4px;
    line-height: 1.2;
}

.os-widget__title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 9px;
    line-height: 1;
    background: rgba(56, 189, 248, 0.12);
    color: var(--os-shell-accent);
}

.os-widget__title-text {
    min-width: 0;
}

/* Estado del sistema / Notas rápidas: cabecera con minimizar (solo layout tipo PC; ver body:not(.mobile-mode)) */
.os-widget-system__head,
.os-widget-notes__head,
.os-widget-weather__head,
.os-widget-spotify__head,
.os-widget-media__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    margin-bottom: 3px;
    min-height: 0;
}

body:not(.mobile-mode) .os-widget-system__head,
body:not(.mobile-mode) .os-widget-notes__head,
body:not(.mobile-mode) .os-widget-weather__head,
body:not(.mobile-mode) .os-widget-spotify__head,
body:not(.mobile-mode) .os-widget-media__head {
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

body:not(.mobile-mode) .os-widget-system__head:active,
body:not(.mobile-mode) .os-widget-notes__head:active,
body:not(.mobile-mode) .os-widget-weather__head:active,
body:not(.mobile-mode) .os-widget-spotify__head:active,
body:not(.mobile-mode) .os-widget-media__head:active {
    cursor: grabbing;
}

body:not(.mobile-mode) button.os-widget-system-toggle,
body:not(.mobile-mode) button.os-widget-notes-toggle,
body:not(.mobile-mode) button.os-widget-weather-toggle,
body:not(.mobile-mode) button.os-widget-spotify-toggle,
body:not(.mobile-mode) button.os-widget-media-toggle {
    cursor: pointer;
    touch-action: manipulation;
}

.os-widget-dragging-lift {
    opacity: 0.92;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    border-color: rgba(56, 189, 248, 0.55) !important;
    will-change: left, top;
}

.os-widget-drop-placeholder {
    flex: 0 0 auto;
    box-sizing: border-box;
    border-radius: 6px;
    border: 2px dashed rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.1);
    pointer-events: none;
}

.os-widget-reorder--active .os-widget-drop-placeholder {
    animation: os-widget-placeholder-pulse 0.9s ease-in-out infinite alternate;
}

@keyframes os-widget-placeholder-pulse {
    from { background: rgba(56, 189, 248, 0.08); }
    to { background: rgba(56, 189, 248, 0.18); }
}

#osWidgetPanel.os-widget-panel--drag-over {
    outline: 1px dashed rgba(56, 189, 248, 0.35);
    outline-offset: -2px;
}

#osWidgetPanel .os-widget-drop-placeholder {
    width: 100%;
    min-height: 48px;
}

.os-widget-system__head .os-widget__title,
.os-widget-notes__head .os-widget__title,
.os-widget-weather__head .os-widget__title,
.os-widget-spotify__head .os-widget__title,
.os-widget-media__head .os-widget__title {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.2;
    font-size: 11px;
}

/* Minimizar sección: icono pequeño, sin chip 36px de main.css */
button.os-widget-system-toggle,
button.os-widget-notes-toggle,
button.os-widget-weather-toggle,
button.os-widget-spotify-toggle,
button.os-widget-media-toggle {
    display: none;
    box-sizing: border-box;
    flex: 0 0 auto;
    align-self: center;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 0 !important;
    max-width: 16px !important;
    max-height: 16px !important;
    margin: 0;
    padding: 0 !important;
    gap: 0 !important;
    border: 1px solid var(--os-shell-border);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--os-shell-muted);
    font-size: 0 !important;
    line-height: 0;
    box-shadow: none !important;
    cursor: pointer;
    place-items: center;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    appearance: none;
    filter: none;
}

button.os-widget-system-toggle i,
button.os-widget-notes-toggle i,
button.os-widget-weather-toggle i,
button.os-widget-spotify-toggle i,
button.os-widget-media-toggle i {
    font-size: 7px;
    line-height: 1;
    pointer-events: none;
    transition: transform 0.2s ease;
}

button.os-widget-system-toggle:hover,
button.os-widget-notes-toggle:hover,
button.os-widget-weather-toggle:hover,
button.os-widget-spotify-toggle:hover,
button.os-widget-media-toggle:hover {
    background: rgba(56, 189, 248, 0.12) !important;
    color: var(--os-shell-accent);
    filter: none !important;
}

button.os-widget-system-toggle:active,
button.os-widget-notes-toggle:active,
button.os-widget-weather-toggle:active,
button.os-widget-spotify-toggle:active,
button.os-widget-media-toggle:active {
    filter: none !important;
}

body:not(.mobile-mode) #osWidgetSystem button.os-widget-system-toggle,
body:not(.mobile-mode) #osWidgetNotes button.os-widget-notes-toggle,
body:not(.mobile-mode) #osWidgetWeather button.os-widget-weather-toggle,
body:not(.mobile-mode) #osWidgetSpotify button.os-widget-spotify-toggle,
body:not(.mobile-mode) #osWidgetMedia button.os-widget-media-toggle {
    display: grid;
}

#osWidgetSystem.os-widget--system-collapsed .os-widget-system__body {
    display: none;
}

#osWidgetSystem.os-widget--system-collapsed button.os-widget-system-toggle i {
    transform: rotate(180deg);
}

#osWidgetNotes.os-widget--notes-collapsed .os-widget-notes__body {
    display: none;
}

#osWidgetNotes.os-widget--notes-collapsed button.os-widget-notes-toggle i {
    transform: rotate(180deg);
}

#osWidgetWeather.os-widget--weather-collapsed .os-widget-weather__body {
    display: none;
}

#osWidgetWeather.os-widget--weather-collapsed button.os-widget-weather-toggle i {
    transform: rotate(180deg);
}

#osWidgetSpotify.os-widget--spotify-collapsed .os-widget-spotify__body {
    display: none;
}

#osWidgetSpotify.os-widget--spotify-collapsed button.os-widget-spotify-toggle i {
    transform: rotate(180deg);
}

#osWidgetMedia.os-widget--media-collapsed .os-widget-media__body {
    display: none;
}

#osWidgetMedia.os-widget--media-collapsed button.os-widget-media-toggle i {
    transform: rotate(180deg);
}

/* Plegado: sin min-height extra ni margen bajo la cabecera (evita franja vacía) */
#osWidgetNotes.os-widget--notes-collapsed,
#osWidgetSystem.os-widget--system-collapsed,
#osWidgetWeather.os-widget--weather-collapsed,
#osWidgetSpotify.os-widget--spotify-collapsed,
#osWidgetMedia.os-widget--media-collapsed {
    min-height: 0 !important;
    padding-top: 3px;
    padding-bottom: 3px;
}

#osWidgetNotes.os-widget--notes-collapsed .os-widget-notes__head,
#osWidgetSystem.os-widget--system-collapsed .os-widget-system__head,
#osWidgetWeather.os-widget--weather-collapsed .os-widget-weather__head,
#osWidgetSpotify.os-widget--spotify-collapsed .os-widget-spotify__head,
#osWidgetMedia.os-widget--media-collapsed .os-widget-media__head {
    margin-bottom: 0;
    gap: 3px;
}

/* Columna widgets: texto legible (≥11px), sin chip 36px de main.css */
#osWidgetPanel {
    font-size: 11px;
}

#osWidgetPanel button.os-widget-system-toggle,
#osWidgetPanel button.os-widget-notes-toggle,
#osWidgetPanel button.os-widget-weather-toggle,
#osWidgetPanel button.os-widget-spotify-toggle,
#osWidgetPanel button.os-widget-media-toggle,
#osWidgetPanel button.os-notes-add,
#osWidgetPanel button.os-notes-nav,
#osWidgetPanel button.os-media-slider-trash {
    min-height: 0 !important;
    padding: 0 !important;
}

#osWidgetPanel .os-notes-counter,
#osWidgetPanel .os-media-slider-counter,
#osWidgetPanel .os-meter__row,
#osWidgetPanel .os-meter__hint,
#osWidgetPanel .os-env-pill,
#osWidgetPanel .os-env-meta,
#osWidgetPanel .os-note-title,
#osWidgetPanel .os-notes-add {
    font-size: 11px;
}

#osWidgetPanel .os-note-title {
    min-height: 20px;
    height: auto;
    line-height: 1.25;
    padding: 2px 6px;
}

.os-notes-widget .os-widget-notes__body {
    padding-top: 0;
}

.os-weather-widget .os-widget-weather__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
    text-align: center;
}

.os-weather-widget .os-widget-weather__body .os-weather-panel {
    width: 100%;
}

.os-weather-map-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0 0 8px;
    text-align: center;
}

.os-weather-map-head:has(.os-weather-map[hidden]):has(.os-weather-map-link[hidden]) {
    display: none;
}

/* Mismo criterio que .windows-menu-user__avatar-wrap (95% del ancho, círculo grande) */
.os-weather-map {
    width: 95%;
    max-width: 95%;
    aspect-ratio: 1 / 1;
    margin-inline: auto;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.18);
    background: rgba(0, 0, 0, 0.22);
    line-height: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.os-weather-map[hidden] {
    display: none !important;
}

.os-weather-map__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

.os-weather-map-link {
    display: inline-block;
    margin: 6px 0 0;
    font-size: 10px;
    font-weight: 600;
    color: rgba(56, 189, 248, 0.85);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.os-weather-map-link[hidden] {
    display: none !important;
}

.os-weather-map-link:hover {
    color: var(--os-shell-accent);
    text-decoration: underline;
}

.os-weather-mobile-modal .os-weather-map {
    width: min(95%, 320px);
    max-width: min(95%, 320px);
}

.os-weather-main {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.os-weather-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(52, 211, 153, 0.12);
    color: #6ee7b7;
    font-size: 16px;
    flex-shrink: 0;
}

.os-weather-temp {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: var(--os-shell-text);
    letter-spacing: -0.02em;
}

.os-weather-place {
    margin: 0 0 6px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--os-shell-muted);
}

.os-weather-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    margin: 0;
}

.os-weather-meta__row {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.os-weather-meta dt {
    margin: 0;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(148, 163, 184, 0.85);
}

.os-weather-meta dd {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--os-shell-text);
}

.os-weather-updated {
    width: 100%;
    margin: 6px 0 0;
    font-size: 9px;
    line-height: 1.25;
    color: rgba(148, 163, 184, 0.72);
    letter-spacing: 0.01em;
}

.os-weather-updated--stale {
    color: rgba(251, 191, 36, 0.78);
}

.os-weather-refresh {
    display: inline-flex !important;
    align-self: center;
    width: fit-content;
    max-width: 100%;
    margin: 4px 0 0;
    padding: 1px 10px;
    min-height: 0;
    line-height: 1.35;
    border: 1px solid var(--os-shell-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--os-shell-muted);
    font-size: 9px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
    box-sizing: border-box;
}

.os-weather-refresh:hover {
    background: rgba(52, 211, 153, 0.12);
    color: #a7f3d0;
    border-color: rgba(52, 211, 153, 0.35);
}

#osWidgetPanel .os-weather-place,
#osWidgetPanel .os-weather-meta dd {
    font-size: 11px;
}

#osWidgetPanel button.os-weather-refresh,
.os-weather-mobile-modal button.os-weather-refresh {
    min-height: 0 !important;
    height: auto;
    font-size: 9px;
    padding: 1px 9px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.os-weather-mobile-modal .modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.os-weather-mobile-modal .os-weather-panel {
    width: 100%;
}

.os-notes-search-wrap {
    position: relative;
    margin: 0 0 3px;
}

.os-notes-search-icon {
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--os-shell-muted);
    opacity: 0.75;
    pointer-events: none;
}

.os-notes-search {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 3px;
    padding-left: 22px;
    border: 1px solid var(--os-shell-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    color: var(--os-shell-text);
    font-size: 11px;
    font-family: inherit;
    line-height: 1.25;
}

.os-notes-search::placeholder {
    color: rgba(148, 163, 184, 0.65);
}

.os-notes-search:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.os-notes-counter {
    margin: 0 0 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--os-shell-muted);
    letter-spacing: 0.02em;
    line-height: 1.2;
    min-height: 0;
}

.os-notes-mobile-modal .os-notes-counter,
.os-media-mobile-modal .os-media-slider-counter {
    margin: 0 0 10px;
}

.os-meter {
    margin-bottom: 4px;
}

.os-meter:last-child {
    margin-bottom: 0;
}

.os-meter__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 2px 6px;
    font-size: 11px;
    color: var(--os-shell-muted);
    margin-bottom: 2px;
}

.os-meter__bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.os-meter__fill {
    height: 100%;
    border-radius: 999px;
    width: 0%;
    transition: width 0.45s ease, background-color 0.3s ease;
    background: var(--os-shell-ok);
}

.os-meter__fill--warn {
    background: var(--os-shell-warn);
}

.os-meter__fill--crit {
    background: var(--os-shell-crit);
}

.os-meter__hint {
    font-size: 11px;
    opacity: 0.65;
    margin-top: 1px;
}

/* Estado del sistema: anillos concéntricos (mayor % fuera, menor % dentro) */
.os-meter-rings {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 2px 0 4px;
    width: 100%;
}

.os-meter-rings__svg {
    display: block;
    width: 100%;
    max-width: 156px;
    height: auto;
    margin: 0 auto;
}

.os-meter-rings__center {
    font-size: 15px;
    font-weight: 700;
    fill: var(--os-shell-text);
    pointer-events: none;
}

.os-meter-rings__center-sub {
    font-size: 7px;
    font-weight: 600;
    fill: var(--os-shell-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
}

.os-meter-rings__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.os-meter-rings__legend-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    font-size: 10px;
    line-height: 1.25;
    color: var(--os-shell-muted);
}

.os-meter-rings__swatch {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.os-meter-rings__legend-label {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--os-shell-text);
    font-weight: 600;
}

.os-meter-rings__legend-val {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--os-shell-text);
    font-variant-numeric: tabular-nums;
}

.os-meter-rings__legend-sev {
    flex: 0 0 auto;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 999px;
    line-height: 1.2;
}

.os-meter-rings__legend-sev--ok {
    color: var(--os-shell-ok);
    background: rgba(52, 211, 153, 0.12);
}

.os-meter-rings__legend-sev--warn {
    color: var(--os-shell-warn);
    background: rgba(251, 191, 36, 0.14);
}

.os-meter-rings__legend-sev--crit {
    color: var(--os-shell-crit);
    background: rgba(248, 113, 113, 0.14);
}

.os-meter-rings__scale {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 8px;
    width: 100%;
    font-size: 8px;
    line-height: 1.2;
    color: rgba(148, 163, 184, 0.85);
    letter-spacing: 0.02em;
}

.os-meter-rings__scale-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.os-meter-rings__scale-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.os-meter-rings__scale-dot--ok {
    background: var(--os-shell-ok);
}

.os-meter-rings__scale-dot--warn {
    background: var(--os-shell-warn);
}

.os-meter-rings__scale-dot--crit {
    background: var(--os-shell-crit);
}

.os-meter-rings__scale-sep {
    opacity: 0.45;
    user-select: none;
}

#osWidgetPanel .os-meter-rings__legend-label,
#osWidgetPanel .os-meter-rings__legend-val,
.os-system-mobile-modal .os-meter-rings__legend-label,
.os-system-mobile-modal .os-meter-rings__legend-val {
    font-size: 11px;
}

.os-env-pill {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--os-shell-accent);
    margin-bottom: 4px;
    max-width: 100%;
}

.os-env-meta {
    font-size: 11px;
    color: var(--os-shell-muted);
    line-height: 1.35;
    word-break: break-word;
    margin-bottom: 3px;
}

/* Notas carrusel */
.os-notes-widget {
    min-height: 0;
    padding: 4px 6px;
}

/* Galería de medios */
.os-media-widget {
    min-height: 0;
    padding: 4px 6px;
}

.os-notes-carousel-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    width: 100%;
}

.os-notes-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 72px;
    padding: 2px 2px 4px;
    -webkit-overflow-scrolling: touch;
}

.os-notes-nav-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

.os-notes-carousel::-webkit-scrollbar {
    height: 6px;
}

.os-notes-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.os-notes-nav {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 0 !important;
    max-width: 18px !important;
    max-height: 18px !important;
    padding: 0 !important;
    gap: 0 !important;
    border: 1px solid var(--os-shell-border);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--os-shell-text);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none !important;
    filter: none;
}

.os-notes-nav i {
    font-size: 9px;
    opacity: 0.9;
}

.os-notes-nav:hover {
    background: rgba(56, 189, 248, 0.15);
    filter: none !important;
}

.os-media-slider-trash:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
}

.os-media-slider-trash:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Galería de medios (widget slider) */
.os-media-widget .os-widget-media__body {
    padding-top: 0;
}

.os-media-slider-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.os-media-slider-viewport {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--os-shell-border);
    min-height: 188px;
    touch-action: pan-y;
}

.os-media-slider-image-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
}

.os-media-slider-zoom-img {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    transform: translate(-50%, -50%) scale(1);
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

.os-media-slider-zoom-img.os-media-slider-img--zoomed {
    max-width: none;
    max-height: none;
}

.os-media-slider-open-preview {
    cursor: zoom-in;
}

.os-media-slider-main {
    position: relative;
    width: 100%;
    height: 188px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
}

.os-media-slider-main img,
.os-media-slider-main video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.os-media-slider-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    color: rgba(148, 163, 184, 0.9);
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
}

.os-media-slider-empty i {
    font-size: 22px;
    opacity: 0.75;
}

.os-media-slider-thumbs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 2px 1px;
    scrollbar-width: thin;
}

.os-media-slider-thumb {
    flex: 0 0 52px;
    width: 52px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    padding: 0;
    cursor: pointer;
    touch-action: manipulation;
}

.os-media-slider-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.os-media-slider-thumb__video {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(15, 23, 42, 0.8);
}

.os-media-slider-thumb.is-active {
    border-color: rgba(56, 189, 248, 0.85);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.os-media-mobile-modal .os-media-slider-viewport,
.os-media-mobile-modal .os-media-slider-main {
    min-height: 280px;
    height: 280px;
}

.os-note-card {
    flex: 0 0 100%;
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    scroll-snap-align: start;
    border-radius: 10px;
    padding: 4px 6px 6px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--os-shell-border);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
}

.os-note-title {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 3px;
    padding: 2px 6px;
    min-height: 20px;
    height: auto;
    border: 1px solid var(--os-shell-border);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.25;
}

.os-note-footer {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 3px;
    width: 100%;
    min-width: 0;
    margin-top: 2px;
}

.os-note-title::placeholder {
    color: rgba(148, 163, 184, 0.55);
}

.os-note-title:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.35);
}

.os-note-title.os-notes-search-hit {
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.45);
    background: rgba(250, 204, 21, 0.12);
}

.os-note-card--filtered-out {
    display: none !important;
}

/* Mismo botón icono: color (fondo/texto) y papelera */
.os-note-delete {
    position: relative;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--os-shell-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--os-shell-text);
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 0;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.os-note-delete i {
    font-size: 9px;
    line-height: 1;
    margin: 0;
    padding: 0;
    pointer-events: none;
    opacity: 0.9;
}

.os-note-footer .os-note-delete:not(:last-child):hover {
    background: rgba(56, 189, 248, 0.15);
    color: var(--os-shell-accent);
}

.os-note-footer .os-note-theme-color:hover {
    filter: brightness(1.08);
}

.os-note-footer .os-note-theme-color:focus-visible {
    outline: 2px solid color-mix(in srgb, currentColor 45%, transparent);
    outline-offset: 1px;
}

.os-note-delete .os-note-color-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    opacity: 0;
    cursor: pointer;
    box-sizing: border-box;
}

.os-note-editor-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 56px;
}

.os-note-highlight {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 5px 7px;
    border: 1px dashed transparent;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 11px;
    font-family: inherit;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
    pointer-events: none;
    color: var(--os-shell-text);
}

.os-note-highlight mark {
    background: rgba(250, 204, 21, 0.55);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

.os-note-card.os-note-card--searching .os-note-ta[readonly] {
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    caret-color: transparent;
}

.os-note-footer .os-note-delete:last-child {
    margin-left: auto;
    color: rgba(248, 113, 113, 0.9);
}

.os-note-footer .os-note-delete:last-child:hover {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

.os-note-delete:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.35);
    outline-offset: 1px;
}

.os-note-footer .os-note-delete:last-child:focus-visible {
    outline-color: rgba(248, 113, 113, 0.5);
}

.os-note-card textarea.os-note-ta {
    display: block;
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 56px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    resize: vertical;
    background: rgba(0, 0, 0, 0.22);
    color: var(--os-shell-text);
    font-size: 11px;
    font-family: inherit;
    line-height: 1.35;
    padding: 5px 7px;
    box-sizing: border-box;
}

.os-note-card textarea.os-note-ta[readonly] {
    cursor: pointer;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.16);
}

.os-note-card textarea.os-note-ta--editing {
    cursor: text;
    border-style: solid;
}

.os-note-card textarea.os-note-ta::placeholder {
    color: rgba(148, 163, 184, 0.65);
}

.os-note-card textarea.os-note-ta:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.os-notes-add {
    box-sizing: border-box;
    margin: 0;
    padding: 1px 6px !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none;
    border-radius: 4px;
    border: 1px dashed var(--os-shell-border);
    background: transparent !important;
    color: var(--os-shell-accent);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    white-space: nowrap;
    text-align: center;
    gap: 0 !important;
    box-shadow: none !important;
    filter: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.os-notes-nav-row .os-notes-add {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
}

.os-notes-add:hover {
    background: rgba(56, 189, 248, 0.1) !important;
    filter: none !important;
}

@keyframes os-note-shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-7px); }
    30% { transform: translateX(7px); }
    45% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

.os-note-card.os-note-card--shake {
    animation: os-note-shake 0.45s ease-in-out;
}

/* Taskbar tray — mismo criterio que .taskbar .clock (main.css): --text-color del tema */
.taskbar-tray-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: 0;
    padding: 0 8px 0 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
    overflow: visible;
}

body:not(.mobile-mode) .taskbar > .taskbar-spotify-quick {
    flex-shrink: 0;
    align-self: center;
    margin-left: 8px;
    margin-right: 16px;
}

.taskbar-tray {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 0;
    margin-left: 0;
    border-left: none;
    font-size: 14px;
    color: var(--text-color);
    text-shadow: 0 1px 2px var(--theme-contrast-shadow);
}

.taskbar-tray__item {
    opacity: 1;
    cursor: default;
    display: grid;
    place-items: center;
    min-width: 28px;
    color: inherit;
}

.taskbar-tray__item i {
    color: inherit;
}

.taskbar-tray__item[hidden] {
    display: none !important;
}

.taskbar-tray__item--offline {
    opacity: 0.45;
}

.taskbar-tray__item--warn {
    color: #fbbf24;
}

.taskbar-tray__item--warn i {
    color: #fbbf24;
}

body:not(.mobile-mode) .taskbar .taskbar-tray-zone {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

body:not(.mobile-mode) .taskbar .taskbar-tray {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

body:not(.mobile-mode).taskbar-left .taskbar > .taskbar-spotify-quick,
body:not(.mobile-mode).taskbar-right .taskbar > .taskbar-spotify-quick {
    margin-left: 0;
    margin-top: 8px;
}

body:not(.mobile-mode).taskbar-left .taskbar .taskbar-tray-zone,
body:not(.mobile-mode).taskbar-right .taskbar .taskbar-tray-zone {
    flex-direction: column;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 8px 4px 0;
    gap: 10px;
    width: 100%;
    margin-left: 0;
    justify-content: center;
}

body:not(.mobile-mode).taskbar-left .taskbar .taskbar-tray,
body:not(.mobile-mode).taskbar-right .taskbar .taskbar-tray {
    flex-direction: column;
    border-left: none;
    border-top: none;
    padding: 0;
    gap: 8px;
    width: 100%;
    margin-left: 0;
    justify-content: center;
}

/* Quick Spotify — barra de tareas (izquierda del WiFi) */
body.mobile-mode .taskbar-spotify-quick {
    display: none !important;
}

body:not(.mobile-mode) .taskbar.taskbar--spotify-quick-compact,
body.mobile-pc-mode .taskbar.taskbar--spotify-quick-compact {
    overflow: visible;
}

/* Quick player: sin caja del widget Spotify (solo en barra / FAB) */
.taskbar-spotify-quick .os-spotify-card,
.spotify-quick-mobile-fab .os-spotify-card {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    gap: 0;
    border: none;
    background: none;
    box-shadow: none;
    border-radius: 0;
    flex-direction: row;
}

.taskbar-spotify-quick .os-spotify-card.is-playing,
.spotify-quick-mobile-fab .os-spotify-card.is-playing {
    border: none;
    box-shadow: none;
}

.taskbar-spotify-quick {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    height: 38px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: default;
    opacity: 1;
    box-sizing: border-box;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.taskbar-spotify-quick--extended {
    width: 268px;
    min-width: 268px;
    max-width: min(268px, 42vw);
    padding: 0 8px 0 4px;
    border-radius: 999px;
    background: rgba(14, 16, 24, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible;
    position: relative;
    z-index: 200;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

.taskbar-spotify-quick--compact {
    width: auto;
    min-width: 64px;
    max-width: 68px;
    height: 44px;
    padding: 0 2px;
    overflow: visible;
    position: relative;
    z-index: 120;
    background: transparent;
    border: none;
    box-shadow: none;
}

.taskbar-spotify-quick[hidden] {
    display: none !important;
}

.taskbar-spotify-quick__panel {
    width: 100%;
    height: 100%;
    min-width: 0;
}

.taskbar-spotify-quick--compact .spotify-quick-panel {
    width: auto;
    height: 44px;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

/* Quick play: portada (cuadrado / vinilo / 3D) como en el widget principal */
.spotify-quick-panel__art.os-spotify-hero {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    gap: 0;
    overflow: visible;
    cursor: pointer;
}

.spotify-quick-panel__art .os-spotify-hero__art-wrap {
    position: relative;
    margin: 0;
    cursor: pointer;
    transition: width 0.25s ease, height 0.25s ease, flex-basis 0.25s ease;
}

.spotify-quick-panel__art .os-spotify-hero__disc-stage,
.spotify-quick-panel__art .os-spotify-hero__disc-spin {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spotify-quick-panel__art .os-spotify-hero__art {
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}

.spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="square"] .os-spotify-hero__art {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    margin: 0;
}

.spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__art,
.spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__art {
    width: 91%;
    height: 91%;
    border-radius: 50%;
    margin: auto;
}

.spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__vinyl-groove,
.spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__vinyl-label,
.spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__vinyl-groove,
.spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__vinyl-label {
    display: block;
}

.spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__disc-stage {
    transform: perspective(520px) rotateX(44deg) rotateY(-26deg) rotateZ(14deg);
    transform-origin: 48% 52%;
}

.taskbar-spotify-quick .os-spotify-card.is-playing .spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__disc-spin,
.taskbar-spotify-quick .os-spotify-card.is-playing .spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__disc-spin,
.spotify-quick-mobile-fab .os-spotify-card.is-playing .spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__disc-spin,
.spotify-quick-mobile-fab .os-spotify-card.is-playing .spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__disc-spin {
    animation: os-spotify-vinyl-spin 4.8s linear infinite;
}

.taskbar-spotify-quick--compact .os-spotify-card.is-playing .spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="square"] .os-spotify-hero__art {
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.45);
}

.taskbar-spotify-quick--compact .spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="square"] .os-spotify-hero__art,
.spotify-quick-mobile-fab--compact .spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="square"] .os-spotify-hero__art {
    border-radius: 50%;
}

.taskbar-spotify-quick--compact .spotify-quick-panel__toggle--compact,
.spotify-quick-mobile-fab--compact .spotify-quick-panel__toggle--compact {
    flex: 0 0 20px;
    align-self: center;
}

/* Quick Spotify — panel compartido (taskbar + móvil) */
.spotify-quick-panel {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
}

.taskbar-spotify-quick--compact .spotify-quick-panel,
.spotify-quick-mobile-fab--compact .spotify-quick-panel,
.taskbar-spotify-quick--extended .spotify-quick-panel,
.spotify-quick-mobile-fab--extended .spotify-quick-panel,
.taskbar-spotify-quick--pop-open .spotify-quick-panel,
.spotify-quick-mobile-fab--pop-open .spotify-quick-panel {
    overflow: visible;
}

.taskbar-spotify-quick--extended .os-spotify-card,
.taskbar-spotify-quick--pop-open .os-spotify-card,
.spotify-quick-mobile-fab--extended .os-spotify-card,
.spotify-quick-mobile-fab--pop-open .os-spotify-card {
    overflow: visible;
}

.taskbar-spotify-quick--pop-open,
.spotify-quick-mobile-fab--pop-open {
    overflow: visible !important;
    z-index: 200;
}

.taskbar-spotify-quick--pop-open.taskbar-spotify-quick--compact,
.spotify-quick-mobile-fab--pop-open.spotify-quick-mobile-fab--compact {
    z-index: 5000;
}

.spotify-quick-panel__hover-pop--compact.is-visible {
    z-index: 5001;
}

.spotify-quick-panel__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.taskbar-spotify-quick--compact .spotify-quick-panel__body,
.spotify-quick-mobile-fab--compact .spotify-quick-panel__body {
    display: none;
}

/* Restaurar: solo en modo compacto */
.spotify-quick-panel__toggle--compact {
    display: none !important;
}

.taskbar-spotify-quick--compact .spotify-quick-panel__toggle--compact,
.spotify-quick-mobile-fab--compact .spotify-quick-panel__toggle--compact {
    display: inline-flex !important;
}

/* Compactar (barra): oculto en compacto; el del hover sigue visible */
.spotify-quick-panel__toggle--expand:not(.spotify-quick-panel__toggle--hover) {
    display: none !important;
}

.taskbar-spotify-quick--compact .spotify-quick-panel__toggle--expand:not(.spotify-quick-panel__toggle--hover),
.spotify-quick-mobile-fab--compact .spotify-quick-panel__toggle--expand:not(.spotify-quick-panel__toggle--hover) {
    display: none !important;
}

.taskbar-spotify-quick--extended .spotify-quick-panel__toggle--expand:not(.spotify-quick-panel__toggle--hover),
.spotify-quick-mobile-fab--extended .spotify-quick-panel__toggle--expand:not(.spotify-quick-panel__toggle--hover) {
    display: inline-flex !important;
}

.taskbar-spotify-quick--extended .spotify-quick-panel__toggle--compact,
.spotify-quick-mobile-fab--extended .spotify-quick-panel__toggle--compact {
    display: none !important;
}

/* Compacto: panel flotante al pasar el ratón */
.spotify-quick-panel__hover-pop {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    z-index: 250;
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.16s ease, visibility 0s linear 0.16s;
}

.spotify-quick-panel__hover-pop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.16s ease, visibility 0s;
    z-index: 12000;
}

.spotify-quick-panel__hover-pop--compact {
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.spotify-quick-panel__hover-pop--compact.is-visible {
    transition: opacity 0.28s ease, visibility 0s;
}

.spotify-quick-panel__hover-pop--browse {
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.spotify-quick-panel__hover-pop--browse.is-visible {
    transition: opacity 0.28s ease, visibility 0s;
}

/* Popup elevado al portal (body): posición por JS, sin recorte de la barra */
.spotify-quick-pop-portal {
    position: fixed;
    inset: 0;
    z-index: 600010;
    pointer-events: none;
}

.spotify-quick-pop-portal__backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none !important;
    background: transparent;
}

.spotify-quick-pop-portal__backdrop.is-visible {
    pointer-events: none !important;
    cursor: default;
}

.spotify-quick-pop-portal .spotify-quick-panel__hover-pop.is-visible {
    pointer-events: auto;
    z-index: 1;
}

.spotify-quick-panel__hover-pop--portal.is-visible {
    position: fixed !important;
    bottom: auto !important;
    right: auto !important;
    left: 0;
    top: 0;
    transform: none !important;
    margin: 0;
}

/* Puente invisible hacia el quick player (evita mouseleave al subir al popup) */
.spotify-quick-panel__hover-pop.is-visible::after {
    content: '';
    position: absolute;
    left: -12px;
    right: -12px;
    top: 100%;
    height: 22px;
}

.spotify-quick-panel__hover-pop-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 248px;
    max-width: min(280px, 92vw);
    padding: calc(2px + 10px) calc(2px + 10px) calc(2px + 8px);
    border-radius: 14px;
    border: 2px solid #1db954;
    background: transparent;
    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.38),
        0 0 14px rgba(29, 185, 84, 0.12);
    pointer-events: auto;
    isolation: isolate;
}

.spotify-quick-panel__hover-pop-inner::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 12px;
    background: rgba(14, 16, 24, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(1.25);
    -webkit-backdrop-filter: blur(20px) saturate(1.25);
    z-index: 0;
    pointer-events: none;
}

.spotify-quick-panel__hover-pop-inner > * {
    position: relative;
    z-index: 1;
}

.spotify-quick-panel__hover-pop .spotify-quick-panel__hover-art {
    display: block;
    flex: 0 0 104px;
    width: 104px !important;
    height: 104px !important;
    min-width: 104px;
    min-height: 104px;
    max-width: 104px;
    max-height: 104px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.spotify-quick-panel__hover-pop .spotify-quick-panel__hover-art.os-spotify-hero__art--empty {
    display: grid;
    place-items: center;
    color: rgba(29, 185, 84, 0.75);
    font-size: 34px;
    background-image: none !important;
}

.spotify-quick-panel__hover-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    text-align: center;
}

.spotify-quick-panel__hover-title {
    display: inline-block;
    width: auto;
    max-width: none;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--os-shell-text, #e8f4ff);
    line-height: 1.25;
    white-space: nowrap;
}

.spotify-quick-panel__hover-marquee {
    width: 100%;
}

.spotify-quick-panel__hover-marquee .spotify-quick-panel__hover-title {
    overflow: visible;
    text-overflow: unset;
}

.spotify-quick-panel__hover-artist {
    width: 100%;
    font-size: 0.74rem;
    color: var(--os-shell-muted, rgba(232, 244, 255, 0.55));
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotify-quick-panel__hover-playlist {
    width: 100%;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(29, 185, 84, 0.9);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.spotify-quick-panel__hover-playlist[hidden] {
    display: none !important;
}

.spotify-quick-panel__hover-tracks {
    width: 100%;
    max-height: min(200px, 38vh);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-right: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.spotify-quick-panel__hover-tracks::-webkit-scrollbar {
    width: 5px;
}

.spotify-quick-panel__hover-tracks::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 3px;
}

.spotify-quick-panel__hover-tracks-hint {
    margin: 0;
    padding: 10px 6px;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--os-shell-muted, rgba(232, 244, 255, 0.55));
}

.spotify-quick-panel__hover-tracks-hint--err {
    color: #fecaca;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover {
    padding: 2px 4px;
    gap: 6px;
    border-radius: 6px;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover .os-spotify-media-row__art {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover .os-spotify-media-row__title {
    font-size: 0.76rem;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover .os-spotify-media-row__sub {
    font-size: 0.66rem;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover .os-spotify-media-row__dur {
    font-size: 0.64rem;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover .os-spotify-media-row__now-playing {
    flex: 0 0 12px;
    width: 12px;
    min-width: 12px;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover .os-spotify-now-playing-bars {
    width: 12px;
    height: 12px;
    gap: 1px;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover .os-spotify-now-playing-bars__bar {
    width: 2px;
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover.is-current {
    background: rgba(29, 185, 84, 0.18);
}

.spotify-quick-panel__hover-tracks .os-spotify-media-row--hover.is-current .os-spotify-media-row__title {
    color: #1ed760;
}

/* Clic en modo extendido: solo portada, canción y lista (sin controles) */
.spotify-quick-panel__hover-pop--browse .spotify-quick-panel__hover-row {
    display: none !important;
}

.spotify-quick-panel__hover-pop--browse .spotify-quick-panel__hover-tracks {
    border-bottom: none;
}

.spotify-quick-panel__hover-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.spotify-quick-panel__hover-pop-inner::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: rgba(14, 16, 24, 0.32);
    border-right: 2px solid #1db954;
    border-bottom: 2px solid #1db954;
    backdrop-filter: blur(20px) saturate(1.25);
    -webkit-backdrop-filter: blur(20px) saturate(1.25);
    transform: rotate(45deg);
    z-index: 0;
}

.spotify-quick-panel__hover-ctrls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.spotify-quick-panel__hover-ctrls .os-spotify-ctrl.os-spotify-ctrl--quick {
    box-sizing: border-box;
    flex: 0 0 26px;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.spotify-quick-panel__hover-ctrls .os-spotify-ctrl--play.os-spotify-ctrl--quick {
    flex: 0 0 30px;
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    font-size: 11px;
}

.spotify-quick-panel__toggle--hover {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    padding: 0 !important;
    font-size: 10px;
    gap: 0;
}

.spotify-quick-panel__hover-pop-inner {
    position: relative;
}

.spotify-quick-panel__toggle {
    box-sizing: border-box;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    max-width: 20px;
    max-height: 20px;
    padding: 0 !important;
    margin: 0;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: none;
}

.spotify-quick-panel__toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.spotify-quick-panel__toggle i {
    pointer-events: none;
}

.spotify-quick-panel__meta {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 112px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.spotify-quick-panel__marquee {
    width: 100%;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10%, #000 90%, transparent 100%);
}

.spotify-quick-panel__marquee:not(.is-scroll) {
    display: flex;
    justify-content: center;
}

.spotify-quick-panel__marquee-inner {
    display: inline-flex;
    align-items: center;
    gap: 2.5rem;
    white-space: nowrap;
    will-change: transform;
}

.spotify-quick-panel__marquee.is-scroll .spotify-quick-panel__marquee-inner {
    animation: spotify-quick-marquee var(--spotify-quick-marquee-dur, 12s) linear infinite;
}

.spotify-quick-panel__marquee.is-scroll:hover .spotify-quick-panel__marquee-inner {
    animation-play-state: paused;
}

@keyframes spotify-quick-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-50% - 1.25rem)); }
}

.spotify-quick-panel__title {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-color);
    text-shadow: 0 1px 2px var(--theme-contrast-shadow);
    white-space: nowrap;
}

.taskbar-spotify-quick--extended .spotify-quick-panel__title,
.taskbar-spotify-quick--extended .spotify-quick-panel__title--clone,
.spotify-quick-mobile-fab--extended .spotify-quick-panel__title,
.spotify-quick-mobile-fab--extended .spotify-quick-panel__title--clone {
    color: #1db954;
    text-shadow: 0 1px 3px rgba(29, 185, 84, 0.28);
}

.spotify-quick-panel__title--clone {
    flex: 0 0 auto;
}

.spotify-quick-panel__ctrls {
    flex: 0 0 76px;
    width: 76px;
    min-width: 76px;
    max-width: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    flex-shrink: 0;
    overflow: visible;
}

.spotify-quick-panel__ctrls .os-spotify-ctrl.os-spotify-ctrl--quick {
    box-sizing: border-box;
    flex: 0 0 22px;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    padding: 0 !important;
    margin: 0;
    line-height: 1;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    transform: none;
    border-width: 1px;
}

.spotify-quick-panel__ctrls .os-spotify-ctrl--play.os-spotify-ctrl--quick {
    flex: 0 0 26px;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    font-size: 10px;
    box-shadow: 0 2px 8px rgba(29, 185, 84, 0.35);
}

.spotify-quick-panel__ctrls .os-spotify-ctrl--quick i {
    display: block;
    line-height: 1;
    pointer-events: none;
}

.spotify-quick-panel__ctrls .os-spotify-ctrl--quick:active {
    transform: scale(0.92);
}

/* Quick Spotify — móvil (encima de agregar aplicación) */
body:not(.mobile-mode) .spotify-quick-mobile-fab {
    display: none !important;
}

.spotify-quick-mobile-fab {
    position: fixed;
    right: 4px;
    bottom: calc(137px + 52px + 10px);
    z-index: 102;
    min-height: 48px;
    padding: 6px 10px 6px 8px;
    box-sizing: border-box;
    overflow: hidden;
    border: none;
    border-radius: 24px;
    cursor: default;
    background-color: var(--neumorphic-bg, rgba(30, 30, 40, 0.96));
    box-shadow:
        5px 5px 10px var(--neumorphic-shadow-dark, rgba(0, 0, 0, 0.25)),
        -5px -5px 10px var(--neumorphic-shadow-light, rgba(255, 255, 255, 0.06));
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.spotify-quick-mobile-fab[hidden] {
    display: none !important;
}

.spotify-quick-mobile-fab__panel .spotify-quick-panel__art {
    width: 36px;
    height: 36px;
}

.spotify-quick-mobile-fab__panel .spotify-quick-panel__art .os-spotify-hero__art-wrap {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
}

.spotify-quick-mobile-fab__panel .spotify-quick-panel__art .os-spotify-hero__art-wrap[data-art-view="crate"] {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.spotify-quick-mobile-fab--extended {
    width: 268px;
    min-width: 268px;
    max-width: min(268px, 92vw);
    border-radius: 999px;
    background: rgba(14, 16, 24, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible;
    z-index: 200;
}

/* Móvil: quick play siempre compacto (sin botones de cambiar tamaño en la barra flotante) */
.spotify-quick-mobile-fab .spotify-quick-panel__toggle--compact,
.spotify-quick-mobile-fab .spotify-quick-panel__toggle--expand:not(.spotify-quick-panel__toggle--hover) {
    display: none !important;
}

.spotify-quick-mobile-fab--compact {
    width: auto;
    min-width: 64px;
    max-width: 68px;
    height: 48px;
    min-height: 48px;
    padding: 0 4px;
    border-radius: 24px;
    overflow: visible;
    position: relative;
    z-index: 120;
    background: var(--neumorphic-bg, rgba(30, 30, 40, 0.96));
    display: flex;
    align-items: center;
    justify-content: center;
}

.spotify-quick-mobile-fab--compact .spotify-quick-panel {
    width: auto;
    height: 44px;
    justify-content: center;
    gap: 4px;
}

.spotify-quick-mobile-fab__panel .spotify-quick-panel__meta {
    max-width: 100px;
}

.spotify-quick-mobile-fab__panel .spotify-quick-panel__title {
    font-size: 11px;
}

@media (min-width: 768px) {
    .spotify-quick-mobile-fab {
        bottom: calc(145px + 60px + 12px);
    }
}

body:not(.mobile-mode).taskbar-left .taskbar-spotify-quick--extended,
body:not(.mobile-mode).taskbar-right .taskbar-spotify-quick--extended {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    height: auto;
    min-height: 128px;
    padding: 6px 4px;
}

body:not(.mobile-mode).taskbar-left .taskbar-spotify-quick--compact,
body:not(.mobile-mode).taskbar-right .taskbar-spotify-quick--compact {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    height: auto;
    min-height: 68px;
    max-height: none;
}

body:not(.mobile-mode).taskbar-left .taskbar .taskbar-spotify-quick .spotify-quick-panel,
body:not(.mobile-mode).taskbar-right .taskbar .taskbar-spotify-quick .spotify-quick-panel {
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

body:not(.mobile-mode).taskbar-left .taskbar .taskbar-spotify-quick .spotify-quick-panel__body,
body:not(.mobile-mode).taskbar-right .taskbar .taskbar-spotify-quick .spotify-quick-panel__body {
    flex-direction: column;
    width: 100%;
}

body:not(.mobile-mode).taskbar-left .taskbar .taskbar-spotify-quick .spotify-quick-panel__meta,
body:not(.mobile-mode).taskbar-right .taskbar .taskbar-spotify-quick .spotify-quick-panel__meta {
    max-width: 64px;
}

body:not(.mobile-mode).taskbar-left .taskbar .taskbar-spotify-quick .spotify-quick-panel__ctrls,
body:not(.mobile-mode).taskbar-right .taskbar .taskbar-spotify-quick .spotify-quick-panel__ctrls {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
    flex-direction: column;
    height: auto;
    gap: 3px;
}

/* ——— Pantalla estrecha / móvil: sistema arriba; categorías | apps; notas en modal ——— */
@media (max-width: 768px) {
    .windows-menu.os-shell .os-shell__head {
        position: relative !important;
        z-index: 4;
        flex-shrink: 0;
        /* Grid: misma fila, alineación vertical estable en cualquier DPI / fuente del sistema */
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 8px;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 4px 8px;
        box-sizing: border-box;
        line-height: 1;
        min-height: 0;
    }

    .windows-menu.os-shell .os-shell__head-mobile-start {
        margin: 0;
        justify-self: stretch;
        align-self: center;
        width: auto;
        max-width: 100%;
        min-width: 0;
    }

    .windows-menu.os-shell .windows-menu-close {
        margin: 0;
        justify-self: end;
        align-self: center;
        position: relative;
        z-index: 5;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

    .windows-menu.os-shell .windows-menu-close i {
        pointer-events: none;
    }

    .os-shell__head-mobile-start {
        display: flex;
    }

    .os-mobile-widget-chip {
        display: inline-flex;
    }

    .os-notes-mobile-open,
    .os-system-mobile-open,
    .os-weather-mobile-open,
    .os-spotify-mobile-open,
    .os-media-mobile-open {
        display: inline-flex;
    }

    .os-shell__head-mobile-start--drag-over {
        outline: 1px dashed rgba(56, 189, 248, 0.35);
        outline-offset: 2px;
        border-radius: 10px;
    }

    .os-shell__head-mobile-start .os-widget-drop-placeholder {
        min-height: var(--os-head-tab-h);
        border-radius: 7px;
    }

    @media (max-width: 360px) {
        .os-notes-mobile-open__label,
        .os-system-mobile-open__label,
        .os-weather-mobile-open__label,
        .os-spotify-mobile-open__label,
        .os-media-mobile-open__label {
            display: none;
        }

        .windows-menu.os-shell .os-notes-mobile-open,
        .windows-menu.os-shell .os-system-mobile-open,
        .windows-menu.os-shell .os-weather-mobile-open,
        .windows-menu.os-shell .os-spotify-mobile-open,
        .windows-menu.os-shell .os-media-mobile-open {
            padding: 0 5px;
        }
    }

    .os-notes-widget--desktop,
    .os-weather-widget--desktop,
    .os-spotify-widget--desktop,
    .os-media-widget--desktop {
        display: none !important;
    }

    body:not(.mobile-mode).taskbar-bottom .windows-menu.os-shell,
    body:not(.mobile-mode).taskbar-top .windows-menu.os-shell,
    body:not(.mobile-mode).taskbar-left .windows-menu.os-shell,
    body:not(.mobile-mode).taskbar-right .windows-menu.os-shell {
        width: auto !important;
        max-width: none !important;
        /* NO usar display:flex !important: anula el display:none en línea de JS y el menú no puede cerrarse en móvil */
        box-sizing: border-box !important;
        /* Pantalla completa; solo safe-area arriba (sin hueco de topbar). Sin padding lateral/inferior. */
        padding: env(safe-area-inset-top, 0px) 0 0 0 !important;
        margin: 0 !important;
        left: env(safe-area-inset-left, 0px) !important;
        right: env(safe-area-inset-right, 0px) !important;
        transform: none !important;
        top: 0 !important;
        bottom: 0 !important;
        z-index: 260 !important;
        pointer-events: auto !important;
        max-height: none !important;
        height: auto !important;
    }

    body:not(.mobile-mode) .windows-menu-backdrop {
        position: fixed !important;
        inset: 0 !important;
        width: auto !important;
        height: auto !important;
        min-height: var(--os-app-visual-height, 100vh) !important;
        z-index: 250 !important;
        -webkit-tap-highlight-color: transparent;
    }

    /* El cuerpo del menú ocupa el espacio entre cabecera y pie (scroll interno en columnas). */
    .windows-menu.os-shell > .os-shell__body {
        flex: 1 1 auto;
        min-height: 0;
    }

    .os-shell__body {
        display: grid;
        margin-top: 0 !important;
        /* Categorías y apps: mitad y mitad del ancho útil */
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        /* Sin franja de widgets: #osWidgetSystem quedaba en blanco y duplicaba «Notas» de la cabecera */
        grid-template-rows: minmax(160px, 1fr);
        gap: 0;
        overflow: hidden;
        min-height: 0;
    }

    /* Móvil: notas en modal (cabecera); el panel de widgets solo mostraba una franja vacía */
    #osWidgetPanel {
        display: none !important;
    }

    #osWidgetSystem.os-widget,
    #osWidgetWeather.os-widget {
        display: none !important;
    }

    .os-shell__sidebar {
        grid-column: 1;
        grid-row: 1;
        width: 100% !important;
        min-width: 0 !important;
        max-height: none;
        border-right: 1px solid var(--os-shell-border);
        border-bottom: none;
        overflow: hidden auto;
        padding: 5px 8px 10px;
    }

    body:not(.mobile-mode) .windows-menu.os-shell .windows-menu-categories.os-shell__sidebar,
    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-categories.os-shell__sidebar {
        width: 100% !important;
        min-width: 0 !important;
    }

    .os-shell__main {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        min-height: 0;
        padding: 5px 8px 10px;
        overflow: hidden;
    }

    .windows-menu.os-shell .windows-menu-apps {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap;
        align-content: stretch;
        gap: 3px !important;
        row-gap: 3px !important;
        grid-template-columns: unset;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .windows-menu.os-shell .windows-menu-apps .app-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        width: 100%;
        max-width: none;
        flex: 0 0 auto;
        aspect-ratio: auto !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 4px 8px !important;
        margin: 0 !important;
        box-sizing: border-box;
        position: relative;
    }

    .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
        width: 34px;
        height: 34px;
        max-width: 34px;
        max-height: 34px;
        flex-shrink: 0;
        margin: 0 8px 0 0;
        object-fit: cover;
        align-self: center;
    }

    .windows-menu.os-shell .windows-menu-apps .app-item p {
        margin: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        text-align: left;
        flex: 1 1 auto;
        min-width: 0;
        display: block;
        align-self: center;
        line-height: 1.2;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    /*
     * Plegables / panel interior ancho (≤768px, landscape): mosaico en mobile-pc-mode.
     * Portrait vertical sigue en lista; también .os-start-menu-fold-wide (JS) en plegables.
     */
    @media (min-width: 600px) and (orientation: landscape) {
        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps {
            display: grid !important;
            flex-direction: unset !important;
            flex-wrap: unset !important;
            grid-template-columns: repeat(auto-fill, minmax(var(--os-start-app-tile-min), var(--os-start-app-tile-max))) !important;
            justify-content: start;
            gap: 10px;
            align-content: start;
            overflow-y: auto;
            overflow-x: hidden;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item {
            flex-direction: column !important;
            justify-content: flex-start !important;
            align-items: center !important;
            text-align: center !important;
            width: 100%;
            max-width: var(--os-start-app-tile-max);
            aspect-ratio: 1;
            min-height: 0;
            min-width: 0;
            padding: 10px 8px 10px;
            justify-self: start;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
            width: 48px;
            height: 48px;
            margin: 0 0 8px 0 !important;
            align-self: center;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item p {
            text-align: center !important;
            flex: 0 1 auto !important;
            width: 100%;
            justify-content: center;
            align-items: center;
            align-self: auto;
        }
    }

    @media (orientation: landscape) and (min-width: 520px) {
        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps {
            display: grid !important;
            flex-direction: unset !important;
            flex-wrap: unset !important;
            grid-template-columns: repeat(auto-fill, minmax(var(--os-start-app-tile-min), var(--os-start-app-tile-max))) !important;
            justify-content: start;
            gap: 10px;
            align-content: start;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item {
            flex-direction: column !important;
            justify-content: flex-start !important;
            align-items: center !important;
            text-align: center !important;
            max-width: var(--os-start-app-tile-max);
            aspect-ratio: 1;
            justify-self: start;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
            width: 48px;
            height: 48px;
            margin: 0 0 8px 0 !important;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item p {
            text-align: center !important;
            flex: 0 1 auto !important;
        }
    }

    @media (min-width: 600px) and (orientation: landscape) {
        body.mobile-mode .windows-menu.os-shell .windows-menu-apps {
            display: grid !important;
            flex-direction: unset !important;
            flex-wrap: unset !important;
            grid-template-columns: repeat(auto-fill, minmax(var(--os-start-app-tile-min), var(--os-start-app-tile-max)));
            justify-content: start;
            gap: 10px;
            align-content: start;
            overflow-y: auto;
            overflow-x: hidden;
        }

        body.mobile-mode .windows-menu.os-shell .windows-menu-apps .app-item {
            flex-direction: column !important;
            justify-content: flex-start !important;
            align-items: center !important;
            text-align: center !important;
            width: 100%;
            max-width: var(--os-start-app-tile-max);
            aspect-ratio: 1;
            justify-self: start;
            min-height: 0;
            min-width: 0;
            padding: 10px 8px 10px;
        }

        body.mobile-mode .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
            width: 48px;
            height: 48px;
            margin: 0 0 8px 0 !important;
            align-self: center;
        }

        body.mobile-mode .windows-menu.os-shell .windows-menu-apps .app-item p {
            text-align: center !important;
            flex: 0 1 auto !important;
            width: 100%;
            justify-content: center;
            align-items: center;
            align-self: auto;
        }
    }

    .windows-menu.os-shell .windows-menu-user__name {
        font-size: 12px;
    }

    .windows-menu.os-shell .windows-menu-categories li {
        padding: 5px 8px;
    }

    .windows-menu.os-shell .windows-menu-categories li .os-cat-label {
        font-size: 11px;
    }

    /* Notas: carrusel bajo y textarea casi a la altura del contenido */
    .os-note-card textarea.os-note-ta {
        min-height: 4.25em;
        max-height: 10em;
        resize: none;
        overflow-y: auto;
        line-height: 1.35;
        field-sizing: content;
    }

    .os-notes-carousel {
        min-height: 0;
        align-items: stretch;
    }

    .os-note-card {
        flex: 0 0 100%;
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

/* Plegable / dual-screen: dos segmentos horizontales → mosaico (lista en móvil de un solo panel) */
@media (horizontal-viewport-segments: 2) {
    body.mobile-mode .windows-menu.os-shell .windows-menu-apps,
    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps {
        display: grid !important;
        flex-direction: unset !important;
        flex-wrap: unset !important;
        grid-template-columns: repeat(auto-fill, minmax(var(--os-start-app-tile-min), var(--os-start-app-tile-max)));
        justify-content: start;
        gap: 10px;
        align-content: start;
        overflow-y: auto;
        overflow-x: hidden;
    }

    body.mobile-mode .windows-menu.os-shell .windows-menu-apps .app-item,
    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item {
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        text-align: center !important;
        width: 100%;
        max-width: var(--os-start-app-tile-max);
        aspect-ratio: 1;
        min-height: 0;
        min-width: 0;
        padding: 10px 8px 10px;
        position: relative;
        justify-self: start;
    }

    body.mobile-mode .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon,
    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
        width: 48px;
        height: 48px;
        margin: 0 0 8px 0 !important;
        align-self: center;
    }

    body.mobile-mode .windows-menu.os-shell .windows-menu-apps .app-item p,
    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item p {
        margin: 0 !important;
        padding: 0;
        text-align: center !important;
        flex: 0 1 auto !important;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        align-self: auto;
        line-height: 1.25;
    }
}

/* Plegables (spanning) — refuerzo si el navegador expone single-fold */
@media (spanning: single-fold-vertical), (spanning: single-fold-horizontal) {
    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(var(--os-start-app-tile-min), var(--os-start-app-tile-max))) !important;
        justify-content: start;
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item {
        flex-direction: column !important;
        max-width: var(--os-start-app-tile-max);
        aspect-ratio: 1;
        justify-self: start;
    }
}

/*
 * Panel ancho en móvil PC (plegables desplegados, landscape): mosaico cuadrado.
 * La clase la pone os-shell.js; portrait estrecho no la recibe (lista intacta).
 */
body.mobile-pc-mode.os-start-menu-fold-wide .windows-menu.os-shell .windows-menu-apps {
    display: grid !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
    grid-template-columns: repeat(auto-fill, minmax(var(--os-start-app-tile-min), var(--os-start-app-tile-max))) !important;
    justify-content: start;
    gap: 10px;
    align-content: start;
    overflow-y: auto;
    overflow-x: hidden;
}

body.mobile-pc-mode.os-start-menu-fold-wide .windows-menu.os-shell .windows-menu-apps .app-item {
    display: flex;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    text-align: center !important;
    width: 100%;
    max-width: var(--os-start-app-tile-max);
    aspect-ratio: 1;
    min-height: 0;
    min-width: 0;
    padding: 10px 8px 10px;
    justify-self: start;
    box-sizing: border-box;
}

body.mobile-pc-mode.os-start-menu-fold-wide .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin: 0 0 8px 0 !important;
    align-self: center;
}

body.mobile-pc-mode.os-start-menu-fold-wide .windows-menu.os-shell .windows-menu-apps .app-item p {
    margin: 0 !important;
    padding: 0;
    text-align: center !important;
    flex: 0 1 auto !important;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.25;
}

/*
 * Teléfono landscape / viewport ancho: el bloque anterior solo corre en max-width:768px.
 * Repetimos el layout compacto solo para mobile-pc-mode cuando el ancho supera 768px.
 */
@media (min-width: 769px) {
    body.mobile-pc-mode .windows-menu.os-shell .os-shell__head {
        position: relative !important;
        z-index: 4;
        flex-shrink: 0;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 8px;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 4px 8px;
        box-sizing: border-box;
        line-height: 1;
        min-height: 0;
    }

    body.mobile-pc-mode .windows-menu.os-shell .os-shell__head-mobile-start {
        margin: 0;
        justify-self: stretch;
        align-self: center;
        width: auto;
        max-width: 100%;
        min-width: 0;
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-close {
        margin: 0;
        justify-self: end;
        align-self: center;
        position: relative;
        z-index: 5;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

    body.mobile-pc-mode .windows-menu.os-shell > .os-shell__body {
        flex: 1 1 auto;
        min-height: 0;
    }

    body.mobile-pc-mode .windows-menu.os-shell .os-shell__body {
        display: grid !important;
        margin-top: 0 !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: minmax(160px, 1fr);
        gap: 0;
        overflow: hidden;
        min-height: 0;
    }

    body.mobile-pc-mode .windows-menu.os-shell #osWidgetPanel {
        display: none !important;
    }

    body.mobile-pc-mode .windows-menu.os-shell #osWidgetSystem.os-widget {
        display: none !important;
    }

    body.mobile-pc-mode .windows-menu.os-shell .os-shell__sidebar {
        grid-column: 1;
        grid-row: 1;
        width: 100% !important;
        min-width: 0 !important;
        max-height: none;
        border-right: 1px solid var(--os-shell-border);
        border-bottom: none;
        overflow: hidden auto;
        padding: 5px 8px 10px;
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-categories.os-shell__sidebar {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.mobile-pc-mode .windows-menu.os-shell .os-shell__main {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        min-height: 0;
        padding: 5px 8px 10px;
        overflow: hidden;
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap;
        align-content: stretch;
        gap: 8px;
        grid-template-columns: unset;
        overflow-y: auto;
        overflow-x: hidden;
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        width: 100%;
        max-width: none;
        aspect-ratio: unset;
        min-height: 52px;
        box-sizing: border-box;
        position: relative;
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        margin: 0 10px 0 0;
        object-fit: cover;
        align-self: center;
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item p {
        margin: 0 !important;
        padding: 0;
        text-align: left;
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        align-self: center;
        line-height: 1.25;
    }

    /* Modo escritorio en móvil + pantalla ancha (interior plegable): mosaico */
    @media (min-width: 700px) {
        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps {
            display: grid !important;
            flex-direction: unset !important;
            flex-wrap: unset !important;
            grid-template-columns: repeat(auto-fill, minmax(var(--os-start-app-tile-min), var(--os-start-app-tile-max)));
            justify-content: start;
            gap: 10px;
            align-content: start;
            overflow-y: auto;
            overflow-x: hidden;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item {
            flex-direction: column !important;
            justify-content: flex-start !important;
            align-items: center !important;
            text-align: center !important;
            width: 100%;
            max-width: var(--os-start-app-tile-max);
            aspect-ratio: 1;
            min-height: 0;
            min-width: 0;
            padding: 10px 8px 10px;
            justify-self: start;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item img.app-icon {
            width: 48px;
            height: 48px;
            margin: 0 0 8px 0 !important;
            align-self: center;
        }

        body.mobile-pc-mode .windows-menu.os-shell .windows-menu-apps .app-item p {
            text-align: center !important;
            flex: 0 1 auto !important;
            width: 100%;
            justify-content: center;
            align-self: auto;
        }
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-categories li {
        padding: 5px 8px;
    }

    body.mobile-pc-mode .windows-menu.os-shell .windows-menu-categories li .os-cat-label {
        font-size: 11px;
    }

    body.mobile-pc-mode .os-shell__head-mobile-start {
        display: flex;
    }

    body.mobile-pc-mode .os-mobile-widget-chip {
        display: inline-flex;
    }

    body.mobile-pc-mode .os-notes-mobile-open,
    body.mobile-pc-mode .os-system-mobile-open,
    body.mobile-pc-mode .os-weather-mobile-open,
    body.mobile-pc-mode .os-spotify-mobile-open,
    body.mobile-pc-mode .os-media-mobile-open {
        display: inline-flex;
    }

    body.mobile-pc-mode .os-shell__head-mobile-start--drag-over {
        outline: 1px dashed rgba(56, 189, 248, 0.35);
        outline-offset: 2px;
        border-radius: 10px;
    }

    body.mobile-pc-mode .os-notes-widget--desktop,
    body.mobile-pc-mode .os-weather-widget--desktop,
    body.mobile-pc-mode .os-spotify-widget--desktop,
    body.mobile-pc-mode .os-media-widget--desktop {
        display: none !important;
    }
}

/* Tablet: tres columnas pero más aire */
@media (min-width: 769px) and (max-width: 1100px) {
    body:not(.mobile-mode) .windows-menu.os-shell {
        width: auto !important;
        max-width: none !important;
        left: var(--os-menu-edge-pad) !important;
        right: var(--os-menu-edge-pad) !important;
        --os-shell-widgets-w: 260px;
        --os-shell-widgets-min-w: 220px;
    }
}

/* Modales móvil OS (notas + clima + estado del sistema): centrados en el viewport */
.modal.os-notes-mobile-modal,
.modal.os-weather-mobile-modal,
.modal.os-system-mobile-modal,
.modal.os-media-mobile-modal {
    align-items: center;
    justify-content: center;
    padding:
        max(12px, env(safe-area-inset-top, 0px))
        max(16px, env(safe-area-inset-right, 0px))
        max(16px, env(safe-area-inset-bottom, 0px))
        max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.os-notes-mobile-modal .modal-content.os-notes-mobile-modal__content,
.os-weather-mobile-modal .modal-content.os-weather-mobile-modal__content,
.os-system-mobile-modal .modal-content.os-system-mobile-modal__content,
.os-media-mobile-modal .modal-content.os-media-mobile-modal__content {
    max-width: 420px;
    width: calc(100vw - (var(--os-menu-edge-pad) * 2));
    max-height: min(85vh, 640px);
    margin: 0;
    overflow-y: auto;
    background: linear-gradient(165deg, rgba(20, 30, 52, 0.98), rgba(8, 12, 24, 0.98));
    border: 1px solid var(--os-shell-border);
    border-radius: var(--os-shell-radius-lg);
    color: var(--os-shell-text);
    position: relative;
}

/* Cabecera modal: título a la izquierda, cerrar cuadrado a la derecha */
.os-mobile-modal__head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.os-mobile-modal__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    color: var(--os-shell-text);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.25;
    text-transform: none;
    letter-spacing: normal;
}

.os-mobile-modal__title .os-widget__title-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 13px;
}

.os-notes-mobile-modal .os-mobile-modal__close,
.os-weather-mobile-modal .os-mobile-modal__close,
.os-system-mobile-modal .os-mobile-modal__close,
.os-media-mobile-modal .os-mobile-modal__close {
    position: static;
    top: auto;
    margin: 0;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    font-size: 1.35rem;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: rgba(148, 163, 184, 0.95);
    background: rgba(255, 255, 255, 0.08);
    z-index: 2;
}

.os-notes-mobile-modal .os-mobile-modal__close:hover,
.os-weather-mobile-modal .os-mobile-modal__close:hover,
.os-system-mobile-modal .os-mobile-modal__close:hover,
.os-media-mobile-modal .os-mobile-modal__close:hover {
    color: var(--os-shell-text);
    background: rgba(255, 255, 255, 0.12);
}

.os-notes-mobile-modal .os-mobile-modal__close span,
.os-weather-mobile-modal .os-mobile-modal__close span,
.os-system-mobile-modal .os-mobile-modal__close span,
.os-media-mobile-modal .os-mobile-modal__close span {
    line-height: 1;
    display: block;
    transform: translateY(-1px);
}

.os-widget--system-modal {
    margin-top: 4px;
    text-align: left;
}

.os-widget--system-modal .os-env-pill {
    margin-bottom: 6px;
}

/* Icon gallery (modal categoría) */
.os-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    margin: 10px 0;
    padding: 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.os-icon-grid button {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    cursor: pointer;
    font-size: 18px;
}

.os-icon-grid button:hover,
.os-icon-grid button.is-selected {
    border-color: var(--os-shell-accent);
    color: var(--os-shell-accent);
    background: rgba(56, 189, 248, 0.12);
}

.os-cat-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    margin-top: 8px;
    border: 1px solid var(--os-shell-border);
}

.os-cat-preview__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 20px;
}

/* ─────────────────────────── Spotify widget ─────────────────────────── */

#osWidgetSpotify .os-widget-spotify__head .os-widget__title-icon {
    background: rgba(29, 185, 84, 0.14);
    color: #1db954;
}

.os-spotify-widget .os-widget-spotify__body {
    padding: 0;
}

.os-spotify-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.os-spotify-inline-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
    font-size: 0.75rem;
    line-height: 1.35;
}

.os-spotify-inline-error i {
    margin-top: 2px;
    flex-shrink: 0;
}

.os-spotify-inline-success {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(29, 185, 84, 0.14);
    border: 1px solid rgba(29, 185, 84, 0.4);
    color: #bbf7d0;
    font-size: 0.75rem;
    line-height: 1.35;
}

.os-spotify-inline-success i {
    margin-top: 2px;
    flex-shrink: 0;
    color: #1ed760;
}

.os-spotify-ctrl--add.is-active {
    background: rgba(29, 185, 84, 0.22);
    border-color: rgba(29, 185, 84, 0.55);
    color: #1ed760;
}

.os-spotify-ctrl:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.os-spotify-add-playlist {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.os-spotify-add-playlist.is-open {
    display: flex;
}

.os-spotify-add-playlist__title {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--os-shell-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.os-spotify-add-playlist__list {
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overscroll-behavior: contain;
}

.os-spotify-media-row--compact {
    padding: 3px 5px;
}

.os-spotify-media-row--compact .os-spotify-media-row__art {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
}

/* ── Estado vacío / desconectado / error ── */
.os-spotify-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 16px 12px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(29, 185, 84, 0.10), rgba(8, 12, 24, 0.3));
    border: 1px solid rgba(29, 185, 84, 0.18);
}

.os-spotify-empty__icon {
    font-size: 30px;
    color: #1db954;
    opacity: 0.9;
}

.os-spotify-empty__title {
    margin: 4px 0 0;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--os-shell-text);
}

.os-spotify-empty__msg {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--os-shell-muted);
}

.os-spotify-connect-btn {
    margin-top: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 0;
    background: #1db954;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
    box-shadow: 0 6px 18px rgba(29, 185, 84, 0.32);
}

.os-spotify-connect-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.os-spotify-empty__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.os-spotify-empty__actions .os-spotify-connect-btn {
    width: 100%;
    justify-content: center;
    margin-top: 0;
    text-decoration: none;
}

.os-spotify-connect-btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: none;
    color: var(--os-shell-text);
}

.os-spotify-connect-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    filter: none;
}

.os-spotify-connect-btn--premium {
    background: linear-gradient(135deg, #1db954 0%, #1ed760 55%, #9be564 100%);
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.35);
}

.os-spotify-empty--premium .os-spotify-empty__icon {
    color: #1ed760;
}

/* ── Card principal (now playing + controles) ── */
.os-spotify-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(20, 30, 52, 0.55), rgba(8, 12, 24, 0.45));
    border: 1px solid var(--os-shell-border);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.os-spotify-card.is-playing {
    border-color: rgba(29, 185, 84, 0.32);
    box-shadow: 0 0 24px rgba(29, 185, 84, 0.10) inset;
}

.os-spotify-card.has-track .os-spotify-hero__art-wrap[data-art-view="square"] .os-spotify-hero__art {
    box-shadow: 0 6px 20px rgba(29, 185, 84, 0.25);
}

/* ── Hero now playing ── */
.os-spotify-hero {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.os-spotify-hero--view-crate {
    align-items: center;
}

.os-spotify-hero__art-wrap {
    position: relative;
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    transition: width 0.35s ease, height 0.35s ease, flex-basis 0.35s ease;
}

.os-spotify-hero__art-wrap:focus-visible {
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.55);
    border-radius: 12px;
}

.os-spotify-hero__disc-stage {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.os-spotify-hero__disc-spin {
    position: relative;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.os-spotify-hero__art {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.45);
    transition: border-radius 0.35s ease, box-shadow 0.35s ease;
}

.os-spotify-hero__art--empty {
    display: grid;
    place-items: center;
    color: rgba(29, 185, 84, 0.65);
    font-size: 30px;
    background: linear-gradient(145deg, rgba(29, 185, 84, 0.12), rgba(8, 12, 24, 0.5));
}

/* Vinilo: orilla fina hacia afuera + centro mínimo */
.os-spotify-hero__vinyl-groove,
.os-spotify-hero__vinyl-label {
    display: none;
    pointer-events: none;
    position: absolute;
    border-radius: 50%;
}

.os-spotify-hero__vinyl-groove {
    inset: 0;
    background: transparent;
    border: 1px solid rgba(20, 20, 20, 0.8);
    box-shadow:
        0 0 0 0.5px rgba(0, 0, 0, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.28);
}

.os-spotify-hero__vinyl-groove::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 0.5px solid rgba(70, 70, 70, 0.35);
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.25);
}

.os-spotify-hero__vinyl-groove::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: repeating-radial-gradient(
        circle at center,
        transparent 0 2px,
        rgba(255, 255, 255, 0.02) 2px 3px
    );
    -webkit-mask: radial-gradient(circle, transparent 88%, #000 93%, transparent 100%);
    mask: radial-gradient(circle, transparent 88%, #000 93%, transparent 100%);
    opacity: 0.45;
}

.os-spotify-hero__vinyl-label {
    width: 4px;
    height: 4px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 10, 0.5);
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.12);
}

.os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__art,
.os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__art {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 91%;
    height: 91%;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.32);
}

.os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__vinyl-groove,
.os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__vinyl-label,
.os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__vinyl-groove,
.os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__vinyl-label {
    display: block;
}

.os-spotify-card.is-playing .os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__disc-spin,
.os-spotify-card.is-playing .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__disc-spin {
    animation: os-spotify-vinyl-spin 4.8s linear infinite;
}

@keyframes os-spotify-vinyl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Vista 3D isométrica (solo disco, sin caja) */
.os-spotify-hero__art-wrap[data-art-view="crate"] {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
}

.os-spotify-hero__art-wrap[data-art-view="crate"]::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 68%;
    height: 16px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.38) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__disc-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    transform: perspective(640px) rotateX(44deg) rotateY(-26deg) rotateZ(14deg);
    transform-origin: 48% 52%;
    filter:
        drop-shadow(0 18px 14px rgba(0, 0, 0, 0.48))
        drop-shadow(0 6px 8px rgba(0, 0, 0, 0.28));
}

.os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__art {
    width: 93%;
    height: 93%;
}

.os-spotify-card.has-track .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__art {
    box-shadow:
        0 8px 18px rgba(29, 185, 84, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .os-spotify-card.is-playing .os-spotify-hero__art-wrap[data-art-view="vinyl"] .os-spotify-hero__disc-spin,
    .os-spotify-card.is-playing .os-spotify-hero__art-wrap[data-art-view="crate"] .os-spotify-hero__disc-spin {
        animation: none;
    }

    .os-spotify-hero__art-wrap,
    .os-spotify-hero__art {
        transition: none;
    }
}

.os-spotify-hero__meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.os-spotify-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1ed760;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(29, 185, 84, 0.14);
}

.os-spotify-hero__eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
}

.os-spotify-hero__eq i {
    display: block;
    width: 2px;
    height: 100%;
    background: #1ed760;
    border-radius: 1px;
    animation: os-spotify-eq 0.9s ease-in-out infinite;
}

.os-spotify-hero__eq i:nth-child(2) { animation-delay: 0.15s; height: 70%; }
.os-spotify-hero__eq i:nth-child(3) { animation-delay: 0.3s; height: 45%; }

@keyframes os-spotify-eq {
    0%, 100% { transform: scaleY(0.35); }
    50% { transform: scaleY(1); }
}

.os-spotify-hero__title {
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
    color: var(--os-shell-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.os-spotify-hero__title.is-link {
    cursor: pointer;
}

.os-spotify-hero__title.is-link:hover {
    color: #1ed760;
}

.os-spotify-hero__sub {
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--os-shell-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.os-spotify-card__progress[data-spotify-seek] {
    cursor: pointer;
}

.os-spotify-card__progress[data-spotify-seek]:hover .os-spotify-card__progress-bar {
    filter: brightness(1.1);
}

/* ── Pestañas ── */
.os-spotify-tabs {
    display: flex;
    gap: 6px;
    padding: 4px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.os-spotify-tabs__btn {
    flex: 1 1 50%;
    border: 0;
    background: transparent;
    color: var(--os-shell-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.os-spotify-tabs__btn:hover {
    color: var(--os-shell-text);
    background: rgba(255, 255, 255, 0.04);
}

.os-spotify-tabs__btn.is-active {
    background: rgba(29, 185, 84, 0.2);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.os-spotify-tab-panel {
    min-height: 120px;
}

/* ── Búsqueda ── */
.os-spotify-search__field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 8px;
    pointer-events: auto;
    cursor: text;
}

.os-spotify-search__field:focus-within {
    border-color: rgba(29, 185, 84, 0.45);
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.12);
}

.os-spotify-search__field > i {
    color: var(--os-shell-muted);
    font-size: 0.85rem;
}

.os-spotify-search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--os-shell-text);
    font-size: 0.85rem;
    padding: 10px 0;
    outline: none;
    pointer-events: auto;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
    touch-action: manipulation;
}

.os-spotify-search__input::placeholder {
    color: rgba(232, 244, 255, 0.38);
}

.os-spotify-search__results,
.os-spotify-playlists__list--tab,
.os-spotify-playlists__tracks {
    max-height: 200px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-right: 2px;
}

.os-spotify-search__results::-webkit-scrollbar,
.os-spotify-playlists__list--tab::-webkit-scrollbar,
.os-spotify-playlists__tracks::-webkit-scrollbar {
    width: 6px;
}

.os-spotify-search__results::-webkit-scrollbar-thumb,
.os-spotify-playlists__list--tab::-webkit-scrollbar-thumb,
.os-spotify-playlists__tracks::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.os-spotify-playlists__detail-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 0 2px;
}

.os-spotify-playlists__back,
.os-spotify-playlists__play-all {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--os-shell-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.os-spotify-playlists__play-all {
    margin-left: auto;
    color: #1ed760;
    border-color: rgba(29, 185, 84, 0.35);
    background: rgba(29, 185, 84, 0.12);
}

.os-spotify-playlists__back:hover,
.os-spotify-playlists__play-all:hover {
    background: rgba(255, 255, 255, 0.12);
}

.os-spotify-playlists__play-all:hover {
    background: rgba(29, 185, 84, 0.22);
}

.os-spotify-playlists__detail-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.os-spotify-playlists__detail-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--os-shell-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-spotify-playlists__detail-sub {
    font-size: 0.7rem;
    color: var(--os-shell-muted);
}

.os-spotify-playlists__more {
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--os-shell-muted);
    font-size: 0.75rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.os-spotify-playlists__more:hover:not(:disabled) {
    color: var(--os-shell-text);
    border-color: rgba(29, 185, 84, 0.4);
    background: rgba(29, 185, 84, 0.08);
}

.os-spotify-playlists__more:disabled {
    opacity: 0.6;
    cursor: wait;
}

.os-spotify-search__hint {
    text-align: center;
    color: var(--os-shell-muted);
    font-size: 0.78rem;
    padding: 14px 8px;
    margin: 0;
    line-height: 1.45;
}

.os-spotify-search__hint--err {
    color: #fecaca;
}

/* ── Filas de canción / playlist ── */
.os-spotify-media-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 4px 6px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--os-shell-text);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease;
}

.os-spotify-media-row--playlist {
    padding: 0;
    gap: 8px;
    min-height: 0;
    border-radius: 6px;
    align-items: stretch;
}

.os-spotify-media-row--playlist .os-spotify-media-row__art {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    align-self: center;
    border-radius: 5px;
}

.os-spotify-media-row--playlist .os-spotify-media-row__body {
    gap: 0;
    padding: 0;
    justify-content: center;
    align-self: center;
}

.os-spotify-media-row--playlist .os-spotify-media-row__title {
    font-size: 0.8rem;
    line-height: 1.15;
}

.os-spotify-media-row--playlist .os-spotify-media-row__sub {
    font-size: 0.68rem;
    line-height: 1.1;
}

.os-spotify-media-row--playlist .os-spotify-media-row__play {
    align-self: center;
    margin-right: 2px;
}

.os-spotify-media-row:hover {
    background: rgba(29, 185, 84, 0.12);
}

.os-spotify-media-row__art {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.4);
}

.os-spotify-media-row__art--empty {
    display: grid;
    place-items: center;
    color: rgba(29, 185, 84, 0.7);
    font-size: 14px;
}

.os-spotify-media-row__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.os-spotify-media-row__title {
    font-size: 0.83rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-spotify-media-row__sub {
    font-size: 0.72rem;
    color: var(--os-shell-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-spotify-media-row__dur {
    font-size: 0.7rem;
    color: var(--os-shell-muted);
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
}

.os-spotify-media-row__now-playing {
    flex: 0 0 14px;
    width: 14px;
    min-width: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.os-spotify-media-row__now-playing[hidden] {
    display: none !important;
}

.os-spotify-now-playing-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    width: 14px;
    height: 14px;
}

.os-spotify-now-playing-bars__bar {
    width: 3px;
    height: 4px;
    border-radius: 1px;
    background: #1db954;
    transform-origin: bottom center;
}

.os-spotify-media-row.is-current .os-spotify-now-playing-bars__bar:nth-child(1) {
    height: 6px;
}

.os-spotify-media-row.is-current .os-spotify-now-playing-bars__bar:nth-child(2) {
    height: 10px;
}

.os-spotify-media-row.is-current .os-spotify-now-playing-bars__bar:nth-child(3) {
    height: 5px;
}

.os-spotify-media-row.is-playing-track .os-spotify-now-playing-bars__bar {
    animation: os-spotify-now-playing-bar 0.85s ease-in-out infinite;
}

.os-spotify-media-row.is-playing-track .os-spotify-now-playing-bars__bar:nth-child(1) {
    animation-delay: 0s;
}

.os-spotify-media-row.is-playing-track .os-spotify-now-playing-bars__bar:nth-child(2) {
    animation-delay: 0.18s;
}

.os-spotify-media-row.is-playing-track .os-spotify-now-playing-bars__bar:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes os-spotify-now-playing-bar {
    0%, 100% { height: 4px; }
    50% { height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .os-spotify-media-row.is-playing-track .os-spotify-now-playing-bars__bar {
        animation: none;
    }
}

.os-spotify-media-row.is-current {
    background: rgba(29, 185, 84, 0.12);
}

.os-spotify-media-row.is-current .os-spotify-media-row__title {
    color: #1ed760;
}

.os-spotify-media-row.is-current .os-spotify-media-row__play {
    opacity: 0 !important;
}

.os-spotify-media-row__play {
    flex: 0 0 auto;
    color: #1db954;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.os-spotify-media-row:hover .os-spotify-media-row__play {
    opacity: 1;
}

.os-spotify-card__head {
    display: flex;
    gap: 10px;
    align-items: stretch;
    min-width: 0;
}

.os-spotify-card__art {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0,0,0,0.4);
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.os-spotify-card__art--empty {
    display: grid;
    place-items: center;
    color: rgba(29,185,84,0.7);
    font-size: 26px;
}

.os-spotify-card__meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}

.os-spotify-card__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--os-shell-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-spotify-card__artist {
    font-size: 0.82rem;
    color: var(--os-shell-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-spotify-card__album {
    font-size: 0.74rem;
    color: rgba(232, 244, 255, 0.42);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-spotify-card__device {
    font-size: 0.72rem;
    color: rgba(29, 185, 84, 0.85);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-spotify-card__device i {
    margin-right: 4px;
}

.os-spotify-card__hint {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 6px;
    line-height: 1.35;
}

.os-spotify-card__progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.os-spotify-card__progress-bar {
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, #1db954, #1ed760);
    width: 0%;
    transition: width 0.4s linear;
}

.os-spotify-card__progress::before {
    content: '';
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    margin-bottom: -4px;
}

.os-spotify-card__progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--os-shell-muted);
    font-variant-numeric: tabular-nums;
}

.os-spotify-card__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 0 2px;
}

.os-spotify-ctrl {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--os-shell-text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 14px;
    transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.os-spotify-ctrl:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(29, 185, 84, 0.4);
}

.os-spotify-ctrl:active {
    transform: scale(0.94);
}

.os-spotify-ctrl--play {
    width: 44px;
    height: 44px;
    background: #1db954;
    border-color: transparent;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(29, 185, 84, 0.4);
}

.os-spotify-ctrl--play:hover {
    background: #1ed760;
    border-color: transparent;
}

.os-spotify-ctrl--like[data-liked="1"] {
    color: #ff5577;
    border-color: rgba(255, 85, 119, 0.4);
}

.os-spotify-card__volume {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
    color: var(--os-shell-muted);
    font-size: 12px;
}

.os-spotify-vol {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
}

.os-spotify-vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    background: #1db954;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

.os-spotify-vol::-moz-range-thumb {
    width: 13px;
    height: 13px;
    background: #1db954;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
}

/* ── Playlists ── */
.os-spotify-playlists {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 8px;
}

.os-spotify-playlists__head {
    width: 100%;
    background: transparent;
    color: var(--os-shell-text);
    border: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
}

.os-spotify-playlists__head:hover {
    background: rgba(255, 255, 255, 0.04);
}

.os-spotify-playlists__head i.fa-list {
    margin-right: 6px;
    color: #1db954;
}

.os-spotify-playlists__list {
    margin-top: 6px;
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-right: 2px;
}

.os-spotify-playlists__list::-webkit-scrollbar { width: 6px; }
.os-spotify-playlists__list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 3px;
}

.os-spotify-playlists__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-radius: 6px;
    background: transparent;
    border: 0;
    color: var(--os-shell-text);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease;
}

.os-spotify-playlists__item:hover {
    background: rgba(29, 185, 84, 0.10);
}

.os-spotify-playlists__art {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0,0,0,0.4);
}

.os-spotify-playlists__art--empty {
    display: grid;
    place-items: center;
    color: rgba(29,185,84,0.7);
    font-size: 14px;
}

.os-spotify-playlists__info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    justify-content: center;
    padding: 0;
}

.os-spotify-playlists__name {
    font-size: 0.83rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-spotify-playlists__count {
    font-size: 0.7rem;
    color: var(--os-shell-muted);
}

.os-spotify-playlists__play {
    color: #1db954;
    opacity: 0;
    transition: opacity 0.15s ease;
    font-size: 12px;
}

.os-spotify-playlists__item:hover .os-spotify-playlists__play {
    opacity: 1;
}

.os-spotify-playlists__empty {
    text-align: center;
    color: var(--os-shell-muted);
    font-size: 0.78rem;
    padding: 10px;
    margin: 0;
}

/* ── Footer ── */
.os-spotify-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 6px;
    font-size: 0.72rem;
    color: var(--os-shell-muted);
}

.os-spotify-card__user i {
    color: #1db954;
    margin-right: 4px;
}

.os-spotify-disconnect {
    background: transparent;
    border: 0;
    color: var(--os-shell-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 6px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.os-spotify-disconnect:hover {
    color: #ff7777;
    background: rgba(255, 119, 119, 0.08);
}

.os-spotify-disconnect i {
    margin-right: 3px;
}

/* ── Modal mobile ── */
.modal.os-spotify-mobile-modal {
    z-index: 99999;
}

.os-spotify-mobile-modal .modal-content.os-spotify-mobile-modal__content {
    max-width: 460px;
    width: calc(100% - 32px);
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(20, 30, 52, 0.96), rgba(8, 12, 24, 0.96));
    border: 1px solid var(--os-shell-border);
    color: var(--os-shell-text);
    padding: 14px 14px 18px;
}

.os-spotify-mobile-modal .os-mobile-modal__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.os-spotify-mobile-modal .os-mobile-modal__title {
    font-size: 1rem;
    margin: 0;
    flex: 1;
    color: var(--os-shell-text);
}

.os-spotify-mobile-modal .os-mobile-modal__title .os-widget__title-icon {
    color: #1db954;
}

.os-spotify-mobile-modal .os-mobile-modal__close {
    background: transparent;
    border: 0;
    color: var(--os-shell-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
}

.os-spotify-mobile-modal .os-mobile-modal__close:hover {
    background: rgba(255,255,255,0.06);
}

.os-spotify-mobile-modal .os-spotify-search__results,
.os-spotify-mobile-modal .os-spotify-playlists__list--tab {
    max-height: min(42vh, 280px);
}

/* ─────────────── Tarjeta de integraciones (configModal) ─────────────── */

.integration-card {
    border: 1px solid rgba(0, 242, 255, 0.18);
    border-radius: 14px;
    background: rgba(20, 30, 52, 0.45);
    padding: 16px;
    margin-bottom: 14px;
}

.integration-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.integration-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 20px;
    flex: 0 0 40px;
}

.integration-card__title-wrap {
    flex: 1;
    min-width: 0;
}

.integration-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.integration-card__subtitle {
    margin: 2px 0 0;
    font-size: 0.82rem;
}

.integration-card__status {
    font-size: 0.74rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    flex-shrink: 0;
}

.integration-card__status--idle {
    background: rgba(232, 244, 255, 0.08);
    color: rgba(232, 244, 255, 0.55);
}

.integration-card__status--ok {
    background: rgba(29, 185, 84, 0.18);
    color: #6ee7b7;
}

.integration-card__status--err {
    background: rgba(255, 119, 119, 0.18);
    color: #ff9b9b;
}

.integration-card__howto {
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.85rem;
}

.integration-card__howto summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.integration-card__howto summary::before {
    content: '▸';
    margin-right: 6px;
    transition: transform 0.15s ease;
    display: inline-block;
}

.integration-card__howto[open] summary::before {
    transform: rotate(90deg);
}

.integration-card__steps {
    margin: 8px 0 4px 18px;
    padding: 0;
    line-height: 1.6;
    font-size: 0.85rem;
}

.integration-card__steps li {
    margin: 6px 0;
}

.integration-card__steps a {
    color: #38bdf8;
}

.integration-card__note {
    margin: 8px 0 0;
    font-size: 0.78rem;
    line-height: 1.45;
}

.integration-card__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.integration-card__field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(232, 244, 255, 0.85);
}

.integration-card__field label .muted {
    font-weight: 400;
    color: rgba(232, 244, 255, 0.55);
    font-size: 0.78rem;
}

.integration-card__field input {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(0,0,0,0.3);
    color: var(--os-shell-text);
    font-family: inherit;
    font-size: 0.88rem;
    box-sizing: border-box;
}

.integration-card__field input:focus {
    outline: none;
    border-color: #1db954;
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.18);
}

.integration-card__field input[readonly] {
    color: rgba(232, 244, 255, 0.7);
    background: rgba(0,0,0,0.45);
}

.integration-card__copyrow {
    display: flex;
    gap: 6px;
}

.integration-card__copyrow input {
    flex: 1;
    min-width: 0;
}

.integration-card__copy-btn {
    flex: 0 0 auto;
    background: rgba(0,114,255,0.18);
    border: 1px solid rgba(0,242,255,0.28);
    color: var(--os-shell-text);
    padding: 0 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.integration-card__copy-btn:hover {
    background: rgba(0,114,255,0.32);
}

.integration-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.integration-card__msg {
    margin: 10px 0 0;
    font-size: 0.82rem;
    min-height: 1.2em;
    color: var(--os-shell-muted);
}

.integration-card__msg--ok {
    color: #6ee7b7;
}

.integration-card__msg--err {
    color: #ff9b9b;
}

.integration-card__setup {
    margin: 0 0 14px;
}

.integration-card__setup-question {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(232, 244, 255, 0.92);
}

.integration-card__setup-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.integration-card__setup-choice {
    flex: 1 1 160px;
    padding: 9px 12px;
    border: 1px solid rgba(29, 185, 84, 0.45);
    border-radius: 10px;
    background: rgba(29, 185, 84, 0.14);
    color: #d1fae5;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.integration-card__setup-choice:hover {
    background: rgba(29, 185, 84, 0.24);
    border-color: rgba(29, 185, 84, 0.7);
}

.integration-card__setup-choice--secondary {
    border-color: rgba(0, 242, 255, 0.28);
    background: rgba(0, 114, 255, 0.12);
    color: rgba(232, 244, 255, 0.9);
}

.integration-card__setup-choice--secondary:hover {
    background: rgba(0, 114, 255, 0.22);
    border-color: rgba(0, 242, 255, 0.45);
}

.integration-card__setup-path {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(0, 242, 255, 0.12);
}

.integration-card__setup-path .integration-card__howto {
    margin-bottom: 10px;
}

.integration-card__setup-path-lead {
    margin: 0 0 8px;
    font-size: 0.84rem;
    line-height: 1.5;
}

.integration-card__setup-path-lead a {
    color: #38bdf8;
}

.integration-card__setup-path-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.integration-card__setup-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 10px;
    background: #1db954;
    color: #04210f;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.integration-card__setup-link-btn:hover {
    background: #1ed760;
    color: #04210f;
}

.integration-card__setup-back {
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: rgba(232, 244, 255, 0.65);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.integration-card__setup-back:hover {
    color: rgba(232, 244, 255, 0.9);
}
