/* ═══════════════════════════════════════
   SHARED — Ministerios Ebenezer Bilbao
═══════════════════════════════════════ */

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --bg:       #F4F5F8;
  --surface:  #ffffff;
  --surface2: #E8EBF3;
  --border:   rgba(11,19,48,.12);
  --text:     #0B1330;
  --muted:    #566082;
  --gold:     #2145E6;
  --gold2:    #1A37B8;
  --ink:      #0B1330;
  --lamp:     #FFB938;
  --font-display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
  --red:      #d92d20;
  --green:    #2f9e5b;
  --blue:     #2563eb;
  --teal:     #0d9488;
  --purple:   #7c3aed;
  --pink:     #db2777;
  --ease:     cubic-bezier(.16,1,.3,1);
  --nav-h:    64px;
  --radius:   18px;
  --radius-sm: 12px;
  --ok-bg:#dcf5e6; --ok-fg:#14653a; --warn-bg:#fff0cc; --warn-fg:#7a5200;
  --bad-bg:#fde1de; --bad-fg:#9b1c12; --info-bg:#dfe7ff; --info-fg:#1a37b8;
  --soft:#eef2ff; --nav-bg:rgba(244,245,248,.92); --hover:rgba(0,0,0,.05);
  --green-ink:#2f6b4f;
  --rhema:#4D7C0F;          /* rhema (Danza): verde oliva propio; texto blanco 5:1 */
}

/* Logo «Ministerios Ebenezer Bilbao»: una sola imagen-máscara que se pinta del color de cada tema */
:root { --logo-c: #7a0c12; }
:root[data-theme="dark"] { --logo-c: #f3e3cc; }
.logo-wm { display: block; height: 44px; width: 130px; flex-shrink: 0; background: var(--logo-c); -webkit-mask: url(/icons/logo-ministerios-mask.png?v=5) left center / contain no-repeat; mask: url(/icons/logo-ministerios-mask.png?v=5) left center / contain no-repeat; }
.app-top .logo-wm.app-logo { height: 38px; width: 112px; }

/* Modo oscuro (lo activa js/tema.js con data-theme="dark") */
:root[data-theme="dark"], :root[data-theme="dark"] .dark-content {
  color-scheme: dark;
  --bg:#130A0C; --surface:#1D1215; --surface2:#2B1A1E; --border:rgba(255,255,255,.12);
  --text:#F7EEEC; --muted:#BBA6A9; --ink:#4A1018;
  --red:#f0645a; --green:#46c27e; --blue:#6b93ff; --teal:#2dd4bf; --purple:#a78bfa; --pink:#f472b6;
  --ok-bg:#12382a; --ok-fg:#7fe0aa; --warn-bg:#3d3112; --warn-fg:#ffd36e;
  --bad-bg:#43191a; --bad-fg:#ff9b94; --info-bg:#3A1A20; --info-fg:#F2B1B5;
  --soft:#2A1519; --nav-bg:rgba(19,10,12,.92); --hover:rgba(255,255,255,.07);
  --green-ink:#5fd49a;
  --rhema:#4F8212;
}


/* Tema claro de la app: papel cálido, tinta granate y acento rojo (el mismo del icono) */
:root[data-theme="light"], :root[data-theme="light"] .dark-content {
  --bg:#FAF7F4; --surface:#FFFFFF; --surface2:#F3EDE8; --border:rgba(74,18,24,.11);
  --text:#2A1417; --muted:#7A666A; --ink:#3B0A10;
  --soft:#FBECEB; --nav-bg:rgba(250,247,244,.92); --hover:rgba(74,18,24,.06);
  --info-bg:#F8E8E6; --info-fg:#8F1018;
  --shadow-card:0 1px 2px rgba(74,18,24,.05), 0 8px 22px rgba(74,18,24,.06);
}
:root[data-theme="dark"] { --shadow-card:none; }
:root[data-pub] { --blue:#B3151F; --purple:#8F1018; --info-fg:#8F1018; }
:root[data-pub][data-theme="dark"] { --blue:#E5484D; --purple:#F0757A; }
:root[data-theme] .card, :root[data-theme] .min, :root[data-theme] .tarjeta { box-shadow: var(--shadow-card, none); }

/* Paneles internos del equipo (equipo/ministerios/etc.) — mismo esquema claro
   que el resto del sitio, solo con una superficie ligeramente distinta para
   diferenciarlos visualmente del sitio público. */
.dark-content {
  --bg:       #EEF0F6;
  --surface:  #ffffff;
  --surface2: #E8EBF3;
  --border:   rgba(11,19,48,.12);
  --text:     #0B1330;
  --muted:    #566082;
  --red:      #d92d20;
  --green:    #2f9e5b;
  --blue:     #2563eb;
  --teal:     #0d9488;
  --purple:   #7c3aed;
  --pink:     #db2777;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Instrument Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  cursor: auto;
  overflow-x: hidden;
}



@media (hover:none) and (pointer:coarse) {
  body { cursor:auto; }
  button, a { cursor:pointer; }
}

/* ── NAVIGATION ── */
.site-nav {
  position: fixed; top:0; left:0; right:0;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 500;
  display: flex; align-items: center;
  padding: 0 2.5rem;
  gap: 2rem;
}

.nav-logo {
  font-size: 1.15rem; font-weight: 800;
  color: var(--text); text-decoration: none;
  letter-spacing: -.03em;
  flex-shrink: 0;
  display: flex; align-items: center; gap: .5rem;
}
.nav-logo .nav-aguila { width: 38px; height: auto; display: block; flex-shrink: 0; }
.nav-logo .stone { width: 13px; height: 19px; background: var(--gold); border-radius: 7px 8px 3px 4px / 9px 9px 3px 3px; transform: rotate(-6deg); flex-shrink: 0; }
.nav-logo em { font-style:normal; font-weight: 500; margin-left:.28em; }

.nav-links {
  display: flex; gap: .25rem;
  flex: 1;
}

.nav-links a {
  font-size: .9rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  padding: .45rem .85rem;
  border-radius: 999px;
  transition: color .2s, background .2s;
  cursor:pointer;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: var(--text);
  background: var(--hover);
}

.nav-right {
  display: flex; align-items: center; gap: .75rem;
  flex-shrink: 0;
}

.nav-btn {
  font-family: 'Instrument Sans', sans-serif;
  font-size: .86rem; font-weight: 650;
  padding: .52rem 1.15rem;
  border-radius: 999px;
  cursor:pointer;
  text-decoration: none;
  transition: all .2s;
}
.nav-btn-outline {
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
}
.nav-btn-outline:hover { border-color: var(--text); color: var(--text); }
.nav-btn-gold {
  border: none;
  background: var(--gold);
  color: #fff;
}
.nav-btn-gold:hover { background: var(--gold2); }

/* Mobile burger */
.nav-burger {
  display: none;
  background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 999px;
  width: 36px; height: 36px;
  cursor:pointer;
  font-size: 1rem;
  align-items: center; justify-content: center;
  margin-left: auto;
}

.nav-mobile {
  position: fixed;
  top: var(--nav-h); left:0; right:0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex; flex-direction: column; gap: .5rem;
  z-index: 499;
  transform: translateY(-110%);
  visibility: hidden;
  transition: transform .35s var(--ease), visibility 0s linear .35s;
}
.nav-mobile.open { transform: translateY(0); visibility: visible; transition: transform .35s var(--ease); }
.nav-mobile a {
  font-size: .9rem; font-weight: 500;
  color: var(--muted); text-decoration: none;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
  transition: color .2s;
}
.nav-mobile a:last-child { border-bottom: none; }
.nav-mobile a:hover, .nav-mobile a.active { color: var(--text); }

@media (max-width: 768px) {
  .site-nav { padding: 0 1.25rem; }
  .nav-links, .nav-right { display: none; }
  .nav-burger { display: flex; }
}

/* ── PAGE WRAPPER ── */
.page { padding-top: var(--nav-h); }

/* ── SECTION UTILITIES ── */
.section { padding: 6rem 2.5rem; }
.section-sm { padding: 4rem 2.5rem; }
.container { max-width: 1100px; margin: 0 auto; }

.section-tag {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 1.25rem; display: block;
}
.section-title {
  font-size: clamp(2.6rem, 6.5vw, 4.75rem);
  font-weight: 800; letter-spacing: -.04em;
  line-height: .98; margin-bottom: 1.5rem;
}
.section-sub {
  font-size: .95rem; color: var(--muted);
  max-width: 480px; line-height: 1.7;
  font-weight: 400;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 1.9rem;
  font-family: 'Instrument Sans', sans-serif;
  font-size: .95rem; font-weight: 650;
  border-radius: 999px; text-decoration: none;
  cursor:pointer; transition: all .25s var(--ease);
  border: none;
}
.btn-gold  { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold2); }
.btn-outline { border: 1px solid var(--border); color: var(--muted); background: transparent; }
.btn-outline:hover { border-color: var(--text); color: var(--text); }
.btn-full { width: 100%; justify-content: center; }

/* ── SCROLL REVEAL ── */
.reveal {
  opacity:0; transform:translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.visible { opacity:1; transform:translateY(0); }

.mask-wrap { overflow:hidden; display:block; }
.mask-text {
  display:block; transform:translateY(110%);
  transition: transform 1s var(--ease);
}
.mask-text.visible { transform:translateY(0); }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem 2.5rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1.5rem;
}
.footer-logo {
  font-size: .85rem; font-weight: 700; color: var(--muted);
  display: flex; align-items: center; gap: .4rem;
}
.footer-logo span { color: var(--gold); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a {
  font-size: .75rem; color: var(--muted);
  text-decoration: none; letter-spacing: .06em;
  text-transform: uppercase; transition: color .2s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
  font-family: 'Space Mono', monospace;
  font-size: .6rem; color: var(--muted);
  letter-spacing: .1em;
}

@media (max-width: 768px) {
  .section { padding: 4rem 1.25rem; }
  .section-sm { padding: 3rem 1.25rem; }
  footer { padding: 2.5rem 1.25rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* ── LOADER ── */
.loader {
  position: fixed; inset:0;
  background: var(--bg); z-index:8000;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:1.5rem;
  transition: opacity .7s var(--ease), visibility .7s;
}
.loader.hidden { opacity:0; visibility:hidden; }
.loader-cross { font-size:2.5rem; color:var(--gold); animation: lp 1.5s ease-in-out infinite; }
@keyframes lp { 0%,100%{opacity:.4;transform:scale(.9)} 50%{opacity:1;transform:scale(1)} }
.loader-bar { width:100px; height:1px; background:var(--border); position:relative; overflow:hidden; }
.loader-bar::after {
  content:''; position:absolute; inset:0;
  background:var(--gold); transform:translateX(-100%);
  animation: lb 1.2s var(--ease) forwards;
}
@keyframes lb { to { transform:translateX(0); } }

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
}

.card-item {
  background: var(--surface);
  padding: 2rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background .3s;
  position: relative;
  overflow: hidden;
}
.card-item::before {
  content:''; position:absolute; inset:0;
  background: radial-gradient(circle 180px at var(--mx,50%) var(--my,50%), rgba(33,69,230,.07) 0%, transparent 70%);
  opacity:0; transition:opacity .4s;
}
.card-item:hover::before { opacity:1; }
.card-item:hover { background: var(--surface2); }

/* ── FORM ── */
.form-field { margin-bottom: 1rem; }
.form-field label {
  display:block; font-size:.7rem;
  letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted); margin-bottom:.5rem;
}
.form-field input, .form-field select, .form-field textarea {
  width:100%; padding:.75rem 1.1rem;
  background:var(--bg); border:1px solid var(--border);
  border-radius:var(--radius-sm); color:var(--text);
  font-family:'Instrument Sans',sans-serif; font-size:.9rem;
  outline:none; transition:border-color .2s;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color:var(--gold); }
.form-field input::placeholder { color:var(--muted); }
.form-field input.error { border-color:var(--red); }

/* ── BADGE ── */
.badge {
  font-family:'Space Mono',monospace;
  font-size:.6rem; letter-spacing:.1em;
  text-transform:uppercase; padding:.3rem .7rem;
  border-radius:999px; display:inline-block;
}
.badge-gold   { background:rgba(33,69,230,.1);   color:var(--gold); }
.badge-green  { background:rgba(47,158,91,.12);  color:var(--green); }
.badge-red    { background:rgba(211,47,47,.1);   color:var(--red); }
.badge-blue   { background:rgba(37,99,235,.1);   color:var(--blue); }
.badge-teal   { background:rgba(13,148,136,.1);  color:var(--teal); }
.badge-purple { background:rgba(124,58,237,.1);  color:var(--purple); }
.badge-pink   { background:rgba(219,39,119,.1);  color:var(--pink); }
.badge-muted  { background:rgba(0,0,0,.05);      color:var(--muted); }

/* ── DIVIDER ── */
.divider {
  display:flex; align-items:center; gap:.75rem;
  color:var(--muted); font-size:.75rem;
  margin: 1rem 0;
}
.divider::before, .divider::after {
  content:''; flex:1; height:1px; background:var(--border);
}

/* ── SPINNER ── */
.spin {
  width:16px; height:16px;
  border:2px solid rgba(255,255,255,.15);
  border-top-color:currentColor; border-radius:50%;
  animation: spinning .7s linear infinite;
  display:inline-block;
}

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 7000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.modal {
  width: 100%; max-width: 460px;
  max-height: 85vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.modal-title {
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: -.01em; margin-bottom: 1.25rem;
}
.modal-actions {
  display: flex; justify-content: flex-end;
  gap: .75rem; margin-top: 1.5rem;
}

/* ── ROW LIST (rosters, line-up, listados) ── */
.row-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.row-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.row-item:last-child { border-bottom: none; }
.row-item-main { flex: 1; min-width: 0; }
.row-item-title { font-size: .9rem; font-weight: 600; }
.row-item-sub { font-size: .78rem; color: var(--muted); margin-top: .15rem; }

/* ── EN DIRECTO — botón nav + aviso flotante ── */
.live-pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
  animation: livePulse 1.1s ease-in-out infinite;
}
@keyframes livePulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }

.nav-btn-live {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--red);
  background: transparent;
  color: var(--red);
}
.nav-btn-live:hover { background: rgba(211,47,47,.08); }
.nav-btn-live.is-live { background: var(--red); color: #fff; border-color: var(--red); }
.nav-btn-live.is-live:hover { background: #b32626; }

.nav-links a.is-live, .nav-mobile a.is-live {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--red) !important;
}

.live-toast {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 600;
  display: flex; align-items: center; gap: .65rem;
  background: var(--ink); color: #fff;
  padding: .75rem .9rem .75rem 1rem;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
  text-decoration: none;
  animation: liveToastIn .4s var(--ease);
  cursor:pointer;
  max-width: calc(100vw - 2.5rem);
}
.live-toast .live-pulse-dot { background: #ef4444; }
.live-toast:hover { background: #1a1a1a; }
.live-toast-text { font-size: .8rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap; }
.live-toast-close {
  background: rgba(255,255,255,.14); border: none; color: #fff;
  width: 22px; height: 22px; border-radius: 50%; font-size: .65rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor:pointer;
}
.live-toast-close:hover { background: rgba(255,255,255,.24); }
@keyframes liveToastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) {
  .live-toast { left: 1rem; right: 1rem; }
  .live-toast-text { white-space: normal; }
}

/* ── WARNING (aviso de bloqueo por meditación pendiente) ── */
.warn-blocked {
  font-family: 'Space Mono', monospace;
  font-size: .62rem; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(211,47,47,.1);
  padding: .3rem .65rem; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .35rem;
}
@keyframes spinning { to { transform:rotate(360deg); } }


/* ── TIPOGRAFÍA DE TITULARES ── */
h1, h2, h3, .section-title, .nav-logo, .modal-title { font-family: var(--font-display); }
h1, h2, .section-title { font-variation-settings: 'wdth' 90; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .mask-text { opacity: 1 !important; transform: none !important; }
}

.nav-badge { background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; min-width: 1.15rem; height: 1.15rem; border-radius: 999px; align-items: center; justify-content: center; padding: 0 .3rem; margin-left: .3rem; }

/* ── MODO APP ── */
body.modo-app { --nav-h: 56px; padding-bottom: 0; }
body.modo-app .site-nav, body.modo-app .nav-mobile, body.modo-app footer, body.modo-app .live-toast, body.modo-app .loader { display: none !important; }
body.modo-app .page { padding-top: calc(56px + env(safe-area-inset-top)); padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.app-top { position: fixed; top: 0; left: 0; right: 0; z-index: 500; display: flex; align-items: center; gap: .65rem; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 1rem 0; background: var(--nav-bg); color: var(--text); border-bottom: 1px solid var(--border); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.app-top .app-logo { width: 40px; height: auto; flex-shrink: 0; display: block; }
.app-top .stone { width: 14px; height: 20px; background: var(--gold); border-radius: 7px 8px 3px 4px / 9px 9px 3px 3px; transform: rotate(-6deg); flex-shrink: 0; }
.app-back { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer; margin-left: -.25rem; }
.app-title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.app-avisos { position: relative; margin-left: auto; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--text); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font: 800 .8rem var(--font-display); text-decoration: none; flex-shrink: 0; transition: transform .2s var(--ease), border-color .2s, color .2s; }
.app-avisos svg { width: 21px; height: 21px; }
.app-avisos.on { color: var(--gold); border-color: var(--gold); }
.app-avisos:active { transform: scale(.92); }
.app-avisos .app-badge { top: -4px; left: auto; right: -4px; }
.app-tab .tab-av { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; display: block; box-shadow: 0 0 0 2px transparent; transition: box-shadow .25s; }
.app-tab.on .tab-av { box-shadow: 0 0 0 2px var(--gold); }
[data-persona] { cursor: pointer; }
[data-persona]:active { opacity: .7; }
.chip[data-persona]:hover { box-shadow: 0 0 0 1.5px var(--gold) inset; }
.app-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 500; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.app-tab { position: relative; flex: 1; min-width: 0; white-space: nowrap; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .6rem 0 .5rem; font-size: .68rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.app-tab svg { width: 21px; height: 21px; }
.app-tab.on { color: var(--gold); font-weight: 750; }
.app-badge { position: absolute; top: .3rem; left: calc(50% + 4px); min-width: 1.05rem; height: 1.05rem; border-radius: 999px; background: var(--red); color: #fff; font: 700 .62rem 'Instrument Sans', sans-serif; font-style: normal; align-items: center; justify-content: center; padding: 0 .25rem; }

/* ── TACTO DE APP ── */
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body.modo-app { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
body.modo-app input, body.modo-app textarea, body.modo-app select, body.modo-app [contenteditable] { -webkit-user-select: text; user-select: text; }
a, button, .b, .btn, .tab, .app-tab, .min { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:active, .b:active, .btn:active, .tab:active, .app-tab:active { transform: scale(.96); transition: transform .08s; }
.app-top { view-transition-name: app-top; }
.app-tabs { view-transition-name: app-tabs; }
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: .12s ease-out both vt-out; }
  ::view-transition-new(root) { animation: .18s ease-out both vt-in; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; } }
}

/* ── ANIMACIONES ── */
.sk { height: 118px; border-radius: 22px; background: linear-gradient(100deg, var(--surface2) 30%, var(--surface) 50%, var(--surface2) 70%); background-size: 220% 100%; animation: brillo 1.25s linear infinite; }
@keyframes brillo { to { background-position: -220% 0; } }
.app-tab::after { content: ''; position: absolute; top: 0; left: 32%; right: 32%; height: 3px; border-radius: 0 0 5px 5px; background: var(--gold); transform: scaleX(0); transition: transform .35s var(--ease); }
.app-tab.on::after { transform: scaleX(1); }
.app-tab svg { transition: transform .3s cubic-bezier(.2,1.5,.4,1); }
.app-tab.on svg { transform: translateY(-1px) scale(1.08); }
#ptr { position: fixed; left: 50%; top: calc(56px + env(safe-area-inset-top) + 8px); width: 38px; height: 38px; margin-left: -19px; border-radius: 50%; background: var(--surface); box-shadow: 0 6px 20px rgba(11,19,48,.2); display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(-40px); z-index: 450; pointer-events: none; color: var(--gold); }
#ptr svg { width: 20px; height: 20px; }
#ptr.gira svg { animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  @keyframes asoma { from { opacity: 0; transform: translateY(24px) scale(.965); } to { opacity: 1; transform: none; } }
  @keyframes sube { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes vista { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
  @keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.95); } to { opacity: 1; transform: none; } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
  @keyframes barrido { 0%, 62% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
  @keyframes latido { 0%, 100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(-6deg) scale(1.12); } }
  .modal-backdrop { animation: fadeIn .2s both; }
  .modal { animation: modalIn .34s cubic-bezier(.2, 1.15, .3, 1) both; }
  .toast, .live-toast { animation: toastIn .36s cubic-bezier(.2, 1.2, .3, 1) both; }
  .app-top .stone { animation: latido 2.6s ease-in-out .6s 2; }
  .vista.on { animation: vista .34s var(--ease) both; }
  .vista.on .hola, .vista.on .fecha { animation: sube .55s var(--ease) both; }
  .vista.on .fecha { animation-delay: .06s; }
  .proximo { position: relative; overflow: hidden; animation: asoma .7s var(--ease) .08s both; }
  .proximo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 38%, rgba(255,255,255,.26) 50%, transparent 62%); animation: barrido 5.5s ease-in-out 1.6s infinite; pointer-events: none; }
  .tarjetas .min { animation: asoma .65s var(--ease) both; animation-delay: calc(.2s + var(--i, 0) * .09s); }
  .tarjetas .min .pasa { transition: transform .3s var(--ease), background .2s; }
  .tarjetas .min:hover .pasa, .tarjetas .min:active .pasa { transform: translateX(3px); background: var(--gold); }
  .tarjetas .min:hover .pasa::before, .tarjetas .min:active .pasa::before { border-color: #fff; }
  .aviso { animation: asoma .5s var(--ease) both; animation-delay: calc(var(--i, 0) * .045s); }
  .aviso.nuevo h4::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: .5rem; border-radius: 50%; background: var(--gold); animation: latido 1.8s ease-in-out infinite; }
  .tarjetas.sin-anim .min, .sin-anim .proximo { animation: none; }
  /* entre pantallas: la nueva entra deslizando, las barras no se mueven */
  /* la pantalla vieja se queda opaca hasta que la nueva la cubre (si no, entre las dos se veía un destello blanco) */
  ::view-transition-group(root) { background: var(--bg); }
  ::view-transition-old(root) { animation: .3s ease-in both vt-fuera; }
  ::view-transition-new(root) { animation: .3s cubic-bezier(.2, .8, .2, 1) both vt-dentro; }
  @keyframes vt-fuera { to { transform: translateX(-10px); } }
  @keyframes vt-dentro { from { opacity: 0; transform: translateX(22px); } }
  /* turnos y listas del ministerio */
  #p-turnos .card, #p-equipo .card, #p-informes .table-wrap { animation: asoma .5s var(--ease) both; }
  #p-turnos .card:nth-of-type(2) { animation-delay: .05s; } #p-turnos .card:nth-of-type(3) { animation-delay: .1s; } #p-turnos .card:nth-of-type(4) { animation-delay: .15s; }
}

/* ── MÓVIL: pantallas de ministerios antiguas (Alabanza, repertorio, canciones, cultos…) ── */
@media (max-width: 640px) {
  body .min-page, body .rep-page, body .songs-page, body .equipo-page, body .cultos-page,
  body .oraciones-page, body .prog-page, body .admin-page { padding: calc(var(--nav-h) + 1.2rem) 1rem 3rem; }
  body .min-title, body .rep-title { font-size: 1.55rem; }
  body .min-sub, body .rep-sub { margin-bottom: 1.2rem; }

  body .tabs { margin: 0 -1rem 1rem; padding: 0 1rem; scroll-padding-inline: 1rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }   /* la primera pestaña empieza alineada con el contenido */
  body .tabs::-webkit-scrollbar { display: none; }
  body .tab-btn { padding: .85rem 1rem; font-size: .74rem; }
  body .subtabs { gap: .4rem; }
  body .subtab-btn { padding: .5rem .9rem; font-size: .76rem; }

  /* filas: el nombre ocupa su línea y los botones bajan debajo */
  body .row-item { flex-wrap: wrap; gap: .55rem .6rem; padding: .9rem 1rem; align-items: center; }
  body .row-item-main { flex: 1 1 100%; min-width: 0; }
  body .row-item > .song-row { flex: 1 1 100%; }
  body .row-item .btn { margin-left: 0 !important; padding: .5rem .95rem !important; font-size: .78rem !important; min-height: 38px; }
  body .song-order-btns { flex-direction: row; gap: .25rem; }
  body .song-order-btns button { font-size: .85rem; padding: .35rem .6rem; }

  body .top-row, body .roster-header { flex-direction: column; align-items: stretch; gap: .8rem; }
  body .top-row .rep-actions { width: 100%; }
  body .roster-header .form-field { min-width: 0 !important; width: 100%; }
  body .roster-header .btn { width: 100%; justify-content: center; }
  body .roster-grid { grid-template-columns: 1fr; }
  body .form-inline { flex-direction: column; align-items: stretch; }
  body .form-inline .form-field { min-width: 0; width: 100%; }
  body .mural-item { padding: .7rem .4rem; }
  body .comentarios-wrap .com-messages { padding: .8rem; max-height: 360px; }

  /* ventanas emergentes como hoja que sube desde abajo */
  body .modal-backdrop { align-items: flex-end; padding: 0; }
  body .modal { width: 100%; max-width: none; border-radius: 24px 24px 0 0; max-height: 90vh; padding: 1.4rem 1.2rem calc(1.4rem + env(safe-area-inset-bottom)); }
  body .modal-actions { gap: .6rem; } body .modal-actions .btn, body .modal-actions .b { flex: 1; justify-content: center; text-align: center; min-height: 44px; }
  /* en iPhone, letra de 16 px para que no haga zoom al escribir */
  input, select, textarea { font-size: 16px !important; }
  body .btn { min-height: 40px; }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  @keyframes hoja { from { transform: translateY(100%); } to { transform: none; } }
  body .modal { animation: hoja .38s cubic-bezier(.2, .9, .25, 1) both; }
}

/* En modo app la barra superior ya reserva el sitio: las páginas antiguas no deben añadirlo otra vez */
body.modo-app .min-page, body.modo-app .rep-page, body.modo-app .songs-page, body.modo-app .equipo-page,
body.modo-app .cultos-page, body.modo-app .oraciones-page, body.modo-app .prog-page, body.modo-app .admin-page { padding-top: 1.4rem; }
@media (max-width: 640px) {
  body.modo-app .min-page, body.modo-app .rep-page, body.modo-app .songs-page, body.modo-app .equipo-page,
  body.modo-app .cultos-page, body.modo-app .oraciones-page, body.modo-app .prog-page, body.modo-app .admin-page { padding-top: 1rem; }
  body .tab-btn { padding: .85rem .72rem; font-size: .7rem; letter-spacing: .03em; }
}
@media (max-width: 640px) {
  body .row-item > .song-row { flex: 1 1 100% !important; }
  body .tono-pill, body .tag { white-space: nowrap; flex-shrink: 0; }
  body .row-item > .song-row .row-item-main { flex: 1 1 0; }
}
/* La foto de perfil (25 px) es más alta que los iconos (21 px): se centra en una caja de 21 px para que «Cuenta» quede a la misma altura que las demás pestañas */
#tabCuentaIco { display: flex; align-items: center; justify-content: center; height: 21px; width: 21px; }

/* En modo oscuro el águila (granate) se aclara para que se vea */
:root[data-theme="dark"] .app-top .app-logo, :root[data-theme="dark"] .nav-logo .nav-aguila { filter: brightness(1.9) saturate(.95); }

/* ── Iconos (Lucide): un solo estilo en toda la app ── */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.24em; }
.i.llena { fill: currentColor; }
.i.chico { width: 1em; height: 1em; vertical-align: -.15em; }
.i.grande { width: 1.6em; height: 1.6em; }
/* pestaña activa: icono con relleno suave y trazo más firme (como las barras de iOS/Android) */
.app-tab .i { width: 21px; height: 21px; stroke-width: 1.8; transition: stroke-width .2s, fill .2s; }
.app-tab.on .i { stroke-width: 2.2; fill: color-mix(in srgb, currentColor 20%, transparent); }
.app-avisos .i { width: 19px; height: 19px; }
.nav-burger .i, .live-toast-close .i { width: 1.2em; height: 1.2em; }

/* Móvil girado: aviso que tapa la pantalla (la tablet nunca lo ve) */
.gira-aviso { display: none; }
@media (orientation: landscape) {
  html.es-movil .gira-aviso { position: fixed; inset: 0; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1.5rem; text-align: center; background: var(--bg, #FAF7F4); color: var(--text, #2A1417); }
  html.es-movil .gira-aviso b { font-family: var(--font-display, inherit); font-size: 1.25rem; } html.es-movil .gira-aviso span { color: var(--muted, #7A666A); }
}

/* El logo de arriba (Inicio) es un enlace a la web de la iglesia */
.app-top a.app-logo-link { display: inline-flex; align-items: center; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.app-top a.app-logo-link:active { opacity: .7; }
