@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

:root {
  /* Green palette - primary theme colors */
  --green: #0d5c3d;
  --green-light: #1a7a52;
  --green-dark: #062e1f;
  --green-deep: #0a3d28;

  /* Gold accent colors */
  --gold: #97770e;
  --gold-light: #c09a11;

  /* Live status colors */
  --live-red: #8b1a1a;
  --live-red-bright: #b91c1c;
  --success: #22c55e;
  --warn: #f59e0b;

  /* Light theme colors - for white background */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --text: #1a202c;
  --text-secondary: #4a5568;
  --muted: #718096;
  --border: #e2e8f0;
  --border-dark: #cbd5e0;
  --card: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Border radius */
  --radius: 16px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Particle canvas for floating animations */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* Arabic Islamic font for titles in RTL mode */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .brand-title-ar,
html[dir="rtl"] .mosque-card .card-name,
html[dir="rtl"] .page-heading {
  font-family: 'Amiri', serif;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--green-light); }
a:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--green-light);
  outline-offset: 2px;
}

.page-wrap {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.page-wrap main {
  padding: 0;
}

/* Add padding only for session pages (pages with constrained content) */
.page-wrap main > *:not(.hero-section):not(.landing-section) {
  padding: 22px 18px;
}

/* Constrain width for session page content */
.page-wrap main > *:not(.hero-section):not(.landing-section) {
  max-width: 1100px;
  margin-inline: auto;
  padding: 22px 18px;
}

/* Top nav */
.site-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 22px;
  background: linear-gradient(135deg, rgba(13, 92, 61, 0.95), rgba(6, 46, 31, 0.92));
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 100;
  transition: background 0.35s ease, padding 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

/* Hero pages: fully transparent nav at top, solid on scroll */
.has-hero-nav .site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  padding: 24px 32px;
}

.has-hero-nav .site-nav.is-scrolled {
  background: linear-gradient(135deg, rgba(13, 92, 61, 0.97), rgba(6, 46, 31, 0.95));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  padding: 16px 22px;
}

/* Nav text: white on green */
.site-nav .pill {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.site-nav .lang-switcher-btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.site-nav .lang-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.site-nav .lang-option {
  color: rgba(255, 255, 255, 0.92);
}

/* Overlay nav: enlarged brand and controls at page top */
.has-hero-nav:not(.nav-scrolled) .brand-icon {
  width: 88px;
  height: 88px;
}

.has-hero-nav:not(.nav-scrolled) .brand-title-ar {
  font-size: 20px;
}

.has-hero-nav:not(.nav-scrolled) .brand-title-en {
  font-size: 17px;
}

.has-hero-nav:not(.nav-scrolled) .pill {
  font-size: 15px;
  min-height: 42px;
  padding: 10px 18px;
}

.has-hero-nav:not(.nav-scrolled) .lang-switcher-btn {
  font-size: 15px;
  min-height: 42px;
  padding: 10px 18px 10px 16px;
}

.has-hero-nav:not(.nav-scrolled) .lang-switcher-flag {
  width: 28px;
  height: 22px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: gap 0.35s ease;
}
.brand-lockup:hover { text-decoration: none; }
.brand-lockup:focus-visible { outline: none; }

.brand-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: transparent;
  padding: 0;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.28));
  transition: width 0.35s ease, height 0.35s ease;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.brand-title-ar {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-light);
  transition: font-size 0.35s ease;
}
.brand-title-en {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  transition: font-size 0.35s ease;
}

.nav-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

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

.pill {
  font-size: 12px;
  min-height: 32px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: font-size 0.35s ease, min-height 0.35s ease, padding 0.35s ease;
}
.pill-action { cursor: pointer; }

.lang-select {
  font-size: 12px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(6, 46, 31, 0.9);
  color: var(--text);
  cursor: pointer;
}

/* Custom language switcher */
.lang-switcher {
  position: relative;
}

.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: linear-gradient(135deg, rgba(13, 92, 61, 0.7), rgba(6, 46, 31, 0.85));
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.35s ease;
  user-select: none;
}

.lang-switcher-btn:hover {
  background: linear-gradient(135deg, rgba(13, 92, 61, 0.85), rgba(6, 46, 31, 0.95));
  border-color: rgba(201, 162, 39, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lang-switcher-btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.lang-switcher-flag {
  width: 24px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.lang-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 140px;
  background: linear-gradient(135deg, rgba(13, 92, 61, 0.98), rgba(6, 46, 31, 0.98));
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.lang-switcher.open .lang-switcher-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.lang-option:hover {
  background: rgba(201, 162, 39, 0.15);
}

.lang-option.active {
  background: rgba(201, 162, 39, 0.2);
  color: var(--gold-light);
  font-weight: 650;
}

.lang-option-flag {
  width: 28px;
  height: 21px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.lang-option:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.dot.ok { background: var(--success); box-shadow: 0 0 8px rgba(34, 197, 94, 0.5); }
.dot.bad { background: var(--live-red-bright); box-shadow: 0 0 8px rgba(185, 28, 28, 0.4); }
.dot.warn { background: var(--warn); }
.dot.live { background: var(--live-red-bright); animation: pulse 1.2s ease-in-out infinite; }
.dot.speak { background: var(--gold-light); animation: blink 1s step-end infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(185, 28, 28, 0); }
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .dot.live, .dot.speak, .live-badge, .wave span, .waiting-dots span { animation: none; }
  .mosque-card img, .mosque-card .card-overlay, .btn { transition: none; }
  .site-nav, .brand-icon, .brand-title-ar, .brand-title-en, .pill, .lang-switcher-btn { transition: none; }
  .faq-item:hover { transform: none; }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  position: relative;
  z-index: 2;
}
.footer-verse {
  font-family: 'Amiri', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}
.site-footer .footer-brand { color: var(--gold-light); font-weight: 600; }
.site-footer-links { margin-top: 8px; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* Page headings */
.page-heading {
  text-align: center;
  padding: 12px 0 6px;
}
.page-heading h1 {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  color: var(--green);
  font-weight: 700;
  margin-bottom: 8px;
}
.page-heading p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* Mosque cards */
.mosque-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  max-width: 1100px;
  margin-inline: auto;
}

.mosque-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  background: var(--card);
  box-shadow: var(--shadow-md);
  isolation: isolate;
  transition: all 0.3s ease;
}
.mosque-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--green-light);
  border-color: var(--green-light);
}
.mosque-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}
.mosque-card:hover img { transform: scale(1.06); filter: saturate(1.1) brightness(1.05); }

.mosque-card .card-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 26, 18, 0.95) 0%, rgba(6, 46, 31, 0.75) 38%, rgba(6, 46, 31, 0.35) 70%, rgba(6, 46, 31, 0.05) 100%);
  pointer-events: none;
}

.mosque-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.mosque-card .card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 22px;
  z-index: 2;
}
.mosque-card .card-name {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.3px;
}
.card-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.mosque-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6, 46, 31, 0.10), rgba(13, 92, 61, 0.12));
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
  z-index: 3;
  padding: 20px;
}
.mosque-card:hover .card-overlay,
.mosque-card:focus-within .card-overlay {
  opacity: 1;
  backdrop-filter: blur(4px);
}

.live-badge {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--live-red-bright), var(--live-red));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: 0 3px 16px rgba(139, 26, 26, 0.6), 0 1px 4px rgba(0, 0, 0, 0.3);
  animation: pulse 1.5s ease-in-out infinite;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.live-badge .dot { width: 7px; height: 7px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.8); }

.offline-badge {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 4;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.grid-status-message {
  color: var(--text-secondary);
  text-align: center;
  grid-column: 1 / -1;
  padding: 24px;
}

/* Buttons */
.btn {
  min-height: 46px;
  padding: 13px 30px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s, opacity 0.12s, box-shadow 0.2s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(0.98); }

.btn-live {
  background: linear-gradient(135deg, var(--live-red-bright), var(--live-red));
  box-shadow: 0 4px 16px rgba(139, 26, 26, 0.4);
}
.btn-primary {
  background: linear-gradient(135deg, var(--green-light), var(--green));
  box-shadow: 0 4px 16px rgba(13, 92, 61, 0.28);
}
.btn-stop {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.85), rgba(71, 85, 105, 0.7));
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.26);
}
.btn-start {
  background: linear-gradient(135deg, var(--green-light), var(--green));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(13, 92, 61, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn-start:hover {
  box-shadow: 0 8px 24px rgba(13, 92, 61, 0.5);
}

.controls { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.join-controls { gap: 12px; }

/* Session interior hero */
.hero-section--interior {
  min-height: 18vh;
}

.hero-section--interior .hero-bg::after {
  background: rgba(66, 66, 66, 0.15);
}

.hero-content--session {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 72px 24px 16px;
}

.session-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 8px;
  padding-bottom: 0;
}

.session-back-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.session-back-link:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.session-hero-badge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--gold-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.session-hero-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-content--session h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
  line-height: 1.3;
}

.hero-content--session p {
  font-size: clamp(0.9375rem, 2vw, 1.0625rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  max-width: 560px;
  margin-bottom: 0;
  text-align: center;
}

/* Admin panels */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.panels--single { grid-template-columns: 1fr; }
@media (max-width: 600px) { .panels { grid-template-columns: 1fr; } }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-header,
.display-header,
.history-hdr {
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-body { padding: 20px; min-height: 128px; }
.lang-tag { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
.panel-text {
  font-size: 18px;
  line-height: 1.6;
  min-height: 54px;
  color: var(--muted);
  word-break: break-word;
  transition: color 0.2s;
}
.panel-text.active { color: var(--text); }
.panel-text.rtl { direction: rtl; text-align: right; font-size: 20px; }

.wave { margin-inline-start: auto; display: flex; gap: 3px; align-items: flex-end; height: 13px; }
.wave span { display: block; width: 3px; background: var(--gold-light); border-radius: 2px; animation: wav 0.9s ease-in-out infinite; }
.wave span:nth-child(1) { height: 5px; }
.wave span:nth-child(2) { height: 10px; animation-delay: 0.1s; }
.wave span:nth-child(3) { height: 7px; animation-delay: 0.2s; }
.wave span:nth-child(4) { height: 12px; animation-delay: 0.15s; }
.wave span:nth-child(5) { height: 5px; animation-delay: 0.05s; }
.wave.hidden { display: none; }
@keyframes wav { 0%, 100% { opacity: 0.3; transform: scaleY(0.5); } 50% { opacity: 1; transform: scaleY(1); } }

/* History */
.history {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  max-height: 280px;
  overflow-y: auto;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.history-hdr {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  backdrop-filter: blur(8px);
}
.history-empty { padding: 28px 24px; text-align: center; color: var(--muted); font-size: 13px; }
.h-item { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 7px; }
.h-item:last-child { border-bottom: none; }
.h-src, .h-tr { font-size: 14px; line-height: 1.55; display: flex; gap: 9px; align-items: flex-start; }
.h-src { color: var(--text); }
.h-tr { color: var(--text-secondary); }
.h-txt { flex: 1; word-break: break-word; }
.h-txt.rtl { direction: rtl; text-align: right; }
.h-arrow { color: var(--muted); }
.history::-webkit-scrollbar { width: 4px; }
.history::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 2px; }

/* Receiver session */
.display {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}
.display-body {
  padding: 32px 26px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}
.waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
  color: var(--muted);
  font-size: 15px;
}
.waiting-dots { display: flex; gap: 6px; }
.waiting-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  animation: wdot 1.4s ease-in-out infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes wdot { 0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

.tr-text {
  font-size: 26px;
  line-height: 1.55;
  word-break: break-word;
  color: var(--text);
}
.tr-text.rtl { direction: rtl; text-align: right; font-size: 28px; }
.tr-text.interim { color: var(--muted); }

/* Single running transcript (merged live + history): the whole khutbah in one pane,
   finalized lines stacked oldest→newest with the in-progress "live" line last. */
.transcript-wrap { position: relative; }
.transcript {
  max-height: 56vh;
  overflow-y: auto;
  padding: 18px 24px;
  font-size: 19px;
  line-height: 1.9;
  color: var(--text);
  word-break: break-word;
  scroll-behavior: smooth;
}
/* Finalized sentences flow inline as one paragraph (no divider between them); the
   still-forming text is a dimmed trailing span. */
.tr-seg { }
.tr-live { color: var(--muted); }
/* Receiver: the live translation is revised a few times by the recognizing events
   before it settles ("trial and error"). Hide that churn — keep the in-progress text
   invisible and only reveal each sentence (in the normal text colour) once it finalizes
   into a .tr-seg. */
#transcript .tr-live { color: transparent; }
.transcript::-webkit-scrollbar { width: 4px; }
.transcript::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 2px; }

.join-screen {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 52px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}
.join-screen h2 { font-size: 21px; color: var(--green); }
.join-screen p { color: var(--text-secondary); font-size: 14px; line-height: 1.65; max-width: 430px; }
.join-icon { font-size: 40px; line-height: 1; }
.test-result { font-size: 13px; color: var(--muted); margin-top: -2px; }
.not-found-screen { margin-top: 40px; }

/* Landing Page Hero Sections */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(6, 46, 31, 0.1),
    rgba(13, 92, 61, 0.1));
  z-index: 1;
}

.hero-section--admin .hero-bg::after {
  background: linear-gradient(135deg,
    rgba(0, 0, 0, 0.5),
    rgba(0, 0, 0, 0.4));
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 100px 24px 60px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.hero-content p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.6;
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta .btn {
  min-width: 180px;
}

.btn-hero-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(201, 162, 39, 0.4);
}

.btn-hero-primary:hover {
  box-shadow: 0 8px 28px rgba(201, 162, 39, 0.5);
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Landing Page Sections */
.landing-section {
  padding: 80px 18px;
  position: relative;
  margin: 0;
}

.landing-section:nth-child(even) {
  background: var(--bg-secondary);
}

.landing-section.with-pattern {
  background-color: var(--bg-tertiary);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
  max-width: 1100px;
  margin-inline: auto;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--green);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 40px;
  max-width: 1100px;
  margin-inline: auto;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-light);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  line-height: 1;
}

.feature-card h3 {
  font-size: 1.25rem;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

/* How It Works Steps */
.steps-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  margin-top: 48px;
  position: relative;
  max-width: 1100px;
  margin-inline: auto;
}

.step-item {
  text-align: center;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--green-light), var(--green));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 20px;
  box-shadow: 0 4px 16px rgba(13, 92, 61, 0.3);
}

.step-item h3 {
  font-size: 1.125rem;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 12px;
}

.step-item p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

/* Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
  margin-top: 40px;
  max-width: 1100px;
  margin-inline: auto;
}

.benefit-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.benefit-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-light);
}

.benefit-icon {
  font-size: 2rem;
  flex-shrink: 0;
  line-height: 1;
}

.benefit-content h3 {
  font-size: 1rem;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 8px;
}

.benefit-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* FAQ Section */
.faq-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.faq-question {
  font-size: 1.0625rem;
  color: var(--green);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.faq-question::before {
  content: 'Q';
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--green-light), var(--green));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.faq-answer {
  color: var(--text-secondary);
  line-height: 1.6;
  padding-inline-start: 40px;
}

/* Technology Section */
.tech-content {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* Support Section */
.support-content {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow-sm);
}

/* RTL Adjustments for Landing Pages */
html[dir="rtl"] .benefit-card:hover {
  transform: translateX(-4px);
}

html[dir="rtl"] .hero-content--session h1,
html[dir="rtl"] .hero-content h1,
html[dir="rtl"] .section-header h2 {
  font-family: 'Amiri', serif;
}

/* Error banner */
.error-banner {
  display: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(139, 26, 26, 0.35);
  border: 1px solid rgba(185, 28, 28, 0.5);
  color: #fecaca;
  font-size: 14px;
}
.error-banner.visible { display: block; }

@media (max-width: 768px) {
  .faq-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-wrap { padding: 16px 14px 30px; gap: 18px; }
  .site-nav { padding: 14px 16px; }
  .has-hero-nav .site-nav { padding: 14px 16px; }
  .has-hero-nav:not(.nav-scrolled) .brand-icon { width: 58px; height: 58px; }
  .has-hero-nav:not(.nav-scrolled) .brand-title-ar { font-size: 15px; }
  .has-hero-nav:not(.nav-scrolled) .brand-title-en { font-size: 13px; }
  .has-hero-nav:not(.nav-scrolled) .pill { font-size: 12px; min-height: 32px; padding: 7px 13px; }
  .has-hero-nav:not(.nav-scrolled) .lang-switcher-btn { font-size: 13px; min-height: 34px; padding: 7px 14px 7px 12px; }
  .brand-icon { width: 52px; height: 52px; }
  .mosque-grid { grid-template-columns: 1fr; gap: 20px; }
  .mosque-card .card-body { padding: 18px; }
  .mosque-card .card-name { font-size: 18px; }
  .mosque-card:hover { transform: translateY(-2px); }
  .btn { width: 100%; padding-inline: 18px; }
  .controls { width: 100%; }
  .join-screen { padding: 42px 20px; }

  .hero-section--interior {
    min-height: auto;
  }

  .hero-content--session {
    padding: 64px 20px 12px;
  }

  .session-hero-badge {
    width: 100px;
    height: 100px;
  }

  .lang-switcher-menu {
    min-width: 120px;
  }

  /* Landing Page Responsive */
  .hero-section {
    min-height: 70vh;
  }

  .hero-content {
    padding: 88px 20px 40px;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 12px;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .landing-section {
    padding: 60px 14px;
    margin-inline: -14px;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .features-grid,
  .steps-container,
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .feature-card,
  .benefit-card {
    padding: 24px 20px;
  }

  .benefit-card:hover,
  html[dir="rtl"] .benefit-card:hover {
    transform: none;
  }

  .faq-item {
    padding: 20px 16px;
  }

  .support-content {
    padding: 32px 24px;
  }

  .lang-choice-options { flex-wrap: wrap; }
  .rx-lang-option { flex: 1 1 40%; }
}

/* ── Receiver language choice ───────────────────────────────────────────────
   Visitor picks Arabic (read-only text) / English / Urdu. Sits above the join
   screen and stays visible during a live session so they can switch anytime. */
.lang-choice {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.lang-choice-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.lang-choice-options {
  display: flex;
  gap: 10px;
}

.rx-lang-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 0;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.rx-lang-option:hover { background: rgba(255, 255, 255, 0.09); }

.rx-lang-option.active {
  background: linear-gradient(135deg, var(--green), var(--green-light));
  border-color: var(--gold);
  color: #fff;
}

.rx-lang-option:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.lang-choice-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.hidden { display: none !important; }

/* ── Audio ↔ PDF comparison module ──────────────────────────────────────────
   Reuses .panel / .btn from the design system; adds compare-specific pieces. */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .compare-grid { grid-template-columns: 1fr; } }

.compare-body { gap: 14px; }

.compare-seg {
  display: flex; gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px;
}
.compare-seg button {
  flex: 1; background: transparent; color: var(--muted); border: none;
  padding: 9px 10px; font-size: 13px; font-weight: 600; border-radius: 9px; cursor: pointer;
}
.compare-seg button.on { background: rgba(13, 92, 61, 0.5); color: var(--text); }

.compare-mode { display: none; flex-direction: column; gap: 12px; }
.compare-mode.on { display: flex; }

.compare-drop {
  border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  padding: 22px; text-align: center; color: var(--muted); font-size: 13px;
  cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.compare-drop:hover { border-color: rgba(201, 162, 39, 0.5); color: var(--text); }
.compare-drop.has { border-color: var(--success); color: var(--text); }
.compare-drop--tall { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.compare-drop input[type=file] { display: none; }

.compare-rec-row { display: flex; gap: 10px; align-items: center; }
.compare-rec-row .btn { flex: 1; }
.compare-timer { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); min-width: 48px; text-align: center; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live-red-bright); animation: pulse 1.2s ease-in-out infinite; display: inline-block; }
.compare-hint { font-size: 12px; color: var(--muted); }
#audioPreview { width: 100%; margin-top: 4px; }

.compare-status { text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.compare-status.err { color: var(--live-red-bright); }
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.compare-report { display: none; flex-direction: column; gap: 16px; }
.compare-report-card { padding: 20px; }
.compare-report-title { font-size: 20px; font-weight: 700; color: var(--gold-light); margin-bottom: 6px; }
.compare-report-desc { font-size: 14px; line-height: 1.6; color: var(--text); }
.compare-score-wrap { margin-top: 14px; }
.compare-score-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.compare-score-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green-light), var(--gold)); transition: width 0.6s; width: 0; }
.compare-score-num { font-size: 13px; color: var(--muted); margin-top: 6px; }

.compare-sec-title {
  font-size: 11px; letter-spacing: 0.8px; text-transform: uppercase;
  font-weight: 600; color: var(--muted); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.compare-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.ar { direction: rtl; text-align: right; font-size: 16px; line-height: 1.7; }
.sim-item { border: 1px solid rgba(34, 197, 94, 0.25); background: rgba(34, 197, 94, 0.06); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.sim-item .lbl { font-size: 10px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin: 2px 0; }
.compare-diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 680px) { .compare-diff-cols { grid-template-columns: 1fr; } }
.compare-diff-list { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: rgba(255, 255, 255, 0.02); }
.compare-diff-list li { list-style: none; padding: 8px 0; border-bottom: 1px solid var(--border); }
.compare-diff-list li:last-child { border-bottom: none; }
.compare-empty { color: var(--muted); font-size: 13px; font-style: italic; }
.compare-extract { max-height: 160px; overflow-y: auto; }

/* ── Compliance audit view (LLM auditor) ────────────────────────────────────*/
.audit-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.audit-badge {
  font-size: 13px; font-weight: 650; padding: 6px 14px; border-radius: 999px;
  background: rgba(13, 92, 61, 0.35); border: 1px solid var(--gold); color: var(--text);
}
.audit-badge.audit-risk { background: rgba(255, 255, 255, 0.06); border-color: var(--border); color: var(--muted); }

.audit-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.audit-metric {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; text-align: center;
}
.audit-metric-val { font-size: 22px; font-weight: 700; color: var(--gold-light); }
.audit-metric-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Audio issues — timestamped highlights of where in the recording each problem is */
.ai-hint { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
#aiPlayer { width: 100%; margin: 4px 0 12px; }
.ai-timeline {
  position: relative; height: 16px; margin: 0 0 16px;
  background: rgba(255, 255, 255, 0.06); border-radius: 8px; overflow: hidden;
}
.ai-marker { position: absolute; top: 0; height: 100%; min-width: 4px; border-radius: 3px; cursor: pointer; opacity: 0.85; }
.ai-marker:hover { opacity: 1; }
.ai-item {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  border-inline-start: 3px solid var(--muted); border-radius: var(--radius-sm);
  padding: 10px 14px; margin: 8px 0;
}
.ai-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-time {
  background: var(--green); color: #fff; border: none; border-radius: 6px;
  padding: 4px 10px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.ai-time:hover { filter: brightness(1.1); }
.ai-type { font-size: 12px; color: var(--muted); }
.ai-snip { margin-top: 8px; font-size: 15px; color: var(--text); }
.ai-note { margin-top: 4px; font-size: 13px; color: var(--muted); }
.ai-marker.sev-critical, .ai-item.sev-critical { border-inline-start-color: #c0392b; background: #c0392b; }
.ai-item.sev-critical { background: rgba(192, 57, 43, 0.08); }
.ai-marker.sev-moderate, .ai-item.sev-moderate { border-inline-start-color: #e67e22; background: #e67e22; }
.ai-item.sev-moderate { background: rgba(230, 126, 34, 0.08); }
.ai-marker.sev-minor, .ai-item.sev-minor { border-inline-start-color: #c09a11; background: #c09a11; }
.ai-item.sev-minor { background: rgba(192, 154, 17, 0.08); }

/* The model's Arabic report (sanitized HTML: headings, paragraphs, lists, tables) */
.audit-report { font-size: 15px; line-height: 1.8; }
.audit-report h2 { font-size: 18px; color: var(--gold-light); margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.audit-report h3 { font-size: 15px; color: var(--text); margin: 16px 0 8px; }
.audit-report p { margin: 8px 0; color: var(--text); }
.audit-report ul { margin: 8px 0; padding-inline-start: 22px; }
.audit-report li { margin: 5px 0; }
.audit-report table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13.5px; }
.audit-report th, .audit-report td { border: 1px solid var(--border); padding: 8px 10px; text-align: right; vertical-align: top; }
.audit-report th { background: rgba(13, 92, 61, 0.3); color: var(--gold-light); font-weight: 650; }
.audit-report tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
/* ── Pre-session khutbah form modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(6, 46, 31, 0.55); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 100%; max-width: 460px; padding: 26px 26px 22px;
  max-height: 92vh; overflow-y: auto;
}
.modal-card h2 { margin: 0 0 4px; font-size: 20px; color: var(--green); }
.modal-sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.modal-card label {
  display: block; margin: 12px 0 5px; font-size: 12.5px; font-weight: 600; color: var(--text);
}
.modal-card input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border-dark); border-radius: var(--radius-sm);
  background: var(--bg-secondary); color: var(--text); font-family: inherit;
}
.modal-card input:focus { outline: none; border-color: var(--green-light); background: #fff; }
.modal-card input[readonly] { background: var(--bg-tertiary); color: var(--muted); cursor: not-allowed; }
.modal-card input.field-error { border-color: #c0392b; background: rgba(192, 57, 43, 0.05); }
.modal-card #fConfirm { width: 100%; margin-top: 20px; }
.modal-card .form-static {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px;
  border: 1px solid var(--border-dark); border-radius: var(--radius-sm);
  background: var(--bg-tertiary); color: var(--text); font-weight: 600;
}

/* ── Compare: saved-khutbah picker ─────────────────────────────────────────── */
.saved-status { font-size: 13px; color: var(--muted); margin: 4px 0 8px; min-height: 18px; }
.saved-list {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card);
}
.saved-list:empty { display: none; }
.saved-group {
  position: sticky; top: 0; z-index: 1;
  padding: 8px 12px; font-weight: 700; font-size: 13px; color: var(--green);
  background: #f3f7f4; border-bottom: 1px solid var(--border);
}
.saved-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background .12s ease;
}
.saved-item:last-child { border-bottom: 0; }
.saved-item:hover { background: #f7faf8; }
.saved-item.sel { background: #eaf5ef; box-shadow: inset 3px 0 0 var(--green); }
.saved-main { flex: 1 1 auto; min-width: 0; }
.saved-title {
  font-weight: 600; color: var(--text); font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.saved-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.saved-dl {
  flex: 0 0 auto; padding: 6px 10px; font-size: 15px; line-height: 1;
  border: 1px solid var(--border-dark); border-radius: var(--radius-sm); background: var(--card);
  cursor: pointer;
}
.saved-dl:hover { background: #f3f7f4; border-color: var(--green-light); }
.saved-dl:disabled { opacity: .5; cursor: default; }

/* ── Compare: audit thresholds panel (sliders) ─────────────────────────────── */
.audit-thresholds {
  max-width: 720px; margin: 8px auto 0; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card); overflow: hidden;
}
.th-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 16px; background: #f3f7f4; border: 0; cursor: pointer;
  font-weight: 700; color: var(--green); font-size: 14px;
}
.th-caret { color: var(--muted); }
.th-body { padding: 14px 16px; }
.th-body.collapsed { display: none; }
.th-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; margin: 10px 0; }
.th-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; }
.th-row label { font-size: 13px; color: var(--text-secondary); }
.th-row input[type="range"] {
  grid-column: 1 / -1; width: 100%; accent-color: var(--green); cursor: pointer; margin: 2px 0;
}
.th-val { font-weight: 700; color: var(--green); font-size: 13px; min-width: 42px; text-align: end; }
.th-row--overall { grid-column: 1 / -1; padding: 8px 10px; background: #eaf5ef; border-radius: var(--radius-sm); }
.th-row--overall label { font-weight: 700; color: var(--green-dark); font-size: 14px; }
.th-row--overall .th-val { font-size: 15px; }
.th-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.th-qual { font-size: 13px; color: var(--text-secondary); }
.th-reset {
  padding: 6px 12px; font-size: 13px; border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm); background: var(--card); cursor: pointer;
}
.th-reset:hover { border-color: var(--green-light); background: #f3f7f4; }
@media (max-width: 560px) { .th-grid { grid-template-columns: 1fr; } }

/* verdict badge + qualification line + metric pass/fail */
.audit-verdict { font-weight: 800; }
.audit-verdict.ok { background: #e6f4ea; color: #0d5c3d; }
.audit-verdict.bad { background: #fdecec; color: #9b1c1c; }
.audit-qual { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.audit-metric.ok { box-shadow: inset 0 -3px 0 #2e8b57; }
.audit-metric.bad { box-shadow: inset 0 -3px 0 #d64545; }
.audit-metric-th { margin-top: 2px; font-size: 11px; color: var(--muted); }

/* ── Admin: add / edit mosque ─────────────────────────────────────────────── */
.mosque-edit-btn {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-dark);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, transform 0.15s;
}
.mosque-edit-btn:hover { background: #fff; transform: translateY(-1px); }

.mosque-add-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border-dark);
  cursor: pointer;
  color: var(--green);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.mosque-add-tile:hover {
  border-color: var(--green);
  background: #fff;
  color: var(--green-dark);
}
.add-tile-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
}
.add-tile-inner .add-plus {
  font-size: 2.6rem;
  line-height: 1;
  color: var(--gold);
}

.mosque-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 46, 31, 0.55);
  backdrop-filter: blur(2px);
}
.mosque-modal {
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 18px;
}
.mosque-modal h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  color: var(--green-dark);
}
.mm-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mm-field { display: flex; flex-direction: column; gap: 5px; }
.mm-field--full { grid-column: 1 / -1; }
.mm-field span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.mm-field input {
  padding: 9px 11px;
  font-size: 0.95rem;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text);
}
.mm-field input:focus {
  outline: none;
  border-color: var(--green);
  background: #fff;
}
.mm-error {
  margin-top: 12px;
  padding: 9px 12px;
  font-size: 0.85rem;
  color: var(--live-red-bright);
  background: #fdecec;
  border: 1px solid #f3c9c9;
  border-radius: var(--radius-sm);
}
.mm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.btn-ghost {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-dark);
}
.btn-ghost:hover { background: var(--border); }
@media (max-width: 480px) {
  .mm-fields { grid-template-columns: 1fr; }
}
