:root {
    --font: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --text-2xs: 0.6875rem;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-md: 0.875rem;
    --text-lg: 0.9375rem;
    --text-2xl: 1.625rem;

    --h1: 1.625rem;
    --h2: 1.375rem;
    --h3: 1.125rem;
    --h4: 1rem;
    --h5: 0.9375rem;
    --h6: 0.875rem;

    --weight-normal: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-heading: 650;
    --weight-bold: 700;

    --leading-none: 1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;

    --tracking-tight: -.02em;
    --tracking-wide: .06em;

    --space-3xs: 2px;
    --space-2xs: 4px;
    --space-xs: 6px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    --space-4xl: 56px;

    --space-card: var(--space-lg);
    --page-top: var(--space-3xl);
    --page-max: 1920px;
    --page-admin: 1400px;
    --card-min: 360px;
    --header: calc(var(--control-lg) + var(--space-md) * 2 + var(--border) * 2);
    --header-band: calc(var(--header) + var(--space-lg) * 2);

    --radius-card: 12px;
    --radius-chip: 6px;
    --radius-icon: 10px;
    --radius-pill: 999px;
    --radius-round: 50%;

    --control-sm: 28px;
    --control-md: 36px;
    --control-lg: 40px;

    --dot: 8px;
    --icon-2xs: 12px;
    --icon-xs: 16px;
    --icon-sm: 22px;
    --icon-md: 26px;
    --icon-lg: 32px;
    --tile: 40px;

    --border: 1px;
    --outline: 2px;
    --outline-offset: 3px;

    --duration: 150ms;
    --duration-slow: 320ms;
    --duration-glow: 520ms;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-glide: cubic-bezier(.16, .84, .44, 1);
    --glow-near: 26%;
    --glow-far: 60%;
    --ring-width: 2px;
    --ring-size: 17rem;

    --z-sticky: 10;
    --z-header: 20;
    --z-overlay: 100;
    --z-toast: 1000;
}

* {
    box-sizing: border-box;
}

.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.form input:not([type=checkbox]) {
    appearance: none;
    font: inherit;
    color: inherit;
    background: var(--bg);
    border: var(--border) solid var(--line);
    border-radius: var(--radius-chip);
    padding: 0 var(--space-sm);
    min-width: 0;
    width: 100%;
    height: var(--control-md);
}

.form input:not([type=checkbox]):focus {
    outline: 0;
    border-color: var(--accent);
}

.form .invalid {
    border-color: var(--down);
}

.form .validation-message {
    color: var(--down);
    font-size: var(--text-xs);
}

html, body {
    margin: 0;
    min-height: 100%;
}

@media (max-width: 900px) {
    body.locked {
        overflow: hidden;
    }
}

body {
    font: var(--text-md) / var(--leading-normal) var(--font);
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--weight-semibold);
    line-height: var(--leading-snug);
    letter-spacing: var(--tracking-tight);
}

h1 {
    font-size: var(--h1);
    font-weight: var(--weight-heading);
}

h2 {
    font-size: var(--h2);
}

h3 {
    font-size: var(--h3);
}

h4 {
    font-size: var(--h4);
}

h5 {
    font-size: var(--h5);
}

h6 {
    font-size: var(--h6);
}

a {
    color: inherit;
    text-decoration: none;
}

.fresh {
    display: block;
    animation: freshen var(--duration-slow) var(--ease-glide);
}

@keyframes freshen {
    from {
        opacity: .3;
    }

    to {
        opacity: 1;
    }
}

img {
    display: block;
}

:focus-visible {
    outline: var(--outline) solid var(--focus);
    outline-offset: var(--outline-offset);
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-toast);
    padding: var(--space-sm) var(--space-md);
    background: var(--down);
    color: #fff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: var(--space-md);
    top: var(--space-sm);
}
