/* css/style.css — todo el diseño del sitio, en un solo archivo.
   El color de marca NO está escrito acá: lo inyecta js/ui.js desde js/config.js
   en la variable --brand. Mobile-first: primero el celular, luego la compu. */

:root {
  --brand: #1a56a0; /* respaldo; config.js lo sobreescribe */
  --brand-oscuro: #133f78;
  --brand-claro: #e8eef7;

  --tinta: #16202e;
  --tinta-suave: #4b5768;
  --gris: #8a94a3;
  --linea: #e2e6ec;
  --fondo: #f6f8fb;
  --papel: #ffffff;

  --verde: #1e8e4a;
  --verde-fondo: #e7f5ec;
  --amarillo: #b57d05;
  --amarillo-fondo: #fdf3de;
  --rojo: #c3352b;
  --rojo-fondo: #fbeceb;

  --radio: 14px;
  --sombra: 0 1px 2px rgba(16, 32, 56, 0.06), 0 8px 24px rgba(16, 32, 56, 0.06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--tinta);
  background: var(--fondo);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--brand); }

.contenedor { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.1rem; }
.oculto { display: none !important; }
.nota { font-size: .85rem; color: var(--gris); margin: .35rem 0 0; }
.centrado { text-align: center; }

/* ------------------------------------------------------- Portada (landing) */
/* El marco azul lleva SOLO el logo. */
.hero {
  background:
    radial-gradient(110% 90% at 50% -20%, rgba(255, 255, 255, .17), rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, var(--brand) 0%, var(--brand-oscuro) 100%);
  color: #fff;
  padding: 2rem 0 2.1rem;
  text-align: center;
}
.hero-inner { text-align: center; }
.logo-grande {
  display: block;
  width: min(300px, 74vw);
  height: auto;
  margin: 0 auto;
}
.logo-texto-grande {
  display: block;
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em;
}
.hero-autor {
  margin: .7rem 0 0;
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .72);
}

/* Título del Learning Day: fuera del azul, sobre el fondo claro. */
.titulo-dia { padding: 1.8rem 0 1.3rem; text-align: center; }
.titulo-dia h1 {
  font-size: clamp(1.4rem, 5.5vw, 2.1rem);
  max-width: 24ch;
  margin: 0 auto .5rem;
  color: var(--tinta);
}
.bienvenida {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--tinta-suave);
  font-size: .98rem;
}

/* ---------------------------------------------------------------- Cabecera */
.cabecera {
  background: var(--brand);
  color: #fff;
  padding: 1.1rem 0 1.6rem;
}
.cabecera h1 { color: #fff; margin-top: .4rem; }
.cabecera .sub { color: rgba(255, 255, 255, .88); margin: 0; max-width: 60ch; }
.marca-fila { display: flex; align-items: center; gap: .6rem; }
/* El wordmark tiene dos líneas, así que necesita más alto que un logo de una línea. */
.logo { height: 40px; width: auto; display: block; }
.logo-texto {
  font-size: .78rem; letter-spacing: .09em; text-transform: uppercase;
  color: rgba(255, 255, 255, .82); font-weight: 600;
}
.volver {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--brand-claro); color: var(--brand);
  border: 1px solid transparent; border-radius: 99px;
  padding: .34rem .9rem; margin-bottom: 1rem;
  font-size: .84rem; font-weight: 600; text-decoration: none;
  transition: background .14s ease, border-color .14s ease;
}
.volver:hover, .volver:focus-visible { background: #fff; border-color: var(--brand); }

.barra-herramienta {
  background: var(--papel);
  border-bottom: 1px solid var(--linea);
  padding: .6rem 0;
}
.barra-herramienta .contenedor {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between;
}
.moneda { display: flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--tinta-suave); }
.moneda select {
  font: inherit; font-size: .9rem; padding: .35rem .5rem;
  border: 1px solid var(--linea); border-radius: 8px; background: #fff; color: var(--tinta);
}

/* ---------------------------------------------------------------- Contenido */
main { padding: 1.4rem 0 2.5rem; }
section { margin-bottom: 2rem; }

.tarjeta {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 1.1rem;
  box-shadow: var(--sombra);
  margin-bottom: 1rem;
}
.tarjeta > h2:first-child, .tarjeta > h3:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- Landing */
.landing main { padding: .9rem 0 0; }
.landing-grid { display: grid; gap: 2rem; padding-bottom: 3rem; }

.kicker {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .13em; color: var(--brand); margin: 0 0 .3rem;
}
.titulo-seccion { margin-bottom: 1rem; }
.titulo-seccion h2 { margin: 0 0 .25rem; font-size: 1.4rem; }
.sub-seccion { color: var(--tinta-suave); margin: 0; font-size: .96rem; }

/* Tarjetas de calculadora: ícono · texto · flecha */
.lista-calc { display: grid; gap: .9rem; }
.calc-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: 16px;
  padding: 1.15rem 1.2rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sombra);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.calc-card:hover, .calc-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: 0 2px 4px rgba(16, 32, 56, .08), 0 16px 34px rgba(16, 32, 56, .12);
}
.calc-card .icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--brand-claro); color: var(--brand);
  transition: background .14s ease, color .14s ease;
}
.calc-card:hover .icono { background: var(--brand); color: #fff; }
.calc-card h3 { margin: 0 0 .2rem; font-size: 1.12rem; }
.calc-card p { margin: 0; color: var(--tinta-suave); font-size: .93rem; }
.calc-card .flecha {
  font-size: 1.5rem; line-height: 1; color: var(--gris);
  transition: color .14s ease, transform .14s ease;
}
.calc-card:hover .flecha { color: var(--brand); transform: translateX(3px); }

/* Columna de artículos (derecha en compu, abajo en celular) */
.tarjeta-lateral {
  background: var(--papel);
  border: 1px solid var(--linea);
  border-radius: 16px;
  padding: 1.2rem 1.3rem;
  box-shadow: var(--sombra);
}
.tarjeta-lateral h2 { font-size: 1.1rem; margin: 0 0 .2rem; }
.articulos { list-style: none; margin: .6rem 0 0; padding: 0; }
.articulos li + li { border-top: 1px solid var(--linea); }
.articulos a {
  display: block; padding: .95rem 0; text-decoration: none; color: inherit;
}
.articulos a:hover h3, .articulos a:focus-visible h3 { color: var(--brand); }
.art-num {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  color: var(--brand); opacity: .55;
}
.articulos h3 { font-size: 1rem; margin: .2rem 0 .3rem; transition: color .12s ease; }
.articulos p { font-size: .9rem; color: var(--tinta-suave); margin: 0 0 .4rem; }
.art-link { font-size: .85rem; font-weight: 600; color: var(--brand); }
.pie-lateral { font-size: .82rem; color: var(--gris); margin: .9rem 0 0; }

/* Cómo funciona: tres pasos, debajo de las calculadoras */
.pasos {
  list-style: none; margin: 1.4rem 0 0; padding: 0;
  display: grid; gap: .55rem;
}
.pasos li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem;
  align-items: start;
  font-size: .92rem; color: var(--tinta-suave);
}
.pasos .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-claro); color: var(--brand);
  font-size: .78rem; font-weight: 700;
}

/* ------------------------------------------------------------- Newsletter */
.newsletter { border-top: 4px solid var(--brand); }
.newsletter h3 { margin-top: 0; }
.newsletter-texto { color: var(--tinta-suave); max-width: 55ch; }

/* Versión centrada de la landing: banda tenue + tarjeta al centro */
.banda-newsletter {
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, var(--brand) 0%, var(--brand-oscuro) 100%);
  padding: 2rem 0 2.2rem;
  color: #fff;
}
/* El texto va sobre el azul; el formulario, en su tarjeta blanca. */
.banda-newsletter .titulo-newsletter { text-align: center; max-width: 46ch; margin: 0 auto 1.1rem; }
.banda-newsletter .titulo-newsletter h2 { color: #fff; font-size: clamp(1.25rem, 3.4vw, 1.6rem); margin: 0 0 .4rem; }
.banda-newsletter .titulo-newsletter p { color: rgba(255, 255, 255, .86); margin: 0; font-size: .96rem; }
.newsletter-centrado {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  border-top: 0;
  border-radius: 18px;
  padding: .9rem 1.2rem .85rem;
  box-shadow: 0 12px 44px rgba(16, 32, 56, .12);
}
.newsletter-centrado h3 { font-size: 1.18rem; margin-bottom: .2rem; }
.newsletter-centrado .kicker { margin-bottom: .15rem; }
.newsletter-centrado .newsletter-texto { margin: 0 auto .55rem; max-width: 42ch; font-size: .93rem; }
.newsletter-centrado .newsletter-embed { display: flex; justify-content: center; }
.newsletter-centrado .fila-form { max-width: 420px; margin: 0 auto; }
.fila-form { display: flex; flex-direction: column; gap: .5rem; }
.fila-form input {
  font: inherit; padding: .7rem .8rem; border: 1px solid var(--linea);
  border-radius: 10px; background: #fff;
}
.newsletter-embed { margin-top: .8rem; }
/* !important gana sobre el borde que trae el iframe de Substack en su style. */
.newsletter-embed iframe {
  display: block; max-width: 100%; border-radius: 12px;
  border: 1px solid var(--linea) !important;
}

/* ------------------------------------------------------------------ Botones */
.boton {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; text-align: center; text-decoration: none;
  padding: .7rem 1.1rem; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; min-height: 46px;
}
.boton span { font-weight: 400; font-size: .8rem; opacity: .85; }
.boton.grande { padding: .9rem 1.4rem; font-size: 1.05rem; }
.boton-primario { background: var(--brand); color: #fff; }
.boton-primario:hover { background: var(--brand-oscuro); }
.boton-suave { background: #fff; color: var(--brand); border-color: var(--linea); }
.boton-suave:hover { border-color: var(--brand); }
.boton-texto { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: .4rem; }
.boton:disabled { opacity: .55; cursor: not-allowed; }
.acciones { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }

/* ------------------------------------------------------- Selector de modo */
.modo { background: var(--brand-claro); border: 1px solid #d6e0ef; border-radius: var(--radio); padding: 1rem; margin-bottom: 1.2rem; }
.modo-pregunta { font-weight: 600; margin-bottom: .6rem; }
.modo-botones { display: grid; gap: .6rem; grid-template-columns: 1fr; }

/* -------------------------------------------------------------- Formulario */
.grupo { border: 0; padding: 0; margin: 0 0 1.4rem; }
.grupo legend {
  padding: 0; font-weight: 700; font-size: 1.05rem; margin-bottom: .2rem; color: var(--tinta);
}
.campo { margin-bottom: 1.1rem; }
.campo label {
  display: flex; align-items: flex-start; gap: .4rem;
  font-weight: 600; font-size: .96rem; margin-bottom: .35rem;
}
.opcional { font-weight: 400; color: var(--gris); }
.ayuda-btn {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--brand); background: #fff; color: var(--brand);
  font-size: .8rem; font-weight: 700; line-height: 1; cursor: pointer;
}
.ayuda-btn[aria-expanded="true"] { background: var(--brand); color: #fff; }
.ayuda {
  background: var(--brand-claro); border-radius: 10px; padding: .65rem .8rem;
  font-size: .9rem; color: var(--tinta-suave); margin-bottom: .45rem;
}
.ayuda strong { color: var(--tinta); }

.input-wrap { display: flex; align-items: stretch; }
.input-wrap input, .input-wrap select {
  font: inherit; width: 100%; padding: .7rem .8rem;
  border: 1px solid var(--linea); border-radius: 10px; background: #fff; color: var(--tinta);
  min-height: 46px;
}
.input-wrap input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.input-wrap input.error { border-color: var(--rojo); background: var(--rojo-fondo); }
.input-wrap.grande input { font-size: 1.35rem; font-weight: 600; padding: .85rem .9rem; }
.prefijo, .sufijo {
  display: flex; align-items: center; padding: 0 .7rem;
  background: #f1f4f8; border: 1px solid var(--linea); color: var(--tinta-suave);
  font-size: .95rem; white-space: nowrap;
}
.prefijo { border-right: 0; border-radius: 10px 0 0 10px; }
.sufijo { border-left: 0; border-radius: 0 10px 10px 0; }
.con-prefijo input { border-radius: 0 10px 10px 0; }
.con-sufijo input { border-radius: 10px 0 0 10px; }
.con-prefijo.con-sufijo input { border-radius: 0; }

.ejemplo { font-size: .82rem; color: var(--gris); margin: .3rem 0 0; }
.omitir {
  background: none; border: 0; color: var(--brand); font: inherit; font-size: .85rem;
  padding: .3rem 0; cursor: pointer; text-decoration: underline;
}

/* ------------------------------------------------------------ Modo guiado */
.guiado-caja {
  background: var(--papel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 1.3rem; box-shadow: var(--sombra);
}
.progreso { height: 8px; background: #eceff4; border-radius: 99px; overflow: hidden; }
.progreso-barra { height: 100%; background: var(--brand); border-radius: 99px; transition: width .25s ease; }
.progreso-texto { font-size: .85rem; color: var(--gris); margin: .45rem 0 .9rem; }
.guiado-caja h3 { font-size: 1.3rem; margin-bottom: .5rem; }
.guiado-ayuda { color: var(--tinta-suave); font-size: .95rem; margin-bottom: 1rem; }
.guiado-botones { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.guiado-botones .boton-primario { flex: 1 1 100%; }

/* ------------------------------------------------------------- Resultados */
.resultado-vacio { color: var(--gris); text-align: center; padding: 2rem 1rem; }

.destacado {
  background: var(--brand); color: #fff; border-radius: var(--radio);
  padding: 1.1rem; margin-bottom: 1rem;
}
.destacado .etiqueta { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; margin: 0; }
.destacado .valor { font-size: 2rem; font-weight: 700; line-height: 1.1; margin: .1rem 0 .2rem; }
.destacado .explica { margin: 0; font-size: .92rem; opacity: .92; }

.kpis { display: grid; gap: .7rem; grid-template-columns: 1fr 1fr; margin-bottom: 1rem; }
.kpi {
  background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; padding: .8rem;
}
.kpi .etiqueta { font-size: .8rem; color: var(--gris); margin: 0; }
.kpi .valor { font-size: 1.25rem; font-weight: 700; margin: .1rem 0 0; }

.ratios { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.ratio { background: var(--papel); border: 1px solid var(--linea); border-radius: 12px; padding: .9rem 1rem; }
.ratio-nombre { font-weight: 600; font-size: .95rem; margin: 0; }
.ratio-valor { font-size: 1.7rem; font-weight: 700; color: var(--brand); margin: .1rem 0 .2rem; line-height: 1.1; }
.ratio-formula { font-size: .82rem; color: var(--gris); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0 0 .4rem; }
.ratio-significa { font-size: .92rem; color: var(--tinta-suave); margin: 0 0 .4rem; }

.semaforo {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .9rem; border-radius: 10px; padding: .5rem .7rem; margin: .4rem 0 0;
}
.semaforo .punto { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; margin-top: .35rem; }
.semaforo.verde { background: var(--verde-fondo); color: #14532d; }
.semaforo.verde .punto { background: var(--verde); }
.semaforo.amarillo { background: var(--amarillo-fondo); color: #6b4c00; }
.semaforo.amarillo .punto { background: var(--amarillo); }
.semaforo.rojo { background: var(--rojo-fondo); color: #7f1d1d; }
.semaforo.rojo .punto { background: var(--rojo); }

.benchmark { margin-top: .6rem; }
.benchmark label { display: block; font-size: .82rem; color: var(--gris); margin-bottom: .2rem; }
.benchmark input {
  font: inherit; font-size: .9rem; width: 100%; padding: .45rem .6rem;
  border: 1px solid var(--linea); border-radius: 8px;
}

/* ------------------------------------------------------------------ Tablas */
.tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1.1rem; padding: 0 1.1rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
caption { text-align: left; font-size: .85rem; color: var(--gris); padding-bottom: .4rem; }
th, td { text-align: right; padding: .6rem .55rem; border-bottom: 1px solid var(--linea); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); border-bottom: 2px solid var(--linea); }
td input {
  font: inherit; font-size: .88rem; width: 118px; text-align: right;
  padding: .38rem .5rem; border: 1px solid var(--linea); border-radius: 8px; background: #fff;
}
td input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.delta {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: .05rem .35rem; border-radius: 6px; margin-left: .35rem; white-space: nowrap;
}
.delta.mejor { background: var(--verde-fondo); color: #14532d; }
.delta.peor { background: var(--rojo-fondo); color: #7f1d1d; }
.delta.igual { background: #eef1f5; color: var(--gris); }

.cab-periodo {
  font: inherit; font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--tinta-suave); text-align: center;
  width: 120px; padding: .28rem .2rem; background: transparent;
  border: 1px dashed var(--linea); border-radius: 7px;
}
.cab-periodo:hover { background: #fff; border-color: var(--brand); }
.cab-periodo:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: #fff; }
.copiar-col {
  display: block; margin: .2rem auto 0; background: none; border: 0;
  color: var(--brand); font: inherit; font-size: .7rem; text-transform: none;
  letter-spacing: 0; cursor: pointer; text-decoration: underline;
}
.selector-periodo {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem;
  margin: .3rem 0 .9rem;
}
.selector-etiqueta { font-size: .9rem; font-weight: 600; color: var(--tinta-suave); }
.selector-botones { display: inline-flex; background: #eef1f5; border-radius: 10px; padding: 3px; gap: 2px; }
.selector-botones button {
  font: inherit; font-size: .86rem; font-weight: 600;
  border: 0; background: transparent; color: var(--tinta-suave);
  padding: .4rem .85rem; border-radius: 8px; cursor: pointer;
}
.selector-botones button.activo {
  background: #fff; color: var(--brand);
  box-shadow: 0 1px 2px rgba(16, 32, 56, .12);
}

.aviso-como {
  background: var(--brand-claro); border-radius: 10px; padding: .7rem .85rem;
  font-size: .9rem; color: var(--tinta-suave); margin: .6rem 0 .9rem;
}
.aviso-como strong { color: var(--tinta); }

tbody tr.calculada { background: #f8fafc; }
tbody tr.calculada td { font-weight: 600; }
tbody tr.destacada { background: var(--verde-fondo); }
tbody tr.destacada td:first-child { font-weight: 700; color: #14532d; }
.pos { color: var(--verde); font-weight: 600; }
.neg { color: var(--rojo); font-weight: 600; }
.rank { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center;
  background: var(--brand-claro); color: var(--brand); border-radius: 50%; font-size: .78rem; font-weight: 700; margin-right: .4rem; }

/* ----------------------------------------------------------------- Palancas */
.palanca { border-bottom: 1px solid var(--linea); padding: .8rem 0; }
.palanca:last-child { border-bottom: 0; }
.palanca-cabeza { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; }
.palanca-nombre { font-weight: 600; font-size: .96rem; }
.palanca-valor { font-weight: 700; color: var(--brand); white-space: nowrap; }
.palanca input[type="range"] { width: 100%; accent-color: var(--brand); margin: .5rem 0 .2rem; }
.palanca-pie { display: flex; justify-content: space-between; font-size: .82rem; color: var(--gris); }

.grafico-caja { position: relative; height: 300px; }

/* ----------------------------------------------- Línea de tiempo del CCC */
.ccc-linea { display: grid; grid-template-columns: 1fr; gap: .2rem; margin-bottom: .7rem; }
.ccc-etiqueta { font-size: .9rem; color: var(--tinta-suave); }
.ccc-barra { display: block; height: 12px; border-radius: 99px; background: var(--brand); min-width: 6px; }
.ccc-barra.resta { background: var(--verde); }
.ccc-dias { font-size: .88rem; font-weight: 600; }
.ccc-total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 2px solid var(--linea); margin-top: .8rem; padding-top: .7rem;
}
.ccc-total strong { font-size: 1.3rem; color: var(--brand); }

/* ------------------------------------------- Escala de crecimiento (SFG) */
.escala { padding: 2.2rem 0 1.6rem; }
.escala-barra { position: relative; display: flex; height: 30px; border-radius: 8px; overflow: visible; }
.escala-seg {
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; white-space: nowrap; overflow: hidden;
}
.escala-seg.s0 { background: #9aa7b8; border-radius: 8px 0 0 8px; }
.escala-seg.s1 { background: #5b8fd4; }
.escala-seg.s2 { background: var(--brand); }
.escala-seg.s3 { background: var(--brand-oscuro); }
.escala-seg.s4 { background: #0d2b52; border-radius: 0 8px 8px 0; }
.escala-marca { position: absolute; top: -1.6rem; transform: translateX(-50%); }
.escala-marca::after {
  content: ""; display: block; width: 2px; height: 42px; margin: 0 auto; background: var(--tinta);
}
.escala-marca em {
  display: block; font-style: normal; font-size: .74rem; font-weight: 700;
  background: var(--tinta); color: #fff; padding: .1rem .4rem; border-radius: 5px; white-space: nowrap;
}
.escala-marca.meta::after { background: var(--rojo); }
.escala-marca.meta em { background: var(--rojo); }

tbody tr.en-rojo { background: var(--rojo-fondo); }

/* --------------------------------------------------------------- Glide path */
.glide { display: grid; gap: .6rem; }
.glide-fila { display: grid; grid-template-columns: 1fr; gap: .3rem; padding: .6rem 0; border-bottom: 1px solid var(--linea); }

/* -------------------------------------------------------------------- Footer */
/* Pie compacto: dos líneas, sin logo. */
.pie {
  background: #fff; border-top: 1px solid var(--linea);
  padding: .45rem 0 .55rem; margin-top: 0;
}
.pie .firma { margin: 0 0 .1rem; color: var(--tinta); font-size: .88rem; }
.pie .legal { font-size: .72rem; color: var(--gris); margin: 0; line-height: 1.35; }

.landing .pie { text-align: center; }

.bloqueado { padding: 4rem 1rem; text-align: center; }

/* ---------------------------------------------------------------- Exportar */
.aviso-pdf {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  background: var(--tinta); color: #fff; padding: .6rem 1rem; border-radius: 99px;
  font-size: .9rem; z-index: 50;
}
body.exportando .no-pdf { display: none !important; }
body.exportando .tabla-scroll { overflow: visible; }

.aparece { animation: aparece .35s ease both; }
@keyframes aparece { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* =================================================================
   Compu: inputs a la izquierda, resultados a la derecha (spec 5)
   ================================================================= */
@media (min-width: 720px) {
  body { font-size: 17px; }
  h1 { font-size: 2rem; }
  .hero { padding: 3.4rem 0 3.8rem; }
  .logo-grande { width: min(400px, 56vw); margin-bottom: 1.9rem; }
  .rejilla { grid-template-columns: repeat(3, 1fr); }
  .calc-card { padding: 1.35rem 1.5rem; gap: 1.2rem; }
  .calc-card .icono { width: 56px; height: 56px; }
  .calc-card h3 { font-size: 1.2rem; }
  .newsletter-centrado { padding: 2.6rem 2.4rem 2.3rem; }
  .modo-botones { grid-template-columns: 1fr 1fr; }
  .fila-form { flex-direction: row; }
  .fila-form input { flex: 1; }
  .ratios { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .guiado-botones .boton-primario { flex: 0 0 auto; margin-left: auto; }
  .logo { height: 48px; }
  .glide-fila { grid-template-columns: 1.6fr repeat(5, 1fr); align-items: center; }
}

@media (min-width: 960px) {
  .layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 1.6rem; align-items: start; }
  .layout .columna-inputs { position: sticky; top: 1rem; }
  .cabecera { padding: 1.4rem 0 2rem; }

  /* Landing: calculadoras a la izquierda, artículos en columna a la derecha. */
  .landing-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 2.2rem;
    align-items: start;
    padding-bottom: 3.5rem;
  }
  .columna-lateral { position: sticky; top: 1.5rem; }
}

@media print {
  body { background: #fff; }
  .no-pdf, .cabecera, .barra-herramienta { display: none !important; }
}
