html {
  background: #dba9d0;
}

.shimmer-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
  mix-blend-mode: screen;
}

.shimmer {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 220, var(--opacity, 0.7)) 0%,
    rgba(255, 200, 120, calc(var(--opacity, 0.7) * 0.5)) 50%,
    transparent 80%
  );
  filter: blur(3px);
  will-change: transform, opacity;
  animation: shimmer-drift var(--dur, 4s) cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  animation-fill-mode: backwards;
}

.shimmer--sharp {
  filter: none;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 1) 0%,
    rgba(255, 240, 180, 0.8) 40%,
    transparent 70%
  );
}

@keyframes shimmer-drift {
  0%   { opacity: 0;                                transform: scale(0.6); }
  10%  { opacity: calc(var(--opacity, 0.6) * 0.4); transform: scale(0.85); }
  35%  { opacity: var(--opacity, 0.6);              transform: scale(1.1); }
  60%  { opacity: calc(var(--opacity, 0.6) * 0.8); transform: scale(0.95); }
  80%  { opacity: calc(var(--opacity, 0.6) * 0.4); transform: scale(0.75); }
  92%  { opacity: calc(var(--opacity, 0.6) * 0.1); transform: scale(0.6); }
  100% { opacity: 0;                                transform: scale(0.6); }
}

.shimmer--bright::after {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 240, 180, 0.6) 30%,
    transparent 65%
  );
  /* negative delay starts the flash animation already offset into the cycle */
  animation: spark-flash var(--dur, 4s) ease-in-out infinite;
  animation-delay: calc(var(--dur, 4s) * var(--spark-delay, 0.3) * -1);
}

@keyframes spark-flash {
  0%   { opacity: 0; transform: scale(0.3); }
  15%  { opacity: 0; transform: scale(0.3); }
  20%  { opacity: 1; transform: scale(1.4); }
  28%  { opacity: 0.5; transform: scale(0.9); }
  35%  { opacity: 0; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(0.3); }
}

:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff4dc;
  color: #3a1440;
  --accent-blue: #5a1d57;
  --accent-purple: #a7004c;
  --accent-coral: #ff5a00;
  --accent-yellow: #f0ce41;
  --accent-blue-soft: rgba(90, 29, 87, 0.14);
  --accent-yellow-soft: rgba(240, 206, 65, 0.35);
  --nh-route-color: #b3b3b3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background: linear-gradient(180deg,
    #fff8ec 0%,
    #ffe0c0 22%,
    #f9bece 38%,
    #e4bedd 50%,
    #f9bece 62%,
    #ffe0c0 78%,
    #fff8ec 100%
  );
  background-size: 100% 300vh;
  background-repeat: repeat-y;
}

.timeline-shell {
  padding: 2rem 1.5rem 4rem;
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
}

.timeline-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 244, 220, 0.9);
  backdrop-filter: blur(6px);
  padding: 1.25rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(90, 29, 87, 0.18);
  box-shadow: 0 12px 30px rgba(90, 29, 87, 0.14);
  display: grid;
  gap: 0.9rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--accent-blue);
}

.back-link {
  color: inherit;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.notes-delete-btn--standalone {
  margin-top: 0.6rem;
  border: 1px solid rgba(90, 29, 87, 0.2);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.6);
}

h1,
h2 {
  margin: 0;
}

.description {
  margin: 0.25rem 0 0;
  color: #7a4a72;
  line-height: 1.6;
}

.content-stats {
  margin: 0.5rem 0 0;
  color: var(--accent-blue);
  font-weight: 600;
  font-size: 0.85rem;
}

.controls-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1 1 260px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: #3a1440;
  border-radius: 999px;
  padding: 0.75rem 0.95rem;
  font-size: 0.95rem;
}

.search-submit-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.8);
  color: #3a1440;
  border-radius: 999px;
  padding: 0.75rem 0.95rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.search-submit-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.theme-toggle {
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  transition: background 120ms ease, transform 120ms ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

a.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.auth-control {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  z-index: 6;
}

.auth-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  color: #3a1440;
}

.auth-icon-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.auth-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(90, 29, 87, 0.25);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.auth-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: rgba(255, 244, 220, 0.98);
  border: 1px solid rgba(90, 29, 87, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(90, 29, 87, 0.18);
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
}

.auth-menu.open {
  display: flex;
}

.auth-menu-email {
  padding: 0.5rem 0.6rem 0.3rem;
  font-size: 0.75rem;
  color: #7a4a72;
  word-break: break-all;
}

.auth-menu-item {
  border: none;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #3a1440;
  cursor: pointer;
  text-decoration: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.auth-menu-item:hover {
  background: rgba(90, 29, 87, 0.08);
}

.search-input:focus {
  outline: 2px solid var(--accent-yellow);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px var(--accent-yellow-soft);
}

.results-summary {
  color: #9c6f92;
  font-size: 0.95rem;
  padding: 0 0.25rem;
}

.refresh-bar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.refresh-btn {
  align-self: flex-start;
  border: 1px solid rgba(90, 29, 87, 0.3);
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-blue);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, opacity 120ms ease;
}

.refresh-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.85);
}

.refresh-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.refresh-log-container {
  position: relative;
  margin-top: 0.5rem;
}

.refresh-log {
  font-size: 0.76rem;
  font-family: ui-monospace, monospace;
  background: rgba(0, 0, 0, 0.06);
  color: #3a1440;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  max-height: 10rem;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  position: relative;
}

.refresh-log-close {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  background: rgba(0, 0, 0, 0.12);
  color: #3a1440;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
  z-index: 10;
}

.refresh-log-close:hover {
  background: rgba(0, 0, 0, 0.2);
}

[data-theme="madhubani"] .refresh-btn {
  border-color: rgba(238, 193, 53, 0.35);
  background: rgba(238, 193, 53, 0.1);
  color: #eec135;
}

[data-theme="madhubani"] .refresh-log {
  background: rgba(255, 255, 255, 0.04);
  color: #c8a86e;
}

[data-theme="madhubani"] .refresh-log-close {
  background: rgba(238, 193, 53, 0.15);
  color: #eec135;
}

[data-theme="madhubani"] .refresh-log-close:hover {
  background: rgba(238, 193, 53, 0.25);
}

.source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0.25rem;
}

.source-filter-chip {
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent-blue);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.source-filter-chip:hover,
.source-filter-chip:focus-visible {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.source-filter-chip--active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

.date-selectors {
  display: none;
  gap: 0.5rem;
  align-items: center;
}

.date-selector {
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: rgba(255, 255, 255, 0.8);
  color: var(--accent-blue);
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 100px;
}

.date-selector:disabled {
  opacity: 0.5;
  cursor: default;
}

.date-go-btn {
  min-width: auto;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(90, 29, 87, 0.3);
  background: rgba(255, 255, 255, 0.55);
  color: var(--accent-blue);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, opacity 120ms ease;
}

.date-go-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.85);
}

.date-go-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid rgba(90, 29, 87, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-blue);
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(90, 29, 87, 0.15);
  transition: all 200ms ease;
  z-index: 1000;
}

.scroll-to-top.show {
  display: flex;
}

.scroll-to-top:hover {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 16px rgba(90, 29, 87, 0.25);
  transform: translateY(-2px);
}

.date-selector:focus-visible {
  outline: 2px solid var(--accent-yellow);
  border-color: var(--accent-blue);
}

.timeline-nav {
  position: fixed;
  top: calc(var(--header-height, 14rem) + 1rem);
  right: 0.75rem;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  max-height: calc(100vh - var(--header-height, 14rem) - 2rem);
  overflow-y: auto;
  padding: 0.4rem 0.2rem;
  scrollbar-width: none;
}

.timeline-nav::-webkit-scrollbar {
  display: none;
}

.nav-year {
  margin-top: 0.5rem;
  background: none;
  border: none;
  padding: 0.1rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #9c6f92;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 6px;
  transition: color 120ms ease, background-color 120ms ease;
}

.nav-year:first-child {
  margin-top: 0;
}

.nav-year:hover,
.nav-year:focus-visible {
  color: var(--accent-blue);
}

.nav-year.expanded {
  color: var(--accent-blue);
  background: var(--accent-yellow-soft);
}

.nav-month {
  background: none;
  border: none;
  padding: 0.1rem 0.3rem;
  font-size: 0.62rem;
  color: rgba(90, 29, 87, 0.55);
  cursor: pointer;
  line-height: 1.4;
  border-radius: 6px;
  transition: color 120ms ease, background-color 120ms ease;
}

.nav-month:hover,
.nav-month:focus-visible {
  color: var(--accent-blue);
  background: var(--accent-yellow-soft);
}

.nav-month--active {
  color: var(--accent-blue);
  font-weight: 700;
}

.nav-month--loading {
  color: var(--accent-blue);
  background: var(--accent-yellow-soft);
}

.video-timeline {
  display: grid;
  gap: 0;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  scroll-margin-top: calc(var(--header-height, 7.5rem) + 1rem);
  transition: background-color 400ms ease;
  border-radius: 16px;
}

.timeline-entry.highlight {
  background: var(--accent-yellow-soft);
}

.timeline-rail {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding-top: 0.4rem;
  position: relative;
}

.timeline-rail::before {
  content: "";
  position: absolute;
  top: 1.2rem;
  bottom: -1rem;
  width: 2px;
  background: rgba(90, 29, 87, 0.2);
}

.timeline-entry:last-child .timeline-rail::before {
  display: none;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-blue);
  z-index: 1;
}

.timeline-date {
  font-size: 0.72rem;
  color: #9c6f92;
  text-align: center;
  line-height: 1.3;
}

.timeline-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(90, 29, 87, 0.16);
  border-radius: 20px;
  padding: 1.1rem;
  display: grid;
  gap: 0.7rem;
  box-shadow: 0 12px 28px rgba(90, 29, 87, 0.1);
}

.timeline-heading {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.timeline-heading--podcast {
  flex-direction: row;
  align-items: flex-start;
}

.media-preview {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #ffdcb8;
}

.media-preview--podcast {
  width: 108px;
  max-width: 108px;
  flex-shrink: 0;
}

.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-embed-wrapper {
  cursor: pointer;
}

.play-button {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(90, 29, 87, 0.75);
  color: #fff;
  font-size: 1rem;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.play-button:hover,
.play-button:focus-visible {
  background: var(--accent-blue);
  transform: scale(1.08);
}

.episode-audio {
  width: 100%;
  height: 36px;
}

.card-title {
  font-weight: 600;
  font-size: 1.02rem;
  color: #3a1440;
  line-height: 1.35;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.card-title-link {
  color: inherit;
  text-decoration: none;
}

.card-title-link:hover,
.card-title-link:focus-visible {
  color: var(--accent-blue);
  text-decoration: underline;
}

.card-badge {
  display: inline-flex;
  width: fit-content;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-yellow-soft);
  color: var(--accent-blue);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-heading {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9c6f92;
}

.about-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.about-card .section-heading:not(:first-child) {
  margin-top: 1.2rem;
}

.about-list {
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
  color: #5a3060;
  line-height: 1.7;
}

.about-credit {
  margin-top: 1.2rem;
  font-size: 0.82rem;
  color: #9c6f92;
  text-align: center;
}

.about-credit a {
  color: var(--accent-blue);
  font-weight: 600;
  text-decoration: none;
}

.about-credit a:hover,
.about-credit a:focus-visible {
  text-decoration: underline;
}

[data-theme="madhubani"] .about-credit {
  color: #c8a86e;
}

.card-details {
  margin-top: 0.5rem;
}

.card-details > summary {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9c6f92;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-details > summary::before {
  content: "▶";
  font-size: 0.6rem;
  transition: transform 120ms ease;
}

.card-details[open] > summary::before {
  transform: rotate(90deg);
}

.card-details-body {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: #5a3060;
  line-height: 1.6;
}

.card-details-body p,
.card-details-body div {
  margin: 0 0 0.4rem;
}

/* YouTube descriptions are plain text whose newlines carry the structure. */
.card-description-plain {
  white-space: pre-wrap;
}


/* Placeholder cards. Every entry starts as one of these and is swapped for the
   real card as it nears the viewport, so the timeline is never blank and never
   has to render a thousand cards to reach an old date. Keeping the real
   .timeline-card/.media-preview boxes means a placeholder occupies very nearly
   the height of the card that replaces it, so the swap barely moves the page. */
/* While the timeline is just the one loading card there is nothing below it to
   scroll to, so don't let the page scroll at all — scrolling past it into bare
   background is exactly what this card is here to prevent. */
.is-loading-timeline,
.is-loading-timeline body {
  overflow: hidden;
}

/* The shaded, sweeping blocks a placeholder is made of. These render at all
   times — nothing about a placeholder is skipped — so however fast the reader
   scrolls, what they land on is a shimmering card rather than an empty one. */
.timeline-entry--skeleton .skeleton-block {
  background: linear-gradient(
    90deg,
    rgba(90, 29, 87, 0.09) 25%,
    rgba(90, 29, 87, 0.17) 37%,
    rgba(90, 29, 87, 0.09) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-sweep 1.4s ease-in-out infinite;
  border-radius: 8px;
}

.timeline-entry--skeleton .skeleton-line {
  height: 0.75rem;
}

.timeline-entry--skeleton .skeleton-line--title {
  height: 1.05rem;
  width: 60%;
}

/* Stand-ins for the collapsed <details> summaries and the playlist button,
   sized to the line boxes they replace so the swap barely moves the page. */
.timeline-entry--skeleton .skeleton-line--summary {
  height: 0.95rem;
  width: 7rem;
  margin-top: 0.5rem;
}

.timeline-entry--skeleton .skeleton-line--control {
  height: 2rem;
  border-radius: 999px;
}

.timeline-entry--skeleton .skeleton-badge {
  height: 1.4rem;
  width: 11rem;
  border-radius: 999px;
}

.timeline-entry--skeleton .skeleton-title {
  opacity: 0.55;
}

@keyframes skeleton-sweep {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-entry--skeleton .skeleton-block {
    animation: none;
  }
}

[data-theme="madhubani"] .timeline-entry--skeleton .skeleton-block {
  background: linear-gradient(
    90deg,
    rgba(238, 193, 53, 0.08) 25%,
    rgba(238, 193, 53, 0.16) 37%,
    rgba(238, 193, 53, 0.08) 63%
  );
  background-size: 400% 100%;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-highlight,
.chip-keyword {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.chip-highlight {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.chip-keyword {
  background: var(--accent-yellow-soft);
  color: #7a4200;
}

.detail-empty {
  color: #9c6f92;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .timeline-entry {
    grid-template-columns: 1fr;
  }

  .timeline-rail {
    flex-direction: row;
    justify-content: flex-start;
  }

  .timeline-rail::before {
    display: none;
  }
}

@media (max-width: 900px) {
  .timeline-nav {
    display: none;
  }

  .date-selectors {
    display: flex;
  }
}

/* ── Madhubani / Gond folk art theme ─────────────────────────────────── */

[data-theme="madhubani"] {
  --accent-blue:        #eec135;
  --accent-yellow:      #c10000;
  --accent-blue-soft:   rgba(238, 193, 53, 0.18);
  --accent-yellow-soft: rgba(193, 0, 0, 0.18);
  --nh-route-color:     rgba(245, 232, 200, 0.4);
}

[data-theme="madhubani"] body {
  background: linear-gradient(180deg,
    #120a02 0%,
    #1a0e08 22%,
    #07161a 38%,
    #0e0d02 50%,
    #07161a 62%,
    #1a0e08 78%,
    #120a02 100%
  );
  background-size: 100% 300vh;
  background-repeat: repeat-y;
  color: #f5e8c8;
}

[data-theme="madhubani"] html {
  background: #120a02;
}

[data-theme="madhubani"] .timeline-header {
  background: rgba(18, 10, 2, 0.9);
  border-color: rgba(238, 193, 53, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

[data-theme="madhubani"] .eyebrow,
[data-theme="madhubani"] .content-stats { color: #eec135; }

[data-theme="madhubani"] .description { color: #c8a86e; }

[data-theme="madhubani"] .search-input {
  background: rgba(255, 255, 255, 0.07);
  color: #f5e8c8;
  border-color: rgba(238, 193, 53, 0.3);
}
[data-theme="madhubani"] .search-input::placeholder { color: rgba(245, 232, 200, 0.4); }
[data-theme="madhubani"] .search-input:focus {
  outline-color: #eec135;
  border-color: #eec135;
  box-shadow: 0 0 0 4px rgba(238, 193, 53, 0.2);
}

[data-theme="madhubani"] .theme-toggle {
  border-color: rgba(238, 193, 53, 0.35);
  background: rgba(238, 193, 53, 0.12);
}

[data-theme="madhubani"] .source-filter-chip {
  border-color: rgba(238, 193, 53, 0.3);
  background: rgba(238, 193, 53, 0.08);
  color: #eec135;
}
[data-theme="madhubani"] .source-filter-chip--active {
  background: #eec135;
  border-color: #eec135;
  color: #120a02;
}

[data-theme="madhubani"] .date-selector {
  border-color: rgba(238, 193, 53, 0.35);
  background: rgba(238, 193, 53, 0.1);
  color: #eec135;
}

[data-theme="madhubani"] .date-go-btn {
  border-color: rgba(238, 193, 53, 0.35);
  background: rgba(238, 193, 53, 0.1);
  color: #eec135;
}

[data-theme="madhubani"] .date-go-btn:hover:not(:disabled) {
  background: rgba(238, 193, 53, 0.2);
}

[data-theme="madhubani"] .scroll-to-top {
  border-color: rgba(238, 193, 53, 0.35);
  background: rgba(18, 10, 2, 0.9);
  color: #eec135;
  box-shadow: 0 2px 12px rgba(238, 193, 53, 0.15);
}

[data-theme="madhubani"] .scroll-to-top:hover {
  background: rgba(18, 10, 2, 0.98);
  box-shadow: 0 4px 16px rgba(238, 193, 53, 0.25);
}

[data-theme="madhubani"] .results-summary { color: rgba(245, 232, 200, 0.5); }

[data-theme="madhubani"] .timeline-rail::before { background: rgba(238, 193, 53, 0.25); }
[data-theme="madhubani"] .timeline-dot { background: #eec135; }
[data-theme="madhubani"] .timeline-date { color: #c8a86e; }

[data-theme="madhubani"] .timeline-card {
  background: rgba(18, 10, 2, 0.88);
  border-color: rgba(238, 193, 53, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

[data-theme="madhubani"] .card-title { color: #f5e8c8; }
[data-theme="madhubani"] .card-title-link:hover { color: #eec135; }
[data-theme="madhubani"] .card-badge {
  background: rgba(238, 193, 53, 0.15);
  color: #eec135;
}

[data-theme="madhubani"] .nav-year { color: rgba(245, 232, 200, 0.45); }
[data-theme="madhubani"] .nav-year.expanded,
[data-theme="madhubani"] .nav-year:hover { color: #eec135; background: rgba(238, 193, 53, 0.1); }
[data-theme="madhubani"] .nav-month { color: rgba(245, 232, 200, 0.35); }
[data-theme="madhubani"] .nav-month:hover,
[data-theme="madhubani"] .nav-month--active { color: #eec135; background: rgba(238, 193, 53, 0.1); }


[data-theme="madhubani"] .timeline-entry.highlight { background: rgba(238, 193, 53, 0.08); }

[data-theme="madhubani"] .card-details > summary,
[data-theme="madhubani"] .section-heading { color: rgba(245, 232, 200, 0.4); }
[data-theme="madhubani"] .card-details-body { color: #c8a86e; }
[data-theme="madhubani"] .media-preview { background: #2a1506; }

/* Coloured folk-art dots — JS sets --dot-color per element */
[data-theme="madhubani"] .shimmer {
  background: radial-gradient(circle at center,
    var(--dot-color, #eec135) 0%, transparent 75%);
}
[data-theme="madhubani"] .shimmer--sharp {
  background: radial-gradient(circle at center,
    var(--dot-color, #eec135) 0%,
    rgba(238, 193, 53, 0.3) 45%,
    transparent 70%);
}
[data-theme="madhubani"] .shimmer--bright::after {
  background: radial-gradient(ellipse at center,
    rgba(255, 255, 255, 0.95) 0%,
    var(--dot-color, #eec135) 35%,
    transparent 65%);
}

/* User-specific features: favorites, progress, notes, profile modal */

.favorite-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent-blue);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  vertical-align: middle;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.favorite-btn:hover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.favorite-btn--active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}

[data-theme="madhubani"] .favorite-btn {
  border-color: rgba(238, 193, 53, 0.3);
  background: rgba(238, 193, 53, 0.08);
  color: #eec135;
}

[data-theme="madhubani"] .favorite-btn--active {
  background: #eec135;
  border-color: #eec135;
  color: #120a02;
}

[data-theme="madhubani"] .modal {
  background: rgba(18, 10, 2, 0.96);
  border: 1px solid rgba(238, 193, 53, 0.25);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  color: #f5e8c8;
}

[data-theme="madhubani"] .modal-close { color: #c8a86e; }

[data-theme="madhubani"] .profile-details dt { color: #c8a86e; }
[data-theme="madhubani"] .profile-details dd { color: #f5e8c8; }

[data-theme="madhubani"] .auth-menu {
  background: rgba(18, 10, 2, 0.96);
  border: 1px solid rgba(238, 193, 53, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

[data-theme="madhubani"] .auth-menu-email { color: #c8a86e; }
[data-theme="madhubani"] .auth-menu-item { color: #f5e8c8; }
[data-theme="madhubani"] .auth-menu-item:hover { background: rgba(238, 193, 53, 0.1); }

[data-theme="madhubani"] .chat-subheading { color: #c8a86e; }

[data-theme="madhubani"] .chat-message--user {
  background: #eec135;
  color: #120a02;
}

[data-theme="madhubani"] .chat-message--model {
  background: rgba(238, 193, 53, 0.12);
  color: #f5e8c8;
}

[data-theme="madhubani"] .chat-message--model a { color: #eec135; }

[data-theme="madhubani"] .chat-textarea {
  background: rgba(238, 193, 53, 0.08);
  border-color: rgba(238, 193, 53, 0.3);
  color: #f5e8c8;
}

[data-theme="madhubani"] .chat-send-btn {
  background: #eec135;
  border-color: #eec135;
  color: #120a02;
}

.playlist-control {
  position: relative;
  margin-top: 0.6rem;
  width: fit-content;
}

.playlist-control-btn {
  border: 1px solid rgba(90, 29, 87, 0.2);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: #3a1440;
}

.playlist-menu {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 4;
  min-width: 220px;
  background: rgba(255, 244, 220, 0.98);
  border: 1px solid rgba(90, 29, 87, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(90, 29, 87, 0.18);
  padding: 0.6rem;
}

.playlist-menu.open {
  display: flex;
}

.playlist-menu-empty {
  margin: 0;
  font-size: 0.8rem;
  color: #9c6f92;
}

.playlist-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #3a1440;
  cursor: pointer;
}

.playlist-menu-new-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.3rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(90, 29, 87, 0.12);
}

.playlist-menu-input {
  flex: 1;
  border: 1px solid rgba(90, 29, 87, 0.2);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
  font-size: 0.82rem;
  font-family: inherit;
}

.playlist-menu-create-btn {
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: #3a1440;
}

.notes-section {
  margin-top: 0.6rem;
}

.notes-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.notes-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  background: rgba(90, 29, 87, 0.06);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  color: #5a3060;
}

.notes-list-item-text {
  flex: 1;
}

.notes-list-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.notes-delete-btn,
.notes-edit-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: #9c6f92;
  flex-shrink: 0;
  line-height: 1;
}

.notes-edit-btn:hover,
.notes-delete-btn:hover {
  color: #3a1440;
}

.notes-form,
.notes-edit-form {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  width: 100%;
}

.notes-cancel-btn {
  border: 1px solid rgba(90, 29, 87, 0.2);
  background: none;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #5a3060;
}

.notes-standalone-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.playlist-item-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}

.playlist-item-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(90, 29, 87, 0.06);
  border-radius: 12px;
  padding: 0.6rem;
  position: relative;
}

.playlist-item-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.playlist-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.playlist-item-card .notes-delete-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255, 244, 220, 0.9);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 1;
}

.notes-input {
  flex: 1;
  border: 1px solid rgba(90, 29, 87, 0.2);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  min-height: 2.2rem;
}

.notes-submit-btn {
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #3a1440;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 5, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.modal {
  position: relative;
  background: rgba(255, 244, 220, 0.98);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 360px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal--wide {
  max-width: 640px;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9c6f92;
}

.profile-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.75rem;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.profile-details dt {
  color: #9c6f92;
  font-weight: 600;
}

.profile-details dd {
  margin: 0;
  color: #3a1440;
}

.chat-modal {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.chat-subheading {
  color: #9c6f92;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  max-height: 45vh;
  min-height: 8rem;
  padding: 0.25rem;
  margin-bottom: 0.75rem;
}

.chat-message {
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  max-width: 85%;
  white-space: pre-wrap;
}

.chat-message--user {
  align-self: flex-end;
  background: var(--accent-blue);
  color: #fff4dc;
}

.chat-message--model {
  align-self: flex-start;
  background: var(--accent-yellow-soft);
  color: #3a1440;
}

.chat-message--model a {
  color: var(--accent-blue);
  font-weight: 600;
}

.chat-message--pending {
  opacity: 0.6;
}

.chat-message--error {
  align-self: center;
  background: transparent;
  color: var(--accent-coral);
  font-size: 0.8rem;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.chat-textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(90, 29, 87, 0.25);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.7);
  color: #3a1440;
}

.chat-send-btn {
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: var(--accent-blue);
  color: #fff4dc;
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.chat-login-prompt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.chat-open-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.nh-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.nh-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.nh-map-card {
  display: flex;
  justify-content: center;
}

.nh-map {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 20;
  margin: 0 auto;
}

/* Side-by-side once there's room, so the northern legs of the journey and
   the description are visible together without scrolling the tall map. */
@media (min-width: 860px) {
  .timeline-shell.nh-page {
    max-width: 1100px;
  }

  .nh-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .nh-map-card {
    flex: 0 0 auto;
    position: sticky;
    top: 1rem;
  }

  .nh-map {
    width: auto;
    max-width: none;
    height: min(78vh, 820px);
  }

  .nh-side {
    flex: 1 1 0;
  }
}

.nh-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.nh-map-land {
  fill: var(--accent-yellow-soft);
}

.nh-route {
  fill: none;
  stroke: var(--nh-route-color, #b3b3b3);
  stroke-width: 0.45;
  stroke-dasharray: 1.6 1.4;
  stroke-linecap: round;
  opacity: 0.8;
}

.nh-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 3.3%;
  height: 1.5%;
  border-radius: 1px;
  border: none;
  background: var(--nh-marker-color, var(--accent-coral));
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: opacity 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.nh-marker:hover,
.nh-marker:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 1px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.nh-map--dimmed .nh-marker {
  opacity: 0.25;
}

.nh-map--dimmed .nh-marker.nh-marker--active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.4);
  z-index: 2;
  outline: 2px solid var(--accent-yellow);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--accent-yellow-soft), 0 2px 6px rgba(0, 0, 0, 0.4);
}

.nh-marker::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(58, 20, 64, 0.92);
  color: #fff4dc;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 3;
}

.nh-marker:hover::after,
.nh-marker:focus-visible::after,
.nh-marker.nh-marker--active::after {
  opacity: 1;
}

[data-theme="madhubani"] .nh-marker::after {
  background: rgba(238, 193, 53, 0.95);
  color: #2a1a05;
}

.nh-detail-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  height: 33rem;
  min-width: 0;
}

/* Match the map's own height once they sit side by side, so the two cards
   line up instead of the detail card looking short next to a tall map. */
@media (min-width: 860px) {
  .nh-detail-card {
    height: min(78vh, 820px);
  }
}

/* Fixed height above + this wrapper as the sole flexible/scrollable
   element keeps the nav row pinned to the same spot regardless of how
   long a given stop's summary (or place name) is, or whether it has a
   video link. */
.nh-detail-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}

.nh-detail-video {
  margin: 0.5rem 0 0;
}

.nh-detail-video-embed {
  max-width: 620px;
}

.nh-detail-nav {
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.nh-nav-btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid rgba(90, 29, 87, 0.25);
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent-blue);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.nh-nav-btn:hover:not(:disabled),
.nh-nav-btn:focus-visible:not(:disabled) {
  border-color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.nh-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.nh-detail-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: #9c6f92;
  min-width: 3.5rem;
  text-align: center;
}

[data-theme="madhubani"] .nh-detail-counter {
  color: #c8a86e;
}


