:root {
  --rmy-gold: #c9962e;
  --rmy-gold-dark: #9a7020;
  --rmy-ink: #1c1510;
  --rmy-parchment: #f7f1e6;
  --rmy-panel: #16110d;
  --rmy-muted: #8f8173;
  --rmy-crimson: #7a2818;
}

body.ramayana-body {
  margin: 0;
  background: #0f0c0a;
  color: #f1ebd9;
  font-family: "Outfit", "Noto Sans Devanagari", system-ui, sans-serif;
}

.rmy-hud {
  background: linear-gradient(180deg, #1f1813, #14100c);
  border-bottom: 2px solid var(--rmy-gold-dark);
  position: sticky;
  top: 0;
  z-index: 1200;
}

.rmy-hud-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px 16px;
}

.rmy-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 200px;
}

.rmy-om { color: var(--rmy-gold); font-size: 1.6rem; }
.rmy-brand h1 {
  margin: 0;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1rem;
  color: var(--rmy-gold);
}
.rmy-brand p { margin: 0; font-size: 0.72rem; color: var(--rmy-muted); }

.rmy-kanda {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
}
.rmy-kanda-btn {
  border: 1px solid #5a4837;
  background: #2a211a;
  color: #d8cab8;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}
.rmy-kanda-btn.is-active,
.rmy-kanda-btn:hover {
  background: var(--rmy-gold-dark);
  border-color: var(--rmy-gold);
  color: #fff;
}

.rmy-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rmy-toggle-group {
  display: inline-flex;
  border: 1px solid #5a4837;
  border-radius: 6px;
  overflow: hidden;
}
.rmy-toggle {
  background: transparent;
  border: 0;
  color: #cbbba8;
  padding: 6px 10px;
  font-size: 0.72rem;
  cursor: pointer;
}
.rmy-toggle.is-active {
  background: var(--rmy-crimson);
  color: #fff;
}
.rmy-lang {
  color: var(--rmy-gold);
  border: 1px solid var(--rmy-gold-dark);
  padding: 5px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
}

.rmy-workspace {
  display: flex;
  min-height: calc(100vh - 140px);
}

.rmy-map-pane {
  flex: 6;
  position: relative;
  min-height: 420px;
}
.rmy-map {
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: #0f0c0a;
}
.rmy-map .leaflet-container {
  background: transparent;
  font: inherit;
}
.rmy-land-overlay {
  pointer-events: none;
  filter: drop-shadow(0 0 18px rgba(201, 150, 46, 0.18));
}

.rmy-region-label-wrap {
  background: none !important;
  border: none !important;
}
.rmy-region-label {
  display: inline-block;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f3ebe0;
  text-shadow:
    0 0 8px rgba(26, 18, 12, 0.9),
    0 1px 0 #1a120c,
    0 -1px 0 #1a120c,
    1px 0 0 #1a120c,
    -1px 0 0 #1a120c;
  opacity: 0.92;
  pointer-events: none;
  white-space: nowrap;
}
.rmy-region-bharat { font-size: 1.15rem; letter-spacing: 0.18em; }
.rmy-region-lanka { font-size: 0.95rem; letter-spacing: 0.14em; color: #e8d4a8; }
.rmy-tooltip {
  background: #1c1510 !important;
  border: 1px solid var(--rmy-gold) !important;
  color: #f1ebd9 !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}
.rmy-tooltip::before {
  border-top-color: var(--rmy-gold) !important;
}

.rmy-katha-pane {
  flex: 4;
  background: var(--rmy-parchment);
  color: #1a120c;
  overflow-y: auto;
  border-left: 2px solid var(--rmy-gold-dark);
  max-height: calc(100vh - 140px);
}
.rmy-katha-pane,
.rmy-katha-pane p,
.rmy-katha-pane li,
.rmy-katha-pane strong,
.rmy-katha-pane em,
.rmy-katha-pane span,
.rmy-katha-pane h2,
.rmy-katha-pane h3,
.rmy-katha-pane blockquote {
  color: #1a120c;
}

body.view-readers .rmy-map-pane {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  overflow: hidden;
}
body.view-readers .rmy-katha-pane {
  flex: 1;
  max-width: 820px;
  margin: 0 auto;
  border-left: 0;
  max-height: none;
}
body.view-readers .rmy-open-map-chip {
  display: inline-flex !important;
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 1300;
}

.rmy-open-map-chip {
  display: none;
  background: var(--rmy-gold);
  color: #1a140f;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.rmy-open-map-chip.is-hidden { display: none !important; }

.rmy-dossier {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: min(340px, calc(100% - 32px));
  background: rgba(22, 17, 13, 0.95);
  border: 2px solid var(--rmy-gold);
  border-radius: 8px;
  padding: 14px;
  z-index: 1000;
}
.rmy-dossier.is-hidden { display: none; }
.rmy-close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: 0;
  color: var(--rmy-muted);
  font-size: 1.3rem;
  cursor: pointer;
}
.rmy-badge { margin: 0; color: var(--rmy-gold); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.rmy-dossier h2 { margin: 4px 0 6px; font-size: 1.05rem; color: #fff; font-family: "Fraunces", serif; }
.rmy-coords { margin: 0 0 8px; color: var(--rmy-muted); font-size: 0.75rem; }
.rmy-gold-btn {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(180deg, var(--rmy-gold), var(--rmy-gold-dark));
  border: 0;
  color: #1a140f;
  font-weight: 700;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
}

.rmy-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2a1c12;
  border: 2px solid var(--rmy-gold);
  color: #f5e6c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.rmy-marker.is-selected {
  transform: scale(1.25);
  border-color: #fff;
  box-shadow: 0 0 12px var(--rmy-gold);
}
.rmy-div-icon { background: none; border: none; }

.rmy-katha-stream { padding: 20px 18px 40px; }
.rmy-card {
  background: #fff;
  border: 1px solid #d8c9b0;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  color: #1a120c;
}
.rmy-card.is-focused {
  border-color: var(--rmy-gold-dark);
  box-shadow: 0 0 0 2px rgba(201, 150, 46, 0.25);
}
.rmy-step {
  color: var(--rmy-crimson);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.rmy-card h2 {
  margin: 4px 0 10px;
  font-family: "Fraunces", "Noto Serif Devanagari", serif;
  font-size: 1.25rem;
  color: #1a1512;
}
.rmy-shloka {
  background: #fbf6ea;
  border-left: 4px solid var(--rmy-gold);
  padding: 12px 14px;
  margin: 0 0 12px;
  border-radius: 4px;
}
.rmy-shloka .orig {
  font-family: "Noto Serif Devanagari", serif;
  white-space: pre-line;
  margin: 0 0 6px;
  color: #4a3218;
}
.rmy-shloka .meaning { margin: 0; font-size: 0.9rem; color: #5a4634; }
.rmy-story p {
  line-height: 1.65;
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #1a120c;
}
body.audience-kids .rmy-story p { font-size: 1.05rem; line-height: 1.7; }
.rmy-moral {
  background: #f3ebe0;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 12px 0;
  font-size: 0.92rem;
  color: #1a120c;
}
.rmy-list-title { margin: 12px 0 4px; font-size: 0.8rem; font-weight: 700; color: #3d2a1c; }
.rmy-card ul { margin: 0 0 8px; padding-left: 1.1rem; }
.rmy-card li { margin-bottom: 4px; font-size: 0.9rem; color: #1a120c; }
.rmy-locate {
  margin-top: 10px;
  background: none;
  border: 1px solid #b8a892;
  color: #5e4c3c;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}
.rmy-related { padding: 0 18px 32px; }
.rmy-related a { color: var(--rmy-crimson); }

@media (max-width: 900px) {
  .rmy-workspace { flex-direction: column; }
  .rmy-map-pane { height: 42vh; flex: none; }
  .rmy-katha-pane { max-height: none; border-left: 0; border-top: 2px solid var(--rmy-gold-dark); }
  body.view-readers .rmy-map-pane { display: none; }
  body.view-readers.force-map .rmy-map-pane { display: block; height: 50vh; width: 100%; flex: none; }
}
