/* Reset + base typography + small utility classes shared across the app. */

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

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--text-primary); }
h1:focus, h2:focus, h3:focus { outline: none; }
p { margin: 0; }

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

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

button { font-family: inherit; }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); border: 2px solid var(--bg-surface); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus ring, consistent across every interactive element */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-sm);
}

/* Utilities */
.muted { color: var(--text-secondary); }
.subtle { color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Blazor's built-in error UI, restyled to match the app rather than the template default */
#blazor-error-ui {
    background: var(--danger);
    color: #fff;
    bottom: 0;
    box-shadow: var(--shadow-lg);
    display: none;
    left: 0;
    padding: var(--space-3) var(--space-5);
    position: fixed;
    width: 100%;
    z-index: 2000;
    font-size: var(--text-sm);
}
#blazor-error-ui .reload { color: #fff; text-decoration: underline; font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%); opacity: .85; }

.blazor-error-boundary {
    background: var(--danger-soft-bg);
    color: var(--danger-soft-text);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}
.blazor-error-boundary::after { content: "Something went wrong rendering this section."; }
