:root {
  --bg: #0d1a12;
  --bg-soft: #13251a;
  --panel: rgba(255, 250, 241, 0.92);
  --panel-strong: #fffaf1;
  --panel-dark: rgba(14, 28, 20, 0.75);
  --line: rgba(181, 148, 86, 0.28);
  --line-strong: rgba(181, 148, 86, 0.55);
  --gold: #b59456;
  --gold-soft: #dbc9a1;
  --emerald: #1f5a43;
  --emerald-strong: #123c2d;
  --ink: #1c1a15;
  --muted: #6f6657;
  --sand: #f4ecdd;
  --sand-2: #efe6d4;
  --white: #ffffff;
  --danger: #9c3e30;
  --shadow: 0 24px 60px rgba(6, 15, 11, 0.24);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: 'Tajawal', sans-serif;
  background: linear-gradient(180deg, #0f2017 0%, #0a1812 100%);
  min-height: 100vh;
}

a { color: inherit; }
img { max-width: 100%; }
button, input, textarea {
  font: inherit;
}
button { cursor: pointer; }

.site-backdrop,
.pattern-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.site-backdrop {
  background:
    radial-gradient(circle at top right, rgba(181, 148, 86, 0.2), transparent 28%),
    radial-gradient(circle at left 20%, rgba(31, 90, 67, 0.28), transparent 30%),
    linear-gradient(135deg, #102117 0%, #0b1811 42%, #0e1712 100%);
}

.pattern-overlay {
  z-index: -1;
  opacity: 0.14;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.04) 75%);
  background-size: 46px 46px;
  background-position: 0 0, 0 23px, 23px -23px, -23px 0;
}

.container {
  width: min(var(--container), calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(10, 20, 15, 0.78);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.topbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--sand);
  text-decoration: none;
}

.brand-mark-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(181, 148, 86, 0.18), rgba(255,255,255,0.04));
  border: 1px solid rgba(181, 148, 86, 0.32);
  color: var(--gold-soft);
  font-size: 1.3rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.brand-mark strong {
  display: block;
  font: 700 1.05rem/1.4 'Amiri', serif;
}

.brand-mark small {
  display: block;
  color: rgba(244, 236, 221, 0.72);
  font-size: 0.84rem;
}

.topbar-menu {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(181, 148, 86, 0.24);
  background: rgba(255,255,255,0.05);
  color: var(--sand);
  padding: 12px 16px;
  border-radius: 999px;
}

.menu-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.main-nav[hidden] {
  display: none !important;
}

.main-nav {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  width: min(260px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(10, 20, 15, 0.96);
  border: 1px solid rgba(181, 148, 86, 0.2);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  z-index: 35;
}

.main-nav a {
  text-decoration: none;
  color: rgba(255, 250, 241, 0.9);
  padding: 12px 14px;
  border-radius: 14px;
  transition: 0.25s ease;
}

.main-nav a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--white);
}

.hero-shell {
  padding: 34px 0 22px;
}

.lessons-entry {
  padding-top: 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.hero-copy,
.hero-panel,
.request-card,
.content-card,
.calendar-card,
.subscribe-card,
.about-grid {
  position: relative;
}

.hero-copy {
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.96), rgba(248, 240, 226, 0.96));
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 38px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy::after,
.hero-panel::after,
.request-card::after,
.content-card::after,
.calendar-card::after,
.subscribe-card::after,
.about-grid::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: inherit;
  border: 1px solid rgba(181, 148, 86, 0.12);
  pointer-events: none;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(31, 90, 67, 0.08);
  color: var(--emerald);
  border: 1px solid rgba(31, 90, 67, 0.12);
  font-size: 0.84rem;
  font-weight: 700;
}

.hero-copy h1,
.hero-copy h2 {
  font-family: 'Amiri', serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.32;
  margin: 18px 0 12px;
}

.hero-copy h1 span,
.hero-copy h2 span {
  color: var(--emerald);
}

.hero-lead {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 2;
  max-width: 64ch;
}

.hero-actions,
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-gold {
  background: linear-gradient(135deg, #ceb374, var(--gold));
  color: #241d11;
  box-shadow: 0 14px 28px rgba(181, 148, 86, 0.22);
}

.btn-outline {
  background: transparent;
  color: var(--emerald);
  border: 1px solid rgba(31, 90, 67, 0.2);
}

.btn-primary {
  background: var(--emerald);
  color: var(--white);
}

.btn-secondary {
  background: rgba(31, 90, 67, 0.08);
  color: var(--emerald);
}

.btn-danger {
  background: rgba(156, 62, 48, 0.12);
  color: var(--danger);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.metric-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.66);
  border: 1px solid rgba(181, 148, 86, 0.2);
}

.metric-card strong {
  display: block;
  font-size: 1.9rem;
  color: var(--emerald-strong);
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.hero-panel {
  background: linear-gradient(180deg, rgba(20, 39, 29, 0.88), rgba(10, 18, 14, 0.92));
  color: var(--sand);
  border: 1px solid rgba(181, 148, 86, 0.18);
  border-radius: 34px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.quote-card {
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.quote-text {
  font-family: 'Amiri', serif;
  font-size: 1.6rem;
  line-height: 1.9;
  margin: 0 0 8px;
}

.quote-source {
  color: rgba(244, 236, 221, 0.74);
}

.panel-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.mini-panel {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.mini-panel i {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(181, 148, 86, 0.14);
  color: var(--gold-soft);
}

.mini-panel strong {
  display: block;
  margin-bottom: 6px;
}

.mini-panel p {
  margin: 0;
  color: rgba(244, 236, 221, 0.76);
  line-height: 1.8;
}

.section {
  padding: 24px 0 32px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h1,
.section-heading h2 {
  font-family: 'Amiri', serif;
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  margin: 16px 0 8px;
  color: var(--sand);
}

.section-heading p {
  color: rgba(244, 236, 221, 0.74);
  max-width: 60ch;
  margin: 0;
  line-height: 1.9;
}

.section-heading.centered {
  text-align: center;
}

.section-heading.centered p {
  margin-inline: auto;
}

.section-heading.compact h2 {
  color: var(--ink);
  margin-bottom: 2px;
}

.section-heading.compact { margin-bottom: 16px; }

.request-card,
.content-card,
.calendar-card,
.subscribe-card,
.about-grid {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.request-card,
.calendar-card,
.subscribe-card {
  padding: 28px;
}

.request-switcher {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  background: #f1e6d2;
  border: 1px solid rgba(181, 148, 86, 0.16);
}

.switch-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.switch-btn.active {
  background: var(--emerald);
  color: var(--white);
  box-shadow: 0 10px 22px rgba(31, 90, 67, 0.18);
}

.request-mode { display: none; }
.request-mode.active { display: block; }

.request-form { margin-top: 22px; }

.form-intro {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #f6efe1;
  color: var(--muted);
  border: 1px solid rgba(181, 148, 86, 0.12);
}

.form-intro strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 700;
  color: var(--ink);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(31, 90, 67, 0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
  padding: 14px 16px;
  color: var(--ink);
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(31, 90, 67, 0.34);
  box-shadow: 0 0 0 4px rgba(31, 90, 67, 0.08);
}

.field small {
  color: var(--muted);
}

.span-2 { grid-column: span 2; }

.request-feedback {
  margin-top: 18px;
  border-radius: 20px;
  padding: 18px;
  background: #f6efe1;
  border: 1px solid rgba(181, 148, 86, 0.16);
}

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feedback-badge {
  background: rgba(31, 90, 67, 0.08);
  color: var(--emerald);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.preview-lessons {
  display: grid;
  gap: 10px;
}

.preview-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(181, 148, 86, 0.16);
}

.preview-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--emerald-strong);
}

.preview-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.section-grid.three-up {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.content-card {
  padding: 24px;
}

.lessons-list {
  display: grid;
  gap: 14px;
}

.lesson-card {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(181, 148, 86, 0.14);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(10, 20, 15, 0.08);
}

.lesson-card.featured {
  border-color: rgba(181, 148, 86, 0.38);
  box-shadow: 0 18px 34px rgba(181, 148, 86, 0.12);
}

.card-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: start;
}

.sheikh {
  font-family: 'Amiri', serif;
  font-size: 1.45rem;
  color: var(--emerald-strong);
}

.time {
  flex-shrink: 0;
  background: #f5eddd;
  color: var(--emerald);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
}

.subject {
  margin: 14px 0 10px;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.8;
}

.meta-line,
.location {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  margin-top: 10px;
}

.meta-line i,
.location i {
  color: var(--gold);
}

.description {
  color: var(--muted);
  line-height: 1.9;
  margin-top: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.disabled-btn {
  opacity: 0.78;
}

.no-lessons {
  padding: 18px;
  border-radius: 18px;
  background: #f7f1e6;
  color: var(--muted);
  border: 1px dashed rgba(181, 148, 86, 0.22);
  line-height: 1.9;
}

.calendar-card {
  overflow: hidden;
}

.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.calendar-nav h3 {
  margin: 0;
  font-family: 'Amiri', serif;
  font-size: 1.85rem;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(181, 148, 86, 0.18);
  background: #f8f1e3;
  color: var(--emerald);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-weekdays {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.calendar-day {
  min-height: 86px;
  border-radius: 18px;
  border: 1px solid rgba(181, 148, 86, 0.14);
  background: rgba(255,255,255,0.86);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calendar-day.empty {
  opacity: 0.28;
}

.calendar-day.has-lessons {
  background: linear-gradient(180deg, #f8f1e2, #f0e5cf);
  border-color: rgba(181, 148, 86, 0.32);
}

.calendar-day .date {
  font-weight: 700;
  color: var(--emerald-strong);
}

.lesson-count {
  font-size: 0.82rem;
  color: var(--muted);
}

.subscribe-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: center;
}

.subscribe-form {
  display: grid;
  gap: 14px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 24px;
  padding: 28px;
  color: var(--sand);
  background: linear-gradient(180deg, rgba(19, 37, 26, 0.92), rgba(10, 18, 14, 0.96));
}

.about-grid h2,
.about-grid .section-kicker,
.about-grid strong {
  color: var(--white);
}

.principles-list {
  display: grid;
  gap: 14px;
}

.principles-list article {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.principles-list i {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(181, 148, 86, 0.14);
  color: var(--gold-soft);
}

.principles-list p,
.about-grid p {
  color: rgba(244, 236, 221, 0.74);
  line-height: 1.9;
}

.footer {
  padding: 24px 0 36px;
  color: rgba(244, 236, 221, 0.78);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 18px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  text-decoration: none;
  color: var(--gold-soft);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 60;
  padding: 14px 18px;
  border-radius: 999px;
  color: var(--white);
  box-shadow: 0 16px 32px rgba(0,0,0,0.24);
}

.toast-success { background: rgba(31, 90, 67, 0.96); }
.toast-error { background: rgba(156, 62, 48, 0.96); }
.toast-info { background: rgba(18, 60, 45, 0.96); }

/* Homepage polish */
.home-hero-shell {
  padding-top: 46px;
}

.home-hero-grid {
  align-items: stretch;
}

.home-side-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.upcoming-focus-shell {
  padding-top: 12px;
}

.upcoming-focus-card {
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(181,148,86,0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,250,241,0.97), rgba(246,238,224,0.95));
}

.upcoming-focus-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.upcoming-focus-heading h1,
.green-heading {
  color: var(--emerald-strong) !important;
}

.filters-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(160px, 0.7fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(255,250,241,0.98), rgba(244,236,221,0.96));
}

.search-results-card {
  margin: 18px 0 24px;
}

.filter-summary {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(31,90,67,0.1);
  color: var(--emerald-strong);
  font-weight: 800;
  border: 1px solid rgba(31,90,67,0.12);
}

.filtered-lessons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filtered-lessons .filter-summary,
.filtered-lessons .no-lessons {
  grid-column: 1 / -1;
}

.lesson-card {
  position: relative;
  overflow: hidden;
}

.lesson-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold), var(--emerald));
  opacity: 0.62;
}

.lesson-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.lesson-icon,
.live-badge,
.countdown-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
}

.lesson-icon {
  width: 36px;
  height: 36px;
  background: rgba(31,90,67,0.1);
  color: var(--emerald);
}

.live-badge {
  padding: 7px 10px;
  background: rgba(156,62,48,0.12);
  color: var(--danger);
  font-size: 0.78rem;
}

.countdown-badge {
  padding: 7px 10px;
  background: rgba(181,148,86,0.14);
  color: #7a5d27;
  font-size: 0.78rem;
}

.lesson-card .actions .btn {
  padding: 11px 15px;
  font-size: 0.92rem;
}

.section-grid.three-up .content-card {
  background: rgba(255,250,241,0.96);
}

.subscribe-card.simple-card {
  background:
    radial-gradient(circle at 12% 0%, rgba(31,90,67,0.12), transparent 30%),
    linear-gradient(180deg, rgba(255,250,241,0.97), rgba(246,238,224,0.96));
}

.dual-callout {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.cta-panel {
  min-height: 100%;
}

.calendar-toolbar {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.calendar-stage {
  display: grid;
  gap: 14px;
}

.calendar-details {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(181, 148, 86, 0.16);
}

.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--emerald-strong);
  font-weight: 700;
}

.details-list {
  display: grid;
  gap: 12px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.week-day-card {
  text-align: right;
  border: 1px solid rgba(181, 148, 86, 0.14);
  background: rgba(255,255,255,0.86);
  border-radius: 20px;
  padding: 14px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.week-day-card.has-lessons {
  background: linear-gradient(180deg, #f8f1e2, #f0e5cf);
  border-color: rgba(181, 148, 86, 0.32);
}

.day-title {
  font-weight: 800;
  color: var(--emerald-strong);
}

.day-date {
  color: var(--muted);
  font-size: 0.9rem;
}

.day-lessons {
  display: grid;
  gap: 8px;
}

.mini-lesson {
  display: block;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.7;
}

.mini-lesson.muted {
  color: var(--muted);
}

.request-manual-optional {
  margin-top: 18px;
}

.reveal-up {
  animation: revealUp 0.6s ease both;
}

.delay-2 { animation-delay: 0.08s; }
.delay-3 { animation-delay: 0.16s; }

@keyframes revealUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1080px) {
  .hero-grid,
  .subscribe-card,
  .about-grid,
  .section-grid.three-up {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .hero-copy,
  .request-card,
  .calendar-card,
  .subscribe-card,
  .about-grid {
    border-radius: 26px;
  }

  .filters-card,
  .filtered-lessons {
    grid-template-columns: 1fr;
  }

  .upcoming-focus-heading {
    flex-direction: column;
  }
}

@media (max-width: 780px) {
  .topbar-inner {
    flex-direction: row;
    align-items: center;
  }

  .topbar-menu {
    align-self: flex-start;
  }

  .main-nav {
    right: 0;
    left: auto;
    width: min(220px, calc(100vw - 32px));
  }

  .hero-copy,
  .hero-panel,
  .request-card,
  .content-card,
  .calendar-card,
  .subscribe-card,
  .about-grid {
    padding: 20px;
  }

  .hero-metrics,
  .form-grid.two-col,
  .calendar-weekdays,
  .calendar-grid,
  .week-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-day {
    min-height: 72px;
  }

  .footer-inner,
  .card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .time {
    align-self: start;
  }

  .home-hero-shell {
    padding-top: 24px;
  }

  .brand-mark-icon {
    width: 44px;
    height: 44px;
  }

  .brand-mark small {
    display: none;
  }

  .btn {
    width: 100%;
  }
}

.details-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-start;
}

.calendar-add-btn {
    gap: 8px;
}

/* Admin dashboard — same visual language as the public homepage */
.admin-page .admin-hero { padding-bottom: 10px; }
.admin-hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr); }
.admin-note-card .quote-text { font-size: 1.35rem; }
.admin-metrics { grid-template-columns: 1fr; }
.admin-metrics .metric-card {
  background: rgba(255,255,255,0.06);
  border-color: rgba(181,148,86,0.18);
  color: var(--sand);
}
.admin-metrics .metric-card strong { color: var(--gold-soft); }
.admin-metrics .metric-card span { color: rgba(244,236,221,0.74); }
.admin-card { padding: 24px; overflow: hidden; }
.admin-hidden-stat { display: none; }

.upload-area {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.drop-zone {
  min-height: 210px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  padding: 24px;
  border: 1px dashed rgba(181,148,86,0.45);
  border-radius: 24px;
  background: linear-gradient(180deg,#fffaf1,#f3ead9);
  color: var(--muted);
}
.drop-zone i { font-size: 2.3rem; color: var(--gold); }
.drop-zone strong { display: block; color: var(--emerald-strong); font-size: 1.08rem; }
.drop-zone input { max-width: 100%; margin-top: 10px; }
.preview-container { display: grid; gap: 12px; }
.image-preview {
  padding: 16px;
  border-radius: 22px;
  background: #f6efe1;
  border: 1px solid rgba(181,148,86,0.16);
  color: var(--muted);
}
.image-preview img {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(181,148,86,0.12);
}

.table-container { width: 100%; overflow-x: auto; }
.lessons-table,
.users-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  min-width: 760px;
}
.lessons-table th,
.users-table th {
  padding: 0 14px 8px;
  text-align: right;
  color: var(--emerald-strong);
  font-weight: 800;
  white-space: nowrap;
}
.lessons-table td,
.users-table td {
  padding: 14px;
  background: rgba(255,255,255,0.86);
  border-block: 1px solid rgba(181,148,86,0.13);
  color: var(--ink);
  vertical-align: top;
}
.lessons-table td:first-child,
.users-table td:first-child {
  border-inline-start: 1px solid rgba(181,148,86,0.13);
  border-radius: 18px 0 0 18px;
}
.lessons-table td:last-child,
.users-table td:last-child {
  border-inline-end: 1px solid rgba(181,148,86,0.13);
  border-radius: 0 18px 18px 0;
}
.lessons-table td small,
.users-table td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .82rem;
}
.lessons-table .btn,
.users-table .btn {
  padding: 9px 12px;
  font-size: .86rem;
  margin: 2px;
}
.status {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(181,148,86,0.14);
  color: #73552a;
  font-weight: 800;
  white-space: nowrap;
}
.status.active { background: rgba(31,90,67,0.12); color: var(--emerald); }
.status.inactive { background: rgba(156,62,48,0.12); color: var(--danger); }
.request-lesson-line {
  display: grid;
  gap: 4px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(181,148,86,0.12);
}
.request-lesson-line:last-child { border-bottom: 0; }
.request-lesson-line strong { color: var(--emerald-strong); }
.request-lesson-line span,
.muted-inline { color: var(--muted); line-height: 1.7; }
.request-image-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--emerald);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1080px) {
  .admin-hero-grid,
  .upload-area { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .admin-card { padding: 16px; }
  .lessons-table,
  .users-table { min-width: 680px; }
}

.upcoming-focus-shell {
  padding-top: 26px;
  padding-bottom: 8px;
}

.upcoming-focus-card {
  padding: 28px;
}

.upcoming-focus-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.upcoming-focus-heading p {
  color: var(--muted);
  margin: 0;
  line-height: 1.9;
  max-width: 58ch;
}

.upcoming-focus-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .upcoming-focus-list {
    grid-template-columns: 1fr;
  }

  .upcoming-focus-heading {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Admin tabs + visitor/AI additions */
.admin-tabs-shell { position: sticky; top: 0; z-index: 30; padding: 14px 0; backdrop-filter: blur(18px); background: rgba(14, 40, 35, .78); border-bottom: 1px solid rgba(217, 180, 111, .22); }
.admin-tabs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.admin-tab { white-space: nowrap; border: 1px solid rgba(217, 180, 111, .28); background: rgba(255,255,255,.06); color: #fff7e8; border-radius: 999px; padding: 10px 16px; font-family: inherit; cursor: pointer; transition: .2s ease; }
.admin-tab:hover, .admin-tab.active { background: linear-gradient(135deg, #d9b46f, #f3d68f); color: #17382f; box-shadow: 0 12px 30px rgba(0,0,0,.16); }
.admin-tab-panel[hidden] { display: none !important; }
.visitor-metrics { margin-bottom: 24px; }
.visitor-chart { display: flex; gap: 12px; align-items: end; min-height: 170px; padding: 18px; border-radius: 24px; background: rgba(12, 54, 45, .06); margin-bottom: 22px; overflow-x: auto; }
.visitor-bar { display: grid; justify-items: center; gap: 8px; min-width: 58px; color: var(--muted, #667); }
.visitor-bar strong { display: block; width: 28px; border-radius: 999px 999px 8px 8px; background: linear-gradient(180deg, #d9b46f, #1e6f5c); }
.visitor-bar em { font-style: normal; font-weight: 800; color: #1e3d35; }
.ai-result { direction: rtl; white-space: pre-wrap; background: #102f28; color: #fff7e8; padding: 16px; border-radius: 16px; overflow:auto; }

/* Lesson source image */
.lesson-thumb-btn { width: 100%; border: 0; cursor: zoom-in; display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; text-align: right; padding: 10px; margin-bottom: 14px; border-radius: 20px; background: rgba(217,180,111,.12); color: #1c3a32; font-family: inherit; }
.lesson-thumb-btn img { width: 92px; height: 72px; object-fit: cover; border-radius: 16px; box-shadow: 0 8px 18px rgba(0,0,0,.16); }
.lesson-thumb-btn span { font-weight: 800; color: #8a6628; }
.lesson-image-modal { position: fixed; inset: 0; z-index: 2000; display: none; place-items: center; padding: 24px; }
.lesson-image-modal.is-open { display: grid; }
.lesson-image-modal-backdrop { position: absolute; inset: 0; background: rgba(4, 20, 17, .82); backdrop-filter: blur(10px); }
.lesson-image-modal-card { position: relative; max-width: min(92vw, 980px); max-height: 88vh; background: #fff8eb; padding: 16px; border-radius: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.38); }
.lesson-image-modal-card img { display: block; max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: 20px; }
.lesson-image-close { position: absolute; top: -18px; inset-inline-start: 18px; border: 0; border-radius: 999px; padding: 10px 16px; font-family: inherit; font-weight: 800; cursor: pointer; background: linear-gradient(135deg, #d9b46f, #f3d68f); color: #17382f; box-shadow: 0 10px 24px rgba(0,0,0,.22); }

@media (max-width: 680px) { .lesson-thumb-btn { grid-template-columns: 76px 1fr; } .lesson-thumb-btn img { width: 76px; height: 62px; } }

.hero-actions button.btn { font-family: inherit; cursor: pointer; }

/* Softer beige lesson cards per site palette */
.lesson-card {
  background: linear-gradient(180deg, #fff8eb 0%, #f4ead6 100%);
  border-color: rgba(181, 148, 86, 0.26);
  box-shadow: 0 14px 30px rgba(99, 73, 32, 0.10);
}
.lesson-card.featured,
.lesson-card.is-live {
  background: linear-gradient(180deg, #fff4dc 0%, #efe0c3 100%);
  border-color: rgba(181, 148, 86, 0.42);
}

/* Compact search + collapsible filters */
.search-toolbar {
  width: min(100%, 720px);
  margin: 0 auto 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255,248,235,0.98), rgba(244,234,214,0.96));
}
.search-field-compact input { min-height: 46px; }
.filters-toggle {
  height: 46px;
  min-width: 116px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  cursor: pointer;
}
.filters-toggle.active {
  background: rgba(31, 90, 67, 0.10);
  border-color: rgba(31, 90, 67, 0.24);
}
.filters-panel[hidden] { display: none !important; }
.filters-panel {
  width: min(100%, 720px);
  margin: 0 auto 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px;
  animation: filtersIn .18s ease-out;
}
@keyframes filtersIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 680px) {
  .search-toolbar { grid-template-columns: 1fr; }
  .filters-toggle { width: 100%; }
  .filters-panel { grid-template-columns: 1fr; }
}

/* Public AI review/edit before submit */
.public-review-box { margin-top: 18px; display: grid; gap: 14px; }
.review-hint { color: var(--muted); margin: 0 0 8px; }
.editable-preview-lessons { display: grid; gap: 14px; }
.editable-preview-card { background: linear-gradient(180deg, #fff8eb, #f4ead6); }
.compact-feedback-header { margin-bottom: 10px; }
.btn-small { padding: 8px 12px; font-size: .86rem; }
.submitted-image-preview { margin: 14px 0; }
.submitted-image-preview a { display: inline-grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center; text-decoration: none; color: var(--emerald-strong); font-weight: 800; }
.submitted-image-preview img { width: 90px; height: 70px; border-radius: 16px; object-fit: cover; box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.admin-thumb-link img, .request-thumb-link img { width: 68px; height: 52px; object-fit: cover; border-radius: 12px; box-shadow: 0 6px 14px rgba(0,0,0,.12); }
.request-thumb-link { display: inline-flex; gap: 8px; align-items: center; }
@media (max-width: 680px) { .submitted-image-preview a { grid-template-columns: 72px 1fr; } .submitted-image-preview img { width:72px;height:58px; } }

/* Beta badge + support block */
.beta-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-inline-start: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(217, 180, 111, .18);
  border: 1px solid rgba(217, 180, 111, .35);
  color: #d9b46f;
  font-family: 'Tajawal', sans-serif;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-mark strong { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.support-section { padding-top: 0; }
.support-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(180deg, #fff8eb, #f4ead6);
  border: 1px solid rgba(181, 148, 86, .22);
}
.support-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .support-card { display: grid; }
  .support-actions .btn { width: 100%; }
}
