/* Jain Prabhavana — shared design system
   Palette inspired by Digambar tradition: saffron (renunciation), deep maroon
   (manuscripts/temple stone), cream (parchment), gold (reverence) */

:root {
  --saffron: #d97706;
  --saffron-dark: #b45309;
  --maroon: #6b1f3a;
  --maroon-dark: #4a1428;
  --cream: #fdf8f0;
  --cream-deep: #f5ebd9;
  --gold: #c9a227;
  --ink: #2b2118;
  --ink-soft: #5c5246;
  --white: #ffffff;
  --success: #2f7a4f;
  --error: #b3261e;

  /* Extra accents for the homepage highlights carousel — one per content
     section, kept muted/desaturated so they sit alongside saffron/maroon/gold
     without looking like a different app. */
  --stone: #4f6b63;
  --indigo: #46567f;
  --sepia: #8a5a35;
  --sage: #6f9053;
  --plum: #6a4a8a;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-card: 0 8px 24px rgba(107, 31, 58, 0.12);
  --shadow-soft: 0 2px 8px rgba(43, 33, 24, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: 'Georgia', 'Iowan Old Style', serif;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; }

/* ---------- Layout shell ---------- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-card);
}

@media (min-width: 600px) {
  .app-shell { min-height: 100vh; border-left: 1px solid var(--cream-deep); border-right: 1px solid var(--cream-deep); }
}

.topbar {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: var(--white);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-tagline {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--gold);
  margin-top: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--maroon-dark);
  font-weight: 700;
  font-size: 16px;
  padding: 4px;
  flex-shrink: 0;
}

.brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.topbar-icon-btn:hover { background: rgba(255,255,255,0.22); }
.topbar-icon-btn:active { transform: scale(0.92); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lang-switcher-btn:hover { background: rgba(255,255,255,0.22); }

.lang-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  min-width: 168px;
  padding: 6px;
  display: none;
  z-index: 20;
}

.lang-switcher-menu.open { display: block; }

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink);
}

.lang-option.selected {
  background: var(--cream-deep);
  color: var(--maroon);
  font-weight: 600;
}

.lang-option.disabled {
  color: #b8aea0;
}

.lang-option .soon-tag {
  font-size: 10px;
  background: var(--cream-deep);
  color: var(--ink-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.content {
  flex: 1;
  padding: 20px;
  padding-bottom: 96px;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--cream-deep);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
}

.nav-item .icon { font-size: 20px; }

.nav-item.active {
  color: var(--maroon);
  font-weight: 600;
}

/* ---------- Mangalacharan (homepage opening invocation) ---------- */
.mangalacharan {
  text-align: center;
  padding: 4px 16px 8px;
  margin: -8px 0 6px;
  border-bottom: 1px solid var(--cream-deep);
}

.mangalacharan-verse {
  color: var(--maroon);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

/* ---------- Daily Card ---------- */
.date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cream-deep);
  color: var(--maroon);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.daily-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 18px;
}

/* Briefly marks the card a "?q=<id>" link (see the homepage highlights
   carousel's quiz card) scrolled to, via ScrollToQuiz.tsx. */
.daily-card-highlighted {
  outline: 3px solid var(--plum);
  outline-offset: 3px;
  transition: outline-color 0.4s ease-out;
}

.daily-card-header {
  background: radial-gradient(circle at top right, var(--saffron) 0%, var(--maroon) 75%);
  color: var(--white);
  padding: 28px 22px 22px;
  position: relative;
}

.daily-card-header .category {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.85;
  margin-bottom: 8px;
}

.daily-card-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
}

.lotus-deco {
  position: absolute;
  right: 14px;
  top: 14px;
  font-size: 38px;
  opacity: 0.25;
}

.daily-card-body {
  padding: 20px 22px;
}

.daily-card-body p {
  margin: 0 0 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  font-size: 16.5px;
}

/* ---------- Public site: "आजचे विशेष" highlights carousel ---------- */
.highlights-carousel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 2px 16px;
  margin: 0 -2px 18px;
}

.highlights-carousel::-webkit-scrollbar { display: none; }

.highlight-card {
  flex: 0 0 87%;
  scroll-snap-align: start;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border-top: 4px solid var(--maroon);
  min-height: 180px;
  display: flex;
  flex-direction: column;
}

.highlight-card--event { border-top-color: var(--gold); }
.highlight-card--shalaka_purush { border-top-color: var(--maroon); }
.highlight-card--kshetra { border-top-color: var(--stone); }
.highlight-card--ritual { border-top-color: var(--saffron); }
.highlight-card--acharya { border-top-color: var(--indigo); }
.highlight-card--agam { border-top-color: var(--sepia); }
.highlight-card--philosophy { border-top-color: var(--sage); }
.highlight-card--quiz { border-top-color: var(--plum); }

.highlight-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px 0;
}

.highlight-card-category {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--maroon);
}

.highlight-card--event .highlight-card-category { color: var(--gold); }
.highlight-card--shalaka_purush .highlight-card-category { color: var(--maroon); }
.highlight-card--kshetra .highlight-card-category { color: var(--stone); }
.highlight-card--ritual .highlight-card-category { color: var(--saffron-dark); }
.highlight-card--acharya .highlight-card-category { color: var(--indigo); }
.highlight-card--agam .highlight-card-category { color: var(--sepia); }
.highlight-card--philosophy .highlight-card-category { color: var(--sage); }
.highlight-card--quiz .highlight-card-category { color: var(--plum); }

.highlight-card-badge {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  background: var(--maroon-dark);
  border-radius: 999px;
  padding: 2px 9px;
}

.highlight-card-body {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 14px 10px;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-height: 0;
}

.highlight-card-media {
  flex-shrink: 0;
}

.highlight-card-media img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.highlight-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.highlight-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 3px;
  flex-shrink: 0;
}

.highlight-card-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.highlight-card .card-meta-chips {
  flex-shrink: 0;
  max-height: 20px;
  overflow: hidden;
  margin-top: 4px;
}

.card-media {
  margin: 0 0 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  display: block;
}

.audio-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cream-deep);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 0 0 16px;
}

.audio-block .play-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--maroon);
  color: var(--white);
  border: none;
  font-size: 14px;
  flex-shrink: 0;
  cursor: pointer;
}

.audio-block .audio-info {
  flex: 1;
  min-width: 0;
}

.audio-block .audio-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--maroon);
}

.audio-block .audio-duration {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.quiz-block {
  border-top: 1px dashed var(--cream-deep);
  padding-top: 16px;
}

.quiz-question {
  font-weight: 600;
  margin-bottom: 14px;
  font-size: 17px;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--cream-deep);
  background: var(--white);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
}

.option-btn:hover { border-color: var(--saffron); }

.option-letter {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.option-btn.correct {
  border-color: var(--success);
  background: #eef7f0;
}
.option-btn.correct .option-letter { background: var(--success); color: var(--white); }

.option-btn.incorrect {
  border-color: var(--error);
  background: #fbeceb;
}
.option-btn.incorrect .option-letter { background: var(--error); color: var(--white); }

.quiz-feedback {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--cream-deep);
  font-size: 15.5px;
  color: var(--ink-soft);
  display: none;
}

.quiz-feedback.show { display: block; }

.quiz-feedback strong { color: var(--maroon); }

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

.share-btn {
  flex: 1 1 auto;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

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

.share-btn.secondary {
  background: var(--cream-deep);
  color: var(--maroon);
}

/* ---------- Section heading ---------- */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 12px;
}

/* Used right after .date-pill (see homepage) where the default 28px top
   margin leaves a visibly large gap before the carousel. */
.section-heading--tight { margin-top: 10px; }

.section-heading h3 {
  margin: 0;
  font-size: 17px;
  color: var(--maroon);
}

.section-heading a {
  font-size: 14.5px;
  color: var(--saffron-dark);
  font-weight: 600;
}

/* ---------- Topic chips ---------- */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--cream-deep);
  font-size: 14.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.chip.active {
  background: var(--maroon);
  color: var(--white);
  border-color: var(--maroon);
}

/* ---------- Streak / stats strip ---------- */
.stats-strip {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.stat-box {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.stat-box .num {
  font-size: 21px;
  font-weight: 700;
  color: var(--maroon);
}

.stat-box .label {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---------- Mini list cards (kshetra, muni, etc.) ---------- */
.mini-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
}

.mini-card .thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  color: var(--white);
}

.mini-card .title { font-weight: 600; font-size: 15.5px; }
.mini-card .sub { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Chat screen ---------- */
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
}

.msg.bot {
  background: var(--white);
  box-shadow: var(--shadow-soft);
  align-self: flex-start;
  border-top-left-radius: 4px;
}

.msg.user {
  background: var(--maroon);
  color: var(--white);
  align-self: flex-end;
  border-top-right-radius: 4px;
}

.msg .src-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--saffron-dark);
  background: var(--cream-deep);
  padding: 3px 8px;
  border-radius: 999px;
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}

.suggestion-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--cream-deep);
  font-size: 12.5px;
  color: var(--maroon);
  cursor: pointer;
}

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--white);
  border-top: 1px solid var(--cream-deep);
}

.chat-input-bar input {
  flex: 1;
  border: 1px solid var(--cream-deep);
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 14px;
  background: var(--cream);
  outline: none;
}

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--maroon);
  color: var(--white);
  border: none;
  font-size: 16px;
  cursor: pointer;
}

/* ---------- Admin dashboard (desktop) ---------- */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 230px;
  background: var(--maroon-dark);
  color: var(--white);
  padding: 22px 16px;
  flex-shrink: 0;
}

.admin-sidebar .brand { margin-bottom: 28px; }

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 4px;
  cursor: pointer;
}

.admin-nav-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-weight: 600;
}

.admin-main {
  flex: 1;
  background: var(--cream);
  padding: 28px 32px;
  overflow-x: hidden;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-header h1 { font-size: 22px; margin: 0; color: var(--maroon); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

.btn-primary { background: var(--maroon); color: var(--white); }
.btn-outline { background: var(--white); color: var(--maroon); border: 1px solid var(--cream-deep); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.kpi-card .num { font-size: 24px; font-weight: 700; color: var(--maroon); }
.kpi-card .label { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.kpi-card .delta { font-size: 11px; color: var(--success); margin-top: 6px; }

.panel {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cream-deep);
}

.panel-header h3 { margin: 0; font-size: 14.5px; color: var(--maroon); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th {
  text-align: left;
  padding: 10px 20px;
  background: var(--cream-deep);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--cream-deep);
  color: var(--ink);
}

tr:last-child td { border-bottom: none; }

.status-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge.review { background: #fff3cd; color: #946200; }
.status-badge.approved { background: #e1f3e8; color: var(--success); }
.status-badge.crawling { background: #e3edfb; color: #2563eb; }
.status-badge.paused { background: var(--cream-deep); color: var(--ink-soft); }
.status-badge.failed { background: #fbeceb; color: var(--error); }

.two-col {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.two-col > * { min-width: 0; }

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

.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink-soft);
  position: relative;
}

.cal-cell.event {
  background: var(--saffron);
  color: var(--white);
  font-weight: 700;
}

.cal-cell .dot {
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--maroon);
}

/* ---------- Jain lunar calendar grid (Paksha x Tithi) ---------- */
.jain-cal-paksha-row {
  display: grid;
  grid-template-columns: 60px repeat(15, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}

.jain-cal-paksha-label {
  display: flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
}

.jain-cal-cell {
  min-height: 56px;
  min-width: 0;
  border-radius: 8px;
  background: var(--cream);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: default;
}

.jain-cal-tithi-num {
  font-size: 10px;
  color: var(--ink-soft);
  font-weight: 600;
}

.jain-cal-cell.in-range { background: #fdecc8; }

.jain-cal-cell.clickable { cursor: pointer; }
.jain-cal-cell.clickable:hover { outline: 2px solid var(--maroon); outline-offset: -2px; }

.jain-cal-cell.has-event {
  background: var(--saffron);
}

.jain-cal-cell.has-event .jain-cal-tithi-num { color: rgba(255, 255, 255, 0.85); }

.jain-cal-event-chip {
  font-size: 9.5px;
  line-height: 1.2;
  color: var(--white);
  background: var(--maroon);
  border-radius: 4px;
  padding: 1px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Multi-day event continuing through this cell (didn't start here) —
   lighter than a same-day event chip so "starts today" stays visually distinct. */
.jain-cal-event-chip.ongoing {
  background: transparent;
  color: var(--maroon);
  border: 1px solid var(--maroon);
}

@media (max-width: 900px) {
  .jain-cal-paksha-row { grid-template-columns: 34px repeat(15, minmax(0, 1fr)); gap: 3px; }
  .jain-cal-cell { padding: 2px; min-height: 44px; }
  .jain-cal-paksha-label { font-size: 10px; }
  .jain-cal-tithi-num { font-size: 9px; }
  .jain-cal-event-chip { font-size: 8px; padding: 1px 2px; }
}

/* ---------- Gregorian calendar with Jain-date overlay ---------- */
.greg-cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.greg-cal-nav select {
  padding: 8px 10px;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  background: var(--cream);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
}

.greg-cal-year-input {
  width: 76px;
  padding: 8px 10px;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  background: var(--cream);
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
}

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

.greg-cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  padding-bottom: 6px;
  text-transform: uppercase;
}

.greg-cal-cell {
  min-height: 92px;
  min-width: 0;
  border-radius: 8px;
  background: var(--cream);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.greg-cal-cell.out-month { opacity: 0.4; }

.greg-cal-cell.today { outline: 2px solid var(--maroon); outline-offset: -2px; }

.greg-cal-cell.in-range { background: #fdecc8; }

.greg-cal-cell.clickable { cursor: pointer; }
.greg-cal-cell.clickable:hover { outline: 2px solid var(--maroon); outline-offset: -2px; }

.greg-cal-cell.has-event { background: var(--saffron); }

.greg-cal-cell.has-event .greg-cal-daynum,
.greg-cal-cell.has-event .greg-cal-jain-date { color: rgba(255, 255, 255, 0.9); }

.greg-cal-daynum { font-size: 13px; font-weight: 700; color: var(--ink); }

.greg-cal-jain-date { font-size: 9.5px; color: var(--ink-soft); line-height: 1.2; }

@media (max-width: 900px) {
  .greg-cal-grid { gap: 3px; }
  .greg-cal-cell { padding: 3px 2px; min-height: 74px; }
  .greg-cal-daynum { font-size: 11px; }
  .greg-cal-jain-date { font-size: 8.2px; overflow-wrap: break-word; }
}

.admin-mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--maroon-dark);
  color: var(--white);
  padding: 14px 16px;
}

.admin-mobile-topbar .brand { font-size: 15px; gap: 8px; }

.hamburger-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  border: none;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
}

.admin-overlay.show { display: block; }

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }

  .admin-shell { flex-direction: column; }
  .admin-mobile-topbar { display: flex; }

  .admin-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }

  .admin-sidebar.open { transform: translateX(0); }
}

@media (max-width: 600px) {
  .admin-main { padding: 18px 14px; }
  th, td { padding: 10px 14px; }
  table { min-width: 560px; }
}

.tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--cream-deep);
  color: var(--maroon);
  margin: 2px 4px 2px 0;
}

.tag.removable {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tag.removable .x { cursor: pointer; opacity: 0.7; }

/* ---------- Content type tabs ---------- */
.content-tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--cream-deep);
}

.content-tab-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.content-tab-btn.active {
  color: var(--maroon);
  border-bottom-color: var(--maroon);
}

.content-type-panel { display: none; }
.content-type-panel.active { display: block; }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(43,33,24,0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.show { display: flex; }

.modal-panel {
  display: none;
  background: var(--white);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  overflow-y: auto;
  margin: auto;
}

.modal-panel.show { display: block; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--cream-deep);
  position: sticky;
  top: 0;
  background: var(--white);
}

.modal-header h3 { margin: 0; font-size: 16px; color: var(--maroon); }

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
}

.modal-body { padding: 22px; }

.day-popup-event-title { margin: 0 0 6px; font-size: 15px; color: var(--maroon); }
.day-popup-event-desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.day-popup-divider { border: none; border-top: 1px solid var(--cream-deep); margin: 16px 0; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--cream-deep);
  position: sticky;
  bottom: 0;
  background: var(--white);
}

/* ---------- Form ---------- */
.form-row { margin-bottom: 16px; }

.form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.form-row .hint {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 4px;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="file"],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: var(--cream);
  font-family: inherit;
  color: var(--ink);
}

.form-row textarea { resize: vertical; min-height: 70px; }

.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.repeatable-row:has(.sutra-ref-row) {
  grid-template-columns: 1fr auto;
}

.sutra-ref-row {
  grid-template-columns: 3fr 1fr;
}

.crawl-row {
  background: var(--cream);
  border: 1px dashed var(--cream-deep);
  border-radius: var(--radius-md);
  padding: 14px;
}

.crawl-input-group {
  display: flex;
  gap: 8px;
}

.crawl-input-group input { flex: 1; background: var(--white); }

.crawl-status {
  display: none;
  margin-top: 10px;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.crawl-status.show { display: block; }
.crawl-status.loading { background: #e3edfb; color: #2563eb; }
.crawl-status.success { background: #e1f3e8; color: var(--success); }
.crawl-status.error { background: #fbeceb; color: var(--error); }

@media (max-width: 560px) {
  .crawl-input-group { flex-direction: column; }
}

.repeatable-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.add-another-btn {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--saffron-dark);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.remove-row-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--cream-deep);
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
}

/* ---------- Admin: Settings option lists ---------- */
.option-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.option-list-row input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--cream);
  font-family: inherit;
  color: var(--ink);
}

.empty-hint {
  font-size: 12.5px;
  color: var(--ink-soft);
}

.tag-input-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border: 1px dashed var(--cream-deep);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.tag-input-field {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--ink);
  outline: none;
}

.tag-input-field::placeholder { color: var(--ink-soft); }

.chip-multiselect {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--cream-deep);
  background: var(--cream);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}

.chip-checkbox input { accent-color: var(--saffron); }

.chip-checkbox:has(input:checked) {
  border-color: var(--saffron);
  background: #fff7ec;
  color: var(--maroon);
  font-weight: 600;
}

.relation-picker { position: relative; }

.relation-picker-selected {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  background: var(--cream);
  min-height: 40px;
}

.relation-picker-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}

.relation-picker-input::placeholder { color: var(--ink-soft); }

.relation-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.relation-picker-option {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.relation-picker-option:hover { background: var(--cream); }

.relation-picker-empty {
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.symbol-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.symbol-icon-preview {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--cream-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.symbol-icon-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Philosophy sections (Dravya / Karma / Gunsthan / Mokshmarg / Anekantvad & Syadwad) ---------- */
.section-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}

.section-tab-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--cream);
  border: 1px solid var(--cream-deep);
  border-radius: 999px;
  cursor: pointer;
}

.section-tab-btn.active {
  color: var(--white);
  background: var(--maroon);
  border-color: var(--maroon);
}

.philo-section-panel { display: none; }
.philo-section-panel.active { display: block; }

.concept-tree, .concept-tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.concept-tree-children {
  margin-left: 26px;
  padding-top: 6px;
}

.concept-node { margin-bottom: 6px; }

.concept-node-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.concept-node-name {
  flex: 1;
  font-size: 13px;
  color: var(--ink);
}

.concept-node-row a { font-size: 12.5px; white-space: nowrap; }

.icon-btn {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
}

.icon-btn:hover { background: var(--cream-deep); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn:disabled:hover { background: var(--white); }

.move-buttons { display: inline-flex; gap: 2px; }

.tree-toggle, .tree-toggle-spacer {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.tree-toggle {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--ink-soft);
  transition: transform 0.15s;
}

.concept-node.collapsed > .concept-node-row .tree-toggle { transform: rotate(-90deg); }
.concept-node.collapsed > .concept-tree-children { display: none; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--cream-deep);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-switch .slider {
  position: absolute;
  inset: 0;
  background: var(--cream-deep);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-switch .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: var(--white);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .slider { background: var(--success); }
.toggle-switch input:checked + .slider::before { transform: translateX(18px); }

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--cream);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.kalyanak-entry {
  border: 1px solid var(--saffron);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  background: #fff7ec;
}

.kalyanak-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}

.kalyanak-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kalyanak-field-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kalyanak-entry-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--cream-deep);
}

.kalyanak-entry-header .remove-row-btn {
  align-self: end;
}

.kalyanak-date-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

@media (max-width: 560px) {
  .form-row-2col { grid-template-columns: 1fr; }
  .repeatable-row { grid-template-columns: 1fr; }
  .kalyanak-entry-header { grid-template-columns: 1fr; }
  .kalyanak-date-row { grid-template-columns: 1fr; }
}

/* ---------- Rich text editor ---------- */
.rte {
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}

.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-deep);
}

.rte-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: none;
  background: var(--white);
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink);
}

.rte-btn:hover { background: var(--cream-deep); }

.rte-sep {
  width: 1px;
  background: var(--cream-deep);
  margin: 3px 4px;
}

.rte-editor {
  min-height: 130px;
  max-height: 320px;
  overflow-y: auto;
  padding: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  outline: none;
}

.rte-editor:empty::before {
  content: attr(data-placeholder);
  color: #b8aea0;
}

.rte-editor ul, .rte-editor ol { margin: 8px 0; padding-left: 22px; }
.rte-editor p { margin: 0 0 8px; }

/* ---------- Image manager (multi-upload + primary selection) ---------- */
.image-thumb-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.image-thumb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.image-thumb-item.primary {
  border-color: var(--saffron);
  background: #fff7ec;
}

.image-thumb-preview {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--cream-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.image-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-radio {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

.primary-radio input { accent-color: var(--saffron); }

.map-preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--saffron-dark);
}

.nav-link-strip {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 14px;
  background: var(--maroon-dark);
}

.nav-link-strip a {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
}

.nav-link-strip a.current {
  background: var(--gold);
  color: var(--maroon-dark);
  font-weight: 700;
}

a[aria-disabled="true"] {
  color: var(--ink-soft);
  opacity: 0.5;
  pointer-events: none;
}

.source-actions, .document-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- Public site: feed cards ---------- */
.feed-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
}

.feed-card-media img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.feed-card-body {
  padding: 14px 16px;
}

.feed-card-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--saffron-dark);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

.feed-card-title {
  font-size: 17.5px;
  font-weight: 700;
  color: var(--maroon);
  margin: 0 0 6px;
}

/* Small 🎧/🎬 badges shown when a card's entity has audio/video attached —
   shared by feed cards, the homepage highlights carousel, and admin table
   rows (components/public/MediaIcons.tsx, components/admin/widgets/MediaIcons.tsx). */
.media-icons {
  display: inline-flex;
  gap: 4px;
  font-size: 12px;
  vertical-align: middle;
  margin-left: 6px;
}

.feed-card-desc {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* Compact metadata chips (type/city/language/period/etc.) shared by feed
   cards and the homepage highlights carousel — see lib/cardMeta.ts. */
.card-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.meta-chip {
  font-size: 13.5px;
  color: var(--ink-soft);
  background: var(--cream-deep);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* ---------- Public site: category index (Jinvani table of contents) ---------- */
.toc-list {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 14px;
}

.toc-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--cream-deep);
}

.toc-item:last-child {
  border-bottom: none;
}

.toc-item-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--maroon);
}

.toc-item-author {
  font-size: 14px;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Public site: detail pages ---------- */
.detail-hero img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  margin-bottom: 16px;
}

.detail-title {
  font-size: 22px;
  color: var(--maroon);
  margin: 0 0 6px;
}

.detail-meta {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.detail-section {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 18px;
}

.media-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.media-strip-item {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.audio-player {
  width: 100%;
  margin: 0 0 16px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-soft);
}

.empty-state h3 {
  color: var(--maroon);
  margin-bottom: 8px;
}

/* ---------- Public site: search page ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--cream-deep);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
}

.search-bar input::placeholder { color: var(--ink-soft); }

.search-mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--cream-deep);
  color: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.search-mic-btn:hover { background: var(--cream); }

.search-mic-btn.listening {
  background: var(--maroon);
  color: var(--white);
  animation: search-pulse 1.2s ease-in-out infinite;
}

@keyframes search-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107, 31, 58, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(107, 31, 58, 0); }
}

.search-hint {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 18px 4px;
  line-height: 1.5;
}

.search-result-count {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 14px 4px;
}

/* ---------- Public site: event banner day badge ---------- */
.event-banner-days {
  display: inline-block;
  background: var(--saffron);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 8px;
}

/* ---------- Public site: header menu overlay ---------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 33, 24, 0.45);
  z-index: 30;
  display: flex;
  justify-content: flex-end;
}

.menu-overlay-panel {
  width: 78%;
  max-width: 320px;
  background: var(--white);
  height: 100%;
  padding: 20px;
  overflow-y: auto;
}

.menu-overlay-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--ink-soft);
  margin-bottom: 12px;
  padding: 0;
}

.menu-overlay-item {
  display: block;
  padding: 14px 8px;
  font-size: 17px;
  color: var(--ink);
  border-bottom: 1px solid var(--cream-deep);
}

.menu-overlay-item.active {
  color: var(--maroon);
  font-weight: 600;
}

/* ---------- Public site: distance badge ---------- */
.distance-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--saffron-dark);
  background: var(--cream-deep);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- Public site: India map (Leaflet) ---------- */
.leaflet-map-container {
  width: 100%;
  height: 420px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

/* Kshetra type → marker/legend color (see lib/kshetraMapColors.ts). Each
   variant just sets --dot-color, so the actual circle styling lives once,
   shared between the map marker dot and the legend swatch below the map. */
.leaflet-kshetra-dot--maroon, .map-legend-dot--maroon { --dot-color: var(--maroon); }
.leaflet-kshetra-dot--gold, .map-legend-dot--gold { --dot-color: var(--gold); }
.leaflet-kshetra-dot--indigo, .map-legend-dot--indigo { --dot-color: var(--indigo); }
.leaflet-kshetra-dot--sage, .map-legend-dot--sage { --dot-color: var(--sage); }
.leaflet-kshetra-dot--plum, .map-legend-dot--plum { --dot-color: var(--plum); }
.leaflet-kshetra-dot--stone, .map-legend-dot--stone { --dot-color: var(--stone); }
.leaflet-kshetra-dot--saffron, .map-legend-dot--saffron { --dot-color: var(--saffron); }

.leaflet-kshetra-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dot-color, var(--saffron));
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px rgba(43, 33, 24, 0.25);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 4px 0 16px;
}

.map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.map-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot-color, var(--saffron));
  flex-shrink: 0;
}

.map-callout {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.map-callout .title { font-weight: 600; font-size: 16.5px; color: var(--maroon); }
.map-callout .sub { font-size: 14.5px; color: var(--ink-soft); margin: 2px 0 8px; }
.map-callout a { color: var(--saffron-dark); font-weight: 600; font-size: 15px; }

/* ---------- Admin: content panel filter bar ---------- */
.panel-filters {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--cream-deep);
  flex-wrap: wrap;
}

.panel-filters select,
.panel-filters input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--cream-deep);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--white);
  color: var(--ink);
}

.panel-filters select { min-width: 160px; }
.panel-filters input[type="text"] { flex: 1; min-width: 160px; }

/* ---------- Admin: discovered-item media picker (Review modal) ---------- */
.discovered-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.discovered-media-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
}

.discovered-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discovered-media-thumb input[type="checkbox"] {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
}

.discovered-media-thumb:has(input:checked) {
  border-color: var(--saffron);
}
