/**
 * mio.land - Scrollbars harmonisees (format UX)
 *
 * Style discret : pastille capsule unie semi-transparente, rail invisible,
 * aligne sur la grille d'icones du bureau. Pas de degrade d'accent.
 *
 * Tailles (OBLIGATOIRE) :
 * - Desktop / pointeur fin : 4px (`--ux-scrollbar-size`)
 * - Tactile / mobile (`body.mode-mobile`, `html.os-mode-mobile`) : 1px
 *
 * La pastille est imposee (!important) : une app la nuance par les jetons
 * --ux-scrollbar-thumb / --ux-scrollbar-thumb-hover, jamais par une bordure,
 * un degrade ou une couleur posee sur ::-webkit-scrollbar-thumb.
 *
 * IMPORTANT: NE PAS utiliser scrollbar-width ou scrollbar-color (Firefox)
 * car ces proprietes causent l'apparition des fleches sur certains systemes.
 * Ne PAS redefinir ::-webkit-scrollbar en local sans reprendre ces tailles.
 */

:root {
    --ux-scrollbar-size: 4px;
    --ux-scrollbar-thumb: rgba(255, 255, 255, 0.14);
    --ux-scrollbar-thumb-hover: rgba(255, 255, 255, 0.20);
}

html.os-mode-mobile,
body.mode-mobile {
    --ux-scrollbar-size: 1px;
    --ux-scrollbar-thumb: rgba(255, 255, 255, 0.32);
    --ux-scrollbar-thumb-hover: rgba(255, 255, 255, 0.45);
}

[data-theme="light"] {
    --ux-scrollbar-thumb: rgba(0, 0, 0, 0.21);
    --ux-scrollbar-thumb-hover: rgba(0, 0, 0, 0.32);
}

[data-theme="light"].os-mode-mobile,
[data-theme="light"] body.mode-mobile,
html.os-mode-mobile[data-theme="light"],
body.mode-mobile[data-theme="light"] {
    --ux-scrollbar-thumb: rgba(0, 0, 0, 0.32);
    --ux-scrollbar-thumb-hover: rgba(0, 0, 0, 0.45);
}

/* ============================
   BOUTONS - user-select: none
   ============================ */
button,
.btn,
.app-btn,
.tag-btn,
[role="button"],
[onclick],
.clickable {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
    width: var(--ux-scrollbar-size, 4px) !important;
    height: var(--ux-scrollbar-size, 4px) !important;
}

::-webkit-scrollbar-track {
    background: transparent !important;
    border-radius: 999px;
}

/* Écran à coins arrondis (modèle de référence, --os-screen-corner-radius posée par
   os/frame-link.js) : le rail s'arrête avant les coins, la pastille n'y entre jamais. */
::-webkit-scrollbar-track:vertical {
    margin: var(--os-screen-corner-radius, 0px) 0;
}

::-webkit-scrollbar-track:horizontal {
    margin: 0 var(--os-screen-corner-radius, 0px);
}

/* Sans bordure : dans 4 px, la bordure transparente effacerait la pastille. */
::-webkit-scrollbar-thumb {
    background-color: var(--ux-scrollbar-thumb, rgba(255, 255, 255, 0.14)) !important;
    background-image: none !important;
    border: none !important;
    background-clip: border-box !important;
    border-radius: 999px !important;
    box-shadow: none !important;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--ux-scrollbar-thumb-hover, rgba(255, 255, 255, 0.20)) !important;
    background-image: none !important;
}

html.os-mode-mobile ::-webkit-scrollbar,
body.mode-mobile ::-webkit-scrollbar {
    width: 1px !important;
    height: 1px !important;
}

::-webkit-scrollbar-corner {
    background: transparent !important;
}

/* CRUCIAL: Supprimer TOUTES les fleches de scrollbar */
::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
    background-color: transparent !important;
}

::-webkit-scrollbar-button:single-button {
    display: none !important;
    background: transparent !important;
}

::-webkit-scrollbar-button:single-button:vertical:decrement,
::-webkit-scrollbar-button:single-button:vertical:increment,
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment,
::-webkit-scrollbar-button:vertical:start:decrement,
::-webkit-scrollbar-button:vertical:end:increment,
::-webkit-scrollbar-button:vertical:start:increment,
::-webkit-scrollbar-button:vertical:end:decrement {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}
