/* Mirrors CourtRosterTheme.cs for markup that is not a MudBlazor component. */
:root {
    --cr-ground: #F3F1E7;
    --cr-surface: #FCFBF6;
    --cr-ink: #14231B;
    --cr-ink-soft: #2C3B32;
    --cr-muted: #55625A;
    --cr-line: #D9D6C7;
    --cr-line-soft: #E6E2D3;
    --cr-input-line: #8A958D;
    --cr-green: #1E5B3E;
    --cr-green-deep: #143F2B;
    --cr-optic: #DCE84F;
    --cr-clay: #A8482A;
    /* Shades the theme does not name: hovers, tints and the colours that sit on the dark bar. */
    --cr-white: #FFFFFF;
    --cr-field: #FFFFFF;
    --cr-surface-hover: #F1EFE6;
    --cr-ink-held: #4A564E;
    --cr-green-tint: #EEF3EC;
    --cr-green-ok: #E4EFE6;
    --cr-booked: #E6EFE8;
    --cr-booked-hover: #DCE9DF;
    --cr-green-line: #4E7560;
    --cr-dash: #7C9A88;
    --cr-optic-hover: #E8F16F;
    --cr-clay-deep: #8F3A20;
    --cr-clay-ink: #7E3219;
    --cr-clay-tint: #F6E4DD;
    --cr-amber: #8A5A00;
    --cr-amber-ink: #5C3C00;
    --cr-amber-tint: #FBF3DF;
    --cr-amber-tint-hover: #F7EBCD;
    --cr-on-dark: #E3E9E2;
    --cr-on-dark-soft: #C9D6CC;
    --cr-on-dark-muted: #D5DDD3;
    --cr-on-dark-line: #6F917D;
    --cr-on-dark-hover: rgba(255, 255, 255, 0.08);
    --cr-shadow-raised: 0 12px 32px rgba(20, 35, 27, 0.18);
    --cr-backdrop: rgba(20, 35, 27, 0.45);
    /* Spacing in 4px steps; 14 is the gap inside a card. */
    --cr-space-1: 4px;
    --cr-space-2: 8px;
    --cr-space-3: 12px;
    --cr-space-4: 14px;
    --cr-space-5: 16px;
    --cr-space-6: 20px;
    --cr-space-7: 24px;
    --cr-space-8: 32px;
    --cr-space-9: 48px;
    --cr-radius-xs: 6px;
    --cr-radius-s: 8px;
    --cr-radius-m: 10px;
    --cr-radius-l: 12px;
    --cr-radius-pill: 999px;
    /* The type scale: display sizes in the display face, the rest in the body face. */
    --cr-size-display-xl: 56px;
    --cr-size-display-l: 44px;
    --cr-size-display-m: 32px;
    --cr-size-display-s: 30px;
    --cr-size-time: 34px;
    --cr-size-card-title: 22px;
    --cr-size-group: 20px;
    --cr-size-body-l: 18px;
    --cr-size-body: 15px;
    --cr-size-body-s: 14px;
    --cr-size-caption: 13px;
    --cr-size-label: 12px;
    --cr-size-tag: 11px;
    --cr-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
    --cr-body: Figtree, 'Segoe UI', system-ui, sans-serif;
    /* A map pin, used as a mask so it takes the colour of whatever draws it: the venue headings (US-27). */
    --cr-pin-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

html, body {
    font-family: var(--cr-body);
    background: var(--cr-ground);
    color: var(--cr-ink);
}

a {
    color: var(--cr-green);
}

a:hover {
    color: var(--cr-green-deep);
}

/* Plain form controls: the pages post ordinary forms, so these are not MudBlazor inputs. MudBlazor's own labels are left alone. */
label:not([class*="mud-"]) {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cr-ink-soft);
}

.form-control, .form-select {
    display: block;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    font: inherit;
    color: var(--cr-ink);
    background: var(--cr-field);
    border: 1.5px solid var(--cr-input-line);
    border-radius: 8px;
}

/* Decision 59: with a mouse or a trackpad a field needs less than a finger does. Touch keeps 44px. */
@media (pointer: fine) {
    .form-control, .form-select {
        min-height: 36px;
        padding-top: 0.3rem;
        padding-bottom: 0.3rem;
    }
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
    outline: 3px solid var(--cr-optic);
    outline-offset: 1px;
    border-color: var(--cr-green);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--cr-green);
}

.form-check-label {
    margin: 0;
}

.text-danger {
    color: var(--cr-clay);
}

/* An email address has no break opportunity, so on a phone a long one widens the page unless it may break anywhere. */
.cr-wrap {
    overflow-wrap: anywhere;
    min-width: 0;
}

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

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--cr-green);
}

.invalid {
    outline: 1px solid var(--cr-clay);
}

.validation-message {
    color: var(--cr-clay);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

/* A league as one row that is one link: the System Admin's list (US-26, 2026-09-23) and the league chooser. */
.sl-row { display: block; color: inherit; text-decoration: none; }
.sl-row:hover .mud-paper, .sl-row:focus-visible .mud-paper { border-color: var(--cr-green-line); }

/* A fold whose summary is a button, drawn for the light page like MudBlazor's outlined button. The system pages used
   to borrow the header's outlined button, whose off-white text is for the dark bar and vanished here (2026-09-24). */
.cr-fold-button {
    min-height: 44px;
    box-sizing: border-box;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1.5px solid var(--cr-green);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--cr-green);
    cursor: pointer;
    list-style: none;
}

/* A fold whose summary is a line of text: the venue's Edit, the same look as the schedule card's "Add a single slot". */
.cr-fold-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--cr-green);
    cursor: pointer;
    list-style: none;
}

.cr-fold-button::-webkit-details-marker,
.cr-fold-link::-webkit-details-marker {
    display: none;
}

.cr-fold-button::after,
.cr-fold-link::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-top: -3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.cr-fold-link::before {
    margin: 0 2px 0 0;
    transform: rotate(-45deg);
}

details[open] > .cr-fold-button::after {
    margin-top: 3px;
    transform: rotate(-135deg);
}

details[open] > .cr-fold-link::before {
    transform: rotate(45deg);
}

.cr-fold-button:hover {
    background: var(--cr-green-tint);
}

.cr-fold-button:focus-visible,
.cr-fold-link:focus-visible {
    outline: 3px solid var(--cr-ink);
    outline-offset: 2px;
    border-radius: 6px;
}

/* A card's own heading introduces the form under it; it does not sit on the form's first label. */
.mud-paper > .mud-typography-h6:first-child {
    margin-bottom: 12px;
}

/* A group of cards or rows by standing or by time: "Waiting to accept", "Upcoming", "Past seasons". Manage members and
   Manage schedules each drew this under their own name until the seasons page needed it too (2026-09-24). */
.cr-group-title {
    margin: 12px 0 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--cr-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--cr-muted);
}

/* How many are in a group or behind a fold, in the body face so the number is not read as part of the title. */
.cr-count {
    font-family: var(--cr-body);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
}

/* Several controls under one caption: a window's date and hour, a list of players to tick. The legend reads as a label. */
.cr-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.cr-fieldset > legend {
    padding: 0;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cr-ink-soft);
}

/* The question a form asks before it posts (Confirm.Ask, wwwroot/js/confirm-dialog.js), in place of the browser's
   confirm: the question as a heading, what follows from it underneath, "Go back" first and the action last, in the
   colour of the button that was pressed. */
.cr-confirm {
    width: min(440px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    color: var(--cr-ink);
    background: var(--cr-surface);
    border: 1px solid var(--cr-line);
    border-radius: 12px;
    box-shadow: var(--cr-shadow-raised);
}

.cr-confirm[open] {
    animation: cr-confirm-in 140ms ease-out;
}

@keyframes cr-confirm-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.cr-confirm::backdrop {
    background: var(--cr-backdrop);
}

.cr-confirm-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 24px 20px;
}

.cr-confirm-title {
    margin: 0;
    font-family: var(--cr-body);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.cr-confirm-detail {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--cr-ink-soft);
    overflow-wrap: anywhere;
}

.cr-confirm-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 12px;
}

.cr-confirm-actions button {
    min-height: 44px;
    padding: 0 18px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    border: 1.5px solid;
    border-radius: 8px;
    cursor: pointer;
}

.cr-confirm-back {
    color: var(--cr-green);
    background: transparent;
    border-color: var(--cr-green);
}

.cr-confirm-back:hover {
    background: var(--cr-green-tint);
}

/* Clay takes something away; green changes something. White on either is above 5.5:1. */
.cr-confirm-yes {
    color: var(--cr-white);
    background: var(--cr-clay);
    border-color: var(--cr-clay);
}

.cr-confirm-yes:hover {
    background: var(--cr-clay-deep);
    border-color: var(--cr-clay-deep);
}

.cr-confirm-yes[data-tone="change"] {
    background: var(--cr-green);
    border-color: var(--cr-green);
}

.cr-confirm-yes[data-tone="change"]:hover {
    background: var(--cr-green-deep);
    border-color: var(--cr-green-deep);
}

.cr-confirm-actions button:focus-visible {
    outline: 3px solid var(--cr-ink);
    outline-offset: 2px;
}

@media (max-width: 479.98px) {
    .cr-confirm-box {
        padding: 18px 16px 16px;
    }

    /* Two buttons share the row on a phone rather than hugging its right edge. */
    .cr-confirm-actions button {
        flex: 1 1 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cr-confirm[open] {
        animation: none;
    }
}

/* Manage schedules, drawn by the page and by each PlayDateCard (US-6 to US-9a), and Club bookings (decision 56): the
   card, the rows of fields, the preview and the help text. Global because several components draw them, and scoped
   CSS reaches only its own. */
.as-card {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--cr-surface);
    border: 1px solid var(--cr-line);
    border-radius: 12px;
}

/* One row of fields with the button on the same baseline; it wraps on a narrow screen. */
.as-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.as-field {
    flex: 1 1 200px;
    min-width: 0;
}

.as-fields .as-submit {
    min-height: 44px;
}

.as-preview {
    flex-basis: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--cr-ink);
    background: var(--cr-green-tint);
    border-radius: 8px;
}

.as-help,
.as-empty {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--cr-muted);
}

.as-empty {
    font-size: 15px;
}

/* A card that folds to its summary line: a play date on Manage schedules (PlayDateCard) and on Club bookings
   (ClubBookingsBoard), and the season's bookers there (decision 56). A <details> lays its own content out, so the card
   is a block and the column and its gaps belong to .as-body. The summary line is the whole card when it is folded. */
.as-fold-card {
    display: block;
}

.as-body {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.as-summary {
    min-height: 44px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    cursor: pointer;
    list-style: none;
}

.as-summary::-webkit-details-marker {
    display: none;
}

.as-summary::before {
    content: "";
    width: 9px;
    height: 9px;
    margin: 0 4px 3px 2px;
    border-right: 2.5px solid var(--cr-green);
    border-bottom: 2.5px solid var(--cr-green);
    transform: rotate(-45deg);
}

.as-fold-card[open] > .as-summary::before {
    transform: rotate(45deg);
}

.as-summary:focus-visible {
    outline: 3px solid var(--cr-ink);
    outline-offset: 2px;
    border-radius: 6px;
}

/* The date, or the card's title, in the display face. */
.as-date {
    margin: 0;
    font-family: var(--cr-display);
    font-weight: 800;
    font-size: 30px;
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
}

/* A play date's state beside its date: Draft, Published, Cancelled; and on Club bookings, Locked. */
.as-chip {
    padding: 3px 10px;
    border: 1.5px solid var(--cr-input-line);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--cr-ink-soft);
}

.as-chip-published {
    border-color: var(--cr-green);
    background: var(--cr-green);
    color: var(--cr-white);
}

.as-chip-draft {
    border-color: var(--cr-ink);
    background: var(--cr-optic);
    color: var(--cr-ink);
}

.as-chip-cancelled,
.as-chip-closed,
.as-chip-locked {
    background: var(--cr-line-soft);
    border-color: var(--cr-line-soft);
}

.as-counts {
    margin-left: auto;
    font-size: 14px;
    color: var(--cr-muted);
}

/* Something the admin should look at before going on: too few courts, a play date off the season's plan. */
.as-warning {
    margin: 0;
    padding: 10px 14px;
    border: 1.5px solid var(--cr-amber);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--cr-amber-ink);
    background: var(--cr-amber-tint);
}

/* US-27: a venue named once, over its courts, with the same pin the players' page uses: each venue's grid on Manage
   schedules (PlayDateCard) and each venue's courts on Club bookings (ClubBookingsBoard). A row under it does not
   repeat it. */
.as-venue {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
}

.as-venue::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: var(--cr-green);
    -webkit-mask: var(--cr-pin-icon) center / contain no-repeat;
    mask: var(--cr-pin-icon) center / contain no-repeat;
}

/* Rows in a bordered list: the matchups on a play date, and the courts of its club bookings. */
.as-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--cr-line);
    border-radius: 10px;
}

.as-list-row {
    min-height: 52px;
    padding: 6px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    font-size: 15px;
    border-bottom: 1px solid var(--cr-line-soft);
}

.as-list-row:last-child {
    border-bottom: none;
}

.as-field-narrow {
    flex: 0 1 150px;
}

/* Decision 59: a row in a long list of people or teams shows at most one button, its next step, and one fold, Change…,
   holding the rest with what takes something away last. The fold opens under the row across its width (as a court's
   folds on the club bookings board do). MemberRow and Manage teams draw it. */
.cr-change {
    flex: 0 0 auto;
}

.cr-change[open] {
    order: 1;
    flex-basis: 100%;
    padding: 0 12px 12px;
    border: 1px solid var(--cr-line);
    border-radius: 10px;
}

/* With a mouse a row's Change… needs less height than a thumb does; touch keeps the 44px of every fold summary. */
@media (pointer: fine) {
    .cr-change > summary {
        min-height: 32px;
    }

    .cr-row {
        min-height: 40px;
    }
}

.cr-change-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Decision 64: a question whose answer is a list asks in a panel under its row, across the row's width, read when the
   page was drawn: Delete from the league… on Manage members (?delete=), Take out of play… on Manage teams (?out=). The
   question, what goes, what stays, then Cancel and the clay button. */
.cr-ask {
    order: 1;
    flex-basis: 100%;
    margin: 4px 0 6px;
    padding: 12px 16px 16px;
    border: 1px solid var(--cr-line);
    border-radius: 10px;
    background: var(--cr-surface);
    scroll-margin-top: 88px;
}

.cr-ask-question {
    margin: 0 0 6px;
    font-weight: 700;
}

.cr-ask-list {
    margin: 0 0 8px;
    padding-left: 20px;
    font-size: 14px;
}

.cr-ask-staying {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--cr-ink-soft);
}

.cr-ask-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

/* A list of people or teams: one card, a row each, a line between (decision 59). */
.cr-rows {
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--cr-surface);
    border: 1px solid var(--cr-line);
    border-radius: 10px;
}

.cr-row {
    min-height: 44px;
    padding: 6px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    border-bottom: 1px solid var(--cr-line-soft);
}

.cr-row:last-child {
    border-bottom: none;
}

.cr-row[hidden] {
    display: none;
}

@media (max-width: 767.98px) {
    .as-card {
        padding: 16px;
    }

    .as-date {
        font-size: 24px;
    }

    .as-counts {
        margin-left: 0;
        flex-basis: 100%;
    }

    .as-field-narrow {
        flex: 1 1 130px;
    }
}

/* ---- The court grid (decision 61) -------------------------------------------------------------------------------
   A row per start time with the time said once, a column per court under its heading; on a phone two cells to a row,
   each naming its own court. Drawn by Club bookings (CourtGrid: the season's plan and each play date's board, the bk-
   cells below). The schedule page drew its players' grid with these rules too, until decision 74 folded it into a list
   of the play date's matches. */

.bg {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bg-row {
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.bg-head {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cr-muted);
}

/* Every venue's grid on a page shares one column width, the one its widest venue allows (--bg-max-courts, set by the
   page), and no wider than a court needs. A venue with two courts no longer draws cells twice as wide as the next
   venue's, and Court 1 at one venue sits over Court 1 at the next (US-27). */
.bg-cells {
    --bg-columns: var(--bg-max-courts, var(--bg-courts, 4));
    display: grid;
    grid-template-columns: repeat(var(--bg-courts, 4), min(280px, calc((100% - (var(--bg-columns) - 1) * 12px) / var(--bg-columns))));
    gap: 12px;
}

.bg-time {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.bg-time-start {
    font-family: var(--cr-display);
    font-weight: 700;
    font-size: 34px;
    line-height: 1;
}

.bg-time-end {
    font-size: 13px;
    color: var(--cr-muted);
}

.bg-cell {
    min-height: 104px;
    box-sizing: border-box;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    border-radius: 10px;
    font: inherit;
    text-align: left;
}

.bg-cell-none {
    min-height: 0;
}

.bg-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
}

/* The column heading already names the court on a wide screen; it stays in the accessible name. */
.bg-court {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .bg {
        gap: 24px;
    }

    .bg-head {
        display: none;
    }

    .bg-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .bg-time {
        flex-direction: row;
        justify-content: flex-start;
        align-items: baseline;
        gap: 8px;
    }

    .bg-time-start {
        font-size: 26px;
    }

    .bg-cells {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .bg-cell {
        min-height: 76px;
        padding: 12px 14px;
    }

    /* No column headings on a phone, so each cell names its own court. */
    .bg-court {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
    }

    .bg-status {
        align-self: stretch;
    }

    .bg-state {
        margin-left: auto;
    }
}

/* Decision 44: the slot's format, said on every cell of the schedule so a singles court is never mistaken for a doubles
   one; Club bookings says it on a singles court only (decision 61). At full strength: faded, it fell below the 4.5:1
   that small text needs. */
.bg-format {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* The narrowest phones: the court, its format and its state take two lines rather than squeezing into one. */
@media (max-width: 379.98px) {
    .bg-status {
        flex-wrap: wrap;
        row-gap: 2px;
    }
}

/* ---- Club bookings' courts (decision 61) -------------------------------------------------------------------------
   A court as a cell of the court grid above, drawn by ClubBookingsBoard (each play date's board) and AdminBookings (the
   season's plan). The cell says its state by colour, icon and word together: Booked green, Waiting amber, No booker
   grey and dashed; on the plan, a line, and "+ Add a booker" where no line covers a court and time. Pressing a cell
   checks its radio, and :has() shows its panel under the time row across the grid, or on a phone under the cell's
   pair (--bk-at, set on each cell, gap and panel, orders them there). One radio group per board, so one panel open. */

/* A cell and its panel share a wrapper, for the markup and the tests, but are two items of the grid. */
.bk-court {
    display: contents;
}

/* The content sits at the top, so the bookers of a row line up whether their names take one line or two. */
.bk-cell {
    position: relative;
    min-width: 0;
    justify-content: flex-start;
}

/* A cell that opens its court is a label for its radio; it is still the grid's cell, not a form's label, so the label
   rule above (block, 14px, 600, ink-soft) is put back to the cell's own. */
label.bk-cell {
    display: flex;
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    cursor: pointer;
}

/* The state word and the singles tag wrap to a second line rather than break inside a word. */
.bk-cell .bg-status {
    flex-wrap: wrap;
    row-gap: 2px;
}

/* The radio that opens the court's panel: in the cell's accessible name and the keyboard's reach, out of sight. */
.bk-pick {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.bk-cell.bk-cell-booked {
    background: var(--cr-booked);
    border: 1.5px solid var(--cr-green);
    color: var(--cr-green-deep);
}

.bk-cell.bk-cell-waiting {
    background: var(--cr-amber-tint);
    border: 1.5px solid var(--cr-amber);
    color: var(--cr-amber-ink);
}

.bk-cell.bk-cell-none {
    background: var(--cr-surface);
    border: 1.5px dashed var(--cr-dash);
    color: var(--cr-muted);
}

/* The plan's line: who books it, on the page's surface. */
.bk-cell.bk-cell-line {
    background: var(--cr-surface);
    border: 1.5px solid var(--cr-line);
    color: var(--cr-ink);
}

/* The plan's court and time that no line covers: an offer, dashed, in the colour of actions. */
.bk-cell.bk-cell-add {
    background: var(--cr-surface);
    border: 1.5px dashed var(--cr-green);
    color: var(--cr-green);
}

label.bk-cell-booked:hover {
    background: var(--cr-booked-hover);
}

label.bk-cell-waiting:hover {
    background: var(--cr-amber-tint-hover);
}

label.bk-cell-none:hover,
label.bk-cell-line:hover,
label.bk-cell-add:hover {
    background: var(--cr-surface-hover);
}

/* The court whose panel is open, marked as the schedule marks the viewer's own court: with the ink border. */
.bk-cell:has(.bk-pick:checked) {
    border: 2px solid var(--cr-ink);
}

.bk-cell:has(.bk-pick:focus-visible) {
    outline: 3px solid var(--cr-ink);
    outline-offset: 2px;
}

.bk-cell-who {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-wrap: anywhere;
}

.bk-cell-booker {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--cr-ink);
}

.bk-cell-names {
    font-size: 13px;
    line-height: 1.3;
    color: var(--cr-ink-soft);
}

.bk-cell-note {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.bk-cell-action {
    font-size: 15px;
    font-weight: 700;
}

/* A court's panel: under its time row, across the grid, while its radio is checked. */
.bk-panel {
    display: none;
    grid-column: 1 / -1;
    order: 1;
    padding: 12px 16px 16px;
    border: 1px solid var(--cr-line);
    border-radius: 10px;
    background: var(--cr-surface);
    scroll-margin-top: 88px;
}

.bk-court:has(> .bk-cell .bk-pick:checked) > .bk-panel {
    display: block;
}

.bk-panel-head {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
}

.bk-panel-court {
    font-weight: 700;
}

.bk-panel-state {
    font-size: 13px;
    font-weight: 700;
    color: var(--cr-muted);
}

.bk-panel-who {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--cr-ink-soft);
}

.bk-panel-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}

/* Close: a label for the board's "no court open" radio, drawn as the page's text actions are; booking-forms.js lets a
   keyboard press it. */
label.bk-close {
    min-height: 44px;
    margin: 0 0 0 auto;
    display: inline-flex;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--cr-green);
    cursor: pointer;
}

label.bk-close:focus-visible {
    outline: 3px solid var(--cr-ink);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (max-width: 767.98px) {
    /* Two cells to a row: a court's panel follows its cell's pair rather than the whole time row. */
    .bk-court > *,
    .bk-gap {
        order: var(--bk-at, 0);
    }
}

