:root {
    color-scheme: light;
    --ink: #142338;
    --muted: #485b72;
    --line: #d4deea;
    --paper: #fff;
    --wash: #eef3f9;
    --accent: #174a9c;
    --danger: #a42433;
    --danger-bg: #fd122d2e;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font: 1rem/1.55 system-ui, sans-serif;
    background: var(--wash);
    color: var(--ink);
}

.admin-login {
    max-width: 30rem;
    margin-inline: auto;
}

    .admin-login .field + .field {
        margin-top: 1rem;
    }

.date-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-shell {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

    .admin-shell.has-navigation {
        grid-template-columns: 12rem minmax(0, 1fr);
    }

.admin-content {
    min-width: 0;
}

.admin-navigation {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: .6rem;
}

    .admin-navigation a::before {
        content: "•";
        display: inline-block;
        margin-right: .5rem;
    }

.nav-sign-out-form {
    margin-top: .5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.nav-section-heading {
    margin-top: 1rem;
}

.organisation-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
    margin: 1.5rem 0;
}

    .organisation-selector form {
        display: flex;
        flex: 1 1 16rem;
        align-items: end;
        gap: .75rem;
        min-width: 0;
    }

    .organisation-selector .field {
        flex: 1;
        min-width: 0;
    }

    .organisation-selector + h2 {
        border-top: 1px solid var(--line);
        padding-top: 1.5rem;
    }

.organisation-editor .field + .field {
    margin-top: 1rem;
}

.field textarea {
    resize: vertical;
}

.check-field {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
}

    .check-field input {
        width: 1.2rem;
        height: 1.2rem;
    }

    .check-field label {
        font-weight: 650;
    }

.nav-sign-out {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

    .nav-sign-out:hover {
        color: var(--accent);
        filter: none;
    }

.date-filters [aria-current="page"] {
    font-weight: 750;
}

.globals-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.global-list {
    flex: 1 1 16rem;
    min-width: 0;
    overflow-x: auto;
}

.global-table {
    border-collapse: collapse;
    width: 100%;
    text-align: left;
}

    .global-table th, .global-table td {
        padding: .65rem .8rem;
        border-bottom: 1px solid var(--line);
    }

    .global-table.tight th, .global-table.tight td {
        padding: .15rem .8rem;
    }

    .global-table.tight .icon-button {
        min-height: 2rem;
        padding: 0.15rem;
        width: 2rem;
    }

    .past-date-year {
        margin-bottom: .75rem;
        border: 1px solid var(--line);
        border-radius: .5rem;
        overflow: hidden;
    }

    .past-date-year summary {
        padding: .8rem 1rem;
        cursor: pointer;
        font-weight: 700;
        background: var(--wash);
    }

.global-add {
    flex: 0 1 18rem;
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: .6rem;
}

    .global-add h2 {
        margin-top: 0;
    }

    .global-add .field + .field {
        margin-top: 1rem;
    }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.frame {
    width: min(100% - 2rem, 60rem);
    margin-inline: auto;
}

.site-header {
    background: #ffffff;
    color: var(--accent);
    padding: 1rem 0;
    border-bottom: 6px solid var(--accent);
    height: 75px;
    min-height: 75px;
    max-height: 75px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.release-header-image {
    display: block;
    height: 45px;
    width: auto;
    max-width: calc(100% - 152px);
    min-width: 0;
    object-fit: contain;
    object-position: left center;
}

.header-logo {
    display: block;
    height: 45px;
    width: auto;
    max-width: 100%;
    margin-left: auto;
    flex-shrink: 0;
}

.wordmark {
    font-weight: 800;
    letter-spacing: .06em;
}

    .wordmark span {
        margin-left: .35rem;
        font-weight: 500;
        letter-spacing: 0;
    }

main {
    padding-top: clamp(1rem, 5vw, 3rem);
}

.card {
    padding: clamp(1.25rem, 5vw, 1.25rem);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 12px 36px #1423380d;
    margin-bottom: 1rem;
}

.release-banner {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 1rem;
    border-radius: .6rem;
}

h1, h2, h3 {
    line-height: 1.2;
}

h1 {
    font-size: clamp(1.85rem, 5vw, 2.65rem);
    margin: 0 0 .75rem;
    letter-spacing: -.025em;
}

h2 {
    font-size: 1.35rem;
    margin: 1.5rem 0 .6rem;
}

h3 {
    font-size: 1.1rem;
}

.welcome {
    font: 14px/17px Arial, Helvetica, sans-serif;
    color: #666;
    white-space: normal;
}

    .welcome p {
        margin: 0;
        padding: 0 0 20px;
    }

    .welcome ul, .welcome ol {
        margin: 0;
        padding: 0 0 0 30px;
    }

    .welcome li {
        margin: 0;
        padding: 0;
    }

    .welcome .Title {
        font-size: 12px;
        font-weight: bold;
    }

.steps {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    padding: 0;
    list-style: none;
    margin: 1.4rem 0;
}

    .steps li {
        border-radius: 1rem;
        padding: .25rem .7rem;
        color: var(--muted);
        background: var(--wash);
        font-size: .9rem;
    }

    .steps [aria-current="step"] {
        background: #dce9ff;
        color: #133d83;
        font-weight: 750;
    }

.fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.field label {
    display: block;
    font-weight: 650;
    margin-bottom: .3rem;
}

.field:not(.check-field) input, .field select, .field textarea {
    display: block;
    width: 100%;
    min-height: 1.8rem;
    padding: .25rem .45rem;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #8294a8;
    border-radius: .25rem;
}

.field .input-validation-error {
    border-color: var(--danger);
}

.validation-summary-errors {
    background: var(--danger-bg);
    border-radius: .45rem;
    padding: 1px;
}

.field-validation-error, .error {
    color: var(--danger);
}

.hint {
    color: var(--muted);
    margin: .4rem 0;
    font-size: .95rem;
}

.notice {
    padding: .8rem 1rem;
    border-radius: .5rem;
    background: #fff0f2;
}

.success {
    color: #165737;
    background: #e9f7ee;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-top: 1.5rem;
    justify-content: space-between;
}

    .actions > .group {
        display: flex;
        align-items: center;
        gap: 30px;
    }

button, .button {
    display: inline-block;
    min-height: 1.8rem;
    padding: 0.25rem 0.8rem;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: .25rem;
    color: #fff;
    cursor: pointer;
}

    button:hover, .button:hover {
        filter: brightness(.88);
    }

.discreet {
    background: transparent;
    color: var(--accent);
    border-color: transparent;
}

    .discreet:hover {
        border-color: var(--accent);
        background-color: transparent;
    }

.danger {
    background: var(--danger);
    border-color: var(--danger);
}

.danger.discreet {
    color: var(--danger);
    background-color: transparent;
    border-color: transparent;
}

    .danger.discreet:hover {
        border-color:var(--danger);
        background-color: transparent;
    }

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    padding: .55rem;
}

a {
    color: inherit;
    text-decoration: none;
}

    a:not(.button):hover {
        color: var(--accent);
    }

:focus-visible {
    outline: 3px solid #087b9b;
    outline-offset: 3px;
}

.related {
    border-top: 1px solid var(--line);
    margin: 1.5rem 0 0;
    padding-top: 1rem;
}

.summary {
    padding: .65rem 1rem;
    background: var(--wash);
    border-radius: .55rem;
}

    .summary div {
        display: grid;
        grid-template-columns: 6rem 1fr;
        gap: .75rem;
        padding: .35rem 0;
    }

    .summary dt {
        font-weight: 700;
    }

    .summary dd {
        margin: 0;
        overflow-wrap: anywhere;
    }

.footer {
    padding-block: 1.5rem;
    color: var(--muted);
    font-size: .9rem;
}

.skip {
    position: absolute;
    left: .75rem;
    top: .75rem;
    padding: .5rem;
    background: #fff;
    transform: translateY(-180%);
}

    .skip:focus {
        transform: none;
    }

.request-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: #14233899;
    cursor: wait;
}

.request-progress {
    padding: 1.5rem 2.5rem;
    border-radius: .8rem;
    background: var(--paper);
    box-shadow: 0 12px 36px #14233833;
    text-align: center;
}

.request-spinner {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
    border: 4px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: request-spin .8s linear infinite;
}

@keyframes request-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .request-spinner {
        animation: none;
    }
}

@media (max-width: 48rem) {
    .admin-shell.has-navigation {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 38rem) {
    .fields {
        grid-template-columns: 1fr;
    }
}

.occurrence-options {
    border: 1px solid var(--line);
    border-radius: .5rem;
    padding: .75rem 1rem;
    margin: 1rem 0;
    max-height: 18rem;
    overflow-y: auto;
}
.occurrence-options .check-field { margin-top: .5rem; }
.occurrence-options input[type="checkbox"] { flex: 0 0 1.2rem; }
.occurrence-table-scroll { overflow-x: auto; }
.occurrence-table-scroll .global-table { min-width: 28rem; }
.occurrence-table-scroll .group { display: flex; gap: .25rem; }

.registration-table-scroll { overflow-x: auto; }
.registration-table-scroll .global-table { min-width: 40rem; }
.registration-row-actions { display: flex; gap: .25rem; }

.voucher-code { overflow-wrap: anywhere; word-break: break-word; }

.user-search { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: .75rem; align-items: end; }
.user-page-heading { margin-top: 0; }
.user-page-heading h1, .user-page-heading h2 { margin-bottom: 0; }
.user-table-scroll { overflow-x: auto; }
.user-table-scroll .global-table { min-width: 36rem; }
.user-row-actions { display: flex; gap: .25rem; }

.programme-booking-link { display: flex; align-items: center; gap: .75rem; }
.programme-booking-link a { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.programme-booking-link button { flex: 0 0 auto; }
