/* Shared styles for the receipt, gift card and giveaway pages (matches the main site tokens). */
:root {
  color-scheme: light;
  --bg: #f5f5f5; --bg-alt: #ffffff; --text: #111111; --muted: #4b5563; --accent: #2563eb;
  --border: #e5e7eb; --soft: #f3f4f6; --shadow: 0 10px 25px rgba(15,23,42,0.08);
  --radius: 20px; --font-head: 'DM Serif Display', Georgia, serif; --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --btn: #111111; --btn-text: #ffffff;
  --green-bg: #ecfdf5; --green-border: #a7f3d0; --green-text: #065f46; --green-btn: #059669;
  --red-bg: #fee2e2; --red-text: #991b1b; --amber-bg: #fef3c7; --amber-text: #92400e;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111827; --bg-alt: #020617; --text: #f9fafb; --muted: #d1d5db; --accent: #93c5fd;
  --border: #1f2937; --soft: #0f172a; --shadow: 0 10px 25px rgba(0,0,0,0.45);
  --btn: #f9fafb; --btn-text: #020617;
  --green-bg: #052e22; --green-border: #065f46; --green-text: #a7f3d0; --green-btn: #10b981;
  --red-bg: #450a0a; --red-text: #fecaca; --amber-bg: #422006; --amber-text: #fde68a;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body); background: var(--bg); color: var(--text);
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}
a { color: var(--accent); }
button, a, [role="button"], input, label { touch-action: manipulation; }

.shell {
  width: 100%; max-width: 560px; margin: 0 auto; flex: 1;
  padding: 18px calc(16px + var(--safe-r)) 28px calc(16px + var(--safe-l));
  display: flex; flex-direction: column; gap: 16px;
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-logo {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center; padding: 4px; overflow: hidden; flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
:root[data-theme="dark"] .brand-logo img, :root[data-theme="dark"] img.invert-dark { filter: invert(1); }
.brand-name { font-weight: 700; font-size: 1rem; }
.icon-btn {
  min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-alt);
  color: var(--muted); font-size: 1.05rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}

.card {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 18px;
}
.center { text-align: center; }
.eyebrow { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h1.title { font-family: var(--font-head); font-weight: 400; font-size: clamp(1.7rem, 7vw, 2.2rem); line-height: 1.15; }
h2.title { font-family: var(--font-head); font-weight: 400; font-size: 1.45rem; line-height: 1.2; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .78rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px;
  border-radius: 14px; border: 1px solid transparent; background: var(--btn); color: var(--btn-text);
  font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer; width: 100%;
  transition: transform .12s ease, opacity .2s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.ghost { background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.btn.green { background: var(--green-btn); color: #fff; }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: .92rem; width: auto; }

/* grid of big save buttons */
.save-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.save-grid .btn { flex-direction: column; gap: 4px; min-height: 76px; font-size: .9rem; background: var(--bg-alt); color: var(--text); border-color: var(--border); }
.save-grid .btn .ic { width: 24px; height: 24px; }
.save-grid .btn.wide { grid-column: 1 / -1; flex-direction: row; min-height: 56px; }

.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field label { font-weight: 600; font-size: .9rem; }
.input {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: 500 16px var(--font-body);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: .92rem; cursor: pointer; padding: 6px 0; }
.check input { width: 24px; height: 24px; flex-shrink: 0; margin-top: 1px; accent-color: var(--green-btn); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.msg { padding: 12px 14px; border-radius: 12px; font-size: .95rem; text-align: left; }
.msg.err { background: var(--red-bg); color: var(--red-text); }
.msg.ok { background: var(--green-bg); color: var(--green-text); }
.msg.info { background: var(--soft); color: var(--muted); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem; }
.pill.red { background: var(--red-bg); color: var(--red-text); }
.pill.amber { background: var(--amber-bg); color: var(--amber-text); }
.pill.green { background: var(--green-bg); color: var(--green-text); }
.pill.gray { background: var(--soft); color: var(--muted); }

.green-box { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green-text); border-radius: 16px; padding: 16px; }
.green-box .title-line { font-weight: 700; font-size: 1.05rem; }
.numbers { font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--text); animation: spin .8s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; font-size: .8rem; color: var(--muted); padding: 10px 16px calc(18px + var(--safe-b)); }
.foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
#view { display: flex; flex-direction: column; gap: 14px; }

/* ── icons ── */
.ic { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: -4px; }
.ic.sm { width: 16px; height: 16px; vertical-align: -3px; }
.ic.lg { width: 28px; height: 28px; }
.ic.xl { width: 40px; height: 40px; }
.ic.end { margin-left: auto; }
.icon-btn .ic { width: 20px; height: 20px; }
.badge-ic {
  width: 64px; height: 64px; border-radius: 20px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--soft); color: var(--text); margin: 0 auto 6px;
}
.badge-ic.green { background: var(--green-bg); color: var(--green-text); }
.badge-ic.red { background: var(--red-bg); color: var(--red-text); }
.badge-ic .ic { width: 30px; height: 30px; }

/* ── card bits ── */
.card-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.02rem; margin-bottom: 12px; }
.card-head .ic { color: var(--muted); }
.center-head { justify-content: center; }
.row-link {
  display: flex; align-items: center; gap: 10px; min-height: 48px; margin-top: 8px; padding: 10px 2px 0;
  border-top: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.row-link .ic { color: var(--muted); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; margin-top: 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 600 .85rem var(--font-body); cursor: pointer;
}
.chip-btn:active { transform: scale(.97); }

/* ── events ── */
.event { display: flex; gap: 14px; padding: 10px 0; }
.event + .event { border-top: 1px solid var(--border); }
.event-date {
  width: 54px; height: 58px; border-radius: 14px; background: var(--soft); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
}
.event-date span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #dc2626; }
.event-date b { font-size: 1.45rem; }
.event-body { min-width: 0; flex: 1; }
.event-title { font-weight: 700; }
.event-meta { display: flex; gap: 6px; align-items: flex-start; color: var(--muted); font-size: .88rem; margin-top: 3px; text-decoration: none; }
.event-meta .ic { margin-top: 2px; }
a.event-meta:hover span { text-decoration: underline; }

/* ── socials ── */
.socials { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.social {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: var(--bg);
}
.social.facebook { color: #1877f2; } .social.instagram { color: #d62976; } .social.youtube { color: #ff0000; }

/* ── countdown ── */
.countdown { display: flex; justify-content: center; gap: 8px; }
.countdown div { min-width: 64px; padding: 10px 6px; border-radius: 14px; background: var(--soft); text-align: center; }
.countdown b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }

/* ── toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--btn); color: var(--btn-text);
  font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); transition: opacity .2s ease, transform .2s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── list rows (saved receipts etc.) ── */
.list-rows { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 0; color: var(--text); text-decoration: none;
}
.list-row + .list-row { border-top: 1px solid var(--border); }
.list-row .ic { color: var(--muted); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 600; }
.list-row .s { color: var(--muted); font-size: .85rem; }
.list-row .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
