/* COMPETITION THEME CORE
   Shared shell, navigation, components, and existing page-level compatibility styles.
   Theme-specific files are loaded after this file. */

/* DARK COMPETITION / EVENT THEME */

:root {
    --cm-bg: #020617;
    --cm-bg-soft: #07111f;
    --cm-surface: #111827;
    --cm-surface-2: #162033;
    --cm-border: rgba(255,255,255,.10);
    --cm-text: #f8fafc;
    --cm-muted: #cbd5e1;
    --cm-muted-2: #94a3b8;
    --cm-gold: #f59e0b;
    --cm-gold-2: #fbbf24;
    --cm-cyan: #22d3ee;
    --cm-purple: #a78bfa;
    --cm-orange: #fb923c;
    --cm-green: #34d399;
    --cm-red: #fb7185;
}

body.competition-shell {
    min-height: 100vh;
    margin: 0;
    color: var(--cm-text);
    font-family: "Segoe UI", system-ui, sans-serif;
    background: radial-gradient(circle at top left, rgba(245,158,11,.14), transparent 34rem), radial-gradient(circle at 90% 5%, rgba(34,211,238,.14), transparent 32rem), linear-gradient(135deg, #07111f 0%, #020617 72%);
}


/* BOOTSTRAP DARK VARIABLE NORMALISATION
   Keeps text, labels, modal values and helper text readable on all dark Event Day pages.
   Many views use Bootstrap variables such as --bs-body-color / --bs-secondary-color;
   without these overrides, custom modal/card content can inherit Bootstrap's default dark text. */
body.competition-shell {
    --bs-body-bg: var(--cm-bg);
    --bs-body-color: var(--cm-text);
    --bs-secondary-color: var(--cm-muted);
    --bs-tertiary-color: var(--cm-muted-2);
    --bs-heading-color: #ffffff;
    --bs-border-color: rgba(255,255,255,.14);
    --bs-border-color-translucent: rgba(255,255,255,.14);
    --bs-card-bg: rgba(17,24,39,.96);
    --bs-card-color: var(--cm-text);
    --bs-card-border-color: rgba(255,255,255,.12);
    --bs-modal-bg: rgba(17,24,39,.98);
    --bs-modal-color: var(--cm-text);
    --bs-modal-border-color: rgba(255,255,255,.16);
    --bs-modal-header-border-color: rgba(255,255,255,.12);
    --bs-modal-footer-border-color: rgba(255,255,255,.12);
    --bs-link-color: var(--cm-gold-2);
    --bs-link-hover-color: #fde68a;
}

body.competition-shell .modal-content,
body.competition-shell .card,
body.competition-shell .dropdown-menu,
body.competition-shell .accordion,
body.competition-shell .accordion-item {
    --bs-body-color: var(--cm-text);
    --bs-secondary-color: var(--cm-muted);
    --bs-tertiary-color: var(--cm-muted-2);
    --bs-border-color: rgba(255,255,255,.14);
    color: var(--cm-text) !important;
}

body.competition-shell .modal-body,
body.competition-shell .modal-body .form-label,
body.competition-shell .modal-body label,
body.competition-shell .modal-body p,
body.competition-shell .modal-body div,
body.competition-shell .modal-body span {
    color: inherit;
}

body.competition-shell .modal-body .text-muted,
body.competition-shell .modal-body .form-text,
body.competition-shell .modal-body small,
body.competition-shell .card .text-muted,
body.competition-shell .card .form-text {
    color: var(--cm-muted) !important;
}

body.competition-shell .form-control[readonly],
body.competition-shell .form-control:disabled,
body.competition-shell .form-select:disabled,
body.competition-shell .form-control-plaintext {
    background-color: rgba(2,6,23,.72) !important;
    color: #f8fafc !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #f8fafc !important;
}

body.competition-shell .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: .82;
}

body.competition-shell .btn-close:hover,
body.competition-shell .btn-close:focus {
    opacity: 1;
}

/* LAYOUT */

.dashboard-shell {
    display: grid;
    grid-template-columns: 280px minmax(0,1fr);
    gap: 1rem;
    min-height: 100vh;
    padding: 1rem;
}

.dashboard-main {
    min-width: 0;
    padding: 1.4rem;
}

/* SIDEBAR */

.dashboard-sidebar {
    position: sticky;
    top: 1rem;
    min-height: calc(100vh - 2rem);
    padding: 1.1rem;
    border-radius: 1.35rem;
    background: linear-gradient(180deg, #111827 0%, #07111f 100%);
    border: 1px solid var(--cm-border);
    box-shadow: 0 25px 80px rgba(0,0,0,.35);
}

.brand-mark {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: .8rem;
    color: inherit;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

.sidebar-brand-text {
    min-width: 0;
}

.side-title {
    font-weight: 800;
    color: #ffffff;
    line-height: 1.05;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.side-subtitle {
    font-size: .82rem;
    color: var(--cm-muted);
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-nav {
    display: grid;
    gap: .55rem;
    margin-top: 1.4rem;
}

    .side-nav a {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .85rem .95rem;
        border-radius: 1rem;
        color: #e5e7eb;
        text-decoration: none;
        background: rgba(255,255,255,.045);
        border: 1px solid transparent;
        transition: .18s ease;
    }

        .side-nav a:hover {
            transform: translateX(4px);
            color: #ffffff;
            background: rgba(245,158,11,.12);
            border-color: rgba(245,158,11,.22);
        }

        .side-nav a.active {
            color: #111827;
            background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2));
            border-color: rgba(245,158,11,.5);
            font-weight: 700;
        }

    .side-nav i {
        color: var(--cm-gold);
        font-size: 1.1rem;
    }

    .side-nav a.active i {
        color: #111827;
    }

/* HERO */

.hero-panel {
    border-radius: 1.5rem;
    padding: 2rem;
    color: var(--cm-text);
    background: linear-gradient(135deg, rgba(17,24,39,.96), rgba(15,23,42,.94)), radial-gradient(circle at top right, rgba(245,158,11,.18), transparent 22rem);
    border: 1px solid var(--cm-border);
    box-shadow: 0 25px 80px rgba(0,0,0,.30);
}

.hero-title {
    color: #ffffff !important;
    font-size: 2.25rem;
    font-weight: 850;
    letter-spacing: -.03em;
}

.hero-copy {
    color: var(--cm-muted) !important;
}

/* SURFACES */

.card,
.modal-content,
.dropdown-menu,
.quick-panel {
    background: rgba(17,24,39,.96) !important;
    color: var(--cm-text) !important;
    border: 1px solid var(--cm-border) !important;
    border-radius: 1.2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.card-header,
.modal-header,
.modal-footer {
    background: rgba(255,255,255,.035) !important;
    color: #ffffff !important;
    border-color: var(--cm-border) !important;
}

/* MODULE / STAT CARDS */

.stat-card,
.module-card {
    position: relative;
    overflow: hidden;
    padding: 1.15rem;
    border-radius: 1.25rem;
    background: rgba(17,24,39,.94);
    border: 1px solid var(--cm-border);
    color: var(--cm-text);
    transition: .18s ease;
}

    .stat-card:hover,
    .module-card:hover {
        transform: translateY(-3px);
        border-color: color-mix(in srgb, var(--accent, var(--cm-gold)) 42%, var(--cm-border));
        box-shadow: 0 26px 70px rgba(0,0,0,.35);
    }

    .stat-card::before,
    .module-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 3px;
        background: var(--accent, var(--cm-gold));
    }

.stat-icon,
.module-icon {
    width: 2.8rem;
    height: 2.8rem;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--accent, var(--cm-gold)) 20%, transparent);
    color: var(--accent, var(--cm-gold));
}

.stat-value {
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 850;
}

.stat-label,
.module-text {
    color: var(--cm-muted);
    font-size: .9rem;
}

.module-card {
    text-decoration: none;
}

.module-title {
    margin-top: .8rem;
    color: #ffffff;
    font-weight: 750;
}

/* TYPOGRAPHY */

.section-heading h5,
h1, h2, h3, h4, h5, h6 {
    color: #ffffff !important;
}

.text-muted,
.text-secondary,
p.text-muted,
small.text-muted,
.lead {
    color: var(--cm-muted) !important;
}

/* ACCENTS */

.accent-gold {
    --accent: var(--cm-gold);
}

.accent-cyan {
    --accent: var(--cm-cyan);
}

.accent-purple {
    --accent: var(--cm-purple);
}

.accent-orange {
    --accent: var(--cm-orange);
}

.accent-green {
    --accent: var(--cm-green);
}

.accent-red {
    --accent: var(--cm-red);
}

/* TABLES */

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cm-text);
    --bs-table-border-color: var(--cm-border);
    color: var(--cm-text) !important;
}

    .table > :not(caption) > * > * {
        background-color: transparent !important;
        color: var(--cm-text) !important;
        border-color: var(--cm-border) !important;
    }

    .table thead th {
        background: rgba(255,255,255,.06) !important;
        color: #ffffff !important;
        font-weight: 750;
    }

    .table tbody td {
        color: #e5e7eb !important;
    }

    .table-hover tbody tr:hover,
    .table tbody tr:hover {
        background: rgba(245,158,11,.08) !important;
    }

.table-client-tools {
    background: rgba(17,24,39,.92);
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    padding: .85rem;
}

/* FORMS */

.form-label,
label {
    color: #ffffff;
}

.form-control,
.form-select {
    background-color: rgba(2,6,23,.82) !important;
    color: #ffffff !important;
    border: 1px solid rgba(148,163,184,.30) !important;
    caret-color: var(--cm-gold);
}

    .form-control:focus,
    .form-select:focus {
        background-color: rgba(2,6,23,.96) !important;
        color: #ffffff !important;
        border-color: var(--cm-gold) !important;
        box-shadow: 0 0 0 .2rem rgba(245,158,11,.22) !important;
    }

    .form-control::placeholder {
        color: #64748b !important;
    }


/* File upload controls - keep browser file picker button aligned with dark theme */
input[type="file"].form-control {
    background-color: rgba(2,6,23,.82) !important;
    color: #ffffff !important;
    border-color: rgba(148,163,184,.30) !important;
}

input[type="file"].form-control::file-selector-button {
    margin: -.375rem .85rem -.375rem -.75rem;
    padding: .58rem .95rem;
    color: #111827 !important;
    background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2)) !important;
    border: 0 !important;
    border-right: 1px solid rgba(245,158,11,.45) !important;
    font-weight: 750;
}

input[type="file"].form-control:hover::file-selector-button,
input[type="file"].form-control:focus::file-selector-button {
    filter: brightness(1.05);
}

input[type="file"].form-control::-webkit-file-upload-button {
    margin: -.375rem .85rem -.375rem -.75rem;
    padding: .58rem .95rem;
    color: #111827 !important;
    background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2)) !important;
    border: 0 !important;
    border-right: 1px solid rgba(245,158,11,.45) !important;
    font-weight: 750;
}

input:-webkit-autofill {
    -webkit-text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* BUTTONS */

.btn-primary {
    background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2)) !important;
    border-color: var(--cm-gold) !important;
    color: #111827 !important;
    font-weight: 750;
}

    .btn-primary:hover,
    .btn-primary:focus {
        background: linear-gradient(135deg, #d97706, var(--cm-gold)) !important;
        color: #111827 !important;
    }

.btn-outline-primary {
    color: var(--cm-gold-2) !important;
    border-color: rgba(245,158,11,.55) !important;
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus {
        background: rgba(245,158,11,.14) !important;
        color: #ffffff !important;
        border-color: var(--cm-gold) !important;
    }

.btn-outline-light {
    color: #f8fafc !important;
    border-color: rgba(255,255,255,.35) !important;
}

    .btn-outline-light:hover {
        background: rgba(255,255,255,.10) !important;
    }

.btn-danger,
.btn-outline-danger:hover {
    color: #ffffff !important;
}

/* ALERTS / BADGES */

.app-alert,
.app-alert-danger {
    border-radius: 1rem;
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
    font-weight: 650;
    line-height: 1.45;
    box-shadow: var(--cm-alert-shadow, 0 12px 30px rgba(15,23,42,.08));
}

.app-alert {
    border: 1px solid var(--cm-alert-success-border, rgba(52,211,153,.35));
    background: var(--cm-alert-success-bg, rgba(16,185,129,.12));
    color: var(--cm-alert-success-text, #bbf7d0);
}

.app-alert-danger {
    border: 1px solid var(--cm-alert-danger-border, rgba(248,113,113,.42));
    background: var(--cm-alert-danger-bg, rgba(127,29,29,.28));
    color: var(--cm-alert-danger-text, #fecaca);
}

.app-alert-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.app-alert-title {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-weight: 700;
    line-height: 1.45;
}

.app-alert-title i {
    margin-top: .15rem;
    color: var(--cm-alert-danger-accent, #fca5a5);
}

.app-alert-count {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--cm-alert-danger-chip-border, rgba(248,113,113,.35));
    background: var(--cm-alert-danger-chip-bg, rgba(248,113,113,.12));
    color: var(--cm-alert-danger-chip-text, #fee2e2);
    font-size: .82rem;
    font-weight: 700;
    padding: .2rem .65rem;
    white-space: nowrap;
}

.app-alert-details {
    margin-top: .85rem;
}

.app-alert-details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--cm-alert-danger-chip-text, #fee2e2);
    margin-bottom: .6rem;
}

.app-alert-list {
    margin: 0;
    padding-left: 1.5rem;
    max-height: 18rem;
    overflow: auto;
}

.app-alert-list li {
    padding: .35rem 0;
    border-bottom: 1px solid rgba(248,113,113,.16);
    line-height: 1.45;
}

.app-alert-list li:last-child {
    border-bottom: 0;
}

.app-alert-more {
    margin-top: .75rem;
    color: var(--cm-alert-danger-text, #fecaca);
    font-size: .92rem;
}

.badge-soft {
    border: 1px solid var(--cm-border);
    background: rgba(255,255,255,.06);
    color: #e2e8f0;
}

/* GLOBAL BOOTSTRAP SURFACE FIXES */

.bg-white,
.bg-light,
.list-group,
.list-group-item {
    background: rgba(17,24,39,.96) !important;
    color: #f8fafc !important;
    border-color: rgba(255,255,255,.10) !important;
}

    .bg-white *,
    .bg-light * {
        color: inherit;
    }

.shadow,
.rounded,
.rounded-3 {
    color: #f8fafc !important;
}

/* TOM SELECT - SEARCHABLE DROPDOWNS */

select.tomselected {
    display: none !important;
}

.ts-wrapper,
.ts-wrapper.single,
.ts-wrapper.form-select {
    width: 100%;
    position: relative !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

    .ts-wrapper.single .ts-control {
        width: 100% !important;
        min-height: 38px !important;
        padding: .45rem 2rem .45rem .75rem !important;
        background-color: #020617 !important;
        color: #ffffff !important;
        border: 1px solid rgba(148,163,184,.30) !important;
        border-radius: .45rem !important;
        box-shadow: none !important;
        cursor: pointer !important;
        background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%) !important;
        background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50% !important;
        background-size: 5px 5px, 5px 5px !important;
        background-repeat: no-repeat !important;
    }

    .ts-wrapper.single.focus .ts-control,
    .ts-wrapper.single.dropdown-active .ts-control {
        border-color: var(--cm-gold) !important;
        box-shadow: 0 0 0 .2rem rgba(245,158,11,.22) !important;
        background-image: linear-gradient(45deg, transparent 50%, var(--cm-gold) 50%), linear-gradient(135deg, var(--cm-gold) 50%, transparent 50%) !important;
    }

.ts-control .item {
    color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ts-control > input {
    position: absolute !important;
    opacity: 0 !important;
    width: 100% !important;
    height: 100% !important;
    inset: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    cursor: pointer !important;
}

.ts-dropdown {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 9999 !important;
    padding: .35rem !important;
    background: #111827 !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    border-radius: .5rem !important;
    box-shadow: 0 18px 45px rgba(0,0,0,.45) !important;
}

    .ts-dropdown .dropdown-input-wrap {
        padding-bottom: .35rem !important;
        margin-bottom: .25rem !important;
        border-bottom: 1px solid rgba(255,255,255,.10);
    }

    .ts-dropdown .dropdown-input {
        display: block !important;
        width: 100% !important;
        height: 34px !important;
        margin: 0 !important;
        padding: .4rem .6rem !important;
        background: #020617 !important;
        color: #ffffff !important;
        border: 1px solid var(--cm-gold) !important;
        border-radius: .35rem !important;
        box-shadow: none !important;
        opacity: 1 !important;
        position: static !important;
    }

    .ts-dropdown .option {
        color: #f8fafc !important;
        background: transparent !important;
        padding: .5rem .65rem !important;
        border-radius: .35rem !important;
        cursor: pointer;
    }

        .ts-dropdown .option.active,
        .ts-dropdown .option:hover {
            background: rgba(245,158,11,.18) !important;
            color: #ffffff !important;
        }

    .ts-dropdown .no-results {
        color: var(--cm-muted-2) !important;
        padding: .5rem .65rem !important;
    }

/* UNAUTHENTICATED / LOGIN / LANDING */

body.competition-shell:not(:has(.dashboard-sidebar)) .dashboard-shell {
    display: flex !important;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

body.competition-shell:not(:has(.dashboard-sidebar)) .dashboard-main {
    width: 100% !important;
    max-width: 520px !important;
    padding: 0;
}

    body.competition-shell:not(:has(.dashboard-sidebar)) .dashboard-main > .d-flex.justify-content-end {
        display: none !important;
    }

body.competition-shell:not(:has(.dashboard-sidebar)) .row {
    display: block !important;
}

body.competition-shell:not(:has(.dashboard-sidebar)) [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
}

body.competition-shell:not(:has(.dashboard-sidebar)) .card,
body.competition-shell:not(:has(.dashboard-sidebar)) .bg-white,
body.competition-shell:not(:has(.dashboard-sidebar)) .bg-light {
    width: 100% !important;
    min-width: 380px;
    padding: 1.75rem;
    background: rgba(17,24,39,.96) !important;
    color: var(--cm-text) !important;
    border: 1px solid var(--cm-border) !important;
}

body.competition-shell:not(:has(.dashboard-sidebar)) h1,
body.competition-shell:not(:has(.dashboard-sidebar)) h2,
body.competition-shell:not(:has(.dashboard-sidebar)) h3,
body.competition-shell:not(:has(.dashboard-sidebar)) h4,
body.competition-shell:not(:has(.dashboard-sidebar)) h5,
body.competition-shell:not(:has(.dashboard-sidebar)) h6 {
    color: #ffffff !important;
    white-space: normal;
}

body.competition-shell:not(:has(.dashboard-sidebar)) p,
body.competition-shell:not(:has(.dashboard-sidebar)) .lead,
body.competition-shell:not(:has(.dashboard-sidebar)) .text-muted {
    color: var(--cm-muted) !important;
}

/* RESPONSIVE */

@media (max-width: 991px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
        min-height: auto;
    }
}

@media (max-width: 520px) {
    body.competition-shell:not(:has(.dashboard-sidebar)) .card,
    body.competition-shell:not(:has(.dashboard-sidebar)) .bg-white,
    body.competition-shell:not(:has(.dashboard-sidebar)) .bg-light {
        min-width: 0;
    }

    .dashboard-shell {
        padding: .75rem;
    }

    .dashboard-main {
        padding: .5rem;
    }
}

/* Registration readonly/autofill visibility fixes */
.form-control[readonly],
.form-select:disabled,
.searchable-select__button:disabled,
.registration-readonly-field {
    background-color: rgba(15, 23, 42, .92) !important;
    color: #cbd5e1 !important;
    border-color: rgba(245, 158, 11, .55) !important;
    cursor: not-allowed;
    opacity: 1 !important;
}

.form-control[readonly]::placeholder {
    color: #94a3b8 !important;
}

.category-auto-readonly:disabled,
.category-auto-readonly:disabled + .searchable-select__button {
    background-image: linear-gradient(135deg, rgba(245, 158, 11, .10), rgba(15, 23, 42, .92)) !important;
}

input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.7);
    opacity: 1;
    cursor: pointer;
}

input[type="date"].form-control[readonly]::-webkit-calendar-picker-indicator {
    cursor: not-allowed;
}

/* Responsive data views: desktop table + mobile cards */
.cm-data-view {
    width: 100%;
}

.cm-data-tools {
    display: grid;
    grid-template-columns: minmax(8rem, auto) minmax(12rem, 22rem) auto;
    gap: .75rem;
    align-items: end;
    margin-bottom: .85rem;
    padding: .85rem;
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    background: rgba(17,24,39,.92);
}

.cm-data-tools__summary {
    color: #ffffff;
    font-weight: 750;
    white-space: nowrap;
}

.cm-data-tools__global {
    min-width: 0;
}

.cm-data-tools__fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .65rem;
}

.cm-data-filter-field {
    display: grid;
    gap: .25rem;
    min-width: 0;
    margin: 0;
}

.cm-data-filter-field span {
    color: var(--cm-muted);
    font-size: .75rem;
    font-weight: 750;
}

.cm-data-clear {
    justify-self: end;
}

.cm-data-cards {
    display: none;
}

.cm-data-empty {
    margin-top: .75rem;
    padding: 1rem;
    border: 1px dashed rgba(148,163,184,.35);
    border-radius: 1rem;
    color: var(--cm-muted);
    background: rgba(2,6,23,.45);
    text-align: center;
}

.cm-data-card {
    display: grid;
    gap: .85rem;
    padding: 1rem;
    border: 1px solid var(--cm-border);
    border-radius: 1.1rem;
    background: linear-gradient(180deg, rgba(17,24,39,.96), rgba(15,23,42,.94));
    box-shadow: 0 14px 34px rgba(0,0,0,.20);
}

.cm-data-card__header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    text-align: left;
}

.cm-data-card__header:focus-visible {
    outline: 2px solid rgba(245,158,11,.85);
    outline-offset: 4px;
    border-radius: .65rem;
}

.cm-data-card__title {
    min-width: 0;
    color: #ffffff;
    font-weight: 850;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.cm-data-card__indicator {
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(148,163,184,.28);
    border-radius: 999px;
    color: var(--cm-gold-2);
    background: rgba(2,6,23,.45);
    transition: transform .18s ease, background .18s ease;
}

.cm-data-card.is-expanded .cm-data-card__indicator {
    transform: rotate(180deg);
    background: rgba(245,158,11,.14);
}

.cm-data-card__details {
    display: none;
    gap: .55rem;
}

.cm-data-card.is-expanded .cm-data-card__details {
    display: grid;
}

.cm-data-card__item {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
    padding: .45rem 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.cm-data-card__item:last-child {
    border-bottom: 0;
}

.cm-data-card__label {
    color: var(--cm-muted-2);
    font-size: .74rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.cm-data-card__value {
    min-width: 0;
    color: #f8fafc;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cm-data-card__actions {
    display: none;
    flex-wrap: wrap;
    gap: .5rem;
    padding-top: .8rem;
    border-top: 1px solid rgba(255,255,255,.08);
}

.cm-data-card.is-expanded .cm-data-card__actions {
    display: flex;
}

.cm-data-card__actions > td,
.cm-data-card__actions > th {
    display: contents;
}

.cm-data-card__actions .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.cm-data-card__actions .btn,
.cm-data-card__actions form,
.cm-data-card__actions button {
    width: auto;
}


body.competition-shell .mark-sheet-scan-page .cm-mscan-file-result-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-file-result-card {
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    background: var(--cm-surface);
    overflow: hidden;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-file-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--cm-border);
    background: rgba(37, 99, 235, .05);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-file-result-kicker {
    color: var(--cm-muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-file-result-title {
    color: var(--cm-text);
    font-weight: 900;
    overflow-wrap: anywhere;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-file-result-card .table-responsive {
    margin: 0;
}

@media (max-width: 1199.98px) {
    .cm-data-tools {
        grid-template-columns: 1fr;
    }

    .cm-data-clear {
        justify-self: stretch;
    }
}

@media (max-width: 1199.98px) {
    .cm-data-view > .table-responsive {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .cm-data-view > .table-responsive > table,
    .cm-data-view > table {
        display: none !important;
    }

    .cm-data-cards {
        display: grid;
        gap: .85rem;
    }

    .cm-data-tools {
        position: sticky;
        top: .5rem;
        z-index: 4;
        margin-bottom: .85rem;
    }

    .cm-data-tools__fields {
        grid-template-columns: 1fr;
    }

    .cm-data-card__actions .btn-group,
    .cm-data-card__actions .btn {
        width: 100%;
    }
}

.cm-data-tools--server {
    grid-template-columns: minmax(8rem, auto) minmax(0, 1fr);
}

.cm-data-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: end;
}

.cm-data-filter-actions .btn,
.cm-data-filter-actions button {
    min-height: calc(1.5em + .5rem + 2px);
}

@media (max-width: 1199.98px) {
    .cm-data-filter-actions,
    .cm-data-filter-actions .btn,
    .cm-data-filter-actions button,
    .cm-data-filter-actions a {
        width: 100%;
    }
}


@media (max-width: 420px) {
    .cm-data-card__item {
        grid-template-columns: 1fr;
        gap: .18rem;
    }

    .cm-data-card__label {
        white-space: normal;
    }
}

/* Mobile menu + collapsible filters */
.mobile-app-bar,
.mobile-menu-backdrop {
    display: none;
}

@media (max-width: 1199.98px) {
    .mobile-app-bar {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .75rem .9rem;
        border: 1px solid var(--cm-border);
        border-radius: 1rem;
        background: rgba(17,24,39,.96);
        box-shadow: 0 14px 34px rgba(0,0,0,.22);
    }

    .mobile-menu-toggle {
        width: 2.35rem;
        height: 2.35rem;
        display: grid;
        place-items: center;
        border: 1px solid rgba(245,158,11,.45);
        border-radius: .8rem;
        color: #111827;
        background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2));
        font-size: 1.35rem;
        line-height: 1;
    }

    .mobile-app-title {
        color: #ffffff;
        font-weight: 850;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .dashboard-sidebar {
        position: fixed;
        top: .75rem;
        bottom: .75rem;
        left: .75rem;
        width: min(20rem, calc(100vw - 1.5rem));
        min-height: 0;
        z-index: 1051;
        overflow-y: auto;
        transform: translateX(calc(-100% - 1rem));
        transition: transform .2s ease;
    }

    body.mobile-menu-open .dashboard-sidebar {
        transform: translateX(0);
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(2,6,23,.68);
        backdrop-filter: blur(2px);
    }

    body.mobile-menu-open .mobile-menu-backdrop {
        display: block;
    }
}

.cm-data-filter-toggle,
.cm-data-apply-filter {
    display: none;
}

@media (max-width: 1199.98px) {
    .cm-data-tools {
        align-items: stretch;
    }

    .cm-data-filter-toggle,
    .cm-data-apply-filter {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .cm-data-filter-toggle {
        justify-self: stretch;
    }

    .cm-data-tools.cm-filters-collapsed .cm-data-tools__global,
    .cm-data-tools.cm-filters-collapsed .cm-data-tools__fields,
    .cm-data-tools.cm-filters-collapsed .cm-data-clear,
    .cm-data-tools.cm-filters-collapsed .cm-data-apply-filter {
        display: none !important;
    }
}


/* ==========================================================
   FINAL RESPONSIVE DATA VIEW CONTROL
   Tablet/mobile must use cards only. Desktop uses tables only.
   This is intentionally placed at the end to override Bootstrap.
   ========================================================== */
@media (max-width: 1199.98px) {
    .cm-data-view > .table-responsive,
    .cm-data-view > table,
    .cm-table-wrapper,
    .cm-data-view .cm-table-wrapper,
    .cm-data-view .table-responsive {
        display: none !important;
        overflow: hidden !important;
    }

    .cm-data-view > .cm-data-cards {
        display: grid !important;
        gap: .85rem;
    }

    .cm-data-card__item {
        display: grid !important;
        grid-template-columns: 140px minmax(0, 1fr) !important;
        gap: .75rem !important;
        align-items: start !important;
    }

    .cm-data-card__value {
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
        white-space: normal !important;
    }
}

@media (min-width: 1200px) {
    .cm-data-view > .cm-data-cards,
    .cm-data-view > .cm-data-empty {
        display: none !important;
    }

    .cm-data-view > .table-responsive,
    .cm-data-view > table {
        display: block !important;
    }
}

@media (max-width: 420px) {
    .cm-data-card__item {
        grid-template-columns: 1fr !important;
        gap: .18rem !important;
    }
}

/* ================================
   TABLET LAYOUT FIX
   Below desktop, do not reserve sidebar/grid space.
   Sidebar becomes overlay and page content uses full width.
   ================================ */
@media (max-width: 1199.98px) {
    .dashboard-shell {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .85rem !important;
        padding: .85rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .mobile-app-bar {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .dashboard-main {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 1rem !important;
    }

    .dashboard-sidebar {
        grid-column: auto !important;
        position: fixed !important;
        top: .75rem !important;
        bottom: .75rem !important;
        left: .75rem !important;
        width: min(20rem, calc(100vw - 1.5rem)) !important;
        min-height: 0 !important;
        z-index: 1051 !important;
        overflow-y: auto !important;
        transform: translateX(calc(-100% - 1rem)) !important;
        transition: transform .2s ease !important;
    }

    body.mobile-menu-open .dashboard-sidebar {
        transform: translateX(0) !important;
    }
}

@media (max-width: 520px) {
    .dashboard-shell {
        padding: .6rem !important;
    }

    .dashboard-main {
        padding: .5rem !important;
    }
}

/* ================================
   TABLET HEADER FIX - v8
   Use a real single-column layout below desktop.
   The mobile app bar must stay compact, not stretch like the desktop sidebar.
   ================================ */
@media (max-width: 1199.98px) {
    .dashboard-shell {
        display: block !important;
        min-height: 100vh !important;
        padding: .85rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .mobile-app-bar {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        padding: .75rem .9rem !important;
        margin: 0 0 1rem 0 !important;
        align-self: auto !important;
    }

    .dashboard-main {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 1rem !important;
    }

    .dashboard-sidebar {
        display: block !important;
        position: fixed !important;
        top: .75rem !important;
        bottom: .75rem !important;
        left: .75rem !important;
        width: min(20rem, calc(100vw - 1.5rem)) !important;
        height: auto !important;
        min-height: 0 !important;
        z-index: 1051 !important;
        overflow-y: auto !important;
        transform: translateX(calc(-100% - 1rem)) !important;
        transition: transform .2s ease !important;
    }

    body.mobile-menu-open .dashboard-sidebar {
        transform: translateX(0) !important;
    }
}

@media (max-width: 520px) {
    .dashboard-shell {
        padding: .6rem !important;
    }

    .dashboard-main {
        padding: .5rem !important;
    }

    .mobile-app-bar {
        margin-bottom: .75rem !important;
    }
}

@media (min-width: 1200px) {
    .cm-data-tools {
        grid-template-columns: auto minmax(220px, 340px) minmax(0, 1fr) auto !important;
        align-items: end !important;
    }

    .cm-data-tools__summary {
        align-self: center !important;
    }

    .cm-data-tools__global {
        min-width: 0 !important;
    }

    .cm-data-tools__fields {
        min-width: 0 !important;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    }

    .cm-data-clear {
        justify-self: end !important;
    }

    .cm-data-tools--server {
        grid-template-columns: auto minmax(0, 1fr) !important;
    }
}

/* ================================
   MOBILE DATA CARD LABEL/VALUE FIX
   Prevent long table header labels from overlapping values.
   Must stay at the end of the CSS file.
   ================================ */
@media (max-width: 1199.98px) {
    .cm-data-card,
    .cm-data-card__details,
    .cm-data-card__item,
    .cm-data-card__label,
    .cm-data-card__value {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .cm-data-card__details {
        width: 100% !important;
    }

    .cm-data-card__item {
        display: grid !important;
        grid-template-columns: minmax(0, 42%) minmax(0, 58%) !important;
        column-gap: .85rem !important;
        row-gap: .15rem !important;
        align-items: start !important;
        width: 100% !important;
    }

    .cm-data-card__label,
    .cm-data-card__value {
        display: block !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    .cm-data-card__label {
        line-height: 1.25 !important;
    }

    .cm-data-card__value {
        line-height: 1.35 !important;
        text-align: left !important;
    }
}

@media (max-width: 360px) {
    .cm-data-card__item {
        grid-template-columns: 1fr !important;
    }
}

/* ================================
   MOBILE DATA CARD ACTION BUTTONS
   Modern action area: same row when space allows, wraps cleanly on narrow screens.
   Keep this at the end of the CSS file.
   ================================ */
@media (max-width: 1199.98px) {
    .cm-data-card__actions {
        display: none !important;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
        gap: .55rem !important;
        align-items: stretch !important;
        padding-top: .85rem !important;
        margin-top: .35rem !important;
    }

    .cm-data-card.is-expanded .cm-data-card__actions {
        display: grid !important;
    }

    .cm-data-card__actions > td,
    .cm-data-card__actions > th {
        display: contents !important;
    }

    .cm-data-card__actions .btn-group {
        display: contents !important;
    }

    .cm-data-card__actions form {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .cm-data-card__actions .btn,
    .cm-data-card__actions button,
    .cm-data-card__actions a.btn {
        width: 100% !important;
        min-height: 2.15rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: .45rem !important;
        font-weight: 700 !important;
    }
}

@media (max-width: 380px) {
    .cm-data-card__actions {
        grid-template-columns: 1fr !important;
    }
}

/* ================================
   SIDEBAR INNER ACCORDION RESTORE
   Keeps section dropdowns in the same dark pill design.
   Must stay after Bootstrap/reset overrides.
   ================================ */
.side-nav-section-group {
    display: grid !important;
    gap: .35rem !important;
    margin: .35rem 0 !important;
}

.side-nav-section-toggle {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 100% !important;
    min-height: 2.65rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .7rem !important;
    padding: .75rem 1rem !important;
    border: 0 !important;
    border-radius: 1rem !important;
    background: rgba(255, 255, 255, .045) !important;
    color: var(--cm-text) !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: .9rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    text-transform: none !important;
    cursor: pointer !important;
}

.side-nav-section-toggle:hover,
.side-nav-section-toggle:focus,
.side-nav-section-toggle:active {
    background: rgba(255, 255, 255, .075) !important;
    color: var(--cm-text) !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.side-nav-section-toggle span {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
}

.side-nav-section-toggle .side-nav-chevron {
    flex: 0 0 auto !important;
    color: var(--cm-gold) !important;
    font-size: .85rem !important;
    transition: transform .18s ease !important;
}

.side-nav-section-toggle[aria-expanded="true"] .side-nav-chevron {
    transform: rotate(180deg) !important;
}

.side-nav-section-items {
    display: grid !important;
    gap: .35rem !important;
    padding: .2rem 0 .35rem .65rem !important;
    margin: 0 !important;
}

.side-nav-section-items .side-nav-subitem {
    width: 100% !important;
    min-height: 2.65rem !important;
    display: flex !important;
    align-items: center !important;
    gap: .65rem !important;
    padding: .75rem 1rem !important;
    border-radius: 1rem !important;
    background: rgba(255, 255, 255, .035) !important;
    color: var(--cm-text) !important;
    text-decoration: none !important;
    font-size: .88rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
}

.side-nav-section-items .side-nav-subitem:hover,
.side-nav-section-items .side-nav-subitem:focus {
    background: rgba(255, 255, 255, .075) !important;
    color: var(--cm-text) !important;
}

.side-nav-section-items .side-nav-subitem i {
    color: var(--cm-gold) !important;
}

/* ================================
   SIDEBAR ACCORDION FINAL FIX
   Restores dark parent/child design and keeps Bootstrap collapse working.
   Keep this block at the end of the file.
   ================================ */
.dashboard-sidebar .side-nav button.side-nav-toggle,
.dashboard-sidebar .side-nav button.side-nav-section-toggle {
    appearance: none !important;
    -webkit-appearance: none !important;
    font-family: inherit !important;
    box-shadow: none !important;
    outline: 0 !important;
    cursor: pointer !important;
}

.dashboard-sidebar .side-nav button.side-nav-toggle {
    width: 100% !important;
    min-height: 3.05rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .75rem !important;
    padding: .85rem .95rem !important;
    border: 1px solid transparent !important;
    border-radius: 1rem !important;
    background: rgba(255,255,255,.045) !important;
    color: #e5e7eb !important;
    text-align: left !important;
    font-size: .95rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    transition: .18s ease !important;
}

.dashboard-sidebar .side-nav button.side-nav-toggle:hover,
.dashboard-sidebar .side-nav button.side-nav-toggle:focus {
    transform: translateX(4px) !important;
    color: #ffffff !important;
    background: rgba(245,158,11,.12) !important;
    border-color: rgba(245,158,11,.22) !important;
}

.dashboard-sidebar .side-nav button.side-nav-toggle span {
    display: inline-flex !important;
    align-items: center !important;
    gap: .75rem !important;
    min-width: 0 !important;
}

.dashboard-sidebar .side-nav button.side-nav-toggle i,
.dashboard-sidebar .side-nav button.side-nav-section-toggle i,
.dashboard-sidebar .side-nav .side-nav-subitem i {
    color: var(--cm-gold) !important;
}

.dashboard-sidebar .side-nav .side-nav-chevron {
    flex: 0 0 auto !important;
    font-size: .85rem !important;
    transition: transform .18s ease !important;
}

.dashboard-sidebar .side-nav button[aria-expanded="true"] .side-nav-chevron {
    transform: rotate(180deg) !important;
}

.dashboard-sidebar .side-nav .side-nav-submenu {
    padding: .35rem 0 .5rem .65rem !important;
    margin: 0 !important;
}

.dashboard-sidebar .side-nav .side-nav-submenu.collapse:not(.show),
.dashboard-sidebar .side-nav .side-nav-section-items.collapse:not(.show) {
    display: none !important;
}

.dashboard-sidebar .side-nav .side-nav-submenu.collapse.show,
.dashboard-sidebar .side-nav .side-nav-section-items.collapse.show,
.dashboard-sidebar .side-nav .side-nav-submenu.collapsing,
.dashboard-sidebar .side-nav .side-nav-section-items.collapsing {
    display: grid !important;
}

.dashboard-sidebar .side-nav .side-nav-submenu,
.dashboard-sidebar .side-nav .side-nav-section-items {
    gap: .35rem !important;
}

.dashboard-sidebar .side-nav .side-nav-section-group {
    display: grid !important;
    gap: .35rem !important;
    margin: .45rem 0 !important;
}

.dashboard-sidebar .side-nav button.side-nav-section-toggle {
    width: 100% !important;
    min-height: 2.35rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .65rem !important;
    padding: .55rem .75rem !important;
    border: 1px solid transparent !important;
    border-radius: .85rem !important;
    background: rgba(255,255,255,.035) !important;
    color: var(--cm-muted-2) !important;
    text-align: left !important;
    font-size: .72rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: .055em !important;
    text-transform: uppercase !important;
    transition: .18s ease !important;
}

.dashboard-sidebar .side-nav button.side-nav-section-toggle:hover,
.dashboard-sidebar .side-nav button.side-nav-section-toggle:focus,
.dashboard-sidebar .side-nav button.side-nav-section-toggle[aria-expanded="true"] {
    background: rgba(255,255,255,.06) !important;
    color: #ffffff !important;
    border-color: rgba(255,255,255,.06) !important;
}

.dashboard-sidebar .side-nav .side-nav-section-items {
    padding: .1rem 0 .35rem .45rem !important;
    margin: 0 !important;
}

.dashboard-sidebar .side-nav .side-nav-subitem,
.dashboard-sidebar .side-nav .side-nav-submenu a.side-nav-subitem,
.dashboard-sidebar .side-nav .side-nav-section-items .side-nav-subitem {
    width: 100% !important;
    min-height: 2.65rem !important;
    display: flex !important;
    align-items: center !important;
    gap: .7rem !important;
    padding: .72rem .9rem !important;
    border: 1px solid transparent !important;
    border-radius: 1rem !important;
    background: rgba(255,255,255,.035) !important;
    color: #e5e7eb !important;
    text-decoration: none !important;
    font-size: .88rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    transition: .18s ease !important;
}

.dashboard-sidebar .side-nav .side-nav-subitem:hover,
.dashboard-sidebar .side-nav .side-nav-subitem:focus {
    transform: translateX(4px) !important;
    color: #ffffff !important;
    background: rgba(245,158,11,.12) !important;
    border-color: rgba(245,158,11,.22) !important;
}

/* =========================================================
   GLOBAL EVENT DAY / STAGE UI
   Shared stage card, accordion, category card, and stage assignment styles.
   Keep these styles global so every stage-related page uses the same layout.
   ========================================================= */

.event-stage-board-list {
    display: grid;
    gap: 1rem;
}

.event-stage-item-card {
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(15, 23, 42, .78);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
}

.event-stage-item-toggle {
    width: 100%;
    border: 0;
    color: #f8fafc;
    background: linear-gradient(135deg, rgba(30, 41, 59, .98), rgba(15, 23, 42, .96));
    padding: 1rem 1.15rem;
    text-align: left;
}

.event-stage-item-toggle:hover,
.event-stage-item-toggle:focus {
    background: linear-gradient(135deg, rgba(51, 65, 85, .98), rgba(15, 23, 42, .98));
    outline: none;
}

.event-stage-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.event-stage-item-title-row {
    display: flex;
    align-items: baseline;
    gap: .65rem;
    flex-wrap: wrap;
    min-width: 0;
}

.event-stage-item-title {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .01em;
    line-height: 1.2;
    margin: 0;
}

.event-stage-item-meta {
    color: #cbd5e1;
    font-size: .875rem;
    margin: 0;
    white-space: nowrap;
}

.event-stage-item-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
    justify-content: flex-end;
}

.event-stage-item-status {
    font-size: .75rem;
    padding: .25rem .55rem;
    font-weight: 700;
}

.event-stage-item-chevron-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.event-stage-item-chevron {
    color: #fbbf24;
    font-size: 1rem;
    transition: transform .2s ease-in-out;
}

.event-stage-item-toggle[aria-expanded="true"] .event-stage-item-chevron {
    transform: rotate(180deg);
}

.event-stage-item-body {
    padding: 1rem;
    background: rgba(2, 6, 23, .55);
    border-top: 1px solid rgba(148, 163, 184, .18);
}

.event-stage-category-row {
    display: grid;
    grid-template-columns: minmax(110px, .7fr) minmax(220px, 2fr) minmax(130px, .8fr) minmax(110px, .7fr) auto;
    gap: .85rem;
    align-items: center;
    padding: .9rem 1rem;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: .85rem;
    background: rgba(15, 23, 42, .82);
}

.event-stage-category-row + .event-stage-category-row {
    margin-top: .75rem;
}

.event-stage-category-label {
    display: block;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .25rem;
}

.event-stage-category-value {
    color: #f8fafc;
    font-weight: 700;
}

.event-stage-progress-pill {
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 999px;
    padding: .35rem .65rem;
    color: #f8fafc;
    background: rgba(2, 6, 23, .36);
    font-weight: 700;
    display: inline-flex;
    min-width: 70px;
    justify-content: center;
}

.event-stage-category-action {
    text-align: right;
}

@media (max-width: 991.98px) {
    .event-stage-category-row {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

    .event-stage-category-action {
        grid-column: 1 / -1;
        text-align: left;
    }

    .event-stage-category-action .btn {
        width: 100%;
        margin-top: .25rem;
    }
}

@media (max-width: 575.98px) {
    .event-stage-item-toggle {
        padding: .95rem;
    }

    .event-stage-item-header {
        display: block;
    }

    .event-stage-item-title-row {
        display: block;
    }

    .event-stage-item-meta {
        display: block;
        margin-top: .25rem;
        white-space: normal;
    }

    .event-stage-item-header-right {
        width: 100%;
        justify-content: space-between;
        margin-top: .75rem;
    }

    .event-stage-item-status {
        font-size: .68rem;
        padding: .18rem .45rem;
    }

    .event-stage-category-row {
        grid-template-columns: 1fr;
        padding: .85rem;
    }
}

/* Stage assignment pages */

.stage-page-header {
    margin-bottom: 1.25rem;
}

.stage-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stage-readonly-box {
    border: 1px solid rgba(245, 158, 11, .75);
    border-radius: 8px;
    padding: .55rem .75rem;
    background: rgba(2, 6, 23, .35);
    color: #f8fafc;
}

.stage-assignment-wrapper {
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 18px;
    background: rgba(15, 23, 42, .72);
    overflow: visible;
}

.stage-assignment-title {
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.035);
}

.stage-card-list {
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 22px;
}

.stage-assignment-card {
    border: 3px solid rgba(34, 211, 238, .85);
    border-radius: 18px;
    background: #0f172a;
    box-shadow: 0 14px 34px rgba(0,0,0,.6);
    overflow: visible;
}

.stage-assignment-card:nth-child(even) {
    border-color: rgba(245, 158, 11, .85);
}

.stage-assignment-header {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(90deg, rgba(34,211,238,.20), rgba(255,255,255,.04));
    border-bottom: 2px solid rgba(255,255,255,.18);
}

.stage-assignment-card:nth-child(even) .stage-assignment-header {
    background: linear-gradient(90deg, rgba(245,158,11,.20), rgba(255,255,255,.04));
}

.stage-assignment-item-name {
    font-weight: 800;
    font-size: 1.08rem;
    color: #f8fafc;
}

.stage-program-badge {
    display: inline-block;
    margin-top: .45rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    border: 1px solid rgba(34,211,238,.55);
    color: #67e8f9;
    background: rgba(34,211,238,.16);
}

.stage-assignment-card:nth-child(even) .stage-program-badge {
    border-color: rgba(245,158,11,.55);
    color: #fbbf24;
    background: rgba(245,158,11,.16);
}

.stage-default-box label,
.stage-category-box label {
    font-weight: 700;
    color: #e5e7eb;
}

.stage-default-help {
    margin-top: .35rem;
    font-size: .78rem;
    color: #94a3b8;
}

.stage-category-section {
    padding: 1rem;
    background: rgba(255,255,255,.025);
}

.stage-category-title {
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: .85rem;
}

.stage-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: .9rem;
}

.stage-category-box {
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 14px;
    padding: .9rem;
    background: rgba(2, 6, 23, .58);
    position: relative;
}

.stage-category-box:hover {
    border-color: rgba(34,211,238,.6);
    background: rgba(2, 6, 23, .72);
}

.stage-assignment-card:nth-child(even) .stage-category-box:hover {
    border-color: rgba(245,158,11,.6);
}

.stage-default-box {
    position: relative;
}

.stage-category-box .searchable-select,
.stage-default-box .searchable-select {
    position: relative;
    z-index: 20;
}

.stage-category-box .searchable-select.open,
.stage-default-box .searchable-select.open {
    z-index: 9999;
}

@media (max-width: 992px) {
    .stage-filter-grid,
    .stage-assignment-header,
    .stage-category-grid {
        grid-template-columns: 1fr;
    }

    .stage-card-list {
        padding: 1rem;
        gap: 1rem;
    }
}

/* ================================
   FINAL TABLE FILTER LAYOUT
   Desktop: compact horizontal filters.
   Tablet/mobile: stacked collapsible filters.
   Keep this at the very end of the file.
   ================================ */

/* The global filter bar no longer uses Search all fields. */
.cm-data-tools__global {
    display: none !important;
}

.cm-data-tools__summary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 2rem !important;
    padding: .35rem .7rem !important;
    border: 1px solid rgba(245, 158, 11, .35) !important;
    border-radius: 999px !important;
    color: var(--cm-gold-2) !important;
    background: rgba(245, 158, 11, .08) !important;
    font-size: .82rem !important;
    font-weight: 750 !important;
    white-space: nowrap !important;
}

/* Desktop / laptop */
@media (min-width: 1200px) {
    .cm-data-tools {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        gap: .75rem !important;
        align-items: end !important;
        margin-bottom: .85rem !important;
        padding: .85rem !important;
        border: 1px solid var(--cm-border) !important;
        border-radius: 1rem !important;
        background: rgba(17,24,39,.92) !important;
    }

    .cm-data-tools__fields {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .cm-data-tools__summary {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        align-self: end !important;
    }

    .cm-data-clear {
        grid-column: 3 !important;
        grid-row: 1 !important;
    }

    .cm-data-tools__fields {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(150px, 220px)) !important;
        justify-content: start !important;
        gap: .65rem !important;
        min-width: 0 !important;
    }

    .cm-data-filter-field {
        display: grid !important;
        gap: .25rem !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .cm-data-filter-field span {
        display: block !important;
        color: var(--cm-muted) !important;
        font-size: .75rem !important;
        font-weight: 750 !important;
        margin-bottom: .15rem !important;
    }

    .cm-data-filter-field .form-control,
    .cm-data-filter-field .form-select {
        width: 100% !important;
    }

    .cm-data-clear {
        justify-self: end !important;
        align-self: end !important;
        white-space: nowrap !important;
    }

    .cm-data-filter-actions {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: end !important;
        gap: .5rem !important;
        margin-left: auto !important;
    }

    .cm-data-tools--server {
        grid-template-columns: minmax(0, 1fr) auto !important;
    }

    .cm-data-tools--server .cm-data-tools__summary {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        align-self: end !important;
    }

    .cm-data-tools--server .cm-data-tools__fields {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
        align-items: end !important;
    }

    .cm-data-tools--server .cm-data-filter-actions {
        justify-self: end !important;
    }
}

/* Tablet / mobile */
@media (max-width: 1199.98px) {
    .cm-data-tools {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .7rem !important;
        align-items: stretch !important;
        margin-bottom: .85rem !important;
        padding: .85rem !important;
        border: 1px solid var(--cm-border) !important;
        border-radius: 1rem !important;
        background: rgba(17,24,39,.92) !important;
    }

    .cm-data-tools__fields {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .65rem !important;
        min-width: 0 !important;
    }

    .cm-data-tools__summary {
        width: 100% !important;
        justify-self: stretch !important;
    }

    .cm-data-filter-field {
        display: grid !important;
        gap: .25rem !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .cm-data-filter-field .form-control,
    .cm-data-filter-field .form-select {
        width: 100% !important;
    }

    .cm-data-clear,
    .cm-data-apply-filter,
    .cm-data-filter-toggle {
        width: 100% !important;
        justify-content: center !important;
    }

    .cm-data-filter-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .5rem !important;
        width: 100% !important;
    }

    .cm-data-filter-actions .btn,
    .cm-data-filter-actions button,
    .cm-data-filter-actions a {
        width: 100% !important;
    }

    .cm-data-tools.cm-filters-collapsed .cm-data-tools__fields,
    .cm-data-tools.cm-filters-collapsed .cm-data-clear,
    .cm-data-tools.cm-filters-collapsed .cm-data-apply-filter {
        display: none !important;
    }
}

/* ================================
   DESKTOP COLLAPSIBLE LEFT NAVIGATION
   Keeps mobile overlay navigation unchanged.
   ================================ */
.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.min-w-0 {
    min-width: 0 !important;
}

.sidebar-collapse-toggle {
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(245,158,11,.45);
    border-radius: .75rem;
    color: var(--cm-gold-2);
    background: rgba(245,158,11,.10);
    line-height: 1;
    transition: .18s ease;
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus {
    color: #111827;
    background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2));
    border-color: rgba(245,158,11,.7);
}

.side-nav-toggle-main {
    display: inline-flex !important;
    align-items: center !important;
    gap: .75rem !important;
    min-width: 0 !important;
}

@media (min-width: 1200px) {
    .dashboard-shell {
        transition: grid-template-columns .2s ease;
    }

    body.sidebar-collapsed .dashboard-shell {
        grid-template-columns: 5.35rem minmax(0, 1fr) !important;
    }

    body.sidebar-collapsed .dashboard-sidebar {
        padding: .85rem .65rem !important;
    }

    body.sidebar-collapsed .sidebar-brand-row {
        justify-content: center !important;
        margin-bottom: 1.05rem !important;
    }

    body.sidebar-collapsed .sidebar-brand-text,
    body.sidebar-collapsed .side-nav-label,
    body.sidebar-collapsed .side-nav-chevron,
    body.sidebar-collapsed .side-nav-submenu,
    body.sidebar-collapsed .side-nav-section-group {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    body.sidebar-collapsed .side-nav-submenu,
    body.sidebar-collapsed .side-nav-section-items {
        display: none !important;
    }

    body.sidebar-collapsed .sidebar-collapse-toggle {
        position: absolute;
        top: 1rem;
        right: -.95rem;
        z-index: 2;
        box-shadow: 0 10px 30px rgba(0,0,0,.35);
    }

    body.sidebar-collapsed .brand-mark {
        width: 3rem;
        height: 3rem;
    }

    body.sidebar-collapsed .side-nav {
        gap: .65rem !important;
        margin-top: 1.25rem !important;
    }

    body.sidebar-collapsed .side-nav a,
    body.sidebar-collapsed .dashboard-sidebar .side-nav button.side-nav-toggle {
        width: 3.4rem !important;
        height: 3.4rem !important;
        min-height: 3.4rem !important;
        justify-content: center !important;
        padding: 0 !important;
        border-radius: 1rem !important;
        gap: 0 !important;
    }

    body.sidebar-collapsed .side-nav a:hover,
    body.sidebar-collapsed .dashboard-sidebar .side-nav button.side-nav-toggle:hover,
    body.sidebar-collapsed .dashboard-sidebar .side-nav button.side-nav-toggle:focus {
        transform: translateX(0) scale(1.04) !important;
    }

    body.sidebar-collapsed .side-nav i,
    body.sidebar-collapsed .dashboard-sidebar .side-nav button.side-nav-toggle i {
        font-size: 1.25rem !important;
        margin: 0 !important;
    }
}

@media (max-width: 1199.98px) {
    .sidebar-collapse-toggle {
        display: none !important;
    }
}

/* ================================
   SIDEBAR FOOTER ACCOUNT + ARROW COLLAPSE
   ================================ */
.dashboard-sidebar {
    display: flex;
    flex-direction: column;
}

.dashboard-sidebar .side-nav {
    flex: 1 1 auto;
    align-content: start;
}

.sidebar-account-panel {
    margin-top: auto;
    padding-top: 1rem;
    display: grid;
    gap: .55rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-account-user,
.sidebar-account-action {
    width: 100%;
    min-height: 2.85rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem .9rem;
    border-radius: 1rem;
    color: #e5e7eb;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.05);
    text-decoration: none;
}

.sidebar-account-user {
    font-size: .9rem;
    font-weight: 700;
    min-width: 0;
}

.sidebar-account-user span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-action {
    justify-content: flex-start;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
}

.sidebar-account-action:hover,
.sidebar-account-action:focus {
    color: #ffffff;
    background: rgba(245,158,11,.12);
    border-color: rgba(245,158,11,.22);
}

.sidebar-account-user i,
.sidebar-account-action i {
    flex: 0 0 auto;
    color: var(--cm-gold);
    font-size: 1.1rem;
}

.sidebar-account-form {
    margin: 0;
}

@media (min-width: 1200px) {
    body.sidebar-collapsed .sidebar-account-panel {
        padding-top: .85rem !important;
    }

    body.sidebar-collapsed .sidebar-account-user,
    body.sidebar-collapsed .sidebar-account-action {
        width: 3.4rem !important;
        height: 3.4rem !important;
        min-height: 3.4rem !important;
        justify-content: center !important;
        padding: 0 !important;
        border-radius: 1rem !important;
        gap: 0 !important;
    }

    body.sidebar-collapsed .sidebar-account-user i,
    body.sidebar-collapsed .sidebar-account-action i {
        font-size: 1.25rem !important;
        margin: 0 !important;
    }
}

/* ==========================================================
   COMMON APPLICATION THEME TOKENS + RANKING FIRST PASS
   Theme is selected in _Layout using UiTheme:Theme = Dark|Light.
   Use these classes for all Event Day pages before adding page CSS.
   ========================================================== */
body.competition-shell {
    --cm-page-bg: var(--cm-bg);
    --cm-card-bg: rgba(17,24,39,.96);
    --cm-card-bg-2: rgba(15,23,42,.94);
    --cm-card-header-bg: rgba(255,255,255,.045);
    --cm-control-bg: rgba(2,6,23,.82);
    --cm-hover-bg: rgba(245,158,11,.10);
    --cm-title: #ffffff;
    --cm-link-accent: var(--cm-gold-2);
    --cm-focus-ring: rgba(245,158,11,.24);
}

body.competition-shell[data-cm-theme="light"] {
    --cm-bg: #f8fafc;
    --cm-bg-soft: #eef3f9;
    --cm-surface: #ffffff;
    --cm-surface-2: #f1f5f9;
    --cm-border: #dbe4f0;
    --cm-text: #0f172a;
    --cm-muted: #475569;
    --cm-muted-2: #64748b;
    --cm-gold: #d97706;
    --cm-gold-2: #f59e0b;
    --cm-cyan: #0891b2;
    --cm-purple: #4f46e5;
    --cm-orange: #ea580c;
    --cm-green: #059669;
    --cm-red: #dc2626;
    --cm-page-bg: #f8fafc;
    --cm-card-bg: rgba(255,255,255,.96);
    --cm-card-bg-2: #ffffff;
    --cm-card-header-bg: linear-gradient(180deg, #ffffff, #f8fbff);
    --cm-control-bg: #ffffff;
    --cm-hover-bg: rgba(49,87,213,.055);
    --cm-title: #0f172a;
    --cm-link-accent: #17318f;
    --cm-focus-ring: rgba(49,87,213,.16);

    --bs-body-bg: #f8fafc;
    --bs-body-color: #0f172a;
    --bs-secondary-color: #475569;
    --bs-tertiary-color: #64748b;
    --bs-heading-color: #0f172a;
    --bs-border-color: #dbe4f0;
    --bs-border-color-translucent: rgba(15,23,42,.12);
    --bs-card-bg: #ffffff;
    --bs-card-color: #0f172a;
    --bs-card-border-color: #dbe4f0;
    --bs-modal-bg: #ffffff;
    --bs-modal-color: #0f172a;
    --bs-modal-border-color: #dbe4f0;
    --bs-modal-header-border-color: #dbe4f0;
    --bs-modal-footer-border-color: #dbe4f0;
    --bs-link-color: #17318f;
    --bs-link-hover-color: #3157d5;

    color: #0f172a;
    background: radial-gradient(circle at top left, rgba(49,87,213,.10), transparent 30rem), radial-gradient(circle at top right, rgba(245,158,11,.10), transparent 28rem), linear-gradient(180deg, #f8fafc 0%, #eef3f9 55%, #ffffff 100%);
}

body.competition-shell[data-cm-theme="light"] .dashboard-sidebar,
body.competition-shell[data-cm-theme="light"] .mobile-app-bar {
    background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
    color: #0f172a !important;
    border-color: #dbe4f0 !important;
    box-shadow: 0 18px 45px rgba(15,23,42,.10) !important;
}

body.competition-shell[data-cm-theme="light"] .side-title,
body.competition-shell[data-cm-theme="light"] .mobile-app-title,
body.competition-shell[data-cm-theme="light"] .section-heading h5,
body.competition-shell[data-cm-theme="light"] h1,
body.competition-shell[data-cm-theme="light"] h2,
body.competition-shell[data-cm-theme="light"] h3,
body.competition-shell[data-cm-theme="light"] h4,
body.competition-shell[data-cm-theme="light"] h5,
body.competition-shell[data-cm-theme="light"] h6 {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .side-subtitle,
body.competition-shell[data-cm-theme="light"] .text-muted,
body.competition-shell[data-cm-theme="light"] .text-secondary,
body.competition-shell[data-cm-theme="light"] p.text-muted,
body.competition-shell[data-cm-theme="light"] small.text-muted,
body.competition-shell[data-cm-theme="light"] .lead {
    color: #475569 !important;
}

body.competition-shell[data-cm-theme="light"] .side-nav a,
body.competition-shell[data-cm-theme="light"] .side-nav-toggle {
    color: #334155 !important;
    background: rgba(15,23,42,.035) !important;
}

body.competition-shell[data-cm-theme="light"] .side-nav a:hover,
body.competition-shell[data-cm-theme="light"] .side-nav-toggle:hover {
    color: #0f172a !important;
    background: rgba(217,119,6,.10) !important;
    border-color: rgba(217,119,6,.22) !important;
}

body.competition-shell[data-cm-theme="light"] .side-nav a.active {
    color: #111827 !important;
}

.cm-page {
    color: var(--cm-text);
}

.cm-page-header,
.cm-filter-card,
.cm-accordion-card,
body.competition-shell .cm-page .card,
body.competition-shell .cm-page .modal-content,
body.competition-shell .cm-page .dropdown-menu {
    color: var(--cm-text) !important;
    background: var(--cm-card-bg) !important;
    border: 1px solid var(--cm-border) !important;
    border-radius: 1.2rem !important;
    box-shadow: 0 18px 48px rgba(0,0,0,.22) !important;
}

.cm-page-header {
    padding: 1rem 1.15rem;
}

body.competition-shell[data-cm-theme="light"] .cm-page-header,
body.competition-shell[data-cm-theme="light"] .cm-filter-card,
body.competition-shell[data-cm-theme="light"] .cm-accordion-card,
body.competition-shell[data-cm-theme="light"] .cm-page .card,
body.competition-shell[data-cm-theme="light"] .cm-page .modal-content,
body.competition-shell[data-cm-theme="light"] .cm-page .dropdown-menu {
    color: #0f172a !important;
    background: #ffffff !important;
    border-color: #dbe4f0 !important;
    box-shadow: 0 12px 30px rgba(15,23,42,.08) !important;
}

.cm-accordion-header,
body.competition-shell .cm-page .card-header,
body.competition-shell .cm-page .modal-header,
body.competition-shell .cm-page .modal-footer {
    color: var(--cm-title) !important;
    background: var(--cm-card-header-bg) !important;
    border-color: var(--cm-border) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-accordion-header,
body.competition-shell[data-cm-theme="light"] .cm-page .card-header,
body.competition-shell[data-cm-theme="light"] .cm-page .modal-header,
body.competition-shell[data-cm-theme="light"] .cm-page .modal-footer {
    color: #0f172a !important;
    background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
}

.cm-accordion-card--nested {
    border-radius: 1rem !important;
    box-shadow: none !important;
}

.cm-page .form-label,
.cm-page label {
    color: var(--cm-title) !important;
}

.cm-page .form-control,
.cm-page .form-select {
    background-color: var(--cm-control-bg) !important;
    color: var(--cm-text) !important;
    border-color: var(--cm-border) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page .form-label,
body.competition-shell[data-cm-theme="light"] .cm-page label {
    color: #334155 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page .form-control,
body.competition-shell[data-cm-theme="light"] .cm-page .form-select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #dbe4f0 !important;
}

.cm-page .form-control:focus,
.cm-page .form-select:focus {
    border-color: var(--cm-link-accent) !important;
    box-shadow: 0 0 0 .2rem var(--cm-focus-ring) !important;
}

/* Ranking & Publication: make it the first consumer of the common theme system. */
.cm-page--ranking .ranking-expand-toggle {
    width: 100%;
    color: var(--cm-title) !important;
    border-radius: inherit;
}

.cm-page--ranking .ranking-expand-toggle:hover,
.cm-page--ranking .ranking-expand-toggle:focus {
    color: var(--cm-title) !important;
    background: var(--cm-hover-bg) !important;
}

.cm-page--ranking .ranking-expand-indicator {
    color: var(--cm-gold-2) !important;
}

.cm-page--ranking .ranking-toggle-title,
.cm-page--ranking .ranking-toggle-title.text-primary {
    color: var(--cm-title) !important;
}

.cm-page--ranking .ranking-header-actions {
    background: transparent;
}

.cm-page--ranking .ranking-summary-line {
    color: var(--cm-text);
}

.cm-page--ranking .ranking-summary-actions .ranking-summary-filter {
    border: 1px solid rgba(255,255,255,.14) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-summary-actions .ranking-summary-filter {
    border-color: rgba(15,23,42,.12) !important;
}

.cm-page--ranking .ranking-summary-filter-active {
    outline-color: var(--cm-link-accent) !important;
    box-shadow: 0 0 0 .18rem var(--cm-focus-ring), 0 .35rem .9rem rgba(0,0,0,.14) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table {
    --bs-table-bg: transparent;
    --bs-table-color: #0f172a;
    --bs-table-border-color: #dbe4f0;
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table > :not(caption) > * > * {
    color: #0f172a !important;
    border-color: #dbe4f0 !important;
    background-color: transparent !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table thead th {
    color: #243b7a !important;
    background: #edf3ff !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table-hover tbody tr:hover,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table tbody tr:hover {
    background: rgba(49,87,213,.055) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .bg-white,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .bg-light,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .list-group,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .list-group-item {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #dbe4f0 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .btn-close {
    filter: none !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-scroll-top-btn {
    border-color: rgba(217,119,6,.45) !important;
    background: #f59e0b !important;
    color: #111827 !important;
    box-shadow: 0 .5rem 1.25rem rgba(15,23,42,.18) !important;
}

@media (max-width: 767.98px) {
    .cm-page-header {
        padding: .9rem;
    }

    .cm-page--ranking .ranking-header-actions,
    .cm-page--ranking .ranking-header-actions .btn,
    .cm-page--ranking .ranking-header-actions form {
        width: 100%;
    }

    .cm-page--ranking .ranking-header-actions {
        padding: .65rem .75rem .75rem;
    }
}

/* Ranking & Publication workflow badges and light-theme refinements */
.cm-page--ranking .ranking-summary-line {
    row-gap: .65rem !important;
}

.cm-status-chip,
.cm-page--ranking .badge.cm-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    gap: .25rem;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    font-size: .78rem;
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: .01em;
    white-space: nowrap;
}

.cm-status-info {
    color: #dbeafe !important;
    background: rgba(37,99,235,.22) !important;
    border-color: rgba(96,165,250,.34) !important;
}

.cm-status-neutral {
    color: #e2e8f0 !important;
    background: rgba(100,116,139,.22) !important;
    border-color: rgba(148,163,184,.30) !important;
}

.cm-status-action {
    color: #451a03 !important;
    background: #fbbf24 !important;
    border-color: #f59e0b !important;
}

.cm-status-active {
    color: #ffffff !important;
    background: #ea580c !important;
    border-color: #c2410c !important;
    box-shadow: 0 .25rem .75rem rgba(234,88,12,.22);
}

.cm-status-complete {
    color: #dcfce7 !important;
    background: rgba(22,163,74,.26) !important;
    border-color: rgba(34,197,94,.38) !important;
}

.cm-status-rank {
    color: #111827 !important;
    background: #facc15 !important;
    border-color: #eab308 !important;
}

.cm-status-danger {
    color: #fee2e2 !important;
    background: rgba(220,38,38,.28) !important;
    border-color: rgba(248,113,113,.42) !important;
}


.cm-page--ranking .cm-ranking-award-tie-row > td {
    background: rgba(250,204,21,.10) !important;
    border-top-color: rgba(234,179,8,.34) !important;
    border-bottom-color: rgba(234,179,8,.34) !important;
}

.cm-page--ranking .cm-ranking-award-tie-row:hover > td {
    background: rgba(250,204,21,.16) !important;
}

.cm-page--ranking .cm-ranking-tie-alert {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #713f12;
    background: #fef3c7;
    border: 1px solid #facc15;
    border-radius: 999px;
    padding: .35rem .75rem;
    font-size: .875rem;
    font-weight: 700;
}

.cm-status-rank-tie {
    box-shadow: 0 0 0 .15rem rgba(250,204,21,.28);
}

.cm-page--ranking .ranking-summary-filter {
    opacity: .92;
}

.cm-page--ranking .ranking-summary-filter:hover,
.cm-page--ranking .ranking-summary-filter:focus {
    opacity: 1;
    transform: translateY(-1px);
}

.cm-page--ranking .ranking-summary-filter-active {
    opacity: 1 !important;
    outline: 2px solid var(--cm-link-accent) !important;
    outline-offset: 2px;
}

.cm-page--ranking .ranking-category-header,
.cm-page--ranking .ranking-toggle-header {
    min-height: 3rem;
}

.cm-page--ranking .ranking-expand-toggle {
    min-height: 3rem;
    padding: .7rem .85rem;
}

.cm-page--ranking .ranking-header-actions .btn,
.cm-page--ranking .table .btn {
    font-weight: 700;
    border-radius: 999px;
}

body.competition-shell[data-cm-theme="light"] .sidebar-account-panel {
    border-top-color: rgba(15,23,42,.12) !important;
}

body.competition-shell[data-cm-theme="light"] .sidebar-account-user,
body.competition-shell[data-cm-theme="light"] .sidebar-account-action {
    color: #1e293b !important;
    background: rgba(15,23,42,.045) !important;
    border: 1px solid rgba(15,23,42,.10) !important;
    opacity: 1 !important;
}

body.competition-shell[data-cm-theme="light"] .sidebar-account-user {
    font-weight: 800;
}

body.competition-shell[data-cm-theme="light"] .sidebar-account-action {
    color: #92400e !important;
}

body.competition-shell[data-cm-theme="light"] .sidebar-account-action:hover,
body.competition-shell[data-cm-theme="light"] .sidebar-account-action:focus {
    color: #111827 !important;
    background: rgba(245,158,11,.16) !important;
    border-color: rgba(217,119,6,.32) !important;
}

body.competition-shell[data-cm-theme="light"] .sidebar-account-user i,
body.competition-shell[data-cm-theme="light"] .sidebar-account-action i {
    color: #d97706 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-status-info {
    color: #1e3a8a !important;
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
}

body.competition-shell[data-cm-theme="light"] .cm-status-neutral {
    color: #334155 !important;
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-status-action {
    color: #78350f !important;
    background: #fde68a !important;
    border-color: #f59e0b !important;
}

body.competition-shell[data-cm-theme="light"] .cm-status-active {
    color: #ffffff !important;
    background: #ea580c !important;
    border-color: #c2410c !important;
    box-shadow: 0 .25rem .75rem rgba(234,88,12,.18);
}

body.competition-shell[data-cm-theme="light"] .cm-status-complete {
    color: #065f46 !important;
    background: #d1fae5 !important;
    border-color: #a7f3d0 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-status-rank {
    color: #713f12 !important;
    background: #fef3c7 !important;
    border-color: #facc15 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-status-danger {
    color: #991b1b !important;
    background: #fee2e2 !important;
    border-color: #fecaca !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table thead th {
    color: #1e3a8a !important;
    background: #eef4ff !important;
    border-bottom: 2px solid #c7d2fe !important;
}

/* ==========================================================
   CONFIRMED COMMON THEME REFINEMENT - RANKING & NAVIGATION
   Keep these overrides at the end so the change is easy to revert.
   ========================================================== */
body.competition-shell[data-cm-theme="light"] {
    --cm-bg: #eef3f9;
    --cm-bg-soft: #e6edf6;
    --cm-surface: #ffffff;
    --cm-surface-2: #f5f8fc;
    --cm-border: #cbd7e6;
    --cm-text: #0f172a;
    --cm-muted: #475569;
    --cm-muted-2: #64748b;
    --cm-card-bg: #ffffff;
    --cm-card-bg-2: #f8fbff;
    --cm-card-header-bg: linear-gradient(180deg, #ffffff, #f6f9fe);
    --cm-control-bg: #ffffff;
    background:
        radial-gradient(circle at top left, rgba(49,87,213,.10), transparent 32rem),
        radial-gradient(circle at top right, rgba(245,158,11,.10), transparent 30rem),
        linear-gradient(180deg, #f8fbff 0%, #eef3f9 48%, #e9eff7 100%) !important;
}

/* Common navigation tokens - now both top-level and submenu links share the same theme layer. */
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar,
body.competition-shell[data-cm-theme="light"] .mobile-app-bar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    border-color: #d7e1ee !important;
    box-shadow: 0 22px 55px rgba(15,23,42,.12) !important;
}

body.competition-shell[data-cm-theme="light"] .side-nav a,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-toggle,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav .side-nav-subitem,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav .side-nav-submenu a.side-nav-subitem,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav .side-nav-section-items .side-nav-subitem {
    color: #1e293b !important;
    background: rgba(15,23,42,.035) !important;
    border-color: transparent !important;
    opacity: 1 !important;
}

body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-toggle[aria-expanded="true"],
body.competition-shell[data-cm-theme="light"] .side-nav a.active {
    color: #92400e !important;
    background: rgba(245,158,11,.13) !important;
    border-color: rgba(245,158,11,.32) !important;
    font-weight: 800 !important;
}

body.competition-shell[data-cm-theme="light"] .side-nav a:hover,
body.competition-shell[data-cm-theme="light"] .side-nav a:focus,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-toggle:hover,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-toggle:focus,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav .side-nav-subitem:hover,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav .side-nav-subitem:focus {
    color: #0f172a !important;
    background: rgba(245,158,11,.12) !important;
    border-color: rgba(217,119,6,.24) !important;
}

body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-section-toggle {
    color: #64748b !important;
    background: rgba(15,23,42,.025) !important;
    border-color: transparent !important;
}

body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-section-toggle:hover,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-section-toggle:focus,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-section-toggle[aria-expanded="true"] {
    color: #334155 !important;
    background: rgba(15,23,42,.05) !important;
    border-color: rgba(15,23,42,.08) !important;
}

body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-toggle i,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav button.side-nav-section-toggle i,
body.competition-shell[data-cm-theme="light"] .dashboard-sidebar .side-nav .side-nav-subitem i,
body.competition-shell[data-cm-theme="light"] .side-nav i {
    color: #d97706 !important;
}

body.competition-shell[data-cm-theme="light"] .sidebar-account-user,
body.competition-shell[data-cm-theme="light"] .sidebar-account-action {
    color: #0f172a !important;
    background: #ffffff !important;
    border-color: #d7e1ee !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.06) !important;
}

body.competition-shell[data-cm-theme="light"] .sidebar-account-action {
    color: #92400e !important;
}

/* Ranking & Publication: stronger light-theme card separation matching the confirmed mockup. */
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .cm-page-header,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .cm-filter-card,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking > .cm-accordion-card,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-item-card {
    background: #ffffff !important;
    border-color: #cfdbea !important;
    box-shadow: 0 16px 42px rgba(15,23,42,.11) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .cm-page-header {
    box-shadow: 0 14px 36px rgba(15,23,42,.10) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .cm-filter-card {
    box-shadow: 0 16px 44px rgba(15,23,42,.12) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-item-card > .card-header,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-toggle-header {
    background: #ffffff !important;
    border-bottom-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .cm-accordion-body {
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%) !important;
    border-radius: 0 0 1.2rem 1.2rem !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .cm-accordion-card--nested,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-category {
    background: #f8fbff !important;
    border-color: #d4dfed !important;
    box-shadow: 0 10px 28px rgba(15,23,42,.075) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-category-header,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-category .cm-accordion-header {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fe 100%) !important;
    border-bottom-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-header-actions {
    background: #f8fbff !important;
    border-bottom: 1px solid #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table {
    --bs-table-bg: #ffffff;
    --bs-table-color: #0f172a;
    --bs-table-border-color: #d7e1ee;
    background: #ffffff !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table thead th {
    color: #1e3a8a !important;
    background: #e8f0ff !important;
    border-top: 1px solid #cddaf2 !important;
    border-bottom: 2px solid #b9c9ec !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .table tbody td {
    background: #ffffff !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-expand-toggle:hover,
body.competition-shell[data-cm-theme="light"] .cm-page--ranking .ranking-expand-toggle:focus {
    background: rgba(245,158,11,.075) !important;
}

/* Dark theme small depth improvement without changing the approved dark palette. */
body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .cm-page-header,
body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .cm-filter-card,
body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .ranking-item-card {
    box-shadow: 0 22px 58px rgba(0,0,0,.30) !important;
}

body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .cm-accordion-card--nested,
body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .ranking-category {
    background: rgba(17,24,39,.72) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,.18) !important;
}

/* ==========================================================
   LIGHT THEME RECOVERY - NON-LAYOUT OVERRIDES ONLY
   Purpose: keep the approved light layout intact while preventing
   old dark page-specific rules from leaking into Event Day pages.
   Do not move elements or change spacing here.
   ========================================================== */
body.competition-shell[data-cm-theme="light"] .card,
body.competition-shell[data-cm-theme="light"] .modal-content,
body.competition-shell[data-cm-theme="light"] .dropdown-menu,
body.competition-shell[data-cm-theme="light"] .quick-panel,
body.competition-shell[data-cm-theme="light"] .accordion,
body.competition-shell[data-cm-theme="light"] .accordion-item,
body.competition-shell[data-cm-theme="light"] .border-secondary,
body.competition-shell[data-cm-theme="light"] .bg-dark-subtle {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
    box-shadow: 0 12px 30px rgba(15,23,42,.08) !important;
}

body.competition-shell[data-cm-theme="light"] .card-header,
body.competition-shell[data-cm-theme="light"] .modal-header,
body.competition-shell[data-cm-theme="light"] .modal-footer,
body.competition-shell[data-cm-theme="light"] .bg-white,
body.competition-shell[data-cm-theme="light"] .bg-light,
body.competition-shell[data-cm-theme="light"] .bg-body-tertiary,
body.competition-shell[data-cm-theme="light"] .list-group,
body.competition-shell[data-cm-theme="light"] .list-group-item {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .card-body,
body.competition-shell[data-cm-theme="light"] .modal-body,
body.competition-shell[data-cm-theme="light"] .accordion-body {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .table,
body.competition-shell[data-cm-theme="light"] .table-dark,
body.competition-shell[data-cm-theme="light"] .table-responsive {
    --bs-table-bg: #ffffff;
    --bs-table-color: #0f172a;
    --bs-table-border-color: #d7e1ee;
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .table > :not(caption) > * > *,
body.competition-shell[data-cm-theme="light"] .table-dark > :not(caption) > * > * {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .table thead th,
body.competition-shell[data-cm-theme="light"] thead.table-dark th,
body.competition-shell[data-cm-theme="light"] .table-dark thead th,
body.competition-shell[data-cm-theme="light"] .table > thead > tr > th {
    background: #e8f0ff !important;
    color: #1e3a8a !important;
    border-color: #bfd0ee !important;
    border-bottom: 2px solid #b8c9ec !important;
}

body.competition-shell[data-cm-theme="light"] .table tbody tr.table-warning > *,
body.competition-shell[data-cm-theme="light"] .table > tbody > tr.table-warning > * {
    background-color: #fffbeb !important;
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .form-label,
body.competition-shell[data-cm-theme="light"] label {
    color: #334155 !important;
}

body.competition-shell[data-cm-theme="light"] .form-control,
body.competition-shell[data-cm-theme="light"] .form-select,
body.competition-shell[data-cm-theme="light"] textarea.form-control,
body.competition-shell[data-cm-theme="light"] input.form-control,
body.competition-shell[data-cm-theme="light"] select.form-select,
body.competition-shell[data-cm-theme="light"] .form-control[readonly],
body.competition-shell[data-cm-theme="light"] .form-control:disabled,
body.competition-shell[data-cm-theme="light"] .form-select:disabled,
body.competition-shell[data-cm-theme="light"] .form-control-plaintext {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .form-control::placeholder {
    color: #64748b !important;
}

body.competition-shell[data-cm-theme="light"] .form-control:focus,
body.competition-shell[data-cm-theme="light"] .form-select:focus,
body.competition-shell[data-cm-theme="light"] textarea.form-control:focus {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 .2rem rgba(245,158,11,.18) !important;
}

body.competition-shell[data-cm-theme="light"] input[type="file"].form-control,
body.competition-shell[data-cm-theme="light"] .appeal-file-name {
    background: #f8fbff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
}

body.competition-shell[data-cm-theme="light"] .text-light {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .btn-close {
    filter: none !important;
}

/* Searchable select/light theme dropdown recovery. */
body.competition-shell[data-cm-theme="light"] .searchable-select-input,
body.competition-shell[data-cm-theme="light"] .searchable-select-search {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
}

body.competition-shell[data-cm-theme="light"] .searchable-select-dropdown {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
    box-shadow: 0 18px 45px rgba(15,23,42,.14) !important;
}

body.competition-shell[data-cm-theme="light"] .searchable-select-option {
    color: #0f172a !important;
    background: transparent !important;
}

body.competition-shell[data-cm-theme="light"] .searchable-select-option:hover,
body.competition-shell[data-cm-theme="light"] .searchable-select-option.active {
    background: #fff7ed !important;
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .searchable-select-option.disabled {
    color: #94a3b8 !important;
}

/* Result Announcement: light theme should keep the rank colours but not the dark panels. */
body.competition-shell[data-cm-theme="light"] .result-announcement-page .accordion-button {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
}

body.competition-shell[data-cm-theme="light"] .result-announcement-page .accordion-button:not(.collapsed) {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .result-announcement-page .accordion-button::after {
    filter: none !important;
}

body.competition-shell[data-cm-theme="light"] .result-announcement-page .accordion-body {
    background: #f8fbff !important;
}

body.competition-shell[data-cm-theme="light"] .announcement-winner-card,
body.competition-shell[data-cm-theme="light"] .announcement-rank-card {
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 10px 24px rgba(15,23,42,.08) !important;
}

body.competition-shell[data-cm-theme="light"] .announcement-winner-name,
body.competition-shell[data-cm-theme="light"] .announcement-winner-org,
body.competition-shell[data-cm-theme="light"] .winner-detail-value,
body.competition-shell[data-cm-theme="light"] .winner-detail-label {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .announcement-tie-details,
body.competition-shell[data-cm-theme="light"] .announcement-tie-card {
    background: #f8fbff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
}

body.competition-shell[data-cm-theme="light"] .announcement-tie-title {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .result-announcement-freeze-switch,
body.competition-shell[data-cm-theme="light"] .result-announcement-freeze-switch .form-check-label {
    color: #0f172a !important;
}

/* Appeal decision modal preview: only colours, no layout changes. */
body.competition-shell[data-cm-theme="light"] .appeal-decision-modal .modal-body {
    background: #ffffff !important;
}

body.competition-shell[data-cm-theme="light"] .appeal-rank-preview,
body.competition-shell[data-cm-theme="light"] .preview-affected-row,
body.competition-shell[data-cm-theme="light"] .preview-affected-row.is-appealed {
    background: #f8fbff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
}

body.competition-shell[data-cm-theme="light"] .preview-title,
body.competition-shell[data-cm-theme="light"] .preview-label {
    color: #334155 !important;
}

/* Certificate Writing/Distribution + Performance Records: recover light cards and text without altering structure. */
body.competition-shell[data-cm-theme="light"] [class*="certificate-writing"],
body.competition-shell[data-cm-theme="light"] [class*="certificate-distribution"],
body.competition-shell[data-cm-theme="light"] [class*="performance-record"],
body.competition-shell[data-cm-theme="light"] [class*="cm-record"] {
    color: #0f172a;
}

body.competition-shell[data-cm-theme="light"] .certificate-writing-table,
body.competition-shell[data-cm-theme="light"] .certificate-writing-table > :not(caption) > * > *,
body.competition-shell[data-cm-theme="light"] .performance-record-table,
body.competition-shell[data-cm-theme="light"] .performance-record-table > :not(caption) > * > *,
body.competition-shell[data-cm-theme="light"] .cm-record-section .table,
body.competition-shell[data-cm-theme="light"] .cm-record-section .table > :not(caption) > * > * {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .audit-detail-pre,
body.competition-shell[data-cm-theme="light"] .cm-record-section .card-body,
body.competition-shell[data-cm-theme="light"] .certificate-writing-mobile-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

/* ==========================================================
   Submit Appeal light-theme recovery
   Scope: ResultAppeals/Index only. Keeps approved layout intact
   and only removes dark-theme leakage from this page.
   ========================================================== */
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .card,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .card-body,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table-responsive {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .card {
    border: 1px solid #d7e1ee !important;
    box-shadow: 0 12px 30px rgba(15,23,42,.08) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .card-header,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .card-header.bg-white {
    background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .card-header *,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .card-body *,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table * {
    color: inherit;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .text-muted,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .form-text,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals small {
    color: #475569 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .form-label,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals label {
    color: #334155 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .form-control,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .form-select,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals input,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals textarea,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
    -webkit-text-fill-color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .form-control::placeholder,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals input::placeholder,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals textarea::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

/* TomSelect/searchable dropdown on Submit Appeal */
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-wrapper.single .ts-control {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
    background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-wrapper.single.focus .ts-control,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-wrapper.single.dropdown-active .ts-control {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 .2rem rgba(217,119,6,.16) !important;
    background-image: linear-gradient(45deg, transparent 50%, #d97706 50%), linear-gradient(135deg, #d97706 50%, transparent 50%) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-control .item {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-dropdown {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
    box-shadow: 0 16px 36px rgba(15,23,42,.16) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-dropdown .dropdown-input-wrap {
    border-bottom-color: #e2e8f0 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-dropdown .dropdown-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd7e6 !important;
    -webkit-text-fill-color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-dropdown .option {
    background: transparent !important;
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-dropdown .option.active,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .ts-dropdown .option:hover {
    background: #fff7ed !important;
    color: #7c2d12 !important;
}

/* Responsive table filter strip generated by responsive-data-view.js */
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-tools,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-tools--server {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
    box-shadow: none !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-tools__summary {
    color: #334155 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-filter-field span {
    color: #334155 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table.table-dark {
    --bs-table-bg: #ffffff;
    --bs-table-color: #0f172a;
    --bs-table-border-color: #d7e1ee;
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table > :not(caption) > * > * {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table thead,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table thead.table-dark,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table thead th {
    background: #e8f0ff !important;
    color: #1e3a8a !important;
    border-color: #c7d2fe !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table tbody td {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .table tbody tr:hover td {
    background: rgba(49,87,213,.055) !important;
}

/* Submit Appeal responsive mobile cards: keep generated table cards in light theme. */
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-empty,
body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
    box-shadow: 0 12px 28px rgba(15,23,42,.10) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card__header {
    color: #0f172a !important;
    background: transparent !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card__title {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card__indicator {
    color: #d97706 !important;
    background: #fff7ed !important;
    border-color: #fed7aa !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card.is-expanded .cm-data-card__indicator {
    background: #ffedd5 !important;
    border-color: #fdba74 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card__details {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card__item {
    border-bottom-color: #e2e8f0 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card__label {
    color: #475569 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card__value {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-page--result-appeals .cm-data-card__actions {
    border-top-color: #e2e8f0 !important;
}

/* ==========================================================
   DARK THEME RECOVERY - Ranking & Publication action toolbar
   Scope: fixes Bootstrap bg-body-tertiary leaking as white in dark theme.
   No layout, table, badge, or button-system redesign changes.
   ========================================================== */
body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .ranking-header-actions,
body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .bg-body-tertiary {
    background: rgba(15, 23, 42, .88) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, .12) !important;
}

body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .ranking-header-actions .btn-outline-danger {
    color: #fca5a5 !important;
    border-color: #fb7185 !important;
    background: rgba(127, 29, 29, .14) !important;
}

body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .ranking-header-actions .btn-outline-danger:hover,
body.competition-shell[data-cm-theme="dark"] .cm-page--ranking .ranking-header-actions .btn-outline-danger:focus {
    color: #ffffff !important;
    background: #7f1d1d !important;
    border-color: #991b1b !important;
}

/* ==========================================================
   Reusable section/accordion card pattern
   Used by Certificate Writing/Distribution and suitable for
   Ranking, Appeals, Performance Records, etc.
   Behaviour (open/closed) stays in Bootstrap collapse markup.
   ========================================================== */
body.competition-shell .app-section-card {
    background: var(--cm-surface) !important;
    color: var(--cm-text) !important;
    border: 1px solid var(--cm-border) !important;
    border-radius: .85rem;
    overflow: hidden;
}

body.competition-shell .app-section-card-nested {
    background: var(--cm-surface-2) !important;
    box-shadow: none !important;
}

body.competition-shell .app-section-header {
    background: transparent !important;
    color: var(--cm-text) !important;
    border-color: var(--cm-border) !important;
}

body.competition-shell .app-section-toggle {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.75rem;
    padding: .65rem .85rem;
    color: var(--cm-text) !important;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}

body.competition-shell .app-section-toggle:hover,
body.competition-shell .app-section-toggle:focus {
    background: rgba(245, 158, 11, .10) !important;
    color: var(--cm-text) !important;
}

body.competition-shell .app-section-chevron {
    flex: 0 0 1rem;
    width: 1rem;
    color: var(--cm-gold-2);
    font-weight: 700;
    text-align: center;
    line-height: 1;
}

body.competition-shell .app-section-chevron::before {
    content: "▶";
}

body.competition-shell .app-section-toggle[aria-expanded="true"] .app-section-chevron::before {
    content: "▼";
}

body.competition-shell .app-section-actions {
    background: rgba(148, 163, 184, .06);
    color: var(--cm-text);
    border-color: var(--cm-border) !important;
}

body.competition-shell .app-section-content {
    background: transparent !important;
    color: var(--cm-text) !important;
}

body.competition-shell .app-summary-card,
body.competition-shell .app-mobile-record-card {
    background: var(--cm-surface) !important;
    color: var(--cm-text) !important;
    border: 1px solid var(--cm-border) !important;
}

body.competition-shell .app-mobile-record-card {
    border-radius: .75rem;
}


/* Reusable compact summary/filter badge row.
   Colour comes from Bootstrap badge/text-bg-* classes; this only standardises spacing and active selection. */
body.competition-shell .app-filter-summary {
    border-radius: 999px;
}

body.competition-shell .app-filter-pill-row {
    min-height: 1.6rem;
}

body.competition-shell .app-filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .42rem .9rem !important;
    min-height: 1.9rem;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 999px !important;
    border: 2px solid transparent !important;
    box-shadow: none;
    white-space: nowrap;
    transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease, transform .15s ease;
}

body.competition-shell button.app-filter-pill {
    cursor: pointer;
}

body.competition-shell .app-filter-pill[aria-pressed="true"],
body.competition-shell .app-filter-pill.active {
    border-color: var(--cm-accent) !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, .28), 0 .5rem 1rem rgba(0, 0, 0, .14);
    opacity: 1;
}

body.competition-shell[data-cm-theme="light"] .app-filter-pill[aria-pressed="true"],
body.competition-shell[data-cm-theme="light"] .app-filter-pill.active {
    border-color: var(--cm-primary, #3157d5) !important;
    box-shadow: 0 0 0 2px rgba(49, 87, 213, .24), 0 .5rem 1rem rgba(15, 23, 42, .12);
}

body.competition-shell .app-filter-pill[aria-pressed="true"]::before,
body.competition-shell .app-filter-pill.active::before {
    content: "✓";
    font-weight: 800;
}

body.competition-shell .app-filter-pill[aria-pressed="false"] {
    opacity: .92;
}

body.competition-shell button.app-filter-pill:hover,
body.competition-shell button.app-filter-pill:focus {
    opacity: 1;
    transform: translateY(-1px);
}

body.competition-shell .certificate-writing-member-list {
    padding-left: 1.25rem;
}

body.competition-shell .certificate-writing-member-list li {
    margin-bottom: .15rem;
}

body.competition-shell .certificate-writing-table td {
    vertical-align: top;
}

body.competition-shell[data-cm-theme="light"] .app-section-card,
body.competition-shell[data-cm-theme="light"] .app-summary-card,
body.competition-shell[data-cm-theme="light"] .app-mobile-record-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .app-section-card-nested {
    background: #f8fbff !important;
}

body.competition-shell[data-cm-theme="light"] .app-section-header,
body.competition-shell[data-cm-theme="light"] .app-section-toggle,
body.competition-shell[data-cm-theme="light"] .app-section-content {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .app-section-actions {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
}

body.competition-shell[data-cm-theme="light"] .app-section-chevron {
    color: #d97706;
}

/* Certificate/common section polish: remove corner artifacts and keep summary filter container rounded. */
body.competition-shell .app-filter-summary {
    border-radius: 1rem !important;
    overflow: hidden;
    border: 1px solid var(--cm-border) !important;
    background: var(--cm-surface) !important;
    box-shadow: none !important;
}

body.competition-shell .app-filter-summary .card-body {
    border-radius: inherit;
}

body.competition-shell .app-section-card {
    border-radius: .85rem !important;
    overflow: hidden;
}

body.competition-shell .app-section-card.shadow-sm,
body.competition-shell .app-section-card-nested.shadow-sm,
body.competition-shell .app-summary-card.shadow-sm {
    box-shadow: none !important;
}

body.competition-shell .app-section-card::before,
body.competition-shell .app-section-card::after,
body.competition-shell .app-section-header::before,
body.competition-shell .app-section-header::after,
body.competition-shell .app-section-content::before,
body.competition-shell .app-section-content::after,
body.competition-shell .app-filter-summary::before,
body.competition-shell .app-filter-summary::after {
    content: none !important;
    display: none !important;
}

body.competition-shell[data-cm-theme="light"] .app-filter-summary {
    background: #ffffff !important;
    border-color: #d7e1ee !important;
}


/* Certificate section card hardening: remove remaining corner artifacts and keep card/header rounding consistent. */
body.competition-shell .certificate-writing-items,
body.competition-shell .certificate-distribution-items {
    border-radius: 1rem;
}

body.competition-shell .certificate-writing-items::before,
body.competition-shell .certificate-writing-items::after,
body.competition-shell .certificate-distribution-items::before,
body.competition-shell .certificate-distribution-items::after {
    content: none !important;
    display: none !important;
}

body.competition-shell .certificate-writing-item.app-section-card,
body.competition-shell .certificate-writing-category.app-section-card,
body.competition-shell .certificate-distribution-item.app-section-card,
body.competition-shell .certificate-distribution-category.app-section-card,
body.competition-shell .ranking-item-card.app-section-card,
body.competition-shell .ranking-category.app-section-card,
body.competition-shell .result-announcement-item.app-section-card,
body.competition-shell .result-announcement-category.app-section-card,
body.competition-shell .app-section-card.certificate-writing-item,
body.competition-shell .app-section-card.certificate-writing-category {
    position: relative;
    border-radius: 1rem !important;
    overflow: hidden !important;
    box-shadow: none !important;
    background-clip: padding-box !important;
}

body.competition-shell .app-section-card > .app-section-header:first-child,
body.competition-shell .app-section-card > .card-header.app-section-header:first-child {
    border-top-left-radius: calc(1rem - 1px) !important;
    border-top-right-radius: calc(1rem - 1px) !important;
    overflow: hidden !important;
}

body.competition-shell .app-section-card > .app-section-header:first-child .app-section-toggle,
body.competition-shell .app-section-card > .card-header.app-section-header:first-child .app-section-toggle {
    border-top-left-radius: calc(1rem - 1px) !important;
    border-top-right-radius: calc(1rem - 1px) !important;
}

body.competition-shell .app-filter-summary,
body.competition-shell .app-filter-summary > .card-body {
    border-radius: 1rem !important;
    overflow: hidden !important;
    background-clip: padding-box !important;
}

body.competition-shell .app-filter-summary,
body.competition-shell .app-section-card,
body.competition-shell .app-section-card-nested {
    outline: 0 !important;
}

/* Certificate accordion chevrons: keep arrows visible after artifact cleanup. */
body.competition-shell .app-section-chevron::before,
body.competition-shell .certificate-writing-chevron::before {
    content: "▶" !important;
    display: inline-block !important;
    color: inherit !important;
}

body.competition-shell .app-section-toggle[aria-expanded="true"] .app-section-chevron::before,
body.competition-shell .app-section-toggle[aria-expanded="true"] .certificate-writing-chevron::before {
    content: "▼" !important;
}

/* ==========================================================
   Registration create/edit form card and field visibility
   Scope: Registration/Single and Registration/Group only.
   ========================================================== */
.registration-form-shell {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.registration-form-card {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 1.35rem;
    background: linear-gradient(135deg, rgba(17, 24, 39, .96), rgba(15, 23, 42, .92));
    box-shadow: 0 22px 58px rgba(0, 0, 0, .28);
    padding: 1.25rem;
    color: var(--cm-text);
}

.registration-form-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
    padding-bottom: .9rem;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
}

.registration-form-card__header h2 {
    margin: 0;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -.02em;
}

.registration-form .form-label,
.registration-form label {
    color: #e2e8f0;
    font-weight: 600;
}


/* Keep required markers attached to their registration form labels.
   Some configured labels are long; rendering the star as a separate sibling can make it wrap onto its own line. */
.registration-form .registration-required-marker {
    white-space: nowrap;
    flex-shrink: 0;
}

.registration-form .form-label:has(+ .registration-required-marker)::after {
    content: "\00a0*";
    color: var(--bs-danger, #dc3545);
    white-space: nowrap;
}

.registration-form .form-label + .registration-required-marker {
    display: none;
}

.registration-form .form-text,
.registration-form .text-muted {
    color: #cbd5e1 !important;
}

.registration-form .form-control,
.registration-form .form-select {
    min-height: 2.5rem;
    border-radius: .65rem;
    background-color: rgba(2, 6, 23, .78) !important;
    color: #f8fafc !important;
    border-color: rgba(148, 163, 184, .32) !important;
    box-shadow: none !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #f8fafc !important;
}

.registration-form .form-control:focus,
.registration-form .form-select:focus {
    background-color: rgba(2, 6, 23, .92) !important;
    color: #ffffff !important;
    border-color: rgba(245, 158, 11, .78) !important;
    box-shadow: 0 0 0 .18rem rgba(245, 158, 11, .18) !important;
}

.registration-form .form-control[readonly],
.registration-form .form-control:disabled,
.registration-form .form-select:disabled,
.registration-form select:disabled,
.registration-form .category-auto-readonly:disabled,
.registration-form .searchable-select__button:disabled {
    background-color: rgba(15, 23, 42, .92) !important;
    color: #e2e8f0 !important;
    border-color: rgba(245, 158, 11, .58) !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #e2e8f0 !important;
    cursor: not-allowed;
}

.registration-form .category-auto-readonly:disabled,
.registration-form .category-auto-readonly:disabled + .searchable-select__button {
    background-image: linear-gradient(135deg, rgba(245, 158, 11, .12), rgba(15, 23, 42, .94)) !important;
}

.registration-form input[type="date"].form-control {
    color-scheme: dark;
}

.registration-form input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.8) !important;
    opacity: 1 !important;
    cursor: pointer;
}

.registration-form input[type="date"].form-control[readonly]::-webkit-calendar-picker-indicator {
    cursor: not-allowed;
}

.registration-form .participant-row {
    background: rgba(15, 23, 42, .55) !important;
    border-color: rgba(255, 255, 255, .12) !important;
    border-radius: 1rem !important;
}

.registration-form .form-check-input {
    border-color: rgba(148, 163, 184, .70);
}

.registration-form .form-check-label {
    color: #e2e8f0;
}

@media (max-width: 767.98px) {
    .registration-form-card {
        padding: 1rem;
        border-radius: 1rem;
    }

    .registration-form-card__header {
        align-items: flex-start;
    }
}

/* ==========================================================
   Registration form native Bootstrap control recovery.
   Keeps Single/Group registration controls on Bootstrap form-select/form-control
   while making select arrows, readonly fields and date icons visible in both themes.
   ========================================================== */
.registration-form select.form-select {
    display: block !important;
    width: 100% !important;
    min-height: 2.5rem !important;
    padding: .5rem 2.25rem .5rem .75rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: .65rem !important;
    line-height: 1.5 !important;
    opacity: 1 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 16px 12px !important;
}

.registration-form input[type="date"].form-control {
    min-height: 2.5rem !important;
    padding-right: 2.45rem !important;
}

.registration-form input[type="date"].form-control::-webkit-calendar-picker-indicator {
    opacity: 1 !important;
    cursor: pointer !important;
}

/* ==========================================================
   Registration form TomSelect final recovery.
   The registration pages use the global TomSelect initializer for Bootstrap
   form-select controls. Keep the TomSelect control visible and keep the
   original select hidden so duplicate dropdowns do not appear.
   ========================================================== */
.registration-form select.tomselected,
.registration-form select.form-select.tomselected,
.registration-form select.ts-hidden-accessible,
.registration-form select.form-select.ts-hidden-accessible {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.registration-form .ts-wrapper,
.registration-form .ts-wrapper.single,
.registration-form .ts-wrapper.form-select,
.registration-form .ts-wrapper.form-control {
    width: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    position: relative !important;
}

.registration-form .ts-wrapper.single .ts-control,
.registration-form .ts-wrapper.multi .ts-control {
    width: 100% !important;
    min-height: 2.5rem !important;
    padding: .5rem 2.25rem .5rem .75rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: .65rem !important;
    line-height: 1.5 !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: none !important;
    cursor: pointer !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 16px 12px !important;
}

.registration-form .ts-wrapper.disabled .ts-control,
.registration-form .ts-wrapper.disabled .ts-control * {
    opacity: 1 !important;
    cursor: not-allowed !important;
}


/* ==========================================================
   Registration TomSelect single-control hardening.
   The global TomSelect initializer now tags registration wrappers with
   .registration-tomselect-wrapper so the source select stays hidden and
   the TomSelect control remains visible in both themes.
   ========================================================== */
.registration-form select.tomselected,
.registration-form select.ts-hidden-accessible {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.registration-form .registration-tomselect-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 100% !important;
    min-height: 2.5rem !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.registration-form .registration-tomselect-wrapper .registration-tomselect-control,
.registration-form .registration-tomselect-wrapper.single .ts-control,
.registration-form .registration-tomselect-wrapper.multi .ts-control {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 2.5rem !important;
    height: auto !important;
    padding: .5rem 2.25rem .5rem .75rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: .65rem !important;
    line-height: 1.5 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none !important;
    cursor: pointer !important;
    background-repeat: no-repeat !important;
    background-position: right .75rem center !important;
    background-size: 16px 12px !important;
}

.registration-form .registration-tomselect-wrapper .ts-control .item {
    display: inline-flex !important;
    align-items: center !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.registration-form .registration-tomselect-wrapper .ts-control > input,
.registration-form .registration-tomselect-wrapper .ts-control input {
    position: static !important;
    display: inline-block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 1rem !important;
    height: auto !important;
    inset: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.registration-form .registration-tomselect-wrapper.disabled,
.registration-form .registration-tomselect-wrapper.disabled .ts-control {
    opacity: 1 !important;
    cursor: not-allowed !important;
}

/* ==========================================================
   Reusable TomSelect control structure
   Applies to every select enhanced by the shared Layout initializer.
   The source select is hidden only after TomSelect marks it, so normal
   Bootstrap select controls are not affected.
   ========================================================== */
select.tomselected,
select.ts-hidden-accessible,
select[data-tomselect-enhanced="true"] {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.cm-tomselect-wrapper,
.ts-wrapper.cm-tomselect-wrapper,
.ts-wrapper.single.cm-tomselect-wrapper,
.ts-wrapper.multi.cm-tomselect-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 100% !important;
    min-height: 2.5rem !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.cm-tomselect-wrapper .cm-tomselect-control,
.cm-tomselect-wrapper.single .ts-control,
.cm-tomselect-wrapper.multi .ts-control,
.ts-wrapper.cm-tomselect-wrapper .ts-control {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 2.5rem !important;
    height: auto !important;
    padding: .5rem 2.25rem .5rem .75rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: .65rem !important;
    line-height: 1.5 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none !important;
    cursor: pointer !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50% !important;
    background-size: 6px 6px, 6px 6px !important;
}

.cm-tomselect-wrapper .ts-control .item,
.cm-tomselect-wrapper .ts-control > input,
.cm-tomselect-wrapper .ts-control input {
    opacity: 1 !important;
    visibility: visible !important;
}

.cm-tomselect-wrapper .ts-control .item {
    display: inline-flex !important;
    align-items: center !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.cm-tomselect-wrapper .ts-control > input,
.cm-tomselect-wrapper .ts-control input {
    position: static !important;
    display: inline-block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 1rem !important;
    height: auto !important;
    inset: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.cm-tomselect-wrapper.disabled,
.cm-tomselect-wrapper.disabled .ts-control,
.cm-tomselect-wrapper.disabled .ts-control * {
    opacity: 1 !important;
    cursor: not-allowed !important;
}

.cm-tomselect-wrapper .ts-dropdown {
    border-radius: .65rem !important;
    overflow: hidden !important;
    z-index: 1060 !important;
}

input[type="date"].form-control {
    min-height: 2.5rem !important;
    padding-right: 2.45rem !important;
}

input[type="date"].form-control::-webkit-calendar-picker-indicator {
    opacity: 1 !important;
    cursor: pointer !important;
}

/* ==========================================================
   CM final shared form/TomSelect hardening 2026-06-12
   ========================================================== */
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) {
    border-radius: 1.1rem !important;
    padding: 1.5rem !important;
    margin-top: 1rem !important;
    margin-bottom: 1.25rem !important;
    overflow: visible !important;
}

body.competition-shell .dashboard-main > .card,
body.competition-shell .dashboard-main > .bk-card,
body.competition-shell .dashboard-main .cm-form-surface,
body.competition-shell .dashboard-main .registration-form-card {
    border-radius: 1.1rem !important;
    overflow: visible !important;
}

body.competition-shell .dashboard-main > .card > .card-body,
body.competition-shell .dashboard-main > .bk-card,
body.competition-shell .dashboard-main .cm-form-surface,
body.competition-shell .dashboard-main .registration-form-card {
    border-radius: 1.1rem !important;
}

body.competition-shell select.cm-tomselect-source,
body.competition-shell select.tomselected,
body.competition-shell select.ts-hidden-accessible,
body.competition-shell select[data-cm-tomselect-enhanced="true"],
body.competition-shell select[data-tomselect-enhanced="true"] {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.competition-shell .ts-wrapper,
body.competition-shell .ts-wrapper.single,
body.competition-shell .ts-wrapper.multi,
body.competition-shell .ts-wrapper.cm-tomselect-wrapper,
body.competition-shell .cm-tomselect-wrapper {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    min-height: 2.5rem !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

body.competition-shell .ts-wrapper.single .ts-control,
body.competition-shell .ts-wrapper.multi .ts-control,
body.competition-shell .ts-wrapper .ts-control,
body.competition-shell .cm-tomselect-wrapper .cm-tomselect-control {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 2.5rem !important;
    height: auto !important;
    padding: .5rem 2.45rem .5rem .75rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: .65rem !important;
    line-height: 1.5 !important;
    background-image: none !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
    text-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

body.competition-shell .ts-wrapper.single .ts-control::after,
body.competition-shell .ts-wrapper.single .ts-control:after,
body.competition-shell .ts-control::after,
body.competition-shell .ts-control:after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.competition-shell .ts-wrapper.single::after,
body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single::after,
body.competition-shell .cm-tomselect-wrapper.single::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    right: .9rem !important;
    top: 50% !important;
    width: .48rem !important;
    height: .48rem !important;
    transform: translateY(-62%) rotate(45deg) !important;
    pointer-events: none !important;
    z-index: 5 !important;
}

body.competition-shell .ts-wrapper.single.dropdown-active::after,
body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single.dropdown-active::after,
body.competition-shell .cm-tomselect-wrapper.single.dropdown-active::after {
    transform: translateY(-38%) rotate(225deg) !important;
}

body.competition-shell .ts-control .item,
body.competition-shell .ts-control > input,
body.competition-shell .ts-control input,
body.competition-shell .ts-control input::placeholder {
    opacity: 1 !important;
    visibility: visible !important;
    text-shadow: none !important;
}

body.competition-shell .ts-control > input,
body.competition-shell .ts-control input {
    position: static !important;
    display: inline-block !important;
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 1rem !important;
    height: auto !important;
    inset: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.competition-shell .ts-control .item {
    display: inline-flex !important;
    align-items: center !important;
    max-width: calc(100% - 1rem) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

body.competition-shell .ts-dropdown {
    z-index: 1060 !important;
    border-radius: .75rem !important;
    overflow: hidden !important;
}


/* ==========================================================
   CM shared checkbox/switch hardening 2026-06-12
   Keeps Bootstrap switches visible inside all create/edit forms.
   ========================================================== */
body.competition-shell .form-check-input {
    opacity: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

body.competition-shell .form-check-input:disabled,
body.competition-shell .form-check-input[disabled] {
    opacity: .72 !important;
    cursor: not-allowed !important;
}

body.competition-shell .form-check-label {
    cursor: pointer;
}

body.competition-shell .form-switch {
    min-height: 1.45rem !important;
}

body.competition-shell .form-switch .form-check-input {
    width: 2.35rem !important;
    height: 1.2rem !important;
    min-width: 2.35rem !important;
    min-height: 1.2rem !important;
    margin-top: .12rem !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 999px !important;
    background-repeat: no-repeat !important;
    background-position: left center !important;
    background-size: 1rem 1rem !important;
    transition: background-position .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

body.competition-shell .form-switch .form-check-input:checked {
    background-position: right center !important;
}

body.competition-shell .form-switch .form-check-input:focus {
    outline: 0 !important;
}

/* CM COMMON FORM FOUNDATION START */
/* ==========================================================
   CM common form foundation
   One reusable structure for create/edit pages. Page markup should
   choose cm-* structure classes; these rules own the visual system.
   ========================================================== */
body.competition-shell {
    --cm-radius-card: 1.15rem;
    --cm-radius-card-sm: .9rem;
    --cm-radius-control: .7rem;
    --cm-form-gap: 1rem;
    --cm-form-surface-bg: rgba(15, 23, 42, .92);
    --cm-form-surface-border: rgba(148, 163, 184, .24);
    --cm-form-surface-shadow: 0 20px 48px rgba(0, 0, 0, .30);
    --cm-form-section-bg: rgba(255, 255, 255, .035);
    --cm-form-section-border: rgba(255, 255, 255, .10);
    --cm-action-bar-bg: rgba(255, 255, 255, .035);
    --cm-page-header-bg: rgba(15, 23, 42, .92);
    --cm-page-header-border: rgba(148, 163, 184, .24);
    --cm-page-title-color: #f8fafc;
    --cm-page-subtitle-color: #cbd5e1;
    --cm-field-label-color: #f8fafc;
    --cm-field-help-color: #cbd5e1;
    --cm-control-bg: rgba(2, 6, 23, .82);
    --cm-control-text: #f8fafc;
    --cm-control-placeholder: #94a3b8;
    --cm-control-border: rgba(148, 163, 184, .42);
    --cm-control-readonly-bg: rgba(15, 23, 42, .94);
    --cm-control-disabled-bg: rgba(15, 23, 42, .94);
    --cm-control-disabled-text: #e2e8f0;
    --cm-focus-color: #f59e0b;
    --cm-focus-shadow: rgba(245, 158, 11, .20);
    --cm-validation-danger: #fb7185;
    --cm-validation-danger-bg: rgba(251, 113, 133, .10);
    --cm-validation-danger-border: rgba(251, 113, 133, .35);
}

body.competition-shell .cm-page {
    display: grid;
    gap: 1rem;
    width: 100%;
    color: var(--cm-text);
}

body.competition-shell .cm-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    color: var(--cm-page-title-color) !important;
    background: var(--cm-page-header-bg) !important;
    border: 1px solid var(--cm-page-header-border) !important;
    border-radius: var(--cm-radius-card) !important;
    box-shadow: var(--cm-form-surface-shadow) !important;
}

body.competition-shell .cm-page-heading {
    min-width: 0;
}

body.competition-shell .cm-page-kicker {
    margin: 0 0 .2rem;
    color: var(--cm-focus-color) !important;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.competition-shell .cm-page-title {
    margin: 0;
    color: var(--cm-page-title-color) !important;
    font-size: clamp(1.35rem, 1.2rem + .7vw, 2rem);
    font-weight: 850;
    letter-spacing: -.025em;
    line-height: 1.15;
}

body.competition-shell .cm-page-subtitle {
    margin: .35rem 0 0;
    color: var(--cm-page-subtitle-color) !important;
    font-size: .95rem;
}

body.competition-shell .cm-page-actions,
body.competition-shell .cm-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
}

body.competition-shell .cm-surface,
body.competition-shell .cm-form-surface,
body.competition-shell .cm-filter-surface,
body.competition-shell .cm-section-card,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) {
    color: var(--cm-text) !important;
    background: var(--cm-form-surface-bg) !important;
    border: 1px solid var(--cm-form-surface-border) !important;
    border-radius: var(--cm-radius-card) !important;
    box-shadow: var(--cm-form-surface-shadow) !important;
    overflow: visible !important;
}

body.competition-shell .cm-surface,
body.competition-shell .cm-form-surface,
body.competition-shell .cm-filter-surface,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) {
    padding: clamp(1rem, 1.4vw, 1.5rem) !important;
}

body.competition-shell .cm-form-surface > :first-child,
body.competition-shell .cm-section-card > :first-child,
body.competition-shell .cm-filter-surface > :first-child {
    margin-top: 0 !important;
}

body.competition-shell .cm-form-surface > :last-child,
body.competition-shell .cm-section-card > :last-child,
body.competition-shell .cm-filter-surface > :last-child {
    margin-bottom: 0 !important;
}

body.competition-shell .cm-section-card {
    padding: 1rem !important;
    background: var(--cm-form-section-bg) !important;
    border-color: var(--cm-form-section-border) !important;
    box-shadow: none !important;
}

body.competition-shell .cm-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: var(--cm-form-gap);
    align-items: start;
}

body.competition-shell .cm-form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.competition-shell .cm-form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.competition-shell .cm-field,
body.competition-shell .cm-form-field {
    display: grid;
    gap: .35rem;
    min-width: 0;
}

body.competition-shell .cm-field--full,
body.competition-shell .cm-form-grid > .cm-full,
body.competition-shell .cm-form-grid > .validation-summary-errors {
    grid-column: 1 / -1;
}

body.competition-shell .cm-field .form-label,
body.competition-shell .cm-field label,
body.competition-shell .cm-form-surface .form-label,
body.competition-shell .cm-form-surface label,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-label,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) label {
    margin-bottom: .25rem;
    color: var(--cm-field-label-color) !important;
    font-weight: 700;
}

body.competition-shell .cm-field-help,
body.competition-shell .cm-form-surface .form-text,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-text {
    color: var(--cm-field-help-color) !important;
    font-size: .85rem;
}

body.competition-shell .cm-form-surface .form-control,
body.competition-shell .cm-form-surface .form-select,
body.competition-shell .cm-form-surface textarea.form-control,
body.competition-shell .cm-filter-surface .form-control,
body.competition-shell .cm-filter-surface .form-select,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-control,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-select,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) textarea.form-control {
    min-height: 2.5rem;
    color: var(--cm-control-text) !important;
    -webkit-text-fill-color: var(--cm-control-text) !important;
    background-color: var(--cm-control-bg) !important;
    border-color: var(--cm-control-border) !important;
    border-radius: var(--cm-radius-control) !important;
    box-shadow: none !important;
}

body.competition-shell .cm-form-surface textarea.form-control,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) textarea.form-control {
    min-height: 6rem;
}

body.competition-shell .cm-form-surface .form-control::placeholder,
body.competition-shell .cm-form-surface textarea.form-control::placeholder,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-control::placeholder,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) textarea.form-control::placeholder {
    color: var(--cm-control-placeholder) !important;
    -webkit-text-fill-color: var(--cm-control-placeholder) !important;
    opacity: 1 !important;
}

body.competition-shell .cm-form-surface .form-control:focus,
body.competition-shell .cm-form-surface .form-select:focus,
body.competition-shell .cm-filter-surface .form-control:focus,
body.competition-shell .cm-filter-surface .form-select:focus,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-control:focus,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-select:focus {
    color: var(--cm-control-text) !important;
    -webkit-text-fill-color: var(--cm-control-text) !important;
    background-color: var(--cm-control-bg) !important;
    border-color: var(--cm-focus-color) !important;
    box-shadow: 0 0 0 .18rem var(--cm-focus-shadow) !important;
    outline: 0 !important;
}

body.competition-shell .cm-readonly-field,
body.competition-shell .cm-form-surface .form-control[readonly],
body.competition-shell .cm-form-surface .form-control:disabled,
body.competition-shell .cm-form-surface .form-select:disabled,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-control[readonly],
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-control:disabled,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .form-select:disabled {
    color: var(--cm-control-disabled-text) !important;
    -webkit-text-fill-color: var(--cm-control-disabled-text) !important;
    background-color: var(--cm-control-readonly-bg) !important;
    border-color: var(--cm-control-border) !important;
    opacity: 1 !important;
}

body.competition-shell .cm-form-surface .ts-wrapper,
body.competition-shell .cm-filter-surface .ts-wrapper,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .ts-wrapper {
    width: 100% !important;
}

body.competition-shell .cm-form-surface .ts-wrapper .ts-control,
body.competition-shell .cm-filter-surface .ts-wrapper .ts-control,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .ts-wrapper .ts-control {
    min-height: 2.5rem !important;
    color: var(--cm-control-text) !important;
    -webkit-text-fill-color: var(--cm-control-text) !important;
    background-color: var(--cm-control-bg) !important;
    border-color: var(--cm-control-border) !important;
    border-radius: var(--cm-radius-control) !important;
}

body.competition-shell .cm-form-surface .ts-wrapper.focus .ts-control,
body.competition-shell .cm-form-surface .ts-wrapper.dropdown-active .ts-control,
body.competition-shell .cm-filter-surface .ts-wrapper.focus .ts-control,
body.competition-shell .cm-filter-surface .ts-wrapper.dropdown-active .ts-control,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .ts-wrapper.focus .ts-control,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .ts-wrapper.dropdown-active .ts-control {
    border-color: var(--cm-focus-color) !important;
    box-shadow: 0 0 0 .18rem var(--cm-focus-shadow) !important;
}

body.competition-shell .cm-validation-summary,
body.competition-shell .validation-summary-errors {
    padding: .85rem 1rem;
    color: var(--cm-validation-danger) !important;
    background: var(--cm-validation-danger-bg) !important;
    border: 1px solid var(--cm-validation-danger-border) !important;
    border-radius: var(--cm-radius-control) !important;
}

body.competition-shell .field-validation-error,
body.competition-shell .validation-message,
body.competition-shell .cm-form-surface .text-danger,
body.competition-shell .dashboard-main > form:not(.sidebar-account-form):not(.d-inline):not(.cm-no-form-surface):not([data-cm-no-surface]) .text-danger {
    color: var(--cm-validation-danger) !important;
    font-weight: 650;
}

body.competition-shell .cm-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .65rem;
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--cm-action-bar-bg) !important;
    border: 1px solid var(--cm-form-section-border) !important;
    border-radius: var(--cm-radius-card-sm) !important;
}

body.competition-shell .cm-action-bar--between {
    justify-content: space-between;
}

body.competition-shell .cm-action-bar .btn,
body.competition-shell .cm-page-actions .btn,
body.competition-shell .cm-inline-actions .btn {
    border-radius: .75rem;
    font-weight: 750;
}

body.competition-shell .cm-stack {
    display: grid;
    gap: 1rem;
}

body.competition-shell .cm-stack-sm {
    display: grid;
    gap: .65rem;
}

@media (max-width: 767.98px) {
    body.competition-shell .cm-page-header {
        display: grid;
        padding: .95rem;
    }

    body.competition-shell .cm-page-actions,
    body.competition-shell .cm-inline-actions,
    body.competition-shell .cm-action-bar {
        justify-content: stretch;
    }

    body.competition-shell .cm-page-actions .btn,
    body.competition-shell .cm-inline-actions .btn,
    body.competition-shell .cm-action-bar .btn {
        width: 100%;
    }

    body.competition-shell .cm-form-grid,
    body.competition-shell .cm-form-grid--two,
    body.competition-shell .cm-form-grid--three {
        grid-template-columns: 1fr;
    }
}
/* CM COMMON FORM FOUNDATION END */

/* CM ADMIN COMMON PAGE FOUNDATION START */
body.competition-shell .cm-admin-page,
body.competition-shell .cm-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.competition-shell .cm-table-surface,
body.competition-shell .cm-section-card,
body.competition-shell .cm-note-surface,
body.competition-shell .cm-muted-box,
body.competition-shell .cm-subsection-card,
body.competition-shell .cm-dashed-section,
body.competition-shell .cm-file-upload-surface {
    background: var(--cm-surface-bg, rgba(255, 255, 255, .92));
    border: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .35));
    border-radius: var(--cm-radius-card, 1rem);
    box-shadow: var(--cm-shadow-card, none);
    color: var(--cm-body-text, inherit);
}

body.competition-shell .cm-table-surface {
    overflow: hidden;
}

body.competition-shell .cm-surface-header,
body.competition-shell .cm-surface-footer,
body.competition-shell .cm-surface-body {
    padding: 1rem 1.15rem;
}

body.competition-shell .cm-surface-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .25));
}

body.competition-shell .cm-surface-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .6rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .25));
}

body.competition-shell .cm-section-title {
    font-weight: 800;
    margin: 0;
    color: var(--cm-heading-text, var(--cm-body-text, inherit));
}

body.competition-shell .cm-section-subtitle {
    margin: .2rem 0 0;
    color: var(--cm-muted-text, #64748b);
    font-size: .9rem;
}

body.competition-shell .cm-section-card,
body.competition-shell .cm-note-surface,
body.competition-shell .cm-muted-box,
body.competition-shell .cm-subsection-card,
body.competition-shell .cm-dashed-section,
body.competition-shell .cm-file-upload-surface {
    padding: 1rem;
}

body.competition-shell .cm-dashed-section,
body.competition-shell .cm-file-upload-surface {
    border-style: dashed;
}

body.competition-shell .cm-note-surface,
body.competition-shell .cm-muted-box {
    background: var(--cm-soft-bg, rgba(148, 163, 184, .08));
    box-shadow: none;
}

body.competition-shell .cm-empty-state {
    padding: 1.25rem;
    color: var(--cm-muted-text, #64748b);
}

body.competition-shell .cm-table-actions,
body.competition-shell .cm-inline-actions,
body.competition-shell .cm-page-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

body.competition-shell .cm-table-actions,
body.competition-shell .cm-inline-form {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin: 0;
}

body.competition-shell .cm-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .75rem;
}

body.competition-shell .cm-check-tile {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .85rem;
    background: var(--cm-soft-bg, rgba(148, 163, 184, .08));
    border: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .25));
    border-radius: var(--cm-radius-control, .75rem);
}

body.competition-shell .cm-accordion-item {
    background: var(--cm-surface-bg, rgba(255, 255, 255, .92));
    border: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .25));
    border-radius: var(--cm-radius-card, 1rem) !important;
    overflow: hidden;
    box-shadow: var(--cm-shadow-card, none);
}

body.competition-shell .cm-accordion-item + .cm-accordion-item {
    margin-top: .75rem;
}

body.competition-shell .cm-accordion-button,
body.competition-shell .cm-accordion-item .accordion-button {
    background: var(--cm-surface-bg, rgba(255, 255, 255, .92));
    color: var(--cm-heading-text, inherit);
    box-shadow: none;
}

body.competition-shell .cm-accordion-item .accordion-button:not(.collapsed) {
    background: var(--cm-soft-bg, rgba(148, 163, 184, .08));
    color: var(--cm-heading-text, inherit);
}

body.competition-shell .cm-table-surface .table {
    margin-bottom: 0;
}

body.competition-shell .cm-table-surface > h5,
body.competition-shell .cm-table-surface > .cm-section-title,
body.competition-shell .cm-table-surface > .text-muted {
    padding: 1rem 1.15rem;
    margin: 0 !important;
}

body.competition-shell .cm-table-surface > h5 + .table-responsive,
body.competition-shell .cm-table-surface > .cm-section-title + .table-responsive {
    border-top: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .25));
}

body.competition-shell .cm-page-header {
    margin-bottom: .5rem;
}

/* Compact numeric order controls used in admin setup tables.
   Keeps the order value visible beside up/down buttons after the shared form styles are applied. */
body.competition-shell .cm-order-column {
    width: 12rem;
    min-width: 12rem;
}

body.competition-shell .cm-order-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    flex-wrap: nowrap;
    min-width: 0;
}

body.competition-shell .cm-order-input,
body.competition-shell input.cm-order-input.form-control {
    flex: 0 0 4rem !important;
    width: 4rem !important;
    min-width: 4rem !important;
    max-width: 4rem !important;
    padding-left: .35rem !important;
    padding-right: .35rem !important;
    text-align: center;
}

body.competition-shell .cm-order-button {
    flex: 0 0 auto;
    min-width: 2rem;
    padding-left: .45rem;
    padding-right: .45rem;
}

body.competition-shell input.cm-order-input::-webkit-outer-spin-button,
body.competition-shell input.cm-order-input::-webkit-inner-spin-button {
    margin: 0;
}

@media (max-width: 576px) {
    body.competition-shell .cm-page-actions,
    body.competition-shell .cm-action-bar,
    body.competition-shell .cm-surface-footer,
    body.competition-shell .cm-inline-actions {
        align-items: stretch;
    }

    body.competition-shell .cm-page-actions > *,
    body.competition-shell .cm-action-bar > *,
    body.competition-shell .cm-surface-footer > *,
    body.competition-shell .cm-inline-actions > * {
        width: 100%;
    }
}

/* CM COMMON DETAIL CARD START
   Shared readable key/value card used by admin preview and review pages.
   Theme-aware so text stays visible in both light and dark modes. */
body.competition-shell .cm-detail-card {
    background: var(--cm-surface-bg, rgba(255, 255, 255, .92));
    border: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .35));
    border-radius: var(--cm-radius-card, 1rem);
    box-shadow: var(--cm-shadow-card, none);
    color: var(--cm-body-text, inherit);
    padding: 1rem;
}

body.competition-shell .cm-detail-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .25));
}

body.competition-shell .cm-detail-card__title {
    margin: 0;
    color: var(--cm-heading-text, var(--cm-body-text, inherit));
    font-weight: 800;
}

body.competition-shell .cm-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    color: var(--cm-body-text, inherit);
}

body.competition-shell .cm-detail-row {
    display: grid;
    grid-template-columns: minmax(7.5rem, 32%) minmax(0, 1fr);
    gap: .8rem;
    padding: .45rem 0;
    border-bottom: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .18));
}

body.competition-shell .cm-detail-row:last-child {
    border-bottom: 0;
}

body.competition-shell .cm-detail-label {
    margin: 0;
    color: var(--cm-muted-text, #64748b);
    font-weight: 800;
    line-height: 1.35;
}

body.competition-shell .cm-detail-value {
    margin: 0;
    min-width: 0;
    color: var(--cm-body-text, inherit);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

body.competition-shell .cm-detail-value--strong {
    color: var(--cm-heading-text, var(--cm-body-text, inherit));
    font-weight: 800;
}

@media (max-width: 576px) {
    body.competition-shell .cm-detail-row {
        grid-template-columns: 1fr;
        gap: .2rem;
    }
}
/* CM COMMON DETAIL CARD END */

/* CM ADMIN COMMON PAGE FOUNDATION END */

/* CM EVENT DAY COMMON PAGE FOUNDATION START
   Shared Event Day shell/header/form/accordion pattern.
   Stage Coordinator is the first Event Day page to consume this common structure.
   ========================================================== */
body.competition-shell .cm-page--event-day {
    --cm-event-stage-card-bg: var(--cm-surface-bg, var(--cm-form-surface-bg));
    --cm-event-stage-card-border: var(--cm-surface-border, var(--cm-form-surface-border));
    --cm-event-stage-header-bg: var(--cm-soft-bg, var(--cm-form-section-bg));
    --cm-event-stage-header-hover-bg: color-mix(in srgb, var(--cm-event-stage-header-bg) 82%, var(--cm-focus-color) 18%);
    --cm-event-stage-body-bg: var(--cm-form-surface-bg);
    --cm-event-stage-row-bg: var(--cm-soft-bg, var(--cm-form-section-bg));
    --cm-event-stage-row-border: var(--cm-surface-border, var(--cm-form-section-border));
    --cm-event-stage-label-color: var(--cm-muted-text, var(--cm-muted));
    --cm-event-stage-text-color: var(--cm-body-text, var(--cm-text));
    --cm-event-stage-title-color: var(--cm-heading-text, var(--cm-page-title-color));
    --cm-event-stage-progress-bg: var(--cm-control-bg);
    --cm-event-stage-progress-border: var(--cm-control-border);
}

body.competition-shell .cm-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    border-radius: 1rem;
    color: var(--cm-page-icon-color, #ffffff);
    background: var(--cm-page-icon-bg, rgba(245, 158, 11, .18));
    border: 1px solid var(--cm-page-icon-border, rgba(245, 158, 11, .28));
}

body.competition-shell .cm-page-icon--cyan {
    --cm-page-icon-color: #67e8f9;
    --cm-page-icon-bg: rgba(8, 145, 178, .22);
    --cm-page-icon-border: rgba(8, 145, 178, .30);
}

body.competition-shell .cm-stage-access-panel {
    max-width: 100%;
}

body.competition-shell .cm-event-stage-board-list,
body.competition-shell .event-stage-board-list {
    display: grid;
    gap: 1rem;
}

body.competition-shell .cm-event-stage-item-card,
body.competition-shell .event-stage-item-card {
    overflow: hidden;
    color: var(--cm-event-stage-text-color) !important;
    background: var(--cm-event-stage-card-bg) !important;
    border: 1px solid var(--cm-event-stage-card-border) !important;
    border-radius: var(--cm-radius-card, 1rem) !important;
    box-shadow: var(--cm-shadow-card, var(--cm-form-surface-shadow)) !important;
}

body.competition-shell .cm-event-stage-item-toggle,
body.competition-shell .event-stage-item-toggle {
    width: 100%;
    display: block;
    padding: 1rem 1.15rem;
    color: var(--cm-event-stage-title-color) !important;
    background: var(--cm-event-stage-header-bg) !important;
    border: 0 !important;
    text-align: left;
    box-shadow: none !important;
}

body.competition-shell .cm-event-stage-item-toggle:hover,
body.competition-shell .cm-event-stage-item-toggle:focus,
body.competition-shell .event-stage-item-toggle:hover,
body.competition-shell .event-stage-item-toggle:focus {
    color: var(--cm-event-stage-title-color) !important;
    background: var(--cm-event-stage-header-hover-bg) !important;
    outline: 0 !important;
}

body.competition-shell .cm-event-stage-item-header,
body.competition-shell .event-stage-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

body.competition-shell .cm-event-stage-item-title-row,
body.competition-shell .event-stage-item-title-row {
    display: flex;
    align-items: baseline;
    gap: .65rem;
    flex-wrap: wrap;
    min-width: 0;
}

body.competition-shell .cm-event-stage-item-title,
body.competition-shell .event-stage-item-title {
    margin: 0;
    color: var(--cm-event-stage-title-color) !important;
    font-size: 1.05rem;
    font-weight: 850;
    letter-spacing: .01em;
    line-height: 1.2;
}

body.competition-shell .cm-event-stage-item-meta,
body.competition-shell .event-stage-item-meta {
    margin: 0;
    color: var(--cm-event-stage-label-color) !important;
    font-size: .875rem;
    white-space: nowrap;
}

body.competition-shell .cm-event-stage-item-header-right,
body.competition-shell .event-stage-item-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    flex-shrink: 0;
}

body.competition-shell .cm-event-stage-item-status,
body.competition-shell .event-stage-item-status {
    font-size: .75rem;
    padding: .25rem .55rem;
    font-weight: 750;
}

body.competition-shell .cm-event-stage-item-chevron-wrap,
body.competition-shell .event-stage-item-chevron-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

body.competition-shell .cm-event-stage-item-chevron,
body.competition-shell .event-stage-item-chevron {
    color: var(--cm-focus-color, var(--cm-gold-2)) !important;
    font-size: 1rem;
    transition: transform .2s ease-in-out;
}

body.competition-shell .cm-event-stage-item-toggle[aria-expanded="true"] .cm-event-stage-item-chevron,
body.competition-shell .event-stage-item-toggle[aria-expanded="true"] .event-stage-item-chevron {
    transform: rotate(180deg);
}

body.competition-shell .cm-event-stage-item-body,
body.competition-shell .event-stage-item-body {
    padding: 1rem;
    color: var(--cm-event-stage-text-color) !important;
    background: var(--cm-event-stage-body-bg) !important;
    border-top: 1px solid var(--cm-event-stage-card-border) !important;
}

body.competition-shell .cm-event-stage-category-row,
body.competition-shell .event-stage-category-row {
    display: grid;
    grid-template-columns: minmax(110px, .7fr) minmax(220px, 2fr) minmax(130px, .8fr) minmax(110px, .7fr) auto;
    gap: .85rem;
    align-items: center;
    padding: .9rem 1rem;
    color: var(--cm-event-stage-text-color) !important;
    background: var(--cm-event-stage-row-bg) !important;
    border: 1px solid var(--cm-event-stage-row-border) !important;
    border-radius: var(--cm-radius-card-sm, .85rem) !important;
}

body.competition-shell .cm-event-stage-category-row + .cm-event-stage-category-row,
body.competition-shell .event-stage-category-row + .event-stage-category-row {
    margin-top: .75rem;
}

body.competition-shell .cm-event-stage-category-label,
body.competition-shell .event-stage-category-label {
    display: block;
    margin-bottom: .25rem;
    color: var(--cm-event-stage-label-color) !important;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

body.competition-shell .cm-event-stage-category-value,
body.competition-shell .event-stage-category-value {
    color: var(--cm-event-stage-title-color) !important;
    font-weight: 750;
}

body.competition-shell .cm-event-stage-progress-pill,
body.competition-shell .event-stage-progress-pill {
    display: inline-flex;
    justify-content: center;
    min-width: 70px;
    padding: .35rem .65rem;
    color: var(--cm-event-stage-title-color) !important;
    background: var(--cm-event-stage-progress-bg) !important;
    border: 1px solid var(--cm-event-stage-progress-border) !important;
    border-radius: 999px;
    font-weight: 750;
}

body.competition-shell .cm-event-stage-category-action,
body.competition-shell .event-stage-category-action {
    text-align: right;
}

body.competition-shell .cm-page--stage-coordinator .btn-outline-secondary {
    color: var(--cm-heading-text, var(--cm-body-text)) !important;
    border-color: var(--cm-control-border, var(--cm-surface-border)) !important;
    background: transparent !important;
}

body.competition-shell .cm-page--stage-coordinator .btn-outline-secondary:hover,
body.competition-shell .cm-page--stage-coordinator .btn-outline-secondary:focus {
    color: var(--cm-heading-text, var(--cm-body-text)) !important;
    border-color: var(--cm-focus-color, var(--cm-gold-2)) !important;
    background: var(--cm-event-stage-header-hover-bg) !important;
}

@media (max-width: 991.98px) {
    body.competition-shell .cm-event-stage-category-row,
    body.competition-shell .event-stage-category-row {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

    body.competition-shell .cm-event-stage-category-action,
    body.competition-shell .event-stage-category-action {
        grid-column: 1 / -1;
        text-align: left;
    }

    body.competition-shell .cm-event-stage-category-action .btn,
    body.competition-shell .event-stage-category-action .btn {
        width: 100%;
        margin-top: .25rem;
    }
}

@media (max-width: 575.98px) {
    body.competition-shell .cm-event-stage-item-toggle,
    body.competition-shell .event-stage-item-toggle {
        padding: .9rem;
    }

    body.competition-shell .cm-event-stage-item-header,
    body.competition-shell .event-stage-item-header {
        align-items: flex-start;
        flex-direction: column;
    }

    body.competition-shell .cm-event-stage-item-title-row,
    body.competition-shell .event-stage-item-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .2rem;
    }

    body.competition-shell .cm-event-stage-item-meta,
    body.competition-shell .event-stage-item-meta {
        white-space: normal;
    }

    body.competition-shell .cm-event-stage-item-header-right,
    body.competition-shell .event-stage-item-header-right {
        width: 100%;
        justify-content: space-between;
    }

    body.competition-shell .cm-event-stage-item-status,
    body.competition-shell .event-stage-item-status {
        max-width: calc(100vw - 6rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.competition-shell .cm-event-stage-category-row,
    body.competition-shell .event-stage-category-row {
        grid-template-columns: 1fr;
    }
}


/* CM EVENT DAY LIVE STAGE CATEGORY FOUNDATION START */
body.competition-shell .stage-context-bar {
    border: 1px solid var(--cm-stage-live-shell-border, var(--cm-surface-border)) !important;
    background: var(--cm-stage-live-shell-bg, var(--cm-surface-bg)) !important;
    border-radius: var(--cm-radius-card, 1rem) !important;
    padding: .85rem;
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
}

body.competition-shell .stage-context-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .85rem 1rem;
}

body.competition-shell .stage-context-main {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-items: center;
    min-width: 0;
}

body.competition-shell .stage-context-pill {
    border: 1px solid var(--cm-stage-live-pill-border, var(--cm-surface-border));
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg));
    color: var(--cm-stage-live-pill-value, var(--cm-body-text)) !important;
    border-radius: 999px;
    padding: .42rem .7rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    line-height: 1.1;
    max-width: 100%;
}

body.competition-shell .stage-context-pill-primary {
    border-color: var(--cm-stage-live-pill-primary-border, var(--cm-focus-border));
    background: var(--cm-stage-live-pill-primary-bg, var(--cm-control-bg));
}

body.competition-shell .stage-context-pill-warning {
    border-color: var(--cm-stage-live-pill-warning-border, var(--cm-focus-color));
    background: var(--cm-stage-live-pill-warning-bg, var(--cm-control-bg));
}

body.competition-shell .stage-context-pill-code {
    border-color: var(--cm-stage-live-code-border, var(--cm-focus-color));
    background: var(--cm-stage-live-code-bg, var(--cm-control-bg));
    padding: .5rem .8rem;
}

body.competition-shell .stage-context-label {
    color: var(--cm-stage-live-pill-label, var(--cm-muted-text)) !important;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap;
    padding-right: .65rem;
    margin-right: .25rem;
    border-right: 1px solid var(--cm-stage-live-pill-divider, var(--cm-surface-border));
    min-height: 1.05rem;
    display: inline-flex;
    align-items: center;
}

body.competition-shell .stage-context-value {
    color: var(--cm-stage-live-pill-value, var(--cm-heading-text)) !important;
    font-size: .92rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.competition-shell .stage-context-pill-code .stage-context-label,
body.competition-shell .stage-context-pill-code .stage-context-value,
body.competition-shell .stage-context-pill-warning .stage-context-label,
body.competition-shell .stage-context-pill-warning .stage-context-value {
    color: var(--cm-stage-live-warning-text, var(--cm-focus-color)) !important;
}

body.competition-shell .stage-context-pill-code .stage-context-label {
    font-size: .75rem;
}

body.competition-shell .stage-context-pill-code .stage-context-value {
    font-size: .95rem;
}

body.competition-shell .stage-context-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    flex: 0 0 auto;
    min-width: max-content;
    margin-left: 0;
    padding-left: 1rem;
    border-left: 1px solid var(--cm-stage-live-pill-divider, var(--cm-surface-border));
}

body.competition-shell .stage-back-btn {
    border: 1px solid var(--cm-stage-live-back-border, var(--cm-control-border)) !important;
    background: var(--cm-stage-live-back-bg, var(--cm-control-bg)) !important;
    color: var(--cm-stage-live-back-text, var(--cm-heading-text)) !important;
    font-weight: 900;
    border-radius: 999px;
    padding: .48rem .85rem;
    box-shadow: var(--cm-stage-live-back-shadow, none);
    flex: 0 0 auto;
    align-self: flex-start;
    margin-left: auto;
}

body.competition-shell .stage-back-btn:hover,
body.competition-shell .stage-back-btn:focus {
    background: var(--cm-stage-live-back-hover-bg, var(--cm-hover-bg)) !important;
    border-color: var(--cm-stage-live-back-hover-border, var(--cm-focus-color)) !important;
    color: var(--cm-stage-live-back-hover-text, var(--cm-heading-text)) !important;
}

body.competition-shell .stage-music-download-btn {
    border-color: var(--cm-stage-live-music-border, rgba(34, 197, 94, .65)) !important;
    color: var(--cm-stage-live-music-text, #15803d) !important;
    background: var(--cm-stage-live-music-bg, rgba(22, 163, 74, .10)) !important;
    font-weight: 900;
    white-space: nowrap;
}

body.competition-shell .stage-music-download-btn:hover,
body.competition-shell .stage-music-download-btn:focus {
    color: var(--cm-stage-live-music-hover-text, #052e16) !important;
    background: var(--cm-stage-live-music-hover-bg, #22c55e) !important;
    border-color: var(--cm-stage-live-music-hover-bg, #22c55e) !important;
}

body.competition-shell .stage-summary-card,
body.competition-shell .stage-table-card,
body.competition-shell .stage-actions-card {
    border: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border)) !important;
    background: var(--cm-stage-live-card-bg, var(--cm-surface-bg)) !important;
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
    border-radius: var(--cm-radius-card, 1rem) !important;
    overflow: hidden;
    box-shadow: var(--cm-shadow-card, var(--cm-form-surface-shadow)) !important;
}

body.competition-shell .stage-table-card .card-header,
body.competition-shell .stage-actions-card .card-header {
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
    background: var(--cm-stage-live-card-header-bg, transparent) !important;
    border-bottom: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border)) !important;
}

body.competition-shell .stage-table-card .card-footer,
body.competition-shell .stage-actions-card .card-footer {
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
    background: var(--cm-stage-live-card-footer-bg, transparent) !important;
    border-top: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border)) !important;
}

body.competition-shell .stage-stat-grid .stage-stat {
    border: 1px solid var(--cm-stage-live-stat-border, var(--cm-surface-border));
    border-radius: var(--cm-radius-card-sm, .75rem);
    padding: .75rem .85rem;
    min-height: 64px;
    background: var(--cm-stage-live-stat-bg, var(--cm-control-bg));
    color: var(--cm-stage-live-heading, var(--cm-heading-text));
}

body.competition-shell .stage-stat .stage-stat-value {
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
}

body.competition-shell .stage-stat .stage-stat-label {
    margin-top: .35rem;
    font-size: .78rem;
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    font-weight: 700;
}

body.competition-shell .stage-live-callout {
    border: 1px solid var(--cm-stage-live-callout-border, var(--cm-info-border, var(--cm-surface-border))) !important;
    background: var(--cm-stage-live-callout-bg, var(--cm-surface-bg)) !important;
    border-radius: var(--cm-radius-card, 1rem) !important;
    padding: 1rem;
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
}

body.competition-shell .stage-live-callout.stage-live-active {
    border-color: var(--cm-stage-live-callout-active-border, var(--cm-danger-border, var(--cm-surface-border))) !important;
    background: var(--cm-stage-live-callout-active-bg, var(--cm-stage-live-callout-bg, var(--cm-surface-bg))) !important;
}

body.competition-shell .stage-live-title {
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--cm-stage-live-callout-title, var(--cm-link-color, var(--cm-heading-text))) !important;
}

body.competition-shell .stage-live-active .stage-live-title {
    color: var(--cm-stage-live-callout-active-title, var(--cm-danger, var(--cm-stage-live-callout-title))) !important;
}

body.competition-shell .stage-live-number-card {
    border: 1px solid var(--cm-stage-live-number-border, var(--cm-surface-border));
    border-radius: var(--cm-radius-card-sm, .85rem);
    padding: 1rem;
    height: 100%;
    background: var(--cm-stage-live-number-bg, var(--cm-control-bg));
}

body.competition-shell .stage-live-number-card .label {
    font-size: .82rem;
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .045em;
    opacity: 1;
}

body.competition-shell .stage-live-number-card .number {
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1;
    margin-top: .4rem;
}

body.competition-shell .stage-live-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--cm-stage-live-text, var(--cm-body-text));
    --bs-table-hover-bg: var(--cm-stage-live-table-hover-bg, rgba(148, 163, 184, .08));
    --bs-table-hover-color: var(--cm-stage-live-text, var(--cm-body-text));
    --bs-table-border-color: var(--cm-stage-live-table-border, var(--cm-surface-border));
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
    margin-bottom: 0;
}

body.competition-shell .stage-live-table thead th {
    white-space: nowrap;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .035em;
    color: var(--cm-stage-live-table-head-text, var(--cm-muted-text)) !important;
    font-weight: 800;
    background: var(--cm-stage-live-table-head-bg, transparent) !important;
    border-bottom-color: var(--cm-stage-live-table-border, var(--cm-surface-border)) !important;
}

body.competition-shell .stage-live-table tbody td {
    vertical-align: middle;
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
    border-top-color: var(--cm-stage-live-table-border-soft, var(--cm-stage-live-table-border, var(--cm-surface-border))) !important;
    padding-top: .8rem;
    padding-bottom: .8rem;
}

body.competition-shell .stage-judge-access-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.competition-shell .stage-judge-access-table {
    min-width: 720px;
}

body.competition-shell .stage-judge-access-table th,
body.competition-shell .stage-judge-access-table td {
    white-space: nowrap;
}

body.competition-shell .stage-row-performing {
    outline: 2px solid var(--cm-stage-live-row-performing-outline, rgba(251, 191, 36, .55));
    outline-offset: -2px;
    background: var(--cm-stage-live-row-performing-bg, rgba(251, 191, 36, .08)) !important;
}

body.competition-shell .stage-row-performed {
    background: var(--cm-stage-live-row-performed-bg, rgba(25, 135, 84, .08)) !important;
}

body.competition-shell .stage-row-absent {
    opacity: .78;
    background: var(--cm-stage-live-row-absent-bg, rgba(220, 53, 69, .06)) !important;
}

body.competition-shell .stage-row-reported {
    background: var(--cm-stage-live-row-reported-bg, rgba(13, 202, 240, .045)) !important;
}

body.competition-shell .stage-check-cell .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

body.competition-shell .stage-check-cell .form-check-input:disabled {
    cursor: not-allowed;
    opacity: .55;
}

body.competition-shell .stage-status-checkbox:disabled,
body.competition-shell .stage-status-checkbox[disabled],
body.competition-shell .stage-check-cell .form-check-input:disabled,
body.competition-shell .stage-mobile-action-box .form-check-input:disabled {
    opacity: .34 !important;
    cursor: not-allowed !important;
    filter: grayscale(1) saturate(.35) !important;
    box-shadow: none !important;
}

body.competition-shell .stage-status-checkbox[data-requires-judge-submission="true"][data-judge-submission-complete="false"]:not(:checked):not(:disabled) {
    border-color: var(--cm-stage-live-pending-mark-border, #f59e0b) !important;
    background-color: var(--cm-stage-live-pending-mark-bg, rgba(245, 158, 11, .08)) !important;
    box-shadow: 0 0 0 .16rem var(--cm-stage-live-pending-mark-shadow, rgba(245, 158, 11, .14)) !important;
    cursor: help !important;
}

body.competition-shell .stage-move-input {
    max-width: 72px;
}

body.competition-shell .stage-order-cell {
    min-width: 135px;
}

body.competition-shell .stage-order-move .btn {
    padding-left: .6rem;
    padding-right: .6rem;
}

body.competition-shell .stage-order-locked {
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

body.competition-shell .stage-chest-input {
    max-width: 110px;
    font-weight: 700;
}

body.competition-shell .stage-help-pill {
    border: 1px solid var(--cm-stage-live-code-border, var(--cm-focus-color));
    background: var(--cm-stage-live-code-bg, var(--cm-control-bg));
    color: var(--cm-stage-live-warning-text, var(--cm-focus-color)) !important;
    border-radius: 999px;
    padding: .35rem .7rem;
    font-size: .78rem;
    font-weight: 700;
}

body.competition-shell .stage-info-pill {
    border: 1px solid var(--cm-stage-live-pill-border, var(--cm-surface-border));
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg));
    color: var(--cm-stage-live-pill-value, var(--cm-body-text)) !important;
    border-radius: 999px;
    padding: .7rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    max-width: 100%;
}

body.competition-shell .stage-info-pill .stage-info-label {
    color: var(--cm-stage-live-pill-label, var(--cm-muted-text)) !important;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.competition-shell .stage-info-pill .stage-info-value {
    color: var(--cm-stage-live-pill-value, var(--cm-heading-text)) !important;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.competition-shell .stage-info-action {
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
}

body.competition-shell .stage-actions-card .card-header {
    background: var(--cm-stage-live-actions-header-bg, var(--cm-stage-live-card-header-bg, transparent)) !important;
    border-bottom-color: var(--cm-stage-live-actions-border, var(--cm-stage-live-card-border, var(--cm-surface-border))) !important;
}

body.competition-shell .stage-actions-card .card-body {
    padding: 1rem 1.15rem 1.2rem !important;
}

body.competition-shell .stage-actions-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

body.competition-shell .stage-action-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .65rem;
    min-height: 0;
    padding: 1rem;
    border: 1px solid var(--cm-stage-live-action-group-border, var(--cm-stage-live-card-border, var(--cm-surface-border)));
    border-radius: var(--cm-radius-card-sm, .9rem);
    background: var(--cm-stage-live-action-group-bg, var(--cm-control-bg));
    color: var(--cm-stage-live-text, var(--cm-body-text));
}

body.competition-shell .stage-action-group-title {
    color: var(--cm-stage-live-action-group-title, var(--cm-stage-live-heading, var(--cm-heading-text))) !important;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .84rem;
}

body.competition-shell .stage-action-status-list {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    align-items: center;
}

body.competition-shell .stage-action-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 100%;
    padding: .45rem .7rem !important;
    border-radius: 999px !important;
    line-height: 1.1;
}

body.competition-shell .stage-action-status-label {
    color: var(--cm-stage-live-pill-label, var(--cm-muted-text)) !important;
    font-weight: 800;
    font-size: .74rem;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.competition-shell .stage-action-status-value {
    color: var(--cm-stage-live-pill-value, var(--cm-heading-text)) !important;
    font-weight: 900;
    white-space: nowrap;
}

body.competition-shell .stage-action-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
    margin-top: .15rem;
}

body.competition-shell .stage-action-button-row .stage-live-ajax-form {
    margin: 0;
}

body.competition-shell .stage-action-group-final {
    background: var(--cm-stage-live-final-group-bg, var(--cm-stage-live-action-group-bg, var(--cm-control-bg)));
}

body.competition-shell .stage-action-button-row-final {
    justify-content: flex-start;
}

@media (min-width: 1200px) {
    body.competition-shell .stage-actions-layout {
        grid-template-columns: minmax(320px, 1.05fr) minmax(300px, .95fr) minmax(300px, .95fr);
    }
}

@media (max-width: 575.98px) {
    body.competition-shell .stage-actions-card .card-body {
        padding: .85rem !important;
    }

    body.competition-shell .stage-action-group {
        min-height: 0;
        padding: .85rem;
    }

    body.competition-shell .stage-action-button-row .cm-btn {
        width: 100%;
    }
}

body.competition-shell .stage-header-badge {
    font-size: .95rem;
    padding: .5rem .8rem;
    letter-spacing: .01em;
}

body.competition-shell .stage-header-badge-main {
    font-size: 1.05rem;
    padding: .55rem .95rem;
    font-weight: 800;
}

body.competition-shell .stage-mobile-queue {
    display: none;
}

body.competition-shell .cm-data-view:has(.stage-live-table) > .cm-data-cards,
body.competition-shell .cm-data-view:has(.stage-live-table) > .cm-data-tools,
body.competition-shell .cm-data-view:has(.stage-live-table) > .cm-data-empty {
    display: none !important;
}

body.competition-shell .stage-mobile-card {
    border: 1px solid var(--cm-stage-live-mobile-border, var(--cm-stage-live-card-border, var(--cm-surface-border)));
    background: var(--cm-stage-live-mobile-bg, var(--cm-stage-live-card-bg, var(--cm-surface-bg)));
    border-radius: var(--cm-radius-card, 1rem);
    margin: .85rem;
    overflow: hidden;
}

body.competition-shell .stage-mobile-card-header {
    width: 100%;
    border: 0;
    background: var(--cm-stage-live-mobile-header-bg, var(--cm-stage-live-card-header-bg, var(--cm-surface-bg)));
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    text-align: left;
}

body.competition-shell .stage-mobile-card-header:focus {
    outline: 2px solid var(--cm-stage-live-code-border, var(--cm-focus-color));
    outline-offset: -2px;
}

body.competition-shell .stage-mobile-card-header-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem .8rem;
    min-width: 0;
}

body.competition-shell .stage-mobile-card-header-number,
body.competition-shell .stage-mobile-card-header-chest {
    font-weight: 900;
    font-size: 1.05rem;
    white-space: nowrap;
}

body.competition-shell .stage-mobile-card-header-chest {
    color: var(--cm-stage-live-warning-text, var(--cm-focus-color)) !important;
}

body.competition-shell .stage-mobile-card-header-icon {
    color: var(--cm-stage-live-warning-text, var(--cm-focus-color)) !important;
    font-size: 1.1rem;
    transition: transform .18s ease-in-out;
}

body.competition-shell .stage-mobile-card-header[aria-expanded="true"] .stage-mobile-card-header-icon {
    transform: rotate(180deg);
}

body.competition-shell .stage-mobile-card-body {
    padding: 1rem;
    border-top: 1px solid var(--cm-stage-live-table-border-soft, var(--cm-surface-border));
}

body.competition-shell .stage-mobile-card.stage-row-performing {
    border-color: var(--cm-stage-live-row-performing-outline, rgba(251, 191, 36, .70));
    box-shadow: 0 0 0 1px var(--cm-stage-live-row-performing-shadow, rgba(251, 191, 36, .32));
}

body.competition-shell .stage-mobile-card.stage-row-performed {
    border-color: var(--cm-stage-live-row-performed-border, rgba(25, 135, 84, .45));
}

body.competition-shell .stage-mobile-card.stage-row-absent {
    border-color: var(--cm-stage-live-row-absent-border, rgba(220, 53, 69, .45));
}

body.competition-shell .stage-mobile-title {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    font-weight: 800;
}

body.competition-shell .stage-mobile-value {
    font-weight: 800;
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
}

body.competition-shell .stage-mobile-row {
    display: grid;
    grid-template-columns: minmax(110px, 38%) 1fr;
    gap: .75rem;
    align-items: center;
    padding: .72rem 0;
    border-top: 1px solid var(--cm-stage-live-table-border-soft, var(--cm-surface-border));
}

body.competition-shell .stage-mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin-top: .75rem;
}

body.competition-shell .stage-mobile-action-box {
    border: 1px solid var(--cm-stage-live-mobile-action-border, var(--cm-surface-border));
    border-radius: var(--cm-radius-card-sm, .85rem);
    padding: .75rem;
    background: var(--cm-stage-live-mobile-action-bg, var(--cm-control-bg));
    min-height: 62px;
}

body.competition-shell .stage-mobile-action-box .form-check {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    min-height: 32px;
}

body.competition-shell .stage-mobile-action-box .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
}

body.competition-shell .stage-mobile-move-form,
body.competition-shell .stage-mobile-chest-form {
    display: flex;
    gap: .5rem;
    align-items: center;
}

body.competition-shell .stage-mobile-chest-form .form-control,
body.competition-shell .stage-mobile-move-form .form-control {
    min-width: 0;
}

body.competition-shell .stage-inline-error {
    width: 100%;
    margin-top: .25rem;
    color: var(--cm-stage-live-error-text, var(--cm-alert-danger-text, #b91c1c)) !important;
    font-size: .78rem;
    font-weight: 700;
}

body.competition-shell .stage-chest-form.is-invalid [data-live-chest-input] {
    border-color: var(--cm-alert-danger-accent, #dc2626) !important;
    box-shadow: 0 0 0 .15rem var(--cm-alert-danger-chip-bg, rgba(220, 38, 38, .16)) !important;
}

@media (max-width: 991.98px) {
    body.competition-shell .stage-desktop-table {
        display: none !important;
    }

    body.competition-shell .stage-mobile-queue {
        display: block;
    }

    body.competition-shell .stage-summary-card {
        display: none !important;
    }

    body.competition-shell .stage-header-badge,
    body.competition-shell .stage-header-badge-main {
        font-size: .78rem;
        padding: .35rem .55rem;
        line-height: 1.05;
    }

    body.competition-shell .stage-context-bar {
        padding: .7rem;
        margin-bottom: .75rem !important;
    }

    body.competition-shell .stage-context-main {
        gap: .45rem;
    }

    body.competition-shell .stage-context-pill {
        padding: .36rem .58rem;
        max-width: 100%;
    }

    body.competition-shell .stage-context-label {
        font-size: .66rem;
    }

    body.competition-shell .stage-context-value {
        font-size: .82rem;
        max-width: 210px;
    }

    body.competition-shell .stage-context-bar .btn {
        padding: .35rem .55rem;
    }

    body.competition-shell .stage-context-actions {
        margin-left: .75rem;
        padding-left: .75rem;
    }

    body.competition-shell .stage-back-btn {
        align-self: flex-start;
        margin-left: auto;
    }

    body.competition-shell .stage-live-callout {
        margin-bottom: .75rem !important;
        padding: .75rem !important;
        border-radius: .9rem;
    }

    body.competition-shell .stage-live-title {
        font-size: .8rem;
        margin-bottom: .5rem !important;
    }

    body.competition-shell .stage-live-callout .row {
        --bs-gutter-x: .5rem;
        --bs-gutter-y: .5rem;
    }

    body.competition-shell .stage-live-number-card {
        padding: .65rem .75rem;
        border-radius: .75rem;
    }

    body.competition-shell .stage-live-number-card .label {
        font-size: .68rem;
        letter-spacing: .03em;
    }

    body.competition-shell .stage-live-number-card .number {
        font-size: 1.75rem;
        margin-top: .25rem;
    }

    body.competition-shell .stage-table-card .card-header {
        padding: .75rem 1rem;
    }

    body.competition-shell .stage-mobile-card {
        margin: .65rem;
        border-radius: .85rem;
    }

    body.competition-shell .stage-mobile-card-header {
        padding: .75rem .9rem;
    }

    body.competition-shell .stage-mobile-card-body {
        padding: .85rem;
    }

    body.competition-shell .stage-mobile-row {
        grid-template-columns: minmax(88px, 34%) 1fr;
        gap: .6rem;
        padding: .55rem 0;
    }

    body.competition-shell .stage-mobile-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
        margin-top: .55rem;
    }

    body.competition-shell .stage-mobile-action-box {
        padding: .6rem;
        min-height: 54px;
        border-radius: .75rem;
    }

    body.competition-shell .stage-mobile-title {
        font-size: .72rem;
    }

    body.competition-shell .stage-mobile-chest-form,
    body.competition-shell .stage-mobile-move-form {
        gap: .4rem;
    }

    body.competition-shell .stage-mobile-chest-form .btn,
    body.competition-shell .stage-mobile-move-form .btn {
        padding-left: .65rem;
        padding-right: .65rem;
    }
}

@media (max-width: 575.98px) {
    body.competition-shell .stage-context-shell {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    body.competition-shell .stage-context-main {
        width: 100%;
    }

    body.competition-shell .stage-context-actions {
        width: 100%;
        justify-self: stretch;
        justify-content: flex-end;
        margin-left: 0;
        margin-top: .15rem;
        padding-left: 0;
        padding-top: .65rem;
        border-left: 0;
        border-top: 1px solid var(--cm-stage-live-pill-divider, var(--cm-surface-border));
    }

    body.competition-shell .stage-back-btn {
        align-self: flex-end !important;
        margin-left: auto;
        margin-top: 0;
    }
}

@media (max-width: 420px) {
    body.competition-shell .stage-mobile-card-header-main {
        gap: .45rem;
    }

    body.competition-shell .stage-mobile-card-header-chest {
        font-size: .98rem;
    }
}
/* CM EVENT DAY LIVE STAGE CATEGORY FOUNDATION END */

/* CM EVENT DAY COMMON PAGE FOUNDATION END */

/* ==========================================================
   CM COMMON BUTTON + STATUS CHIP FOUNDATION
   Reusable button and badge primitives for admin/event-day pages.
   ========================================================== */
body.competition-shell .cm-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .38rem;
    border-radius: 999px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    min-height: 2.25rem;
    padding: .5rem .9rem !important;
    text-decoration: none !important;
    box-shadow: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}

body.competition-shell .cm-btn.btn-sm {
    min-height: 2rem;
    padding: .38rem .72rem !important;
    font-size: .82rem;
}

body.competition-shell .cm-btn:hover,
body.competition-shell .cm-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 .45rem 1rem rgba(15, 23, 42, .12);
}

body.competition-shell .cm-btn:disabled,
body.competition-shell .cm-btn.disabled {
    transform: none !important;
    box-shadow: none !important;
    cursor: not-allowed;
    opacity: .58;
}

body.competition-shell .cm-btn-neutral {
    color: var(--cm-heading-text, #0f172a) !important;
    background: var(--cm-control-bg, #ffffff) !important;
    border-color: var(--cm-control-border, var(--cm-surface-border, #cbd5e1)) !important;
}

body.competition-shell .cm-btn-neutral:hover,
body.competition-shell .cm-btn-neutral:focus {
    color: var(--cm-heading-text, #0f172a) !important;
    background: var(--cm-hover-bg, rgba(148, 163, 184, .16)) !important;
    border-color: var(--cm-focus-color, #f59e0b) !important;
}

body.competition-shell .cm-btn-warning,
body.competition-shell .btn-warning.cm-btn-warning {
    color: #451a03 !important;
    background: #f59e0b !important;
    border-color: #d97706 !important;
}

body.competition-shell .cm-btn-warning:hover,
body.competition-shell .cm-btn-warning:focus {
    color: #111827 !important;
    background: #fbbf24 !important;
    border-color: #f59e0b !important;
}

body.competition-shell .cm-btn-warning-outline,
body.competition-shell .btn-outline-warning.cm-btn-warning-outline {
    color: #d97706 !important;
    background: rgba(245, 158, 11, .08) !important;
    border-color: rgba(245, 158, 11, .70) !important;
}

body.competition-shell .cm-btn-warning-outline:hover,
body.competition-shell .cm-btn-warning-outline:focus {
    color: #111827 !important;
    background: #f59e0b !important;
    border-color: #d97706 !important;
}

body.competition-shell .cm-btn-success,
body.competition-shell .btn-success.cm-btn-success {
    color: #ffffff !important;
    background: #198754 !important;
    border-color: #157347 !important;
}

body.competition-shell .cm-btn-success:hover,
body.competition-shell .cm-btn-success:focus {
    color: #ffffff !important;
    background: #157347 !important;
    border-color: #146c43 !important;
}

body.competition-shell .cm-btn-success-outline {
    color: #047857 !important;
    background: rgba(16, 185, 129, .10) !important;
    border-color: rgba(16, 185, 129, .55) !important;
}

body.competition-shell .cm-btn-success-outline:hover,
body.competition-shell .cm-btn-success-outline:focus {
    color: #ffffff !important;
    background: #10b981 !important;
    border-color: #059669 !important;
}

body.competition-shell .cm-btn-danger,
body.competition-shell .btn-danger.cm-btn-danger {
    color: #ffffff !important;
    background: #dc3545 !important;
    border-color: #bb2d3b !important;
}

body.competition-shell .cm-btn-danger:hover,
body.competition-shell .cm-btn-danger:focus {
    color: #ffffff !important;
    background: #bb2d3b !important;
    border-color: #b02a37 !important;
}

body.competition-shell .cm-status-chip.text-bg-success,
body.competition-shell .cm-status-chip.bg-success {
    color: #dcfce7 !important;
    background: rgba(22, 163, 74, .26) !important;
    border-color: rgba(34, 197, 94, .42) !important;
}

body.competition-shell .cm-status-chip.text-bg-warning,
body.competition-shell .cm-status-chip.bg-warning {
    color: #451a03 !important;
    background: #facc15 !important;
    border-color: #eab308 !important;
}

body.competition-shell .cm-status-chip.text-bg-info,
body.competition-shell .cm-status-chip.bg-info {
    color: #075985 !important;
    background: rgba(14, 165, 233, .22) !important;
    border-color: rgba(56, 189, 248, .46) !important;
}

body.competition-shell .cm-status-chip.text-bg-secondary,
body.competition-shell .cm-status-chip.bg-secondary,
body.competition-shell .cm-status-chip.text-bg-dark,
body.competition-shell .cm-status-chip.bg-dark {
    color: var(--cm-heading-text, #e2e8f0) !important;
    background: rgba(100, 116, 139, .24) !important;
    border-color: rgba(148, 163, 184, .34) !important;
}

body.competition-shell .cm-status-chip.text-bg-danger,
body.competition-shell .cm-status-chip.bg-danger {
    color: #fee2e2 !important;
    background: rgba(220, 38, 38, .30) !important;
    border-color: rgba(248, 113, 113, .46) !important;
}

body.competition-shell .stage-live-empty-alert {
    border-radius: var(--cm-radius-card-sm, .75rem) !important;
    border-color: var(--cm-stage-live-warning-alert-border, rgba(245, 158, 11, .42)) !important;
    background: var(--cm-stage-live-warning-alert-bg, rgba(245, 158, 11, .14)) !important;
    color: var(--cm-stage-live-warning-alert-text, #854d0e) !important;
}

body.competition-shell[data-cm-theme="dark"] .cm-btn-neutral {
    color: #e5e7eb !important;
    background: rgba(15, 23, 42, .72) !important;
    border-color: rgba(148, 163, 184, .30) !important;
}

body.competition-shell[data-cm-theme="dark"] .cm-btn-neutral:hover,
body.competition-shell[data-cm-theme="dark"] .cm-btn-neutral:focus {
    color: #ffffff !important;
    background: rgba(30, 41, 59, .95) !important;
    border-color: #f59e0b !important;
}

body.competition-shell[data-cm-theme="dark"] .cm-btn-success-outline {
    color: #86efac !important;
    background: rgba(16, 185, 129, .12) !important;
    border-color: rgba(74, 222, 128, .55) !important;
}

body.competition-shell[data-cm-theme="dark"] .cm-btn-success-outline:hover,
body.competition-shell[data-cm-theme="dark"] .cm-btn-success-outline:focus {
    color: #052e16 !important;
    background: #86efac !important;
    border-color: #22c55e !important;
}

body.competition-shell[data-cm-theme="dark"] .cm-btn-warning-outline {
    color: #fbbf24 !important;
    background: rgba(245, 158, 11, .10) !important;
    border-color: rgba(251, 191, 36, .70) !important;
}

body.competition-shell[data-cm-theme="dark"] .stage-live-empty-alert {
    color: #fde68a !important;
    background: rgba(245, 158, 11, .13) !important;
    border-color: rgba(251, 191, 36, .42) !important;
}

/* Stage live chips opt into cm-status-chip while keeping their stage-specific layout. */
body.competition-shell .stage-context-pill.cm-status-chip {
    border-color: var(--cm-stage-live-pill-border, var(--cm-surface-border)) !important;
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg)) !important;
    color: var(--cm-stage-live-pill-value, var(--cm-body-text)) !important;
    min-height: 2.05rem;
}

body.competition-shell .stage-context-pill-primary.cm-status-chip {
    border-color: var(--cm-stage-live-pill-primary-border, var(--cm-focus-border)) !important;
    background: var(--cm-stage-live-pill-primary-bg, var(--cm-control-bg)) !important;
}

body.competition-shell .stage-context-pill-warning.cm-status-chip,
body.competition-shell .stage-context-pill-code.cm-status-chip {
    border-color: var(--cm-stage-live-code-border, var(--cm-focus-color)) !important;
    background: var(--cm-stage-live-code-bg, var(--cm-control-bg)) !important;
}

body.competition-shell .stage-info-pill.cm-status-chip {
    border-color: var(--cm-stage-live-pill-border, var(--cm-surface-border)) !important;
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg)) !important;
    color: var(--cm-stage-live-pill-value, var(--cm-body-text)) !important;
}

/* CM LIVE STAGE ACTION STATUS READABILITY START
   Keeps the shared grouped action layout, but makes the label/value chips readable in both themes. */
body.competition-shell .stage-action-status {
    min-height: 2.25rem;
    padding: .58rem .82rem !important;
    gap: .45rem;
    font-size: .86rem;
}

body.competition-shell .stage-action-status-label {
    font-size: .78rem;
    letter-spacing: .02em;
    opacity: 1;
}

body.competition-shell .stage-action-status-value {
    font-size: .86rem;
    letter-spacing: 0;
}

body.competition-shell .stage-action-status.cm-status-action .stage-action-status-label,
body.competition-shell .stage-action-status.text-bg-warning .stage-action-status-label {
    color: #78350f !important;
}

body.competition-shell .stage-action-status.cm-status-action .stage-action-status-value,
body.competition-shell .stage-action-status.text-bg-warning .stage-action-status-value {
    color: #111827 !important;
}

body.competition-shell .stage-action-status.cm-status-complete .stage-action-status-label,
body.competition-shell .stage-action-status.text-bg-success .stage-action-status-label {
    color: var(--cm-stage-live-success-label, #065f46) !important;
}

body.competition-shell .stage-action-status.cm-status-complete .stage-action-status-value,
body.competition-shell .stage-action-status.text-bg-success .stage-action-status-value {
    color: var(--cm-stage-live-success-value, #064e3b) !important;
}
/* CM LIVE STAGE ACTION STATUS READABILITY END */


/* CM LIVE STAGE NEUTRAL INFO PILL COLOUR START
   Keep routine action-status chips such as No. of Judges, Score Entry and Timing Status neutral.
   Program Code is highlighted separately below because it is a key operational identifier. */
body.competition-shell .stage-context-pill-code.cm-status-chip {
    border-color: var(--cm-stage-live-pill-border, var(--cm-surface-border)) !important;
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg)) !important;
}

body.competition-shell .stage-context-pill-code .stage-context-label {
    color: var(--cm-stage-live-pill-label, var(--cm-muted-text)) !important;
}

body.competition-shell .stage-context-pill-code .stage-context-value {
    color: var(--cm-stage-live-pill-value, var(--cm-heading-text)) !important;
}

body.competition-shell .stage-action-status.cm-status-neutral .stage-action-status-label {
    color: var(--cm-stage-live-pill-label, var(--cm-muted-text)) !important;
}

body.competition-shell .stage-action-status.cm-status-neutral .stage-action-status-value {
    color: var(--cm-stage-live-pill-value, var(--cm-heading-text)) !important;
}
/* CM LIVE STAGE NEUTRAL INFO PILL COLOUR END */


/* CM LIVE STAGE PROGRAM CODE HIGHLIGHT START
   Program Code is an operational identifier, so keep it visually highlighted like an active/status chip. */
body.competition-shell .stage-context-pill-code.cm-status-chip {
    border-color: var(--cm-stage-live-code-highlight-border, #eab308) !important;
    background: var(--cm-stage-live-code-highlight-bg, #facc15) !important;
    color: var(--cm-stage-live-code-highlight-value, #111827) !important;
    box-shadow: 0 .25rem .75rem var(--cm-stage-live-code-highlight-shadow, rgba(245, 158, 11, .18));
}

body.competition-shell .stage-context-pill-code .stage-context-label {
    color: var(--cm-stage-live-code-highlight-label, #78350f) !important;
    border-right-color: var(--cm-stage-live-code-highlight-divider, rgba(120, 53, 15, .35)) !important;
}

body.competition-shell .stage-context-pill-code .stage-context-value {
    color: var(--cm-stage-live-code-highlight-value, #111827) !important;
}
/* CM LIVE STAGE PROGRAM CODE HIGHLIGHT END */

/* CM EVENT DAY JUDGING AND TIMING COMMON FOUNDATION START */
body.competition-shell .cm-event-access-shell {
    max-width: 1180px;
    margin: 0 auto;
}

body.competition-shell .cm-event-access-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

body.competition-shell .cm-event-access-title {
    margin: 0;
    color: var(--cm-page-title-color, var(--cm-heading-text));
    font-size: clamp(1.75rem, 2.6vw, 2.5rem);
    font-weight: 900;
    letter-spacing: -.035em;
}

body.competition-shell .cm-event-access-subtitle {
    color: var(--cm-muted-text, var(--cm-muted));
    font-size: .96rem;
    margin-top: .2rem;
}

body.competition-shell .cm-event-access-icon {
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5b301, #ffcc33);
    color: #111827;
    font-size: 1.35rem;
    box-shadow: 0 12px 24px rgba(245, 179, 1, .22);
    flex: 0 0 auto;
}

body.competition-shell .cm-event-access-card,
body.competition-shell .cm-event-form-card {
    color: var(--cm-body-text, var(--cm-text)) !important;
    background: var(--cm-stage-live-card-bg, var(--cm-surface-bg)) !important;
    border: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border)) !important;
    border-radius: var(--cm-radius-card, 1.25rem) !important;
    box-shadow: var(--cm-shadow-card, 0 18px 50px rgba(15, 23, 42, .12)) !important;
    overflow: hidden;
}

body.competition-shell .cm-event-access-card .card-body,
body.competition-shell .cm-event-form-card .cm-surface-body {
    padding: clamp(1rem, 2vw, 1.5rem);
}

body.competition-shell .cm-event-entry-option {
    height: 100%;
    color: var(--cm-body-text, var(--cm-text)) !important;
    background: var(--cm-stage-live-action-group-bg, var(--cm-soft-bg)) !important;
    border: 1px solid var(--cm-stage-live-action-group-border, var(--cm-surface-border)) !important;
    border-radius: var(--cm-radius-card-sm, 1rem);
    padding: 1.1rem;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

body.competition-shell .cm-event-entry-option:focus-within {
    border-color: var(--cm-focus-border, #f59e0b) !important;
    background: var(--cm-hover-bg, var(--cm-stage-live-action-group-bg)) !important;
    transform: translateY(-1px);
}

body.competition-shell .cm-event-entry-heading {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1rem;
    color: var(--cm-heading-text, var(--cm-text)) !important;
    font-weight: 900;
}

body.competition-shell .cm-event-entry-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #92400e;
    background: rgba(245, 158, 11, .14);
    flex: 0 0 auto;
}

body.competition-shell .cm-event-entry-icon-success {
    color: #047857;
    background: rgba(16, 185, 129, .16);
}

body.competition-shell .cm-event-entry-title {
    font-size: 1.05rem;
    line-height: 1.2;
}

body.competition-shell .cm-event-access-label {
    color: var(--cm-heading-text, var(--cm-text)) !important;
    font-weight: 800;
    margin-bottom: .5rem;
}

body.competition-shell .cm-event-access-input {
    min-height: 3.2rem;
    border-radius: .8rem;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

body.competition-shell .cm-event-entry-field {
    display: grid;
    gap: .45rem;
    min-width: 0;
}

body.competition-shell .cm-event-entry-field .cm-event-access-label {
    margin-bottom: 0;
}

body.competition-shell .cm-event-validation {
    display: block !important;
    width: 100%;
    margin-top: .05rem;
    color: var(--cm-validation-danger, #dc2626) !important;
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.25;
}

body.competition-shell .cm-event-validation.field-validation-valid {
    display: none !important;
}

body.competition-shell .cm-event-validation.field-validation-error {
    display: block !important;
}

body.competition-shell .cm-event-access-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

body.competition-shell .cm-event-access-actions .cm-btn {
    min-width: 9.5rem;
}

body.competition-shell .judge-count-pill,
body.competition-shell .timing-count-pill {
    border: 1px solid var(--cm-stage-live-warning-alert-border, rgba(245, 158, 11, .42));
    color: var(--cm-stage-live-warning-alert-text, #854d0e);
    background: var(--cm-stage-live-warning-alert-bg, rgba(245, 158, 11, .10));
    border-radius: 999px;
    padding: .55rem .85rem;
    text-align: center;
    font-weight: 800;
}

body.competition-shell .judge-mobile-list,
body.competition-shell .timing-chest-list {
    padding: 1rem;
}

body.competition-shell .judge-chest-card,
body.competition-shell .timing-chest-card {
    border: 1px solid var(--cm-stage-live-mobile-border, var(--cm-stage-live-card-border, var(--cm-surface-border)));
    border-radius: var(--cm-radius-card-sm, 1rem);
    background: var(--cm-stage-live-mobile-bg, var(--cm-stage-live-card-bg, var(--cm-surface-bg)));
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
    padding: .9rem;
    margin-bottom: .85rem;
}

body.competition-shell .judge-card-top {
    display: block;
}

body.competition-shell .judge-card-main {
    flex: 1;
    min-width: 0;
}

body.competition-shell .judge-card-main-row,
body.competition-shell .timing-card-main-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: .65rem;
    align-items: center;
}

body.competition-shell .judge-card-label,
body.competition-shell .timing-card-label {
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .15rem;
}

body.competition-shell .judge-chest-number,
body.competition-shell .timing-chest-number {
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
    font-size: 1.45rem;
    font-weight: 900;
    line-height: 1;
}

body.competition-shell .judge-status-badge,
body.competition-shell .timing-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .38rem .68rem;
    font-weight: 900;
    white-space: nowrap;
    font-size: .84rem;
}

body.competition-shell .judge-mark-submitted,
body.competition-shell .judge-mark-complete,
body.competition-shell .timing-status-performed {
    color: var(--cm-stage-live-success-value, #047857) !important;
    border-color: rgba(34, 197, 94, .42) !important;
    background: rgba(22, 163, 74, .16) !important;
}

body.competition-shell .judge-mark-draft {
    color: #075985 !important;
    border-color: rgba(56, 189, 248, .45) !important;
    background: rgba(14, 165, 233, .16) !important;
}

body.competition-shell .timing-status-performing {
    color: #92400e !important;
    border-color: rgba(245, 158, 11, .55) !important;
    background: rgba(245, 158, 11, .16) !important;
}

body.competition-shell .judge-mark-pending {
    color: #451a03 !important;
    border-color: #eab308 !important;
    background: #facc15 !important;
}

body.competition-shell .judge-mark-waiting,
body.competition-shell .timing-status-waiting {
    color: var(--cm-stage-live-pill-value, var(--cm-heading-text)) !important;
    border-color: var(--cm-stage-live-pill-border, var(--cm-surface-border)) !important;
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg)) !important;
}

body.competition-shell .judge-card-divider,
body.competition-shell .timing-card-divider {
    height: 1px;
    background: var(--cm-stage-live-table-border-soft, var(--cm-surface-border));
    margin: .75rem 0;
}

body.competition-shell .judge-card-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
}

body.competition-shell .judge-card-total-row span {
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    font-size: .9rem;
}

body.competition-shell .judge-card-total-row strong {
    color: var(--cm-stage-live-code-highlight-bg, #facc15) !important;
    font-size: 1.25rem;
    font-weight: 900;
}

body.competition-shell .judge-current-performing {
    border-color: var(--cm-stage-live-row-performing-outline, rgba(245, 158, 11, .65)) !important;
    background: var(--cm-stage-live-row-performing-bg, var(--cm-stage-live-mobile-bg)) !important;
    box-shadow: 0 0 0 1px var(--cm-stage-live-row-performing-shadow, rgba(245, 158, 11, .18));
}

body.competition-shell .timing-current-performing {
    border-color: var(--cm-stage-live-row-performing-outline, rgba(245, 158, 11, .65)) !important;
    background: var(--cm-stage-live-row-performing-bg, var(--cm-stage-live-mobile-bg)) !important;
    box-shadow: 0 0 0 1px var(--cm-stage-live-row-performing-shadow, rgba(245, 158, 11, .18));
}

body.competition-shell .judge-live-pill,
body.competition-shell .timing-live-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .38rem .7rem;
    background: rgba(245, 158, 11, .14);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, .45);
    font-size: .82rem;
    font-weight: 900;
    margin-bottom: .8rem;
}

body.competition-shell .timing-live-pill {
    background: rgba(245, 158, 11, .14);
    color: #b45309;
    border-color: rgba(245, 158, 11, .45);
}

body.competition-shell .judge-enter-mark-btn,
body.competition-shell .timing-action-btn {
    white-space: nowrap;
}

body.competition-shell .judge-finish-footer {
    padding: 1rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--cm-stage-live-card-footer-bg, var(--cm-surface-bg)) !important;
    backdrop-filter: blur(8px);
}

body.competition-shell .judge-finish-btn {
    width: 100%;
}

body.competition-shell .judge-finish-modal {
    color: var(--cm-body-text, var(--cm-text)) !important;
    background: var(--cm-stage-live-card-bg, var(--cm-surface-bg)) !important;
    border: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border));
    border-radius: var(--cm-radius-card, 1rem);
    box-shadow: var(--cm-shadow-card, 0 24px 60px rgba(0, 0, 0, .24));
}

body.competition-shell .judge-finish-modal .modal-header,
body.competition-shell .judge-finish-modal .modal-footer {
    border-color: var(--cm-stage-live-card-border, var(--cm-surface-border));
}

body.competition-shell .judge-finish-modal .modal-title {
    color: var(--cm-heading-text, var(--cm-text)) !important;
    font-weight: 900;
}

body.competition-shell .judge-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

body.competition-shell .judge-total-pill {
    border: 1px solid var(--cm-stage-live-pill-border, var(--cm-surface-border));
    border-radius: .75rem;
    padding: .6rem .85rem;
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg));
    white-space: nowrap;
}

body.competition-shell .judge-total-pill strong {
    color: var(--cm-stage-live-code-highlight-bg, #facc15) !important;
    margin-left: .25rem;
}

body.competition-shell .judge-criteria-list {
    display: grid;
    gap: .8rem;
}

body.competition-shell .judge-criteria-card {
    border: 1px solid var(--cm-stage-live-mobile-border, var(--cm-surface-border));
    border-radius: var(--cm-radius-card-sm, 1rem);
    background: var(--cm-stage-live-mobile-bg, var(--cm-control-bg));
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr 230px;
    gap: 1rem;
    align-items: center;
}

body.competition-shell .judge-criteria-title {
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
    font-weight: 900;
    font-size: 1rem;
    margin-bottom: .25rem;
}

body.competition-shell .judge-criteria-description,
body.competition-shell .judge-min-max {
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    font-size: .9rem;
}

body.competition-shell .judge-min-max {
    display: flex;
    gap: .55rem;
}

body.competition-shell .judge-min-max strong {
    color: var(--cm-stage-live-code-highlight-bg, #facc15) !important;
}

body.competition-shell .judge-mark-entry {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .6rem;
    align-items: center;
}

body.competition-shell .judge-mark-input,
body.competition-shell .timing-number-input {
    text-align: center;
    font-weight: 900;
}

body.competition-shell .judge-mark-input {
    font-size: 1.35rem;
    min-height: 3.1rem;
}

body.competition-shell .judge-max-label {
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
    font-size: 1.15rem;
    font-weight: 800;
}

body.competition-shell .judge-field-error,
body.competition-shell .client-mark-error {
    grid-column: 1 / -1;
}

body.competition-shell .judge-comment-input {
    min-height: 120px;
}

body.competition-shell .judge-action-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--cm-stage-live-card-footer-bg, var(--cm-surface-bg));
    backdrop-filter: blur(8px);
    padding: 1rem 0;
    display: grid;
    grid-template-columns: 1.2fr .9fr 1fr;
    gap: .8rem;
}

body.competition-shell .judge-action-btn {
    min-height: 3.25rem;
}

body.competition-shell .cm-event-page-header.timing-entry-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

body.competition-shell .cm-event-entry-section {
    border: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border)) !important;
    background: var(--cm-stage-live-card-bg, var(--cm-surface-bg)) !important;
    border-radius: var(--cm-radius-card, 1rem) !important;
    overflow: hidden;
    box-shadow: var(--cm-shadow-card, var(--cm-form-surface-shadow)) !important;
}

body.competition-shell .timing-entry-card-header {
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border));
    color: var(--cm-stage-live-code-highlight-bg, #facc15) !important;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

body.competition-shell .timing-entry-card-body {
    padding: 1.15rem;
}

body.competition-shell .timing-number-input {
    max-width: 90px;
    font-size: 1.15rem;
}

body.competition-shell .timing-table-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 120px minmax(230px, 280px);
    gap: 1rem;
    align-items: center;
    padding: .85rem 0;
    border-top: 1px solid var(--cm-stage-live-table-border-soft, var(--cm-surface-border));
}

body.competition-shell .good-green {
    color: #047857 !important;
}

body.competition-shell .deduct-red {
    color: #dc2626 !important;
}

body.competition-shell .timing-entry-action-panel {
    border: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border)) !important;
    background: var(--cm-stage-live-card-bg, var(--cm-surface-bg)) !important;
    border-radius: var(--cm-radius-card, 1rem) !important;
}

body.competition-shell .timing-action-btn {
    min-width: 160px;
    min-height: 44px;
}

@media (max-width: 991.98px) {
    body.competition-shell .cm-event-access-shell {
        max-width: none;
    }

    body.competition-shell .cm-event-access-header {
        margin-bottom: 1rem;
    }

    body.competition-shell .cm-event-access-actions {
        justify-content: stretch;
    }

    body.competition-shell .cm-event-access-actions .cm-btn {
        width: 100%;
    }

    body.competition-shell .timing-table-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    body.competition-shell .judge-card-main-row,
    body.competition-shell .timing-card-main-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    body.competition-shell .judge-card-status,
    body.competition-shell .timing-card-status,
    body.competition-shell .judge-enter-mark-btn {
        width: 100%;
    }

    body.competition-shell .judge-status-badge,
    body.competition-shell .timing-status-badge,
    body.competition-shell .judge-enter-mark-btn {
        justify-content: center;
    }

    body.competition-shell .judge-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    body.competition-shell .judge-total-pill {
        font-size: .9rem;
    }

    body.competition-shell .judge-criteria-card {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    body.competition-shell .judge-mark-input {
        width: 100%;
        font-size: 1.5rem;
    }

    body.competition-shell .judge-action-bar {
        grid-template-columns: 1fr;
        padding: 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
    }

    body.competition-shell .judge-action-btn,
    body.competition-shell .timing-action-btn {
        width: 100%;
    }
}

/* CM EVENT DAY JUDGE AND MANUAL SCORE PAGE NORMALISATION START */
body.competition-shell .cm-event-score-page {
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
}

body.competition-shell .cm-event-score-page .form-label,
body.competition-shell .cm-event-score-page label,
body.competition-shell .cm-event-score-page .fw-semibold,
body.competition-shell .cm-event-score-page .fs-4,
body.competition-shell .cm-event-score-page .fs-6 {
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
}

body.competition-shell .cm-event-score-page .text-muted,
body.competition-shell .cm-event-score-page .form-text,
body.competition-shell .cm-event-score-page small {
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
}

body.competition-shell .cm-page--manual-paper-marking .manual-paper-total-pill,
body.competition-shell .cm-page--manual-paper-marking .manual-score-card,
body.competition-shell .cm-page--manual-paper-marking .manual-paper-criteria-card {
    border: 1px solid var(--cm-stage-live-mobile-border, var(--cm-surface-border)) !important;
    border-radius: var(--cm-radius-card-sm, 1rem) !important;
    background: var(--cm-stage-live-mobile-bg, var(--cm-control-bg)) !important;
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
}

body.competition-shell .cm-page--manual-paper-marking .manual-paper-total-pill {
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg)) !important;
    color: var(--cm-stage-live-muted, var(--cm-muted-text)) !important;
}

body.competition-shell .cm-page--manual-paper-marking .manual-paper-judges-label {
    color: var(--cm-stage-live-warning-text, var(--cm-stage-live-code-highlight-bg, #f59e0b)) !important;
}

body.competition-shell .cm-page--manual-paper-marking .manual-paper-judge-name,
body.competition-shell .cm-page--manual-paper-marking .manual-paper-criteria-card .fw-semibold,
body.competition-shell .cm-page--manual-paper-marking .manual-score-card .fw-semibold,
body.competition-shell .cm-page--manual-paper-marking .judge-access-code__value {
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
}

body.competition-shell .cm-page--manual-paper-marking .manual-paper-judge-grid.border-start {
    border-left-color: var(--cm-stage-live-table-border, var(--cm-surface-border)) !important;
}

body.competition-shell .cm-page--manual-paper-marking hr {
    border-color: var(--cm-stage-live-table-border-soft, var(--cm-surface-border)) !important;
    opacity: 1;
}

body.competition-shell .cm-page--manual-paper-marking .manual-paper-mark-cell .input-group-text,
body.competition-shell .cm-page--manual-paper-marking .manual-paper-comment-cell .input-group-text {
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
    background: var(--cm-stage-live-pill-bg, var(--cm-control-bg)) !important;
    border-color: var(--cm-stage-live-card-border, var(--cm-surface-border)) !important;
}

body.competition-shell .cm-page--manual-paper-marking .judge-assignment-table > :not(caption) > * > * {
    background-color: transparent !important;
    border-color: var(--cm-stage-live-table-border-soft, var(--cm-surface-border)) !important;
    color: var(--cm-stage-live-text, var(--cm-body-text)) !important;
}

body.competition-shell .cm-page--manual-paper-marking .judge-assignment-table thead th {
    color: var(--cm-stage-live-table-head-text, var(--cm-muted-text)) !important;
}

body.competition-shell .cm-page--manual-paper-marking .judge-assignment-table .form-control[readonly] {
    cursor: default;
}
/* CM EVENT DAY JUDGE AND MANUAL SCORE PAGE NORMALISATION END */

/* CM EVENT DAY JUDGING AND TIMING COMMON FOUNDATION END */

/* CM SCORE ENTRY CONTEXT AND SCORE RANGE NORMALISATION START */
body.competition-shell .cm-event-score-page .stage-context-main {
    align-items: stretch;
}

body.competition-shell .cm-event-score-page .judge-min-max strong,
body.competition-shell .cm-event-score-page .judge-total-pill strong,
body.competition-shell .cm-event-score-page .manual-paper-total-pill strong,
body.competition-shell .cm-event-score-page .manual-paper-judge-total strong,
body.competition-shell .cm-event-score-page .manual-paper-criteria-card strong.text-warning {
    color: var(--cm-score-entry-highlight, var(--cm-stage-live-warning-text, #f59e0b)) !important;
}

body.competition-shell .cm-page--timing-entry .timing-entry-card-header {
    color: var(--cm-score-entry-highlight, var(--cm-stage-live-warning-text, #f59e0b)) !important;
}
/* CM SCORE ENTRY CONTEXT AND SCORE RANGE NORMALISATION END */

/* ==========================================================
   Public registration pages use the same registration form shell
   as the normal logged-in registration screens.
   ========================================================== */
body.competition-shell:has(.public-registration-page) .dashboard-shell {
    display: flex !important;
    min-height: 100vh !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: clamp(1rem, 2vw, 2rem) !important;
}

body.competition-shell:has(.public-registration-page) .dashboard-main {
    width: 100% !important;
    max-width: min(1180px, 100%) !important;
    padding: clamp(1rem, 2vw, 1.75rem) !important;
}

body.competition-shell:has(.public-registration-page) .dashboard-main > .top-account-bar,
body.competition-shell:has(.public-registration-page) .dashboard-main > .d-flex.justify-content-end {
    display: none !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .row {
    display: flex !important;
    flex-wrap: wrap !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page [data-single-consent-section].d-none,
body.competition-shell:has(.public-registration-page) .public-registration-page [data-single-consent-section][hidden] {
    display: none !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page [class*="col-"] {
    flex: 0 0 auto !important;
    max-width: 100% !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .col-12,
body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-12 {
    width: 100% !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .col-sm-3 {
    width: 25% !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .col-sm-9 {
    width: 75% !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-3 {
    width: 25% !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-4 {
    width: 33.333333% !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-5 {
    width: 41.666667% !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-6 {
    width: 50% !important;
}

body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-8 {
    width: 66.666667% !important;
}

.registration-start-shell {
    max-width: 1120px;
}

.registration-start-card {
    overflow: hidden;
}

.registration-form-subtitle {
    color: var(--cm-muted);
    font-weight: 500;
}

.registration-start-alert {
    border-radius: .95rem;
    border-width: 1px;
    margin-bottom: 1rem;
}

.registration-start-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.registration-start-options > .registration-start-option-card:only-child {
    grid-column: 1 / -1;
}

.registration-start-option-card,
.registration-status-section {
    border: 1px solid var(--cm-border);
    border-radius: 1.1rem;
    background: var(--cm-card-bg-2);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}

.registration-start-option-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.1rem;
    min-height: 11rem;
}

.registration-start-options > .registration-start-option-card:only-child {
    grid-column: 1 / -1;
}

.registration-start-option-icon {
    flex: 0 0 auto;
    width: 2.85rem;
    height: 2.85rem;
    display: grid;
    place-items: center;
    border-radius: .95rem;
    color: #111827;
    background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2));
    box-shadow: 0 10px 24px rgba(245, 158, 11, .24);
}

.registration-start-option-icon--group {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    box-shadow: 0 10px 24px rgba(79, 70, 229, .22);
}

.registration-start-option-body {
    min-width: 0;
}

.registration-start-option-body h5,
.registration-status-section__header h5 {
    margin: 0;
    color: var(--cm-title);
    font-weight: 800;
    letter-spacing: -.01em;
}

.registration-start-option-body p {
    margin: .45rem 0 1rem;
}

.registration-start-action {
    border-radius: .65rem;
    font-weight: 800;
    padding-inline: 1rem;
}

.public-registration-status-page {
    max-width: 1120px;
}

.registration-status-card {
    overflow: hidden;
}

.registration-status-section {
    margin-top: 1rem;
    overflow: hidden;
}

.registration-status-section__header {
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--cm-border);
    background: var(--cm-card-header-bg);
}

.registration-status-dl {
    padding: 1rem;
}

.registration-status-dl dt {
    color: var(--cm-muted-2);
    font-weight: 800;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .04em;
    margin-bottom: .65rem;
}

.registration-status-dl dd {
    color: var(--cm-text);
    margin-bottom: .65rem;
}

.registration-status-table {
    color: var(--cm-text) !important;
    margin: 0;
}

.registration-status-table thead th {
    color: var(--cm-title) !important;
    background: var(--cm-card-header-bg) !important;
    border-color: var(--cm-border) !important;
    font-weight: 800;
}

.registration-status-table tbody td {
    color: var(--cm-text) !important;
    border-color: var(--cm-border) !important;
    background: transparent !important;
}

@media (max-width: 767.98px) {
    body.competition-shell:has(.public-registration-page) .dashboard-shell {
        padding: .75rem !important;
    }

    body.competition-shell:has(.public-registration-page) .dashboard-main {
        padding: .25rem !important;
    }

    body.competition-shell:has(.public-registration-page) .public-registration-page .col-sm-3,
    body.competition-shell:has(.public-registration-page) .public-registration-page .col-sm-9,
    body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-3,
    body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-4,
    body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-5,
    body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-6,
    body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-8,
    body.competition-shell:has(.public-registration-page) .public-registration-page .col-md-12 {
        width: 100% !important;
    }

    .registration-start-options {
        grid-template-columns: 1fr;
    }

    .registration-start-option-card {
        min-height: auto;
    }
}

/* ==========================================================
   Shared modern date input + calendar picker
   Used by registration forms. Supports manual dd/mm/yyyy entry
   and stays theme-aware through the common CM variables.
   ========================================================== */
.cm-date-input {
    position: relative;
    width: 100%;
}

.cm-date-input__text {
    padding-right: 3rem !important;
}

.cm-date-input__toggle {
    position: absolute;
    top: 50%;
    right: .45rem;
    transform: translateY(-50%);
    width: 2.1rem;
    height: 2.1rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: .65rem;
    color: var(--cm-muted-2);
    background: transparent;
    line-height: 1;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.cm-date-input__toggle:hover,
.cm-date-input__toggle:focus-visible {
    color: var(--cm-gold-2);
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .32);
    box-shadow: 0 0 0 .2rem rgba(245, 158, 11, .10);
    outline: 0;
}

.cm-date-input__toggle:disabled {
    cursor: not-allowed;
    opacity: .55;
    box-shadow: none;
}

.cm-date-picker-popover {
    position: absolute;
    z-index: 1080;
    top: calc(100% + .45rem);
    right: 0;
    width: min(21rem, calc(100vw - 2rem));
    padding: .85rem;
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    color: var(--cm-text);
    background: var(--cm-surface);
    box-shadow: 0 24px 60px rgba(2, 6, 23, .30);
    display: none;
}

.cm-date-input--open .cm-date-picker-popover {
    display: block;
}

.cm-date-picker__header {
    display: grid;
    grid-template-columns: 2.1rem minmax(0, 1fr) 2.1rem;
    align-items: center;
    gap: .55rem;
    margin-bottom: .75rem;
}

.cm-date-picker__nav,
.cm-date-picker__link {
    border: 1px solid var(--cm-border);
    color: var(--cm-text);
    background: rgba(148, 163, 184, .08);
    border-radius: .65rem;
    font-weight: 700;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.cm-date-picker__nav {
    width: 2.1rem;
    height: 2.1rem;
    display: inline-grid;
    place-items: center;
}

.cm-date-picker__nav:hover,
.cm-date-picker__link:hover,
.cm-date-picker__nav:focus-visible,
.cm-date-picker__link:focus-visible {
    color: #111827;
    background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2));
    border-color: transparent;
    outline: 0;
}

.cm-date-picker__month-year {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 5.25rem;
    gap: .45rem;
}

.cm-date-picker__month,
.cm-date-picker__year {
    min-height: 2.1rem;
    border: 1px solid var(--cm-border);
    border-radius: .65rem;
    color: var(--cm-text);
    background: var(--cm-bg-soft);
    padding: .25rem .55rem;
    font-weight: 700;
}

.cm-date-picker__month:focus,
.cm-date-picker__year:focus {
    border-color: var(--cm-gold-2);
    box-shadow: 0 0 0 .2rem rgba(245, 158, 11, .13);
    outline: 0;
}

.cm-date-picker__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .3rem;
}

.cm-date-picker__weekday {
    color: var(--cm-muted-2);
    font-size: .72rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .25rem 0;
}

.cm-date-picker__empty {
    min-height: 2rem;
}

.cm-date-picker__day {
    min-height: 2rem;
    border: 1px solid transparent;
    border-radius: .6rem;
    color: var(--cm-text);
    background: transparent;
    font-weight: 700;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.cm-date-picker__day:hover,
.cm-date-picker__day:focus-visible {
    color: #111827;
    background: rgba(245, 158, 11, .78);
    border-color: rgba(245, 158, 11, .75);
    outline: 0;
}

.cm-date-picker__day.is-today {
    border-color: rgba(99, 102, 241, .72);
}

.cm-date-picker__day.is-selected {
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    border-color: rgba(129, 140, 248, .85);
    box-shadow: 0 8px 18px rgba(79, 70, 229, .26);
}

.cm-date-picker__footer {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .75rem;
}

.cm-date-picker__link {
    padding: .35rem .75rem;
    font-size: .85rem;
}

body.competition-shell[data-cm-theme="light"] .cm-date-picker-popover {
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .14);
}

body.competition-shell[data-cm-theme="light"] .cm-date-picker__month,
body.competition-shell[data-cm-theme="light"] .cm-date-picker__year {
    color: #0f172a;
    background: #ffffff;
}

body.competition-shell[data-cm-theme="light"] .cm-date-picker__day,
body.competition-shell[data-cm-theme="light"] .cm-date-picker__nav,
body.competition-shell[data-cm-theme="light"] .cm-date-picker__link {
    color: #0f172a;
}



/* Keep global date inputs compact inside tables.
   Without this, Edge/Chrome can stretch the text input to the full table column width,
   leaving a large empty area before the calendar button. */
.cm-date-input--table {
    display: inline-block;
    width: 12.75rem;
    max-width: 100%;
    min-width: 10.75rem;
    vertical-align: middle;
}

.cm-date-input--table .cm-date-input__text {
    padding-right: 2.35rem !important;
}

.cm-date-input--table .cm-date-input__toggle {
    right: .35rem;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: .55rem;
    font-size: .82rem;
}

.cm-date-input--table.cm-date-input--sm {
    width: 11.75rem;
    min-width: 10.25rem;
}

/* Shared date input: compact/table support */
.cm-date-input--sm .cm-date-input__text {
    padding-right: 2.45rem !important;
}

.cm-date-input--sm .cm-date-input__toggle {
    right: .35rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: .5rem;
    font-size: .8rem;
}

.cm-date-input--sm .cm-date-picker-popover {
    width: min(20rem, calc(100vw - 2rem));
}

.table-responsive.cm-date-input-context-open {
    overflow: visible;
}

@media (max-width: 575.98px) {
    .cm-date-picker-popover {
        left: 0;
        right: auto;
        width: min(21rem, calc(100vw - 2rem));
    }
}

/* ==========================================================
   CM shared TomSelect final caret hardening
   Keeps every enhanced select using the common wrapper/control style.
   Prevents TomSelect Bootstrap's native triangle from appearing inside
   page controls such as Submit Appeal Item / Category.
   ========================================================== */
html body.competition-shell .ts-wrapper.single .ts-control::before,
html body.competition-shell .ts-wrapper.single .ts-control:before,
html body.competition-shell .ts-wrapper.single .ts-control::after,
html body.competition-shell .ts-wrapper.single .ts-control:after,
html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control::before,
html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control:before,
html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control::after,
html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control:after,
html body.competition-shell .cm-tomselect-wrapper.single .ts-control::before,
html body.competition-shell .cm-tomselect-wrapper.single .ts-control:before,
html body.competition-shell .cm-tomselect-wrapper.single .ts-control::after,
html body.competition-shell .cm-tomselect-wrapper.single .ts-control:after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single::after,
html body.competition-shell .cm-tomselect-wrapper.single::after {
    box-sizing: border-box !important;
}

/* CM TOMSELECT COMMON FINAL FIX 2026-06-14
   Use one common TomSelect visual model everywhere.
   Remove TomSelect/Bootstrap pseudo triangles completely and draw the caret
   as a small background chevron on the control. This fixes the large white
   triangle seen on Submit Appeal in light theme. */
html body.competition-shell .ts-wrapper.single,
html body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single,
html body.competition-shell .cm-tomselect-wrapper.single {
    position: relative !important;
}

html body.competition-shell .ts-wrapper.single::before,
html body.competition-shell .ts-wrapper.single:before,
html body.competition-shell .ts-wrapper.single::after,
html body.competition-shell .ts-wrapper.single:after,
html body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single::before,
html body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single:before,
html body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single::after,
html body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single:after,
html body.competition-shell .cm-tomselect-wrapper.single::before,
html body.competition-shell .cm-tomselect-wrapper.single:before,
html body.competition-shell .cm-tomselect-wrapper.single::after,
html body.competition-shell .cm-tomselect-wrapper.single:after,
html body.competition-shell .ts-wrapper.single .ts-control::before,
html body.competition-shell .ts-wrapper.single .ts-control:before,
html body.competition-shell .ts-wrapper.single .ts-control::after,
html body.competition-shell .ts-wrapper.single .ts-control:after,
html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control::before,
html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control:before,
html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control::after,
html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control:after {
    content: none !important;
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

html body.competition-shell .ts-wrapper.single .ts-control,
html body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single .ts-control,
html body.competition-shell .cm-tomselect-wrapper.single .ts-control,
html body.competition-shell .cm-tomselect-wrapper.single .cm-tomselect-control {
    padding-right: 2.45rem !important;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--cm-muted-2) 50%),
        linear-gradient(135deg, var(--cm-muted-2) 50%, transparent 50%) !important;
    background-position:
        calc(100% - 1.18rem) 50%,
        calc(100% - .88rem) 50% !important;
    background-size: .34rem .34rem, .34rem .34rem !important;
    background-repeat: no-repeat !important;
}

html body.competition-shell .ts-wrapper.single.dropdown-active .ts-control,
html body.competition-shell .ts-wrapper.cm-tomselect-wrapper.single.dropdown-active .ts-control,
html body.competition-shell .cm-tomselect-wrapper.single.dropdown-active .ts-control,
html body.competition-shell .cm-tomselect-wrapper.single.dropdown-active .cm-tomselect-control {
    background-image:
        linear-gradient(45deg, transparent 50%, var(--cm-gold) 50%),
        linear-gradient(135deg, var(--cm-gold) 50%, transparent 50%) !important;
}

html body.competition-shell .ts-wrapper.single .ts-control > input,
html body.competition-shell .ts-wrapper.single .ts-control input {
    box-shadow: none !important;
    background: transparent !important;
}

/* Event Day Recovery page components
   Recovery uses the common CM surface/button/accordion shell; these rules only define
   recovery-specific card grids and action layouts. */
.cm-page--event-day-recovery .accordion-button {
    background: rgba(15, 23, 42, .86);
    color: var(--bs-body-color);
    border-radius: 1rem !important;
    box-shadow: none;
}

.cm-page--event-day-recovery .accordion-button:not(.collapsed) {
    background: rgba(245, 158, 11, .14);
    color: var(--bs-body-color);
}

.cm-page--event-day-recovery .accordion-button:focus {
    box-shadow: 0 0 0 .2rem rgba(245, 158, 11, .22);
}

.cm-page--event-day-recovery .accordion-body {
    padding: 1rem;
}

.recovery-summary-grid,
.recovery-card-grid,
.recovery-result-grid {
    display: grid;
    gap: 1rem;
}

.recovery-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.recovery-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.recovery-result-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.recovery-card {
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .54);
    border-radius: 1rem;
    padding: 1rem;
    min-width: 0;
}

.recovery-card--danger {
    border-color: rgba(248, 113, 113, .45);
}

.recovery-card--warning {
    border-color: rgba(245, 158, 11, .42);
}

.recovery-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.recovery-muted {
    color: var(--bs-secondary-color);
    font-size: .875rem;
}

.recovery-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .75rem;
    margin-top: .85rem;
}

.recovery-meta-item {
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: .85rem;
    padding: .65rem .75rem;
    background: rgba(2, 6, 23, .18);
}

.recovery-meta-label {
    color: var(--bs-secondary-color);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.recovery-meta-value {
    font-weight: 700;
    margin-top: .15rem;
}

.recovery-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .9rem;
}

.recovery-action-row .btn {
    border-radius: 999px;
    font-weight: 700;
}

.recovery-section-note {
    border: 1px solid rgba(14, 165, 233, .24);
    border-left: .35rem solid rgba(14, 165, 233, .75);
    background: rgba(14, 165, 233, .10);
    border-radius: .85rem;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
}

.recovery-warning-note {
    border-color: rgba(245, 158, 11, .28);
    border-left-color: rgba(245, 158, 11, .9);
    background: rgba(245, 158, 11, .10);
}

.recovery-danger-note {
    border-color: rgba(248, 113, 113, .30);
    border-left-color: rgba(248, 113, 113, .90);
    background: rgba(248, 113, 113, .10);
}

.recovery-participant-list,
.recovery-result-list {
    display: grid;
    gap: .9rem;
}

.recovery-participant-card,
.recovery-result-card {
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .46);
    border-radius: 1rem;
    padding: 1rem;
}

.recovery-participant-head,
.recovery-result-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem;
    align-items: flex-start;
}

.recovery-chest-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    border-radius: .9rem;
    padding: .35rem .6rem;
    background: rgba(245, 158, 11, .16);
    border: 1px solid rgba(245, 158, 11, .35);
    font-weight: 800;
}

.recovery-action-explain {
    margin-top: .75rem;
    padding-top: .75rem;
    border-top: 1px dashed rgba(148, 163, 184, .24);
}

.recovery-action-explain strong {
    display: block;
    margin-bottom: .15rem;
}

.recovery-action-help {
    border: 1px solid rgba(148, 163, 184, .20);
    border-radius: 1rem;
    background: rgba(2, 6, 23, .18);
    padding: .9rem 1rem;
    margin-bottom: 1rem;
}

.recovery-action-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: .75rem;
    margin-top: .65rem;
}

.recovery-action-help-item {
    border-left: .25rem solid rgba(245, 158, 11, .85);
    padding-left: .7rem;
}

.recovery-action-help-item strong {
    display: block;
    margin-bottom: .15rem;
}

.recovery-modal-message {
    white-space: pre-line;
    border-radius: .85rem;
    background: rgba(245, 158, 11, .10);
    border: 1px solid rgba(245, 158, 11, .25);
    padding: .85rem;
}

@media (max-width: 768px) {
    .cm-page--event-day-recovery .accordion-body {
        padding: .75rem;
    }

    .recovery-card-grid,
    .recovery-result-grid {
        grid-template-columns: 1fr;
    }

    .recovery-card,
    .recovery-participant-card,
    .recovery-result-card {
        padding: .85rem;
    }

    .recovery-action-row .btn {
        width: 100%;
    }
}


/* CM LIVE CONTROL TABLET DASHBOARD OVERRIDES START */
body.competition-shell .stage-judge-name-truncate {
    display: inline-block;
    max-width: 18ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

body.competition-shell .stage-actions-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, .82fr);
}

body.competition-shell .stage-action-group-final {
    grid-column: 2;
    grid-row: 1 / span 2;
}

body.competition-shell .stage-mobile-card-header-static {
    cursor: default;
}

body.competition-shell .stage-mobile-card-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: .75rem .9rem;
    align-items: end;
    width: 100%;
}

body.competition-shell .stage-mobile-card-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: .3rem;
}

body.competition-shell .stage-mobile-card-value {
    min-width: 0;
    color: var(--cm-stage-live-heading, var(--cm-heading-text)) !important;
    font-weight: 800;
}

body.competition-shell .stage-mobile-order-value {
    min-height: 2.25rem;
    display: flex;
    align-items: center;
}

body.competition-shell .stage-mobile-status-field .cm-status-chip {
    align-self: flex-start;
}

body.competition-shell .stage-mobile-card-body-visible {
    display: block !important;
}

body.competition-shell .stage-mobile-actions-visible {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.competition-shell .stage-mobile-action-box {
    text-align: center;
}

body.competition-shell .stage-mobile-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
}

body.competition-shell .stage-mobile-checkbox-wrap .form-check-input,
body.competition-shell .stage-mobile-action-box > .form-check-input {
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
}

body.competition-shell .stage-mobile-move-form,
body.competition-shell .stage-mobile-chest-form {
    flex-wrap: wrap;
}

body.competition-shell .stage-mobile-move-form .form-control {
    max-width: 70px;
}

body.competition-shell .stage-mobile-chest-form .form-control {
    max-width: 150px;
}

body.competition-shell .stage-small-screen-notice-content {
    border: 1px solid var(--cm-stage-live-card-border, var(--cm-surface-border));
    background: var(--cm-stage-live-card-bg, var(--cm-surface-bg));
    color: var(--cm-stage-live-text, var(--cm-body-text));
    border-radius: var(--cm-radius-card, 1rem);
    box-shadow: var(--cm-shadow-card, var(--cm-form-surface-shadow));
}

body.competition-shell .stage-small-screen-notice-content .modal-header,
body.competition-shell .stage-small-screen-notice-content .modal-footer {
    border-color: var(--cm-stage-live-card-border, var(--cm-surface-border));
}

body.competition-shell .stage-small-screen-notice-content .modal-title {
    color: var(--cm-stage-live-heading, var(--cm-heading-text));
    font-weight: 900;
}

@media (max-width: 991.98px) {
    body.competition-shell .stage-mobile-card-header-static {
        display: block;
    }

    body.competition-shell .stage-mobile-card-header-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.competition-shell .stage-mobile-actions-visible {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    body.competition-shell .stage-actions-layout {
        grid-template-columns: 1fr;
    }

    body.competition-shell .stage-action-group-final {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 575.98px) {
    body.competition-shell .stage-mobile-card-header-grid,
    body.competition-shell .stage-mobile-actions-visible {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    body.competition-shell .stage-actions-layout {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, .9fr) minmax(0, 1fr);
    }

    body.competition-shell .stage-action-group-final {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    body.competition-shell .stage-actions-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.competition-shell .stage-action-group-final {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}


/* Live Control tablet queue two-section card refinement */
body.competition-shell .stage-row-next {
    outline: 2px solid var(--cm-stage-live-row-next-outline, rgba(59, 130, 246, .55));
    outline-offset: -2px;
    background: var(--cm-stage-live-row-next-bg, rgba(59, 130, 246, .075)) !important;
}

body.competition-shell .stage-live-table tbody tr.stage-row-performing {
    outline: 2px solid var(--cm-stage-live-row-performing-outline, rgba(251, 191, 36, .78));
    outline-offset: -2px;
    background: var(--cm-stage-live-row-performing-bg, rgba(251, 191, 36, .13)) !important;
}

body.competition-shell .stage-live-table tbody tr.stage-row-next {
    background: var(--cm-stage-live-row-next-bg, rgba(59, 130, 246, .075)) !important;
}

body.competition-shell .stage-mobile-card.stage-row-performing {
    border-color: var(--cm-stage-live-row-performing-outline, rgba(251, 191, 36, .85));
    box-shadow: 0 0 0 2px var(--cm-stage-live-row-performing-shadow, rgba(251, 191, 36, .34));
    background: var(--cm-stage-live-row-performing-bg, rgba(251, 191, 36, .10));
}

body.competition-shell .stage-mobile-card.stage-row-next {
    border-color: var(--cm-stage-live-row-next-outline, rgba(59, 130, 246, .72));
    box-shadow: 0 0 0 2px var(--cm-stage-live-row-next-shadow, rgba(59, 130, 246, .18));
    background: var(--cm-stage-live-row-next-bg, rgba(59, 130, 246, .065));
}

body.competition-shell .stage-mobile-card.stage-row-performing .stage-mobile-card-header-static,
body.competition-shell .stage-mobile-card.stage-row-next .stage-mobile-card-header-static {
    background: transparent;
}

body.competition-shell .stage-mobile-card-header-grid,
body.competition-shell .stage-mobile-actions-visible {
    display: grid;
    width: 100%;
    align-items: start;
}

body.competition-shell .stage-mobile-card-header-grid {
    grid-template-columns: minmax(90px, .75fr) minmax(150px, 1.18fr) minmax(90px, .7fr) minmax(104px, .78fr);
    gap: .65rem .8rem;
}

body.competition-shell .stage-mobile-actions-visible {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
}

body.competition-shell .stage-mobile-card-field,
body.competition-shell .stage-mobile-action-box {
    min-width: 0;
}

body.competition-shell .stage-mobile-card-field {
    padding: .2rem .25rem;
}

body.competition-shell .stage-mobile-action-box {
    padding: .55rem .45rem;
    min-height: 58px;
}

body.competition-shell .stage-mobile-card-value,
body.competition-shell .stage-mobile-value,
body.competition-shell .stage-mobile-status-field .cm-status-chip {
    max-width: 100%;
}

body.competition-shell .stage-mobile-move-form,
body.competition-shell .stage-mobile-chest-form {
    flex-wrap: nowrap;
    max-width: 100%;
}

body.competition-shell .stage-mobile-move-form .form-control {
    width: 4.25rem;
    max-width: 4.25rem;
}

body.competition-shell .stage-mobile-chest-form .form-control {
    width: 6.75rem;
    max-width: 6.75rem;
}

body.competition-shell .stage-mobile-move-form .btn,
body.competition-shell .stage-mobile-chest-form .btn {
    padding-left: .55rem !important;
    padding-right: .55rem !important;
    min-height: 2rem;
}

@media (max-width: 991.98px) and (min-width: 576px) {
    body.competition-shell .stage-mobile-card-header-grid {
        grid-template-columns: minmax(86px, .72fr) minmax(142px, 1.16fr) minmax(82px, .68fr) minmax(96px, .78fr);
    }

    body.competition-shell .stage-mobile-actions-visible {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    body.competition-shell .stage-mobile-card-header-grid,
    body.competition-shell .stage-mobile-actions-visible {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Live Control scroll/top, disabled queue checkbox clarity, and tablet judge cards */
body.competition-shell .stage-scroll-top-btn {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--cm-stage-live-code-border, var(--cm-focus-color));
    background: var(--cm-stage-live-code-bg, var(--cm-control-bg));
    color: var(--cm-stage-live-warning-text, var(--cm-focus-color)) !important;
    font-weight: 900;
    font-size: 1.35rem;
    line-height: 1;
    box-shadow: var(--cm-shadow-card, 0 16px 32px rgba(15, 23, 42, .2));
    opacity: 0;
    visibility: hidden;
    transform: translateY(.4rem);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

body.competition-shell .stage-scroll-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.competition-shell .stage-scroll-top-btn:hover,
body.competition-shell .stage-scroll-top-btn:focus-visible {
    background: var(--cm-stage-live-back-hover-bg, var(--cm-hover-bg));
    border-color: var(--cm-stage-live-back-hover-border, var(--cm-focus-color));
    color: var(--cm-stage-live-back-hover-text, var(--cm-heading-text)) !important;
    outline: none;
}

body.competition-shell .stage-live-table .form-check-input:disabled,
body.competition-shell .stage-live-table .form-check-input[disabled],
body.competition-shell .stage-mobile-action-box .form-check-input:disabled,
body.competition-shell .stage-mobile-action-box .form-check-input[disabled] {
    opacity: 1 !important;
    cursor: not-allowed !important;
    filter: none !important;
}

body.competition-shell .stage-live-table .form-check-input:disabled:not(:checked),
body.competition-shell .stage-live-table .form-check-input[disabled]:not(:checked),
body.competition-shell .stage-mobile-action-box .form-check-input:disabled:not(:checked),
body.competition-shell .stage-mobile-action-box .form-check-input[disabled]:not(:checked) {
    background-color: var(--cm-stage-disabled-checkbox-bg, rgba(148, 163, 184, .16)) !important;
    border-color: var(--cm-stage-disabled-checkbox-border, rgba(100, 116, 139, .52)) !important;
    box-shadow: inset 0 0 0 1px var(--cm-stage-disabled-checkbox-inner, rgba(255, 255, 255, .38)) !important;
}

body.competition-shell .stage-live-table .form-check-input:disabled:checked,
body.competition-shell .stage-live-table .form-check-input[disabled]:checked,
body.competition-shell .stage-mobile-action-box .form-check-input:disabled:checked,
body.competition-shell .stage-mobile-action-box .form-check-input[disabled]:checked {
    background-color: var(--cm-stage-disabled-checked-bg, rgba(16, 185, 129, .72)) !important;
    border-color: var(--cm-stage-disabled-checked-border, rgba(5, 150, 105, .9)) !important;
    box-shadow: 0 0 0 .12rem var(--cm-stage-disabled-checked-shadow, rgba(16, 185, 129, .18)) !important;
}

body.competition-shell[data-cm-theme="dark"] .stage-live-table .form-check-input:disabled:not(:checked),
body.competition-shell[data-cm-theme="dark"] .stage-live-table .form-check-input[disabled]:not(:checked),
body.competition-shell[data-cm-theme="dark"] .stage-mobile-action-box .form-check-input:disabled:not(:checked),
body.competition-shell[data-cm-theme="dark"] .stage-mobile-action-box .form-check-input[disabled]:not(:checked) {
    background-color: var(--cm-stage-disabled-checkbox-bg-dark, rgba(30, 41, 59, .86)) !important;
    border-color: var(--cm-stage-disabled-checkbox-border-dark, rgba(148, 163, 184, .56)) !important;
    box-shadow: inset 0 0 0 1px rgba(2, 6, 23, .38) !important;
}

body.competition-shell[data-cm-theme="dark"] .stage-live-table .form-check-input:disabled:checked,
body.competition-shell[data-cm-theme="dark"] .stage-live-table .form-check-input[disabled]:checked,
body.competition-shell[data-cm-theme="dark"] .stage-mobile-action-box .form-check-input:disabled:checked,
body.competition-shell[data-cm-theme="dark"] .stage-mobile-action-box .form-check-input[disabled]:checked {
    background-color: var(--cm-stage-disabled-checked-bg-dark, rgba(16, 185, 129, .6)) !important;
    border-color: var(--cm-stage-disabled-checked-border-dark, rgba(52, 211, 153, .76)) !important;
    box-shadow: 0 0 0 .12rem rgba(16, 185, 129, .16) !important;
}

body.competition-shell .stage-judge-access-cards {
    display: none;
}

body.competition-shell .stage-judge-access-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem .85rem;
    padding: .8rem .9rem;
    border: 1px solid var(--cm-stage-live-mobile-border, var(--cm-stage-live-card-border, var(--cm-surface-border)));
    border-radius: var(--cm-radius-card-sm, .85rem);
    background: var(--cm-stage-live-mobile-bg, var(--cm-stage-live-card-bg, var(--cm-surface-bg)));
}

body.competition-shell .stage-judge-access-field {
    min-width: 0;
}

@media (max-width: 991.98px) {
    body.competition-shell .stage-judge-access-table-responsive {
        display: none !important;
    }

    body.competition-shell .stage-judge-access-cards {
        display: grid;
        gap: .75rem;
    }
}

@media (max-width: 767.98px) {
    body.competition-shell .stage-judge-access-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    body.competition-shell .stage-scroll-top-btn {
        right: .75rem;
        bottom: .75rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.2rem;
    }
}


/* Live Control tablet queue card/reg-number conditional layout and clearer disabled checkbox states */
body.competition-shell .stage-mobile-card-header-grid.stage-mobile-card-header-grid-no-reg {
    grid-template-columns: minmax(90px, .8fr) minmax(150px, 1.2fr) minmax(104px, .85fr);
}

body.competition-shell .stage-mobile-card-header-grid.stage-mobile-card-header-grid-with-sheet-no.stage-mobile-card-header-grid-no-reg {
    grid-template-columns: minmax(86px, .78fr) minmax(86px, .72fr) minmax(150px, 1.2fr) minmax(104px, .85fr);
}

body.competition-shell .stage-mobile-card-header-grid.stage-mobile-card-header-grid-with-sheet-no.stage-mobile-card-header-grid-with-reg {
    grid-template-columns: minmax(86px, .78fr) minmax(86px, .72fr) minmax(150px, 1.2fr) minmax(112px, .9fr) minmax(104px, .85fr);
}

body.competition-shell .stage-live-table .form-check-input:not(:disabled):not([disabled]),
body.competition-shell .stage-mobile-action-box .form-check-input:not(:disabled):not([disabled]) {
    border-width: 1.5px;
}

body.competition-shell .stage-live-table .form-check-input:disabled,
body.competition-shell .stage-live-table .form-check-input[disabled],
body.competition-shell .stage-mobile-action-box .form-check-input:disabled,
body.competition-shell .stage-mobile-action-box .form-check-input[disabled] {
    opacity: 1 !important;
    cursor: not-allowed !important;
    filter: none !important;
}

body.competition-shell .stage-live-table .form-check-input:disabled:not(:checked),
body.competition-shell .stage-live-table .form-check-input[disabled]:not(:checked),
body.competition-shell .stage-mobile-action-box .form-check-input:disabled:not(:checked),
body.competition-shell .stage-mobile-action-box .form-check-input[disabled]:not(:checked) {
    background-color: var(--cm-stage-disabled-checkbox-bg, rgba(226, 232, 240, .78)) !important;
    background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--cm-stage-disabled-checkbox-stripe, rgba(100, 116, 139, .22)) 4px 7px) !important;
    border-color: var(--cm-stage-disabled-checkbox-border, rgba(100, 116, 139, .68)) !important;
    border-style: dashed !important;
    box-shadow: inset 0 0 0 1px var(--cm-stage-disabled-checkbox-inner, rgba(255, 255, 255, .68)) !important;
}

body.competition-shell .stage-live-table .form-check-input:disabled:checked,
body.competition-shell .stage-live-table .form-check-input[disabled]:checked,
body.competition-shell .stage-mobile-action-box .form-check-input:disabled:checked,
body.competition-shell .stage-mobile-action-box .form-check-input[disabled]:checked {
    background-color: var(--cm-stage-disabled-checked-bg, #64748b) !important;
    border-color: var(--cm-stage-disabled-checked-border, #475569) !important;
    border-style: solid !important;
    box-shadow: 0 0 0 .12rem var(--cm-stage-disabled-checked-shadow, rgba(100, 116, 139, .22)) !important;
}

body.competition-shell[data-cm-theme="dark"] .stage-live-table .form-check-input:disabled:not(:checked),
body.competition-shell[data-cm-theme="dark"] .stage-live-table .form-check-input[disabled]:not(:checked),
body.competition-shell[data-cm-theme="dark"] .stage-mobile-action-box .form-check-input:disabled:not(:checked),
body.competition-shell[data-cm-theme="dark"] .stage-mobile-action-box .form-check-input[disabled]:not(:checked) {
    background-color: var(--cm-stage-disabled-checkbox-bg-dark, rgba(51, 65, 85, .95)) !important;
    background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--cm-stage-disabled-checkbox-stripe-dark, rgba(148, 163, 184, .30)) 4px 7px) !important;
    border-color: var(--cm-stage-disabled-checkbox-border-dark, rgba(148, 163, 184, .78)) !important;
    border-style: dashed !important;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .72) !important;
}

body.competition-shell[data-cm-theme="dark"] .stage-live-table .form-check-input:disabled:checked,
body.competition-shell[data-cm-theme="dark"] .stage-live-table .form-check-input[disabled]:checked,
body.competition-shell[data-cm-theme="dark"] .stage-mobile-action-box .form-check-input:disabled:checked,
body.competition-shell[data-cm-theme="dark"] .stage-mobile-action-box .form-check-input[disabled]:checked {
    background-color: var(--cm-stage-disabled-checked-bg-dark, #64748b) !important;
    border-color: var(--cm-stage-disabled-checked-border-dark, #94a3b8) !important;
    border-style: solid !important;
    box-shadow: 0 0 0 .13rem rgba(148, 163, 184, .18) !important;
}

@media (max-width: 991.98px) and (min-width: 576px) {
    body.competition-shell .stage-mobile-card-header-grid.stage-mobile-card-header-grid-no-reg {
        grid-template-columns: minmax(86px, .78fr) minmax(142px, 1.2fr) minmax(96px, .84fr);
    }

    body.competition-shell .stage-mobile-card-header-grid.stage-mobile-card-header-grid-with-sheet-no.stage-mobile-card-header-grid-no-reg,
    body.competition-shell .stage-mobile-card-header-grid.stage-mobile-card-header-grid-with-sheet-no.stage-mobile-card-header-grid-with-reg {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

/* CM LIVE CONTROL TABLET DASHBOARD OVERRIDES END */

/* ================================
   ACTIVE LEFT NAVIGATION STATE
   Highlights the current page and its expanded parent groups.
   ================================ */
.dashboard-sidebar .side-nav a.active,
.dashboard-sidebar .side-nav .side-nav-subitem.active,
.dashboard-sidebar .side-nav .side-nav-submenu a.side-nav-subitem.active,
.dashboard-sidebar .side-nav .side-nav-section-items .side-nav-subitem.active {
    color: #111827 !important;
    background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2)) !important;
    border-color: rgba(245,158,11,.55) !important;
    font-weight: 800 !important;
    box-shadow: 0 12px 28px rgba(245,158,11,.18) !important;
}

.dashboard-sidebar .side-nav a.active i,
.dashboard-sidebar .side-nav .side-nav-subitem.active i,
.dashboard-sidebar .side-nav .side-nav-submenu a.side-nav-subitem.active i,
.dashboard-sidebar .side-nav .side-nav-section-items .side-nav-subitem.active i {
    color: #111827 !important;
}

.dashboard-sidebar .side-nav .side-nav-group.has-active > button.side-nav-toggle,
.dashboard-sidebar .side-nav button.side-nav-toggle.active {
    color: #ffffff !important;
    background: rgba(245,158,11,.16) !important;
    border-color: rgba(245,158,11,.36) !important;
    font-weight: 800 !important;
    box-shadow: inset 3px 0 0 var(--cm-gold) !important;
}

.dashboard-sidebar .side-nav .side-nav-group.has-active > button.side-nav-toggle i,
.dashboard-sidebar .side-nav button.side-nav-toggle.active i {
    color: var(--cm-gold-2) !important;
}

.dashboard-sidebar .side-nav .side-nav-section-group.has-active > button.side-nav-section-toggle,
.dashboard-sidebar .side-nav button.side-nav-section-toggle.active {
    color: #ffffff !important;
    background: rgba(245,158,11,.10) !important;
    border-color: rgba(245,158,11,.25) !important;
    font-weight: 900 !important;
}

body.sidebar-collapsed .dashboard-sidebar .side-nav .side-nav-group.has-active > button.side-nav-toggle,
body.sidebar-collapsed .dashboard-sidebar .side-nav button.side-nav-toggle.active,
body.sidebar-collapsed .dashboard-sidebar .side-nav a.active {
    background: rgba(245,158,11,.20) !important;
    border-color: rgba(245,158,11,.45) !important;
    box-shadow: 0 12px 30px rgba(245,158,11,.18), inset 0 -3px 0 var(--cm-gold) !important;
}


/* Stage running-order planner */
.stage-planner-sections{display:flex;flex-direction:column;gap:1.25rem;padding:1rem}.stage-planner-section{border:1px solid rgba(255,255,255,.16);border-radius:16px;background:rgba(15,23,42,.42);overflow:hidden}.stage-planner-section-header{display:flex;justify-content:space-between;gap:1rem;align-items:center;padding:1rem;border-bottom:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.04)}.stage-planner-section-header h3{margin:0;font-size:1.1rem;font-weight:800}.stage-planner-count{border:1px solid rgba(148,163,184,.45);border-radius:999px;padding:.25rem .65rem;font-size:.8rem;font-weight:700}.stage-planner-item-controls{display:grid;grid-template-columns:140px minmax(220px,1fr) minmax(120px,.45fr);gap:.85rem;align-items:start}.stage-planner-category-list{display:flex;flex-direction:column;gap:.75rem}.stage-planner-category-row{display:block}.stage-planner-category-heading{display:flex;align-items:center;gap:.65rem;margin-bottom:.75rem}.stage-display-order{display:inline-flex;min-width:3rem;justify-content:center;border-radius:999px;padding:.2rem .55rem;font-weight:800;background:rgba(34,211,238,.16);color:#67e8f9;border:1px solid rgba(34,211,238,.45)}.stage-planner-category-controls{display:grid;grid-template-columns:minmax(180px,1.2fr) minmax(120px,.6fr) minmax(120px,.6fr);gap:.75rem}.stage-order-input{max-width:150px}.stage-empty-message{padding:1rem;border:1px dashed rgba(148,163,184,.45);border-radius:12px;color:#cbd5e1;background:rgba(15,23,42,.35)}@media(max-width:992px){.stage-planner-item-controls,.stage-planner-category-controls{grid-template-columns:1fr}.stage-order-input{max-width:none}}

/* Stage assignment planner refinement: compact item/category running order layout. */
.cm-page--stage-assignments .stage-planner-section {
    border-radius: 1rem;
    overflow: hidden;
}

.cm-page--stage-assignments .stage-planner-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cm-page--stage-assignments .stage-planner-count {
    white-space: nowrap;
}

.cm-page--stage-assignments .stage-planner-item-card {
    overflow: hidden;
}

.cm-page--stage-assignments .stage-planner-item-header {
    display: grid;
    grid-template-columns: minmax(240px, .95fr) minmax(360px, 1.45fr);
    align-items: start;
    gap: 1rem;
}

.cm-page--stage-assignments .stage-planner-item-title-block {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
}

.cm-page--stage-assignments .stage-planner-item-order-chip {
    min-width: 2.4rem;
    height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, .48);
    background: rgba(34, 211, 238, .16);
    color: #67e8f9;
    font-weight: 900;
    flex: 0 0 auto;
}

.cm-page--stage-assignments .stage-planner-item-controls {
    display: grid;
    grid-template-columns: minmax(110px, 150px) minmax(240px, 1fr) minmax(110px, 150px);
    gap: .85rem;
    align-items: start;
}

.cm-page--stage-assignments .stage-category-section {
    padding: 1rem;
}

.cm-page--stage-assignments .stage-planner-category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: .85rem;
}

.cm-page--stage-assignments .stage-planner-category-row {
    display: block;
}

.cm-page--stage-assignments .stage-planner-category-heading {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .75rem;
}

.cm-page--stage-assignments .stage-display-order {
    display: inline-flex;
    min-width: 3rem;
    justify-content: center;
    border-radius: 999px;
    padding: .2rem .55rem;
    font-weight: 900;
    background: rgba(34, 211, 238, .16);
    color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, .45);
}

.cm-page--stage-assignments .stage-planner-category-controls {
    display: grid;
    grid-template-columns: minmax(190px, 1.3fr) minmax(95px, .65fr) minmax(95px, .65fr);
    gap: .7rem;
    align-items: start;
}

.cm-page--stage-assignments .stage-order-input {
    max-width: 100%;
}

.cm-page--stage-assignments .stage-planner-item-card--needs-setup .stage-planner-item-order-chip,
.cm-page--stage-assignments .stage-planner-item-card--needs-setup .stage-display-order {
    background: rgba(148, 163, 184, .14);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, .42);
}

@media (max-width: 1100px) {
    .cm-page--stage-assignments .stage-planner-item-header,
    .cm-page--stage-assignments .stage-planner-item-controls,
    .cm-page--stage-assignments .stage-planner-category-controls {
        grid-template-columns: 1fr;
    }
}


/* Stage assignment planner dropdown clipping fix.
   Stage selectors are intentionally kept as native selects on this page
   because the planner cards sit inside nested stage/item/category panels. */
.cm-page--stage-assignments .stage-planner-section,
.cm-page--stage-assignments .stage-planner-item-list,
.cm-page--stage-assignments .stage-planner-item-card,
.cm-page--stage-assignments .stage-assignment-card,
.cm-page--stage-assignments .stage-category-section,
.cm-page--stage-assignments .stage-planner-category-list,
.cm-page--stage-assignments .stage-category-box,
.cm-page--stage-assignments .stage-planner-category-row {
    overflow: visible !important;
}

.cm-page--stage-assignments .stage-planner-item-card,
.cm-page--stage-assignments .stage-category-box,
.cm-page--stage-assignments .stage-planner-category-row {
    position: relative;
}

.cm-page--stage-assignments .stage-planner-item-card:focus-within,
.cm-page--stage-assignments .stage-category-box:focus-within,
.cm-page--stage-assignments .stage-planner-category-row:focus-within {
    z-index: 30;
}

.cm-page--stage-assignments select[data-cm-no-tomselect].form-select {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    opacity: 1 !important;
    width: 100% !important;
    min-height: 2.5rem;
}

/* Stage assignment planner category wrapping fix.
   Keep category cards wide enough for Stage + Category order + Judges.
   When there is not enough horizontal space, categories wrap onto the next row
   instead of squeezing/overlapping the judge field. */
.cm-page--stage-assignments .stage-planner-category-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
    align-items: stretch;
}

.cm-page--stage-assignments .stage-category-box,
.cm-page--stage-assignments .stage-planner-category-row {
    min-width: 0;
}

.cm-page--stage-assignments .stage-planner-category-controls {
    grid-template-columns: minmax(210px, 1fr) minmax(95px, 120px) minmax(85px, 110px);
    gap: .75rem;
}

.cm-page--stage-assignments .stage-planner-category-controls > div {
    min-width: 0;
}

.cm-page--stage-assignments .stage-planner-category-controls .form-label {
    white-space: normal;
    line-height: 1.2;
}

@media (max-width: 620px) {
    .cm-page--stage-assignments .stage-planner-category-controls {
        grid-template-columns: 1fr;
    }
}

/* Stage assignment planner category control layout fix.
   Keep each category card readable by putting the stage selector on its own row,
   then showing Category order and Judges side-by-side underneath. */
.cm-page--stage-assignments .stage-planner-category-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.cm-page--stage-assignments .stage-planner-category-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem .8rem;
    align-items: start;
}

.cm-page--stage-assignments .stage-planner-category-controls > div:first-child {
    grid-column: 1 / -1;
}

.cm-page--stage-assignments .stage-planner-category-controls .stage-order-input {
    width: 100%;
    max-width: none;
}

.cm-page--stage-assignments .stage-planner-category-controls .form-label {
    display: block;
    margin-bottom: .35rem;
    white-space: nowrap;
    line-height: 1.15;
}

.cm-page--stage-assignments .stage-category-box {
    padding: .95rem 1rem;
}

.cm-page--stage-assignments .stage-planner-category-heading {
    min-width: 0;
}

.cm-page--stage-assignments .stage-planner-category-heading strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .cm-page--stage-assignments .stage-planner-category-controls {
        grid-template-columns: 1fr;
    }

    .cm-page--stage-assignments .stage-planner-category-controls > div:first-child {
        grid-column: auto;
    }
}

/* Stage assignment planner: collapsed category details and cleaner item header help. */
.cm-page--stage-assignments .stage-default-help {
    display: none !important;
}

.cm-page--stage-assignments .stage-category-section {
    padding: .85rem 1rem 1rem;
}

.cm-page--stage-assignments .stage-category-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--cm-ink, #111827);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .15rem 0 .55rem;
    font-weight: 900;
    text-align: left;
}

.cm-page--stage-assignments .stage-category-toggle::after {
    content: "▸";
    font-size: .9rem;
    line-height: 1;
    transition: transform .16s ease;
}

.cm-page--stage-assignments .stage-category-toggle[aria-expanded="true"]::after {
    content: "▾";
}

.cm-page--stage-assignments .stage-category-toggle-count {
    margin-left: auto;
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 999px;
    padding: .15rem .55rem;
    font-size: .75rem;
    font-weight: 800;
    color: var(--cm-muted, #64748b);
    background: rgba(255,255,255,.45);
}

.cm-page--stage-assignments .stage-planner-category-list[hidden] {
    display: none !important;
}

.cm-page--stage-assignments .stage-category-section--collapsed {
    padding-bottom: .7rem;
}

/* Stage assignment planner: collapsible stage sections.
   Stage sections are collapsed by default; Needs Setup starts expanded but can be collapsed manually. */
.cm-page--stage-assignments .stage-planner-section-header {
    padding: 0;
}

.cm-page--stage-assignments .stage-section-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
}

.cm-page--stage-assignments .stage-section-title-block {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.cm-page--stage-assignments .stage-section-title {
    font-size: 1.1rem;
    line-height: 1.15;
    font-weight: 900;
}

.cm-page--stage-assignments .stage-section-subtitle {
    color: var(--cm-muted, #64748b);
    font-size: .86rem;
    font-weight: 500;
}

.cm-page--stage-assignments .stage-section-toggle::after {
    content: "▾";
    flex: 0 0 auto;
    font-size: .95rem;
    line-height: 1;
    color: var(--cm-muted, #64748b);
    transition: transform .16s ease;
}

.cm-page--stage-assignments .stage-section-toggle[aria-expanded="false"]::after {
    content: "▸";
}

.cm-page--stage-assignments .stage-section-toggle:focus-visible {
    outline: 3px solid rgba(49, 87, 213, .25);
    outline-offset: -3px;
}

.cm-page--stage-assignments .stage-planner-item-list[hidden] {
    display: none !important;
}

.cm-page--stage-assignments .stage-planner-section--collapsed .stage-planner-section-header {
    border-bottom-color: transparent;
}

.cm-page--stage-assignments .stage-section-toggle:hover {
    background: rgba(49, 87, 213, .04);
}

.cm-page--stage-assignments .stage-section-toggle .stage-planner-count {
    margin-left: auto;
}

/* Administration dashboard grouping */
body.competition-shell .admin-dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

body.competition-shell .admin-dashboard-main .hero-panel {
    margin-bottom: .25rem !important;
}

body.competition-shell .admin-dashboard-main .admin-dashboard-section {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

body.competition-shell .admin-dashboard-main .section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

body.competition-shell .admin-dashboard-main .section-heading h5 {
    margin: 0 0 .25rem;
    font-size: 1.05rem;
    font-weight: 850;
}

body.competition-shell .admin-dashboard-main .section-heading span {
    display: inline-block;
}

body.competition-shell .admin-dashboard-main .row {
    row-gap: 1.15rem;
}

body.competition-shell .admin-dashboard-main .module-card {
    min-height: 7.4rem;
}

body.competition-shell .admin-dashboard-main .org-unit-dashboard-section {
    margin-top: .35rem;
}

body.competition-shell .admin-dashboard-main .org-unit-module-card {
    min-height: 8.2rem;
}

body.competition-shell .admin-dashboard-main .module-card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .85rem;
}

body.competition-shell .admin-dashboard-main .module-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--cm-border);
    padding: .28rem .65rem;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.competition-shell .admin-dashboard-main .module-level-badge-current {
    color: #67e8f9;
    background: rgba(6, 182, 212, .16);
    border-color: rgba(103, 232, 249, .34);
}

body.competition-shell .admin-dashboard-main .module-level-badge-child {
    color: #fde68a;
    background: rgba(245, 158, 11, .16);
    border-color: rgba(253, 230, 138, .34);
}

@media (max-width: 767.98px) {
    body.competition-shell .admin-dashboard-main {
        gap: 1.35rem;
    }

    body.competition-shell .admin-dashboard-main .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: .55rem;
        margin-bottom: .85rem;
    }

    body.competition-shell .admin-dashboard-main .module-card {
        min-height: auto;
    }
}


/* COMMON VALIDATION FEEDBACK / TOASTS
   Adds global save-failure visibility while leaving existing field validation messages in place. */
body.competition-shell .cm-toast-region {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 2140;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .75rem;
    width: min(28rem, calc(100vw - 2rem));
    pointer-events: none;
}

body.competition-shell .cm-toast {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .85rem;
    width: 100%;
    border-radius: 1rem;
    border: 1px solid var(--cm-toast-border, var(--cm-border));
    background: var(--cm-toast-bg, rgba(17,24,39,.96));
    color: var(--cm-toast-text, var(--cm-text));
    box-shadow: 0 18px 55px rgba(0,0,0,.28);
    padding: .95rem 1rem;
    pointer-events: auto;
    animation: cm-toast-enter .18s ease-out both;
    backdrop-filter: blur(16px);
}

body.competition-shell .cm-toast--leaving {
    animation: cm-toast-leave .18s ease-in both;
}

body.competition-shell .cm-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: var(--cm-toast-icon-bg, rgba(255,255,255,.08));
    color: var(--cm-toast-icon, var(--cm-gold-2));
    font-size: 1.05rem;
}

body.competition-shell .cm-toast-body {
    min-width: 0;
}

body.competition-shell .cm-toast-title {
    font-size: .96rem;
    font-weight: 850;
    line-height: 1.3;
}

body.competition-shell .cm-toast-message {
    margin-top: .22rem;
    color: var(--cm-toast-muted, var(--cm-muted));
    font-size: .9rem;
    line-height: 1.42;
}

body.competition-shell .cm-toast-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

body.competition-shell .cm-toast-action {
    border: 1px solid var(--cm-toast-action-border, rgba(255,255,255,.22));
    border-radius: 999px;
    background: var(--cm-toast-action-bg, rgba(255,255,255,.08));
    color: var(--cm-toast-action-text, var(--cm-text));
    padding: .35rem .75rem;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1;
}

body.competition-shell .cm-toast-action:hover,
body.competition-shell .cm-toast-action:focus {
    background: var(--cm-toast-action-hover-bg, rgba(255,255,255,.14));
    border-color: var(--cm-toast-action-hover-border, rgba(255,255,255,.35));
}

body.competition-shell .cm-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--cm-toast-close, var(--cm-muted));
    padding: 0;
}

body.competition-shell .cm-toast-close:hover,
body.competition-shell .cm-toast-close:focus {
    background: rgba(255,255,255,.10);
    color: var(--cm-toast-text, var(--cm-text));
}

body.competition-shell .cm-toast--success {
    --cm-toast-bg: var(--cm-alert-success-bg, rgba(6,78,59,.92));
    --cm-toast-border: var(--cm-alert-success-border, rgba(52,211,153,.45));
    --cm-toast-text: var(--cm-alert-success-text, #bbf7d0);
    --cm-toast-muted: var(--cm-alert-success-text, #bbf7d0);
    --cm-toast-icon: var(--cm-green, #34d399);
    --cm-toast-icon-bg: rgba(52,211,153,.16);
}

body.competition-shell .cm-toast--error {
    --cm-toast-bg: var(--cm-alert-danger-bg, rgba(127,29,29,.94));
    --cm-toast-border: var(--cm-alert-danger-border, rgba(248,113,113,.48));
    --cm-toast-text: var(--cm-alert-danger-text, #fecaca);
    --cm-toast-muted: var(--cm-alert-danger-text, #fecaca);
    --cm-toast-icon: var(--cm-alert-danger-accent, #fca5a5);
    --cm-toast-icon-bg: rgba(248,113,113,.16);
    --cm-toast-action-border: var(--cm-alert-danger-chip-border, rgba(248,113,113,.35));
    --cm-toast-action-bg: var(--cm-alert-danger-chip-bg, rgba(248,113,113,.12));
    --cm-toast-action-text: var(--cm-alert-danger-chip-text, #fee2e2);
}

body.competition-shell .cm-toast--warning {
    --cm-toast-bg: rgba(120,53,15,.94);
    --cm-toast-border: rgba(251,191,36,.45);
    --cm-toast-text: #fef3c7;
    --cm-toast-muted: #fde68a;
    --cm-toast-icon: #fbbf24;
    --cm-toast-icon-bg: rgba(251,191,36,.16);
}

body.competition-shell .cm-toast--info {
    --cm-toast-bg: rgba(14,56,86,.94);
    --cm-toast-border: rgba(34,211,238,.40);
    --cm-toast-text: #cffafe;
    --cm-toast-muted: #a5f3fc;
    --cm-toast-icon: #22d3ee;
    --cm-toast-icon-bg: rgba(34,211,238,.15);
}

body.competition-shell .cm-flash-alert--leaving {
    opacity: 0;
    transform: translateY(-.25rem);
    transition: opacity .18s ease, transform .18s ease;
}

body.competition-shell .validation-summary-errors,
body.competition-shell .field-validation-error,
body.competition-shell .input-validation-error,
body.competition-shell .is-invalid,
body.competition-shell .cm-validation-summary,
body.competition-shell .app-alert-danger {
    scroll-margin-top: 6rem;
}

body.competition-shell .cm-validation-highlight {
    animation: cm-validation-attention 1.2s ease-out 0s 2;
}

@keyframes cm-validation-attention {
    0% {
        box-shadow: 0 0 0 0 rgba(248,113,113,.55);
        outline: 2px solid rgba(248,113,113,.75);
        outline-offset: 2px;
    }
    70% {
        box-shadow: 0 0 0 .55rem rgba(248,113,113,0);
        outline-color: rgba(248,113,113,.28);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(248,113,113,0);
        outline-color: transparent;
    }
}

@keyframes cm-toast-enter {
    from {
        opacity: 0;
        transform: translateY(.5rem) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cm-toast-leave {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(.4rem) scale(.98);
    }
}

@media (max-width: 767.98px) {
    body.competition-shell .cm-toast-region {
        left: .75rem;
        right: .75rem;
        bottom: .75rem;
        align-items: stretch;
        width: auto;
    }

    body.competition-shell .cm-toast {
        grid-template-columns: auto minmax(0, 1fr) auto;
        padding: .85rem .9rem;
        border-radius: .9rem;
    }
}

/* Privacy policy footer and policy page */
body.competition-shell .dashboard-shell {
    grid-template-rows: minmax(0, 1fr) auto;
}

body.competition-shell .dashboard-sidebar {
    grid-row: 1 / span 2;
}

body.competition-shell .dashboard-main {
    grid-column: 2;
    grid-row: 1;
}

body.competition-shell .cm-privacy-footer {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin: 1.5rem 1.4rem .25rem;
    padding: 1rem 0 .25rem;
    color: var(--cm-muted, #64748b);
    font-size: .875rem;
    border-top: 1px solid var(--cm-border, rgba(148, 163, 184, .25));
}

body.competition-shell:not(:has(.dashboard-sidebar)) .dashboard-shell {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    align-items: center !important;
    justify-items: center !important;
    padding: 2rem !important;
}

body.competition-shell:not(:has(.dashboard-sidebar)) .dashboard-main {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: center !important;
}

body.competition-shell:not(:has(.dashboard-sidebar)) .cm-privacy-footer {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: min(100%, 56rem);
    margin: 1.5rem auto .25rem;
}

@media (max-width: 1199.98px) {
    body.competition-shell .cm-privacy-footer {
        grid-column: 1;
        grid-row: auto;
        margin-inline: 1rem;
    }
}

body.competition-shell .cm-privacy-footer a {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

body.competition-shell .cm-privacy-footer a:hover,
body.competition-shell .cm-privacy-footer a:focus {
    color: var(--cm-primary, #2563eb);
    text-decoration: underline;
}

body.competition-shell .cm-policy-content h2 {
    margin-top: 1.65rem;
    font-size: 1.1rem;
    font-weight: 800;
}

body.competition-shell .cm-policy-content p,
body.competition-shell .cm-policy-content li {
    line-height: 1.65;
}

/* Public layout shell: public links must not inherit the authenticated sidebar layout. */
body.competition-shell.cm-public-body .cm-public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: clamp(1rem, 2vw, 2rem);
}

body.competition-shell.cm-public-body .cm-public-header,
body.competition-shell.cm-public-body .cm-public-main,
body.competition-shell.cm-public-body .cm-privacy-footer--public {
    width: min(100%, 1120px);
    margin-inline: auto;
}

body.competition-shell.cm-public-body .cm-public-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

body.competition-shell.cm-public-body .cm-public-brand {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    color: var(--cm-title);
    text-decoration: none;
}

body.competition-shell.cm-public-body .cm-public-brand:hover,
body.competition-shell.cm-public-body .cm-public-brand:focus {
    color: var(--cm-title);
    text-decoration: none;
}

body.competition-shell.cm-public-body .cm-public-brand-mark {
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
}

body.competition-shell.cm-public-body .cm-public-brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

body.competition-shell.cm-public-body .cm-public-brand-title {
    color: var(--cm-title);
    font-weight: 900;
    letter-spacing: -.03em;
}

body.competition-shell.cm-public-body .cm-public-brand-subtitle {
    color: var(--cm-muted);
    font-size: .9rem;
    font-weight: 600;
    margin-top: .15rem;
}

body.competition-shell.cm-public-body .cm-public-main {
    flex: 1 0 auto;
    display: block;
    padding: clamp(.25rem, 1.2vw, 1rem) 0 0;
}

body.competition-shell.cm-public-body .cm-public-main > .alert {
    margin-inline: auto;
    max-width: 1120px;
}

body.competition-shell.cm-public-body .cm-public-main > .registration-form-shell,
body.competition-shell.cm-public-body .cm-public-main > .cm-page {
    margin-inline: auto;
}

body.competition-shell.cm-public-body .cm-privacy-footer--public {
    flex: 0 0 auto;
    margin-top: 2rem;
    margin-bottom: 0;
    padding: 1rem 0 0;
    justify-content: center;
}

body.competition-shell.cm-public-body .registration-form-shell {
    width: 100%;
}

.cm-privacy-ack,
.cm-registration-ack {
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--cm-surface) 92%, var(--cm-primary) 8%);
    padding: 1rem;
}

.cm-privacy-ack a,
.cm-registration-ack a {
    font-weight: 700;
}

body.competition-shell.cm-public-body .registration-start-shell,
body.competition-shell.cm-public-body .public-registration-status-page {
    max-width: 1120px;
}

@media (max-width: 767.98px) {
    body.competition-shell.cm-public-body .cm-public-shell {
        padding: .85rem;
    }

    body.competition-shell.cm-public-body .cm-public-header {
        margin-bottom: .75rem;
    }

    body.competition-shell.cm-public-body .cm-public-brand-title {
        max-width: 18rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.competition-shell.cm-public-body .cm-privacy-footer--public {
        text-align: center;
    }
}

.brand-mark-logo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: inherit;
}

.orgunit-logo-upload-panel {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    background: var(--cm-surface-2);
}

.orgunit-logo-preview-wrap {
    flex: 0 0 auto;
}

.orgunit-logo-preview {
    width: 5.5rem;
    height: 5.5rem;
    display: grid;
    place-items: center;
    padding: .35rem;
    border: 1px solid var(--cm-border);
    border-radius: 1.15rem;
    background: var(--cm-surface);
}

.orgunit-logo-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    border-radius: .85rem;
}

.orgunit-logo-upload-body {
    min-width: 0;
    flex: 1 1 auto;
}

@media (max-width: 575.98px) {
    .orgunit-logo-upload-panel {
        flex-direction: column;
    }
}

/* CM LIVE FINALISATION STATUS WRAP START
   Long finalisation messages can contain several blockers. Keep the status inside
   the finalisation card instead of clipping it as a single-line pill. */
body.competition-shell .stage-action-group-final .stage-action-status-list {
    width: 100%;
    align-items: stretch;
}

body.competition-shell .stage-action-group-final .stage-action-status {
    width: 100%;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: var(--cm-radius-card-sm, .9rem) !important;
    text-align: center;
    white-space: normal;
}

body.competition-shell .stage-action-group-final .stage-action-status-label {
    flex: 1 1 100%;
    text-align: center;
}

body.competition-shell .stage-action-group-final .stage-action-status-value {
    flex: 1 1 100%;
    min-width: 0;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

body.competition-shell [data-live-timing-entry-control] {
    min-width: 0;
}

body.competition-shell [data-live-timing-entry-control] .stage-action-status-list {
    width: 100%;
    min-width: 0;
    justify-content: center;
}

body.competition-shell [data-live-timing-entry-control] .stage-action-status {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
}

body.competition-shell [data-live-timing-entry-control] .stage-action-status-label,
body.competition-shell [data-live-timing-entry-control] .stage-action-status-value {
    min-width: 0;
    text-align: center;
    white-space: normal;
}
/* CM LIVE FINALISATION STATUS WRAP END */

/* Overall Championship - professional event-day standings */
body.competition-shell .overall-championship-page {
    --oc-surface: color-mix(in srgb, var(--cm-card-bg-2) 92%, transparent);
    --oc-surface-strong: color-mix(in srgb, var(--cm-card-bg) 96%, transparent);
    --oc-soft-border: color-mix(in srgb, var(--cm-border) 72%, transparent);
    --oc-accent: var(--cm-gold);
    --oc-accent-soft: color-mix(in srgb, var(--cm-gold) 16%, transparent);
    --oc-blue-soft: color-mix(in srgb, var(--cm-cyan) 14%, transparent);
    --oc-green-soft: color-mix(in srgb, var(--cm-green) 14%, transparent);
}

body.competition-shell .overall-championship-page .oc-hero,
body.competition-shell .overall-championship-page .oc-section,
body.competition-shell .overall-championship-page .oc-stat-card,
body.competition-shell .overall-championship-page .oc-rules-card,
body.competition-shell .overall-championship-page .oc-list-card,
body.competition-shell .overall-championship-page .oc-table-card {
    border: 1px solid var(--oc-soft-border);
    background: linear-gradient(180deg, var(--oc-surface-strong), var(--oc-surface));
    border-radius: 1.35rem;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .16);
}

body.competition-shell .overall-championship-page .oc-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.35rem 1.5rem;
    position: relative;
    overflow: hidden;
}

body.competition-shell .overall-championship-page .oc-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--cm-gold) 16%, transparent), transparent 24rem), radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--cm-cyan) 12%, transparent), transparent 22rem);
}

body.competition-shell .overall-championship-page .oc-hero__content,
body.competition-shell .overall-championship-page .oc-hero__status {
    position: relative;
    z-index: 1;
}

body.competition-shell .overall-championship-page .oc-hero h1 {
    margin: .1rem 0 .35rem;
    color: var(--cm-title);
    font-weight: 850;
    letter-spacing: -.035em;
}

body.competition-shell .overall-championship-page .oc-hero__status {
    min-width: 12rem;
    padding: .9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--cm-gold) 36%, var(--cm-border));
    border-radius: 1rem;
    background: color-mix(in srgb, var(--cm-gold) 10%, transparent);
    text-align: right;
}

body.competition-shell .overall-championship-page .oc-hero__status-value {
    display: block;
    color: var(--cm-title);
    font-size: 2.25rem;
    font-weight: 850;
    line-height: 1;
}

body.competition-shell .overall-championship-page .oc-hero__status-label {
    color: var(--cm-muted);
    font-size: .82rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .055em;
}

body.competition-shell .overall-championship-page .oc-section,
body.competition-shell .overall-championship-page .oc-rules-card,
body.competition-shell .overall-championship-page .oc-list-card,
body.competition-shell .overall-championship-page .oc-table-card {
    padding: 1.15rem;
}

body.competition-shell .overall-championship-page .oc-section-header,
body.competition-shell .overall-championship-page .oc-table-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

body.competition-shell .overall-championship-page .oc-section-kicker {
    color: var(--cm-muted-2);
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .075em;
}

body.competition-shell .overall-championship-page .oc-live-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .7rem;
    border: 1px solid color-mix(in srgb, var(--cm-green) 34%, var(--cm-border));
    border-radius: 999px;
    color: var(--cm-green);
    background: var(--oc-green-soft);
    font-size: .84rem;
    font-weight: 800;
    white-space: nowrap;
}

body.competition-shell .overall-championship-page .oc-podium-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

body.competition-shell .overall-championship-page .oc-podium-card {
    position: relative;
    min-height: 13.5rem;
    padding: 1.15rem;
    overflow: hidden;
    border: 1px solid var(--oc-soft-border);
    border-radius: 1.2rem;
    background: color-mix(in srgb, var(--cm-card-bg-2) 82%, transparent);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.competition-shell .overall-championship-page .oc-podium-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--cm-gold) 42%, var(--cm-border));
    box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

body.competition-shell .overall-championship-page .oc-podium-card--winner {
    background: linear-gradient(145deg, color-mix(in srgb, var(--cm-gold) 18%, var(--cm-card-bg-2)), var(--cm-card-bg-2));
}

body.competition-shell .overall-championship-page .oc-podium-card--empty {
    display: grid;
    place-items: center;
    color: var(--cm-muted);
    border-style: dashed;
}

body.competition-shell .overall-championship-page .oc-rank-medal {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-grid;
    place-items: center;
    margin-bottom: .9rem;
    border-radius: 999px;
    color: #111827;
    background: var(--cm-gold-2);
    font-weight: 900;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--cm-gold) 28%, transparent);
}

body.competition-shell .overall-championship-page .oc-rank-medal--2 {
    color: #0f172a;
    background: #cbd5e1;
    box-shadow: 0 10px 24px rgba(148, 163, 184, .22);
}

body.competition-shell .overall-championship-page .oc-rank-medal--3 {
    color: #111827;
    background: #fb923c;
    box-shadow: 0 10px 24px rgba(251, 146, 60, .22);
}

body.competition-shell .overall-championship-page .oc-podium-card h3 {
    margin: 0;
    color: var(--cm-title);
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    font-weight: 850;
    line-height: 1.12;
}

body.competition-shell .overall-championship-page .oc-podium-card__label,
body.competition-shell .overall-championship-page .oc-muted-line {
    color: var(--cm-muted-2);
    font-size: .85rem;
    font-weight: 700;
}

body.competition-shell .overall-championship-page .oc-score-line {
    margin-top: 1rem;
    color: var(--cm-title);
    font-size: 1.2rem;
    font-weight: 850;
}

body.competition-shell .overall-championship-page .oc-medal-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .8rem;
    margin-top: .65rem;
    color: var(--cm-muted);
    font-size: .9rem;
    font-weight: 700;
}

body.competition-shell .overall-championship-page .oc-stat-grid,
body.competition-shell .overall-championship-page .oc-split-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

body.competition-shell .overall-championship-page .oc-split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.competition-shell .overall-championship-page .oc-stat-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem;
}

body.competition-shell .overall-championship-page .oc-stat-card__icon,
body.competition-shell .overall-championship-page .oc-list-card__icon {
    width: 2.65rem;
    height: 2.65rem;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: .85rem;
    color: var(--cm-gold-2);
    background: var(--oc-accent-soft);
}

body.competition-shell .overall-championship-page .oc-stat-card__label {
    color: var(--cm-muted);
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .045em;
}

body.competition-shell .overall-championship-page .oc-stat-card__value {
    color: var(--cm-title);
    font-size: 2rem;
    font-weight: 850;
    line-height: 1;
}

body.competition-shell .overall-championship-page .oc-rules-card {
    overflow: hidden;
}

body.competition-shell .overall-championship-page .oc-rules-card > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    color: var(--cm-title);
    font-weight: 850;
    list-style: none;
}

body.competition-shell .overall-championship-page .oc-rules-card > summary::-webkit-details-marker {
    display: none;
}

body.competition-shell .overall-championship-page .oc-rules-card > summary span:first-child {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

body.competition-shell .overall-championship-page .oc-rules-card__hint {
    color: var(--cm-muted);
    font-size: .85rem;
    font-weight: 700;
}

body.competition-shell .overall-championship-page .oc-rules-card__body {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--oc-soft-border);
}

body.competition-shell .overall-championship-page .oc-rules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

body.competition-shell .overall-championship-page .oc-rule-title {
    margin-bottom: .5rem;
    color: var(--cm-muted-2);
    font-size: .82rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .06em;
}

body.competition-shell .overall-championship-page .oc-rule-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

body.competition-shell .overall-championship-page .oc-rule-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem .6rem;
    border: 1px solid var(--oc-soft-border);
    border-radius: 999px;
    color: var(--cm-text);
    background: color-mix(in srgb, var(--cm-card-bg-2) 74%, transparent);
    font-size: .85rem;
    font-weight: 750;
}

body.competition-shell .overall-championship-page .oc-list-card__header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

body.competition-shell .overall-championship-page .oc-empty-text {
    color: var(--cm-muted);
}

body.competition-shell .overall-championship-page .oc-mini-standings {
    display: grid;
    gap: .65rem;
}

body.competition-shell .overall-championship-page .oc-mini-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    padding: .7rem .75rem;
    border: 1px solid var(--oc-soft-border);
    border-radius: .9rem;
    background: color-mix(in srgb, var(--cm-card-bg-2) 76%, transparent);
}

body.competition-shell .overall-championship-page .oc-mini-rank,
body.competition-shell .overall-championship-page .oc-table-rank {
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .45rem;
    border-radius: 999px;
    color: var(--cm-title);
    background: color-mix(in srgb, var(--cm-muted-2) 18%, transparent);
    font-weight: 850;
}

body.competition-shell .overall-championship-page .oc-mini-name {
    min-width: 0;
    color: var(--cm-title);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.competition-shell .overall-championship-page .oc-mini-points {
    color: var(--cm-text);
    font-weight: 850;
}

body.competition-shell .overall-championship-page .oc-table-card {
    overflow: hidden;
}

body.competition-shell .overall-championship-page .oc-table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .8rem;
    flex-wrap: wrap;
}

body.competition-shell .overall-championship-page .oc-search-field {
    position: relative;
    min-width: min(22rem, 100%);
    margin: 0;
}

body.competition-shell .overall-championship-page .oc-search-field i {
    position: absolute;
    left: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cm-muted-2);
    pointer-events: none;
}

body.competition-shell .overall-championship-page .oc-search-field .form-control {
    padding-left: 2.35rem;
    min-height: 2.55rem;
    border-radius: .85rem;
}

body.competition-shell .overall-championship-page .oc-zero-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .5rem .7rem;
    border: 1px solid var(--oc-soft-border);
    border-radius: .85rem;
    background: color-mix(in srgb, var(--cm-card-bg-2) 70%, transparent);
    white-space: nowrap;
}

body.competition-shell .overall-championship-page .oc-standings-table {
    border-collapse: separate;
    border-spacing: 0;
}

body.competition-shell .overall-championship-page .oc-standings-table thead th {
    color: var(--cm-title) !important;
    background: color-mix(in srgb, var(--cm-surface-2) 86%, transparent) !important;
    border-bottom: 1px solid var(--oc-soft-border) !important;
    font-size: .84rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .04em;
}

body.competition-shell .overall-championship-page .oc-standings-table tbody td {
    color: var(--cm-text) !important;
    padding-top: .95rem;
    padding-bottom: .95rem;
    vertical-align: middle;
}

body.competition-shell .overall-championship-page .oc-standings-table tbody tr {
    transition: background .16s ease, transform .16s ease;
}

body.competition-shell .overall-championship-page .oc-standings-table tbody tr:hover > * {
    background: var(--cm-hover-bg) !important;
}

body.competition-shell .overall-championship-page .oc-row-highlight > * {
    background: color-mix(in srgb, var(--cm-gold) 8%, transparent) !important;
}

body.competition-shell .overall-championship-page .oc-table-rank--top {
    color: #111827;
    background: linear-gradient(135deg, var(--cm-gold), var(--cm-gold-2));
}

body.competition-shell .overall-championship-page .oc-org-cell {
    display: grid;
    gap: .55rem;
    min-width: 14rem;
}

body.competition-shell .overall-championship-page .oc-progress {
    width: 100%;
    height: .42rem;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cm-muted-2) 18%, transparent);
}

body.competition-shell .overall-championship-page .oc-progress > span {
    display: block;
    width: var(--oc-progress, 0%);
    height: 100%;
    min-width: .3rem;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--cm-gold), var(--cm-cyan));
}

body.competition-shell .overall-championship-page .oc-points-value {
    color: var(--cm-title);
    font-size: 1.15rem;
    font-weight: 900;
}

body.competition-shell .overall-championship-page .oc-placement-text {
    display: inline-block;
    min-width: max-content;
    color: var(--cm-muted);
    font-size: .9rem;
    font-weight: 700;
}

body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-hero,
body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-section,
body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-stat-card,
body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-rules-card,
body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-list-card,
body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-table-card {
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-podium-card,
body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-mini-row,
body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-rule-chip,
body.competition-shell[data-cm-theme="light"] .overall-championship-page .oc-zero-toggle {
    background: #ffffff;
}

@media (max-width: 1199.98px) {
    body.competition-shell .overall-championship-page .oc-podium-grid,
    body.competition-shell .overall-championship-page .oc-stat-grid,
    body.competition-shell .overall-championship-page .oc-split-grid {
        grid-template-columns: 1fr;
    }

    body.competition-shell .overall-championship-page .oc-hero,
    body.competition-shell .overall-championship-page .oc-section-header,
    body.competition-shell .overall-championship-page .oc-table-card__header {
        align-items: stretch;
        flex-direction: column;
    }

    body.competition-shell .overall-championship-page .oc-hero__status {
        text-align: left;
    }

    body.competition-shell .overall-championship-page .oc-table-actions {
        justify-content: flex-start;
    }

    body.competition-shell .overall-championship-page .oc-search-field {
        width: 100%;
    }

    body.competition-shell .overall-championship-page .oc-rules-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    body.competition-shell .overall-championship-page .oc-hero,
    body.competition-shell .overall-championship-page .oc-section,
    body.competition-shell .overall-championship-page .oc-rules-card,
    body.competition-shell .overall-championship-page .oc-list-card,
    body.competition-shell .overall-championship-page .oc-table-card {
        padding: .95rem;
        border-radius: 1rem;
    }

    body.competition-shell .overall-championship-page .oc-table-actions {
        display: grid;
        width: 100%;
    }
}

/* Planning Reports - item/category judge comment pills */
body.competition-shell .planning-judge-report-list {
    display: grid;
    gap: 1rem;
}

body.competition-shell .planning-judge-card {
    border: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .28));
    border-radius: var(--cm-radius-card-sm, .9rem);
    background: var(--cm-card-bg, var(--cm-surface, #ffffff));
    padding: 1rem;
    box-shadow: 0 .65rem 1.4rem rgba(15, 23, 42, .08);
}

body.competition-shell .planning-judge-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: .85rem;
}

body.competition-shell .planning-judge-summary-pills,
body.competition-shell .planning-comment-pill-row,
body.competition-shell .planning-category-pill-title,
body.competition-shell .planning-category-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
}

body.competition-shell .planning-judge-card--review {
    border-color: rgba(245, 158, 11, .58);
    background: linear-gradient(135deg, rgba(245, 158, 11, .13), var(--cm-card-bg, var(--cm-surface, #ffffff)) 46%);
}

body.competition-shell .planning-review-note {
    border: 1px solid rgba(245, 158, 11, .42);
    border-radius: .85rem;
    background: rgba(245, 158, 11, .12);
    color: var(--cm-heading-text, #0f172a);
    padding: .65rem .75rem;
    margin-bottom: .9rem;
    font-weight: 700;
    font-size: .88rem;
}

body.competition-shell .planning-category-pill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: .75rem;
}

body.competition-shell .planning-category-pill {
    border: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .34));
    border-radius: 1rem;
    background: var(--cm-surface, #ffffff);
    padding: .8rem;
    min-height: 7.25rem;
}

body.competition-shell .planning-category-pill--criteria {
    border-color: rgba(59, 130, 246, .30);
}

body.competition-shell .planning-category-pill--missing {
    border-color: rgba(239, 68, 68, .42);
    background: linear-gradient(135deg, rgba(239, 68, 68, .07), transparent 72%);
}

body.competition-shell .planning-category-meta {
    min-height: 1.25rem;
    margin: .5rem 0;
    font-size: .76rem;
    color: var(--cm-muted-text, #64748b);
}

body.competition-shell .planning-category-meta span {
    border-radius: 999px;
    border: 1px solid var(--cm-surface-border, rgba(148, 163, 184, .28));
    padding: .12rem .45rem;
    background: var(--cm-control-bg, rgba(148, 163, 184, .08));
}

body.competition-shell .planning-comment-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, .30);
    background: rgba(59, 130, 246, .10);
    color: var(--cm-heading-text, #0f172a);
    padding: .28rem .58rem;
    font-size: .78rem;
    line-height: 1.25;
}

body.competition-shell .planning-comment-empty {
    display: inline-flex;
    border-radius: 999px;
    border: 1px solid rgba(239, 68, 68, .30);
    background: rgba(239, 68, 68, .08);
    color: var(--cm-muted-text, #64748b);
    padding: .28rem .58rem;
    font-size: .78rem;
}

body.competition-shell[data-cm-theme="dark"] .planning-judge-card,
body.competition-shell[data-cm-theme="dark"] .planning-category-pill {
    background: rgba(15, 23, 42, .78);
    box-shadow: 0 .8rem 1.7rem rgba(0, 0, 0, .22);
}

body.competition-shell[data-cm-theme="dark"] .planning-judge-card--review {
    background: linear-gradient(135deg, rgba(245, 158, 11, .20), rgba(15, 23, 42, .78) 48%);
}

body.competition-shell[data-cm-theme="dark"] .planning-review-note {
    color: #fef3c7;
}

body.competition-shell[data-cm-theme="dark"] .planning-comment-pill,
body.competition-shell[data-cm-theme="dark"] .planning-comment-empty {
    color: #e5e7eb;
}


/* ==========================================================
   LIGHT THEME RESPONSIVE DATA CARDS
   The common responsive-data-view script converts tables to
   collapsible cards on tablet/mobile. Keep those cards in the
   active light theme instead of falling back to the dark default.
   ========================================================== */
body.competition-shell[data-cm-theme="light"] .cm-data-empty,
body.competition-shell[data-cm-theme="light"] .cm-data-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%) !important;
    color: #0f172a !important;
    border-color: #d7e1ee !important;
    box-shadow: 0 12px 28px rgba(15,23,42,.10) !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__header {
    color: #0f172a !important;
    background: transparent !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__title {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__indicator {
    color: #d97706 !important;
    background: #fff7ed !important;
    border-color: #fed7aa !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card.is-expanded .cm-data-card__indicator {
    background: #ffedd5 !important;
    border-color: #fdba74 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__details {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__item {
    border-bottom-color: #e2e8f0 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__label {
    color: #475569 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__value {
    color: #0f172a !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__actions {
    border-top-color: #e2e8f0 !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__actions .btn-outline-primary,
body.competition-shell[data-cm-theme="light"] .cm-data-card__actions a.btn-outline-primary {
    color: #1d4ed8 !important;
    border-color: #93c5fd !important;
    background: #eff6ff !important;
}

body.competition-shell[data-cm-theme="light"] .cm-data-card__actions .btn-outline-primary:hover,
body.competition-shell[data-cm-theme="light"] .cm-data-card__actions a.btn-outline-primary:hover {
    color: #ffffff !important;
    border-color: #2563eb !important;
    background: #2563eb !important;
}

/* COMMON UPLOAD / SCAN PAGES */
body.competition-shell .cm-upload-page {
    color: var(--cm-text);
}

body.competition-shell .cm-upload-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

body.competition-shell .cm-upload-help {
    color: var(--cm-muted);
}

body.competition-shell .cm-upload-card {
    border-color: var(--cm-border);
    background: var(--cm-surface);
    color: var(--cm-text);
}

body.competition-shell .cm-upload-card-title,
body.competition-shell .cm-upload-status-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

body.competition-shell .cm-upload-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: .85rem;
    border: 1px solid var(--cm-border);
    background: var(--cm-surface-muted, rgba(148,163,184,.10));
    color: var(--cm-accent, currentColor);
    font-size: 1.15rem;
    flex: 0 0 auto;
}

body.competition-shell .cm-upload-file-list .input-group-text,
body.competition-shell .cm-upload-file-row .input-group-text {
    min-width: 6rem;
    justify-content: center;
}

body.competition-shell .cm-upload-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: .85rem;
}

body.competition-shell .cm-upload-stat {
    min-height: 5rem;
    border: 1px solid var(--cm-border);
    border-radius: .95rem;
    padding: .9rem 1rem;
    background: var(--cm-surface-muted, rgba(148,163,184,.08));
}

body.competition-shell .cm-upload-stat-label {
    color: var(--cm-muted);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .025em;
    text-transform: uppercase;
    margin-bottom: .25rem;
}

body.competition-shell .cm-upload-stat-value {
    color: var(--cm-text);
    font-size: 1rem;
    font-weight: 800;
    overflow-wrap: anywhere;
}

body.competition-shell .cm-upload-note {
    border: 1px solid var(--cm-border);
    border-radius: .9rem;
    padding: .75rem .9rem;
    background: var(--cm-surface-muted, rgba(148,163,184,.08));
    color: var(--cm-muted);
    font-size: .92rem;
}

body.competition-shell .cm-upload-issues {
    border-top: 1px solid var(--cm-border);
    padding-top: .9rem;
}

body.competition-shell .cm-upload-section-title {
    color: var(--cm-text);
    font-weight: 800;
    margin-bottom: .45rem;
}

body.competition-shell .cm-upload-issue-list {
    padding-left: 1.25rem;
}

body.competition-shell .cm-upload-issue-list li {
    padding: .2rem 0;
}

@media (max-width: 767.98px) {
    body.competition-shell .cm-upload-summary-grid {
        grid-template-columns: 1fr;
    }

    body.competition-shell .cm-upload-card-title {
        align-items: flex-start;
    }
}

/* MARK SHEET SCANNING DETAILS - MOBILE FIRST REDESIGN */
body.competition-shell .mark-sheet-scan-page .cm-mscan-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-back-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.85rem;
    padding: .6rem 1rem;
    border-radius: .95rem;
    font-weight: 700;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-scroll-top {
    position: fixed;
    top: 5.75rem;
    right: 1rem;
    z-index: 1040;
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--cm-border);
    background: var(--cm-surface);
    color: var(--cm-text);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-alert {
    border-radius: 1rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 1.9rem;
    padding: .15rem .65rem;
    border-radius: .7rem;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.1;
    border: 1px solid transparent;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-chip-success {
    background: rgba(34, 197, 94, .14);
    color: #15803d;
    border-color: rgba(34, 197, 94, .22);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-chip-warning {
    background: rgba(245, 158, 11, .16);
    color: #b45309;
    border-color: rgba(245, 158, 11, .26);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-chip-danger-soft,
body.competition-shell .mark-sheet-scan-page .cm-mscan-chip-danger {
    background: rgba(239, 68, 68, .10);
    color: #dc2626;
    border-color: rgba(239, 68, 68, .20);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-chip-info {
    background: rgba(37, 99, 235, .10);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, .18);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-card {
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    background: var(--cm-surface);
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-label {
    color: var(--cm-muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin-bottom: .45rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-value {
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.1;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-sub {
    margin-top: .45rem;
    color: var(--cm-muted);
    font-size: .9rem;
    font-weight: 600;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-progress {
    height: .4rem;
    margin-top: .8rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, .24);
    overflow: hidden;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-action-card {
    border-radius: 1.1rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-action-card-danger {
    border-color: rgba(239, 68, 68, .28);
    background: rgba(254, 242, 242, .7);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-action-card-success {
    border-color: rgba(34, 197, 94, .26);
    background: rgba(240, 253, 244, .7);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-action-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-action-title {
    font-size: 1.25rem;
    font-weight: 900;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-action-content {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-action-copy {
    flex: 1 1 18rem;
    max-width: 44rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-action-form {
    flex: 1 1 20rem;
    max-width: 28rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-form-stack {
    display: flex;
    align-items: center;
    gap: .75rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-create-btn {
    min-width: 12rem;
    min-height: 3rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border-radius: .9rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-accordion .accordion-item {
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-accordion .accordion-button {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 800;
    color: var(--cm-text);
    background: var(--cm-surface);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-accordion .accordion-button:not(.collapsed) {
    color: var(--cm-text);
    background: var(--cm-surface);
    box-shadow: none;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-accordion .accordion-button:focus {
    box-shadow: none;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-accordion-title {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

/* Keep scan status badges at the far right, immediately before the accordion chevron. */
body.competition-shell .mark-sheet-scan-page .cm-mscan-accordion .accordion-button.cm-mscan-status-button > .cm-mscan-accordion-status {
    margin-left: auto;
    margin-right: 0;
    flex: 0 0 auto;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-accordion .accordion-button.cm-mscan-status-button::after {
    margin-left: .75rem;
    flex: 0 0 auto;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 .45rem;
    border-radius: .55rem;
    background: rgba(37, 99, 235, .1);
    color: #1d4ed8;
    font-size: .8rem;
    font-weight: 800;
    margin-left: .5rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-stack {
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-card {
    display: flex;
    gap: .85rem;
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    padding: .95rem 1rem;
    background: var(--cm-surface);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-card-danger {
    border-color: rgba(239, 68, 68, .22);
    background: rgba(254, 242, 242, .55);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-card-warning {
    border-color: rgba(245, 158, 11, .22);
    background: rgba(255, 251, 235, .62);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, .08);
    color: #1d4ed8;
    flex: 0 0 auto;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-card-danger .cm-mscan-issue-icon {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-card-warning .cm-mscan-issue-icon {
    background: rgba(245, 158, 11, .14);
    color: #d97706;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-title {
    font-weight: 800;
    margin-bottom: .2rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-meta {
    color: var(--cm-muted);
    font-size: .92rem;
    margin-bottom: .2rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-text {
    color: var(--cm-text);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-issue-foot {
    margin-top: .3rem;
    font-size: .92rem;
    font-weight: 700;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-rows-table th,
body.competition-shell .mark-sheet-scan-page .cm-mscan-rows-table td {
    vertical-align: top;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-cell-danger {
    background: rgba(254, 242, 242, .6);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-cell-warning {
    background: rgba(255, 251, 235, .7);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-rows {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-row-card {
    border: 1px solid var(--cm-border);
    border-radius: 1rem;
    padding: .95rem;
    background: var(--cm-surface);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-row-card.has-error {
    border-color: rgba(239, 68, 68, .22);
    background: rgba(254, 242, 242, .62);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-row-card.has-warning {
    border-color: rgba(245, 158, 11, .22);
    background: rgba(255, 251, 235, .66);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-row-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .95rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-row-index {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, .12);
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex: 0 0 auto;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-row-title {
    font-weight: 800;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-item,
body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-total-item {
    border: 1px solid var(--cm-border);
    border-radius: .9rem;
    padding: .65rem;
    background: rgba(148, 163, 184, .06);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-item.danger {
    border-color: rgba(239, 68, 68, .26);
    background: rgba(254, 242, 242, .8);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-item.warning {
    border-color: rgba(245, 158, 11, .26);
    background: rgba(255, 251, 235, .85);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-label {
    color: var(--cm-muted);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    margin-bottom: .3rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-value {
    font-size: 1.2rem;
    font-weight: 900;
    line-height: 1.15;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-meta {
    margin-top: .25rem;
    font-size: .82rem;
    color: var(--cm-muted);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-inline-error {
    margin-top: .9rem;
    border: 1px solid rgba(239, 68, 68, .22);
    background: rgba(254, 242, 242, .9);
    color: #dc2626;
    border-radius: .9rem;
    padding: .65rem .8rem;
    font-size: .92rem;
    font-weight: 700;
}

@media (max-width: 1199.98px) {
    body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    body.competition-shell .mark-sheet-scan-page .cm-mscan-topbar {
        align-items: flex-start;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-back-btn {
        padding: .55rem .8rem;
        min-height: 2.6rem;
        font-size: .95rem;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-back-btn span {
        display: none;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-scroll-top {
        top: 5.25rem;
        right: .85rem;
        width: 2.75rem;
        height: 2.75rem;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .85rem;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-card {
        padding: .85rem;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-summary-value {
        font-size: 1.35rem;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-action-head,
    body.competition-shell .mark-sheet-scan-page .cm-mscan-action-content,
    body.competition-shell .mark-sheet-scan-page .cm-mscan-form-stack {
        flex-direction: column;
        align-items: stretch;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-action-form {
        max-width: none;
        width: 100%;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-create-btn {
        width: 100%;
        min-width: 0;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-create-btn:disabled,
body.competition-shell .mark-sheet-scan-page .cm-mscan-create-btn.disabled {
    border-color: #cbd5e1 !important;
    background: #e5e7eb !important;
    color: #64748b !important;
    opacity: 1;
}

@media (max-width: 767.98px) {
    body.competition-shell .mark-sheet-scan-page .cm-mscan-action-copy,
    body.competition-shell .mark-sheet-scan-page .cm-mscan-action-form {
        flex: 0 1 auto;
        max-width: none;
        width: 100%;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-action-copy {
        margin-bottom: .25rem;
    }
}

/* Do not let the common responsive table script create duplicate row accordions above
   the purpose-built mark-scan mobile row cards. */
body.competition-shell .mark-sheet-scan-page .cm-mscan-rows-table-wrap + .cm-data-cards {
    display: none !important;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-label,
body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-value,
body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-meta {
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 767.98px) {
    body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-item,
    body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-total-item {
        min-width: 0;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-label {
        font-size: .72rem;
        line-height: 1.15;
    }
}

/* iPad/tablet fix: the shared responsive-table script hides normal tables below
   1200px, so mark-scan rows must use our purpose-built cards up to xl. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-criteria-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-mobile-row-card {
        padding: 1rem;
    }
}

/* Mark Sheet Scanning index: compact upload page */
body.competition-shell .mark-sheet-scan-page .cm-mscan-chip-secondary {
    background: rgba(100, 116, 139, .12);
    color: #475569;
    border-color: rgba(100, 116, 139, .22);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-index-hero {
    align-items: center;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-status {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-status-text {
    color: var(--cm-muted);
    font-size: .9rem;
    font-weight: 600;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-tips {
    border: 1px solid var(--cm-border);
    border-radius: .85rem;
    padding: .65rem .8rem;
    background: var(--cm-surface-muted, rgba(148, 163, 184, .08));
    color: var(--cm-muted);
    font-size: .92rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-tips > summary {
    cursor: pointer;
    color: var(--cm-text);
    font-weight: 800;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-tips > div {
    margin-top: .45rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-btn {
    min-height: 2.65rem;
    border-radius: .8rem;
    font-weight: 800;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-picker {
    border: 1px dashed var(--cm-border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--cm-surface-muted, rgba(148, 163, 184, .06));
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-picker-actions,
body.competition-shell .mark-sheet-scan-page .cm-mscan-add-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-source-btn {
    min-height: 2.75rem;
    min-width: 9.5rem;
    border-radius: .8rem;
    font-weight: 800;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-preview-list {
    display: grid;
    gap: .55rem;
    margin-bottom: .8rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-preview-item {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    padding: .55rem;
    border: 1px solid var(--cm-border);
    border-radius: .8rem;
    background: var(--cm-surface, #fff);
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-preview-media {
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: .65rem;
    background: rgba(148, 163, 184, .14);
    font-size: 1.65rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-preview-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-preview-info {
    min-width: 0;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-preview-name {
    overflow: hidden;
    color: var(--cm-text);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-preview-meta {
    color: var(--cm-muted);
    font-size: .82rem;
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-preview-remove {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border-radius: .65rem;
}

@media (max-width: 767.98px) {
    body.competition-shell .mark-sheet-scan-page .cm-mscan-index-hero {
        gap: .75rem;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-status {
        gap: .45rem;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-status-text {
        font-size: .84rem;
        line-height: 1.25;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-btn {
        width: 100%;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-picker {
        padding: .8rem;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-picker-actions,
    body.competition-shell .mark-sheet-scan-page .cm-mscan-add-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-source-btn,
    body.competition-shell .mark-sheet-scan-page .cm-mscan-add-actions .btn {
        width: 100%;
        min-height: 3rem;
        font-weight: 800;
    }

    body.competition-shell .mark-sheet-scan-page .cm-mscan-picker-actions [data-cm-open-camera],
    body.competition-shell .mark-sheet-scan-page .cm-mscan-add-actions [data-cm-open-camera] {
        min-height: 3.35rem;
        font-size: 1rem;
    }
}

body.competition-shell .mark-sheet-scan-page .cm-mscan-upload-status:has(.cm-mscan-upload-status-text):not(:has(.cm-mscan-chip)) {
    border: 1px solid var(--cm-border);
    border-radius: .85rem;
    padding: .65rem .8rem;
    background: var(--cm-surface-muted, rgba(148, 163, 184, .08));
}

/* Generic table filters: use the full available filter-card width. */
body.competition-shell .cm-data-tools,
body.competition-shell .cm-data-tools.cm-data-tools--server {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    width: 100% !important;
}

body.competition-shell .cm-data-tools__fields {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)) !important;
    gap: .65rem !important;
    align-items: end !important;
    justify-content: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 !important;
    grid-row: auto !important;
}

body.competition-shell .cm-data-filter-field,
body.competition-shell .cm-data-filter-actions,
body.competition-shell .cm-data-tools__summary,
body.competition-shell .cm-data-clear,
body.competition-shell .cm-data-apply-filter {
    grid-column: auto !important;
    grid-row: auto !important;
    justify-self: stretch !important;
    align-self: end !important;
    min-width: 0 !important;
}

body.competition-shell .cm-data-tools__summary {
    width: 100% !important;
    min-height: calc(1.5em + .5rem + 2px) !important;
}

body.competition-shell .cm-data-clear,
body.competition-shell .cm-data-apply-filter,
body.competition-shell .cm-data-filter-actions .btn,
body.competition-shell .cm-data-filter-actions button,
body.competition-shell .cm-data-filter-actions a {
    width: 100% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.competition-shell .cm-data-filter-actions {
    display: flex !important;
    gap: .5rem !important;
    flex-wrap: wrap !important;
    margin-left: 0 !important;
}

@media (max-width: 575.98px) {
    body.competition-shell .cm-data-tools__fields {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 1199.98px) {
    body.competition-shell .cm-data-tools.cm-filters-collapsed .cm-data-tools__fields {
        display: grid !important;
    }

    body.competition-shell .cm-data-tools.cm-filters-collapsed .cm-data-tools__fields > :not(.cm-data-tools__summary) {
        display: none !important;
    }
}
