:root {
  --fondo: #f7f7f5;
  --panel: #ffffff;
  --texto: #1d1d1b;
  --suave: #5f5f5a;
  --borde: #deddd8;
  --ref: #8a8a85;
  --mod: #c2410c;
  --aviso-fondo: #fff4d6;
  --aviso-borde: #e0b84a;
  --enlace: #1d4ed8;
  --radio: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #161615;
    --panel: #1f1f1e;
    --texto: #ececea;
    --suave: #a6a6a0;
    --borde: #34342f;
    --ref: #8f8f8a;
    --mod: #fb923c;
    --aviso-fondo: #3a2f12;
    --aviso-borde: #8a6d1e;
    --enlace: #93b4ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--enlace); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
header h1 { font-size: 1.4rem; margin: 0 0 4px; }
header .volver { font-size: .9rem; }
#pregunta { font-size: 1.15rem; font-weight: 600; margin: 12px 0; }

.panel {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 14px;
  margin-bottom: 14px;
}
#avisos {
  background: var(--aviso-fondo);
  border: 1px solid var(--aviso-borde);
  border-radius: var(--radio);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.rejilla { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 768px) {
  .rejilla { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

.control { margin-bottom: 14px; }
.control label { display: block; font-weight: 600; }
.control .unidad { font-weight: 400; color: var(--suave); }
.control .nombre { margin-left: 6px; font-size: .75rem; color: var(--suave); font-weight: 400; }
.control .par { display: flex; gap: 10px; align-items: center; }
.control input[type=range] { flex: 1; min-height: 44px; accent-color: var(--mod); }
.control input[type=number] { width: 6.5em; min-height: 44px; font: inherit; padding: 4px 6px; }
.control select { min-height: 44px; font: inherit; padding: 4px 8px; }

.leyenda { display: flex; gap: 16px; font-size: .9rem; color: var(--suave); margin-bottom: 8px; }
.leyenda .ref::before, .leyenda .mod::before {
  content: ""; display: inline-block; width: 14px; height: 4px; margin-right: 6px; vertical-align: middle;
}
.leyenda .ref::before { background: var(--ref); }
.leyenda .mod::before { background: var(--mod); }

.tapado { position: relative; }
.tapado::after {
  content: "Resultado tapado: predice y pulsa «Mostrar resultado»";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--panel);
  color: var(--suave); font-size: .95rem; padding: 8px;
  border-radius: 6px;
}

#prediccion { width: 100%; min-height: 72px; font: inherit; padding: 8px; border-radius: 6px; border: 1px solid var(--borde); background: var(--fondo); color: var(--texto); }
button {
  min-height: 44px; padding: 8px 16px; font: inherit; font-weight: 600;
  border-radius: 8px; border: 1px solid var(--borde); background: var(--panel); color: var(--texto); cursor: pointer;
}
button.principal { background: var(--mod); border-color: var(--mod); color: #fff; }
button:disabled { opacity: .55; cursor: default; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.copia-manual { width: 100%; margin-top: 10px; font: 13px/1.4 ui-monospace, Consolas, monospace; }

#simplificaciones h2 { font-size: 1.05rem; margin: 0 0 6px; }
#simplificaciones .meta { color: var(--suave); font-size: .9rem; }
#simplificaciones .fuente { color: var(--suave); font-size: .85rem; }
#simplificaciones .aviso-verif { background: var(--aviso-fondo); padding: 6px 10px; border-radius: 6px; font-size: .9rem; }
#simplificaciones li { margin-bottom: 6px; }

.lista-sims { list-style: none; padding: 0; }
.lista-sims li { margin-bottom: 10px; }
.pie { color: var(--suave); font-size: .85rem; }
