/* ----------------------------------------------------------
   RESET BÁSICO & CONTENEDORES
---------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
.calendar-page,
.calendar-page .main,
.calendar-page .section,
.calendar-page footer,
.calendar-page .footer {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--bg) !important;
  background-image: none !important;
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

/* ----------------------------------------------------------
   TEMAS: OSCURO (NOCHE) Y CLARO (DÍA CON FONDO MARRÓN Y CELDAS GRISES)
---------------------------------------------------------- */

/* ==========================================================
   MODO OSCURO (NOCHE - Diseño original azul/cian)
========================================================== */
:root,
:root[data-theme="dark"] {
  --bg: #121316;
  --bg-global: #121316;
  --text: #e6e6e6;
  --text-muted: #9aa0a6;
  --cell-bg: #1e2025;
  --cell-border: #32363f;
  --cell-hover-border: #4fc3ff;
  --surface-1: #16181d;
  --surface-2: #242830;
  --card-bg: #1e2025;
  
  --today-border: #00bfe6;
  --today-bg: #1e2025;
  --today-shadow: 0 0 15px rgba(0, 191, 230, 0.6), inset 0 0 8px rgba(0, 191, 230, 0.2);
  --today-badge-bg: #00bfe6;
  --today-badge-color: #000000;
  
  --rosh-bg: #4a3700;
  --rosh-border: #d49b00;
  --rosh-label-bg: #d49b00;
  --rosh-label-color: #000000;
  
  --header-title-color: #ffffff;
  --header-subtitle-color: rgba(255, 255, 255, 0.7);
  --weekdays-text: #e6e6e6;
  --shabat-text: #4fc3ff;
  
  --nav-arrow-bg: linear-gradient(145deg, #0a2a4f, #0d3b7a);
  --nav-arrow-border: transparent;
  --nav-arrow-icon: #4fc3ff;
  --nav-arrow-shadow: 0 0 12px rgba(0, 150, 255, 0.7), inset 0 0 8px rgba(0, 150, 255, 0.4);
  --nav-arrow-hover-shadow: 0 0 18px rgba(0, 180, 255, 1), inset 0 0 10px rgba(0, 180, 255, 0.6);
  
  --download-btn-bg: linear-gradient(145deg, rgba(10, 42, 79, 0.8), rgba(13, 59, 122, 0.8));
  --download-btn-border: rgba(79, 195, 255, 0.4);
  --download-btn-color: #4fc3ff;
  --download-btn-hover-bg: linear-gradient(145deg, rgba(13, 59, 122, 0.95), rgba(20, 80, 160, 0.95));
  --download-btn-hover-border: rgba(79, 195, 255, 0.7);
  --download-btn-hover-color: #ffffff;
}

/* ==========================================================
   MODO CLARO (DÍA - Fondo Marrón Oscuro Cálido y Celdas Gris Suave)
========================================================== */
:root[data-theme="light"] {
  --bg: #4e3d2f; /* Fondo marrón cálido elegante */
  --bg-global: #4e3d2f;
  --text: #1a1612;
  --text-muted: #4d4439;
  --cell-bg: #c9c2b7; /* Celdas en color gris suave */
  --cell-border: #756857; /* Bordes más oscuros y nítidos */
  --cell-hover-border: #382b20;
  --surface-1: #382b20; /* Fila de días en marrón profundo */
  --surface-2: #48382b;
  --card-bg: #c9c2b7;
  
  --today-border: #005f9e; /* Azul oscuro más visible y no pálido */
  --today-bg: #c9c2b7;
  --today-shadow: 0 0 12px rgba(0, 95, 158, 0.45);
  --today-badge-bg: #005f9e;
  --today-badge-color: #ffffff;
  
  --rosh-bg: #a88a44; /* Tono ocre más oscuro y definido */
  --rosh-border: #694f13;
  --rosh-label-bg: #694f13;
  --rosh-label-color: #ffffff;
  
  --header-title-color: #fdfbf7;
  --header-subtitle-color: #ded3c3;
  --weekdays-text: #f0e8dd;
  --shabat-text: #d4b895;
  
  --nav-arrow-bg: linear-gradient(145deg, #3d2f23, #2e2319);
  --nav-arrow-border: #735e49;
  --nav-arrow-icon: #d4b895;
  --nav-arrow-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  --nav-arrow-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(212, 184, 149, 0.3);
  
  --download-btn-bg: linear-gradient(145deg, #3d2f23, #2e2319);
  --download-btn-border: #735e49;
  --download-btn-color: #f0e8dd;
  --download-btn-hover-bg: linear-gradient(145deg, #523f2f, #3d2f23);
  --download-btn-hover-border: #d4b895;
  --download-btn-hover-color: #ffffff;
}

/* ----------------------------------------------------------
   CONTENEDOR PRINCIPAL
---------------------------------------------------------- */
.calendar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ----------------------------------------------------------
   HEADER
---------------------------------------------------------- */
.calendar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 18px;
}

.calendar-header-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.calendar-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.calendar-header h1 {
  font-family: "Montserrat", "Poppins", sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--header-title-color);
  letter-spacing: 0.5px;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.year-select-container,
.month-select-container {
  display: inline-flex;
  align-items: center;
}

.year-select,
.month-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border-radius: 8px;
  padding: 5px 32px 5px 12px;
  font-family: "Montserrat", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Modo Noche (Oscuro) para los Selectores de Año y Mes */
:root[data-theme="dark"] .year-select,
:root[data-theme="dark"] .month-select,
body.dark .year-select,
body.dark .month-select {
  background-color: #1e2025;
  border: 1.5px solid #32363f;
  color: #4fc3ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234fc3ff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] .year-select:hover,
:root[data-theme="dark"] .year-select:focus,
:root[data-theme="dark"] .month-select:hover,
:root[data-theme="dark"] .month-select:focus {
  border-color: #4fc3ff;
  box-shadow: 0 0 12px rgba(79, 195, 255, 0.45);
}

:root[data-theme="dark"] .year-select option,
:root[data-theme="dark"] .month-select option {
  background-color: #1e2025;
  color: #e6e6e6;
}

/* Modo Día (Claro) para los Selectores de Año y Mes */
:root[data-theme="light"] .year-select,
:root[data-theme="light"] .month-select {
  background-color: #382b20;
  border: 1.5px solid #735e49;
  color: #fdfbf7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d4b895' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

:root[data-theme="light"] .year-select:hover,
:root[data-theme="light"] .year-select:focus,
:root[data-theme="light"] .month-select:hover,
:root[data-theme="light"] .month-select:focus {
  border-color: #d4b895;
  box-shadow: 0 0 12px rgba(212, 184, 149, 0.35);
}

:root[data-theme="light"] .year-select option,
:root[data-theme="light"] .month-select option {
  background-color: #382b20;
  color: #fdfbf7;
}

.calendar-header h2 {
  font-family: "Roboto", sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--header-subtitle-color);
  letter-spacing: 0.3px;
  margin: 0;
}

button {
  padding: 6px 12px;
  cursor: pointer;
}

/* ----------------------------------------------------------
   SLIDER
---------------------------------------------------------- */
.month-slider {
  display: none;
  width: 100%;
  margin: 10px 0 20px 0;
  text-align: center;
}

#month-slider {
  width: 60%;
}

/* ----------------------------------------------------------
   FILA DE DÍAS DE LA SEMANA
---------------------------------------------------------- */
.weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--cell-border);
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  font-family: "Montserrat", "Segoe UI", sans-serif;
  margin-bottom: 12px;
}

.weekdays-row > div {
  text-align: center;
  padding: 10px 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--weekdays-text);
  border-radius: 6px;
  letter-spacing: 0.5px;
  transition: background 0.2s ease, color 0.2s ease;
}

.weekdays-row > div:hover {
  background: rgba(255, 255, 255, 0.08);
}

.weekdays-row > div:last-child {
  color: var(--shabat-text);
  font-weight: 700;
}

/* ----------------------------------------------------------
   GRILLA DEL CALENDARIO
---------------------------------------------------------- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  width: 100%;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.calendar-grid.fade-out {
  opacity: 0;
  transform: translateY(8px);
}

.calendar-grid.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* ----------------------------------------------------------
   CELDAS
---------------------------------------------------------- */
.calendar-cell {
  background: var(--cell-bg);
  border: 1.5px solid var(--cell-border);
  padding: 8px;
  border-radius: 8px;
  min-height: 96px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.calendar-cell:hover:not(.empty) {
  border-color: var(--cell-hover-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.calendar-cell.empty {
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: none;
}

/* DÍA ACTUAL (HOY) */
.today {
  border: 2.5px solid var(--today-border) !important;
  box-shadow: var(--today-shadow) !important;
  background: var(--cell-bg) !important;
  z-index: 2;
}

.today .lunisolar-day {
  color: var(--text) !important;
}

.today .gregorian-day,
.today .moon-info span,
.today .moon-info .moon-text {
  color: var(--text-muted) !important;
}

.today-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--today-badge-bg);
  color: var(--today-badge-color);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 3;
}

/* ----------------------------------------------------------
   DÍAS & TIPOGRAFÍA
---------------------------------------------------------- */
.lunisolar-day {
  font-family: "Montserrat", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.gregorian-day {
  font-family: "Roboto", sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.2;
  font-weight: 500;
}

/* ----------------------------------------------------------
   FASE LUNAR
---------------------------------------------------------- */
.moon-info {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
}

.moon-icon {
  font-size: 1.15rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.moon-info span,
.moon-info .moon-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ----------------------------------------------------------
   ROSH JODESH
---------------------------------------------------------- */
.roshjodesh {
  background: var(--rosh-bg);
  border: 2.5px solid var(--rosh-border);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.15);
  padding-top: 24px;
}

.rosh-label {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--rosh-label-bg);
  color: var(--rosh-label-color);
  font-family: "Montserrat", sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* ----------------------------------------------------------
   ETIQUETAS Y BORDES BASE DE FESTIVIDADES
---------------------------------------------------------- */
.holiday-label {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  letter-spacing: 0.5px;
  z-index: 4;
}

.pesaj-label {
  background: #9c1313;
  color: #fff !important;
  text-transform: uppercase;
}

.hamatzo-label {
  background: #b33e00;
  color: #fff !important;
  text-transform: uppercase;
}

.bikurim-label {
  background: #175e24;
  color: #fff !important;
  text-transform: uppercase;
}

.shavuot-label {
  background: #095273;
  color: #fff !important;
  text-transform: uppercase;
}

.yomteruah-label {
  top: auto;
  bottom: 5px;
  background: #5b0f82;
  color: #fff !important;
  text-transform: uppercase;
}

.yomkippur-label {
  background: #7d5e00;
  color: #fff !important;
  text-transform: uppercase;
}

.sukkot-label {
  background: #175e24;
  color: #fff !important;
  text-transform: uppercase;
}

.shemini-label {
  background: #095273;
  color: #fff !important;
  text-transform: uppercase;
}

.pesaj {
  background: #5c1414 !important;
  border: 2.5px solid #9c1313 !important;
  box-shadow: inset 0 0 12px rgba(156, 19, 19, 0.4);
  padding-top: 24px;
}
.pesaj .lunisolar-day { color: #ffffff !important; }
.pesaj .gregorian-day, .pesaj .moon-info span { color: #fecaca !important; }

.hamatzo {
  background: #5e2405 !important;
  border: 2.5px dashed #d9531e !important;
  box-shadow: inset 0 0 12px rgba(217, 83, 30, 0.35);
  padding-top: 24px;
}
.hamatzo .lunisolar-day { color: #ffffff !important; }
.hamatzo .gregorian-day, .hamatzo .moon-info span { color: #fed7aa !important; }

.bikurim {
  background: #113d1a !important;
  border: 2.5px solid #16a34a !important;
  box-shadow: inset 0 0 12px rgba(22, 163, 74, 0.35);
  padding-top: 24px;
}
.bikurim .lunisolar-day { color: #ffffff !important; }
.bikurim .gregorian-day, .bikurim .moon-info span { color: #bbf7d0 !important; }

.shavuot {
  background: #093c52 !important;
  border: 2.5px solid #0891b2 !important;
  box-shadow: inset 0 0 12px rgba(8, 145, 178, 0.35);
  padding-top: 24px;
}
.shavuot .lunisolar-day { color: #ffffff !important; }
.shavuot .gregorian-day, .shavuot .moon-info span { color: #bae6fd !important; }

.yomteruah {
  background: #3e0b57 !important;
  border: 2.5px solid #9333ea !important;
  box-shadow: inset 0 0 12px rgba(147, 51, 234, 0.4);
  padding-top: 24px;
  padding-bottom: 24px;
}
.yomteruah .lunisolar-day { color: #ffffff !important; }
.yomteruah .gregorian-day, .yomteruah .moon-info span { color: #e9d5ff !important; }

.yomkippur {
  background: #543f05 !important;
  border: 2.5px solid #d97706 !important;
  box-shadow: inset 0 0 12px rgba(217, 119, 6, 0.4);
  padding-top: 24px;
}
.yomkippur .lunisolar-day { color: #ffffff !important; }
.yomkippur .gregorian-day, .yomkippur .moon-info span { color: #fef08a !important; }

.sukkot {
  background: #113d1a !important;
  border: 2.5px solid #16a34a !important;
  box-shadow: inset 0 0 12px rgba(22, 163, 74, 0.35);
  padding-top: 24px;
}
.sukkot .lunisolar-day { color: #ffffff !important; }
.sukkot .gregorian-day, .sukkot .moon-info span { color: #bbf7d0 !important; }

.shemini-atzeret,
.sheminiatzeret {
  background: #0d3466 !important;
  border: 2.5px solid #2563eb !important;
  box-shadow: inset 0 0 12px rgba(37, 99, 235, 0.4);
  padding-top: 24px;
}
.shemini-atzeret .lunisolar-day,
.sheminiatzeret .lunisolar-day { color: #ffffff !important; }
.shemini-atzeret .gregorian-day,
.sheminiatzeret .gregorian-day,
.shemini-atzeret .moon-info span,
.sheminiatzeret .moon-info span { color: #bfdbfe !important; }

/* ==========================================================
   FESTIVIDADES EN MODO CLARO (Celdas Completas Pintadas)
========================================================== */
:root[data-theme="light"] .pesaj {
  background: #c62828 !important;
  border: 2.5px solid #8e0000 !important;
}
:root[data-theme="light"] .pesaj-label {
  background: #8e0000 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .pesaj .lunisolar-day {
  color: #ffffff !important;
}
:root[data-theme="light"] .pesaj .gregorian-day,
:root[data-theme="light"] .pesaj .moon-info span {
  color: #ffebee !important;
}

:root[data-theme="light"] .hamatzo {
  background: #e65100 !important;
  border: 2.5px dashed #bf360c !important;
}
:root[data-theme="light"] .hamatzo-label {
  background: #bf360c !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .hamatzo .lunisolar-day {
  color: #ffffff !important;
}
:root[data-theme="light"] .hamatzo .gregorian-day,
:root[data-theme="light"] .hamatzo .moon-info span {
  color: #fff3e0 !important;
}

:root[data-theme="light"] .bikurim {
  border: 2.5px solid #2e7d32 !important;
}
:root[data-theme="light"] .bikurim-label {
  background: #1b5e20 !important;
  color: #ffffff !important;
}

:root[data-theme="light"] .yomteruah {
  background: #6a1b9a !important;
  border: 2.5px solid #4a148c !important;
}
:root[data-theme="light"] .yomteruah-label {
  background: #4a148c !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .yomteruah .lunisolar-day {
  color: #ffffff !important;
}
:root[data-theme="light"] .yomteruah .gregorian-day,
:root[data-theme="light"] .yomteruah .moon-info span {
  color: #f3e5f5 !important;
}

:root[data-theme="light"] .yomkippur {
  background: #cf9b17 !important; /* Dorado cálido y luminoso, más claro que marrón */
  border: 2.5px solid #8c6704 !important;
}
:root[data-theme="light"] .yomkippur-label {
  background: #7a5a02 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .yomkippur .lunisolar-day {
  color: #ffffff !important;
}
:root[data-theme="light"] .yomkippur .gregorian-day,
:root[data-theme="light"] .yomkippur .moon-info span {
  color: #fffde7 !important;
}

:root[data-theme="light"] .sukkot {
  background: #2e7d32 !important; /* Verde agradable y destacado */
  border: 2.5px solid #1b5e20 !important;
}
:root[data-theme="light"] .sukkot-label {
  background: #1b5e20 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .sukkot .lunisolar-day {
  color: #ffffff !important;
}
:root[data-theme="light"] .sukkot .gregorian-day,
:root[data-theme="light"] .sukkot .moon-info span {
  color: #e8f5e9 !important;
}

:root[data-theme="light"] .shemini-atzeret,
:root[data-theme="light"] .sheminiatzeret {
  background: #1565c0 !important; /* Azul destacado y nítido */
  border: 2.5px solid #0d47a1 !important;
}
:root[data-theme="light"] .shemini-label {
  background: #0d47a1 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .shemini-atzeret .lunisolar-day,
:root[data-theme="light"] .sheminiatzeret .lunisolar-day {
  color: #ffffff !important;
}
:root[data-theme="light"] .shemini-atzeret .gregorian-day,
:root[data-theme="light"] .sheminiatzeret .gregorian-day,
:root[data-theme="light"] .shemini-atzeret .moon-info span,
:root[data-theme="light"] .sheminiatzeret .moon-info span {
  color: #e3f2fd !important;
}

:root[data-theme="light"] .shavuot {
  background: #00838f !important;
  border: 2.5px solid #006064 !important;
}
:root[data-theme="light"] .shavuot-label {
  background: #006064 !important;
  color: #ffffff !important;
}
:root[data-theme="light"] .shavuot .lunisolar-day {
  color: #ffffff !important;
}
:root[data-theme="light"] .shavuot .gregorian-day,
:root[data-theme="light"] .shavuot .moon-info span {
  color: #e0f7fa !important;
}

/* Cuenta del Omer */
:root[data-theme="light"] .omer-row {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: #17496e;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  border-left: 3.5px solid #0d2f47;
}

:root[data-theme="dark"] .omer-row {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  background: #0e466e;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  border-left: 3.5px solid #00bfe6;
}

/* ----------------------------------------------------------
   ROSH HASHANÁ (EVENTO MAYOR)
---------------------------------------------------------- */
.roshhashana {
  background: linear-gradient(135deg, #660a14, #85121e);
  color: #fff;
  border: 2.5px solid #d49b00;
  box-shadow: 0 0 12px rgba(212, 155, 0, 0.6);
  padding-top: 28px;
}

.roshhashana-label {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  background: #85121e;
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #d49b00;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  white-space: nowrap;
}

.roshhashana .lunisolar-day {
  font-size: 1.35rem;
  font-weight: 700;
}

.roshhashana .gregorian-day {
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ----------------------------------------------------------
   BOTÓN CAMBIO DE TEMA (LUNA EN DÍA / SOL EN NOCHE)
---------------------------------------------------------- */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease, box-shadow 0.4s ease, transform 0.2s ease;
  z-index: 999;
}

/* MODO CLARO (DÍA): Botón Azul Marino que muestra la LUNA */
:root[data-theme="light"] .theme-toggle,
body:not(.dark) .theme-toggle {
  background: #001f3f !important;
  box-shadow: 0 4px 12px rgba(0, 31, 63, 0.4) !important;
}

:root[data-theme="light"] .theme-toggle:hover,
body:not(.dark) .theme-toggle:hover {
  background: #0a3159 !important;
  transform: scale(1.05);
}

:root[data-theme="light"] .theme-toggle .moon,
body:not(.dark) .theme-toggle .moon {
  opacity: 1 !important;
  transform: rotate(0deg) scale(1) !important;
}

:root[data-theme="light"] .theme-toggle .sun,
body:not(.dark) .theme-toggle .sun {
  opacity: 0 !important;
  transform: rotate(45deg) scale(0.5) !important;
}

/* MODO OSCURO (NOCHE): Botón Celeste Claro que muestra el SOL */
:root[data-theme="dark"] .theme-toggle,
body.dark .theme-toggle {
  background: #87CEEB !important;
  box-shadow: 0 4px 15px rgba(135, 206, 235, 0.6) !important;
}

:root[data-theme="dark"] .theme-toggle:hover,
body.dark .theme-toggle:hover {
  background: #a0e4ff !important;
  transform: scale(1.05);
}

:root[data-theme="dark"] .theme-toggle .moon,
body.dark .theme-toggle .moon {
  opacity: 0 !important;
  transform: rotate(-45deg) scale(0.5) !important;
}

:root[data-theme="dark"] .theme-toggle .sun,
body.dark .theme-toggle .sun {
  opacity: 1 !important;
  transform: rotate(0deg) scale(1) !important;
}

.theme-toggle .icon {
  width: 28px;
  height: 28px;
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ----------------------------------------------------------
   WRAPPER Y FLECHAS DE NAVEGACIÓN
---------------------------------------------------------- */
.calendar-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.nav-arrow {
  width: 55px;
  height: 55px;
  border: 1px solid var(--nav-arrow-border);
  background: var(--nav-arrow-bg);
  box-shadow: var(--nav-arrow-shadow);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.nav-arrow::before {
  content: "";
  width: 18px;
  height: 18px;
  border-right: 4px solid var(--nav-arrow-icon);
  border-top: 4px solid var(--nav-arrow-icon);
  transform: rotate(45deg);
  display: block;
}

.nav-arrow.left::before {
  transform: rotate(-135deg);
}

.nav-arrow.right::before {
  transform: rotate(45deg);
}

.nav-arrow:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: var(--nav-arrow-hover-shadow);
}

.nav-arrow.left {
  position: absolute;
  left: -70px;
}

.nav-arrow.right {
  position: absolute;
  right: -70px;
}

@media (max-width: 1550px) {
  .nav-arrow.left {
    left: -55px;
  }
  .nav-arrow.right {
    right: -55px;
  }
}

@media (max-width: 1400px) {
  .nav-arrow {
    width: 46px;
    height: 46px;
  }
  .nav-arrow.left {
    left: -48px;
  }
  .nav-arrow.right {
    right: -48px;
  }
}

/* ----------------------------------------------------------
   BARRA DE DESCARGA & ACCIONES
---------------------------------------------------------- */
.download-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid var(--download-btn-border);
  border-radius: 8px;
  background: var(--download-btn-bg);
  color: var(--download-btn-color);
  font-family: "Montserrat", "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
}

.download-btn:hover {
  background: var(--download-btn-hover-bg);
  border-color: var(--download-btn-hover-border);
  color: var(--download-btn-hover-color);
  transform: translateY(-1px);
}

.download-btn:active {
  transform: translateY(0);
}

.download-btn:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.download-btn svg {
  flex-shrink: 0;
  stroke: currentColor;
}

/* ----------------------------------------------------------
   INDICADORES DE CICLO DE TORÁ Y PARASHOT EN SHABAT
---------------------------------------------------------- */
.subtitle-dates {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.subtitle-cycle-info {
  margin-top: 5px;
}

.year-cycle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
}

.year-cycle-pill.leap {
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.2), rgba(184, 134, 11, 0.1));
  border: 1px solid rgba(212, 168, 83, 0.6);
  color: #f7d280;
}

.year-cycle-pill.regular {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.18), rgba(79, 70, 229, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #d8b4fe;
}

[data-theme="light"] .year-cycle-pill.leap {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #d97706;
  color: #92400e;
}

[data-theme="light"] .year-cycle-pill.regular {
  background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
  border-color: #a855f7;
  color: #6b21a8;
}

/* CELDA DE SHABAT */
.calendar-cell.shabat-cell:not(.roshjodesh):not(.roshhashana):not(.pesaj):not(.hamatzo):not(.bikurim):not(.shavuot):not(.yomteruah):not(.yomkippur):not(.sukkot):not(.shemini-atzeret):not(.sheminiatzeret) {
  border-color: rgba(79, 195, 255, 0.28) !important;
  background: radial-gradient(circle at top right, rgba(79, 195, 255, 0.05), var(--cell-bg)) !important;
}

[data-theme="light"] .calendar-cell.shabat-cell:not(.roshjodesh):not(.roshhashana):not(.pesaj):not(.hamatzo):not(.bikurim):not(.shavuot):not(.yomteruah):not(.yomkippur):not(.sukkot):not(.shemini-atzeret):not(.sheminiatzeret) {
  border-color: rgba(3, 105, 161, 0.25) !important;
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.06), #ffffff) !important;
}

/* BADGE DE PARASHÁ EN CADA SHABAT */
.shabat-parasha-badge {
  margin-top: auto;
  margin-bottom: 2px;
  background: linear-gradient(135deg, #132742 0%, #0d1b2e 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
  border-radius: 6px;
  padding: 4px 6px;
  font-family: "Montserrat", sans-serif;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  z-index: 3;
}

.shabat-parasha-badge:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
  color: #ffffff;
}

.parasha-badge-top {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.15;
}

.parasha-badge-ico {
  font-size: 0.72rem;
  flex-shrink: 0;
}

.parasha-badge-title {
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.parasha-badge-ref {
  font-size: 0.61rem;
  color: #93c5fd;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
  line-height: 1.1;
}

/* LECTURA DOBLE EN AÑOS REGULARES (12 MESES) */
.shabat-parasha-badge.double {
  background: linear-gradient(135deg, #2e1065 0%, #1e0942 100%);
  border-color: rgba(192, 132, 252, 0.5);
  color: #f5f3ff;
}

.shabat-parasha-badge.double:hover {
  border-color: #c084fc;
  box-shadow: 0 4px 12px rgba(192, 132, 252, 0.38);
}

.shabat-parasha-badge.double .parasha-badge-ref {
  color: #d8b4fe;
}

.parasha-double-pill {
  display: inline-block;
  align-self: flex-start;
  background: rgba(192, 132, 252, 0.25);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #e9d5ff;
  font-size: 0.54rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 1px;
}

/* LECTURA ESPECIAL DE FESTIVIDAD */
.shabat-parasha-badge.festival {
  background: linear-gradient(135deg, #451a03 0%, #291002 100%);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fef3c7;
}

.shabat-parasha-badge.festival:hover {
  border-color: #fbbf24;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}

.shabat-parasha-badge.festival .parasha-badge-ref {
  color: #fde68a;
}

/* TEMA CLARO PARA BADGES DE PARASHÁ */
[data-theme="light"] .shabat-parasha-badge {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-color: #7dd3fc;
  color: #0369a1;
}

[data-theme="light"] .shabat-parasha-badge .parasha-badge-ref {
  color: #0284c7;
}

[data-theme="light"] .shabat-parasha-badge.double {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: #c4b5fd;
  color: #6b21a8;
}

[data-theme="light"] .shabat-parasha-badge.double .parasha-badge-ref {
  color: #7c3aed;
}

[data-theme="light"] .shabat-parasha-badge.double .parasha-double-pill {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.35);
  color: #5b21b6;
}

[data-theme="light"] .shabat-parasha-badge.festival {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fcd34d;
  color: #92400e;
}

[data-theme="light"] .shabat-parasha-badge.festival .parasha-badge-ref {
  color: #b45309;
}

/* LEYENDA DEL CICLO DE PARASHOT AL PIE DEL CALENDARIO */
.calendar-torah-legend {
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-family: "Montserrat", sans-serif;
  color: var(--text-muted);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .calendar-torah-legend {
  background: #fdfbf7;
  border-color: #ebdccb;
  color: #555;
}

.legend-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.77rem;
  line-height: 1.4;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.chip-badge.regular {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.chip-badge.double {
  background: rgba(192, 132, 252, 0.18);
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #c084fc;
}

.chip-badge.festival {
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fbbf24;
}

[data-theme="light"] .chip-badge.regular {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

[data-theme="light"] .chip-badge.double {
  background: #f3e8ff;
  border-color: #c084fc;
  color: #6b21a8;
}

[data-theme="light"] .chip-badge.festival {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

/* ----------------------------------------------------------
   MODO STANDALONE PWA & BARRA OFFLINE / INSTALACIÓN
---------------------------------------------------------- */
#preloader {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.pwa-standalone #header,
body.pwa-standalone .page-title,
body.pwa-standalone #footer {
  display: none !important;
}

body.pwa-standalone .section {
  padding-top: 18px !important;
}

.download-bar {
  flex-wrap: wrap;
}

.install-pwa-btn {
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.22), rgba(184, 134, 11, 0.14)) !important;
  border-color: rgba(212, 168, 83, 0.65) !important;
  color: #f7d280 !important;
  box-shadow: 0 3px 10px rgba(212, 168, 83, 0.2);
}

.install-pwa-btn:hover {
  background: linear-gradient(135deg, rgba(212, 168, 83, 0.34), rgba(184, 134, 11, 0.24)) !important;
  border-color: #f7d280 !important;
  color: #ffffff !important;
  box-shadow: 0 5px 14px rgba(212, 168, 83, 0.35);
}

:root[data-theme="light"] .install-pwa-btn {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  border-color: #d97706 !important;
  color: #78350f !important;
}

:root[data-theme="light"] .install-pwa-btn:hover {
  background: linear-gradient(135deg, #fde68a, #fcd34d) !important;
  border-color: #b45309 !important;
  color: #451a03 !important;
}

@keyframes pwaPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 168, 83, 0.55);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(212, 168, 83, 0);
  }
}

.pwa-ready-pulse {
  animation: pwaPulse 2.4s infinite;
}

.offline-status-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  font-family: "Montserrat", "Inter", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.offline-status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  flex-shrink: 0;
}

.offline-status-pill.mode-ready {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

.offline-status-pill.mode-ready .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.offline-status-pill.mode-offline {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.offline-status-pill.mode-offline .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.85);
}

.offline-status-pill.mode-sync {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}

.offline-status-pill.mode-sync .status-dot {
  background: #38bdf8;
}

:root[data-theme="light"] .offline-status-pill.mode-ready {
  background: #d1fae5;
  border-color: #34d399;
  color: #065f46;
}

:root[data-theme="light"] .offline-status-pill.mode-offline {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

/* ----------------------------------------------------------
   MODAL INTERACTIVO DE LECTURAS / FESTIVIDADES / INSTALACIÓN
---------------------------------------------------------- */
.calendar-cell {
  cursor: pointer;
}

.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.cal-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cal-modal-card {
  position: relative;
  width: 100%;
  max-width: 610px;
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(165deg, #171b24 0%, #10131a 100%);
  border: 1px solid rgba(212, 168, 83, 0.45);
  border-radius: 16px;
  padding: 24px 24px 22px;
  color: #f3f4f6;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.75);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
  font-family: "Inter", "Montserrat", sans-serif;
}

.cal-modal-overlay.open .cal-modal-card {
  transform: translateY(0) scale(1);
}

:root[data-theme="light"] .cal-modal-card {
  background: linear-gradient(165deg, #ffffff 0%, #f8f5ef 100%);
  border-color: #d4a853;
  color: #1f2937;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.cal-modal-close {
  position: sticky;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.cal-modal-close:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: scale(1.06);
}

:root[data-theme="light"] .cal-modal-close {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.06);
}

.cal-modal-header {
  margin-bottom: 16px;
  padding-right: 38px;
}

.cal-modal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.cal-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.cal-pill.lunisolar {
  background: rgba(212, 168, 83, 0.18);
  border: 1px solid rgba(212, 168, 83, 0.5);
  color: #f7d280;
}

.cal-pill.shabat {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
}

.cal-pill.rosh {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

:root[data-theme="light"] .cal-pill.lunisolar {
  background: #fef3c7;
  border-color: #d97706;
  color: #92400e;
}

:root[data-theme="light"] .cal-pill.shabat {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #075985;
}

:root[data-theme="light"] .cal-pill.rosh {
  background: #d1fae5;
  border-color: #059669;
  color: #065f46;
}

.cal-modal-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.32rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  text-transform: capitalize;
}

.cal-modal-subtitle {
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 0;
}

.cal-detail-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
}

:root[data-theme="light"] .cal-detail-section {
  background: #ffffff;
  border-color: #e5e0d5;
}

.cal-detail-section.moon-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.cal-detail-label {
  font-size: 0.82rem;
  opacity: 0.85;
}

.cal-detail-value {
  font-weight: 700;
  font-size: 0.9rem;
}

.cal-detail-section.holiday-box {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.02));
}

.cal-detail-section.omer-box {
  border-left: 4px solid #00bfe6;
}

.cal-detail-section.parasha-box {
  border-left: 4px solid #38bdf8;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(255, 255, 255, 0.02));
}

:root[data-theme="light"] .cal-detail-section.holiday-box {
  background: #fffbeb;
}

:root[data-theme="light"] .cal-detail-section.parasha-box {
  background: #f0f9ff;
}

.cal-section-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #fbbf24;
  margin-bottom: 4px;
}

:root[data-theme="light"] .cal-section-badge {
  color: #b45309;
}

.cal-section-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 8px 0;
}

.cal-section-desc {
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 8px 0 0 0;
  opacity: 0.92;
}

.cal-scripture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.cal-scripture-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

:root[data-theme="light"] .cal-scripture-item {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.1);
}

.cal-scripture-label {
  font-size: 0.7rem;
  font-weight: 700;
  opacity: 0.75;
}

.cal-scripture-ref {
  font-size: 0.82rem;
  font-weight: 700;
  color: #93c5fd;
}

:root[data-theme="light"] .cal-scripture-ref {
  color: #0369a1;
}

.cal-online-link-wrap {
  margin-top: 12px;
}

.cal-online-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
}

.cal-online-link:hover {
  text-decoration: underline;
}

.cal-offline-note {
  font-size: 0.78rem;
  color: #fcd34d;
}

.cal-install-steps {
  margin: 8px 0 0 18px;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.cal-primary-install-btn,
.cal-portable-download-btn {
  margin-top: 12px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cal-primary-install-btn {
  background: linear-gradient(135deg, #d4a853, #b8860b);
  border: none;
  color: #0f1319;
  box-shadow: 0 4px 14px rgba(212, 168, 83, 0.4);
}

.cal-primary-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212, 168, 83, 0.55);
}

.cal-portable-download-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
}

.cal-portable-download-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

:root[data-theme="light"] .cal-portable-download-btn {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

@media (max-width: 768px) {
  .offline-status-pill {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
  .cal-modal-card {
    padding: 18px 16px;
  }
}

/* ----------------------------------------------------------
   MODAL: ESTADO ACTIVO Y CLASES DE CONTENIDO
---------------------------------------------------------- */
.cal-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cal-modal-overlay.active .cal-modal-card {
  transform: translateY(0) scale(1);
}

.cal-modal-badges,
.cal-detail-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.cal-modal-main-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: inherit;
}

.cal-modal-gregorian {
  font-size: 0.86rem;
  opacity: 0.82;
  margin: 0;
}

.cal-detail-heading {
  font-family: "Montserrat", sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  margin: 2px 0 6px 0;
  color: inherit;
}

.cal-detail-text {
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 6px 0 0 0;
  opacity: 0.94;
}

.cal-festival-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}

.cal-hebrew-tag {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f7d280;
  direction: rtl;
}

.cal-pill.gold {
  background: rgba(212, 168, 83, 0.18);
  border: 1px solid rgba(212, 168, 83, 0.55);
  color: #f7d280;
}

.cal-pill.cyan {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #7dd3fc;
}

.cal-pill.amber {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}

.cal-pill.today {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
}

.cal-pill-num {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.8;
}

:root[data-theme="light"] .cal-pill.gold { background: #fef3c7; border-color: #d97706; color: #92400e; }
:root[data-theme="light"] .cal-pill.cyan { background: #e0f2fe; border-color: #0284c7; color: #075985; }
:root[data-theme="light"] .cal-pill.amber { background: #fff7ed; border-color: #ea580c; color: #9a3412; }
:root[data-theme="light"] .cal-pill.today { background: #d1fae5; border-color: #059669; color: #065f46; }
:root[data-theme="light"] .cal-hebrew-tag,
:root[data-theme="light"] .cal-festival-sub { color: #b45309; }

.cal-moon-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cal-moon-big-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.cal-moon-phase-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.cal-moon-phase-sub {
  font-size: 0.8rem;
  opacity: 0.85;
}

.cal-modal-actions-row {
  margin-top: 12px;
}

.cal-action-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
}

.cal-action-link:hover {
  text-decoration: underline;
}

.cal-install-ready-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cal-ready-check {
  font-size: 1.3rem;
}

.cal-detail-section.install-status-box {
  border-left: 4px solid #10b981;
}

.cal-detail-section.portable-box {
  border-left: 4px solid #f59e0b;
}

.cal-install-steps {
  margin: 8px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-step-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.86rem;
  line-height: 1.5;
}

.cal-step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4a853, #b8860b);
  color: #0f1319;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-inline-ico {
  white-space: nowrap;
}

/* ----------------------------------------------------------
   BOTÓN FLOTANTE "INSTALAR EN ESTE DISPOSITIVO"
---------------------------------------------------------- */
.pwa-fab-install {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9998;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(212, 168, 83, 0.75);
  background: linear-gradient(135deg, #1f1a10 0%, #2b2210 100%);
  color: #fdf3d7;
  font-family: "Montserrat", "Inter", sans-serif;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(212, 168, 83, 0.5);
  animation: pwaPulse 2.6s infinite;
}

.pwa-fab-install.visible {
  display: inline-flex;
}

.pwa-fab-install:hover {
  transform: translateY(-2px);
  border-color: #f7d280;
}

.pwa-fab-ico {
  font-size: 1.5rem;
}

.pwa-fab-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.pwa-fab-text strong {
  font-size: 0.86rem;
  color: #f7d280;
}

.pwa-fab-text small {
  font-size: 0.7rem;
  opacity: 0.85;
}

.pwa-fab-close {
  margin-left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.08);
}

.pwa-fab-close:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.35);
}

:root[data-theme="light"] .pwa-fab-install {
  background: linear-gradient(135deg, #fffbeb, #fde68a);
  color: #451a03;
  border-color: #d97706;
}

:root[data-theme="light"] .pwa-fab-text strong {
  color: #78350f;
}

@media (max-width: 576px) {
  .pwa-fab-install {
    left: 12px;
    right: 12px;
    bottom: 12px;
    justify-content: center;
  }
}

/* ----------------------------------------------------------
   LOGO E ICONO OFICIAL DEL CALENDARIO (cal-icon)
---------------------------------------------------------- */
.calendar-brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(212, 168, 83, 0.75);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.pwa-fab-logo {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  object-fit: cover;
  border: 1.5px solid rgba(212, 168, 83, 0.85);
  flex-shrink: 0;
}

.cal-install-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cal-modal-brand-logo {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(212, 168, 83, 0.85);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   IMPRESIÓN HORIZONTAL: 1 MES COMPLETO EN 1 SOLA HOJA
---------------------------------------------------------- */
.print-year-container {
  display: none;
}

@page {
  size: landscape;
  margin: 5mm 7mm;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html,
  body,
  .calendar-page,
  .calendar-page .main,
  .calendar-page .section {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #111827 !important;
  }

  /* Ocultar barras, botones y elementos interactivos ajenos al mes impreso */
  #header,
  .page-title,
  #footer,
  #scroll-top,
  #preloader,
  .download-bar,
  .theme-toggle,
  .nav-arrow,
  .month-slider,
  .pwa-fab-install,
  .cal-modal-overlay {
    display: none !important;
  }

  /* Si se está imprimiendo el año completo (1 mes por hoja), ocultar la vista individual */
  body.printing-full-year > .calendar-container,
  body.printing-full-year main > .section > .calendar-container {
    display: none !important;
  }

  body.printing-full-year .print-year-container {
    display: block !important;
    width: 100% !important;
  }

  .calendar-container,
  .print-month-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-month-page {
    page-break-after: always !important;
    break-after: page !important;
  }

  .print-month-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  /* Cabecera compacta en una sola línea para aprovechar toda la altura de la hoja */
  .calendar-header {
    margin-bottom: 4px !important;
    padding-bottom: 2px !important;
    border-bottom: 1.5px solid #cbd5e1 !important;
  }

  .calendar-header-content {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .calendar-title-wrapper {
    gap: 8px !important;
  }

  .calendar-brand-logo {
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
  }

  .calendar-header h1 {
    font-size: 1.2rem !important;
    color: #111827 !important;
    text-shadow: none !important;
  }

  .year-select,
  .month-select {
    font-size: 0.92rem !important;
    padding: 2px 8px !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 1px solid #94a3b8 !important;
    color: #111827 !important;
    background-color: #f8fafc !important;
  }

  .calendar-header h2,
  .subtitle-dates {
    font-size: 0.76rem !important;
    color: #334155 !important;
    margin: 0 !important;
  }

  .subtitle-cycle-info {
    display: inline-block !important;
    margin-top: 0 !important;
    margin-left: 6px !important;
  }

  .year-cycle-pill {
    font-size: 0.64rem !important;
    padding: 1px 8px !important;
    box-shadow: none !important;
  }

  /* Fila de días de la semana compacta */
  .weekdays-row {
    margin-bottom: 4px !important;
    padding: 2px 4px !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    background: #1e293b !important;
    border: 1px solid #1e293b !important;
  }

  .weekdays-row > div {
    padding: 3px 0 !important;
    font-size: 0.76rem !important;
    color: #ffffff !important;
  }

  .weekdays-row > div:last-child {
    color: #7dd3fc !important;
  }

  /* Grilla ajustada para que 5 o 6 filas entren SIEMPRE en 1 sola hoja horizontal */
  .calendar-wrapper {
    width: 100% !important;
    display: block !important;
  }

  .calendar-grid {
    gap: 4px !important;
    width: 100% !important;
    grid-auto-rows: 72px !important;
  }

  .calendar-grid.rows-6 {
    grid-auto-rows: 60px !important;
  }

  .calendar-cell {
    min-height: 0 !important;
    height: 100% !important;
    padding: 3px 5px !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .calendar-cell:not(.roshjodesh):not(.roshhashana):not(.pesaj):not(.hamatzo):not(.bikurim):not(.shavuot):not(.yomteruah):not(.yomkippur):not(.sukkot):not(.shemini-atzeret):not(.sheminiatzeret) {
    background: #f8fafc !important;
    border: 1px solid #94a3b8 !important;
    color: #0f172a !important;
  }

  .calendar-cell.empty {
    background: transparent !important;
    border: none !important;
  }

  .lunisolar-day {
    font-size: 0.92rem !important;
    line-height: 1.05 !important;
    color: #0f172a !important;
  }

  .gregorian-day {
    font-size: 0.68rem !important;
    line-height: 1.05 !important;
    color: #475569 !important;
  }

  .roshjodesh,
  .roshhashana,
  .pesaj,
  .hamatzo,
  .bikurim,
  .shavuot,
  .yomteruah,
  .yomkippur,
  .sukkot,
  .shemini-atzeret,
  .sheminiatzeret {
    padding-top: 14px !important;
    padding-bottom: 2px !important;
  }

  .rosh-label,
  .roshhashana-label,
  .holiday-label,
  .today-badge {
    top: 1px !important;
    font-size: 0.5rem !important;
    padding: 1px 4px !important;
    line-height: 1.05 !important;
    box-shadow: none !important;
  }

  .yomteruah-label {
    top: auto !important;
    bottom: 1px !important;
  }

  .omer-row {
    margin-top: 1px !important;
    padding: 0 3px !important;
    font-size: 0.54rem !important;
    line-height: 1.1 !important;
  }

  .moon-info {
    padding-top: 1px !important;
    margin-top: auto !important;
  }

  .moon-icon {
    font-size: 0.78rem !important;
    filter: none !important;
  }

  .moon-info span,
  .moon-info .moon-text {
    font-size: 0.6rem !important;
    color: #334155 !important;
  }

  .shabat-parasha-badge {
    padding: 1px 4px !important;
    margin-top: 1px !important;
    margin-bottom: 0 !important;
    gap: 0 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
  }

  .parasha-badge-ico {
    font-size: 0.55rem !important;
  }

  .parasha-badge-title {
    font-size: 0.56rem !important;
  }

  .parasha-badge-ref {
    font-size: 0.46rem !important;
  }

  .parasha-double-pill {
    display: none !important;
  }

  /* Leyenda de aclaraciones del Ciclo Anual de Parashot debajo de la grilla en el imprimible */
  .calendar-torah-legend {
    display: block !important;
    margin-top: 5px !important;
    margin-bottom: 0 !important;
    padding: 5px 10px !important;
    background: #f8fafc !important;
    border: 1px solid #94a3b8 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .legend-header {
    font-size: 0.66rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin-bottom: 3px !important;
    gap: 4px !important;
  }

  .legend-items {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    font-size: 0.59rem !important;
    line-height: 1.22 !important;
    color: #1e293b !important;
  }

  .legend-chip {
    display: flex !important;
    align-items: baseline !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }

  .chip-badge {
    font-size: 0.55rem !important;
    padding: 1px 6px !important;
    border-radius: 3px !important;
    flex-shrink: 0 !important;
  }

  .chip-badge.regular {
    background: #e0f2fe !important;
    border: 1px solid #38bdf8 !important;
    color: #0369a1 !important;
  }

  .chip-badge.double {
    background: #f3e8ff !important;
    border: 1px solid #a855f7 !important;
    color: #6b21a8 !important;
  }

  .chip-badge.festival {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b !important;
    color: #92400e !important;
  }
}


