/* ═══════════════════════════════════════════════════════════
   CAELOVA NEPALI PATRO — calendar.css
   Dark theme (default) + Light theme via [data-theme="light"]
   ═══════════════════════════════════════════════════════════ */

/* ══ DARK THEME (default) — Midnight Vineyard ══ */
#page-calendar {
  /* Backgrounds — Wine-Black base layer */
  --bg-primary:    #1A0808;
  --bg-secondary:  #220C0C;
  --bg-elevated:   #301010;
  --bg-hover:      #4A0E0E;
  --bg-gradient:   radial-gradient(ellipse at 50% 0%, #3A0E0E 0%, #1A0808 80%);

  /* Surfaces — Deep Burgundy cells */
  --surface-base:  #2D0B0B;
  --surface-hover: #3A0E0E;
  --surface-active:#4A1212;

  /* Accent — Rich Gold */
  --accent-primary:   #D4AF37;
  --accent-light:     #E0C068;
  --accent-bright:    #F0D080;
  --accent-dim:       #A08020;
  --accent-glow:      rgba(212, 175, 55, 0.08);

  /* Wine tones */
  --maroon:           #4A0E0E;
  --maroon-light:     #5C1818;
  --maroon-deep:      #2D0B0B;
  --brand-text:       #D4AF37;

  /* Semantic colors */
  --color-holiday:    #DC143C;
  --color-holiday-dim:#B01030;
  --color-festival:   #E0A040;
  --color-sunday:     #C07050;
  --color-sunday-dim: #A06040;
  --color-info:       #5A9AB4;

  /* Text — High-contrast on wine */
  --text-primary:    #F3E5AB;
  --text-secondary:  #D4C8A0;
  --text-tertiary:   #A18E8E;
  --text-muted:      #8A7676;

  /* Borders — Muted wine-gray grid lines */
  --border-base:     #4A2B2B;
  --border-subtle:   #4A2B2B;
  --border-accent:   rgba(212, 175, 55, 0.30);
  --border-glass:    rgba(255, 255, 255, 0.03);

  /* Shadows */
  --shadow-sm:   0 2px 16px rgba(0,0,0,0.50), 0 1px 4px rgba(0,0,0,0.35);
  --shadow-md:   0 8px 28px rgba(0,0,0,0.55), 0 0 0 1px rgba(212,175,55,0.12);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.60), 0 2px 8px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 24px rgba(212, 175, 55, 0.12);

  /* Weekday header */
  --wday-bg:   linear-gradient(180deg, #4A0E0E 0%, #2D0B0B 100%);
  --wday-text: #F3E5AB;
  --wday-border: #4A2B2B;

  /* Today / selected cells — Gold highlights */
  --today-bg:    linear-gradient(145deg, rgba(212,175,55,0.14) 0%, rgba(74,14,14,0.6) 100%);
  --today-border: #D4AF37;
  --today-glow:  0 0 20px rgba(212, 175, 55, 0.18);
  --sel-bg:      rgba(212, 175, 55, 0.10);
  --sel-glow:    0 0 40px rgba(212, 175, 55, 0.22), inset 0 0 10px rgba(212, 175, 55, 0.08);

  /* Holiday cell */
  --holiday-bg:  rgba(220, 20, 60, 0.10);

  /* Controls */
  --lang-toggle-bg:    transparent;
  --today-chip-bg:     rgba(212, 175, 55, 0.08);
  --today-chip-border: rgba(212, 175, 55, 0.15);
  --topbar-bg:         rgba(26, 8, 8, 0.92);

  /* Grid */
  --grid-gap-color: transparent;
  --cell-divider:   #4A2B2B;

  /* Scrollbar */
  --scrollbar-thumb: rgba(212, 175, 55, 0.15);
  --scrollbar-hover: rgba(212, 175, 55, 0.25);

  /* Radius / type */
  --r:    12px;
  --r-sm: 8px;
  --r-xs: 6px;
  --fn-dev:  'Noto Sans Devanagari', 'Mukta', sans-serif;
  --fn-disp: 'Yatra One', 'Noto Sans Devanagari', serif;
  --fn-mono: monospace;
  --fn-body: 'Mukta', sans-serif;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  background: var(--bg-gradient);
  min-height: calc(100vh - 72px);
  position: relative;
}

/* ══ LIGHT THEME — Premium Pearl & Wine Red ══ */
#page-calendar[data-theme="light"] {
  /* Surfaces — Pearl / Off-White */
  --bg-primary:    #FAF9F6;
  --bg-secondary:  #F5F3F0;
  --bg-elevated:   #EFEDEA;
  --bg-hover:      #F0ECEC;
  --surface-base:  #FFFFFF;
  --surface-hover: #FDFCFB;
  --surface-active:#F5F2F0;

  /* Text — Deep charcoal + Slate Gray */
  --text-primary:    #1A1A1A;   /* 16.9:1 on #FFF */
  --text-secondary:  #3A3A3A;   /* 12.1:1 */
  --text-tertiary:   #555555;   /* 7.5:1  */
  --text-muted:      #6B6B6B;   /* 5.7:1  */

  /* Brand — Caelova Wine Red */
  --brand-text:      #4A0E0E;

  /* Accent — Wine Red + Gold */
  --accent-primary:   #4A0E0E;
  --accent-light:     #6B1A1A;
  --accent-bright:    #4A0E0E;
  --accent-dim:       #8B4513;
  --accent-glow:      rgba(74, 14, 14, 0.06);

  /* Wine tones for light */
  --maroon:           #4A0E0E;
  --maroon-light:     #6B1A1A;
  --maroon-deep:      #3A0A0A;

  /* Semantic — refined for light backgrounds */
  --color-holiday:    #B22222;
  --color-holiday-dim:#961C1C;
  --color-festival:   #B8860B;
  --color-sunday:     #8B6B50;
  --color-sunday-dim: #6B5040;
  --color-info:       #3A7CA5;

  /* Borders — Near-invisible, airy feel */
  --border-base:     rgba(74, 14, 14, 0.08);
  --border-subtle:   rgba(0, 0, 0, 0.05);
  --border-accent:   rgba(74, 14, 14, 0.25);
  --border-glass:    rgba(0, 0, 0, 0.02);

  /* Shadows — Soft, premium card feel */
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:   0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-glow: 0 0 16px rgba(74, 14, 14, 0.08);

  --grid-gap-color: transparent;
  --cell-divider:   rgba(0, 0, 0, 0.05);

  /* Today — Gold border on pearl */
  --today-bg:    rgba(212, 175, 55, 0.06);
  --today-border: #D4AF37;
  --today-glow:  0 0 12px rgba(212, 175, 55, 0.12);

  /* Selected — Soft wine tint */
  --sel-bg:   rgba(74, 14, 14, 0.04);
  --sel-glow: 0 0 12px rgba(74, 14, 14, 0.06), 0 4px 12px rgba(0,0,0,0.03);

  /* Holiday cell — Barely-there blush */
  --holiday-bg: rgba(178, 34, 34, 0.04);

  /* Controls */
  --lang-toggle-bg:    transparent;
  --today-chip-bg:     rgba(74, 14, 14, 0.04);
  --today-chip-border: rgba(74, 14, 14, 0.12);
  --topbar-bg:         rgba(250, 249, 246, 0.90);

  /* Scrollbar */
  --scrollbar-thumb: rgba(74, 14, 14, 0.12);
  --scrollbar-hover: rgba(74, 14, 14, 0.22);

  background: var(--bg-primary);
}

/* ── Light theme: Airy weekday header (no solid block) ── */
#page-calendar[data-theme="light"] .wday-row {
  background: transparent;
  border-bottom: 2px solid rgba(74, 14, 14, 0.12);
}
#page-calendar[data-theme="light"] .wday {
  color: #4A0E0E;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 4px;
}
#page-calendar[data-theme="light"] .wday.sat {
  color: #B22222;
}
#page-calendar[data-theme="light"] .wday.sun {
  color: #8B6B50;
}

/* ── Light theme: Calendar container — borderless, airy ── */
#page-calendar[data-theme="light"] .cal-container {
  border: none;
  box-shadow: var(--shadow-sm);
  border-radius: 8px;
  overflow: hidden;
}

/* ── Light theme: Cells — match dark mode layout exactly ── */
#page-calendar[data-theme="light"] .cell {
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
#page-calendar[data-theme="light"] .cell:hover {
  background: #FFFFFF;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 0 0 1px rgba(74, 14, 14, 0.06);
  z-index: 1;
}
#page-calendar[data-theme="light"] .cell.empty {
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* ── Light: Cell internals — match dark mode structure ── */
#page-calendar[data-theme="light"] .cell-num {
  flex: 1;
}
#page-calendar[data-theme="light"] .bs-n {
  font-weight: 700;
  color: #1A1A1A;
}
#page-calendar[data-theme="light"] .cell-tithi-name {
  color: #555555;
}
#page-calendar[data-theme="light"] .ad-n {
  color: #555555;
}

/* ── Light: Saturday & Sunday cell numbers ── */
#page-calendar[data-theme="light"] .cell.sat .bs-n {
  color: #B22222;
}
#page-calendar[data-theme="light"] .cell.sun .bs-n {
  color: #8B6B50;
}

/* ── Light: Saturday & Sunday cell tints ── */
#page-calendar[data-theme="light"] .cell.sat {
  background: rgba(178, 34, 34, 0.02);
}
#page-calendar[data-theme="light"] .cell.sun {
  background: rgba(139, 107, 80, 0.03);
}
#page-calendar[data-theme="light"] .cell.sat:hover,
#page-calendar[data-theme="light"] .cell.sun:hover {
  background: #FFFFFF;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 0 0 1px rgba(74, 14, 14, 0.06);
}

/* ── Light: Today cell — Gold border, soft glow ── */
#page-calendar[data-theme="light"] .cell.today {
  background: rgba(212, 175, 55, 0.06) !important;
  box-shadow: inset 0 0 0 2px #D4AF37, 0 2px 12px rgba(212, 175, 55, 0.10);
}
#page-calendar[data-theme="light"] .cell.today .bs-n {
  color: #4A0E0E !important;
}
#page-calendar[data-theme="light"] .cell.today .ad-n {
  color: #555555;
}
#page-calendar[data-theme="light"] .cell.today .cell-tithi-name {
  color: #555555;
}
#page-calendar[data-theme="light"] .cell.today .cell-evt-name {
  color: #4A0E0E !important;
}
#page-calendar[data-theme="light"] .cell.today .fl-badge {
  background: rgba(212, 175, 55, 0.20);
  color: #3A0A0A;
}
#page-calendar[data-theme="light"] .cell.today.sat .bs-n,
#page-calendar[data-theme="light"] .cell.today.sun .bs-n {
  color: #4A0E0E !important;
}

/* ── Light: Selected cell ── */
#page-calendar[data-theme="light"] .cell.sel {
  background: rgba(74, 14, 14, 0.04) !important;
  box-shadow: inset 0 0 0 2px rgba(74, 14, 14, 0.30);
}
#page-calendar[data-theme="light"] .cell.sel .bs-n {
  color: #4A0E0E !important;
}
#page-calendar[data-theme="light"] .cell.sel .cell-tithi-name {
  color: #4A0E0E !important;
}

/* ── Light: Month name ── */
#page-calendar[data-theme="light"] .month-name {
  color: #4A0E0E;
}

/* ── Light: Holiday cells ── */
#page-calendar[data-theme="light"] .cell.holiday {
  background: rgba(178, 34, 34, 0.03);
}
#page-calendar[data-theme="light"] .cell.holiday:hover {
  background: #FFFFFF;
  box-shadow: 0 2px 12px rgba(178, 34, 34, 0.08), 0 0 0 1px rgba(178, 34, 34, 0.08);
}

/* ── Light: Side panel — color overrides only ── */
#page-calendar[data-theme="light"] .side-panel {
  background: #FFF5F5;
  border-color: rgba(74, 14, 14, 0.06);
}
#page-calendar[data-theme="light"] .sp-sun {
  background: rgba(74, 14, 14, 0.03);
}
#page-calendar[data-theme="light"] .sp-sunrow {
  border-color: rgba(74, 14, 14, 0.08);
}
#page-calendar[data-theme="light"] .sp-sun:first-child {
  border-right-color: rgba(74, 14, 14, 0.08);
}
#page-calendar[data-theme="light"] .sp-card {
  border-left-color: rgba(74, 14, 14, 0.20);
}
#page-calendar[data-theme="light"] .sp-panch-row {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}
#page-calendar[data-theme="light"] .sp-fest-item {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

/* ── Light: Controls refinement ── */
#page-calendar[data-theme="light"] .today-btn {
  color: #4A0E0E;
  border-color: rgba(74, 14, 14, 0.20);
}
#page-calendar[data-theme="light"] .today-btn:hover {
  background: rgba(74, 14, 14, 0.04);
  color: #3A0A0A;
}
#page-calendar[data-theme="light"] .nav-btn:hover {
  border-color: rgba(74, 14, 14, 0.20);
  color: #4A0E0E;
}
#page-calendar[data-theme="light"] .view-bar {
  background: #FFFFFF;
  border-color: rgba(74, 14, 14, 0.08);
}
#page-calendar[data-theme="light"] .vt {
  color: #555555;
  font-weight: 600;
}
#page-calendar[data-theme="light"] .vt.on {
  color: #4A0E0E;
  background: rgba(74, 14, 14, 0.05);
  border-color: rgba(74, 14, 14, 0.20);
  font-weight: 700;
}
#page-calendar[data-theme="light"] .vt:hover:not(.on) {
  color: #1A1A1A;
  background: rgba(0, 0, 0, 0.02);
}
#page-calendar[data-theme="light"] .lang-toggle {
  background: #FFFFFF;
  border-color: rgba(74, 14, 14, 0.10);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
#page-calendar[data-theme="light"] .lang-btn {
  color: #6B6B6B;
}
#page-calendar[data-theme="light"] .lang-btn.on {
  background: #4A0E0E;
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(74, 14, 14, 0.20);
}
#page-calendar[data-theme="light"] .lang-btn:hover:not(.on) {
  color: #1A1A1A;
  background: rgba(0, 0, 0, 0.03);
}
#page-calendar[data-theme="light"] .fl-badge {
  background: rgba(74, 14, 14, 0.10);
  color: #4A0E0E;
}

/* ══ RESET (scoped) ══ */
#page-calendar *, #page-calendar *::before, #page-calendar *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}
#page-calendar a { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════
   GLOBAL CONTAINER
   ═══════════════════════════════════════════════════════════ */
#page-calendar .cal-wrap {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 36px;
}

/* ═══════════════════════════════════════════════════════════
   PREAMBLE & CONTEXT
   ═══════════════════════════════════════════════════════════ */
.cal-preamble {
  text-align: center;
  font-family: var(--fn-dev);
  font-size: 16.5px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
  margin-top: 10px;
  letter-spacing: 0.02em;
  font-weight: 300;
  font-style: italic;
}
#page-calendar[data-theme="light"] .cal-preamble {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   TOPBAR — premium header bar
   ═══════════════════════════════════════════════════════════ */
.cal-topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-base);
  padding: 24px 0 24px;
  position: static;
  margin-bottom: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.cal-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

/* Brand */
.cal-brand {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 16px;
  min-width: 0;
  flex-shrink: 0;
}
.cal-brand-ne {
  font-family: var(--fn-dev);
  font-size: 24px;
  color: var(--brand-text);
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}
.cal-brand-sub {
  font-size: 10.5px;
  font-family: var(--fn-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Today chip — centered date display */
.today-chip-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 0 24px;
}
.today-chip {
  background: var(--surface-base);
  border: 1px solid var(--border-base);
  border-radius: 30px;
  padding: 10px 28px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.today-chip .bs {
  font-size: 17px;
  font-family: var(--fn-dev);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.today-chip .ad-sub {
  font-size: 11px;
  font-family: var(--fn-mono);
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* Controls row */
.cal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Today button */
.today-btn {
  display: inline-flex;
  align-items: center;
  background: var(--surface-base);
  border: 1px solid var(--border-accent);
  border-radius: 30px;
  padding: 0 22px;
  min-height: 40px;
  font-family: var(--fn-dev);
  font-size: 14px;
  color: var(--accent-primary);
  cursor: pointer;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.today-btn:hover {
  background: var(--accent-glow);
  color: var(--accent-bright);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Theme toggle button */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--surface-base);
  border: 1px solid var(--border-base);
  border-radius: 30px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.22s var(--ease);
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  border-color: var(--border-accent);
  color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Language toggle — premium pill selector */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface-base);
  border: 1px solid var(--border-base);
  border-radius: 30px;
  padding: 3px;
  margin-left: 8px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.lang-btn {
  padding: 6px 18px;
  font-size: 13px;
  font-family: var(--fn-dev);
  color: var(--text-muted);
  border-radius: 30px;
  transition: all 0.22s var(--ease);
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.03em;
  font-weight: 500;
  position: relative;
}
.lang-btn.on {
  background: var(--maroon);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.lang-btn:hover:not(.on) {
  color: var(--text-primary);
  background: var(--surface-hover);
}

/* View Tabs — Left Sidebar Navigation */
.view-bar {
  background: var(--surface-base);
  padding: 6px;
  margin-bottom: 24px;
  border: 1px solid var(--border-base);
  border-radius: 16px;
}
.view-bar-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vt {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 20px;
  min-height: 44px;
  font-size: 15px;
  font-family: var(--fn-dev);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.22s var(--ease);
  border: 1px solid transparent;
  background: transparent;
  letter-spacing: 0.01em;
}
.vt.on {
  color: var(--brand-text);
  background: var(--accent-glow);
  border-color: var(--border-accent);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.vt:hover:not(.on) {
  color: var(--text-primary);
  background: var(--surface-hover);
  border-color: var(--border-base);
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT — 2-column grid
   ═══════════════════════════════════════════════════════════ */
.app-body {
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  gap: 40px;
  align-items: start;
  padding: 32px 0 80px;
}

.left-area {
  position: sticky;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.main-area {
  padding: 0;
  min-width: 0;
}
.side-panel {
  border: 1px solid var(--border-base);
  background: var(--bg-secondary);
  padding: 24px;
  position: sticky;
  top: 10px;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════
   MONTH NAVIGATION
   ═══════════════════════════════════════════════════════════ */
.month-nav-wrap {
  margin-bottom: 0;
  margin-top: 0;
}
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 4px;
}
/* cancel the old absolute rules (month-nav-wrap uses same .month-nav) */
.month-nav .nav-btn:first-child { position: static; }
.month-nav .nav-btn:last-child { position: static; }

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: transparent;
  border: 1px solid var(--border-base);
  border-radius: 30px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.nav-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-accent);
  color: var(--brand-text);
}
.month-head {
  text-align: center;
  flex: 1;
  padding: 0 16px;
  min-width: 0;
}
.month-name {
  font-family: var(--fn-dev);
  font-size: 35px;
  color: var(--maroon);
  font-weight: 700;
  line-height: 1.25;
  padding-bottom: 4px;
}
#page-calendar[data-theme="dark"] .month-name { color: var(--accent-primary); }

.month-sub {
  font-size: 14px;
  font-family: var(--fn-mono);
  color: var(--text-tertiary);
  margin-top: 6px;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   WEEKDAY ROW
   ═══════════════════════════════════════════════════════════ */
.wday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.wday {
  text-align: center;
  padding: 18px 4px;
  font-size: 18px;
  font-family: var(--fn-dev);
  color: #FFF;
  font-weight: 600;
}
.wday-row { background: var(--maroon); border-radius: 0; }
#page-calendar[data-theme="dark"] .wday-row { background: var(--maroon-deep); border-bottom: 1px solid #4A2B2B; }
.wday.sun { color: #E0A888; }
.wday.sat { color: #DC143C; }

/* Calendar wrapper — flat, no rounded corners */
.cal-container {
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border-base);
}

/* ═══════════════════════════════════════════════════════════
   MONTHLY GRID — flat table layout
   ═══════════════════════════════════════════════════════════ */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
}

.cell {
  background: var(--surface-base);
  min-height: 120px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  min-width: 0;
  z-index: 1;
}
.cell:nth-child(7n) { border-right: none; }
.cell:hover { 
  background: var(--bg-hover); 
  transform: scale(1.02) translateY(-2px);
  box-shadow: var(--shadow-md);
  z-index: 2;
  border-radius: var(--r-sm);
  border-color: transparent;
}

.cell.empty {
  background: var(--bg-primary);
  cursor: default;
  opacity: 0.3;
  pointer-events: none;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.cell.empty:nth-child(7n) { border-right: none; }

/* Day-of-week shades */
.cell.sun { background: rgba(192, 112, 80, 0.06); }
.cell.sat { background: rgba(220, 20, 60, 0.05); }
.cell.sun:hover { background: rgba(192, 112, 80, 0.10); }
.cell.sat:hover { background: rgba(220, 20, 60, 0.10); }
.cell.sun .bs-n { color: var(--color-sunday); }
.cell.sat .bs-n { color: var(--color-holiday); }

/* Holiday */
.cell.holiday { background: var(--holiday-bg); }
.cell.holiday:hover { background: rgba(220, 20, 60, 0.15); }
.cell.holiday .cell-evt-name { color: var(--color-holiday) !important; font-weight: 700; }

/* Today */
.cell.today {
  background: var(--today-bg) !important;
  box-shadow: inset 0 0 0 2px var(--today-border), var(--today-glow);
  z-index: 2;
}
.cell.today:hover { 
  background: var(--today-bg) !important; 
  box-shadow: inset 0 0 0 2px var(--today-border), 0 0 30px rgba(212, 175, 55, 0.3);
}
.cell.today .bs-n          { color: var(--accent-bright) !important; }
.cell.today .ad-n          { color: #A18E8E; }
.cell.today .cell-tithi-name { color: #D4C8A0; }
.cell.today .cell-evt-name  { color: var(--accent-bright) !important; }
.cell.today .fl-badge       { background: rgba(212,175,55,0.30); color: #1A0808; }
.cell.today.sun .bs-n,
.cell.today.sat .bs-n { color: var(--accent-bright) !important; }

/* Selected */
.cell.sel {
  background: var(--sel-bg) !important;
  box-shadow: inset 0 0 0 2px var(--today-border);
}
.cell.sel:hover { background: var(--sel-bg) !important; }
.cell.sel .bs-n            { color: var(--accent-bright) !important; }
.cell.sel .cell-tithi-name { color: var(--accent-primary) !important; }
.cell.sel .ad-n            { color: var(--text-secondary); }

/* ── Cell internals — new 3-zone layout ── */

/* TOP: event name + badge, centered */
.cell-event {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 18px;
  text-align: center;
  overflow: hidden;
}
.cell-evt-name {
  font-size: 11px;
  font-family: var(--fn-dev);
  color: var(--color-festival);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.cell-evt-name.public_holiday,
.cell-evt-name.major,
.cell-evt-name.public { color: var(--color-holiday); }
.cell-evt-name.hindu,
.cell-evt-name.national { color: var(--color-festival); }
.cell-evt-name.buddhist { color: var(--color-sunday); }
.cell-evt-name.international,
.cell-evt-name.global { color: var(--color-info); }
.cell-evt-name.observance { color: var(--text-tertiary); }
.fl-badge {
  font-size: 9px;
  font-family: var(--fn-mono);
  background: var(--accent-dim);
  color: #1A0808;
  border-radius: 10px;
  padding: 1px 5px;
  flex-shrink: 0;
  font-weight: 700;
  line-height: 1.4;
}

/* MIDDLE: BS date centered */
.cell-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 6px 0;
  min-height: 0;
}
.bs-n {
  font-family: var(--fn-dev);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-primary);
  transition: color 0.18s var(--ease);
  text-align: center;
}

/* BOTTOM: tithi left, AD date right — pinned to cell bottom */
.cell-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
  flex-shrink: 0;
}
.cell-tithi-name {
  font-family: var(--fn-dev);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.ad-n {
  font-size: 11px;
  font-family: var(--fn-mono);
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* (legacy — kept for other views) */
.fl {
  font-size: 10.5px;
  font-family: var(--fn-dev);
  color: var(--accent-primary);
  line-height: 1.3;
  margin-top: 8px;
  display: flex;
  align-items: center;
  background: rgba(212, 175, 55, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  width: fit-content;
}
.fl::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-primary);
  margin-right: 8px;
  box-shadow: 0 0 8px var(--accent-primary);
}
.fl .fl-name { color: var(--brand-text); font-weight: 500; }
.fdots { display: flex; gap: 3px; margin-top: 3px; }
.fd {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}
.fd.public_holiday, .fd.major, .fd.public { background: var(--color-holiday); color: var(--color-holiday); }
.fd.hindu, .fd.national    { background: var(--color-festival); color: var(--color-festival); }
.fd.buddhist               { background: var(--color-sunday); color: var(--color-sunday); }
.fd.global, .fd.international { background: var(--color-info); color: var(--color-info); }
.fd.observance             { background: var(--text-tertiary); color: var(--text-tertiary); }
.fd.festival               { background: var(--accent-dim); color: var(--accent-dim); }
.fl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fl-more { font-size: 9px; color: var(--text-tertiary); font-family: var(--fn-mono); margin-left: 4px; flex-shrink: 0; }
.cell-top-right { text-align: right; flex-shrink: 0; }
.cell-paksha-row { display: flex; align-items: center; gap: 4px; }

/* ═══════════════════════════════════════════════════════════
   WEEKLY VIEW
   ═══════════════════════════════════════════════════════════ */
.week-grid {
  display: grid;
  grid-template-columns: 90px repeat(7, 1fr);
  gap: 0;
  border: 1px solid var(--border-base);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}
.wg-hdr {
  background: var(--wday-bg);
  padding: 14px 8px;
  text-align: center;
  border-right: 1px solid var(--border-subtle);
}
.wg-hdr:last-of-type { border-right: none; }
.wg-hdr.corner { background: var(--wday-bg); }
.wg-hdr .wname  { font-size: 10px; font-family: var(--fn-mono); color: var(--wday-text); letter-spacing: 1px; text-transform: uppercase; }
.wg-hdr .wdate  { font-size: 18px; font-family: var(--fn-dev); font-weight: 800; color: #f4efe4; line-height: 1; margin-top: 4px; }
.wg-hdr .wade   { font-size: 10px; font-family: var(--fn-mono); color: var(--text-tertiary); margin-top: 2px; }
.wg-hdr.wtoday  { background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-dim) 100%); box-shadow: var(--shadow-glow); }
.wg-hdr.wtoday .wname,
.wg-hdr.wtoday .wade { color: rgba(26, 10, 10, 0.6); }
.wg-hdr.wtoday .wdate { color: var(--bg-primary); }
.wg-time { background: var(--bg-secondary); padding: 10px; border-top: 1px solid var(--border-subtle); text-align: right; }
.wg-time span { font-size: 11px; font-family: var(--fn-mono); color: var(--text-secondary); }
.wg-slot {
  background: var(--surface-base);
  padding: 8px;
  border-top: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
  min-height: 50px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.wg-slot:hover { background: var(--surface-hover); }
.wg-slot.wtoday-col { background: var(--accent-glow); }
.wg-slot.panchang-row .panch-pill {
  display: inline-block;
  font-size: 10px; font-family: var(--fn-dev);
  background: var(--accent-glow); color: var(--accent-primary);
  border: 1px solid var(--border-accent);
  border-radius: 14px; padding: 3px 10px;
  white-space: nowrap; margin: 2px;
}
.wg-slot.fest-row .fest-tag {
  display: block; font-size: 11px; font-family: var(--fn-dev);
  color: var(--color-holiday);
  background: rgba(196, 64, 64, 0.08);
  border-left: 2px solid var(--color-holiday);
  padding: 5px 10px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wg-slot.fest-row .fest-tag.buddhist     { color: var(--color-sunday); background: rgba(192,112,80,0.08); border-color: var(--color-sunday); }
.wg-slot.fest-row .fest-tag.major,
.wg-slot.fest-row .fest-tag.public       { color: var(--color-holiday); background: rgba(196,64,64,0.08); border-color: var(--color-holiday); }
.wg-slot.fest-row .fest-tag.national     { color: var(--color-festival); background: rgba(212,144,58,0.08); border-color: var(--color-festival); }
.wg-slot.fest-row .fest-tag.festival     { color: var(--accent-primary); background: var(--accent-glow); border-color: var(--accent-dim); }
.wg-slot.fest-row .fest-tag.international { color: var(--color-info); background: rgba(90,154,180,0.08); border-color: var(--color-info); }
.sun-slot .sun-mini { font-size: 11px; font-family: var(--fn-mono); color: var(--text-tertiary); padding: 2px 0; }

/* ═══════════════════════════════════════════════════════════
   YEAR VIEW
   ═══════════════════════════════════════════════════════════ */
.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-base); }
.mini-month {
  background: var(--surface-base);
  border: none;
  border-radius: 0; overflow: hidden;
  cursor: pointer; transition: background 0.18s var(--ease); box-shadow: none;
}
.mini-month:hover { background: var(--bg-hover); border-color: transparent; box-shadow: none; }
.mm-title {
  background: var(--wday-bg); color: var(--wday-text);
  text-align: center; padding: 10px 10px;
  font-family: var(--fn-dev); font-size: 13px; font-weight: 700; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}
.mm-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 9px; gap: 2px; }
.mm-wd { font-size: 8px; font-family: var(--fn-mono); color: var(--text-tertiary); text-align: center; padding: 4px 0; letter-spacing: 0.5px; font-weight: 600; }
.mm-day {
  font-size: 10px; font-family: var(--fn-dev); text-align: center;
  padding: 5px 2px; border-radius: var(--r-xs);
  color: var(--text-secondary); font-weight: 600;
  transition: all 0.15s var(--ease);
}
.mm-day:hover { background: var(--surface-active); }
.mm-day.mm-today { background: var(--accent-primary); color: var(--bg-primary); font-weight: 700; box-shadow: var(--shadow-glow); }
.mm-day.mm-hol  { color: var(--color-holiday); }
.mm-day.mm-sat  { color: var(--color-sunday); }
.mm-day.mm-empty { opacity: 0; }

/* ═══════════════════════════════════════════════════════════
   DAILY VIEW
   ═══════════════════════════════════════════════════════════ */
.daily-view { width: 100%; margin: 0 auto; }
.dainik-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.dainik-col-left { display: flex; flex-direction: column; gap: 20px; }
.dainik-col-right { display: flex; flex-direction: column; gap: 20px; }

.day-banner {
  background: var(--wday-bg);
  border: none;
  border-bottom: 2px solid var(--border-accent);
  border-radius: 0;
  padding: 24px 28px; margin-bottom: 24px;
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 20px;
  box-shadow: none;
}
.day-bs-date { font-family: var(--fn-dev); font-size: 2rem; color: var(--wday-text); line-height: 1; font-weight: 700; }
.day-ad-date { font-size: 12px; font-family: var(--fn-mono); color: rgba(255,245,230,0.55); margin-top: 6px; letter-spacing: 0.5px; }
.day-vara    { font-size: 15px; font-family: var(--fn-dev); color: rgba(255,245,230,0.8); margin-top: 5px; font-weight: 500; }
.day-nav     { display: flex; gap: 8px; }
.day-nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; color: var(--wday-text); cursor: pointer;
  transition: background 0.18s var(--ease);
}
.day-nav-btn:hover { background: rgba(255,255,255,0.15); }

.detail-card {
  background: var(--surface-base); border: 1px solid var(--border-base);
  border-radius: 0; padding: 22px 24px;
  box-shadow: none;
  height: 100%;
}
.detail-card.ephemeris { height: auto; }
.detail-card-title {
  font-size: 11px; font-family: var(--fn-mono); letter-spacing: 2.5px;
  color: var(--accent-primary); text-transform: uppercase;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-base); font-weight: 600;
}
.panch-table { width: 100%; border-collapse: collapse; }
.panch-table tr { border-bottom: 1px solid var(--border-base); }
.panch-table tr:last-child { border-bottom: none; }
.panch-table td { padding: 14px 0; }
.panch-table td:first-child {
  width: 120px; font-size: 10px; font-family: var(--fn-mono);
  color: var(--accent-dim); letter-spacing: 1.5px;
  vertical-align: top; padding-top: 16px; font-weight: 600;
}
.panch-name { font-family: var(--fn-dev); font-size: 19px; font-weight: 700; line-height: 1.2; color: var(--text-primary); }
.panch-eng  { font-size: 10px; font-family: var(--fn-mono); color: var(--text-secondary); margin-top: 4px; }
.panch-bar-wrap { height: 3px; background: var(--border-base); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.panch-bar { height: 100%; border-radius: 2px; transition: width 0.6s var(--ease); }
.panch-bar.tithi { background: linear-gradient(90deg, var(--accent-dim), var(--accent-primary)); }
.panch-bar.nak   { background: linear-gradient(90deg, var(--color-sunday-dim), var(--color-sunday)); }
.panch-bar.yog   { background: linear-gradient(90deg, #b07828, var(--color-festival)); }
.sun-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sun-card {
  background: var(--surface-base); border: 1px solid var(--border-base);
  border-radius: var(--r); padding: 20px; text-align: center;
}
.sun-icon { font-size: 26px; line-height: 1; }
.sun-lbl { font-size: 10px; font-family: var(--fn-mono); letter-spacing: 2px; color: var(--text-secondary); margin-top: 8px; text-transform: uppercase; font-weight: 600; }
.sun-val { font-size: 21px; font-family: var(--fn-mono); font-weight: 700; color: var(--accent-primary); margin-top: 6px; }
.fest-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 13px 16px; background: transparent;
  border: none; border-left: 2px solid var(--border-accent);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  margin-bottom: 8px;
}
.fest-item:last-child { margin-bottom: 0; border-bottom: none; }
.fest-item.h { border-left-color: var(--color-holiday); }
.fest-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; box-shadow: 0 0 6px currentColor; }
.fest-dot.public_holiday, .fest-dot.major, .fest-dot.public { background: var(--color-holiday); color: var(--color-holiday); }
.fest-dot.hindu, .fest-dot.national  { background: var(--color-festival); color: var(--color-festival); }
.fest-dot.buddhist                    { background: var(--color-sunday); color: var(--color-sunday); }
.fest-dot.global, .fest-dot.international { background: var(--color-info); color: var(--color-info); }
.fest-dot.festival                    { background: var(--accent-dim); color: var(--accent-dim); }
.fest-name-ne { font-family: var(--fn-dev); font-size: 16px; font-weight: 700; color: var(--text-primary); }
.fest-name-en { font-size: 11px; font-family: var(--fn-mono); color: var(--text-secondary); margin-top: 3px; }
.hbadge {
  margin-left: auto; flex-shrink: 0; font-size: 9px; font-family: var(--fn-mono);
  background: linear-gradient(135deg, var(--color-holiday) 0%, var(--color-holiday-dim) 100%);
  color: #fff; border-radius: var(--r-xs); padding: 4px 10px;
  letter-spacing: 1px; align-self: center; text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(196,64,64,0.3);
}
.no-data { text-align: center; color: var(--text-secondary); font-size: 14px; font-family: var(--fn-body); line-height: 1.6; padding: 32px 16px; }
.raw-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.raw-box {
  font-family: var(--fn-mono); font-size: 12px;
  background: var(--surface-base); border: 1px solid var(--border-base);
  border-radius: var(--r-sm); padding: 14px; line-height: 1.5; color: var(--text-secondary);
  display: flex; flex-direction: column; gap: 6px;
}
.raw-box.full { grid-column: 1 / -1; }
.raw-box strong, .raw-label { color: var(--accent-primary); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.raw-val { color: var(--text-primary); font-size: 14px; font-weight: 500; }
.loc-name   { font-family: var(--fn-dev); font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; line-height: 1.6; }
.loc-coords { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
.loc-tz     { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; letter-spacing: 0.5px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   SIDE PANEL — flat, even-padded
   ═══════════════════════════════════════════════════════════ */
/* ── Sidebar spacing: 4/8px system, 32px section gaps ── */
.sp-group { margin-bottom: 32px; }
.sp-group:last-child { margin-bottom: 0; }

/* Section label */
.sp-label {
  font-size: 10px;
  font-family: var(--fn-mono);
  letter-spacing: 2px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.6;
}

/* Date card — left-bordered accent */
.sp-card {
  border: none;
  border-left: 2px solid var(--border-accent);
  background: transparent;
  padding: 16px 20px;
  border-radius: 0;
  box-shadow: none;
}
.sp-date-big { font-family: var(--fn-dev); font-size: 26px; color: var(--text-primary); line-height: 1.6; font-weight: 700; }
.sp-date-ad  { font-size: 12px; font-family: var(--fn-mono); color: var(--text-muted); margin-top: 8px; letter-spacing: 0.5px; line-height: 1.6; }
.sp-vara     { font-size: 15px; font-family: var(--fn-dev); color: var(--text-secondary); margin-top: 8px; font-weight: 500; line-height: 1.6; }

/* Panchang rows — 14px vertical padding, 20px label-value gap */
.sp-panch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  border-radius: 0;
}
.sp-panch-row:last-of-type { border-bottom: none; }
.sp-panch-first { border-left: none; }
.sp-pk     { font-size: 9px; font-family: var(--fn-mono); color: var(--text-muted); letter-spacing: 1.5px; font-weight: 600; text-transform: uppercase; line-height: 1.6; flex-shrink: 0; opacity: 0.8; }
.sp-pv     { text-align: right; }
.sp-pv-ne  { font-family: var(--fn-dev); font-size: 18px; font-weight: 700; text-align: right; color: var(--accent-primary); line-height: 1.6; }
.sp-pv-en  { font-size: 10.5px; font-family: var(--fn-mono); color: var(--text-tertiary); text-align: right; margin-top: 4px; line-height: 1.6; }

/* Sunrise/set — 2-col card */
.sp-sunrow { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-bottom: 0; border: 1px solid var(--border-subtle); border-radius: 6px; overflow: hidden; }
.sp-sun {
  background: var(--bg-elevated);
  border: none;
  padding: 16px;
  text-align: center;
  border-radius: 0;
}
.sp-sun:first-child { border-right: 1px solid var(--border-subtle); }
.sp-sun-icon { color: var(--accent-primary); margin-bottom: 8px; }
.sp-sun-lbl  { font-size: 9px; font-family: var(--fn-mono); color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; line-height: 1.6; opacity: 0.8; }
.sp-sun-val  { font-size: 19px; font-family: var(--fn-mono); font-weight: 700; color: var(--text-primary); margin-top: 8px; line-height: 1.6; }

/* Festival items — left-accent strips */
.sp-fest-item {
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-left: 2px solid var(--border-accent);
  border-radius: 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.sp-fest-item:last-child { margin-bottom: 0; border-bottom: none; }
.sp-fest-item.h            { border-left-color: var(--color-holiday); }
.sp-fest-item.buddhist     { border-left-color: var(--color-sunday); }
.sp-fest-item.international{ border-left-color: var(--color-info); }
.sp-fest-item.festival     { border-left-color: var(--accent-dim); }
.sp-fest-item.hindu,
.sp-fest-item.national     { border-left-color: var(--color-festival); }
.sp-fest-ne { font-family: var(--fn-dev); font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.6; }
.sp-fest-en { font-size: 11px; font-family: var(--fn-mono); color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; text-transform: capitalize; line-height: 1.6; }
.sp-fest-badge {
  font-size: 9px;
  font-family: var(--fn-mono);
  background: var(--color-holiday);
  color: #fff;
  border-radius: 2px;
  padding: 2px 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.no-data-sm { color: var(--text-muted); font-size: 13px; font-family: var(--fn-body); line-height: 1.6; text-align: center; padding: 20px 8px; }

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.cell        { animation: fadeUp 0.3s var(--ease) both; }
.mini-month  { animation: fadeUp 0.35s var(--ease) both; }
.detail-card { animation: fadeUp 0.35s var(--ease) both; }
.sp-sec      { animation: fadeIn 0.35s var(--ease) both; }
.cell:nth-child(7n+1) { animation-delay: 0.02s; }
.cell:nth-child(7n+2) { animation-delay: 0.04s; }
.cell:nth-child(7n+3) { animation-delay: 0.06s; }
.cell:nth-child(7n+4) { animation-delay: 0.08s; }
.cell:nth-child(7n+5) { animation-delay: 0.10s; }
.cell:nth-child(7n+6) { animation-delay: 0.12s; }
.cell:nth-child(7n+7) { animation-delay: 0.14s; }
.mini-month:nth-child(1)  { animation-delay: 0.05s; }
.mini-month:nth-child(2)  { animation-delay: 0.10s; }
.mini-month:nth-child(3)  { animation-delay: 0.15s; }
.mini-month:nth-child(4)  { animation-delay: 0.20s; }
.mini-month:nth-child(5)  { animation-delay: 0.25s; }
.mini-month:nth-child(6)  { animation-delay: 0.30s; }
.mini-month:nth-child(7)  { animation-delay: 0.35s; }
.mini-month:nth-child(8)  { animation-delay: 0.40s; }
.mini-month:nth-child(9)  { animation-delay: 0.45s; }
.mini-month:nth-child(10) { animation-delay: 0.50s; }
.mini-month:nth-child(11) { animation-delay: 0.55s; }
.mini-month:nth-child(12) { animation-delay: 0.60s; }
.detail-card:nth-child(1) { animation-delay: 0.05s; }
.detail-card:nth-child(2) { animation-delay: 0.15s; }
.detail-card:nth-child(3) { animation-delay: 0.25s; }
.detail-card:nth-child(4) { animation-delay: 0.35s; }
.sp-group:nth-child(1) { animation-delay: 0.08s; }
.sp-group:nth-child(2) { animation-delay: 0.16s; }
.sp-group:nth-child(3) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════ */
#page-calendar ::-webkit-scrollbar { width: 5px; }
#page-calendar ::-webkit-scrollbar-track { background: transparent; }
#page-calendar ::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
#page-calendar ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ── 1280px: collapse side panel, keep left nav ── */
@media (max-width: 1280px) {
  .app-body { grid-template-columns: 200px 1fr; gap: 28px; }
  .side-panel { display: none; }
}

/* ── 1024px: single-column, left-area becomes horizontal tabs ── */
@media (max-width: 1024px) {
  #page-calendar .cal-wrap { padding: 0 24px; }

  .app-body {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 20px 0 60px;
  }
  .left-area {
    position: static;
    order: -1;
    margin-bottom: 16px;
  }

  /* View tabs → horizontal strip */
  .view-bar {
    margin-bottom: 16px;
    padding: 4px;
    border-radius: 6px;
  }
  .view-bar-inner {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
  }
  .vt {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    min-height: 38px;
    font-size: 13px;
    padding: 0 12px;
    border-radius: 4px;
  }

  /* Month nav */
  .month-nav { margin-bottom: 20px; }
  .nav-btn { width: 40px; height: 40px; }

  /* Grid cells */
  .cell { min-height: 100px; }

  /* Year / Day views */
  .year-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .dainik-grid { grid-template-columns: 1fr; }
}

/* ── 768px: topbar stacks into 2 rows ── */
@media (max-width: 768px) {
  #page-calendar .cal-wrap { padding: 0 16px; }

  /* Topbar — 2-row layout */
  .cal-topbar { padding: 16px 0; }
  .cal-topbar-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Row 1: Brand + Controls */
  .cal-brand { order: 0; flex-shrink: 0; }
  .cal-brand-ne { font-size: 20px; }
  .cal-brand-sub { display: none; }
  .brand-icon { display: none; }
  .cal-controls { order: 1; gap: 8px; margin-left: auto; }

  /* Row 2: Today chip full-width */
  .today-chip-wrap {
    order: 2;
    width: 100%;
    flex: none;
    justify-content: stretch;
    padding: 0;
  }
  .today-chip {
    width: 100%;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 6px;
  }
  .today-chip .bs { font-size: 15px; }
  .today-chip .ad-sub { font-size: 10px; margin-top: 0; }

  /* Controls — scale down */
  .today-btn { min-height: 36px; padding: 0 16px; font-size: 13px; }
  .theme-toggle-btn { width: 36px; height: 36px; }
  .lang-toggle { margin-left: 0; }
  .lang-btn { padding: 4px 14px; font-size: 12px; min-height: 28px; }

  /* Month nav */
  .month-nav { margin-bottom: 16px; padding-bottom: 0; }
  .month-name { font-size: 1.7rem; padding-bottom: 2px; }
  .month-sub { font-size: 12px; margin-top: 4px; }
  .nav-btn { width: 38px; height: 38px; }

  /* Grid cells */
  #page-calendar .cell { min-height: 88px; padding: 6px 6px; }
  #page-calendar .bs-n { font-size: 20px; }
  #page-calendar .cell-tithi-name { font-size: 8.5px; }
  #page-calendar .ad-n { font-size: 8.5px; }
  #page-calendar .cell-footer { gap: 2px; }
  .cell-evt-name { font-size: 9px; }
  .cell-event { min-height: 14px; }
  .fl-badge { font-size: 8px; padding: 0 4px; }

  /* Weekday header */
  .wday { font-size: 13px; padding: 10px 2px; }
}

/* ── 640px: compact mobile ── */
@media (max-width: 640px) {
  #page-calendar .cal-wrap { padding: 0 10px; }

  .app-body { padding: 12px 0 40px; }

  /* View tabs tighten */
  .view-bar { padding: 3px; }
  .vt { min-height: 34px; font-size: 12px; padding: 0 8px; }

  /* Month nav */
  .month-name { font-size: 1.4rem; }
  .month-sub { font-size: 11px; }
  .nav-btn { width: 34px; height: 34px; border-radius: 6px; }

  /* Grid cells — hide events, keep footer stacked */
  #page-calendar .cell { min-height: 72px; padding: 4px 3px; }
  #page-calendar .bs-n { font-size: 16px; }
  #page-calendar .cell-footer {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  #page-calendar .cell-tithi-name {
    font-size: 7.5px;
    text-align: center;
    width: 100%;
  }
  #page-calendar .ad-n {
    font-size: 7px;
    text-align: center;
    width: 100%;
  }
  .cell-evt-name { display: none; }
  .fl-badge { display: none; }
  .cell-event { min-height: 0; }
  .cell-num { padding: 2px 0; }

  /* Weekday header */
  .wday { font-size: 10px; padding: 8px 2px; }

  /* Year view */
  .year-grid { grid-template-columns: 1fr; }

  /* Controls further compact */
  .today-btn { min-height: 34px; padding: 0 12px; font-size: 12px; border-radius: 4px; }
  .theme-toggle-btn { width: 34px; height: 34px; border-radius: 4px; }
  .lang-btn { padding: 4px 10px; font-size: 11px; min-height: 26px; }
  .lang-toggle { border-radius: 4px; padding: 2px; }
}

/* ── 480px: ultra compact ── */
@media (max-width: 480px) {
  #page-calendar .cal-wrap { padding: 0 6px; }

  /* Topbar minimal */
  .cal-topbar { padding: 12px 0; }
  .cal-topbar-inner { gap: 8px; }
  .cal-brand-ne { font-size: 17px; }
  .today-chip { padding: 6px 12px; gap: 8px; border-radius: 4px; }
  .today-chip .bs { font-size: 13px; }
  .today-chip .ad-sub { font-size: 9px; }

  /* Controls — minimum viable */
  .cal-controls { gap: 4px; }
  .today-btn { min-height: 30px; padding: 0 10px; font-size: 11px; }
  .theme-toggle-btn { width: 30px; height: 30px; }
  .lang-btn { padding: 3px 8px; font-size: 10px; min-height: 24px; }
  .lang-toggle { padding: 2px; }

  /* Month nav */
  .month-name { font-size: 1.2rem; }
  .month-sub { font-size: 10px; }
  .nav-btn { width: 30px; height: 30px; border-radius: 4px; }

  /* Grid cells — keep footer stacked, ultra compact */
  #page-calendar .cell { min-height: 60px; padding: 2px 2px; }
  #page-calendar .bs-n { font-size: 14px; }
  #page-calendar .cell-tithi-name { font-size: 6.5px; }
  #page-calendar .ad-n { font-size: 6px; }
  .cell-event { display: none; }
  .cell-num { padding: 0; }

  /* Weekday header */
  .wday { font-size: 9px; padding: 6px 1px; }
}
