:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --soft: #e8e8ed;
  --accent: #0071e3;
  --ok: #1fa35c;
  --bad: #e5484d;
  --radius: 22px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --text: #f5f5f7;
    --muted: #98989d;
    --line: #38383a;
    --soft: #2c2c2e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

.hero {
  text-align: center;
  padding: 88px 16px 40px;
}
.eyebrow {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.4s;
}
h1 {
  margin: 0;
  font-size: clamp(44px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.lead {
  max-width: 560px;
  margin: 16px auto 0;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--muted);
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 40px;
  display: grid;
  gap: 20px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.card-head h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.step {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.4s;
}

.field { margin-top: 22px; }
.field > label, .field-row > label { font-weight: 600; }
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
.value { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.value b { color: var(--text); }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

.switch-label {
  font-weight: 400 !important;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
}
.switch-label input { accent-color: var(--accent); }

/* Segmented control */
.segmented {
  display: flex;
  background: var(--soft);
  border-radius: 12px;
  padding: 3px;
  margin-top: 10px;
}
.segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 8px 6px;
  border-radius: 9px;
  cursor: pointer;
}
.segmented button.on {
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
  font-weight: 600;
}

/* Range */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 50%) 100% no-repeat, var(--soft);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
  cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.25);
}
input[type="range"]:disabled { opacity: .45; }

/* Pruebas */
.pruebas { display: grid; gap: 8px; margin-top: 12px; }
.prueba {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.prueba:first-child { border-top: 0; }
.prueba.off .prueba-body { display: none; }
.prueba.off .prueba-name { color: var(--muted); }
.prueba-name { font-weight: 600; display: flex; align-items: center; gap: 10px; }
.prueba-name input { accent-color: var(--accent); width: 18px; height: 18px; }
.tag { font-size: 12px; font-weight: 500; color: var(--muted); background: var(--soft); padding: 2px 8px; border-radius: 99px; }
.prueba-body { margin-top: 12px; }
.score { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }

.pill {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  background: var(--soft);
}
.pill.ok { color: var(--ok); }
.pill.bad { color: var(--bad); }

/* Filtros y lista */
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
select, input[type="search"] {
  flex: 1 1 220px;
  font: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  outline: none;
}
select:focus, input[type="search"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.chip {
  border: 0;
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--soft);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip.on { background: var(--c); color: #fff; }
.chip.on i { background: #fff; }

.lista { display: grid; gap: 2px; max-height: 420px; overflow-y: auto; }
.item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 12px;
  border-radius: 12px;
  cursor: pointer;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}
.item:hover { background: var(--soft); }
.item .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.item .txt { flex: 1; min-width: 0; }
.item .txt b { display: block; font-weight: 600; }
.item .txt small { color: var(--muted); }
.item .check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid; place-items: center;
  color: #fff; font-size: 14px;
  flex: none;
}
.item.on .check { background: var(--c); border-color: var(--c); }
.empty { color: var(--muted); padding: 16px 4px; }

/* Resultados */
.resultados { display: grid; gap: 20px; }
.res {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.res::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 6px;
  background: var(--c);
}
.res-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.res-area { color: var(--c); font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.res h3 { margin: 0; font-size: 24px; letter-spacing: -0.02em; line-height: 1.15; }
.res .uni { color: var(--muted); margin: 4px 0 0; }
.quitar { border: 0; background: var(--soft); color: var(--muted); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 16px; flex: none; }

.big {
  margin: 22px 0 6px;
  font-size: clamp(56px, 12vw, 88px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--c);
  font-variant-numeric: tabular-nums;
}
.big small { font-size: 18px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.verdict { font-size: 18px; font-weight: 600; margin: 8px 0 18px; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

.bar { position: relative; height: 10px; background: var(--soft); border-radius: 5px; margin: 8px 0 26px; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: var(--c); border-radius: 5px; transition: width .4s; }
.bar .mark { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--text); }
.bar .mark span { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; }

.desglose { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.desglose td { padding: 8px 0; border-top: 1px solid var(--line); }
.desglose td:nth-child(2), .desglose td:nth-child(3), .desglose td:nth-child(4) { text-align: right; color: var(--muted); }
.desglose td:last-child { color: var(--text); font-weight: 600; }
.warn { color: var(--bad); font-size: 14px; margin-top: 12px; }

.vacio { text-align: center; color: var(--muted); padding: 32px 16px; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 48px; }

@media (max-width: 520px) {
  .card, .res { padding: 22px 18px; }
  .hero { padding-top: 56px; }
}

.modulos { margin: 0 0 14px; }
.modulos button { font-size: 13px; }
.verdict.neutral { color: var(--muted); font-weight: 500; }
footer a { color: inherit; }
