body {
    color-scheme: light;
    --site-background: #f7f8fa;
    --site-foreground: #24262c;
    --site-header-background: #fff;
    --site-border: #d9dce3;
    --site-control-hover: #e9edf4;
    --site-accent: light-dark(#5442a9, #c5b8ff);
    --site-accent-ink: light-dark(#fff, #221643);
    --colorBrandBackground: #5442a9;
    --colorBrandBackgroundHover: #473694;
    --colorBrandBackgroundPressed: #392b7a;
    --colorBrandBackgroundSelected: #473694;
    --colorBrandBackground2: #f1eefc;
    --colorBrandBackground2Hover: #e4defa;
    --colorBrandBackground2Pressed: #d4cbf6;
    --colorBrandForeground1: #5442a9;
    --colorBrandForeground2: #473694;
    --colorBrandForegroundLink: #5442a9;
    --colorBrandForegroundLinkHover: #473694;
    --colorBrandForegroundLinkPressed: #392b7a;
    --colorBrandStroke1: #5442a9;
    --colorBrandStroke2: #c5b8ff;
    --colorCompoundBrandBackground: #5442a9;
    --colorCompoundBrandBackgroundHover: #473694;
    --colorCompoundBrandBackgroundPressed: #392b7a;
    --colorCompoundBrandForeground1: #5442a9;
    --colorCompoundBrandForeground1Hover: #473694;
    --colorCompoundBrandForeground1Pressed: #392b7a;
    --colorCompoundBrandStroke: #5442a9;
    --colorCompoundBrandStrokeHover: #473694;
    --colorCompoundBrandStrokePressed: #392b7a;
    --colorNeutralForegroundOnBrand: #fff;
    margin: 0;
    min-height: 100dvh;
    background: var(--site-background);
    color: var(--site-foreground);
}

body[data-theme="dark"] {
    color-scheme: dark;
    --site-background: #17191d;
    --site-foreground: #edf0f5;
    --site-header-background: #202328;
    --site-border: #3a3e47;
    --site-control-hover: #343a45;
    --colorBrandBackground: #6b57c7;
    --colorBrandBackgroundHover: #7b68d4;
    --colorBrandBackgroundPressed: #5946b0;
    --colorBrandBackgroundSelected: #5946b0;
    --colorBrandBackground2: #2b2743;
    --colorBrandBackground2Hover: #363054;
    --colorBrandBackground2Pressed: #423b66;
    --colorBrandForeground1: #c5b8ff;
    --colorBrandForeground2: #d6cdff;
    --colorBrandForegroundLink: #c5b8ff;
    --colorBrandForegroundLinkHover: #d6cdff;
    --colorBrandForegroundLinkPressed: #b2a1fa;
    --colorBrandStroke1: #c5b8ff;
    --colorBrandStroke2: #5442a9;
    --colorCompoundBrandBackground: #6b57c7;
    --colorCompoundBrandBackgroundHover: #7b68d4;
    --colorCompoundBrandBackgroundPressed: #5946b0;
    --colorCompoundBrandForeground1: #c5b8ff;
    --colorCompoundBrandForeground1Hover: #d6cdff;
    --colorCompoundBrandForeground1Pressed: #b2a1fa;
    --colorCompoundBrandStroke: #c5b8ff;
    --colorCompoundBrandStrokeHover: #d6cdff;
    --colorCompoundBrandStrokePressed: #b2a1fa;
    --colorNeutralForegroundOnBrand: #fff;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44Nz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2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.site-info {
    flex: none;
    width: min(100% - 2rem, 46rem);
    margin-inline: auto;
    padding-block: clamp(1rem, 4vw, 2rem);
}

.site-info h2 {
    margin-block-start: 1.5rem;
    font-size: 1.25rem;
}

.calendar-list-page {
    --list-muted: light-dark(#555b66, #a8b0bf);
    --list-surface: var(--site-header-background);
    --list-tint: light-dark(#f0edfc, #2d2642);
    flex: none;
    width: min(100% - 2rem, 64rem);
    margin-inline: auto;
    padding-block: clamp(1rem, 3vw, 2.25rem);
    display: grid;
    gap: 1.25rem;
}

.calendar-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.calendar-list-title-group {
    display: grid;
    gap: 0.35rem;
}

.calendar-list-title-group h1 {
    margin: 0;
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.calendar-list-subtitle {
    margin: 0;
    color: var(--list-muted);
    font-size: 0.95rem;
    line-height: 1.45;
    max-inline-size: 60ch;
}

.year-switcher {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.year-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-block-size: 2.25rem;
    min-inline-size: 2.25rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--site-border);
    border-radius: 0.5rem;
    background: var(--list-surface);
    color: var(--site-foreground);
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.year-link:hover {
    background: var(--site-control-hover);
}

.year-link:focus-visible {
    outline: 2px solid var(--site-accent);
    outline-offset: 2px;
}

.year-link[aria-current="page"] {
    background: var(--site-accent);
    border-color: var(--site-accent);
    color: var(--site-accent-ink);
}

.year-link--reset {
    background: var(--list-tint);
    border-color: color-mix(in srgb, var(--site-accent) 30%, var(--site-border));
    color: var(--site-accent);
}

.calendar-list-summary {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
    gap: 0.875rem;
}

.calendar-summary-card {
    display: grid;
    align-content: start;
    gap: 0.25rem;
    padding: 1rem 1.125rem;
    border: 1px solid var(--site-border);
    border-radius: 0.875rem;
    background: var(--list-surface);
}

.calendar-summary-card--highlight {
    border-inline-start: 4px solid var(--site-accent);
}

.calendar-summary-label {
    color: var(--list-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.calendar-summary-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.calendar-summary-meta {
    color: var(--list-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.calendar-table-card {
    border: 1px solid var(--site-border);
    border-radius: 0.875rem;
    background: var(--list-surface);
    overflow: hidden;
}

.calendar-table-scroll {
    overflow-x: auto;
}

.calendar-reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.calendar-reference-table th,
.calendar-reference-table td {
    padding: 0.75rem 1rem;
    text-align: start;
    border-block-end: 1px solid var(--site-border);
    vertical-align: middle;
}

.calendar-reference-table thead th {
    background: color-mix(in srgb, var(--site-background) 65%, var(--list-surface));
    color: var(--list-muted);
    font-size: 0.8125rem;
    font-weight: 650;
    white-space: nowrap;
}

.calendar-reference-table tbody tr:last-child td {
    border-block-end: 0;
}

.calendar-reference-table tbody tr.is-today {
    background: var(--list-tint);
}

.calendar-reference-table tbody tr.is-past {
    opacity: 0.72;
}

.calendar-reference-date {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.calendar-reference-weekday {
    color: var(--list-muted);
    text-transform: capitalize;
    white-space: nowrap;
}

.calendar-reference-week {
    color: var(--list-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.calendar-reference-name {
    font-weight: 600;
}

.calendar-name-with-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.finnish-flag-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    border: 1px solid light-dark(rgb(0 0 0 / 15%), rgb(255 255 255 / 22%));
    border-radius: 2px;
    overflow: hidden;
    line-height: 0;
}

.calendar-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.calendar-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.175rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.calendar-badge--holiday {
    background: light-dark(#fdecec, #3c2329);
    color: light-dark(#b42318, #ff8a80);
}

.calendar-badge--eve {
    background: light-dark(#fef3e6, #3b2d1d);
    color: light-dark(#9a4f00, #f5b971);
}

.calendar-badge--official-flag {
    background: light-dark(#e6effe, #1e2d4a);
    color: light-dark(#003580, #93c5fd);
}

.calendar-badge--established-flag {
    background: light-dark(#eef2f7, #272d38);
    color: light-dark(#3b4454, #c5ccd9);
}

.calendar-badge--today {
    background: var(--site-accent);
    color: var(--site-accent-ink);
}

.calendar-list-info {
    display: grid;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--site-border);
    border-radius: 0.875rem;
    background: var(--list-surface);
    color: var(--list-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.calendar-list-info h2 {
    margin: 0;
    color: var(--site-foreground);
    font-size: 1.05rem;
    font-weight: 650;
}

.calendar-list-info p {
    margin: 0;
}

.calendar-list-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-block-start: 0.25rem;
}

.calendar-list-links a {
    color: var(--site-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

@media (max-width: 56rem) {
    .calendar-list-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-summary-card--highlight {
        grid-column: 1 / -1;
    }
}

@media (max-width: 48rem) {
    .calendar-list-page {
        width: calc(100% - 1.5rem);
        grid-template-columns: minmax(0, 1fr);
    }

    .calendar-list-links a {
        display: inline-flex;
        align-items: center;
        min-block-size: 2.25rem;
    }
}

@media (max-width: 40rem) {
    .year-switcher {
        gap: 0.25rem;
    }

    .year-link {
        min-inline-size: 2rem;
        min-block-size: 2.25rem;
        padding: 0.25rem 0.5rem;
        font-size: 0.84rem;
    }

    .calendar-list-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .calendar-summary-card {
        min-inline-size: 0;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .calendar-summary-card--highlight {
        grid-column: 1 / -1;
    }

    .calendar-summary-card:not(.calendar-summary-card--highlight) {
        padding: 0.7rem 0.8rem;
        gap: 0.2rem;
    }

    .calendar-summary-card:not(.calendar-summary-card--highlight) .calendar-summary-label {
        font-size: 0.78rem;
    }

    .calendar-summary-card:not(.calendar-summary-card--highlight) .calendar-summary-value {
        font-size: 1.1rem;
    }

    .calendar-summary-card:not(.calendar-summary-card--highlight) .calendar-summary-meta {
        font-size: 0.78rem;
    }

    .calendar-reference-table th,
    .calendar-reference-table td {
        padding: 0.625rem 0.75rem;
    }

    .calendar-reference-week-col {
        display: none;
    }

    .calendar-reference-table--cards-mobile thead {
        display: none;
    }

    .calendar-reference-table--cards-mobile tbody {
        display: grid;
    }

    .calendar-reference-table--cards-mobile tbody tr {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.25rem 0.5rem;
        padding: 0.75rem 0.875rem;
        border-block-end: 1px solid var(--site-border);
    }

    .calendar-reference-table--cards-mobile tbody tr:last-child {
        border-block-end: 0;
    }

    .calendar-reference-table--cards-mobile td {
        padding: 0;
        border: 0;
    }

    .calendar-reference-table--cards-mobile .calendar-reference-date {
        grid-column: 1;
        font-size: 0.875rem;
    }

    .calendar-reference-table--cards-mobile .calendar-reference-weekday {
        grid-column: 2;
        font-size: 0.875rem;
    }

    .calendar-reference-table--cards-mobile .calendar-reference-name,
    .calendar-reference-table--cards-mobile td:last-child {
        grid-column: 1 / -1;
    }

    .calendar-reference-table--cards-mobile .calendar-reference-name {
        font-size: 0.96rem;
    }

    .calendar-reference-table--cards-mobile .calendar-name-with-flag {
        flex-wrap: wrap;
    }
}
