/* ==========================================================================
   Chup — Design System
   Loyalty stamp-card platform by Keyva  ·  chup.keyva.app
   Brand: Orange (#FF6A00) + Gold (#FFC107) + Navy (#1B2A4A)
          + accents Teal (#00C2D1), Purple (#8B5CF6), Pink (#FF4DA6)
   Type:  Poppins (friendly, modern)
   --------------------------------------------------------------------------
   This layer sits on top of the Bootstrap/Sneat theme. It (1) defines the
   Chup brand tokens, (2) re-skins the underlying theme's primary color, and
   (3) provides a small reusable component library used across all pages.
   Legacy --bjaur-* variables are aliased to Chup tokens so any not-yet-
   migrated markup still adopts the new brand automatically.
   ========================================================================== */

/* ----------------------------------------------------------------- Tokens */
:root {
  /* Brand — Orange (primary) */
  --chup-primary:        #FF6A00;
  --chup-primary-600:    #E85F00;
  --chup-primary-700:    #C74E00;
  --chup-primary-300:    #FF9445;
  --chup-primary-100:    #FFDCBF;
  --chup-primary-050:    #FFF3EA;
  --chup-primary-bg:     #FFF3EA;
  --chup-primary-rgb:    255, 106, 0;

  /* Brand — Gold / yellow (rewards / stamps) */
  --chup-gold:           #FFC107;
  --chup-gold-600:       #E0A500;
  --chup-gold-100:       #FFEFC2;
  --chup-gold-bg:        #FFF8E6;
  --chup-gold-rgb:       255, 193, 7;

  /* Brand — Navy (deep colour for cards / headings) */
  --chup-ink:            #1B2A4A;
  --chup-ink-800:        #24365C;
  --chup-ink-700:        #2E4370;
  --chup-ink-rgb:        27, 42, 74;

  /* Brand — Teal accent */
  --chup-teal:           #00C2D1;
  --chup-teal-bg:        #E0F7FA;

  /* Brand accents (stamp variety / patterns) */
  --chup-purple:         #8B5CF6;
  --chup-purple-bg:      #F1ECFE;
  --chup-pink:           #FF4DA6;
  --chup-pink-bg:        #FFE7F3;

  /* Neutrals */
  --chup-bg:             #FFF7EE;   /* brand cream app background */
  --chup-surface:        #FFFFFF;
  --chup-border:         #EFE7DD;
  --chup-muted:          #8A8580;
  --chup-body:           #4B4842;
  --chup-heading:        var(--chup-ink);

  /* Semantic */
  --chup-success:        #12B886;
  --chup-warning:        #FFC107;
  --chup-danger:         #F0402C;
  --chup-info:           #3B82F6;

  /* Gradients */
  --chup-gradient:       linear-gradient(135deg, #FF8A3D 0%, #FF6A00 55%, #E85F00 100%);
  --chup-gradient-ink:   linear-gradient(150deg, #24365C 0%, #1B2A4A 100%);
  --chup-gradient-warm:  linear-gradient(135deg, #FFC107 0%, #FF6A00 100%);

  /* Elevation */
  --chup-shadow-sm:      0 1px 2px rgba(25,26,35,.06), 0 1px 3px rgba(25,26,35,.05);
  --chup-shadow:         0 4px 14px rgba(25,26,35,.08);
  --chup-shadow-lg:      0 18px 48px rgba(25,26,35,.14);
  --chup-shadow-brand:   0 10px 28px rgba(var(--chup-primary-rgb),.30);

  /* Radii */
  --chup-radius-sm:      10px;
  --chup-radius:         16px;
  --chup-radius-lg:      22px;
  --chup-radius-pill:    999px;

  /* Type — Poppins (friendly, modern) */
  --chup-font-display:   "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --chup-font-body:      "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ------------------------------------------------- Re-skin base theme --- */
/* Map Bootstrap / Sneat primary onto the Chup coral so stock components
   (buttons, links, form focus, badges, progress, etc.) adopt the brand. */
:root {
  --bs-primary:        #FF6A00;
  --bs-primary-rgb:    255, 106, 0;
  --bs-link-color:     #E85F00;
  --bs-link-hover-color: #C74E00;
  --bs-body-font-family: var(--chup-font-body);
}

/* Legacy bjaur aliases → Chup (keeps un-migrated markup on-brand) */
:root {
  --bjaur-purple:       var(--chup-primary);
  --bjaur-purple-dark:  var(--chup-primary-600);
  --bjaur-purple-light: var(--chup-primary-300);
  --bjaur-purple-bg:    var(--chup-primary-bg);
  --bjaur-indigo:       var(--chup-ink);
}

/* --------------------------------------------------------- Typography --- */
body {
  font-family: var(--chup-font-body);
  color: var(--chup-body);
}
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4,
.fw-bold, .fw-bolder,
.app-brand-text, .card-title {
  font-family: var(--chup-font-display);
  letter-spacing: -0.01em;
}
.text-heading { color: var(--chup-heading) !important; }

/* ------------------------------------------- Native mobile app feel --- */
/* Make the web app read like a native mobile app: crisp text, no rubber-band
   scroll or tap-flash, no accidental text selection on chrome, hidden
   scrollbars, and safe-area handling when installed to the home screen. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* Gentle fade so page-to-page navigation feels like app screen transitions.
   Opacity only — a transform on <body> would re-anchor the fixed bottom navs. */
@media (prefers-reduced-motion: no-preference) {
  body { animation: chup-screen-in .2s ease-out both; }
  @keyframes chup-screen-in { from { opacity: 0; } to { opacity: 1; } }
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;          /* no pull-to-refresh / bounce */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;           /* removes the 300ms tap delay */
}
/* Clean, scrollbar-less surface (content still scrolls) */
* { scrollbar-width: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* Kill the grey/blue tap flash and long-press callout on controls */
a, button, [role="button"], .btn,
.action-card, .appnav-item, .vnav-item, .tab-btn,
.stamp-slot, .lc-slide, .list-row, .method-tab {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
/* App chrome shouldn't behave like selectable web text */
.appnav, .vnav, .tab-btn, .btn, button,
.action-card, .stat-card, .lc-tap, .stamp-grid,
.lc-swipe-hint, .greeting-eyebrow, .section-title {
  -webkit-user-select: none;
  user-select: none;
}
/* Tactile press feedback on the main tappables */
.btn:active, .action-card:active, .lc-slide:active,
a.action-card:active, .join-btn:active {
  transform: scale(.98);
}
::selection { background: rgba(var(--chup-primary-rgb), .18); }
/* Clear the notch / status bar when launched as an installed PWA */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top, 0px); }
}

/* -------------------------------------------- "Café not on Chup?" CTA --- */
.suggest-cta {
  display: flex; align-items: center; gap: .85rem;
  padding: 1rem 1.1rem; margin-bottom: 1.5rem;
  text-decoration: none;
}
.suggest-cta-body { flex: 1; min-width: 0; }
.suggest-cta-title { margin: 0; font-weight: 700; font-size: .92rem; color: var(--chup-ink); }
.suggest-cta-sub { margin: .1rem 0 0; font-size: .76rem; color: var(--chup-muted); }
.suggest-cta-arrow { color: var(--chup-muted); font-size: 1.3rem; flex: none; }

/* ------------------------------------- Camera permission / error state --- */
.cam-error {
  text-align: center; padding: 1.4rem 1.1rem;
  background: var(--chup-bg); border: 1px solid var(--chup-border);
  border-radius: var(--chup-radius);
}
.cam-error-ic {
  width: 54px; height: 54px; border-radius: 50%; margin: 0 auto .75rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--chup-primary-bg); color: var(--chup-primary); font-size: 1.7rem;
}
.cam-error-title { margin: 0; font-weight: 700; font-size: .98rem; color: var(--chup-ink); }
.cam-error-help { margin: .4rem 0 1.1rem; font-size: .8rem; color: var(--chup-muted); line-height: 1.5; }
.cam-error-btn { width: 100%; }
.cam-error-link {
  display: block; width: 100%; margin-top: .7rem;
  background: none; border: 0; cursor: pointer;
  color: var(--chup-muted); font-size: .78rem; text-decoration: underline;
}

/* ----------------------------------------------- Bootstrap primary btn --- */
.btn-primary {
  --bs-btn-bg: var(--chup-primary);
  --bs-btn-border-color: var(--chup-primary);
  --bs-btn-hover-bg: var(--chup-primary-600);
  --bs-btn-hover-border-color: var(--chup-primary-600);
  --bs-btn-active-bg: var(--chup-primary-700);
  --bs-btn-active-border-color: var(--chup-primary-700);
  --bs-btn-disabled-bg: var(--chup-primary);
  --bs-btn-disabled-border-color: var(--chup-primary);
  box-shadow: var(--chup-shadow-brand);
}
.btn-outline-primary {
  --bs-btn-color: var(--chup-primary);
  --bs-btn-border-color: var(--chup-primary);
  --bs-btn-hover-bg: var(--chup-primary);
  --bs-btn-hover-border-color: var(--chup-primary);
  --bs-btn-active-bg: var(--chup-primary-600);
}
.text-primary { color: var(--chup-primary) !important; }
.bg-primary   { background-color: var(--chup-primary) !important; }
a { color: var(--chup-primary-600); }
a:hover { color: var(--chup-primary-700); }

/* ======================================================================
   Chup component library
   ====================================================================== */

/* Brand text helpers */
.text-chup        { color: var(--chup-primary) !important; }
.text-chup-gold   { color: var(--chup-gold-600) !important; }
.text-chup-ink    { color: var(--chup-ink) !important; }
.chup-bg          { background-color: var(--chup-bg) !important; }
.chup-surface     { background-color: var(--chup-surface) !important; }

/* Gradients */
.chup-gradient      { background: var(--chup-gradient); }
.chup-gradient-ink  { background: var(--chup-gradient-ink); }
.chup-gradient-warm { background: var(--chup-gradient-warm); }
.chup-gradient-text {
  background: var(--chup-gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Buttons ------------------------------------------------------------- */
/* NOTE: the Sneat template customizer re-injects the vendor theme stylesheet
   at runtime (after this file), so the base `.btn` rule would otherwise win on
   equal specificity. The paint properties below use !important so the Chup
   button variants stay authoritative over the vendor theme on every page. */
.btn-chup {
  background: var(--chup-primary) !important;
  border: 1px solid var(--chup-primary) !important;
  color: #fff !important;
  font-family: var(--chup-font-body);
  font-weight: 600;
  border-radius: var(--chup-radius-pill);
  padding: .65rem 1.4rem;
  box-shadow: var(--chup-shadow-brand);
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn-chup:hover,
.btn-chup:focus {
  background: var(--chup-primary-600) !important;
  border-color: var(--chup-primary-600) !important;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(var(--chup-primary-rgb), .38);
}
.btn-chup:active { background: var(--chup-primary-700) !important; transform: translateY(0); }
.btn-chup:disabled, .btn-chup.disabled { opacity: .55; box-shadow: none; }

.btn-chup-gradient {
  background: var(--chup-gradient) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--chup-radius-pill);
  padding: .65rem 1.4rem;
  box-shadow: var(--chup-shadow-brand);
  transition: transform .15s ease, box-shadow .2s ease;
}
.btn-chup-gradient:hover { color: #fff !important; transform: translateY(-1px); box-shadow: 0 16px 36px rgba(var(--chup-primary-rgb), .4); }

.btn-chup-ink {
  background: var(--chup-ink) !important;
  border: 1px solid var(--chup-ink) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--chup-radius-pill);
  padding: .65rem 1.4rem;
  transition: transform .15s ease, background-color .2s ease;
}
.btn-chup-ink:hover { background: var(--chup-ink-700) !important; color: #fff !important; transform: translateY(-1px); }

.btn-outline-chup {
  background: transparent !important;
  border: 1.5px solid var(--chup-primary) !important;
  color: var(--chup-primary) !important;
  font-weight: 600;
  border-radius: var(--chup-radius-pill);
  padding: .6rem 1.35rem;
  transition: all .2s ease;
}
.btn-outline-chup:hover { background: var(--chup-primary) !important; color: #fff !important; }

.btn-chup-soft {
  background: var(--chup-primary-bg) !important;
  border: 1px solid transparent !important;
  color: var(--chup-primary-700) !important;
  font-weight: 600;
  border-radius: var(--chup-radius-pill);
  padding: .6rem 1.3rem;
  transition: all .2s ease;
}
.btn-chup-soft:hover { background: var(--chup-primary-100) !important; color: var(--chup-primary-700) !important; }

/* Cards --------------------------------------------------------------- */
.chup-card {
  background: var(--chup-surface);
  border: 1px solid var(--chup-border);
  border-radius: var(--chup-radius);
  box-shadow: var(--chup-shadow-sm);
  transition: transform .18s ease, box-shadow .2s ease;
}
.chup-card-hover:hover { transform: translateY(-3px); box-shadow: var(--chup-shadow-lg); }
.chup-card-lg { border-radius: var(--chup-radius-lg); box-shadow: var(--chup-shadow); }

/* Auth split-panel (brand side) -------------------------------------- */
.chup-authbrand {
  background: var(--chup-gradient-ink);
  position: relative;
  overflow: hidden;
  color: #fff;
}
.chup-authbrand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(var(--chup-primary-rgb), .55) 0%, transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(var(--chup-gold-rgb), .35) 0%, transparent 45%);
  opacity: .9;
}
.chup-authbrand > * { position: relative; z-index: 1; }

/* Badges / pills ------------------------------------------------------ */
.chup-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .8rem;
  border-radius: var(--chup-radius-pill);
  font-size: .75rem; font-weight: 600; line-height: 1;
  background: var(--chup-primary-bg); color: var(--chup-primary-700);
}
.chup-badge-gold { background: var(--chup-gold-bg); color: var(--chup-gold-600); }
.chup-badge-teal { background: var(--chup-teal-bg); color: var(--chup-teal); }
.chup-badge-ink  { background: rgba(var(--chup-ink-rgb), .06); color: var(--chup-ink); }

/* Icon tiles ---------------------------------------------------------- */
.chup-icon-tile {
  width: 48px; height: 48px;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  font-size: 1.35rem;
  background: var(--chup-primary-bg); color: var(--chup-primary);
}
.chup-icon-tile.gold { background: var(--chup-gold-bg); color: var(--chup-gold-600); }
.chup-icon-tile.teal { background: var(--chup-teal-bg); color: var(--chup-teal); }
.chup-icon-tile.ink  { background: rgba(var(--chup-ink-rgb), .06); color: var(--chup-ink); }

/* Loyalty stamp grid (signature component) ---------------------------- */
.chup-stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: .6rem; }
.chup-stamp {
  aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--chup-primary-100);
  color: var(--chup-primary-100);
  font-size: 1.1rem;
}
.chup-stamp.filled {
  background: var(--chup-gradient-warm);
  border: 2px solid transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--chup-gold-rgb), .35);
}

/* Form controls ------------------------------------------------------- */
.chup-input,
.form-control.chup-input {
  border-radius: var(--chup-radius-sm);
  border: 1.5px solid var(--chup-border);
  padding: .7rem .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus,
.chup-input:focus {
  border-color: var(--chup-primary);
  box-shadow: 0 0 0 .2rem rgba(var(--chup-primary-rgb), .15);
}

/* Section label ------------------------------------------------------- */
.chup-eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--chup-primary);
}

/* Vertical menu active state (Sneat) --------------------------------- */
.menu-vertical .menu-item.active > .menu-link {
  background: var(--chup-primary-bg);
  color: var(--chup-primary-700);
}
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link {
  color: var(--chup-primary-700);
}

/* ============================================================================
   Loyalty card (shared) — the single source of truth for the card component.
   Used by the customer's hero card (index.html) and the vendor's live preview
   (vendor_index.html) so both render identically. Edit here, not per-page.
   ========================================================================== */
.loyalty-card {
  position: relative;
  overflow: hidden;
  background: var(--chup-gradient-ink);
  border-radius: 26px;
  padding: 1.5rem 1.4rem 1.65rem;
  color: #fff;
  box-shadow: 0 20px 44px rgba(25, 26, 35, .28);
  margin-bottom: 1.5rem;
}
.loyalty-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 12% 12%, rgba(var(--chup-primary-rgb), .6) 0%, transparent 45%),
    radial-gradient(circle at 95% 90%, rgba(var(--chup-gold-rgb), .34) 0%, transparent 48%);
  pointer-events: none;
}
/* diagonal gloss sheen */
.loyalty-card::after {
  content: '';
  position: absolute;
  top: -45%; left: -25%;
  width: 58%; height: 190%;
  z-index: 1;
  background: linear-gradient(105deg, rgba(255,255,255,.16), rgba(255,255,255,0) 62%);
  transform: rotate(12deg);
  pointer-events: none;
}
.loyalty-card > * { position: relative; z-index: 2; }
.loyalty-card.is-ready {
  box-shadow: 0 0 0 1.5px rgba(var(--chup-gold-rgb), .6), 0 22px 46px rgba(var(--chup-gold-rgb), .3);
}

/* Vendor-uploaded card design — a full-bleed background photo. The dark scrim
   keeps the white logo/name/stamps legible over any image; the --lc-photo
   custom property is set inline per card. Applied wherever the .loyalty-card
   face renders. */
.loyalty-card.has-card-photo {
  background-image:
    linear-gradient(155deg, rgba(16,16,24,.60) 0%, rgba(16,16,24,.32) 45%, rgba(16,16,24,.72) 100%),
    var(--lc-photo);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Tone the decorative glows right down so the photo reads cleanly. */
.loyalty-card.has-card-photo::before { opacity: .3; }

.loyalty-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.15rem;
  gap: .9rem;
}
.lc-brand { display: flex; align-items: center; gap: .7rem; min-width: 0; }

.loyalty-card-logo {
  width: 52px;
  height: 52px;
  flex: none;
  object-fit: contain;
  background: #fff;
  border-radius: 15px;
  padding: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
/* Branded fallback tile (cafe initial) when a cafe has no logo */
.loyalty-card-logo--initial {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: var(--chup-gradient-warm);
  color: #fff;
  font-family: var(--chup-font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
}

.cafe-name {
  font-family: var(--chup-font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stamp grid — clean 5-column punch card */
.stamp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 1.15rem 0 .3rem;
}
.stamp-slot {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  border: 2px dashed rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}
.stamp-slot .stamp-icon {
  font-size: 1.15rem;
  color: rgba(255,255,255,.32);
}
.stamp-slot.filled {
  background: var(--chup-gradient-warm);
  border: 2px solid transparent;
  box-shadow: 0 5px 14px rgba(var(--chup-gold-rgb), .45), inset 0 1px 2px rgba(255,255,255,.55);
}
.stamp-slot.filled .stamp-icon { color: #fff; }
.stamp-slot.reward {
  background: rgba(var(--chup-gold-rgb), .18);
  border: 2px dashed var(--chup-gold);
}
.stamp-slot.reward .stamp-icon { color: var(--chup-gold); }
.stamp-slot.reward.filled {
  background: var(--chup-gradient-warm);
  border: 2px solid var(--chup-gold);
}
.stamp-slot.reward.filled .stamp-icon { color: #fff; }
/* Personalised stamp: the cafe's logo fills the collected stamp. */
.stamp-slot.filled.has-logo { background: #fff; overflow: hidden; padding: 0; }
.stamp-slot .stamp-logo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

@media (min-width: 576px) {
  .loyalty-card { padding: 1.9rem; }
  .loyalty-card-logo { width: 52px; height: 52px; }
  .cafe-name { font-size: 1.2rem; }
  .stamp-slot .stamp-icon { font-size: 1.35rem; }
}

/* ---- Achievement level headline ---- */
.ach-level { background: var(--chup-gradient-ink); color: #fff; border-radius: 18px; padding: 1rem 1.1rem; margin-bottom: 1.1rem; }
.ach-level-top { display: flex; align-items: center; gap: .7rem; }
.ach-level-ic { font-size: 1.9rem; line-height: 1; flex: none; }
.ach-level-body { flex: 1; min-width: 0; }
.ach-level-name { font-family: var(--chup-font-display); font-weight: 800; font-size: 1.1rem; margin: 0; color: #fff; }
.ach-level-sub { font-size: .74rem; color: rgba(255,255,255,.75); margin: .1rem 0 0; }
.ach-level-count { flex: none; font-size: .68rem; font-weight: 800; color: var(--chup-gold); background: rgba(255,255,255,.1); padding: .28rem .6rem; border-radius: 99px; }
.ach-level-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.15); margin-top: .85rem; overflow: hidden; }
.ach-level-fill { height: 100%; border-radius: 99px; background: var(--chup-gradient-warm); min-width: 6px; transition: width .5s ease; }

/* ---- Achievement badges (shared grid: Profile + Achievements page) ---- */
/* Compact medallion wall: a dense 4-up grid so many badges fit with little
   scrolling. Each medallion's gold ring (conic-gradient) doubles as a progress
   meter — full when earned, partial while locked. */
/* Progressive category sections — collapse to just the "current" rung; the
   header toggles the full ladder open. */
.ach-section { margin-bottom: 1.1rem; }
.ach-section:last-child { margin-bottom: 0; }
.ach-section-head {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  background: none; border: none; padding: 0; margin: 0 0 .55rem;
  cursor: pointer; text-align: left;
}
.ach-section-name { flex: 1; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--chup-ink); }
.ach-section-count { flex: none; font-size: .68rem; font-weight: 800; color: var(--chup-gold-600); }
.ach-section-chev { flex: none; display: inline-flex; color: var(--chup-muted); font-size: 1.25rem; }

/* Each category card shows its current-goal preview and opens a modal (the full
   grid) on tap — the grid now lives in .modal-body, not inline. */

.ach-current { display: flex; align-items: center; gap: .9rem; padding: .15rem .1rem .2rem; cursor: pointer; }
.ach-current:focus-visible { outline: 2px solid var(--chup-gold-600); outline-offset: 3px; border-radius: 12px; }
.ach-current .ach-medal { width: 52px; height: 52px; margin: 0; flex: none; }
.ach-current.earned .ach-medal-in { background: var(--chup-gold-bg); }
.ach-current.earned .ach-medal { box-shadow: 0 4px 11px rgba(var(--chup-gold-rgb), .28); }
.ach-current.locked .ach-medal-in { filter: grayscale(1); opacity: .5; }
.ach-current-body { flex: 1; min-width: 0; }
.ach-current-name { font-size: .92rem; font-weight: 800; color: var(--chup-ink); margin: 0; }
.ach-current.locked .ach-current-name { color: var(--chup-body); }
.ach-current-bar { height: 7px; border-radius: 99px; background: var(--chup-border); overflow: hidden; max-width: 220px; margin: .4rem 0 .3rem; }
.ach-current-fill { height: 100%; border-radius: 99px; background: var(--chup-gradient-warm); }
.ach-current-status { font-size: .72rem; font-weight: 700; color: var(--chup-gold-600); margin: 0; }
.ach-current.locked .ach-current-status { color: var(--chup-muted); }

/* The current rung stands out inside the expanded ladder. */
.ach-badge.is-current .ach-medal { box-shadow: 0 0 0 2px var(--chup-gold-600), 0 4px 11px rgba(var(--chup-gold-rgb), .25); }

.ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .95rem .3rem; }
.ach-badge { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; cursor: pointer; }
.ach-badge:focus-visible { outline: 2px solid var(--chup-gold-600); outline-offset: 3px; border-radius: 12px; }
.ach-medal {
  position: relative; width: 54px; height: 54px; border-radius: 50%; flex: none;
  margin-bottom: .35rem;
  background: conic-gradient(var(--chup-gold-600) calc(var(--pct, 0) * 1%), var(--chup-border) 0);
}
.ach-medal-in {
  position: absolute; inset: 3px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.35rem; line-height: 1;
  background: var(--chup-surface);
}
.ach-badge.earned .ach-medal-in { background: var(--chup-gold-bg); }
.ach-badge.earned .ach-medal { box-shadow: 0 4px 11px rgba(var(--chup-gold-rgb), .28); }
/* Locked: grey just the emoji; keep the ring + name legible. */
.ach-badge.locked .ach-medal-in { filter: grayscale(1); opacity: .5; }
.ach-name {
  font-size: .64rem; font-weight: 700; color: var(--chup-ink); margin: 0; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ach-badge.locked .ach-name { color: var(--chup-body); font-weight: 600; }
.ach-status { font-size: .56rem; font-weight: 800; color: var(--chup-gold-600); margin: .12rem 0 0; }
.ach-badge.locked .ach-status { color: var(--chup-muted); }
.ach-count { font-size: .78rem; font-weight: 800; color: var(--chup-primary); background: var(--chup-primary-bg); padding: .22rem .6rem; border-radius: 999px; }

/* Achievement detail — tap a medallion to open this sheet. */
.ach-modal-overlay {
  position: fixed; inset: 0; z-index: 1090;
  background: rgba(17, 24, 39, .55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 1.1rem;
}
.ach-modal-overlay.show { display: flex; animation: achFade .18s ease; }
@keyframes achFade { from { opacity: 0; } to { opacity: 1; } }
.ach-modal {
  position: relative; width: 100%; max-width: 340px; text-align: center;
  background: var(--chup-surface, #fff); border-radius: 20px;
  box-shadow: var(--chup-shadow-lg); padding: 1.7rem 1.4rem 1.5rem;
  animation: achPop .22s cubic-bezier(.16, 1, .3, 1);
}
@keyframes achPop { from { transform: translateY(12px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.ach-modal-close {
  position: absolute; top: .7rem; right: .7rem; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--chup-muted);
  font-size: 1.35rem; border-radius: 10px; cursor: pointer; transition: all .15s ease;
}
.ach-modal-close:hover { background: var(--chup-primary-bg); color: var(--chup-ink); }
.ach-modal-medal {
  display: block; position: relative; width: 86px; height: 86px; border-radius: 50%; margin: .1rem auto 1rem;
  background: conic-gradient(var(--chup-gold-600) calc(var(--pct, 0) * 1%), var(--chup-border) 0);
}
.ach-modal-medal-in {
  position: absolute; inset: 4px; border-radius: 50%;
  display: grid; place-items: center; font-size: 2.15rem; line-height: 1;
  background: var(--chup-gold-bg);
}
.ach-modal.is-locked .ach-modal-medal-in { background: var(--chup-surface); filter: grayscale(1); opacity: .5; }
.ach-modal-name { font-family: var(--chup-font-display); font-weight: 800; font-size: 1.2rem; color: var(--chup-ink); margin: 0; }
.ach-modal-cat { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--chup-gold-600); margin: .32rem 0 0; }
.ach-modal.is-locked .ach-modal-cat { color: var(--chup-muted); }
.ach-modal-desc { font-size: .86rem; color: var(--chup-body); margin: .85rem 0 0; line-height: 1.45; }
.ach-modal-prog { height: 8px; border-radius: 99px; background: var(--chup-border); margin: 1.15rem 0 .55rem; overflow: hidden; }
.ach-modal-prog-fill { height: 100%; border-radius: 99px; background: var(--chup-gradient-warm); transition: width .4s ease; }
.ach-modal-status { font-size: .78rem; font-weight: 700; color: var(--chup-gold-600); margin: 0; }
.ach-modal.is-locked .ach-modal-status { color: var(--chup-muted); }
/* Badge detail rendered inside the shared modal (.modal-content) — centre the
   medal/desc/status, and grey them out for a locked badge. */
.ach-detail { text-align: center; padding-top: .3rem; }
.ach-detail.is-locked .ach-modal-medal-in { background: var(--chup-surface); filter: grayscale(1); opacity: .5; }
.ach-detail.is-locked .ach-modal-status { color: var(--chup-muted); }
/* Badge insight — how to earn + rarity, in a tidy left-aligned block. */
.ach-info { text-align: left; margin: 1.15rem 0 .2rem; display: flex; flex-direction: column; gap: .7rem; }
.ach-info-row { display: flex; flex-direction: column; gap: .18rem; }
.ach-info-label { display: inline-flex; align-items: center; gap: .35rem; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: var(--chup-muted); }
.ach-info-label i { font-size: .95rem; color: var(--chup-gold-600); }
.ach-info-val { font-size: .86rem; font-weight: 600; color: var(--chup-ink); line-height: 1.45; }
.ach-rare-tag { display: inline-block; margin-left: .45rem; padding: .08rem .42rem; border-radius: 999px;
  background: var(--chup-primary-bg); color: var(--chup-primary-700); font-size: .66rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; vertical-align: .05em; }

/* ---- Passport badge summary card ---- */
.badge-summary {
  display: flex; align-items: center; gap: .7rem;
  background: var(--chup-gradient-ink); color: #fff;
  border-radius: var(--chup-radius-lg); padding: 1rem 1rem;
  text-decoration: none; margin-bottom: 1.5rem;
  box-shadow: 0 14px 34px rgba(25, 26, 35, .22);
}
.badge-summary-body { flex: 1; min-width: 0; }
.badge-summary-title { font-family: var(--chup-font-display); font-weight: 800; font-size: 1rem; margin: 0; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-summary-sub { font-size: .74rem; color: rgba(255,255,255,.7); margin: .15rem 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-summary-count {
  flex: none; padding: .45rem .55rem;
  display: flex; flex-direction: row; align-items: baseline; justify-content: center; gap: .22rem;
  border-radius: 14px; background: rgba(255,255,255,.09);
  font-family: var(--chup-font-display); font-weight: 800;
}
.badge-summary-count .n { font-size: 1.6rem; line-height: 1; color: var(--chup-gold); }
.badge-summary-count .d { font-size: .85rem; line-height: 1; color: rgba(255,255,255,.6); letter-spacing: .02em; }

/* Weekly visit-streak (🔥) folded into the Achievements card as a compact
   second stat pill; .is-risk tints it amber when this week isn't kept yet. */
.badge-summary-streak {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; min-width: 48px; padding: .38rem .45rem; border-radius: 14px;
  background: rgba(255,255,255,.09);
}
.badge-summary-streak .bss-top {
  display: inline-flex; align-items: center; gap: .18rem; line-height: 1;
  font-family: var(--chup-font-display); font-weight: 800; font-size: 1.25rem; color: var(--chup-gold);
}
.badge-summary-streak .bss-flame { font-size: .95rem; }
.badge-summary-streak .bss-unit {
  font-size: .55rem; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.6);
}
.badge-summary-streak.is-risk .bss-top,
.badge-summary-streak.is-risk .bss-unit { color: #FFC97A; }
.badge-summary .chev { color: rgba(255,255,255,.5); font-size: 1.3rem; flex: none; }

/* "Show off" control in the badge detail modal (leaderboard showcase). */
.ach-feature-btn {
  width: 100%; margin-top: 1.2rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .75rem; border-radius: var(--chup-radius); border: 1.5px solid var(--chup-gold-600);
  background: none; color: var(--chup-gold-600); font-family: inherit; font-weight: 800; font-size: .9rem; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ach-feature-btn i { font-size: 1.15rem; }
.ach-feature-btn.is-on { background: var(--chup-gold-600); border-color: var(--chup-gold-600); color: #fff; }
.ach-feature-full {
  margin-top: 1.2rem; text-align: center; font-size: .8rem; color: var(--chup-muted);
  display: flex; align-items: center; justify-content: center; gap: .35rem;
}
