:root {
  --gold: #c9973a;
  --gold-light: #e8c87a;
  --gold-dark: #8b6420;
  --crimson: #8b1a1a;
  --crimson-light: #c0392b;
  --ink: #1a1208;
  --parchment: #f5ead8;
  --parchment-dark: #e8d5b0;
  --parchment-deep: #d4b896;
  --azure: #1a3a6b;
  --azure-light: #2a5298;
  --shadow: rgba(26,18,8,0.4);
  --text-body: #2c1f0e;
  --text-muted: #6b4c2a;
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: #0d0906;
  min-height: 100vh;
  font-family: 'IM Fell English', Georgia, serif;
  color: var(--text-body);
  overflow-x: hidden;
}

/* ── NOISE OVERLAY ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ── HEADER ── */
.site-header {
  position: relative; z-index: 10;
  background: linear-gradient(180deg, #0d0906 0%, #1a1005 40%, #2a1a08 100%);
  border-bottom: 2px solid var(--gold-dark);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 120% at 50% -20%, rgba(201,151,58,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.ornament-top {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-bottom: 1.5rem;
  color: var(--gold);
  font-size: 1.4rem; letter-spacing: 0.3em;
}
.ornament-top span { opacity: 0.6; font-size: 0.9rem; }

.site-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(201,151,58,0.5), 0 2px 8px rgba(0,0,0,0.8);
  letter-spacing: 0.05em;
  line-height: 1.2;
  position: relative;
}

.site-subtitle {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: var(--gold-light);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  opacity: 0.8;
}

.header-verse {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--parchment-deep);
  font-size: 0.95rem;
  margin-top: 1rem;
  opacity: 0.7;
  letter-spacing: 0.03em;
}

.gold-rule {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem auto 0; max-width: 500px;
  color: var(--gold-dark);
}
.gold-rule::before, .gold-rule::after {
  content: ''; flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.gold-rule-symbol { font-size: 1.2rem; color: var(--gold); }

/* ── STATS BAR ── */
.stats-bar {
  background: linear-gradient(90deg, #1a1005, #2a1a08, #1a1005);
  border-bottom: 1px solid rgba(201,151,58,0.2);
  padding: 0.75rem 2rem;
  display: flex; justify-content: center; gap: 3rem;
  position: relative; z-index: 9;
}
.stat-item {
  text-align: center;
  font-family: 'Cinzel', serif;
}
.stat-number {
  display: block;
  font-size: 1.4rem; font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.stat-label {
  font-size: 0.65rem; letter-spacing: 0.15em;
  color: var(--parchment-deep); text-transform: uppercase; opacity: 0.7;
}

/* ── CONTROLS ── */
.controls-panel {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(180deg, #1e1208 0%, #16100a 100%);
  border-bottom: 2px solid var(--gold-dark);
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.controls-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
}

.search-wrap {
  position: relative; flex: 1; min-width: 220px;
}
.search-icon {
  position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  color: var(--gold-dark); font-size: 1rem; pointer-events: none;
}
#search-input {
  width: 100%; padding: 0.6rem 0.9rem 0.6rem 2.5rem;
  background: rgba(245,234,216,0.07);
  border: 1px solid var(--gold-dark);
  border-radius: 3px;
  color: var(--parchment);
  font-family: 'IM Fell English', serif;
  font-size: 0.95rem;
  transition: all 0.2s;
  outline: none;
}
#search-input::placeholder { color: rgba(201,151,58,0.4); font-style: italic; }
#search-input:focus {
  border-color: var(--gold);
  background: rgba(245,234,216,0.1);
  box-shadow: 0 0 0 2px rgba(201,151,58,0.15);
}

.filter-scroll {
  display: flex; gap: 0.4rem; overflow-x: auto;
  scrollbar-width: none; flex-wrap: wrap;
}
.filter-scroll::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 0.35rem 0.8rem;
  background: transparent;
  border: 1px solid rgba(201,151,58,0.3);
  border-radius: 2px;
  color: rgba(201,151,58,0.6);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem; letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,151,58,0.1);
}
.filter-btn.active {
  background: var(--gold-dark);
  border-color: var(--gold);
  color: var(--parchment);
}

.view-toggle {
  display: flex; gap: 0.3rem; margin-left: auto;
}
.view-btn {
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid rgba(201,151,58,0.3);
  border-radius: 3px;
  color: rgba(201,151,58,0.5);
  cursor: pointer; font-size: 0.9rem;
  transition: all 0.2s; display:flex; align-items:center; justify-content:center;
}
.view-btn.active, .view-btn:hover {
  background: rgba(201,151,58,0.15);
  border-color: var(--gold); color: var(--gold);
}

.results-info {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem; color: var(--gold-dark);
  letter-spacing: 0.1em; white-space: nowrap;
  display: flex; align-items: center;
}

/* ── MAIN LAYOUT ── */
.main-wrap {
  max-width: 1400px; margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative; z-index: 1;
}

/* ── GRID VIEW ── */
#psalms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ── LIST VIEW ── */
#psalms-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

/* ── PSALM CARD ── */
.psalm-card {
  background: linear-gradient(145deg, var(--parchment) 0%, var(--parchment-dark) 60%, var(--parchment-deep) 100%);
  border: 1px solid var(--parchment-deep);
  border-radius: 4px;
  cursor: pointer;
  position: relative; overflow: hidden;
  box-shadow: 2px 3px 12px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: cardReveal 0.4s ease both;
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.psalm-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--crimson), var(--gold), var(--crimson));
}

.psalm-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(201,151,58,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.psalm-card:hover {
  transform: translateY(-3px);
  box-shadow: 4px 8px 24px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.7);
}

.card-header {
  padding: 1.1rem 1.1rem 0.6rem;
  display: flex; align-items: flex-start; gap: 0.8rem;
}

.card-num {
  font-family: 'Cinzel Decorative', serif;
  font-size: 2rem; font-weight: 700; line-height: 1;
  color: var(--crimson);
  text-shadow: 1px 1px 0 rgba(139,26,26,0.3);
  min-width: 2.5rem;
}

.card-meta { flex: 1; }

.card-ref {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem; letter-spacing: 0.15em;
  color: var(--gold-dark); text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem; font-weight: 700;
  color: var(--ink); line-height: 1.3;
}

.card-body { padding: 0 1.1rem 1rem; }

.card-desc {
  font-size: 0.82rem; font-style: italic;
  color: var(--text-muted); line-height: 1.5;
  border-top: 1px solid rgba(139,26,26,0.15);
  padding-top: 0.6rem; margin-bottom: 0.6rem;
}

.card-cat {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--azure); border: 1px solid rgba(26,58,107,0.3);
  padding: 0.15rem 0.5rem; border-radius: 2px;
  background: rgba(26,58,107,0.06);
}

.card-ornament {
  position: absolute; bottom: 0.5rem; right: 0.75rem;
  font-size: 1.4rem; color: rgba(201,151,58,0.18);
  pointer-events: none;
}

/* ── LIST VIEW CARD ── */
.list-view .psalm-card { border-radius: 3px; }
.list-view .card-header { padding: 0.75rem 1.1rem 0.4rem; align-items: center; }
.list-view .card-num { font-size: 1.5rem; min-width: 2.2rem; }
.list-view .card-title { font-size: 0.88rem; }
.list-view .card-body { padding: 0 1.1rem 0.6rem; }
.list-view .card-desc { font-size: 0.78rem; }

/* ── MODAL OVERLAY ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,7,4,0.88);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.open {
  opacity: 1; pointer-events: all;
}

/* ── MODAL ── */
.modal {
  background: var(--parchment);
  max-width: 720px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 0 1px var(--gold-dark),
              inset 0 1px 0 rgba(255,255,255,0.7);
  position: relative;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--crimson) 0%, var(--gold) 30%, var(--azure) 60%, var(--gold) 80%, var(--crimson) 100%);
}

.modal-illuminated {
  padding: 2rem 2rem 0;
  display: flex; align-items: flex-start; gap: 1.5rem;
}

.modal-drop-cap {
  width: 72px; height: 72px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--crimson), #5a1010);
  border: 2px solid var(--gold);
  border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel Decorative', serif;
  font-size: 2.2rem; font-weight: 700; color: var(--gold);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  box-shadow: 2px 3px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
}
.modal-drop-cap::after {
  content: '';
  position: absolute; inset: 3px;
  border: 1px solid rgba(201,151,58,0.4);
  border-radius: 2px;
}

.modal-header-text { flex: 1; padding-top: 0.25rem; }

.modal-ref {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-dark); margin-bottom: 0.35rem;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 700; color: var(--crimson);
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(139,26,26,0.2);
}

.modal-cat {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--azure-light); border: 1px solid rgba(26,82,152,0.3);
  padding: 0.2rem 0.6rem; border-radius: 2px;
  background: rgba(26,82,152,0.06); margin-top: 0.5rem;
}

.modal-divider {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 2rem;
  color: var(--gold-dark);
}
.modal-divider::before, .modal-divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dark), transparent);
}
.modal-divider-sym { font-size: 1rem; color: var(--crimson); }

.modal-body { padding: 0 2rem 2rem; }

.section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-dark); margin-bottom: 0.4rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.section-label::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--gold-dark), transparent);
}

.modal-desc {
  font-size: 1.05rem; font-style: italic;
  color: var(--text-muted); line-height: 1.7;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid var(--crimson);
}

.modal-analysis {
  font-size: 0.93rem; line-height: 1.85;
  color: var(--text-body); margin-bottom: 1.5rem;
  text-align: justify;
}

/* ── SALMO COMPLETO ── */
.modal-psalm-text {
  font-family: 'IM Fell English', Georgia, serif;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(201,151,58,0.05) 0%, transparent 80%);
  border: 1px solid rgba(201,151,58,0.2);
  border-radius: 3px;
  padding: 1.25rem 1.5rem 1rem;
  position: relative;
}
.modal-psalm-text::before {
  content: '❝';
  position: absolute; top: 0.4rem; left: 0.75rem;
  font-size: 2rem; color: rgba(201,151,58,0.18);
  font-family: Georgia, serif; line-height: 1;
  pointer-events: none;
}

/* Estrofa: bloque con separación entre estrofas */
.verse-stanza {
  display: block;
  margin-bottom: 0.75rem;
}
.verse-stanza:last-child { margin-bottom: 0; }

/* Línea de versículo: número + texto en grid */
.verse-line {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  margin-bottom: 1px;
  line-height: 1.4;
  align-items: baseline;
}
.verse-num {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--crimson);
  opacity: 0.7;
  text-align: right;
  user-select: none;
}
.verse-body {
  font-size: 0.93rem;
  color: var(--ink);
  line-height: 1.4;
}

/* Rúbrica / subtítulo sin número */
.verse-rubric {
  display: block;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 2px;
  padding-left: 28px;
}

/* ── YOUTUBE PLAYER ── */
.modal-youtube {
  margin-bottom: 1.5rem;
}
.youtube-wrap {
  position: relative;
  width: 100%;
  /* Shorts son verticales 9:16 → padding-bottom 177.7%
     Videos normales son 16:9 → padding-bottom 56.25%
     Usamos un tamaño intermedio cómodo: ancho fijo centrado */
  display: flex;
  justify-content: center;
}
.youtube-wrap iframe {
  width: 100%;
  max-width: 315px;   /* ancho máximo para shorts verticales */
  height: 560px;      /* 9:16 aprox */
  border: none;
  border-radius: 3px;
  border: 1px solid rgba(201,151,58,0.2);
}
@media (max-width: 600px) {
  .youtube-wrap iframe {
    max-width: 100%;
    height: 480px;
  }
}

/* Collapsible salmo completo */
.psalm-toggle {
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Cinzel', serif;
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold-dark); margin-bottom: 0.4rem; width: 100%;
  padding: 0;
}
.psalm-toggle::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--gold-dark), transparent);
}
.psalm-toggle-icon {
  font-size: 0.8rem; transition: transform 0.2s;
  color: var(--crimson);
}
.psalm-toggle.open .psalm-toggle-icon { transform: rotate(180deg); }
.psalm-collapsible {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
}
.psalm-collapsible.open { max-height: 9000px; }

/* Hashtags */
.hashtag-cloud {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.hashtag {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem; letter-spacing: 0.05em;
  color: var(--azure-light);
  background: rgba(26,58,107,0.07);
  border: 1px solid rgba(26,58,107,0.25);
  padding: 0.25rem 0.6rem; border-radius: 2px;
  cursor: pointer; transition: all 0.15s;
}
.hashtag:hover {
  background: rgba(26,58,107,0.15);
  border-color: var(--azure-light);
  color: var(--azure);
}

/* Modal nav */
.modal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  border-top: 1px solid var(--parchment-deep);
  background: linear-gradient(180deg, var(--parchment-dark), var(--parchment-deep));
}
.modal-nav-btn {
  background: transparent; border: 1px solid var(--gold-dark);
  color: var(--gold-dark); padding: 0.45rem 1rem;
  font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.1em;
  cursor: pointer; border-radius: 2px; transition: all 0.2s;
  display: flex; align-items: center; gap: 0.4rem;
}
.modal-nav-btn:hover {
  background: var(--gold-dark); color: var(--parchment);
}
.modal-nav-btn:disabled {
  opacity: 0.3; cursor: not-allowed;
}
.modal-close {
  background: var(--crimson); border: 1px solid #5a1010;
  color: var(--parchment); padding: 0.45rem 1.2rem;
  font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.1em;
  cursor: pointer; border-radius: 2px; transition: all 0.2s;
}
.modal-close:hover { background: #5a1010; }

.modal::-webkit-scrollbar { width: 5px; }
.modal::-webkit-scrollbar-track { background: var(--parchment-dark); }
.modal::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 3px; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--gold-dark); grid-column: 1/-1;
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 {
  font-family: 'Cinzel', serif; font-size: 1rem;
  letter-spacing: 0.15em; text-transform: uppercase;
}

/* ── FOOTER ── */
.site-footer {
  text-align: center; padding: 2rem;
  border-top: 1px solid rgba(201,151,58,0.15);
  font-family: 'Cinzel', serif;
  font-size: 0.65rem; letter-spacing: 0.15em;
  color: rgba(201,151,58,0.3);
  text-transform: uppercase;
  position: relative; z-index: 1;
}

/* ── HIGHLIGHT ── */
.highlight { background: rgba(201,151,58,0.35); border-radius: 2px; padding: 0 1px; }

/* ── SCROLL TO TOP ── */
.scroll-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 50;
  width: 40px; height: 40px;
  background: var(--gold-dark); border: 1px solid var(--gold);
  border-radius: 50%; color: var(--parchment);
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; opacity: 0; pointer-events: none;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
}
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { background: var(--gold); transform: translateY(-2px); }

/* ── YOUTUBE SOUND HINT ── */
.youtube-wrap {
  position: relative; /* necesario para posicionar el hint */
}
.yt-sound-hint {
  position: absolute;
  top: 0.75rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(26, 18, 8, 0.82);
  border: 1px solid var(--gold-dark);
  border-radius: 20px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  z-index: 10;
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.yt-sound-hint:hover {
  background: rgba(139, 100, 32, 0.9);
  border-color: var(--gold);
}
.yt-sound-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.yt-sound-label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.yt-sound-hint--off {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  pointer-events: none;
}

/* ── LOADING ── */
.loading-state {
  text-align: center; padding: 4rem 2rem;
  color: var(--gold-dark); grid-column: 1/-1;
  font-family: 'Cinzel', serif; font-size: 0.85rem;
  letter-spacing: 0.15em; text-transform: uppercase;
}

/* ── SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--parchment-dark) 25%, var(--parchment) 50%, var(--parchment-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 3px;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── RESPONSIVE — MOBILE ── */
@media (max-width: 600px) {

  /* Header más compacto */
  .site-header { padding: 1.25rem 1rem 1rem; }
  .ornament-top { margin-bottom: 0.75rem; font-size: 1rem; }
  .header-verse { font-size: 0.8rem; margin-top: 0.5rem; }
  .gold-rule { margin-top: 0.75rem; }

  /* Stats bar: menos gap */
  .stats-bar { gap: 1rem; padding: 0.5rem 1rem; }
  .stat-number { font-size: 1.1rem; }
  .stat-label { font-size: 0.58rem; }

  /* Panel de controles: todo en columna, más ajustado */
  .controls-panel { padding: 0.6rem 0.75rem; }
  .controls-inner { gap: 0.5rem; }

  /* Búsqueda ocupa todo el ancho */
  .search-wrap { min-width: 0; width: 100%; flex: none; }
  #search-input { font-size: 0.88rem; padding: 0.5rem 0.75rem 0.5rem 2.2rem; }

  /* Filtros: scroll horizontal en una sola fila, no wrap */
  .filter-scroll {
    flex-wrap: nowrap;          /* una sola fila */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;        /* espacio para la scrollbar en iOS */
    width: 100%;
  }
  .filter-btn {
    font-size: 0.6rem;
    padding: 0.28rem 0.6rem;
    flex-shrink: 0;             /* no se comprimen */
  }

  /* View toggle y contador en la misma fila, al final */
  .view-toggle { margin-left: 0; }
  .results-info { font-size: 0.65rem; }

  /* Grid: una sola columna */
  #psalms-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Cards más compactas */
  .card-header { padding: 0.8rem 0.8rem 0.4rem; gap: 0.6rem; }
  .card-num { font-size: 1.6rem; min-width: 2rem; }
  .card-title { font-size: 0.88rem; }
  .card-body { padding: 0 0.8rem 0.75rem; }
  .card-desc { font-size: 0.78rem; }

  /* Main padding */
  .main-wrap { padding: 1rem 0.75rem; }

  /* Modal: ocupa casi toda la pantalla */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-height: 92vh;
    border-radius: 12px 12px 0 0;   /* esquinas arriba, pegado abajo */
    transform: scale(1) translateY(40px);
  }
  .modal-overlay.open .modal { transform: translateY(0); }

  /* Modal interior más compacto */
  .modal-illuminated { padding: 1.25rem 1.25rem 0; gap: 1rem; flex-direction: column; align-items: center; text-align: center; }
  .modal-drop-cap { width: 56px; height: 56px; font-size: 1.7rem; }
  .modal-title { font-size: 1.2rem; }
  .modal-divider { padding: 0.6rem 1.25rem; }
  .modal-body { padding: 0 1.25rem 1.25rem; }
  .modal-desc { font-size: 0.95rem; padding-left: 0.75rem; }
  .modal-analysis { font-size: 0.87rem; }
  .modal-nav { padding: 0.75rem 1.25rem; }
  .modal-nav-btn { font-size: 0.65rem; padding: 0.4rem 0.75rem; }
  .modal-close { font-size: 0.65rem; padding: 0.4rem 1rem; }

  /* Salmo completo más legible en pantalla chica */
  .modal-psalm-text { padding: 1rem 1rem 0.75rem; }
  .verse-body { font-size: 0.88rem; }

  /* Scroll top: más cerca del borde */
  .scroll-top { bottom: 1rem; right: 1rem; width: 36px; height: 36px; font-size: 0.9rem; }

  /* Footer */
  .site-footer { padding: 1.25rem 1rem; font-size: 0.6rem; }
}
