[hidden] { display: none !important; }
:root {
  color-scheme: light;
  --bg: #f7f8fa; --card: #fff; --ink: #1a2238; --muted: #5b6579; --line: #e3e7ee;
  --navy: #14307a; --navy-2: #1d4cb8;
  --brand: #1d3f98; --brand-soft: #e4eafb;
  --accent: #f28a1b; --accent-ink: #2a1500; --accent-soft: #fff0dc; --accent-text: #b25a00;
  --ok: #17824f; --ok-soft: #dff4e8; --idle: #66708c; --idle-soft: #e9edf7;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.04);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
h1, h2, .big { font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.2; margin: .2rem 0; }
h2 { font-size: 1.25rem; margin: 2.2rem 0 .8rem; }
h3 { font-size: 1rem; margin: 0 0 .3rem; }
p { margin: .3rem 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--navy); font-weight: 600; margin: 0; }
.top { background: #fff; border-top: 5px solid var(--navy); border-bottom: 1px solid var(--line); padding: 22px 0; }
.top-in { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.top form { display: flex; align-items: center; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.doc, .annex { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.doc .btn, .annex .btn { margin-top: auto; }
.annex { gap: 6px; } .annex .bar { width: 100%; }
.annex-head { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.code { background: var(--brand-soft); color: var(--navy); font-weight: 700; border-radius: 8px; padding: 2px 10px; }

.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 14px; border-radius: 10px; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--navy); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-ghost { background: transparent; }
:focus-visible { outline: 3px solid var(--navy-2); outline-offset: 2px; }

.overall { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-top: 20px; }
.big { font-size: 3rem; font-weight: 700; line-height: 1; margin: 0; } .big span { font-size: 1.4rem; color: var(--muted); }
.bar { display: block; height: 8px; background: var(--idle-soft); border-radius: 99px; overflow: hidden; }
.bar.lg { height: 14px; } .bar i { display: block; height: 100%; background: var(--navy); border-radius: 99px; }

.phase-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.phase-btn { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.phase-btn[aria-selected="true"] { border-color: var(--navy); box-shadow: inset 0 -4px 0 var(--accent); }
.phase-btn:hover { border-color: var(--navy); }
.phase-btn.st-active .bar i { background: var(--accent); }
.phase-btn.st-completed .bar i { background: var(--ok); }
.phase-panel[hidden] { display: none; }
.steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 4px; }
.step { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 6px; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; }
.step div { display: flex; flex-direction: column; }
.dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; background: var(--idle-soft); color: var(--idle); }
.step.st-completed .dot { background: var(--ok-soft); color: var(--ok); }
.step.st-in_progress .dot { background: var(--accent-soft); color: var(--accent-text); }

.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--idle-soft); color: var(--idle); white-space: nowrap; width: fit-content; }
.pill.st-completed { background: var(--ok-soft); color: var(--ok); }
.pill.st-active, .pill.st-in_progress, .pill.ds-capturing { background: var(--accent-soft); color: var(--accent-text); }
.pill.ds-consolidated { background: var(--ok-soft); color: var(--ok); }

.timeline { list-style: none; margin: 0; padding: 8px 16px; }
.timeline li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; }
.timeline li:first-child { border-top: 0; } .timeline time { min-width: 88px; }
.foot { padding: 32px 16px; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 400px; border-top: 5px solid var(--navy); box-shadow: 0 8px 30px rgba(16,24,40,.08); display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
input, select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.alert { background: #fde3e3; color: #b42318; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.alert.ok { background: var(--ok-soft); color: var(--ok); margin-top: 16px; }

.admin-block { display: grid; gap: 10px; margin-bottom: 14px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline.row > span:first-child { flex: 1 1 260px; }
.stack { display: grid; gap: 8px; max-width: 420px; border-top: 1px solid var(--line); padding-top: 12px; }

@media (max-width: 560px) {
  .overall { grid-template-columns: 1fr; gap: 12px; }
  .step { grid-template-columns: 28px 1fr; } .step .pill { grid-column: 2; }
}

/* ---- Encuesta pública (A1) ---- */
.sv-top { background: #fff; border-top: 5px solid var(--navy); border-bottom: 1px solid var(--line); padding: 14px 0; }
.sv-top .sv-wrap { display: flex; flex-direction: column; gap: 2px; } .sv-top span { color: var(--muted); font-size: .85rem; }
.sv-wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.sv-progress { height: 6px; background: var(--idle-soft); border-radius: 99px; margin: 20px 0 8px; overflow: hidden; }
.sv-progress i { display: block; height: 100%; width: 0; background: var(--navy); transition: width .25s; }
.sv-sec h2 { margin: 0 0 14px; font-size: 1.2rem; }
.q { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.q[hidden] { display: none; }
label.q { display: flex; flex-direction: column; gap: 6px; }
.q legend { font-weight: 600; padding: 0; margin-bottom: 10px; }
.qn { display: inline-block; background: var(--brand-soft); color: var(--navy); font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 6px; margin-right: 4px; }
.choice { flex-direction: row; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: var(--card); }
.choice:has(input:checked) { border-color: var(--navy); background: var(--brand-soft); }
.choice input, .pill-choice input { accent-color: var(--navy); width: 18px; height: 18px; margin-top: 2px; flex: none; }
.otro { margin: -2px 0 8px 30px; width: calc(100% - 30px); }
.mrow { padding: 10px 0; border-top: 1px solid var(--line); }
.mlabel { font-weight: 500; margin-bottom: 6px; }
.mopts { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-choice { flex-direction: row; display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; cursor: pointer; font-size: .9rem; }
.pill-choice:has(input:checked) { border-color: var(--navy); background: var(--brand-soft); }
textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; width: 100%; background: var(--card); color: var(--ink); }
.err { color: #b42318; font-size: .85rem; margin: 6px 0 0; }
.sv-nav { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0; }
.sv-nav #svNext, .sv-nav #svSend { margin-left: auto; }
.sv-foot { text-align: center; padding-bottom: 32px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---- Compartir ---- */
.share { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.btn-wa { background: #128c4a; border-color: #128c4a; color: #fff; font-weight: 600; display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.btn-wa:hover { background: #0e7a40; border-color: #0e7a40; }
.share .btn { width: 100%; text-align: center; }

/* ---- Móvil: encuesta ---- */
.q.consent legend { font-weight: 400; line-height: 1.55; }
.mopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
.mopts.short { grid-template-columns: repeat(5, 1fr); }
.mopts.short .pill-choice { flex-direction: column; gap: 2px; padding: 8px 0; justify-content: center; border-radius: 10px; }
.pill-choice { border-radius: 10px; }
@media (max-width: 560px) {
  .wrap, .sv-wrap { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
  .sv-nav .btn { min-height: 46px; padding: 10px 20px; }
  .choice { padding: 12px; }
}

/* ---- Escalas y matrices: segmentos grandes, fáciles de pulsar ---- */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.seg, .pill-choice { position: relative; cursor: pointer; }
.seg input, .pill-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg { display: flex; align-items: center; justify-content: center; min-height: 58px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 1.2rem; font-weight: 600; transition: background .12s, color .12s; }
.seg:hover, .pill-choice:hover { border-color: var(--navy); }
.seg:has(input:checked), .pill-choice:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg:has(input:focus-visible), .pill-choice:has(input:focus-visible) { outline: 3px solid var(--navy-2); outline-offset: 2px; }
.scale-ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: .82rem; color: var(--muted); }
.mopts { grid-template-columns: repeat(5, 1fr); }
.pill-choice { justify-content: center; text-align: center; min-height: 48px; padding: 8px 6px; font-size: .92rem; line-height: 1.15; }
.mopts.short .pill-choice { min-height: 52px; font-size: 1.1rem; font-weight: 600; }
@media (max-width: 560px) {
  .mopts:not(.short) { grid-template-columns: repeat(2, 1fr); }
  .mopts:not(.short) .pill-choice:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .seg { min-height: 56px; }
}
