/* =====================================================================
   A. Pudupatti Jamath – design system
   Ivory neutrals · emerald green · gold accent · Islamic geometric pattern
   ===================================================================== */

:root {
  --bg: #faf8f2;
  --bg-tint: #eef5f0;
  --surface: #ffffff;
  --surface-2: #f4f2ea;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.6);
  --ink: #0b1f17;
  --ink-2: #33443c;
  --muted: #5f6f67;
  --line: rgba(11, 31, 23, 0.10);
  --line-strong: rgba(11, 31, 23, 0.18);

  --brand: #065f46;
  --brand-600: #047857;
  --brand-500: #059669;
  --brand-100: #d1fae5;
  --brand-50: #ecfdf5;
  --accent: #d4a017;
  --accent-600: #b7860b;
  --accent-50: #fbf5e3;
  --accent-ink: #7a5a0a;
  --green: #15803d;
  --blue: #2563eb;
  --rose: #be123c;
  --danger: #b42318;
  --danger-50: #fef1f0;
  --success: #116149;
  --success-50: #e8f6f0;
  --warning-50: #fbf5e3;

  /* Chart series – validated with the dataviz palette checker (light) */
  --series-1: #059669;
  --series-2: #c2410c;
  --track: #e7e6df;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 23, .06), 0 1px 1px rgba(11, 31, 23, .04);
  --shadow: 0 1px 2px rgba(11, 31, 23, .05), 0 8px 24px -8px rgba(11, 31, 23, .12);
  --shadow-lg: 0 2px 4px rgba(11, 31, 23, .04), 0 24px 48px -16px rgba(11, 31, 23, .22);
  --ring: 0 0 0 3px rgba(5, 150, 105, .35);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Tamil", "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, "SF Pro Display", "Segoe UI", Roboto, "Noto Sans Tamil", sans-serif;
  --container: 1180px;
  --header-h: 76px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08130f;
    --bg-tint: #0c1a15;
    --surface: #0f1d18;
    --surface-2: #152620;
    --glass: rgba(15, 29, 24, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --ink: #eef5f1;
    --ink-2: #c3d3cb;
    --muted: #92a59b;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --brand: #6ee7b7;
    --brand-600: #34d399;
    --brand-500: #10b981;
    --brand-100: rgba(52, 211, 153, .16);
    --brand-50: rgba(52, 211, 153, .08);
    --accent: #e9c46a;
    --accent-600: #d4a017;
    --accent-50: rgba(233, 196, 106, .1);
    --accent-ink: #f3d27a;
    --danger: #f97066;
    --danger-50: rgba(249, 112, 102, .1);
    --success: #6ce9a6;
    --success-50: rgba(108, 233, 166, .1);
    --warning-50: rgba(233, 196, 106, .1);
    /* Dark-mode series – validated against a dark surface */
    --series-1: #059669;
    --series-2: #ea580c;
    --track: #1f302a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, .6);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--ink); }
h1, .h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); font-weight: 800; letter-spacing: -0.035em; }
h2, .h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 750; }
h3, .h3 { font-size: 1.25rem; font-weight: 700; }
h4, .h4 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
code { font-size: .875em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }
::selection { background: var(--brand-100); }

.container { width: min(95%, 100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 1rem); margin-inline: auto; }
.narrow { max-width: 1100px; }
.stack > * + * { margin-top: 1.25rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.no-js .js-only { display: none !important; }

.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }

/* Icons */
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; }
.icon-xs { width: .9em; height: .9em; }
.icon-sm { width: 1.05em; height: 1.05em; }
.icon-xl { width: 2.5rem; height: 2.5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(16px);
  backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(0,0,0,.4); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { border-radius: 10px; box-shadow: var(--shadow-sm); }
.brand-text { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em; }
.brand-tld { color: var(--brand-500); }
.site-nav { display: flex; align-items: center; gap: 1rem; flex: 1; justify-content: space-between; }
.nav-links { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  display: block; padding: .45rem .75rem; border-radius: 999px;
  color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .925rem;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a[aria-current="page"] { background: #065f46; color: #fff; }
.nav-actions { display: flex; align-items: center; gap: .4rem; }
.inline-form { display: inline; margin: 0; }
.nav-toggle { display: none; margin-left: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .55rem; color: var(--ink); cursor: pointer; }

@media (max-width: 1080px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 1rem;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.5rem; box-shadow: var(--shadow-lg);
    display: none;
  }
  .js .site-nav.is-open { display: flex; animation: drop .18s ease-out; }
  .js .nav-links { flex-direction: column; }
  .js .nav-links a { padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
  .js .nav-actions { flex-wrap: wrap; }
  .no-js .header-inner { flex-wrap: wrap; padding-block: .75rem; }
  .no-js .site-nav { flex-wrap: wrap; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-border: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.2rem; border-radius: 999px;
  font: inherit; font-weight: 650; font-size: .95rem; line-height: 1.2;
  color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-border);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s, border-color .15s, color .15s;
}
.btn:hover { color: var(--btn-fg); transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { --btn-bg: linear-gradient(135deg, #059669, #065f46); --btn-fg: #fff; --btn-border: transparent; background: var(--btn-bg); box-shadow: 0 6px 18px -8px rgba(5, 150, 105, .7); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 24px -8px rgba(5, 150, 105, .75); }
.btn-outline { --btn-bg: transparent; }
.btn-outline:hover { --btn-border: var(--ink); }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; }
.btn-ghost:hover { --btn-bg: var(--surface-2); box-shadow: none; }
.btn-glass { --btn-bg: var(--glass); --btn-border: var(--glass-border); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.btn-light { --btn-bg: #fff; --btn-fg: #064e3b; --btn-border: transparent; }
.btn-light:hover { color: #064e3b; }
.btn-ghost-light { --btn-bg: transparent; --btn-fg: #ecfdf5; --btn-border: rgba(255,255,255,.35); }
.btn-ghost-light:hover { color: #fff; --btn-border: #fff; }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-border: transparent; }
.btn-danger:hover { color: #fff; }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover { color: var(--danger); }
.btn-sm { padding: .45rem .9rem; font-size: .85rem; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.btn-row.center { justify-content: center; }
.btn-row.nowrap { flex-wrap: nowrap; }
.btn-col { display: grid; gap: .5rem; margin-top: 1rem; }
.btn-col form { margin: 0; }
.link-arrow { display: inline-flex; align-items: center; gap: .35rem; font-weight: 650; text-decoration: none; color: var(--brand-600); }
.link-arrow .icon { transition: transform .2s; }
a:hover .link-arrow .icon, .link-arrow:hover .icon { transform: translateX(3px); }
.back-link { display: inline-block; margin-bottom: 1rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--ink); }

/* ---------- Pills & badges ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-600); margin-bottom: .75rem;
}
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; vertical-align: middle; text-transform: none; }
.pill-dated { background: var(--accent-50); color: var(--accent-ink); border: 1px solid rgba(212, 160, 23, .35); }
.pill-soft { background: var(--brand-50); color: var(--brand-600); }
.pill-lg { font-size: .85rem; padding: .35rem .85rem; }
.badge { display: inline-flex; align-items: center; padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-pending { background: var(--warning-50); color: var(--accent-ink); border-color: rgba(212,160,23,.35); }
.badge-approved, .badge-listed { background: var(--success-50); color: var(--success); border-color: rgba(17,97,73,.25); }
.badge-inactive { background: var(--surface-2); color: var(--muted); }
.badge-admin { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); isolation: isolate; }
.hero-bg, .auth-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-bg::after, .auth-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 85%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 18s ease-in-out infinite alternate; }
.blob-1 { width: 520px; height: 520px; background: #6ee7b7; top: -180px; left: -120px; }
.blob-2 { width: 460px; height: 460px; background: #f3d27a; top: -60px; right: -120px; animation-delay: -6s; opacity: .45; }
.blob-3 { width: 380px; height: 380px; background: #f3d27a; bottom: -200px; left: 40%; animation-delay: -12s; opacity: .3; }
@media (prefers-color-scheme: dark) { .blob { opacity: .18; } .blob-2 { opacity: .12; } .blob-3 { opacity: .1; } }
@keyframes float { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(40px, 30px) scale(1.08); } }

.hero-inner { display: grid; grid-template-columns: 1.35fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.display { font-size: clamp(2.4rem, 6.2vw, 4.6rem); line-height: 1.02; letter-spacing: -0.045em; margin-bottom: 1.25rem; }
.display-accent {
  display: block; margin-top: .35rem;
  font-size: .62em; letter-spacing: 0; line-height: 1.3;
  background: linear-gradient(100deg, #059669 0%, #d4a017 60%, #b7860b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 62ch; }
.lead p { margin-bottom: .8em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.glass, .glass-card {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}
.hero-card { border-radius: var(--radius-xl); padding: 1.25rem 1.25rem 1.5rem; transform: rotate(1.5deg); transition: transform .3s; }
.hero-card:hover { transform: rotate(0); }
.hero-card-map { border-radius: var(--radius-lg); background: linear-gradient(160deg, var(--brand-50), var(--accent-50)); color: var(--brand-600); overflow: hidden; margin-bottom: 1.1rem; }
.mini-map { width: 100%; height: auto; }
.pin-dot { fill: var(--accent-600); stroke: #fff; stroke-width: 3; }
.pulse { fill: var(--accent); opacity: .25; transform-origin: center; transform-box: fill-box; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.4); opacity: .5; } 100% { transform: scale(1.4); opacity: 0; } }
.hero-card-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin-bottom: .2rem; }
.hero-card-value { font-family: var(--font-display); font-size: 1.35rem; font-weight: 750; letter-spacing: -0.02em; margin-bottom: .75rem; font-variant-numeric: tabular-nums; }

/* Page hero (inner pages) */
.page-hero { position: relative; padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); background: radial-gradient(1200px 400px at 10% -10%, rgba(110, 231, 183, .28), transparent 60%), radial-gradient(900px 380px at 100% 0%, rgba(243, 210, 122, .22), transparent 60%); border-bottom: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .page-hero { background: radial-gradient(1200px 400px at 10% -10%, rgba(52, 211, 153, .12), transparent 60%), radial-gradient(900px 380px at 100% 0%, rgba(233, 196, 106, .08), transparent 60%); } }
.page-hero-compact { padding-block: 2rem 1.75rem; }
.page-hero h1 { max-width: 22ch; }
.admin-hero h1 { margin-bottom: 1rem; }

/* ---------- Sections ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-tight { padding-top: 2rem; }
.section-tint { background: var(--bg-tint); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 2rem; }

/* Facts */
.facts-grid { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.fact-card {
  position: relative; display: flex; flex-direction: column; gap: .25rem;
  padding: 1.35rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.fact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.fact-card-dated { background: linear-gradient(160deg, var(--accent-50), var(--surface) 70%); border-color: rgba(212, 160, 23, .3); }
.fact-icon { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 14px; background: var(--brand-50); color: var(--brand-600); margin-bottom: .6rem; }
.fact-card-dated .fact-icon { background: var(--accent-50); color: var(--accent-ink); }
.icon-green { background: rgba(21, 128, 61, .1); color: var(--green); }
.icon-blue { background: rgba(37, 99, 235, .1); color: var(--blue); }
.icon-amber { background: var(--accent-50); color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { .icon-green { color: #86efac; } .icon-blue { color: #93c5fd; } }
.fact-label { font-size: .82rem; font-weight: 650; color: var(--muted); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.fact-value { font-family: var(--font-display); font-size: 1.3rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.25; }
.fact-note { font-size: .78rem; color: var(--accent-ink); font-weight: 600; }
.source-note { display: flex; gap: .5rem; align-items: flex-start; font-size: .82rem; color: var(--muted); margin-top: 1.5rem; }
.source-note .icon { margin-top: .2rem; }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(220px, auto); gap: 1rem; }
.bento-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 1.6rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}
.bento-card:hover { color: var(--ink); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.bento-card h3 { margin-top: .25rem; }
.bento-card p { color: var(--ink-2); flex: 1; }
.bento-card::after { content: ""; position: absolute; width: 220px; height: 220px; right: -70px; bottom: -90px; border-radius: 50%; opacity: .5; filter: blur(10px); transition: transform .4s; }
.bento-card:hover::after { transform: scale(1.15); }
.bento-lg { grid-column: span 2; grid-row: span 2; }
.bento-lg h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
.bento-wide { grid-column: span 2; }
.bento-icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 16px; margin-bottom: 1rem; background: var(--surface-2); }
.card-teal::after { background: radial-gradient(circle, #6ee7b7, transparent 70%); }
.card-teal .bento-icon { background: var(--brand-50); color: var(--brand-600); }
.card-amber::after { background: radial-gradient(circle, #f3d27a, transparent 70%); }
.card-amber .bento-icon { background: var(--accent-50); color: var(--accent-ink); }
.card-green::after { background: radial-gradient(circle, #86efac, transparent 70%); }
.card-green .bento-icon { background: rgba(21, 128, 61, .1); color: var(--green); }
.card-rose::after { background: radial-gradient(circle, #f3d27a, transparent 70%); }
.card-rose .bento-icon { background: rgba(190, 18, 60, .08); color: var(--rose); }
.card-ink { background: linear-gradient(135deg, #0b1f17, #065f46); color: #ecfdf5; border-color: transparent; }
.card-ink:hover { color: #fff; }
.card-ink p { color: #bfe3d3; }
.card-ink h3 { color: #fff; }
.card-ink .bento-icon { background: rgba(255,255,255,.1); color: #6ee7b7; }
.card-ink .link-arrow { color: #6ee7b7; }
.card-ink::after { background: radial-gradient(circle, #10b981, transparent 70%); opacity: .6; }
@media (prefers-color-scheme: dark) {
  .card-green .bento-icon { color: #86efac; }
  .card-rose .bento-icon { color: #f3d27a; }
  .card-ink { background: linear-gradient(135deg, #065f46, #042f22); }
  .bento-card::after { opacity: .15; }
}

/* CTA band */
.cta-band {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center;
  padding: clamp(2rem, 5vw, 3.5rem); border-radius: var(--radius-xl);
  background: linear-gradient(120deg, #065f46 0%, #059669 55%, #10b981 100%);
  color: #ecfdf5; box-shadow: var(--shadow-lg);
}
.cta-band::before { content: ""; position: absolute; width: 380px; height: 380px; right: -100px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(243, 210, 122, .55), transparent 70%); }
.cta-band h2 { color: #fff; }
.cta-band p { color: #d1fae5; }
.cta-actions { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, 3vw, 1.75rem); box-shadow: var(--shadow-sm); }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card-danger { border-color: rgba(180, 35, 24, .25); background: linear-gradient(180deg, var(--danger-50), var(--surface) 60%); }
.card h2 .icon, .card h3 .icon { display: inline; vertical-align: -0.15em; color: var(--brand-600); }

.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.location-card { position: sticky; top: calc(var(--header-h) + 1rem); }
.location-visual { border-radius: var(--radius); background: linear-gradient(160deg, var(--brand-50), var(--accent-50)); color: var(--brand-600); overflow: hidden; margin-bottom: 1.25rem; }

.meta-list { margin: 0 0 1rem; display: grid; gap: .1rem; }
.meta-list > div { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--muted); font-size: .875rem; font-weight: 600; }
.meta-list dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.meta-cols > div { grid-template-columns: minmax(140px, 32%) 1fr; }

/* Feature & school cards */
.feature-grid, .school-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.school-grid { list-style: none; padding: 0; }
.school-card { position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.school-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.school-num { position: absolute; right: 1.25rem; top: .5rem; font-family: var(--font-display); font-size: 3.5rem; font-weight: 800; color: var(--line); letter-spacing: -0.05em; }
.school-card p { display: flex; align-items: center; gap: .3rem; }

.callout { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem 1.5rem; border-radius: var(--radius-lg); background: var(--brand-50); border: 1px solid var(--brand-100); margin-top: 1.5rem; }
.callout > .icon { color: var(--brand-600); margin-top: .2rem; }
.callout h2 { margin-bottom: .3rem; }

/* ---------- Stats & charts ---------- */
.stat-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; box-shadow: var(--shadow-sm); }
.stat-hero { background: linear-gradient(150deg, var(--brand-50), var(--surface) 70%); }
.stat-label { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 650; color: var(--muted); margin-bottom: .35rem; }
.stat-value { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin-bottom: .35rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat-unit { font-size: .55em; font-weight: 700; color: var(--muted); margin-left: .1em; }
.stat-note { font-size: .85rem; color: var(--muted); }
.stat-link { text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s, border-color .2s; }
.stat-link:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.stat-link.is-active { border-color: var(--brand-500); box-shadow: var(--ring); }
.stat-link .stat-value { font-size: 2rem; }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.chart-card { margin: 0; }
.chart-card figcaption { margin-bottom: 1.25rem; }
.chart-card figcaption h2 { margin-bottom: .2rem; }
.split-bar { width: 100%; height: auto; }
.seg-1 { fill: var(--series-1); }
.seg-2 { fill: var(--series-2); }
.seg:hover { opacity: .85; }
.legend { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: .5rem; }
.legend strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.swatch-1 { background: var(--series-1); }
.swatch-2 { background: var(--series-2); }
.bar-list { display: grid; gap: .9rem; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 48px; align-items: center; gap: .75rem; }
.bar-label { font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.bar { width: 100%; height: auto; overflow: visible; }
.bar-track { fill: var(--track); }
.bar-fill { fill: var(--series-1); }
.bar-fill:hover { opacity: .85; }
.bar-ref { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 3 3; opacity: .6; }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.table-card summary { cursor: pointer; font-weight: 650; }
.table-card[open] summary { margin-bottom: 1rem; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .925rem; }
.data-table th, .data-table td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); font-weight: 700; }
.data-table tbody th { font-weight: 600; color: var(--ink-2); }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--brand-50); }

/* ---------- Directory ---------- */
.search-panel { border-radius: var(--radius-xl); padding: clamp(1.25rem, 3vw, 1.75rem); margin-top: -3.5rem; position: relative; z-index: 2; }
.search-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: end; }
.field-actions { display: flex; gap: .5rem; }
.alpha-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.alpha-filter > span { margin-right: .4rem; }
.chip { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding: 0 .55rem; border-radius: 999px; font-size: .82rem; font-weight: 650; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); background: var(--surface); transition: all .15s; }
.chip:hover { border-color: var(--brand-500); color: var(--brand-600); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.access-note { display: flex; gap: .65rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius); background: var(--surface-2); color: var(--ink-2); font-size: .9rem; margin: 1.5rem 0; }
.access-note .icon { color: var(--brand-600); margin-top: .2rem; }
.results-count { margin-bottom: 1rem; color: var(--ink-2); }
.family-grid { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.family-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.family-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.family-card-body { display: grid; flex: 1; min-width: 0; }
.family-card-family { font-weight: 750; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-card-name { font-size: .9rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-card-arrow { color: var(--muted); transition: transform .2s, color .2s; }
.family-card:hover .family-card-arrow { transform: translateX(3px); color: var(--brand-600); }
.avatar { flex-shrink: 0; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 16px; font-weight: 800; font-size: 1.15rem; color: #fff; background: linear-gradient(135deg, #10b981, #065f46); box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.family-grid li:nth-child(3n+2) .avatar { background: linear-gradient(135deg, #d4a017, #c2410c); }
.family-grid li:nth-child(3n+3) .avatar { background: linear-gradient(135deg, #fb7185, #9f1239); }
.avatar-lg { width: 4.5rem; height: 4.5rem; font-size: 1.8rem; border-radius: 22px; }
.profile-head { display: flex; gap: 1.25rem; align-items: center; }
.profile-head h1 { margin-bottom: .1rem; }
.profile-head .eyebrow { margin-bottom: .25rem; }
.tel-link { font-size: 1.35rem; font-weight: 750; font-variant-numeric: tabular-nums; text-decoration: none; }

/* States */
.state-card { text-align: center; padding: clamp(2rem, 6vw, 3.5rem) 1.5rem; border-radius: var(--radius-xl); background: var(--surface); border: 1px dashed var(--line-strong); }
.state-card > .icon { margin: 0 auto 1rem; color: var(--brand-500); }
.state-card p { color: var(--muted); max-width: 52ch; margin-inline: auto; }
.state-card .btn { margin-top: 1rem; }
.state-error > .icon { color: var(--danger); }
.error-code { font-family: var(--font-display); font-size: clamp(4rem, 12vw, 7rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1; margin-bottom: .5rem; background: linear-gradient(120deg, #059669, #d4a017); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loading-state { text-align: center; padding: 2rem 0; color: var(--muted); }
.spinner { display: inline-block; width: 2rem; height: 2rem; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand-500); animation: spin .8s linear infinite; margin-bottom: .5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; margin-top: 1.5rem; }
.skeleton-grid li { height: 82px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; align-items: center; margin-top: 1.5rem; }
.pager-link { display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .9rem; border-radius: 999px; text-decoration: none; font-weight: 650; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); }
.pager-link:hover { border-color: var(--brand-500); color: var(--brand-600); }
.pager-link.is-current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pager-gap { color: var(--muted); padding: 0 .2rem; }

/* ---------- Alerts ---------- */
.flash-stack { margin-top: 1rem; display: grid; gap: .5rem; }
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-size: .95rem; }
.alert > .icon { margin-top: .15rem; }
.alert ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.alert-success { background: var(--success-50); border-color: rgba(17,97,73,.25); color: var(--success); }
.alert-error { background: var(--danger-50); border-color: rgba(180,35,24,.25); color: var(--danger); }
.alert-error a { color: var(--danger); }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.alert-warning { background: var(--warning-50); border-color: rgba(212,160,23,.35); color: var(--accent-ink); }
.error-summary { margin-bottom: 1.5rem; }
.error-summary:focus { outline: none; box-shadow: var(--ring); }

/* ---------- Forms ---------- */
.field { display: grid; gap: .35rem; min-width: 0; }
label, legend { font-weight: 650; font-size: .9rem; color: var(--ink-2); }
.hint { font-weight: 500; color: var(--muted); font-size: .8rem; }
.req { color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  padding: .7rem .9rem; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.25rem; }
textarea { resize: vertical; min-height: 5.5rem; }
input:hover, textarea:hover, select:hover { border-color: var(--muted); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
::placeholder { color: var(--muted); opacity: .7; }
.has-error input, .has-error textarea, [aria-invalid="true"] { border-color: var(--danger) !important; background: var(--danger-50); }
.field-error { display: flex; gap: .35rem; align-items: flex-start; font-size: .82rem; color: var(--danger); font-weight: 600; margin: 0; }
.field-error .icon { margin-top: .15rem; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 2.5rem; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; margin-top: .2rem; accent-color: var(--brand-500); flex-shrink: 0; }

/* Segmented radio */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.segmented { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.segmented legend { float: left; margin-right: .5rem; font-size: .85rem; }
.segmented > legend + * { clear: none; }
.segment { position: relative; cursor: pointer; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment span { display: inline-block; padding: .4rem 1rem; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 600; font-size: .875rem; background: var(--surface); transition: all .15s; }
.segment:hover span { border-color: var(--brand-500); }
.segment input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.segment input:focus-visible + span { box-shadow: var(--ring); }
.segmented .field-error { flex-basis: 100%; }
.segmented-sm .segment span { padding: .3rem .8rem; font-size: .82rem; }

/* Toggles */
.consent-list { display: grid; gap: .6rem; }
.toggle { display: flex; align-items: flex-start; gap: .9rem; padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, opacity .15s; position: relative; }
.toggle:hover { border-color: var(--brand-100); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { flex-shrink: 0; position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); transition: background .2s; margin-top: .1rem; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.toggle input:checked + .toggle-ui { background: var(--brand-500); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-ui { box-shadow: var(--ring); }
.toggle:has(input:checked) { border-color: var(--brand-100); background: var(--brand-50); }
.toggle-text { display: grid; gap: .1rem; font-weight: 500; }
.toggle-text strong { font-weight: 650; color: var(--ink); }
.toggle-text span { font-size: .85rem; color: var(--muted); }
.toggle.is-disabled { opacity: .5; cursor: not-allowed; }
.toggle-sm { padding: .6rem .8rem; }
.toggle-sm .toggle-text strong { font-size: .9rem; }

/* Membership form */
.membership-form { display: grid; gap: 1.5rem; }
.form-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow-sm); }
.form-section-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.5rem; }
.form-section-head h2 { font-size: 1.3rem; margin-bottom: .2rem; }
.step { flex-shrink: 0; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 14px; background: linear-gradient(135deg, #10b981, #065f46); color: #fff; font-weight: 800; }
.form-grid { display: grid; gap: 1.25rem; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.address-block { display: grid; gap: .75rem; align-content: start; justify-items: start; }
.address-block > .field { width: 100%; }
.side-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.side-card { border-radius: var(--radius-lg); padding: 1.25rem; border: 1px solid var(--line); background: var(--surface-2); }
.side-card legend { float: left; width: 100%; font-size: 1rem; font-weight: 750; color: var(--ink); padding-bottom: .75rem; margin-bottom: .75rem; border-bottom: 2px solid var(--brand-500); }
.side-wife legend { border-bottom-color: var(--accent); }
.side-card legend + * { clear: both; }
.relation-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: .75rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.relation-row:last-child { border-bottom: 0; }
.relation-row.no-place { grid-template-columns: 1fr; }
.member-rows { display: grid; gap: .9rem; margin-bottom: 1rem; counter-reset: row; }
.member-row { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.1rem; background: var(--surface-2); }
.member-row legend { float: left; width: 100%; margin-bottom: .6rem; font-size: .9rem; }
.member-row legend + * { clear: both; }
.row-num { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4rem; padding: .1rem .5rem; margin-right: .4rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .78rem; font-weight: 750; }
.member-fields { display: grid; grid-template-columns: 1.4fr 1fr .5fr 1fr 1fr auto; gap: .75rem; align-items: end; }
.member-fields .field label { font-size: .8rem; }
.member-fields input { padding: .55rem .75rem; font-size: 1rem; }
.member-row-actions { display: flex; justify-content: flex-end; gap: .25rem; margin-top: .5rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; padding: 1rem; margin-inline: -1rem; background: linear-gradient(to top, var(--bg) 60%, transparent); }

/* Auth */
.auth-section { position: relative; overflow: hidden; isolation: isolate; min-height: calc(100vh - var(--header-h) - 200px); min-height: calc(100svh - var(--header-h) - 200px); display: grid; align-items: center; }
.auth-wrap { display: grid; place-items: center; }
.auth-card { width: min(100%, 460px); border-radius: var(--radius-xl); padding: clamp(1.5rem, 5vw, 2.5rem); }
.auth-card h1 { font-size: 2rem; }
.auth-icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 16px; background: var(--brand-50); color: var(--brand-600); margin-bottom: 1rem; }

/* Account / admin */
.account-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; align-items: start; }
.success-card { text-align: center; padding: clamp(2rem, 6vw, 3.5rem); border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.success-card h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); max-width: 26ch; margin-inline: auto; }
.success-card h1:focus { outline: none; }
.success-icon { display: grid; place-items: center; width: 5rem; height: 5rem; margin: 0 auto 1.5rem; border-radius: 50%; background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 12px 30px -10px rgba(5,150,105,.7); animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.steps { text-align: left; max-width: 560px; margin: 1.5rem auto 2rem; padding-left: 1.25rem; display: grid; gap: .6rem; color: var(--ink-2); }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; padding: .3rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.tab { padding: .5rem 1rem; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 650; font-size: .9rem; }
.tab:hover { color: var(--ink); background: var(--surface); }
.tab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; margin: 1.5rem 0 1rem; }
.toolbar-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.toolbar-form .field { min-width: 220px; }
.admin-profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.admin-side { position: sticky; top: calc(var(--header-h) + 1rem); }
.history summary { cursor: pointer; font-weight: 600; font-size: .9rem; margin-top: 1rem; }
.history-list { padding-left: 1.1rem; margin: .75rem 0 0; display: grid; gap: .5rem; }
.history-list li { display: grid; }
.content-preview { color: var(--ink-2); font-size: .95rem; margin-bottom: 1rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--surface-2); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 3rem; padding: 3.5rem 0 1.5rem; background: var(--surface); border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 2rem; }
.footer-brand p { color: var(--muted); margin-top: 1rem; font-size: .925rem; }
.footer-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer ul a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.site-footer ul a:hover { color: var(--brand-600); }
.footer-small { font-size: .85rem; color: var(--muted); }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.footer-bottom a { color: var(--muted); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); transition-delay: var(--reveal-delay, 0ms); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .member-fields { grid-template-columns: 1fr 1fr 1fr; }
  .member-fields .field-name { grid-column: span 2; }
  .admin-profile-grid { grid-template-columns: 1fr; }
  .admin-side { position: static; }
}
@media (max-width: 900px) {
  .hero-inner, .split, .cta-band, .account-grid, .chart-grid { grid-template-columns: 1fr; }
  .hero-card { transform: none; max-width: 420px; }
  .bento { grid-template-columns: 1fr 1fr; }
  .bento-lg { grid-row: span 1; }
  .side-grid, .form-grid.cols-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid, .stat-grid-4 { grid-template-columns: 1fr 1fr; }
  .stat-hero { grid-column: span 2; }
  .location-card { position: static; }
  .search-fields { grid-template-columns: 1fr 1fr; }
  .field-actions { grid-column: span 2; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .bento-lg, .bento-wide { grid-column: span 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .stat-grid, .stat-grid-4 { grid-template-columns: 1fr; }
  .stat-grid-4 { grid-template-columns: 1fr 1fr; }
  .stat-hero { grid-column: auto; }
  .search-fields { grid-template-columns: 1fr; }
  .field-actions { grid-column: auto; }
  .field-actions .btn { flex: 1; }
  .relation-row { grid-template-columns: 1fr; gap: .5rem; }
  .member-fields { grid-template-columns: 1fr 1fr; }
  .member-fields .field-name, .member-fields .field-food { grid-column: span 2; }
  .meta-list > div, .meta-cols > div { grid-template-columns: 1fr; gap: .1rem; }
  .hero-actions .btn { width: 100%; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .admin-table td { border: 0; padding: .3rem 1rem; display: flex; justify-content: space-between; gap: 1rem; }
  .admin-table td[data-label]::before { content: attr(data-label); font-weight: 650; color: var(--muted); font-size: .8rem; }
  .bar-row { grid-template-columns: 60px 1fr 42px; gap: .5rem; }
  .form-section { border-radius: var(--radius-lg); }
  .tabs { border-radius: var(--radius); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (forced-colors: active) {
  .seg-1, .bar-fill { fill: Highlight; }
  .seg-2 { fill: LinkText; }
  .toggle-ui { border: 1px solid CanvasText; }
}
@media print {
  .site-header, .site-footer, .hero-bg, .btn, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .form-section { box-shadow: none; border-color: #ccc; }
}

/* ---------- Top bar & language switcher ---------- */
.topbar { border-bottom: 1px solid var(--line); font-size: .8rem; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 38px; }
.topbar-note { margin: 0; color: var(--muted); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); flex-shrink: 0; }
.lang-option { padding: .2rem .8rem; border-radius: 999px; font-weight: 650; font-size: .82rem; line-height: 1.5; color: var(--ink-2); text-decoration: none; transition: background .15s, color .15s; }
.lang-option:hover { color: var(--ink); text-decoration: none; }
.lang-option.is-active { background: var(--ink); color: var(--bg); }
.lang-option:focus-visible { outline: none; box-shadow: var(--ring); }
.lang-switch-footer { margin-top: 1rem; }
.js .site-nav { top: 100%; }
.declarations { display: grid; gap: .9rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px dashed var(--line); }

/* ---------- Tamil typography ---------- */
:lang(ta) { line-height: 1.8; }
:lang(ta) h1, :lang(ta) h2, :lang(ta) h3, :lang(ta) h4,
:lang(ta) .display, :lang(ta) .stat-value, :lang(ta) .fact-value, :lang(ta) .brand-text {
  letter-spacing: 0;
  line-height: 1.4;
}
:lang(ta) .display { font-size: clamp(2rem, 5vw, 3.6rem); }
:lang(ta) h1, :lang(ta) .h1 { font-size: clamp(1.75rem, 3.8vw, 2.75rem); }
:lang(ta) .eyebrow { letter-spacing: .02em; text-transform: none; font-size: .85rem; }
:lang(ta) .nav-links a { font-size: .875rem; padding-inline: .6rem; }
:lang(ta) .footer-title, :lang(ta) .data-table thead th, :lang(ta) .hero-card-label { letter-spacing: 0; text-transform: none; }
:lang(ta) .btn { white-space: normal; text-align: center; }
html:lang(ta) body { font-family: "Noto Sans Tamil", "Tamil Sangam MN", "Tamil MN", "Latha", "Nirmala UI", var(--font); }
[lang="en"] { font-family: var(--font); }
:lang(ta) .display-accent:lang(en) { letter-spacing: -0.02em; }
@media (max-width: 1240px) {
  html:lang(ta).js .nav-toggle { display: inline-flex; }
  html:lang(ta).js .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 1rem;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.5rem; box-shadow: var(--shadow-lg);
    display: none;
  }
  html:lang(ta).js .site-nav.is-open { display: flex; }
  html:lang(ta).js .nav-links { flex-direction: column; }
  html:lang(ta).js .nav-links a { padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
}
@media (max-width: 600px) {
  .topbar-note { font-size: .75rem; }
}
@media (max-width: 600px) {
  .auth-section { min-height: 0; padding-top: 1.5rem; }
}

/* ---------- Form alignment refinements ---------- */
/* Keep paired inputs aligned even when one label wraps (subgrid rows: label / input / error). */
.relation-row, .form-grid.cols-2 { grid-template-rows: auto auto auto; align-items: start; }
.relation-row > .field, .form-grid.cols-2 > .field { grid-row: span 3; display: grid; grid-template-rows: subgrid; row-gap: .35rem; align-items: end; }
.relation-row > .field > .field-error, .form-grid.cols-2 > .field > .field-error { align-self: start; }
.member-fields { align-items: start; }
.member-fields .field-error { font-size: .78rem; }
.row-num { white-space: nowrap; }
@media (max-width: 900px) {
  .form-grid.cols-2 { grid-template-rows: none; }
  .form-grid.cols-2 > .field { grid-row: auto; grid-template-rows: none; }
}
@media (max-width: 600px) {
  .relation-row { grid-template-rows: none; }
  .relation-row > .field { grid-row: auto; grid-template-rows: none; }
}

/* =====================================================================
   Jamath theme – Islamic geometric pattern, arches, photos, prayer times
   ===================================================================== */
:root {
  --green-deep: #053d2e;
  --green-night: #042a20;
  --gold: #d4a017;
  --gold-light: #f3d27a;
  --arabic: "Noto Naskh Arabic", "Geeza Pro", "Damascus", "Al Nile", "Traditional Arabic", "Arabic Typesetting", "Segoe UI", Tahoma, serif;
  --pattern: url("../img/pattern.svg");
}
[lang="ar"] { font-family: var(--arabic); letter-spacing: 0 !important; text-transform: none !important; }

/* Pattern overlays (CSS mask, so the colour follows the theme) */
.section-pattern, .page-hero-pattern, .hero-jamath, .cta-band, .site-footer { position: relative; isolation: isolate; }
.section-pattern::before, .page-hero-pattern::before, .hero-jamath::after, .cta-band::after, .footer-pattern {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask: var(--pattern) 0 0 / 80px 80px repeat; mask: var(--pattern) 0 0 / 80px 80px repeat;
}
.section-pattern::before, .page-hero-pattern::before { background-color: var(--brand-500); opacity: .07; }
.cta-band::after { background-color: var(--gold-light); opacity: .1; z-index: 0; }
.cta-band > * { position: relative; z-index: 1; }

/* Top bar */
.topbar { background: var(--green-deep); border-bottom: 1px solid rgba(243, 210, 122, .25); color: #e6d9b0; }
.topbar-note { display: flex; align-items: center; gap: .5rem; color: #dcebe4; min-width: 0; }
.topbar-hijri { display: inline-flex; align-items: center; gap: .35rem; color: var(--gold-light); font-weight: 650; white-space: nowrap; }
.topbar-hijri + .topbar-place::before { content: "·"; margin-right: .5rem; opacity: .6; }
.topbar-place { overflow: hidden; text-overflow: ellipsis; }
.lang-switch-top, .lang-switch-footer { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); }
.lang-switch-top .lang-option, .lang-switch-footer .lang-option { color: #e6efe9; }
.lang-switch-top .lang-option:hover, .lang-switch-footer .lang-option:hover { color: #fff; }
.lang-switch-top .lang-option.is-active, .lang-switch-footer .lang-option.is-active { background: var(--gold-light); color: var(--green-deep); }

/* Brand */
.brand { gap: .7rem; }
.brand .brand-logo { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.brand-text { display: grid; line-height: 1.2; letter-spacing: -0.01em; }
.brand-name { font-size: 1.08rem; font-weight: 800; color: var(--ink); }
.brand-sub { font-size: .74rem; font-weight: 650; color: var(--accent-ink); letter-spacing: .01em; }
:lang(ta) .brand-name { font-size: 1rem; }

/* Bismillah */
.bismillah { display: grid; gap: .1rem; margin: 0 0 1rem; }
.bismillah-ar { font-family: var(--arabic); font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.9; color: var(--accent-ink); }
.bismillah-tr { font-size: .85rem; color: var(--muted); font-style: italic; }
.salam-ar { font-size: 1.05rem; }

/* Home hero: night photo of the masjid under a deep green veil */
.hero-jamath { background: var(--green-night); color: #f4efe1; padding: clamp(2.5rem, 6vw, 5rem) 0; }
.hero-photo { position: absolute; inset: 0; z-index: -2; }
.hero-photo-img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.hero-jamath::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(3, 34, 25, .96) 0%, rgba(3, 34, 25, .86) 48%, rgba(3, 34, 25, .5) 100%); }
.hero-jamath::after { background-color: var(--gold-light); opacity: .07; }
.hero-jamath .hero-inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); }
.hero-jamath h1 { color: #fff; }
.hero-jamath .lead { color: #d3e6dc; }
.hero-jamath .eyebrow { color: var(--gold-light); }
.hero-jamath .btn-glass { --btn-bg: rgba(255, 255, 255, .1); --btn-fg: #fff; --btn-border: rgba(255, 255, 255, .35); }
.hero-jamath .btn-primary { --btn-bg: linear-gradient(135deg, #f3d27a, #d4a017); --btn-fg: var(--green-deep); box-shadow: 0 8px 22px -10px rgba(243, 210, 122, .8); }
.hero-jamath .btn-primary:hover { color: var(--green-deep); }
.bismillah-hero .bismillah-ar { color: var(--gold-light); font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
.bismillah-hero .bismillah-tr { color: #c4dccf; }
.display-jamath { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.12; letter-spacing: -0.025em; }
.display-jamath:lang(ta) { font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.4; }

/* Arch shape (mihrab) */
.arch { border-radius: 50% 50% var(--radius-lg) var(--radius-lg) / 110px 110px var(--radius-lg) var(--radius-lg); }

/* Prayer times card */
.prayer-card { position: relative; width: 100%; max-width: 470px; justify-self: end; padding: 3.75rem 1.4rem 1.4rem; text-align: center; background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.prayer-card::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(212, 160, 23, .45); border-radius: inherit; pointer-events: none; }
.arch-crown { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, #f3d27a, #b7860b); color: var(--green-deep); box-shadow: 0 6px 16px -6px rgba(183, 134, 11, .8); }
.prayer-kicker { margin: .25rem 0 0; font-size: .8rem; font-weight: 650; color: var(--muted); }
.prayer-title { font-size: 1.55rem; margin: 0; }
.prayer-hijri { margin: .1rem 0 .9rem; font-size: .9rem; font-weight: 650; color: var(--accent-ink); }
.prayer-table { width: 100%; border-collapse: separate; border-spacing: 0 5px; text-align: left; font-variant-numeric: tabular-nums; }
.prayer-table th, .prayer-table td { padding: .55rem .7rem; }
.prayer-table thead th { padding-block: 0 .1rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.prayer-table thead th:not(:first-child), .prayer-table td { text-align: right; white-space: nowrap; }
.prayer-table tbody tr > * { background: var(--surface-2); }
.prayer-table tbody tr > :first-child { border-radius: 12px 0 0 12px; }
.prayer-table tbody tr > :last-child { border-radius: 0 12px 12px 0; }
.prayer-name { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-weight: 700; color: var(--ink); }
.prayer-ar { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); }
.prayer-sub { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.prayer-iqamah { font-weight: 750; color: var(--brand); }
.prayer-table tr.is-next > * { background: linear-gradient(135deg, #065f46, #047857); color: #fff; }
.prayer-table tr.is-next .prayer-name, .prayer-table tr.is-next .prayer-ar, .prayer-table tr.is-next .prayer-sub { color: #fff; }
.prayer-table tr.is-next .prayer-iqamah { color: var(--gold-light); }
.pill-next { background: var(--gold-light); color: var(--green-deep); }
.prayer-updated { margin: .6rem 0 0; font-size: .78rem; color: var(--muted); }
.prayer-empty { padding: 1.25rem .5rem .5rem; color: var(--muted); }
.prayer-empty .icon { margin: 0 auto .75rem; color: var(--brand-500); }
.prayer-link { margin-top: 1rem; justify-content: center; }
:lang(ta) .prayer-table thead th { letter-spacing: 0; text-transform: none; }

.masjid-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.masjid-grid .prayer-card { max-width: none; justify-self: stretch; }
.jumuah-card .fact-icon { margin-bottom: .5rem; }
.office-address, .footer-address { font-style: normal; line-height: 1.75; margin-bottom: .75rem; font-weight: 550; }

/* Page hero with photo */
.page-hero-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.page-hero-split h1 { max-width: none; }
.arch-photo { margin: 0; }
.arch-photo img { width: 100%; height: auto; max-height: 520px; object-fit: cover; border: 6px solid var(--surface); box-shadow: var(--shadow-lg); border-radius: 50% 50% var(--radius-lg) var(--radius-lg) / 26% 26% var(--radius-lg) var(--radius-lg); }
.arch-photo figcaption { margin-top: .6rem; text-align: center; font-size: .82rem; color: var(--muted); }
.arch-photo-sm img { aspect-ratio: 1 / 1; }

/* Galleries */
.gallery { display: grid; gap: 1rem; }
.gallery-item { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.gallery-item a { display: block; height: 100%; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1rem .85rem; font-size: .88rem; font-weight: 600; color: #fff; background: linear-gradient(to top, rgba(2, 24, 17, .88), transparent); pointer-events: none; }
.gallery-home { grid-template-columns: 2fr 1fr 1fr; }
.gallery-home .gallery-item { height: clamp(260px, 30vw, 460px); }
.gallery-full { grid-template-columns: 2fr 1fr; }
.gallery-full .gallery-item { height: clamp(240px, 30vw, 460px); }

/* Section heads with a gold rule */
.section-head h2::after { content: ""; display: block; width: 64px; height: 3px; margin-top: .65rem; border-radius: 3px; background: linear-gradient(90deg, var(--gold), rgba(212, 160, 23, 0)); }
.section-head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.section-flush-top { padding-top: 0; }

/* Announcements */
.announcement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.announcement-list { display: grid; gap: 1rem; max-width: 1100px; }
.announcement { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.announcement.is-pinned { border-color: rgba(212, 160, 23, .5); background: linear-gradient(160deg, var(--accent-50), var(--surface) 60%); }
.date-badge { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.6rem; height: 4.2rem; padding-top: .3rem; border-radius: 999px 999px 14px 14px; background: linear-gradient(160deg, #065f46, #047857); color: #fff; line-height: 1.05; text-align: center; }
.date-badge-day { font-size: 1.35rem; font-weight: 800; }
.date-badge-month { font-size: .7rem; font-weight: 650; color: var(--gold-light); }
.date-badge-icon { color: var(--gold-light); }
.announcement-body { flex: 1; min-width: 0; }
.announcement-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .4rem; font-size: .78rem; }
.announcement-posted { color: var(--muted); }
.announcement-title { font-size: 1.12rem; margin-bottom: .35rem; overflow-wrap: anywhere; }
.announcement-title a { color: var(--ink); text-decoration: none; }
.announcement-title a:hover { color: var(--brand-600); text-decoration: underline; }
.announcement-text { color: var(--ink-2); overflow-wrap: anywhere; }
.announcement-lang-note { margin-top: .4rem; font-size: .78rem; font-style: italic; color: var(--muted); }
.pill-gold { background: var(--accent-50); color: var(--accent-ink); border: 1px solid rgba(212, 160, 23, .4); }

/* Services */
.service-grid { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1rem; }
.service-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .35rem; }
.service-card::after { content: ""; position: absolute; top: -28px; right: -28px; width: 120px; height: 120px; background-color: var(--gold); opacity: .14; -webkit-mask: var(--pattern) 0 0 / 60px 60px repeat; mask: var(--pattern) 0 0 / 60px 60px repeat; pointer-events: none; }
.service-card h3 { margin: 0; }
.service-card .link-arrow { margin-top: auto; padding-top: .5rem; }
.service-icon { display: grid; place-items: center; width: 3rem; height: 3.2rem; margin-bottom: .5rem; border-radius: 999px 999px 12px 12px; background: var(--brand-50); color: var(--brand-600); }
.feature-photo { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; margin-bottom: 1.5rem; }

/* Link cards (About page) */
.prose .link-cards { list-style: none; padding: 0; display: grid; gap: .6rem; }
.prose .link-cards li { margin: 0; }
.link-card { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.link-card:hover { color: var(--ink); border-color: var(--brand-100); box-shadow: var(--shadow); }
.link-card .fact-icon { margin: 0; flex-shrink: 0; }
.link-card > span:last-child { display: grid; }

/* Admin prayer form */
.prayer-edit-table td { min-width: 9rem; }
.prayer-edit-table .prayer-ar { display: inline; margin-left: .35rem; }
.hijri-field { margin: 1.5rem 0; max-width: 420px; }
.form-actions { align-items: center; flex-wrap: wrap; }

/* Footer: deep green with a faint gold pattern */
.site-footer { overflow: hidden; background: var(--green-night); color: #cfe3d8; border-top: 4px solid var(--gold); padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.footer-pattern { background-color: var(--gold-light); opacity: .05; }
.site-footer .brand, .site-footer .brand:hover, .site-footer .brand-name { color: #fff; }
.site-footer .brand-sub, .footer-title { color: var(--gold-light); }
.site-footer .brand .brand-logo { width: 64px; height: 64px; border-color: transparent; }
.footer-brand p { color: #b8d2c6; }
.site-footer ul a { color: #dcebe4; }
.site-footer ul a:hover { color: #fff; }
.footer-small, .footer-bottom { color: #a9c5b8; }
.footer-small a, .footer-bottom a { color: var(--gold-light); }
.footer-bottom { border-top-color: rgba(255, 255, 255, .12); }
.footer-address { color: #dcebe4; }

/* ---------- Phones and tablets (iOS Safari, Android Chrome) ---------- */
html { -webkit-tap-highlight-color: rgba(5, 150, 105, .15); }
body { overflow-wrap: break-word; }
@supports (overflow: clip) { body { overflow-x: clip; } }
input[type=date], input[type=time] { min-height: 2.95rem; display: block; line-height: 1.4; }
input::-webkit-date-and-time-value { text-align: left; }
.sticky-actions { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 1240px) {
  html:lang(ta).js .site-nav.is-open { max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 1080px) {
  .js .site-nav.is-open { max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 900px) {
  .hero-jamath .hero-inner, .masjid-grid, .page-hero-split { grid-template-columns: minmax(0, 1fr); }
  .prayer-card { justify-self: stretch; max-width: none; }
  .hero-jamath::before { background: linear-gradient(180deg, rgba(3, 34, 25, .9) 0%, rgba(3, 34, 25, .82) 60%, rgba(3, 34, 25, .9) 100%); }
  .gallery-home { grid-template-columns: 1fr 1fr; }
  .gallery-home .gallery-masjid { grid-column: span 2; }
  .gallery-home .gallery-item { height: 220px; }
  .gallery-home .gallery-masjid { height: clamp(240px, 55vw, 420px); }
  .gallery-full { grid-template-columns: 1fr 1fr; }
  .gallery-full .gallery-night, .gallery-full .gallery-masjid { grid-column: span 2; }
  .gallery-full .gallery-item { height: 240px; }
  .arch-photo img { max-height: 420px; }
}
@media (max-width: 600px) {
  :root { --header-h: 66px; }
  .brand .brand-logo { width: 46px; height: 46px; border-radius: 13px; }
  .brand-name { font-size: .98rem; }
  .brand-sub { font-size: .68rem; }
  .topbar-place { display: none; }
  .topbar-hijri { font-size: .75rem; }
  .prayer-card { padding: 3.5rem .9rem 1.1rem; }
  .prayer-table th, .prayer-table td { padding: .5rem .55rem; }
  .arch { border-radius: 50% 50% var(--radius-lg) var(--radius-lg) / 80px 80px var(--radius-lg) var(--radius-lg); }
  .announcement { padding: 1rem; gap: .8rem; }
  .date-badge { width: 3.1rem; height: 3.7rem; }
  .feature-photo { grid-template-columns: minmax(0, 1fr); }
  .feature-photo .arch-photo { max-width: 320px; }
  .gallery-full .gallery-item, .gallery-home .gallery-item { height: 180px; }
  .gallery-full .gallery-night, .gallery-full .gallery-masjid, .gallery-home .gallery-masjid { height: 230px; }
  .section-head-row { align-items: flex-start; flex-direction: column; }
  .bismillah-hero .bismillah-ar { font-size: 1.6rem; }
  .prayer-edit-table td { min-width: 7.5rem; }
}
/* Comfortable touch targets on phones */
@media (pointer: coarse) {
  .chip { min-width: 2.75rem; height: 2.75rem; }
  .pager-link { min-width: 2.75rem; height: 2.75rem; }
  .lang-option { padding: .4rem .95rem; }
  .nav-toggle { padding: .7rem; }
  .btn-sm { padding: .62rem 1rem; }
  .segment span { padding: .55rem 1.1rem; }
  .site-footer ul { gap: .8rem; }
}
/* No sticky hover lift on touch screens */
@media (hover: none) {
  .btn:hover, .bento-card:hover, .fact-card:hover, .family-card:hover, .school-card:hover, .stat-link:hover { transform: none; }
  .gallery-item:hover img { transform: none; }
}
@media print {
  .hero-photo, .footer-pattern { display: none !important; }
  .hero-jamath { background: #fff; color: #000; }
  .hero-jamath h1, .hero-jamath .lead { color: #000; }
}

/* Refinements after device screenshots */
.bismillah-ar { justify-self: start; }
.prayer-table tr.is-next > * { background: #05694c; }
.bento-card.has-photo { isolation: isolate; }
.bento-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; opacity: .38; transition: transform .6s, opacity .3s; }
.bento-card.has-photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(4, 42, 32, .25) 0%, rgba(4, 42, 32, .92) 75%); }
.bento-card.has-photo:hover .bento-photo { transform: scale(1.04); opacity: .48; }
.bento-card.has-photo p { color: #d3e6dc; }
.date-badge { border-radius: 50% 50% 12px 12px / 42% 42% 12px 12px; }
.service-icon { border-radius: 50% 50% 12px 12px / 45% 45% 12px 12px; }

/* =====================================================================
   Compact pass – less vertical scrolling on every page
   ===================================================================== */
body { line-height: 1.55; }
:lang(ta) { line-height: 1.65; }
h1, .h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
:lang(ta) h1, :lang(ta) .h1 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h2, .h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
:lang(ta) h2, :lang(ta) .h2 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
h3, .h3 { font-size: 1.1rem; }
.section { padding: clamp(1.5rem, 3.2vw, 2.5rem) 0; }
.section-tight { padding-top: 1.25rem; }
.section-head { margin-bottom: 1rem; }
.section-head h2 { margin-bottom: 0; }
.section-head h2::after { margin-top: .4rem; width: 48px; }
.eyebrow { margin-bottom: .4rem; }
.page-hero { padding: clamp(1.25rem, 3vw, 2rem) 0 clamp(1rem, 2.5vw, 1.5rem); }
.page-hero-compact { padding-block: clamp(1.1rem, 2.6vw, 1.75rem) clamp(.9rem, 2vw, 1.4rem); }
.page-hero h1 { margin-bottom: .35rem; max-width: none; }
.page-hero .lead { font-size: 1rem; max-width: 90ch; }
.page-hero .lead p { margin-bottom: .4em; }
.card { padding: clamp(1rem, 2vw, 1.35rem); }
.stack > * + * { margin-top: .9rem; }
.callout { padding: 1rem 1.25rem; margin-top: 1rem; }
.source-note { margin-top: .75rem; }
.site-footer { margin-top: 1.5rem; padding-top: 2rem; }
.footer-grid { gap: 1.25rem 2rem; }
.footer-brand p { margin-top: .6rem; font-size: .875rem; }
.site-footer ul { gap: .35rem; }
.footer-bottom { margin-top: 1.25rem; padding-top: .9rem; }
.form-section { padding: clamp(1rem, 2.5vw, 1.5rem); }
.form-section-head { margin-bottom: 1rem; }
.membership-form { gap: 1rem; }
.prose h2 { margin-top: 1.25rem; }
.state-card { padding: clamp(1.25rem, 4vw, 2rem) 1.25rem; }
.state-compact { display: flex; gap: .75rem; align-items: center; text-align: left; padding: 1rem 1.25rem; }
.state-compact > .icon { margin: 0; flex-shrink: 0; }
.state-compact p { margin: 0; max-width: none; }

/* Home hero */
.hero-jamath { padding: clamp(1.5rem, 3.5vw, 2.75rem) 0; }
.hero-jamath .hero-inner { align-items: center; gap: clamp(1.25rem, 3vw, 2.5rem); }
.bismillah { margin-bottom: .5rem; }
.bismillah-hero .bismillah-ar { font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.7; }
.display-jamath { font-size: clamp(1.75rem, 3.4vw, 2.75rem); margin-bottom: .75rem; }
.display-jamath:lang(ta) { font-size: clamp(1.5rem, 2.8vw, 2.25rem); }
.hero-jamath .lead { font-size: 1rem; }
.hero-actions { margin-top: 1.1rem; }

/* Compact prayer card */
.prayer-card { padding: 2.6rem 1.1rem 1rem; }
.arch { border-radius: 50% 50% var(--radius-lg) var(--radius-lg) / 70px 70px var(--radius-lg) var(--radius-lg); }
.arch-crown { top: 10px; width: 34px; height: 34px; }
.arch-crown .icon { width: 1.05em; height: 1.05em; }
.prayer-title { font-size: 1.3rem; }
.prayer-kicker { margin: 0 0 .5rem; font-size: .78rem; }
.prayer-kicker .prayer-hijri { font-size: inherit; margin: 0; }
.prayer-table { border-spacing: 0 3px; }
.prayer-table th, .prayer-table td { padding: .38rem .6rem; }
.prayer-name { gap: .35rem; }
.prayer-name .prayer-ar { display: inline; font-size: .8rem; }
.prayer-sub { display: inline; }
.prayer-updated { margin-top: .35rem; font-size: .72rem; }
.prayer-link { margin-top: .5rem; }

/* Home: announcements + photos side by side */
.home-duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; }
.home-duo .section-head-row { align-items: center; flex-direction: row; }
.announcement-list-compact { gap: .6rem; }
.announcement-list-compact .announcement { padding: .8rem 1rem; gap: .8rem; }
.announcement-list-compact .announcement-title { font-size: 1rem; margin-bottom: .15rem; }
.announcement-list-compact .announcement-text { font-size: .9rem; }
.announcement-list-compact .date-badge { width: 3rem; height: 3.4rem; }
.announcement-list-compact .date-badge-day { font-size: 1.1rem; }
.announcement { padding: 1rem 1.1rem; }
.gallery { gap: .6rem; }
.gallery-quad { grid-template-columns: 1fr 1fr; }
.gallery-quad .gallery-item { height: clamp(120px, 12vw, 175px); }
.gallery-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery-row .gallery-item { height: clamp(150px, 16vw, 240px); }
.gallery-item figcaption { padding: 1.5rem .7rem .55rem; font-size: .78rem; }

/* Home: explore tiles */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; }
.tile { height: 100%; display: flex; align-items: flex-start; gap: .75rem; padding: .9rem 1rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile:hover { color: var(--ink); border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-2px); }
.tile-icon { flex-shrink: 0; display: grid; place-items: center; width: 2.4rem; height: 2.6rem; border-radius: 50% 50% 10px 10px / 45% 45% 10px 10px; background: var(--brand-50); color: var(--brand-600); }
.tile-gold .tile-icon { background: var(--accent-50); color: var(--accent-ink); }
.tile-rose .tile-icon { background: rgba(190, 18, 60, .08); color: var(--rose); }
.tile-ink { background: linear-gradient(135deg, #053d2e, #065f46); border-color: transparent; color: #fff; }
.tile-ink:hover { color: #fff; }
.tile-ink .tile-icon { background: rgba(255, 255, 255, .12); color: var(--gold-light); }
.tile-ink .tile-desc { color: #c9e2d6; }
.tile-text { display: grid; gap: .15rem; min-width: 0; flex: 1; }
.tile-text strong { font-size: .98rem; line-height: 1.3; }
.tile-desc { font-size: .8rem; line-height: 1.45; color: var(--muted); }
.tile-arrow { margin-top: .3rem; color: var(--muted); }
.tile-ink .tile-arrow { color: var(--gold-light); }
@media (prefers-color-scheme: dark) { .tile-rose .tile-icon { color: #fda4af; } }

/* Home: facts + slim CTA */
.facts-compact { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.facts-compact .fact-card { padding: .8rem .9rem; gap: .1rem; }
.facts-compact .fact-icon { width: 2rem; height: 2rem; border-radius: 10px; margin-bottom: .3rem; }
.facts-compact .fact-icon .icon { width: 1.05em; height: 1.05em; }
.facts-compact .fact-value { font-size: 1.02rem; }
.facts-compact .fact-label { font-size: .75rem; }
.facts-compact .fact-note { font-size: .7rem; }
.section-head-row .source-note { margin: 0; font-size: .75rem; }
.cta-slim { padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1.1rem, 3vw, 2rem); gap: 1rem 2rem; grid-template-columns: minmax(0, 1fr) auto; }
.cta-slim h2 { font-size: clamp(1.1rem, 2vw, 1.35rem); margin-bottom: .25rem; }
.cta-slim p { font-size: .9rem; margin: 0; }
.cta-slim .cta-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }

/* Masjid & services */
.masjid-grid { gap: 1rem; }
.masjid-grid .stack > * + * { margin-top: .75rem; }
.jumuah-card .meta-list > div { padding: .35rem 0; }
.service-grid { gap: .75rem; margin-bottom: 1rem; }
.service-card { gap: .25rem; }
.service-head { display: flex; align-items: center; gap: .7rem; }
.service-head .service-icon { margin: 0; width: 2.4rem; height: 2.6rem; flex-shrink: 0; }
.service-card p { font-size: .9rem; margin: 0; }
.feature-photo { grid-template-columns: 180px minmax(0, 1fr); margin-bottom: 0; padding: 1rem; }
.feature-photo h2 { margin-bottom: .3rem; }
.feature-photo p { margin-bottom: .4rem; }
.arch-photo-sm img { border-width: 4px; }

/* Directory & about */
.search-panel { margin-top: -1.5rem; }
.family-grid { gap: .6rem; margin-bottom: 1rem; }
.family-card { padding: .8rem 1rem; }
.location-card .location-visual { display: none; }
.meta-list > div { padding: .4rem 0; }

@media (max-width: 1080px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .home-duo { grid-template-columns: minmax(0, 1fr); }
  .gallery-quad .gallery-item { height: clamp(110px, 26vw, 200px); }
  .gallery-row { grid-template-columns: 1fr 1fr; }
  .gallery-row .gallery-item { height: clamp(120px, 28vw, 220px); }
  .cta-slim { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .section { padding: 1.25rem 0; }
  .hero-jamath { padding: 1.25rem 0 1.5rem; }
  .bismillah-hero .bismillah-ar { font-size: 1.35rem; }
  .bismillah-tr { font-size: .75rem; }
  .hero-jamath .lead { font-size: .95rem; }
  .hero-actions { gap: .5rem; }
  .hero-actions .btn { width: auto; flex: 1 1 0; padding-inline: .8rem; }
  .prayer-card { padding: 2.4rem .7rem .8rem; }
  .prayer-table th, .prayer-table td { padding: .32rem .45rem; font-size: .9rem; }
  .prayer-table thead th { font-size: .66rem; }
  .tiles { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .tiles li:first-child { grid-column: span 2; }
  .tile { padding: .7rem .75rem; gap: .55rem; align-items: center; }
  .tile-desc, .tile-arrow { display: none; }
  .tiles li:first-child .tile-desc { display: block; }
  .tile-icon { width: 2.1rem; height: 2.3rem; }
  .tile-text strong { font-size: .9rem; }
  .facts-compact { grid-template-columns: 1fr 1fr; }
  .facts-compact .fact-card-dated { grid-column: span 2; }
  .section-head-row { flex-direction: row; align-items: center; }
  .section-head-row .source-note { flex-basis: 100%; }
  .gallery-row .gallery-item, .gallery-quad .gallery-item { height: 120px; }
  .gallery-item figcaption { font-size: .7rem; padding: 1.2rem .5rem .4rem; }
  .announcement { padding: .8rem; }
  .feature-photo { grid-template-columns: 96px minmax(0, 1fr); gap: .9rem; align-items: start; }
  .feature-photo .arch-photo { max-width: none; }
  .feature-photo .eyebrow { display: none; }
  .service-grid { grid-template-columns: minmax(0, 1fr); }
  .service-card { padding: .85rem 1rem; }
  .page-hero .lead { font-size: .95rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
  .footer-brand, .footer-grid > div:last-child { grid-column: span 2; }
  .footer-brand p { display: none; }
  .site-footer { padding-top: 1.5rem; }
  .site-footer ul a { font-size: .9rem; }
  .footer-bottom { flex-direction: row; flex-wrap: wrap; margin-top: .9rem; }
  .meta-list > div, .meta-cols > div { grid-template-columns: minmax(100px, 40%) 1fr; gap: .5rem; }
}
@media (pointer: coarse) { .site-footer ul { gap: .55rem; } }
.prayer-card { padding-top: 2.95rem; }
@media (max-width: 600px) {
  .hero-actions .btn { flex: 1 1 100%; font-size: .9rem; padding-block: .6rem; white-space: normal; }
  .cta-slim p { display: none; }
  .cta-slim .cta-actions .btn { flex: 1 1 auto; }
  .facts-compact .fact-icon { display: none; }
  .footer-small { display: none; }
  .bismillah-tr { display: none; }
}
@media (max-width: 600px) {
  .footer-address { font-size: .9rem; font-weight: 500; }
  .footer-bottom { gap: .25rem 1rem; }
  .footer-bottom p { margin: 0; }
}
@media (max-width: 600px) {
  .site-footer nav { display: none; }
  .footer-brand { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
  .footer-brand .lang-switch-footer { margin-top: 0; }
  .site-footer .brand .brand-logo { width: 48px; height: 48px; }
  .footer-title { margin-bottom: .3rem; }
}
.school-grid { gap: .75rem; margin-bottom: 1rem; }
.school-card { padding: 1rem 1.1rem; }
.school-card h3 { margin-bottom: .2rem; }
.school-card p { margin-bottom: .4rem; }
.school-num { font-size: 2.4rem; top: .35rem; }
.school-card .fact-icon { width: 2.2rem; height: 2.2rem; margin-bottom: .4rem; }
@media (max-width: 600px) {
  .school-card .fact-icon { display: none; }
  .school-card h3 { padding-right: 3rem; }
  .alpha-filter { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: .25rem; margin-top: .9rem; padding-top: .8rem; }
  .alpha-filter::-webkit-scrollbar { display: none; }
  .alpha-filter .chip, .alpha-filter > span { flex-shrink: 0; }
  .search-panel { padding: 1rem; }
  .access-note { margin: 1rem 0; }
}

/* Circular logo */
.brand .brand-logo, .site-footer .brand .brand-logo { border-radius: 50%; border: 0; background: transparent; box-shadow: 0 2px 8px -2px rgba(4, 42, 32, .35); object-fit: contain; }

/* =====================================================================
   Services release: menus, ads, businesses, events, chat, nikah, madrasa
   ===================================================================== */

/* Dropdown menus */
.nav-links .has-sub { position: relative; }
.nav-sub-toggle { display: inline-flex; align-items: center; gap: .3rem; padding: .45rem .75rem; border-radius: 999px; border: 0; background: none; font: inherit; font-weight: 550; font-size: .925rem; color: var(--ink-2); cursor: pointer; }
.nav-sub-toggle:hover { background: var(--surface-2); color: var(--ink); }
.nav-sub-toggle.is-current { background: #065f46; color: #fff; }
.nav-sub-toggle .icon { transition: transform .2s; }
.has-sub.is-open > .nav-sub-toggle .icon { transform: rotate(180deg); }
.nav-sub { list-style: none; margin: 0; padding: .4rem; position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none; }
.has-sub.is-open > .nav-sub { display: block; animation: drop .15s ease-out; }
.no-js .has-sub:hover > .nav-sub, .no-js .has-sub:focus-within > .nav-sub { display: block; }
.nav-sub a { display: block; padding: .55rem .8rem; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: .92rem; }
.nav-sub a:hover { background: var(--surface-2); color: var(--ink); }
.nav-sub a[aria-current="page"] { background: var(--brand-50); color: var(--brand-600); }
:lang(ta) .nav-sub-toggle { font-size: .875rem; padding-inline: .6rem; }
.nav-messages { position: relative; }
.badge-count { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: .7rem; font-weight: 800; line-height: 1; }
@media (max-width: 1240px) {
  html:lang(ta).js .nav-sub { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 0 1rem; min-width: 0; background: transparent; }
  html:lang(ta).js .has-sub.is-open > .nav-sub { display: block; }
  html:lang(ta).js .nav-sub-toggle { width: 100%; justify-content: space-between; padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
}
@media (max-width: 1080px) {
  .js .nav-sub { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 0 1rem; min-width: 0; background: transparent; }
  .js .has-sub.is-open > .nav-sub { display: block; }
  .js .nav-sub-toggle { width: 100%; justify-content: space-between; padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
  .js .nav-sub a { padding: .65rem 1rem; font-size: .98rem; }
}

/* Advertisement strip: 75% width, 96px high, below the menu */
.ad-strip { display: flex; justify-content: center; padding: .6rem 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.ad-frame { position: relative; width: 75%; height: 96px; overflow: hidden; border-radius: 12px; background: var(--surface-2); box-shadow: var(--shadow-sm); }
.ad-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s; }
.ad-slide.is-active { opacity: 1; visibility: visible; transition: opacity .6s ease; }
.ad-slide a, .ad-slide img { display: block; width: 100%; height: 100%; }
.ad-slide img { object-fit: cover; }
.ad-label { position: absolute; top: 4px; right: 6px; padding: 0 .4rem; border-radius: 6px; font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: rgba(0, 0, 0, .45); color: #fff; pointer-events: none; }
.ad-thumb { display: block; width: 160px; height: auto; max-height: 24px; object-fit: cover; border-radius: 4px; margin-bottom: .3rem; }
.ad-preview img { width: 100%; height: 96px; object-fit: cover; border-radius: 12px; }

/* Shared */
.page-hero-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; }
.page-hero-row > div { flex: 1 1 420px; min-width: 0; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-pad { padding: 1rem 1.25rem; margin: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tfoot th, .data-table tfoot td { padding: .75rem 1rem; border-top: 2px solid var(--line-strong); }
.avatar-sm { width: 2.4rem; height: 2.4rem; font-size: .95rem; border-radius: 50%; }
.icon-rose { background: rgba(190, 18, 60, .08); color: var(--rose); }
.stat-sm { font-size: 1.5rem !important; }
.steps-row { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: .75rem; }
.steps-row .card { display: grid; gap: .35rem; align-content: start; }
.steps-row .step, .steps-row .service-icon { margin-bottom: .25rem; }
.chip-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.photo-manage { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.photo-manage li { display: grid; gap: .3rem; justify-items: start; }
.photo-manage img { width: 160px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.service-link { text-decoration: none; color: var(--ink); height: 100%; transition: border-color .15s, box-shadow .15s, transform .15s; }
.service-link:hover { color: var(--ink); border-color: var(--brand-100); box-shadow: var(--shadow); transform: translateY(-2px); }
.service-link .link-arrow { margin-top: auto; }
.service-grid > li { display: flex; }
.service-grid > li > * { flex: 1; }
.profile-actions { margin-top: .9rem; }

/* Business directory */
.business-search { display: grid; grid-template-columns: 2fr 1.3fr 1.3fr .9fr auto; gap: .75rem; align-items: end; margin-top: 0; }
.business-grid, .event-grid, .nikah-grid { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: .9rem; }
.business-card, .event-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.business-card:hover, .event-card:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand-100); }
.business-cover, .event-cover { position: relative; display: grid; place-items: center; height: 150px; background: linear-gradient(160deg, var(--brand-50), var(--accent-50)); color: var(--brand-500); }
.business-cover img, .event-cover img { width: 100%; height: 100%; object-fit: cover; }
.business-body, .event-body { display: grid; gap: .3rem; padding: .85rem 1rem 1rem; justify-items: start; }
.business-body strong, .event-body strong { font-size: 1.02rem; line-height: 1.3; }
.business-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.business-gallery, .event-gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.business-gallery .gallery-item, .event-gallery .gallery-item { height: 190px; }
.business-contact { position: sticky; top: calc(var(--header-h) + 1rem); }

/* Events */
.event-date { font-size: .8rem; font-weight: 650; color: var(--accent-ink); display: inline-flex; gap: .3rem; align-items: center; }
.live-badge { position: absolute; top: .6rem; left: .6rem; display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: .72rem; font-weight: 750; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; margin-bottom: .75rem; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Chat */
.chat-layout { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 1rem; height: calc(100vh - var(--header-h) - 120px); height: calc(100dvh - var(--header-h) - 120px); min-height: 460px; }
.chat-list { display: flex; flex-direction: column; overflow: hidden; }
.chat-list-title { padding: 1rem 1.1rem; margin: 0; border-bottom: 1px solid var(--line); display: flex; gap: .4rem; align-items: center; }
.chat-list ul { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: .7rem; align-items: center; padding: .65rem .7rem; border-radius: 12px; color: var(--ink); text-decoration: none; }
.chat-item:hover { background: var(--surface-2); color: var(--ink); }
.chat-item.is-active { background: var(--brand-50); }
.chat-item-body { display: grid; min-width: 0; }
.chat-item-body strong { display: flex; gap: .35rem; align-items: center; }
.chat-item-biz, .chat-item-last { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-empty, .chat-placeholder { padding: 1.5rem; text-align: center; color: var(--muted); }
.chat-placeholder { margin: auto; }
.chat-placeholder .icon { margin: 0 auto .75rem; color: var(--brand-500); }
.chat-thread { display: flex; flex-direction: column; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; }
.chat-head p { margin: 0; }
.chat-head .chat-block { margin-left: auto; }
.chat-back { display: none; font-size: 1.3rem; text-decoration: none; padding: .2rem .5rem; }
.chat-messages { list-style: none; margin: 0; padding: 1rem; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; background: var(--bg-tint); overscroll-behavior: contain; }
.msg { max-width: min(78%, 560px); padding: .55rem .8rem .4rem; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; box-shadow: var(--shadow-sm); }
.msg p { margin: 0; overflow-wrap: anywhere; }
.msg time { display: block; font-size: .68rem; color: var(--muted); margin-top: .15rem; text-align: right; }
.msg-mine { align-self: flex-end; background: #065f46; border-color: transparent; color: #fff; border-radius: 16px 16px 4px 16px; }
.msg-mine time { color: #bfe3d3; }
.chat-start { align-self: center; padding: 1rem; }
.chat-composer { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem; border-top: 1px solid var(--line); background: var(--surface); padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
.chat-composer textarea { flex: 1; resize: none; min-height: 2.9rem; max-height: 160px; }
.chat-composer .btn { padding: .75rem; border-radius: 50%; }
.chat-blocked { padding: .9rem 1.1rem; margin: 0; border-top: 1px solid var(--line); color: var(--muted); display: flex; gap: .4rem; align-items: center; }
.chat-error { padding: 0 1rem .6rem; }
.chat-embed { display: flex; flex: 1; flex-direction: column; min-height: 0; padding: 0; }
.chat-embed-picker { display: grid; flex: 0 0 auto; gap: .4rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-embed-picker label { margin: 0; font-weight: 650; color: var(--ink-2); }
.chat-embed-picker select { width: 100%; min-height: 3.2rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; }
.chat-layout.is-embed { display: flex; flex: 1; min-width: 0; min-height: 0; height: auto; gap: 0; }
.chat-layout.is-embed .chat-list { display: none; }
.chat-layout.is-embed .chat-thread { flex: 1; height: auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.chat-layout.is-embed:not(.has-thread) .chat-thread { display: flex; }
.chat-layout.is-embed .chat-messages { background: var(--surface); }

/* Nikah */
.nikah-search { display: grid; grid-template-columns: auto .7fr .7fr 1.6fr auto; gap: .75rem; align-items: end; margin-top: 0; }
.nikah-card { display: flex; gap: .9rem; align-items: center; padding: .85rem; height: 100%; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); }
.nikah-card:hover { color: var(--ink); border-color: var(--brand-100); box-shadow: var(--shadow); }
.nikah-photo { flex-shrink: 0; display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; overflow: hidden; background: var(--surface-2); color: var(--muted); }
.nikah-photo img { width: 100%; height: 100%; object-fit: cover; }
.nikah-body { display: grid; gap: .2rem; justify-items: start; min-width: 0; }
.nikah-photo-lg { width: 100%; max-width: 320px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-lg); }

/* Prayer clock and current prayer */
.prayer-clock { display: inline-flex; align-items: center; gap: .35rem; margin: 0 0 .55rem; padding: .25rem .75rem; border-radius: 999px; background: var(--brand-50); color: var(--brand-600); font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.prayer-clock time { font-weight: 800; }
.prayer-clock abbr { text-decoration: none; font-size: .72rem; opacity: .8; }
.prayer-table tr.is-current > * { background: #05694c; color: #fff; }
.prayer-table tr.is-current .prayer-name, .prayer-table tr.is-current .prayer-ar, .prayer-table tr.is-current .prayer-sub { color: #fff; }
.prayer-table tr.is-current .prayer-iqamah { color: var(--gold-light); }
.prayer-table tr.is-next:not(.is-current) > * { background: var(--accent-50); color: var(--ink); }
.prayer-table tr.is-next:not(.is-current) .prayer-name { color: var(--ink); }
.prayer-table tr.is-next:not(.is-current) .prayer-iqamah { color: var(--brand); }
.pill-now { background: var(--gold-light); color: var(--green-deep); }
.prayer-table tr.is-next:not(.is-current) .pill-next { background: var(--brand-600); color: #fff; }
.pill[hidden] { display: none; }

@media (max-width: 1080px) {
  .business-search { grid-template-columns: 1fr 1fr; }
  .business-search .field:first-of-type { grid-column: span 2; }
  .nikah-search { grid-template-columns: 1fr 1fr; }
  .nikah-search fieldset, .nikah-search .field:nth-of-type(4) { grid-column: span 2; }
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .business-layout { grid-template-columns: minmax(0, 1fr); }
  .business-contact { position: static; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .chat-layout.has-thread .chat-list { display: none; }
  .chat-layout:not(.has-thread) .chat-thread { display: none; }
  .chat-thread { height: calc(100vh - var(--header-h) - 110px); height: calc(100dvh - var(--header-h) - 110px); min-height: 420px; }
  .chat-back { display: inline-block; }
}
@media (max-width: 600px) {
  .ad-frame { height: 96px; }
  .business-search, .nikah-search { grid-template-columns: 1fr; }
  .business-search .field:first-of-type, .nikah-search fieldset, .nikah-search .field:nth-of-type(4) { grid-column: auto; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .business-cover, .event-cover { height: 130px; }
  .business-gallery .gallery-item, .event-gallery .gallery-item { height: 150px; }
  .msg { max-width: 88%; }
  .page-hero-row .btn { width: 100%; }
  .photo-manage img { width: 130px; height: 90px; }
}

/* Compact desktop header: one line for eight menu items */
.header-inner { gap: 1rem; }
.site-nav { gap: .5rem; }
.nav-links { gap: 0; flex-wrap: nowrap; }
.nav-links a, .nav-sub-toggle { padding: .42rem .6rem; font-size: .9rem; white-space: nowrap; }
.brand-text { white-space: nowrap; }
.nav-actions { gap: .25rem; flex-shrink: 0; }
.prayer-table tr.is-next:not(.is-current) .prayer-ar, .prayer-table tr.is-next:not(.is-current) .prayer-sub { color: var(--muted); }
@media (min-width: 1081px) {
  .nav-icon-btn { padding: .5rem; position: relative; }
  .nav-icon-btn .nav-btn-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-icon-btn .badge-count { position: absolute; top: -4px; right: -6px; }
}
@media (max-width: 1360px) and (min-width: 1081px) {
  .brand-sub { display: none; }
  .brand .brand-logo { width: 48px; height: 48px; }
  .nav-links a, .nav-sub-toggle { padding-inline: .45rem; font-size: .86rem; }
}
/* English: collapse to the menu button a little earlier so items never wrap */
@media (max-width: 1240px) {
  html:lang(en).js .nav-toggle { display: inline-flex; }
  html:lang(en).js .site-nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 1rem; background: var(--surface); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.5rem; box-shadow: var(--shadow-lg); display: none; max-height: calc(100dvh - 120px); overflow-y: auto; }
  html:lang(en).js .site-nav.is-open { display: flex; }
  html:lang(en).js .nav-links { flex-direction: column; flex-wrap: nowrap; }
  html:lang(en).js .nav-links a { padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
  html:lang(en).js .nav-sub { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 0 1rem; min-width: 0; background: transparent; }
  html:lang(en).js .has-sub.is-open > .nav-sub { display: block; }
  html:lang(en).js .nav-sub-toggle { width: 100%; justify-content: space-between; padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
  html:lang(en).js .nav-actions { flex-wrap: wrap; }
}
/* Tamil labels are longer: collapse below 1440px */
@media (max-width: 1440px) {
  html:lang(ta).js .nav-toggle { display: inline-flex; }
  html:lang(ta).js .site-nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 1rem; background: var(--surface); border-bottom: 1px solid var(--line); padding: 1rem 1.25rem 1.5rem; box-shadow: var(--shadow-lg); display: none; max-height: calc(100dvh - 120px); overflow-y: auto; }
  html:lang(ta).js .site-nav.is-open { display: flex; }
  html:lang(ta).js .nav-links { flex-direction: column; flex-wrap: nowrap; }
  html:lang(ta).js .nav-links a { padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
  html:lang(ta).js .nav-sub { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 0 1rem; min-width: 0; background: transparent; }
  html:lang(ta).js .has-sub.is-open > .nav-sub { display: block; }
  html:lang(ta).js .nav-sub-toggle { width: 100%; justify-content: space-between; padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; }
  html:lang(ta).js .nav-actions { flex-wrap: wrap; }
  html:lang(ta) .nav-icon-btn { padding: .45rem .9rem; }
  html:lang(ta) .nav-icon-btn .nav-btn-label { position: static !important; width: auto; height: auto; clip: auto; }
}
/* Fixes after screenshots */
.business-cover, .event-cover { overflow: hidden; }
.business-body .small, .event-body .small, .nikah-body .small, .event-date { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
h1 > .icon, h2 > .icon, h3 > .icon, h4 > .icon, .lead > .icon { display: inline-block; vertical-align: -0.15em; }
.page-hero .back-link { display: block; width: fit-content; margin-bottom: .5rem; }

/* Compact footer: logo + office address on one line, then copyright */
.site-footer { margin-top: 1.5rem; padding-top: 1.25rem; padding-bottom: calc(.9rem + env(safe-area-inset-bottom, 0px)); }
.footer-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; }
.footer-office { display: flex; align-items: center; gap: .45rem; margin: 0; color: #dcebe4; font-size: .92rem; white-space: nowrap; }
.footer-office strong { color: var(--gold-light); font-weight: 650; }
.footer-office .icon { color: var(--gold-light); flex-shrink: 0; }
.site-footer .footer-bottom { margin-top: .9rem; padding-top: .7rem; }
@media (max-width: 900px) {
  .footer-office { white-space: normal; align-items: flex-start; }
  .footer-office .icon { margin-top: .2rem; }
}
@media (max-width: 600px) {
  .site-footer .brand .brand-logo { width: 42px; height: 42px; }
  .footer-office { font-size: .85rem; }
}
@media (max-width: 900px) {
  .footer-office { display: block; }
  .footer-office .icon { display: inline-block; vertical-align: -0.15em; margin: 0 .3rem 0 0; }
}

/* Account actions in the top bar: language · Register family · Register business · icons · Sign in */
.topbar-inner { min-height: 44px; }
.topbar-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.topbar-actions { display: flex; align-items: center; gap: .35rem; }
.top-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); color: #eef6f1; font-size: .8rem; font-weight: 650; line-height: 1.4; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.top-btn:hover { color: #fff; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .4); }
.top-btn-primary { background: var(--gold-light); border-color: var(--gold-light); color: var(--green-deep); }
.top-btn-primary:hover { background: #f7dd95; color: var(--green-deep); }
.top-btn[aria-current="page"] { box-shadow: 0 0 0 2px rgba(243, 210, 122, .6); }
.top-icon { position: relative; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #eef6f1; cursor: pointer; text-decoration: none; padding: 0; font: inherit; }
.top-icon:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.top-icon[aria-current="page"] { background: var(--gold-light); color: var(--green-deep); border-color: var(--gold-light); }
.top-icon .badge-count { position: absolute; top: -5px; right: -6px; min-width: 1.1rem; height: 1.1rem; font-size: .62rem; }
.top-btn:focus-visible, .top-icon:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.topbar .inline-form { display: inline-flex; }
@media (pointer: coarse) { .top-icon { width: 2.4rem; height: 2.4rem; } .top-btn { padding: .45rem .85rem; } }
@media (max-width: 900px) {
  .topbar-place { display: none; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; row-gap: .35rem; padding-block: .35rem; }
  .topbar-note { display: none; }
  .topbar-right { width: 100%; justify-content: space-between; }
}
@media (max-width: 480px) {
  /* Icon-only buttons on small phones (labels stay available to screen readers) */
  .topbar-actions:not(.is-signed-in) .top-btn { font-size: .76rem; padding: .4rem .65rem; }
  .is-signed-in .top-btn { padding: .45rem; border-radius: 50%; width: 2.4rem; height: 2.4rem; justify-content: center; }
  .is-signed-in .top-btn span { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topbar-actions { gap: .3rem; }
}
@media (max-width: 480px) {
  .lang-switch-top .lang-option { padding: .3rem .6rem; font-size: .76rem; }
  .is-signed-in .top-btn, .is-signed-in .top-icon { width: 2.2rem; height: 2.2rem; }
  .topbar-actions.is-signed-in { gap: .22rem; }
  .topbar-right { gap: .4rem; }
}
@media (max-width: 380px) {
  .is-signed-in .top-btn, .is-signed-in .top-icon { width: 2rem; height: 2rem; }
  .topbar-actions.is-signed-in { gap: .15rem; }
  .lang-switch-top .lang-option { padding: .28rem .5rem; }
}

/* Very compact footer: logo | office address + © · Privacy and Disclaimer */
.site-footer { margin-top: 1.25rem; padding-top: .9rem; padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px)); }
.footer-main { gap: .6rem 2rem; }
.footer-info { display: grid; gap: .2rem; justify-items: end; text-align: right; }
.footer-office { font-size: .88rem; }
.footer-legal { margin: 0; font-size: .78rem; color: #a9c5b8; }
.footer-legal a { color: var(--gold-light); }
.site-footer .brand .brand-logo { width: 44px; height: 44px; }
@media (max-width: 900px) {
  .footer-info { justify-items: start; text-align: left; }
}
.footer-legal a { white-space: nowrap; }

/* =====================================================================
   Single fixed header (logo · menu · language · account) + fixed footer
   ===================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--green-deep); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid rgba(243, 210, 122, .28); box-shadow: 0 6px 20px -14px rgba(0, 0, 0, .6); }
.site-header.is-scrolled { border-bottom-color: rgba(243, 210, 122, .28); }
.header-inner { min-height: 64px; gap: .75rem; flex-wrap: nowrap; position: relative; }
.site-header .brand, .site-header .brand:hover { color: #fff; flex-shrink: 0; }
.site-header .brand-name { color: #fff; }
.site-header .brand-sub { color: var(--gold-light); }
.site-header .brand .brand-logo { width: 48px; height: 48px; box-shadow: 0 0 0 2px rgba(243, 210, 122, .5); }
.site-header .site-nav { flex: 1 1 auto; min-width: 0; justify-content: center; }
.header-controls { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.site-header:not(.nav-collapsed) .header-controls { margin-left: auto; }
.header-controls .topbar-actions { display: flex; align-items: center; gap: .35rem; }
.site-header .nav-toggle { margin-left: 0; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }

/* Menu on the dark header (expanded state) */
.site-header:not(.nav-collapsed) .nav-links a, .site-header:not(.nav-collapsed) .nav-sub-toggle { color: #e6efe9; }
.site-header:not(.nav-collapsed) .nav-links a:hover, .site-header:not(.nav-collapsed) .nav-sub-toggle:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.site-header:not(.nav-collapsed) .nav-links > li > a[aria-current="page"], .site-header:not(.nav-collapsed) .nav-sub-toggle.is-current { background: var(--gold-light); color: var(--green-deep); }

/* Collapsed menu: the menu button opens a white panel under the header */
.site-header.nav-collapsed .nav-toggle { display: inline-flex; }
.site-header.nav-collapsed .site-nav { position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: .25rem; background: var(--surface); border-bottom: 1px solid var(--line); padding: .75rem 1.25rem 1.25rem; box-shadow: var(--shadow-lg); display: none; max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain; }
.site-header.nav-collapsed .site-nav.is-open { display: flex; animation: drop .18s ease-out; }
.site-header.nav-collapsed .nav-links { flex-direction: column; flex-wrap: nowrap; }
.site-header.nav-collapsed .nav-links a { padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; color: var(--ink-2); }
.site-header.nav-collapsed .nav-links > li > a[aria-current="page"] { background: #065f46; color: #fff; }
.site-header.nav-collapsed .nav-sub-toggle { width: 100%; justify-content: space-between; padding: .75rem 1rem; border-radius: 12px; font-size: 1rem; color: var(--ink-2); }
.site-header.nav-collapsed .nav-sub-toggle.is-current { background: var(--brand-50); color: var(--brand-600); }
.site-header.nav-collapsed .nav-sub { position: static; display: none; box-shadow: none; border: 0; padding: 0 0 0 1rem; min-width: 0; background: transparent; }
.site-header.nav-collapsed .has-sub.is-open > .nav-sub { display: block; }
.site-header.nav-collapsed .nav-sub a { padding: .6rem 1rem; font-size: .96rem; }
.site-header.nav-collapsed .header-controls { flex-direction: column; align-items: stretch; gap: .75rem; margin: .5rem 0 0; padding: .9rem 0 0; border-top: 1px solid var(--line); }
.site-header.nav-collapsed .header-controls .topbar-actions { display: grid; gap: .35rem; }
.site-header.nav-collapsed .header-controls .top-btn { justify-content: flex-start; padding: .65rem .8rem; border-radius: 10px; border-color: var(--line); color: var(--ink-2); }
.site-header.nav-collapsed .header-controls .top-btn:hover { background: var(--surface-2); color: var(--ink); }
.site-header.nav-collapsed .header-controls .top-btn-primary { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.site-header.nav-collapsed .header-controls .top-btn-primary:hover { filter: brightness(.92); color: #fff; }
.site-header.nav-collapsed .header-controls .top-icon { color: var(--ink-2); border-color: var(--line); }
.site-header.nav-collapsed .header-controls .user-sub { left: 0; right: auto; top: calc(100% + 4px); }

/* Phones: logo + menu button; account and language controls live in the menu */
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; row-gap: .4rem; padding-block: .45rem; min-height: 0; }
  .site-header .brand { order: 1; flex: 1 1 auto; min-width: 0; }
  .site-header .nav-toggle { order: 2; }
  .site-header .brand .brand-logo { width: 40px; height: 40px; }
  .site-header .brand-sub { display: none; }
}

/* Fixed footer */
.site-footer { position: sticky; bottom: 0; z-index: 40; margin-top: 1.25rem; padding-top: .55rem; padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px)); border-top-width: 3px; }
.site-footer .brand .brand-logo { width: 36px; height: 36px; }
.site-footer .brand-text { line-height: 1.15; }
.site-footer .brand-name { font-size: .95rem; }
.site-footer .brand-sub { font-size: .68rem; }
.footer-office { font-size: .82rem; }
.footer-legal { font-size: .74rem; }
@media (max-width: 900px) {
  .site-footer .brand { display: none; }
  .footer-office { font-size: .76rem; line-height: 1.45; }
  .footer-legal { font-size: .7rem; }
}

/* Floating chat button (signed-in users) */
.chat-fab { position: fixed; z-index: 45; right: max(1rem, env(safe-area-inset-right, 0px)); bottom: calc(var(--footer-h, 72px) + 1rem); display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: linear-gradient(135deg, #065f46, #047857); color: var(--gold-light); box-shadow: 0 10px 24px -8px rgba(4, 42, 32, .6), 0 0 0 3px rgba(243, 210, 122, .45); text-decoration: none; transition: transform .15s; }
.chat-fab:hover { color: #fff; transform: translateY(-2px); }
.chat-fab:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
.chat-fab .icon { width: 1.6rem; height: 1.6rem; }
.chat-fab .badge-count { position: absolute; top: -2px; right: -2px; }
@media print { .chat-fab { display: none !important; } .site-header, .site-footer { position: static !important; } }

/* Chat page fits between the fixed header and footer */
.chat-layout { height: calc(100vh - var(--header-h, 64px) - var(--footer-h, 72px) - 70px); height: calc(100dvh - var(--header-h, 64px) - var(--footer-h, 72px) - 70px); }
@media (max-width: 900px) {
  .chat-thread { height: calc(100vh - var(--header-h, 64px) - var(--footer-h, 72px) - 60px); height: calc(100dvh - var(--header-h, 64px) - var(--footer-h, 72px) - 60px); }
}

/* User menu (icon → My account / Admin / Sign out) */
.user-menu { position: relative; }
.user-sub { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 210px; padding: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.user-menu.is-open .user-sub { display: grid; animation: drop .15s ease-out; }
.no-js .user-menu:focus-within .user-sub, .no-js .user-menu:hover .user-sub { display: grid; }
.user-sub-name { margin: 0; padding: .45rem .8rem .5rem; font-size: .78rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: .25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-sub a, .user-sub button { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .6rem .8rem; border: 0; border-radius: 10px; background: none; font: inherit; font-size: .92rem; font-weight: 550; color: var(--ink-2); text-decoration: none; cursor: pointer; text-align: left; }
.user-sub a:hover, .user-sub button:hover { background: var(--surface-2); color: var(--ink); }
.user-sub a[aria-current="page"] { background: var(--brand-50); color: var(--brand-600); }
.user-sub form { margin: 0; }
.user-sub button { color: var(--danger); }
.user-menu.is-open .user-menu-toggle { background: var(--gold-light); color: var(--green-deep); border-color: var(--gold-light); }
.site-header .site-nav { overflow: visible; }
.site-header:not(.nav-collapsed) .nav-links { justify-content: center; }
.site-header.nav-collapsed .header-controls { margin-left: auto; }
.site-header:not(.nav-collapsed) .nav-toggle { display: none; }
/* Menu on a second row inside the header when one row is too narrow */
.site-header.nav-two-rows .header-inner { flex-wrap: wrap; row-gap: 0; }
.site-header.nav-two-rows .header-controls { margin-left: auto; }
.site-header.nav-two-rows .site-nav { order: 5; flex-basis: 100%; justify-content: center; padding: .1rem 0 .45rem; border-top: 1px solid rgba(255, 255, 255, .08); }
/* The measured state (.nav-collapsed) decides the menu layout; neutralise older width-based rules */
html body .site-header:not(.nav-collapsed) .nav-toggle { display: none; }
html body .site-header:not(.nav-collapsed) .site-nav { position: static; display: flex; flex-direction: row; align-items: center; gap: .5rem; background: transparent; border: 0; padding: 0; box-shadow: none; max-height: none; overflow: visible; animation: none; }
html body .site-header.nav-two-rows:not(.nav-collapsed) .site-nav { padding: .1rem 0 .45rem; border-top: 1px solid rgba(255, 255, 255, .08); }
html body .site-header:not(.nav-collapsed) .nav-links { flex-direction: row; flex-wrap: nowrap; }
html body .site-header:not(.nav-collapsed) .nav-links a, html body .site-header:not(.nav-collapsed) .nav-sub-toggle { width: auto; padding: .42rem .6rem; border-radius: 999px; font-size: .9rem; justify-content: flex-start; }
html body .site-header:not(.nav-collapsed) .nav-sub { position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; padding: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); display: none; }
html body .site-header:not(.nav-collapsed) .has-sub.is-open > .nav-sub { display: block; }
html body .site-header:not(.nav-collapsed) .nav-sub a { padding: .55rem .8rem; border-radius: 10px; font-size: .92rem; color: var(--ink-2); }
html body .site-header:not(.nav-collapsed) .nav-sub a:hover { background: var(--surface-2); color: var(--ink); }
html body .site-header:not(.nav-collapsed) .nav-sub a[aria-current="page"] { background: var(--brand-50); color: var(--brand-600); }
html body .site-header.nav-collapsed .nav-toggle { display: inline-flex; }

/* Niyat prayer-times widget inside the arch card */
.prayer-card-widget { padding-bottom: 1rem; }
.prayer-widget { margin: .4rem auto 0; max-width: 420px; text-align: left; min-height: 120px; }
.prayer-subtitle { font-size: 1rem; margin: 1rem 0 .4rem; }

/* Phones: language and account actions live inside the menu panel */
.nav-mobile-controls { display: none; }
@media (max-width: 720px) {
  .header-controls { display: none !important; }
  .header-inner { flex-wrap: nowrap; padding-block: .4rem; }
  .site-header .brand { flex: 1 1 auto; }
  .site-header.nav-collapsed .nav-mobile-controls { display: grid; gap: .75rem; margin-top: .75rem; padding-top: .9rem; border-top: 1px solid var(--line); }
  .nav-mobile-controls .lang-switch { justify-self: start; background: var(--surface-2); border-color: var(--line); }
  .nav-mobile-controls .lang-option { color: var(--ink-2); padding: .45rem 1.1rem; }
  .nav-mobile-controls .lang-option.is-active { background: #065f46; color: #fff; }
  .nav-mobile-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
  .nav-mobile-links a, .nav-mobile-links button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .75rem 1rem; border: 0; border-radius: 12px; background: none; font: inherit; font-size: 1rem; font-weight: 550; color: var(--ink-2); text-decoration: none; cursor: pointer; text-align: left; }
  .nav-mobile-links a:hover, .nav-mobile-links button:hover { background: var(--surface-2); color: var(--ink); }
  .nav-mobile-links a.is-primary { background: var(--gold-light); color: var(--green-deep); font-weight: 700; }
  .nav-mobile-links form { margin: 0; }
  .nav-mobile-links button { color: var(--danger); }
  .nav-mobile-links .badge-count { margin-left: auto; }
}

/* Floating chat panel: 15% of the page width (300px minimum), between header and footer */
.chat-panel { position: fixed; z-index: 60; right: 0; top: var(--header-h, 64px); bottom: var(--footer-h, 72px); width: max(15vw, 300px); display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 32px -16px rgba(4, 42, 32, .45); animation: slide-in .2s ease-out; }
.chat-panel[hidden] { display: none; }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.chat-panel-head { display: flex; align-items: center; gap: .4rem; padding: .7rem .8rem .7rem 1rem; background: linear-gradient(135deg, #065f46, #047857); color: #fff; }
.chat-panel-head h2 { flex: 1; margin: 0; color: #fff; font-size: 1.05rem; display: flex; align-items: center; gap: .45rem; }
.chat-panel-btn { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; text-decoration: none; }
.chat-panel-btn:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.chat-panel iframe { flex: 1; width: 100%; border: 0; background: var(--surface); }
.chat-fab.is-open { background: var(--gold-light); color: var(--green-deep); }
@media (max-width: 600px) { .chat-panel { width: 100%; border-left: 0; } }

/* Simple chat view inside the panel */
html.is-embedded, .embed-body { height: 100%; background: var(--surface); }
.embed-body { margin: 0; overflow: hidden; }
.embed-flash { margin: .5rem; padding: .5rem .75rem; font-size: .85rem; }
.chatw { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chatw-choose { display: grid; gap: .35rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.chatw-choose label { font-size: .85rem; }
.chatw-choose select { padding: .6rem 2.2rem .6rem .8rem; font-size: .95rem; }
.chatw-messages { flex: 1; background: var(--surface); padding: .9rem; }
.chatw-messages .msg { max-width: 90%; }
.chatw-messages .chat-start { align-self: flex-start; padding: .5rem 0; font-size: 1rem; }
.chatw-composer { padding: .6rem; }
.chatw-composer textarea { min-height: 2.6rem; font-size: 1rem; }
.chatw-empty { padding: 1.5rem 1.25rem; }

/* Niyat widget: use the site's colours (the widget reads these custom properties from its host element) */
.prayer-widget [data-niyat-widget] {
  --w-bg: var(--surface);
  --w-ink: var(--ink);
  --w-dim: var(--ink-2);
  --w-muted: var(--muted);
  --w-line: var(--line);
  --w-chip-bg: #065f46;
  --w-chip-ink: #ffffff;
  --w-gold: var(--accent-ink);
}
/* Home explore tiles: four after the Masjid page was removed */
.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1080px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tiles li:first-child { grid-column: auto; } .tiles li:first-child .tile-desc { display: none; } }
#prayer-times { scroll-margin-top: calc(var(--header-h, 64px) + 1rem); }
.role-form { display: inline-flex; gap: .3rem; align-items: center; }
.role-form select { padding: .35rem 2rem .35rem .6rem; font-size: .85rem; width: auto; }
.admin-sub { max-height: calc(100dvh - 90px); overflow-y: auto; }
.admin-sub a { font-size: .9rem; padding: .5rem .8rem; }

/* Event Details timeline, gallery media grid, live badges */
.event-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; max-width: 1100px; }
.event-row { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.event-row.event-today { border-color: rgba(212, 160, 23, .55); background: linear-gradient(160deg, var(--accent-50), var(--surface) 60%); }
.event-row.event-past { opacity: .92; }
.event-row-body { flex: 1; min-width: 0; }
.event-row-body h2 { margin: .1rem 0 .3rem; }
.event-row-body h2 a { color: var(--ink); text-decoration: none; }
.event-row-body h2 a:hover { color: var(--brand-600); text-decoration: underline; }
.event-row-body .muted { margin-bottom: .5rem; }
.event-row-body .btn-row { gap: .4rem; }
.live-badge-inline { position: static; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: .75rem; margin-bottom: 1rem; }
.media-item { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.media-item img, .media-item video { display: block; width: 100%; height: 200px; object-fit: cover; background: #000; }
.media-item a { display: block; }
.media-item figcaption { padding: .45rem .7rem; font-size: .82rem; color: var(--ink-2); }
.photo-manage video { width: 160px; height: 110px; object-fit: cover; border-radius: 10px; background: #000; }
@media (max-width: 600px) {
  .event-row { padding: .85rem; gap: .75rem; }
  .media-item img, .media-item video { height: 170px; }
}

/* Footer always at the bottom of the screen, even on short pages */
body:not(.embed-body) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:not(.embed-body) > main { flex: 1 0 auto; }
body:not(.embed-body) > .site-header, body:not(.embed-body) > .ad-strip, body:not(.embed-body) > .site-footer { flex-shrink: 0; }

/* Chat button sits at the footer's right edge; the footer text keeps clear of it */
.chat-fab { bottom: calc((var(--footer-h, 72px) - 3.5rem) / 2 + env(safe-area-inset-bottom, 0px)); }
body:has(.chat-fab) .footer-main { padding-right: 4.75rem; }
body:has(.chat-panel:not([hidden])) .chat-fab { bottom: calc((var(--footer-h, 72px) - 3.5rem) / 2 + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 600px) {
  .chat-fab { width: 3rem; height: 3rem; bottom: calc((var(--footer-h, 72px) - 3rem) / 2 + env(safe-area-inset-bottom, 0px)); }
  body:has(.chat-fab) .footer-main { padding-right: 3.75rem; }
}
.announcement-posted { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.link-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }

/* Demographics: 2001 vs 2011 */
.split-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: .75rem; }
.split-values { font-size: .85rem; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-list-paired { gap: 1rem; }
.bar-group { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: .75rem; align-items: center; }
.bar-pair { display: grid; gap: 4px; }
.bar-pair .bar-row { grid-template-columns: 40px minmax(0, 1fr) 58px; gap: .5rem; }
.bar-year { font-size: .75rem; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-fill-2 { fill: var(--series-2); }
.bar-fill-2:hover { opacity: .85; }
.stat-grid-4 .stat-tile .stat-value { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
@media (max-width: 600px) {
  .bar-group { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
  .split-row { grid-template-columns: 40px minmax(0, 1fr); }
  .split-values { grid-column: 2; }
}
@media (forced-colors: active) { .bar-fill-2 { fill: LinkText; } }
.bar-pair .bar-row { grid-template-columns: 40px minmax(0, 1fr) 68px; }
.bar-pair .bar-value { white-space: nowrap; }

/* Chat button: 10% smaller, icon 20% larger */
.chat-fab { width: 3.15rem; height: 3.15rem; bottom: calc((var(--footer-h, 72px) - 3.15rem) / 2 + env(safe-area-inset-bottom, 0px)); }
.chat-fab .icon { width: 1.92rem; height: 1.92rem; }
body:has(.chat-fab) .footer-main { padding-right: 4.4rem; }
@media (max-width: 600px) {
  .chat-fab { width: 2.7rem; height: 2.7rem; bottom: calc((var(--footer-h, 72px) - 2.7rem) / 2 + env(safe-area-inset-bottom, 0px)); }
  .chat-fab .icon { width: 1.65rem; height: 1.65rem; }
  body:has(.chat-fab) .footer-main { padding-right: 3.4rem; }
}

/* Home: advertisement banner inside the welcome section */
.ad-strip-hero { display: block; padding: 0; margin: 0 0 1.25rem; background: transparent; border: 0; }
.hero-jamath:has(.ad-strip-hero) { padding-top: clamp(.75rem, 1.6vw, 1.25rem); }
.hero-jamath:has(.ad-strip-hero) .hero-copy { align-self: start; }
.ad-strip-hero .ad-slide img { object-position: left center; }
.ad-strip-hero .ad-frame { width: 100%; height: auto; aspect-ratio: 1200 / 96; min-height: 64px; max-height: 110px; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .6); }

/* Home: rotating announcement strip */
.ann-ticker { display: flex; align-items: stretch; gap: 0; margin-top: 1.25rem; max-width: 640px; border-radius: 14px; overflow: hidden; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ann-ticker-label { flex-shrink: 0; display: inline-flex; align-items: center; gap: .4rem; padding: .7rem .9rem; background: var(--gold-light); color: var(--green-deep); font-weight: 750; font-size: .85rem; text-decoration: none; }
.ann-ticker-label:hover { color: var(--green-deep); background: #f7dd95; }
.ann-ticker-track { position: relative; flex: 1; min-width: 0; min-height: 3.1rem; }
.ann-slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: .4rem .9rem; color: #fff; text-decoration: none; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; }
.ann-slide.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease, transform .45s ease; }
.ann-slide:hover { color: #fff; }
.ann-slide strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-slide span { font-size: .75rem; color: var(--gold-light); }
@media (max-width: 600px) {
  .ann-ticker-label span { display: none; }
  .ann-ticker-label { padding: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .ann-slide { transition: none; transform: none; } }

/* Header menu: more room between items (the fit script collapses the menu if it no longer fits) */
html body .site-header:not(.nav-collapsed) .nav-links { gap: clamp(.6rem, 1.8vw, 1.75rem); }

/* Home: hero fills the space down to the fixed footer */
body:not(.embed-body) > main:has(> .hero-jamath) { display: flex; flex-direction: column; }
main > .hero-jamath { flex: 1 0 auto; }
