:root {
    /* Palette aligned with common OWHA hockey colours (navy / red / silver) */
    --owha-navy: #002642;
    --owha-blue: #00539f;
    --owha-red: #ed1b2d;
    --owha-silver: #b3b3b3;
    --owha-gold: #ffd65a;

    --ink: #002642;
    --muted: #4a5f73;
    --paper: #f2f5f8;
    --band: #002642;
    --band-ink: #ffffff;
    --line: #c8d0d8;
    --ok: #1b6b3a;
    --ok-bg: #e5f4ea;
    --bad: #ed1b2d;
    --bad-bg: #fde8ea;
    --accent: #ed1b2d;
    --accent-hover: #c41222;
    --warn-bg: #fff8e6;
    --radius: 4px;
    --font: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-ui: "IBM Plex Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 18px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    color: var(--ink);
    background:
        radial-gradient(ellipse 120% 80% at 10% -20%, #d4e2f0 0%, transparent 55%),
        radial-gradient(ellipse 90% 60% at 100% 0%, #f8d4d7 0%, transparent 45%),
        var(--paper);
    line-height: 1.5;
}

.wrap {
    width: min(42rem, calc(100% - 2rem));
    margin-inline: auto;
}

.wrap-wide {
    width: min(72rem, calc(100% - 2rem));
}

.site-header {
    background: var(--band);
    color: var(--band-ink);
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--owha-red);
}

.brand {
    font-family: var(--font);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--band-ink);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer .disclaimer {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
}

.home-admin-link {
    margin: 1rem 0 0;
    font-size: 0.8rem;
}

.home-admin-link a {
    color: var(--muted);
    text-decoration: none;
}

.home-admin-link a:hover {
    color: var(--ink);
    text-decoration: underline;
}

.page-home main.wrap {
    width: min(28rem, calc(100% - 2rem));
}

.home-gate {
    padding: 0.5rem 0 1rem;
}

.home-tagline {
    margin: 0 0 2rem;
    font-family: var(--font);
    font-size: 1.2rem;
    line-height: 1.35;
    color: var(--muted);
}

.home-block h1,
.home-block h2 {
    font-family: var(--font);
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 0.4rem;
    line-height: 1.2;
}

.home-block .hint {
    margin: 0 0 1rem;
}

.home-code-field {
    margin-bottom: 0;
}

.home-demo-link {
    margin: 1rem 0 0;
    font-size: 0.95rem;
    color: var(--muted);
}

.home-demo-link a {
    font-weight: 600;
    color: var(--owha-blue, #1a5f8f);
}

.demo-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 1px solid #c5d8e8;
    background: #eef5fb;
    color: var(--owha-navy, #0f2740);
}

.demo-banner-text {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
}

.demo-banner-text span {
    color: var(--muted);
    font-size: 0.95rem;
}

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

.home-code-field input {
    max-width: none;
}

.home-code-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: stretch;
}

.home-code-row input {
    flex: 1 1 12rem;
    min-width: 0;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.65rem 0.75rem;
}

.home-code-row .btn {
    flex: 0 0 auto;
    padding-inline: 1.25rem;
}

.home-or {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 1.75rem 0;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.home-or::before,
.home-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.home-block-lead .actions {
    margin-top: 0;
}

.home-block-lead .btn {
    width: 100%;
    text-align: center;
}

h1 {
    font-family: var(--font);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

.lede {
    font-size: 1.05rem;
    color: var(--muted);
    margin: 0 0 1.75rem;
    max-width: 36rem;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.25rem 1.35rem;
    margin-bottom: 1.25rem;
}

.panel h2 {
    font-family: var(--font);
    font-size: 1.15rem;
    margin: 0 0 0.75rem;
}

.season-pair-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    align-items: stretch;
}

.season-pair-grid > .panel {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.season-pair-grid > .panel .actions {
    margin-top: auto;
    padding-top: 1rem;
}

.ice-batch-details > summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--owha-navy);
    font-family: var(--font);
}

.ice-batch-body {
    margin-top: 0.75rem;
}

@media (min-width: 721px) {
    .ice-batch-details {
        display: contents;
    }

    .ice-batch-details > summary {
        display: none;
    }

    .ice-batch-panel::before {
        content: "Batch upload";
        display: block;
        margin: 0 0 0.75rem;
        font-weight: 700;
        font-size: 1.15rem;
        color: var(--owha-navy);
        font-family: var(--font);
    }
}

@media (max-width: 720px) {
    .season-pair-grid {
        grid-template-columns: 1fr;
    }

    .ice-batch-panel {
        order: 2;
    }

    .season-pair-grid > .panel:not(.ice-batch-panel) {
        order: 1;
    }
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

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

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    font-size: 0.9rem;
}

.site-nav a {
    color: var(--band-ink);
    text-decoration: none;
    opacity: 0.9;
}

.site-nav a:hover {
    text-decoration: underline;
    opacity: 1;
}

.site-nav a.is-active {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 0.2em;
    font-weight: 600;
}

.site-nav-team {
    align-items: center;
}

.site-nav .nav-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.site-nav .nav-sign-out {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.15rem;
    padding: 0.2rem;
    opacity: 0.85;
    min-width: 2.75rem;
    min-height: 2.75rem;
    flex-shrink: 0;
}

.site-nav .nav-sign-out:hover {
    opacity: 1;
    text-decoration: none;
}

.site-nav .nav-sign-out svg {
    display: block;
}

@media (max-width: 720px) {
    .header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }

    .site-nav-team {
        flex-wrap: nowrap;
        gap: 0.35rem 0.65rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 0.15rem;
        margin-inline: -0.15rem;
        padding-inline: 0.15rem;
    }

    .site-nav-team > a:not(.nav-sign-out) {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.55rem 0.35rem;
        scroll-snap-align: start;
    }

    .site-nav-team {
        scroll-snap-type: x proximity;
    }
}

.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.flash-error {
    background: var(--bad-bg);
    color: var(--owha-navy);
    border: 1px solid #f0a8af;
}

.flash-success {
    background: var(--ok-bg);
    color: var(--ok);
    border: 1px solid #b6dcc4;
}

.flash-info {
    background: #e8eef4;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn {
    display: inline-block;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: var(--radius);
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

button.btn {
    appearance: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: #fff;
    color: var(--ink);
    border-color: var(--line);
}

.btn-secondary:hover {
    border-color: var(--owha-blue);
    color: var(--owha-blue);
}

.btn-danger {
    background: #fff;
    color: var(--bad);
    border-color: #f0b8be;
}

.btn-danger:hover {
    background: var(--bad-bg);
    border-color: var(--bad);
    color: var(--bad);
}

.btn.is-disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.status {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.status-ok {
    background: var(--ok-bg);
    color: var(--ok);
    border: 1px solid #b6dcc4;
}

.status-bad {
    background: var(--bad-bg);
    color: var(--owha-navy);
    border: 1px solid #f0a8af;
}

.status-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
    background: currentColor;
}

.booking-status-panel .status + .status {
    margin-top: 0.75rem;
}

.booking-status-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-bottom: 0.85rem;
}

.booking-status-header h2 {
    margin: 0;
}

.booking-status-banner {
    margin: 0;
    flex: 1 1 14rem;
    max-width: 36rem;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.35;
}

.booking-status-banner.is-ok {
    background: var(--ok-bg);
    color: var(--ok);
    border: 1px solid #b6dcc4;
}

.booking-status-banner.is-warn {
    background: #fff8e8;
    color: var(--owha-navy);
    border: 1px solid #e6c98a;
}

.booking-status-panel .countdown {
    margin: 0 0 0.85rem;
}

.booking-away-progress {
    margin: 0;
}

.booking-status-more {
    margin-top: 0.85rem;
}

.booking-status-more > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--owha-navy);
}

.booking-status-more-body {
    margin-top: 0.65rem;
}

@media (min-width: 721px) {
    .booking-status-more {
        display: contents;
    }

    .booking-status-more > summary {
        display: none;
    }
}

.booking-fav-move {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.booking-fav-priority-cell {
    white-space: nowrap;
}

.booking-away-progress-label {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.booking-away-progress-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.booking-away-progress-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.84rem;
    line-height: 1.2;
    color: var(--owha-navy);
    background: #fff;
}

.booking-away-progress-chip.is-open {
    background: #fff8e8;
    border-color: #e6c98a;
}

.booking-away-progress-chip.is-complete {
    background: #eef7f0;
    border-color: #b7d7bf;
    color: #2f5d3a;
}

.booking-away-progress-name {
    font-weight: 600;
}

.booking-away-progress-count {
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}

.booking-ice-memo {
    margin-top: 0.85rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius);
    background: #fff8e8;
    border: 1px solid #e6c98a;
}

.booking-ice-memo-title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--owha-navy);
}

.booking-ice-missing-list {
    margin: 0.45rem 0 0;
    padding-left: 1.1rem;
}

.booking-ice-missing-list li {
    margin: 0.15rem 0;
    font-size: 0.88rem;
}

.field {
    margin-bottom: 0.85rem;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.field input {
    width: 100%;
    max-width: 20rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: #fff;
}

.field select {
    width: 100%;
    max-width: 20rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: #fff;
}

.field textarea {
    width: 100%;
    max-width: 28rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    background: #fff;
    min-height: 8rem;
    resize: vertical;
}

.season-tree {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.season-year-title {
    font-family: var(--font);
    font-size: 1.35rem;
    margin: 0 0 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--owha-red);
}

.season-division {
    margin: 0 0 1rem 0.5rem;
}

.season-division-title {
    font-family: var(--font);
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
    color: var(--owha-navy);
}

.season-age {
    margin: 0 0 0.75rem 0.75rem;
}

.season-age-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.season-level {
    margin: 0 0 0.5rem 0.75rem;
}

.season-level-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 0.15rem;
}

.season-area-list {
    margin-left: 0.5rem;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--owha-blue);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.crumb-sep {
    color: var(--muted);
}

.browse-list .list-row {
    padding: 0.65rem 0;
}

table.data th .sort-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

table.data th .sort-link:hover {
    color: var(--owha-blue);
    text-decoration: underline;
}

.panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.panel-toolbar h2 {
    margin: 0;
}

.season-bulk-actions {
    margin: 0 0 0.85rem;
    gap: 0.5rem;
}

table.data th.col-check,
table.data td.col-check {
    width: 2.25rem;
    text-align: center;
    vertical-align: middle;
}

table.data tr.is-unused td {
    background: #fafbfc;
}

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

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.5rem 0.75rem;
    margin: 0.75rem 0 1rem;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-size: 0.95rem;
    cursor: pointer;
}

.checkbox-card input {
    margin: 0;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.search-form .field-grow {
    flex: 1 1 16rem;
    margin-bottom: 0;
}

.search-form .field-grow input {
    max-width: none;
    width: 100%;
}

.search-form .actions {
    margin-top: 0;
}

.jump-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.jump-grid .field {
    margin-bottom: 0;
}

.jump-grid .field select {
    max-width: none;
    width: 100%;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tab {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.tab.is-active {
    background: var(--band);
    border-color: var(--band);
    color: var(--band-ink);
    box-shadow: inset 0 -3px 0 var(--owha-red);
}

.btn-small {
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
}

.inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
}

.inline-form input[type="text"] {
    width: auto;
    min-width: 8rem;
    max-width: 14rem;
    padding: 0.3rem 0.45rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
}

.row-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
}

/* Never put display:flex on a <td>; it breaks row borders and height. */
table.data td.row-actions {
    display: table-cell;
    vertical-align: middle;
}

table.data td.row-actions > .inline-form,
table.data td.row-actions > form {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    vertical-align: middle;
}

table.data td.row-actions > * + * {
    margin-left: 0.35rem;
}

table.data tr.is-editing {
    background: color-mix(in srgb, var(--accent, #b91c1c) 8%, transparent);
}

table.data tr.row-mine td {
    background: #eef5fb;
}

table.data tr.row-mine.row-warn td {
    background: #fff3e8;
}

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

.list-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--line);
}

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

.hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0.35rem 0 0;
}

.meta {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0 0 1rem;
}

.table-wrap {
    overflow-x: auto;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

table.data th,
table.data td {
    text-align: left;
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

table.data td .inline-form,
table.data td .row-actions {
    vertical-align: middle;
}

table.data th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

tr.row-warn td {
    background: var(--warn-bg);
}

.empty {
    color: var(--muted);
    font-size: 0.95rem;
}

.fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem 1rem 0.25rem;
    margin: 0 0 1rem;
}

.fieldset legend {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    padding: 0 0.35rem;
}

.req {
    color: var(--owha-red);
    font-weight: 700;
}

.field-optional {
    font-weight: 500;
    color: var(--muted);
}

.profile-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    margin: 0 0 1.25rem;
}

.profile-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.profile-page-header h1 {
    margin: 0 0 0.25rem;
}

.profile-page-header .lede {
    margin: 0;
}

.profile-status {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    max-width: 22rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.profile-status strong {
    display: block;
    margin-bottom: 0.15rem;
}

.profile-status p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.35;
}

.profile-status-dot {
    width: 0.65rem;
    height: 0.65rem;
    margin-top: 0.35rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--owha-silver);
}

.profile-status.is-complete {
    background: var(--ok-bg);
    border-color: #b6dcc4;
}

.profile-status.is-complete .profile-status-dot {
    background: var(--ok);
}

.profile-status.is-incomplete {
    background: var(--warn-bg);
    border-color: #e6d59a;
}

.profile-status.is-incomplete .profile-status-dot {
    background: #b8860b;
}

.profile-missing {
    margin-bottom: 1.25rem;
}

.profile-missing h2 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.profile-missing-list {
    margin: 0;
    padding-left: 1.2rem;
    columns: 2;
    column-gap: 1.5rem;
}

.profile-missing-list li {
    break-inside: avoid;
    margin: 0 0 0.25rem;
    color: var(--owha-navy);
}

.profile-form-panel {
    padding-top: 1.15rem;
}

.profile-form-intro {
    margin: 0 0 1.15rem;
}

.profile-form .profile-card {
    margin: 0 0 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.profile-card-header {
    padding: 0.85rem 1.1rem 0.7rem;
    background: linear-gradient(180deg, #f4f8fc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--line);
}

.profile-card-header h2 {
    margin: 0;
    font-family: var(--font);
    font-size: 1.15rem;
    color: var(--owha-navy);
}

.profile-card-header .hint {
    margin: 0.25rem 0 0;
}

.profile-card-body {
    padding: 1rem 1.1rem 0.35rem;
}

.profile-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.profile-contact-grid .profile-card {
    margin: 0;
}

.profile-form .field input {
    max-width: none;
}

.profile-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 960px) {
    .profile-contact-grid {
        grid-template-columns: 1fr;
    }

    .profile-missing-list {
        columns: 1;
    }
}

.access-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 0.25rem 0 0.5rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem 1.25rem;
}

.countdown {
    font-size: 1.05rem;
    margin: 0.85rem 0 0.35rem;
}

.countdown strong {
    font-family: var(--font);
    font-size: 1.15rem;
}

.group-title {
    font-family: var(--font);
    font-size: 1.05rem;
    margin: 1.25rem 0 0.5rem;
}

.error-list {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
    color: var(--bad);
}

.filter-form .actions {
    margin-top: 0.5rem;
}

.schedule-table td {
    white-space: nowrap;
}

.schedule-table td:nth-child(3) {
    white-space: normal;
}

.contact-grid h3 {
    font-family: var(--font);
    font-size: 1rem;
    margin: 0 0 0.35rem;
}

.contact-grid p {
    margin: 0.15rem 0;
}

.matrix-yours {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f7fafc;
}

.matrix-yours-title {
    margin: 0 0 0.35rem;
    font-family: var(--font);
    font-size: 1.05rem;
    color: var(--owha-navy);
}

.matrix-yours-totals {
    margin: 0 0 0.65rem;
}

.matrix-yours-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}

.matrix-yours-list li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--line);
}

.matrix-yours-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.matrix-yours-counts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.matrix-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

table.matchup-matrix {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    table-layout: fixed;
    font-size: 0.85rem;
}

.matchup-matrix .matrix-col-name {
    width: 8.75rem;
}

.matchup-matrix .matrix-col-home {
    width: auto;
}

.matchup-matrix .matrix-col-away-total {
    width: 2.75rem;
}

.matchup-matrix th,
.matchup-matrix td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0.3rem;
    text-align: center;
    vertical-align: middle;
}

.matchup-matrix tr:last-child th,
.matchup-matrix tr:last-child td {
    border-bottom: none;
}

.matchup-matrix th:last-child,
.matchup-matrix td:last-child {
    border-right: none;
}

.matrix-corner {
    position: sticky;
    left: 0;
    z-index: 3;
    background: #e8eef4;
    text-align: left !important;
    padding: 0.4rem 0.45rem !important;
    white-space: normal;
}

.matrix-corner-top {
    display: block;
    font-family: var(--font);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ink);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.2;
}

.matrix-axis-note {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.2;
}

.matrix-col-head {
    vertical-align: bottom !important;
    background: #f7f9fb;
    padding: 0.35rem 0.15rem 0.3rem !important;
}

.matrix-col-head .matrix-team-name {
    display: block;
    font-weight: 600;
    color: var(--ink);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.66rem;
    line-height: 1.15;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.matrix-row-head {
    position: sticky;
    left: 0;
    z-index: 2;
    text-align: left !important;
    background: #f7f9fb;
    padding: 0.3rem 0.45rem !important;
    white-space: normal;
}

.matrix-row-head .matrix-team-name {
    display: block;
    font-weight: 600;
    color: var(--ink);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.72rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.matrix-self {
    background: #d9e4ef;
    color: transparent;
}

.matrix-cell {
    background: #fff;
    padding: 0.1rem !important;
}

.matrix-cell.has-games {
    background: #f4fbf6;
}

.matrix-count-btn {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    min-width: 1.7rem;
    min-height: 1.7rem;
    padding: 0.2rem 0.25rem;
    border-radius: var(--radius);
    cursor: pointer;
}

.matrix-count-btn:hover,
.matrix-count-btn:focus-visible {
    border-color: var(--owha-blue);
    background: #eef5fb;
    color: var(--owha-blue);
    outline: none;
}

.matrix-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.7rem;
    min-height: 1.7rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}

.matchup-matrix-readonly .matrix-col-head.is-mine,
.matchup-matrix-readonly .matrix-row-head.is-mine {
    background: #eef5fb;
    color: var(--owha-blue);
}

.matchup-matrix-readonly tr.is-mine .matrix-cell {
    background: #f7fbfe;
}

.matchup-team-tab.is-mine:not(.is-active) {
    box-shadow: inset 0 -2px 0 var(--owha-blue);
}

.matrix-total-head,
td.matrix-total-away,
th.matrix-total-away {
    background: #f8ebe3;
    color: var(--ink);
    font-weight: 700;
    width: 2.75rem;
    max-width: 2.75rem;
    padding-inline: 0.1rem !important;
    white-space: nowrap;
}

.matrix-total-label,
.matrix-total-home,
.matrix-home-totals th,
.matrix-home-totals td {
    background: #e7f2ea;
}

.matrix-total-label {
    text-align: left !important;
    white-space: normal;
    padding: 0.35rem 0.45rem !important;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.75rem;
}

.matrix-total {
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.9rem;
}

.matrix-total .matrix-target {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--muted);
}

.matrix-total.is-complete {
    color: var(--ok);
}

.matrix-total.is-short {
    color: #9a3412;
    background: #fff4e8;
}

.matrix-grand {
    background: #e8eef4;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--muted);
    white-space: normal;
    line-height: 1.2;
    padding-inline: 0.15rem !important;
}

.matrix-errors {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: var(--bad-bg);
    border: 1px solid #f0a8af;
    color: var(--owha-navy);
}

.matrix-errors h3 {
    font-family: var(--font);
    font-size: 1rem;
    margin: 0 0 0.45rem;
}

.matrix-errors ul {
    margin: 0;
    padding-left: 1.15rem;
}

.matrix-errors li + li {
    margin-top: 0.25rem;
}

.matrix-ok {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--ok-bg);
    border: 1px solid #b6dcc4;
    color: var(--ok);
    font-size: 0.95rem;
}

.matchup-dialog {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0;
    width: min(22rem, calc(100vw - 2rem));
    box-shadow: 0 12px 40px rgba(0, 38, 66, 0.18);
}

.matchup-dialog::backdrop {
    background: rgba(0, 38, 66, 0.35);
}

.matchup-dialog form {
    padding: 1.15rem 1.25rem 1.25rem;
}

.matchup-dialog h3 {
    font-family: var(--font);
    font-size: 1.2rem;
    margin: 0 0 0.35rem;
}

.matchup-dialog .field input {
    max-width: none;
}

.matchup-build-tools {
    display: grid;
    gap: 1.25rem;
}

.matchup-build-block {
    padding: 1rem 0 0;
    border-top: 1px solid var(--line);
}

.matchup-build-block:first-child {
    padding-top: 0;
    border-top: none;
}

.matchup-build-block h3 {
    margin: 0 0 0.35rem;
    font-family: var(--font);
    font-size: 1.05rem;
}

.matchup-breakdown-panel {
    overflow: hidden;
}

.matchup-team-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin: 0 0 1.25rem;
    padding: 0.15rem 0 0.55rem;
    overflow-x: auto;
    scrollbar-width: thin;
    border-bottom: 1px solid var(--line);
}

.matchup-team-tab {
    appearance: none;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.45rem 0.8rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.matchup-team-tab:hover {
    background: #e8eef4;
    color: var(--ink);
}

.matchup-team-tab:focus-visible {
    outline: 2px solid var(--owha-blue);
    outline-offset: 2px;
}

.matchup-team-tab.is-active {
    background: var(--owha-navy);
    border-color: var(--owha-navy);
    color: #fff;
}

.matchup-team-tab-status {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--owha-silver);
    flex-shrink: 0;
}

.matchup-team-tab.is-complete .matchup-team-tab-status {
    background: var(--ok);
}

.matchup-team-tab.is-active .matchup-team-tab-status {
    background: var(--owha-gold);
}

.matchup-team-tab.is-active.is-complete .matchup-team-tab-status {
    background: #8fefb0;
}

.matchup-team-panel {
    animation: none;
}

.matchup-team-panel.is-entering {
    animation: matchup-panel-in 0.22s ease;
}

@keyframes matchup-panel-in {
    from {
        opacity: 0;
        transform: translateY(0.35rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.matchup-breakdown-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.matchup-breakdown-team {
    margin: 0;
    font-family: var(--font);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.matchup-breakdown-summary {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.matchup-stat.is-complete {
    color: var(--ok);
    font-weight: 600;
}

.matchup-stat.is-short {
    color: var(--bad);
    font-weight: 600;
}

.matchup-stat-of {
    opacity: 0.75;
}

.matchup-stat-sep {
    margin: 0 0.35rem;
    opacity: 0.5;
}

.matchup-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

.matchup-breakdown-block {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.matchup-breakdown-block.is-home {
    border-top: 3px solid var(--owha-navy);
}

.matchup-breakdown-block.is-away {
    border-top: 3px solid var(--owha-blue);
}

.matchup-breakdown-block-head {
    padding: 0.85rem 1rem 0.75rem;
    background: linear-gradient(180deg, #f7fafc 0%, #fff 100%);
    border-bottom: 1px solid var(--line);
}

.matchup-breakdown-kicker {
    display: inline-block;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.matchup-breakdown-block.is-home .matchup-breakdown-kicker {
    color: var(--owha-navy);
}

.matchup-breakdown-block.is-away .matchup-breakdown-kicker {
    color: var(--owha-blue);
}

.matchup-breakdown-block-head h4 {
    margin: 0;
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 600;
}

.matchup-breakdown-block-head .meta {
    margin: 0.15rem 0 0;
}

.matchup-breakdown-empty {
    margin: 0;
    padding: 1.1rem 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.matchup-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
}

.matchup-breakdown-list li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.55rem;
    align-items: baseline;
    padding: 0.55rem 1rem;
}

.matchup-breakdown-list li:nth-child(even) {
    background: #f7fafc;
}

.matchup-breakdown-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 1.4rem;
}

.matchup-breakdown-vs {
    font-weight: 600;
    min-width: 0;
}

.matchup-breakdown-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius);
    background: #e8eef4;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .matchup-team-panel.is-entering {
        animation: none;
    }

    .matchup-team-tab {
        transition: none;
    }
}

@media (max-width: 480px) {
    .actions {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }

    .home-code-row {
        flex-direction: column;
    }

    .home-code-row .btn {
        width: 100%;
    }
}

.booking-view-tabs,
.booking-team-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.booking-view-tab {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.booking-view-tab:hover {
    background: #e8eef4;
    color: var(--ink);
}

.booking-view-tab.is-active {
    background: var(--owha-navy);
    border-color: var(--owha-navy);
    color: #fff;
}

.booking-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: end;
    margin: 0 0 1rem;
}

.booking-filters .field {
    margin: 0;
    min-width: 9rem;
}

.booking-filters .field input,
.booking-filters .field select {
    max-width: none;
}

.booking-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted);
    padding-bottom: 0.45rem;
}

.booking-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.75rem;
}

.booking-cal-nav-placeholder {
    display: inline-block;
    min-width: 5.75rem;
    min-height: 2.1rem;
}

.booking-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.booking-cal-dow {
    background: #e8eef4;
    padding: 0.45rem 0.35rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.booking-cal-day {
    background: #fff;
    min-height: 6.5rem;
    padding: 0.35rem;
    vertical-align: top;
}

.booking-cal-day.is-outside {
    background: #f7fafc;
}

.booking-cal-slots {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.booking-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1.15rem;
    list-style: none;
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f7fafc;
    font-size: 0.82rem;
    color: var(--muted);
}

.booking-cal-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.booking-legend-swatch {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 3px;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.booking-legend-swatch.is-available {
    background: #e5f4ea;
    border-color: #b6dcc4;
    box-shadow: inset 3px 0 0 var(--ok);
}

.booking-legend-swatch.is-favourite {
    background: #fff8e6;
    border-color: #e6d59a;
    box-shadow: inset 3px 0 0 #b8860b;
}

.booking-legend-swatch.is-yours {
    background: #e8f0fa;
    border-color: #b7cce3;
    box-shadow: inset 3px 0 0 var(--owha-blue);
}

.booking-legend-swatch.is-held {
    background: #fde8ea;
    border-color: #f0a8af;
    box-shadow: inset 3px 0 0 var(--owha-red);
}

.booking-legend-marker.is-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 3px;
    background: #fff4e5;
    border: 1px solid #e0c48a;
    color: #8a6a00;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
}

.booking-cal-day.has-home-game {
    background: #fffaf0;
    box-shadow: inset 0 0 0 1px #e6d59a;
}

.booking-cal-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--owha-navy);
    margin-bottom: 0.25rem;
}

.booking-cal-home-badge {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a6a00;
    background: #fff4e5;
    border: 1px solid #e0c48a;
    border-radius: 999px;
    padding: 0.05rem 0.35rem;
}

.booking-cal-home-note {
    margin: 0 0 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #8a6a00;
    line-height: 1.25;
}

.booking-chip.has-home-conflict {
    box-shadow: inset 0 0 0 1px #e0c48a;
}

.booking-chip-home {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.15rem;
    border-radius: 3px;
    background: #fff4e5;
    border: 1px solid #e0c48a;
    color: #8a6a00;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
}

.booking-home-conflict-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: #fff4e5;
    border: 1px solid #e0c48a;
    color: #8a6a00;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.booking-slot-dialog-conflict {
    margin: 0 1.15rem 0.85rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius);
    background: #fff4e5;
    border: 1px solid #e0c48a;
    color: #8a6a00;
    font-size: 0.85rem;
    font-weight: 600;
}

.booking-chip {
    appearance: none;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.35rem;
    width: 100%;
    margin: 0;
    padding: 0.25rem 0.35rem;
    border: 1px solid var(--line);
    border-left-width: 3px;
    border-radius: var(--radius);
    background: #f7fafc;
    color: var(--ink);
    font: inherit;
    font-size: 0.72rem;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.booking-chip:hover,
.booking-chip:focus-visible {
    border-color: var(--owha-blue);
    outline: none;
}

.booking-chip.is-available {
    background: #e5f4ea;
    border-color: #b6dcc4;
    border-left-color: var(--ok);
}

.booking-chip.is-favourite {
    background: #fff8e6;
    border-color: #e6d59a;
    border-left-color: #b8860b;
}

.booking-chip.is-yours {
    background: #e8f0fa;
    border-color: #b7cce3;
    border-left-color: var(--owha-blue);
}

.booking-chip.is-held {
    background: #fde8ea;
    border-color: #f0a8af;
    border-left-color: var(--owha-red);
}

.booking-chip-time {
    font-weight: 700;
    white-space: nowrap;
}

.booking-chip-star {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1;
    color: var(--owha-silver);
}

.booking-chip-star.is-on {
    color: #b8860b;
}

.booking-slot-dialog {
    width: min(24rem, calc(100vw - 2rem));
    border: none;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 38, 66, 0.28);
}

.booking-slot-dialog::backdrop {
    background: rgba(0, 38, 66, 0.45);
}

.booking-slot-dialog-panel {
    padding: 0;
    background: #fff;
}

.booking-slot-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.15rem 0.85rem;
    background:
        linear-gradient(180deg, #f4f8fc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--line);
}

.booking-slot-dialog-kicker {
    margin: 0 0 0.15rem;
    font-family: var(--font-ui);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.booking-slot-dialog-header h3 {
    margin: 0;
    font-family: var(--font);
    font-size: 1.25rem;
    line-height: 1.2;
    color: var(--owha-navy);
}

.booking-slot-status {
    flex-shrink: 0;
    margin-top: 0.15rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: #eef2f6;
    color: var(--muted);
}

.booking-slot-status.is-open {
    background: var(--ok-bg);
    color: var(--ok);
}

.booking-slot-status.is-yours {
    background: #e8f0fa;
    color: var(--owha-blue);
}

.booking-slot-status.is-held {
    background: var(--warn-bg);
    color: #8a6a00;
}

.booking-slot-dialog-facts {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0.95rem 1.15rem;
}

.booking-slot-dialog-facts > div {
    display: grid;
    gap: 0.1rem;
}

.booking-slot-dialog-facts dt {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.booking-slot-dialog-facts dd {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
}

.booking-slot-dialog-reason {
    margin: 0 1.15rem 0.85rem;
    padding: 0.55rem 0.7rem;
    border-radius: var(--radius);
    background: var(--bad-bg);
    color: var(--owha-navy);
    font-size: 0.85rem;
}

.booking-slot-dialog-swap {
    margin: 0 1.15rem 0.85rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f7f9fb;
}

.booking-slot-dialog-swap-copy {
    margin: 0 0 0.55rem;
    font-size: 0.88rem;
    color: var(--owha-navy);
}

.booking-slot-dialog-swap-list {
    margin: 0;
    padding: 0;
    border: 0;
    display: grid;
    gap: 0.35rem;
}

.booking-slot-dialog-swap-option {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.86rem;
    cursor: pointer;
}

.booking-slot-dialog-swap-option input {
    margin-top: 0.15rem;
}

.booking-chip.is-swappable:not(.is-yours):not(.is-held) {
    box-shadow: inset 0 0 0 1px rgba(15, 76, 129, 0.35);
}

.booking-slot-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.15rem 1.05rem;
    border-top: 1px solid var(--line);
    background: #f7f9fb;
}

.booking-slot-dialog-actions .inline-form {
    display: inline-flex;
    margin: 0;
}

.booking-slot-dialog-actions .btn {
    min-height: 2.1rem;
}

.booking-slot-fav-btn.is-on {
    background: #fff8e6;
    border-color: #e6d59a;
    color: #8a6a00;
}

.booking-slot-fav-btn span {
    margin-right: 0.2rem;
}

.booking-team-block {
    margin: 0 0 1.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--line);
}

.booking-team-block:first-of-type {
    border-top: none;
    padding-top: 0;
}

.booking-team-dates {
    display: grid;
    gap: 0.5rem;
}

.booking-team-date-row {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.75rem;
    align-items: start;
}

.booking-team-date-label {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding-top: 0.2rem;
}

.btn-small.is-fav {
    color: #b8860b;
    border-color: #e6d59a;
}

table.data tr.row-favourite td {
    background: #fffdf5;
}

.booking-fav-priority-col {
    width: 4.5rem;
    white-space: nowrap;
}

.booking-fav-priority-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--owha-navy);
    white-space: nowrap;
    user-select: none;
}

.booking-fav-handle {
    display: inline-block;
    margin-right: 0.35rem;
    color: var(--muted);
    cursor: grab;
    font-size: 0.95rem;
    letter-spacing: -0.08em;
}

.booking-fav-sortable tbody tr.is-draggable {
    cursor: grab;
}

.booking-fav-sortable tbody tr.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
    background: #eef4fa;
}

.booking-fav-sortable tbody tr.is-drag-over {
    box-shadow: inset 0 2px 0 var(--owha-blue);
}

.booking-fav-rank {
    display: inline-block;
    min-width: 1.25rem;
    text-align: center;
}

@media (max-width: 720px) {
    .booking-cal-grid {
        display: block;
        background: transparent;
        border: none;
    }

    .booking-cal-dow {
        display: none;
    }

    .booking-cal-day {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        margin-bottom: 0.5rem;
        min-height: 0;
    }

    .booking-cal-day.is-outside,
    .booking-cal-day.is-empty {
        display: none;
    }

    .booking-cal-slots {
        gap: 0.4rem;
    }

    .booking-chip {
        min-height: 2.75rem;
        padding: 0.5rem 0.65rem;
        font-size: 0.9rem;
        align-items: center;
    }

    .booking-team-date-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .booking-fav-handle {
        display: none;
    }

    .booking-fav-move {
        display: inline-flex;
    }

    .booking-fav-move .btn {
        min-width: 2.5rem;
        min-height: 2.5rem;
        padding: 0.25rem;
        font-size: 1rem;
        line-height: 1;
    }

    body.team-portal table.data td.row-actions {
        white-space: normal;
    }

    body.team-portal table.data td.row-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        align-items: center;
    }

    body.team-portal table.data td.row-actions > .inline-form,
    body.team-portal table.data td.row-actions > form {
        display: inline-flex;
    }

    body.team-portal .btn-small {
        min-height: 2.5rem;
        padding: 0.45rem 0.75rem;
        font-size: 0.9rem;
    }

    body.team-portal .hide-on-narrow {
        display: none !important;
    }

    body.team-portal .schedule-table thead {
        display: none;
    }

    body.team-portal .schedule-table tbody tr {
        display: block;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        margin-bottom: 0.65rem;
        padding: 0.35rem 0.65rem;
        background: #fff;
    }

    body.team-portal .schedule-table tbody td {
        display: flex;
        justify-content: space-between;
        gap: 0.75rem;
        border: none;
        padding: 0.35rem 0;
        text-align: right;
    }

    body.team-portal .schedule-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
        text-align: left;
        flex: 0 0 38%;
    }

    body.team-portal .matrix-cell,
    body.team-portal .matrix-count {
        min-width: 2.25rem;
        min-height: 2.25rem;
    }

    body.team-portal .matrix-col-head .matrix-team-name,
    body.team-portal .matrix-row-head .matrix-team-name {
        font-size: 0.78rem;
    }
}

.leads-search-form {
    margin: 0 0 1rem;
}

.leads-assign-heading {
    margin: 1.15rem 0 0.35rem;
    font-family: var(--font);
    font-size: 1.05rem;
    color: var(--owha-navy);
}

.leads-create-form .jump-grid {
    margin: 0.65rem 0 1rem;
}

.leads-create-form .field select {
    max-width: none;
}

.leads-create-form .field-row .field input {
    max-width: min(24rem, 100%);
}

@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    .site-header,
    .site-footer,
    .site-nav,
    .actions,
    .flash,
    .btn,
    form,
    .no-print,
    .matrix-count-btn {
        display: none !important;
    }

    .wrap {
        width: 100%;
        max-width: none;
        margin: 0;
    }

    main.wrap {
        padding: 0;
    }

    .panel {
        border: none;
        padding: 0;
        margin: 0 0 1.25rem;
        background: transparent;
        break-inside: avoid;
    }

    h1, h2 {
        color: #000;
    }

    table.data th,
    table.data td {
        border-bottom: 1px solid #ccc;
        padding: 0.25rem 0.35rem;
    }

    tr.row-warn td {
        background: #f5f5f5;
    }

    .matrix-wrap {
        border: 1px solid #999;
    }
}

