:root {
    /* Palette from lotrecoffee.com */
    --green: #1F4D3A;
    --green-dark: #153528;
    --green-light: #2A6B52;
    --orange: #C75B2B;
    --orange-dark: #A64820;
    /* Lighter orange for text on green (the brand orange is too dark to read there). */
    --orange-light: #F0A27A;
    --cream: #F5EDE4;
    --cream-deep: #E8DDD0;
    --ink: #2A2420;
    --ink-muted: #6B5E54;
    /* The website uses near-square corners. */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Outfit', system-ui, sans-serif;
}

* { box-sizing: border-box; }

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gentleGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(199, 91, 43, 0.5); }
    50% { box-shadow: 0 0 0 10px rgba(199, 91, 43, 0); }
}

@keyframes reticlePulse {
    0%, 100% { border-color: rgba(245, 237, 228, 0.75); }
    50% { border-color: rgba(245, 237, 228, 0.35); }
}

@keyframes countPop {
    0% { transform: scale(0.7); opacity: 0.3; }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--green-dark);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 48px;
}

.topbar {
    --page-max: 420px;
    /* Full-bleed bar (cancels body padding); inner content lines up with the page column. */
    width: calc(100% + 32px);
    margin: -24px -16px 22px;
    padding: max(10px, env(safe-area-inset-top)) max(16px, calc((100% + 32px - var(--page-max)) / 2)) 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--green);
    border-bottom: 4px solid var(--orange);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--cream);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
}

.brand em { font-style: normal; color: var(--orange-light); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Lock button (staff + admin): turns red on hover. */
.lock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(245, 237, 228, 0.12);
    color: var(--cream);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.lock-btn[hidden] { display: none; }

.lock-btn:hover,
.lock-btn:focus-visible {
    background: #c0392b;
    color: #fff;
    outline: none;
}

.settings-btn:hover,
.settings-btn:focus-visible {
    background: var(--orange);
    color: #fff;
}

.card {
    width: 100%;
    max-width: 420px;
    background: var(--green);
    color: var(--cream);
    border-radius: var(--radius-lg);
    padding: 28px 24px 32px;
    box-shadow: 0 20px 44px rgba(20, 45, 34, 0.22);
    animation: fadeSlideUp 0.5s ease both;
}

.kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--orange-light);
    margin: 0 0 8px;
}

.title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 6vw, 2.1rem);
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.15;
}

.lead {
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(245, 237, 228, 0.85);
    margin: 0 0 22px;
}

.stamps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.stamp {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid rgba(245, 237, 228, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(245, 237, 228, 0.45);
    background: rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.stamp.is-filled {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--cream);
}

.stamp.is-new {
    animation: stampPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 0 6px rgba(199, 91, 43, 0.25);
}

@keyframes stampPop {
    0% { transform: scale(0.4) rotate(-8deg); }
    55% { transform: scale(1.2) rotate(4deg); }
    100% { transform: scale(1) rotate(0); }
}

.qr-wrap {
    display: flex;
    justify-content: center;
    margin: 0 auto 16px;
    padding: 14px;
    background: #fff;
    border-radius: var(--radius);
    width: fit-content;
}

.qr-wrap img {
    display: block;
    width: 180px;
    height: 180px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.qr-wrap img.is-loaded {
    opacity: 1;
}

.code {
    font-family: var(--font-body);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-align: center;
    margin: 6px 0 2px;
}

.code-label {
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(245, 237, 228, 0.6);
    margin: 0 0 18px;
}

.note {
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(245, 237, 228, 0.68);
    text-align: center;
    margin: 0;
}

.status {
    margin-top: 16px;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1.4em;
    font-weight: 600;
    transition: opacity 0.25s ease;
}

.status:empty {
    opacity: 0;
}

.status.is-ok { color: #b8e6c8; }
.status.is-error { color: #ffb4a8; }

/* Same messages when they sit on the cream page instead of a green card. */
.scan-shell > .status.is-error,
.admin-main > .status.is-error { color: #A8321F; }

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.2s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20, 45, 34, 0.18); }
.btn:active:not(:disabled) { transform: scale(0.97) translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-orange {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

.btn-orange:hover:not(:disabled) { background: var(--orange-dark); border-color: var(--orange-dark); }

.btn-outline {
    background: transparent;
    border-color: rgba(245, 237, 228, 0.4);
    color: var(--cream);
}

.btn-ghost {
    background: transparent;
    border-color: rgba(31, 77, 58, 0.25);
    color: var(--green);
}

.ready-banner {
    display: none;
    background: var(--orange);
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
}

.ready-banner.show {
    display: block;
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both, gentleGlow 2s ease-in-out 0.4s 3;
}

/* ── Staff scanner page ── */

.scan-shell {
    width: 100%;
    max-width: 420px;
}

.scan-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0c1c15;
    box-shadow: 0 20px 44px rgba(20, 45, 34, 0.22);
}

.scan-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-reticle {
    position: absolute;
    /* Extra room at the bottom for the hint text. */
    inset: 9% 12% 19%;
    border: 3px solid rgba(245, 237, 228, 0.75);
    border-radius: var(--radius-lg);
    pointer-events: none;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
    animation: reticlePulse 2s ease-in-out infinite;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.scan-reticle.is-hit {
    border-color: var(--orange);
    animation: none;
    transform: scale(1.03);
}

.scan-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    /* Fills the band under the reticle, centred, so wrapped text never touches it. */
    height: 19%;
    margin: 0;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    color: var(--cream);
    font-size: clamp(0.72rem, 3.4vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.result-panel {
    margin-top: 18px;
    background: var(--green);
    color: var(--cream);
    border-radius: var(--radius-lg);
    padding: 22px;
    text-align: center;
    animation: fadeSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.result-code {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 6px;
}

.result-count {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--orange-light);
    line-height: 1;
    margin: 8px 0;
}

.result-count.is-updated span {
    display: inline-block;
    animation: countPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pin-gate {
    width: 100%;
    max-width: 420px;
    background: var(--green);
    color: var(--cream);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
}

.pin-gate input {
    width: 100%;
    text-align: center;
    font-size: 1.4rem;
    letter-spacing: 0.4em;
    padding: 14px;
    margin: 18px 0;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(245, 237, 228, 0.3);
    background: rgba(0, 0, 0, 0.15);
    color: var(--cream);
}

.pin-gate input:focus { outline: none; border-color: var(--orange); }

.manual-toggle {
    text-align: center;
    margin-top: 14px;
}

.manual-toggle button:not(.btn) {
    background: none;
    border: none;
    color: var(--green);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.manual-toggle .btn {
    width: 100%;
    border-color: rgba(31, 77, 58, 0.45);
}

.manual-form {
    display: none;
    margin-top: 14px;
    gap: 10px;
}

.manual-form.show { display: flex; }

.manual-form .btn { flex-shrink: 0; }

.manual-form input {
    flex: 1;
    /* Inputs won't shrink below their default width without this. */
    min-width: 0;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(31, 77, 58, 0.2);
    font-size: 1rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-family: var(--font-body);
}

.staff-log {
    width: 100%;
    max-width: 420px;
    margin-top: 18px;
}

.staff-log h2 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(27, 27, 24, 0.55);
    margin: 0 0 8px;
}

.staff-log ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.staff-log li {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.82rem;
    display: flex;
    justify-content: space-between;
    color: rgba(27, 27, 24, 0.75);
}

/* ── Add-to-Home-Screen nudge ── */

.install-banner {
    display: none;
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--orange);
    color: #fff;
    border-radius: var(--radius);
    padding: 16px 36px 16px 18px;
    margin-bottom: 16px;
    text-align: left;
}

.install-banner.show {
    display: block;
    animation: slideDown 0.4s ease both;
}

.install-banner p {
    margin: 0 0 10px;
    font-size: 0.85rem;
    line-height: 1.45;
    font-weight: 600;
}

.install-banner .btn {
    width: 100%;
    background: #fff;
    color: var(--orange);
    padding: 10px 16px;
    font-size: 0.85rem;
}

.install-banner-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    padding: 4px;
}

.install-banner-close:hover {
    opacity: 1;
}

/* ── Add-to-Home-Screen steps sheet (iPhone / no install prompt) ── */

.install-sheet {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(22, 40, 32, 0.55);
}

.install-sheet[hidden] {
    display: none;
}

.install-sheet-card {
    width: 100%;
    max-width: 420px;
    background: var(--cream);
    color: var(--green-dark);
    border-radius: var(--radius-lg);
    padding: 22px 20px 18px;
    box-shadow: 0 20px 44px rgba(20, 45, 34, 0.28);
    animation: slideDown 0.28s ease both;
    position: relative;
}

.install-sheet-card .kicker { margin-bottom: 4px; }

.install-sheet-card h2 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.2;
}

.install-sheet-lead {
    margin: 0 0 14px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.install-sheet ol {
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.install-sheet li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 600;
}

.install-sheet li span {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green);
    color: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.install-sheet .btn { width: 100%; }

.install-sheet-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--green);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

/* ── Admin panel ─────────────────────────────────────────── */

body.admin .topbar { --page-max: 1100px; }

.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 30, 22, 0.55);
    animation: fadeIn 0.2s ease both;
}

.settings-modal[hidden] { display: none; }

.settings-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 26px 24px 24px;
    border-radius: var(--radius-lg);
    background: #fffaf3;
    color: var(--green-dark);
    box-shadow: 0 24px 60px rgba(10, 30, 20, 0.3);
}

.settings-card h2 {
    margin: 0 40px 6px 0;
    font-family: var(--font-display);
    color: var(--green);
}

.settings-help {
    margin: 0 0 18px;
    color: rgba(22, 56, 40, 0.7);
    font-size: 0.88rem;
    line-height: 1.45;
}

.settings-choice {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.settings-choice[hidden],
.settings-card form[hidden] { display: none; }

.settings-card form { margin-top: 18px; }

.settings-card label {
    display: block;
    margin: 12px 0 5px;
    font-size: 0.82rem;
    font-weight: 700;
}

.settings-card input {
    width: 100%;
    padding: 11px 13px;
    border: 2px solid rgba(31, 77, 58, 0.15);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--green-dark);
    font: inherit;
    font-variant-numeric: tabular-nums;
}

.settings-card input:focus {
    outline: none;
    border-color: var(--orange);
}

.settings-card .status.is-ok { color: var(--green); }
.settings-card .status.is-error { color: #A8321F; }
.settings-card .btn { width: 100%; }

.settings-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}


.admin-main {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-main[hidden] { display: none; }

.admin-section {
    background: #fffaf3;
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    box-shadow: 0 10px 30px rgba(20, 45, 34, 0.08);
    animation: fadeSlideUp 0.4s ease both;
}

.admin-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-section-head h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin: 0;
    color: var(--green);
}

.range-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    background: rgba(31, 77, 58, 0.08);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.range-tabs button {
    border: 0;
    background: transparent;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--green);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.range-tabs button[aria-selected="true"] {
    background: var(--green);
    color: var(--cream);
}

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

.stat-tile {
    background: var(--cream);
    border-radius: var(--radius);
    padding: 14px 16px;
}

.stat-label {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(22, 56, 40, 0.7);
}

.stat-value {
    margin: 4px 0 2px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--green-dark);
    font-variant-numeric: tabular-nums;
}

.stat-sub {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(22, 56, 40, 0.6);
}

.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.chart { margin: 0; min-width: 0; }

.chart figcaption {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: 6px;
}

.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: rgba(22, 56, 40, 0.1); stroke-width: 1; }
.chart .axis { stroke: rgba(22, 56, 40, 0.35); stroke-width: 1; }
.chart .tick { fill: rgba(22, 56, 40, 0.6); font-size: 11px; font-family: var(--font-body); }
.chart .bar { fill: var(--green-light); transition: fill 0.12s ease; }
.chart .bar.is-active { fill: var(--orange); }
.chart .hit { fill: transparent; cursor: pointer; }

.chart-tooltip {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    background: var(--green-dark);
    color: var(--cream);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.chart-tooltip[hidden] { display: none; }

.admin-search {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(31, 77, 58, 0.15);
    background: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--green-dark);
    margin-bottom: 12px;
}

.admin-search:focus { outline: none; border-color: var(--orange); }

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    white-space: nowrap;
}

.admin-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(22, 56, 40, 0.6);
    padding: 8px 10px;
    border-bottom: 1px solid rgba(22, 56, 40, 0.12);
}

.admin-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(22, 56, 40, 0.07);
    color: var(--green-dark);
}

.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .mono { font-family: ui-monospace, monospace; letter-spacing: 0.04em; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr:hover,
.admin-table tbody tr:focus { background: rgba(199, 91, 43, 0.08); outline: none; }

.who { display: flex; align-items: center; gap: 10px; }
.who-name { font-weight: 600; }
.who-email { font-size: 0.78rem; color: rgba(22, 56, 40, 0.6); }

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.avatar-blank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cream-deep);
    color: var(--green);
    font-weight: 700;
}

.identity-cell { white-space: nowrap; }

.identity-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.identity-registered { background: rgba(31, 77, 58, 0.12); color: var(--green); }
.identity-google { background: rgba(66, 133, 244, 0.12); color: #1a56a8; }
.identity-both { background: rgba(199, 91, 43, 0.14); color: var(--orange-dark); }
.identity-anonymous { background: rgba(22, 56, 40, 0.08); color: rgba(22, 56, 40, 0.62); }

.admin-empty {
    text-align: center;
    color: rgba(22, 56, 40, 0.6);
    margin: 18px 0 4px;
}

.admin-drawer {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(15, 30, 22, 0.45);
    display: flex;
    justify-content: flex-end;
    animation: fadeIn 0.2s ease both;
}

.admin-drawer[hidden] { display: none; }

.admin-drawer-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100%;
    overflow-y: auto;
    background: #fffaf3;
    padding: 28px 22px;
    color: var(--green-dark);
}

.admin-drawer-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(31, 77, 58, 0.08);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--green);
    cursor: pointer;
}

.drawer-profile { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-right: 40px; }
.drawer-profile img { width: 56px; height: 56px; border-radius: 50%; }
.drawer-profile h2 { font-family: var(--font-display); margin: 0; font-size: 1.3rem; word-break: break-word; }
.drawer-profile p { margin: 2px 0 0; font-size: 0.85rem; color: rgba(22, 56, 40, 0.6); word-break: break-all; }

.drawer-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 22px;
}

.drawer-facts div { background: var(--cream); border-radius: var(--radius-sm); padding: 10px 12px; }
.drawer-facts dt { font-size: 0.72rem; color: rgba(22, 56, 40, 0.6); }
.drawer-facts dd { margin: 2px 0 0; font-weight: 600; }

.admin-drawer-card h3 { font-size: 0.95rem; margin: 0 0 8px; }

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

.drawer-events li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    padding: 10px 0 10px 14px;
    border-bottom: 1px solid rgba(22, 56, 40, 0.07);
    border-left: 3px solid rgba(22, 56, 40, 0.15);
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.drawer-events .ev-type { font-weight: 600; }
.drawer-events .ev-count { font-size: 0.78rem; color: rgba(22, 56, 40, 0.6); grid-row: 2; }
.drawer-events time { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 0.8rem; color: rgba(22, 56, 40, 0.7); }
.drawer-events .ev-stamp { border-left-color: var(--green-light); }
.drawer-events .ev-redeem { border-left-color: var(--orange); }
.drawer-events .ev-revert { border-left-color: #c9b8a4; }
.drawer-events .muted { border-left: 0; color: rgba(22, 56, 40, 0.6); display: block; }

/* ── 404 page ────────────────────────────────────────────── */

.not-found { text-align: center; }
.not-found-cup { font-size: 3rem; margin: 4px 0 8px; }
.not-found .actions { margin-top: 4px; }

/* ── Customer authentication ─────────────────────────────── */

body.auth-page .topbar { --page-max: 520px; }

.auth-card {
    width: 100%;
    max-width: 520px;
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    background: #fffaf3;
    box-shadow: 0 20px 44px rgba(20, 45, 34, 0.14);
    animation: fadeSlideUp 0.4s ease both;
}

.auth-card h1 {
    margin: 0 0 8px;
    color: var(--green);
    font-family: var(--font-display);
    font-size: 1.8rem;
}

.auth-lead {
    margin: 0 0 20px;
    color: rgba(22, 56, 40, 0.72);
    line-height: 1.5;
}

.auth-form label {
    display: block;
    margin: 12px 0 5px;
    font-size: 0.84rem;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    padding: 12px 13px;
    border: 2px solid rgba(31, 77, 58, 0.15);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--green-dark);
    font: inherit;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--orange);
}

.auth-form .status.is-ok,
.auth-card .status.is-ok { color: var(--green); }
.auth-form .status.is-error,
.auth-card .status.is-error { color: #A8321F; }
.auth-form .btn { width: 100%; }

.auth-name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-switch {
    margin: 18px 0 8px;
    text-align: center;
    color: rgba(22, 56, 40, 0.75);
    font-size: 0.9rem;
}

.auth-switch a,
.auth-back {
    color: var(--green);
    font-weight: 700;
}

.auth-secondary-btn {
    width: 100%;
    margin-bottom: 12px;
}

.auth-back {
    display: block;
    text-align: center;
    font-size: 0.84rem;
}

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

.auth-choice-list .btn { width: 100%; }
.auth-google { display: flex; justify-content: center; min-height: 44px; }
.auth-google[hidden] { display: none; }

.customer-auth-block {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.customer-login-btn {
    width: 100%;
    margin-top: 10px;
}

.account-signed-in {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(245, 237, 228, 0.1);
    text-align: center;
}

.account-signed-in[hidden],
#account-signin-options[hidden] { display: none; }

.account-signed-in p {
    margin: 0 0 8px;
    color: #b8e6c8;
    font-size: 0.86rem;
    font-weight: 600;
}

.account-signed-in button {
    border: 0;
    background: none;
    color: var(--cream);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 420px) {
    .auth-name-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 560px) {
    body.auth-page { padding-bottom: 24px; }

    body.auth-page .topbar {
        margin-bottom: 14px;
        padding-left: 16px;
        padding-right: 16px;
    }

    body.auth-page .brand {
        min-width: 0;
        font-size: 1.08rem;
    }

    body.auth-page .brand span {
        min-width: 0;
        white-space: nowrap;
    }

    .auth-card {
        padding: 22px 16px;
        border-radius: var(--radius);
    }

    .auth-card h1 {
        font-size: clamp(1.45rem, 7vw, 1.75rem);
    }

    .auth-form input {
        min-height: 48px;
        font-size: 16px;
    }

    .auth-choice-list .btn,
    .auth-form .btn,
    .auth-secondary-btn {
        min-height: 48px;
        padding-left: 12px;
        padding-right: 12px;
        font-size: 0.74rem;
        letter-spacing: 0.08em;
    }

    .auth-google {
        width: 100%;
        overflow: hidden;
    }
}
