/* Esmalte · el marco: lo que rodea a todas las pantallas.
   Encabezado, barra de abajo, tarjetas y el ancho de la hoja. */

.contenido {
  max-width: 620px;
  margin: 0 auto;
  padding: 1rem 1.05rem calc(var(--alto-nav) + 2rem);
}

/* --- Encabezado ---------------------------------------------------------- */

.encabezado {
  background: var(--marca);
  color: #fff;
  padding: .85rem 1.05rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.encabezado a, .encabezado h1 { color: #fff; }
.encabezado .logo {
  width: 40px; height: 40px; border-radius: 13px;
  object-fit: cover; background: rgba(255,255,255,.18); flex: none;
}
.encabezado .logo.iniciales {
  display: flex; align-items: center; justify-content: center;
  font-family: Fraunces, Georgia, serif;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  border: 1px solid rgba(255,255,255,.28);
}
.encabezado .titulo { flex: 1; min-width: 0; }
.encabezado .titulo strong {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.06rem;
  line-height: 1.2;
}
.encabezado .titulo span { font-size: .78rem; opacity: .82; }
.encabezado .engranaje {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.14);
  transition: background var(--suave);
}
.encabezado .engranaje:hover { background: rgba(255,255,255,.26); text-decoration: none; }

/* --- Barra de abajo ------------------------------------------------------- */

.nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--alto-nav);
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(1.5) blur(12px);
  border-top: 1px solid var(--borde);
  display: flex;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .66rem;
  font-weight: 600;
  color: var(--gris);
  text-decoration: none;
  position: relative;
  isolation: isolate;
  transition: color var(--suave);
}
.nav a .ico { width: 22px; height: 22px; }
.nav a.activo { color: var(--marca); }
.nav a.activo::before {
  content: "";
  position: absolute;
  top: 6px;
  width: 44px; height: 30px;
  border-radius: 999px;
  background: var(--marca-suave);
  z-index: -1;
}
.nav a:hover { text-decoration: none; color: var(--marca); }

/* --- Tarjetas y acomodo --------------------------------------------------- */

.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 1.05rem 1.1rem;
  margin-bottom: .85rem;
  box-shadow: var(--sombra);
}
.tarjeta.destacada {
  border-color: var(--marca-media);
  background: linear-gradient(180deg, var(--marca-suave) 0%, var(--tarjeta) 62%);
}
.tarjeta .encima { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }

.fila { display: flex; gap: .6rem; align-items: center; }
.fila.separada { justify-content: space-between; }
.fila.envuelve { flex-wrap: wrap; }
.crece { flex: 1; min-width: 0; }
.centro { text-align: center; }
/* Un link suelto tiene que ser tocable, no una rayita de 19 píxeles. */
p.centro a, .chico a { display: inline-block; padding: .55rem .25rem; }
.vacio { text-align: center; color: var(--gris); padding: 2.2rem 1rem; }
.vacio .grande { font-size: 2.6rem; display: block; margin-bottom: .6rem; line-height: 1; }
.vacio h1, .vacio h2 { color: var(--tinta); }

details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid var(--gris);
  border-bottom: 2px solid var(--gris);
  transform: rotate(45deg);
  transition: transform var(--suave);
  flex: none;
}
details[open] > summary::after { transform: rotate(-135deg); }

/* --- Pantallas grandes ---------------------------------------------------- */

@media (min-width: 760px) {
  .contenido { padding: 1.6rem 1.5rem 3rem; max-width: 720px; }
  .nav {
    position: sticky;
    top: 0;
    height: auto;
    border-top: none;
    border-bottom: 1px solid var(--borde);
    max-width: 720px;
    margin: 0 auto;
    border-radius: 0 0 var(--radio) var(--radio);
  }
  .nav a { flex-direction: row; gap: .45rem; font-size: .88rem; padding: .85rem .5rem; }
  .nav a.activo::before { top: 50%; transform: translateY(-50%); width: 100%; height: 38px; }
  .encabezado { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .nav, .acciones, .boton, .encabezado { display: none; }
  body { background: #fff; }
}
