@font-face {
  font-family: "GeorgiaApp";
  src: url("img/Georgia.ttf") format("truetype");
}
@font-face {
  font-family: "DavidHeb";
  src: url("img/David_New_Hebrew.ttf") format("truetype");
}

:root {
  --bg: #f7f3e8;
  --bg-dot: #e4dcc8;
  --side: #801b1b;
  --side-border: #5a1212;
  --ink: #3a3228;
  --ink-soft: #6a5e50;
  --gold: #c4a35a;
  --gold-dark: #9a7b3c;
  --tab-on: #5a5348;
  --tab-off: #f8f5ee;
  --line: #d2c8b0;
  --fab: #3b6ea5;
  /* Rojo Torah Viviente — títulos, subtítulos, símbolos, menoroth */
  --tv-red: #801b1b;
  --tv-red-soft: #f6e8e8;
  --read-size: 1.02rem;
  --read-size-list: 1.02rem;
  --read-size-detail: 1.02rem;
  --read-size-panel: 1.02rem;
  --read-size-video: 1.02rem;
  --read-size-search: 1.02rem;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #2a3034;
  font-family: "GeorgiaApp", Georgia, "Times New Roman", serif;
  color: var(--ink);
}

#phone {
  max-width: 430px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--bg-dot) 0.85px, transparent 1.05px);
  background-size: 9px 9px;
  position: relative;
  overflow: hidden;
}

/* Móvil: barra de estado y de navegación en rojo BTV */
@media (max-width: 499px) {
  html, body {
    background: #801b1b;
  }
  #phone {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background-clip: content-box;
    background-origin: content-box;
  }
  #phone::before,
  #phone::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 400;
    pointer-events: none;
    background: #801b1b;
  }
  #phone::before {
    top: 0;
    height: env(safe-area-inset-top, 0px);
  }
  #phone::after {
    bottom: 0;
    height: env(safe-area-inset-bottom, 0px);
  }
}

/* Splash / página de inicio — proporción 720×1280, sin estirar */
.home-splash {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  right: 0;
  bottom: env(safe-area-inset-bottom, 0px);
  left: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #01011b;
  padding: 0;
  box-sizing: border-box;
}
.home-splash[hidden] {
  display: none !important;
}
.home-splash-hit {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.home-splash-stage {
  position: absolute;
  inset: 0;
  background: #01011b url("img/splash_back.png?v=2") center / contain no-repeat;
}
.home-splash-back {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
}
#phone.mode-splash > :not(.home-splash) {
  visibility: hidden;
}
#view-list,
.tabs-row {
  --read-size: var(--read-size-list);
}
#view-detail {
  --read-size: var(--read-size-detail);
}
#overlayCard,
#overlayPanel {
  --read-size: var(--read-size-panel);
}
#videoPlayer {
  --read-size: var(--read-size-video);
}
#searchSheet,
#searchResults {
  --read-size: var(--read-size-search);
}

.header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem 0.25rem;
  flex-shrink: 0;
  position: relative;
  z-index: 6;
}
.logo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
  border: 1.5px solid var(--tv-red);
  background: #000;
  box-sizing: border-box;
  padding: 0;
}
.logo:active {
  transform: scale(0.94);
}
.date-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  position: relative;
  min-width: 0;
}
.date-board {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.15rem 0.25rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: inherit;
}
.date-board:focus-visible {
  outline: 1px solid var(--tv-red);
  outline-offset: 2px;
}
.date-text {
  display: block;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: #4a4338;
  line-height: 1.2;
}
.date-eterno-line {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tv-red);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.date-eterno-line.is-moed,
.date-eterno-line.is-shabbat {
  color: var(--tv-red);
}
.date-israel-time {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: #6a6256;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.eterno-backdrop {
  position: absolute;
  inset: 0;
  z-index: 240;
  background: rgba(30, 16, 16, 0.45);
}
.eterno-backdrop[hidden],
.eterno-panel[hidden] {
  display: none !important;
}
.eterno-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 1.5rem);
  max-width: 420px;
  max-height: min(82%, calc(100% - 4.5rem));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 250;
  padding: 0.85rem 0.95rem 1rem;
  border: 2px solid var(--tv-red);
  border-radius: 12px;
  background: #f7f3e8;
  box-shadow: 0 14px 36px rgba(40, 20, 20, 0.32);
  text-align: left;
  color: #2f2a24;
}
.eterno-panel-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}
.eterno-panel-title {
  margin: 0;
  flex: 1;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--tv-red);
  text-align: center;
}
.eterno-panel-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  padding-right: 0.15rem;
}
.eterno-panel-body p {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.eterno-k {
  color: var(--tv-red);
  font-weight: 700;
}
.eterno-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem !important;
}
.eterno-tags span {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--tv-red);
  border-radius: 3px;
  background: var(--tv-red-soft);
  color: var(--tv-red);
  font-size: 0.68rem;
  font-weight: 700;
}
.eterno-note {
  margin-top: 0.55rem !important;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(128, 27, 27, 0.2);
  font-size: 0.78rem !important;
  color: #6a6256;
  line-height: 1.4 !important;
}
}
.date-arrow {
  border: 0;
  background: transparent;
  padding: 0.2rem;
  cursor: pointer;
  color: var(--tv-red);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.date-arrow svg {
  width: 22px;
  height: 22px;
  display: block;
}
.date-arrow:active {
  opacity: 0.75;
}
/* Cabecera Sidurim / Tikun — espacio de la fecha */
.ministry-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 0.25rem;
}
.ministry-nav[hidden] {
  display: none !important;
}
.ministry-title {
  margin: 0;
  text-align: center;
  font-family: "Cormorant Garamond", "GeorgiaApp", Georgia, serif;
  font-style: italic;
  font-weight: 800;
  font-size: clamp(1.05rem, 4.8vw, 1.35rem);
  line-height: 1.22;
  letter-spacing: 0.01em;
  color: var(--tv-red);
  text-wrap: balance;
  max-width: 100%;
  -webkit-text-stroke: 0.15px var(--tv-red);
}

.gold-banner {
  min-height: 28px;
  margin: 0.25rem 0.45rem 0.35rem;
  padding: 0.28rem 0.4rem 0.28rem 0.5rem;
  border-radius: 3px;
  background: var(--tv-red);
  box-shadow: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  color: #fff;
  font-family: "GeorgiaApp", Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: none;
  line-height: 1.2;
  text-align: center;
  z-index: 5;
  flex-shrink: 0;
}
.gold-banner::after {
  content: none;
}
.gold-banner a {
  color: inherit;
  text-decoration: none;
  letter-spacing: inherit;
  font: inherit;
  flex: 1;
  min-width: 0;
  text-align: center;
}
.gold-banner a:hover,
.gold-banner a:focus-visible {
  text-decoration: underline;
  outline: none;
}

/* —— Google Translate (UI propia) —— */
.gtr-host,
#google_translate_element {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.goog-te-banner-frame,
.goog-te-balloon-frame,
body > .skiptranslate,
.goog-tooltip,
.goog-tooltip:hover,
#goog-gt-tt {
  display: none !important;
}
body {
  top: 0 !important;
}
.goog-text-highlight {
  background: none !important;
  box-shadow: none !important;
}
.gtr-wrap {
  position: relative;
  flex-shrink: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 600;
}
.gtr-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 132px;
  margin: 0;
  padding: 0.22rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.gtr-trigger:hover,
.gtr-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}
.gtr-trigger-flag {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  background: #fff;
}
.gtr-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 72px;
}
.gtr-chevron {
  flex-shrink: 0;
  opacity: 0.9;
}
.gtr-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(300px, calc(100vw - 1.4rem));
  max-height: min(420px, 62vh);
  display: flex;
  flex-direction: column;
  border: 2px solid var(--tv-red);
  border-radius: 8px;
  background: #f7f3e8;
  box-shadow: 0 10px 28px rgba(40, 20, 20, 0.28);
  overflow: hidden;
  z-index: 80;
  color: #2f2a24;
}
.gtr-panel[hidden] {
  display: none !important;
}
.gtr-search-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(128, 27, 27, 0.2);
  color: var(--tv-red);
  background: var(--tv-red-soft);
}
.gtr-search {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  color: #2f2a24;
  outline: none;
}
.gtr-search::placeholder {
  color: #8a7068;
}
.gtr-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0 0.45rem;
}
.gtr-section-label {
  margin: 0.35rem 0.65rem 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tv-red);
}
.gtr-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.42rem 0.7rem;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.88rem;
  color: #2f2a24;
  cursor: pointer;
}
.gtr-item:hover,
.gtr-item:focus-visible {
  background: var(--tv-red-soft);
  outline: none;
}
.gtr-item.is-active {
  background: rgba(128, 27, 27, 0.12);
  color: var(--tv-red);
  font-weight: 700;
}
.gtr-flag {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ddd;
}
.gtr-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gtr-code,
.gtr-hint {
  font-size: 0.68rem;
  color: #8a7068;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.gtr-hint {
  color: var(--tv-red);
}
.gtr-empty {
  margin: 1rem;
  text-align: center;
  color: #6a6256;
  font-size: 0.9rem;
}

.tabs-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem 0.45rem;
  flex-shrink: 0;
  position: relative;
  z-index: 4;
}
.seg-tabs {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border: 1px solid var(--tv-red);
  border-radius: 4px;
  overflow: hidden;
  background: var(--tv-red-soft);
}
.seg {
  border: 0;
  border-right: 1px solid rgba(128, 27, 27, 0.35);
  background: var(--tv-red-soft);
  color: var(--tv-red);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.42rem 0.2rem;
  cursor: pointer;
}
.seg:last-child { border-right: 0; }
.seg.active {
  background: var(--tv-red);
  color: #fff;
}

.view-tools {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}
.tool-chip {
  min-width: 36px;
  height: 36px;
  border: 1px solid #8a8274;
  background: #f3eee3;
  border-radius: 6px;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
  display: inline-grid;
  place-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tool-chip svg {
  display: block;
  pointer-events: none;
}
.tool-chip.light {
  border-color: rgba(255,255,255,0.35);
  background: #243035;
  color: #fff;
}
.tool-chip:active { transform: scale(0.96); }

#phone.is-fs {
  max-width: none;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  border-radius: 0;
}
body.is-fs {
  padding: 0;
  background: #801b1b;
  height: 100%;
}

.body-row {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.list-wrap {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  min-width: 0;
}
.psalm-list {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.5rem;
}
.psalm-list li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 0.2rem 0.45rem;
  padding: 0.55rem 0.45rem 0.55rem 0.25rem;
  border-bottom: 1px solid rgba(120, 110, 90, 0.28);
  cursor: pointer;
}
.psalm-list li:active { background: rgba(196, 163, 90, 0.12); }
.psalm-list li.selected {
  background: rgba(90, 83, 72, 0.12);
  outline: 1px solid rgba(90, 83, 72, 0.25);
}
.icon-cell {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.icon-cell img.harp {
  width: 42px;
  height: 42px;
  object-fit: contain;
  opacity: 0.9;
}
.icon-cell img.star,
.icon-cell img.menorah-mark {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  object-fit: contain;
}
/* Menorá SVG lineal transparente (estilo iconos stroke) */
.icon-cell .menorah-badge {
  position: absolute;
  display: grid;
  place-items: center;
  z-index: 2;
  pointer-events: none;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}
.icon-cell .menorah-badge--daily {
  top: -4px;
  right: -6px;
  width: 26px;
  height: 26px;
  color: var(--tv-red);
}
.icon-cell .menorah-badge--daily .menorah-svg {
  width: 24px;
  height: 24px;
  display: block;
}
.icon-cell .menorah-badge--mark {
  top: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  color: var(--tv-red);
  opacity: 0.92;
}
.icon-cell .menorah-badge--mark .menorah-svg {
  width: 18px;
  height: 18px;
  display: block;
}
.psalm-list li.is-daily {
  border-left: none;
  background: transparent;
}
.psalm-list li.is-daily .item-title {
  color: #2f2a24;
}
.item-main { min-width: 0; }
.item-titles-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.55rem;
}
.item-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: calc(var(--read-size, 1.02rem) * 1.02);
  font-weight: 700;
  color: #2f2a24;
  line-height: 1.2;
  text-align: left;
  direction: ltr;
}
.item-heb {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: "DavidHeb", "Times New Roman", serif;
  font-size: calc(var(--read-size, 1.02rem) * 0.95);
  color: #3a342c;
  direction: rtl;
  text-align: right;
  unicode-bidi: embed;
}
.item-preview {
  margin: 0.15rem 0 0;
  font-size: calc(var(--read-size, 1.02rem) * 0.8);
  color: var(--ink-soft);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
  direction: ltr;
}

.calendar-panel[hidden] { display: none !important; }

.shabbat-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "city city"
    "in out";
  align-items: stretch;
  gap: 0.35rem 0.45rem;
  padding: 0.4rem 0.55rem 0.7rem;
  background: rgba(247, 243, 232, 0.92);
  border-top: 1px solid var(--line);
  margin-top: auto;
  position: relative;
  z-index: 8;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.shabbat-city-btn {
  grid-area: city;
  margin: 0;
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(128, 27, 27, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--tv-red);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shabbat-city-btn:active {
  background: var(--tv-red-soft);
}
#shabbatIn { grid-area: in; }
#shabbatOut { grid-area: out; }
.city-picker {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: none;
}
.city-picker input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.6rem;
  border: 1px solid #c9beb0;
  border-radius: 6px;
  font: inherit;
}
.city-gps-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--tv-red);
  border-radius: 10px;
  background: var(--tv-red-soft);
  color: var(--tv-red);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.city-gps-btn.is-active {
  background: #801b1b;
  color: #fff;
  border-color: #5a1212;
}
.city-gps-ico {
  font-size: 1.25rem;
  line-height: 1;
}
.city-gps-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.city-gps-copy strong {
  font-size: 0.98rem;
  font-weight: 800;
}
.city-gps-copy em {
  font-style: normal;
  font-size: 0.78rem;
  opacity: 0.85;
  font-weight: 500;
}
.city-picker-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  border: 1px solid #e4d9c8;
  border-radius: 8px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.city-picker-list li button {
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f0e8da;
  background: transparent;
  padding: 0.55rem 0.7rem;
  font: inherit;
  cursor: pointer;
  color: #3a342c;
}
.city-picker-list li:last-child button {
  border-bottom: 0;
}
.city-picker-list li button:active,
.city-picker-list li button.is-active {
  background: var(--tv-red-soft);
  color: var(--tv-red);
  font-weight: 600;
}
.city-picker-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #6a6256;
}
.shabbat-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0.4rem 0.45rem;
  border: 2px solid transparent;
  border-radius: 10px;
  /* Interior plano + borde rojo con desvanecidos (como el círculo de inicio) */
  background:
    linear-gradient(#f7f3e8, #f7f3e8) padding-box,
    linear-gradient(
      145deg,
      #f0c0c0 0%,
      #b82e2e 26%,
      #801b1b 50%,
      #4a0e0e 76%,
      #c45a5a 100%
    ) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 230, 0.65),
    inset 0 -1px 0 rgba(60, 12, 12, 0.22);
  font: inherit;
  color: #4a4338;
  text-align: left;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.shabbat-item > img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.shabbat-text {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}
.shabbat-text strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #2f2a22;
  font-variant-numeric: tabular-nums;
}
.shabbat-text em {
  font-style: normal;
  font-size: 0.68rem;
  color: #6a6256;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shabbat-lupa {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: var(--tv-red);
  background: var(--tv-red-soft);
  flex-shrink: 0;
  opacity: 0.9;
}
.shabbat-zoom {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) scale(0.92);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 168px;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 2px solid transparent;
  background:
    linear-gradient(#f7f3e8, #f7f3e8) padding-box,
    linear-gradient(
      145deg,
      #f0c0c0 0%,
      #b82e2e 26%,
      #801b1b 50%,
      #4a0e0e 76%,
      #c45a5a 100%
    ) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 230, 0.7),
    inset 0 -1px 0 rgba(60, 12, 12, 0.2),
    0 8px 20px rgba(80, 20, 20, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 30;
}
.shabbat-zoom::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #f7f3e8;
  border-right: 2px solid #801b1b;
  border-bottom: 2px solid #801b1b;
  transform: translateX(-50%) rotate(45deg);
}
.shabbat-zoom img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.shabbat-zoom .zoom-time {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: #2a2418;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.shabbat-zoom .zoom-date {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.92rem;
  color: #5a5348;
  white-space: nowrap;
}
/* PC: lupa al pasar el puntero */
@media (hover: hover) and (pointer: fine) {
  .shabbat-item:hover,
  .shabbat-item:focus-visible {
    background:
      linear-gradient(var(--tv-red-soft), var(--tv-red-soft)) padding-box,
      linear-gradient(
        145deg,
        #f0c0c0 0%,
        #b82e2e 26%,
        #801b1b 50%,
        #4a0e0e 76%,
        #c45a5a 100%
      ) border-box;
    outline: none;
  }
  .shabbat-item:hover .shabbat-zoom,
  .shabbat-item:focus-visible .shabbat-zoom {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
  }
  .shabbat-item:hover .shabbat-lupa,
  .shabbat-item:focus-visible .shabbat-lupa {
    background: #f0d0d0;
    opacity: 1;
  }
}
/* Móvil / touch: lupa al tocar (.is-zoomed) */
.shabbat-item.is-zoomed {
  background:
    linear-gradient(var(--tv-red-soft), var(--tv-red-soft)) padding-box,
    linear-gradient(
      145deg,
      #f0c0c0 0%,
      #b82e2e 26%,
      #801b1b 50%,
      #4a0e0e 76%,
      #c45a5a 100%
    ) border-box;
  z-index: 31;
}
.shabbat-item.is-zoomed .shabbat-zoom {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}
.shabbat-item.is-zoomed .shabbat-lupa {
  background: #f0d0d0;
  opacity: 1;
}
/* Evitar que el zoom se corte en el borde derecho */
#shabbatOut .shabbat-zoom {
  left: auto;
  right: 0;
  transform: translateX(0) scale(0.92);
}
@media (hover: hover) and (pointer: fine) {
  #shabbatOut:hover .shabbat-zoom,
  #shabbatOut:focus-visible .shabbat-zoom {
    transform: translateX(0) scale(1);
  }
}
#shabbatOut.is-zoomed .shabbat-zoom {
  transform: translateX(0) scale(1);
}
#shabbatOut .shabbat-zoom::after {
  left: auto;
  right: 28px;
  transform: rotate(45deg);
}

.detail-view {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: radial-gradient(circle, var(--bg-dot) 0.9px, transparent 1.1px);
  background-size: 10px 10px;
}
.detail-view[hidden] { display: none !important; }
/* En detalle: cabecera de lista fuera; la barra roja queda encima del detalle sin taparlo */
#phone.mode-detail .header {
  display: none;
}
#phone.mode-detail .gold-banner {
  flex-shrink: 0;
  z-index: 2;
  margin: 0.2rem 0.4rem 0.25rem;
}
#phone.mode-detail .tabs-row {
  display: none !important;
}
#phone.mode-detail .shabbat-bar {
  display: none;
}
#phone.mode-detail .body-row {
  display: none !important;
}
.detail-toolbar {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 232, 0.95);
  flex-shrink: 0;
}
.back-circle,
.psalm-audio-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--tv-red);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: visible;
}
.tool-btn.back-circle {
  border: 1.5px solid var(--tv-red);
  background: #000;
  padding: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}
.back-circle .back-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  background: #000;
}
.back-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--tv-red);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1.5px #f7f3e8;
  pointer-events: none;
}
.back-badge svg {
  display: block;
  width: 10px;
  height: 10px;
}
.psalm-audio-btn {
  background: transparent;
  color: var(--tv-red);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.psalm-audio-btn[hidden] {
  display: none !important;
}
.psalm-audio-btn svg {
  display: block;
  pointer-events: none;
  grid-area: 1 / 1;
}
.psalm-audio-btn .ico-play {
  margin-left: 1px;
}
.psalm-audio-btn .ico-pause {
  display: none;
}
.psalm-audio-btn.is-playing .ico-play {
  display: none;
}
.psalm-audio-btn.is-playing .ico-pause {
  display: block;
}
.psalm-audio-btn:active,
.back-circle:active {
  transform: scale(0.94);
}
.psalm-audio-btn.is-playing {
  background: var(--tv-red);
  color: #f8f5ee;
}
.psalm-audio-btn.is-loading {
  opacity: 0.55;
  pointer-events: none;
}
.swipe-hint {
  display: none;
  margin: 0;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5a5348;
  text-align: center;
  line-height: 1.2;
}
.pager-nav-icon {
  display: none;
}
.pager-nav-label {
  display: inline;
}
.detail-titles {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.detail-toolbar h1 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  text-align: left;
  direction: ltr;
}
.detail-title-heb {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: "DavidHeb", "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 600;
  color: #3a342c;
  text-align: right;
  direction: rtl;
  unicode-bidi: embed;
}
.detail-title-heb[hidden] { display: none !important; }
.lang-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.25rem;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 232, 0.95);
  flex-shrink: 0;
}
.lang-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: 1px solid #8a8274;
  background: #f3eee3;
  color: #3f3a32;
  border-radius: 6px;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.72;
}
.lang-tab img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.lang-tab.active {
  opacity: 1;
  background: var(--tv-red);
  color: #fff;
  border-color: var(--tv-red);
}
.tool-btn {
  border: 0;
  background: transparent;
  padding: 0.15rem;
  cursor: pointer;
}
.tool-btn:not(.back-circle) img { width: 28px; height: 28px; }
.detail-read-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.7rem 1.25rem 1rem 0.45rem;
  font-size: var(--read-size, 1.02rem);
  line-height: 1.55;
  text-align: left;
  color: var(--ink);
}
.festive-tehilim {
  margin: 0.55rem 0 0.9rem;
}
.festive-tehilim-sec {
  margin: 0.7rem 0 0.35rem;
  color: var(--tv-red);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.festive-tehilim-row {
  margin: 0 0 0.42rem;
  line-height: 1.5;
}
.festive-tehilim-row b {
  color: var(--ink);
}
a.psalm-jump {
  color: var(--tv-red);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(128, 27, 27, 0.35);
  white-space: nowrap;
}
a.psalm-jump:active {
  background: rgba(128, 27, 27, 0.08);
}
.detail-body.align-es,
.detail-body.align-tr,
.panel-body.align-es {
  text-align: left;
  direction: ltr;
}
.detail-body.align-es *,
.detail-body.align-tr *,
.panel-body.align-es * {
  text-align: left !important;
}
#phone.read-justify .detail-body.align-es,
#phone.read-justify .detail-body.align-tr,
#phone.read-justify .panel-body.align-es,
#phone.read-justify .detail-body.align-es p,
#phone.read-justify .detail-body.align-tr p,
#phone.read-justify .detail-body.align-es .verse,
#phone.read-justify .detail-body.align-es .verse-es,
#phone.read-justify .detail-body.align-es .verses-es {
  text-align: justify !important;
}
#phone.read-justify .detail-body.align-es *:not(h1):not(h2):not(h3):not(h4):not(.verse-num):not(.heb-inline),
#phone.read-justify .detail-body.align-tr *:not(h1):not(h2):not(h3):not(h4),
#phone.read-justify .panel-body.align-es *:not(h1):not(h2):not(h3):not(h4) {
  text-align: justify !important;
}
.verse.search-verse-hit {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
  background: rgba(196, 163, 90, 0.18);
}
/* Hebreo inline en español: aislar bidi y dejar hueco (Translate a veces come espacios) */
.heb-inline {
  unicode-bidi: isolate;
  direction: rtl;
  font-family: "DavidHeb", "Times New Roman", "Noto Sans Hebrew", serif;
  margin-inline: 0.18em;
  white-space: nowrap;
}
/* Títulos y subtítulos resaltados */
.detail-body h1,
.detail-body h2,
.detail-body h3,
.detail-body h4,
.panel-body h3 {
  color: var(--tv-red) !important;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.3;
  background: none !important;
}
.detail-body h1 {
  font-size: 1.25em;
  margin: 0.4rem 0 0.55rem;
  text-align: center !important;
}
.detail-body h2 {
  font-size: 1.12em;
  margin: 0.85rem 0 0.4rem;
}
.detail-body h3 {
  font-size: 1.05em;
  margin: 0.9rem 0 0.4rem;
  border-bottom: 1px solid rgba(128, 27, 27, 0.25);
  padding-bottom: 0.2rem;
}
.detail-body h4 {
  font-size: 0.98em;
  margin: 0.75rem 0 0.35rem;
  font-style: italic;
  color: var(--tv-red) !important;
}
.detail-body .text-hl,
.detail-body strong.text-hl,
.midrash-body .text-hl,
.midrash-body strong.text-hl {
  color: var(--tv-red) !important;
  font-weight: 800;
  background: none !important;
  padding: 0;
  border-radius: 0;
}
.detail-body .text-subhl,
.detail-body em.text-subhl,
.midrash-body .text-subhl {
  color: var(--tv-red) !important;
  font-style: italic;
  font-weight: 700;
  background: none !important;
}
.detail-body .psalm-kicker {
  display: block;
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
  background: none !important;
  box-shadow: none;
  color: var(--tv-red) !important;
  font-weight: 700;
  font-style: italic;
  line-height: 1.4;
  text-align: left !important;
}
/* Prefacio antes del v.1 = título/subtítulo: rojo, sin fondo */
.detail-body .psalm-preface {
  display: block;
  margin: 0 0 0.85rem;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none !important;
  box-shadow: none;
  color: var(--tv-red);
  font-weight: 700;
  font-style: italic;
  line-height: 1.45;
}
.detail-body .psalm-preface.preface-es {
  text-align: left !important;
  direction: ltr !important;
}
.detail-body .psalm-preface.preface-he {
  text-align: right !important;
  direction: rtl !important;
  border: none;
}
.detail-body .psalm-preface,
.detail-body .psalm-preface p,
.detail-body .psalm-preface li,
.detail-body .psalm-preface b,
.detail-body .psalm-preface strong,
.detail-body .psalm-preface em,
.detail-body .psalm-preface span:not(.verse-num) {
  color: var(--tv-red) !important;
  background: none !important;
  font-weight: 700;
}
.detail-body .psalm-preface h1,
.detail-body .psalm-preface h2,
.detail-body .psalm-preface h3,
.detail-body .psalm-preface h4 {
  color: var(--tv-red) !important;
  font-weight: 800;
  font-style: normal;
  margin: 0.25rem 0 0.45rem;
  background: none !important;
}
.detail-body .psalm-preface a {
  color: var(--tv-red) !important;
  text-decoration: underline;
  font-weight: 700;
  background: none !important;
}
.detail-body .psalm-preface .text-hl,
.detail-body .psalm-preface .text-subhl,
.detail-body .psalm-preface p > b:only-child,
.detail-body .psalm-preface p > strong:only-child {
  background: none !important;
  color: var(--tv-red) !important;
  font-weight: 800;
}
.detail-body .psalm-preface .heb-inline {
  color: var(--tv-red) !important;
  font-style: normal;
}
/* Negrita de párrafo = tinta; rojo solo si es título corto solo en el <p> */
.detail-body b,
.detail-body strong {
  color: inherit;
  font-weight: 800;
}
.detail-body p > b:only-child,
.detail-body p > strong:only-child,
.detail-body h1 b,
.detail-body h2 b,
.detail-body h3 b,
.detail-body h4 b,
.detail-body h1 strong,
.detail-body h2 strong,
.detail-body h3 strong,
.detail-body h4 strong {
  color: var(--tv-red) !important;
}
.detail-body.heb,
.detail-body.align-he {
  direction: rtl;
  font-family: "DavidHeb", "Times New Roman", "Noto Sans Hebrew", serif;
  font-size: calc(var(--read-size, 1.02rem) * 1.45);
  line-height: 1.9;
  text-align: right;
  unicode-bidi: embed;
  letter-spacing: 0.01em;
  color: #1f1a14;
}
.detail-body.heb *,
.detail-body.align-he * {
  text-align: right !important;
  direction: rtl;
  font-family: inherit;
}
.detail-body.heb p,
.detail-body.align-he p {
  margin: 0 0 0.85rem;
}
/* Números de versículo (árabes y letras hebreas) siempre en rojo */
.detail-body .verse-num,
.detail-body .verse-number,
.detail-body .he-verse-num,
.detail-body font[color="#ff0000"],
.detail-body font[color="ff0000"],
.detail-body font[color="#af3a2b"],
.detail-body font[color="af3a2b"],
.detail-body font[color="#AF3A2B"],
.detail-body.heb .verse-num,
.detail-body.align-he .verse-num {
  color: var(--tv-red) !important;
  font-weight: 700;
  font-size: 1.05em;
  margin-inline: 0.12em;
  white-space: nowrap;
}
.detail-body .verse-num .btv-verse-link,
.midrash-body a.btv-verse-link,
.estudio-btv a.btv-verse-link,
.btv-ref-wrap a.btv-verse-link,
a.btv-verse-link {
  color: inherit !important;
  font: inherit;
  font-weight: inherit;
  background: none !important;
  border: 0 !important;
  border-radius: 0;
  padding: 0;
  margin: 0;
  text-decoration: none !important;
  box-shadow: none !important;
  cursor: pointer;
  display: inline;
}
.detail-body .verse-num .btv-verse-link {
  color: var(--tv-red) !important;
  font-weight: 700;
}
/* Cada versículo en su propio bloque */
.verses {
  display: block;
  width: 100%;
}
.verse {
  display: block;
  width: 100%;
  margin: 0 0 0.85rem;
  line-height: inherit;
}
.verse-es,
.verses-es .verse,
.detail-body.align-es .verse {
  text-align: left !important;
  direction: ltr !important;
}
#phone.read-justify .verse-es,
#phone.read-justify .verses-es .verse,
#phone.read-justify .detail-body.align-es .verse,
#phone.read-justify .detail-body.align-es .verses-es,
#phone.read-justify .detail-body.align-es .verse-es {
  text-align: justify !important;
}
.verse-he,
.verses-he .verse,
.detail-body.align-he .verse,
.detail-body.heb .verse {
  text-align: right !important;
  direction: rtl !important;
}
.detail-body.align-es .verses-es,
.detail-body.align-es .verse-es {
  text-align: left !important;
  direction: ltr !important;
}
.detail-body.align-he .verses-he,
.detail-body.heb .verses-he {
  text-align: right !important;
  direction: rtl !important;
}
.estudio-btv {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid rgba(154, 117, 40, 0.45);
  text-align: left !important;
  direction: ltr !important;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.estudio-btv h3 {
  margin: 1.1rem 0 0.55rem;
  font-size: 1.08em;
  color: var(--tv-red);
  letter-spacing: 0.02em;
}
.estudio-btv h4 {
  margin: 0.95rem 0 0.4rem;
  font-size: 0.98em;
  color: #5a4530;
}
.estudio-btv p {
  margin: 0 0 0.75rem;
  line-height: 1.55;
}
.estudio-btv ul {
  margin: 0.35rem 0 0.85rem 1.1rem;
  padding: 0;
}
.estudio-btv li {
  margin: 0 0 0.35rem;
  line-height: 1.45;
}
.midrash-note {
  border: 1px solid rgba(154, 117, 40, 0.4);
  border-radius: 8px;
  background: rgba(247, 243, 232, 0.92);
  overflow: visible;
}
.midrash-note[open] {
  background: rgba(255, 252, 245, 0.98);
  box-shadow: 0 2px 8px rgba(40, 30, 10, 0.08);
}
.midrash-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label icon"
    "title icon";
  align-items: center;
  gap: 0.15rem 0.65rem;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.midrash-summary::-webkit-details-marker {
  display: none;
}
.midrash-summary::marker {
  content: "";
}
.midrash-label {
  grid-area: label;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--tv-red);
}
.midrash-title {
  grid-area: title;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tv-red);
  line-height: 1.25;
  padding-right: 0.25rem;
}
.midrash-icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(128, 27, 27, 0.45);
  background: var(--tv-red-soft);
  color: var(--tv-red);
}
.midrash-note[open] .midrash-icon-open {
  display: none;
}
.midrash-glyph {
  display: block;
  pointer-events: none;
}
.midrash-body {
  position: relative;
  color: var(--ink);
  padding: 0.7rem 0.4rem 0.9rem 0.55rem;
  border-top: 1px solid rgba(154, 117, 40, 0.28);
}
/* Cerrar sticky: acompaña el scroll, pegado más a la derecha */
.midrash-close {
  position: sticky;
  top: 0.45rem;
  float: right;
  z-index: 12;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0 -0.15rem 0.45rem 0.65rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #5a5348;
  background: #5a5348;
  color: #f8f5ee;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  /* Saca el botón hacia el borde derecho del lector */
  margin-right: -1.55rem;
}
.midrash-close:active {
  transform: scale(0.96);
}
.midrash-note:not([open]) .midrash-close {
  display: none;
}
.btv-estudio-cta {
  margin: 0.85rem 0 0.35rem;
  padding: 1.05rem 0.95rem 1.15rem;
  border-radius: 10px;
  border: 1px solid #c9a04a;
  background: #f7f0dc;
  box-shadow: none;
  text-align: center;
  direction: ltr !important;
}
.btv-cta-lead {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #4a3a22;
}
.btv-cta-brand {
  margin: 0 0 0.35rem;
  font-family: "GeorgiaApp", Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: #2f2412;
}
.btv-cta-gratis {
  margin: 0.15rem 0 0.55rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--tv-red);
}
.btv-cta-extra,
.btv-cta-ministry {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #3f3424;
}
.btv-cta-ministry {
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--tv-red);
  font-size: clamp(1rem, 4.2vw, 1.15rem);
}
.btv-cta-btn {
  display: inline-block;
  margin: 0.15rem 0 0.55rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  border: 1px solid #7a5a1e;
  background: #c9a04a;
  color: #2a1f0c !important;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none !important;
  box-shadow: none;
}
.btv-cta-btn:active {
  transform: translateY(1px);
}
.btv-cta-link {
  display: block;
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: #6a4e18 !important;
  word-break: break-all;
}
.btv-cta-flag {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2f2a22;
}
.btv-flag {
  width: 28px;
  height: 20px;
  object-fit: contain;
  border: 1px solid rgba(0, 40, 120, 0.25);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  flex-shrink: 0;
}
.detail-body .button-container,
.detail-body .fullscreen-button,
.detail-body #fullscreenButton {
  display: none !important;
}
.psalm-play-btn {
  display: inline-grid !important;
  place-items: center;
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border: 1px solid #8a8274 !important;
  border-radius: 6px !important;
  background: #f3eee3 !important;
  color: var(--ink) !important;
  box-shadow: none;
  box-sizing: border-box;
}
.psalm-play-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  pointer-events: none;
}
.psalm-play-btn:active {
  transform: scale(0.96);
  background: #f3eee3 !important;
}
.psalm-play-btn[hidden] {
  display: none !important;
}
.psalm-play-btn.is-playing {
  border-color: #8a8274 !important;
  background: #f3eee3 !important;
  color: var(--ink) !important;
}
.detail-pager-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 1.2rem;
}
/* Marcador favorito — mismo drawable APK (bookmark_big_icon) + altura 30/60 dp */
.fav-toggle {
  --fav-h-off: 30px;
  --fav-h-on: 60px;
  position: absolute;
  top: 0;
  right: 0.35rem;
  left: auto;
  z-index: 6;
  display: block;
  width: 28px;
  height: var(--fav-h-off);
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
  transition: height 0.12s ease;
}
.fav-toggle.is-off {
  height: var(--fav-h-off);
}
.fav-toggle.is-on {
  height: var(--fav-h-on);
}
.fav-toggle img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill; /* estira como el .9.png del APK */
  pointer-events: none;
  filter: none;
  opacity: 1;
  transform: none;
}
.fav-toggle:active {
  opacity: 0.9;
}
.fav-toggle:focus-visible {
  outline: 2px solid rgba(154, 117, 40, 0.7);
  outline-offset: 2px;
}
.fav-toggle[hidden] {
  display: none !important;
}
.fav-toggle.just-toggled.is-on {
  animation: favPop 0.28s ease;
}
@keyframes favPop {
  0% { transform: scaleY(0.92); }
  60% { transform: scaleY(1.04); }
  100% { transform: scaleY(1); }
}
.panel-body {
  font-size: var(--read-size, 1.02rem);
}
.detail-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.4rem;
  align-items: center;
  padding: 0.55rem;
  border-top: 1px solid var(--line);
  background: rgba(247, 243, 232, 0.95);
  flex-shrink: 0;
  min-height: 48px;
  z-index: 4;
}
.detail-pager > #btnPrev,
.detail-pager > #btnNext {
  border: 1px solid #8a8274;
  background: #f3eee3;
  border-radius: 4px;
  padding: 0.55rem;
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  align-self: center;
}
.psalm-list-empty {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  grid-template-columns: none !important;
  width: 100%;
  box-sizing: border-box;
  margin: 1.25rem 0.75rem;
  padding: 1.4rem 1.1rem !important;
  border: 1px dashed rgba(154, 117, 40, 0.45) !important;
  border-radius: 10px;
  background: rgba(247, 243, 232, 0.85);
  text-align: center;
  color: #4a4338;
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: default !important;
  pointer-events: none;
}
.psalm-list-empty .empty-ico {
  width: 36px;
  height: 36px;
  object-fit: contain;
  opacity: 0.85;
}
.psalm-list-empty .empty-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2f2a22;
}
.psalm-list-empty .empty-hint {
  margin: 0;
  max-width: 16rem;
  font-size: 0.88rem;
  color: #6a6256;
}
.psalm-video-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #1a0a0a;
  border-top: 1px solid var(--tv-red);
}
.psalm-video-dock[hidden] {
  display: none !important;
}
.psalm-video-dock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  background: var(--tv-red);
  color: #f8f5ee;
  font-size: 0.88rem;
}
.dock-close {
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.25);
  color: #fff;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.dock-close svg { pointer-events: none; }
#psalmVideoEl {
  display: block;
  width: 100%;
  height: auto;
  max-height: 42vh;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #120808;
  vertical-align: top;
}

.overlay-panel {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(30, 28, 24, 0.5);
  display: grid;
  place-items: stretch;
  padding: 0.55rem;
}
.overlay-panel[hidden] { display: none !important; }
.overlay-card {
  width: 100%;
  max-height: 100%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--gold-dark);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.overlay-card.wide { max-width: none; }
.overlay-panel.is-city {
  padding: 0.28rem;
  place-items: stretch;
}
.overlay-panel.is-city .overlay-card {
  height: 100%;
  max-height: 100%;
}
.overlay-panel.is-city .panel-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0.45rem 0.5rem 0.45rem;
}
.overlay-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 232, 0.95);
}
.overlay-head h2 {
  margin: 0;
  text-align: left;
  font-family: "GeorgiaApp", Georgia, serif;
  font-size: 1.15rem;
}
.close-overlay {
  border: 1px solid #8a8274;
  background: #f3eee3;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.close-overlay svg {
  display: block;
  pointer-events: none;
}
.close-overlay:active { transform: scale(0.96); }
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 0.55rem 1rem;
  -webkit-overflow-scrolling: touch;
  color: var(--ink);
}

.settings-block h3,
.messages-empty h3,
.contact-panel h3 {
  margin: 0.4rem 0 0.6rem;
  font-family: "GeorgiaApp", Georgia, serif;
  color: var(--tab-on);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(120, 110, 90, 0.25);
  font-size: 0.95rem;
}
.settings-row label { flex: 1; }
.settings-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}
.settings-row input[type="range"] {
  width: 100%;
  accent-color: #801b1b;
}
.settings-note {
  margin-top: 1rem;
  color: #5a6d78;
  font-size: 0.88rem;
}
.settings-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #5a5348;
}

.contact-panel {
  max-width: 420px;
  margin: 0 auto;
}
.contact-lead {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
}
.contact-field span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tab-on);
}
.contact-field input,
.contact-field textarea {
  border: 1px solid var(--gold-dark);
  background: #fbf8f0;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  resize: vertical;
}
.contact-field input:focus,
.contact-field textarea:focus {
  outline: 2px solid rgba(196, 163, 90, 0.45);
  outline-offset: 1px;
}
.contact-note {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-align: left;
  line-height: 1.35;
}
.contact-submit {
  margin-top: 0.25rem;
  border: 1px solid #c4b8a4;
  background: #d8d0c2;
  color: #8a8274;
  border-radius: 6px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: not-allowed;
  opacity: 0.72;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.contact-submit.is-on,
.contact-submit:not(:disabled) {
  border-color: #5a1212;
  background: #801b1b;
  color: #fff;
  cursor: pointer;
  opacity: 1;
}
.contact-submit:disabled {
  pointer-events: none;
}
.contact-submit.is-on:active {
  transform: scale(0.98);
  background: #5a1212;
}
.contact-status {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  text-align: left;
}
.contact-status.ok { color: #3d6b4f; }
.contact-status.err { color: #8a2f24; }

.video-toolbar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
  flex-wrap: wrap;
}
.video-toolbar .vid-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--gold-dark);
  background: #f3eee3;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  cursor: pointer;
  color: var(--tab-on);
}
.video-toolbar .vid-action svg {
  flex-shrink: 0;
  pointer-events: none;
}
.video-toolbar .vid-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.video-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.video-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem 0.2rem;
  border-bottom: 1px solid rgba(120, 110, 90, 0.22);
}
.video-list .v-title {
  font-weight: 700;
  font-size: 0.98rem;
}
.video-list .v-meta {
  color: var(--ink-soft);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}
.video-list .play-btn {
  border: 1px solid var(--gold-dark);
  background: #f3eee3;
  color: var(--tab-on);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: none;
}
.video-list .play-btn svg {
  display: block;
  pointer-events: none;
}
.video-list .play-btn:active {
  transform: scale(0.96);
  background: rgba(196, 163, 90, 0.18);
}
.video-list .play-btn.playing {
  background: var(--tab-on);
  color: #f8f5ee;
  border-color: var(--tab-on);
}

.verse-balloon-backdrop {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(30, 16, 16, 0.28);
}
.verse-balloon {
  position: absolute;
  z-index: 101;
  top: 12px;
  left: 8px;
  width: min(92%, 380px);
  max-height: min(70%, 420px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #eadfd0;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(40, 16, 16, 0.28);
  overflow: hidden;
}
.verse-balloon[hidden],
.verse-balloon-backdrop[hidden] {
  display: none !important;
}
.verse-balloon-head {
  position: relative;
  flex-shrink: 0;
  background: #f6e8e8;
  color: #801b1b;
  font-weight: 800;
  font-size: 0.98rem;
  padding: 0.58rem 2.5rem 0.58rem 0.9rem;
  border-bottom: 1px solid rgba(128, 27, 27, 0.12);
}
.verse-balloon-x {
  position: absolute;
  top: 0.2rem;
  right: 0.3rem;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #801b1b;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}
.verse-balloon-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0.9rem 1rem 0.7rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: #3a3228;
}
.verse-balloon-body .verse {
  margin: 0 0 0.75rem;
}
.verse-balloon-body .verse-num {
  color: #801b1b;
  font-weight: 700;
  margin-inline-end: 0.2em;
}
.verse-balloon-verse {
  margin: 0 0 0.75rem;
}
.verse-balloon-verse:last-child {
  margin-bottom: 0;
}
.verse-balloon-num {
  font-weight: 700;
  color: #801b1b;
  margin-right: 0.35rem;
}
.verse-balloon-more {
  color: #6a5e50;
  font-style: italic;
  font-size: 0.9em;
}
.verse-balloon-loading,
.verse-balloon-empty {
  margin: 0.35rem 0;
  color: #6a5e50;
}
.verse-balloon-ref-inline {
  color: #801b1b;
  font-weight: 700;
}
.verse-balloon-foot {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #eadfd0;
  background: #fff;
}
#btnVerseBalloonClose,
#btnVerseBalloonGo {
  min-height: 40px;
  padding: 0 0.95rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
#btnVerseBalloonClose {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid #801b1b;
}
#btnVerseBalloonGo {
  background: #801b1b;
  color: #fff;
  border: 1px solid #801b1b;
}

.btv-viewer {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  background: #f7f3e8;
}
.btv-viewer[hidden] {
  display: none !important;
}
.btv-viewer-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.3rem 0.65rem;
  background: #801b1b;
  color: #fff;
}
.btv-viewer-back {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 0.7rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btv-viewer-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btv-frame {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #fff;
}

@media (min-width: 500px) and (max-width: 899px) {
  .psalm-video-dock {
    max-height: 40vh;
  }
}

.video-player {
  position: absolute;
  inset: 0;
  z-index: 40;
  /* Fondo pergamino: sin banda negra vacía debajo del video */
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--bg-dot) 0.85px, transparent 1.05px);
  background-size: 9px 9px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
}
.video-player[hidden] { display: none !important; }
.video-player-sheet {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: #1a2226;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.video-player-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: #1a2226;
  color: #f2f7f8;
  flex-shrink: 0;
}
.video-player-bar button {
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font: inherit;
}
#videoTitle {
  flex: 1;
  font-size: 0.95rem;
  text-align: left;
  min-width: 0;
}
.video-stage {
  flex: 0 0 auto;
  display: block;
  padding: 0;
  background: #000;
  line-height: 0;
}
#videoEl {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  border-radius: 0;
  flex: none;
}
.video-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.65rem 0.7rem 0.85rem;
  background: #1a2226;
  flex-shrink: 0;
}
.video-nav button {
  border: 1px solid rgba(255,255,255,0.25);
  background: #2f3c42;
  color: #fff;
  border-radius: 8px;
  padding: 0.65rem;
  font: inherit;
  cursor: pointer;
}

.about-frame {
  border: 0;
  width: 100%;
  min-height: 60vh;
  background: transparent;
}

[hidden] { display: none !important; }

/* Móvil: ocultar detail-pager (solo PC). Navegación por deslizar. */
@media (max-width: 720px), (hover: none) and (pointer: coarse) {
  .detail-pager {
    display: none !important;
  }
  .detail-view {
    touch-action: pan-y;
  }
  .ministry-nav {
    padding: 0.1rem 0.15rem;
  }
  .ministry-title {
    font-size: clamp(1.12rem, 5.4vw, 1.4rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0;
  }
  .btv-cta-ministry {
    font-size: clamp(1.05rem, 4.6vw, 1.22rem);
    font-weight: 800;
  }
  .detail-body {
    padding: 0.5rem 1.05rem 0.85rem 0.28rem;
  }
  .detail-body.heb,
  .detail-body.align-he {
    padding: 0.5rem 0.28rem 0.85rem 1.05rem;
  }
  .panel-body {
    padding: 0.5rem 0.35rem 0.9rem;
  }
  .psalm-preface {
    padding: 0 !important;
    background: none !important;
  }
  .midrash-body {
    padding: 0.55rem 0.28rem 0.8rem 0.4rem;
  }
  .overlay-panel {
    padding: 0.35rem;
  }
  .psalm-video-dock {
    max-height: 36vh;
  }
  #psalmVideoEl {
    max-height: 30vh;
  }
}

