/* Fuentes del sistema a propósito: no enviamos la IP de los visitantes a terceros (Google Fonts, CDNs). */
/* El atributo hidden siempre oculta, aunque la clase defina display (p. ej. .notice usa flex). */
[hidden] { display: none !important; }
:root {
  --bg: #F2F4F3; --surface: #FFFFFF; --ink: #15212B; --muted: #586773; --line: #D6DDE0;
  --accent: #1E57B8; --accent-ink: #FFFFFF; --accent-soft: #E2EBF8;
  --high: #B3261E; --high-soft: #FBE8E6; --mid: #8F5B00; --mid-soft: #FFF2D4; --low: #2B7449; --low-soft: #E3F2E8;
  --f-display: "Avenir Next", "Segoe UI Variable Display", "Helvetica Neue", Arial, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1418; --surface: #162028; --ink: #E5EBEE; --muted: #9AA7B1; --line: #29353E;
    --accent: #86ABEF; --accent-ink: #0E1418; --accent-soft: #1B2A42;
    --high: #F1938B; --high-soft: #3A1F1C; --mid: #E7B964; --mid-soft: #362A12; --low: #7FCB9D; --low-soft: #15301F;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.55; }
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
header.top { border-bottom: 1px solid var(--line); background: var(--surface); }
header.top .wrap { padding-block: 22px 20px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; }
.eyebrow { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(26px, 4vw, 34px); line-height: 1.1; margin: 4px 0 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-family: var(--f-display); font-weight: 700; font-size: 22px; line-height: 1.2; margin: 4px 0 0; text-wrap: balance; }
h3 { font-family: var(--f-display); font-weight: 700; font-size: 16px; margin: 0; }
.sub { color: var(--muted); max-width: 62ch; margin: 6px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button { font: inherit; cursor: pointer; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 6px; font-weight: 600; font-size: 14px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--high); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible, .step:focus-visible, .opt input:focus-visible + span, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.notice { margin-bottom: 12px; padding: 10px 14px; border-radius: 6px; background: var(--accent-soft); font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.notice.error { background: var(--high-soft); color: var(--high); }
main .wrap { padding-block: 24px 48px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
nav.steps { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.step { text-align: left; background: none; border: none; color: var(--muted); padding: 9px 12px; border-radius: 6px; display: flex; gap: 10px; align-items: baseline; font-size: 14.5px; }
.step .n { font-family: var(--f-mono); font-size: 12px; width: 18px; }
.step:hover { color: var(--ink); }
.step.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.step.result { margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0; padding-top: 14px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 26px clamp(16px, 3vw, 32px); min-width: 0; }
.q { padding: 20px 0; border: none; border-top: 1px solid var(--line); margin: 0; }
.q:first-of-type { border-top: none; padding-top: 8px; }
.q .label { font-weight: 600; font-size: 15.5px; padding: 0; }
.q .help { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 12px; }
.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span.box { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; font-size: 14px; height: 100%; }
.opt span.box::before { content: ""; flex: 0 0 14px; height: 14px; margin-top: 3px; border: 1.5px solid var(--muted); border-radius: 3px; }
.opt input[type="radio"] + span.box::before { border-radius: 50%; }
.opt input:checked + span.box { border-color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.opt input:checked + span.box::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2.5px var(--surface); }
.tag { display: inline-block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; background: var(--high-soft); color: var(--high); margin-left: 6px; vertical-align: 1px; }
.webscan { margin: 18px 0 8px; padding: 16px; border: 1px dashed var(--accent); border-radius: 8px; background: var(--accent-soft); }
.webscan .linkbox input { flex: 1 1 220px; min-width: 0; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.webscan .tasks { background: var(--surface); }
.muted { color: var(--muted); font-weight: 400; }
.tag.det { background: var(--accent-soft); color: var(--accent); }
.pill.info { background: var(--bg); color: var(--muted); }
.stripe.ok { background: var(--low); } .stripe.info { background: var(--line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.diag-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.diag-grid nav.steps { position: sticky; top: 16px; }
.savestate { font-size: 12.5px; color: var(--muted); min-height: 1.2em; }
fieldset.q[disabled] .opt span.box { opacity: .75; cursor: default; }
.estado { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; }
.estado .grande { font-family: var(--f-display); font-size: 18px; font-weight: 700; }
.progreso { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; flex: 1 1 160px; }
.progreso span { display: block; height: 100%; background: var(--accent); }
@media (max-width: 760px) {
  .diag-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .diag-grid nav.steps { position: static; flex-direction: row; overflow-x: auto; }
}
.avance-header { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 13.5px; color: var(--muted); text-decoration: none; }
.avance-header:hover { color: var(--ink); }
.avance-header .progreso { width: 140px; flex: 0 0 140px; }
.avance-header b { color: var(--ink); font-variant-numeric: tabular-nums; }
.navrow { display: flex; justify-content: space-between; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.empty { color: var(--muted); padding: 18px 0; }
.res-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; justify-content: space-between; }
.counts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.count { border-radius: 6px; padding: 10px 14px; min-width: 120px; }
.count b { font-family: var(--f-display); font-size: 26px; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.count.alta { background: var(--high-soft); color: var(--high); }
.count.media { background: var(--mid-soft); color: var(--mid); }
.count.baja { background: var(--low-soft); color: var(--low); }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 18px; }
.area { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.pill { font-family: var(--f-mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.pill.alta { background: var(--high-soft); color: var(--high); }
.pill.media { background: var(--mid-soft); color: var(--mid); }
.pill.baja, .pill.ok { background: var(--low-soft); color: var(--low); }
section.block { margin-top: 32px; }
section.block > .sub { margin-bottom: 14px; }
.tasks { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.task { display: grid; grid-template-columns: 6px minmax(0, 1fr); border-top: 1px solid var(--line); }
.task:first-child { border-top: none; }
.stripe.alta { background: var(--high); } .stripe.media { background: var(--mid); } .stripe.baja { background: var(--low); }
.task .body { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.task .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.task .meta .mod { color: var(--accent); font-weight: 600; }
.task p { margin: 0; font-size: 14px; color: var(--muted); max-width: 72ch; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 820px; font-size: 13.5px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); }
th { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; border-top: none; background: var(--bg); }
td.who { font-weight: 600; white-space: nowrap; }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.doc { border: 1px dashed var(--line); border-radius: 6px; padding: 10px 12px; font-size: 14px; }
.doc small { display: block; color: var(--muted); font-size: 12.5px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 28px; max-width: 80ch; }
.ok-msg { font-size: 13.5px; color: var(--low); }
.err-msg { font-size: 13.5px; color: var(--high); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--muted); }
.field input, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%; }
textarea { min-height: 80px; resize: vertical; margin-top: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin-top: 12px; }
.check input { margin-top: 4px; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.linkbox code { font-family: var(--f-mono); font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); padding: 6px 8px; border-radius: 4px; overflow-wrap: anywhere; }
footer { color: var(--muted); font-size: 12.5px; }
footer .wrap { padding-block: 0 32px; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 28px; }
@media (max-width: 760px) {
  main .wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  nav.steps { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .step { white-space: nowrap; }
  .step.result { margin-top: 0; border-top: none; border-radius: 6px; padding-top: 9px; }
  .step.on { box-shadow: inset 0 -3px 0 var(--accent); }
}
@media (prefers-reduced-motion: no-preference) { .opt span.box, .btn { transition: border-color .12s, background-color .12s; } }
