/* Tono Firme · app unificada. Misma paleta que el plan de 28 dias (papel calido, terracota, verde agua). */
:root {
  --bg: #FBF6EF; --card: #FFFFFF; --ink: #1F2A2E; --muted: #5E6A6D; --line: #E9DFD2;
  --accent: #C8553D; --accent-soft: #F6E2DB; --teal: #2F6F66; --teal-soft: #DDEDEA;
  --lock: #6B6157; --lock-soft: #EFE8DF;
  --shadow: 0 1px 2px rgba(31,42,46,.06), 0 6px 18px rgba(31,42,46,.07);
  --shadow-up: 0 2px 4px rgba(31,42,46,.08), 0 14px 30px rgba(31,42,46,.12);
  --r: 18px; --r-s: 12px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --barra: 56px;
  --nav: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171C1E; --card: #21282B; --ink: #EEF0EE; --muted: #A7B1B2; --line: #323B3E;
    --accent: #E58A72; --accent-soft: #3A2A25; --teal: #7FC1B6; --teal-soft: #1F3330;
    --lock: #B8AEA3; --lock-soft: #2B2724; --shadow: none; --shadow-up: none;
  }
}
:root[data-theme="dark"] {
  --bg: #171C1E; --card: #21282B; --ink: #EEF0EE; --muted: #A7B1B2; --line: #323B3E;
  --accent: #E58A72; --accent-soft: #3A2A25; --teal: #7FC1B6; --teal-soft: #1F3330;
  --lock: #B8AEA3; --lock-soft: #2B2724; --shadow: none; --shadow-up: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-text-size-adjust: 100%; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0; overflow-wrap: anywhere; }
h1 { font-size: 28px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
p { margin: 0; }
.muted { color: var(--muted); }
.cargando { padding: 40px 16px; text-align: center; color: var(--muted); }
.raiz { min-height: 100vh; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

/* ---------- estructura ---------- */
.pagina { max-width: 1040px; margin: 0 auto; padding: 0 16px calc(var(--nav) + 28px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); display: flex; align-items: center; gap: 10px;
  min-height: var(--barra); border-bottom: 1px solid var(--line); padding: 0 16px; padding-top: env(safe-area-inset-top); }
.top-in { max-width: 1040px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 10px; }
.marca { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 6px 0; flex: 1; min-width: 0; text-align: left; }
.marca svg { flex: none; }
.marca b { font: 700 13px/1 var(--sans); letter-spacing: .28em; text-transform: uppercase; color: var(--teal); }
.chip-modo { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border-radius: 999px;
  padding: 4px 10px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.volver { border: 0; background: none; font-weight: 700; padding: 8px 4px; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.nav-in { max-width: 560px; margin: 0 auto; display: flex; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px 8px; text-decoration: none;
  font-size: 12px; font-weight: 700; color: var(--muted); min-height: var(--nav); justify-content: center; }
.nav a svg { width: 24px; height: 24px; }
.nav a[aria-current="page"] { color: var(--accent); }

/* ---------- piezas comunes ---------- */
.seccion { margin-top: 28px; }
.seccion > h2 { margin-bottom: 4px; }
.seccion > .muted { margin-bottom: 14px; font-size: 15px; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 10px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 14px; padding: 14px 16px;
  font-weight: 800; font-size: 16px; min-height: 52px; text-decoration: none; text-align: center; transition: transform .12s ease, box-shadow .12s ease; }
.btn:active { transform: translateY(1px) scale(.995); }
.btn-primario { background: var(--ink); color: var(--bg); }
.btn-acento { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(200,85,61,.28); }
.btn-suave { background: var(--teal-soft); color: var(--teal); }
.btn-linea { background: transparent; border: 1.5px solid var(--line); }
.btn-chico { min-height: 40px; padding: 8px 14px; font-size: 14px; width: auto; border-radius: 10px; }
.fila-btn { display: flex; gap: 8px; flex-wrap: wrap; }
.aviso { position: fixed; left: 50%; bottom: calc(var(--nav) + 18px); transform: translateX(-50%); z-index: 30; background: var(--ink); color: var(--bg);
  padding: 12px 16px; border-radius: 12px; font-weight: 700; max-width: calc(100% - 32px); box-shadow: var(--shadow-up); }

/* ---------- inicio ---------- */
.saludo { margin-top: 22px; }
.saludo h1 { font-size: 30px; }
.hoy { position: relative; overflow: hidden; margin-top: 16px; padding: 22px 20px; border-radius: 22px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-up); }
.hoy::after { content: ""; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: .9; }
.hoy > * { position: relative; z-index: 1; }
.hoy .kicker { color: #F6C9BC; }
.hoy h2 { font-size: 25px; margin: 6px 0 4px; max-width: 85%; }
.hoy .btn { margin-top: 16px; background: var(--bg); color: var(--ink); }
.barra-prog { height: 8px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; margin-top: 14px; }
.barra-prog i { display: block; height: 100%; background: #F6C9BC; border-radius: 99px; }
.datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.dato { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: left; box-shadow: var(--shadow); }
.dato b { display: block; font: 700 26px/1.1 var(--serif); }
.dato span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.termo { margin-top: 14px; display: grid; grid-template-columns: 1fr; gap: 12px; }
.termo-valor { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.termo-valor b { font: 700 40px/1 var(--serif); color: var(--teal); }
.termo svg { width: 100%; height: 90px; display: block; }
.mini-lista { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.mini { flex: 0 0 132px; scroll-snap-align: start; text-decoration: none; }
.mini img { border-radius: 14px; aspect-ratio: 1; object-fit: cover; box-shadow: var(--shadow); }
.mini span { display: block; font-size: 13.5px; font-weight: 700; margin-top: 6px; line-height: 1.25; }

/* ---------- catalogo ---------- */
.grilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 720px) { .grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .grilla { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tarjeta { position: relative; display: flex; flex-direction: column; text-decoration: none; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.tarjeta:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
.tarjeta .tapa { position: relative; aspect-ratio: 1; background: var(--c2, var(--line)); }
.tarjeta .tapa img { width: 100%; height: 100%; object-fit: cover; }
.tarjeta .cuerpo { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.tarjeta .etq { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--c, var(--teal)); }
.tarjeta h3 { font-size: 16px; }
.tarjeta .estado { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.tarjeta .estado svg { width: 16px; height: 16px; flex: none; }
.tarjeta .estado.abierta { color: var(--teal); }
.tarjeta .estado.cerrada { color: var(--lock); }
.tarjeta.bloqueada .tapa img { filter: saturate(.35) brightness(.92); }
.candado { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; background: rgba(31,42,46,.82); color: #fff;
  display: flex; align-items: center; justify-content: center; }
.candado svg { width: 18px; height: 18px; }

/* ---------- pieza ---------- */
.cabeza { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
@media (min-width: 720px) { .cabeza { grid-template-columns: 300px 1fr; align-items: start; gap: 28px; } }
.cabeza .tapa { position: relative; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-up); max-width: 260px; }
.cabeza .tapa img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.cabeza .tapa.bloqueada img { filter: saturate(.35) brightness(.9); }
.cabeza .tapa .candado { width: 46px; height: 46px; right: 12px; top: 12px; }
.cabeza h1 { margin-top: 4px; }
.cabeza .bajada { color: var(--muted); font-size: 16.5px; margin-top: 6px; }
.lista-archivos { display: flex; flex-direction: column; gap: 10px; }
.archivo { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; flex-wrap: wrap; }
.archivo .ico { flex: none; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--c2, var(--teal-soft)); color: var(--c, var(--teal)); }
.archivo .ico svg { width: 22px; height: 22px; }
.archivo .txt { flex: 1; min-width: 150px; }
.archivo .txt b { display: block; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.archivo .txt span { font-size: 13px; color: var(--muted); }
.audio { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.audio b { display: block; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.audio span { font-size: 13px; color: var(--muted); }
.audio audio { width: 100%; margin-top: 8px; height: 40px; }
.galeria { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .galeria { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.galeria a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.galeria img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.trae { margin: 0; padding: 0; list-style: none; }
.trae li { position: relative; padding-left: 28px; margin: 8px 0; }
.trae li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--teal)); }
.muestra { border-left: 5px solid var(--c, var(--teal)); background: var(--c2, var(--teal-soft)); border-radius: 12px; padding: 14px 16px; color: #1F2A2E; }
.muestra .t { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #4b575a; }
.muestra .f { font-family: var(--serif); font-size: 19px; line-height: 1.3; margin: 6px 0; }
.muestra p { font-size: 15px; }
.comprar { margin-top: 22px; background: var(--card);
  border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow-up); }
.comprar .precio { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.comprar .precio b { font: 700 24px/1 var(--serif); }
.comprar small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.sello { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 800; }
.sello.abierta { background: var(--teal-soft); color: var(--teal); }
.sello.cerrada { background: var(--lock-soft); color: var(--lock); }
.sello svg { width: 15px; height: 15px; }

/* ---------- modulo a pantalla completa ---------- */
.modo-modulo { overflow: hidden; }
.barra-modulo { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--barra); background: var(--bg); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.barra-modulo b { font-family: var(--serif); font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marco { position: fixed; top: var(--barra); left: 0; right: 0; bottom: 0; width: 100%; height: calc(100% - var(--barra)); border: 0; background: var(--bg); }

/* ---------- cuenta y panel ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo input { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); min-height: 50px; width: 100%; }
.interruptor { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.interruptor:last-child { border-bottom: 0; }
.interruptor input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.interruptor .txt { flex: 1; min-width: 0; }
.interruptor .txt b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.interruptor .txt span { font-size: 13px; color: var(--muted); }
.lineas li { margin: 6px 0; }
.legal { font-size: 14px; color: var(--muted); }
.volver svg { width: 20px; height: 20px; flex: none; }
