/* Lower Hutt Islamic Centre — shared styles
   Palette: deep green (primary), warm gold (accent), warm white (surface).
   v1.8.0: theme system — light (default), dark, high-contrast. Themes are
   switched by setting `data-theme="dark|hc"` on <html>. The default (no
   attribute) is the warm light theme. All components below use CSS variables
   so a single switch flips the whole site.
   v1.8.1.30: modern 3D look — layered shadows, soft elevations, glassmorphism
   on the header/hero, multi-stop gradient on hero, depth on cards. */

:root,
:root[data-theme="light"] {
  --green-900: #0e3a2f;
  --green-700: #155a48;
  --green-500: #1f8c6b;
  --green-300: #5fb89b;
  --green-100: #d5ebe1;
  --gold-700: #8a6d24;
  --gold-500: #c89b3c;
  --gold-300: #e4c879;
  --gold-100: #f8edcd;
  --ink-900: #0a1e1a;
  --ink-700: #2c3a36;
  --ink-500: #54635e;
  --ink-300: #93a39e;
  --ink-100: #e3e9e7;
  --surface: #f6f5ee;
  --white: #ffffff;
  --danger: #b03a2e;
  --warn: #b8860b;
  --ok: #1f8c6b;
  /* v1.8.2.66w.331.7: tone pairs for status chips / badges.
     Previously every status badge inlined a Tailwind hex pair
     (#fee2e2/#991b1b etc.), which meant ~209 literals that could not
     follow the theme. These pairs replace them; see
     docs/ROADMAP.md §2.1 (A5). */
  --danger-bg: #fee2e2;  --danger-fg: #991b1b;
  --warn-bg:   #fef3c7;  --warn-fg:   #92400e;
  --ok-bg:     #dcfce7;  --ok-fg:     #166534;
  --info-bg:   #dbeafe;  --info-fg:   #1e40af;
  --neutral-bg:#f3f4f6;  --neutral-fg:#374151;
  /* Sisters template identity: soft blush pink + rose gold. */
  --sisters-bg: #fce7f3; --sisters-fg: #9d174d; --sisters-accent: #b8895a;
  /* v1.8.1.63: bigger radii for a more rounded, modern feel */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-pill: 999px;
  /* v1.8.1.63: stronger 3D shadows with bigger blur, colored glow,
     and multi-layer ambient occlusion. The system has 5 levels:
     1 = subtle (small UI), 2 = cards, 3 = hover, 4 = hero/elevated,
     5 = modals. Plus an inset for pressed/inner elements. */
  --shadow-1: 0 1px 2px rgba(10,30,26,0.05), 0 2px 6px rgba(10,30,26,0.04);
  --shadow-2: 0 2px 4px rgba(10,30,26,0.04), 0 8px 16px rgba(10,30,26,0.06), 0 20px 40px rgba(10,30,26,0.04);
  --shadow-3: 0 4px 8px rgba(10,30,26,0.05), 0 16px 32px rgba(10,30,26,0.08), 0 32px 64px rgba(10,30,26,0.06);
  --shadow-4: 0 8px 16px rgba(10,30,26,0.08), 0 24px 48px rgba(10,30,26,0.10), 0 48px 96px rgba(10,30,26,0.08);
  --shadow-5: 0 12px 24px rgba(10,30,26,0.10), 0 32px 64px rgba(10,30,26,0.14), 0 64px 128px rgba(10,30,26,0.10);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -1px 0 rgba(10,30,26,0.04);
  --shadow-inset-deep: inset 0 2px 6px rgba(10,30,26,0.08);
  --shadow-glow: 0 0 0 4px rgba(31,140,107,0.18), 0 0 24px rgba(31,140,107,0.25);
  --shadow-gold: 0 0 0 4px rgba(200,155,60,0.20), 0 0 24px rgba(200,155,60,0.25);
  --shadow-old-2: 0 4px 12px rgba(10,30,26,0.10), 0 16px 32px rgba(10,30,26,0.08);
  /* v1.8.1.63: smooth easing curves for animations */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition: 0.25s var(--ease-out);
  --transition-slow: 0.4s var(--ease-in-out);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Roboto Flex", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-arabic: "Amiri", "Scheherazade New", "Noto Naskh Arabic", serif;
  /* v1.8.2.66w.369: Urdu is Arabic script but NOT Arabic. Amiri is
     a Naskh face; setting Urdu in it is legible but reads as
     foreign to an Urdu reader. Nastaliq is the script Urdu is
     actually written in. Loaded only for :lang(ur), so the
     660 KB never touches an English or Arabic page. */
  --font-urdu: "NotoNastaliqUrdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", serif;
  /* v1.8.1.63: typography scale (modular scale 1.250) */
  --fs-xs: 0.78rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;
  --fs-5xl: 3.75rem;

  /* Semantic tokens (v1.8.0) — components below read these, not raw colors,
     so theme switches propagate uniformly. */
  --bg-page: var(--surface);
  --bg-card: var(--white);
  --bg-elevated: var(--white);
  --bg-muted: #efeee7;
  --bg-header: rgba(255,255,255,0.78);
  --bg-hero: radial-gradient(ellipse at 30% 0%, #1f8c6b 0%, #155a48 45%, #0e3a2f 100%);
  --bg-bismillah: linear-gradient(180deg, #e3ede0 0%, #d3e1cf 100%);
  --bg-bismillah-text: var(--green-900);
  --text-primary: var(--ink-900);
  --text-secondary: var(--ink-700);
  --text-muted: var(--ink-500);
  --text-on-hero: var(--white);
  --text-on-accent: var(--ink-900);
  --border: var(--ink-100);
  --border-strong: var(--ink-300);
  --accent: var(--gold-500);
  /* v1.8.2.66w.331.7: --gold was referenced ~6× but never
     defined, so every use fell back to a hardcoded hex that
     ignored the theme. Alias it to the ramp instead. */
  --gold: var(--gold-700);
  /* v1.8.2.66w.331.7: gold-family TEXT on the page surface. Distinct
     from --warn-fg, which is the dark-badge-fill partner of --warn-bg
     and is deliberately bright in dark/hc. */
  --gold-text: #92400e;
  --accent-strong: var(--gold-700);
  --accent-text: var(--white);
  --link: var(--green-700);
  --link-hover: var(--green-900);
  --header-h: 64px;
  --header-shadow: 0 4px 16px rgba(10,30,26,0.06), 0 1px 0 rgba(10,30,26,0.04);
}

/* Dark theme — same layout, deep night palette. */
:root[data-theme="dark"] {
  --green-900: #c8e6d8;
  --green-700: #5fb89b;
  --green-500: #1f8c6b;
  --green-300: #155a48;
  --green-100: #0e3a2f;
  --gold-700: #f8edcd;
  --gold-500: #e4c879;
  --gold-300: #c89b3c;
  --gold-100: #8a6d24;
  --ink-900: #f4f6f3;
  --ink-700: #d2d8d3;
  --ink-500: #93a39e;
  --ink-300: #4a5751;
  --ink-100: #2a302d;
  --surface: #14181a;
  --white: #1c2123;
  --danger: #e07b6f;
  --warn: #e8c068;
  --ok: #5fb89b;
  /* v1.8.2.66w.331.7: dark tone pairs — dark fill, light text. */
  --danger-bg: #3f1d1d;  --danger-fg: #fca5a5;
  --warn-bg:   #3f2f10;  --warn-fg:   #fcd34d;
  --ok-bg:     #10301f;  --ok-fg:     #86efac;
  --info-bg:   #102a4a;  --info-fg:   #93c5fd;
  --neutral-bg:#242a2d;  --neutral-fg:#d2d8d3;
  /* Sisters template identity — dark fill, light text. */
  --sisters-bg: #3a1025; --sisters-fg: #f9a8d4; --sisters-accent: #d4a574;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.25);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.5), 0 16px 32px rgba(0,0,0,0.35);
  --shadow-3: 0 8px 16px rgba(0,0,0,0.5), 0 24px 48px rgba(0,0,0,0.4);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.4);
  --shadow-glow: 0 0 0 4px rgba(95,184,155,0.25);

  --bg-page: var(--surface);
  --bg-card: var(--white);
  --bg-elevated: #232a2c;
  --bg-muted: #1f2426;
  --bg-header: rgba(28,33,35,0.78);
  --bg-hero: radial-gradient(ellipse at 30% 0%, #0e3a2f 0%, #0a1e1a 60%, #050d0b 100%);
  --bg-bismillah: linear-gradient(180deg, #1f2426 0%, #16191a 100%);
  --bg-bismillah-text: var(--gold-300);
  --text-primary: var(--ink-900);
  --text-secondary: var(--ink-700);
  --text-muted: var(--ink-500);
  --text-on-hero: var(--white);
  --text-on-accent: var(--ink-900);
  --border: var(--ink-100);
  --border-strong: var(--ink-300);
  --accent: var(--gold-500);
  --gold: var(--gold-700);
  --accent-strong: var(--gold-300);
  /* v1.8.2.66w.331.7: must be DARK in dark theme. --accent is the
     light gold #e4c879 here, so `var(--ink-900)` (which inverts to
     #f4f6f3 in dark) put light text on a light fill = 1.5:1. */
  --accent-text: #1a2e1a;
  --gold-text: #e4c879;
  --link: var(--green-300);
  --link-hover: var(--green-100);
  --header-shadow: 0 1px 0 #2a302d;
}

/* High-contrast theme — accessibility: WCAG AAA contrast, no shadows, thicker
   borders, larger hit areas. The same layout, just starker. */
:root[data-theme="hc"] {
  --green-900: #000000;
  --green-700: #003a23;
  --green-500: #006633;
  --green-300: #00994d;
  --green-100: #99ffcc;
  --gold-700: #664400;
  --gold-500: #cc8800;
  --gold-300: #ffaa00;
  --gold-100: #fff2cc;
  --ink-900: #000000;
  --ink-700: #1a1a1a;
  --ink-500: #333333;
  --ink-300: #666666;
  --ink-100: #cccccc;
  --surface: #ffffff;
  --white: #ffffff;
  --danger: #990000;
  --warn: #996600;
  --ok: #006633;
  /* v1.8.2.66w.331.7: high-contrast tone pairs — near-black fill,
     saturated text, so every chip clears WCAG AA on the hc palette. */
  --danger-bg: #2a0000;  --danger-fg: #ff8080;
  --warn-bg:   #2a1f00;  --warn-fg:   #ffc107;
  --ok-bg:     #00210f;  --ok-fg:     #4ade80;
  --info-bg:   #001a33;  --info-fg:   #60a5fa;
  --neutral-bg:#000000;  --neutral-fg:#ffffff;
  /* Sisters template identity — near-black fill, saturated pink. */
  --sisters-bg: #2a0016; --sisters-fg: #ff9fd0; --sisters-accent: #e8c39a;
  --shadow-1: 0 0 0 2px #000;
  --shadow-2: 0 0 0 3px #000;

  --bg-page: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-muted: #f0f0f0;
  --bg-header: #ffffff;
  --bg-hero: #003a23;
  --bg-bismillah: #fff2cc;
  --bg-bismillah-text: #000000;
  --text-primary: #000000;
  --text-secondary: #000000;
  --text-muted: #1a1a1a;
  --text-on-hero: #ffffff;
  --text-on-accent: #000000;
  --border: #000000;
  --border-strong: #000000;
  --accent: #cc8800;
  --gold: var(--gold-700);
  --gold-text: #7a5f14;
  --accent-strong: #664400;
  --accent-text: #000000;
  --link: #003a23;
  --link-hover: #000000;
  --header-shadow: 0 0 0 2px #000;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: var(--surface);
  line-height: 1.6;
  font-size: var(--fs-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* v1.8.1.63: layered radial gradients give the page a subtle
     aurora-mesh feel — two soft glows (green top, gold bottom-left)
     that change as the user scrolls. Cards "float" on this background. */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(31,140,107,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(200,155,60,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 90% 60%, rgba(95,184,155,0.05) 0%, transparent 70%);
  background-attachment: fixed;
  /* Smooth scrolling for in-page anchors */
  scroll-behavior: smooth;
}
a {
  color: var(--green-700);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--green-900); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }

/* v1.8.1.63: 3D form inputs — inset shadow + focus glow ring + smooth
   size transition. The border also gets a 1.5px focus treatment.
   v1.8.2.45: added `input:not([type])` to the selector list so inputs
   that omit the type attribute (which defaults to text in HTML but
   doesn't match `input[type="text"]`) still get the same styling.
   v1.8.2.49: explicit `:not()` exclusions for checkbox / radio so
   they stay auto-sized. The old `input` selector was setting
   `width: 100%` on every input including checkboxes, which broke
   label layouts (e.g. the Transfer modal — checkbox stretched to
   fill the row, pushing the label text to the right). */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="color"]):not([type="range"]),
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"], select, textarea {
  font-family: inherit; font-size: 0.95rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: inset 0 1px 2px rgba(10,30,26,0.06), 0 1px 0 rgba(255,255,255,0.6);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
  width: 100%;
}
/* v1.8.2.49: re-assert auto width on checkboxes / radios in case
   a more specific rule above slipped through. */
input[type="checkbox"], input[type="radio"] { width: auto; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-500);
  box-shadow: var(--shadow-glow), inset 0 1px 2px rgba(10,30,26,0.04);
}
input::placeholder, textarea::placeholder { color: var(--ink-300); }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 700; color: var(--ink-900); margin: 0 0 0.5em; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small { color: var(--ink-500); font-size: 0.85rem; }

/* ----- Layout ----- */
.lhic-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* ----- v1.2.1: Bismillah strip (top of every page when enabled) ----- */
.bismillah-strip {
  /* v1.8.1.63: refined top strip with a soft gradient, centered
     content, and a subtle drop shadow underneath. The Arabic text is
     larger and uses the dedicated Amiri/Noto Naskh stack.
     v1.8.2.66w.371: this used to hardcode its OWN gradient
     (linear-gradient #e8f0e2 → #d4e3cf) even though --bg-bismillah
     had been defined per-theme since 66w.332. The token existed; the
     component just never read it — so the strip stayed emerald-green
     on the midnight and sand themes. Now it consumes the token. */
  background: var(--bg-bismillah);
  color: var(--bg-bismillah-text);
  border-bottom: 1px solid color-mix(in srgb, var(--ink-100) 50%, transparent);
  padding: 0.65rem 1.5rem;
  text-align: center;
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
  min-height: 56px;
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  flex-wrap: wrap;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 4px 12px rgba(10,30,26,0.05);
}
.bismillah-strip .ar { font-weight: 500; font-size: 1.5rem; }
.bismillah-strip .tr {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-style: italic;
  opacity: 0.75;
  color: inherit;
  letter-spacing: 0;
}

/* v1.2.1: Islamic geometric divider (8-point star + diamond) — pure CSS, no assets */
.islamic-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  color: var(--gold-500);
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.islamic-divider::before, .islamic-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
  max-width: 200px;
}
.islamic-divider::after { background: linear-gradient(90deg, var(--gold-500), transparent); }

/* v1.2.1: 8-point Islamic star */
.islamic-star {
  display: inline-block;
  width: 1.1em; height: 1.1em;
  background: var(--gold-500);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,5 61,39 95,50 61,61 50,95 39,61 5,50 39,39'/><polygon points='50,20 70,30 80,50 70,70 50,80 30,70 20,50 30,30' fill='black' fill-opacity='0.5'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='50,5 61,39 95,50 61,61 50,95 39,61 5,50 39,39'/><polygon points='50,20 70,30 80,50 70,70 50,80 30,70 20,50 30,30' fill='black' fill-opacity='0.5'/></svg>") center/contain no-repeat;
  vertical-align: -0.1em;
}

/* v1.2.1: Sadaqah Jariyah ribbon (for dashboards + thanks pages) */
.sadaqah-ribbon {
  /* v1.8.2.66w.371: --green-500 was the LIGHT end of this gradient, and
     white on it is only 4.18:1 (emerald) / 4.08:1 (sand) — under the
     4.5:1 floor. The ribbon now runs --green-700 → --green-900 so BOTH
     ends clear the bar in every theme (8.1:1 and 12.6:1 in emerald;
     9.8/14.6 midnight; 7.8/13.7 sand). */
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-900) 100%);
  /* v1.8.2.66w.371: this was --gold-100, then --accent-strong (see
     the second .sadaqah-ribbon rule below). Both put DARK ink on a
     DARK gradient — about 2:1, effectively unreadable in emerald,
     midnight and sand alike. The ribbon is a filled banner, so its
     label colour has to follow the FILL, not the page palette:
     --on-fill is white over emerald's dark green and sand's dark clay,
     and near-black over midnight's light teal. */
  color: var(--on-fill);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.2rem;
  display: flex; align-items: center; gap: 0.8rem;
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(255,255,255,0.08);
}
.sadaqah-ribbon .sadaqah-icon {
  font-size: 1.6rem; line-height: 1; flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}
.sadaqah-ribbon .sadaqah-text {
  flex: 1; line-height: 1.4;
}
/* --on-fill, not a literal #fff: midnight's fill is LIGHT, and white
   on it was invisible. */
.sadaqah-ribbon strong { color: var(--on-fill); display: block; margin-bottom: 0.15rem; }
.sadaqah-ribbon small { color: var(--on-fill); font-size: 0.85rem; opacity: 0.92; }
/* v1.8.2.66w.323: the .sadaqah-ribbon small text was using
   --gold-100 (#f8edcd in light, #8a6d24 in dark) which is hard
   to read on the green gradient in BOTH themes. Switched to
   white at 92% opacity for all themes — the bold gradient
   banner is a brand element and white-on-green is the
   intended high-contrast look. */
/* No theme-specific override. --on-fill covers every case: hc inherits
   the BRAND's green ramp (dark for emerald/sand, light for midnight),
   so a hard-coded #fff or #000 here would be wrong for half of them. */
:root[data-theme="hc"] .sadaqah-ribbon { color: var(--on-fill); }

/* v1.2.1: Verse-of-the-day card */
.verse-card {
  background: linear-gradient(135deg, #fff 0%, var(--gold-100) 100%);
  border: 1px solid var(--gold-300);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin: 1.2rem 0;
  box-shadow: var(--shadow-1);
  position: relative;
}
.verse-card::before {
  content: '“';
  position: absolute;
  top: -0.2rem; left: 0.5rem;
  font-size: 4rem; line-height: 1;
  color: var(--gold-300);
  font-family: Georgia, serif;
}
.verse-card .verse-arabic {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  text-align: right;
  direction: rtl;
  color: var(--green-900);
  line-height: 1.8;
  margin: 0.4rem 0 0.6rem;
}
.verse-card .verse-tr {
  font-size: 1rem;
  color: var(--ink-700);
  font-style: italic;
  margin: 0.4rem 0;
  padding-left: 1.6rem;
}
.verse-card .verse-src {
  font-size: 0.8rem;
  color: var(--gold-700);
  text-align: right;
  font-weight: 600;
}

/* v1.2.1: Milestone card */
.milestone-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.8rem; }
.milestone {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-left: 4px solid var(--green-500);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  box-shadow: var(--shadow-1);
}
.milestone.complete { border-left-color: var(--gold-500); background: linear-gradient(180deg, var(--gold-100) 0%, var(--white) 60%); }
.milestone .milestone-emoji { font-size: 1.6rem; line-height: 1; }
.milestone .milestone-title { font-weight: 700; color: var(--green-900); margin: 0; font-size: 1.05rem; }
.milestone .milestone-desc { color: var(--ink-500); font-size: 0.88rem; margin: 0; }
.milestone .milestone-progress { margin-top: 0.4rem; }
.milestone .milestone-progress .bar { background: var(--green-500); height: 6px; border-radius: 3px; }
.milestone.complete .milestone-progress .bar { background: var(--gold-500); }
.milestone .milestone-amounts { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-500); }

/* v1.2.1: Activity ticker (live, anonymised) */
.activity-ticker {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  margin: 0.8rem 0;
  font-size: 0.9rem;
}
.activity-ticker h3 { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--ink-500); text-transform: uppercase; letter-spacing: 0.04em; }
.activity-ticker ul { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow-y: auto; }
.activity-ticker li { padding: 0.35rem 0; border-bottom: 1px dashed var(--ink-100); color: var(--ink-700); }
.activity-ticker li:last-child { border-bottom: 0; }
.activity-ticker .t-name { font-weight: 600; color: var(--green-700); }
.activity-ticker .t-anon { color: var(--ink-500); font-style: italic; }
.activity-ticker .t-amount { color: var(--gold-700); font-weight: 600; }

/* v1.2.1: Quick-donate microbuttons */
.quick-donate {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
  background: var(--gold-100);
  border: 1px solid var(--gold-300);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  margin: 0.8rem 0;
}
.quick-donate .label { font-size: 0.85rem; color: var(--ink-700); margin-right: 0.4rem; font-weight: 600; }
.quick-donate .qd-btn {
  background: var(--white);
  color: var(--green-700);
  border: 1px solid var(--green-500);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s;
}
.quick-donate .qd-btn:hover { background: var(--green-500); color: var(--white); }
.quick-donate .qd-btn.amt-other {
  background: transparent;
  border: 1px dashed var(--green-500);
  color: var(--green-700);
}

/* v1.2.1: Welcome modal (first donor login) */
.welcome-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 30, 26, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 1rem;
  animation: fadeIn 0.25s ease-out;
}
.welcome-modal {
  background: var(--white);
  border-radius: 14px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease-out;
  position: relative;
}
.welcome-modal .welcome-header {
  background: linear-gradient(135deg, var(--green-700), var(--green-500));
  color: var(--white);
  padding: 1.5rem 1.5rem 1.2rem;
  border-radius: 14px 14px 0 0;
  text-align: center;
}
.welcome-modal .welcome-header h1 { color: var(--white); margin: 0.3rem 0 0.4rem; font-size: 1.5rem; }
.welcome-modal .welcome-header .bismillah { font-family: var(--font-arabic); font-size: 1.3rem; color: var(--gold-100); }
.welcome-modal .welcome-body { padding: 1.3rem 1.5rem; }
.welcome-modal .welcome-body p { color: var(--ink-700); white-space: pre-line; }
.welcome-modal .welcome-actions {
  display: flex; gap: 0.6rem; flex-wrap: wrap;
  padding: 0 1.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}
.welcome-modal .welcome-actions .cta-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.welcome-modal .welcome-skip { color: var(--ink-500); background: none; border: 0; cursor: pointer; font-size: 0.9rem; text-decoration: underline; }
.welcome-modal .ribbon-quran {
  background: var(--gold-100);
  border: 1px solid var(--gold-300);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--ink-700);
  font-style: italic;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* v1.2.1: Qibla compass (on map page) */
.qibla-compass {
  position: absolute; top: 10px; right: 10px; z-index: 500;
  background: var(--white); border: 1px solid var(--ink-100);
  border-radius: 50%; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-2);
  cursor: help;
}
.qibla-compass svg { width: 100%; height: 100%; }

/* v1.2.1: Salaam banner (small in-line, post-welcome) */
.salaam-banner {
  background: var(--green-100);
  color: var(--green-900);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--green-500);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.salaam-banner .salaam-arabic { font-family: var(--font-arabic); font-size: 1.1rem; }

/* v1.7.0: CMS nav dropdown (More ▾) removed. Pages are still
   accessible at /page/<slug> but no longer auto-injected into the nav. */

/* v1.2.2: CMS page renderer */
.cms-page {
  max-width: 760px;
  margin: 1.5rem auto;
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  padding: 1.5rem 1.8rem 2rem;
  box-shadow: var(--shadow-1);
}
.cms-page h1 { color: var(--green-900); margin-top: 0; }
.cms-page h2, .cms-page h3 { color: var(--green-700); }
.cms-page ul, .cms-page ol { padding-left: 1.4rem; }
.cms-page li { margin-bottom: 0.4rem; }
.cms-page blockquote { border-left: 4px solid var(--gold-500); padding-left: 1rem; color: var(--ink-700); font-style: italic; }
.cms-page a { color: var(--green-700); text-decoration: underline; }
.cms-page a:hover { color: var(--green-900); }
.cms-page .hero-ribbon {
  background: linear-gradient(135deg, var(--green-100), var(--gold-100));
  border: 1px solid var(--gold-300);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}
.cms-page .hero-ribbon h1 { margin-top: 0; }
.cms-meta { color: var(--ink-500); font-size: 0.85rem; margin-bottom: 1rem; }

.lhic-header {
  /* v1.8.1.63: stronger glassmorphism — translucent white with
     saturation, larger blur, and a more prominent drop shadow with a
     subtle green tint. The header is sticky and visually floats
     above the page. */
  background: var(--bg-header);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink-100) 60%, transparent);
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 4px 24px rgba(10,30,26,0.08), 0 1px 0 rgba(255,255,255,0.5) inset;
  min-height: var(--header-h);
}
.lhic-brand {
  font-weight: 800; font-size: 1.15rem; color: var(--text-primary);
  display: flex; align-items: center; gap: 0.5rem;
}
.lhic-brand .logo {
  font-size: 1.5rem;
  width: 36px; height: 36px;
  object-fit: contain;
  display: block;
}
/* v1.8.2.66w.291: `flex: 1` is a leftover from when .lhic-nav lived
   INSIDE .lhic-header, where growing along the row axis was correct.
   Since v1.8.2.66w.12 the nav is rendered as a SIBLING of the header
   inside .lhic-shell, which is `display:flex; flex-direction:column`.
   In a COLUMN flex container `flex: 1` means "grow vertically", so the
   nav absorbed leftover vertical space and changed height depending on
   how much content each route rendered:
     - content-rich routes (Home, 3534px) -> no free space -> nav 40px
     - short routes (/login, /register) -> ~25px free space -> nav 65px
   The 25px height delta pushed the entire page body down the moment a
   donor clicked "Sign in". Fix: pin the nav to its content height so it
   is identical on every route. Horizontal growth is no longer needed
   either — it is a top-level row, not a flex child of a row. */
/* v1.8.2.66w.332: `flex-wrap: wrap` so the nav DEGRADES instead of
   overflowing. Adding the language switcher (66w.332) pushed the row to
   1335px in a 1280px viewport — the nav had only 3px of headroom, so
   any new control would break it. Wrapping is the structural fix: the
   row stays on one line while it fits, and folds rather than pushing
   content off-screen when it doesn't. The 1400px rule below keeps it
   on one row in practice. */
.lhic-nav { display: flex; gap: 0.5rem; flex: 0 1 auto; align-items: center; flex-wrap: wrap; min-width: 0; }
/* v1.8.2.66w.216: hide the mobile-menu topbar on desktop. JSX
   also gates this with `{mobileOpen && (...)}` (so it shouldn't
   even render on desktop), but if any stale HTML references the
   class, this CSS belt ensures it stays hidden at >900px. */
@media (min-width: 901px) {
  .lhic-nav-topbar { display: none !important; }
}
.lhic-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
  white-space: nowrap;
}
.lhic-nav a:hover { background: var(--bg-muted); color: var(--text-primary); text-decoration: none; }
.lhic-nav a.active { background: var(--green-100); color: var(--green-900); }
/* v1.7.0: prominent "Donate" CTA in the nav, gold background to stand out */
/* v1.8.2.66w.331.7: --accent is gold-500 and --accent-text is white in
   light theme, giving 2.55:1 — well under AA for the 14px bold label.
   Use --gold-700 (white on it = 4.89:1). --accent is reserved for
   decorative fills where contrast is not load-bearing. */
.lhic-nav a.donate-nav { background: var(--gold-700); color: var(--white); padding: 0.45rem 1rem; font-weight: 700; }
.lhic-nav a.donate-nav:hover { background: var(--accent-strong); color: var(--accent-text); }
/* Keep the nav on ONE row in the 1200-1400px band by trimming the
   horizontal padding. Below 1200px the mobile menu takes over. */
@media (min-width: 1200px) and (max-width: 1400px) {
  .lhic-nav a { padding: 0.45rem 0.5rem; }
  .lhic-nav { gap: 0.3rem; }
  .lang-switcher-select { padding: 0.15rem 0.25rem !important; font-size: 0.78rem !important; }
}

/* v1.8.2.66w.332: `margin-inline-start` instead of `margin-left`.
   In RTL the nav flipped but this physical margin kept pushing the
   right-hand group off the LEFT edge — 55px of horizontal overflow.
   Logical properties make it flip with the direction. */
/* v1.8.2.66w.332: `min-width: 0` + `flex-wrap` so the control
   group can shrink and fold. Without `min-width: 0` a flex item
   refuses to shrink below its content width — which is how a
   wide <select> pushed the header off-screen at large font
   sizes (iOS text-zoom / Android display-size). */
.lhic-nav .right {
  margin-inline-start: auto; display: flex; gap: 0.5rem;
  align-items: center; flex-wrap: wrap; min-width: 0;
}

/* v1.8.0: theme switcher — three small dots indicating active theme */
.lhic-theme-switcher { display: inline-flex; gap: 0.25rem; align-items: center; }
/* v1.8.2.66w.192: theme switcher buttons now match the 36×36
   size of the other header icon triggers (about-app ?, contact ✉,
   admin-help ?). The old 24×24 was visibly inconsistent — sun/moon/
   contrast dots felt cramped next to the bigger round triggers. */
.lhic-theme-switcher button {
  background: transparent; border: 1px solid var(--border);
  width: 36px; height: 36px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted);
  transition: all 0.12s;
}
.lhic-theme-switcher button:hover { border-color: var(--border-strong); color: var(--text-primary); }
.lhic-theme-switcher button[aria-pressed="true"] {
  background: var(--green-100); border-color: var(--green-500); color: var(--green-900);
}

.lhic-main { flex: 1; max-width: 1280px; margin: 0 auto; padding: 1.5rem; width: 100%; }
.lhic-footer {
  background: var(--green-900); color: #d3e0db; padding: 2rem 1.5rem;
  text-align: center; font-size: 0.9rem;
}
.lhic-footer a { color: var(--gold-300); }

/* ----- v1.8.0: Mobile nav toggle (hidden on desktop, hamburger on mobile) ----- */
.lhic-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 36px; height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-primary);
  align-items: center; justify-content: center;
  margin-left: auto;
}
.lhic-nav-toggle:hover { background: var(--bg-muted); }
@media (max-width: 900px) {
  .lhic-nav-toggle { display: inline-flex; }
  /* v1.8.2.66w.190: the mobile drawer used to be position:absolute with
     top:100% which anchored to the initial containing block (viewport),
     putting it at the BOTTOM of the viewport instead of right below the
     header. Switching to position:fixed anchored to the header height
     keeps it visible whenever it opens. The sibling placement avoids
     the header's backdrop-filter containing block. */
  /* v1.8.2.66w.197: menu positioned BELOW both the bismillah-strip
     (92px tall) AND the lhic-header (65px tall). Total ~157px from
     the top of the viewport. The menu must clear both or its
     first row gets hidden behind the sticky header. */
  /* v1.8.2.66w.199: full-viewport overlay menu. The user wants
     the menu to show at the TOP of the screen, covering the entire
     viewport from y=0, with the page behind locked from scrolling.
     The menu sits at z-index 60 (above the header at z-index 50)
     so it covers the entire viewport including the header. The
     brand mark + X close button are rendered INSIDE the menu at
     the top so the user always sees them and has a way to close. */
  .lhic-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100dvh;
    height: 100dvh;
    overflow-y: auto;
    background: var(--bg-page, var(--surface));
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    padding: 0 0 1rem;
    gap: 0;
    z-index: 60;
    /* Flex column layout — close bar at top, links stacked below */
    flex-direction: column;
    align-items: stretch;
  }
  .lhic-nav[data-mobile-open="true"] { display: flex; }
  /* v1.8.2.66w.332: the desktop nav is `white-space: nowrap` so the
     row never breaks mid-label — but inside the STACKED mobile menu
     each link is its own row, so nowrap just forces the widest label
     past the viewport. At 18px+ text-zoom that pushed the whole nav
     (and the control group with it) off-screen. Let stacked links
     wrap instead. */
  .lhic-nav[data-mobile-open="true"] a { white-space: normal; }
  /* v1.8.2.66w.332: `flex-wrap: wrap` is correct for the desktop ROW
     (so nav links fold to a second line instead of overflowing),
     but the mobile menu is `flex-direction: column` — and in a column
     flex container the cross axis is HORIZONTAL, so `wrap` creates
     a new COLUMN to the right. That shoved `.right` (language
     switcher, theme switcher, Sign in, Register) off-screen at
     phone widths. The stacked menu must NOT wrap. */
  .lhic-nav[data-mobile-open="true"] { flex-wrap: nowrap; }
  /* THE BUG (66w.332): `margin-inline-start: auto` is a ROW-axis idiom —
     it pushes the item to the far end of the row. Inside the mobile
     menu the nav switches to `flex-direction: column`, so the very
     same auto margin is now a CROSS-axis margin and shoved `.right`
     412px to the RIGHT (off-screen at phone widths) instead of
     pushing it DOWN. Reset it to 0 for the stacked layout. */
  .lhic-nav[data-mobile-open="true"] .right {
    margin-inline-start: 0;
    min-width: 0;
    max-width: 100%;
  }
  /* v1.8.2.66w.199: top bar of the full-viewport menu — contains
     the brand on the left + the close button on the right. Sits
     above the menu items. Mimics the desktop header layout so the
     user sees familiar brand identity even with the menu open. */
  .lhic-nav-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
  }
  .lhic-nav-topbar .lhic-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-primary);
  }
  .lhic-nav-topbar .lhic-nav-brand .logo {
    width: 32px; height: 32px; object-fit: contain;
  }
  .lhic-nav-topbar .lhic-nav-close {
    background: var(--accent);
    color: var(--accent-text, #fff);
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    flex-shrink: 0;
  }
  .lhic-nav-topbar .lhic-nav-close:hover { background: var(--accent-strong); }
  /* v1.8.2.66w.199: nav links in a clean 2-column grid below the
     top bar. Each link is a comfortable tap target with padding
     and clear typography. */
  .lhic-nav > a:not(.donate-nav):not(.admin-nav-link) {
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
  }
  .lhic-nav > a:not(.donate-nav):not(.admin-nav-link):active {
    background: var(--bg-muted);
  }
  .lhic-nav a.donate-nav {
    margin: 1rem 1rem 0.5rem;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
    text-align: center;
  }
  .lhic-nav a.admin-nav-link {
    margin: 0.5rem 1rem 0.5rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    text-align: center;
  }
  /* v1.8.2.66w.195: icon row inside the menu — theme switcher +
     about ? + contact ✉ + admin-help ?. Sits at the bottom of the
     menu as a single row. Sign in / Register are block-level full-width. */
  .lhic-nav .right {
    margin: 0.5rem 1rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
  .lhic-nav .right > * {
    width: auto;
    align-self: center;
  }
  /* Keep icon button size in mobile drawer */
  .lhic-nav .right .lhic-theme-switcher {
    gap: 6px;
  }
  .lhic-nav .right .lhic-theme-switcher button {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .lhic-nav .right .contact-header-trigger,
  .lhic-nav .right .about-app-trigger {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .lhic-nav .right .admin-help-trigger {
    padding: 6px 14px;
    font-size: 0.9em;
  }
  /* Sign in / Register full-width rows below the icon row */
  .lhic-nav .right > a {
    flex: 1 1 100%;
    text-align: center;
    padding: 0.7rem 1rem;
    border-radius: 8px;
  }
}

/* ----- v1.8.0: Home page ----- */
.home-page { display: flex; flex-direction: column; gap: 1.5rem; }

/* v1.8.2.24: hero image + prayer-times side-by-side on desktop, stacked
   on mobile. The prayer-times card is a soft gold-tinted panel that
   matches the rest of the site but stands out enough to read "live". */
.home-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  align-items: stretch;
}
.home-prayer-card {
  background: linear-gradient(180deg, rgba(200,138,43,0.06), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1rem 0.75rem 1rem;
  box-shadow: var(--shadow-2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.home-prayer-title { margin: 0; font-size: 1.05rem; color: var(--green-900); }
.home-prayer-sub { margin: 0 0 0.25rem 0; font-size: 0.78rem; color: var(--text-muted); }
.home-prayer-empty { margin: 1.5rem 0; color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }
.home-prayer-empty a { color: var(--green-700); }
/* v1.8.2.25: native prayer-times table (replaces the old iframe) */
.home-prayer-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  margin: 0.25rem 0 0.5rem 0;
}
.home-prayer-table th, .home-prayer-table td {
  padding: 0.35rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
/* v1.8.2.26: explicit column header row so users can tell which
   time is the azan (call to prayer) vs the iqamah (start of
   the prayer). Smaller and uppercase so it doesn't compete
   with the actual times below. */
.home-prayer-table thead th {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(20, 110, 70, 0.05);
  border-bottom: 1px solid var(--border);
}
.home-prayer-table .home-prayer-label-col { width: 38%; }
.home-prayer-table .home-prayer-azan-col { width: 31%; text-align: left; }
.home-prayer-table .home-prayer-iqamah-col { width: 31%; text-align: left; }
.home-prayer-table tbody th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.82rem;
  width: 38%;
}
.home-prayer-table .home-prayer-azan {
  font-weight: 700;
  color: var(--green-900);
  font-size: 0.95rem;
  width: 31%;
}
/* v1.8.2.66w.342: Turkish renders the meridiem as "ÖÖ"/"ÖŞ", which
   is wider than "am"/"pm" and pushed the time onto two lines
   ("ÖÖ" / "5:50"). A time is one token — never let it wrap. */
.home-prayer-table .home-prayer-azan,
.home-prayer-table .home-prayer-iqamah {
  white-space: nowrap;
}
.home-prayer-table .home-prayer-iqamah {
  color: var(--text-muted);
  font-size: 0.82rem;
  width: 31%;
}
/* v1.8.2.26: Jumu'ah row in the prayer-times table. Same gold
   palette as the Wall of Gratitude memorials so Jumu'ah (the
   most important weekly prayer) reads as a special event. */
.home-prayer-table tr.home-prayer-row-jumuah th,
.home-prayer-table tr.home-prayer-row-jumuah td {
  background: linear-gradient(90deg, rgba(200,138,43,0.10), rgba(200,138,43,0.02));
  border-bottom: 1px solid rgba(200,138,43,0.25);
}
.home-prayer-table tr.home-prayer-row-jumuah th {
  color: var(--gold, #8a5a1a);
  font-weight: 700;
  font-size: 0.88rem;
}
.home-prayer-table tr.home-prayer-row-jumuah td.home-prayer-azan {
  color: var(--gold, #8a5a1a);
  font-size: 0.95rem;
}
.home-prayer-jumuah {
  margin: 0.4rem 0 0 0;
  padding: 0.4rem 0.5rem;
  background: rgba(20, 110, 70, 0.08);
  border-left: 3px solid var(--green-700);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--green-900);
}
.home-prayer-foot { margin: auto 0 0 0; padding-top: 0.5rem; font-size: 0.72rem; color: var(--text-muted); border-top: 1px solid var(--border); }
.home-prayer-foot a { color: var(--green-700); }
@media (max-width: 900px) {
  .home-hero-row { grid-template-columns: minmax(0, 1fr); }
  .home-prayer-card { order: 2; }
}

.hero {
  /* v1.8.1.30: 3D hero with radial gradient (depth), subtle gold glow
     ring, and a layered drop shadow. */
  background: var(--bg-hero);
  color: var(--text-on-hero);
  padding: 3.5rem 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.08);
}
.hero::before {
  /* v1.8.1.30: subtle gold glow on the upper-left, plus a soft white
     highlight in the upper-right for that "stage lit from above" feel. */
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 18% 20%, rgba(228,200,121,0.18) 0%, transparent 35%),
              radial-gradient(circle at 82% 8%, rgba(255,255,255,0.10) 0%, transparent 30%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero h1 { text-shadow: 0 2px 8px rgba(10,30,26,0.20); }
.hero h1 { margin: 0 0 0.75rem; font-size: 2.2rem; line-height: 1.15; letter-spacing: -0.01em; }
.hero p { max-width: 620px; margin: 0 auto 1.5rem; opacity: 0.92; font-size: 1.05rem; line-height: 1.55; }
.hero-actions { display: inline-flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }

/* v1.8.1.36: full-bleed new-masjid image variant of the hero. Replaces
   the dark-green gradient with a 1920×1080 architectural rendering.
   v1.8.1.67: the previous version had max-height: 70vh which on a
   1366×768 PC made the container 537px tall while staying 1232px wide
   (aspect 2.30). Since the image itself is 16:9 (1.78), object-fit:
   cover cropped the bottom of the building + the car + the
   "imagine[it].possible" sign. Fixed by letting the container match
   the image's natural 16:9 aspect ratio (no max-height cap), so the
   whole image is always visible. The 1232px-wide hero is now 693px
   tall on desktop, which scrolls past cleanly with the rest of the
   page. */
.hero.hero-image {
  background: var(--bg-hero);
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  margin: 0 auto;
}
.hero.hero-image::before { display: none; }
.hero-image-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* Smaller screens: cap the height so the image doesn't dominate on
   phones/tablets, but keep the 16:9 shape so no cropping happens. */
@media (max-width: 700px) {
  .hero.hero-image {
    max-height: 320px;
    aspect-ratio: auto;
  }
}

.btn-ghost-light {
  background: transparent; color: var(--text-on-hero);
  border: 1px solid rgba(255,255,255,0.5);
  padding: 0.6rem 1.1rem; border-radius: 6px;
  font-weight: 600; text-decoration: none;
  transition: all 0.12s;
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.12); color: var(--text-on-hero); text-decoration: none; }

.card {
  /* v1.8.1.63: 3D card with stronger layered shadow, top inner
     highlight, and a subtle vertical gradient (slightly lighter at
     top, slightly tinted at bottom) so the card looks like it's
     floating above the page. */
  background: linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, var(--bg-card) 97%, var(--ink-100)) 100%);
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-2), var(--shadow-inset);
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-3), var(--shadow-inset); }
.card h2 { margin: 0 0 1rem; font-size: var(--fs-xl); letter-spacing: -0.01em; }

.stats .stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stats .stat {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1rem;
  background: var(--bg-muted);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.stats .label { font-size: 0.7rem; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; }
.stats .value { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.stats .value .unit { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.stats .hint { font-size: 0.78rem; color: var(--text-muted); }

.progress-bar {
  width: 100%; height: 12px; background: var(--bg-muted);
  border-radius: 999px; overflow: hidden; border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-500) 0%, var(--green-700) 100%);
  transition: width 0.4s ease-out;
}
.progress-pct { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
/* v1.8.2.66w.321: same dark-mode contrast fix as .stat. The
   "X.X% of the plot-purchase target reached" line under the
   progress bar uses --text-muted which is --ink-500 in dark
   mode (#93a39e) — too dim against the page background. */
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .progress-pct,
[data-theme="hc"]   .progress-pct { color: var(--ink-700); }

/* v1.8.2.66w.371: there are TWO base .sadaqah-ribbon rules in this
   file. This one comes later and so won the cascade, replacing the
   base rule's label colour with --accent-strong (a dark gold) on top
   of the dark gradient. Fixed to --on-fill so it matches the fill in
   every theme. The duplicate base rule is left in place deliberately —
   merging them is a larger refactor than this fix warrants. */
.sadaqah-ribbon {
  text-align: center;
  color: var(--on-fill);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  font-weight: 600;
  padding: 0.5rem 0;
  text-transform: uppercase;
}

.hadith {
  background: var(--bg-card);
  border-left: 4px solid var(--accent);
  text-align: center;
  padding: 2rem;
}
.hadith .quote {
  font-size: 1.15rem; font-style: italic; line-height: 1.55;
  color: var(--text-primary); max-width: 720px; margin: 0 auto 0.75rem;
}
.hadith .cite { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

.how-it-works { padding: 1.5rem 0; }
.how-it-works h2 { font-size: 1.4rem; margin: 0 0 1.25rem; text-align: center; }
.how-it-works .steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.how-it-works .step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.6rem;
  box-shadow: var(--shadow-1);
}
.how-it-works .num {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--green-100); color: var(--green-900);
  font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.how-it-works .step h3 { margin: 0; font-size: 1.1rem; }
.how-it-works .step p { margin: 0 0 0.75rem; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; }
.how-it-works .step .btn { align-self: flex-start; }

/* ----- v1.8.0: Page hero (used by About, Team, Donate, etc.) ----- */
.page-hero {
  text-align: center;
  padding: 2.5rem 1.5rem 1.5rem;
}
.page-hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--text-primary);
}
.page-hero h1 .sub { color: var(--green-700); font-style: italic; font-weight: 700; }
.page-hero p { max-width: 720px; margin: 0 auto; color: var(--text-secondary); font-size: 1.075rem; line-height: 1.65; }
.kicker { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.2em; color: var(--green-700); text-transform: uppercase; margin-bottom: 0.6rem; padding: 0.25rem 0.75rem; background: var(--green-100); border-radius: var(--radius-pill); }

/* ----- v1.8.0: About page ----- */
.about-page, .team-page, .donate-page, .components-page, .wall-page, .pledge-page, .account-page, .login-page, .register-page {
  display: flex; flex-direction: column; gap: 1.5rem;
}
.about-page .address-card { text-align: center; border: 2px solid var(--border); background: var(--bg-muted); }
.about-page .address-card a { color: var(--green-700); font-weight: 600; }
.about-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-top: 1rem;
}
.about-stats > div {
  text-align: center; padding: 1rem;
  background: var(--bg-muted); border: 1px solid var(--border);
  border-radius: 8px;
}
.about-stats .big { display: block; font-size: 1.4rem; font-weight: 800; color: var(--green-700); }
.about-stats .lbl { font-size: 0.7rem; letter-spacing: 0.1em; color: var(--text-muted); font-weight: 600; }
.vision-card.card { background: var(--green-700); color: #ffffff; }
/* v1.8.2.66w.371: this was --gold-300, a LIGHT gold, sitting on the
   kicker's own light chip background (--green-100). Light-on-light —
   1.31:1 in emerald, 1.43:1 in sand. The vision panel behind it is dark,
   but the chip covers that, so the label must stay dark for its own
   background. --green-700 is the base .kicker colour and already
   measures well on --green-100 in all three themes. */
.vision-card.card .kicker { color: var(--green-700); background: var(--green-100); }
.vision-card.card .vision { font-size: 1.3rem; line-height: 1.45; margin: 0 0 1rem; font-style: italic; color: var(--text-on-hero); }
/* v1.8.2.66w.371: this used --text-on-hero, which follows the PAGE's
   hero fill. The footer is its OWN filled panel (.vision-footer paints
   a deep brand green), so the label must follow THAT fill — on midnight
   the page hero inverts to light while this panel stays dark, and the
   two together rendered dark-on-dark at 1.75:1. */
.vision-card.card .vision-footer {
  display: flex; align-items: center; gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.25);
  color: var(--on-fill);
}
.vision-card.card .vision-footer p { color: var(--on-fill); }
.vision-card .avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--gold-500); color: var(--ink-900);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-arabic); font-size: 1.1rem; font-weight: 700;
}
.principles { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.principles li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.principles li:last-child { border-bottom: none; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1rem; }
.service { padding: 1rem; background: var(--bg-muted); border: 1px solid var(--border); border-radius: 8px; }
.service-icon { display: block; font-size: 1.5rem; margin-bottom: 0.5rem; }
.service h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.service p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45; }
.amenities { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.amenity-pill { padding: 0.35rem 0.75rem; background: var(--green-100); color: var(--green-900); border-radius: 999px; font-size: 0.85rem; font-weight: 500; }
.location-card { text-align: center; }

/* ----- v1.8.0: Team page ----- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.team-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: var(--shadow-1); }
.team-photo { width: 90px; height: 90px; border-radius: 999px; overflow: hidden; background: var(--bg-muted); margin-bottom: 0.75rem; }
.team-photo img { width: 100%; height: 100%; object-fit: cover; }
.team-initial { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: var(--green-700); }
.team-card h3 { margin: 0 0 0.25rem; font-size: 1.05rem; }
.team-role { display: inline-block; padding: 0.2rem 0.6rem; background: var(--green-100); color: var(--green-900); border-radius: 999px; font-size: 0.78rem; font-weight: 600; margin-bottom: 0.5rem; }
.team-committees { list-style: disc inside; padding: 0; margin: 0.5rem 0 0; color: var(--text-secondary); font-size: 0.85rem; }
.team-committees li { margin: 0.15rem 0; }
.committee-group { margin: 1rem 0; }
.committee-group h3 { font-size: 1.05rem; margin: 0 0 0.5rem; color: var(--green-700); }
.committee-group ul { list-style: disc inside; padding: 0; margin: 0; color: var(--text-secondary); }
.committee-group li { margin: 0.2rem 0; }
.cta-card { text-align: center; background: var(--green-100); border-color: var(--green-300); }
.cta-card .hero-actions { margin-top: 1rem; }

/* ----- v1.8.0: Donate page ----- */
.donate-hero { background: transparent; padding: 2rem 0 0; }
.donate-hero h1 { color: var(--text-primary); }
.donate-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
.donate-content .callout {
  background: var(--bg-muted); border-left: 4px solid var(--green-500);
  padding: 1rem 1.25rem; border-radius: 0 8px 8px 0;
  margin: 1rem 0; line-height: 1.55;
}
.donate-facts { display: flex; flex-direction: column; gap: 1rem; }
.donate-facts .fact { display: flex; gap: 0.75rem; padding: 1rem; background: var(--bg-muted); border: 1px solid var(--border); border-radius: 8px; }
.donate-facts .num {
  width: 30px; height: 30px; border-radius: 999px; flex-shrink: 0;
  background: var(--green-100); color: var(--green-900);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.9rem;
}
.donate-facts .badge { display: inline-block; padding: 0.15rem 0.5rem; background: var(--green-700); color: var(--bg-page); border-radius: 4px; font-weight: 700; margin: 0 0.25rem; }
.donate-facts strong { display: block; margin-bottom: 0.25rem; }
.donate-facts p > strong { display: inline; margin-bottom: 0; }
.donate-facts p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.45; }
.donate-cta { background: var(--green-900); color: #f0f7f4; }
.donate-cta h2 { color: white; }
.donate-cta > p { color: var(--ink-300); }
.amount-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.5rem; margin: 1rem 0; }
.amount-btn { padding: 0.7rem 1rem; background: rgba(255,255,255,0.08); color: white; border: 1px solid rgba(255,255,255,0.25); border-radius: 8px; font-weight: 700; cursor: pointer; transition: all 0.12s; }
.amount-btn:hover { background: rgba(255,255,255,0.15); }
.amount-btn.active { background: var(--accent); color: var(--ink-900); border-color: var(--accent); }
.custom-amount { display: flex; flex-direction: column; gap: 0.3rem; margin: 1rem 0; color: var(--ink-300); font-size: 0.9rem; }
.custom-amount input { padding: 0.6rem 0.75rem; border-radius: 6px; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08); color: white; font-size: 1rem; }
.donate-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1rem; }
/* v1.8.2.66w.332: at 200% text zoom (26px root) the bank details and
   prayer-times tables are intrinsically wider than a phone. Rather than
   clip or squish, let the TABLE scroll inside its own card so the
   page itself never scrolls sideways. */
/* v1.8.2.66w.332: at 200% text zoom (26px root) the bank details and
   prayer-times tables are intrinsically wider than a phone. Rather than
   clip or squish, let the TABLE scroll inside its own card so the
   page itself never scrolls sideways. */
/* v1.8.2.66w.332: at 200% text zoom (26px root) the bank details and
   prayer-times tables are intrinsically wider than a phone. Rather than
   clip or squish, let the TABLE scroll inside its own card so the
   page itself never scrolls sideways. */

.donate-bank > *, .home-prayer-card > * { min-width: 0; }
.donate-bank > *, .home-prayer-card > * { min-width: 0; }
.bank-table th { text-align: left; padding: 0.5rem 0.75rem; background: var(--bg-muted); border: 1px solid var(--border); font-weight: 600; width: 35%; }
.bank-table td { padding: 0.5rem 0.75rem; border: 1px solid var(--border); }
.donate-trust .trust-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.donate-trust .trust-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.donate-trust .trust-list li:last-child { border-bottom: none; }
@media (max-width: 800px) {
  .donate-grid { grid-template-columns: 1fr; }
}

/* ----- v1.8.0: Components page ----- */
.components-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.component-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; box-shadow: var(--shadow-1); }
.component-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.component-card h3 { margin: 0; font-size: 1.05rem; }
.component-card .cat { font-size: 0.75rem; padding: 0.15rem 0.5rem; background: var(--bg-muted); border-radius: 999px; color: var(--text-muted); white-space: nowrap; }
/* v1.8.2.40: small "Componet #N" reference badge on every component
   card so donors / treasurers can quote a stable identifier in
   bank statement text or conversation (e.g. "Componet 3" in the
   Particulars field of a bank row). */
/* v1.8.2.66w.331.7: was --accent (--gold-500) as TEXT on a white card =
   2.55:1, below the 4.5:1 WCAG AA floor for small text. The old
   fallback was --green-700, which passed — but --accent always won.
   Use --gold-700, the ramp step meant for gold text on light. */
.component-card .component-ref { display: inline-block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; color: var(--gold-700, var(--green-700)); text-transform: uppercase; margin-bottom: 0.15rem; }
.component-card .desc { margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.4; }
.price-row { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.5rem; }
.price-row .price { font-size: 1.3rem; font-weight: 800; color: var(--green-700); }
.price-row .unit { color: var(--text-muted); font-size: 0.85rem; }
.component-card .progress-bar { margin-top: 0.5rem; }
.component-card .progress-meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }

/* ----- v1.8.0: Wall of Gratitude ----- */
.wall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.wall-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; box-shadow: var(--shadow-1); transition: transform 0.15s, box-shadow 0.15s; }
.wall-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.wall-card-memorial { border-left: 3px solid var(--gold, #c88a2b); background: linear-gradient(180deg, rgba(200,138,43,0.04), var(--bg-card)); }
.wall-card-head { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.wall-avatar {
  width: 42px; height: 42px; border-radius: 999px;
  background: var(--green-100); color: var(--green-900);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; flex-shrink: 0;
}
.wall-name { font-weight: 700; }
.wall-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.wall-tag { display: inline-block; padding: 0.05rem 0.4rem; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
/* v1.8.2.66w.331.7: --gold-700 (#8a6d24) on --surface (#f6f5ee)
   = 4.48:1, a hair under the 4.5 AA floor for this 11px bold tag.
   --warn-fg (#92400e) is the ramp's gold-on-light text step: 6.49:1. */
.wall-tag-memorial { background: rgba(200,138,43,0.15); color: var(--gold-text); }
.wall-message { font-style: italic; color: var(--text-secondary); margin: 0; line-height: 1.4; }

/* v1.8.2.19: Wall of Gratitude controls (search, filter chips, sort, pagination) */
.wall-controls { margin-bottom: 1.25rem; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.wall-controls-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.wall-search { flex: 1 1 240px; min-width: 200px; }
.wall-filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.wall-sort-chips { padding-top: 0.4rem; border-top: 1px dashed var(--border); }
.wall-sort-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-right: 0.25rem; }
.wall-filter-chips .chip { background: var(--bg-page); border: 1px solid var(--border); border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 0.35rem; font-family: inherit; }
.wall-filter-chips .chip:hover { border-color: var(--green-700); color: var(--green-900); }
.wall-filter-chips .chip.active { background: var(--green-700); color: var(--bg-page); border-color: var(--green-700); }
.wall-filter-chips .chip-memorial { color: var(--gold-text); }
.wall-filter-chips .chip-memorial.active { background: var(--gold, #c88a2b); border-color: var(--gold, #c88a2b); color: white; }
.wall-filter-chips .chip-clear { background: transparent; border-color: var(--text-muted); color: var(--text-muted); }
.wall-filter-chips .chip-clear:hover { color: var(--danger); border-color: var(--danger); }
.wall-filter-chips .chip-count { background: rgba(255,255,255,0.18); color: inherit; padding: 0 0.4rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.wall-filter-chips .chip:not(.active) .chip-count { background: var(--bg-muted); }
.wall-filter-chips .chip-sep { width: 1px; height: 18px; background: var(--border); margin: 0 0.25rem; }

/* v1.8.2.34: Wall admin status filter (All / Shown / Hidden).
   These are buttons (not divs) so the .chip styles don't apply;
   the matching class is `wall-filter-chip` instead. */
.wall-filter-chip { background: var(--bg-page); border: 1px solid var(--border); border-radius: 999px; padding: 0.3rem 0.85rem; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 0.35rem; font-family: inherit; }
.wall-filter-chip:hover { border-color: var(--green-700); color: var(--green-900); }
.wall-filter-chip--active { background: var(--green-700); color: white; border-color: var(--green-700); }
.wall-filter-chip-count { background: rgba(255,255,255,0.18); color: inherit; padding: 0 0.4rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.wall-filter-chip:not(.wall-filter-chip--active) .wall-filter-chip-count { background: var(--bg-muted); }
.wall-summary { display: flex; justify-content: space-between; align-items: center; padding-top: 0.25rem; border-top: 1px solid var(--border); }
.wall-year-group { margin-bottom: 1.5rem; }
.wall-year-heading { font-size: 1.25rem; color: var(--green-900); border-bottom: 2px solid var(--green-100); padding-bottom: 0.4rem; margin: 1.5rem 0 1rem; }
.wall-pagination { display: flex; justify-content: center; padding: 1.5rem 0 2rem; }
.empty { text-align: center; padding: 2rem; }
.empty .link { background: none; border: none; color: var(--green-700); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }

/* ----- v1.8.0: Auth pages ----- */
.auth-card { max-width: 460px; margin: 2rem auto; }
.auth-form { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.auth-form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
.auth-form input {
  padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-card); color: var(--text-primary); font-size: 1rem;
}

/* v1.8.2.29: per-sub-account monthly bank statement upload + filters.
   The Bank tab now shows a sub-account dropdown + month picker in the
   import form, and the reconciliation list has its own filter row.
   Keep the labels and inputs aligned and let them wrap gracefully. */
.bank-csv-file, .bank-csv-account, .bank-csv-period, .bank-csv-notes {
  display: flex; flex-direction: column;
}
.bank-csv-file input, .bank-csv-account select, .bank-csv-period input, .bank-csv-notes input {
  min-height: 38px;
}
.bank-csv-period input:disabled, .bank-csv-notes input:disabled {
  opacity: 0.5; cursor: not-allowed;
}
.bank-csv-notes { flex: 1 1 240px; }
.auth-form input:focus { outline: 2px solid var(--green-500); outline-offset: 1px; }
.auth-form .err { color: var(--danger); font-size: 0.9rem; padding: 0.5rem 0.75rem; background: rgba(176, 58, 46, 0.1); border-radius: 6px; }

/* ----- v1.8.0: Account page ----- */
.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table th, .schedule-table td { padding: 0.6rem 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
.schedule-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
/* v1.8.2.12: item cell in the pledges table — emoji badge +
   human-readable label, with the secondary line (zone/tier) muted
   underneath. */
.schedule-table td > .item-badge { display: inline-block; width: 1.8rem; height: 1.8rem; line-height: 1.8rem; text-align: center; border-radius: 0.5rem; font-size: 1rem; margin-right: 0.4rem; vertical-align: middle; }
.schedule-table td > .item-badge.item-plot { background: rgba(20, 110, 70, 0.10); }
.schedule-table td > .item-badge.item-component { background: rgba(195, 130, 35, 0.12); }
.schedule-table td .item-cell { display: inline-flex; flex-direction: column; vertical-align: middle; }
.schedule-table td .item-cell strong { font-size: 0.95rem; }
.schedule-table td .item-cell .muted.small { font-size: 0.75rem; }
.status-pill { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.status-active { background: var(--green-100); color: var(--green-900); }
.status-completed { background: var(--green-500); color: white; }
.status-cancelled { background: var(--bg-muted); color: var(--text-muted); }
.status-defaulted { background: rgba(176, 58, 46, 0.15); color: var(--danger); }
.cert { font-family: var(--font-mono, monospace); font-size: 0.85rem; background: var(--bg-muted); padding: 0.15rem 0.4rem; border-radius: 4px; }

/* v1.8.2.14: click-to-edit status pill in the admin Donations table.
   The pill becomes a button with a hover ring; the popover anchors
   below it and is dismissable by clicking outside. */
.status-pill-btn { border: 1px solid transparent; cursor: pointer; transition: border-color 0.15s, transform 0.15s; font-family: inherit; }
.status-pill-btn:hover { border-color: var(--border); transform: translateY(-1px); }
.status-pill-btn:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
.status-editor { position: relative; display: inline-block; }
.status-editor-pop { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 280px; max-width: calc(100vw - 24px); background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 32px rgba(0,0,0,0.18); padding: 0.85rem; display: flex; flex-direction: column; gap: 0.6rem; }
/* v1.8.2.32: when the button is in the right half of the viewport,
   anchor the popover to the right edge of the button so it opens
   to the left. This stops the popover from running off the right
   edge of the screen on wide tables. */
.status-editor-pop--right { left: auto; right: 0; }
/* v1.8.2.66w.311: vertical flip. When the status pill is in the
   bottom half of the viewport, the popover overflows past the
   visible area. Flip the popover to anchor ABOVE the button so
   the Save / Cancel actions stay in view. Estimated popover
   height is 220px (3 rows + 2 actions + paddings); if the room
   below the button is less than that, open upward instead. */
.status-editor-pop--above { top: auto; bottom: calc(100% + 6px); }

/* v1.8.2.41: self-hosted tunnel system (scripts/tunnel/) — bypasses the cloudflared Go-TLS limitation in the sandbox by using a pure-Node.js relay+client pair over WebSocket; serveo.net SSH tunnel also documented as a no-install fallback
/* v1.8.2.40: component number reference (Componet #N) — extract numeric component ID from "Componet 3" / "Component 5" / "Comp 2" patterns in bank row text, surface the same number on every public component card so donors have a stable identifier
/* v1.8.2.39: component-based matching — extract component name (Carpet/Quran/Bookshelf/etc.) from payee/particular/reference, match endpoint bumps components.current_amount (for goal-based) and -component_id payment_schedules, unlink reverses both
/* v1.8.2.38: plot-based matching — extract Plot N from payee/particular/reference, match endpoint bumps payment_schedules.paid_cents by bank amount, unlink reverses (and reverts completed → active)
/* v1.8.2.37: inline receipt picker — opens from the Match button
   on each unmatched bank row. Lists every matchable receipt
   (status in approved/receipt_made/sent, not yet linked to a bank
   row) with the amount, donor, and tax period visible so the
   admin can pick the right one in one click. */
.receipt-picker { position: relative; display: inline-block; }
.receipt-picker-pop { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 32px rgba(0,0,0,0.18); padding: 0.85rem; display: flex; flex-direction: column; gap: 0.6rem; }
.receipt-picker-pop--left { right: auto; left: 0; }
.receipt-picker-head { display: flex; flex-direction: column; gap: 0.15rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.receipt-picker-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.receipt-picker-item { background: var(--bg-page); border: 1px solid var(--border); border-radius: 6px; padding: 0.55rem 0.65rem; font-size: 0.82rem; }
.receipt-picker-item:hover { border-color: var(--green-700); }
/* v1.8.2.42: clickable picker item — the entire row (not just the
   bottom button) can be clicked to link the bank row to the receipt.
   Hover gets a subtle background, focus gets a clear ring. */
.receipt-picker-item-clickable { transition: background 80ms ease, border-color 80ms ease, transform 80ms ease; }
.receipt-picker-item-clickable:hover { background: var(--green-100, #d5ebe1); border-color: var(--green-700); }
.receipt-picker-item-clickable:focus { outline: 2px solid var(--green-700); outline-offset: 1px; }
.receipt-picker-item-clickable:focus:not(:focus-visible) { outline: none; }
.receipt-picker-row1 { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.receipt-picker-row2 { font-weight: 600; margin-top: 0.15rem; }
.receipt-picker-row3 { margin-top: 0.15rem; font-size: 0.78rem; }
.receipt-picker-amount { font-weight: 700; color: var(--green-700); }
.receipt-picker-exact { font-size: 0.65rem; background: var(--green-700); color: white; padding: 0.05rem 0.4rem; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-left: 0.25rem; }
.receipt-picker-empty { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.5rem 0; }
.receipt-picker-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 0.5rem; }
/* v1.8.2.38: sectioned dropdown (Plot matches + Receipt matches).
   Each section has its own header for visual separation. */
.receipt-picker-section { display: flex; flex-direction: column; gap: 0.3rem; }
.receipt-picker-section-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding-bottom: 0.15rem; }
.receipt-picker-memorial { font-size: 0.65rem; background: var(--gold, #c89b3c); color: white; padding: 0.05rem 0.4rem; border-radius: 999px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-left: 0.25rem; }
.status-editor-row { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.status-editor-row label { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.status-editor-row select, .status-editor-row input, .status-editor-row textarea { padding: 0.4rem 0.55rem; border: 1px solid var(--border); border-radius: 5px; background: var(--bg-page); color: var(--text-primary); font-size: 0.85rem; font-family: inherit; }
.status-editor-row textarea { resize: vertical; min-height: 2.2rem; }
.status-editor-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.status-editor .err { color: var(--danger); }

/* ----- v1.8.0: Pledge page ----- */
.pledge-list { list-style: none; padding: 0; margin: 0; }
.pledge-list li { display: flex; justify-content: space-between; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.pledge-list li:last-child { border-bottom: none; }
.pledge-form { display: flex; flex-direction: column; gap: 0.75rem; }
.pledge-form label { display: flex; flex-direction: column; gap: 0.3rem; }
.pledge-form input { padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); color: var(--text-primary); font-size: 1rem; }

/* v1.8.1.14: Payment-plan template picker (radio-button grid) */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}
.template-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.template-option:hover { border-color: var(--green-500); }
.template-option.selected {
  border-color: var(--green-700);
  background: var(--green-50, #f0f7f4);
  box-shadow: 0 0 0 2px rgba(15, 60, 47, 0.12);
}
.template-option input[type=radio] {
  margin: 0.2rem 0 0;
  width: 16px; height: 16px;
  accent-color: var(--green-700);
}
.tpl-info { display: flex; flex-direction: column; gap: 0.15rem; }
.tpl-name { font-weight: 600; color: var(--text-primary); }
.tpl-desc { line-height: 1.4; }
.custom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.25rem; }
.pledge-total { display: flex; justify-content: space-between; padding: 0.75rem 0; border-top: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); margin: 0.5rem 0; }
.pledge-total strong { font-size: 1.4rem; color: var(--green-700); }
.pledge-done { text-align: center; max-width: 560px; margin: 2rem auto; }
.pledge-done h1 { color: var(--green-700); }

/* ----- v1.8.0: Map view (the big one — 299 plots) ----- */
.map-view-page { display: flex; flex-direction: column; gap: 1rem; }
/* v1.8.1.47: intro blurb at the top of the prayer plot map page. */
.map-page-hero { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.map-page-hero p { max-width: 760px; margin: 0 auto; line-height: 1.55; color: var(--text-secondary); font-size: 0.95rem; }

/* v1.8.1.48: home page introduction card. */
.home-intro h2 { margin-top: 0; margin-bottom: 0.75rem; font-size: 1.55rem; }
.home-intro p { margin: 0 0 0.9rem 0; color: var(--text-primary); line-height: 1.55; font-size: 1rem; }
.home-intro h3 { margin: 1.25rem 0 0.75rem 0; font-size: 1.1rem; color: var(--green-900); }
.home-intro-thanks { margin-top: 1rem; font-style: italic; color: var(--green-700) !important; }
.home-intro-ways { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.home-intro-ways li {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem 0.9rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.home-intro-ways li div { font-size: 0.92rem; line-height: 1.4; }
.home-intro-glyph { font-size: 1.4rem; line-height: 1; flex-shrink: 0; }
.map-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; padding: 0.75rem 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; }
.search-box { position: relative; }
.search-box .search-icon { position: absolute; left: 0.6rem; top: 0.55rem; opacity: 0.6; }
.search-box input { padding: 0.4rem 0.6rem 0.4rem 2rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); color: var(--text-primary); width: 160px; font-size: 0.85rem; }
.zone-filters { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.zone-btn { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); color: var(--text-primary); font-size: 0.78rem; font-weight: 500; cursor: pointer; transition: all 0.12s; }
.zone-btn:hover { background: var(--bg-muted); }
.zone-btn .dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.counters { display: flex; gap: 0.5rem; margin-left: auto; font-size: 0.75rem; color: var(--text-muted); }
.counter { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.5rem; background: var(--bg-muted); border-radius: 999px; }
.counter .dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
/* v1.8.2.66w.371: the three counter pills are a STATUS LEGEND — the
   label names the colour ("252 avail", "44 res", "3 sold"). They read
   from the same fixed tokens as the cells and the legend dots, so all
   three always agree and none of them drift with the site theme. */
.counter.avail .dot { background: var(--plot-available); }
.counter.res .dot { background: var(--plot-reserved); }
.counter.sold .dot { background: var(--plot-sold); }

.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
/* v1.8.1.51: wraps the canvas + entrance + legend together so they all
   stack in the first grid column instead of flowing to the second. */
.map-main { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.map-canvas {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: var(--shadow-1);
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  /* v1.8.1.49: center the map horizontally inside the canvas. The
     .plot-grid-wrap is inline-block (so the qibla pill can position
     absolutely inside it) — the canvas needs text-align:center to
     horizontally center that inline-block child. */
  text-align: center;
}
.map-canvas:has(.plan-view) { max-height: none; }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 0.75rem; font-size: 0.78rem; color: var(--text-muted); }
/* v1.8.1.50: legend BELOW the map (was above). The colored dot doubles
   as a small color-block to act as the zone's color key. */
.map-legend-below {
  margin-top: 1rem;
  margin-bottom: 0;
  padding: 0.6rem 0.75rem;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.map-legend-below .dot { width: 10px; height: 10px; flex-shrink: 0; }
.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.legend-item .dot { width: 8px; height: 8px; border-radius: 999px; }
.legend-price { font-weight: 600; color: var(--text-secondary); margin-left: 0.15rem; }
.plot-grid {
  display: grid;
  grid-template-columns: repeat(36, 38px);
  grid-template-rows: repeat(15, 38px);
  gap: 3px;
  padding: 0.75rem;
  width: max-content;
  margin: 0 auto;
}
.plot {
  /* v1.8.1.30: 3D plot cell — gradient + inset highlight + outer drop
     shadow + hover lift. Looks like a small pill rising off the page. */
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 5px;
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative;
  padding: 0;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.30);
}
.plot:hover { transform: translateY(-1px) scale(1.18); z-index: 5; box-shadow: 0 4px 8px rgba(0,0,0,0.20), 0 8px 16px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.40); }
.plot.selected {
  border-color: #facc15 !important;
  box-shadow: 0 0 0 3px #facc15, 0 0 16px rgba(250, 204, 21, 0.6), 0 4px 12px rgba(250, 204, 21, 0.3);
  transform: translateY(-1px) scale(1.12);
  z-index: 6;
}
.plot.sold { opacity: 0.55; cursor: not-allowed; }
.plot.reserved { border-color: #f59e0b !important; box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.4), 0 1px 2px rgba(0,0,0,0.18); }
.plot.dimmed { opacity: 0.18; }
.plot-num { font-variant-numeric: tabular-nums; line-height: 1; }

.zoom-controls { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.zoom-label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.75rem; color: var(--text-muted); }
.zoom-label input[type="range"] { width: 80px; accent-color: var(--green-700); }
.zoom-val { font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; color: var(--text-secondary); font-weight: 600; }
.btn-mini { width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-primary); cursor: pointer; font-size: 0.85rem; }
.btn-mini:hover { background: var(--bg-muted); }

/* v1.8.1.3: view-mode toggle (Grid / Plan) */
.view-toggle {
  display: inline-flex;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.view-pill {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.view-pill:hover { color: var(--text-primary); }
.view-pill.active {
  background: var(--green-700);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.entrance-marker { text-align: center; margin-top: 0.5rem; font-size: 0.7rem; letter-spacing: 0.18em; padding: 0.4rem 0.6rem; background: var(--bg-muted); border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }

/* v1.8.1.7: Plan view — just the static image, no interactivity */
.plan-view { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; width: 100%; }
.plan-image-wrap {
  width: 100%;
  /* Fill the available width of the map-canvas. The map-canvas itself
     sizes to fill the map-layout column, so this scales with the
     viewport — image stays sharp and fills the screen. */
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  position: relative;
}
.plan-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 280px); /* keep image inside viewport */
  object-fit: contain;
  user-select: none;
}

/* v1.8.1.9: Plan view zoom controls + panning */
.plan-zoombar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
}
.plan-zoombar input[type="range"] {
  width: 130px;
  accent-color: var(--green-700);
}
.plan-zoom-btn {
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  line-height: 1;
}
.plan-zoom-btn:hover { background: var(--bg-muted); }
.plan-zoom-val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: center;
  font-size: 0.85rem;
}
.plan-hint-inline {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ----- Qibla direction bar (above the plot grid) -----
   Shows the direction of prayer with an upward arrow. The Kaaba in
   Mecca is roughly northwest from New Zealand, but in a typical
   masjid floor plan the Qibla wall is "at the top" of the hall,
   so the arrow points up from the entrance (bottom) to the Imam (top). */
.plot-grid-wrap {
  position: relative;
  display: inline-block;
  /* Top padding leaves room for the Qibla label sitting just above row 1 */
  padding-top: 32px;
}
/* v1.8.1.25: small "Q I B L A" pill with down-arrow, positioned inside
   .plot-grid-wrap so it scrolls horizontally with the grid. Always
   sits directly above plot 1 (Imam, col 21). Pill auto-sizes to fit
   the text so the arrow tip is exactly above plot 1. */
.qibla-pill {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  /* the JS sets `left` to the exact center of col 21. Width auto-sizes. */
}
.qibla-pill-text {
  /* v1.8.1.30: 3D pill — gradient + green glow + inset highlight */
  font-family: var(--font-arabic, 'Inter', system-ui, sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-900);
  letter-spacing: 0.30em;
  white-space: nowrap;
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--green-700, #1f7a4d);
  box-shadow: 0 2px 4px rgba(10,30,26,0.10), 0 4px 8px rgba(31,140,107,0.20), inset 0 1px 0 rgba(255,255,255,0.8);
  text-align: center;
  line-height: 1.1;
}
.qibla-pill-arrow {
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--green-900);
  margin-top: 1px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 2px rgba(10,30,26,0.20));
}
/* Dark mode */
.map-view-page.map-dark .qibla-pill-text {
  color: #d8eae3;
  background: #1c2123;
  border-color: var(--green-300, #5fb89b);
}
.map-view-page.map-dark .qibla-pill-arrow { border-top-color: #5fb89b; }
/* High-contrast theme */
:root[data-theme="hc"] .qibla-pill-text {
  color: #000;
  background: #fff8d0;
  border-color: #000;
  border-width: 2px;
}
:root[data-theme="hc"] .qibla-pill-arrow { border-top-color: #000; }
.qibla-label-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--green-900);
  letter-spacing: 0.30em;
  white-space: nowrap;
  background: var(--bg-card);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--green-300);
  display: inline-block;
  line-height: 1.2;
}
.qibla-label-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--green-900);
  /* Center the arrow under the bordered text box, not the wide parent.
     The text is an inline-block; this puts the arrow directly below it
     with the same width as the text (well, ~12px which is centered). */
  margin: 1px auto 0;
  display: block;
  /* To center under the text itself (not the parent wrap), we wrap
     the text + arrow in a single container — see .qibla-label-stack */
}
.qibla-label-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.qibla-label-sub {
  display: none;   /* v1.8.1.15: hide the "MECCA" sub for a more compact label */
}
.map-view-page.map-dark .qibla-label-text {
  color: #d8eae3;
  background: #1c2123;
  border-color: var(--green-700);
}
.map-view-page.map-dark .qibla-label-arrow { border-top-color: #5fb89b; }
.map-view-page.map-dark .qibla-label-sub { color: #93a39e; }
.qibla-bar-spacer { display: none; }
.qibla-bar {
  position: relative;
  width: 100%;
  max-width: 700px;
  margin: 0 auto 0.4rem;
  padding: 0.35rem 0.75rem 0.2rem;
  background: linear-gradient(180deg, var(--green-100) 0%, #f0f7f4 100%);
  border: 1px solid var(--green-300);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 0.05rem;
}
.qibla-bar::before, .qibla-bar::after {
  /* Small decorative Islamic 8-point stars on each side */
  content: '✦';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-500);
  font-size: 0.7rem;
  opacity: 0.7;
}
.qibla-bar::before { left: 0.6rem; }
.qibla-bar::after  { right: 0.6rem; }
.qibla-arrow {
  width: 100%;
  max-width: 360px;
  height: 60px;
  display: block;
}
.qibla-arrow .qibla-word {
  font-family: var(--font-arabic);
  /* Fall back to the sans if Amiri isn't loaded */
}
/* Dark-mode variant for the Qibla bar */
.map-view-page.map-dark .qibla-bar {
  background: linear-gradient(180deg, #0e3a2f 0%, #0a1e1a 100%);
  border-color: var(--green-700);
}
.map-view-page.map-dark .qibla-arrow text { fill: var(--gold-300) !important; }
.map-view-page.map-dark .qibla-arrow line { stroke: #5fb89b; }
.map-view-page.map-dark .qibla-bar::before,
.map-view-page.map-dark .qibla-bar::after { color: var(--gold-300); }

/* High-contrast variant */
:root[data-theme="hc"] .qibla-bar {
  background: var(--gold-100);
  border: 2px solid var(--ink-900);
}
:root[data-theme="hc"] .qibla-arrow text { fill: var(--ink-900) !important; }
:root[data-theme="hc"] .qibla-arrow line { stroke: var(--ink-900); }

.legend-status { display: inline-flex; align-items: center; gap: 0.5rem; padding-left: 0.5rem; border-left: 1px solid var(--border); margin-left: 0.5rem; }

/* Map page dark theme */
.map-view-page.map-dark { background: #14181a; color: #e4e7e3; }
.map-view-page.map-dark .map-canvas { background: #1c2123; border-color: #2a302d; }
.map-view-page.map-dark .map-toolbar { background: #1c2123; border-color: #2a302d; }
.map-view-page.map-dark .legend-item { color: #93a39e; }
.map-view-page.map-dark .entrance-marker { background: #232a2c; border-color: #2a302d; color: #93a39e; }

.map-sidebar { display: flex; flex-direction: column; gap: 1rem; min-width: 0; max-width: 340px; }
.counter-pill { display: inline-block; padding: 0.2rem 0.6rem; background: var(--bg-muted); color: var(--text-secondary); border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.empty-cart { text-align: center; padding: 1.5rem 1rem; border: 1px dashed var(--border); border-radius: 8px; background: var(--bg-muted); margin-top: 0.5rem; }
.empty-cart .emoji { font-size: 1.5rem; }
.cart-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.cart-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem; background: var(--bg-muted); border: 1px solid var(--border); border-radius: 8px; }
.cart-num { width: 32px; height: 32px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; flex-shrink: 0; }
.cart-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.cart-info strong { font-size: 0.85rem; }
.cart-remove { width: 28px; height: 28px; border-radius: 999px; border: none; background: var(--bg-card); color: var(--text-secondary); cursor: pointer; }
.cart-remove:hover { background: var(--bg-muted); color: var(--danger); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 0.75rem 0; border-top: 1px solid var(--border); margin-top: 0.75rem; }
.cart-total strong { font-size: 1.2rem; }
.cart-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.cart-actions .btn { flex: 1; }
.how-list { padding-left: 1.25rem; margin: 0.5rem 0 0; color: var(--text-secondary); font-size: 0.85rem; line-height: 1.45; word-wrap: break-word; overflow-wrap: break-word; }
.how-list li { margin: 0.5rem 0; }

.plot-tooltip {
  position: fixed;
  background: var(--ink-900);
  color: white;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  pointer-events: none;
  z-index: 100;
  display: flex; flex-direction: column; gap: 0.1rem;
  box-shadow: var(--shadow-2);
}

@media (max-width: 1100px) {
  .map-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .map-toolbar { flex-direction: column; align-items: stretch; }
  .search-box input { width: 100%; }
  .counters { margin-left: 0; flex-wrap: wrap; }
  /* v1.8.1.53: REMOVED the v1.8.1.49 mobile `transform: scale(0.4)` —
     the user now wants 100% zoom on mobile too (matches the desktop
     default), with the canvas auto-scrolling to show plot 1. The
     pill font-size override also removed since the pill renders at
     100% zoom and needs the original size. */
  .qibla-pill { font-size: 0.85rem !important; }
}

/* ----- Components ----- */
.btn {
  /* v1.8.1.63: modern 3D button — multi-layer gradient (top highlight,
     middle color, bottom shade), inset top highlight, drop shadow, plus
     a satisfying press state. Smooth ease-out transitions. */
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 1.3rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent; text-decoration: none;
  letter-spacing: -0.005em;
  transition: transform var(--transition-fast), box-shadow var(--transition), background var(--transition);
  box-shadow: var(--shadow-1), var(--shadow-inset);
  position: relative;
  user-select: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2), var(--shadow-inset); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-1), var(--shadow-inset-deep); transition-duration: 0.05s; }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-1), var(--shadow-glow); }
/* Primary: rich green gradient with bottom shade */
.btn-primary {
  background: linear-gradient(180deg, var(--green-500) 0%, var(--green-700) 60%, var(--green-900) 100%);
  color: var(--white);
  border-color: var(--green-900);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--green-300) 0%, var(--green-500) 50%, var(--green-700) 100%); text-decoration: none; }
/* Gold: warm gold gradient */
.btn-gold {
  background: linear-gradient(180deg, var(--gold-300) 0%, var(--gold-500) 50%, var(--gold-700) 100%);
  color: var(--ink-900);
  border-color: var(--gold-700);
}
.btn-gold:hover { background: linear-gradient(180deg, var(--gold-500) 0%, var(--gold-700) 100%); color: var(--white); text-decoration: none; }
/* Secondary: white outline for dark heroes */
.btn-secondary { background: rgba(255,255,255,0.04); color: var(--white); border: 1.5px solid rgba(255,255,255,0.7); backdrop-filter: blur(6px); }
.btn-secondary:hover { background: rgba(255,255,255,0.16); color: var(--white); text-decoration: none; }
/* Outline: clean white with green border */
.btn-outline { background: var(--white); color: var(--green-700); border-color: var(--green-300); }
.btn-outline:hover { background: var(--green-100); text-decoration: none; border-color: var(--green-500); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--ink-100); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.card {
  /* v1.8.1.30: 3D card with soft layered shadow + top inner highlight */
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2), var(--shadow-inset);
  padding: 1.5rem;
  border: 1px solid var(--ink-100);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-3), var(--shadow-inset); }
.card h3 { margin-top: 0; }

.stat {
  /* v1.8.1.30: 3D stat card — gradient + shadow + inner highlight + lift */
  background: linear-gradient(180deg, var(--white) 0%, color-mix(in srgb, var(--white) 92%, var(--ink-100)) 100%);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  box-shadow: 0 1px 2px rgba(10,30,26,0.06), 0 2px 6px rgba(10,30,26,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 0.18s, box-shadow 0.18s;
}
.stat:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(10,30,26,0.08), 0 8px 16px rgba(10,30,26,0.06); }
.stat .label { color: var(--ink-500); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-size: 1.6rem; font-weight: 800; color: var(--green-900); }
.stat .sub { color: var(--ink-500); font-size: 0.85rem; }
/* v1.8.2.66w.321: dark-mode contrast. --ink-500 (#93a39e in dark
   mode) is too dim against the dark stat card background
   (#1c2123). Bump label + hint to --ink-700 (#d2d8d3) so the
   "GOAL", "RAISED FROM PLOTS", "from plot sales" labels are
   readable instead of fading into the card surface. The .value
   already uses --green-900 which is a near-white mint in dark
   mode so it stays legible. */
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .stat .label,
[data-theme="hc"]   .stat .label,
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .stat .sub,
[data-theme="hc"]   .stat .sub { color: var(--ink-700); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

.progress {
  width: 100%; height: 14px; background: var(--ink-100);
  border-radius: 999px; overflow: hidden; margin: 0.5rem 0;
  box-shadow: inset 0 1px 2px rgba(10,30,26,0.10);
}
.progress > .bar {
  height: 100%;
  background: linear-gradient(180deg, var(--green-300) 0%, var(--green-500) 50%, var(--green-700) 100%);
  box-shadow: 0 0 8px rgba(31,140,107,0.4);
  transition: width 0.4s;
}

.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.badge-supporter  { background: var(--supporter-bg); color: var(--supporter-fg); }
.badge-friend     { background: var(--green-100); color: var(--green-900); }
.badge-guardian   { background: var(--guardian-bg); color: var(--guardian-fg); }
.badge-benefactor { background: var(--gold-100); color: var(--gold-700); }
.badge-founder    { background: var(--gold-300); color: #4a3a0a; }

/* v1.8.2.66w.331.7 (A5): status-tone badge modifiers. Replaces ~209
   inline Tailwind hex pairs scattered across the SPA. Prefer these
   over `style={{ background: '…', color: '…' }}` — they follow the
   theme automatically. See docs/ROADMAP.md §2.1. */
.badge--danger  { background: var(--danger-bg);  color: var(--danger-fg); }
.badge--warn    { background: var(--warn-bg);    color: var(--warn-fg); }
.badge--ok      { background: var(--ok-bg);      color: var(--ok-fg); }
.badge--info    { background: var(--info-bg);    color: var(--info-fg); }
.badge--neutral { background: var(--neutral-bg); color: var(--neutral-fg); }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.form-row { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-row label { font-weight: 600; color: var(--ink-700); font-size: 0.9rem; }
.form-row input, .form-row textarea, .form-row select {
  padding: 0.65rem 0.8rem; border: 1px solid var(--ink-300);
  border-radius: 6px; font-size: 1rem; font-family: inherit;
  background: var(--white);
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: 2px solid var(--green-500); outline-offset: 1px; border-color: var(--green-500);
}
.form-row .help { color: var(--ink-500); font-size: 0.82rem; }
.form-row .err { color: var(--danger); font-size: 0.85rem; }
.form-row.row { flex-direction: row; align-items: center; gap: 0.6rem; }
.form-row.row input[type=checkbox] { width: 18px; height: 18px; }

.alert { padding: 0.9rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-info { background: #e6f1ed; color: var(--green-900); border: 1px solid var(--green-300); }
.alert-warn { background: #fdf3df; color: #6b4f0a; border: 1px solid var(--gold-300); }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #e8b4ad; }
.alert-ok { background: var(--green-100); color: var(--green-900); border: 1px solid var(--green-300); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--ink-100); }
th { font-size: 0.8rem; text-transform: uppercase; color: var(--ink-500); letter-spacing: 0.05em; }
tr:hover td { background: var(--ink-100); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10,30,26,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;  /* v1.6.1: bump to be on top of Leaflet panes (which are z 200-700) */
  padding: 1rem;
}
.modal {
  background: var(--white); border-radius: 12px; padding: 2rem;
  max-width: 480px; width: 100%; max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-2);
}
.modal.lg { max-width: 720px; }
.modal h2 { margin-top: 0; position: relative; padding-right: 2rem; }
.modal-close-x {
  position: absolute; top: 0.75rem; right: 0.75rem;
  width: 32px; height: 32px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.4rem; line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.modal-close-x:hover { background: var(--bg-muted); color: var(--text-primary); border-color: var(--text-muted); }

.tag {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; background: var(--ink-100); color: var(--ink-700);
}
.tag-memorial { background: var(--memorial-bg); color: var(--memorial-fg); }
.tag-zone { background: var(--green-100); color: var(--green-900); }
.tag-status-available { background: var(--ok-bg); color: var(--green-900); }
.tag-status-reserved  { background: var(--warn-bg); color: var(--warn-fg); }
.tag-status-sold      { background: var(--danger-bg); color: var(--danger); }
.tag-status-pending   { background: var(--warn-bg); color: var(--warn-fg); }

.hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  color: var(--white); padding: 4rem 1.5rem; text-align: center;
}
.hero h1 { color: var(--white); font-size: 2.5rem; }
.hero p { font-size: 1.1rem; max-width: 600px; margin: 0 auto 1.5rem; opacity: 0.9; }
.hero .actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.empty {
  text-align: center; padding: 3rem 1rem; color: var(--ink-500);
}
.empty .ico { font-size: 2.5rem; opacity: 0.5; }

.muted { color: var(--ink-500); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.flex { display: flex; gap: 0.6rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.gap-2 { gap: 1rem; }
.hidden { display: none !important; }
/* Allow Tailwind-style responsive classes (e.g. `md:flex`) to override the
   !important `hidden` above at the appropriate breakpoint. The selector
   below uses higher specificity (md\:flex + a list of element types
   that React apps commonly render) so it wins at min-width: 768px. */
@media (min-width: 768px) {
  nav.md\:flex,
  div.md\:flex,
  header.md\:flex,
  span.md\:flex {
    display: flex !important;
  }
}

/* ----- Tabs ----- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--ink-100); margin-bottom: 1.5rem; }
.tabs button {
  background: none; border: none; padding: 0.8rem 1.2rem;
  font-size: 0.95rem; font-weight: 600; color: var(--ink-500);
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tabs button:hover { color: var(--green-700); }
.tabs button.active { color: var(--green-900); border-bottom-color: var(--green-700); }

/* ----- Map page specific (v1.7.0 legacy) — v1.8.0 React map uses the
   styles defined above. These rules are kept only so the legacy
   leaflet map.html still works if a user opens it directly. ----- */
.map-container { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; min-height: 500px; position: relative; }
#map { height: 70vh; min-height: 500px; }

.chip-group { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.chip {
  padding: 0.3rem 0.7rem; border-radius: 999px; border: 1px solid var(--ink-300);
  font-size: 0.82rem; cursor: pointer; background: var(--white); user-select: none;
}
/* v1.8.2.66w.331.7: the green ramp inverts in dark, so
   --green-700 is a LIGHT step there. Pairing it with literal
   `white` gave 2.38:1. --bg-page inverts with the ramp, so the
   pair stays ~7.5:1 in light and dark. */
.chip.on { background: var(--green-700); color: var(--bg-page); border-color: var(--green-700); }

/* ----- Spinner ----- */
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--ink-100); border-top-color: var(--green-700);
  border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Toast ----- */
#toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--ink-900); color: var(--white);
  padding: 0.8rem 1.2rem; border-radius: 8px; z-index: 200;
  box-shadow: var(--shadow-2); max-width: 360px;
  opacity: 0; transform: translateY(20px); transition: all 0.2s;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.ok { background: var(--green-900); }
#toast.err { background: var(--danger); }

/* ----- Wall card ----- */
.wall-card {
  background: var(--white); padding: 1.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow-1); border: 1px solid var(--ink-100);
  display: flex; flex-direction: column; gap: 0.6rem;
  position: relative;
}
.wall-card .name { font-weight: 700; color: var(--green-900); display: flex; align-items: center; gap: 0.5rem; }
.wall-card .date { color: var(--ink-500); font-size: 0.8rem; }
.wall-card .msg { color: var(--ink-700); font-style: italic; }
.wall-card .ref { font-size: 0.78rem; color: var(--ink-500); }
.wall-card .ribbon {
  position: absolute; top: -8px; right: 1rem;
  background: var(--memorial-fg); color: white; font-size: 0.7rem; font-weight: 700;
  padding: 0.2rem 0.6rem; border-radius: 999px; letter-spacing: 0.05em;
}

/* ----- Multi-step form ----- */
.stepper { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.stepper .step { display: flex; align-items: center; gap: 0.4rem; color: var(--ink-500); font-size: 0.9rem; }
.stepper .step .num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink-100);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-500);
}
.stepper .step.active { color: var(--green-900); font-weight: 600; }
.stepper .step.active .num { background: var(--green-700); color: var(--white); }
.stepper .line { flex: 1; height: 2px; background: var(--ink-100); }
.stepper .line.done { background: var(--green-700); }

.slide-form { overflow: hidden; }
/* v1.8.2.66w.391 — the steps have to sit SIDE BY SIDE.
 *
 * The rules below slide the panel with translateX(-100%) / (-200%), which
 * only moves it by ONE step if the steps are laid out in a row. The grid
 * template stacked them in a single column instead, so at step 2 the whole
 * panel was translated a full width to the LEFT and every field ended up
 * off-screen: the donor saw the stepper say "2 Contact" above an EMPTY
 * form and could not continue. The signup journey was unusable and no test
 * covered it.
 *
 * A flex row of fixed-width panes puts each step one pane-width apart, so
 * the existing transforms mean what they say. The form clips the overflow
 * (.slide-form { overflow: hidden }), so only the current step shows.
 */
.slide-form .panel {
  display: block;
}
/* v1.8.2.66w.391 — show the CURRENT step and only the current step.
 *
 * The steps used to be laid out in a row and the panel was slid sideways
 * with translateX(-100%) / (-200%). The rules matched two nested elements
 * (the wrapper AND the inner .panel.modern-card), so the content was
 * translated twice and every field ended up off screen. The donor saw the
 * stepper say "2 Contact" above an EMPTY form and could not continue: the
 * signup journey was unusable, and no test covered it.
 *
 * Hiding the inactive steps cannot drift out of sync with the stepper —
 * the same data-step attribute drives both — and it works at any width.
 */
.slide-form .pane { display: none; padding: 0 0.5rem; }
.slide-form[data-step="1"] > .panel > .pane:nth-child(1),
.slide-form[data-step="2"] > .panel > .pane:nth-child(2),
.slide-form[data-step="3"] > .panel > .pane:nth-child(3) { display: block; }
/* The slide is gone (see above): the current step is shown by the
 * data-step rules, and no transform is applied. These are kept so that a
 * page which still relies on the old slide keeps its steps in step. */
.slide-form[data-step="2"] > .panel { transform: none; }
.slide-form[data-step="3"] > .panel { transform: none; }

/* ----- Component card ----- */
.comp-card {
  background: var(--white); border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-1); border: 1px solid var(--ink-100);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.comp-card .name { font-weight: 700; color: var(--ink-900); font-size: 1.1rem; }
.comp-card .desc { color: var(--ink-500); font-size: 0.9rem; flex: 1; }
.comp-card .price { font-weight: 800; color: var(--green-900); font-size: 1.3rem; }
.comp-card .recurring-tag { color: var(--gold-700); font-size: 0.85rem; font-weight: 600; }

/* ----- Plot modal ----- */
.plot-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .plot-modal-grid { grid-template-columns: 1fr; } }

/* ----- Admin ----- */
.admin-table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 1rem; overflow: auto; }
.admin-table { min-width: 800px; }

/* ========================================================================
   v1.7.0 — Modern UI from map.html (React/Tailwind inspired)
   Apply these classes to existing elements to get the new look-and-feel
   ======================================================================== */

/* Modern design tokens (matching the React app's zinc palette) */
:root {
  --zinc-50:  #fafafa;
  --zinc-100: #f4f4f5;
  --zinc-200: #e4e4e7;
  --zinc-300: #d4d4d8;
  --zinc-400: #a1a1aa;
  --zinc-500: #71717a;
  --zinc-600: #52525b;
  --zinc-700: #3f3f46;
  --zinc-800: #27272a;
  --zinc-900: #18181b;
  --zinc-950: #09090b;

  --emerald-100: #d1fae5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;

  --amber-100: #fef3c7;
  --amber-500: #f59e0b;
  --amber-700: #b45309;

  --yellow-400: #facc15;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-pop: 0 4px 12px rgba(0,0,0,0.10), 0 16px 32px rgba(0,0,0,0.08);

  --ease: cubic-bezier(.4,0,.2,1);
}

/* Modern sticky header (matches map.html) */
.modern-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--zinc-200);
}
.modern-header-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex; align-items: center; gap: 0.75rem;
  justify-content: space-between; flex-wrap: wrap;
}
.modern-header h1 {
  font-size: 1.05rem; font-weight: 600; margin: 0; line-height: 1.1; color: var(--zinc-900);
  letter-spacing: -0.01em;
}
.modern-header p {
  font-size: 0.7rem; color: var(--zinc-500); margin: 2px 0 0 0;
}
.modern-logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--green-500); color: var(--on-fill); font-weight: 700; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Status pill (avail/res/sold counters) */
.status-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.7rem; padding: 0.35rem 0.75rem; border-radius: 9999px;
  background: var(--zinc-50); border: 1px solid var(--zinc-200);
  color: var(--zinc-700);
}
.status-pill .dot { width: 0.4rem; height: 0.4rem; border-radius: 9999px; display: inline-block; }
.status-pill .dot.avail { background: var(--emerald-500); }
.status-pill .dot.res { background: var(--amber-500); }
.status-pill .dot.sold { background: var(--zinc-400); }
.status-pill .sep { width: 1px; height: 0.75rem; background: var(--zinc-300); margin: 0 0.25rem; }

/* Modern card (matches map.html's rounded-[20px] shadow-sm cards) */
.modern-card {
  background: var(--white);
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.modern-card-pad { padding: 1rem; }
.modern-card-pad-lg { padding: 1.5rem; }

/* Modern filter bar (matches map.html's filters row) */
.modern-filters {
  background: var(--white);
  border-bottom: 1px solid var(--zinc-200);
  padding: 0.75rem 1.5rem;
}
.modern-filters-inner {
  max-width: 1600px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
  justify-content: space-between;
}

/* Modern pill button (matches map.html's filter buttons) */
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  height: 1.75rem; padding: 0 0.75rem;
  border-radius: 9999px; font-size: 0.7rem; font-weight: 500;
  border: 1px solid var(--zinc-200); background: var(--white);
  color: var(--zinc-700); cursor: pointer;
  transition: all 0.15s var(--ease);
}
.pill:hover { background: var(--zinc-50); }
.pill.active {
  background: var(--zinc-900); color: var(--white); border-color: var(--zinc-900);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.pill .dot { width: 0.4rem; height: 0.4rem; border-radius: 9999px; display: inline-block; }
.pill[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Modern search input */
.search-input {
  position: relative; display: inline-flex; align-items: center;
}
.search-input input {
  height: 2rem; width: 180px; padding: 0 0.75rem 0 2rem;
  border-radius: 9999px; border: 1px solid var(--zinc-200);
  background: var(--zinc-50); font-size: 0.75rem; outline: none;
  color: var(--zinc-900);
}
.search-input input:focus { ring: 2px solid var(--yellow-400); }
.search-input .ico {
  position: absolute; left: 0.5rem; top: 0.3rem;
  font-size: 0.75rem; opacity: 0.6;
}

/* Modern legend (matches map.html's zone legend) */
.legend-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.7rem; padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background: var(--zinc-50); border: 1px solid var(--zinc-200);
  color: var(--zinc-700);
}
.legend-pill .swatch {
  width: 0.75rem; height: 0.75rem; border-radius: 3px; display: inline-block;
  border: 1px solid rgba(0,0,0,0.1);
}

/* Modern section title (in cards) */
.section-title {
  font-size: 0.75rem; font-weight: 600; color: var(--zinc-500);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 0.5rem 0;
}

/* Modern grid plot cell (matches map.html's plot cells) */
.plot-cell {
  width: 2.625rem; height: 2.625rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 600;
  border-radius: 0.5rem; border: 1.5px solid rgba(0,0,0,0.12);
  cursor: pointer; user-select: none;
  transition: all 0.2s var(--ease);
  position: relative;
}
.plot-cell:hover { transform: scale(1.06); z-index: 10; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.plot-cell.selected { box-shadow: 0 0 0 4px var(--yellow-400), 0 0 0 6px white; transform: scale(1.05); z-index: 10; }
.plot-cell.sold { opacity: 0.75; }
.plot-cell.sold::after {
  content: 'SOLD'; position: absolute; inset: 0;
  background: rgba(24,24,27,0.75); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 700; letter-spacing: 0.1em;
  border-radius: 0.4rem;
}
.plot-cell.reserved {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(0,0,0,0.12) 3px, rgba(0,0,0,0.12) 6px);
}
.plot-cell.reserved::before {
  content: ''; position: absolute; top: -3px; right: -3px;
  width: 0.5rem; height: 0.5rem; background: var(--amber-500);
  border-radius: 9999px; border: 1.5px solid white;
}

/* Modern Qibla/Entrance badges */
.qibla-badge {
  font-size: 0.65rem; letter-spacing: 0.2em; padding: 0.25rem 0.75rem;
  border-radius: 9999px; background: var(--zinc-100); border: 1px solid var(--zinc-200);
  color: var(--zinc-500); text-align: center; display: inline-block;
}

/* Modern tooltip */
.modern-tooltip {
  background: var(--white);
  border: 1px solid var(--zinc-200);
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15), 0 8px 10px -6px rgba(0,0,0,0.1);
  padding: 0.75rem; font-size: 0.7rem; min-width: 160px;
  color: var(--zinc-900);
}
.modern-tooltip .row { display: flex; justify-content: space-between; gap: 0.5rem; }
.modern-tooltip .label { color: var(--zinc-500); }

/* Modern modal (matches Stripe modal) */
.modern-modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modern-modal {
  background: var(--white);
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  width: 100%; max-width: 420px; padding: 1.25rem;
}
.modern-modal h3 { font-size: 0.95rem; font-weight: 600; margin: 0; color: var(--zinc-900); }
.modern-modal-row { display: flex; justify-content: space-between; font-size: 0.7rem; }
.modern-modal-input {
  width: 100%; height: 2.5rem; border-radius: 0.75rem;
  border: 1px solid var(--zinc-200); padding: 0 0.75rem;
  font-size: 0.8rem; outline: none; background: var(--white);
}
.modern-modal-input:focus { box-shadow: 0 0 0 2px var(--yellow-400); border-color: var(--zinc-300); }
.modern-btn-primary {
  background: var(--zinc-900); color: var(--white);
  border: none; border-radius: 9999px; padding: 0.5rem 1rem;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: background 0.15s var(--ease);
}
.modern-btn-primary:hover { background: var(--zinc-700); }
.modern-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.modern-btn-secondary {
  background: var(--white); color: var(--zinc-900);
  border: 1px solid var(--zinc-200); border-radius: 9999px; padding: 0.5rem 1rem;
  font-size: 0.75rem; font-weight: 500; cursor: pointer;
}
.modern-btn-secondary:hover { background: var(--zinc-50); }

/* Modern spinner */
.spinner {
  width: 2.5rem; height: 2.5rem; border-radius: 9999px;
  border: 2px solid var(--zinc-200); border-top-color: var(--zinc-900);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modern empty state */
.modern-empty {
  border: 1px dashed var(--zinc-200);
  background: var(--zinc-50);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--zinc-500);
}

/* Modern stats grid */
.modern-stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
.modern-stat {
  background: var(--zinc-50);
  border-radius: 0.5rem;
  padding: 0.5rem;
  text-align: center;
}
.modern-stat .value { font-size: 1.1rem; font-weight: 700; color: var(--zinc-900); }
.modern-stat .label { font-size: 0.65rem; color: var(--zinc-500); }

/* Apply modern look to existing components */
.modern-look { font-family: var(--font-sans); }
.modern-look .bismillah-strip { font-family: var(--font-arabic); }

/* Override existing lhic styles with modern equivalents */
.modern-look .sadaqah-ribbon {
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--zinc-200);
  color: var(--zinc-900);
}
.modern-look .sadaqah-ribbon strong { color: var(--zinc-900); }
.modern-look .sadaqah-ribbon small { color: var(--zinc-500); }

/* Responsive grid for modern pages */
@media (max-width: 768px) {
  .modern-header-inner { padding: 0.75rem 1rem; }
  .modern-filters { padding: 0.75rem 1rem; }
}


/* =========================================================================
   v1.8.1: Admin CMS — Pages, Media, Tags, Schedule
   Used by /#/admin/* routes in the React app. Shares the same CSS
   variables as the donor-facing pages so the theme (light/dark/hc)
   propagates automatically.
   ========================================================================= */

.admin-shell { background: var(--bg-page); min-height: 100vh; }

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-wrap: wrap;
}
.admin-brand-link {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--text-primary);
}
.admin-brand-link img { border-radius: 4px; }
.admin-brand-title { font-weight: 800; font-size: 1rem; }
.admin-brand-sub { font-size: 0.7rem; color: var(--text-muted); }

/* v1.8.1.27: side-nav layout — 13 admin items now in a vertical column
   to the left of the content area. Wraps on smaller screens. */
.admin-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  align-items: start;
  min-height: calc(100vh - 60px);
}
@media (max-width: 768px) {
  .admin-body { grid-template-columns: 1fr; }
}

.admin-nav {
  display: flex; flex-direction: column; gap: 0.15rem;
  padding: 1rem 0.5rem;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  position: sticky; top: 60px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
@media (max-width: 768px) {
  .admin-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }
}
.admin-nav-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.admin-nav-link:hover { background: var(--bg-muted); color: var(--text-primary); text-decoration: none; }
.admin-nav-link.active { background: var(--green-100); color: var(--green-900); font-weight: 600; }
.admin-nav-glyph { font-size: 1rem; flex-shrink: 0; }
.admin-nav-label { white-space: nowrap; }

.admin-header-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-me {
  font-weight: 600;
  color: var(--ink-900, #111);
}
.admin-me-role {
  font-size: 0.7rem; padding: 0.15rem 0.5rem;
  background: var(--bg-muted); border-radius: 999px; color: var(--text-muted);
}

.admin-main { padding: 1.5rem 2rem; min-width: 0; }

.admin-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.admin-page-head h1 { margin: 0; font-size: 1.5rem; }
.admin-page-head p { margin: 0.25rem 0 0 0; font-size: 0.9rem; }
.admin-page-actions { display: flex; gap: 0.5rem; }
.admin-dirty { color: var(--gold-700); font-weight: 600; }

.admin-error {
  background: rgba(176, 58, 46, 0.1);
  border-color: var(--danger) !important;
  color: var(--danger);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.admin-saved {
  background: rgba(31, 140, 107, 0.1);
  border-color: var(--ok, #1f8c6b) !important;
  color: var(--ok, #1f8c6b);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.admin-filters { padding: 0.75rem; }
.admin-filter-row {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
}
.admin-search {
  flex: 1; min-width: 200px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.admin-filter-row select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* v1.8.2.66w.292: neutralise the global form-control rule
   `select { width: 100% }` for selects that live inside an admin
   INLINE control row. That global width is correct for stacked
   form fields (settings, modals) but wrong for toolbar filters:
   a full-width select in a flex-wrap row takes 100% of the row,
   forcing every sibling onto its own line and turning a one-row
   filter bar into a 5-row stack. Scope the override to the
   inline rows only — stacked form selects are untouched. */
.admin-filter-row select,
.admin-filters select,
.admin-toolbar select {
  width: auto;
  min-width: 150px;
  max-width: 240px;
  flex: 0 1 auto;
}

/* v1.8.2.66w.292: the Updated column holds a locale-formatted
   timestamp ("14 Sept 2026, 10:54 am"). Without nowrap the "am"
   token wrapped onto its own line, doubling the row height. */
.admin-table td[data-label="Updated"] { white-space: nowrap; }

.admin-table-card { padding: 0; overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table .status-cell { min-width: 110px; white-space: nowrap; }
.admin-table .status-cell .status-pill { display: inline-block; max-width: 100%; }
.admin-table th, .admin-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.9rem;
}
.admin-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-muted);
  font-weight: 600;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-muted); }
/* v1.8.2.66w.331.7: a stray "." on its own line made the parser
   read the NEXT rule as the selector "..admin-row-selected td", which
   is invalid — so `.admin-row-selected` was silently dropped and never
   applied. Removing the stray restores the rule. */

.admin-row-selected td { background: var(--green-100) !important; }
/* v1.8.2.66w.290: actions row — desktop horizontal flex, mobile grid.
   5 action buttons in the Pages table needed to fit on phones
   without text wrapping vertically. */
.admin-row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.admin-row-actions .btn { white-space: nowrap; }
@media (max-width: 700px) {
  .admin-row-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 4px; width: 100%; }
  .admin-row-actions .btn { width: 100%; min-width: 0; padding: 6px 8px; font-size: 12px; }
}

/* Tag pills */
.tag-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
  margin-right: 0.25rem;
  margin-bottom: 0.2rem;
}
.tag-row { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; }

.status-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: lowercase;
}
.status-published { background: var(--green-100); color: var(--green-900); }
.status-draft { background: var(--bg-muted); color: var(--text-muted); }
.status-scheduled { background: var(--warn-bg); color: var(--warn-fg); }

/* Page editor */
.admin-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
}
.admin-edit-main { min-width: 0; }
.admin-edit-side { display: flex; flex-direction: column; gap: 1rem; }

.admin-edit-side .card { padding: 0.85rem; }
.admin-edit-side h3 { font-size: 0.95rem; margin: 0 0 0.75rem 0; }

.admin-tag-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.admin-tag-btn {
  padding: 0.3rem 0.7rem;
  border: 1px solid;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.12s;
}
.admin-tag-btn:hover { transform: translateY(-1px); }
.admin-tag-btn.on { font-weight: 700; }

/* Form rows */
.form-row { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.85rem; }
.form-row > span:first-child {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-row input, .form-row select, .form-row textarea {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--green-500);
  outline-offset: 1px;
}

/* Media library */
.admin-dropzone {
  padding: 2rem;
  text-align: center;
  border: 2px dashed var(--border-strong);
  cursor: pointer;
  transition: all 0.12s;
  margin-bottom: 1.5rem;
}
.admin-dropzone:hover, .admin-dropzone-active {
  border-color: var(--green-500);
  background: var(--green-100);
}
.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.admin-media-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-1);
  transition: transform 0.12s, box-shadow 0.12s;
}
.admin-media-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.admin-media-card img, .admin-media-card .admin-media-pdf {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  background: var(--bg-muted);
}
.admin-media-pdf {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: var(--text-muted);
  gap: 0.5rem;
}
.admin-media-meta { padding: 0.6rem; flex: 1; min-height: 0; }
.admin-media-name {
  font-size: 0.85rem; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-media-actions {
  padding: 0.4rem 0.6rem;
  border-top: 1px solid var(--border);
  display: flex; gap: 0.3rem; flex-wrap: wrap;
}
.admin-media-actions .btn { flex: 1; min-width: 0; padding: 0.3rem 0.5rem; font-size: 0.75rem; }

.admin-media-toolbar {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 1rem;
}

/* Tags page */
.admin-tag-form {
  display: grid;
  grid-template-columns: 1fr 1fr 80px;
  gap: 0.75rem;
  align-items: end;
}
.admin-tag-form .admin-tag-desc { grid-column: 1 / -1; }
.admin-tag-form .admin-tag-actions { grid-column: 1 / -1; text-align: right; }
@media (max-width: 700px) { .admin-tag-form { grid-template-columns: 1fr 1fr; } }

/* Revisions */
.admin-revisions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.admin-revisions-grid > .card { padding: 0; overflow: hidden; }
.admin-revisions-grid > .card:last-child { padding: 1rem; }
@media (max-width: 900px) { .admin-revisions-grid { grid-template-columns: 1fr; } }
.admin-revision-preview {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  background: var(--bg-muted);
  max-height: 600px;
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Modal (shared with donor app but customised) */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal {
  background: var(--bg-card);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  border: 1px solid var(--border);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 1.05rem; margin: 0; }
.modal-body { padding: 1rem; }
.modal-actions {
  display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem;
}

@media (max-width: 1000px) {
  .admin-edit-grid { grid-template-columns: 1fr; }
}

/* ----- v1.8.1.54: dynamic /page/:slug view (admin-edited content) ----- */
.page-view {
  display: flex; flex-direction: column; gap: 1.5rem;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.page-view .page-hero h1 { font-size: 2.2rem; }
.page-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-1);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 1rem;
}
.page-content h1, .page-content h2, .page-content h3 {
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.page-content h1 { font-size: 1.6rem; margin-top: 0; }
.page-content h2 { font-size: 1.3rem; }
.page-content h3 { font-size: 1.1rem; }
.page-content p { margin: 0.85rem 0; }
.page-content a {
  color: var(--green-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.page-content a:hover { color: var(--green-800); }
.page-content ul, .page-content ol { margin: 0.85rem 0; padding-left: 1.5rem; }
.page-content li { margin: 0.4rem 0; }
.page-content blockquote {
  border-left: 4px solid var(--green-500);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  background: var(--bg-muted);
  border-radius: 0 8px 8px 0;
}
.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}
.page-content code {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.92em;
  background: var(--bg-muted);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.page-content pre {
  background: var(--bg-muted);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}
.page-content pre code { background: transparent; padding: 0; }
.page-content hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* dark mode for page-content */
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .page-content {
  background: var(--bg-card);
  border-color: var(--border);
}
[data-theme="hc"] .page-content {
  border-width: 2px;
  border-color: var(--text-primary);
}

/* ----- v1.8.1.55: News / activity feed ----- */
.news-page {
  display: flex; flex-direction: column; gap: 1rem;
  padding: 0 1rem;
}
.news-card {
  /* a bit more breathing room than the default card */
  border-radius: 14px;
  transition: outline-color 0.5s;
}
.news-card .news-image { transition: transform 0.2s; }
.news-card .news-image:hover { transform: scale(1.02); }
.news-image img { display: none; } /* we use background-image for cover-fit */

/* admin posts page */
.admin-posts { display: flex; flex-direction: column; gap: 1rem; }
.admin-post-card { /* same as .card with padding 0 */ }
.admin-post-editor { display: flex; flex-direction: column; gap: 1rem; }
.admin-post-editor .card { padding: 1rem 1.25rem; }
.admin-post-editor .form-row { margin-bottom: 0.6rem; }

@media (max-width: 900px) {
  .admin-edit-grid { grid-template-columns: 1fr !important; }
}

/* ----- v1.8.1.56: component image uploader (drag-drop + preview) ----- */
.comp-image-uploader { width: 100%; }
.comp-image-preview {
  position: relative;
  width: 100%;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.comp-image-preview:hover { border-color: var(--green-700); }
.comp-image-preview.dragging {
  border-color: var(--green-700);
  background: var(--green-100, #e8f5e9);
  border-style: solid;
}
.comp-image-preview[data-empty="false"] {
  border-style: solid;
  border-color: var(--border);
  min-height: 0;
  aspect-ratio: 16/9;
}
.comp-image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}
.comp-image-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px;
  text-align: center;
}
.comp-image-preview[data-empty="false"] .comp-image-empty { display: none; }
.comp-image-uploading {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 600; color: var(--text-secondary);
  z-index: 2;
}
.comp-image-uploading[hidden] { display: none; }
.comp-image-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(220, 30, 30, 0.92);
  color: white;
  border: 2px solid white;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.comp-image-remove:hover { background: rgba(180, 0, 0, 1); transform: scale(1.06); }
.comp-image-fallback summary {
  list-style: none;
  user-select: none;
}
.comp-image-fallback summary::-webkit-details-marker { display: none; }
.comp-image-fallback summary::before {
  content: '▸ '; color: var(--text-muted);
}
.comp-image-fallback[open] summary::before { content: '▾ '; }
.comp-image-fallback input[type=url] {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

/* ----- v1.8.1.56: component card image ----- */
.component-card { overflow: hidden; }
.component-card-image {
  margin: -1.25rem -1.25rem 1rem;
  background: linear-gradient(135deg, var(--ok-bg) 0%, #b5d8c9 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  /* v1.8.2.45: fixed 4:3 aspect ratio so all images are the same
     visual size. Previously used a fixed 180px height which made
     portrait images (e.g. Library Books 0.74:1) get heavily cropped.
     aspect-ratio keeps the box consistent and object-position: center
     keeps the focal point of the image visible. */
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.component-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
/* v1.8.2.45: graceful placeholder when no image is set — same
   height/aspect as a real image so cards stay aligned. Icon scales
   with the container, label is small and muted. */
.component-card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0.5rem;
  color: var(--green-700);
}
.component-card-placeholder .glyph { font-size: 3.2rem; line-height: 1; opacity: 0.75; }
.component-card-placeholder .label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.6; font-weight: 600; }

/* ----- v1.8.1.59: custom payment controls (friendlier) ----- */
.custom-row {
  display: flex; flex-direction: column; gap: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--bg-muted);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.custom-row-field {
  display: flex; flex-direction: column; gap: 0.4rem;
}
.custom-row-field > label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.custom-row-field input[type=number],
.custom-row-field select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1.05rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text-primary);
  /* Make it look active, not readonly */
  appearance: none;
  -webkit-appearance: none;
  cursor: text;
}
.custom-row-field input[type=number]:focus,
.custom-row-field select:focus {
  outline: none;
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(31, 140, 107, 0.15);
}
.custom-row-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23444' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
/* Number stepper with +/- buttons for the count */
.number-stepper {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}
.number-stepper:focus-within {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(31, 140, 107, 0.15);
}
.number-stepper input {
  flex: 1;
  border: 0;
  outline: none;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  /* Hide the browser spinners — we provide our own +/- */
  -moz-appearance: textfield;
  appearance: textfield;
}
.number-stepper input::-webkit-outer-spin-button,
.number-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.number-stepper-btn {
  background: var(--bg-muted);
  border: 0;
  padding: 0 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green-700);
  cursor: pointer;
  min-width: 48px;
  transition: background 0.12s;
}
.number-stepper-btn:hover { background: var(--green-100, #e8f5e9); }
.number-stepper-btn:active { background: var(--green-200, #c8e6c9); }
.number-stepper-btn:disabled { color: var(--text-muted); cursor: not-allowed; background: var(--bg-muted); }
.custom-summary {
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green-700);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.custom-summary strong { color: var(--green-700); }

/* ----- v1.8.1.61: pledge list item with inline units stepper ----- */
.pledge-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.pledge-list-item:last-child { border-bottom: none; }
.pledge-list-name {
  flex: 1 1 auto;
  min-width: 180px;
}
.pledge-list-name span { font-weight: 600; }
.pledge-list-units {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}
.pledge-list-units:focus-within {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(31, 140, 107, 0.15);
}
.pledge-list-units-input {
  width: 56px;
  border: 0;
  outline: none;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}
.pledge-list-units-input::-webkit-outer-spin-button,
.pledge-list-units-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pledge-list-units-label {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}
.pledge-list-price {
  min-width: 90px;
  text-align: right;
  font-size: 1.05rem;
  color: var(--green-700);
}

@media (max-width: 600px) {
  .pledge-list-item { gap: 0.5rem; }
  .pledge-list-name { min-width: 100%; }
  .pledge-list-units { margin-left: auto; }
  .pledge-list-price { width: 100%; text-align: right; }
}

/* ----- v1.8.1.62: goal/recurring amount picker + progress bar ----- */
.pledge-progress {
  margin-top: 0.4rem;
  max-width: 480px;
}
.pledge-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-muted);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}
.pledge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-500, #4ade80), var(--green-700, #15803d));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.pledge-amount-picker {
  display: flex; flex-direction: column; gap: 0.4rem;
  min-width: 280px;
}
.pledge-amount-buttons {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.pledge-amount-btn {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.pledge-amount-btn:hover { border-color: var(--green-700); background: var(--green-100, #e8f5e9); }
.pledge-amount-btn.active {
  background: var(--green-700);
  color: white;
  border-color: var(--green-700);
}
.pledge-amount-custom {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: white;
  overflow: hidden;
  max-width: 200px;
}
.pledge-amount-currency {
  padding: 0 0 0 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
}
.pledge-amount-custom input {
  width: 100%;
  border: 0;
  outline: none;
  padding: 0.5rem 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}
.pledge-amount-custom input::-webkit-outer-spin-button,
.pledge-amount-custom input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.pledge-amount-custom:focus-within {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(31, 140, 107, 0.15);
}

@media (max-width: 700px) {
  .pledge-amount-picker { min-width: 0; width: 100%; }
  .pledge-amount-buttons { gap: 0.3rem; }
  .pledge-amount-btn { padding: 0.35rem 0.6rem; font-size: 0.85rem; }
}

/* ----- v1.8.1.63: final 3D polish pass ----- */

/* Custom scrollbar for the whole document — slim, theme-aware */
* { scrollbar-width: thin; scrollbar-color: var(--ink-300) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--green-500); background-clip: padding-box; border: 2px solid transparent; }

/* Text selection */
::selection { background: var(--green-500); color: white; }
::-moz-selection { background: var(--green-500); color: white; }

/* Gradient text utility */
.text-gradient {
  background: linear-gradient(135deg, var(--green-500) 0%, var(--green-900) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.text-gradient-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* 3D hover lift for cards (in addition to .card's default hover) */
.card-hoverable { cursor: pointer; }
.card-hoverable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-3), var(--shadow-inset);
}

/* Soft floating animation for hero elements */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.float { animation: float 6s ease-in-out infinite; }

/* Subtle entrance for cards (fade + slide up) */
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.card { animation: card-in 0.4s var(--ease-out) backwards; }

/* Modern progress bar (used by pledge page) */
.progress-bar {
  height: 10px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(10,30,26,0.08);
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-500) 0%, var(--green-700) 100%);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 8px rgba(31,140,107,0.4);
  transition: width 0.5s var(--ease-out);
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  animation: shimmer 2s linear infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Tag pills (used by admin/posts) — soft 3D */
.tag-pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem; font-weight: 600;
  border: 1px solid transparent;
  transition: transform var(--transition-fast);
}
.tag-pill:hover { transform: translateY(-1px); }

/* Status pills */
.status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid transparent;
}
.status-published { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.status-draft     { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.status-scheduled{ background: color-mix(in srgb, var(--ink-500) 15%, transparent); color: var(--ink-700); border-color: color-mix(in srgb, var(--ink-500) 30%, transparent); }

/* Nav active state — more prominent with a soft glow */
.lhic-nav a.active {
  background: var(--green-100);
  color: var(--green-900);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 2px rgba(31,140,107,0.15);
}

/* Footer — subtle gradient backdrop */
.lhic-footer {
  background: linear-gradient(180deg, var(--green-900) 0%, #082017 100%);
  color: var(--text-on-hero);
  position: relative;
  overflow: hidden;
}
.lhic-footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold-500) 50%, transparent 100%);
  opacity: 0.6;
}

/* Tables — softer borders and hover states */
table.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
table.admin-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 0.85rem;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
}
table.admin-table tbody tr {
  transition: background var(--transition-fast);
}
table.admin-table tbody tr:hover td {
  background: color-mix(in srgb, var(--green-100) 50%, transparent);
}
table.admin-table td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.admin-table tbody tr:last-child td { border-bottom: none; }

/* ----- v1.8.1.64: admin legacy tabs unified React UI ----- */
.admin-legacy { display: flex; flex-direction: column; gap: 1rem; }
.admin-legacy h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.admin-legacy h2 { font-size: var(--fs-lg); margin: 0 0 0.6rem; color: var(--text-primary); }

.admin-toolbar {
  display: flex; gap: 0.5rem; align-items: center;
  flex-wrap: wrap; margin-bottom: 0.5rem;
}
.admin-toolbar-search { flex: 1 1 240px; max-width: 320px; }
.admin-toolbar-select { min-width: 160px; }

/* v1.8.2.66w.238: prayer plot summary banner on the admin Plots
   tab. Mirrors the HTML report's summary grid but uses
   surface-2 (warm cream) so it reads as the page's primary
   metric block, not as a table row. 7 cards in a responsive
   auto-fit grid (3-4 cards per row on desktop, 2 on tablet,
   1 on phone). The "outstanding" card highlights in red when
   money is owed — same urgency cue as the HTML report. */
.plot-summary-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border, #e8e6dd);
  border: 1px solid var(--border, #e8e6dd);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.plot-summary-card {
  background: var(--surface-2, #fafaf3);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 88px;
  transition: background 0.15s ease;
}
.plot-summary-card:hover { background: var(--surface, #ffffff); }
.plot-summary-card.has-outstanding {
  background: linear-gradient(135deg, var(--danger-bg) 0%, var(--bg-card) 100%);
}
.plot-summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-muted, #6b7b6b);
}
.plot-summary-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #1a2e1a);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.plot-summary-value.money { color: var(--ok-fg); }
.plot-summary-value.outstanding { color: var(--danger); }
.plot-summary-sub {
  font-size: 12px;
  color: var(--text-muted, #6b7b6b);
  line-height: 1.3;
}
@media (max-width: 700px) {
  .plot-summary-banner { grid-template-columns: repeat(2, 1fr); }
  .plot-summary-value { font-size: 20px; }
  .plot-summary-card { min-height: 78px; padding: 12px 14px; }
}
@media (max-width: 420px) {
  .plot-summary-banner { grid-template-columns: 1fr 1fr; }
  .plot-summary-card { min-height: 72px; }
  .plot-summary-label { font-size: 10px; }
}

/* v1.8.2.66w.256: per-row warning chip when plot status implies
   a payment but no actual cash trail exists. Two flavours:
     no_payment_trail     — sold/reserved but $0 donations + $0
                            schedules (likely stale test data)
     reserved_no_schedule — reserved but no schedule at all (orphan)
   Same red tone as "Outstanding" to draw admin attention. */
.plot-warning-chip {
  display: inline-block;
  margin-top: 4px;
  margin-left: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--danger-bg);
  color: var(--danger-fg);
  border: 1px solid color-mix(in srgb, var(--danger-fg) 30%, transparent);
  vertical-align: middle;
  white-space: nowrap;
}
.plot-warning-chip.plot-warning-no_payment_trail {
  background: var(--danger-bg);
  border-color: color-mix(in srgb, var(--danger-fg) 35%, transparent);
}
.plot-warning-chip.plot-warning-reserved_no_schedule {
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-color: color-mix(in srgb, var(--warn-fg) 32%, transparent);
}

/* Dashboard stat grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}
.stat-card {
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(31,140,107,0.08) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30px, -30px);
}
.stat-glyph { font-size: 1.6rem; line-height: 1; }
.stat-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--green-900); letter-spacing: -0.01em; }

/* ----- v1.8.1.66: team member bio (added to Team card) ----- */
.team-bio { margin: 0.5rem 0 0; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.5; }

/* ===== v1.8.2.0: Treasury dashboard styles ===== */

.admin-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 1.25rem 0 1rem;
  border-bottom: 2px solid var(--border);
  flex-wrap: wrap;
}
.admin-tab {
  padding: 0.55rem 1rem;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active {
  color: var(--green-700);
  border-bottom-color: var(--green-700);
}
.admin-tab-content { display: flex; flex-direction: column; gap: 1rem; }

.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.admin-toolbar-left, .admin-toolbar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.admin-toolbar-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

/* Drawer (slide-in panel for review/edit) */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: flex; justify-content: flex-end;
  animation: fadeIn 0.15s;
}
.drawer {
  background: var(--bg-card);
  width: 100%; max-width: 600px;
  height: 100vh; overflow-y: auto;
  box-shadow: -8px 0 24px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
  animation: slideIn 0.2s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
}
.drawer-header h2 { margin: 0; font-size: 1.1rem; }
.btn-close {
  background: transparent; border: 0; font-size: 1.5rem;
  cursor: pointer; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 50%;
}
.btn-close:hover { background: var(--bg-muted); color: var(--danger); }
.drawer-body { padding: 1.5rem; flex: 1; }
.drawer-body h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; color: var(--green-700); }
.drawer-body h3:first-child { margin-top: 0; }

/* Review grid (key-value pairs) */
.review-grid {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 0.5rem 1rem; margin: 0; font-size: 0.9rem;
}
.review-grid dt { color: var(--text-muted); font-weight: 600; }
.review-grid dd { margin: 0; color: var(--text-primary); }
.review-grid code { background: var(--bg-muted); padding: 1px 6px; border-radius: 3px; }

/* Form row (used in drawer/editor) */
.form-row { margin-bottom: 0.75rem; display: flex; flex-direction: column; gap: 4px; }
.form-row label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

/* Action row (button group) */
.action-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }

/* Status pills for receipt requests */
.status-pill { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; text-transform: capitalize; }
.status-pending  { background: var(--warn-bg); color: var(--warn-fg); }
.status-approved { background: var(--green-100); color: var(--green-900); }
.status-declined { background: var(--danger-bg); color: var(--danger-fg); }
.status-made     { background: var(--green-700); color: #fff; }

/* Sub-account chip */
.sub-account-chip { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }

/* Error banner */
.error-banner {
  background: var(--danger-bg); color: var(--danger-fg);
  border: 1px solid color-mix(in srgb, var(--danger-fg) 35%, transparent); border-radius: 6px;
  padding: 0.75rem 1rem; margin: 0.5rem 0;
}

/* Verify page */
.verify-success, .verify-error { text-align: center; padding: 1rem 0; }
.verify-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem;
}
.verify-icon.success { background: var(--green-100); color: var(--green-700); border: 3px solid var(--green-500); }
.verify-icon.error   { background: var(--danger-bg); color: var(--danger-fg); border: 3px solid color-mix(in srgb, var(--danger-fg) 35%, transparent); }

/* ===== v1.8.2.1: Donor receipt request form styles ===== */
.tax-year-pills {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.pill {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.pill:hover { border-color: var(--green-500); color: var(--green-700); }
.pill.active {
  background: var(--green-700); color: #fff;
  border-color: var(--green-700);
}
.form-row-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
@media (max-width: 600px) { .form-row-grid { grid-template-columns: 1fr; } }

.rows-section { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.row-grid {
  display: grid; grid-template-columns: 1fr 1fr 130px 40px; gap: 0.4rem; align-items: center;
}
@media (max-width: 600px) { .row-grid { grid-template-columns: 1fr; } }
.btn-icon {
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.5rem;
  cursor: pointer; color: var(--text-muted);
}
.btn-icon:hover:not(:disabled) { background: #fce7e7; color: var(--danger); border-color: var(--danger); }
.btn-icon:disabled { opacity: 0.4; cursor: not-allowed; }

.live-summary {
  background: var(--bg-muted);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem;
  margin: 0.75rem 0;
  font-size: 0.88rem;
}
.live-summary > div { display: flex; flex-direction: column; }
.live-summary span { color: var(--text-muted); font-size: 0.78rem; }
.live-summary strong { color: var(--green-700); }

.confirm-row {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #fef8e7; border: 1px solid #fbbf24; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.88rem;
}
.confirm-row input { transform: scale(1.1); }

/* Donor receipt history list */
.receipt-history { display: flex; flex-direction: column; gap: 0.75rem; }
.receipt-history-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, #fff, var(--bg-muted));
}
.receipt-history-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.4rem;
}
.request-uid { font-family: var(--font-mono, monospace); font-size: 0.78rem; }
.receipt-history-body { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; }
.rh-line { display: flex; gap: 1rem; align-items: baseline; }
.rh-line > span:first-child { color: var(--text-muted); min-width: 120px; font-size: 0.8rem; }
.rh-line > strong, .rh-line > span:last-child { flex: 1; }
.receipt-history-actions { margin-top: 0.5rem; display: flex; justify-content: flex-end; }

/* ===== v1.8.2.3: 5-stage workflow + RBAC styles ===== */
.stage-pipeline {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin: 0 0 1rem 0; padding: 0;
}
.stage-pill {
  font-size: 0.72rem; font-weight: 600;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  background: var(--bg-muted); color: var(--text-muted);
  border: 1px solid var(--border);
}
.stage-pill.done { background: var(--green-100); color: var(--green-900); border-color: var(--green-300); }
.stage-pill.current { background: var(--green-700); color: #fff; border-color: var(--green-900); }
.verify-checks { display: flex; flex-direction: column; gap: 0.5rem; }
.check-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.9rem;
  background: var(--bg-card);
}
.check-row:hover { background: var(--bg-muted); }
.check-row input { transform: scale(1.15); }

/* Per-stage status pill colors */
.status-requested { background: var(--warn-bg); color: var(--warn-fg); }
.status-verification { background: var(--info-bg); color: var(--info-fg); }
.status-verified { background: var(--green-100); color: var(--green-900); }
.status-sent { background: var(--green-700); color: #fff; }
.status-archived { background: var(--bg-muted); color: var(--text-muted); }
.status-declined { background: var(--danger-bg); color: var(--danger-fg); }

/* ===== v1.8.2.3: RBAC admin page styles ===== */
.rbac-page { display: flex; flex-direction: column; gap: 1rem; }
.rbac-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.role-summary {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-card); margin-right: 6px;
}
.role-summary .dot { width: 8px; height: 8px; border-radius: 50%; }
.role-summary strong { margin-left: 4px; }

.rbac-table-wrap { overflow: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 0.5rem; }
.rbac-table { border-collapse: collapse; font-size: 0.85rem; width: 100%; }
.rbac-table th, .rbac-table td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); }
.rbac-table th { background: var(--bg-muted); font-weight: 700; text-align: left; }
.rbac-table .role-col { text-align: center; min-width: 90px; }
.rbac-table .role-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.rbac-table .cell-check { text-align: center; }
.rbac-table .cell-check input[type=checkbox] { transform: scale(1.15); }
.rbac-table .group-row td { background: var(--green-100); color: var(--green-900); font-weight: 700; padding: 0.4rem 0.6rem; }
.resource-path { font-family: var(--font-mono, monospace); font-size: 0.8em; color: var(--text-muted); }

.rbac-workflow { display: flex; flex-direction: column; gap: 1rem; }
.rbac-workflow h3 { margin: 0; font-size: var(--fs-lg); color: var(--green-700); }
.rbac-workflow .toggle { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.rbac-workflow .toggle input { transform: scale(1.15); }

/* v1.8.2.4: Plot edit drawer additions */
.drawer-footer {
  display: flex; gap: 0.5rem; justify-content: flex-end;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
  background: var(--bg-muted);
}
.form-row-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.form-row-2col > div {
  display: flex; flex-direction: column; gap: 4px;
}
.form-row-checks {
  display: flex; flex-direction: column; gap: 0.5rem;
  margin: 0.5rem 0 1rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-muted);
  border-radius: 6px;
}
.check-label {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; cursor: pointer; user-select: none;
}
.check-label input { width: 16px; height: 16px; cursor: pointer; }
.status-err {
  background: var(--danger-bg); color: var(--danger-fg);
  padding: 0.5rem 0.75rem; border-radius: 6px;
  margin-top: 0.5rem; font-size: 0.85rem;
}
.admin-table-clickable tbody tr:hover { background: var(--bg-muted); }

/* v1.8.2.5: donor welcome pill in the top-right nav corner. Replaces
   the v1.8.2.2 "⚙ Admin" link that incorrectly rendered for donors
   because /api/account/me 404'd and `me` stayed null. The pill is a
   solid green chip that stands out so donors can find their way
   back to the welcome page (/#/account) from any route. */
.donor-welcome-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  background: var(--green-700, #0e3a2f);
  color: var(--on-fill) !important;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 0 0 1px rgba(0,0,0,.04);
}
.donor-welcome-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(14, 58, 47, 0.25), 0 0 0 1px rgba(0,0,0,.04);
  background: var(--green-800, #0a2c23) !important;
  color: var(--on-fill) !important;
}
.donor-welcome-pill.active {
  background: var(--white) !important;
  color: var(--green-700) !important;
  box-shadow: 0 0 0 2px var(--green-700, #0e3a2f) inset;
}
.donor-welcome-glyph { font-size: 14px; line-height: 1; }
.donor-welcome-label {
  font-weight: 700; letter-spacing: 0.01em;
  opacity: 0.85;
}
.donor-welcome-name {
  max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
@media (max-width: 640px) {
  .donor-welcome-label { display: none; }
  .donor-welcome-name { max-width: 100px; }
}

/* v1.8.2.43: User Management page (AdminUsers.tsx) */
.admin-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.admin-stat-card { display: flex; align-items: center; gap: 0.75rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; }
.admin-stat-glyph { font-size: 1.5rem; line-height: 1; }
.admin-stat-body { display: flex; flex-direction: column; }
.admin-stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.admin-stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.status-pill.status-active { background: var(--green-100); color: var(--green-900); }
.status-pill.status-suspended { background: var(--danger-bg); color: var(--danger-fg); }
.status-pill.status-invited { background: var(--info-bg); color: var(--info-fg); }
.status-pill.status-matched { background: var(--green-100); color: var(--green-900); }
.status-pill.status-ignored { background: var(--bg-page); color: var(--text-muted); }
.status-pill.status-unmatched { background: var(--warn-bg); color: var(--warn-fg); }
/* v1.8.2.49: campaigner lifecycle statuses. "left" is a permanent
   state (resigned / moved / retired) distinct from "suspended"
   (temporarily paused). "archived" is the old hard-archive path
   still used by the Delete button when pledges exist. */
.status-pill.status-left { background: var(--info-bg); color: var(--info-fg); }
.status-pill.status-archived { background: var(--bg-page); color: var(--text-muted); }
/* v1.8.2.50: suspicious-flag pill for donors. The bright red draws
   the admin's eye to accounts that have been flagged for review. */
.status-pill.status-flagged { background: var(--danger-bg); color: var(--danger-fg); border: 1px solid color-mix(in srgb, var(--danger-fg) 30%, transparent); }
.role-pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; font-family: monospace; }
.role-pill.role-superadmin    { background: var(--danger-bg); color: var(--danger-fg); }
.role-pill.role-treasurer     { background: var(--info-bg); color: var(--info-fg); }
.role-pill.role-finance       { background: var(--ok-bg); color: var(--ok-fg); }
.role-pill.role-campaign_lead { background: var(--warn-bg); color: var(--warn-fg); }
.role-pill.role-viewer        { background: var(--bg-page); color: var(--text-muted); }
.badge-anon { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.35rem; border-radius: 999px; background: var(--bg-page); color: var(--text-muted); font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.form-row { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
.form-row label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.form-row-checkbox { margin: 0.25rem 0; }
.form-row-checkbox label { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }
.error-banner { background: var(--danger-bg); color: var(--danger-fg); padding: 0.5rem 0.75rem; border-radius: 6px; margin-bottom: 0.75rem; font-size: 0.85rem; }
.action-row { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* v1.8.2.49: Transfer modal checkboxes — full-width rows so the
   label text doesn't get pulled to the right by the parent
   column flex. Each label is a row: [☐] [text]. The selectors
   use `.form-row .transfer-checkboxes label` (3 classes) to beat
   the `.form-row label` rule (2 classes) — without the higher
   specificity, the parent style overrides text-transform + colour
   and the labels render uppercase + right-aligned. */
.form-row .transfer-checkboxes { display: flex; flex-direction: column; gap: 6px; }
.form-row .transfer-checkboxes label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 0; font-size: 0.9rem !important; text-transform: none !important; letter-spacing: normal !important; font-weight: 500 !important; color: var(--text-primary) !important; }
.form-row .transfer-checkboxes label input[type=checkbox] { margin: 0; }

/* v1.8.2.52: shared banner styles. Used by the Account dashboard
   for verification + review-queue notices, and by the Pledge
   page for the minimum-amount nudge. Three severity levels —
   info (blue), warn (yellow), error (red). */
.banner { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.92rem; line-height: 1.4; }
.banner strong { color: inherit; }
.banner-ok     { background: var(--ok-bg); color: var(--ok-fg); border: 1px solid color-mix(in srgb, var(--ok-fg) 30%, transparent); }
.banner-warn   { background: var(--warn-bg); color: var(--warn-fg); border: 1px solid color-mix(in srgb, var(--warn-fg) 32%, transparent); }
.banner-info   { background: var(--info-bg); color: var(--info-fg); border: 1px solid color-mix(in srgb, var(--info-fg) 30%, transparent); }
.banner-error  { background: var(--danger-bg); color: var(--danger-fg); border: 1px solid color-mix(in srgb, var(--danger-fg) 30%, transparent); }
.banner .btn-link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* v1.8.2.52: badge for tab counts (e.g. "Review queue [3]"). Small
   red pill next to the tab label, only shown when count > 0. */
.tab-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; background: var(--danger); color: white; border-radius: 999px; font-size: 0.7rem; font-weight: 700; vertical-align: middle; }

/* v1.8.2.52: status pills for the review-queue table. Mirrors
   the campaigner status-pill palette so the UI is consistent. */
.status-pill { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-pill.status-active  { background: var(--ok-bg); color: var(--ok-fg); }
.status-pill.status-pending { background: var(--warn-bg); color: var(--warn-fg); }
.status-pill.status-flagged { background: var(--danger-bg); color: var(--danger-fg); }

/* v1.8.2.52: data-table — generic striped table for the review
   queue. Reuses admin-table where possible but the review list
   has more columns (IP, status) so it gets its own class. */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.data-table th, .data-table td { padding: 0.65rem 0.75rem; text-align: left; border-bottom: 1px solid var(--neutral-bg); font-size: 0.88rem; }
.data-table th { background: var(--bg-muted); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.75rem; }
.data-table tbody tr:hover { background: var(--bg-muted); }
.data-table tbody tr:last-child td { border-bottom: 0; }

/* ============================================================
 * v1.8.2.66w.186: Reconstructed styles for new modules
 * ============================================================ */

/* ---------- STUDENT REGISTRATION (public form) ---------- */
.studreg-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}
.studreg-header {
  text-align: center;
  margin-bottom: 24px;
}
.studreg-header h1 {
  font-family: var(--serif, Georgia, serif);
  font-size: 2.2em;
  margin: 0 0 8px;
  color: var(--brand-700, #14532d);
}
.studreg-blurb {
  color: var(--ink-700, #444);
  margin: 4px 0 0;
}
.studreg-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.studreg-section {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.studreg-section legend,
.studreg-section h2 {
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand-700, #14532d);
  text-transform: uppercase;
  margin: 0 0 14px;
  padding: 0;
}
.studreg-field {
  margin-bottom: 14px;
}
.studreg-field:last-child {
  margin-bottom: 0;
}
.studreg-label {
  display: block;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--ink-800, #222);
  margin-bottom: 4px;
}
.studreg-label .req {
  color: var(--danger, #c0392b);
  font-style: normal;
  margin-left: 2px;
}
.studreg-field input[type="text"],
.studreg-field input[type="email"],
.studreg-field input[type="tel"],
.studreg-field input[type="date"],
.studreg-field select,
.studreg-field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  font: inherit;
  background: var(--surface, #fff);
  color: inherit;
  box-sizing: border-box;
}
.studreg-field input:focus,
.studreg-field select:focus,
.studreg-field textarea:focus {
  outline: 2px solid var(--brand-500, #16a34a);
  outline-offset: 1px;
  border-color: var(--brand-500, #16a34a);
}
.studreg-field textarea {
  min-height: 80px;
  resize: vertical;
}
.studreg-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
}
.studreg-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.studreg-radio input {
  width: auto;
}
.studreg-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface-2, #f9fafb);
  cursor: pointer;
}
.studreg-check input {
  margin-top: 2px;
}
.studreg-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.studreg-foot {
  margin: 16px 0 0;
  text-align: center;
  color: var(--ink-600, #555);
  font-size: 0.9em;
}
.studreg-honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.studreg-success {
  max-width: 560px;
  margin: 40px auto;
  padding: 32px 24px;
  text-align: center;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.studreg-success h1 {
  font-family: var(--serif, Georgia, serif);
  color: var(--brand-700, #14532d);
  margin: 0 0 12px;
}
.studreg-error {
  color: var(--danger, #c0392b);
  font-size: 0.85em;
  margin-top: 4px;
}
.studreg-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.studreg-stat {
  background: var(--surface-2, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.studreg-stat-value {
  display: block;
  font-size: 1.6em;
  font-weight: 700;
  color: var(--brand-700, #14532d);
}
.studreg-stat-label {
  display: block;
  font-size: 0.78em;
  color: var(--ink-600, #555);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
.studreg-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.studreg-detail-group {
  background: var(--surface-2, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
}
.studreg-detail-group dt {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-600, #555);
  margin: 0 0 4px;
}
.studreg-detail-group dd {
  margin: 0;
  font-size: 0.95em;
  color: var(--ink-900, #111);
}

/* Share URL widget */
.studreg-share-card {
  background: var(--surface-2, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
}
.studreg-share-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.studreg-share-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85em;
  background: var(--surface, #fff);
}
.studreg-share-compact {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: var(--surface-2, #f9fafb);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #e5e7eb);
}
.studreg-share-link {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85em;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.studreg-copy-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #d1d5db);
  background: var(--surface, #fff);
  cursor: pointer;
  font-size: 0.85em;
}

/* ---------- CONTACT FORM MODAL ---------- */
.contact-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.contact-shell {
  background: var(--surface, #fff);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.contact-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 1.6em;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-700, #444);
}
.contact-close:hover {
  background: var(--surface-2, #f3f4f6);
}
.contact-header {
  margin-bottom: 16px;
}
.contact-header h2 {
  margin: 0 0 6px;
  font-family: var(--serif, Georgia, serif);
  color: var(--brand-700, #14532d);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-label {
  display: block;
  font-size: 0.85em;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink-800, #222);
}
.contact-label .req {
  color: var(--danger, #c0392b);
  font-style: normal;
  margin-left: 2px;
}
.contact-form select,
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  font: inherit;
  background: var(--surface, #fff);
  color: inherit;
  box-sizing: border-box;
}
.contact-form textarea {
  min-height: 110px;
  resize: vertical;
}
.contact-error {
  color: var(--danger, #c0392b);
  font-size: 0.85em;
  margin-top: 4px;
}
.contact-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}
.contact-foot {
  margin: 8px 0 0;
  color: var(--ink-600, #555);
  font-size: 0.85em;
}

/* Contact header trigger */
.contact-header-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--brand-500, #16a34a);
  background: transparent;
  color: var(--brand-700, #14532d);
  cursor: pointer;
  margin-left: 4px;
}
.contact-header-trigger:hover {
  background: var(--brand-50, #f0fdf4);
}

/* ---------- ADMIN INBOX ---------- */
.admin-inbox-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-inbox-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.admin-inbox-tabs .pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  cursor: pointer;
  font-size: 0.85em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.admin-inbox-tabs .pill.active {
  background: var(--brand-700, #14532d);
  color: var(--on-fill);
  border-color: var(--brand-700, #14532d);
}
.pill-count {
  display: inline-block;
  background: var(--surface-2, #f3f4f6);
  color: var(--ink-700, #444);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.85em;
}
.admin-inbox-tabs .pill.active .pill-count {
  background: rgba(255,255,255,0.2);
  color: var(--on-fill);
}
.admin-inbox-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.admin-inbox-search {
  flex: 1;
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
}
.admin-inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-inbox-detail {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
}
@media (max-width: 800px) {
  .admin-inbox-detail {
    grid-template-columns: 1fr;
  }
}
.admin-inbox-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-inbox-side {
  background: var(--surface-2, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px;
}
.admin-inbox-side .card h3 {
  margin: 0 0 6px;
  font-size: 0.95em;
}
.admin-inbox-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.thread-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface, #fff);
}
.thread-original {
  border-left: 4px solid var(--gold-500, #d4a017);
}
.thread-admin {
  border-left: 4px solid var(--brand-500, #16a34a);
}
.thread-system {
  border-left: 4px solid var(--ink-400, #9ca3af);
  background: var(--surface-2, #f9fafb);
}
.admin-reply-form {
  margin-top: 12px;
}
.admin-reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.reply-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  color: var(--ink-700, #444);
}
.topic-pill {
  display: inline-block;
  background: var(--surface-2, #f3f4f6);
  color: var(--ink-700, #444);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78em;
  text-transform: capitalize;
}
.warn-tag {
  display: inline-block;
  background: var(--warn-bg);
  color: var(--warn-fg);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78em;
}
.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pill.status-new {
  background: var(--info-bg);
  color: var(--info-fg);
}
.status-pill.status-in_progress {
  background: var(--warn-bg);
  color: var(--warn-fg);
}
.status-pill.status-responded {
  background: var(--ok-bg);
  color: var(--ok-fg);
}
.status-pill.status-closed {
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}
.status-pill.status-spam {
  background: var(--danger-bg);
  color: var(--danger-fg);
}
.status-pill.status-open {
  background: var(--ok-bg);
  color: var(--ok-fg);
}
.status-pill.status-scheduled {
  background: var(--info-bg);
  color: var(--info-fg);
}

/* ---------- MODAL OVERLAYS (admin-*-modal, about-app-modal) ---------- */
/* v1.8.2.66w.193: the previous selector grouped .admin-help-overlay AND
   .about-app-overlay AND .admin-help-modal together, giving the modal
   itself position:fixed; inset:0 — which stretched it across the
   entire viewport and pushed the title off-screen. Split overlay and
   modal selectors so the modal sits inside the overlay's flex layout. */
.admin-help-overlay,
.about-app-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 16px;
}
.admin-help-modal,
.about-app-modal {
  background: var(--surface, #fff);
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  padding: 22px 24px;
  position: relative;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.admin-help-header,
.about-app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-help-header h2,
.about-app-header h2 {
  margin: 0;
  font-family: var(--serif, Georgia, serif);
  color: var(--brand-700, #14532d);
}
.admin-help-footer,
/* v1.8.2.66w.346: this was `display: flex; justify-content: flex-end`
   — a rule for a ROW of separate links. The footer is a <p> holding
   one sentence of prose with an inline <Link> in the middle, so flex
   turned each fragment into its own column. In LTR that read as a
   slightly loose line; in RTL it reordered into three side-by-side
   columns and the sentence was unreadable. Prose flows — it does not
   flex. Same class of bug as the mobile-nav auto-margin fix. */
.about-app-footer {
  display: block;
  margin-top: 16px;
}
/* Keep the inline link from being reordered out of its sentence by
   the bidi algorithm when the page is RTL. */
.about-app-footer a,
.about-app-footer kbd {
  unicode-bidi: isolate;
}
.admin-help-section,
.about-app-section {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #f3f4f6);
}
.admin-help-section:last-child,
.about-app-section:last-child {
  border-bottom: none;
}
.admin-help-section-title,
.about-app-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 0.95em;
  color: var(--ink-900, #111);
}
.admin-help-section-body,
.about-app-body {
  color: var(--ink-700, #444);
  font-size: 0.92em;
  line-height: 1.5;
}
.admin-help-list {
  list-style: none;
  margin: 6px 0;
  padding: 0;
}
.admin-help-section-icon,
.about-app-eyebrow {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-50, #f0fdf4);
  color: var(--brand-700, #14532d);
  text-align: center;
  line-height: 28px;
  font-size: 1.1em;
}
.about-app-eyebrow {
  background: var(--surface-2, #f3f4f6);
  font-size: 0.78em;
  padding: 2px 10px;
  width: auto;
  height: auto;
  line-height: 1.6;
  border-radius: 999px;
}
.admin-help-links,
.about-app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.admin-help-links a,
.about-app-links a {
  color: var(--brand-700, #14532d);
  text-decoration: none;
  border-bottom: 1px solid var(--brand-200, #bbf7d0);
}
.admin-help-roles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
/* v1.8.2.66w.198: about-app-meta is a <dl> with rows of <div><dt/><dd/>.
   Each row needs a 2-column grid so the label is left and the value
   is right-aligned (or just flowing after). */
.about-app-meta {
  display: grid;
  gap: 6px 16px;
  margin: 8px 0 0 0;
}
.about-app-meta > div {
  display: grid;
  grid-template-columns: minmax(80px, max-content) 1fr;
  gap: 12px;
  align-items: baseline;
}
.about-app-meta dt {
  font-weight: 600;
  color: var(--ink-700, #444);
}
.about-app-meta dd {
  margin: 0;
  color: var(--ink-900, #111);
}
.admin-help-role-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2, #f3f4f6);
  font-size: 0.78em;
}
.admin-help-divider,
.about-app-divider {
  margin: 12px 0;
  border: none;
  border-top: 1px solid var(--border, #f3f4f6);
}

/* ---------- ABOUT APP TRIGGER (header icon) ---------- */
.about-app-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border, #d1d5db);
  background: transparent;
  cursor: pointer;
  color: var(--ink-700, #444);
}
.about-app-trigger:hover {
  background: var(--surface-2, #f3f4f6);
}

/* ---------- HELP TRIGGER (admin header) ---------- */
.admin-help-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  cursor: pointer;
  font-size: 0.85em;
}
.admin-help-trigger-label {
  font-weight: 600;
}

/* ---------- ADDRESS AUTOCOMPLETE ---------- */
.address-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  font: inherit;
  box-sizing: border-box;
}
.address-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  max-height: 220px;
  overflow: auto;
  z-index: 200;
  margin-top: 2px;
}
.address-suggestion-line {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9em;
}
.address-suggestion-line:hover {
  background: var(--surface-2, #f3f4f6);
}
.address-card {
  position: relative;
}
.address-error {
  color: var(--danger, #c0392b);
  font-size: 0.85em;
  margin-top: 4px;
}
.address-hint {
  color: var(--ink-600, #555);
  font-size: 0.85em;
  margin-top: 4px;
}
.address-attribution {
  color: var(--ink-600, #555);
  font-size: 0.78em;
  margin-top: 4px;
}

/* ---------- ACCOUNT PAGE ---------- */
.account-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ---------- ADMIN EXPENSE (filter chips) ---------- */
.admin-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.admin-expense {
  /* container */
}

/* ---------- ADMIN BRAND ---------- */
.admin-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--brand-700, #14532d);
}

/* ---------- ADMIN LINK ---------- */
.admin-link {
  color: var(--brand-700, #14532d);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.admin-link:hover {
  border-bottom-color: var(--brand-500, #16a34a);
}

/* ---------- STUDREG-ADMIN ROWS ---------- */
.studreg-admin-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-2, #f9fafb);
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  margin-bottom: 6px;
}

/* ---------- DANGER BUTTON ---------- */
.btn.btn-outline.danger-btn {
  border-color: var(--danger, #c0392b);
  color: var(--danger, #c0392b);
}
.btn.btn-outline.danger-btn:hover {
  background: var(--danger, #c0392b);
  color: var(--on-danger);
}

/* ---------- PILL (generic) ---------- */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.82em;
  background: var(--surface-2, #f3f4f6);
  color: var(--ink-700, #444);
}

/* ---------- CERTIFICATE / ADMIN EXPENSE / TREASURY (placeholder rules for safety) ---------- */
.cert-page, .cert-toolbar, .cert-stamp, .cert-frame, .cert-preview,
.cert-empty, .cert-list, .cert-row, .cert-signer, .cert-modal,
.treasury-page, .treasury-summary, .treasury-chart, .treasury-row,
.treasury-modal, .expense-page, .expense-summary, .expense-row,
.expense-modal, .pledge-page, .pledge-card, .pledge-form,
.marketplace-page, .marketplace-card, .marketplace-filters,
.lead-page, .lead-card, .lead-form, .post-page, .post-editor,
.page-editor, .page-list, .donate-page, .donate-card,
.cert-title, .cert-meta, .cert-actions,
.media-page, .media-grid, .media-card, .media-modal {
  /* container — fallbacks */
}

/* ---------- ICON BUTTONS / COMMON ADMIN PATTERNS ---------- */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  cursor: pointer;
}


/* ---------- v1.8.2.66w.188: STUDENT REGISTRATION TERMS ---------- */
.studreg-terms {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.studreg-terms .studreg-check {
  margin-bottom: 0;
}
.studreg-terms-read-more {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--brand-500, #16a34a);
  color: var(--brand-700, #14532d);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85em;
  font-weight: 600;
  margin-left: 26px;
}
.studreg-terms-read-more:hover {
  background: var(--brand-50, #f0fdf4);
}
.studreg-rules-body {
  padding: 8px 0 16px;
  border-top: 1px solid var(--border, #f3f4f6);
  margin-top: 8px;
}
.studreg-rules-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: 0.95em;
  line-height: 1.5;
  color: var(--ink-800, #222);
  background: var(--surface-2, #f9fafb);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  margin: 0;
  max-height: 60vh;
  overflow: auto;
}


/* ---------- v1.8.2.66w.189: ANNOUNCEMENT CAROUSEL OVERLAY ---------- */
.announcement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1500;
  padding: 16px;
}
.announcement-shell {
  background: var(--surface, #fff);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  overflow: auto;
  position: relative;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: announcement-in 0.32s ease-out;
}
@keyframes announcement-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
.announcement-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-700, #444);
  font-size: 1.6em;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
}
.announcement-close:hover {
  background: var(--surface-2, #f3f4f6);
}
.announcement-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: -8px 0 12px;
}
.announcement-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border, #d1d5db);
  background: var(--surface-2, #f3f4f6);
  cursor: pointer;
  padding: 0;
}
.announcement-dot.active {
  background: var(--brand-500, #16a34a);
  border-color: var(--brand-500, #16a34a);
  transform: scale(1.15);
}
.announcement-card {
  text-align: center;
}
.announcement-image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
  display: block;
  margin: 0 auto 14px;
}
.announcement-pdf {
  margin-bottom: 14px;
}
.announcement-pdf iframe {
  width: 100%;
  height: 60vh;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
}
.announcement-pdf-actions {
  margin-top: 8px;
}
.announcement-text-only {
  padding: 30px 16px;
}
.announcement-text-only h2 {
  font-family: var(--serif, Georgia, serif);
  color: var(--brand-700, #14532d);
  margin: 0 0 12px;
}
.announcement-caption {
  padding-top: 4px;
}
.announcement-caption h3 {
  font-family: var(--serif, Georgia, serif);
  color: var(--ink-900, #111);
  margin: 0 0 8px;
  font-size: 1.25em;
}
.announcement-body {
  color: var(--ink-700, #444);
  line-height: 1.5;
  font-size: 0.95em;
}
.announcement-body p {
  margin: 0 0 8px;
}
.announcement-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #f3f4f6);
  text-align: center;
}
.announcement-progress {
  height: 4px;
  background: var(--surface-2, #f3f4f6);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}
.announcement-progress-bar {
  height: 100%;
  background: var(--brand-500, #16a34a);
  width: 100%;
  transform-origin: left;
  animation: announcement-progress linear forwards;
}
@keyframes announcement-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
/* Preview-only badge (admin edit form) */
.certificate-preview-badge {
  /* placeholder */
}
/* Pill button on home page that re-opens the carousel */
.announcement-pill {
  background: var(--brand-500, #16a34a);
  color: var(--on-fill);
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.announcement-pill:hover {
  background: var(--brand-700, #14532d);
}
.announcement-pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: var(--on-fill);
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.9em;
}


/* ============================================================
 * v1.8.2.66w.194: Comprehensive CSS pass — fix all missing rules
 * for the classes that show up in the JSX but had no CSS.
 * ============================================================ */

/* Admin common */
.admin-edit-grid { display: grid; gap: 12px; }
.admin-edit-main { min-width: 0; }
.admin-edit-side { min-width: 0; }
.admin-error {
  background: var(--danger-bg); color: var(--danger-fg);
  border: 1px solid color-mix(in srgb, var(--danger-fg) 35%, transparent); border-radius: 8px;
  padding: 10px 14px; margin: 8px 0;
}
.admin-dirty {
  background: var(--warn-bg); color: var(--warn-fg);
  padding: 6px 12px; border-radius: 999px; font-size: 0.85em;
  font-weight: 600;
}
.admin-saved {
  background: var(--ok-bg); color: var(--ok-fg);
  padding: 6px 12px; border-radius: 999px; font-size: 0.85em;
}
.admin-page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.admin-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-page-head { margin-bottom: 16px; }
.admin-reply-form { margin-top: 12px; }

.admin-search { width: 100%; max-width: 280px; padding: 8px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 6px; }
.admin-search-wrap { margin-bottom: 12px; }
/* v1.8.2.66w.292: this duplicate overrode the earlier
   `.admin-filters { padding: 0.75rem }` and made the filter CARD a
   flex row container. `align-items: center` then vertically centred
   the filter controls inside the card, so when the card was stretched
   by the broken .admin-pages grid the controls floated to the middle
   of an otherwise empty box. Keep it a plain padded block — the inner
   .admin-filter-row is already the flex row. */
.admin-filters { display: block; padding: 0.75rem; }
.admin-filter-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
/* v1.8.2.66w.428: THE SCHEDULED-PAYMENTS FILTER ROW.
   ---------------------------------------------------------------------------
   This row is a GRID, not a flex row, and that is the whole point.

   THE DEFECT (measured 2026-11-09)
   --------------------------------
   The row was an inline-styled flex row whose inputs carried the class
   `admin-toolbar-input` — a class that DOES NOT EXIST in this stylesheet.
   So the global form-control rule above (`input { width: 100% }`) applied
   to the two date fields, and the admin's own neutralising rule (which
   covers only .admin-filter-row / .admin-filters / .admin-toolbar) did
   NOT apply to this row.

   The row's geometry was therefore decided by each BROWSER's intrinsic
   control widths:

     Chromium : a date control wants 162.4px -> the row looks fine
     Safari   : a date control wants  71px  -> the date segments and the
                 picker icon do NOT shrink with the box, so they paint
                 OUTSIDE it, across the gap, and land ON TOP OF the Plot
                 control beside it.

   A donor's phone saw a broken filter row; a desktop saw a fine one. A
   control that only ran Chromium would have been GREEN against the
   broken code — which is exactly what happened to everyone else.

   THE CONTRACT
   ------------
   - The GRID owns the layout. The tracks are never narrower than a date
     control needs, so no control can be squeezed below its content.
   - `min-width: 0` on the LABEL hands the width to the track: without it
     the label's automatic minimum size is the input's min-content width,
     which is the engine's idea of a control's width — not the width the
     control needs to be usable.
   - `min-width: 163px` on a date control is the width Chromium ASKS FOR
     when it renders one correctly (MEASURED 2026-11-10: 162.4px at the
     page's 15.2px font, rounded UP). Safari needs 133.2px; the binding
     engine is Chromium. Below the floor the date segments and the picker
     icon do NOT shrink with the box — they paint OUTSIDE it.
   - ONE height for every control. The date fields render at 40.4px and
     the number/text controls at 38.2px, and `align-items: end` left the
     Plot field hanging lower than its neighbours.
   - The actions sit on their own row, so the buttons never squeeze a
     control out of its track.

   THE PHONE GEOMETRY (measured, not guessed)
   -------------------------------------------
   Two date controls CANNOT share a row on a phone. The filter card's
   inner width is 332px at a 390px viewport; two 163px tracks plus a 10px
   gap need 336px. "From | To" side by side is arithmetically impossible
   at 390px without squeezing a date below the width its content needs.

   ⇒ ON A PHONE, EACH ROW PAIRS ONE DATE WITH ONE NON-DATE CONTROL:
     row 1 = From (due date) | Plot,  row 2 = To (due date) | Search name.
     The first track keeps a hard 163px floor; the second takes what is
     left. Two date controls NEVER share a row, so the original collision
     is structurally impossible rather than merely unlikely.

   ⇒ ON A WIDER SCREEN (420px+) the natural order returns: the grid
     resolves From | To, then Plot | Search, and one row of four on a
     desktop. Two dates side by side is fine there — there is room.

   ⇒ BELOW 360px it falls back to one control per row, because the second
     track would be too narrow to be worth having. */
.admin-payment-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(163px, 1fr));
  gap: 10px 12px;
  align-items: end;
  padding: 12px;
}
/* v1.8.2.66w.429: the phone layout. See the note above — the pairings are
   EXPLICIT, not auto-flow, because auto-flow would put the two dates on
   the same row and that row does not exist at this width. */
@media (min-width: 360px) and (max-width: 419px) {
  .admin-payment-filters {
    grid-template-columns: minmax(163px, 1fr) minmax(0, 1fr);
  }
  .admin-payment-filters > label:nth-child(1) { grid-column: 1; grid-row: 1; }
  .admin-payment-filters > label:nth-child(2) { grid-column: 1; grid-row: 2; }
  .admin-payment-filters > label:nth-child(3) { grid-column: 2; grid-row: 1; }
  .admin-payment-filters > label:nth-child(4) { grid-column: 2; grid-row: 2; }
}
.admin-payment-filters > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  min-width: 0;
}
.admin-payment-filters input {
  width: 100%;
  min-width: 0;
  height: 40px;
}
.admin-payment-filters input[type="date"] { min-width: 163px; }
.admin-payment-filters-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}
.admin-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.admin-stat-body { display: flex; flex-direction: column; gap: 4px; }
.admin-toolbar-right { margin-left: auto; display: flex; gap: 8px; }
.admin-nav-external {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--ink-700, #444);
  text-decoration: none;
  font-size: 0.9em;
  padding: 4px 8px; border-radius: 6px;
}
.admin-nav-external:hover { background: var(--surface-2, #f3f4f6); }
.admin-tag-desc { color: var(--ink-600, #555); font-size: 0.85em; }
.admin-tag-actions { display: flex; gap: 6px; align-items: center; }
.admin-team-editor { background: var(--surface-2, #f9fafb); border-radius: 10px; padding: 12px; margin: 12px 0; }
.admin-legacy { color: var(--ink-500, #6b7280); font-size: 0.85em; }
/* v1.8.2.66w.292: .admin-pages renders THREE stacked blocks
   (page-head + filter card + data table), not a card gallery. The
   old `repeat(auto-fill, minmax(280px, 1fr))` laid those three
   children out as three side-by-side columns, which squeezed the
   table into ~300px (clipping Menu/Updated/Actions off-screen)
   and stretched the filter card to the full row height. Only
   AdminPages uses this class, so the fix is local. */
.admin-pages { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.admin-page-edit { background: var(--surface-2, #f9fafb); border-radius: 10px; padding: 14px; }
.admin-media-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.admin-media-card {
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px;
}
.admin-media-actions { display: flex; gap: 6px; margin-top: auto; }
.admin-media-meta { font-size: 0.78em; color: var(--ink-500, #6b7280); }
.admin-media-name { font-weight: 600; }
.admin-media-pdf { color: var(--ink-700, #444); font-size: 0.85em; }
.admin-media-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.admin-scheduled { display: grid; gap: 12px; }
.admin-post-card {
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.admin-post-avatar { width: 40px; height: 40px; border-radius: 50%; }
.admin-post-list { display: flex; flex-direction: column; gap: 8px; }
.admin-post-editor { background: var(--surface-2, #f9fafb); border-radius: 10px; padding: 14px; }
.admin-revision-preview {
  background: var(--surface, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; padding: 14px; margin-top: 12px;
}
.admin-revisions { display: grid; gap: 8px; }
.admin-revisions-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.admin-action-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.admin-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.admin-header-right { display: flex; gap: 12px; align-items: center; }
.admin-body { padding: 16px; }
.admin-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand-700, #14532d); }
.admin-brand-link { color: var(--brand-700, #14532d); text-decoration: none; }
.admin-brand-sub { font-size: 0.78em; color: var(--ink-500, #6b7280); }
.admin-brand-title { font-weight: 700; }

/* Admin inbox */
.admin-inbox { padding: 0; }
.admin-inbox-detail { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.admin-inbox-main { min-width: 0; }
.admin-inbox-side {
  background: var(--surface-2, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 12px;
}
@media (max-width: 800px) {
  .admin-inbox-detail { grid-template-columns: 1fr; }
}

/* Generic helpers */
.form-grid-2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-control {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 6px; font: inherit;
  background: var(--surface, #fff); color: inherit;
  box-sizing: border-box;
}
.btn-danger-ghost {
  background: transparent;
  color: var(--danger, #c0392b);
  border: 1px solid var(--danger, #c0392b);
}
.btn-danger-ghost:hover {
  background: var(--danger, #c0392b); color: #fff;
}
.btn-link {
  background: transparent;
  color: var(--brand-700, #14532d);
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* v1.8.2.66w.327: donor profile-edit card + modals.
   Three-column layout on wide screens, single-column on mobile.
   Field rows are click-targets for the edit buttons. */
.profile-card { padding: 1.25rem 1.5rem; }
.profile-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.75rem 0 0;
}
@media (max-width: 640px) {
  .profile-card-grid { grid-template-columns: 1fr; gap: 0.75rem; }
}
.profile-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 0.25rem 0.75rem;
  padding: 0.75rem 0.9rem;
  background: var(--bg-muted, #f5f7f6);
  border: 1px solid var(--border, #e1e5e2);
  border-radius: 8px;
}
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .profile-field,
[data-theme="hc"]   .profile-field {
  background: var(--bg-card, #1f2426);
  border-color: var(--border, #2a302d);
}
.profile-field-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500, #54635e);
  font-weight: 600;
}
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .profile-field-label,
[data-theme="hc"]   .profile-field-label {
  /* v1.8.2.66w.327: dark-mode contrast. The field label is
     small uppercase text; --ink-500 in dark mode is too dim. */
  color: var(--ink-700, #d2d8d3);
}
.profile-field-value {
  grid-column: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-900, #1a2e1a);
  word-break: break-word;
}
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .profile-field-value,
[data-theme="hc"]   .profile-field-value {
  color: var(--ink-100, #f0f3f1);
}
.profile-edit-btn {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  white-space: nowrap;
}
.profile-card-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e1e5e2);
  display: flex;
  justify-content: flex-end;
}
/* v1.8.2.66w.327: form-group / form-error / form-control were
   already in the stylesheet under different names. Map them so
   the new modals pick up the same look. */
.profile-modal-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.5rem; }
.profile-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}
.form-error {
  color: var(--danger, #b91c1c);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .form-error,
[data-theme="hc"]   .form-error {
  color: var(--danger-fg);
}
.callout {
  border-left: 4px solid var(--brand-500, #16a34a);
  background: var(--brand-50, #f0fdf4);
  padding: 10px 14px; border-radius: 6px;
  margin: 12px 0;
}
.data-table-wrap { overflow-x: auto; margin: 12px 0; }
.back-link {
  display: inline-block; margin-bottom: 12px;
  color: var(--ink-700, #444); text-decoration: none;
  font-size: 0.9em;
}
.back-link:hover { color: var(--brand-700, #14532d); text-decoration: underline; }
.privacy-note {
  background: var(--surface-2, #f9fafb); border-radius: 8px;
  padding: 10px 14px; font-size: 0.85em; color: var(--ink-700, #444);
  margin: 12px 0;
}
.hero-image {
  width: 100%; max-width: 720px;
  border-radius: 12px; display: block; margin: 0 auto;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.toast-container { position: fixed; bottom: 16px; right: 16px; z-index: 5000; }

/* Toast container */
.lhic-toast-container {
  position: fixed; bottom: 16px; right: 16px;
  display: flex; flex-direction: column-reverse; gap: 8px;
  z-index: 5000; pointer-events: none;
}
.lhic-toast {
  padding: 10px 14px; border-radius: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  pointer-events: auto;
  font-size: 0.92em;
}
.lhic-toast-success { border-left: 4px solid var(--success, #16a34a); }
.lhic-toast-error { border-left: 4px solid var(--danger, #c0392b); }
.lhic-toast-info { border-left: 4px solid var(--brand-500, #16a34a); }

/* Login / register / verify */
.login-page, .register-page, .verify-error {
  max-width: 480px; margin: 0 auto; padding: 24px 16px;
}
.verify-error { color: var(--danger, #c0392b); }

/* Components page */
.components-page { display: flex; flex-direction: column; gap: 16px; }
.pledge-page { display: flex; flex-direction: column; gap: 16px; padding: 16px 0; }
.team-page { display: flex; flex-direction: column; gap: 16px; padding: 16px 0; }
.news-feed { display: flex; flex-direction: column; gap: 12px; }
.news-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.wall-page { padding: 16px 0; }
.wall-prefs {
  background: var(--surface-2, #f9fafb); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 12px;
}
.account-page { max-width: 720px; margin: 0 auto; padding: 24px 16px; }
.about-page { max-width: 720px; margin: 0 auto; padding: 24px 16px; }

/* Marketplace (mp-*) */
.mp-shell { min-height: 100vh; background: var(--bg, #f8fafc); }
.mp-container { max-width: 1280px; margin: 0 auto; padding: 16px; }
.mp-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.mp-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.mp-card {
  background: var(--surface, #fff); border: 1px solid var(--border, var(--neutral-bg));
  border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.mp-card-photo { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; background: var(--surface-2, var(--neutral-bg)); }
.mp-card-photo-fallback {
  width: 100%; height: 160px; background: var(--surface-2, var(--neutral-bg));
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-500, var(--neutral-fg)); font-size: 2em;
}
.mp-card-title { font-weight: 600; font-size: 1em; margin: 4px 0 0; }
.mp-card-desc { color: var(--ink-600, #555); font-size: 0.88em; }
.mp-card-price { font-weight: 700; color: var(--brand-700, #14532d); }
.mp-card-suburb { color: var(--ink-500, var(--neutral-fg)); font-size: 0.85em; }
.mp-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
}
.mp-card-fav {
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-500, var(--neutral-fg)); font-size: 1.1em; padding: 4px;
}
.mp-card-fav:hover { color: var(--danger); }
.mp-badge, .mp-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mp-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2, var(--neutral-bg)); color: var(--ink-700, #444);
  font-size: 0.78em;
}
.mp-pills { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.mp-status-banner {
  background: var(--brand-50, #f0fdf4); border: 1px solid var(--brand-500, #16a34a);
  padding: 10px 14px; border-radius: 8px; margin-bottom: 12px;
}
.mp-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.mp-search { flex: 1; min-width: 200px; }
.mp-search-wrap { position: relative; }
.mp-tabs {
  display: flex; gap: 4px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border, var(--neutral-bg));
}
.mp-tab {
  background: transparent; border: none;
  padding: 8px 14px; cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--ink-700, #444);
}
.mp-tab.active { border-bottom-color: var(--brand-500, #16a34a); color: var(--brand-700, #14532d); font-weight: 600; }
.mp-input, .mp-select {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border, #d1d5db); border-radius: 8px;
  font: inherit; background: var(--surface, #fff); color: inherit;
  box-sizing: border-box;
}
.mp-form-field { margin-bottom: 12px; }
.mp-checkbox-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mp-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}
.mp-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.mp-empty {
  text-align: center; padding: 48px 16px;
  color: var(--ink-500, var(--neutral-fg));
}
.mp-error {
  background: var(--danger-bg); color: var(--danger-fg);
  padding: 10px 14px; border-radius: 8px; margin: 12px 0;
}
.mp-loading {
  text-align: center; padding: 24px;
  color: var(--ink-500, var(--neutral-fg));
}
.mp-modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1100; padding: 16px;
}
.mp-modal {
  background: var(--surface, #fff);
  border-radius: 12px; width: 100%; max-width: 720px;
  max-height: 92vh; overflow: auto; padding: 22px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
.mp-detail-row {
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 700px) { .mp-detail-row { grid-template-columns: 1fr; } }
.mp-photo-gallery {
  display: grid; gap: 8px;
  grid-template-columns: 1fr;
}
.mp-photo-main {
  width: 100%; max-height: 480px; object-fit: contain;
  background: var(--surface-2, var(--neutral-bg)); border-radius: 8px;
}
.mp-photo-fallback {
  width: 100%; height: 320px;
  background: var(--surface-2, var(--neutral-bg)); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-500, var(--neutral-fg));
}
.mp-photo-thumbs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.mp-photo-thumb {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 6px; cursor: pointer;
  border: 2px solid transparent;
}
.mp-photo-thumb.active { border-color: var(--brand-500, #16a34a); }
.mp-photo-thumb-fallback {
  width: 64px; height: 64px; background: var(--surface-2, var(--neutral-bg));
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: var(--ink-500, var(--neutral-fg)); font-size: 0.78em;
}
.mp-photo-nav {
  display: flex; justify-content: space-between;
  margin-top: 8px;
}
.mp-photo-counter {
  text-align: center; font-size: 0.85em;
  color: var(--ink-500, var(--neutral-fg));
}
.mp-toast {
  position: fixed; bottom: 16px; right: 16px;
  background: var(--surface, #fff); border: 1px solid var(--border, var(--neutral-bg));
  border-radius: 8px; padding: 10px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1); z-index: 5000;
}
.mp-bg-blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mp-blob {
  position: absolute; border-radius: 50%;
  filter: blur(40px); opacity: 0.4;
}
.mp-blob-1 { background: var(--brand-200, color-mix(in srgb, var(--ok-fg) 30%, transparent)); top: -10%; left: -10%; width: 400px; height: 400px; }
.mp-blob-2 { background: var(--gold-200, color-mix(in srgb, var(--warn-fg) 32%, transparent)); top: 40%; right: -10%; width: 350px; height: 350px; }
.mp-blob-3 { background: var(--brand-100, var(--ok-bg)); bottom: -10%; left: 30%; width: 300px; height: 300px; }
.mp-btn {
  background: var(--brand-700, #14532d); color: #fff;
  border: none; padding: 10px 16px; border-radius: 8px;
  cursor: pointer; font-weight: 600;
}
.mp-btn:hover { background: var(--brand-500, #16a34a); }

/* Certificates */
.cert-scaler {
  /* v1.8.2.66w.201: scale-to-fit wrapper. The cert is A4-sized
     (1122.6×793.7px at 96 DPI for landscape). On small screens we
     shrink it via CSS transform so the whole cert fits inside its
     parent without horizontal scroll. JS sets --cert-scale. */
  display: inline-block;
  transform: scale(var(--cert-scale, 1));
  transform-origin: top left;
}

/* v1.8.2.66w.201: the actual certificate surface.
   A4 dimensions (landscape = 297×210mm = 1122.6×793.7px @ 96 DPI;
   portrait = 210×297mm = 793.7×1122.6px). The card-wrap gives the
   cert its parchment-like background + outer border + box-shadow.
   Each template then tints the inner frame + decorations. */
.certificate-card-wrap {
  width: 1122.6px;
  height: 793.7px;
  position: relative;
  background: linear-gradient(135deg, #fbf6e8 0%, #f4ead0 100%);
  border: 2px solid #b88a2a;
  box-shadow:
    0 0 0 8px #fbf6e8 inset,
    0 0 0 10px #b88a2a inset,
    0 12px 40px rgba(10,30,26,0.18);
  overflow: hidden;
}
.orientation-landscape { /* default in .certificate-card-wrap */ }
.orientation-portrait {
  width: 793.7px;
  height: 1122.6px;
}
.certificate-preview {
  background: linear-gradient(135deg, #f8f5ee 0%, #f0e8d0 100%) !important;
  border-style: dashed !important;
}

/* v1.8.2.66w.221: bumped the cert frame border from 1px to 2px so it
   reads as a single, clearly-visible gold line on all four sides
   at A4 print size. 1px borders can render thinner than 1 device
   pixel depending on the printer/PDF renderer, which made the
   border look uneven (sometimes a hairline, sometimes invisible).
   2px is reliable across all rendering paths.

   The frame's cream parchment background is what previously gave
   the impression of a "double line" at the edge — the gradient
   transition at the very edge of the page was visible as a
   second contour. To fix that, the parchment gradient is now
   inset 2px (1px to avoid the visible 2px border, 1px breathing
   room) so the cream ends before the border, leaving the border
   as the ONLY visible line. */
.certificate-frame {
  position: absolute;
  inset: 12px;
  border: 2px solid #b88a2a;
  background: linear-gradient(135deg, #fffaef 0%, #fbf3da 100%);
  background-clip: padding-box;
  /* Subtle inset shadow makes the border look crisp even when the
     outer shadow gets clipped by the printable area. */
  box-shadow: inset 0 0 0 1px rgba(184, 138, 42, 0.25);
}
.certificate-frame-inner {
  position: absolute;
  inset: 14px;
  /* v1.8.2.66w.206: tighter padding (12mm vertical, 18mm horizontal)
     so the body+notes+footer+serial all fit on a single A4 landscape
     page without the "Issued by Hutt Valley Charitable Trust" line
     getting clipped at the bottom. Previous 18mm vertical left only
     ~625px usable after the inset; tight certs with notes overflowed
     that budget. 12mm gives ~700px usable — fits long notes + footer
     + serial without clipping. */
  padding: 12mm 18mm;
  display: flex;
  flex-direction: column;
}
/* v1.8.2.66w.124: portrait orientation uses larger bottom
   padding so the cert content doesn't crowd the bottom border, but
   we no longer apply `justify-content: space-between` — that
   created a big empty block in the middle of short-content certs
   (Sisters / Heritage) because the body flex-grow pushed the
   recipient to the vertical center of the frame while the header
   stayed at the top. With justify-content removed, all children
   stack naturally from the top. */
.orientation-portrait .certificate-frame-inner {
  padding: 16mm 18mm 24mm;
}

/* v1.8.2.66w.201: per-template tints.
   .template-classic = cream + gold serif (default — no overrides).
   .template-youth   = bright sky-blue + lime + rounded sans.
   .template-heritage = deep LHIC green + cream.
   .template-sisters  = soft blush pink + rose-gold + filigree. */
.template-classic {
  background: linear-gradient(135deg, #fbf6e8 0%, #f4ead0 100%) !important;
  border-color: #b88a2a !important;
}
.template-classic .certificate-frame {
  border-color: rgba(184, 138, 42, 0.55);
  background: linear-gradient(135deg, #fffaef 0%, #fbf3da 100%);
}
.template-classic .certificate-title,
.template-classic .certificate-recipient {
  color: #5a3d0f;
}
.template-youth {
  background: linear-gradient(135deg, #e8f4ff 0%, #c8e8f4 100%) !important;
  border-color: #2563eb !important;
}
.template-youth .certificate-frame {
  border-color: rgba(37, 99, 235, 0.5);
  background: linear-gradient(135deg, #f0f8ff 0%, #d8efff 100%);
}
.template-youth .certificate-title,
.template-youth .certificate-recipient {
  color: #1e3a8a;
  font-family: var(--font-display, "Inter"), -apple-system, sans-serif;
}
.template-youth .certificate-flourish-cell {
  color: #84cc16;
}
.template-heritage {
  background: linear-gradient(135deg, #d8e8d8 0%, #b8d4b8 100%) !important;
  border-color: #0e3a2f !important;
}
.template-heritage .certificate-frame {
  border-color: rgba(14, 58, 47, 0.5);
  background: linear-gradient(135deg, #e8f0e8 0%, #d0e0d0 100%);
}
.template-heritage .certificate-title,
.template-heritage .certificate-recipient {
  color: #0e3a2f;
}
.template-heritage .certificate-flourish-cell {
  color: #0e3a2f;
}
.template-sisters {
  background: linear-gradient(135deg, #fce7f3 0%, #f8d4e8 100%) !important;
  border-color: #b8895a !important;
}
.template-sisters .certificate-frame {
  border-color: rgba(184, 137, 90, 0.5);
  background: linear-gradient(135deg, #fdf2f8 0%, #f9d8ea 100%);
}
.template-sisters .certificate-title,
.template-sisters .certificate-recipient {
  color: #9d174d;
}
.template-sisters .certificate-flourish-cell {
  color: #b8895a;
}

/* v1.8.2.66w.201: the sisters-template decorative flower glyph. */
.certificate-sisters-flower {
  text-align: center;
  color: #b8895a;
  font-size: 2em;
  margin: 6px 0;
  opacity: 0.7;
}

.cert-table { width: 100%; border-collapse: collapse; }
.cert-table th, .cert-table td { padding: 10px; border-bottom: 1px solid var(--border, #e5e7eb); text-align: left; }
.cert-table th { background: var(--surface-2, #f9fafb); }

/* v1.8.2.66w.196: cert table scrolls horizontally on small viewports.
   Set a min-width so columns don't crush into each other, then wrap
   in a scrollable container so users can swipe sideways on mobile. */
@media (max-width: 900px) {
  .cert-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    min-width: 600px;
  }
  .cert-table th, .cert-table td {
    white-space: normal;
    max-width: 180px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  /* Truncate text in cells */
  .cert-table td {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* v1.8.2.66w.202: GENERIC admin responsive table → cards.
   Applies to every `<table>` inside admin containers at narrow
   viewports. The horizontal-scroll fallback (66w.196) hides action
   buttons at the right edge of the viewport, making them unreachable
   without swiping. This rule converts each row into a card with
   all cells stacked, action buttons at the bottom in a 2-col grid.

   Usage: just add `data-label="..."` to each `<td>` in admin tables.
   Cells WITHOUT data-label are treated as either action rows (if
   they contain buttons) or full-width value rows (otherwise). The
   rule handles the pattern generically — no need to write per-table
   CSS. */
@media (max-width: 700px) {
  /* v1.8.2.66w.254: tighter admin-main padding so the cards have
     more horizontal room on phones. The default desktop padding
     (32px each side = 64px) eats 16% of a 390px viewport. */
  .admin-main { padding: 1rem 12px; }

  /* v1.8.2.66w.202: override 66w.196 horizontal-scroll for any
     admin table so the card layout can take over. The cert table
     already has its own card layout from 66w.200, so we leave it.
     v1.8.2.66w.254: also include .data-table (used by AdminUsers
     review queue + AdminLegacy) — otherwise the 7-col queue table
     hides the Approve/Reject buttons off-screen on phones. */
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards),
  .admin-page table:not(.cert-table):not(.no-mobile-cards),
  .admin-pages table:not(.cert-table):not(.no-mobile-cards),
  .admin-team table:not(.cert-table):not(.no-mobile-cards),
  .data-table:not(.cert-table):not(.no-mobile-cards),
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards),
  .admin-table:not(.cert-table):not(.no-mobile-cards) {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    overflow-x: visible !important;
    white-space: normal !important;
  }
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) thead,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) thead,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) thead,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) thead,
  .data-table:not(.cert-table):not(.no-mobile-cards) thead,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) thead,
  .admin-table:not(.cert-table):not(.no-mobile-cards) thead {
    display: none;
  }
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tbody,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tbody,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tbody,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tbody,
  .data-table:not(.cert-table):not(.no-mobile-cards) tbody,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tbody,
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody {
  }
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tr,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tr,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tr,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tr,
  .data-table:not(.cert-table):not(.no-mobile-cards) tr,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tr,
  .admin-table:not(.cert-table):not(.no-mobile-cards) tr {
  }
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) td,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) td,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) td,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) td,
  .data-table:not(.cert-table):not(.no-mobile-cards) td,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) td,
  .admin-table:not(.cert-table):not(.no-mobile-cards) td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }
  /* Each tr = a card */
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tbody tr,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tbody tr,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tbody tr,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tbody tr,
  .data-table:not(.cert-table):not(.no-mobile-cards) tbody tr,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tbody tr,
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody tr {
    display: block; /* v1.8.2.66w.254: needed to take the TR out of
                       table-row layout so it becomes a card */
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(10,30,26,0.06);
    white-space: normal;
    /* v1.8.2.66w.254: TR is `display: block` so it doesn't auto-
       constrain to the table's width — it expands to fit content.
       Force the card to fill the table (which is 100% of its
       parent) and clip any overflow with border-box sizing. */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  /* Each td = a row inside the card */
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tbody td,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tbody td,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tbody td,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tbody td,
  .data-table:not(.cert-table):not(.no-mobile-cards) tbody td,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tbody td,
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0 !important;
    border: 0 !important;
    text-align: left !important;
    white-space: normal !important;
    /* v1.8.2.66w.254: min-width: 0 lets the flex children (the
       value text, the buttons) shrink past their natural content
       size instead of pushing the card wider than the viewport.
       Without this, a long email/IP value stretches the card
       right past 390px and clips the Reject button. word-break
       makes long emails wrap rather than overflow. */
    min-width: 0;
    word-break: break-word;
  }
  /* Label from data-label slot shown left, value right */
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tbody td[data-label]::before,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tbody td[data-label]::before,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tbody td[data-label]::before,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tbody td[data-label]::before,
  .data-table:not(.cert-table):not(.no-mobile-cards) tbody td[data-label]::before,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tbody td[data-label]::before,
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-500, #6b7280);
    font-weight: 600;
    padding-top: 2px;
    min-width: 88px;
  }
  /* Action cell (any cell with buttons — including cells WITH
     data-label like the review queue's Actions column) → 2-col
     grid at the bottom of the card so all buttons are visible.
     v1.8.2.66w.254: was `td:not([data-label])` only — missed the
     review queue's Actions cell which has data-label="Actions".
     Result was buttons rendered in the inline flex <div>, not a
     2-col grid, and the right button overflowed past the viewport.

     Switched from `display: grid` to `display: flex; flex-wrap: wrap`
     because Chromium was placing items in a 2-row layout even with
     `grid-template-columns: 1fr 1fr` (likely because the inner
     `display:contents` <div> confuses the grid auto-placement).
     Flexbox handles the inline-flex wrapper + 2 buttons cleanly. */
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button),
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button),
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button),
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button),
  .data-table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button),
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button),
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button) {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 10px !important;
    border-top: 1px solid var(--border, #e5e7eb) !important;
  }
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button) button,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button) button,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button) button,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button) button,
  .data-table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button) button,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button) button,
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody td:has(button) button {
    margin: 0 !important;
    padding: 0.55rem 0.4rem !important;
    font-size: 12px !important;
    /* v1.8.2.66w.254: `flex: 1 1 0` makes both buttons share the
       row equally. min-width:0 lets them shrink past their content
       so 2 buttons fit in a 392px card on a 390px viewport. */
    flex: 1 1 0;
    min-width: 0;
  }
  /* v1.8.2.66w.202: many admin tables wrap action buttons in an
     inline-styled <div style="display:flex; gap:…">. With the
     outer grid layout, that div would block the grid from seeing
     the buttons as direct children. Reset the div to
     `display: contents` so the buttons become direct grid items
     and wrap into the 2-col layout we want. !important beats
     inline `style="display:flex"` set in JSX.
     v1.8.2.66w.254: was `td:not([data-label]) > div` only —
     broadened to all tbody td > div so the review queue's
     Actions cell (data-label="Actions") gets the same treatment. */
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tbody td > div,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tbody td > div,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tbody td > div,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tbody td > div,
  .data-table:not(.cert-table):not(.no-mobile-cards) tbody td > div,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tbody td > div,
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody td > div {
    display: contents !important;
  }
  /* v1.8.2.66w.222: on the plots table, the action cell now
     renders both an Edit button and an optional Revert button.
     The Edit button is the only one mobile admins need (the edit
     drawer can change status); Revert is hidden on mobile to keep
     the 2-col button grid clean. */
  @media (max-width: 700px) {
    .plot-row-revert { display: none !important; }
  }
  /* Empty/blank cells with no content and no data-label → hide */
  .admin-inbox table:not(.cert-table):not(.no-mobile-cards) tbody td:not([data-label]):empty,
  .admin-page table:not(.cert-table):not(.no-mobile-cards) tbody td:not([data-label]):empty,
  .admin-pages table:not(.cert-table):not(.no-mobile-cards) tbody td:not([data-label]):empty,
  .admin-team table:not(.cert-table):not(.no-mobile-cards) tbody td:not([data-label]):empty,
  .data-table:not(.cert-table):not(.no-mobile-cards) tbody td:not([data-label]):empty,
  .admin-toolbar + table:not(.cert-table):not(.no-mobile-cards) tbody td:not([data-label]):empty,
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody td:not([data-label]):empty {
    display: none;
  }
}

/* v1.8.2.66w.200: responsive table → card layout for narrow viewports.
   On mobile the cert table has 8 columns — too wide for 390px even
   with horizontal scroll. The Actions column (View/Edit/Archive/
   Delete) is unreachable without scrolling. Instead, use the standard
   "responsive table" pattern: at narrow widths each row becomes a
   stacked card with the column name shown above each value via the
   `data-label` attribute. The card's border, padding, and gap give a
   clear "this is one row" feel without the wide scroll. The <thead>
   row is hidden on mobile (column names go into `data-label` slots).
   IMPORTANT: also override the 66w.196 `min-width: 600px` so the
   table itself sizes to its parent card instead of forcing a
   horizontal scroll at narrow viewports. */
@media (max-width: 700px) {
  .cert-table, .cert-table thead, .cert-table tbody,
  .cert-table tr, .cert-table td, .cert-table th {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .cert-table { overflow-x: visible !important; white-space: normal !important; }
  .cert-table thead { display: none; }
  .cert-table tbody tr {
    display: block;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(10,30,26,0.06);
    white-space: normal;
    min-width: 0;
  }
  .cert-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0 !important;
    border: 0 !important;
    text-align: left !important;
    white-space: normal !important;
    max-width: none !important;
  }
  /* Column label (from data-label) shown left, value right */
  .cert-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-500, #6b7280);
    font-weight: 600;
    padding-top: 2px;
    min-width: 88px;
  }
  /* Recipient row is the card title — bigger, full width */
  .cert-table tbody td[data-label="Recipient"] {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--green-900, #0e3a2f);
    padding-bottom: 4px !important;
    border-bottom: 1px dashed var(--border, #e5e7eb) !important;
    margin-bottom: 4px;
  }
  .cert-table tbody td[data-label="Recipient"]::before { display: none; }
  /* Actions row at the bottom of each card — buttons in a 2-column
     grid so all four action buttons are visible without scrolling. */
  .cert-table tbody td[data-label="Actions"] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
    padding-top: 10px !important;
    border-top: 1px solid var(--border, #e5e7eb) !important;
  }
  .cert-table tbody td[data-label="Actions"]::before { display: none; }
  .cert-table tbody td[data-label="Actions"] .btn {
    padding: 0.55rem 0.4rem;
    font-size: 12px;
    margin-right: 0 !important;
    width: 100%;
  }
  /* Contribution row — value gets full width so text wraps cleanly */
  .cert-table tbody td[data-label="Contribution"] {
    display: block;
    padding-left: 0 !important;
  }
  .cert-table tbody td[data-label="Contribution"]::before {
    display: block;
    margin-bottom: 2px;
  }
}
.certificate-modal {
  background: var(--surface, #fff); border-radius: 12px;
  width: 100%; max-width: 1100px; max-height: 92vh;
  overflow: auto; padding: 22px; margin: 40px 16px;
  position: relative;
}
.certificate-body {
  /* v1.8.2.66w.208 + 210: the body grows to fill the available
     space (flex: 1 1 auto) but content inside is aligned to the
     TOP with justify-content: flex-start. This keeps the content
     right below the header (no big gap) and lets the empty space
     accumulate at the BOTTOM of the body, before the footer. The
     cert visually looks balanced: header on top, content in the
     upper-middle, footer near the bottom. */
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 8px;
}
/* v1.8.2.66w.205: bigger logo on landscape A4 cert. The cert is
   1122.6×793.7px (landscape) — the previous 80×80 logo was only
   ~7% of the width, which looked small in the print. Landscape
   gets a 130px logo + 130px seal (~11.5% of width). Portrait
   keeps the smaller size since it's already proportional to
   its narrower body. */
/* v1.8.2.66w.213: header is now a centered trio (logo | title |
   star) rather than spanning the full cert width. Logo on the
   left, title in the middle, decorative star on the right — all
   centered together via `justify-content: center` and a tighter
   `gap`. Previously the flex layout pushed logo to the left edge
   and the flourish to the right edge, with the title stretched
   across the middle, making the trio feel disconnected. */
/* v1.8.2.66w.213: header is a centered trio (logo | title |
   star). Logo on the left, title in the middle, decorative star
   on the right — all centered together via `justify-content: center`.
   The trio naturally fills the cert width — that's the intended
   look for a single horizontal banner at the top of the cert. The
   title block uses `min-width: 0` so the flex layout correctly
   allocates space, and the natural content widths (logo width,
   title text width, star width) all line up as a balanced row. */
.certificate-header { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 0 auto 18px; }
.certificate-logo-cell { flex-shrink: 0; }
/* v1.8.2.66w.213: logo at 110px landscape / 90px portrait
   — sized to match the smaller star so the trio reads as a
   balanced group, not logo-dominant. */
.certificate-logo { width: 110px; height: 110px; object-fit: contain; }
.orientation-portrait .certificate-logo { width: 90px; height: 90px; }
.certificate-title-block { text-align: center; min-width: 0; flex: 0 0 auto; }
.certificate-eyebrow {
  font-size: 0.85em; letter-spacing: 0.1em;
  color: var(--ink-700, #444); text-transform: uppercase;
  margin-bottom: 4px;
}
.certificate-title {
  font-family: var(--serif, Georgia, serif);
  font-size: 1.8em; margin: 4px 0;
  color: var(--ink-900, #111);
}
.certificate-subtitle-line { color: var(--ink-700, #444); font-size: 0.9em; }
.certificate-flourish-cell { flex-shrink: 0; color: var(--gold-500, #d4a017); display: flex; align-items: center; justify-content: center; }
/* v1.8.2.66w.213: Sisters luxury 3D star at 110px landscape /
   90px portrait — same as the LH logo so the trio reads as a
   balanced group. */
.certificate-flourish-cell img.certificate-decor { width: 110px; height: 110px; object-fit: contain; }
.orientation-portrait .certificate-flourish-cell img.certificate-decor { width: 90px; height: 90px; }
.certificate-flourish-cell svg { width: 64px; height: 64px; }
.certificate-presented-to { font-size: 0.9em; color: var(--ink-700, #444); margin: 12px 0 4px; }
.certificate-recipient {
  font-family: var(--serif, Georgia, serif);
  font-size: 2em; text-align: center;
  color: var(--brand-700, #14532d);
  margin: 8px 0;
}
.certificate-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin: 12px 0; color: var(--gold-500, #d4a017);
}
.certificate-divider span {
  display: inline-block; width: 80px; height: 1px;
  background: currentColor;
}
.certificate-contribution { font-size: 0.95em; color: var(--ink-700, #444); margin: 6px 0; text-align: center; }
/* v1.8.2.66w.214: notes block is `position: relative` so the
   corner-bracket SVG can sit absolutely-positioned behind the
   text. The previous layout stacked the SVG ABOVE the notes
   (via `width: 100%; height: auto`), which left a big empty
   rectangle between the contribution line and the actual notes
   text. Now the brackets surround the notes text frame so they
   read as a decorative border, not a separate block. */
/* v1.8.2.66w.214: notes block is `position: relative` so the
   corner-bracket SVG can sit absolutely-positioned and act as
   a frame around the text. The previous layout stacked the
   SVG ABOVE the notes (via `width: 100%; height: auto`), which
   left a big empty rectangle between the contribution line and
   the actual notes text. Now the brackets surround the notes
   text frame so they read as a decorative border. */
.certificate-notes { margin-top: 10px; font-size: 0.85em; color: var(--ink-700, #444); line-height: 1.4; position: relative; padding: 14px 18px; }
.certificate-notes-label {
  font-weight: 700; margin-bottom: 6px;
  color: var(--brand-700, #14532d);
}
/* v1.8.2.66w.214: bracket SVG fills the entire notes block
   (inset 0) with `preserveAspectRatio: none` so the corner
   brackets sit at the four corners of the content area. No
   `z-index: -1` — the SVG sits BEFORE the text in DOM order
   so the text paints on top naturally. */
.certificate-notes-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.certificate-footer {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 18px; margin-top: 8px; align-items: end;
}
.certificate-footer-block { text-align: center; }
.certificate-footer-line {
  height: 1px; background: var(--ink-400, #9ca3af); margin-bottom: 4px;
}
.certificate-footer-name { font-family: var(--serif, Georgia, serif); font-weight: 700; }
.certificate-footer-label { font-size: 0.85em; color: var(--ink-700, #444); }
/* v1.8.2.66w.205: bigger seal on landscape. Mirrors the logo
   bump above. Landscape seal = 150px, portrait = 120px. */
.certificate-footer-seal { width: 150px; height: 150px; }
.orientation-portrait .certificate-footer-seal { width: 120px; height: 120px; }
.certificate-seal-image { width: 100%; height: 100%; object-fit: contain; }
/* v1.8.2.66w.206: tighter serial block so the cert fits without
   clipping. Previous margin-top: 16px + padding-top: 12px = 28px of
   gap before the serial number; reduced to 8px+6px = 14px. */
.certificate-serial {
  margin-top: 8px; padding-top: 6px;
  border-top: 1px solid var(--border, #e5e7eb);
  font-size: 0.85em; color: var(--ink-700, #444);
  text-align: center;
}
.certificate-issuer-line { font-size: 0.9em; margin-top: 4px; }
.certificate-decor { pointer-events: none; opacity: 0.7; }
/* v1.8.2.66w.213: legacy absolute positioning for `.certificate-decor-tr`
   is no longer used — the Sisters star is now part of the header flex
   row (`.certificate-flourish-cell > img.certificate-decor`). Kept as
   a no-op so any stale references don't break. */
.certificate-decor-tr { width: 0; height: 0; }

/* Status pills + badges */
.badge-gold {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--warn-bg); color: var(--warn-fg);
  font-size: 0.78em; font-weight: 600;
}
.badge-sold {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok-fg);
  font-size: 0.78em; font-weight: 600;
}

/* Forms */
.checkbox-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.optional-details { background: var(--surface-2, #f9fafb); border-radius: 8px; padding: 12px; margin: 12px 0; }
.optional-fields { color: var(--ink-600, #555); font-size: 0.85em; margin: 6px 0; }
.danger-btn {
  background: transparent; color: var(--danger, #c0392b);
  border: 1px solid var(--danger, #c0392b);
}
.danger-btn:hover { background: var(--danger, #c0392b); color: #fff; }

/* Misc */
.search-icon { color: var(--ink-500, #6b7280); }
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.cite { color: var(--ink-500, #6b7280); font-style: italic; font-size: 0.9em; }
.col-span-4 { grid-column: span 4; }
.cell-check { width: 1%; white-space: nowrap; }
.excerpt-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.role-col { width: 1%; white-space: nowrap; }
.role-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 6px;
}
.progress-meta { color: var(--ink-600, #555); font-size: 0.85em; }
.bank-csv-account {
  background: var(--surface-2, #f9fafb); border-radius: 8px;
  padding: 10px 14px; font-family: ui-monospace, monospace;
  font-size: 0.88em;
}
.donate-bank {
  background: var(--brand-50, #f0fdf4); border: 1px solid var(--brand-200, color-mix(in srgb, var(--ok-fg) 30%, transparent));
  border-radius: 10px; padding: 24px 16px 12px 16px; margin: 12px 0;
}
/* v1.8.2.66w.312: dark-mode contrast for the bank transfer panel.
   The hardcoded --brand-50 (#f0fdf4 light green) + the inherited
   body text were unreadable in dark mode (light text on light
   background = invisible). Override the card to a deep-green
   surface and switch the inner text/table-cell contrast to the
   dark-theme text tokens. */
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .donate-bank,
[data-theme="hc"]   .donate-bank {
  background: color-mix(in srgb, var(--green-100) 70%, var(--bg-card));
  border-color: var(--green-300);
  color: var(--text-primary);
}
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .donate-bank h2,
[data-theme="hc"]   .donate-bank h2 { color: var(--text-primary); }
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .donate-bank p,
[data-theme="hc"]   .donate-bank p { color: var(--text-secondary); }
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .donate-bank p.muted,
[data-theme="hc"]   .donate-bank p.muted { color: var(--text-muted); }
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .donate-bank .bank-table td,
[data-theme="hc"]   .donate-bank .bank-table td {
  background: color-mix(in srgb, var(--bg-card) 70%, var(--green-100));
  color: var(--text-primary);
  border-color: var(--ink-300);
}
:is([data-theme="dark"], [data-theme="midnight"], [data-theme$="-hc"]) .donate-bank .bank-table th,
[data-theme="hc"]   .donate-bank .bank-table th {
  background: var(--ink-100);
  color: var(--text-primary);
  border-color: var(--ink-300);
}
/* v1.8.2.66w.331.7: was gold-500 + white = 2.55:1. The .lhic-nav
   variant already used --accent-text; this standalone rule did not. */
.donate-nav {
  background: var(--gold-700, #8a6d24); color: var(--white, #fff);
  padding: 0.45rem 1rem; font-weight: 700;
  border-radius: 6px; text-decoration: none;
}
.donate-nav:hover {
  background: var(--gold-700, #b45309); color: var(--white, #fff);
}
.thread-body { padding: 8px 12px; background: var(--surface-2, #f9fafb); border-radius: 8px; margin: 6px 0; }
.from-name { font-weight: 600; }
.transfer-checkboxes { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }
.rbac-permissions { background: var(--surface-2, #f9fafb); border-radius: 10px; padding: 14px; }
.trust-list { display: flex; flex-direction: column; gap: 6px; }
.post-body { padding: 12px; background: var(--surface-2, #f9fafb); border-radius: 8px; }
.status-editor-pop-- { display: none !important; }
.status-new { background: var(--info-bg); color: var(--info-fg); }
.status-flagged { background: var(--warn-bg); color: var(--warn-fg); }
.status-closed { background: var(--neutral-bg); color: var(--neutral-fg); }
.status-archived { background: var(--neutral-bg); color: var(--neutral-fg); }
.receipt-picker-pop-- { display: none !important; }

/* Misc UI helpers */
.chip-count { background: var(--surface-2, #f3f4f6); padding: 1px 6px; border-radius: 999px; font-size: 0.78em; }
.chip-clear { background: transparent; border: none; cursor: pointer; color: var(--ink-500, #6b7280); padding: 2px 6px; }
.chip-sep { color: var(--ink-500, #6b7280); padding: 0 4px; }
.chip-memorial {
  background: var(--gold-50, #fef3c7); color: var(--gold-900, #78350f);
  padding: 2px 10px; border-radius: 999px; font-size: 0.78em;
}
.modal-bg {
  /* v1.8.2.66w.253: fix the expense-claim modals (ClaimDetailsModal
     + NewClaimModal) that use className="modal-bg". The previous
     CSS only set a background colour, so the modal rendered as a
     static block below the page content (invisible) — "View Details"
     appeared to do nothing. Add the missing fixed/centered overlay
     styles. We reuse the same recipe as .modal-backdrop but with the
     slightly darker rgba(0,0,0,0.55) tone that .modal-bg already
     had, so any existing modals that picked that tone still match. */
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

/* Pledge / components */
.component-ref { font-size: 0.85em; color: var(--ink-600, #555); }

/* Plot tooltip */
.plot-tooltip-detail { color: var(--ink-700, #444); font-size: 0.88em; }
.plot-tooltip-wall-name { font-weight: 600; }
.plot-tooltip-wall-msg { font-size: 0.85em; color: var(--ink-600, #555); margin-top: 4px; }

/* Expense / Receipt */
.exp-card {
  background: var(--surface, #fff); border: 1px solid var(--border, var(--neutral-bg));
  border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.exp-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.exp-card-amount { font-size: 1.4em; font-weight: 700; color: var(--brand-700, #14532d); }
.exp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.exp-card-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.exp-card-item-amt { font-weight: 600; }
.exp-card-item-desc { color: var(--ink-600, #555); font-size: 0.85em; }
.exp-card-items { display: flex; flex-direction: column; gap: 4px; }
.exp-card-progress { background: var(--surface-2, var(--neutral-bg)); border-radius: 6px; overflow: hidden; height: 6px; }
.exp-card-right { text-align: right; }
/* v1.8.2.66w.398: a claim title is free text and can be very long. On
   a grid card it must not push the amount column off the card, so it
   truncates with an ellipsis. The full text stays reachable through the
   `title` attribute the component sets on the same element. */
.exp-card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The title lives in a flex item of .exp-card-head. A flex item's
   default min-width:auto refuses to shrink below its content — which
   is precisely what stops the ellipsis from ever appearing. */
.exp-card-head > .exp-card-meta { min-width: 0; }
.exp-card-uid { font-size: 0.78em; color: var(--ink-500, var(--neutral-fg)); font-family: ui-monospace, monospace; }
.exp-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.exp-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2, var(--neutral-bg)); font-size: 0.78em; }
.exp-decline-note { background: var(--warn-bg); color: var(--warn-fg); padding: 10px 14px; border-radius: 8px; }
.exp-filter-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.exp-item-form { background: var(--surface-2, var(--bg-muted)); border-radius: 10px; padding: 14px; margin: 12px 0; }
.exp-items-head { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 8px 0; font-weight: 700; border-bottom: 1px solid var(--border); }
.exp-items-head-wide { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; padding: 8px 0; font-weight: 700; }
.exp-items-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 6px 0; align-items: center; }
.exp-items-row-wide { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; padding: 6px 0; align-items: center; }
.exp-items-table { background: var(--surface-2, var(--bg-muted)); border-radius: 10px; padding: 8px 12px; }
.exp-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.exp-overall-add { display: flex; gap: 8px; }
.exp-overall-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.exp-overall-name { font-weight: 600; }
.exp-overall-remove { background: transparent; border: 1px solid var(--danger, #c0392b); color: var(--danger, #c0392b); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.exp-overall-tile { background: var(--surface, #fff); border: 1px solid var(--border, var(--neutral-bg)); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.exp-overall-uploader { background: var(--surface-2, var(--bg-muted)); border-radius: 8px; padding: 12px; }
.exp-photo-carousel { position: relative; }
.exp-photo-large { width: 100%; max-height: 360px; object-fit: contain; background: var(--surface-2, var(--neutral-bg)); border-radius: 8px; }
.exp-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2, var(--neutral-bg)); font-size: 0.78em; }
.exp-progress-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-400, #9ca3af); }
.exp-progress-line { height: 2px; background: var(--border, var(--neutral-bg)); margin: 4px 0; }
.exp-progress-name { font-weight: 600; }
.exp-progress-num { font-size: 0.85em; color: var(--ink-500, var(--neutral-fg)); }
.exp-receipt-current { background: var(--brand-50, #f0fdf4); border: 1px solid var(--brand-200, color-mix(in srgb, var(--ok-fg) 30%, transparent)); border-radius: 10px; padding: 12px; }
.exp-receipt-empty { text-align: center; padding: 32px; color: var(--ink-500, var(--neutral-fg)); }
.exp-receipt-lib { display: flex; flex-direction: column; gap: 8px; }
.exp-receipt-lib-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.exp-receipt-lib-item { background: var(--surface, #fff); border: 1px solid var(--border, var(--neutral-bg)); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.exp-receipt-name { font-weight: 600; }
.exp-receipt-preflight { background: var(--surface-2, var(--warn-bg)); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.exp-receipt-row-thumb { display: flex; align-items: center; gap: 12px; }
.exp-receipt-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--surface-2, var(--neutral-bg)); }
.exp-receipt-uploader { background: var(--surface-2, var(--bg-muted)); border-radius: 10px; padding: 12px; }
.exp-reports-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.exp-self-approval-note { background: var(--warn-bg); color: var(--warn-fg); padding: 10px 14px; border-radius: 8px; }
.exp-status-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.78em; font-weight: 600;
}
.exp-stepper { background: var(--surface-2, var(--bg-muted)); border-radius: 10px; padding: 12px; }
.exp-stepper-body { padding: 8px 0; }
.exp-stepper-label { font-weight: 600; margin-bottom: 4px; }
.exp-stepper-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.exp-tab { background: transparent; border: none; padding: 6px 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.exp-tab.active { border-bottom-color: var(--brand-500, #16a34a); color: var(--brand-700, #14532d); }
.exp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border, var(--neutral-bg)); margin-bottom: 12px; }
.exp-thumb-btn { background: transparent; border: 1px solid var(--border, var(--neutral-bg)); border-radius: 6px; padding: 4px; cursor: pointer; }
.exp-toast {
  position: fixed; bottom: 16px; right: 16px;
  background: var(--surface, #fff); border: 1px solid var(--border, var(--neutral-bg));
  border-radius: 8px; padding: 10px 14px; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 5000;
}
.exp-totals { display: flex; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border, var(--neutral-bg)); }

/* v1.8.2.66w.398: the expense page had NO mobile breakpoint at all.
   The claim grid is `repeat(auto-fill, minmax(280px, 1fr))`, so on a
   360px phone the card padding ate most of the column and the item
   table (six columns: description, category, merchant, amount, GST,
   receipt) was squeezed until the receipt thumbnail was unusable.

   720px is the boundary the rest of the admin surface uses. */
@media (max-width: 720px) {
  .exp-grid, .exp-reports-grid, .exp-receipt-lib-grid { grid-template-columns: 1fr; }
  .exp-card { padding: 12px; }
  .exp-card-head { flex-wrap: wrap; }
  .exp-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .exp-tab { white-space: nowrap; }
  /* The item table has six columns. Re-gridding it on a phone means
     deciding what to hide, and anything hidden is data the approver
     needs to see. Make it scroll sideways instead. */
  .exp-items-table { overflow-x: auto; }
  .exp-items-row, .exp-items-head { min-width: 520px; }
  .exp-modal-actions { flex-wrap: wrap; }
  .exp-totals { flex-wrap: wrap; gap: 8px; }
}

/* Vision / footer */
/* v1.8.2.66w.371: was `var(--brand-900, #064e3b)` — --brand-900 is
   never defined, so this painted a FIXED deep green in every theme
   while the vision card around it inverted. On midnight that left
   dark text on a dark panel at 1.92:1.
   Using the green ramp makes the panel follow the theme like
   everything else, so --on-fill is then correct in all three. */
.vision-footer {
  background: var(--green-900); color: var(--on-fill);
  padding: 24px 16px; text-align: center; font-size: 0.88em;
}

/* Custom frequency */
.custom-frequency { margin-left: 8px; max-width: 120px; }

/* Status pills for various admin types */
.status-pill.status-suspended { background: var(--danger-bg); color: var(--danger-fg); }
.status-pill.status-expired { background: var(--neutral-bg); color: var(--neutral-fg); }



/* v1.8.2.66w.196: admin layout responsiveness for mobile. The admin
   sidebar is shown above the main content on small screens (the
   desktop two-pane layout collapses). Header items wrap. Tables
   scroll horizontally. Filter buttons wrap to multiple lines. */
@media (max-width: 900px) {
  /* Admin sidebar becomes a horizontal pill grid on mobile.
     Use 3 columns for tablet, 2 columns for narrow phones. */
  .admin-sidebar, .admin-nav, aside[class*='admin'] {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: var(--surface, #fff);
  }
  /* Tables scroll horizontally instead of overflowing viewport */
  table, .data-table-wrap, .cert-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  /* Admin header wraps */
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .admin-header-right {
    width: 100%;
    justify-content: space-between;
  }
  /* Admin page actions wrap to new lines */
  .admin-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  /* Form rows become stacked columns */
  .admin-edit-grid, .form-grid-2 {
    grid-template-columns: 1fr !important;
  }
  /* Filter chips wrap */
  .admin-filter-chips, .admin-inbox-tabs, .admin-filters {
    flex-wrap: wrap;
  }
  /* Stack inbox detail */
  .admin-inbox-detail {
    grid-template-columns: 1fr !important;
  }
  /* Stat summary cards stack */
  .studreg-summary {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* v1.8.2.66w.196: cards containing tables allow horizontal scroll
   on mobile so cells don't overflow viewport. */
@media (max-width: 900px) {
  .card:has(> .cert-table),
  .card:has(> table):not(.donate-bank) {
    padding: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* v1.8.2.66w.246: event registration (public + admin) styles */
.events-page .page-hero h1 { font-size: 2rem; }
.events-signin-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 1rem;
  padding: 14px 18px;
}
.events-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.event-card { padding: 0; overflow: hidden; }
.event-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-900) 100%);
  color: var(--on-fill);
  flex-wrap: wrap;
}
.event-card-header h2 { margin: 0; font-size: 1.35rem; }
.event-card-header .event-date {
  margin: 4px 0 0;
  opacity: 0.85;
  font-size: 0.9rem;
}
.event-card-header .event-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.event-meta-pill {
  background: rgba(255,255,255,0.15);
  color: var(--on-fill);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}
.event-description {
  padding: 14px 22px 0;
  margin: 0;
  color: var(--text-secondary, #4a5a4a);
}
.event-my-badge {
  margin: 12px 22px 0;
  padding: 10px 14px;
  background: var(--ok-bg);
  color: var(--ok-fg);
  border-radius: 8px;
  font-weight: 600;
  border-left: 4px solid var(--ok-fg);
}
.event-slots { padding: 14px 22px 22px; }
.slot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.slot-table thead th {
  background: var(--surface-2, #fafaf3);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e8e6dd);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #6b7b6b);
}
.slot-table thead th.num { text-align: right; }
.slot-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border, #ece9df);
}
.slot-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
.slot-table tbody tr:last-child td { border-bottom: none; }
.slot-table tr.slot-mine { background: var(--ok-bg); }
.slot-table tr.slot-mine:hover { background: var(--ok-bg); }
.event-totals { margin: 12px 0 0; text-align: right; }
.status-pill-full    { background: var(--danger-bg); color: var(--danger-fg); }
.status-pill-tight   { background: var(--warn-bg); color: var(--warn-fg); }
.status-pill-open    { background: var(--ok-bg); color: var(--ok-fg); }
.status-pill-attended { background: var(--ok-bg); color: var(--ok-fg); }
.status-pill-archived{ background: var(--neutral-bg); color: var(--neutral-fg); }
.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* v1.8.2.66w.246: admin events page */
.admin-events-page .admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.event-date-group { padding: 14px 18px; border-bottom: 1px solid var(--border, #ece9df); }
.event-date-group:last-child { border-bottom: none; }
.event-date-title {
  font-size: 1.1rem;
  color: var(--text-primary, #1a2e1a);
  margin: 0 0 10px;
}
.archived-row td { opacity: 0.55; }
.modal-wide { max-width: 900px; }

/* v1.8.2.66w.247: PDF button busy state. Donor clicks "📄 Pledge form"
   or "🏅 Certificate", the fetch + Chromium render takes 1-3s —
   without feedback the donor thought the click didn't register.
   Inline spinner in the button + status line under the row shows
   the current phase (Fetch → Render → Open) so a long render
   doesn't feel broken. */
.btn-spinner-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,0,0,0.15);
  border-top-color: var(--green-700, #1a5d3a);
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}
button[disabled] {
  cursor: not-allowed;
  opacity: 0.85;
}
.pledge-pdf-status {
  margin-top: 6px;
  width: 100%;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ok-bg);
  color: var(--ok-fg);
  border-left: 3px solid var(--ok-fg);
}
.pledge-pdf-status.is-busy { animation: pdf-status-pulse 1.5s ease-in-out infinite; }
.pledge-pdf-status.is-error {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-left-color: var(--danger);
  animation: none;
}
@keyframes pdf-status-pulse {
  0%, 100% { opacity: 0.95; }
  50% { opacity: 0.65; }
}

/* ========================================================================
   v1.8.2.66w.296 — Intro splash screen
   Full-bleed night photo of the new minaret, gentle Ken Burns drift,
   gold copy, fade-out. Shown once per session before the home page.
   ======================================================================== */
.lhic-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  background: #060b16;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.65s ease, visibility 0.65s;
  /* iOS-safe full viewport */
  height: 100vh;
  height: 100dvh;
}
.lhic-splash-out { opacity: 0; visibility: hidden; pointer-events: none; }

/* Background photo — drifts slowly (Ken Burns) */
.lhic-splash-bg {
  position: absolute;
  inset: 0;
  display: block;
}
.lhic-splash-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  animation: lhic-splash-drift 14s ease-out forwards;
  will-change: transform;
}
@keyframes lhic-splash-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.10) translate3d(0, -1.2%, 0); }
}

/* Bottom-left scrim so the copy stays legible over the bright stone */
.lhic-splash-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(4, 10, 8, 0.86) 0%, rgba(4, 10, 8, 0.34) 38%, rgba(4, 10, 8, 0) 62%),
    linear-gradient(to right, rgba(4, 10, 8, 0.62) 0%, rgba(4, 10, 8, 0) 58%);
  pointer-events: none;
}

/* Copy block */
.lhic-splash-copy {
  position: absolute;
  left: clamp(20px, 6vw, 84px);
  right: clamp(20px, 6vw, 84px);
  bottom: clamp(56px, 14vh, 132px);
  color: #f6f1e4;
  animation: lhic-splash-rise 1.05s cubic-bezier(.22,.9,.3,1) 0.22s backwards;
  pointer-events: none;
}
@keyframes lhic-splash-rise {
  from { opacity: 0; transform: translate3d(0, 22px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.lhic-splash-rule {
  display: block;
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #d8b45a 0%, #f0dca0 100%);
  box-shadow: 0 0 14px rgba(216, 180, 90, 0.55);
  margin-bottom: 16px;
}
.lhic-splash-name {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2rem, 6.2vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: #fdfaf3;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.5);
}
.lhic-splash-tagline {
  margin: 0.65rem 0 0;
  font-size: clamp(0.98rem, 2.1vw, 1.3rem);
  line-height: 1.45;
  font-weight: 400;
  color: rgba(246, 241, 228, 0.93);
  max-width: 44ch;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.55);
}
.lhic-splash-arabic {
  display: block;
  margin-top: 1.1rem;
  font-family: 'Amiri', 'Noto Naskh Arabic', 'Segoe UI', serif;
  font-size: clamp(1.1rem, 2.6vw, 1.6rem);
  color: rgba(240, 220, 160, 0.9);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6);
  direction: rtl;
  /* Arabic is cursive — letter-spacing breaks the joining forms and
     letter-spacing is inherited from .lhic-splash. Reset it. */
  letter-spacing: normal;
  text-align: left;
  unicode-bidi: isolate;
}

/* Skip button */
.lhic-splash-skip {
  position: absolute;
  top: clamp(14px, 3vh, 26px);
  right: clamp(14px, 3vw, 26px);
  z-index: 2;
  appearance: none;
  border: 1px solid rgba(246, 241, 228, 0.42);
  background: rgba(10, 18, 14, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f6f1e4;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.lhic-splash-skip:hover {
  background: rgba(10, 18, 14, 0.7);
  border-color: rgba(246, 241, 228, 0.7);
  transform: translateY(-1px);
}
.lhic-splash-skip:focus-visible {
  outline: 2px solid #d8b45a;
  outline-offset: 2px;
}

/* Phones: copy sits a little higher, photo centred on the minaret */
@media (max-width: 820px) {
  .lhic-splash-bg img { object-position: center 34%; }
  .lhic-splash-copy { bottom: clamp(48px, 11vh, 96px); }
}

/* Landscape phones: avoid the copy colliding with the skip button */
@media (max-height: 480px) {
  .lhic-splash-name { font-size: clamp(1.5rem, 5vw, 2.1rem); }
  .lhic-splash-tagline { font-size: 0.92rem; max-width: 38ch; }
  .lhic-splash-arabic { display: none; }
  .lhic-splash-copy { bottom: 32px; }
}

/* Accessibility: no drift, no rise animation */
@media (prefers-reduced-motion: reduce) {
  .lhic-splash-bg img,
  .lhic-splash-copy { animation: none !important; }
  .lhic-splash-bg img { transform: scale(1.02); }
  .lhic-splash { transition: opacity 0.25s linear, visibility 0.25s; }
}

/* ===========================================================
   v1.8.2.66w.298 — End User Agreement modal + gate
   --------------------------------------------------------- */

/* Inline gate on the register form */
.agreement-gate {
  border: 1px solid var(--c-border, #d4d4d0);
  border-radius: 8px;
  padding: 0.9rem 1rem 1rem;
  margin: 0.5rem 0 0.25rem;
  background: var(--c-card, #fafaf7);
}
/* v1.8.2.66w.298b: heading inside the gate replaces <legend>.
   iOS Safari renders <legend> outside the fieldset border with
   a visible gap; an h3 inside the div keeps the heading visually
   attached to the box on every browser. */
.agreement-gate-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
  padding: 0;
  color: var(--c-text, #1a1a1a);
  line-height: 1.25;
}
.agreement-hint { margin: 0 0 0.65rem; }
.agreement-row { display: flex; flex-direction: column; gap: 0.65rem; }
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.45;
  font-size: 0.95rem;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  margin: 0;
  margin-top: 0.18rem;
  width: 20px; height: 20px;
  min-width: 20px; min-height: 20px;
  flex-shrink: 0;
  accent-color: var(--c-primary, #8a6d3b);
  /* iOS Safari: use -apple-system-properties to nudge the
     default checkbox to render at the declared size rather
     than the platform default 22×22 with extra padding. */
  -webkit-appearance: checkbox;
  transform: scale(1);
}
.checkbox-row input[type="checkbox"][disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}
.consent-row { color: var(--c-text, #1a1a1a); }
.marketing-row { color: var(--c-text-muted, #555); font-size: 0.9rem; }

/* The link-button inside the consent row must look like text, not a button */
.consent-row .btn-link {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--c-primary, #8a6d3b);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}
.consent-row .btn-link:hover { color: var(--c-primary-d, #6a5226); }

/* Modal — generic backdrop, reusable for future modals */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 15, 15, 0.55);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: modal-fade 0.18s ease-out;
}
@keyframes modal-fade { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  background: var(--c-card, #ffffff);
  border-radius: 10px;
  width: min(820px, 100%);
  max-height: min(88vh, 760px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28), 0 4px 10px rgba(0,0,0,0.12);
  animation: modal-pop 0.22s cubic-bezier(.2,.8,.4,1.05);
}
@keyframes modal-pop { from { transform: translateY(8px) scale(0.98); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--c-border, #e3e3e0);
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-x {
  background: none; border: none; font-size: 1.3rem; line-height: 1;
  color: var(--c-text-muted, #555);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}
.modal-x:hover { background: var(--c-border-soft, #f1f1ec); color: var(--c-text, #1a1a1a); }
.modal-meta {
  display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  color: var(--c-text-muted, #555);
  background: var(--c-bg-soft, #fafaf7);
  border-bottom: 1px solid var(--c-border, #e3e3e0);
}
.modal-foot {
  display: flex; justify-content: flex-end; gap: 0.6rem;
  padding: 0.8rem 1.1rem;
  border-top: 1px solid var(--c-border, #e3e3e0);
  background: var(--c-bg-soft, #fafaf7);
  border-radius: 0 0 10px 10px;
}

/* Agreement-specific: scroll container fills the middle */
.agreement-modal .agreement-scroll {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;        /* allow flex to shrink */
  padding: 1.1rem 1.4rem;
  /* No smooth scroll — programmatic tests need to fire `scroll`
     synchronously. We still get nice UX because the agree button
     fades in once the user has read. */
}
.agreement-modal .agreement-body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--c-text, #1a1a1a);
}
.agreement-modal .agreement-body h2 {
  font-size: 1.05rem;
  margin: 1.4rem 0 0.5rem;
  color: var(--c-primary, #8a6d3b);
  border-bottom: 1px solid var(--c-border, #e3e3e0);
  padding-bottom: 0.3rem;
}
.agreement-modal .agreement-body h2:first-child { margin-top: 0; }
.agreement-modal .agreement-body p,
.agreement-modal .agreement-body li { margin: 0 0 0.55rem; }
.agreement-modal .agreement-body ol,
.agreement-modal .agreement-body ul { padding-left: 1.4rem; }
.agreement-modal .agreement-body a { color: var(--c-primary, #8a6d3b); }
.agreement-modal .agreement-body em { color: var(--c-text-muted, #555); }
.agreement-modal .agreement-body strong { color: var(--c-text, #1a1a1a); }
.agreement-modal .agreement-body hr { border: 0; border-top: 1px solid var(--c-border, #e3e3e0); margin: 1.2rem 0; }

/* Mobile tweaks */
@media (max-width: 600px) {
  .modal-card { max-height: 95vh; border-radius: 8px 8px 0 0; align-self: flex-end; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .agreement-modal .agreement-body { font-size: 0.88rem; }
  .modal-head h2 { font-size: 1.05rem; }
}

/* ===========================================================
   v1.8.2.66w.299 — Marketing preferences (Account dashboard)
   --------------------------------------------------------- */

.marketing-pref {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.marketing-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.45;
  font-size: 0.95rem;
  cursor: pointer;
}
.marketing-row input[type="checkbox"] {
  margin: 0.18rem 0 0;
  width: 20px; height: 20px;
  min-width: 20px; min-height: 20px;
  flex-shrink: 0;
  accent-color: var(--c-primary, #8a6d3b);
}

/* ══════════════════════════════════════════════════════════════════
   v1.8.2.66w.332 — RTL (Arabic) support.

   Scoped to [dir="rtl"] so LTR locales (en-NZ, tr) are untouched.
   This is a FOUNDATION, not a complete mirroring: it handles the
   layout-level flips that a hand-written stylesheet gets wrong
   (text alignment, logical padding, icon direction, shadows). Any
   component that hardcodes `left`/`right` rather than logical
   properties will still need a targeted override.
   ══════════════════════════════════════════════════════════════ */

[dir="rtl"] {
  text-align: right;
}

/* Arabic type needs more line height — the descenders and diacritics
   collide at Latin leading. */
[dir="rtl"] body {
  line-height: 1.75;
}

/* Forms: caret and text flow follow direction automatically, but
   the placeholder inherits the LTR default in some engines. */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
  direction: rtl;
}

/* Place a Latin-script value (email, bank reference, phone) inside
   an Arabic sentence without mangling its direction. */
[dir="rtl"] .ltr-value,
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] .mono-value {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}

/* Numerals stay Latin (ar-u-nu-latn) — keep them left-to-right and
   tabular so amounts line up in tables. */
[dir="rtl"] .amount,
[dir="rtl"] .price,
[dir="rtl"] .num,
[dir="rtl"] td.numeric,
[dir="rtl"] .plot-num {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

/* Directional icons and chevrons must mirror. */
[dir="rtl"] .icon-arrow,
[dir="rtl"] .chevron,
[dir="rtl"] .nav-next {
  transform: scaleX(-1);
}

/* Box shadows and gradients are physical, not logical. */
[dir="rtl"] .card,
[dir="rtl"] .btn,
[dir="rtl"] input,
[dir="rtl"] .card {
  box-shadow: var(--shadow-inset);
}

/* Tables read better with the action column on the left in RTL. */
[dir="rtl"] .admin-table th,
[dir="rtl"] .admin-table td {
  text-align: right;
}

/* The stacked-table-to-card layout (≤700px) uses a data-label
   pseudo-element; in RTL that label belongs on the right. */
@media (max-width: 700px) {
  [dir="rtl"] td::before {
    text-align: right;
  }
}

/* The language switcher itself must not be mirrored. */
.lang-switcher { direction: ltr; display: inline-flex; min-width: 0; max-width: 100%; }
.lang-switcher-select {
  font-family: var(--font-sans);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  /* v1.8.2.66w.332: a <select> has no intrinsic max width — it grows
     to fit its longest option, so "العربية" at 18px+ overflowed a 390px
     header. Cap it and let the text ellipsis. */
  max-width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
}
.lang-switcher-select:focus-visible {
  outline: 2px solid var(--green-500);
  outline-offset: 2px;
}

/* v1.8.2.66w.332: last-resort guard. If any future control is wider
   than the viewport at a large text size, clip it at the header
   rather than letting it push the page sideways. */
.lhic-header, .lhic-nav, .lhic-nav .right { max-width: 100%; }

/* v1.8.2.66w.332: at large text zoom the "✕ Close" button could push
   past the viewport in the mobile menu's top bar. */
.lhic-nav-topbar { flex-wrap: wrap; min-width: 0; }
.lhic-nav-close { max-width: 100%; }

/* v1.8.2.66w.332: at large text zoom the "✕ Close" button could push
   past the viewport in the mobile menu's top bar. */
.lhic-nav-topbar { flex-wrap: wrap; min-width: 0; }
.lhic-nav-close { max-width: 100%; }

/* v1.8.2.66w.332: at large text zoom the "✕ Close" button could push
   past the viewport in the mobile menu's top bar. */
.lhic-nav-topbar { flex-wrap: wrap; min-width: 0; }
.lhic-nav-close { max-width: 100%; }

/* ══════════════════════════════════════════════════════════════════
   v1.8.2.66w.332 — tables that must scroll, not push the page.

   `.home-prayer-card` and `.donate-bank` are grid/flex items. A flex or
   grid item defaults to `min-width: auto`, which means it grows to fit
   its widest child instead of shrinking — so `overflow-x: auto` on it
   alone never engages, and at 175%+ text zoom the prayer-times table
   widened the whole document.

   `min-width: 0` is what actually lets the container shrink so the
   inner scrollbar can take over.
   ══════════════════════════════════════════════════════════════ */
.home-prayer-card,
.donate-bank {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.home-prayer-card > *,
.donate-bank > * { min-width: 0; }

/* v1.8.2.66w.332: same treatment for the donate cards — at 175%+ text
   zoom on a 320–390px screen they are grid items whose long
   paragraphs exceed the column. Contain them rather than letting
   them widen the document. */
.donate-content,
.donate-facts,
.donate-trust,
.donate-bank {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* ══════════════════════════════════════════════════════════════════
   v1.8.2.66w.332 — mobile header language control.

   The desktop switcher sits inside `.lhic-nav`, which is
   `display: none` until the drawer opens. That left phones with no
   reachable language control at all. This puts a compact one in the
   collapsed header, and hides it above 900px so the desktop header
   keeps exactly one.
   ══════════════════════════════════════════════════════════════ */
.lhic-header-lang { display: none; }

@media (max-width: 900px) {
  .lhic-header-lang {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-inline-start: auto;   /* sits between brand and ☰ */
    min-width: 0;
    max-width: 45vw;
  }
  .lhic-header-lang .lang-switcher-select {
    /* icon-sized so it never crowds the brand or the hamburger */
    max-width: 6.5rem;
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
  }
}

/* Keep the collapsed header from crowding at very large text zoom. */
@media (max-width: 900px) {
  .lhic-header { flex-wrap: nowrap; min-width: 0; }
  .lhic-brand { min-width: 0; }
  .lhic-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* v1.8.2.66w.357: route-chunk loading skeleton.
   Shown by <Suspense fallback> while a lazy()'d page chunk downloads.
   The Header, footer and Bismillah strip are already mounted, so the
   donor keeps the real shell — only the body is briefly empty.
   Shimmer is a gradient, not an animation library. */
.page-loading-skeleton {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1.25rem;
}
/* v1.8.2.66w.398: the shimmer used to be welded to the container above
   — the gradient, the line heights and the card height were all scoped
   to `.page-loading-skeleton`, so no other component could reuse it.
   The expense page therefore had nowhere to go and fell back to a bare
   "Loading…" paragraph.

   Split it in two: `.lhic-skeleton` is the shimmer primitive, and
   `.page-loading-skeleton` keeps the container layout but is now built
   from the same primitive. One shimmer, two shapes. */
.lhic-skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--surface-2, #f3f4f6) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: lhic-skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}
.lhic-skeleton-line { height: 14px; }
.lhic-skeleton-line-lg { height: 30px; width: 60%; }
.lhic-skeleton-card { height: 110px; }
@keyframes lhic-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* The `skeleton-line` / `skeleton-card` class names are kept (App.tsx
   uses them) but they now carry only the SIZE and the spacing — the
   gradient and the animation come from `.lhic-skeleton`. */
.page-loading-skeleton .skeleton-line { height: 14px; margin-bottom: 12px; }
.page-loading-skeleton .skeleton-line-lg { height: 30px; width: 60%; margin-bottom: 20px; }
.page-loading-skeleton .skeleton-card { height: 110px; margin-top: 20px; }
/* Respect reduced-motion: hold still rather than shimmer. */
@media (prefers-reduced-motion: reduce) {
  .lhic-skeleton { animation: none; }
}

/* v1.8.2.66w.358: first-paint holder while the i18n bundle loads.
   Deliberately invisible — it only exists so nothing paints raw
   translation keys before the strings arrive. */
.i18n-boot { min-height: 100vh; }

/* ==========================================================
   v1.8.2.66w.362 — News & Events tab strip
   ----------------------------------------------------------
   Horizontal tablist at the top of /updates. Sits above the page
   content in normal flow (NOT a nav flyout) so it behaves the
   same on touch and desktop.

   All directional rules use LOGICAL properties — never left/right.
   The active indicator is anchored with inset-inline-start so it
   mirrors in RTL. This is the 66w.333 lesson: a row-axis idiom
   applied in an RTL context puts content in the wrong place. */
.updates-tabs {
  display: flex;
  gap: 4px;
  max-width: 720px;
  margin: 1.5rem auto 0;
  padding: 0 1rem;
  border-bottom: 2px solid var(--border, #e2e5e4);
}
.updates-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  /* Pull the tab down so the active underline sits ON the rule
     rather than nudging the strip taller when it activates. */
  margin-bottom: -2px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
}
.updates-tab:hover { color: var(--text-primary); background: var(--bg-muted); }
.updates-tab:focus-visible {
  outline: 2px solid var(--green-700, #155a48);
  outline-offset: -2px;
}
.updates-tab.is-active {
  color: var(--green-900, #0e3a2f);
  border-bottom-color: var(--green-700, #155a48);
}
/* The strip must never itself be the overflow source on a narrow
   phone — let the two short labels sit side by side instead. */
@media (max-width: 420px) {
  .updates-tab { padding: 0.65rem 0.7rem; }
}

/* ==========================================================
   v1.8.2.66w.369 — Urdu typography
   ----------------------------------------------------------
   Urdu is Arabic script and RTL (so the layout side came free from
   the 25 generic [dir="rtl"] rules), but it is NOT Arabic script
   style. Amiri is Naskh; Urdu is written Nastaliq. Setting Urdu in
   Naskh is the single most visible way to tell a reader the site
   was machine-translated without understanding the language.

   Font is declared with a `urdu`-scoped family name so it is only
   FETCHED when :lang(ur) content is on screen. An English or
   Arabic page never downloads these 660 KB.

   Nastaliq also has far taller ascenders and descenders than
   Naskh, and its glyphs sit below the baseline. Line-height and a
   little vertical padding are required or adjacent lines collide
   — Nastaliq at 1.5 line-height overlaps visibly. */
@font-face {
  font-family: "NotoNastaliqUrdu";
  src: url("/fonts/NotoNastaliqUrdu.woff2") format("woff2");
  /* 400 = the static instance. The full variable face is 660 KB and
     the weight axis is not used anywhere on this site. */
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Body copy. Line-height 2.1 (vs the Naskh default of ~1.5) gives
   the diagonal strokes room; without it, descenders of one line
   touch the ascenders of the next. */
/* NOT wrapped in :where(). :where() has ZERO specificity, so a plain
   `body { font-family: ... }` rule beat it and <body> itself kept the
   system font — every descendant inherited Nastaliq anyway, which
   hid the bug until something else set a font. Real selectors,
   real specificity, so this reliably wins. */
html[lang="ur"],
html[lang="ur"] * {
  font-family: var(--font-urdu);
  line-height: 2.1;
}

/* The big display moments need MORE room, not less — the Bismillah
   strip, headings and the page title all sit at large sizes where
   Nastaliq's vertical extent scales up. */
html[lang="ur"] .bismillah-strip,
html[lang="ur"] .bismillah-strip .ar {
  font-family: var(--font-urdu);
  line-height: 2.4;
  font-size: 1.25rem;
}
html[lang="ur"] h1,
html[lang="ur"] h2,
html[lang="ur"] .page-hero h1 {
  font-family: var(--font-urdu);
  line-height: 1.9;
}
html[lang="ur"] .page-hero p,
html[lang="ur"] .muted,
html[lang="ur"] .stat-value,
html[lang="ur"] .price {
  line-height: 2.1;
}
/* Buttons and pills: Nastaliq needs a little more height to not
   look cramped inside a fixed-height control. */
html[lang="ur"] .btn,
html[lang="ur"] .zone-btn,
html[lang="ur"] .updates-tab,
html[lang="ur"] .view-pill {
  line-height: 2;
}
/* Keep the digits and any Latin (bank references, plot numbers)
   in the Latin face so they stay upright and aligned. */
html[lang="ur"] .ltr-value,
html[lang="ur"] .amount,
html[lang="ur"] .num,
html[lang="ur"] .plot-num {
  font-family: var(--font-arabic), "Amiri", sans-serif;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   v1.8.2.66w.372 — COMMUNITY ARTICLES
   ----------------------------------------------------------
   docs/FEATURE-community-articles.md §9.5.

   THE CLASS GOES ON THE CONTAINER, NEVER ON THE DONOR'S HTML.
   The donor's article body is sanitised server-side and the
   sanitiser strips `class` and `id` from it (that is what makes
   the HTML safe to inject). So every rule below is an ELEMENT
   selector scoped to `.article-body` — there is no way for the
   author's markup to name a class, and no way for it to borrow
   one of ours.

   The same rule is why the donor's <ul> stays a bullet list:
   Quill writes the list type into `data-list`, not into a class
   or a tag (§3.11), so the sanitiser's allowlist keeps
   `data-list` on the <li> and the marker survives. Styling is
   therefore by element, exactly as Quill's own stylesheet does
   it.

   No hex literals below — every colour is a theme token, so the
   block follows the light / dark / high-contrast themes like the
   rest of the site.
   ========================================================== */

/* ----- Public listing (#/articles) ----- */
.articles-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.15rem 1.25rem;
  text-align: start;
}
.article-card h3 {
  margin: 0;
  font-size: var(--fs-lg);
  line-height: 1.3;
}
.article-card h3 a { color: var(--text-primary); }
.article-card h3 a:hover { color: var(--link-hover); }
.article-card-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  /* The summary is the donor's own words; clamp it so one long
     paragraph cannot blow the card out of the grid. */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-meta {
  margin: auto 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.article-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.article-badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.article-badge-featured {
  background: var(--gold-100);
  color: var(--gold-text);
  border-color: var(--gold-300);
}
.article-read-more {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--link);
}
.articles-pager {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1.5rem;
}

/* ----- Public article page (#/articles/:slug) ----- */
.article-view {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.article-view-head h1 { margin-bottom: 0.35rem; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.article-summary {
  margin: 0;
  padding: 1rem 1.15rem;
  border-inline-start: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.65;
}
.article-pdf {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.article-pdf-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: var(--fs-base);
}
.article-pdf-frame {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--bg-muted);
}
.article-pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ----- The donor's own article body (sanitised HTML) -----
   Everything below is selected BY ELEMENT inside .article-body.
   The donor's HTML carries no class and no id, so this is the
   only hook there is. */
.article-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-1);
  color: var(--text-primary);
  font-size: 1.02rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}
.article-body > *:first-child { margin-top: 0; }
.article-body > *:last-child { margin-bottom: 0; }
.article-body h2 {
  margin: 1.75rem 0 0.6rem;
  font-size: var(--fs-xl);
  line-height: 1.3;
  color: var(--text-primary);
}
.article-body h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: var(--fs-lg);
  line-height: 1.35;
  color: var(--text-primary);
}
.article-body p { margin: 0.9rem 0; }
.article-body ul,
.article-body ol {
  margin: 0.9rem 0;
  padding-inline-start: 1.6rem;
}
.article-body li { margin: 0.35rem 0; }
.article-body li > ul,
.article-body li > ol { margin: 0.35rem 0; }
.article-body blockquote {
  margin: 1.1rem 0;
  padding: 0.65rem 1.1rem;
  border-inline-start: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-style: italic;
}
.article-body blockquote p { margin: 0.35rem 0; }
.article-body pre {
  margin: 1.1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}
.article-body code {
  font-family: 'Menlo', 'Monaco', monospace;
  font-size: 0.92em;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.08em 0.35em;
}
.article-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
}
.article-body figure {
  margin: 1.25rem 0;
}
.article-body figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.article-body figcaption {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.article-body table {
  width: 100%;
  margin: 1.1rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: start;
  vertical-align: top;
}
.article-body th {
  background: var(--bg-muted);
  color: var(--text-primary);
  font-weight: 700;
}
.article-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:hover { color: var(--link-hover); }
.article-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}
.article-body strong { color: var(--text-primary); }

/* ----- Admin: revision diff ----- */
.article-diff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.6rem 0;
}
.article-diff-col {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  overflow: hidden;
}
.article-diff-col h4 {
  margin: 0;
  padding: 0.45rem 0.7rem;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.article-diff-body {
  margin: 0;
  padding: 0.6rem 0.7rem;
  max-height: 320px;
  overflow: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.article-diff-line {
  display: block;
  padding: 0 0.25rem;
  border-radius: 3px;
}
.article-diff-add { background: var(--ok-bg); color: var(--ok-fg); }
.article-diff-del { background: var(--danger-bg); color: var(--danger-fg); }
.article-diff-same { color: var(--text-secondary); }
.article-field-change {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0.35rem 0;
}
.article-field-change del { color: var(--danger-fg); }
.article-field-change ins { color: var(--ok-fg); text-decoration: none; }

@media (max-width: 700px) {
  .article-diff { grid-template-columns: 1fr; }
  .article-body { padding: 1.25rem 1.1rem; }
  .article-pdf-frame { height: 60vh; min-height: 320px; }
}

/* ----- v1.8.2.66w.372: the community-articles admin tables -----
   At <=700px the site-wide rule turns every admin table into a
   stack of cards and makes each <td> a flex row (label | value).
   It also sets `td > div { display: contents }` so the ACTION
   buttons become direct flex items of the action cell and land in
   the 2-column grid.

   A CONTENT cell needs the opposite: ONE block of content beside
   the label, not three flex items sharing the width — which
   squeezed the article title down to one character per line. The
   `.admin-cell` wrapper keeps the content together.

   The action cell is deliberately NOT wrapped: it keeps the shared
   `display: contents` behaviour, so its buttons still land in the
   2-column grid. */
@media (max-width: 700px) {
  /* The selector mirrors the shared rule it overrides — same
     specificity, later in the file, so this one wins. */
  .admin-table:not(.cert-table):not(.no-mobile-cards) tbody td > .admin-cell {
    display: block !important;
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* ==========================================================
   v1.8.2.66w.373 — COMMUNITY ARTICLES · PHASE 2 (public SPA)
   ----------------------------------------------------------
   docs/FEATURE-community-articles.md §16.2, §16.3, §16.4,
   §16.7, §16.10.

   FRONTEND-TRACK BLOCK. The server track adds its own styles for
   the server-rendered /articles pages in a separate block — if the
   two ever collide, this one is the SPA's and can be renamed
   without touching the server's rules.

   What is here:
     • the listing toolbar — the search box and the tag filter row
     • the card thumbnail and the card tag chips
     • the article gallery (the article's own images)
     • the article's tag list and the "Download as PDF" row
     • the "Report this article" form

   NO HEX LITERALS — every colour is a theme token, so the block
   follows the light / dark / high-contrast themes like the rest of
   the site. (The active chip uses the same green-700 / bg-page
   pair as .wall-filter-chips .chip.active, which is proven in all
   three themes.)
   ========================================================== */

/* ----- The listing toolbar: search box + tag filter row ----- */
.articles-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.articles-search {
  position: relative;
  display: flex;
  align-items: center;
}
.articles-search-icon {
  position: absolute;
  inset-inline-start: 0.7rem;
  opacity: 0.65;
  pointer-events: none;
  font-size: 0.9rem;
  line-height: 1;
}
.articles-search input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="color"]):not([type="range"]) {
  /* The site-wide input rule near the top of this file uses a
     :not() chain, which makes it specificity (0,9,1) — far higher
     than a plain `.articles-search input` (0,1,1). Without the
     same chain here, the GLOBAL rule wins: the box came out with
     the site's default radius and padding instead of the pill and
     the room for the magnifier this design needs. Repeating the
     chain gives this rule (0,10,1), so it wins — and it is the
     last rule about this element in the file, so it also wins on
     order. */
  width: 100%;
  /* LOGICAL padding: the magnifier sits at the inline start, so the
     room for it has to be at the inline start too — in Arabic the
     box mirrors and a physical left-padding would put the text under
     the icon. */
  padding-block: 0.55rem;
  padding-inline: 2.2rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-sm);
}
.articles-search input::placeholder { color: var(--text-muted); }
.articles-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--border-strong);
}
.articles-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.articles-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.articles-tag-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.articles-tag-chip.active {
  background: var(--green-700);
  border-color: var(--green-700);
  color: var(--bg-page);
}
.articles-tag-count {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.75;
}

/* ----- The card: first image + tag chips ----- */
.article-card-media {
  margin: -0.35rem -0.6rem 0.15rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-muted);
}
.article-card-media img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
}
.article-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-card-tag {
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.article-card-tag:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ----- The article page: gallery, tags, download, report ----- */
.article-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
}
.article-gallery-item {
  margin: 0;
}
.article-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  /* A portrait photo in a 2-up grid is taller than the page wants.
     The cap keeps one very tall image from pushing the article (and
     the report link) off the screen; `contain` letterboxes it rather
     than cropping a face out of it. */
  max-height: 420px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
}
.article-gallery-item figcaption {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.article-tags-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.article-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-tag {
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.article-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.article-report {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.article-report-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.article-report-toggle:hover { color: var(--link-hover); }
.article-report-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 620px;
}
.article-report-label {
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.article-report-textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 1.6;
  resize: vertical;
}
.article-report-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--border-strong);
}
.article-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.article-report-note {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.article-report-note-ok { color: var(--ok-fg); }
.article-report-note-warn { color: var(--warn-fg); }
.article-report-note-error { color: var(--danger-fg); }

@media (max-width: 700px) {
  .article-card-media img { height: 140px; }
  .article-gallery { grid-template-columns: 1fr; }
}

/* ==========================================================
   v1.8.2.66w.372 — SERVER-RENDERED COMMUNITY ARTICLE PAGES
   ----------------------------------------------------------
   docs/FEATURE-community-articles.md §16.5.

   THE PAGES THEMSELVES are generated by the server
   (server/server.js — the `/articles` and `/articles/:slug`
   routes). They are STANDALONE HTML documents: what a search
   engine and a link-preview scraper see, and what a human sees
   when they land on a link pasted into a chat.

   They use the SAME stylesheet as the SPA and the SAME
   `data-theme`, so the page matches the site in every one of
   the six themes (emerald / midnight / sand × normal / hc).

   The `sr-` prefix (server-rendered) keeps these rules clear
   of the SPA's own `.article-*` classes, which are scoped to
   the React components. The two never meet on one page: the
   server-rendered document has no React on it.

   NO HEX LITERALS BELOW. Every colour is a theme token, so
   the block follows light / dark / high-contrast like the rest
   of the site. The donor's own HTML is never styled by class
   name — the body is rendered inside `.article-body`, whose
   rules are element selectors (see the v1.8.2.66w.372 block
   above), because the sanitiser strips `class` from the
   donor's markup.
   ========================================================== */

.sr-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  color: var(--text-primary);
}
.sr-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.sr-breadcrumb a { color: var(--text-secondary); }
.sr-title {
  margin: 0 0 0.5rem;
  font-size: var(--fs-2xl);
  line-height: 1.25;
  color: var(--text-primary);
}
.sr-lede {
  margin: 0 0 2rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}
.sr-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

/* ----- the index grid ----- */
.sr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.sr-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.sr-card-media {
  display: block;
  margin: -0.35rem 0 0.25rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sr-card-media img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.sr-card-title {
  margin: 0;
  font-size: var(--fs-lg);
  line-height: 1.3;
}
.sr-card-title a { color: var(--text-primary); }
.sr-card-title a:hover { color: var(--link-hover); }
.sr-card-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.sr-card-meta,
.sr-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.sr-card-meta {
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

/* ----- the detail page ----- */
.sr-summary {
  margin: 0 0 1.75rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-muted);
  border-inline-start: 3px solid var(--green-500, var(--green-700));
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.65;
}
.sr-figure {
  margin: 0 0 1.5rem;
}
.sr-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.sr-figure figcaption {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* ----- the tag pills ----- */
.sr-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.sr-tag {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  text-decoration: none;
}
.sr-tag:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ----- the action row + the footer link ----- */
.sr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 2rem 0 0;
}
.sr-foot {
  margin: 3rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.sr-foot a { color: var(--text-secondary); }

@media (max-width: 700px) {
  .sr-wrap { padding: 1.25rem 1rem 3rem; }
  .sr-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   v1.8.2.66w.374 — COMMUNITY ARTICLES · PHASE 2 (admin
   reports + the donor's image and tag inputs)
   ----------------------------------------------------------
   The last of the phase-2 frontend work: the two pieces the
   server and the public-SPA tracks left.

     • the ADMIN REPORT INBOX — the "Reported articles" list on
       the admin community-articles screen, with the two
       resolve actions (dismiss / mark actioned)
     • the DONOR'S IMAGE PICKER + TAGS — the shared media
       picker (components/DonorMediaPicker.tsx) and the tag
       chips of the community-articles form

   The `dm-` prefix is the donor's media picker, the `report-`
   prefix the admin report inbox, and `donor-tag-` the tag
   chips. None of them collide with the public SPA's own
   `.article-*` classes.

   NO HEX LITERALS — every colour is a theme token, so the
   block follows the light / dark / high-contrast themes like
   the rest of the site.
   ========================================================== */

/* ----- The admin report inbox ----- */
.admin-reports {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.admin-reports-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-reports-head h2 {
  margin: 0;
  font-size: var(--fs-lg);
}
.admin-reports-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: var(--radius-pill);
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.admin-reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.report-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.report-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.report-row-title {
  font-size: var(--fs-base);
  color: var(--text-primary);
}
.report-row-title a { color: var(--text-primary); }
.report-row-title a:hover { color: var(--link-hover); }
.report-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.report-row-reason {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text-secondary);
  /* The reason is the donor's own words — a long one must not
     stretch the row, and it must not be collapsed either. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.report-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}
.report-note {
  flex: 1 1 220px;
  min-width: 0;
  font-size: var(--fs-sm);
}

/* ----- The donor's media picker (both donor forms) ----- */
.dm-picker {
  display: grid;
  gap: 6px;
}
.dm-picker-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
/* The file control is a <label> with the input INSIDE it (the CSP
   blocks inline handlers, so the label/input association is what
   opens the picker) — the input itself is hidden but NOT
   display:none, or the browser refuses to open the picker. */
.dm-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  left: -9999px;
  top: -9999px;
}
.dm-picker-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}
.dm-picker-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.dm-picker-tile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* The ✕ sits ON the photo, so it carries its own surface rather
   than a fixed dark scrim — a scrim would be invisible on a dark
   photo in the dark theme. */
.dm-picker-tile-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dm-library {
  padding: 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
}
.dm-library-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.dm-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}
.dm-library-item {
  position: relative;
  aspect-ratio: 1;
}
.dm-library-thumb {
  display: block;
  padding: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  border-radius: 4px;
  overflow: hidden;
  opacity: 1;
  cursor: pointer;
}
.dm-library-thumb-picked {
  border: 2px solid var(--green-700);
  opacity: 0.4;
}
.dm-library-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dm-library-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----- The donor's tag chips ----- */
.donor-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 2px;
}
.donor-tag-chip {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
