:root {
  --fondo: #F3F5F4;
  --superficie: #FFFFFF;
  --tinta: #13232B;
  --sutil: #4A5A61;
  --linea: #D5DDDC;
  --borde: #B9C6C5;
  --acento: #0B5F69;
  --acento-oscuro: #08464E;
  --nota: #EEF3F3;
  --bien-fondo: #E2F2E8; --bien-tinta: #145233; --bien-barra: #2E9960;
  --atento-fondo: #FDF1D6; --atento-tinta: #6B4600; --atento-barra: #E0A21B;
  --mal-fondo: #FBE4E2; --mal-tinta: #8C1D17; --mal-barra: #C9372C;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  height: 100dvh;
  background: #DCE3E2;
  color: var(--tinta);
  font: 16px/1.4 'Atkinson Hyperlegible', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

button, input { font: inherit; color: inherit; }
a { color: var(--acento); }

.aviso-prototipo {
  flex: none;
  width: 100%;
  padding: 8px 16px;
  background: var(--tinta);
  color: #FFFFFF;
  font-size: 13px;
  text-align: center;
}

.telefono {
  width: 100%;
  max-width: 430px;
  flex: 1;
  min-height: 0;
  background: var(--fondo);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 600px) {
  body { height: auto; min-height: 100vh; padding-bottom: 24px; }
  .telefono { flex: none; margin-top: 24px; border-radius: 24px; border: 1px solid var(--borde); box-shadow: 0 12px 32px rgba(19, 35, 43, .12); height: 844px; }
}

.pantalla { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.cabecera {
  padding: 20px 20px 16px;
  background: var(--superficie);
  border-bottom: 1px solid var(--linea);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cuerpo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* Sin esto, los bloques se encogen y se recortan en vez de que la pantalla haga scroll. */
.cuerpo > * { flex-shrink: 0; }

.fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pila { display: flex; flex-direction: column; gap: 8px; }
.pila-14 { display: flex; flex-direction: column; gap: 14px; }
.pila-6 { display: flex; flex-direction: column; gap: 6px; }
.grilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.titulo { margin: 0; font: 700 22px/1.2 'Bricolage Grotesque', sans-serif; }
.titulo-sm { margin: 0; font: 700 20px/1.2 'Bricolage Grotesque', sans-serif; }
.subtitulo { margin: 0; font: 700 18px/1.2 'Bricolage Grotesque', sans-serif; }
.sutil { margin: 0; color: var(--sutil); font-size: 14px; }
.chico { font-size: 14px; }
.negrita { font-weight: 700; }

fieldset { border: 0; margin: 0; padding: 0; }
legend { padding: 0; margin-bottom: 8px; }

.opcion {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--borde);
  background: var(--superficie);
  cursor: pointer;
}
.opcion.activa { border: 2px solid var(--acento); background: var(--acento); color: #FFFFFF; font-weight: 700; }

.campo { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.campo input {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  background: var(--superficie);
  font-weight: 400;
  width: 100%;
}
.campo input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }

.foto {
  min-height: 48px;
  border-radius: 10px;
  border: 1px dashed var(--sutil);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.foto.lista { border: 1px solid var(--bien-tinta); background: var(--bien-fondo); color: var(--bien-tinta); }

.error { margin: 0; color: #B3261E; font-weight: 700; }

.primario, .secundario {
  min-height: 56px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
}
.primario { border: 0; background: var(--acento); color: #FFFFFF; }
.primario:hover { background: var(--acento-oscuro); }
.secundario { border: 1px solid var(--acento); background: var(--superficie); color: var(--acento); font-size: 16px; min-height: 52px; }

.lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lista li {
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pildora, .pildora-boton {
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  align-self: flex-start;
}
.pildora-boton { min-height: 44px; padding: 0 14px; font-size: 14px; cursor: pointer; align-self: center; }
.bien { background: var(--bien-fondo); color: var(--bien-tinta); border: 1px solid var(--bien-tinta); }
.atento { background: var(--atento-fondo); color: var(--atento-tinta); border: 1px solid var(--atento-tinta); }
.mal { background: var(--mal-fondo); color: var(--mal-tinta); border: 1px solid var(--mal-tinta); }
.pildora.bien, .pildora.atento, .pildora.mal { border: 0; }

.tarjeta {
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: 14px;
  padding: 18px;
}

.porcentaje { display: flex; align-items: baseline; gap: 10px; }
.numero { font: 700 52px/1 'Bricolage Grotesque', sans-serif; white-space: nowrap; flex: none; }

.barra { position: relative; height: 14px; background: #E4EAE9; border-radius: 999px; overflow: hidden; }
.relleno { height: 100%; border-radius: 999px; transition: width .3s; }
.marca { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--tinta); }
.escala { position: relative; height: 16px; font-size: 12px; color: var(--sutil); }
.escala span { position: absolute; transform: translateX(-50%); }
.escala span:first-child { transform: none; }

.desglose { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; font-size: 15px; }
.desglose dt { color: var(--sutil); }
.desglose dd { margin: 0; text-align: right; font-weight: 700; }

.nota { margin: 0; padding: 12px; border-radius: 10px; background: var(--nota); font-size: 15px; }

.centro {
  min-height: 56px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--linea);
  background: var(--superficie);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
}
.centro[aria-pressed="true"] { border: 2px solid var(--acento); }
.centro .lado { display: flex; align-items: center; gap: 8px; }

.tabla { list-style: none; margin: 0; padding: 0; background: var(--superficie); border: 1px solid var(--linea); border-radius: 14px; overflow: hidden; }
.tabla li { padding: 12px 14px; border-bottom: 1px solid #E4EAE9; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tabla li:last-child { border-bottom: 0; }
.tabla .valor { font-weight: 700; font-size: 18px; }
.copiar { min-height: 44px; min-width: 88px; border-radius: 10px; border: 1px solid var(--acento); background: var(--superficie); color: var(--acento); font-weight: 700; cursor: pointer; }
.copiado { min-width: 88px; text-align: center; font-weight: 700; color: var(--bien-tinta); }

.navegacion { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--superficie); border-top: 1px solid var(--linea); }
.navegacion a {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--sutil);
  border-top: 3px solid transparent;
}
.navegacion a[aria-current="page"] { color: var(--acento); font-weight: 700; border-top-color: var(--acento); }

.comentar {
  flex: none;
  margin: 12px 16px;
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--superficie);
  border: 1px solid var(--acento);
  font-weight: 700;
  text-decoration: none;
}

/* Notas del prototipo: explican cómo funcionará cada pieza en la app real. */
.con-nota { display: flex; align-items: center; gap: 4px; }
.con-nota.ancho > :first-child { flex: 1; min-width: 0; }
.marca-nota {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -10px -6px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.marca-nota span, .i-muestra {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px dashed #7A3E9D;
  color: #5E2A7E;
  background: #F4ECF8;
  font: 700 13px/18px 'Atkinson Hyperlegible', system-ui, sans-serif;
  text-align: center;
  font-style: italic;
}
.i-muestra { display: inline-block; width: 18px; height: 18px; line-height: 14px; font-size: 11px; vertical-align: middle; }
.con-nota.ancho .marca-nota { margin: 0 -8px 0 -4px; }

dialog {
  width: min(360px, calc(100vw - 32px));
  border: 0;
  border-radius: 16px;
  padding: 20px;
  color: var(--tinta);
  box-shadow: 0 12px 32px rgba(19, 35, 43, .25);
}
dialog::backdrop { background: rgba(19, 35, 43, .45); }
dialog p { margin: 12px 0 18px; }
dialog form { display: flex; }
dialog .primario { flex: 1; }

/* Pantalla completa: solo en celular. Oculta el aviso y el enlace de comentarios. */
.telefono { position: relative; }
.boton-completa {
  display: none;
  position: absolute;
  right: 12px;
  bottom: 72px;
  z-index: 5;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--borde);
  background: var(--superficie);
  color: var(--tinta);
  box-shadow: 0 4px 12px rgba(19, 35, 43, .18);
  opacity: .45;
  transition: opacity .15s;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.boton-completa:hover, .boton-completa:focus-visible, .boton-completa:active { opacity: 1; }
.boton-completa .icono-contraer { display: none; }
body.pantalla-completa .boton-completa .icono-expandir { display: none; }
body.pantalla-completa .boton-completa .icono-contraer { display: block; }
body.pantalla-completa .aviso-prototipo,
body.pantalla-completa .comentar { display: none; }
@media (max-width: 599px) {
  .boton-completa { display: inline-flex; }
}
