/* ==========================================================================
   Gumdrop Booth components (shared by every page). Admin-only pieces
   (tables, filter bar, coins, popover, pagination, jelly toggle, date pill)
   live in admin-components.css. Values follow DESIGN.md section 4.
   ========================================================================== */

/* --- Wash: the drifting page background, aria-hidden ---------------------- */
.wash { position: fixed; inset: 0; z-index: var(--z-wash); overflow: hidden; pointer-events: none;
  background: linear-gradient(135deg, #FFD6C2 0%, #CFEFE0 52%, #E3D6FF 100%); }
.wash::before, .wash::after { content: ""; position: absolute; width: 60vw; height: 60vw; border-radius: 50%; filter: blur(40px); will-change: transform; }
.wash::before { top: -20vw; left: -15vw; background: rgba(255, 214, 194, 0.4); animation: drift-a 40s ease-in-out infinite alternate; }
.wash::after { bottom: -20vw; right: -15vw; background: rgba(227, 214, 255, 0.4); animation: drift-b 40s ease-in-out infinite alternate; }
@keyframes drift-a { to { transform: translate(8vw, 6vw); } }
@keyframes drift-b { to { transform: translate(-8vw, -6vw); } }

/* --- Surfaces: .glass blurs (max three on screen), .panel never does ------- */
.glass { background: var(--glass-62); -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
  border: var(--border-rim); border-radius: var(--r-panel); box-shadow: var(--inset-highlight), var(--shadow-panel); }
.panel { background: var(--panel-92); border: var(--border-rim); border-radius: var(--r-panel); box-shadow: var(--inset-highlight), var(--shadow-panel); }
.glass, .panel { padding: 24px; }
@media (max-width: 640px) { .glass, .panel { padding: 20px; } }

/* --- Print treatment: booth strips with sprocket holes --------------------- */
.print { position: relative; background: var(--cream); }
.print--h::before, .print--h::after { content: ""; position: absolute; left: 8px; right: 8px; height: var(--dot-size); pointer-events: none;
  background: radial-gradient(circle at 3px 3px, rgba(184, 151, 90, 0.35) 0 2.5px, transparent 3px) 0 0 / var(--dot-pitch) var(--dot-size) repeat-x;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent); mask: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent); }
.print--h::before { top: 6px; } .print--h::after { bottom: 6px; }
.print--v::before, .print--v::after { content: ""; position: absolute; top: 8px; bottom: 8px; width: var(--dot-size); pointer-events: none;
  background: radial-gradient(circle at 3px 3px, rgba(184, 151, 90, 0.2) 0 2.5px, transparent 3px) 0 0 / var(--dot-size) var(--dot-pitch) repeat-y; }
.print--v::before { left: 6px; } .print--v::after { right: 6px; }
.print__photo { border: var(--border-print); border-radius: var(--r-print); box-shadow: var(--shadow-print); object-fit: cover; display: block; }

/* --- Buttons --------------------------------------------------------------- */
.gumdrop, .pill, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-pill);
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--d-panel) var(--spring), box-shadow var(--d-panel) var(--ease-out), background-color var(--d-chip) linear; }
/* .gumdrop: the one primary per screen; sizes --lg 56 (Generate), --md 52 (Let me in), --sm 36 (Download, Add, Copy) */
.gumdrop { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1; height: 36px; padding: 0 16px; border: 0; color: var(--gumdrop-text);
  background: radial-gradient(120% 90% at 18% 10%, rgba(255,255,255,0.45), rgba(255,255,255,0) 55%), linear-gradient(135deg, var(--gumdrop-a), var(--gumdrop-b));
  box-shadow: inset 0 0 0 2px var(--white), var(--shadow-gumdrop); }
.gumdrop--md { height: 52px; font-size: 17px; padding: 0 20px; }
.gumdrop--lg { height: 56px; font-size: 18px; padding: 0 20px; width: 100%; justify-content: flex-start; }
.gumdrop:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--white), var(--shadow-gumdrop-hover); }
.gumdrop:active { transform: scale(0.96); }
.gumdrop:disabled, .gumdrop[aria-disabled="true"] { background: var(--disabled-bg); color: var(--ink-soft); box-shadow: inset 0 0 0 2px var(--white); transform: none; cursor: not-allowed; }
/* .gumdrop__cost: the live price pill inside Generate */
.gumdrop__cost { margin-left: auto; background: var(--white); color: var(--coral-deep); font: 500 14px var(--font-mono); font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: var(--r-pill); }
.gumdrop:disabled .gumdrop__cost { color: var(--ink-soft); }
/* .pill: ghost secondary; --sm 28 (tables), --lg 44 (phone, Load more) */
.pill { font: 600 14px/1 var(--font-body); height: 36px; padding: 0 14px; background: rgba(255,255,255,0.85); color: var(--ink); border: var(--border-control); }
.pill--sm { height: 28px; padding: 0 10px; font-size: 13px; }
.pill--lg { height: 44px; padding: 0 18px; }
.pill:hover { background: var(--white); transform: translateY(-1px); }
.pill:active { transform: scale(0.97); }
.pill:disabled, .pill[aria-disabled="true"] { opacity: 0.55; transform: none; cursor: not-allowed; }
.pill--mint { background: var(--wash-mint); color: var(--mint-deep); border-color: var(--sand-deep); }
.pill--mint:hover { background: var(--chip-mint); }
.pill--danger-text { color: var(--danger); }
.pill--ink { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); }
.pill--ink:hover { background: var(--white); }
.pill--on-dark { background: transparent; border-color: var(--white); color: var(--white); }
.pill--on-dark:hover { background: rgba(255,255,255,0.12); }
.pill--current { background: var(--ink); color: var(--white); border-color: var(--ink); }
/* .btn-danger: the only destructive confirm (Disable person) */
.btn-danger { font: 600 15px/1 var(--font-display); height: 36px; padding: 0 16px; background: var(--danger); color: var(--white); border: 0; }
.btn-danger:hover { background: #9C1F27; transform: translateY(-2px); }
.btn-danger:active { transform: scale(0.96); }
/* .link: text link (Sign out, more, Clear strip) */
.link { display: inline; color: var(--grape); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; }
.link:hover { text-decoration-thickness: 2.5px; }
/* .close-circle: white circle with an ink cross (dialogs, lightbox, remove) */
.close-circle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--white); color: var(--ink);
  box-shadow: 0 0 0 1px var(--sand-deep), var(--shadow-print-phone); flex: none; }
.close-circle:hover { transform: scale(1.06); }
/* .is-loading: a 14px ring replaces the trailing gap; pair with aria-busy and a swapped label */
.is-loading { position: relative; pointer-events: none; }
.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; flex: none; }
@media (max-width: 640px) { .pill, .gumdrop, .btn-danger { min-height: 44px; } .pill--sm { min-height: 36px; margin: 4px 0; } .close-circle { width: 44px; height: 44px; } .link--row { display: inline-block; padding: 10px 0; } }

/* --- Inputs ---------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field > .label { margin-bottom: 0; }
/* .input: 44px pill; --lg is the 52px login size; selects add .input--select */
.input { height: 44px; width: 100%; background: rgba(255,255,255,0.85); border: var(--border-control); border-radius: var(--r-pill); padding: 0 18px;
  font: 400 16px var(--font-body); color: var(--ink); transition: border-color var(--d-chip) linear, box-shadow var(--d-chip) linear; }
.input--lg { height: 52px; }
.input:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; box-shadow: var(--glow-mint); }
.input.is-invalid, .is-invalid > .input, .textarea-wrap.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 6px rgba(249,220,216,0.8); }
.input--select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B2340' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px 16px; }
/* .field--password: input with the Show / Hide pill inside its right end */
.field--password .field__wrap { position: relative; }
.field--password .input { padding-right: 84px; }
.toggle-pw { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); height: 32px; font-size: 13px; padding: 0 10px; min-height: 0; }
.toggle-pw:hover { transform: translateY(-50%); }
/* .textarea-wrap + .textarea + .counter: the autosizing prompt with its 128 / 4000 counter */
.textarea-wrap { position: relative; }
.textarea { display: block; width: 100%; min-height: 112px; max-height: 50vh; resize: none; overflow-y: auto; background: rgba(255,255,255,0.85); border: var(--border-control);
  border-radius: var(--r-field); padding: 14px 16px 34px 16px; font: 400 16px/1.5 var(--font-body); color: var(--ink); }
.textarea:focus-visible { outline: 3px solid var(--grape); outline-offset: 2px; box-shadow: var(--glow-mint); }
.counter { position: absolute; right: 14px; bottom: 10px; font: 400 12px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-soft); pointer-events: none; }
.counter.is-over { color: var(--danger); }
.textarea-wrap.is-over .textarea { border-color: var(--danger); }
/* .hint: the mono line under a button (Cmd Enter, password shape) */
.hint { font: 400 12px/1.4 var(--font-mono); color: var(--ink-soft); text-align: center; }
/* .inline-error: the login error pill (aria-live slot) */
.inline-error { display: flex; gap: 8px; align-items: flex-start; background: var(--blush-pale); color: var(--danger); padding: 10px 14px; border-radius: var(--r-pill); font: 600 14px/1.4 var(--font-body); animation: shake 300ms var(--ease-out); }
.inline-error .icon { margin-top: 2px; }

/* --- Stickers: rotated pill labels ---------------------------------------- */
.sticker { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); border: var(--border-sticker-outer); box-shadow: 0 0 0 1px var(--sand);
  font: 800 13px/1 var(--font-body); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; margin: 6px; transform: rotate(-4deg); background: var(--cream); color: var(--ink-soft); }
.sticker--mode-text { background: var(--fill-mode-text); color: var(--text-mode-text); }
.sticker--mode-edit { background: var(--fill-mode-edit); color: var(--text-mode-edit); }
.sticker--count { background: var(--blush); color: var(--ink); }
.sticker--count.is-full { background: var(--blush-pale); color: var(--danger); }
.sticker--developing { background: var(--fill-developing); color: var(--text-developing); }
.sticker--failed { background: var(--fill-failed); color: var(--text-failed); }
.sticker--disabled { background: var(--blush-pale); color: var(--danger); transform: none; }
.sticker--once { background: var(--butter); color: var(--amber); transform: rotate(-3deg); }
/* .sticker--section: the group label overlapping its control's top-left border */
.sticker--section { transform: rotate(-2deg); position: relative; z-index: 1; margin: 0 0 -12px 12px; width: max-content; justify-self: start; align-self: start; }
.sticker.is-pop { animation: pop var(--d-chip) var(--spring); }

/* --- Ratio chips (role=radiogroup of role=radio buttons) ------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 10px; border-radius: var(--r-pill); background: rgba(255,255,255,0.85);
  border: var(--border-control); color: var(--ink); font: 600 14px/1 var(--font-body); cursor: pointer; transition: transform var(--d-chip) var(--spring), background-color var(--d-chip) linear, box-shadow var(--d-chip) linear; }
.chip:hover { background: var(--white); transform: translateY(-1px); }
.chip[aria-checked="true"] { background: linear-gradient(135deg, var(--gumdrop-a), var(--gumdrop-b)); color: var(--ink); box-shadow: 0 0 0 2px var(--sand-deep); animation: pop var(--d-chip) var(--spring); }
.chip__glyph { width: 16px; height: 16px; flex: none; }
@media (max-width: 640px) { .chip { height: 40px; margin: 2px 0; } }

/* --- Segmented control (resolution with prices, format) ------------------- */
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); height: 44px; padding: 3px; background: var(--cream); border: var(--border-control); border-radius: var(--r-pill); }
.seg--2 { grid-template-columns: repeat(2, 1fr); }
.seg__thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); background: var(--white); border-radius: var(--r-pill); box-shadow: 0 0 0 1.5px var(--sand-deep), var(--inset-highlight);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform var(--d-thumb) var(--spring); pointer-events: none; }
.seg--2 .seg__thumb { width: calc((100% - 6px) / 2); }
.seg__cell { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: transparent; border: 0; border-radius: var(--r-pill); color: var(--ink); cursor: pointer; }
.seg__label { font: 700 15px/1 var(--font-body); }
.seg__price { font: 400 11px/1 var(--font-mono); color: var(--bronze); }
.seg__cell[aria-checked="true"] .seg__price { color: var(--coral-deep); }

/* --- Generator card: the booth ---------------------------------------------- */
.booth { position: relative; display: grid; gap: 20px; }
.booth__title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.booth__title .sticker { margin-right: 6px; }
.booth::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--white); opacity: 0; pointer-events: none; }
.booth.is-flashing::after { animation: shutter 120ms linear; }
.group { display: grid; }
.group > .chips { padding-top: 10px; } /* chips have no border to overlap, so they clear the sticker */
.group__row { display: grid; grid-template-columns: 1fr 200px; gap: 12px; }
@media (max-width: 640px) { .group__row { grid-template-columns: 1fr; } }

/* --- Result card: one booth frame ------------------------------------------ */
.card { position: relative; border-radius: var(--r-card); padding: 14px 18px 16px; display: grid; box-shadow: inset 0 0 0 3px var(--white), var(--inset-highlight), var(--shadow-print), var(--shadow-panel); }
.card--pending { order: -1; animation: card-in var(--d-panel) var(--spring); }
.card__sticker { position: absolute; top: 12px; left: 12px; z-index: 2; margin: 0; }
.card__sticker.is-out { animation: pop-out var(--d-chip) var(--ease-out) forwards; }
.card__img { position: relative; width: 100%; aspect-ratio: var(--ratio, 9 / 16); border-radius: var(--r-print); overflow: hidden; background: var(--cream); }
.card__img img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-print); }
.card__img img.is-revealing { animation: reveal var(--d-reveal) var(--ease-out); }
.card--pending .card__img { background: linear-gradient(135deg, rgba(255,214,194,0.6), rgba(227,214,255,0.6)); }
.card--pending .card__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.55) 50%, transparent 65%); background-size: 250% 100%; animation: shimmer 2s linear infinite; }
.card__status { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font: 500 14px/1.3 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.spinner-ring { width: 48px; height: 48px; animation: spin 1.2s linear infinite; }
.spinner-ring circle { fill: none; stroke: var(--sand); stroke-width: 3; stroke-dasharray: 2 6; stroke-linecap: round; }
.card--failed .card__img { background: var(--blush-pale); display: grid; place-items: center; animation: fade-in var(--d-panel) var(--ease-out); }
.card--failed { animation: shake 300ms var(--ease-out); }
.card__cap { background: var(--cream); margin: 12px -18px -16px; padding: 12px 18px 16px; border-radius: 0 0 var(--r-card) var(--r-card); display: grid; gap: 8px; }
.card__prompt { font: 400 14px/1.4 var(--font-body); color: var(--ink); cursor: pointer; }
.card__chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* .mini: the tiny mono chips (2K, 9:16, $0.14) */
.mini { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--sand-deep); border-radius: var(--r-pill); background: var(--white); font: 400 12px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.mini--money { color: var(--coral-deep); }
.mini--zero { color: var(--ink-soft); }
.card__time { font: 400 12px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.card__error { font: 400 12px/1.4 var(--font-mono); color: var(--danger); overflow-wrap: anywhere; }
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card__downloads { margin-left: auto; font: 400 12px/1.4 var(--font-mono); color: var(--ink-soft); }
@media (max-width: 640px) { .card__actions .pill, .card__actions .gumdrop { flex: 1 1 45%; height: 44px; } .card__downloads { flex: 1 1 100%; margin-left: 0; } }

/* --- Reference strip: dropzone + tray ------------------------------------- */
.strip-tilt { transform: rotate(-1deg); transition: transform 200ms var(--ease-out); padding: 6px; overflow: visible; }
.strip-tilt.is-dragover, .strip-tilt:focus-within { transform: rotate(0deg); }
.strip { display: block; position: relative; height: var(--strip-h); border: 1.5px solid var(--sand-deep); border-radius: var(--r-strip); cursor: pointer; transition: border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out); }
.is-dragover .strip { border-color: var(--mint-deep); box-shadow: var(--glow-mint-strong); }
.is-dragover .strip__frame { background: var(--wash-mint); }
.strip .sticker--count { position: absolute; left: 12px; top: 50%; margin: 0; transform: translateY(-50%) rotate(-4deg); z-index: 2; }
.strip__row { display: flex; gap: 12px; padding: 20px 16px 20px 96px; height: 100%; overflow-x: auto; overflow-y: visible; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; align-items: center; }
.strip__row::-webkit-scrollbar { display: none; }
.strip__thumb { position: relative; flex: none; width: var(--thumb); height: var(--thumb); scroll-snap-align: start; animation: pop-in var(--d-thumb) var(--spring); }
.strip__thumb.is-removing { transform: scale(0); transition: transform var(--d-chip) var(--ease-out); }
.strip__thumb > button { display: block; width: 100%; height: 100%; border-radius: var(--r-print); }
.strip__thumb .print__photo { width: 100%; height: 100%; }
.strip__thumb.is-uploading .print__photo { opacity: 0.55; }
.strip__thumb.is-uploading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid var(--sand); border-right-color: transparent; animation: spin 0.9s linear infinite; }
.strip__thumb.is-error .print__photo { opacity: 0.4; border-color: var(--danger); }
.strip__thumb.is-error::after { content: ""; position: absolute; inset: 3px; border-radius: 9px; background: var(--blush-pale); opacity: 0.6; }
/* .strip__remove: 22px white circle, 44px hit area on touch */
.strip__remove { position: absolute; top: -6px; right: -6px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; background: var(--white); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1px var(--sand-deep), var(--shadow-print-phone); }
.strip__remove .icon { width: 12px; height: 12px; }
@media (pointer: coarse) { .strip__remove::before { content: ""; position: absolute; inset: -11px; } }
/* .strip__add and .strip__frame: dashed frames, the add slot carries a plus and the word Add */
.strip__frame, .strip__add { flex: none; width: var(--thumb); height: var(--thumb); border: 1.5px dashed var(--sand); border-radius: var(--r-print); background: rgba(255,255,255,0.5); transition: background-color 200ms linear; }
.strip__add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--bronze); font: 700 12px/1 var(--font-body); cursor: pointer; }
.strip__add .icon { width: 24px; height: 24px; color: var(--sand); }
.strip__empty { display: flex; align-items: center; gap: 12px; height: 100%; }
.strip__empty-copy { font: 400 14px/1.4 var(--font-body); color: var(--ink-soft); }
.strip__foot { display: flex; justify-content: flex-end; min-height: 20px; padding: 2px 8px 0; font-size: 14px; }
.strip.is-shaking { animation: shake 300ms var(--ease-out); }
@media (max-width: 640px) { .strip__thumb, .strip__frame, .strip__add { width: 72px; height: 72px; } .strip__row { padding-left: 88px; } .strip .sticker--count { font-size: 12px; } }

/* --- Status chips (tables and toasts): fill + text + glyph ----------------- */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); border: var(--border-sticker-outer); box-shadow: 0 0 0 1px var(--sand);
  font: 800 12px/1 var(--font-body); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.status .icon { width: 14px; height: 14px; }
.status--queued { background: var(--fill-queued); color: var(--text-queued); }
.status--processing { background: var(--fill-processing); color: var(--text-processing); }
.status--processing .icon { animation: pulse 1.2s ease-in-out infinite; }
.status--completed { background: var(--fill-completed); color: var(--text-completed); }
.status--failed { background: var(--fill-failed); color: var(--text-failed); }
.status--text { background: var(--wash-mint); color: var(--ink); }
.status--edit { background: var(--wash-peach); color: var(--ink); }

/* --- Lightbox: native dialog, one per page --------------------------------- */
.lightbox { background: transparent; max-width: none; max-height: none; width: auto; overflow: visible; }
.lightbox[open] { display: grid; justify-items: center; gap: 12px; animation: pop-frame var(--d-panel) var(--ease-out); }
.lightbox::backdrop { background: var(--overlay); animation: fade-in 200ms linear; }
.lightbox__frame { position: relative; background: var(--white); padding: 8px; border-radius: var(--r-card); box-shadow: var(--shadow-panel); }
.lightbox__img { max-width: min(90vw, 1400px); max-height: 85vh; width: auto; height: auto; object-fit: contain; border-radius: 12px; }
.lightbox__close { position: absolute; top: -12px; right: -12px; }
.lightbox__caption { font: 400 12px/1.4 var(--font-mono); color: var(--white); text-align: center; max-width: min(90vw, 1400px); overflow-wrap: anywhere; }
.lightbox__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) { .lightbox__img { max-width: calc(100vw - 24px); max-height: 78vh; } }

/* --- Toasts: one polite region, at most two stacked ----------------------- */
.toasts { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: var(--z-toast); width: max-content; max-width: calc(100% - 32px); display: grid; gap: 8px; pointer-events: none; }
body.has-fab .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-radius: var(--r-pill); background: var(--cream); color: var(--ink); border: var(--border-control);
  box-shadow: var(--inset-highlight), var(--shadow-panel); font: 600 14px/1.4 var(--font-body); animation: toast-in var(--d-panel) var(--spring); }
.toast--success { background: var(--wash-mint); color: var(--mint-deep); }
.toast--error { background: var(--blush-pale); color: var(--danger); }
.toast.is-leaving { opacity: 0; transition: opacity var(--d-chip) linear; }

/* --- Dialog: password reveal and confirm ----------------------------------- */
.dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; border-radius: var(--r-panel); }
.dialog[open] { display: grid; gap: 16px; animation: pop-frame var(--d-panel) var(--ease-out); }
.dialog::backdrop { background: var(--overlay); animation: fade-in 200ms linear; }
.dialog__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog__head .h2 { display: grid; gap: 2px; }
.dialog__who { font: 600 16px/1.4 var(--font-body); color: var(--ink); overflow-wrap: anywhere; }
.dialog__body { font: 400 14px/1.5 var(--font-body); color: var(--ink-soft); }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; }
/* .dialog__pw: the password strip with the Copy gumdrop */
.dialog__pw { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border: var(--border-control); border-radius: var(--r-strip); }
.dialog__pw-text { flex: 1 1 auto; min-width: 0; font: 500 20px/1.3 var(--font-mono); letter-spacing: 0.02em; user-select: all; overflow-wrap: anywhere; }

/* --- Header and nav --------------------------------------------------------- */
.header { position: sticky; top: 0; z-index: var(--z-header); height: var(--header-h); border-radius: 0; border: 0; border-bottom: 1px solid var(--sand); box-shadow: none; padding: 0; }
.header__inner { max-width: 1360px; margin: 0 auto; padding: 0 24px; height: 100%; display: flex; align-items: center; gap: 12px; }
.header--admin .header__inner { max-width: 1400px; }
.header__brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; border-radius: var(--r-pill); }
.header__coin { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--logo-cream); box-shadow: 0 0 0 1px var(--sand); overflow: hidden; flex: none; }
.header__coin img { width: 30px; height: 30px; }
.header__right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* .spend-pill: $12.46 this month; #spend-month is the amount span inside */
.spend-pill { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border: var(--border-control); border-radius: var(--r-pill); background: rgba(255,255,255,0.85); font: 500 14px var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spend-pill__amount { color: var(--coral-deep); }
.spend-pill__label { color: var(--ink-soft); }
.email-pill { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border: var(--border-control); border-radius: var(--r-pill); background: rgba(255,255,255,0.85); font-size: 13px; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
/* .header__menu: the phone initial pill; .header__popover the glass menu it opens */
.header__menu { display: none; width: 40px; height: 40px; border-radius: 50%; background: var(--wash-mint); color: var(--ink); font: 800 16px/1 var(--font-body); align-items: center; justify-content: center; text-transform: uppercase; }
.header__popover { position: absolute; right: 16px; top: calc(var(--header-h) + 8px); width: 240px; padding: 8px; border-radius: 20px; display: grid; animation: pop-frame var(--d-chip) var(--ease-out); }
.header__popover > * { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14px; color: var(--ink); text-decoration: none; }
.header__popover > a:hover, .header__popover > button:hover { background: rgba(255,255,255,0.7); }
.header__popover-email { font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; line-height: 1.3; padding: 8px 12px; }
@media (max-width: 640px) { .header__inner { padding: 0 16px; } .header__right > .email-pill, .header__right > .pill, .header__right > .link { display: none; } .header__menu { display: inline-flex; } }
@media (max-width: 480px) { .header__brand .wordmark { display: none; } .spend-pill__label { display: none; } }

/* --- Banner: generation paused ----------------------------------------------- */
.banner { max-width: 1360px; margin: 16px auto 0; padding: 0 24px; }
.banner__inner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-strip); background: var(--blush-pale); color: var(--danger); border: 1.5px solid var(--danger); font: 600 14px/1.4 var(--font-body); }
.banner--warn .banner__inner { background: #FFE7A3; color: #5C4300; border-color: #B8975A; }
.banner + .banner { margin-top: 8px; }
@media (max-width: 640px) { .banner { padding: 0 16px; margin-top: 12px; } }

/* --- Door layout: login card and the 403 page ------------------------------- */
body.door-page { display: grid; place-items: center; padding: 56px 0 24px; }
.door { position: relative; width: 400px; max-width: calc(100% - 32px); padding: 56px 32px 32px; margin-top: 48px; text-align: center; display: grid; gap: 0; }
.door__coin { position: absolute; top: -48px; left: 50%; transform: translateX(-50%); width: 96px; height: 96px; border-radius: 50%; background: var(--logo-cream); box-shadow: 0 0 0 2px var(--sand), var(--shadow-coin); display: grid; place-items: center; overflow: hidden; }
.door__coin img { width: 80px; height: 80px; }
.door__glyph { margin: 0 auto 8px; }
.door .wordmark { margin-top: 8px; }
.door__sub { font: 400 15px/1.4 var(--font-body); color: var(--ink-soft); margin: 4px 0 24px; }
.door__form { display: grid; gap: 16px; text-align: left; }
.door__form .gumdrop { margin-top: 8px; width: 100%; }
.door__foot { margin-top: 24px; font: 400 13px/1.4 var(--font-body); color: var(--ink-soft); }
.door__error { min-height: 0; text-align: left; }
/* .overprint and .ambient: the fixed decorations behind the card, aria-hidden */
.overprint { position: fixed; border-radius: 50%; mix-blend-mode: multiply; opacity: 0.55; pointer-events: none; z-index: var(--z-base); }
.overprint--peach { width: 520px; height: 520px; top: 8vh; left: calc(50% - 470px); background: var(--wash-peach); animation: drift-a 40s ease-in-out infinite alternate; }
.overprint--mint { width: 460px; height: 460px; bottom: 6vh; right: calc(50% - 440px); background: var(--wash-mint); animation: drift-b 40s ease-in-out infinite alternate; }
.ambient { position: fixed; width: 360px; height: 128px; border-radius: var(--r-strip); opacity: 0.12; pointer-events: none; z-index: var(--z-base); }
.ambient--a { top: 12vh; left: 6vw; transform: rotate(-8deg); background: var(--wash-mint); }
.ambient--b { bottom: 10vh; right: 6vw; transform: rotate(6deg); background: var(--wash-lilac); }
.door, .toasts { z-index: var(--z-sticky-card); }
@media (max-width: 640px) {
  .door { width: calc(100% - 32px); padding: 48px 20px 24px; border-radius: 20px; }
  .door__coin { top: -40px; width: 80px; height: 80px; } .door__coin img { width: 62px; height: 62px; }
  .ambient { display: none; }
  .overprint--peach { width: 320px; height: 320px; left: -140px; } .overprint--mint { width: 280px; height: 280px; right: -120px; }
}

/* --- Empty states ----------------------------------------------------------- */
.empty { display: grid; place-items: center; align-content: center; gap: 12px; padding: 24px; text-align: center; border: 1.5px dashed var(--sand); border-radius: var(--r-card); font: 400 14px/1.4 var(--font-body); color: var(--ink-soft); }
.empty--frame { aspect-ratio: 9 / 16; max-width: 260px; }
.empty__copy { max-width: 28ch; }

/* --- Skeletons: shimmer blocks while a list loads --------------------------- */
.skeleton { position: relative; overflow: hidden; border-radius: var(--r-print); background: linear-gradient(135deg, rgba(255,214,194,0.6), rgba(227,214,255,0.6)); min-height: 16px; }
.skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.55) 50%, transparent 65%); background-size: 250% 100%; animation: shimmer 2s linear infinite; }
.skeleton--text { height: 14px; border-radius: 7px; }
.skeleton--thumb { width: var(--sheet-thumb); height: var(--sheet-thumb); border-radius: var(--r-thumb); }

/* --- Keyframes ---------------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 50% { transform: scale(1.06); } }
@keyframes pop-in { from { transform: scale(0.6); } to { transform: scale(1); } }
@keyframes pop-out { to { transform: scale(0.6); opacity: 0; } }
@keyframes pop-frame { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes toast-in { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes card-in { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes reveal { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 16%, 50%, 83% { transform: translateX(-4px); } 33%, 66% { transform: translateX(4px); } }
@keyframes shutter { 50% { opacity: 0.4; } }
@keyframes pulse { 50% { transform: scale(1.4); opacity: 0.6; } }
@keyframes pulse-once { 50% { transform: scale(1.6); } }
@media (prefers-reduced-motion: reduce) {
  .wash::before, .wash::after, .overprint, .card--pending .card__img::after, .skeleton::after, .status--processing .icon { animation: none; }
  .spinner-ring { display: none; }
  .card__img img.is-revealing { clip-path: none; }
}
/* .door--plain: the 403 card has no coin, so it needs no top clearance */
.door--plain { padding-top: 32px; margin-top: 0; }
.door__center { text-align: center; }
