[hidden] {
    display: none !important;
}

/* Brand (A10, P1-BRD-C1): the one palette, measured on larkspurinternational.com. Every colour below comes from
   these properties. --brand-primary and --brand-accent (P1-OPS-C6) are set inline by the layout from validated
   configuration and override the header band, hero band and accent line. */
:root {
    --brand-teal: #0e435d;
    --brand-teal-dark: #0a354c;
    --brand-navy: #214368;
    --brand-mint: #8bc5bc;
    --brand-cream: #f8f5ec;
    --brand-coral: #e37168;
    --brand-text: #111827;
    --brand-white: #ffffff;
}

/* Fonts (P1-BRD-C2): served same-origin from /branding/fonts (CSP font-src 'self'). */
@font-face {
    font-family: "Source Sans 3";
    src: url("/branding/fonts/SourceSans3-latin-var.woff2") format("woff2");
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Figtree";
    src: url("/branding/fonts/Figtree-latin-var.woff2") format("woff2");
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    line-height: 1.5;
    color: var(--brand-text);
    background: var(--brand-cream);
}

body,
button,
input,
select,
textarea {
    font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1,
h2,
h3 {
    font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-weight: 400;
    color: var(--brand-teal);
}

a {
    color: var(--brand-teal);
}

img {
    max-width: 100%;
}

a:hover {
    color: var(--brand-teal-dark);
}

a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--brand-teal);
    outline-offset: 2px;
}

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header band (P1-BRD-C3). */
.site-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 2rem;
    padding: 1rem 1.5rem;
    background: var(--brand-primary, var(--brand-teal));
    border-bottom: 4px solid var(--brand-accent, var(--brand-mint));
    color: var(--brand-white);
}

.site-brand {
    display: inline-flex;
    align-items: center;
}

.site-logo {
    height: 2.5rem;
    width: auto;
    max-width: 100%;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
}

.site-header nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    color: var(--brand-white);
    font-size: 18px;
    text-decoration: none;
}

.site-header nav a:hover {
    color: var(--brand-white);
    text-decoration: underline;
}

/* The active nav item is underlined in mint, as on the website. */
.site-header nav a.active {
    text-decoration: underline;
    text-decoration-color: var(--brand-mint);
    text-decoration-thickness: 3px;
    text-underline-offset: 8px;
}

.site-header a:focus-visible {
    outline: 3px solid var(--brand-white);
    outline-offset: 2px;
}

/* Page layout (A11, P1-BRD-C5): the main area is full width so the heading band runs edge to edge; every other
   child of the page section sits in the readable column (40rem; 64rem from 900px up on pages marked "wide"). */
.site-main {
    flex: 1 0 auto;
    width: 100%;
}

.site-main > section {
    --column: 40rem;
    padding: 0 0 4rem;
}

.site-main > section > :not(h1):not(.hero) {
    width: calc(100% - 3rem);
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 900px) {
    .site-main > section.wide {
        --column: 64rem;
    }

    .site-main > section.wide > :not(h1):not(.hero) {
        max-width: 64rem;
    }
}

.site-footer {
    padding: 1.5rem;
    background: var(--brand-teal-dark);
    color: var(--brand-mint);
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: inherit;
    text-decoration: underline;
}

.policy-table {
    border-collapse: collapse;
    margin-block: 1rem;
}

.policy-table th,
.policy-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid currentColor;
    text-align: left;
    vertical-align: top;
}

/* Heading bands (A11, P1-BRD-C5): the full-bleed deep-teal band. The hero (public pages) is generous; the
   heading band on host and door pages (a bare h1 directly under the page section) is slimmer. Text is inset to
   line up with the content column. */
.hero,
.site-main > section > h1 {
    width: 100%;
    max-width: none;
    margin-block: 0 2.5rem;
    padding-block: 1.75rem;
    padding-inline: max(1.5rem, calc((100% - var(--column, 40rem)) / 2));
    background: var(--brand-primary, var(--brand-teal));
    color: var(--brand-white);
    font-size: 2.25rem;
    font-weight: 300;
    line-height: 1.15;
}

.hero {
    padding-block: 3.5rem;
}

.hero-title {
    color: var(--brand-white);
    font-size: clamp(2.25rem, 7vw, 3.5rem);
    font-weight: 300;
    line-height: 1.15;
}

.site-main > section > h1.hero-title {
    padding-block: 3rem;
}

.hero .hero-title {
    margin: 0 0 1rem;
}

.hero p {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.hero .event-date {
    color: var(--brand-white);
}

.hero .event-access {
    color: var(--brand-mint);
}

.hero .event-register {
    margin-top: 1.75rem;
}

/* Buttons (P1-BRD-C4, A11): one base, three variants. Primary is teal with cream text on light surfaces and cream
   with dark text on dark ones (.site-header, .hero, .site-footer, .on-dark); secondary is a 2px outline (teal on
   light, white on dark); danger is only for actions that remove, turn down or withdraw. */
button,
.btn {
    display: inline-block;
    min-height: 2.75rem;
    padding: 12px 24px;
    border: 2px solid var(--brand-teal);
    border-radius: 8px;
    background: var(--brand-teal);
    color: var(--brand-cream);
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--brand-teal);
    color: var(--brand-cream);
    border: 2px solid var(--brand-teal);
}

.btn-primary:hover {
    background: var(--brand-teal-dark);
    border-color: var(--brand-teal-dark);
    color: var(--brand-cream);
}

.btn-secondary {
    background: transparent;
    color: var(--brand-teal);
    border: 2px solid var(--brand-teal);
}

.btn-secondary:hover {
    background: var(--brand-teal);
    color: var(--brand-cream);
}

.btn-danger {
    background: var(--brand-coral);
    color: var(--brand-text);
    border: 2px solid var(--brand-coral);
}

.btn-danger:hover {
    border-color: var(--brand-text);
}

.site-header .btn-primary,
.hero .btn-primary,
.site-footer .btn-primary,
.on-dark .btn-primary {
    background: var(--brand-cream);
    color: var(--brand-text);
    border-color: var(--brand-cream);
}

.site-header .btn-primary:hover,
.hero .btn-primary:hover,
.site-footer .btn-primary:hover,
.on-dark .btn-primary:hover {
    background: var(--brand-white);
    color: var(--brand-text);
    border-color: var(--brand-white);
}

.site-header .btn-secondary,
.hero .btn-secondary,
.site-footer .btn-secondary,
.on-dark .btn-secondary {
    background: transparent;
    color: var(--brand-white);
    border-color: var(--brand-white);
}

.site-header .btn-secondary:hover,
.hero .btn-secondary:hover,
.site-footer .btn-secondary:hover,
.on-dark .btn-secondary:hover {
    background: var(--brand-white);
    color: var(--brand-text);
}

.btn:focus-visible,
button:focus-visible {
    outline: 3px solid var(--brand-teal);
    outline-offset: 2px;
}

.site-header .btn:focus-visible,
.site-header button:focus-visible,
.hero .btn:focus-visible,
.site-footer .btn:focus-visible,
.on-dark .btn:focus-visible {
    outline: 3px solid var(--brand-white);
    outline-offset: 2px;
}

.event-date,
.event-access {
    margin: 0.25rem 0;
}

.event-access {
    font-weight: 600;
    color: var(--brand-teal);
}

/* Host pages (TG-03): phone-first tables, totals, forms and messages. */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--brand-mint);
    border-radius: 8px;
    background: var(--brand-white);
}

.totals {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

.total {
    flex: 1 1 6.5rem;
    padding: 1rem;
    border-radius: 8px;
    background: var(--brand-white);
    border: 1px solid var(--brand-mint);
    text-align: center;
}

.total-count {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-teal);
}

.total-label {
    font-size: 0.9rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--brand-white);
}

th,
td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--brand-mint);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--brand-cream);
    color: var(--brand-text);
}

.people-table td,
.grants-table td,
.approvals-table td {
    overflow-wrap: anywhere;
}

.filters,
.status-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.filters {
    margin: 1rem 0;
}

.stacked {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.stacked button {
    align-self: flex-start;
    margin-top: 0.5rem;
}

input,
select,
textarea,
button {
    font: inherit;
    min-height: 2.5rem;
    max-width: 100%;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 4px solid var(--brand-coral);
    background: var(--brand-white);
    color: var(--brand-text);
}

.notice {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border-left: 4px solid var(--brand-teal);
    background: var(--brand-white);
    color: var(--brand-text);
}

.page-links a,
.host-links a {
    margin-right: 1rem;
}

.host-links {
    padding-left: 1.25rem;
    line-height: 2;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Public pages (TG-04): register link, registration form, privacy notice, details. Phone-first. */
.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="tel"] {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
}

.privacy {
    margin: 1rem 0 0.5rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--brand-mint);
    border-radius: 8px;
    background: var(--brand-white);
}

.privacy-notice,
.details-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.privacy-meta {
    font-size: 0.9rem;
    color: var(--brand-navy);
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0.5rem 0;
}

.check input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    min-height: 1.5rem;
    margin: 0.1rem 0 0;
}

.details-list dt {
    font-weight: 600;
}

.details-list dd {
    margin: 0 0 0.75rem;
}

.approve-form,
.reject-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
}

/* P1-REG-C15: an address with letters outside the Latin script is flagged for the host. */
.email-flag {
    display: block;
    margin-top: 0.25rem;
    font-weight: 600;
    color: var(--brand-navy);
}

/* Door check-in (TG-05): phone-first cards, finger-sized controls (44px+), nothing wider than the screen. */
.door-action {
    min-height: 2.75rem;
    min-width: 2.75rem;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
}

.door-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    margin: 0 0 0.75rem;
    padding: 1rem;
    background: var(--brand-white);
    border: 1px solid var(--brand-mint);
    border-radius: 8px;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.door-results {
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}

.door-name {
    flex: 1 1 100%;
    font-size: 1.15rem;
    font-weight: 600;
}

.door-organisation {
    flex: 1 1 100%;
    color: var(--brand-navy);
}

.door-arrived {
    flex: 1 1 auto;
    font-weight: 600;
    color: var(--brand-teal);
}

.door-card form {
    margin-left: auto;
}

.door-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.door-search label {
    flex: 1 1 100%;
}

.door-search input[type="search"] {
    flex: 1 1 12rem;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
}

.door-search button {
    min-height: 2.75rem;
}

.door-form input[type="text"],
.door-form input[type="email"] {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
}

.door-links {
    margin: 1rem 0;
}

/* TG-05 evaluator backlog: the door page's Sign out button is a finger-sized 44px target like the door actions. */
.door .signout button {
    min-height: 2.75rem;
}

/* Attended view (TG-06): the per-row follow-up forms stack inside the row or card. */
.followup-form,
.withdraw-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0 0 0.5rem;
}

.followup-form textarea {
    width: 100%;
    font: inherit;
}

.followup-note {
    display: block;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* Phone: each table row becomes a stacked card (labels come from the td data-label attribute). */
@media (max-width: 640px) {
    .register-form button,
    a.btn {
        width: 100%;
        min-height: 2.75rem;
        text-align: center;
    }

    .approvals-table thead,
    .people-table thead,
    .grants-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .approvals-table,
    .approvals-table tbody,
    .approvals-table tr,
    .approvals-table td,
    .people-table,
    .people-table tbody,
    .people-table tr,
    .people-table td,
    .grants-table,
    .grants-table tbody,
    .grants-table tr,
    .grants-table td {
        display: block;
        width: 100%;
    }

    .approvals-table tr,
    .people-table tr,
    .grants-table tr {
        margin: 0 0 0.75rem;
        padding: 0.75rem;
        background: var(--brand-white);
        border: 1px solid var(--brand-mint);
        border-radius: 8px;
    }

    .approvals-table td,
    .people-table td,
    .grants-table td {
        padding: 0.35rem 0;
        border-bottom: 0;
    }

    .approvals-table td[data-label]::before,
    .people-table td[data-label]::before,
    .grants-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.8rem;
        font-weight: 600;
        color: var(--brand-navy);
    }

    .people-table td.cell-name::before {
        display: none;
    }

    .people-table td.cell-name {
        font-size: 1.1rem;
        font-weight: 600;
    }

    .people-table td.cell-name a {
        display: inline-block;
        min-height: 2.75rem;
        line-height: 2.75rem;
    }

    .people-table td.cell-email,
    .grants-table td.cell-email {
        overflow-wrap: anywhere;
    }

    .people-table .status-form {
        flex-direction: column;
        align-items: stretch;
    }

    .approvals-table .approve-form select,
    .approvals-table td.cell-action button,
    .people-table .status-form select,
    .people-table .status-form button,
    .people-table .followup-form button,
    .people-table .withdraw-form button,
    .grants-table td.cell-action button {
        width: 100%;
        min-height: 2.75rem;
    }
}
