/* =============================================================================
   MASJID ATLAS — External Netlify add-masjid app
   Map-first experience. Drop a pin → contribution drawer slides up.
   Mobile-first, dark theme matching TMA brand.
   ============================================================================ */

:root {
  /* Tells the browser the page is dark-themed. */
  color-scheme: dark;

  /* ── Brand palette ──────────────────────────────────────────────────── */
  --c-navy:        #0D1520;
  --c-navy-deep:   #07111E;

  /* ── Bridge to main TMA explore-page variable names ───────────────────
     So we can lift `.ex-*` CSS rules verbatim from the live site and have
     the βeta form match the real explore page's look. */
  --color-green:    #1D9E75;
  --color-green-deep: #178A65;
  --color-gold:     #C9A84C;
  --color-cream:    #F5ECD7;
  --color-navy:     #0D1520;
  --color-info:     #60A5FA;
  --color-purple:   #A78BFA;
  --color-warning:  #FBBF24;

  /* Green alpha ladder — used heavily by explore */
  --green-06: rgba(29,158,117,0.06);
  --green-08: rgba(29,158,117,0.08);
  --green-10: rgba(29,158,117,0.10);
  --green-12: rgba(29,158,117,0.12);
  --green-13: rgba(29,158,117,0.13);
  --green-15: rgba(29,158,117,0.15);
  --green-18: rgba(29,158,117,0.18);
  --green-20: rgba(29,158,117,0.20);
  --green-22: rgba(29,158,117,0.22);
  --green-25: rgba(29,158,117,0.25);
  --green-28: rgba(29,158,117,0.28);
  --green-45: rgba(29,158,117,0.45);

  /* Gold alpha ladder */
  --gold-04: rgba(201,168,76,0.04);
  --gold-06: rgba(201,168,76,0.06);
  --gold-07: rgba(201,168,76,0.07);
  --gold-08: rgba(201,168,76,0.08);
  --gold-10: rgba(201,168,76,0.10);
  --gold-12: rgba(201,168,76,0.12);
  --gold-20: rgba(201,168,76,0.20);

  /* White + blue alpha ladders */
  --white-04: rgba(255,255,255,0.04);
  --white-05: rgba(255,255,255,0.05);
  --white-06: rgba(255,255,255,0.06);
  --white-08: rgba(255,255,255,0.08);
  --white-09: rgba(255,255,255,0.09);
  --white-10: rgba(255,255,255,0.10);
  --blue-08:  rgba(96,165,250,0.08);
  --blue-12:  rgba(96,165,250,0.12);
  --blue-25:  rgba(96,165,250,0.25);

  /* Text opacity */
  --text-20: rgba(237,244,248,0.20);
  --text-28: rgba(237,244,248,0.28);
  --text-30: rgba(237,244,248,0.30);
  --text-35: rgba(237,244,248,0.35);
  --text-40: rgba(237,244,248,0.40);
  --text-50: rgba(237,244,248,0.50);
  --text-65: rgba(237,244,248,0.65);
  --text-70: rgba(237,244,248,0.70);
  --text-90: rgba(237,244,248,0.90);
  --text-primary: var(--c-text);
  --text-muted:   #8899AA;
  --cream-80:     rgba(245,236,215,0.80);

  /* Typography aliases (Cormorant Garamond not loaded — use display serif fallback) */
  --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-arabic:  var(--ff-arabic);
  --font-sans:    inherit;

  /* Radii / shadows / transitions */
  --border-radius:      8px;
  --border-radius-sm:   6px;
  --border-radius-lg:   12px;
  --border-radius-xl:   16px;
  --border-radius-full: 999px;
  --shadow-modal:       0 16px 48px rgba(0,0,0,0.55);
  --transition-color:   color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  --transition-all:     all 0.15s ease;

  /* Button colours */
  --btn-bg:        var(--color-green);
  --btn-bg-hover:  var(--color-green-deep);
  --btn-text:      var(--color-navy);
  --c-surface:     #141B25;
  --c-elevated:    #1F2935;
  --c-border:      rgba(255, 255, 255, 0.08);
  --c-border-mid:  rgba(255, 255, 255, 0.16);

  --c-gold:        #C9A84C;
  --c-gold-light:  #E8D070;
  --c-gold-dark:   #A87B20;
  --c-green:       #1D9E75;
  --c-green-hover: #178A65;
  --c-cream:       #F5ECD7;

  --c-text:        #EDF4F8;
  --c-text-mid:    #86A8BC;
  --c-text-dim:    #5A7184;
  --c-danger:      #EF4444;

  /* ── Type scale ──────────────────────────────────────────────────────── */
  --fs-xs:  12px;
  --fs-sm:  14px;
  --fs-md:  16px;
  --fs-lg:  18px;
  --fs-xl:  22px;
  --fs-2xl: 28px;
  --fs-3xl: 32px;

  /* ── Spacing ────────────────────────────────────────────────────────── */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --radius:    8px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Header height — used to offset the map */
  /* Header total height = brand bar (56px) + slim stats ribbon (28px) */
  --hdr-brand-h: 56px;
  --hdr-h:       84px;

  /* ── Type stacks ────────────────────────────────────────────────────── */
  --ff-base:    system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ff-arabic:  'Amiri', 'Scheherazade New', 'Noto Naskh Arabic', 'Segoe UI', sans-serif;
  --ff-display: Georgia, 'Cormorant Garamond', 'Times New Roman', serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: var(--c-navy);
  color: var(--c-text);
  font-family: var(--ff-base);
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  /* Prevent body scroll — the map manages its own panning */
  overflow: hidden;
}

html[dir="rtl"] body { font-family: var(--ff-arabic); }

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--c-text-dim); }

/* =============================================================================
   HEADER
   ============================================================================ */
.hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--hdr-h);
  background: linear-gradient(180deg, rgba(7, 17, 30, 0.96), rgba(13, 21, 32, 0.88));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
}

.hdr-inner {
  height: var(--hdr-brand-h);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

/* ── Persistent stats ribbon — slim row below the lang switcher ─────────
   Right-aligned, sits directly under the EN/AR/TR buttons. Visible on
   every screen. Populated by the same fetchStats() that fills the
   larger intro stats-strip. */
.hdr-stats-ribbon {
  height: calc(var(--hdr-h) - var(--hdr-brand-h));
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: flex-end;   /* sit on the right, under lang switcher */
  gap: 16px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--c-text-mid);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
html[dir="rtl"] .hdr-stats-ribbon {
  /* In RTL the lang switcher is on the LEFT; align the ribbon there too. */
  justify-content: flex-start;
}
.hdr-stats-ribbon::-webkit-scrollbar { display: none; }

.hsr-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Breathing dot — soft pulse + halo to signal "live data". One per stat. */
.hsr-dot {
  width:  6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow:
    0 0 0 0 rgba(29, 158, 117, 0.85),
    0 0 6px 1px rgba(29, 158, 117, 0.55);
  animation: hsr-breathe 2.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes hsr-breathe {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 0 rgba(29, 158, 117, 0.55),
      0 0 5px 1px rgba(29, 158, 117, 0.45);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.25);
    box-shadow:
      0 0 0 4px rgba(29, 158, 117, 0),
      0 0 9px 2px rgba(29, 158, 117, 0.7);
    opacity: 1;
  }
}

.hsr-num {
  font-weight: 700;
  color: var(--c-gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.hsr-num[data-loading="true"] {
  opacity: 0.55;
  animation: hsr-pulse 1.4s ease-in-out infinite;
}
.hsr-label {
  text-transform: lowercase;
  font-weight: 500;
}

@keyframes hsr-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

@media (max-width: 480px) {
  .hdr-stats-ribbon { font-size: 10.5px; gap: 10px; padding: 0 12px; }
  .hsr-item         { gap: 4px; }
  .hsr-dot          { width: 5px; height: 5px; }
}

/* Respect user's reduced-motion preference — breathing dot becomes static */
@media (prefers-reduced-motion: reduce) {
  .hsr-dot { animation: none; }
}

/* Personal stat dot — GOLD instead of green. Signals "this number is YOU"
   to distinguish from the four global green-dot stats. */
.hsr-dot--gold {
  background: var(--c-gold);
  animation: hsr-breathe-gold 2.4s ease-in-out infinite;
  box-shadow:
    0 0 0 0 rgba(201, 168, 76, 0.85),
    0 0 6px 1px rgba(201, 168, 76, 0.55);
}
@keyframes hsr-breathe-gold {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 0 rgba(201, 168, 76, 0.55),
      0 0 5px 1px rgba(201, 168, 76, 0.45);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.25);
    box-shadow:
      0 0 0 4px rgba(201, 168, 76, 0),
      0 0 9px 2px rgba(201, 168, 76, 0.75);
    opacity: 1;
  }
}
.hsr-personal .hsr-num   { color: var(--c-gold); }
.hsr-personal .hsr-label { color: var(--c-cream); opacity: 0.7; font-weight: 600; }

/* Visual separator before the personal stat */
.hsr-divider {
  color: var(--c-text-dim);
  opacity: 0.35;
  margin: 0 2px;
  font-size: 14px;
  line-height: 1;
}

/* ── Updates panel inside the intro card ──────────────────────────────────
   Shows recent admin outcomes (approved / rejected / duplicate / needs info)
   for the contributor's previous submissions. Hidden until the my_submissions
   RPC returns at least one non-PENDING item. */
.contrib-updates {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.10), rgba(29, 158, 117, 0.08));
  border: 1px solid var(--c-gold);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.cu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.cu-icon { font-size: 16px; line-height: 1; }
.cu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cu-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--c-border);
  font-size: 13px;
  line-height: 1.45;
}
.cu-item--approved        { border-color: rgba(29, 158, 117, 0.45); }
.cu-item--rejected        { border-color: rgba(239, 68, 68, 0.35); }
.cu-item--duplicate       { border-color: rgba(96, 165, 250, 0.35); }
.cu-item--needs_more_info { border-color: rgba(201, 168, 76, 0.45); }

.cu-item-icon {
  font-size: 16px;
  line-height: 1.2;
  flex-shrink: 0;
}
.cu-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.cu-item-name   { font-weight: 700; color: var(--c-text); }
.cu-item-status { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-text-mid); }
.cu-item-note   { font-size: 12px; color: var(--c-text-mid); font-style: italic; }

/* ── Milestone message on success screen ──────────────────────────────────
   Soft Islamic encouragement when a contributor's total just crossed a
   threshold (1/3/5/10/25/50/100). Never names the Ajar/badge mechanics. */
.success-milestone {
  margin: 14px 0 0;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.12), rgba(245, 236, 215, 0.05));
  border: 1px solid var(--c-gold);
  border-radius: var(--radius);
  font-size: 14px;
  font-style: italic;
  color: var(--c-cream);
  line-height: 1.55;
  text-align: center;
}

.hdr-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: inherit;
}

.hdr-brand-icon {
  font-size: 24px;
  line-height: 1;
}

.hdr-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hdr-brand-main {
  font-family: var(--ff-display);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-cream);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.hdr-brand-sub {
  font-size: 10px;
  color: var(--c-gold);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  line-height: 1.2;
}

/* βeta pill — sits next to the brand. Subtle pulse to give it life. */
.beta-pill {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(29, 158, 117, 0.18);
  border: 1px solid var(--c-green);
  color: var(--c-green);
  margin-inline-start: var(--sp-2);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  animation: beta-pulse 3s ease-in-out infinite;
}

@keyframes beta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29, 158, 117, 0); }
  50%      { box-shadow: 0 0 0 4px rgba(29, 158, 117, 0.10); }
}

@media (max-width: 380px) {
  .beta-pill { display: none; }
}

/* Language switch */
.lang-switch {
  display: flex;
  gap: 3px;
  background: var(--c-surface);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--c-text-mid);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  letter-spacing: 0.04em;
  min-width: 36px;
}

.lang-btn:hover { color: var(--c-text); }

.lang-btn.is-active {
  background: var(--c-gold);
  color: var(--c-navy);
}

/* =============================================================================
   MAP STAGE — full-screen below header
   ============================================================================ */
.map-stage {
  position: fixed;
  inset: var(--hdr-h) 0 0 0;
  overflow: hidden;
  /* Defensive: explicit min sizing so MapLibre's container has dimensions
     even if a parent stylesheet load order does something weird. */
  width:  100%;
  min-height: 240px;
  background: var(--c-navy-deep);
}

.map-container {
  position: absolute;
  inset: 0;
  width:  100%;
  height: 100%;
  background: var(--c-navy-deep);
}

/* MapLibre's own canvas / containers — make sure they fill */
.map-container .maplibregl-map,
.map-container canvas.maplibregl-canvas {
  width:  100% !important;
  height: 100% !important;
}

/* MapLibre's default attribution control — tone it down a bit */
.maplibregl-ctrl-attrib {
  background: rgba(13, 21, 32, 0.85) !important;
  color: var(--c-text-mid) !important;
  font-size: 10px !important;
}
.maplibregl-ctrl-attrib a {
  color: var(--c-gold) !important;
}

.maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib {
  margin: 0 8px 8px 0 !important;
}

/* MapLibre default zoom controls — match brand */
.maplibregl-ctrl-group {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}
.maplibregl-ctrl-group button {
  background: transparent !important;
  color: var(--c-text) !important;
}
.maplibregl-ctrl-group button:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* =============================================================================
   INTRO OVERLAY — dismissible welcome
   ============================================================================ */
.intro-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(29, 158, 117, 0.18), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(201, 168, 76, 0.14), transparent 60%),
    rgba(13, 21, 32, 0.94);
  backdrop-filter: blur(4px);
  /* Sits ABOVE the .ex-panel (z-index 20) so the welcome card + "Got it"
     button are always clickable on first load. */
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 1;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
}

/* When the intro overlay is showing, push the bottom-sheet panel off-screen
   on mobile so it cannot cover the "Got it" CTA. Desktop is unaffected
   because the panel is a left sidebar there and doesn't overlap the
   centred welcome card. */
@media (max-width: 760px) {
  .intro-overlay:not(.is-hidden) ~ .ex-panel {
    transform: translateY(100%);
    pointer-events: none;
    transition: transform 0.3s ease;
  }
}

.intro-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-card {
  max-width: 480px;
  width: 100%;
  background: linear-gradient(145deg, var(--c-elevated), var(--c-surface));
  border: 1px solid var(--c-border-mid);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-height: calc(100vh - var(--hdr-h) - var(--sp-7));
  overflow-y: auto;
}

.intro-eyebrow {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-gold);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  font-weight: 700;
}

.intro-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.15;
  color: var(--c-cream);
  letter-spacing: -0.02em;
}

.intro-sub {
  margin: 0;
  color: var(--c-text-mid);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.intro-steps {
  list-style: none;
  margin: var(--sp-2) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.intro-steps li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-text);
  line-height: 1.6;
}

.intro-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-gold);
  color: var(--c-navy);
  font-weight: 800;
  font-size: var(--fs-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.intro-cta {
  margin-top: var(--sp-3);
  align-self: stretch;
  justify-content: center;
}

/* βeta notice — explicit expectation-setting block in the intro card */
.beta-notice {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(29, 158, 117, 0.08);
  border: 1px solid rgba(29, 158, 117, 0.30);
  border-inline-start-width: 4px;
  border-radius: var(--radius);
  color: var(--c-text);
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.beta-notice strong {
  color: var(--c-green);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  letter-spacing: 0.04em;
  font-weight: 800;
}

/* βeta note on the success screen */
.success-beta {
  margin: 0;
  padding: var(--sp-3);
  background: rgba(29, 158, 117, 0.08);
  border: 1px solid rgba(29, 158, 117, 0.24);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  color: var(--c-text-mid);
  line-height: 1.5;
  max-width: 40ch;
}

/* ─────────────────────────────────────────────────────────────────────────
   Live stats strip — sits in the intro card under the steps.
   Fetched from /api/public/stats on page load.
   ───────────────────────────────────────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  padding: var(--sp-4);
  background:
    linear-gradient(135deg, rgba(201, 168, 76, 0.07), rgba(29, 158, 117, 0.07));
  border: 1px solid var(--c-border-mid);
  border-radius: var(--radius);
}

@media (max-width: 540px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.stat-num {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--c-gold);
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  /* Subtle skeleton state — until numbers populate, em dash sits there */
  transition: color 0.4s ease;
}

.stat-num[data-loading="true"] {
  color: var(--c-text-dim);
  opacity: 0.6;
}

.stat-label {
  font-size: 10px;
  color: var(--c-text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
  font-weight: 600;
}

.stats-foot {
  margin: var(--sp-2) 0 0;
  font-size: 11px;
  color: var(--c-text-dim);
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

@media (max-width: 380px) {
  .stat-num   { font-size: var(--fs-lg); }
  .stat-label { font-size: 9px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Live Activity Ticker (intro card)
   Hidden by default — JS reveals it only when there's activity in last 3 days
   ───────────────────────────────────────────────────────────────────────── */
.atk-root {
  display:         flex;
  align-items:     center;
  gap:             var(--sp-3);
  padding:         10px var(--sp-3);
  margin-top:      var(--sp-3);
  background:
    linear-gradient(135deg,
      rgba(201, 168, 76, 0.07),
      rgba(29, 158, 117, 0.07));
  border:          1px solid rgba(201, 168, 76, 0.22);
  border-radius:   999px;
  font-size:       var(--fs-xs);
  overflow:        hidden;
  min-height:      40px;
}

.atk-root[hidden] { display: none; }

.atk-header {
  display:     flex;
  align-items: center;
  gap:         6px;
  flex-shrink: 0;
  padding-inline-end: var(--sp-2);
  border-inline-end:  1px solid rgba(201, 168, 76, 0.18);
}

.atk-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 0 0 rgba(29, 158, 117, 0.4);
  animation:  atk-pulse 1.6s ease-in-out infinite;
}

@keyframes atk-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(29, 158, 117, 0.40); }
  50%      { box-shadow: 0 0 0 6px rgba(29, 158, 117, 0);    }
}

.atk-live-label {
  font-family:    'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size:      9px;
  font-weight:    700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color:          var(--c-green);
}

.atk-live-sub {
  font-size:      9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color:          var(--c-text-dim);
}

.atk-bubble {
  flex: 1;
  min-width: 0;
  display:    flex;
  align-items: center;
  transition: transform 0.30s ease-out, opacity 0.30s ease-out;
}

.atk-bubble--in       { transform: translateX(40%);  opacity: 0; }
.atk-bubble--visible  { transform: translateX(0);     opacity: 1; }
.atk-bubble--out      { transform: translateX(-40%); opacity: 0; transition-timing-function: ease-in; }

html[dir="rtl"] .atk-bubble--in  { transform: translateX(-40%); }
html[dir="rtl"] .atk-bubble--out { transform: translateX(40%);  }

.atk-bubble-static {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.atk-icon    { font-size: 14px; line-height: 1; flex-shrink: 0; }
.atk-nick    { font-weight: 700; color: var(--c-gold); flex-shrink: 0; }
.atk-verb    { color: var(--c-text-mid); flex-shrink: 0; }
.atk-subject {
  color:         var(--c-text);
  font-style:    italic;
  overflow:      hidden;
  text-overflow: ellipsis;
  white-space:   nowrap;
  min-width:     0;
  flex:          1;
}
.atk-flag    { font-size: 13px; flex-shrink: 0; }
.atk-time    { color: var(--c-text-dim); flex-shrink: 0; font-variant-numeric: tabular-nums; font-size: 11px; }

@media (max-width: 480px) {
  .atk-verb     { display: none; }
  .atk-live-sub { display: none; }
  .atk-time     { display: none; }
}

/* =============================================================================
   MAP CONTROLS — floating GPS + Search
   ============================================================================ */
.map-controls {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.map-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-mid);
  border-radius: 999px;
  color: var(--c-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.map-btn:hover {
  background: var(--c-elevated);
  border-color: var(--c-gold);
}

.map-btn:active { transform: scale(0.96); }

.map-btn.is-busy {
  pointer-events: none;
  opacity: 0.7;
}

@media (max-width: 540px) {
  .map-btn-label { display: none; }
  .map-btn {
    padding: 12px;
    width: 44px;
    height: 44px;
    justify-content: center;
  }
}

/* =============================================================================
   SEARCH PANEL — slides down from top
   ============================================================================ */
.search-panel {
  position: absolute;
  top: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 18;
  width: min(540px, calc(100% - var(--sp-7)));
  background: var(--c-surface);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.search-panel[hidden] { display: none; }

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px 44px 14px 16px;
  color: var(--c-text);
  font-size: var(--fs-md);
  outline: none;
}

.search-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--c-text-mid);
  cursor: pointer;
  font-size: 16px;
}

.search-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--c-text);
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 440px;
  overflow-y: auto;
  border-top: 1px solid var(--c-border);
}

.search-results[hidden] { display: none; }

/* Group header — "🕌 Masjids" / "🌍 Places" pills sticky-ish above each section */
.search-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-gold);
  background: linear-gradient(180deg, rgba(201, 168, 76, 0.08), rgba(201, 168, 76, 0.02));
  border-bottom: 1px solid rgba(201, 168, 76, 0.18);
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--c-border);
  transition: background 0.12s;
}

.search-result:hover { background: rgba(201, 168, 76, 0.06); }
.search-result:last-child { border-bottom: none; }
.search-result--loading { cursor: default; }
.search-result--loading:hover { background: transparent; }

.search-result-body { flex: 1; min-width: 0; }

.search-result-ar {
  font-family: var(--ff-arabic);
  font-size: 15px;
  font-weight: 700;
  color: var(--c-cream);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-name {
  font-size: var(--fs-sm);
  color: var(--c-text);
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-detail {
  font-size: var(--fs-xs);
  color: var(--c-text-mid);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tier-coloured dot on masjid results (matches explore tier conventions) */
.sr-tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
  background: var(--c-text-dim);
}
.search-result.sr-tier-0 .sr-tier-dot { background: #8899AA; }                          /* SEEDED */
.search-result.sr-tier-1 .sr-tier-dot { background: var(--c-info, #60A5FA); }           /* REPORTED */
.search-result.sr-tier-2 .sr-tier-dot { background: var(--c-green, #1D9E75); }          /* VERIFIED */
.search-result.sr-tier-3 .sr-tier-dot { background: var(--c-gold, #C9A84C); }           /* CLAIMED */
.search-result.sr-tier-4 .sr-tier-dot { background: #A78BFA; }                          /* INSTITUTIONAL */

.sr-place-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.30);
  font-size: 13px;
  flex-shrink: 0;
}
.sr-arrow {
  color: var(--c-text-dim);
  font-size: 14px;
  flex-shrink: 0;
}
.search-result:hover .sr-arrow { color: var(--c-gold); }

/* =============================================================================
   LONG-PRESS HINT
   ============================================================================ */
.lp-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(13, 21, 32, 0.92);
  border: 1px solid var(--c-gold);
  border-radius: 999px;
  padding: 10px 20px;
  color: var(--c-gold);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: lp-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes lp-pulse {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.95; }
  50%      { transform: translateX(-50%) translateY(-4px); opacity: 1; }
}

/* =============================================================================
   DROPPED PIN MARKER (custom HTML marker for MapLibre)
   ============================================================================ */
.pin-marker {
  width: 32px;
  height: 40px;
  cursor: grab;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transform: translateY(-20px);
}

.pin-marker svg {
  width: 100%;
  height: 100%;
}

.pin-marker:active {
  cursor: grabbing;
  transform: translateY(-22px) scale(1.05);
}

/* =============================================================================
   PIN ACTIONS — floating bar at bottom after pin drop
   ============================================================================ */
.pin-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 12;
  padding: var(--sp-4);
  background: linear-gradient(180deg, transparent, rgba(13, 21, 32, 0.92) 50%);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.pin-actions:not([hidden]) {
  display: block;
}

.pin-actions.is-visible {
  transform: translateY(0);
}

.pin-actions-inner {
  max-width: 540px;
  margin: 0 auto;
  background: var(--c-elevated);
  border: 1px solid var(--c-gold);
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.pin-actions-loc {
  font-size: var(--fs-sm);
  color: var(--c-cream);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-content: center;
}

.pin-actions-loc::before {
  content: "📍";
  font-size: 18px;
}

.pin-actions-row {
  display: flex;
  gap: var(--sp-3);
}

.pin-actions-row .btn { flex: 1; }

/* =============================================================================
   DRAWER — slides up to host the wizard
   ============================================================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(7, 17, 30, 0.66);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.drawer-overlay:not([hidden]) {
  display: block;
}

.drawer-overlay.is-visible { opacity: 1; }

.drawer {
  position: fixed;
  z-index: 41;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border-mid);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
  height: 92vh;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer:not([hidden]) {
  display: flex;
}

.drawer.is-open {
  transform: translateY(0);
}

@media (min-width: 720px) {
  .drawer {
    left: auto;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(540px, 100%);
    height: 100%;
    border-radius: 0;
    border-top: none;
    border-left: 1px solid var(--c-border-mid);
    transform: translateX(100%);
  }
  .drawer.is-open { transform: translateX(0); }

  html[dir="rtl"] .drawer {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--c-border-mid);
    transform: translateX(-100%);
  }
  html[dir="rtl"] .drawer.is-open { transform: translateX(0); }
}

.drawer-hdr {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Drag handle on mobile */
.drawer-hdr::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 40px;
  height: 4px;
  background: var(--c-border-mid);
  border-radius: 999px;
  transform: translateX(-50%);
}

@media (min-width: 720px) {
  .drawer-hdr::before { display: none; }
}

.drawer-hdr-text {
  min-width: 0;
}

.drawer-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-cream);
}

.drawer-sub {
  margin: 2px 0 0;
  font-size: var(--fs-xs);
  color: var(--c-gold);
  font-weight: 500;
}

.drawer-close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--c-border-mid);
  border-radius: 50%;
  color: var(--c-text);
  font-size: var(--fs-md);
  cursor: pointer;
  flex-shrink: 0;
}

.drawer-close:hover {
  background: var(--c-elevated);
  color: var(--c-gold);
  border-color: var(--c-gold);
}

/* =============================================================================
   WIZARD (inside drawer)
   ============================================================================ */
.wiz {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Progress */
.wiz-progress {
  height: 4px;
  width: 100%;
  background: var(--c-border);
  border-radius: 999px;
  overflow: hidden;
}

.wiz-progress-bar {
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--c-gold-dark), var(--c-gold), var(--c-gold-light));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.wiz-step-label {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.wiz-step-name {
  color: var(--c-gold);
  margin-inline-start: var(--sp-2);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

/* Step */
.wiz-step {
  display: none;
  flex-direction: column;
  gap: var(--sp-4);
}

.wiz-step.is-active { display: flex; }

.wiz-step-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-cream);
  letter-spacing: -0.01em;
}

.wiz-step-sub {
  margin: 0;
  color: var(--c-text-mid);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.wiz-subhead {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--c-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Wizard nav */
.wiz-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-top: var(--sp-4);
  margin-top: auto;
  border-top: 1px solid var(--c-border);
  position: sticky;
  bottom: 0;
  background: var(--c-surface);
  padding-bottom: var(--sp-2);
}

.wiz-error {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.30);
  color: #FCA5A5;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
}

/* =============================================================================
   LOCATION SUMMARY (top of wizard step 1)
   ============================================================================ */
.loc-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(29, 158, 117, 0.08);
  border: 1px solid rgba(29, 158, 117, 0.30);
  border-radius: var(--radius);
}

.loc-summary-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.loc-summary-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loc-summary-coords {
  font-family: monospace;
  font-size: var(--fs-xs);
  color: var(--c-text-mid);
}

.loc-summary-place {
  font-size: var(--fs-sm);
  color: var(--c-text);
  font-weight: 600;
}

.loc-summary-edit {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--c-border-mid);
  border-radius: var(--radius);
  color: var(--c-text-mid);
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
}

.loc-summary-edit:hover {
  color: var(--c-gold);
  border-color: var(--c-gold);
}

/* =============================================================================
   FIELDS
   ============================================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
}

.field--inline { flex: 1; }

.field-label {
  font-size: var(--fs-sm);
  color: var(--c-text);
  font-weight: 600;
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
}

.field-label-sm {
  font-size: 11px;
  color: var(--c-text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 2px;
}

.field-required { color: var(--c-gold); font-weight: 700; }

.field-hint {
  font-size: var(--fs-xs);
  color: var(--c-text-dim);
  font-weight: 400;
}

.field-hint-block {
  margin: 6px 0 0;
  font-size: var(--fs-xs);
  color: var(--c-text-mid);
  line-height: 1.5;
  font-style: italic;
}

/* Hint variants — colour-tinted to reinforce visibility status */
.field-hint-block--public {
  color: var(--c-cream);
  background: rgba(201, 168, 76, 0.07);
  border-left: 3px solid var(--c-gold);
  padding: 8px 10px;
  border-radius: 0 4px 4px 0;
  font-style: normal;
}
.field-hint-block--private {
  color: var(--c-text-mid);
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--c-border-mid);
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  font-style: normal;
}

/* ── Visibility badges next to field labels ──────────────────────────────
   Inline pills that tell the contributor up-front whether this field is
   PUBLIC (seen by everyone) or PRIVATE (only admin / amanah audit). */
.vis-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-inline-start: 8px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: middle;
}
.vis-badge--public {
  color: var(--c-gold);
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.35);
}
.vis-badge--private {
  color: var(--c-text-mid);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.field-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--c-text);
  font-size: var(--fs-md);
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}

.field-input:hover  { background: rgba(255, 255, 255, 0.06); }
.field-input:focus  { border-color: var(--c-gold); background: rgba(201, 168, 76, 0.05); }

.field-input--ar    { font-family: var(--ff-arabic); font-size: var(--fs-lg); }
.field-input--reveal { margin-top: 6px; }

select.field-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-gold) 50%),
                    linear-gradient(135deg, var(--c-gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px),
                       calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 36px;
}

html[dir="rtl"] select.field-input {
  background-position: 18px calc(50% - 2px), 13px calc(50% - 2px);
  padding-inline-end: 14px;
  padding-inline-start: 36px;
}

/* The <option> elements inside <select> render in the browser's native
   dropdown overlay — they DON'T inherit the parent <select> colors on
   Chrome/Edge. Explicit dark bg + light text so the list is readable. */
select.field-input option {
  background-color: var(--c-navy-deep);
  color: var(--c-text);
}
select.field-input option:checked,
select.field-input option:hover {
  background-color: var(--c-navy);
  color: var(--c-cream);
}

textarea.field-input {
  resize: vertical;
  min-height: 72px;
}

.field-error {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-danger);
  font-weight: 600;
}

.field-input[aria-invalid="true"] { border-color: var(--c-danger); }

/* =============================================================================
   TRI-STATE
   ============================================================================ */
.tri-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tri-group-label {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text);
}

.tri-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tri-pills button {
  flex: 1;
  min-width: 60px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--c-border);
  color: var(--c-text-mid);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: all 0.15s;
}

.tri-pills button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--c-text);
}

.tri-pills button.is-active[data-tri-val="true"] {
  background: rgba(29, 158, 117, 0.18);
  border-color: var(--c-green);
  color: var(--c-green);
}

.tri-pills button.is-active[data-tri-val="false"] {
  background: rgba(239, 68, 68, 0.14);
  border-color: var(--c-danger);
  color: var(--c-danger);
}

.tri-pills button.is-active[data-tri-val="null"] {
  background: rgba(255, 255, 255, 0.10);
  border-color: var(--c-border-mid);
  color: var(--c-text);
}

.tri-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

@media (max-width: 420px) {
  .tri-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   IQAMAH GRID
   ============================================================================ */
.iqamah-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-2);
}

@media (max-width: 540px) {
  .iqamah-grid { grid-template-columns: repeat(3, 1fr); }
}

.iqamah-grid .field-input {
  padding: 8px 10px;
  font-size: var(--fs-sm);
}

/* =============================================================================
   CONDITIONAL VISIBILITY
   ============================================================================ */
.conditional {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-inline-start: var(--sp-4);
  border-inline-start: 2px solid var(--c-gold);
  margin-block: var(--sp-2);
}

.conditional[hidden] { display: none; }

/* =============================================================================
   EMAIL PERMANENCE NOTICE
   ============================================================================ */
.permanence {
  margin-top: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(201, 168, 76, 0.06);
  border: 1px solid rgba(201, 168, 76, 0.30);
  border-inline-start-width: 4px;
  border-radius: var(--radius);
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.permanence-icon {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  flex-shrink: 0;
}

.permanence-body p {
  margin: 0 0 6px;
  font-size: var(--fs-xs);
  color: var(--c-text);
  line-height: 1.6;
}

.permanence-body p strong { color: var(--c-gold); }

.permanence-link {
  font-size: var(--fs-xs);
  color: var(--c-gold);
  font-weight: 700;
  text-decoration: none;
}

.permanence-link:hover { text-decoration: underline; }

/* =============================================================================
   EXPLORE-PAGE-STYLE SIDEBAR (ported from src/styles/sections/masjid-map.css)
   Makes the βeta form look like part of the main TMA explore page.
   ============================================================================= */

/* Root — the whole map-stage acts as the explore root */
.ex-root {
  position: relative;
  display:  flex;
  width:    100%;
  height:   100%;
}

/* Map fills the remaining space to the right of the panel */
.ex-map-wrap {
  position: absolute;
  inset:    0;
  z-index:  1;
}
.ex-map { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── FLOATING PANEL — teal ember glassmorphism ─────────────────────────── */
/* Sits flush against the bottom edge of the header. Reaches to the very
   bottom of the viewport. Parent `.map-stage` is already pushed down
   by `var(--hdr-h)` via `position: fixed; inset: var(--hdr-h) 0 0 0`,
   so the panel's own `top: 0` puts it exactly under the header. */
.ex-panel {
  position:         absolute;
  top:              0;
  left:             0;
  bottom:           0;
  width:            340px;
  max-width:        calc(100vw - 0px);
  z-index:          20;
  background:
    radial-gradient(ellipse 120% 35% at 50% 0%, var(--green-10) 0%, transparent 65%),
    linear-gradient(160deg, rgba(30,46,56,0.96) 0%, rgba(25,38,48,0.96) 100%);
  border:           1px solid var(--green-18);
  border-radius:    var(--border-radius-xl);
  overflow:         hidden;
  backdrop-filter:  blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:       var(--shadow-modal), 0 0 0 1px var(--green-06), inset 0 1px 0 var(--white-04);
}
.ex-panel {
  border-radius: 0 var(--border-radius-xl) var(--border-radius-xl) 0;
}
.ex-panel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 75% 45% at 100% 0%,  var(--green-13) 0%, transparent 65%),
    radial-gradient(ellipse 55% 35% at 0%   100%, var(--gold-08) 0%, transparent 60%);
}
.ex-panel-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  min-height: 0;       /* allow children with overflow:auto to shrink */
}

/* Sheet handle — shown on mobile only */
.ex-sheet-handle-wrap {
  display: none; width: 100%; padding: 10px 0 4px;
  background: transparent; border: none; cursor: pointer;
  flex-shrink: 0; align-items: center; justify-content: center;
}
.ex-sheet-handle { display: block; width: 40px; height: 4px; background: var(--green-45); border-radius: var(--border-radius-full); margin: 0 auto; }

/* ── Search section ─── */
.ex-search-section { padding: 14px 14px 8px; flex-shrink: 0; }
.ex-search-wrap {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  background: var(--white-05);
  border: 1px solid var(--green-18);
  border-radius: var(--border-radius-lg);
  transition: var(--transition-color);
}
.ex-search-wrap:focus-within { border-color: var(--green-45); }
.ex-search-icon { font-size: 13px; opacity: 0.55; flex-shrink: 0; }
.ex-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-90); font-size: 13px; font-family: inherit;
}
.ex-search-input::placeholder { color: var(--text-28); }
.ex-count-pill {
  font-size: 10px; font-weight: 700;
  color: var(--color-green); background: var(--green-10);
  border: 1px solid var(--green-20);
  border-radius: var(--border-radius-full);
  padding: 2px 9px; flex-shrink: 0; line-height: 1.6;
}
.ex-search-clear {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  flex-shrink: 0; color: var(--text-35); font-size: 14px; line-height: 1;
  border-radius: var(--border-radius-sm);
}
.ex-search-clear:hover { color: var(--text-70); }

/* ── Map action row (Find me / Dark mode) inside the sidebar ───────────── */
.ex-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.ex-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  background: var(--white-04);
  border: 1px solid var(--green-18);
  border-radius: var(--border-radius);
  color: var(--text-70);
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-all);
}
.ex-action:hover {
  background: var(--green-08);
  border-color: var(--green-28);
  color: var(--c-cream);
}
.ex-action.is-active {
  background: var(--green-12);
  border-color: var(--green-45);
  color: var(--color-green);
}
.ex-action-icon { font-size: 13px; line-height: 1; }
.ex-action-label { line-height: 1; }
@media (max-width: 400px) {
  /* On very narrow screens, icon-only — labels hidden */
  .ex-action-label { display: none; }
}

/* ── Stats strip ── */
.ex-stats { display: flex; align-items: center; justify-content: space-around; padding: 6px 14px 12px; flex-shrink: 0; }
.ex-stat  { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ex-stat-num     { font-family: var(--font-display); font-size: 22px; font-weight: 700; line-height: 1; text-shadow: 0 0 20px currentColor; }
.ex-stat-label   { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-28); }
.ex-stat-divider { width: 1px; height: 30px; background: var(--white-06); }
.ex-stat-num--green { color: var(--color-green); }
.ex-stat-num--gold  { color: var(--color-gold);  }
.ex-stat-num--info  { color: var(--color-info); font-size: 11px; letter-spacing: 0.05em; }

.ex-panel-divider { height: 1px; background: var(--green-08); flex-shrink: 0; }

/* Spinner */
.ex-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid var(--green-25); border-top-color: var(--color-green);
  border-radius: 50%; animation: ex-spin 0.65s linear infinite; vertical-align: middle;
}
@keyframes ex-spin { to { transform: rotate(360deg); } }
.ex-spinner--inline { margin-right: 6px; }

/* ── Selected masjid card ── */
.ex-selected-card {
  margin: 10px 12px;
  padding: 12px;
  background: linear-gradient(145deg, #1E2E38 0%, #192630 100%);
  border: 1px solid var(--green-22);
  border-radius: var(--border-radius-lg);
  flex-shrink: 0; position: relative; overflow: hidden;
  animation: ex-slide-in 0.25s ease;
}
@keyframes ex-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.ex-selected-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 100% 0%, rgba(29,158,117,0.11) 0%, transparent 65%),
    radial-gradient(ellipse 55% 45% at 0%   100%, var(--gold-07) 0%, transparent 60%);
}
.ex-selected-card > * { position: relative; z-index: 1; }
.ex-selected-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.ex-tier-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 18px; padding: 0 8px;
  border-radius: var(--border-radius-full);
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.ex-tier-badge--0 { background: rgba(107,114,128,0.12); color: #9CA3AF; border: 1px solid rgba(107,114,128,0.25); }
.ex-tier-badge--1 { background: var(--blue-12);  color: var(--color-info); border: 1px solid var(--blue-25); }
.ex-tier-badge--2 { background: var(--green-12);  color: var(--color-green); border: 1px solid var(--green-28); }
.ex-tier-badge--3 { background: rgba(251,191,36,0.12);  color: var(--color-warning); border: 1px solid rgba(251,191,36,0.25); }
.ex-tier-badge--4 { background: rgba(167,139,250,0.12); color: var(--color-purple); border: 1px solid rgba(155,114,207,0.25); }

.ex-selected-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-30); font-size: 14px; padding: 2px 6px; line-height: 1;
  border-radius: var(--border-radius-sm);
}
.ex-selected-close:hover { color: var(--cream-80); }

.ex-selected-arabic { font-family: var(--font-arabic); font-size: 17px; color: var(--color-gold); margin: 0 0 2px; direction: rtl; text-align: right; line-height: 1.35; }
.ex-selected-name   { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--color-cream); margin: 0 0 4px; line-height: 1.2; }
.ex-selected-city   { font-size: 11px; color: var(--text-40); margin: 0 0 8px; }

/* Facility chips — colored icons only */
.ex-facility-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.ex-chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; border: none; background: transparent;
  border-radius: var(--border-radius-full); font-size: 16px; line-height: 1; cursor: help;
  transition: transform 0.15s ease;
}
.ex-chip:hover { transform: translateY(-1px) scale(1.08); }
.ex-chip--jumah      { color: var(--color-green); }
.ex-chip--sisters    { color: var(--color-purple); }
.ex-chip--wheelchair { color: var(--color-info); }
.ex-chip--parking    { color: var(--color-gold); }
.ex-chip--wifi       { color: var(--color-info); }
.ex-chip--iftar      { color: var(--color-gold); }
.ex-chip--food       { color: var(--color-green); }

/* Action buttons */
.ex-selected-actions { display: flex; gap: 7px; margin-bottom: 8px; }
.ex-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 1; height: 32px; border-radius: 8px;
  font-size: 12px; font-weight: 600; font-family: inherit;
  text-decoration: none; transition: var(--transition-all); cursor: pointer;
  border: 1px solid var(--white-10); background: var(--white-05); color: var(--text-65);
}
.ex-btn:hover { background: var(--white-09); color: var(--text-primary); }
.ex-btn--primary { background: var(--btn-bg); border-color: var(--color-green); color: var(--btn-text); }
.ex-btn--primary:hover { background: var(--btn-bg-hover); }

/* βeta teaser footer in the selected card — "Full profile coming soon" */
.ex-coming-soon {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--color-gold); padding: 6px 0 0;
  border-top: 1px dashed rgba(201,168,76,0.30); margin-top: 6px;
}

/* ── Nearby list ── */
.ex-nearby {
  padding: 6px 12px 8px;
  flex: 1 1 0;                /* explicit basis so it shrinks below content height */
  min-height: 0;              /* without this, flex item refuses to be smaller than its content */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;   /* momentum on iOS */
  scrollbar-width: thin;
  scrollbar-color: var(--green-15) transparent;
}
.ex-nearby::-webkit-scrollbar { width: 4px; }
.ex-nearby::-webkit-scrollbar-thumb { background: var(--green-15); border-radius: 2px; }
.ex-nearby-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-28); margin: 0 0 6px; }
.ex-nearby-empty { font-size: 11.5px; color: var(--text-20); margin: 0; font-style: italic; }
.ex-nearby-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 6px; background: transparent; border: none;
  cursor: pointer; border-bottom: 1px solid var(--white-04);
  text-align: left; transition: var(--transition-all); border-radius: var(--border-radius-sm);
}
.ex-nearby-item:last-child { border-bottom: none; }
.ex-nearby-item:hover { background: linear-gradient(90deg, var(--green-08) 0%, transparent 100%); padding-left: 10px; border-color: var(--green-08); }
.ex-nearby-item:hover .ex-nearby-name { color: var(--color-green); }
.ex-nearby-dot   { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,0.04); }
.ex-nearby-info  { flex: 1; min-width: 0; }
.ex-nearby-name  { font-size: 12px; font-weight: 600; color: rgba(240,244,248,0.85); margin: 0 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: var(--transition-color); }
.ex-nearby-city  { font-size: 10px; color: var(--text-28); margin: 0; }
.ex-nearby-arabic { font-family: var(--font-arabic); font-size: 12px; color: rgba(240,244,248,0.40); margin: 0 0 1px; direction: rtl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-nearby-arrow { font-size: 11px; color: rgba(240,244,248,0.18); flex-shrink: 0; }

/* Tier dot colours (used in nearby list) */
.ex-tier-dot--0 { background: var(--text-muted); }
.ex-tier-dot--1 { background: var(--color-info); }
.ex-tier-dot--2 { background: var(--color-green); }
.ex-tier-dot--3 { background: var(--color-warning); }
.ex-tier-dot--4 { background: var(--color-purple); }

/* ── Mobile bottom-sheet behaviour ── */
@media (max-width: 760px) {
  .ex-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; max-width: none;
    max-height: 48vh;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
  }
  .ex-sheet-handle-wrap { display: flex; }
  .ex-panel--expanded   { max-height: 75vh; }
}

/* =============================================================================
   MASJID INFO POPUP — teaser-style card shown on green-pin click
   Arabic name above English (non-negotiable design rule), location, facility
   emojis only (no labels until full launch), Directions button only,
   "Full profile coming soon" footer.
   ============================================================================ */
.maplibregl-popup.tma-masjid-popup .maplibregl-popup-content {
  background:    var(--c-navy-deep);
  color:         var(--c-text);
  border:        1px solid var(--c-gold);
  border-radius: var(--radius);
  padding:       0;
  box-shadow:    0 10px 30px rgba(0, 0, 0, 0.45);
}
.maplibregl-popup.tma-masjid-popup .maplibregl-popup-tip {
  border-top-color: var(--c-gold);
  border-bottom-color: var(--c-gold);
}
.maplibregl-popup.tma-masjid-popup .maplibregl-popup-close-button {
  color: var(--c-cream);
  font-size: 22px;
  padding: 0 8px;
  line-height: 1;
}

.mp-card {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}
.mp-head { margin-bottom: 2px; }
.mp-tier {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.mp-tier--0 { color: #8899AA; }
.mp-tier--1 { color: var(--c-info, #60A5FA); }
.mp-tier--2 { color: var(--c-green, #1D9E75); }
.mp-tier--3 { color: var(--c-gold, #C9A84C); }
.mp-tier--4 { color: #A78BFA; }
.mp-ar {
  font-family: var(--ff-arabic);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-cream);
  line-height: 1.35;
}
.mp-en {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.35;
}
.mp-loc {
  font-size: 11.5px;
  color: var(--c-text-mid);
  letter-spacing: 0.01em;
}
.mp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.mp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(201, 168, 76, 0.10);
  border: 1px solid rgba(201, 168, 76, 0.30);
  color: var(--c-cream);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.mp-chip-lbl {
  /* Keep label text terse on mobile; full label shows on hover via title */
  display: inline;
}
@media (max-width: 380px) {
  /* On very narrow screens, icon-only chips */
  .mp-chip-lbl { display: none; }
}
.mp-no-data {
  font-size: 11.5px;
  color: var(--c-text-dim);
  font-style: italic;
  margin: 4px 0;
}
.mp-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.mp-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.mp-btn--directions {
  background: var(--c-green);
  color: var(--c-navy-deep);
}
.mp-btn--directions:hover {
  background: var(--c-green-bright, #2cb88a);
}
.mp-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(201, 168, 76, 0.30);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--c-gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mp-footer-icon { font-size: 11px; }

/* =============================================================================
   βETA LEGAL FRAMEWORK TEASER
   Sits above the consent block. Frames the active βeta consent as part of
   the broader stack arriving with full launch.
   ============================================================================ */
.legal-framework {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(29, 158, 117, 0.04));
  border: 1px solid var(--c-gold);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.lf-header { margin-bottom: var(--sp-3); }
.lf-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--c-gold);
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.40);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.lf-title {
  font-family: var(--ff-display, inherit);
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-cream);
  margin: 8px 0 6px;
  line-height: 1.3;
}
.lf-sub {
  font-size: var(--fs-xs);
  color: var(--c-text-mid);
  line-height: 1.55;
  margin: 0;
}
.lf-docs {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.lf-doc {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.20);
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 8px;
}
.lf-doc-icon {
  font-size: 14px;
  line-height: 1.2;
  flex-shrink: 0;
  opacity: 0.85;
}
.lf-doc-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.lf-doc-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-cream);
  line-height: 1.25;
}
.lf-doc-meta {
  font-size: 10px;
  color: var(--c-text-mid);
  font-style: italic;
  letter-spacing: 0.02em;
}
@media (max-width: 540px) {
  .lf-docs { grid-template-columns: 1fr; }
}

/* =============================================================================
   CONSENT BLOCK
   ============================================================================ */
.consent {
  background: var(--c-elevated);
  border: 1px solid var(--c-border-mid);
  border-radius: var(--radius);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.consent-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--c-cream);
  font-family: var(--ff-display);
}

.consent-meta {
  display: flex;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-mid);
  flex-wrap: wrap;
  align-items: center;
}

.consent-version {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.consent-text {
  max-height: 220px;
  overflow-y: auto;
  padding: var(--sp-3);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--c-text);
  white-space: pre-wrap;
}

.consent-text:empty::before {
  content: "Loading consent text…";
  color: var(--c-text-dim);
  font-style: italic;
}

.consent-text[lang="ar"] {
  font-family: var(--ff-arabic);
  font-size: var(--fs-md);
  direction: rtl;
  text-align: right;
}

.consent-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--c-border);
}

.consent-checkbox-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  accent-color: var(--c-gold);
  cursor: pointer;
  margin-top: 1px;
}

.consent-checkbox-row label {
  font-size: var(--fs-sm);
  color: var(--c-text);
  cursor: pointer;
  line-height: 1.5;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-dim);
  padding-top: var(--sp-2);
}

.legal-links a {
  color: var(--c-text-mid);
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--c-gold);
  text-decoration: underline;
}

/* =============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-sm {
  padding: 8px 14px;
  font-size: var(--fs-xs);
}

.btn-primary {
  background: var(--c-gold);
  color: var(--c-navy);
  border-color: var(--c-gold);
}

.btn-primary:hover:not(:disabled) {
  background: var(--c-gold-light);
  border-color: var(--c-gold-light);
  transform: translateY(-1px);
}

.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border-mid);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--c-gold);
  color: var(--c-gold);
}

.btn-submit {
  background: linear-gradient(90deg, var(--c-gold), var(--c-gold-light));
  color: var(--c-navy);
  padding: 14px 28px;
  font-size: var(--fs-md);
  border: none;
}

.btn-submit:disabled { opacity: 0.55; }

/* =============================================================================
   SUCCESS OVERLAY
   ============================================================================ */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(7, 17, 30, 0.94);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}

.success-overlay[hidden] { display: none; }

.success-card {
  background: linear-gradient(145deg, var(--c-elevated), var(--c-surface));
  border: 1px solid var(--c-border-mid);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  align-items: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.success-icon { font-size: 64px; line-height: 1; }

.success-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: var(--fs-2xl);
  color: var(--c-gold);
}

.success-body {
  margin: 0;
  color: var(--c-text-mid);
  line-height: 1.7;
  font-size: var(--fs-sm);
  max-width: 40ch;
}

.success-dup {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(201, 168, 76, 0.10);
  border: 1px solid rgba(201, 168, 76, 0.30);
  border-radius: var(--radius);
  font-size: var(--fs-xs);
  color: var(--c-cream);
  line-height: 1.5;
}

.success-id {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-text-dim);
}

.success-id code {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--c-text);
}

.success-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* =============================================================================
   RTL fine-tuning
   ============================================================================ */
html[dir="rtl"] .field-input {
  text-align: right;
}

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="time"] {
  text-align: left;
  direction: ltr;
}

html[dir="rtl"] .map-controls {
  left: auto;
  right: var(--sp-4);
}

html[dir="rtl"] .success-id code,
html[dir="rtl"] .loc-summary-coords {
  direction: ltr;
  display: inline-block;
}
