/* Bike Shop Mini App — v2, openlocally-v3 design language.
 * Cream paper background, big rounded cards (24–32px), Outfit display +
 * Inter body + JetBrains Mono kicker labels, terracotta + mint accents.
 * Per-shop brand_color_primary overrides --brand (the pill / chip /
 * highlight colour); the base paper-and-cream palette stays consistent
 * across shops. Phone-shaped frame on desktop.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@500&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; width: 100%; }
html { background: #1a1a1a; }    /* outer "stage" colour on desktop */
body {
  font: 16px/1.55 Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--cream);
  /* On mobile (phone-shaped viewport) the body is a plain block container
     so #app fills the whole screen. On desktop the @media block below
     switches to a centred flex layout to draw the desktop phone-frame. */
}

:root {
  /* openlocally-v3 palette, brightened for dark-mode pop */
  --terracotta:   #E85A3A;
  --terracotta-2: #D44E2D;
  --sepia:        #C9A876;
  --mint:         #4FD4A0;
  --ink:          #1A1A1A;
  --ink-dim:      rgba(26, 26, 26, .65);
  --ink-muted:    rgba(26, 26, 26, .45);
  --cream:        #F0EAD9;
  --paper:        #F4EEDE;
  --paper-shade:  #EBE3CC;
  --rule:         rgba(26, 26, 26, .08);
  /* Per-shop overrides — set via JS from shops.brand_color_primary/_accent.
     Defaults match v3 so the demo looks like v3 if no override fires. */
  --brand:        var(--terracotta);
  --brand-accent: var(--mint);

  --topbar-h:     58px;
  --tabbar-h:     72px;
  --safe-top:     env(safe-area-inset-top, 0px);
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

body.theme-dark {
  --cream:       #15110d;
  --paper:       #1d1812;
  --paper-shade: #251f17;
  --ink:         #fdf9ec;
  --ink-dim:     rgba(253, 249, 236, .85);
  --ink-muted:   rgba(253, 249, 236, .62);
  --rule:        rgba(253, 249, 236, .1);
  background: #0a0805;
}

/* ───── App + splash containers — fill the viewport directly
   Using position: fixed + inset: 0 avoids the 100% height inheritance
   chain that can mis-compute inside Telegram's WebView before the
   viewport is established. dvh/dvw handle mobile address-bar resize. */
#app, #splash {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--cream);
}
#app { position: relative; }
#splash { position: fixed; }
/* Desktop-only phone-frame illusion. Mobile devices (Telegram WebView,
   Android Chrome, iOS Safari) skip this entirely and #app fills the
   viewport. The threshold is 900px wide AND 700px tall so even large
   foldables and landscape phones are treated as mobile. */
@media (min-width: 900px) and (min-height: 700px) {
  html, body { background: #1a1a1a; }
  body {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #app, #splash {
    position: relative;
    inset: auto;
    max-width: 440px;
    width: 440px;
    height: min(900px, calc(100vh - 32px));
    border-radius: 36px;
    overflow: hidden;
    box-shadow:
      0 0 0 8px #0c0a07,
      0 32px 80px rgba(0, 0, 0, .55),
      0 8px 24px rgba(0, 0, 0, .3);
  }
}

#app { display: grid; grid-template-rows: calc(var(--topbar-h) + var(--safe-top)) 1fr calc(var(--tabbar-h) + var(--safe-bottom)); }

/* ───── Splash ───── */
.splash { display: grid; place-items: center; z-index: 100; transition: opacity .25s ease; }
.splash.hidden { opacity: 0; pointer-events: none; }
.splash-mark { font-size: 56px; line-height: 1; }
.splash-name {
  margin-top: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ───── Top bar ───── */
.topbar {
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  padding: calc(10px + var(--safe-top)) 20px 10px;
  display: flex; align-items: center;
  cursor: pointer;     /* tapping the topbar = go Home */
}
.topbar:active { background: var(--paper); }
.topbar-shop { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  background: var(--paper); object-fit: cover;
}
.topbar-logo[src=""] { display: none; }
.topbar-text { min-width: 0; }
.topbar-name {
  font-family: Outfit, sans-serif; font-weight: 700; font-size: 16px;
  letter-spacing: -.01em; line-height: 1.15; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-town {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-muted);
  margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ───── Scrollable view ───── */
.view {
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 28px;
  scroll-behavior: smooth;
  background: var(--cream);
}
.view::-webkit-scrollbar { display: none; }

/* ───── Bottom tab bar ───── */
.tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--cream);
  border-top: 1px solid var(--rule);
  padding-bottom: var(--safe-bottom);
  padding-top: 6px;
}
.tab {
  background: transparent; border: 0; color: var(--ink-muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 6px 0;
  font: inherit; cursor: pointer;
  transition: color .15s ease;
}
.tab[aria-selected="true"] { color: var(--ink); }
.tab-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
}

/* ───── Reusable atoms ───── */
.kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-muted);
}
.h-display {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 36px; line-height: 1.02; letter-spacing: -.025em;
  color: var(--ink);
}
.h-display em { font-style: italic; color: var(--brand); font-weight: 500; }
.h-section {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 26px; line-height: 1.05; letter-spacing: -.02em;
  color: var(--ink);
}

.pill {
  background: var(--ink); color: var(--cream);
  border: 0; cursor: pointer;
  font: 500 13px/1 Inter, sans-serif;
  padding: 12px 20px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform .15s ease, background .15s ease;
}
.pill:active { transform: translateY(1px); }
.pill.pill-brand { background: var(--brand); }
.pill.pill-mint { background: var(--mint); color: var(--ink); }
.pill.pill-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule);
}

/* ───── Hero (home) ───── */
.hero {
  border-radius: 32px;
  background: var(--paper);
  padding: 28px 24px 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero-kicker { margin-bottom: 12px; }
.hero-headline { font-size: 32px; line-height: 1.02; letter-spacing: -.025em;
                 font-family: Outfit, sans-serif; font-weight: 700; color: var(--ink); }
.hero-headline em { font-style: italic; color: var(--brand); font-weight: 500; }
.hero-photo-wrap {
  margin-top: 20px;
  border-radius: 22px; overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--paper-shade);
}
.hero-photo { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ───── Section header ───── */
.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 16px;
  margin: 28px 4px 16px;
}
.section-head .h-section { max-width: 75%; }
.section-title {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 22px; line-height: 1.1; letter-spacing: -.018em;
  color: var(--ink);
  max-width: 75%;
}
.section-link {
  background: transparent; border: 0; cursor: pointer; padding: 6px 10px;
  font: 500 13px Inter; color: var(--brand); border-radius: 999px;
}
.section-link:active { background: var(--paper); }

/* ───── Big rounded cards ───── */
.cards { display: grid; gap: 16px; }
.card {
  background: var(--paper);
  border-radius: 24px;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.card:active { transform: translateY(2px); }
.card-img-wrap {
  aspect-ratio: 16 / 11;
  background: var(--paper-shade);
  position: relative; overflow: hidden;
}
.card-img { width: 100%; height: 100%; object-fit: cover; display: block;
            transition: transform .6s ease; }
.card:hover .card-img { transform: scale(1.04); }
.card-body { padding: 22px 24px 24px; }
.card-kicker { display: block; margin-bottom: 10px; color: var(--brand); }
.card-title {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 22px; line-height: 1.12; letter-spacing: -.015em;
  color: var(--ink);
}
.card-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: 14px 0 0;
}
.chip {
  font: 500 11px/1 'JetBrains Mono', monospace;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 999px;
  background: var(--cream); color: var(--ink-dim);
  border: 1px solid var(--rule);
}
.chip-brand { background: var(--brand); color: var(--cream); border-color: transparent; }
.chip-mint { background: var(--mint); color: var(--ink); border-color: transparent; }
.chip-grade-easy        { background: var(--mint); color: var(--ink); border-color: transparent; }
.chip-grade-intermediate{ background: #F5C26B; color: var(--ink); border-color: transparent; }
.chip-grade-advanced    { background: var(--terracotta); color: var(--cream); border-color: transparent; }
.chip-grade-expert      { background: var(--ink); color: var(--cream); border-color: transparent; }

.card-text {
  font-size: 14px; color: var(--ink-dim); line-height: 1.5; margin-top: 12px;
}
.card-cta-row { margin-top: 18px; display: flex; gap: 8px; }

/* Primary card CTA — full-width brand pill */
.card-cta {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; width: 100%;
  margin-top: 18px;
  padding: 14px 22px;
  border: 0; border-radius: 999px;
  background: var(--brand); color: var(--cream);
  cursor: pointer;
  font: 600 14px/1 Inter, system-ui, sans-serif;
  letter-spacing: -.005em;
  transition: transform .15s ease, filter .15s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}
.card-cta:active {
  transform: translateY(1px);
  filter: brightness(.92);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
}

/* Secondary card CTA — outline pill */
.card-cta.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  box-shadow: none;
}
body.theme-dark .card-cta.secondary {
  border-color: rgba(253, 249, 236, .22);
  color: var(--ink);
}
.card-cta.secondary:active {
  background: var(--paper-shade);
  transform: translateY(1px);
}

/* On tone-ink cards (rare — most cards are tone-paper), the CTA gets an
   accent that contrasts with the ink background. */
.tone-ink .card-cta {
  background: var(--mint); color: #1A1A1A;
}

/* ───── Card variants (rotating accent bg) ───── */
.card.tone-paper  { background: var(--paper); }
.card.tone-mint   { background: var(--mint); }
.card.tone-mint .card-kicker { color: var(--ink); opacity: .65; }
.card.tone-sepia  { background: var(--sepia); }
.card.tone-sepia .card-kicker { color: var(--ink); opacity: .65; }
.card.tone-ink    { background: var(--ink); color: var(--cream); }
.card.tone-ink .card-title { color: var(--cream); }
.card.tone-ink .card-text  { color: rgba(240, 234, 217, .8); }
.card.tone-ink .card-kicker { color: var(--mint); }
.card.tone-ink .chip { background: rgba(240, 234, 217, .12); color: var(--cream); border-color: transparent; }

/* ───── Deal price ───── */
.price-line { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.price-now {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 28px; line-height: 1; letter-spacing: -.02em;
  color: var(--brand);
}
.tone-ink .price-now { color: var(--mint); }
.price-was { font-size: 14px; color: var(--ink-muted); text-decoration: line-through; }
.price-free {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 20px; letter-spacing: -.01em;
  color: var(--brand);
}
.tone-ink .price-free { color: var(--mint); }

/* ───── Menu tiles (Home — primary feature grid, above the fold) ───── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 4px 0 28px;
}
.menu-tile {
  border-radius: 22px;
  padding: 18px 14px 16px;
  min-height: 122px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 0; cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  position: relative; overflow: hidden;
  transition: transform .2s ease;
}
.menu-tile:active { transform: translateY(2px); }
.menu-tile.tone-paper { background: var(--paper); color: var(--ink); }
.menu-tile.tone-paper-shade { background: var(--paper-shade); color: var(--ink); }
.menu-tile.tone-mint  { background: var(--mint); color: #1A1A1A; }
.menu-tile.tone-sepia { background: var(--sepia); color: #1A1A1A; }
.menu-tile.tone-terracotta { background: var(--terracotta); color: var(--cream); }
.menu-tile.tone-brand { background: var(--brand); color: var(--cream); }
.menu-tile.tone-ink   { background: #0c0a07; color: #fdf9ec; }
body.theme-dark .menu-tile.tone-ink { background: #fdf9ec; color: #1A1A1A; }
.menu-tile-icon {
  font-size: 26px; line-height: 1;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .35);
  border-radius: 14px;
}
.menu-tile.tone-paper .menu-tile-icon,
.menu-tile.tone-paper-shade .menu-tile-icon {
  background: var(--cream);
}
body.theme-dark .menu-tile.tone-paper .menu-tile-icon,
body.theme-dark .menu-tile.tone-paper-shade .menu-tile-icon {
  background: rgba(253, 249, 236, .13);
}
.menu-tile.tone-ink .menu-tile-icon { background: rgba(253, 249, 236, .14); }
body.theme-dark .menu-tile.tone-ink .menu-tile-icon { background: rgba(26, 26, 26, .08); }
.menu-tile-stack {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 4px;
}
.menu-tile-label {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 16px; line-height: 1.08; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.menu-tile-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  opacity: .72;
}

/* ───── More tab — info rows ───── */
.row-list { display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--paper);
  border-radius: 18px;
  cursor: pointer;
  border: 0; width: 100%;
  text-align: left; font: inherit; color: inherit;
}
.row:active { background: var(--paper-shade); }
.row-icon { font-size: 22px; flex: 0 0 auto; }
.row-text { flex: 1; min-width: 0; }
.row-title {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 15px; letter-spacing: -.005em; color: var(--ink);
}
.row-sub {
  font-size: 12px; color: var(--ink-muted); margin-top: 3px;
  white-space: pre-wrap;
}
.row-arrow { color: var(--ink-muted); font-size: 18px; }

/* ───── Empty / loading ───── */
.empty {
  padding: 28px 16px; text-align: center;
  color: var(--ink-muted); font-size: 13px;
  background: var(--paper); border-radius: 18px;
}
.skel {
  background: linear-gradient(90deg, var(--paper) 0%, var(--paper-shade) 50%, var(--paper) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 24px;
}
.skel-card { height: 220px; }
.skel-tile { height: 132px; border-radius: 24px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ───── Trail card additions ───── */
.card-trail { cursor: pointer; }
.card-trail .card-img-wrap { position: relative; }
.preview-badge {
  position: absolute; top: 12px; right: 12px;
  background: var(--brand); color: var(--cream);
  padding: 5px 9px; border-radius: 999px;
  font: 500 9px/1 'JetBrains Mono', monospace;
  letter-spacing: .2em; text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
  z-index: 2;
}
.trail-oneliner {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 16px; line-height: 1.28; letter-spacing: -.012em;
  color: var(--brand);
  margin-top: 10px;
}
.split-pills {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 16px;
}
.split-pill {
  border-radius: 16px; padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--rule);
}
.split-pill-good {
  background: rgba(168, 213, 186, .28);
  border-color: rgba(168, 213, 186, .55);
}
.split-pill-warn {
  background: rgba(245, 194, 107, .22);
  border-color: rgba(245, 194, 107, .5);
}
body.theme-dark .split-pill-good {
  background: rgba(168, 213, 186, .12);
  border-color: rgba(168, 213, 186, .25);
}
body.theme-dark .split-pill-warn {
  background: rgba(245, 194, 107, .12);
  border-color: rgba(245, 194, 107, .28);
}
.split-pill-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 6px;
}
.split-pill-text {
  font-size: 13px; line-height: 1.4; color: var(--ink);
}
@media (max-width: 380px) {
  .split-pills { grid-template-columns: 1fr; }
}

/* ───── Slide-up detail sheet ─────
   Sheet stops ABOVE the bottom tabbar so the 5-tab navigation stays
   visible while a sheet is open. The tabbar is persistent across every
   view, so users can switch tabs or close back to Home without losing
   their place. Android hardware back also wires through to closeSheet()
   via Telegram's BackButton API. */
.sheet {
  position: absolute;
  top: calc(var(--topbar-h) + var(--safe-top));
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  z-index: 80;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  display: flex; align-items: flex-end;
}
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .55);
}
.sheet-card {
  position: relative;
  width: 100%;
  background: var(--cream);
  border-radius: 28px 28px 0 0;
  height: 92%;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 -20px 50px rgba(0,0,0,.35);
}
.sheet.open .sheet-card { transform: translateY(0); }
.sheet-handle-row {
  display: flex; align-items: center; justify-content: center;
  position: relative;
  padding: 10px 16px 6px;
  flex: 0 0 auto;
}
.sheet-handle {
  width: 40px; height: 4px;
  background: var(--ink-muted);
  opacity: .5;
  border-radius: 2px;
}
.sheet-close {
  position: absolute; right: 12px; top: 4px;
  width: 44px; height: 44px;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 26px; font-weight: 500; line-height: 1;
  cursor: pointer; border-radius: 999px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  transition: transform .15s ease, background .15s ease;
}
.sheet-close:active {
  background: var(--paper-shade);
  transform: scale(.94);
}
.sheet-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-bottom) + 20px);
}
.sheet-scroll::-webkit-scrollbar { display: none; }
.sheet-img-wrap {
  margin: 6px 16px 0;
  border-radius: 20px; overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--paper-shade);
}
.sheet-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-body { padding: 20px 24px 0; }
.sheet-kicker { display: block; margin-bottom: 10px; color: var(--brand); }
.sheet-title {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 30px; line-height: 1.04; letter-spacing: -.022em;
  color: var(--ink);
}
.sheet-oneliner {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 18px; line-height: 1.3; letter-spacing: -.012em;
  color: var(--brand);
  margin-top: 12px;
}
.sheet-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.sheet-section { margin-top: 24px; }
.sheet-section .kicker { display: block; margin-bottom: 10px; }
.highlights-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 8px;
}
.highlights-list li {
  position: relative; padding-left: 22px;
  font-size: 14px; line-height: 1.45; color: var(--ink-dim);
}
.highlights-list li::before {
  content: ''; position: absolute; left: 6px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--brand);
}
.sheet-prose p {
  font-size: 15px; line-height: 1.6; color: var(--ink);
  margin-bottom: 14px;
}
.sheet-prose p:last-child { margin-bottom: 0; }
.sheet-cta { margin: 28px 0 8px; }
.sheet-cta .pill { width: 100%; justify-content: center; }

/* ───── Loyalty sheet ───── */
.stamp-card {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 20px 0 4px;
  padding: 18px;
  border-radius: 22px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.stamp {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 18px;
  font-family: Outfit, sans-serif;
  transition: transform .2s ease;
}
.stamp-on {
  background: var(--brand);
  color: var(--cream);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15);
}
.stamp-off {
  background: transparent;
  border: 1.5px dashed var(--rule);
  color: var(--ink-muted);
}
body.theme-dark .stamp-off { border-color: rgba(253, 249, 236, .2); }

.reward-list { display: grid; gap: 8px; }
.reward-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--paper);
  border-radius: 16px;
  border: 1px solid var(--rule);
  transition: opacity .15s ease;
}
.reward-row.reward-earned {
  border-color: var(--mint);
  background: linear-gradient(0deg, rgba(79, 212, 160, .12), rgba(79, 212, 160, .04));
}
body.theme-dark .reward-row.reward-earned {
  background: linear-gradient(0deg, rgba(79, 212, 160, .14), rgba(79, 212, 160, .06));
}
.reward-icon {
  font-size: 22px; line-height: 1;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--cream); border-radius: 12px;
  flex: 0 0 auto;
}
body.theme-dark .reward-icon { background: rgba(253, 249, 236, .08); }
.reward-text { flex: 1; min-width: 0; }
.reward-title {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 15px; line-height: 1.2; color: var(--ink);
}
.reward-sub {
  font-size: 12px; color: var(--ink-muted); margin-top: 3px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .12em; text-transform: uppercase;
}
.reward-tag {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--mint); color: #1A1A1A;
  border-radius: 50%;
  font-weight: 700; font-size: 13px;
  flex: 0 0 auto;
}

.earn-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.earn-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  border-radius: 14px;
  border: 1px solid var(--rule);
  font-size: 13px; color: var(--ink-dim);
  line-height: 1.25;
}
.earn-icon {
  font-size: 18px; line-height: 1;
  flex: 0 0 auto;
}
@media (max-width: 380px) {
  .earn-list { grid-template-columns: 1fr; }
}

.activity-list { display: grid; gap: 6px; }
.activity-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 10px 14px;
  background: transparent;
  border-bottom: 1px solid var(--rule);
}
.activity-row:last-child { border-bottom: 0; }
.activity-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted);
  flex: 0 0 auto;
  width: 60px;
}
.activity-label {
  font-size: 13px; color: var(--ink-dim); line-height: 1.35;
  flex: 1; min-width: 0;
}

.sheet-fineprint {
  margin-top: 14px;
  padding: 0 4px;
  font-size: 11px; line-height: 1.5;
  color: var(--ink-muted);
  text-align: center;
}

/* ───── Booking form ───── */
.tier-list { display: grid; gap: 8px; }
.tier-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 16px;
  cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.tier-row.tier-selected {
  border-color: var(--brand);
  background: linear-gradient(0deg, rgba(232, 90, 58, .08), transparent);
}
body.theme-dark .tier-row.tier-selected {
  background: linear-gradient(0deg, rgba(232, 90, 58, .12), transparent);
}
.tier-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--ink-muted);
  flex: 0 0 auto;
  display: grid; place-items: center;
  transition: border-color .15s ease;
}
.tier-selected .tier-radio {
  border-color: var(--brand);
}
.tier-selected .tier-radio::after {
  content: '';
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--brand);
}
.tier-text { flex: 1; min-width: 0; }
.tier-title {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 15px; color: var(--ink);
}
.tier-desc {
  font-size: 12px; color: var(--ink-muted); margin-top: 3px;
}
.tier-price {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 18px; color: var(--brand);
  text-align: right; flex: 0 0 auto;
  letter-spacing: -.01em;
}
.tier-was {
  font-size: 12px; color: var(--ink-muted);
  font-weight: 500; text-decoration: line-through;
  margin-top: 2px;
}

/* Form fields */
.field-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 14px;
  color: var(--ink);
  font: 500 15px Inter, system-ui, sans-serif;
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease;
}
.field-input:focus {
  outline: 0;
  border-color: var(--brand);
}
.field-input::placeholder { color: var(--ink-muted); }
body.theme-dark .field-input { background: var(--paper); }
.field-textarea { resize: vertical; min-height: 80px; font-family: inherit; }

/* Segment buttons (Disc / Rim) */
.segment-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-top: 8px;
}
.segment {
  padding: 12px 14px;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 14px;
  color: var(--ink-dim);
  font: 500 14px Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: all .15s ease;
}
.segment.segment-on {
  background: var(--brand);
  color: var(--cream);
  border-color: var(--brand);
}

/* Booking confirmation */
.book-confirm { text-align: center; }
.confirm-icon {
  width: 64px; height: 64px;
  margin: 20px auto 16px;
  display: grid; place-items: center;
  background: var(--mint); color: #1A1A1A;
  border-radius: 50%;
  font-size: 32px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(79, 212, 160, .35);
}
.confirm-title { text-align: center; }
.confirm-sub { text-align: center; }
.confirm-card {
  margin-top: 28px;
  padding: 20px 22px;
  background: var(--paper);
  border-radius: 18px;
  border: 1px solid var(--rule);
  text-align: left;
  display: grid; gap: 14px;
}
.confirm-row { display: grid; gap: 4px; }
.confirm-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-muted);
}
.confirm-value {
  font-size: 14px; line-height: 1.4; color: var(--ink);
}

/* ───── Visit shop sheet ───── */
.visit-map {
  margin: 8px 16px 0;
  border-radius: 20px;
  aspect-ratio: 2 / 1;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(79, 212, 160, .22) 0%, transparent 60%),
    linear-gradient(135deg, var(--paper-shade) 0%, var(--paper) 100%);
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid var(--rule);
  transition: transform .2s ease;
  overflow: hidden;
}
.visit-map::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(253,249,236,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(253,249,236,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
body:not(.theme-dark) .visit-map::before {
  background-image:
    linear-gradient(rgba(26,26,26,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,26,26,.05) 1px, transparent 1px);
}
.visit-map:active { transform: scale(.99); }
.visit-map-pin {
  font-size: 32px; line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.3));
  z-index: 1;
}
.visit-map-label {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 14px; color: var(--ink);
  text-align: center; padding: 0 20px;
  z-index: 1;
}
.visit-map-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-muted);
  z-index: 1;
}
.hours-block {
  white-space: pre-wrap;
  font-size: 14px; line-height: 1.55; color: var(--ink-dim);
  background: var(--paper);
  padding: 16px 18px; border-radius: 14px;
  border: 1px solid var(--rule);
}
.visit-actions { display: grid; gap: 8px; }
.visit-action {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
  font: 500 14px Inter, system-ui, sans-serif;
  color: var(--ink); cursor: pointer;
  text-align: left;
  transition: background .15s ease;
}
.visit-action:active { background: var(--paper-shade); }
.visit-action-icon { font-size: 20px; line-height: 1; flex: 0 0 auto; }

/* ───── Inline SVG icons ───── */
.ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1em; height: 1em;
  vertical-align: middle;
  line-height: 1;
}
.ico svg { width: 100%; height: 100%; display: block; }

/* Sizing in different contexts */
.tab-icon .ico, .tab-icon svg { width: 22px; height: 22px; }
.menu-tile-icon .ico, .menu-tile-icon svg { width: 24px; height: 24px; }
.visit-action-icon { font-size: 20px; }
.visit-action-icon.ico, .visit-action-icon svg { width: 20px; height: 20px; }
.inbox-icon.ico, .inbox-icon svg { width: 22px; height: 22px; }
.account-card-icon.ico, .account-card-icon svg { width: 22px; height: 22px; }

/* Make sure tab-icon container holds the SVG cleanly */
.tab-icon-wrap { width: auto; height: auto; background: transparent !important; }
.tab .tab-icon { display: grid; place-items: center; width: 36px; height: 32px;
                 background: transparent; border-radius: 14px;
                 transition: background .15s ease; }
.tab[aria-selected="true"] .tab-icon { background: var(--brand); color: var(--cream); }

/* Inbox badge on tab */
.tab { position: relative; }
.tab-badge {
  position: absolute; top: 0; right: calc(50% - 22px);
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--terracotta); color: var(--cream);
  font: 700 10px/18px Inter, sans-serif;
  text-align: center;
  box-shadow: 0 0 0 2px var(--cream);
}
body.theme-dark .tab-badge { box-shadow: 0 0 0 2px #0a0805; }

/* ───── Chat tab ───── */
.chat-view {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  margin: -20px -20px -28px;
}
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
}
.chat-header-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--brand); color: var(--cream);
  border-radius: 12px;
}
.chat-header-icon svg { width: 20px; height: 20px; }
.chat-header-name {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 15px; color: var(--ink);
}
.chat-header-sub {
  font: 500 10px/1.2 'JetBrains Mono', monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted); margin-top: 4px;
}
.chat-scroll {
  overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-scroll::-webkit-scrollbar { display: none; }
.chat-msg { display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14.5px; line-height: 1.45;
  background: var(--paper);
  color: var(--ink);
}
.chat-msg-user .chat-bubble {
  background: var(--brand); color: var(--cream);
  border-bottom-right-radius: 6px;
}
.chat-msg-assistant .chat-bubble {
  border-bottom-left-radius: 6px;
}
.chat-typing {
  display: inline-flex; gap: 5px; align-items: center;
  padding: 14px 18px;
}
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-muted);
  animation: chat-dot 1.2s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .18s; }
.chat-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .3; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }

.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
.chat-suggest {
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font: 500 13px Inter, system-ui, sans-serif;
  color: var(--ink-dim);
  cursor: pointer;
  text-align: left;
  transition: background .15s ease;
}
.chat-suggest:active { background: var(--paper-shade); }

.chat-composer {
  display: flex; gap: 8px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--cream);
  border-top: 1px solid var(--rule);
}
.chat-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  font: 500 15px Inter, system-ui, sans-serif;
  outline: none;
}
.chat-input::placeholder { color: var(--ink-muted); }
.chat-input:focus { border-color: var(--brand); }
.chat-send {
  width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: var(--brand); color: var(--cream);
  display: grid; place-items: center;
  cursor: pointer; flex: 0 0 auto;
}
.chat-send svg { width: 20px; height: 20px; }
.chat-send:active { transform: translateY(1px); }

/* ───── Inbox tab ───── */
.inbox-summary {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand);
  margin-top: 6px;
}
.inbox-list { display: grid; gap: 8px; }
.inbox-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: 0; border-radius: 16px;
  cursor: pointer; text-align: left;
  font: inherit; color: inherit; width: 100%;
  transition: background .15s ease;
}
.inbox-row:active { background: var(--paper-shade); }
.inbox-row.inbox-unread { border: 1px solid rgba(232, 90, 58, .35); }
.inbox-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--terracotta);
  margin-top: 7px; flex: 0 0 auto;
}
.inbox-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--cream); border-radius: 10px;
  color: var(--ink-dim);
  flex: 0 0 auto;
}
body.theme-dark .inbox-icon { background: rgba(253,249,236,.08); }
.inbox-text { flex: 1; min-width: 0; }
.inbox-subject {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 15px; color: var(--ink); line-height: 1.25;
  margin-bottom: 4px;
}
.inbox-unread .inbox-subject { font-weight: 700; }
.inbox-preview {
  font-size: 13px; color: var(--ink-muted); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.inbox-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 4px; flex: 0 0 auto;
}

/* ───── Account tab ───── */
.account-header {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 24px;
}
.account-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--brand); color: var(--cream);
  display: grid; place-items: center;
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 28px; letter-spacing: -.01em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
  margin-bottom: 14px;
}
.account-name {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 22px; color: var(--ink); letter-spacing: -.015em;
}
.account-handle {
  font: 500 11px/1 'JetBrains Mono', monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted); margin-top: 6px;
}
.account-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 24px;
}
.stat-tile {
  padding: 16px 12px; background: var(--paper);
  border-radius: 16px; border: 1px solid var(--rule);
  text-align: center;
}
.stat-num {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 28px; line-height: 1; color: var(--brand);
  letter-spacing: -.02em;
}
.stat-small {
  font-size: 14px; color: var(--ink-muted); font-weight: 500;
}
.stat-label {
  font: 500 10px/1 'JetBrains Mono', monospace;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-muted); margin-top: 8px;
}
.account-card {
  width: 100%;
  background: var(--paper);
  border: 0; border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
  cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  transition: background .15s ease;
}
.account-card:active { background: var(--paper-shade); }
.account-loyalty-card {
  background: linear-gradient(135deg, rgba(232, 90, 58, .14), rgba(79, 212, 160, .12));
  border: 1px solid var(--rule);
}
.account-card-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.account-card-icon {
  width: 36px; height: 36px;
  background: var(--brand); color: var(--cream);
  border-radius: 12px;
  display: grid; place-items: center;
}
.account-card-icon svg { width: 18px; height: 18px; }
.account-card-title {
  flex: 1;
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 17px; color: var(--ink);
}
.account-card-tag {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 16px; color: var(--brand);
}
.account-card-sub {
  font-size: 13px; color: var(--ink-dim); margin-bottom: 14px;
}
.mini-stamp-row {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px;
}
.mini-stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px dashed var(--rule);
}
.mini-stamp-on {
  background: var(--brand);
  border: 1.5px solid var(--brand);
}

/* ───── Spinning wheel ───── */
.wheel-block {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 12px 0;
}
.wheel-stage {
  width: 220px; height: 220px;
  position: relative;
  display: grid; place-items: center;
  filter: drop-shadow(0 14px 28px rgba(0,0,0,.25));
}
.wheel-svg { width: 100%; height: 100%; }
#wheel-rot { transform-origin: 80px 80px; }
.wheel-result {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 15px; color: var(--ink);
  text-align: center; min-height: 22px;
}
.wheel-btn {
  width: 100%;
  justify-content: center;
}
.wheel-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ───── Civic cards (CCC notices + DOC alerts) ───── */
.section-kicker-tag {
  font: 500 9px/1 'JetBrains Mono', monospace;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 8px;
}
.card-civic {
  cursor: pointer;
  border: 1px solid var(--rule);
}
.card-civic-ccc { border-left: 3px solid var(--mint); }
.card-civic-doc { border-left: 3px solid var(--sepia); }
.card-civic-closure { border-left: 3px solid var(--terracotta); }
.card-civic-warning { border-left: 3px solid #F5C26B; }
.civic-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.civic-source {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 10px/1 'JetBrains Mono', monospace;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-muted);
}
.civic-source .ico, .civic-source svg { width: 14px; height: 14px; }
.civic-tag {
  padding: 4px 10px; border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--rule);
  font: 500 9px/1 'JetBrains Mono', monospace;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-dim);
}
body.theme-dark .civic-tag { background: rgba(253,249,236,.08); }
.civic-tag-closure {
  background: var(--terracotta); color: var(--cream); border-color: transparent;
}
.civic-tag-warning {
  background: #F5C26B; color: #1A1A1A; border-color: transparent;
}
.civic-tag-info {
  background: var(--mint); color: #1A1A1A; border-color: transparent;
}
.civic-title { font-size: 18px; line-height: 1.18; }
.civic-trail {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink-dim);
  margin-top: 6px;
}

/* ───── Course Info / Clubhouse / Notice Board extras (golf) ───── */
.sheet-hero-img {
  margin: 6px 16px 0;
  border-radius: 20px; overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--paper-shade);
}
.sheet-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hole-list { display: grid; gap: 6px; }
.hole-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: var(--paper);
  border-radius: 14px;
  border: 1px solid var(--rule);
}
.hole-num {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 22px; color: var(--brand);
  text-align: center; line-height: 1;
}
.hole-mid { min-width: 0; }
.hole-name {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 14px; color: var(--ink);
}
.hole-tip {
  font-size: 12px; color: var(--ink-muted);
  margin-top: 3px; line-height: 1.4;
}
.hole-stats { text-align: right; }
.hole-par {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink);
}
.hole-yards {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--ink-muted);
  margin-top: 3px;
}

.photo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.photo-card {
  background: var(--paper); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--rule);
}
.photo-card img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
}
.photo-card figcaption {
  font: 500 11px 'JetBrains Mono', monospace;
  letter-spacing: .08em;
  padding: 8px 10px; color: var(--ink-dim);
}

.menu-block {
  background: var(--paper); border-radius: 16px;
  padding: 18px 20px; border: 1px solid var(--rule);
}
.menu-block-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}
.menu-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
}
.menu-row:last-child { border-bottom: 0; }
.menu-row-name {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 14px; color: var(--ink); line-height: 1.3;
}
.menu-row-note {
  font-size: 12px; color: var(--ink-muted); margin-top: 2px;
  grid-column: 1 / 2;
}
.menu-row-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--brand); font-weight: 600;
  align-self: start;
  white-space: nowrap;
}

.sponsors-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.sponsor-tile {
  padding: 14px; border-radius: 14px;
  background: var(--paper); border: 1px solid var(--rule);
}
.sponsor-name {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 14px; color: var(--ink); line-height: 1.2;
}
.sponsor-cat {
  font: 500 9px/1 'JetBrains Mono', monospace;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand);
  margin: 8px 0 4px;
}
.sponsor-tag {
  font-size: 12px; color: var(--ink-muted); line-height: 1.35;
}

/* "More from the club" small tile row on Home */
.small-tiles {
  display: grid; gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 28px;
}
.small-tile {
  display: grid; gap: 4px;
  padding: 16px 16px 18px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  cursor: pointer; text-align: left;
  font: inherit; color: inherit;
  transition: background .15s ease;
}
.small-tile:active { background: var(--paper-shade); }
.small-tile-emoji { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.small-tile-label {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 14px; line-height: 1.2; color: var(--ink);
}
.small-tile-sub {
  font: 500 10px/1.3 'JetBrains Mono', monospace;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-muted);
}
@media (max-width: 380px) {
  .small-tiles { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .sponsors-grid { grid-template-columns: 1fr; }
}

/* ───── Scorekeeper / Scorecard / Leaderboard ───── */
.small-tile-primary {
  background: linear-gradient(135deg, rgba(232,90,58,.16), rgba(79,212,160,.12));
  border-color: var(--brand);
}
.small-tile-primary .small-tile-label { color: var(--brand); }

/* Player setup */
.player-setup-list { display: grid; gap: 10px; }
.player-setup-row {
  display: grid; grid-template-columns: 28px 1fr 28px; gap: 12px;
  align-items: start;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.player-setup-num {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--brand); color: var(--cream);
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 13px;
}
.player-setup-fields { display: grid; gap: 8px; min-width: 0; }
.player-setup-row-2 { display: flex; gap: 8px; }
.player-setup-remove {
  position: static !important;
  width: 28px !important; height: 28px !important;
  font-size: 18px !important;
  background: transparent !important; box-shadow: none !important;
  color: var(--ink-muted) !important;
}

/* Scorecard sheet special — full-height, less padding */
.sheet-card-scorecard {
  background: var(--cream);
}
.sheet-finish {
  position: absolute; right: 60px; top: 8px;
  border: 0; padding: 8px 14px;
  background: var(--brand); color: var(--cream);
  border-radius: 999px;
  font: 600 12px Inter, system-ui, sans-serif;
  cursor: pointer;
}

.scorecard {
  padding: 0 4px;
}
.scorecard-header {
  display: grid; grid-template-columns: 48px 1fr 48px;
  align-items: center; gap: 10px;
  margin: 8px 0 14px;
}
.sc-nav {
  width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: var(--paper); color: var(--ink);
  font-size: 28px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.sc-nav[disabled] { opacity: .35; cursor: not-allowed; }
.sc-hole-info { text-align: center; }
.sc-hole-num {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 42px; line-height: 1; color: var(--brand);
  letter-spacing: -.02em;
}
.sc-hole-par {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 4px;
}
.sc-hole-name {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 13px; color: var(--ink-dim);
  margin-top: 4px;
  font-style: italic;
}
.sc-tip {
  background: rgba(79, 212, 160, .15);
  border: 1px solid rgba(79, 212, 160, .3);
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px; line-height: 1.4;
  color: var(--ink);
  margin-bottom: 14px;
}

.sc-players { display: grid; gap: 10px; }
.sc-player {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--paper);
  border-radius: 18px;
  border: 1px solid var(--rule);
}
.sc-player-name {
  font-family: Outfit, sans-serif; font-weight: 600;
  font-size: 15px; color: var(--ink); line-height: 1.2;
  min-width: 0;
}
.sc-player-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-stroke-dot { color: var(--brand); margin-left: 6px; letter-spacing: 1px; }

.sc-score-controls {
  display: flex; align-items: center; gap: 8px;
}
.sc-btn {
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: var(--cream); color: var(--ink);
  font-size: 22px; line-height: 1; font-weight: 600;
  cursor: pointer;
}
body.theme-dark .sc-btn { background: rgba(253,249,236,.1); }
.sc-btn:active { transform: scale(.92); }
.sc-score {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 38px; line-height: 1;
  color: var(--brand);
  min-width: 50px; text-align: center;
  letter-spacing: -.02em;
}

.sc-player-totals { text-align: right; min-width: 0; }
.sc-running {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .08em;
  color: var(--ink-dim);
}
.sc-hole-pts {
  font-family: Outfit, sans-serif; font-weight: 700;
  font-size: 14px; color: var(--brand);
  margin-top: 4px;
}

.sc-finish-large {
  width: 100%; margin-top: 22px;
  justify-content: center;
  padding: 18px 22px;
  font-size: 16px;
}

.sc-totals {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-dim);
}
.sc-totals strong { color: var(--brand); font-weight: 700; }

/* Leaderboard */
.lb-tabs {
  display: flex; gap: 6px; margin: 16px 0 12px;
  overflow-x: auto;
  -ms-overflow-style: none; scrollbar-width: none;
}
.lb-tabs::-webkit-scrollbar { display: none; }
.lb-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font: 500 13px Inter, system-ui, sans-serif;
  color: var(--ink-dim);
  cursor: pointer;
  white-space: nowrap;
}
.lb-tab-on {
  background: var(--brand); color: var(--cream);
  border-color: transparent;
}
.lb-table {
  width: 100%;
  background: var(--paper);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-collapse: collapse;
}
.lb-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-muted);
  padding: 6px 8px;
  text-align: left;
}
.lb-table td {
  padding: 10px 8px;
  font-size: 14px;
  color: var(--ink);
  border-top: 1px solid var(--rule);
}
.lb-pos {
  font-family: Outfit, sans-serif; font-weight: 700;
  color: var(--brand);
}
.lb-points {
  font-family: Outfit, sans-serif; font-weight: 700;
  color: var(--brand);
}

/* ───── Error toast ───── */
.error {
  position: fixed; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  left: 20px; right: 20px;
  background: var(--terracotta); color: var(--cream);
  padding: 14px 18px; border-radius: 18px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  z-index: 50;
}

/* ──────────────────────────────────────────────────────────────
 *  Network home (Open Golf shell)
 * ────────────────────────────────────────────────────────────── */
.network-hero {
  margin: 6px 0 14px;
  padding: 22px 22px 24px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 75%, #000) 100%);
  color: var(--cream, #f4eede);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
.network-hero-eyebrow {
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .82;
}
.network-hero-title {
  margin-top: 6px;
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 26px; line-height: 1.18;
  letter-spacing: -.01em;
}
.network-hero-sub {
  margin-top: 8px;
  font-size: 14px; line-height: 1.45;
  opacity: .88;
}
.network-hero-cta-row {
  display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap;
}
.network-cta {
  flex: 1 1 140px;
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-accent, #E8B547);
  color: #1a1a1a;
  border: none;
  padding: 12px 16px;
  border-radius: 18px;
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 14px;
  cursor: pointer;
  transition: transform .12s ease;
}
.network-cta:active { transform: translateY(1px); }
.network-cta-ghost {
  background: rgba(255,255,255,.14);
  color: var(--cream, #f4eede);
}
.network-cta-emoji { font-size: 18px; }

.network-about {
  margin: 22px 4px 8px;
  padding: 18px 18px;
  border-radius: 22px;
  background: var(--paper-shade, #efe9d8);
  color: var(--ink, #221c12);
}
.network-about-title {
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 16px; margin-bottom: 6px;
}
.network-about-body { font-size: 14px; line-height: 1.5; }

.network-list {
  display: flex; flex-direction: column; gap: 8px; margin-top: 12px;
}
.network-list-item {
  padding: 12px 14px;
  background: var(--paper, #f8f1de);
  color: var(--ink, #221c12);
  border-radius: 14px;
}
.network-list-item-title {
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 14px;
}
.network-list-item-sub { font-size: 13px; opacity: .82; margin-top: 2px; line-height: 1.4; }

.sheet-intro {
  font-size: 14px; line-height: 1.55;
  color: var(--ink, #221c12);
  margin: 2px 4px 6px;
}
.sheet-foot {
  font-size: 12px; opacity: .65;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.inline-link {
  background: none; border: none; padding: 0;
  color: var(--brand); font: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Course cards (network directory) — each card hard-navigates to ?shop=<slug>. */
.course-card {
  display: flex; gap: 12px; align-items: stretch;
  padding: 10px;
  text-align: left;
  background: var(--paper, #f8f1de);
  color: var(--ink, #221c12);
  border: none;
  border-radius: 18px;
  cursor: pointer;
  transition: transform .12s ease;
  width: 100%;
}
.course-card:active { transform: translateY(1px); }
.course-card-thumb {
  flex: 0 0 78px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; min-height: 78px;
}
.course-card-mark { font-size: 28px; }
.course-card-body { flex: 1; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.course-card-name {
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 15px;
}
.course-card-meta { font-size: 12px; opacity: .7; }
.course-card-tag { font-size: 13px; opacity: .85; line-height: 1.35; }
.course-card-cta {
  margin-top: 4px;
  font-size: 12px; font-weight: 700;
  color: var(--course-brand, var(--brand));
  text-transform: uppercase; letter-spacing: .04em;
}
.course-card-featured {
  background: var(--paper, #f8f1de);
  padding: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.course-card-featured .course-card-thumb { flex-basis: 96px; min-height: 96px; }
.course-card-featured .course-card-mark { font-size: 36px; }
.course-card-featured .course-card-name { font-size: 18px; }

.directory-region-head {
  margin: 18px 0 6px;
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .65;
}
.directory-coming-soon {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--paper-shade, #efe9d8);
}
.directory-coming-soon-title {
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 14px;
}
.directory-coming-soon-sub {
  margin-top: 4px;
  font-size: 13px; line-height: 1.5;
}

/* ──────────────────────────────────────────────────────────────
 *  Wine cards (cellar sheet)
 * ────────────────────────────────────────────────────────────── */
.wine-card {
  display: flex; gap: 14px;
  padding: 12px;
  text-align: left;
  background: var(--paper, #f8f1de);
  color: var(--ink, #221c12);
  border: none;
  border-radius: 18px;
  cursor: pointer;
  transition: transform .12s ease;
  width: 100%;
}
.wine-card:active { transform: translateY(1px); }
.wine-card-thumb {
  flex: 0 0 84px;
  align-self: flex-start;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.wine-card-thumb img {
  width: 100%; height: 100%; max-height: 120px;
  object-fit: contain;
}
.wine-card-body { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.wine-card-name {
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 15px; line-height: 1.25;
}
.wine-card-meta { font-size: 12px; opacity: .7; }
.wine-card-pitch {
  font-size: 13px; line-height: 1.4;
  margin-top: 2px;
}
.wine-card-notes {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 4px;
}
.wine-card-note {
  font-size: 12px; opacity: .82;
}
.wine-card-note-watch { opacity: .7; }
.wine-card-foot {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 6px;
}
.wine-card-price { display: flex; gap: 8px; align-items: baseline; }
.wine-card-price-now {
  font-family: Outfit, sans-serif;
  font-weight: 700; font-size: 16px;
  color: var(--brand);
}
.wine-card-price-rrp {
  font-size: 12px; opacity: .55;
  text-decoration: line-through;
}
.wine-card-oos {
  font-size: 11px; font-weight: 700;
  color: var(--terracotta);
  text-transform: uppercase; letter-spacing: .04em;
}
.wine-card-cta {
  font-size: 12px; font-weight: 700;
  color: var(--brand);
  text-transform: uppercase; letter-spacing: .04em;
}
