/* ------------------------------------------------------------------
   Schulpsychologie - Terminkoordination
   ------------------------------------------------------------------ */

:root {
    --sp-primary: #1f5f8b;
    --sp-primary-dark: #174a6d;
    --sp-primary-light: #e7f0f7;
    --sp-bg: #f4f6f8;
    --sp-surface: #ffffff;
    --sp-border: #d8dee4;
    --sp-text: #1d2733;
    --sp-muted: #5f6b77;

    --sp-free: #2e7d32;
    --sp-free-bg: #edf7ee;
    --sp-booked: #1565c0;
    --sp-booked-bg: #e8f1fb;
    --sp-held: #546e7a;
    --sp-held-bg: #eef1f3;
    --sp-noshow: #a15c00;
    --sp-noshow-bg: #fdf3e3;
    --sp-cancelled: #c62828;
    --sp-cancelled-bg: #fdecec;

    --bs-primary: var(--sp-primary);
    --bs-link-color: var(--sp-primary);
    --bs-link-hover-color: var(--sp-primary-dark);
    /* Bootstrap 5.3 colours links with these - without them links stay #0d6efd (4.15:1 on the page background) */
    --bs-link-color-rgb: 31, 95, 139;
    --bs-link-hover-color-rgb: 23, 74, 109;
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body {
    background: var(--sp-bg);
    color: var(--sp-text);
}

h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0;
}

h1:focus {
    outline: none;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-primary {
    --bs-btn-bg: var(--sp-primary);
    --bs-btn-border-color: var(--sp-primary);
    --bs-btn-hover-bg: var(--sp-primary-dark);
    --bs-btn-hover-border-color: var(--sp-primary-dark);
    --bs-btn-active-bg: var(--sp-primary-dark);
    --bs-btn-disabled-bg: var(--sp-primary);
    --bs-btn-disabled-border-color: var(--sp-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--sp-primary);
    --bs-btn-border-color: var(--sp-primary);
    --bs-btn-hover-bg: var(--sp-primary);
    --bs-btn-hover-border-color: var(--sp-primary);
    --bs-btn-active-bg: var(--sp-primary-dark);
}

.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(31, 95, 139, 0.35);
    border-color: var(--sp-primary);
}

.validation-message, .validation-errors {
    color: #b3261e;
    font-size: 0.875rem;
}

.invalid {
    border-color: #b3261e;
}

/* ------------------------------------------------------------------ header */

.app-header {
    background: var(--sp-primary);
    color: #fff;
}

.app-header-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    min-height: 3.5rem;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    white-space: nowrap;
}

.app-brand:hover {
    color: #fff;
}

.app-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.18);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.app-brand-sub {
    font-weight: 400;
    opacity: 0.8;
}

.app-nav {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.25rem;
}

.app-nav form {
    margin: 0;
}

.app-nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.45rem 0.75rem;
    border-radius: 0.4rem;
    white-space: nowrap;
}

.app-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.app-nav-link.active {
    color: #fff;
    background: var(--sp-primary-dark);
}

.app-nav-button {
    background: none;
    border: 0;
    font: inherit;
}

.app-nav-spacer {
    flex: 1;
}

.app-nav-user {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* the person icon tells the account link apart from the logo */
.app-nav-user .icon {
    margin-right: 0.35rem;
    vertical-align: -0.1em;
}

.app-nav-user-hint {
    display: none;
}

.nav-toggle,
.nav-toggle-label {
    display: none;
}

@media (max-width: 991.98px) {
    /* The header stays visible while scrolling through long lists */
    .app-header {
        position: sticky;
        top: 0;
        z-index: 1020;
    }

    html {
        scroll-padding-top: 4.5rem;
    }

    .app-header-inner {
        position: relative;
        flex-wrap: nowrap;
        min-height: 3.25rem;
    }

    .app-brand {
        min-width: 0;
    }

    .app-brand > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-toggle-label {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        flex-shrink: 0;
        margin: 0 0 0 auto;
        min-height: 2.5rem;
        padding: 0.35rem 0.8rem;
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 0.4rem;
        cursor: pointer;
        user-select: none;
    }

    .nav-toggle:checked + .nav-toggle-label {
        background: rgba(255, 255, 255, 0.18);
    }

    /* Opened menu: a panel below the header bar, over the page */
    .app-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        max-height: calc(100vh - 3.25rem);
        max-height: calc(100dvh - 3.25rem);
        overflow-y: auto;
        padding: 0.25rem 0.75rem 0.75rem;
        background: var(--sp-primary);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    .app-nav-user-hint {
        display: inline;
        opacity: 0.75;
    }

    .app-nav-user {
        max-width: none;
    }

    .nav-toggle:checked ~ .app-nav {
        display: flex;
    }

    .app-nav-spacer {
        display: none;
    }

    .app-nav-link {
        display: block;
        text-align: left;
        width: 100%;
        padding: 0.7rem 0.75rem;
    }
}

/* Small laptops and landscape tablets: the full menu fits in one row without the subtitle */
@media (min-width: 992px) and (max-width: 1279.98px) {
    .app-header-inner {
        column-gap: 0.75rem;
    }

    .app-nav {
        gap: 0.1rem;
    }

    .app-nav-link {
        padding: 0.45rem 0.55rem;
    }
}

@media (min-width: 992px) and (max-width: 1079.98px) {
    .app-header-inner {
        column-gap: 0.5rem;
    }

    .app-nav-link {
        padding: 0.45rem 0.4rem;
    }
}

@media (max-width: 1279.98px) {
    .app-brand-sub {
        display: none;
    }
}

/* Very narrow phones: the menu button shows only its icon, so the full name fits */
@media (max-width: 374.98px) {
    .app-header-inner {
        column-gap: 0.5rem;
    }

    .nav-toggle-text {
        display: none;
    }

    .nav-toggle-label {
        padding: 0.35rem 0.7rem;
    }

    .app-brand {
        gap: 0.45rem;
    }
}

/* ------------------------------------------------------------------ page */

.app-main {
    padding: 1.5rem 0 3rem;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.page-header .page-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.page-lead {
    color: var(--sp-muted);
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
}

.card-panel {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 0.6rem;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.card-panel > h2 {
    margin-bottom: 0.9rem;
}

/* Head of a list card: title on the left, its actions ("+ … anlegen") on the right - the same on every list page */
.card-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card-head h2 {
    margin-bottom: 0;
}

.card-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--sp-border);
    margin-bottom: 1.25rem;
}

.tabs a {
    padding: 0.5rem 0.9rem;
    text-decoration: none;
    color: var(--sp-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.tabs a:hover {
    color: var(--sp-text);
}

.tabs a.active {
    color: var(--sp-primary);
    border-bottom-color: var(--sp-primary);
    font-weight: 600;
}

.tab-short {
    display: none;
}

@media (max-width: 575.98px) {
    .tab-long {
        display: none;
    }

    .tab-short {
        display: inline;
    }
}

@media (max-width: 767.98px) {
    .app-main {
        padding-top: 1rem;
    }

    h1 {
        font-size: 1.4rem;
    }

    .page-header {
        margin-bottom: 1rem;
    }

    .card-panel {
        padding: 1rem;
    }

    /* tabs in one row that can be swiped instead of wrapping */
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tabs a {
        flex-shrink: 0;
        padding: 0.6rem 0.65rem;
        white-space: nowrap;
    }
}

.table {
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    padding: 0.55rem 0.6rem;
}

.table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sp-muted);
    font-weight: 600;
}

/* Phones: each table row becomes a small card, the column name in front of each value */
@media screen and (max-width: 767.98px) {
    .table-stack thead {
        display: none;
    }

    .table-stack,
    .table-stack > tbody,
    .table-stack > tbody > tr,
    .table-stack > tbody > tr > td {
        display: block;
        width: 100%;
    }

    .table-stack > tbody > tr {
        padding: 0.7rem 0;
        border-bottom: 1px solid var(--sp-border);
    }

    .table-stack > tbody > tr:first-child {
        padding-top: 0;
    }

    .table-stack > tbody > tr:last-child {
        border-bottom: 0;
        padding-bottom: 0;
    }

    .table-stack.table {
        margin-bottom: 0.5rem;
    }

    .table-stack.table > :not(caption) > * > * {
        padding: 0.12rem 0;
        border-bottom-width: 0;
    }

    /* The label floats in the left padding; flow-root makes the row as tall as a wrapped label */
    .table-stack > tbody > tr > td[data-label] {
        display: flow-root;
        padding-left: 7.5rem;
    }

    .table-stack > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        float: left;
        width: 7rem;
        margin-left: -7.5rem;
        color: var(--sp-muted);
        font-size: 0.85rem;
        font-weight: 400;
        line-height: 1.5rem;
    }

    .table-stack > tbody > tr > td:empty {
        display: none;
    }

    .table-stack > tbody > tr > td.text-end {
        text-align: left !important;
    }

    .table-stack > tbody > tr > td.cell-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        padding-top: 0.5rem;
        white-space: normal !important;
    }

    /* rows that only hold an inline form (series, user actions) */
    .table-stack > tbody > tr.row-detail {
        padding: 0.75rem;
        margin-bottom: 0.7rem;
        border: 1px solid var(--sp-border);
        border-radius: 0.5rem;
        background: #f8f9fa;
    }

    .table-stack > tbody > tr.row-detail > td {
        background: transparent !important;
    }
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--sp-muted);
}

/* Date field with calendar (InputDay) - the browser's own date field follows the browser language */
.date-field {
    position: relative;
}

.date-field-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
}

.date-field-popup {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 1041;
    width: 17.5rem;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.date-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.date-field-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.date-field-weekday {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sp-muted);
    padding: 0.25rem 0;
}

.date-field-day {
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--sp-text);
    padding: 0.35rem 0;
    font-size: 0.9rem;
    line-height: 1.2;
}

.date-field-day:hover,
.date-field-day:focus-visible {
    background: var(--sp-primary-light);
}

.date-field-day.other {
    color: var(--sp-muted);
}

.date-field-day.today {
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--sp-primary);
}

.date-field-day.selected {
    background: var(--sp-primary);
    color: #fff;
    opacity: 1;
}

.date-field-foot {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.empty-state {
    color: var(--sp-muted);
    padding: 1.5rem 0;
    text-align: center;
}

.chip {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--sp-held-bg);
    color: var(--sp-held);
    white-space: nowrap;
}

.chip-free { background: var(--sp-free-bg); color: var(--sp-free); }
.chip-booked { background: var(--sp-booked-bg); color: var(--sp-booked); }
.chip-held { background: var(--sp-held-bg); color: var(--sp-held); }
.chip-noshow { background: var(--sp-noshow-bg); color: var(--sp-noshow); }
.chip-cancelled { background: var(--sp-cancelled-bg); color: var(--sp-cancelled); }
.chip-info { background: var(--sp-primary-light); color: var(--sp-primary); }

.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------ calendar (month view) */

.cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.cal-toolbar .form-control,
.cal-toolbar .form-select {
    width: auto;
}

.cal-step {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 575.98px) {
    .cal-toolbar,
    .cal-step {
        flex: 1 1 100%;
    }

    .cal-toolbar .cal-step .form-select {
        flex: 1;
        min-width: 0;
        font-weight: 600;
    }

    .cal-toolbar > .btn {
        flex: 1 1 0;
    }

    .cal-toolbar > .form-select {
        flex: 1 1 100%;
        width: 100%;
    }
}

.cal-label {
    font-weight: 600;
    font-size: 1.15rem;
    margin: 0 0.25rem;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: var(--sp-muted);
    margin-bottom: 1rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-swatch {
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 0.2rem;
    border-left: 4px solid;
}

.month-grid {
    display: grid;
    grid-template-columns: 2.4rem repeat(var(--days, 5), minmax(0, 1fr));
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 0.6rem;
}

.month-head {
    padding: 0.45rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sp-muted);
    background: #f8f9fa;
    border-bottom: 1px solid var(--sp-border);
}

.month-head.month-corner {
    text-align: center;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    border-right: 1px solid var(--sp-border);
    border-top-left-radius: 0.6rem;
}

.month-head.last-col {
    border-top-right-radius: 0.6rem;
}

.month-week {
    padding: 0.45rem 0.2rem;
    font-size: 0.75rem;
    color: var(--sp-muted);
    text-align: center;
    background: #fbfcfd;
    border-right: 1px solid var(--sp-border);
    border-bottom: 1px solid #e9edf1;
}

.month-week.last-row {
    border-bottom: 0;
    border-bottom-left-radius: 0.6rem;
}

.month-day {
    position: relative;
    min-width: 0;
    min-height: 6.5rem;
    padding: 0.3rem 0.35rem 0.45rem;
    border-right: 1px solid #e9edf1;
    border-bottom: 1px solid #e9edf1;
}

.month-day.last-col {
    border-right: 0;
}

.month-day.last-row {
    border-bottom: 0;
}

.month-day.last-row.last-col {
    border-bottom-right-radius: 0.6rem;
}

.month-day.other-month {
    background: #fafbfc;
}

.month-day.other-month .month-day-number,
.month-day.other-month .mblock {
    opacity: 0.7;
}

/* free slots of past days cannot be booked any more - same dimming as the neighbouring months */
.month-day.past .mblock.block-free {
    opacity: 0.7;
}

.month-day.closed {
    background: repeating-linear-gradient(135deg, #f7f8f9, #f7f8f9 8px, #f0f2f4 8px, #f0f2f4 16px);
}

.month-day-top {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.7rem;
}

.month-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.month-day.today .month-day-number {
    background: var(--sp-primary);
    color: #fff;
}

.month-day-label {
    flex: 1;
    min-width: 0;
    font-size: 0.72rem;
    font-style: italic;
    color: var(--sp-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.month-day-tools {
    margin-left: auto;
}

.month-day .day-menu {
    top: 2.1rem;
    right: 0.3rem;
}

.day-menu-button {
    border: 1px solid transparent;
    background: none;
    border-radius: 0.35rem;
    padding: 0 0.35rem;
    line-height: 1.4;
    color: var(--sp-muted);
}

.day-menu-button:hover,
.day-menu-button:focus-visible {
    border-color: var(--sp-border);
    color: var(--sp-text);
}

.day-menu {
    position: absolute;
    right: 0;
    top: 1.8rem;
    z-index: 20;
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    min-width: 13rem;
    padding: 0.3rem 0;
}

.day-menu button,
.day-menu a {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 0.4rem 0.9rem;
    color: var(--sp-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.day-menu button:hover,
.day-menu a:hover {
    background: var(--sp-bg);
}

/* closes the day menu when clicking anywhere else */
.day-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 15;
}

.day-menu-title,
.day-menu .day-menu-cancel {
    display: none;
}

/* with "Alle Schulen": which school the day actions apply to, or why there are none */
.day-menu-school,
.day-menu-hint {
    padding: 0.3rem 0.9rem;
    font-size: 0.8rem;
    color: var(--sp-muted);
}

.day-menu-hint {
    max-width: 16rem;
}

/* one appointment in the month view */
.mblock {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    min-width: 0;
    margin-top: 0.2rem;
    padding: 0.12rem 0.35rem;
    border: 0;
    border-left: 3px solid var(--sp-free);
    border-radius: 0.3rem;
    background: var(--sp-free-bg);
    color: var(--sp-text);
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.mblock:hover,
.mblock:focus-visible {
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
    outline: none;
}

.mblock-time {
    flex-shrink: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mblock-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mblock-icon {
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.7;
}

.mblock-icon + .mblock-icon {
    margin-left: 0;
}

.mblock.is-new {
    box-shadow: inset 0 0 0 1.5px #f2b705;
}

/* :is() raises the weight, so the colours also win over the agenda entries' own rule further down */
:is(.mblock, .ablock).block-free { border-left-color: var(--sp-free); background: var(--sp-free-bg); }
:is(.mblock, .ablock).block-booked { border-left-color: var(--sp-booked); background: var(--sp-booked-bg); }
:is(.mblock, .ablock).block-held { border-left-color: var(--sp-held); background: var(--sp-held-bg); }
:is(.mblock, .ablock).block-noshow { border-left-color: var(--sp-noshow); background: var(--sp-noshow-bg); }
:is(.mblock, .ablock).block-cancelled { border-left-color: var(--sp-cancelled); background: var(--sp-cancelled-bg); }
.block-cancelled .mblock-time { text-decoration: line-through; }

.mblock .badge-new {
    flex-shrink: 0;
    font-size: 0.65rem;
    line-height: 1.4;
}

.badge-new {
    background: #f2b705;
    color: #2b2100;
    border-radius: 999px;
    padding: 0 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ------------------------------------------------------------------ agenda (phones and small tablets) */

.agenda,
.agenda-footer {
    display: none;
}

@media (max-width: 991.98px) {
    .month-grid,
    .legend,
    .cal-label {
        display: none;
    }

    .agenda {
        display: block;
    }

    .agenda-past-toggle {
        display: block;
        width: 100%;
        margin-bottom: 0.75rem;
        padding: 0.6rem;
        border: 1px dashed var(--sp-border);
        border-radius: 0.6rem;
        background: transparent;
        color: var(--sp-primary);
        font-size: 0.92rem;
    }

    .agenda-day {
        margin-bottom: 0.75rem;
        padding: 0.65rem 0.65rem 0.7rem;
        background: var(--sp-surface);
        border: 1px solid var(--sp-border);
        border-radius: 0.75rem;
    }

    .agenda-day.today {
        border-color: var(--sp-primary);
        box-shadow: 0 0 0 1px var(--sp-primary);
    }

    .agenda-day.past .agenda-date {
        background: var(--sp-held-bg);
        color: var(--sp-muted);
    }

    .agenda-day-head {
        position: relative;
        display: flex;
        align-items: center;
        gap: 0.7rem;
    }

    .agenda-date {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 2.9rem;
        height: 2.9rem;
        border-radius: 0.6rem;
        background: var(--sp-primary-light);
        color: var(--sp-primary);
        line-height: 1;
    }

    .agenda-day.today .agenda-date {
        background: var(--sp-primary);
        color: #fff;
    }

    .agenda-date-day {
        font-size: 1.2rem;
        font-weight: 700;
    }

    .agenda-date-month {
        margin-top: 0.15rem;
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .agenda-day-title {
        flex: 1;
        min-width: 0;
    }

    .agenda-weekday {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        font-weight: 600;
    }

    .agenda-day-sub {
        font-size: 0.85rem;
        color: var(--sp-muted);
    }

    .agenda-free {
        color: var(--sp-free);
        font-weight: 600;
    }

    .agenda-day-tools {
        flex-shrink: 0;
    }

    /* one appointment in the agenda */
    .ablock {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
        min-height: 3.25rem;
        margin-top: 0.45rem;
        padding: 0.45rem 0.6rem 0.45rem 0.7rem;
        border: 0;
        border-left: 4px solid var(--sp-free);
        border-radius: 0.45rem;
        background: var(--sp-free-bg);
        color: var(--sp-text);
        text-align: left;
        line-height: 1.3;
    }

    .ablock:active {
        filter: brightness(0.96);
    }

    .ablock:focus-visible {
        outline: 2px solid var(--sp-primary);
        outline-offset: 1px;
    }

    .ablock.is-new {
        box-shadow: inset 0 0 0 1.5px #f2b705;
    }

    .ablock-time {
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        width: 2.9rem;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

    .ablock-end {
        font-size: 0.78rem;
        font-weight: 400;
        color: var(--sp-muted);
    }

    .block-cancelled .ablock-time > :first-child,
    .block-cancelled .ablock-title {
        text-decoration: line-through;
    }

    .ablock-main {
        display: flex;
        flex: 1;
        flex-direction: column;
        min-width: 0;
    }

    .ablock-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .block-booked .ablock-title,
    .block-held .ablock-title,
    .block-noshow .ablock-title {
        font-weight: 600;
    }

    .ablock-sub {
        font-size: 0.8rem;
        color: var(--sp-muted);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ablock-side {
        display: flex;
        align-items: center;
        gap: 0.4rem;
        flex-shrink: 0;
        color: var(--sp-muted);
    }

    .ablock-icon {
        opacity: 0.75;
    }

    .ablock-chevron {
        font-size: 0.8rem;
        opacity: 0.6;
    }

    .ablock-book {
        padding: 0.25rem 0.65rem;
        border-radius: 999px;
        background: var(--sp-free);
        color: #fff;
        font-size: 0.8rem;
        font-weight: 600;
    }

    .agenda-footer {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.25rem;
    }

    .agenda-footer > .btn {
        flex: 1 1 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
    }

    .agenda-footer > .agenda-footer-wide {
        flex-basis: 100%;
    }

    .day-menu-button {
        min-width: 2.5rem;
        min-height: 2.5rem;
        border-color: var(--sp-border);
    }

    /* day menu as a sheet at the bottom of the screen */
    .day-menu-backdrop {
        z-index: 1040;
        background: rgba(17, 24, 39, 0.45);
    }

    .day-menu {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1045;
        min-width: 0;
        max-height: 85vh;
        overflow-y: auto;
        padding: 0.5rem 0.5rem calc(0.75rem + env(safe-area-inset-bottom));
        border: 0;
        border-radius: 1rem 1rem 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    }

    .day-menu-head {
        padding: 0.6rem 1rem 0.5rem;
        border-bottom: 1px solid var(--sp-border);
        margin-bottom: 0.3rem;
    }

    .day-menu-title {
        display: block;
        font-weight: 600;
    }

    .day-menu-school {
        padding: 0;
        font-size: 0.9rem;
    }

    .day-menu-hint {
        max-width: none;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }

    .day-menu button,
    .day-menu a {
        padding: 0.8rem 1rem;
        border-radius: 0.5rem;
        font-size: 1rem;
    }

    .day-menu .day-menu-cancel {
        display: block;
        margin-top: 0.3rem;
        border-top: 1px solid var(--sp-border);
        border-radius: 0;
        text-align: center;
        color: var(--sp-muted);
    }
}

/* ------------------------------------------------------------------ dialogs */

.modal.d-block {
    background: rgba(17, 24, 39, 0.45);
    overflow-y: auto;
}

/* the page behind an open dialog does not scroll */
body:has(.modal.d-block) {
    overflow: hidden;
}

/* A form around header, body and footer of a scrollable dialog: only the body scrolls */
.modal-dialog-scrollable .modal-form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.modal-dialog-scrollable .modal-form > .modal-body {
    flex: 1 1 auto;
}

@media (max-width: 575.98px) {
    /* buttons fill the footer in rows, easy to hit with a thumb */
    .modal-footer > .btn {
        flex: 1 1 auto;
    }

    .modal-footer > .btn.me-auto {
        margin-right: 0.25rem !important;
    }
}

.modal-content {
    border-radius: 0.75rem;
    border: 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
    align-items: flex-start;
}

.modal-subtitle {
    color: var(--sp-muted);
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

.dialog-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.dialog-note {
    background: var(--sp-primary-light);
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

fieldset.form-section {
    border: 1px solid var(--sp-border);
    border-radius: 0.6rem;
    padding: 0.9rem 1rem 0.4rem;
    margin-bottom: 1rem;
}

fieldset.form-section > legend {
    float: none;
    width: auto;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0 0.4rem;
    margin-bottom: 0;
}

fieldset.form-section.internal {
    background: #fbfaf4;
    border-color: #e6dfbf;
}

.privacy-hint {
    font-size: 0.82rem;
    color: var(--sp-muted);
}

.audit-info {
    font-size: 0.85rem;
    color: var(--sp-muted);
    border-top: 1px solid var(--sp-border);
    padding-top: 0.75rem;
}

.history {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}

.history > li {
    border-left: 3px solid var(--sp-border);
    padding: 0.15rem 0 0.5rem 0.7rem;
}

.history-head time {
    font-variant-numeric: tabular-nums;
    color: var(--sp-muted);
}

.history-changes {
    margin: 0.15rem 0 0;
    padding-left: 1rem;
    color: var(--sp-muted);
}

.history-changes .old {
    text-decoration: line-through;
}

.password-box {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    background: var(--sp-bg);
    border: 1px dashed var(--sp-border);
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    text-align: center;
    user-select: all;
}

/* Stacked columns: the cards' own margin separates them, no extra row gutter */
@media (max-width: 991.98px) {
    .row.g-4 {
        --bs-gutter-y: 0;
    }
}

/* Buttons below a form */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Small square button with an icon (e.g. "more actions") */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    vertical-align: top;
}

/* As tall as a line of text, so the button matches the text buttons next to it */
.btn-icon > .icon {
    height: calc(var(--bs-btn-line-height) * 1em);
}

@media (max-width: 575.98px) {
    .form-actions > .btn {
        flex: 1 1 0;
    }
}

@media screen and (max-width: 767.98px) {
    .table-stack .cell-actions > .btn {
        flex: 1 1 auto;
    }

    .table-stack .cell-actions > .btn-icon {
        flex: 0 0 auto;
        min-width: 2.75rem;
    }
}

/* ------------------------------------------------------------------ touch */

/* Touch screens keep :hover after a tap - buttons would stay highlighted */
@media (hover: none) {
    .btn:hover:not(:active):not(.active):not(.btn-check + .btn) {
        color: var(--bs-btn-color);
        background-color: var(--bs-btn-bg);
        border-color: var(--bs-btn-border-color);
    }
}

/* Fingers need bigger targets than a mouse pointer */
@media (pointer: coarse) {
    .btn-sm {
        --bs-btn-padding-y: 0.4rem;
        --bs-btn-padding-x: 0.75rem;
        --bs-btn-font-size: 0.9rem;
    }

    .form-check-input {
        width: 1.2rem;
        height: 1.2rem;
        margin-top: 0.15rem;
    }

    .form-check {
        min-height: 2rem;
    }

    .form-check-label {
        padding-left: 0.25rem;
    }

    .list-plain > li > a {
        display: inline-block;
        padding: 0.2rem 0;
    }

    /* month view on touch tablets: at least 24 px per entry */
    .mblock {
        min-height: 1.75rem;
        margin-top: 0.3rem;
    }
}

/* ------------------------------------------------------------------ dashboard */

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
    gap: 1.25rem;
}

.dash-grid .card-panel {
    margin-bottom: 0;
}

.list-plain {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-plain > li {
    padding: 0.45rem 0;
    border-bottom: 1px solid #eef1f3;
}

.list-plain > li:last-child {
    border-bottom: 0;
}

.stat {
    font-size: 2rem;
    font-weight: 700;
    color: var(--sp-primary);
    line-height: 1;
}

.steps {
    padding-left: 1.2rem;
    margin: 0;
}

.steps li {
    margin-bottom: 0.35rem;
}

.steps li.done {
    color: var(--sp-muted);
    text-decoration: line-through;
}

/* ------------------------------------------------------------------ planning preview */

.preview-days {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
    gap: 0.5rem;
    max-height: 26rem;
    overflow-y: auto;
}

@media (max-width: 991.98px) {
    /* no scroll area inside the scrolling page */
    .preview-days {
        max-height: none;
    }
}

.preview-day {
    border: 1px solid var(--sp-border);
    border-radius: 0.45rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    background: var(--sp-surface);
}

.preview-day.skipped {
    background: #f6f6f6;
    color: var(--sp-muted);
}

.preview-slot.overlap {
    color: var(--sp-cancelled);
    text-decoration: line-through;
}

/* ------------------------------------------------------------------ account / login */

.auth-wrap {
    max-width: 28rem;
    margin: 2rem auto;
}

.auth-card {
    background: var(--sp-surface);
    border: 1px solid var(--sp-border);
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.auth-card h1 {
    margin-bottom: 1rem;
}

@media (max-width: 575.98px) {
    .auth-wrap {
        margin: 0.5rem auto;
    }

    .auth-card {
        padding: 1.25rem;
    }
}

.recovery-code {
    font-size: 1.1rem;
}

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

/* ------------------------------------------------------------------ info card & rich text */

.info-card {
    border-left: 5px solid var(--sp-primary);
}

.rich-text {
    overflow-wrap: anywhere;
}

.rich-text > :last-child {
    margin-bottom: 0;
}

.rich-text h2 {
    font-size: 1.15rem;
    margin-top: 0.7rem;
    margin-bottom: 0.2rem;
}

.rich-text h3 {
    font-size: 1.02rem;
    font-weight: 600;
    margin-top: 0.7rem;
    margin-bottom: 0.2rem;
}

.rich-text > h2:first-child,
.rich-text > h3:first-child {
    margin-top: 0;
}

/* Quill stores every line as its own paragraph - same spacing as in the editor */
.rich-text p {
    margin: 0;
}

.rich-text p:empty {
    min-height: 1.5em;
}

.rich-text ul,
.rich-text ol {
    padding-left: 1.4rem;
    margin: 0.2rem 0;
}

.rich-text blockquote {
    border-left: 3px solid var(--sp-border);
    padding: 0.2rem 0 0.2rem 0.8rem;
    color: var(--sp-muted);
    margin: 0 0 0.6rem;
}

/* Quill editor */
.rte .ql-toolbar.ql-snow {
    border-color: var(--sp-border);
    border-radius: 0.45rem 0.45rem 0 0;
    background: #f8f9fa;
}

.rte .ql-container.ql-snow {
    border-color: var(--sp-border);
    border-radius: 0 0 0.45rem 0.45rem;
    font-family: inherit;
    font-size: 1rem;
    background: var(--sp-surface);
}

.rte .ql-editor {
    min-height: 16rem;
    line-height: 1.5;
}

.rte .ql-editor h2 {
    font-size: 1.15rem;
}

.rte .ql-editor h3 {
    font-size: 1.02rem;
}

.rte .ql-editor.ql-blank::before {
    font-style: normal;
    color: var(--sp-muted);
}

.rte .ql-snow .ql-tooltip::before { content: "Link:"; }
.rte .ql-snow .ql-tooltip[data-mode=link]::before { content: "Adresse:"; }
.rte .ql-snow .ql-tooltip a.ql-action::after { content: "Ändern"; }
.rte .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Übernehmen"; }
.rte .ql-snow .ql-tooltip a.ql-remove::before { content: "Entfernen"; }
.rte .ql-snow .ql-picker.ql-header .ql-picker-label::before,
.rte .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Normal"; }
.rte .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.rte .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "Überschrift"; }
.rte .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.rte .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "Zwischentitel"; }
.rte .ql-snow .ql-picker.ql-header {
    width: 8.5rem;
}

/* ------------------------------------------------------------------ Schüler-Anmeldung (staff pages) */

.switch-panel {
    border-left: 5px solid var(--sp-border);
}

.switch-panel.is-on {
    border-left-color: var(--sp-free);
}

.switch-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.switch-head h2 {
    margin-bottom: 0;
}

/* On/off switch in the card head: the state is shown once, next to the control */
.switch-head {
    flex-wrap: wrap;
    align-items: center;
}

.switch-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding-left: 0;
    min-height: 0;
}

.switch-toggle .form-check-input {
    float: none;
    margin: 0;
    width: 2.75rem;
    height: 1.5rem;
    cursor: pointer;
}

.switch-toggle .form-check-input:checked {
    background-color: var(--sp-free);
    border-color: var(--sp-free);
}

.switch-toggle .form-check-label {
    font-weight: 600;
    cursor: pointer;
}

.switch-state {
    margin-bottom: 0.75rem;
}

.notice-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.notice-list > li {
    background: var(--sp-noshow-bg);
    border-radius: 0.5rem;
    padding: 0.55rem 0.8rem;
    margin-top: 0.5rem;
    font-size: 0.92rem;
}

.howto {
    padding-left: 1.3rem;
    margin-bottom: 1rem;
}

.howto > li {
    margin-bottom: 0.5rem;
}

.layout-choice {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(13rem, 100%), 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.layout-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border: 1px solid var(--sp-border);
    border-radius: 0.6rem;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
    margin: 0;
}

.layout-option:has(input:checked) {
    border-color: var(--sp-primary);
    box-shadow: 0 0 0 1px var(--sp-primary);
    background: var(--sp-primary-light);
}

.layout-option input {
    margin-top: 0.25rem;
}

.layout-option strong {
    display: block;
}

.layout-option span {
    font-size: 0.85rem;
    color: var(--sp-muted);
}

.code-result {
    border-top: 1px solid var(--sp-border);
    margin-top: 1rem;
    padding-top: 1rem;
}

/* Download again, lock, delete: equally wide below each other on wide screens, side by side on phones */
.print-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 9.5rem;
    margin-left: auto;
}

.print-actions > .btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

@media screen and (max-width: 767.98px) {
    .print-actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        margin-left: 0;
    }

    .print-actions > .btn {
        flex: 1 1 0;
        justify-content: center;
    }
}

/* ------------------------------------------------------------------ Schüler-Anmeldung (pages for students) */

@font-face {
    font-family: "Nunito";
    src: url("fonts/Nunito-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Nunito";
    src: url("fonts/Nunito-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

.student-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: #f6f8fb;
    font-family: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 1.05rem;
}

.student-container {
    max-width: 34rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.student-header {
    background: var(--sp-surface);
    border-bottom: 1px solid var(--sp-border);
    padding: 0.7rem 0;
}

.student-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--sp-primary);
}

.student-logo {
    width: 2rem;
    height: 1.6rem;
}

.student-main {
    flex: 1;
    padding: 1.25rem 0 2rem;
}

.student-footer {
    padding: 1rem 0 calc(1.5rem + env(safe-area-inset-bottom));
    font-size: 0.9rem;
    color: var(--sp-muted);
    background: var(--sp-surface);
    border-top: 1px solid var(--sp-border);
}

/* "Datenschutz": 44 px touch height (the phone numbers stay inline in their sentence) */
.student-footer .student-container > a {
    display: inline-block;
    padding: 0.6rem 0;
}

.student-hero {
    margin-bottom: 1.1rem;
}

.student-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.45rem;
}

.student-accent {
    color: var(--sp-primary);
}

/* The school as a label line - school names don't fit into a sentence ("an der …" / "am …") */
.student-school {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sp-primary);
    margin-bottom: 0.35rem;
}

.student-hero-art {
    display: block;
    width: 7rem;
    margin-bottom: 0.75rem;
}

.student-lead {
    font-size: 1.1rem;
    margin-bottom: 0;
}

.student-text {
    margin-bottom: 1rem;
}

.student-tip {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--sp-muted);
}

.student-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 2.75rem; /* 44 px touch target */
    margin-bottom: 0.25rem;
    color: var(--sp-primary);
    font-weight: 700;
    text-decoration: none;
}

.student-card {
    background: var(--sp-surface);
    border-radius: 1rem;
    padding: 1.1rem 1.15rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 14px rgba(16, 24, 40, 0.05);
}

.student-card h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.student-btn {
    display: block;
    width: 100%;
    margin-bottom: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.student-actions {
    margin-bottom: 1rem;
}

.student-actions .btn-link {
    display: block;
    width: 100%;
    text-align: center;
}

.student-promises {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1.1rem;
    padding: 0;
    list-style: none;
}

.student-promises li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--sp-primary-light);
    color: var(--sp-primary-dark);
    font-size: 0.95rem;
    font-weight: 700;
}

.student-message {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.8rem;
}

.student-message.is-success { background: var(--sp-free-bg); color: #1e5a22; }
.student-message.is-warning { background: var(--sp-noshow-bg); color: #6d3f00; }
.student-message.is-error { background: var(--sp-cancelled-bg); color: #8e1c1c; }

.student-preview {
    margin-bottom: 1rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid #f2d57e;
    border-radius: 0.8rem;
    background: #fff3cd;
    color: #5c4400;
    font-size: 0.95rem;
}

.appointment-card {
    border-left: 6px solid var(--sp-primary);
}

.appointment-card.is-previous {
    border-left-color: var(--sp-border);
    color: var(--sp-muted);
}

.appointment-caption {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sp-muted);
}

.appointment-date {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

.appointment-time {
    font-size: 1.15rem;
}

.appointment-room {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
    color: var(--sp-muted);
}

.slot-day {
    margin-bottom: 1.1rem;
}

.slot-day h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.5rem;
}

.slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 3.5rem;
    padding: 0.55rem 0.5rem;
    border: 2px solid var(--sp-free);
    border-radius: 0.8rem;
    background: var(--sp-surface);
    color: var(--sp-text);
    text-align: center;
    text-decoration: none;
}

.slot:hover,
.slot:focus-visible {
    background: var(--sp-free-bg);
    color: var(--sp-text);
}

.slot-time {
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.slot-room {
    font-size: 0.82rem;
    color: var(--sp-muted);
}

.student-form .form-label {
    font-weight: 700;
}

.student-done {
    text-align: center;
}

.student-done-icon {
    display: inline-grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    margin-bottom: 0.6rem;
    border-radius: 50%;
    background: var(--sp-free);
    color: #fff;
    font-size: 2rem;
}

.student-notice .rich-text ul {
    padding-left: 1.2rem;
}

.student-notice .rich-text li {
    margin-bottom: 0.35rem;
}

/* ------------------------------------------------------------------ print */

.print-day {
    margin-bottom: 1.5rem;
    break-inside: avoid;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.print-table th,
.print-table td {
    border: 1px solid #bfc6cd;
    padding: 0.35rem 0.5rem;
    vertical-align: top;
}

.print-table th {
    background: #f1f3f5;
    text-align: left;
}

.print-only {
    display: none;
}

/* Phones (screen only): one card per appointment instead of a wide table */
@media screen and (max-width: 767.98px) {
    .print-table.table-stack > tbody > tr,
    .print-table.table-stack > tbody > tr:first-child,
    .print-table.table-stack > tbody > tr:last-child {
        margin-bottom: 0.5rem;
        padding: 0.6rem 0.75rem;
        border: 1px solid var(--sp-border);
        border-radius: 0.5rem;
        background: var(--sp-surface);
    }

    .print-table.table-stack > tbody > tr > td {
        border: 0;
        padding-top: 0.1rem;
        padding-bottom: 0.1rem;
        padding-right: 0;
    }

    .print-table.table-stack > tbody > tr > td:not([data-label]) {
        padding-left: 0;
        font-weight: 600;
    }
}

@media print {
    @page {
        margin: 1.5cm;

        /* On every page of a list with student names (Chromium 131+; other browsers show it in the header and at the end) */
        @bottom-center {
            content: "Vertraulich – enthält personenbezogene Daten von Schüler:innen. Bitte nach Gebrauch vernichten.";
            font-size: 8pt;
        }
    }

    html, body {
        background: #fff;
    }

    .app-header,
    .d-print-none,
    #blazor-error-ui,
    #components-reconnect-modal {
        display: none !important;
    }

    .app-main {
        padding: 0;
    }

    .print-only {
        display: block;
    }

    .card-panel {
        border: 0;
        padding: 0;
    }

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

/* ------------------------------------------------------------------ blazor */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.35rem;
    border: 0;
    background: none;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem 0.4rem;
    color: inherit;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1.25rem;
    color: white;
    border-radius: 0.5rem;
}

.blazor-error-boundary::after {
    content: "Es ist ein Fehler aufgetreten.";
}

/* ------------------------------------------------------------------ contrast (WCAG AA) */

/* unchecked boxes: border 3.7:1 instead of Bootstrap's 1.3:1; checked ones in the app colour, not Bootstrap blue */
.form-check-input {
    border-color: #7b8794;
}

.form-check-input:checked {
    background-color: var(--sp-primary);
    border-color: var(--sp-primary);
}

/* text of outline buttons on the page background: 5.0:1 instead of 4.3:1 */
.btn-outline-secondary {
    --bs-btn-color: var(--sp-muted);
}
