:root {
    --rr-navy: #21436B;
    --rr-red: #E03E36;
    --rr-ink: #0E2138;
    --rr-surface: #F2F5FA;
    --rr-line: #DEE4EC;
    --rr-muted: #5A6B80;
}

body {
    background-color: var(--rr-surface);
    color: var(--rr-ink);
}

/* On the navy drawer MudBlazor's default (navy primary) active highlight is nearly invisible,
   so brand the selected nav link red. Global (not scoped) because NavMenu's root is a component. */
.mud-nav-link.active,
.mud-nav-link.active:hover {
    background-color: var(--rr-red) !important;
    color: #fff !important;
}

.mud-nav-link.active .mud-nav-link-icon,
.mud-nav-link.active .mud-icon-root {
    color: #fff !important;
}

/* Page-load progress bar pinned to the bottom edge of the app bar; absolutely positioned so it
   never changes the app bar height. */
.rr-appbar-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Indent the raffle entries so they read as a sub-list under "Raffles". */
.mud-nav-link.raffle-link {
    padding-left: 2.5rem;
    font-size: 0.9rem;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--rr-red);
}

.btn-primary {
    color: #fff;
    background-color: var(--rr-red);
    border-color: var(--rr-red);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image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IgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.app-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--rr-surface, #F2F5FA);
}

.app-loading-icon {
    width: 8rem;
    height: 8rem;
}

/* Border ring doubles as download progress.
   Circumference at r=25 is 2*pi*25 = 157.08; pi*25/50 = 1.5708. */
.app-loading-icon .progress-arc {
    fill: none;
    stroke: #E03E36;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-dasharray: calc(1.5708 * var(--blazor-load-percentage, 0%)), 500%;
    transform: rotate(-90deg);
    transform-box: fill-box;
    transform-origin: 50% 50%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.rafflephoto-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.8); z-index: 1080;
    display: flex; align-items: center; justify-content: center; }
.rafflephoto-dialog { background: #fff; padding: 1rem; max-width: 90vw; max-height: 90vh; }
.rafflephoto-img { max-height: 70vh; }
.rafflephoto-img img { max-width: 100%; }

/* --cell drives both the cell width and the block grid tracks so they shrink on small screens. */
.ticket-grid { display: flex; flex-wrap: wrap; gap: 2px; --cell: 44px; }
/* A block is at most one block-width wide (one row on desktop), but when the viewport is
   narrower it shrinks to 100% and the cells wrap inside the block — so every ticket stays
   reachable on mobile without horizontal scrolling, and block boundaries remain visible. */
.record-block { display: grid; grid-template-columns: repeat(auto-fill, var(--cell)); gap: 2px;
    width: min(100%, calc(var(--bs, 1) * (var(--cell) + 2px))); }
/* Fixed width (not min-width) so cells stay uniform regardless of digit count and the grid
   does not reflow/jump between 1- and 4-digit numbers. */
.ticket-cell { width: var(--cell, 44px); height: 22px; padding: 0 2px; border-radius: 2px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; line-height: 1; cursor: pointer; box-sizing: border-box; overflow: hidden; }
@media (max-width: 600px) { .ticket-grid { --cell: 34px; } }
/* Two classes so the selected fill wins over .ts-assigned / .ts-sold (single-class) rules. */
.ticket-cell.ticket-cell-selected { background: #1565c0; color: #fff;
    outline: 2px solid #0d3c75; outline-offset: -1px; }
.ticket-detail-photo { max-height: 120px; border-radius: 4px; }
.ticket-swatch { width: 14px; height: 14px; border-radius: 2px; display: inline-block; }
.ticket-bar { display: flex; height: 28px; width: 100%; border: 1px solid #999;
    border-radius: 4px; overflow: hidden; }
.ticket-seg { height: 100%; cursor: pointer; }
.ticket-table tbody tr.ticket-row { cursor: pointer; }
.ts-unassigned { background: #e0e0e0; }
.ts-assigned { background: #bcdcff; }
.ts-sold { background: #2e9e5b; }
.rafflephoto-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .75rem; }

/* Seller-scoped Sell page bar + drill views (SellerTicketBar) */
.bar-back { background: none; border: none; padding: 0; margin-bottom: .5rem; margin-right: .75rem;
    color: #1a2b4a; cursor: pointer; font: inherit; }
.bar-back:hover { text-decoration: underline; }
.sold-groups { display: flex; flex-direction: column; gap: 4px; }
.sold-group { text-align: left; width: 100%; padding: .4rem .6rem; border: 1px solid #d0d0d0;
    border-radius: 4px; background: #f7f7f7; cursor: pointer; font: inherit; }
.sold-group:hover { background: #ececec; }
.sale-detail { margin-top: .25rem; }
.record-bucket { padding: .25rem .6rem; border: 1px solid #c0c0c0; border-radius: 4px;
    background: #bcdcff; cursor: pointer; font: inherit; font-size: 12px; }
.record-bucket:hover { filter: brightness(0.96); }
.record-bucket.ts-sold { background: #2e9e5b; color: #fff; }
/* Record-sale form: stacked rows; field groups use a left-packed fixed-column grid so the
   inputs don't stretch across the full desktop width. */
.record-form { display: flex; flex-direction: column; gap: .25rem; }
.record-fields { display: grid; gap: .5rem; justify-content: start; }
.record-fields .mud-input-control { width: 100%; }

.draw-reveal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 33, 56, 0.92);
    cursor: pointer;
    outline: none;
}

.draw-reveal-card {
    text-align: center;
    color: #fff;
    padding: 2rem;
    max-width: 90vw;
}

.draw-reveal-prize {
    color: #FFD166;
}

.draw-reveal-photo {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: min(70vw, 360px);
    max-height: 50vh;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}