/* ==============================================
   RESET & NORMALIZATION
   ============================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ==============================================
   GLOBAL SCROLLBAR STYLING
   ============================================== */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-secondary) var(--bg-primary);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

*::-webkit-scrollbar-thumb {
    background-color: var(--bg-secondary);
    border-radius: var(--radius-standard);
    border: 2px solid var(--bg-primary);
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--bg-tertiary);
}

/* Hide visible browser scrollbars in Capacitor while preserving touch scrolling. */
html.runtime-capacitor-native,
html.runtime-capacitor-native * {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html.runtime-capacitor-native *::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

html.runtime-capacitor-native *::-webkit-scrollbar-track,
html.runtime-capacitor-native *::-webkit-scrollbar-thumb {
    background: transparent;
    border: 0;
}

html {
    font-size: var(--text-base);
    overscroll-behavior: auto;
    overscroll-behavior-y: auto;
}

/* Base Body Styles - Defaults for App/SPA mode */
body {
    overflow: auto;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overscroll-behavior: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: -webkit-fill-available;
    position: relative;
}

/* ==============================================
   ACCESSIBILITY
   ============================================== */

/* Global focus visible styles for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--status-info-fg);
    outline-offset: 2px;
}

/* Adjust for buttons with large border-radius */
.btn:focus-visible {
    outline-offset: 4px;
}
