:root {
  color-scheme: light;
  --forest: #143936;
  --brown: #6a5943;
  --brown-soft: #8a7a64;
  --red: #ed1846;
  --red-dark: #bd0f34;
  --sage: #f1f4ee;
  --gold: #f9d77b;
  --paper: #ffffff;
  --physical-card-rasp: #ff2e58;
  --physical-card-cream: #fff8c5;
  --physical-card-forest: #163b3a;
  --physical-card-white: #ffffff;
  --physical-card-page: #e7e5df;
  --ink: var(--forest);
  --body: var(--brown);
  --muted: var(--brown-soft);
  --line: #dcd8cd;
  --line-soft: #ebe7dc;
  --shadow-sm: 0 2px 6px rgba(7, 21, 20, 0.05);
  --shadow-card: 0 22px 55px rgba(7, 21, 20, 0.22);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(237, 24, 70, 0.06), transparent 60%),
    radial-gradient(ellipse 50% 40% at 5% 30%, rgba(20, 57, 54, 0.05), transparent 60%),
    var(--sage);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.05;
}

em {
  color: var(--red);
  font-style: italic;
}

.page-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 28px 18px 56px;
}

.page-shell.narrow {
  width: min(100%, 820px);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--forest);
  text-decoration: none;
}

.brand-lockup img {
  width: 52px;
  height: auto;
}

.brand-lockup strong {
  color: var(--forest);
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
}

.eyebrow {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow.gold {
  color: var(--gold);
}

.helper,
.muted,
.status {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.status {
  min-height: 24px;
}

.status.is-loading {
  color: var(--forest);
}

.status.is-success {
  color: var(--forest);
  font-weight: 700;
}

.status.is-warning {
  color: #8b6a16;
  font-weight: 700;
}

.status.is-error {
  color: var(--red);
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 28px 14px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  text-decoration: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.btn-outline {
  border-color: var(--forest);
  color: var(--forest);
}

.btn-outline:hover {
  background: var(--forest);
  color: var(--paper);
}

.btn-block {
  width: 100%;
}

.btn-google-wallet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 24px;
  border: 1.5px solid #000;
  border-radius: var(--radius-pill);
  background: #000;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.btn-google-wallet:hover {
  background: #1a1a1a;
}

.gw-icon {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
}

.field {
  display: grid;
  gap: 6px;
}

.field label,
.field-label {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.field .opt {
  margin-left: 6px;
  color: var(--brown-soft);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field textarea {
  min-height: 78px;
  padding-top: 12px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--brown-soft);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(237, 24, 70, 0.32);
  outline-offset: 2px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(20, 57, 54, 0.12);
  outline: none;
}

.input-hint {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  color: var(--brown-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.or-divider::before,
.or-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
  flex: 1;
}

.consent-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--sage);
  color: var(--body);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1.45;
}

.consent-row input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px;
  min-height: 20px;
  margin: 1px 0 0;
}

.consent-row strong {
  color: var(--ink);
}

.join-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.85fr);
  gap: 26px;
  align-items: stretch;
}

.join-hero,
.status-card {
  background:
    radial-gradient(ellipse 80% 60% at 80% 10%, rgba(237, 24, 70, 0.18), transparent 60%),
    radial-gradient(ellipse 70% 60% at 10% 100%, rgba(249, 215, 123, 0.08), transparent 70%),
    var(--forest);
  color: var(--paper);
  overflow: hidden;
}

.join-hero {
  display: grid;
  min-height: 560px;
  padding: clamp(28px, 6vw, 58px);
  border-radius: var(--radius-xl);
  align-content: space-between;
  box-shadow: var(--shadow-card);
}

.join-hero h1 {
  max-width: 11ch;
  margin-top: 12px;
  color: var(--paper);
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  line-height: 0.96;
}

.join-hero h1 em {
  color: var(--gold);
}

.hero-copy {
  max-width: 36ch;
  margin-top: 16px;
  color: rgba(241, 244, 238, 0.78);
  font-size: 1rem;
}

.tier-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 28px 0 0;
  list-style: none;
}

.tier-chip {
  padding: 12px 10px;
  border: 1px solid rgba(241, 244, 238, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(241, 244, 238, 0.05);
}

.tier-chip strong {
  display: block;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.96rem;
  font-weight: 400;
}

.tier-chip span {
  color: rgba(241, 244, 238, 0.58);
  font-size: 0.7rem;
}

.tier-chip.is-current {
  border-color: var(--gold);
  background: rgba(249, 215, 123, 0.12);
}

.tier-chip.is-current strong {
  color: var(--gold);
}

.signup-panel,
.panel {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.signup-panel {
  display: grid;
  gap: 14px;
  padding: clamp(20px, 3vw, 30px);
}

.signup-panel h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.signup-form {
  display: grid;
  gap: 12px;
}

.signup-form .field {
  gap: 5px;
}

.signup-form .field input {
  min-height: 46px;
}

.signup-form .or-divider {
  margin: 0;
}

.signup-form .consent-row {
  padding: 12px;
  line-height: 1.35;
}

.signup-form .btn {
  min-height: 50px;
  padding: 10px 28px 12px;
}

.wallet-preview {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--sage);
}

.wallet-card {
  padding: 22px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(237, 24, 70, 0.22), transparent 60%),
    radial-gradient(ellipse 50% 70% at 0% 100%, rgba(249, 215, 123, 0.1), transparent 60%),
    var(--forest);
  color: var(--paper);
  box-shadow: var(--shadow-card);
}

.wallet-card-top,
.progress-label,
.panel-head,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tier-badge {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1;
}

.tier-badge small {
  display: block;
  margin-bottom: 4px;
  color: rgba(241, 244, 238, 0.55);
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.progress-label {
  margin: 18px 0 7px;
  color: rgba(241, 244, 238, 0.62);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

progress {
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(241, 244, 238, 0.16);
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background: rgba(241, 244, 238, 0.16);
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--gold), #ffe5a3);
  border-radius: var(--radius-pill);
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--gold), #ffe5a3);
  border-radius: var(--radius-pill);
}

.status-card progress {
  background: rgba(249, 215, 123, 0.24);
  box-shadow: inset 0 0 0 1px rgba(249, 215, 123, 0.2);
}

.status-card progress::-webkit-progress-bar {
  background: rgba(249, 215, 123, 0.24);
}

.wallet-metrics,
.quick-stats,
.snapshot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wallet-metric,
.quick-stat,
.metric {
  padding: 10px 12px;
  border: 1px solid rgba(241, 244, 238, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(241, 244, 238, 0.07);
}

.wallet-metric span,
.quick-stat .label,
.metric span {
  display: block;
  margin-bottom: 2px;
  color: rgba(241, 244, 238, 0.58);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wallet-metric strong,
.quick-stat .value,
.metric strong {
  color: var(--paper);
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
}

.quick-stat .supporting-value {
  margin: 4px 0 0;
  color: rgba(241, 244, 238, 0.7);
  font-size: 0.86rem;
  line-height: 1.35;
}

.account-top {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.status-card {
  padding: clamp(22px, 5vw, 36px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.status-card .tier-name {
  margin: 5px 0 8px;
  color: var(--paper);
  font-size: clamp(2.2rem, 8vw, 4rem);
}

.status-card .tier-rule {
  color: rgba(241, 244, 238, 0.76);
}

.status-card .sc {
  margin: 20px 0;
}

.status-card .physical-card-shell {
  margin: 20px 0;
}

.physical-card-shell {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 480 / 311.5;
  overflow: hidden;
  border-radius: 12px;
  background: var(--physical-card-page);
  container-type: inline-size;
}

.physical-card-art {
  position: relative;
  --physical-card-reference-width: 480px;
  --physical-card-reference-height: 311.5px;
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 16px 38px -14px rgba(0, 0, 0, 0.4);
  font-family: var(--sans);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.physical-card-brand-logo {
  position: absolute;
  left: 14.2917%;
  top: 5.0401%;
  width: 24.0833%;
  height: auto;
}

.physical-card-art[data-logo-variant="light"] .physical-card-brand-logo {
  filter: brightness(0) invert(1);
}

.physical-card-brand-subtitle {
  position: absolute;
  left: 14.2917%;
  top: 28.9246%;
  width: 24.0833%;
  color: var(--card-fg);
  font-size: 1.875cqw;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
}

.physical-card-divider {
  position: absolute;
  left: 44.0833%;
  top: 5.0401%;
  width: 2px;
  height: 27.6726%;
  border-radius: 2px;
  background: var(--card-fg);
}

.physical-card-headline {
  position: absolute;
  left: 48.9792%;
  top: 4.397%;
  width: 48.1042%;
}

.physical-card-headline-line {
  color: var(--headline-color);
  font-family: var(--serif);
  font-size: 4.375cqw;
  font-weight: 400;
  line-height: 1.12;
}

.physical-card-address {
  margin-top: 1.6667cqw;
  color: var(--address-color);
  font-size: 2.7084cqw;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.stamp-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.physical-card-art-slot {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  width: var(--slot-size);
  height: var(--slot-size);
  align-items: center;
  justify-content: center;
  border: var(--slot-border);
  border-radius: 50%;
  background: var(--slot-bg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.physical-card-slot-number {
  position: absolute;
  color: var(--physical-card-rasp);
  font-size: var(--slot-font-size);
  font-weight: 600;
  line-height: 1;
  opacity: 1;
  pointer-events: none;
}

.stamp-bird {
  position: absolute;
  width: 72%;
  color: var(--physical-card-rasp);
  filter: contrast(0.92) saturate(1.05);
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
  transform: rotate(var(--stamp-rotation, 0deg)) scale(0.5);
  transform-box: fill-box;
  transform-origin: center;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

input:checked + .physical-card-art-slot .stamp-bird {
  opacity: 0.68;
  transform: rotate(var(--stamp-rotation, 0deg)) scale(1);
}

.pc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: min(100%, 480px);
  margin-top: 8px;
  color: rgba(241, 244, 238, 0.84);
  font-size: 0.78rem;
  font-weight: 700;
}

.pc-meta strong {
  color: var(--gold);
}

.sc {
  position: relative;
  display: flex;
  width: min(100%, 360px);
  flex-direction: column;
  gap: 14px;
  padding: 22px 26px 20px;
  border-radius: 18px;
  cursor: default;
  isolation: isolate;
  overflow: hidden;
  user-select: none;
}

.sc-top,
.sc-footer,
.sc-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sc-brand {
  font-family: var(--serif);
  font-size: 0.9rem;
  letter-spacing: 0;
  line-height: 1;
}

.sc-badge {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.sc-identity,
.sc-progress {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.sc-identity {
  gap: 3px;
}

.sc-tier {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.sc-sub {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  opacity: 0.45;
  text-transform: uppercase;
}

.sc-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sc-dot {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.sc-meta {
  align-items: baseline;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
}

.sc-divider {
  position: relative;
  z-index: 1;
  height: 1px;
}

.sc-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc[data-t="basic"] {
  background: var(--paper);
  box-shadow:
    0 0 0 1.5px rgba(20, 57, 54, 0.09),
    0 8px 28px rgba(7, 21, 20, 0.07),
    0 2px 6px rgba(7, 21, 20, 0.04);
}

.sc[data-t="normal"] {
  background:
    radial-gradient(ellipse 100% 60% at 100% -5%, rgba(237, 24, 70, 0.14), transparent 55%),
    var(--forest);
  box-shadow:
    0 10px 36px rgba(7, 21, 20, 0.28),
    0 2px 8px rgba(7, 21, 20, 0.2);
}

.sc[data-t="top"] {
  background:
    radial-gradient(ellipse 90% 50% at 100% 0%, rgba(249, 215, 123, 0.18), transparent 55%),
    #071514;
  box-shadow:
    0 0 0 1px rgba(249, 215, 123, 0.15),
    0 12px 44px rgba(7, 21, 20, 0.55),
    0 3px 10px rgba(7, 21, 20, 0.32);
}

.sc::before {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 18px 0 0 18px;
  background: var(--red);
  content: "";
}

.sc[data-t="top"]::before {
  background: var(--gold);
}

.sc[data-t="basic"] .sc-brand,
.sc[data-t="basic"] .sc-tier,
.sc[data-t="basic"] .sc-name,
.sc[data-t="basic"] .sc-meta strong {
  color: var(--forest);
}

.sc[data-t="basic"] .sc-badge {
  background: rgba(237, 24, 70, 0.08);
  color: var(--red);
}

.sc[data-t="basic"] .sc-sub,
.sc[data-t="basic"] .sc-meta {
  color: var(--brown-soft);
}

.sc[data-t="basic"] .sc-dot.on,
.sc[data-t="normal"] .sc-dot.on {
  background: var(--red);
}

.sc[data-t="basic"] .sc-dot.off {
  border: 2px solid rgba(20, 57, 54, 0.22);
}

.sc[data-t="basic"] .sc-stamps {
  display: grid;
  grid-template-columns: repeat(5, 24px);
}

.sc[data-t="basic"] .sc-divider {
  background: rgba(20, 57, 54, 0.08);
}

.sc[data-t="normal"] .sc-brand,
.sc[data-t="normal"] .sc-sub,
.sc[data-t="normal"] .sc-meta {
  color: rgba(241, 244, 238, 0.62);
}

.sc[data-t="normal"] .sc-tier,
.sc[data-t="normal"] .sc-name,
.sc[data-t="normal"] .sc-meta strong {
  color: var(--paper);
}

.sc[data-t="normal"] .sc-badge {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(241, 244, 238, 0.68);
}

.sc[data-t="normal"] .sc-dot.off {
  border: 2px solid rgba(241, 244, 238, 0.38);
}

.sc[data-t="normal"] .sc-divider {
  background: rgba(255, 255, 255, 0.1);
}

.sc[data-t="top"] .sc-brand,
.sc[data-t="top"] .sc-sub,
.sc[data-t="top"] .sc-meta {
  color: rgba(249, 215, 123, 0.62);
}

.sc[data-t="top"] .sc-tier,
.sc[data-t="top"] .sc-name {
  color: var(--paper);
}

.sc[data-t="top"] .sc-badge {
  background: rgba(249, 215, 123, 0.12);
  color: var(--gold);
}

.sc[data-t="top"] .sc-dot.on {
  background: var(--gold);
}

.sc[data-t="top"] .sc-meta strong {
  color: var(--gold);
}

.sc[data-t="top"] .sc-dot.off {
  border: 2px solid rgba(249, 215, 123, 0.35);
}

.sc[data-t="top"] .sc-divider {
  background: rgba(249, 215, 123, 0.1);
}

.next-card-ribbon {
  display: grid;
  gap: 4px;
  margin: 4px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(249, 215, 123, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(249, 215, 123, 0.14);
  color: rgba(241, 244, 238, 0.8);
}

.next-card-ribbon strong {
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
}

.next-card-ribbon span {
  font-size: 0.88rem;
}

.reward-banner {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(249, 215, 123, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(249, 215, 123, 0.16);
  color: var(--gold);
  font-family: var(--serif);
}

.reward-banner-icon,
.avatar-pill {
  display: inline-grid;
  border-radius: 50%;
  font-family: var(--serif);
  place-items: center;
}

.reward-banner-icon {
  width: 32px;
  height: 32px;
  background: var(--gold);
  color: var(--forest);
}

.avatar-pill {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  aspect-ratio: 1;
  background: var(--forest);
  color: var(--paper);
}

.content-grid {
  display: grid;
  gap: 16px;
}

.panel {
  padding: 18px;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.history-row:first-of-type {
  border-top: 0;
}

.history-icon {
  display: grid;
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--forest);
  font-family: var(--serif);
  place-items: center;
}

.history-icon.reward {
  background: rgba(249, 215, 123, 0.32);
  color: #8b6a16;
}

.history-meta {
  flex: 1;
}

.history-meta .what {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}

.history-meta .when,
.rules-text {
  color: var(--body);
  font-size: 0.88rem;
}

.history-amount {
  color: var(--forest);
  font-family: var(--serif);
}

.history-amount.reward {
  color: var(--red);
}

.rules-text {
  line-height: 1.55;
}

.scanner-shell {
  width: min(100%, 1160px);
  padding-top: 0;
}

.topbar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(20, 57, 54, 0.08);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.role-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest);
  content: "";
}

.staff-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  color: var(--forest);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.staff-nav-link:hover {
  color: var(--red);
}

.staff-nav-link.is-active {
  background: var(--forest);
  color: var(--paper);
}

.staff-nav-link.is-active:hover {
  color: var(--paper);
}

.staff-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  background: var(--sage);
}

.scanner-workspace {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  min-width: 0;
  padding: 18px 20px 60px;
}

.scanner-scan-panel {
  position: relative;
  display: grid;
  min-height: 440px;
  padding: 20px;
  color: var(--paper);
  overflow: hidden;
  place-items: center;
  text-align: center;
}

.scanner-scan-panel::before {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(20, 57, 54, 0.14);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 80% 60% at 80% 10%, rgba(237, 24, 70, 0.16), transparent 60%),
    radial-gradient(ellipse 70% 60% at 10% 100%, rgba(249, 215, 123, 0.08), transparent 70%),
    var(--forest);
  content: "";
}

.scanner-scan-panel video {
  position: absolute;
  inset: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  border: 0;
  border-radius: 12px;
  object-fit: cover;
}

.scanner-scan-panel video:not([hidden]) + .scan-overlay {
  background: rgba(7, 21, 20, 0.28);
}

.scan-overlay {
  position: absolute;
  inset: 14px;
  display: grid;
  z-index: 1;
  border-radius: 12px;
  overflow: hidden;
  padding-top: clamp(72px, 16%, 120px);
  place-items: start center;
}

.scan-frame {
  position: relative;
  width: min(36%, 150px);
  aspect-ratio: 1;
  border-radius: 18px;
}

.scan-frame::before,
.scan-frame::after,
.scan-frame .corner-tr,
.scan-frame .corner-br {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
  content: "";
}

.scan-frame::before {
  top: 0;
  left: 0;
  border-top-width: 3px;
  border-left-width: 3px;
  border-top-left-radius: 14px;
}

.scan-frame::after {
  right: 0;
  bottom: 0;
  border-right-width: 3px;
  border-bottom-width: 3px;
  border-bottom-right-radius: 14px;
}

.scan-frame .corner-tr {
  top: 0;
  right: 0;
  border-top-width: 3px;
  border-right-width: 3px;
  border-top-right-radius: 14px;
}

.scan-frame .corner-br {
  bottom: 0;
  left: 0;
  border-bottom-width: 3px;
  border-left-width: 3px;
  border-bottom-left-radius: 14px;
}

.scan-laser {
  position: absolute;
  top: 50%;
  right: 6%;
  left: 6%;
  height: 2px;
  animation: scan-pulse 2.4s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  box-shadow: 0 0 12px rgba(237, 24, 70, 0.6);
}

@keyframes scan-pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: translateY(-32px);
  }

  50% {
    opacity: 1;
    transform: translateY(32px);
  }
}

.camera-caption {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  max-width: 36ch;
  margin-top: 230px;
}

.camera-caption h2 {
  color: var(--paper);
  font-size: 1.6rem;
}

.camera-caption p {
  margin-top: 6px;
  color: rgba(241, 244, 238, 0.74);
  font-size: 0.88rem;
}

.camera-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.camera-actions .btn-outline {
  border-color: rgba(241, 244, 238, 0.4);
  color: var(--paper);
}

.camera-actions .btn-outline:hover {
  border-color: var(--paper);
}

.scanner-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.insights-shell {
  width: min(100%, 1160px);
  padding-top: 0;
}

.insights-topbar,
.period-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
}

.insights-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px 20px;
  flex-wrap: wrap;
}

.insights-topbar-left,
.insights-topbar-right,
.period-bar-left,
.seg-group,
.location-sub {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-sep {
  width: 1px;
  height: 28px;
  background: var(--line);
}

.page-label {
  display: grid;
  gap: 1px;
}

.page-label h1 {
  font-size: 1rem;
  line-height: 1.2;
}

.period-bar {
  padding: 10px 20px;
  flex-wrap: wrap;
}

.period-bar-left {
  flex-wrap: wrap;
}

.seg-group {
  gap: 0;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 18px;
  border-right: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.seg-btn:last-child {
  border-right: 0;
}

.seg-btn:hover:not(.seg-active) {
  background: var(--sage);
  color: var(--forest);
}

.seg-btn.seg-active {
  background: var(--forest);
  color: var(--paper);
}

.period-caption {
  color: var(--muted);
  font-size: 0.82rem;
}

.insights-body {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 18px 20px 60px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kpi-card {
  display: grid;
  gap: 3px;
  padding: 14px 16px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.kpi-helper {
  max-width: 24ch;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.kpi-label,
.panel-eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kpi-value {
  color: var(--forest);
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.customers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.insights-grid > .panel {
  min-width: 0;
  overflow: hidden;
}

.customers-table th,
.customers-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.customers-table th {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.customers-table tbody tr:last-child td {
  border-bottom: 0;
}

.customers-table tbody tr:hover {
  background: var(--sage);
}

.customers-table th:nth-child(3),
.customers-table th:nth-child(4),
.customers-table th:nth-child(5),
.customers-table td:nth-child(3),
.customers-table td:nth-child(4),
.customers-table td:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rank-badge {
  display: inline-grid;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  place-items: center;
}

.rank-badge.gold {
  background: var(--gold);
  color: #7a5e10;
}

.rank-badge.silver {
  background: #e4e2dd;
  color: #555050;
}

.rank-badge.bronze {
  background: #e6d0bb;
  color: #7a4a28;
}

.rank-badge.plain {
  color: var(--muted);
}

.customer-name,
.location-name {
  color: var(--ink);
  font-weight: 700;
}

.coffee-count {
  color: var(--forest);
  font-family: var(--serif);
  font-size: 1rem;
}

.location-list {
  padding: 4px 0;
}

.location-row {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.location-row:last-child {
  border-bottom: 0;
}

.location-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.location-name {
  font-size: 0.92rem;
}

.location-pct {
  color: var(--muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 5px;
  border-radius: 3px;
  background: var(--sage);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--forest);
}

.location-sub {
  gap: 18px;
  margin-top: 7px;
}

.location-metric {
  color: var(--muted);
  font-size: 0.75rem;
}

.location-metric strong {
  color: var(--forest);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 400;
}

.empty-state {
  padding: 44px 24px;
  text-align: center;
}

.empty-state-glyph {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 2.2rem;
  line-height: 1;
}

.empty-state h3 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.empty-state p {
  max-width: 36ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.manual-card,
.customer-card,
.transaction-card {
  padding: 18px;
}

.customer-card {
  display: grid;
  gap: 14px;
}

.loaded-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(20, 57, 54, 0.16);
  border-radius: 8px;
  background: rgba(20, 57, 54, 0.08);
}

.loaded-status-mark {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  place-items: center;
}

.loaded-status h2 {
  color: var(--forest);
  font-size: 1.25rem;
}

.customer-card .metric {
  border-color: var(--line-soft);
  background: var(--sage);
}

.customer-card .metric span {
  color: var(--muted);
}

.customer-card .metric strong {
  color: var(--forest);
}

.customer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.customer-head > div {
  flex: 1 1 140px;
  min-width: 0;
}

.reward-pill {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(249, 215, 123, 0.32);
  color: #8b6a16;
  font-family: var(--serif);
  white-space: nowrap;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s, font-weight 0.2s;
}

.reward-pill.has-rewards {
  background: rgba(249, 215, 123, 0.52);
  color: #7a5000;
  font-weight: 700;
  box-shadow: 0 0 0 1.5px rgba(249, 215, 123, 0.72);
}

.scanner-progress-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--paper);
}

.scanner-next-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(249, 215, 123, 0.35);
  border-radius: 8px;
  background: rgba(249, 215, 123, 0.16);
}

.scanner-next-card strong {
  color: var(--forest);
  font-size: 0.98rem;
}

.scanner-next-card p {
  color: var(--body);
  font-size: 0.84rem;
  line-height: 1.35;
}

.scanner-progress-block > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.scanner-progress-block strong {
  color: var(--forest);
  font-size: 0.92rem;
  text-align: right;
}

.scanner-progress-block progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--sage);
}

.scanner-progress-block progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--sage);
}

.scanner-progress-block progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--gold);
}

.scanner-progress-block progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--gold);
}

.challenge-stamp-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.challenge-stamp-dots .sc-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}

.challenge-stamp-dots .sc-dot.on {
  background: var(--red);
}

.challenge-stamp-dots .sc-dot.off {
  border: 2px solid rgba(20, 57, 54, 0.22);
}

.challenge-stamp-dots .sc-dot.is-new {
  animation: dot-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes dot-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.detail-label,
.scanner-detail-grid dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scanner-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.scanner-detail-grid div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--sage);
}

.scanner-detail-grid dd {
  margin: 3px 0 0;
  color: var(--forest);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.transaction-card {
  display: grid;
  gap: 14px;
}

.transaction-card[hidden],
.customer-card[hidden],
.modal-backdrop[hidden],
.scanner-loading[hidden] {
  display: none;
}

.transaction-form {
  display: grid;
  gap: 14px;
}

.result-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  overflow-y: auto;
  padding: 16px;
  background: rgba(7, 21, 20, 0.64);
  backdrop-filter: blur(10px) saturate(0.85);
  place-items: center;
  -webkit-backdrop-filter: blur(10px) saturate(0.85);
}

.confirmation-modal {
  position: relative;
  width: min(100%, 492px);
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow:
    0 2px 0 1px rgba(255, 255, 255, 0.06) inset,
    0 48px 96px rgba(7, 21, 20, 0.55),
    0 12px 28px rgba(7, 21, 20, 0.28);
  overflow-x: hidden;
  overflow-y: auto;
  animation: modal-enter 0.32s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-top {
  display: grid;
  gap: 4px;
  padding: 28px 28px 26px;
  background:
    radial-gradient(ellipse 90% 55% at 88% 0%, rgba(237, 24, 70, 0.24), transparent 55%),
    radial-gradient(ellipse 70% 70% at 5% 115%, rgba(249, 215, 123, 0.09), transparent 65%),
    var(--forest);
  place-items: center;
  text-align: center;
}

.modal-check {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--paper);
  animation: check-pop 0.45s 0.06s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  place-items: center;
}

@keyframes check-pop {
  from {
    opacity: 0;
    transform: scale(0.3);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.check-path {
  stroke-dasharray: 25;
  stroke-dashoffset: 25;
  animation: draw-check 0.38s 0.32s ease forwards;
}

@keyframes draw-check {
  to {
    stroke-dashoffset: 0;
  }
}

.modal-top .eyebrow {
  margin-bottom: 2px;
  color: rgba(249, 215, 123, 0.78);
}

.modal-customer-name {
  max-width: 22ch;
  color: var(--paper);
  font-size: clamp(1.55rem, 4vw, 1.95rem);
  line-height: 1.05;
  text-align: center;
  overflow-wrap: anywhere;
  animation: name-in 0.35s 0.12s ease both;
}

@keyframes name-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-contact-line {
  max-width: 100%;
  margin-top: 3px;
  color: rgba(241, 244, 238, 0.56);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  animation: name-in 0.35s 0.18s ease both;
}

.modal-body {
  display: grid;
  gap: 14px;
  padding: 20px 24px 16px;
}

.change-section-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.change-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.change-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px 7px;
  border-radius: var(--radius-pill);
  font-family: var(--serif);
  font-size: 1rem;
  animation: pill-pop 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes pill-pop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.change-pill.c-added {
  border: 1px solid rgba(20, 57, 54, 0.15);
  background: rgba(20, 57, 54, 0.1);
  color: var(--forest);
}

.change-pill.c-redeemed {
  border: 1px solid rgba(249, 215, 123, 0.42);
  background: rgba(249, 215, 123, 0.28);
  color: #7a5e10;
}

.change-pill.c-neutral {
  border: 1px solid var(--line-soft);
  background: var(--sage);
  color: var(--body);
}

.confirmation-modal .sc {
  width: 100%;
  gap: 11px;
  padding: 18px 20px 16px;
  border-radius: var(--radius-md);
  animation: card-in 0.35s 0.1s ease both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirmation-modal .sc-tier {
  font-size: 1.55rem;
}

.confirmation-modal .sc-dot.is-new {
  animation: sc-dot-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes sc-dot-pop {
  from {
    opacity: 0;
    transform: scale(0);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.state-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.state-chip {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--paper);
  text-align: center;
}

.state-chip .sc-label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.state-chip .sc-value {
  color: var(--forest);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.milestone-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: 1px solid rgba(249, 215, 123, 0.42);
  border-radius: var(--radius-sm);
  background: rgba(249, 215, 123, 0.16);
  animation: banner-slide 0.4s 0.28s ease both;
}

@keyframes banner-slide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.milestone-icon {
  display: grid;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: #7a5e10;
  font-family: var(--serif);
  font-size: 1.1rem;
  place-items: center;
}

.milestone-text {
  display: grid;
  gap: 2px;
}

.milestone-text strong {
  color: #7a5000;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
}

.milestone-text span {
  color: #8b7030;
  font-size: 0.8rem;
}

.modal-footer {
  display: grid;
  gap: 8px;
  padding: 4px 24px 24px;
  animation: footer-in 0.3s 0.2s ease both;
}

@keyframes footer-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-ghost-text {
  width: 100%;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  text-align: center;
  text-decoration: underline;
  text-decoration-color: rgba(138, 122, 100, 0.4);
  text-underline-offset: 3px;
  transition:
    color 0.15s ease,
    text-decoration-color 0.15s ease;
}

.btn-ghost-text:hover {
  color: var(--red);
  text-decoration-color: rgba(237, 24, 70, 0.4);
}

.reversal-section {
  display: grid;
  gap: 12px;
  padding: 18px 24px 24px;
  border-top: 1px dashed var(--line);
  animation: modal-enter 0.25s ease both;
}

.reversal-section h3 {
  color: var(--red);
  font-size: 1rem;
}

.reversal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.transaction-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 196px);
  gap: 12px;
  align-items: center;
}

.physical-card-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.physical-card-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.physical-card-meta {
  display: grid;
  gap: 4px;
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.physical-card-slots {
  display: grid;
  grid-template-columns: repeat(6, minmax(38px, 1fr));
  gap: 8px;
}

.physical-card-stage {
  display: block;
}

.physical-card-stage .physical-card-shell {
  margin: 0;
}

.physical-card-art-slot.is-selected {
  outline: 4px solid rgba(255, 248, 197, 0.78);
  outline-offset: 3px;
}

.physical-card-art-slot.is-disabled {
  cursor: not-allowed;
}

.physical-card-actions {
  margin-top: 10px;
}

.confirmation-physical-card {
  margin: 0;
}

.scanner-loading {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  background: rgba(7, 21, 20, 0.46);
  backdrop-filter: blur(6px);
  place-items: center;
}

.scanner-loading-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(320px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--forest);
  box-shadow: 0 24px 60px rgba(7, 21, 20, 0.28);
}

.scanner-loading-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(20, 57, 54, 0.18);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.78s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.physical-card-slot {
  min-height: 44px;
  border: 1px solid rgba(20, 57, 54, 0.2);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--forest);
  font-weight: 800;
  cursor: pointer;
}

.physical-card-slot.is-free {
  border-color: rgba(181, 37, 37, 0.45);
  color: var(--red);
}

.physical-card-slot.is-filled,
.physical-card-slot.is-redeemed,
.physical-card-slot.is-banked {
  background: var(--forest);
  color: #fff;
  cursor: default;
}

.physical-card-slot.is-selected {
  outline: 3px solid rgba(181, 37, 37, 0.28);
  border-color: var(--red);
}

.physical-card-slot:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.card-override-panel {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

.card-override-panel summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}

.card-override-panel[open] summary {
  color: var(--forest);
  margin-bottom: 14px;
}

.card-override-form {
  display: grid;
  gap: 14px;
}

.card-override-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.override-card-picker {
  background: rgba(247, 244, 239, 0.72);
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 46px minmax(56px, 1fr) 46px;
  gap: 6px;
  align-items: center;
}

.quantity-btn {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--sage);
  color: var(--forest);
  cursor: pointer;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.quantity-btn:hover {
  border-color: rgba(20, 57, 54, 0.28);
  background: rgba(20, 57, 54, 0.1);
}

.quantity-input {
  min-width: 0;
  text-align: center;
}

.summary-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.9rem;
}

.summary-line .value {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .join-layout,
  .scanner-workspace,
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .join-hero {
    min-height: 0;
  }

  .scanner-scan-panel {
    min-height: 360px;
  }

  .scan-overlay {
    padding-top: 58px;
  }

  .scan-frame {
    width: 118px;
  }

  .camera-caption {
    margin-top: 190px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    padding: 20px 14px 44px;
  }

  .tier-row,
  .wallet-metrics,
  .quick-stats,
  .snapshot,
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topbar,
  .insights-topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-right,
  .insights-topbar-right {
    align-items: flex-start;
    flex-direction: column;
  }

  .insights-body,
  .scanner-workspace,
  .period-bar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .transaction-row {
    grid-template-columns: 1fr;
  }

  .card-override-grid {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .confirmation-modal {
    max-height: calc(100dvh - 20px);
    border-radius: 24px 24px 20px 20px;
  }

  .modal-top {
    padding: 24px 20px 22px;
  }

  .modal-body {
    padding: 18px 18px 14px;
  }

  .confirmation-physical-card .physical-card-shell {
    width: min(100%, 420px);
    justify-self: center;
  }

  .state-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .state-chip {
    padding: 8px 9px;
  }

  .state-chip .sc-label {
    letter-spacing: 0.06em;
  }

  .state-chip .sc-value {
    line-height: 1.08;
    overflow-wrap: break-word;
  }

  .modal-footer,
  .reversal-section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .reversal-actions {
    grid-template-columns: 1fr;
  }

  .scanner-detail-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    margin-right: -18px;
    margin-left: -18px;
    padding: 0 18px 8px;
  }

  .customers-table {
    min-width: 520px;
  }

  .customers-table .customer-name {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .camera-caption {
    max-width: 28ch;
    margin-top: 180px;
  }
}
