/* ==========================================================================
   Modern reset — based on modern-normalize + opinionated defaults
   ========================================================================== */

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

* { margin: 0; }

html, body { height: 100%; }

html {
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Ensure [hidden] is always respected even when CSS classes set display */
[hidden] { display: none !important; }

body {
    line-height: var(--lh-normal);
    font-family: var(--font-sans);
    font-size: var(--fs-15);
    color: var(--text-primary);
    background-color: var(--surface-base);
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

button:disabled, [aria-disabled="true"] {
    cursor: not-allowed;
}

a {
    color: var(--text-link);
    text-decoration: none;
}
a:hover { color: var(--text-link-hover); text-decoration: underline; }

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

ul, ol {
    padding: 0;
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-subtle);
    margin: var(--space-5) 0;
}

::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

::selection {
    background: var(--brand-soft);
    color: var(--text-primary);
}

/* Visible focus ring (keyboard) — buttons/inputs override this with their own ring */
:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Custom scrollbar (dezent, optional) */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: padding-box; border: 2px solid transparent; }

#root, #app, .app-layout { isolation: isolate; }
