/*
  Brasov Marathon inspired theme
  Replace: public/assets/app.css
*/

:root {
    /* Palette sampled/inspired from the supplied Brasov Marathon artwork */
    --burgundy: #641c28;
    --burgundy-dark: #46101a;
    --race-red: #8b080b;
    --mountain-blue: #3295af;
    --sky-blue: #5298ab;
    --forest: #145827;
    --forest-dark: #142725;
    --ochre: #bc6914;
    --gold: #c19f1c;
    --cream: #f6f4f4;
    --stone: #969ca2;

    --bg: #f6f1ea;
    --card: rgba(255, 255, 255, 0.94);
    --card-solid: #ffffff;
    --text: #142725;
    --muted: #5f6c70;
    --border: rgba(100, 28, 40, 0.16);
    --primary: #8b080b;
    --primary-dark: #641c28;
    --primary-soft: #f8e9e4;
    --danger: #8b080b;
    --success: #145827;
    --warning: #bc6914;
    --focus: rgba(50, 149, 175, 0.35);
    --shadow: 0 18px 45px rgba(20, 39, 37, 0.12);
    --shadow-soft: 0 10px 24px rgba(20, 39, 37, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    line-height: 1.5;
    background:
        radial-gradient(circle at 14% 8%, rgba(82, 152, 171, 0.32), transparent 30%),
        radial-gradient(circle at 86% 18%, rgba(188, 105, 20, 0.20), transparent 28%),
        linear-gradient(180deg, #f8f4ef 0%, #efe6dc 52%, #e7d9cc 100%);
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(145deg, rgba(50, 149, 175, 0.14) 0 22%, transparent 22% 100%),
        linear-gradient(22deg, transparent 0 61%, rgba(139, 8, 11, 0.12) 61% 78%, transparent 78%),
        linear-gradient(166deg, transparent 0 70%, rgba(20, 88, 39, 0.10) 70% 100%);
    z-index: -1;
}

.page { min-height: 100vh; }

a {
    color: var(--race-red);
    text-decoration: none;
    font-weight: 700;
}

a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 28px;
    background: linear-gradient(90deg, var(--burgundy-dark), var(--burgundy) 52%, var(--race-red));
    color: var(--cream);
    border-bottom: 4px solid var(--ochre);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(20, 39, 37, 0.22);
}

.brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--cream);
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 15px;
}


.topbar nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.topbar nav a {
    color: rgba(246, 244, 244, 0.88);
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 7px 10px;
    border-radius: 999px;
}

.topbar nav a:hover {
    color: var(--cream);
    background: rgba(255,255,255,.12);
    text-decoration: none;
}

.content {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto 64px;
}

.hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(20, 39, 37, .82), rgba(100, 28, 40, .78)),
        linear-gradient(16deg, rgba(20, 88, 39, .38) 0 26%, transparent 26% 100%),
        linear-gradient(155deg, transparent 0 64%, rgba(188, 105, 20, .42) 64% 100%);
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 28px;
    padding: clamp(28px, 6vw, 58px);
    box-shadow: var(--shadow);
    color: var(--cream);
}

.hero::after {
    content: "";
    position: absolute;
    right: -10%;
    bottom: -34%;
    width: 58%;
    height: 72%;
    background:
        linear-gradient(145deg, transparent 0 39%, rgba(193, 159, 28, .84) 40% 54%, transparent 55%),
        linear-gradient(32deg, transparent 0 45%, rgba(20, 88, 39, .62) 46% 62%, transparent 63%);
    opacity: .42;
    transform: rotate(-2deg);
}

.hero h1 {
    position: relative;
    z-index: 1;
    font-size: clamp(34px, 5.6vw, 64px);
    margin: 0 0 12px;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.hero p {
    position: relative;
    z-index: 1;
    font-size: 18px;
    color: rgba(246, 244, 244, 0.86);
    max-width: 760px;
}

.actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    backdrop-filter: blur(8px);
}

.card h2:first-child,
.card h3:first-child { margin-top: 0; }

.narrow { max-width: 460px; margin-inline: auto; }
.narrowish { max-width: 760px; margin-inline: auto; }

h1, h2, h3 { line-height: 1.2; color: var(--forest-dark); }
h1 { margin: 0 0 22px; }
h2 { margin: 0 0 15px; }
h3 { margin-top: 30px; }

label {
    display: block;
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--forest-dark);
}

input, select, textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    border: 1px solid rgba(20, 39, 37, 0.20);
    border-radius: 14px;
    padding: 12px 13px;
    font: inherit;
    background: rgba(255,255,255,.94);
    color: var(--text);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

textarea { min-height: 96px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--mountain-blue);
    box-shadow: 0 0 0 4px var(--focus);
}

button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--race-red), var(--burgundy));
    color: var(--cream);
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    box-shadow: 0 10px 18px rgba(139, 8, 11, 0.20);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

button:hover, .button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(139, 8, 11, 0.24);
    text-decoration: none;
}

button:disabled {
    opacity: .48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary {
    background: #fff;
    color: var(--burgundy);
    border: 1px solid rgba(100, 28, 40, 0.22);
    box-shadow: none;
}

.secondary:hover {
    background: var(--primary-soft);
    box-shadow: 0 8px 18px rgba(100, 28, 40, .10);
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    align-items: end;
}

.grid-form.compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.inline-form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.inline-form label { min-width: 240px; flex: 1; }

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.help {
    color: var(--muted);
    font-size: 14px;
    margin: 5px 0 11px;
    font-weight: 500;
}

.required { color: var(--race-red); }

.flash {
    border-radius: 16px;
    padding: 13px 17px;
    margin: 0 0 18px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.92);
    box-shadow: 0 8px 18px rgba(20,39,37,.06);
}

.flash-success {
    border-color: rgba(20,88,39,.28);
    background: #edf7ef;
    color: var(--success);
}

.flash-error {
    border-color: rgba(139,8,11,.30);
    background: #fff0ee;
    color: var(--danger);
}

.flash-info {
    border-color: rgba(50,149,175,.34);
    background: #eef8fb;
    color: #1f6071;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    overflow-x: auto;
}

th, td {
    border-bottom: 1px solid rgba(20,39,37,.10);
    padding: 11px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--burgundy);
    font-size: 13px;
    letter-spacing: .045em;
    text-transform: uppercase;
}

tr:hover td { background: rgba(246,244,244,.55); }
.table-action { margin: 0; }

code {
    background: rgba(193,159,28,.14);
    color: var(--burgundy);
    padding: 2px 6px;
    border-radius: 7px;
    border: 1px solid rgba(193,159,28,.22);
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.chip {
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(100,28,40,.16);
    color: var(--burgundy);
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 13px;
    font-weight: 800;
}

.result-list { display: grid; gap: 12px; }

.result-card {
    border: 1px solid rgba(100,28,40,.16);
    border-radius: 18px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 18px;
    align-items: center;
    background: rgba(255,255,255,.78);
    box-shadow: 0 8px 18px rgba(20,39,37,.06);
}

.result-card:hover {
    border-color: rgba(139,8,11,.28);
    box-shadow: 0 12px 24px rgba(20,39,37,.09);
}

.result-card span { color: var(--muted); }

.summary-box {
    background:
        linear-gradient(135deg, rgba(82,152,171,.14), rgba(193,159,28,.12));
    border: 1px solid rgba(50,149,175,.22);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 20px;
}

.checkbox-line {
    font-weight: 700;
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 9px 0;
    color: var(--forest-dark);
}

.checkbox-line input {
    width: auto;
    margin: 0;
    accent-color: var(--race-red);
}

.signature-wrap {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(11, 95, 165, .08), rgba(82, 152, 171, .08));
    border: 1px solid rgba(11, 95, 165, .18);
}

#signatureCanvas {
    width: 100%;
    height: 220px;
    border: 2px dashed rgba(11, 95, 165, .55);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(238,247,255,.96));
    box-shadow: inset 0 0 0 1px rgba(11, 95, 165, .08), 0 10px 24px rgba(11, 95, 165, .08);
    touch-action: none;
    cursor: crosshair;
}

.status-strip {
    border-radius: 16px;
    padding: 13px 15px;
    margin-bottom: 18px;
    font-weight: 900;
}

.status-strip.ok {
    background: #edf7ef;
    color: var(--success);
    border: 1px solid rgba(20,88,39,.28);
}

.status-strip.warn {
    background: #fff7e6;
    color: var(--warning);
    border: 1px solid rgba(188,105,20,.32);
}

.details {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 9px 18px;
}

.details dt {
    font-weight: 900;
    color: var(--burgundy);
}

.details dd { margin: 0; }

@media (max-width: 720px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px 18px;
    }

    .topbar nav { gap: 6px; }
    .content { width: min(100% - 24px, 1180px); margin-top: 24px; }
    .hero { border-radius: 22px; }
    .search-form { grid-template-columns: 1fr; }
    .result-card { grid-template-columns: 1fr; }
    .card { padding: 17px; border-radius: 18px; }
    table { display: block; overflow-x: auto; }
    .details { grid-template-columns: 1fr; }
}

/* Mobile and volunteer check-in refinements */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-badge.complete {
    background: rgba(20, 88, 39, 0.12);
    color: var(--success);
    border: 1px solid rgba(20, 88, 39, 0.26);
}

.status-badge.missing {
    background: rgba(188, 105, 20, 0.12);
    color: var(--warning);
    border: 1px solid rgba(188, 105, 20, 0.30);
}

tr.is-complete td {
    background: rgba(20, 88, 39, 0.08);
}

tr.is-complete:hover td {
    background: rgba(20, 88, 39, 0.14);
}

tr.is-missing:hover td {
    background: rgba(188, 105, 20, 0.07);
}

@media (max-width: 900px) {
    .content {
        width: min(100% - 24px, 1180px);
        margin: 22px auto 44px;
    }

    .grid-form,
    .grid-form.compact,
    .search-form {
        grid-template-columns: 1fr;
    }

    .inline-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .inline-form label {
        min-width: 0;
    }

    input,
    select,
    textarea,
    button,
    .button {
        font-size: 16px;
    }
}

@media (max-width: 720px) {
    body {
        background:
            radial-gradient(circle at 20% 0%, rgba(82, 152, 171, 0.22), transparent 34%),
            linear-gradient(180deg, #f8f4ef 0%, #efe6dc 100%);
    }

    .topbar {
        position: static;
    }

    .topbar nav {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .topbar nav a {
        white-space: nowrap;
    }

    .hero {
        padding: 24px 18px;
    }

    .hero h1 {
        font-size: clamp(28px, 10vw, 42px);
    }

    .hero p {
        font-size: 16px;
    }

    .actions,
    .actions .button,
    .actions button {
        width: 100%;
    }

    .actions .button,
    .actions button,
    .search-form button,
    .grid-form button,
    .inline-form button {
        width: 100%;
    }

    .card {
        padding: 16px;
        border-radius: 18px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }

    #signatureCanvas {
        height: 180px;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 14px;
    }

    th,
    td {
        padding: 10px 8px;
    }
}

@media (max-width: 560px) {
    .content {
        width: min(100% - 16px, 1180px);
        margin-top: 16px;
    }

    .brand {
        font-size: 13px;
        letter-spacing: .04em;
    }

    .result-card {
        padding: 14px;
    }

    .details {
        gap: 6px;
    }

    .details dt {
        margin-top: 8px;
    }
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
}

.lang-switch a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
}

.lang-switch a.active {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.small-input {
    max-width: 120px;
}

.color-input {
    width: 56px;
    min-height: 42px;
    padding: 4px;
    border-radius: 12px;
    cursor: pointer;
}

.product-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 11px;
    border-radius: 5px;
    background: var(--race-color, #7a1430);
    color: var(--race-text-color, #fff);
    font-weight: 900;
    line-height: 1.2;
    box-shadow: 0 8px 18px rgba(20, 39, 37, .14);
}

.stack-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

button.danger,
.button.danger {
    background: #7a1430;
    color: #fff;
    border-color: #7a1430;
}

button:disabled,
.button.disabled {
    opacity: .45;
    cursor: not-allowed;
    filter: grayscale(.4);
}

.optional-glow,
.validate-box.has-optional {
    border: 2px solid rgba(204, 176, 37, .85);
    box-shadow: 0 0 0 4px rgba(204, 176, 37, .18), 0 0 28px rgba(204, 176, 37, .33);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,248,205,.92));
    border-radius: 22px;
    padding: 18px;
    margin: 18px 0;
}

.optional-glow h3 {
    margin-top: 0;
}

.optional-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(122, 20, 48, .08);
    margin: 4px 6px 4px 0;
}

.bib-display {
    display: grid;
    gap: 4px;
    padding: 12px 16px;
    border-radius: 18px;
    background: var(--race-color, #7a1430);
    color: var(--race-text-color, #fff);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--race-color, #7a1430) 20%, transparent), 0 18px 34px rgba(20, 39, 37, .20);
}

.bib-display span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .8;
}

.bib-display strong {
    font-size: clamp(26px, 5vw, 42px);
    line-height: 1;
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
}

.action-row .search-form {
    flex: 1 1 420px;
}

@media (max-width: 720px) {
    .topbar {
        gap: 10px;
    }

    .lang-switch {
        margin-left: 0;
    }

    .action-row,
    .action-row .button {
        width: 100%;
    }

    .optional-item {
        width: 100%;
        justify-content: space-between;
    }

    .stack-actions,
    .stack-actions .table-action,
    .stack-actions button {
        width: 100%;
    }
}

.flash-warning {
    border-color: rgba(204, 176, 37, .55);
    background: #fff8d6;
    color: #5a4b00;
}

.date-warning {
    min-height: 1.2em;
    margin: 4px 0 0;
    font-size: 12px;
    color: #7a1430;
    font-weight: 700;
}

.stats-card table {
    margin-top: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.stat-box {
    border-radius: 18px;
    padding: 16px;
    background: rgba(50, 149, 175, .11);
    border: 1px solid rgba(50, 149, 175, .22);
}

.stat-box span {
    display: block;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.stat-box strong {
    display: block;
    font-size: clamp(28px, 7vw, 44px);
    line-height: 1;
    margin-top: 8px;
    color: var(--race-burgundy);
}

.danger-zone {
    border-color: rgba(139, 8, 11, .3);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,240,238,.88));
}

button.danger,
.button.danger {
    background: #8b080b;
    color: #fff;
    border-color: #8b080b;
}

/* v6 admin accordions and responsive tables */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.accordion-details,
.accordion-card {
    overflow: hidden;
}

.accordion-details summary,
.accordion-card > summary {
    list-style: none;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 900;
    color: var(--forest-dark);
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(50, 149, 175, .10);
    border: 1px solid rgba(50, 149, 175, .18);
}

.accordion-details summary::-webkit-details-marker,
.accordion-card > summary::-webkit-details-marker {
    display: none;
}

.accordion-details summary::after,
.accordion-card > summary::after {
    content: "+";
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--race-red);
    color: var(--cream);
    flex: 0 0 auto;
}

.accordion-details[open] summary::after,
.accordion-card[open] > summary::after {
    content: "–";
}

.accordion-card > summary {
    margin: -4px 0 16px;
}

.accordion-card > summary small {
    color: var(--muted);
    font-weight: 800;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll table {
    min-width: 760px;
}

.search-with-limit {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(100px, 130px) auto;
    align-items: end;
    gap: 12px;
}

.limit-label {
    margin-bottom: 0;
}

.readonly-box {
    display: block;
    width: 100%;
    margin-top: 7px;
    border: 1px solid rgba(20, 39, 37, 0.16);
    border-radius: 14px;
    padding: 12px 13px;
    min-height: 48px;
    background: rgba(20, 39, 37, 0.045);
    font-weight: 800;
}

@media (max-width: 760px) {
    .search-with-limit {
        grid-template-columns: 1fr;
    }

    .search-with-limit button,
    .search-with-limit select {
        width: 100%;
    }

    .accordion-details summary,
    .accordion-card > summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .accordion-details summary::after,
    .accordion-card > summary::after {
        position: absolute;
        right: 18px;
        margin-top: -2px;
    }
}


/* v7 admin layout fixes */
.admin-search-row {
    align-items: flex-end;
}

.search-with-limit {
    grid-template-columns: minmax(260px, 1fr) minmax(110px, 150px) minmax(92px, auto);
    align-items: end;
}

.search-with-limit label,
.search-with-limit .limit-label {
    margin-bottom: 0;
}

.search-with-limit input,
.search-with-limit select,
.search-with-limit button,
.admin-search-row > .button {
    min-height: 52px;
    line-height: 1.2;
}

.search-with-limit button,
.admin-search-row > .button {
    margin-top: 0;
    white-space: nowrap;
}

.manual-participant-form {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    align-items: end;
}

.manual-participant-form label {
    min-width: 0;
    margin-bottom: 0;
}

.manual-participant-form .wide {
    grid-column: span 2;
}

.manual-participant-form button {
    min-height: 52px;
}

@media (max-width: 1050px) {
    .manual-participant-form {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .admin-search-row {
        display: grid;
        grid-template-columns: 1fr;
    }
    .admin-search-row > .button {
        width: 100%;
    }
    .manual-participant-form,
    .manual-participant-form .wide {
        grid-template-columns: 1fr;
        grid-column: auto;
    }
}

/* v7 specificity fixes */
.grid-form.compact.manual-participant-form {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

@media (max-width: 1050px) {
    .grid-form.compact.manual-participant-form {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .grid-form.compact.manual-participant-form {
        grid-template-columns: 1fr;
    }
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:focus,
.clickable-row:hover {
    outline: 2px solid rgba(122, 20, 48, .35);
    outline-offset: -2px;
    background: rgba(122, 20, 48, .035);
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    font-size: 19px;
    font-weight: 1000;
    line-height: 1;
    box-shadow: 0 8px 20px rgba(20, 39, 37, .12);
}

.status-icon.ok {
    background: rgba(24, 130, 82, .15);
    color: #0f6d45;
    border: 1px solid rgba(24, 130, 82, .35);
}

.status-icon.warn {
    background: rgba(204, 125, 24, .16);
    color: #9c5c00;
    border: 1px solid rgba(204, 125, 24, .38);
}

.status-icon.bad {
    background: rgba(154, 16, 45, .13);
    color: #9a102d;
    border: 1px solid rgba(154, 16, 45, .36);
}

.volunteer-results-table th,
.volunteer-results-table td {
    vertical-align: middle;
}


.stat-details {
    display: block;
}

.stat-details summary {
    list-style: none;
    cursor: pointer;
}

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

.stat-details .stat-box {
    height: 100%;
}

.stat-details[open] .stat-box {
    outline: 3px solid rgba(122, 20, 48, .18);
}

.stat-person-list {
    margin-top: 14px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(122, 20, 48, .16);
}

.stat-person-list h3 {
    margin: 0 0 10px;
}

.stat-person-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.stat-person-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(245, 239, 223, .72);
}

.stat-person-list .person-meta {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .stat-person-list li {
        align-items: flex-start;
        flex-direction: column;
    }

    .stat-person-list .person-meta {
        white-space: normal;
    }
}

.bib-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 6px 10px;
    border-radius: 5px;
    background: var(--race-color, #7a1430);
    color: var(--race-text-color, #fff);
    font-weight: 1000;
    box-shadow: 0 8px 18px rgba(20, 39, 37, .14);
}

.dob-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 11px;
    border-radius: 12px;
    background: rgba(82, 152, 171, .10);
    border: 1px solid rgba(82, 152, 171, .22);
    font-weight: 800;
}

.dob-box.compact {
    padding: 5px 8px;
    font-size: 14px;
}

.dob-warning {
    border: 2px solid rgba(204, 176, 37, .85);
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,248,205,.94));
    box-shadow: 0 0 0 4px rgba(204, 176, 37, .16), 0 0 24px rgba(204, 176, 37, .32);
    animation: dobPulse 1.35s ease-in-out infinite;
}

@keyframes dobPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(204, 176, 37, .14), 0 0 18px rgba(204, 176, 37, .24);
    }
    50% {
        box-shadow: 0 0 0 7px rgba(204, 176, 37, .26), 0 0 34px rgba(204, 176, 37, .48);
    }
}


/* v13 text blocks, observations, and minor warnings */
.text-block-field {
    white-space: pre-wrap;
    border: 1px solid rgba(50, 149, 175, .22);
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(238,248,251,.92));
    color: var(--forest-dark);
    font-weight: 650;
    line-height: 1.65;
}

.text-block-help {
    white-space: pre-wrap;
}

.grid-form.compact > .wide {
    grid-column: span 2;
}

.dob-warning {
    border: 2px solid rgba(204, 176, 37, .85) !important;
    box-shadow: 0 0 0 4px rgba(204, 176, 37, .18), 0 0 28px rgba(204, 176, 37, .33) !important;
    animation: warningPulse 1.45s ease-in-out infinite;
}

.dob-warning strong {
    display: inline-block;
    margin-top: 4px;
    color: #7a1430;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.observation-stat-box {
    background: rgba(188, 105, 20, .11);
    border-color: rgba(188, 105, 20, .28);
}

.observation-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.observation-item {
    border: 1px solid rgba(100, 28, 40, .16);
    border-radius: 16px;
    background: rgba(255,255,255,.88);
    overflow: hidden;
}

.observation-item > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
    list-style: none;
}

.observation-item > summary::-webkit-details-marker {
    display: none;
}

.observation-item small {
    display: block;
    color: var(--muted);
    font-weight: 800;
    margin-top: 3px;
}

.observation-item.is-open {
    border-color: rgba(188, 105, 20, .34);
}

.observation-item.is-done {
    border-color: rgba(20, 88, 39, .28);
    background: rgba(237, 247, 239, .72);
}

.observation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.observation-badge.open {
    background: rgba(188, 105, 20, .14);
    color: #9c5c00;
    border: 1px solid rgba(188, 105, 20, .32);
}

.observation-badge.done {
    background: rgba(20, 88, 39, .14);
    color: var(--success);
    border: 1px solid rgba(20, 88, 39, .28);
}

.observation-body {
    border-top: 1px solid rgba(20, 39, 37, .08);
    padding: 14px 15px 16px;
}

.observation-body p {
    white-space: pre-wrap;
    margin: 0 0 12px;
}

.observation-done-form {
    align-items: center;
}

.validate-box .wide {
    grid-column: 1 / -1;
}

@media (max-width: 760px) {
    .grid-form.compact > .wide {
        grid-column: auto;
    }

    .observation-item > summary,
    .observation-done-form {
        align-items: stretch;
        flex-direction: column;
    }
}

/* Keep the app title text-only, with no generated logo/icon. */
.brand::before,
.brand::after {
    content: none !important;
    display: none !important;
}

.stat-box-link {
    display: block;
    min-height: 100%;
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.stat-box-link:hover,
.stat-box-link:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(122, 20, 48, .12);
    border-color: rgba(122, 20, 48, .35);
    outline: none;
}

.observations-section {
    margin-top: 18px;
}

.readonly-form-data {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.readonly-row {
    border: 1px solid rgba(20, 39, 37, .12);
    border-radius: 12px;
    background: rgba(255, 252, 246, .76);
    padding: 12px 14px;
}

.readonly-label {
    font-weight: 800;
    margin-bottom: 6px;
}

.readonly-value {
    white-space: pre-wrap;
    color: var(--ink);
}

/* v22 participant form reset block */
.reset-form-block {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(139, 8, 11, .25);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,240,238,.72));
}
.reset-form-block h3 {
    margin-top: 0;
}

/* Public participant search: completed liability form marker */
.result-card.is-form-completed {
    background: rgba(20, 88, 39, 0.055);
    border-color: rgba(20, 88, 39, 0.24);
}

.result-card-main {
    display: grid;
    gap: 5px;
}

.public-completed-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--success);
    font-weight: 900;
    font-size: 13px;
}

.public-completed-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(20, 88, 39, 0.14);
    border: 1px solid rgba(20, 88, 39, 0.32);
    color: var(--success);
    line-height: 1;
}

/* v25 floating toast notifications */
.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    border-radius: 16px;
    padding: 14px 14px 14px 16px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.98);
    box-shadow: 0 18px 42px rgba(20,39,37,.18);
    font-weight: 750;
    animation: toastIn .22s ease-out;
}

.toast-message {
    line-height: 1.35;
}

.toast-close {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: rgba(20,39,37,.08);
    color: var(--ink);
    padding: 0;
    line-height: 1;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
}

.toast-close:hover {
    background: rgba(20,39,37,.14);
}

.toast-success {
    border-color: rgba(20,88,39,.30);
    background: #edf7ef;
    color: var(--success);
}

.toast-error {
    border-color: rgba(139,8,11,.32);
    background: #fff0ee;
    color: var(--danger);
}

.toast-info {
    border-color: rgba(50,149,175,.34);
    background: #eef8fb;
    color: #1f6071;
}

.toast-warning {
    border-color: rgba(198,134,34,.34);
    background: #fff8e8;
    color: #8a5711;
}

.toast.is-hiding {
    animation: toastOut .18s ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(10px) scale(.98); }
}

/* v25 purple reset participant form button */
.reset-form-block button.danger {
    background: #7c3aed;
    border-color: #6d28d9;
    color: #fff;
    box-shadow: 0 12px 24px rgba(124,58,237,.22);
}

.reset-form-block button.danger:hover {
    background: #6d28d9;
    border-color: #5b21b6;
}

@media (max-width: 700px) {
    .toast-stack {
        left: 14px;
        right: 14px;
        bottom: 14px;
        width: auto;
    }
}


/* v27 WhatsApp quick action next to phone-like fields */
.input-action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.whatsapp-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(37, 211, 102, .42);
    background: #eafff1;
    color: #075e54;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.whatsapp-action svg {
    width: 20px;
    height: 20px;
    fill: #25d366;
    flex: 0 0 auto;
}

.whatsapp-action:hover {
    background: #d7ffe5;
    border-color: rgba(37, 211, 102, .72);
    transform: translateY(-1px);
}

@media (max-width: 620px) {
    .input-action-row {
        grid-template-columns: 1fr;
    }

    .whatsapp-action {
        width: fit-content;
    }
}

/* v28 waiver PDF export */
.document-actions.waiver-pdf-block {
    margin-top: 1.1rem;
    padding: 1rem;
    border: 1px solid rgba(122, 20, 48, 0.12);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 16px;
}
.document-actions.waiver-pdf-block h3 {
    margin-top: 0;
}
.pdf-export-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}
.pdf-export-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    filter: grayscale(0.25);
}


/* v30 admin edit operations cleanup */
.admin-signature-row {
    margin-bottom: 1.5rem;
}

.signature-inline-box {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid rgba(122,20,48,.16);
    border-radius: 10px;
    background: rgba(255,255,255,.75);
    box-shadow: 0 4px 14px rgba(0,0,0,.04);
}

.signature-inline-box a,
.signature-inline-box span {
    font-weight: 800;
    text-decoration: none;
}

.admin-operations-block {
    margin-top: 1.25rem;
    padding-top: 0.5rem;
}

.admin-operations-block h3 {
    margin-bottom: 0.9rem;
}

.admin-operations-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.admin-operations-row .inline-form {
    margin: 0;
}

.admin-operations-row .button,
.admin-operations-row button {
    margin: 0;
}

.admin-operations-row .pdf-export-button {
    min-height: 46px;
}

@media (max-width: 700px) {
    .admin-operations-row {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-operations-row .inline-form,
    .admin-operations-row .button,
    .admin-operations-row button {
        width: 100%;
    }
}


/* v31 fix admin save outside form + keep reset button purple */
.admin-operations-row .reset-participant-form-button {
    background: #7c3aed;
    border-color: #6d28d9;
    color: #fff;
    box-shadow: 0 12px 24px rgba(124,58,237,.22);
}

.admin-operations-row .reset-participant-form-button:hover {
    background: #6d28d9;
    border-color: #5b21b6;
}

/* v35 child/teen on-site registration */
.actions .locked-action,
.button.locked-action {
    background: #d7d7d7;
    border-color: #c7c7c7;
    color: #5f6668;
    box-shadow: none;
}

.actions .locked-action:hover,
.button.locked-action:hover {
    background: #cecece;
    color: #41484a;
}

.kids-registration-card .locked-panel,
.kids-registration-card .success-panel {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(122,20,48,.12);
}

.kids-registration-form .child-age-info {
    margin: 8px 0 0;
    font-weight: 900;
    letter-spacing: .02em;
}

.child-age-info.is-ok {
    color: var(--success);
}

.child-age-info.is-warning {
    color: var(--danger);
}

.unlock-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.unlock-form label {
    margin: 0;
    min-width: 220px;
}
