:root {
  /* Display: Bricolage Grotesque — a grotesque with fluid, slightly
     irregular rhythm in its letterforms, used with restraint on the
     wordmark, hero, section titles, and the calendar's big date numerals.
     Body/UI: Plus Jakarta Sans — geometric-humanist with rounded
     terminals, reads fast at small sizes without competing with the
     display face. Neither is the generic go-to for a "friendly SaaS UI"
     (that's usually just Inter everywhere), and both carry real energy
     for a running app without tipping into a script/italic cliché. */
  --font-display: 'Bricolage Grotesque', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --bg: #FAFBF6;
  --surface: #FFFFFF;
  --purple: #6D28D9;
  --purple-dark: #4C1D95;
  --purple-tint: #F1EBFC;
  --lime: #A3E635;
  --lime-dark: #65A30D;
  --lime-tint: #F3FBE4;
  --text: #1F1B2E;
  --text-muted: #6B7280;
  --border: #E7E9DE;
  --shadow: 0 8px 24px rgba(76, 29, 149, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--font-body);
  font-weight: 700;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

/* Display face — headlines, brand, section titles, and the calendar's big
   date numerals only. Everything else (buttons, chips, list rows, data)
   stays on the body face for legibility at UI sizes. */
.landing-title,
.brand-name,
.run-title,
.runnow-header,
.install-title,
.ob-step-title,
.cal-band-num {
  font-family: var(--font-display);
  font-weight: 800;
}

button {
  -webkit-tap-highlight-color: transparent;
}
button:active {
  opacity: 0.75;
}

/* Top bar.
   iOS PWA note: index.html pairs `viewport-fit=cover` with
   `apple-mobile-web-app-status-bar-style: black-translucent`, so the web view
   extends *under* the status bar / Dynamic Island when launched from the home
   screen. Every fixed edge in this file therefore carries an
   env(safe-area-inset-*) term with an explicit `0px` fallback, so desktop and
   non-notched rendering is byte-for-byte identical to before. */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(64px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) 24px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--purple), var(--lime));
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* Glare as a separate overlay, not a background-clip:text trick — the
   latter can render fully invisible when an ancestor also has
   backdrop-filter (the topbar's blur), a known Chromium/WebKit compositing
   interaction. This way the wordmark's own color is always solid and
   guaranteed visible; only a light sweep is layered on top of it. */
.brand-name {
  position: relative;
  display: inline-block;
  overflow: hidden;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--purple-dark);
}
.brand-name::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,0.9) 50%, transparent 65%);
  mix-blend-mode: overlay;
  pointer-events: none;
  transform: translateX(-130%);
  animation: brand-glare-sweep 5s ease-in-out infinite;
}
@keyframes brand-glare-sweep {
  0% { transform: translateX(-130%); }
  35% { transform: translateX(130%); }
  100% { transform: translateX(130%); }
}

.run-now-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--purple);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.run-now-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.45);
}

.run-now-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(163,230,53,0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(163,230,53,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(163,230,53,0); }
  100% { box-shadow: 0 0 0 0 rgba(163,230,53,0); }
}

/* Map */
#map {
  position: fixed;
  top: calc(64px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: 0;
}

/* Custom marker */
.club-marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.marker-label {
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
  margin-bottom: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  pointer-events: none;
}

.club-marker {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: var(--purple);
  border: 3px solid white;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  pointer-events: auto;
}

.club-marker.active {
  background: var(--lime-dark);
}

/* Side panels */
.panel {
  position: fixed;
  top: 0;
  width: 380px;
  max-width: 92vw;
  height: 100%;
  height: 100dvh;
  background: var(--surface);
  z-index: 2000;
  /* Full-height overlay: clear the notch at the top and the home indicator at
     the bottom so panel content stays readable and scroll-reachable. */
  padding: calc(32px + env(safe-area-inset-top, 0px)) 28px calc(32px + env(safe-area-inset-bottom, 0px));
  transition: transform 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-left {
  left: 0;
  box-shadow: 8px 0 30px rgba(0,0,0,0.15);
  transform: translateX(-100%);
}
.panel-left.open { transform: translateX(0); }

.panel-right {
  right: 0;
  box-shadow: -8px 0 30px rgba(0,0,0,0.15);
  transform: translateX(100%);
}
.panel-right.open { transform: translateX(0); }

.panel-close {
  position: absolute;
  /* Absolutely positioned, so it does not inherit .panel's inset padding. */
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 18px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 46, 0.35);
  z-index: 1500;
  display: none;
}

.overlay.open { display: block; }

/* Club panel content */
.club-title {
  font-size: 22px;
  font-weight: 700;
  margin: 6px 0 4px;
  color: var(--purple-dark);
}

.club-location {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 16px;
}

.tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tag {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--purple-tint);
  color: var(--purple-dark);
  text-transform: capitalize;
}

.tag.lime {
  background: var(--lime-tint);
  color: var(--lime-dark);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.info-row .label { color: var(--text-muted); font-weight: 400; }
.info-row .value { font-weight: 700; text-align: right; }

.club-notes {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.5;
}

.club-link-btn {
  display: block;
  text-align: center;
  margin-top: 24px;
  padding: 13px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--purple-dark);
  text-decoration: none;
  font-weight: 700;
  transition: background 0.15s ease;
}

.club-link-btn:hover { background: var(--lime-dark); color: white; }

.updated-note {
  margin-top: 14px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

/* Run Now panel */
.runnow-header {
  font-size: 22px;
  font-weight: 700;
  color: var(--purple-dark);
  margin: 6px 0 4px;
}

.runnow-sub {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 20px;
}

.runnow-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.runnow-card-name { font-size: 17px; font-weight: 700; color: var(--purple-dark); margin: 0 0 4px; }

.runnow-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lime-tint);
  color: var(--lime-dark);
  margin-bottom: 8px;
}

.runnow-meta {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin: 2px 0;
}

.empty-state {
  text-align: center;
  padding: 40px 10px;
}

.empty-state .emoji { font-size: 40px; margin-bottom: 12px; }
.empty-state p { color: var(--text-muted); font-size: 14px; font-weight: 400; line-height: 1.5; }

/* Landing page */
#landing-page {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: var(--purple-dark); /* solid fallback so there's no flash before the map paints */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Hero is centred, but keep it out from under the notch / home indicator
     on short viewports where the content would otherwise reach the edges. */
  padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow: hidden;
}

#landing-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.landing-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(109,40,217,0.75) 0%, rgba(76,29,149,0.82) 55%, rgba(46,16,101,0.9) 100%);
}

.landing-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Belt-and-braces: #landing-page's padding already reserves the insets, but
     the scrim/map siblings are inset:0, so keep the hero itself bounded too. */
  max-width: 100%;
  padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
}

#landing-page.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-pin {
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  animation: bounce 1.1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

.landing-title {
  font-size: 44px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
  margin: 0;
}

.landing-tagline {
  font-size: 16px;
  font-weight: 400;
  color: var(--lime);
  margin: 10px 0 40px;
}

.landing-cta {
  background: var(--lime);
  color: var(--purple-dark);
  border: none;
  padding: 15px 36px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(163, 230, 53, 0.4);
  transition: transform 0.15s ease;
}

.landing-cta:hover { transform: translateY(-2px); }

@media (max-width: 480px) {
  .brand-name { display: none; }
  .panel { width: 100%; }
  .landing-title { font-size: 34px; }
}

/* ===== Additional styles: onboarding, list sheet, filters, colored pins ===== */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.icon-btn:hover { background: var(--purple-tint); }

/* Legend (UAE flag button + pin-color popover) */
.legend-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.legend-flag-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.legend-flag-btn:hover { background: var(--purple-tint); }

.legend-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  min-width: 200px;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.legend-popover.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (hover: hover) {
  .legend-wrap:hover .legend-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.legend-popover-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.legend-popover-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 4px 0;
}

/* Colored pins */
.club-marker.color-red { background: #DC2626; }
.club-marker.color-black { background: #111111; }
.club-marker.color-white { background: #FFFFFF; border-color: #6B7280; }
.club-marker.color-green { background: var(--lime-dark); }

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.legend-dot.red { background: #DC2626; }
.legend-dot.black { background: #111111; }
.legend-dot.white { background: #FFFFFF; border: 1px solid #6B7280; }
.legend-dot.green { background: var(--lime-dark); }

/* Onboarding modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 27, 46, 0.55);
  z-index: 5500; /* above #landing-page (5000) — it fades over 0.4s, not an instant unmount */
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 32px 28px;
  width: 420px;
  max-width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow);
}

.ob-step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--purple-dark);
  margin: 0 0 4px;
}
.ob-step-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.ob-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  margin-bottom: 14px;
}

.ob-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ob-option {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}

.ob-option.selected {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
}

.ob-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.ob-btn {
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.ob-btn.primary { background: var(--lime); color: var(--purple-dark); }
.ob-btn.secondary { background: none; color: var(--text-muted); }

.ob-progress {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Install-to-homescreen tutorial */
.install-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--purple-dark);
  margin: 0 0 4px;
}
.install-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.install-step-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.install-step-row:last-of-type { border-bottom: none; }
.install-step-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--purple-tint);
  color: var(--purple-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}
.install-step-text { font-size: 14px; font-weight: 700; color: var(--text); }
.install-step-num { color: var(--text-muted); font-weight: 400; margin-right: 4px; }
.install-nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* List / map bottom sheet */
.list-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 78vh;
  height: 78dvh;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.15);
  z-index: 900;
  /* Collapsed: just the drag handle — decluttered, and clears the corner
     switcher. The 40px peek is measured from the home indicator, not from the
     physical screen edge, so the inset is added to the peek; otherwise the
     handle would sit underneath the indicator and become untappable. */
  transform: translateY(calc(100% - 40px - env(safe-area-inset-bottom, 0px)));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}
.list-sheet.expanded { transform: translateY(0); }

.sheet-handle {
  padding: 14px 0 8px;
  display: flex;
  justify-content: center;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
}
.handle-bar {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--border);
}

.this-week-banner {
  margin: 0 20px 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--purple-tint);
  color: var(--purple-dark);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.list-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 0 20px 24px;
  flex: 1;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.list-row-info { flex: 1; }
.list-row-name { font-weight: 700; font-size: 15px; }
.list-row-meta { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }

/* Filters panel */
.filter-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 22px 0 10px;
}

.filter-toggle-row {
  display: flex;
  gap: 8px;
}

.filter-toggle {
  flex: 1;
  text-align: center;
  padding: 11px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface);
}
.filter-toggle.active { background: var(--purple); color: white; border-color: var(--purple); }

.locked-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px dashed var(--border);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  cursor: pointer;
}
.locked-chip .lock-icon { font-size: 13px; }

.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--purple-dark);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 6000;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* =====================================================================
   v2 prototype additions — Variant A (Map Sheet), the only variant left.
   Materials/motion follow the apple-design skill: translucent chrome,
   instant press feedback, reduced-motion fallback. Brand palette/type
   unchanged per PRD.md §5 (branding kept as-is for this pass).
   ===================================================================== */

button, .rsvp-btn, .scope-btn {
  -webkit-tap-highlight-color: transparent;
  transition: transform 100ms ease-out, opacity 100ms ease-out, background 150ms ease;
}
button:active, .rsvp-btn:active, .scope-btn:active {
  transform: scale(0.96);
}

.map-surface { position: absolute; inset: 0; }
#map-a { position: fixed; top: calc(64px + env(safe-area-inset-top, 0px)); left: 0; right: 0; bottom: 0; }

/* Topbar: translucent material over the map (apple-design §12) */
.topbar {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(231, 233, 222, 0.6);
  gap: 16px;
}

/* Scope toggle (This Week / This Month) */
.scope-toggle {
  display: flex;
  width: 240px;
  background: var(--purple-tint);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.scope-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  color: var(--purple-dark);
  cursor: pointer;
  white-space: nowrap;
}
.scope-btn.active { background: var(--purple); color: white; }

/* Freebies ring — separate layer from the base kind/type color
   (PRD.md §4.3 / TECHNICAL.md §4), so it never hides the base signal. */
.club-marker.has-ring {
  box-shadow: 0 0 0 3px var(--lime), 0 2px 8px rgba(0,0,0,0.25);
}
.cal-chip-dot.has-ring, .legend-dot.has-ring {
  box-shadow: 0 0 0 2px var(--lime);
}

/* Run detail panel (shared) */
.run-title { font-size: 22px; font-weight: 700; margin: 6px 0 4px; color: var(--purple-dark); }
.run-location { color: var(--text-muted); font-size: 14px; font-weight: 400; margin-bottom: 16px; }
.run-notes { margin-top: 16px; font-size: 14px; font-weight: 400; color: var(--text-muted); line-height: 1.5; }
.tag.kind-one_off { background: #111111; color: white; }
.tag.kind-recurring { background: var(--purple-tint); color: var(--purple-dark); }

.register-btn {
  display: block;
  text-align: center;
  margin-top: 20px;
  padding: 13px;
  border-radius: 10px;
  background: var(--lime);
  color: var(--purple-dark);
  text-decoration: none;
  font-weight: 700;
}
.register-btn:hover { background: var(--lime-dark); color: white; }

.ics-btn {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.rsvp-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.rsvp-btn {
  flex: 1 1 auto;
  min-width: 84px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 10px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}
.rsvp-btn.rsvp-going.active { background: var(--purple); border-color: var(--purple); color: white; }
.rsvp-btn.rsvp-interested.active { background: var(--lime); border-color: var(--lime); color: var(--purple-dark); }
.rsvp-btn.rsvp-not_interested.active, .rsvp-btn.rsvp-not_going.active { background: var(--text-muted); border-color: var(--text-muted); color: white; }

/* ---------- Variant A: sheet title ---------- */
.sheet-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 8px;
  flex-shrink: 0;
}
.sheet-title-row .sheet-title { padding: 0; }
.sheet-title {
  padding: 0 20px 8px;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.prefs-chip {
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: inherit;
}
.prefs-chip.active { background: var(--lime); border-color: var(--lime); color: var(--purple-dark); }

/* Type filter chips — shared by Variant A's sheet and Variant C's feed */
.list-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 20px 14px;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
}
.type-chip {
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  font-family: inherit;
}
.type-chip.active { background: var(--purple); border-color: var(--purple); color: white; }

/* "More" menu — folds Calendar + Profile behind one icon in Variant A's
   topbar, so the primary row reads as Brand / Scope / Run Now, not five
   competing clusters. */
.more-wrap { position: relative; }
.more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  min-width: 160px;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}
.more-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.more-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  padding: 10px 12px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.more-menu-item:hover { background: var(--purple-tint); }

/* Calendar: vertically stacked day bands (per calendar.webp), a rotating
   per-weekday pastel palette applied inline per band (Calendar.DAY_PALETTE
   in calendar.js), big bold date numerals, dark pill-chip events. */
.cal-stack { display: flex; flex-direction: column; gap: 14px; }

.cal-band {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px;
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.cal-band-today { box-shadow: 0 0 0 2px rgba(0,0,0,0.18); }
.cal-band-date { display: flex; flex-direction: column; flex-shrink: 0; width: 62px; }
.cal-band-dayname { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; opacity: 0.75; }
.cal-band-num { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.cal-band-chips { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; align-content: flex-start; }

.cal-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: #1F1B2E;
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.cal-chip-highlight { box-shadow: 0 0 0 2px var(--lime); }
.cal-chip-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip-time { opacity: 0.65; font-weight: 400; flex-shrink: 0; }
.cal-chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-chip-dot.color-red { background: #DC2626; }
.cal-chip-dot.color-black { background: #6B7280; }
.cal-chip-dot.color-white { background: #FFFFFF; }

.cal-band-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  background: transparent;
  border-bottom: 1px solid var(--border);
}
.cal-band-empty-date { font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; width: 62px; flex-shrink: 0; }
.cal-band-empty-text { font-size: 13px; color: var(--text-muted); }

/* Compact: Variant A's narrow side-panel host — chips stack single-column
   instead of wrapping into a wide multi-chip row. */
.cal-stack-compact .cal-band { flex-direction: column; gap: 12px; padding: 16px 18px; }
.cal-stack-compact .cal-band-date { flex-direction: row; align-items: baseline; gap: 8px; width: auto; }
.cal-stack-compact .cal-band-num { font-size: 26px; }
.cal-stack-compact .cal-band-chips { flex-direction: column; width: 100%; }
.cal-stack-compact .cal-chip { width: 100%; }
.cal-stack-compact .cal-chip-name { max-width: none; flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .scope-toggle { order: 3; width: 100%; margin-top: 8px; }
  /* These overrides fire on exactly the phones that have a notch, so they must
     re-apply the safe-area insets or they silently undo the fix above. */
  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: calc(64px + env(safe-area-inset-top, 0px));
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
  }
  .map-surface, #map-a { top: calc(96px + env(safe-area-inset-top, 0px)); }
}

/* ---------- Reduced motion (apple-design §14) ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 50ms !important; animation-duration: 50ms !important; }
  .landing-pin { animation: none; }
}
