:root {
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-alt: #f1f5f9;
    --color-border: #e2e8f0;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #d97706;
    --radius: 10px;

    /* Left-nav app shell (see .app-shell below) — a deep blue rather than
       the near-black sidebar of the reference design, with the same bright
       indigo used for links/buttons carried through as the active-item
       highlight so it still reads as one accent color across the page. */
    --color-sidebar-bg: #1e3a8a;
    --color-sidebar-border: rgba(255, 255, 255, 0.1);
    --color-sidebar-text: #c7d2fe;
    --color-sidebar-text-active: #ffffff;
    --color-sidebar-muted: #93a5d1;
    --color-sidebar-active-bg: #4f46e5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.site-header {
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
}
.header-inner nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.nav-user {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}
.nav-user:hover {
    color: var(--color-text);
}
.nav-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
}
.profile-avatar-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
}
.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #fff;
    font-size: 2.25rem;
    font-weight: bold;
}
/* The [hidden] attribute alone loses to the display:flex rule above (same
   specificity, but this stylesheet's author-origin rule beats the browser's
   user-agent-origin `[hidden]{display:none}`) — so profile-avatar.js
   toggling `hidden` needs this explicit override to actually hide it. */
.profile-avatar-placeholder[hidden] {
    display: none;
}
/* Clicking the avatar itself opens the file picker (see the hidden #photo
   input + static/js/profile-avatar.js for the live preview) instead of a
   separate file-input placeholder sitting below it. */
.profile-avatar-upload {
    position: relative;
    display: inline-flex;
    border-radius: 50%;
    cursor: pointer;
}
.profile-avatar-upload:hover .profile-avatar,
.profile-avatar-upload:focus-within .profile-avatar {
    opacity: 0.85;
}
.profile-avatar-edit-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    border: 2px solid var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-avatar-edit-badge svg {
    width: 15px;
    height: 15px;
}
.profile-avatar-hint {
    text-align: center;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.lang-switch {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.lang-switch a {
    color: var(--color-text-muted);
}
.lang-switch a.lang-active {
    color: var(--color-text);
    font-weight: 700;
    text-decoration: none;
}

main.container {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.25rem 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Left-nav app shell for logged-in pages (admin/staff/platform/account) —
   see the `{% if user %}` branch in base.html. Public/auth pages keep the
   plain top-nav header above instead. */
.app-shell {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
}
.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-sidebar-bg);
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 0.5rem 1.5rem;
    color: var(--color-sidebar-text-active);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
}
.app-sidebar-brand:hover {
    text-decoration: none;
}
.app-sidebar-brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: var(--color-sidebar-active-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}
.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}
.app-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.app-sidebar-nav a svg {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}
.app-sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-sidebar-text-active);
    text-decoration: none;
}
.app-sidebar-nav a.active {
    background: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-text-active);
}

/* Profile dropdown — opened by clicking the user button in the sidebar
   footer (see static/js/sidebar-menu.js). Anchored above the button since
   it lives at the bottom of the sidebar. Holds only the handful of
   platform-management links (Companies/Super admins/Analytics/Staff
   accounts) that don't need everyday sidebar real estate — everything
   else stays in .app-sidebar-nav above. */
.app-sidebar-profile {
    position: relative;
    flex: 1;
    min-width: 0;
}
.app-sidebar-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 0.6rem);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22);
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    max-height: min(70vh, 480px);
    overflow-y: auto;
    z-index: 45;
}
.app-sidebar-menu[hidden] {
    display: none;
}
.app-sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.65rem;
    border-radius: 7px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}
.app-sidebar-menu a svg {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}
.app-sidebar-menu a:hover {
    background: var(--color-surface-alt);
    text-decoration: none;
}
.app-sidebar-menu a.active {
    background: var(--color-primary);
    color: #ffffff;
}
.app-sidebar-menu a.active svg {
    color: #ffffff;
}
.app-sidebar-menu-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.4rem 0.3rem;
}
.app-sidebar-lang {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 1rem 0.85rem 0;
    font-size: 0.78rem;
    color: var(--color-sidebar-muted);
}
.app-sidebar-lang a {
    color: var(--color-sidebar-muted);
    text-decoration: none;
}
.app-sidebar-lang a.lang-active {
    color: var(--color-sidebar-text-active);
    font-weight: 700;
}
.app-sidebar-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid var(--color-sidebar-border);
    margin-top: 1rem;
    padding-top: 1rem;
}
.app-sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    text-align: left;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.app-sidebar-user:hover {
    text-decoration: none;
}
.app-sidebar-user-chevron {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    margin-left: auto;
    color: var(--color-sidebar-muted);
    transition: transform 0.15s ease;
}
.app-sidebar-user[aria-expanded="true"] .app-sidebar-user-chevron {
    transform: rotate(180deg);
}
.app-sidebar-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-text-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.app-sidebar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.app-sidebar-user-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.app-sidebar-user-name {
    color: var(--color-sidebar-text-active);
    font-size: 0.85rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-sidebar-user-role {
    color: var(--color-sidebar-muted);
    font-size: 0.72rem;
}
.app-sidebar-logout {
    background: none;
    border: none;
    color: var(--color-sidebar-muted);
    cursor: pointer;
    padding: 0.45rem;
    border-radius: 8px;
    display: flex;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.app-sidebar-logout svg {
    width: 1.1rem;
    height: 1.1rem;
}
.app-sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-sidebar-text-active);
}

/* Mobile/tablet top bar — hidden on desktop, shown in its place below at
   <=900px. Holds the hamburger button that slides .app-sidebar in as an
   off-canvas drawer instead of the old horizontal icon-only strip. */
.app-topbar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    background: var(--color-sidebar-bg);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.app-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-sidebar-text-active);
    cursor: pointer;
}
.app-sidebar-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
}
.app-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
}
.app-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-sidebar-text-active);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
}
.app-topbar-brand:hover {
    text-decoration: none;
}
.app-sidebar-overlay {
    display: none;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.app-content {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}
.app-footer {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    padding: 1rem 2rem 1.5rem;
}

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }
    .app-topbar {
        display: flex;
    }
    /* Off-canvas drawer: hidden by translateX until .app-shell.sidebar-open
       (toggled by static/js/sidebar-toggle.js) brings it on-screen over the
       page content, matching a standard mobile nav-drawer pattern. */
    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem 1rem;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 40;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25);
    }
    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }
    .app-shell.sidebar-open .app-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        z-index: 30;
    }
    .app-sidebar-footer {
        margin-top: 1rem;
    }
    .app-content {
        padding: 1.25rem;
    }
}

@media (min-width: 901px) {
    .app-sidebar-toggle,
    .app-topbar {
        display: none;
    }
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}
.two-col .card {
    margin-bottom: 0;
}
@media (max-width: 768px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

/* Registration detail (staff review): mirrors the public registration
   form's layout (.register-layout/.register-form-col/.register-side-col)
   — one card on the left holding buyer details, extracted receipt fields,
   and the review decision/outcome as their own .form-section sub-panels,
   with the receipt preview as its own card in the side column. The form
   itself needs to fill the (wide) column rather than the site's normal
   520px single-column form width. */
form.form.review-form {
    max-width: none;
}

/* Lottery create/edit form: regrouped into named .form-section panels
   (details / bank accounts / schedule / capacity / Telegram) instead of one
   long flat list of ~18 fields — needs the same full-width treatment as
   .review-form since a two-column .form-row-pair and a bank-accounts table
   both live inside it. */
form.form.lottery-form {
    max-width: none;
}
.review-card .form-section {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.review-card .form-section:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.14);
}
.receipt-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.receipt-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.18);
}
.receipt-card .receipt-preview {
    height: 480px;
    overflow: auto;
}
.receipt-card .receipt-preview img {
    width: 100%;
    height: auto;
    cursor: zoom-in;
}

/* PDF receipts render page-by-page onto a canvas via pdf-viewer.js (using
   the vendored PDF.js under static/js/vendor/), rather than an <embed>
   handing the whole document off to the browser's own PDF viewer — that
   gave us no way to add our own Prev/Next controls. */
.pdf-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.pdf-viewer-canvas {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}
.pdf-viewer-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.pdf-viewer-page-info {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Extracted-fields key/value grid: label stacked above value (rather than
   inline) so long values get their own cell's full width instead of being
   squeezed next to the label — always exactly two per row regardless of
   card width, rather than reflowing to as many as fit. See
   receipt-lightbox.js / .lightbox-overlay for the click-to-zoom receipt
   viewer, and copy-link.js for the .copy-link-button behavior. */
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.5rem;
    margin-top: 0.5rem;
}
.field-block {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}
.field-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}
.field-value {
    font-size: 0.95rem;
    word-break: break-word;
}
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.field-value.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.field-value.reference-reuse-flag {
    color: var(--color-warning);
    font-weight: 700;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
    padding: 2rem;
}
.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox-hidden {
    display: none;
}

/* QR code modal for the per-lottery shareable link — see lottery-qr.js and
   the .qr-code-button trigger next to .copy-link-button. */
.qr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}
.qr-modal-content {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.qr-modal-content canvas {
    max-width: 100%;
    height: auto;
}
.qr-modal-link {
    word-break: break-all;
    text-align: center;
}
.qr-modal-close {
    align-self: flex-end;
}
.qr-modal-hidden {
    display: none;
}

/* The admin Telegram conversation-thread page (app/templates/admin/
   telegram_conversation.html) — a self-contained chat panel (bounded
   height, its own scroll) rather than bubbles loose on the page, so it
   reads as a real messaging surface: history scrolls inside the panel,
   the composer stays docked to its bottom, same shape as any chat app. */
.chat-panel {
    display: flex;
    flex-direction: column;
    height: min(70vh, 720px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.chat-thread {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.25rem;
    background: var(--color-surface-alt);
}
.chat-date-separator {
    align-self: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 0.15rem 0.75rem;
    border-radius: 999px;
    margin: 0.75rem 0 0.5rem;
}
.chat-bubble-row {
    display: flex;
    margin-top: 0.6rem;
}
.chat-bubble-row-outbound {
    justify-content: flex-end;
}
.chat-bubble {
    max-width: 70%;
    padding: 0.55rem 0.8rem;
    border-radius: 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.chat-bubble-row-inbound .chat-bubble {
    border-bottom-left-radius: 3px;
}
.chat-bubble-row-outbound .chat-bubble {
    border-bottom-right-radius: 3px;
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.chat-bubble-row-outbound .chat-bubble-meta,
.chat-bubble-row-outbound .chat-bubble-sender {
    color: rgba(255, 255, 255, 0.85);
}
.chat-bubble-sender {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.15rem;
}
.chat-bubble-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}
.chat-bubble-meta {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    margin-top: 0.3rem;
    text-align: right;
}
.chat-attachment-image {
    display: block;
    max-width: 220px;
    max-height: 220px;
    width: auto;
    border-radius: 10px;
    margin: 0.2rem 0 0.35rem;
    cursor: zoom-in;
    border: 1px solid rgba(15, 23, 42, 0.08);
}
.chat-attachment-file {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    margin: 0.2rem 0 0.35rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.04);
    text-decoration: none;
    color: inherit;
}
.chat-bubble-row-outbound .chat-attachment-file {
    background: rgba(255, 255, 255, 0.15);
}
.chat-attachment-file:hover {
    background: rgba(15, 23, 42, 0.08);
}
.chat-bubble-row-outbound .chat-attachment-file:hover {
    background: rgba(255, 255, 255, 0.25);
}
.chat-attachment-file-icon {
    font-size: 1.4rem;
    line-height: 1;
}
.chat-attachment-file-label {
    font-size: 0.8rem;
    font-weight: 600;
}
.chat-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    padding: 0.75rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
}
.chat-composer textarea {
    flex: 1;
    resize: none;
    max-height: 8rem;
    overflow-y: auto;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 0.6rem 1rem;
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-composer textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

@media (max-width: 640px) {
    .chat-bubble {
        max-width: 85%;
    }
    .chat-panel {
        height: min(75vh, 640px);
    }
}

.register-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}
.register-form-col,
.register-side-col {
    min-width: 0;
}
@media (max-width: 900px) {
    .register-layout {
        grid-template-columns: 1fr;
    }
    .register-side-col {
        order: -1;
    }
}

/* Full-bleed marketing-style hero banner at the very top of a lottery's
   public link page (public/landing.html) — three stacked full-width bands:
   a rotating promo strip (.lottery-promo-strip, hidden when the lottery has
   no promo_banner_messages configured), the main title/prize band
   (.lottery-promo-hero), and a draw-date footer (.lottery-promo-footer,
   hidden when the lottery has no draw_date set). The margin-only breakout
   (no explicit `width: 100vw`) avoids the classic scrollbar-width overflow
   bug that comes with sizing by vw directly. */
.lottery-promo-banner {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 2rem;
    color: #fff;
}
.lottery-promo-strip {
    position: relative;
    background: #312e81;
    padding: 0.65rem 1.5rem;
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* JS (promo-banner.js) toggles which .lottery-promo-strip-message has
   .active — display:none/flex here rather than opacity so only one ever
   occupies layout space, keeping the strip a fixed height regardless of
   how long each message is. */
.lottery-promo-strip-message {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}
.lottery-promo-strip-message.active {
    display: flex;
}
.lottery-promo-strip-icon {
    font-size: 1rem;
}

.lottery-promo-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 55%, #6366f1 100%);
    padding: clamp(1.75rem, 5vw, 3.25rem) 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    min-height: clamp(160px, 26vw, 260px);
}
/* Decorative confetti flecks scattered across the hero band — a cheap
   multi-radial-gradient dot pattern rather than a bespoke illustration. */
.lottery-promo-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0.18) 3px, transparent 4px),
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.15) 0, rgba(255, 255, 255, 0.15) 4px, transparent 5px),
        radial-gradient(circle at 70% 78%, rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0.14) 3px, transparent 4px),
        radial-gradient(circle at 35% 82%, rgba(255, 255, 255, 0.12) 0, rgba(255, 255, 255, 0.12) 2px, transparent 3px),
        radial-gradient(circle at 92% 62%, rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0.14) 3px, transparent 4px),
        radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.1) 0, rgba(255, 255, 255, 0.1) 2px, transparent 3px);
    pointer-events: none;
}
.lottery-promo-hero-title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}
.lottery-promo-hero-badge {
    flex-shrink: 0;
    width: clamp(3rem, 6vw, 4.5rem);
    height: clamp(3rem, 6vw, 4.5rem);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    border: 2px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
}
.lottery-promo-hero-title h1 {
    margin: 0;
    font-size: clamp(1.4rem, 3.2vw, 2.2rem);
    font-weight: 800;
    line-height: 1.15;
    max-width: 560px;
}
.lottery-promo-hero-prize {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}
.lottery-promo-hero-prize-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
    margin-bottom: 0.2rem;
}
.lottery-promo-hero-prize-value {
    font-size: clamp(1.6rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.lottery-promo-footer {
    background: rgba(255, 255, 255, 0.14);
    padding: 0.6rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 640px) {
    .lottery-promo-hero {
        justify-content: center;
        text-align: center;
    }
    .lottery-promo-hero-title {
        flex-direction: column;
        text-align: center;
    }
    .lottery-promo-hero-prize {
        align-items: center;
        text-align: center;
    }
}

.hero {
    text-align: center;
    padding: 2.5rem 1rem;
}
.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.hero p.description {
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

/* Uploaded photo/video gallery as the hero band's own background
   (public/landing.html, .lottery-promo-hero.has-media) — the slider fills
   the band edge-to-edge behind the title/prize text, with a gradient
   overlay layered on top for legibility. Reuses the same .card>.lottery-gallery
   markup as register.html's boxed side-column card (partials/lottery_gallery.html),
   just stripped of the card chrome and stretched to fill instead. */
.lottery-promo-hero-media {
    position: absolute;
    inset: 0;
}
.lottery-promo-hero-media .card {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    height: 100%;
}
.lottery-promo-hero-media .lottery-gallery {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    max-height: none;
    border-radius: 0;
    margin-bottom: 0;
    /* transparent, not the usual light-gray placeholder fill — any
       letterboxing from object-fit: contain below shows the hero's own
       gradient through instead of a flat gray box clashing with it. */
    background: none;
}
/* contain, not cover: the whole photo/video stays visible and unclipped
   (cover would crop it to fill the band's fixed aspect ratio) — any gap
   around it is just the hero's own gradient background showing through. */
.lottery-promo-hero-media .lottery-gallery-slide img,
.lottery-promo-hero-media .lottery-gallery-slide video {
    object-fit: contain;
}
/* Left-to-right wash rather than a flat tint over the whole photo — keeps
   the title/prize side (left) legible while leaving more of the photo
   visible toward the right, instead of drowning it out entirely. */
.lottery-promo-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(49, 46, 129, 0.88) 0%,
        rgba(67, 56, 202, 0.6) 45%,
        rgba(99, 102, 241, 0.28) 100%
    );
}
/* A translucent panel behind each text block so it stays readable
   regardless of what the photo underneath looks like at that spot —
   only needed once there's a photo behind the text; the flat gradient
   background (no gallery) already has enough contrast on its own. */
.lottery-promo-hero.has-media .lottery-promo-hero-title,
.lottery-promo-hero.has-media .lottery-promo-hero-prize {
    background: rgba(15, 23, 42, 0.32);
    border-radius: 0.75rem;
    padding: 0.6rem 1rem;
}

/* Generic "no specific lottery" welcome page at "/" (public/landing.html,
   the `{% else %}` branch) — a hero band, a 3-step explainer, then the
   shared ticket-lookup card every landing view (welcome or per-lottery)
   ends with. */
.landing-hero {
    text-align: center;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 65%);
    border: 1px solid var(--color-border);
    margin-bottom: 2rem;
}
.landing-hero h1 {
    font-size: 1.4rem;
    margin: 0;
}

.landing-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.landing-step {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
}
.landing-step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    font-size: 1.5rem;
    margin-bottom: 0.85rem;
}
.landing-step h3 {
    margin: 0.25rem 0 0.5rem;
    font-size: 1.05rem;
}
.landing-step p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
}
/* Color-code each step so the explainer reads as three distinct stages
   rather than three identical cards — indigo/amber/green tracks the same
   accent colors used for links, "review" flags, and "confirmed" states
   elsewhere in the app. */
.landing-step:nth-child(1) {
    border-top-color: var(--color-primary);
}
.landing-step:nth-child(1) .landing-step-icon {
    background: rgba(79, 70, 229, 0.12);
}
.landing-step:nth-child(2) {
    border-top-color: var(--color-warning);
}
.landing-step:nth-child(2) .landing-step-icon {
    background: rgba(217, 119, 6, 0.12);
}
.landing-step:nth-child(3) {
    border-top-color: var(--color-success);
}
.landing-step:nth-child(3) .landing-step-icon {
    background: rgba(22, 163, 74, 0.12);
}
@media (max-width: 768px) {
    .landing-steps {
        grid-template-columns: 1fr;
    }
}

.landing-lookup-card {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}
.landing-lookup-card .form {
    margin: 0 auto;
    text-align: left;
}
/* Icon sits inline next to the heading rather than stacked above it (as
   the 3-step cards' icons are) — keeps this card compact since it's the
   first thing a returning buyer sees, right after the hero. */
.landing-lookup-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.landing-lookup-header h2 {
    margin: 0;
}
.landing-lookup-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    font-size: 1.05rem;
    flex-shrink: 0;
}
.landing-lookup-input {
    border-color: rgba(13, 148, 136, 0.35) !important;
    background: rgba(13, 148, 136, 0.05) !important;
}
.landing-lookup-input::placeholder {
    color: #0d9488;
    font-weight: 600;
    opacity: 0.85;
}
.landing-lookup-input:focus {
    border-color: #0d9488 !important;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}
.btn-accent {
    background: #0d9488;
}
.btn-accent:hover {
    background: #0f766e;
}
.lottery-gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 420px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--color-surface-alt);
}
.lottery-gallery-track {
    display: flex;
    height: 100%;
    transition: transform 0.45s ease;
}
.lottery-gallery-slide {
    flex: 0 0 100%;
    height: 100%;
}
.lottery-gallery-slide img,
.lottery-gallery-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lottery-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.5);
    color: #fff;
    border: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
}
.lottery-gallery-arrow:hover {
    background: rgba(15, 23, 42, 0.8);
    transform: translateY(-50%) scale(1.08);
}
.lottery-gallery-prev {
    left: 0.75rem;
}
.lottery-gallery-next {
    right: 0.75rem;
}
.lottery-gallery-dots {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
}
.lottery-gallery-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}
.lottery-gallery-dot.active {
    background: #fff;
    transform: scale(1.3);
}

.bank-accounts-list-wrap {
    margin-bottom: 1.25rem;
}
.bank-accounts-heading {
    margin: 0 0 0.6rem;
    font-size: 1rem;
}
.bank-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.bank-account-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
}
.bank-account-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.bank-account-bank-name {
    font-size: 1rem;
    font-weight: 700;
}
.bank-account-holder {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.bank-account-number-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.bank-account-number {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-primary);
}
@media (max-width: 480px) {
    .bank-account-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

.media-gallery-manager {
    margin-top: 0.75rem;
}
.media-gallery-manager-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.media-gallery-manager-item {
    width: 120px;
    text-align: center;
}
.media-gallery-manager-item img,
.media-gallery-manager-item video {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    display: block;
}
.media-gallery-manager-item form {
    margin-top: 0.25rem;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}
.countdown-unit {
    background: var(--color-surface-alt);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    min-width: 80px;
    text-align: center;
}
.countdown-unit .value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
}
.countdown-unit .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}
.countdown-closed {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-danger);
    margin: 1.5rem 0;
}
.countdown-ethiopian {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: -0.5rem 0 1.5rem;
}

.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 0.7rem 1.4rem;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover {
    background: var(--color-primary-hover);
    text-decoration: none;
}
.btn:disabled,
.btn.disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
}
.chat-composer-send {
    border-radius: 50%;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.btn-danger {
    background: var(--color-danger);
}
.btn-success {
    background: var(--color-success);
}
.btn-secondary {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

/* The "Get updates via Telegram" button on a buyer's ticket status page
   (app/templates/public/status.html) — Telegram's own brand blue plus a
   gentle pulsing glow to draw the eye to it as an action worth taking,
   since it's easy to miss next to the plain status text around it. */
.btn-telegram {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #2aabee, #229ed9);
    font-weight: 600;
    animation: btn-telegram-pulse 2.2s ease-out infinite;
}
.btn-telegram:hover {
    background: linear-gradient(135deg, #229ed9, #1e8ec2);
}
.btn-telegram svg {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}
@keyframes btn-telegram-pulse {
    0% { box-shadow: 0 0 0 0 rgba(42, 171, 238, 0.55); }
    70% { box-shadow: 0 0 0 12px rgba(42, 171, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(42, 171, 238, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-telegram {
        animation: none;
    }
}

.link-button {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    padding: 0;
    font-size: inherit;
    text-decoration: underline;
}

form.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 520px;
}
.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
/* Two fields side by side on one line instead of each taking a full row —
   used on the registration detail page's buyer-details section to keep it
   compact. Falls back to stacked on narrow screens. */
.form-row-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1.25rem;
}
@media (max-width: 480px) {
    .form-row-pair {
        grid-template-columns: 1fr;
    }
}
.form-row label {
    font-weight: 600;
    font-size: 0.9rem;
}
.required-marker {
    color: var(--color-danger);
    font-weight: 700;
}
.phone-input-group {
    display: flex;
    gap: 0.5rem;
}
#bank-account-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.bank-account-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.bank-account-row input {
    flex: 1 1 160px;
    min-width: 0;
}
@media (max-width: 600px) {
    .bank-account-row {
        flex-direction: column;
        align-items: stretch;
    }
}
.phone-code-input {
    width: 3.75rem;
    flex: 0 0 auto;
    text-align: center;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    font-size: 0.9rem;
}
.phone-local-input {
    flex: 1;
    min-width: 0;
}
.form-row input,
.form-row textarea,
.form-row select {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    color: var(--color-text);
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.form-row input.touched:invalid {
    border-color: var(--color-danger);
}
.form-row input.touched:valid {
    border-color: var(--color-success);
}
.form-row .hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
/* The Telegram webhook URL hint (a full https://.../telegram/webhook/<uuid>
   string with nowhere to break) would otherwise overflow past its card's
   right edge instead of wrapping — this lets it break anywhere it needs to. */
.form-row .hint code {
    overflow-wrap: anywhere;
}
.inline-form {
    display: inline;
}

.form-section {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
/* Lottery form cards get a subtle lift on hover, same treatment as
   .review-card's sections, so the panel the admin is about to work in
   reads as an obvious, clickable surface rather than flat text blocks. */
.lottery-form .form-section {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.lottery-form .form-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
/* Lottery form: the smaller field groups (bank accounts / schedule /
   capacity / Telegram) sit two-up instead of stacking full-width — full-
   width single-topic panels read as oversized once there's only 3-6 short
   fields inside. */
.form-section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
}
@media (max-width: 700px) {
    .form-section-grid {
        grid-template-columns: 1fr;
    }
}
.form-section-primary { border-top-color: var(--color-primary); }
.form-section-primary .form-section-icon { background: rgba(79, 70, 229, 0.12); }
.form-section-teal { border-top-color: #0d9488; }
.form-section-teal .form-section-icon { background: rgba(13, 148, 136, 0.12); }
.form-section-warning { border-top-color: var(--color-warning); }
.form-section-warning .form-section-icon { background: rgba(217, 119, 6, 0.12); }
.form-section-success { border-top-color: var(--color-success); }
.form-section-success .form-section-icon { background: rgba(22, 163, 74, 0.12); }
.form-section-telegram { border-top-color: #2aabee; }
.form-section-telegram .form-section-icon { background: rgba(42, 171, 238, 0.12); }
/* .review-card stacks the buyer-details and extracted-fields sections
   directly as siblings with no gap of their own — add space between them. */
.review-card .form-section + .form-section {
    margin-top: 1.25rem;
}
.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.05rem;
    margin: 0;
}
.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}
.form-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.12);
    font-size: 1rem;
    flex-shrink: 0;
}

/* Toggle-style checkbox row (lottery form's "featured" / "let buyers pick
   their own number" switches) — a full clickable row instead of a bare
   checkbox, so the whole label is an obvious click target. */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    cursor: pointer;
    font-weight: 500;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.toggle-row:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.06);
}
.toggle-row input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--color-primary);
}

/* Shareable-link card at the top of the lottery edit page. */
.lottery-share-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}
.lottery-share-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
    min-width: 0;
}
.lottery-share-card-body label {
    font-weight: 600;
    font-size: 0.85rem;
}
.lottery-share-card-body code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.lottery-share-card-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.btn-submit {
    font-size: 1.05rem;
    padding: 0.9rem 1.4rem;
    font-weight: 600;
}

.alert {
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.alert-error {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid var(--color-danger);
    color: #991b1b;
}
.alert-success {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid var(--color-success);
    color: #166534;
}
.alert-warning {
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid var(--color-warning);
    color: #92400e;
}
.alert-info {
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid var(--color-primary);
    color: var(--color-primary-hover);
}
.alert-info a {
    color: inherit;
    font-weight: 600;
}
.alert-notices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.alert-notices .alert {
    margin-bottom: 0;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.filter-field label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}
.filter-field input,
.filter-field select,
.select-control {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    color: var(--color-text);
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.filter-field input:focus,
.filter-field select:focus,
.select-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.filter-search {
    flex: 1 1 240px;
}
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: normal;
    white-space: nowrap;
    padding-bottom: 0.5rem;
}
.filter-checkbox input {
    width: 1.05rem;
    height: 1.05rem;
}
.filter-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    padding-bottom: 0.35rem;
}
.filter-count {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.filter-clear-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.filter-clear-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}
.filter-row-hidden {
    display: none;
}
.filter-no-matches {
    display: none;
    padding: 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
}
.filter-no-matches.filter-no-matches-visible {
    display: block;
}

.filter-pagination {
    display: none;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 1rem 0;
}
.filter-pagination.filter-pagination-visible {
    display: flex;
}
.filter-pagination .page-btn,
.filter-pagination .page-nav-btn {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 2.1rem;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.filter-pagination .page-btn:hover,
.filter-pagination .page-nav-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    color: var(--color-text);
}
.filter-pagination .page-btn-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    cursor: default;
}
.filter-pagination .page-nav-btn:disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
    opacity: 0.5;
}
.filter-pagination .page-ellipsis {
    color: var(--color-text-muted);
    padding: 0 0.15rem;
}

/* Translations review page (platform/translations.html) — one editable
   input per row; see translations-edit.js for the .is-edited highlight. */
.translation-key {
    font-size: 0.82rem;
    white-space: nowrap;
}
.translation-input {
    width: 100%;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    font-size: 0.88rem;
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.translation-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
.translation-input.is-edited {
    border-color: var(--color-warning);
    background: rgba(217, 119, 6, 0.06);
}
.translations-save-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    position: sticky;
    bottom: 1rem;
}
.translations-changed-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-warning);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
th, td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
th {
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    background: var(--color-surface-alt);
}
tbody tr:nth-child(even) {
    background: var(--color-surface-alt);
}
tbody tr {
    transition: background 0.12s ease;
}
tbody tr:hover {
    background: rgba(79, 70, 229, 0.06) !important;
}
/* These review/audit queues stay dense tables rather than card grids (many
   columns need to stay scannable side by side), so the "beautiful and
   interactive" pass here is table polish — a sticky header, a hover cue,
   and a card-like frame — instead of a layout change. */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}
.table-wrap table {
    margin: 0;
}
.table-wrap th:first-child, .table-wrap td:first-child {
    padding-left: 1rem;
}
.table-wrap th:last-child, .table-wrap td:last-child {
    padding-right: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-pending { background: rgba(245, 158, 11, 0.2); color: var(--color-warning); }
.badge-confirmed { background: rgba(34, 197, 94, 0.2); color: var(--color-success); }
.badge-rejected { background: rgba(239, 68, 68, 0.2); color: var(--color-danger); }
.badge-open { background: rgba(34, 197, 94, 0.2); color: var(--color-success); }
.badge-draft { background: rgba(148, 163, 184, 0.2); color: var(--color-text-muted); }
.badge-closed { background: rgba(239, 68, 68, 0.2); color: var(--color-danger); }
.badge-archived { background: rgba(148, 163, 184, 0.2); color: var(--color-text-muted); }
.badge-email-sent { background: rgba(34, 197, 94, 0.2); color: var(--color-success); }
.badge-email-failed { background: rgba(239, 68, 68, 0.2); color: var(--color-danger); }
.badge-flagged { background: rgba(245, 158, 11, 0.2); color: var(--color-warning); }
.badge-qr-ok { background: rgba(34, 197, 94, 0.2); color: var(--color-success); }
.badge-qr-missing { background: rgba(239, 68, 68, 0.2); color: var(--color-danger); }
.badge-telegram-outbound { background: rgba(34, 197, 94, 0.2); color: var(--color-success); }
.badge-telegram-inbound { background: rgba(148, 163, 184, 0.2); color: var(--color-text-muted); }
.badge-active { background: rgba(34, 197, 94, 0.2); color: var(--color-success); }
.badge-disabled { background: rgba(148, 163, 184, 0.2); color: var(--color-text-muted); }
.badge-role-superadmin { background: rgba(217, 119, 6, 0.15); color: var(--color-warning); }
.badge-role-admin { background: rgba(79, 70, 229, 0.15); color: var(--color-primary); }
.badge-role-staff { background: rgba(13, 148, 136, 0.15); color: #0d9488; }

/* Card-grid list pages (admin/lotteries, admin/users, platform/companies,
   platform/admins) — a shared "entity card" component swapped in for the
   old plain <table> so these top-level entity lists feel less like a
   spreadsheet and more like a dashboard, with hover lift + a color-coded
   top border per status/role. */
.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.entity-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.entity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1);
    border-color: var(--color-primary);
}
.entity-card-banner {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    background-size: cover;
    background-position: center;
    font-size: 2.25rem;
    position: relative;
    flex-shrink: 0;
}
.entity-card-banner-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.entity-card-body {
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1;
}
.entity-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}
.entity-card-heading {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}
.entity-card-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.12);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
    flex-shrink: 0;
    overflow: hidden;
}
.entity-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.entity-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.entity-card-subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.entity-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}
.entity-card-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
}
.entity-card-progress-row strong {
    color: var(--color-text);
    font-weight: 700;
}
.entity-card-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--color-surface-alt);
    overflow: hidden;
}
.entity-card-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.entity-card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.9rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    margin-top: auto;
}
.entity-card-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 2.5rem 1rem;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--color-primary);
    text-decoration: none;
}
.icon-btn-primary {
    color: var(--color-primary);
}
.icon-btn-danger:hover {
    background: rgba(220, 38, 38, 0.1);
    color: var(--color-danger);
}

/* Lottery cards: top border + banner emoji track the lottery's own status
   badge colors so the card reads correctly at a glance without needing to
   read the badge text. */
.lottery-card.status-open { border-top-color: var(--color-success); }
.lottery-card.status-draft { border-top-color: var(--color-text-muted); }
.lottery-card.status-closed { border-top-color: var(--color-danger); }
.lottery-card.status-archived { border-top-color: var(--color-text-muted); }

/* User/admin cards: top border tracks role instead of status. */
.entity-card.role-superadmin { border-top-color: var(--color-warning); }
.entity-card.role-admin { border-top-color: var(--color-primary); }
.entity-card.role-staff { border-top-color: #0d9488; }
.entity-card.is-current { border-top-color: var(--color-primary); }

@media (max-width: 480px) {
    .entity-grid {
        grid-template-columns: 1fr;
    }
}

tr.row-flagged {
    background: rgba(245, 158, 11, 0.12) !important;
}
tr.row-flagged:hover {
    background: rgba(245, 158, 11, 0.2) !important;
}

tr.row-unread {
    background: rgba(79, 70, 229, 0.08) !important;
    font-weight: 600;
}
tr.row-unread:hover {
    background: rgba(79, 70, 229, 0.16) !important;
}
.unread-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--color-primary);
    margin-right: 0.4rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}
.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}
.stat-card .stat-label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.stat-card-icon {
    position: absolute;
    top: 1rem;
    right: 1.1rem;
    font-size: 1.4rem;
    opacity: 0.4;
}
/* Semantic color accents — reused across the admin dashboard and the
   reconciliation/status-import result summaries so "matched" is always
   green, "errors" always red, etc. regardless of which page it's on. */
.stat-card-primary { border-top-color: var(--color-primary); }
.stat-card-primary .stat-value { color: var(--color-primary); }
.stat-card-success { border-top-color: var(--color-success); }
.stat-card-success .stat-value { color: var(--color-success); }
.stat-card-warning { border-top-color: var(--color-warning); }
.stat-card-warning .stat-value { color: var(--color-warning); }
.stat-card-danger { border-top-color: var(--color-danger); }
.stat-card-danger .stat-value { color: var(--color-danger); }
.stat-card-teal { border-top-color: #0d9488; }
.stat-card-teal .stat-value { color: #0d9488; }
.stat-card-muted { border-top-color: var(--color-text-muted); }

.result-list {
    list-style: none;
    margin: 0.6rem 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.result-list li {
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    background: var(--color-surface-alt);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Lottery multi-select on the "all receipts" page — pill-style toggle chips
   instead of plain checkboxes, so an active filter is visible at a glance. */
.lottery-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lottery-chip:hover {
    border-color: var(--color-primary);
}
.lottery-chip:has(input:checked) {
    background: rgba(79, 70, 229, 0.12);
    border-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}
.lottery-chip input {
    accent-color: var(--color-primary);
}

.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
    margin: 1rem 0;
}
.ticket-card {
    position: relative;
    background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 0.9rem 0.85rem;
    text-align: center;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ticket-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    border-color: var(--color-primary);
}
.ticket-card[data-status="confirmed"] { border-top-color: var(--color-success); }
.ticket-card[data-status="pending"] { border-top-color: var(--color-warning); }
.ticket-card[data-status="rejected"] { border-top-color: var(--color-danger); }
.ticket-card .ticket-card-number {
    font-family: var(--font-mono, monospace);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.ticket-card .ticket-card-full {
    margin-top: 0.15rem;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    word-break: break-all;
}
.ticket-card .ticket-card-buyer {
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ticket-card .badge {
    margin-top: 0.5rem;
}
.ticket-card .ticket-card-winner-badge {
    display: none;
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
    animation: ticket-card-pop 0.25s ease;
}
.ticket-card.is-winner {
    border-color: var(--color-warning);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35), 0 8px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}
.ticket-card.is-winner .ticket-card-winner-badge {
    display: block;
}
@keyframes ticket-card-pop {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* The draw/spinner page benefits from real screen space (a big ticket
   grid on one side, a big spinner on the other) — the logged-in shell's
   .app-content normally caps out at 1400px and centers itself in
   whatever room .app-main has next to the sidebar (see .app-shell); this
   lifts that cap so the draw page fills all of that remaining width
   instead. Scoped with :has() so no other admin/staff page is affected,
   and never touches viewport units directly — .app-main already sits
   correctly beside the sidebar via flex, so there's no risk of sliding
   under it the way a 100vw-based trick would. */
.app-content:has(.draw-page-fullwidth) {
    max-width: none;
}

.draw-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
    gap: 2rem;
    align-items: start;
}
.draw-main {
    min-width: 0;
}
@media (max-width: 900px) {
    .draw-layout {
        grid-template-columns: 1fr;
    }
}

.spinner-panel {
    background: linear-gradient(160deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    position: sticky;
    top: 1rem;
}
.spinner-panel h2 {
    margin: 0 0 0.25rem;
    font-size: 1.4rem;
}
.spinner-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.1rem 0;
}
.spinner-controls input[type="number"] {
    width: 4.5rem;
}

/* Six independent "reel" windows, one per digit of the winning ticket —
   each cycles its own random digits and locks in turn (see
   static/js/ticket-spinner.js), left to right, with a longer delay on
   each one so the suspense builds as more digits are revealed. */
.spinner-display {
    display: flex;
    justify-content: center;
}
.spinner-reels {
    display: flex;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    border-radius: var(--radius);
    background: #0f172a;
    box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.35);
}
.spinner-digit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 4.6rem;
    border-radius: 10px;
    border: 2px solid #334155;
    background: #1e293b;
    font-family: var(--font-mono, monospace);
    font-size: 2.8rem;
    font-weight: 700;
    color: #e2e8f0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
@media (max-width: 480px) {
    .spinner-digit {
        width: 2.3rem;
        height: 3.4rem;
        font-size: 2.1rem;
    }
}
.spinner-digit.is-spinning {
    border-color: var(--color-primary);
    animation: spinner-digit-roll 0.12s ease-in-out;
}
.spinner-digit.is-locked {
    border-color: var(--color-warning);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
    animation: spinner-digit-lock 0.35s ease;
}
@keyframes spinner-digit-roll {
    0% { transform: translateY(-40%); opacity: 0.3; }
    100% { transform: translateY(0); opacity: 1; }
}
@keyframes spinner-digit-lock {
    0% { transform: scale(1.3); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}
.spinner-status {
    min-height: 1.2rem;
    color: var(--color-warning);
    font-size: 0.85rem;
}
.spinner-winners {
    text-align: left;
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.spinner-winner-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    border-left: 4px solid var(--color-warning);
    background: linear-gradient(100deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.03));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    animation: ticket-card-pop 0.35s ease;
}
.spinner-winner-badge {
    flex-shrink: 0;
    background: var(--color-warning);
    color: #1e1000;
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    white-space: nowrap;
}
.spinner-winner-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.spinner-winner-ticket {
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spinner-winner-buyer {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Full-screen reveal shown the instant a winner's reels finish locking
   (see showWinnerOverlay in static/js/ticket-spinner.js). Dismissing it
   (click/tap, Enter/Escape, or an auto-timeout) is what lets the draw
   move on to the next lot. */
.spinner-winner-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(8, 8, 12, 0.94);
    cursor: pointer;
    animation: spinner-overlay-fade-in 0.25s ease;
}
.spinner-winner-overlay[hidden] {
    display: none;
}
.spinner-overlay-fireworks {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.spinner-winner-overlay-card {
    position: relative;
    z-index: 1;
    max-width: 92vw;
    text-align: center;
}
.spinner-winner-overlay-badge {
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 0.4rem 1.3rem;
    border-radius: 999px;
    background: var(--color-warning);
    color: #1e1000;
    font-weight: 700;
    font-size: clamp(1rem, 3vw, 1.6rem);
}
.spinner-winner-overlay-ticket {
    font-family: var(--font-mono, monospace);
    font-weight: 800;
    font-size: clamp(2.5rem, 10vw, 7rem);
    line-height: 1.1;
    letter-spacing: 0.04em;
    color: #fff;
    word-break: break-word;
    animation: spinner-overlay-pop 0.4s ease;
}
.spinner-winner-overlay-buyer {
    margin-top: 1.25rem;
    font-weight: 700;
    font-size: clamp(1.5rem, 6vw, 3.5rem);
    color: var(--color-warning);
    word-break: break-word;
}
.spinner-winner-overlay-hint {
    margin-top: 2.5rem;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
}
@keyframes spinner-overlay-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes spinner-overlay-pop {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.receipt-preview img,
.receipt-preview embed {
    max-width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}


.number-section {
    text-align: center;
    align-items: center;
}
.number-section .hint {
    text-align: center;
}

.number-picker {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 0.25rem 0;
}
.digit-reel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.digit-btn {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    border-radius: 6px;
    width: 2.4rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.digit-btn:hover {
    background: var(--color-primary);
    color: #fff;
}
.digit-btn:active {
    transform: scale(0.9);
}
.digit-select {
    width: 2.6rem;
    height: 3.2rem;
    text-align: center;
    text-align-last: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, var(--color-surface-alt), var(--color-surface));
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0;
}
.digit-select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
.digit-select:disabled {
    cursor: not-allowed;
}
@keyframes digit-bump {
    0% { transform: translateY(-8px) scale(1.1); opacity: 0.5; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.digit-bump {
    animation: digit-bump 0.18s ease-out;
}
.randomize-btn {
    font-size: 0.85rem;
    padding: 0.45rem 0.9rem;
}
.hint-success {
    color: var(--color-success);
}
.hint-error {
    color: var(--color-danger);
}
.number-picker-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.ticket-preview {
    display: inline-flex;
    align-items: baseline;
    gap: 0.15rem;
    background: var(--color-surface-alt);
    border: 1px dashed var(--color-primary);
    border-radius: var(--radius);
    padding: 0.6rem 1.1rem;
    font-size: 1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}
.ticket-preview-code {
    color: var(--color-text-muted);
}
#ticket-preview-value {
    color: var(--color-primary);
}

@media (max-width: 480px) {
    .digit-select {
        width: 2.2rem;
        height: 2.8rem;
        font-size: 1.35rem;
    }
    .digit-btn {
        width: 2.1rem;
    }
}

.ticket-box {
    text-align: center;
    padding: 2rem;
}
.ticket-number {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin: 1rem 0;
}

@media (max-width: 640px) {
    .header-inner nav {
        gap: 0.6rem;
        font-size: 0.9rem;
    }
    .countdown-unit {
        min-width: 65px;
        padding: 0.75rem;
    }
    .countdown-unit .value {
        font-size: 1.4rem;
    }
}

/* Analytics dashboard (platform/analytics.html) — stat tiles, ranked bar
   lists, and inline-SVG line charts. No JS charting library anywhere else in
   this codebase, so charts are plain server-rendered SVG/HTML rather than a
   new client-side dependency. */
.analytics-section {
    margin-bottom: 2rem;
}
.analytics-section h2 {
    margin-bottom: 0.25rem;
}
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.stat-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}
.stat-tile-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--color-text);
}
.stat-tile-value.stat-warning { color: var(--color-warning); }
.stat-tile-value.stat-success { color: var(--color-success); }
.stat-tile-value.stat-danger { color: var(--color-danger); }
.stat-tile-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.chart-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}
.chart-svg .chart-line {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.chart-svg .chart-gridline {
    stroke: var(--color-border);
    stroke-width: 1;
}
.chart-svg .chart-point {
    fill: var(--color-primary);
    stroke: var(--color-surface);
    stroke-width: 2;
}
.chart-svg .chart-axis-label {
    fill: var(--color-text-muted);
    font-size: 10px;
}
.chart-data-table {
    margin-top: 0.75rem;
}
.chart-data-table summary {
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.bar-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}
.bar-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3fr auto;
    align-items: center;
    gap: 0.75rem;
}
.bar-list-label {
    font-size: 0.85rem;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bar-list-track {
    background: var(--color-surface-alt);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}
.bar-list-fill {
    background: var(--color-primary);
    height: 100%;
    border-radius: 999px;
}
.bar-list-value {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 2.5ch;
    text-align: right;
}
