/* Reset, document defaults, typography, focus. Tokens: tokens.css. */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background: var(--color-surface);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-surface);
    color: var(--color-on-surface);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    font-weight: var(--weight-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
[hidden] { display: none !important; }

h1 { font-size: var(--text-xl); line-height: var(--leading-tight); font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
h2 { font-size: var(--text-md); line-height: var(--leading-tight); font-weight: var(--weight-semibold); }
h3 { font-size: var(--text-base); line-height: var(--leading-tight); font-weight: var(--weight-semibold); }
h1:focus { outline: none; } /* FocusOnNavigate moves focus here after a route change; the heading is not interactive */

a { color: var(--color-link); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; border-radius: var(--radius-xs); }
a:hover { text-decoration-thickness: 2px; }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.92em; }
code {
    background: var(--color-surface-container-lowest);
    border: 1px solid var(--color-outline-variant);
    border-radius: var(--radius-xs);
    padding: 0.05em 0.35em;
    overflow-wrap: anywhere;
}

::selection { background: color-mix(in srgb, var(--color-brand) 45%, transparent); }

/* One focus style for everything: a 2px ring offset from the element, visible on every surface (>= 3:1). */
:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: var(--space-2);
    left: var(--space-2);
    z-index: calc(var(--z-toast) + 1);
    padding: var(--space-2) var(--space-3);
    background: var(--color-primary);
    color: var(--color-on-primary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: var(--weight-medium);
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.text-muted { color: var(--color-on-surface-variant); }
.text-hint { color: var(--color-on-surface-muted); font-size: var(--text-sm); }
.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.cluster-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }

/* Start-up splash (shown by index.html until Blazor has rendered) and the framework error bar. */
.splash {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: var(--space-3);
    color: var(--color-on-surface-variant);
}
.splash-logo { width: 2.5rem; height: 2.5rem; color: var(--color-brand); animation: splash-pulse 1.4s var(--ease-standard) infinite alternate; }
@keyframes splash-pulse { from { opacity: 0.45; } to { opacity: 1; } }
html[lang="de"] .splash-en, html:not([lang="de"]) .splash-de { display: none; }

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: calc(var(--z-toast) + 2);
    padding: var(--space-3) var(--space-4);
    background: var(--color-error-container);
    color: var(--color-on-error-container);
    border-top: 1px solid var(--color-error);
}
#blazor-error-ui a { color: inherit; font-weight: var(--weight-semibold); }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
