/* ============================================================================
   magorai-scorecard.css — sistema Magorai aplicado al OR Scorecard
   Sustituye el bloque <style> que hoy vive dentro de cada HTML del tool.
   Mismos nombres de clase: no cambia el JS ni el marcado.
   ========================================================================== */

:root {
  /* superficies */
  --bg-app: #F5F8FF;
  --surface: #FFFFFF;
  --surface-soft: #FAFCFF;
  --surface-head: #F7FAFF;
  --tint: #EEF4FF;
  --tint-hover: #F4F8FF;
  --icon-bg: #EAF1FF;

  /* bordes */
  --border: #E4EBF8;
  --border-inner: #E9EFFB;
  --border-sep: #EEF3FB;
  --border-ctrl: #DCE5F7;
  --border-chip: #CFE0FF;
  --border-dashed: #D6E1F6;

  /* tinta */
  --ink: #0B1B44;
  --ink-body: #5A6B92;
  --ink-2: #7C8CB4;
  --ink-meta: #9AA8C7;
  --ink-off: #B8C4DC;

  /* marca */
  --navy-900: #0A1436;
  --navy-800: #152459;
  --navy-700: #1E3277;
  --navy-600: #2E5BC8;
  --blue-600: #1746B8;
  --blue-500: #2E7BFF;
  --blue-400: #1F6FEB;
  --blue-300: #7FB2FF;

  /* niveles 1-5 → tríos semánticos */
  --l1-bg:#FDF3F1; --l1-bc:#F2C9BE; --l1-fg:#B8402C;
  --l2-bg:#FFF8EC; --l2-bc:#F2DFB0; --l2-fg:#8A6316;
  --l3-bg:#F2F6FE; --l3-bc:#E4EBF8; --l3-fg:#7C8CB4;
  --l4-bg:#EEF4FF; --l4-bc:#CFE0FF; --l4-fg:#1746B8;
  --l5-bg:#EAF7F1; --l5-bc:#C6EBDA; --l5-fg:#186B4A;
  --level1: #B8402C;
  --level2: #8A6316;
  --level3: #7C8CB4;
  --level4: #1746B8;
  --level5: #186B4A;

  /* alias que el JS y el marcado antiguo siguen usando */
  --bg-primary: #F5F8FF;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #FAFCFF;
  --accent: #EEF4FF;
  --highlight: #B8402C;
  --success: #1746B8;
  --text-primary: #0B1B44;
  --text-secondary: #5A6B92;
  --text-muted: #9AA8C7;

  --radius: 18px;
  --radius-card: 20px;
  --radius-ctrl: 11px;
  --gap: 16px;
  --shadow-card: 0 18px 40px -34px rgba(11,27,68,.45);
  --shadow-row: 0 10px 26px -26px rgba(11,27,68,.5);
  --shadow-modal: 0 50px 90px -40px rgba(6,13,38,.8);
  --shadow-btn: 0 10px 24px -12px rgba(23,70,184,.65);
  --transition: .15s ease;
  --grad-band: linear-gradient(125deg,#0A1436 0%,#152459 38%,#1E3277 68%,#2E5BC8 100%);
  --grad-btn: linear-gradient(150deg,#2E7BFF,#1746B8);
  --grad-btn-hover: linear-gradient(150deg,#3B86FF,#1B51CF);
  --glow: radial-gradient(circle at 50% 50%, rgba(120,160,255,.42), rgba(120,160,255,0) 68%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: var(--bg-app);
  color: var(--ink-body);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
}
/* ---------- FONDO DECORATIVO: formas orgánicas de marca ----------
   Capa no interactiva detrás de todo el contenido. Los blobs son SVG en
   data URI para no añadir peticiones ni archivos al despliegue.          */
body { position: relative; isolation: isolate; }
body::before {
  content: "";
  position: absolute; inset: 0;
  z-index: -1; pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cpath d='M470,95 C556,168 585,300 516,398 C447,496 300,545 198,492 C96,439 52,298 116,196 C180,94 384,22 470,95 Z' fill='%231E3277'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cpath d='M392,70 C478,132 512,268 448,362 C384,456 242,496 152,440 C62,384 30,242 90,150 C150,58 306,8 392,70 Z' fill='%232E5BC8'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cpath d='M430,120 C520,190 540,330 462,412 C384,494 234,510 152,444 C70,378 48,236 112,152 C176,68 340,50 430,120 Z' fill='%23152459'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cpath d='M392,70 C478,132 512,268 448,362 C384,456 242,496 152,440 C62,384 30,242 90,150 C150,58 306,8 392,70 Z' fill='%231E3277'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  /* Cuanto asoma cada blob: el margen libre junto al contenido (.container mide
     1180px con 40px de padding) mas 12px, para que se detenga ~20px antes del
     texto, con tope de 380px. Los px fijos son el borde de cada forma dentro de
     su imagen ya escalada (666, 579 izquierda; 576, 630 derecha). */
  --blob-v: min(calc((100vw - 1180px) / 2 + 12px), 380px);
  background-position:
    calc(var(--blob-v) - 666px) 460px,
    calc(100% + 576px - var(--blob-v)) 1180px,
    calc(var(--blob-v) - 579px) 2100px,
    calc(100% + 630px - var(--blob-v)) 2900px;
  background-size: 720px 720px, 640px 640px, 680px 680px, 700px 700px;
}
@media (max-width: 1100px) { body::before { display: none; } }
@media print { body::before { display: none; } }
a { color: var(--blue-400); text-decoration: none; }
a:hover { color: var(--blue-600); text-decoration: underline; }

/* z-index:1 deja el contenido sobre la capa de blobs. Los modales y el toast
   viven fuera de .container, asi que no quedan atrapados en este apilamiento. */
.container { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 40px; }

svg.mg-ico { width: 1em; height: 1em; vertical-align: -.12em; flex: none; }

/* ---------- BANDA AZUL (cabecera del prototipo v2) ----------
   Degradado + dos resplandores + formas organicas translucidas, fila de
   navegacion con pestanas, titular con acciones y onda doble al pie. */
.hero {
  position: relative;
  overflow: hidden;
  text-align: left;
  background: var(--grad-band);
  border: none;
}
.hero::before, .hero::after {
  content: ""; position: absolute; pointer-events: none; background: var(--glow);
}
.hero::before { top: -120px; left: -60px; width: 420px; height: 420px; }
.hero::after { top: -80px; right: -40px; width: 520px; height: 460px; }
.hero-shape { position: absolute; pointer-events: none; }
.hero-shape-tr { top: -140px; right: -90px; width: 620px; height: 620px; opacity: .5; }
.hero-shape-bl { bottom: -60px; left: -120px; width: 380px; height: 380px; opacity: .45; }

.hero-nav {
  position: relative; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 40px; border-bottom: 1px solid rgba(255,255,255,.10);
}
.hero-brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.hero-brand:hover { text-decoration: none; }
.hero-brand img { height: 34px; width: auto; display: block; }
.hero-brand-text { display: flex; flex-direction: column; gap: 2px; }
.hero-brand-text b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.hero-brand-text small {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(160,186,240,.65);
}
.hero-tabs {
  display: flex; gap: 6px; padding: 4px; border-radius: 999px;
  background: rgba(10,20,54,.5); border: 1px solid rgba(255,255,255,.22);
}
.hero-tab {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px;
  border: none; border-radius: 999px; background: transparent; color: rgba(219,230,255,.82);
  font-family: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s;
}
.hero-tab:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.hero-tab.is-active, .hero-tab.is-active:hover { background: #fff; color: #12306E; }
.hero-tab:disabled { opacity: .45; cursor: not-allowed; background: transparent; color: rgba(219,230,255,.82); }

.hero-head {
  position: relative; padding: 34px 40px 104px;
  display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap;
}
.hero-text { flex: 1 1 620px; min-width: 0; }
.hero-eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(160,186,240,.85); margin-bottom: 10px;
}
.hero h1 {
  font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1.08;
  color: #fff; margin: 0 0 10px; text-wrap: pretty;
}
.hero .intro { max-width: 62ch; margin: 0; color: rgba(200,218,255,.82); font-size: 14px; line-height: 1.6; text-wrap: pretty; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-btn {
  display: inline-flex; align-items: center; font-family: inherit; font-size: 14px; font-weight: 700;
  white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s;
}
.hero-btn:hover { text-decoration: none; }
.hero-btn-light {
  height: 46px; padding: 0 26px; border: none; border-radius: 999px;
  background: #fff; color: #12306E; box-shadow: 0 10px 24px -12px rgba(6,13,38,.65);
}
.hero-btn-light:hover { background: #EEF4FF; color: #12306E; }
.hero-btn-dark {
  height: 42px; padding: 0 20px; border-radius: 11px;
  background: rgba(10,20,54,.5); border: 1px solid rgba(255,255,255,.22); color: #fff;
}
.hero-btn-dark:hover { background: rgba(10,20,54,.8); border-color: rgba(255,255,255,.5); color: #fff; }

/* onda doble al pie: franja celeste translucida y el fondo claro de la app */
.hero > .hero-wave {
  position: absolute; bottom: -1px; left: 0; width: 100%; height: 112px; display: block;
}

/* ---------- BARRA STICKY ---------- */
.sticky-bar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245,248,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px 40px;
}
.sticky-inner { max-width: 1180px; margin: 0 auto; gap: 16px; }
.progress-track { height: 8px; background: var(--border-sep); border-radius: 999px; }
.progress-fill { background: var(--grad-btn); border-radius: 999px; }
.progress-text { font-size: 13px; color: var(--ink-2); }
.progress-score { font-size: 13px; font-weight: 800; color: var(--ink); }
.btn-calculate {
  height: 42px; padding: 0 20px; border: none; border-radius: var(--radius-ctrl);
  background: var(--grad-btn); color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-btn); cursor: pointer; transition: var(--transition);
}
.btn-calculate:hover { background: var(--grad-btn-hover); opacity: 1; }
.btn-calculate:disabled { background: #F2F6FE; color: var(--ink-off); box-shadow: none; cursor: not-allowed; }

/* ---------- SELECTOR DE ROL ---------- */
.role-section { padding: 26px 40px 30px; background: transparent; border: none; }
.role-section h2 {
  font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink);
  text-align: left; margin-bottom: 4px;
}
.role-hint { text-align: left; font-size: 13.5px; color: var(--ink-body); margin-bottom: 16px; max-width: 76ch; }
.role-grid { display: flex; flex-wrap: wrap; gap: 12px; max-width: 1180px; }
.role-card {
  flex: 1 1 250px; min-width: 220px; min-height: 0;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 14px 16px; cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.role-card:hover { border-color: var(--blue-500); background: var(--tint-hover); transform: none; box-shadow: var(--shadow-card); }
.role-card.selected { border-color: var(--blue-500); background: var(--tint); }
.role-card .role-icon {
  width: 34px; height: 34px; border-radius: 10px; background: var(--icon-bg);
  color: var(--blue-400); display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 10px;
}
.role-card .role-name { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.3; margin-bottom: 4px; }
.role-card .role-tagline { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.role-badge { margin-top: 16px; text-align: left; font-size: 13px; color: var(--ink-body); }
.role-badge button.role-change {
  height: 34px; padding: 0 14px; margin-left: 10px;
  background: var(--surface); border: 1.5px solid var(--border-ctrl); color: var(--ink);
  border-radius: 10px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: var(--transition);
}
.role-badge button.role-change:hover { border-color: var(--blue-500); background: var(--tint-hover); color: var(--blue-600); }

/* ---------- FASES ---------- */
.phase-section { padding: 8px 0 24px; }
.phase-section h2 { text-align: left; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin-bottom: 4px; }
.phase-section .phase-hint { text-align: left; font-size: 13.5px; color: var(--ink-body); margin-bottom: 16px; }
.phase-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.phase-card {
  flex: 1 1 190px; min-width: 170px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 16px; cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-card);
}
.phase-card:hover { border-color: var(--blue-500); background: var(--tint-hover); transform: none; box-shadow: var(--shadow-card); }
.phase-card.selected { border-color: var(--blue-500); background: var(--tint); box-shadow: var(--shadow-card); }
.phase-card .icon { font-size: 18px; color: var(--blue-400); margin-bottom: 10px; }
.phase-card .name { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.phase-card .desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.phase-badge { text-align: left; margin-top: 16px; }
.phase-badge span {
  display: inline-flex; align-items: center; height: 30px; padding: 0 14px;
  background: var(--tint); border: 1.5px solid var(--border-chip); color: var(--blue-600);
  border-radius: 999px; font-size: 12.5px; font-weight: 700;
}

/* ---------- INFORMACIÓN DEL PROYECTO / COLAPSABLES ---------- */
.project-info { padding: 0 0 18px; }
.collapsible-header, .scale-header, .disc-header {
  background: var(--surface-head); border: none;
  padding: 14px 18px; cursor: pointer; transition: var(--transition);
}
.collapsible-header {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.collapsible-header:hover, .scale-header:hover, .disc-header:hover { background: var(--tint); }
.collapsible-header h3, .scale-header h3 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scale-header .hint { font-size: 11px; color: var(--ink-meta); font-weight: 500; letter-spacing: 0; text-transform: none; margin-left: 10px; }
.collapsible-header .arrow, .scale-header .arrow, .disc-header .disc-arrow {
  font-size: 0; width: 8px; height: 8px; flex: none;
  border-right: 2px solid var(--blue-400); border-bottom: 2px solid var(--blue-400);
  transform: rotate(45deg); transition: transform .18s ease;
}
.collapsible-header.open .arrow, .scale-header.open .arrow, .disc-header.open .disc-arrow { transform: rotate(225deg); }
.collapsible-body {
  background: var(--surface); border: 1.5px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); padding: 18px 20px;
}
.form-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.form-group { flex: 1 1 300px; min-width: 220px; }
.form-group label, .lead-gate-form label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px;
}
.form-group input,
.lead-gate-form input[type="text"], .lead-gate-form input[type="email"],
.lead-gate-form input[type="tel"], .lead-gate-form select,
.evidence-form input[type="url"] {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--surface-soft); border: 1.5px solid var(--border-ctrl);
  border-radius: var(--radius-ctrl); color: var(--ink); font-size: 14px;
  outline: none; transition: var(--transition);
}
.form-group input:focus, .lead-gate-form input:focus, .lead-gate-form select:focus,
.evidence-form input[type="url"]:focus, .comment-textarea:focus {
  border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 4px rgba(46,123,255,.12);
}
.lead-gate-form select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
                    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  padding-right: 34px;
}
.lead-gate-form input.invalid, .lead-gate-form select.invalid, .comment-textarea.invalid { border-color: var(--l1-fg); }

/* ---------- ESCALA ---------- */
.scale-block {
  margin: 0 0 18px; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden;
}
.scale-body { padding: 20px; border-top: 1px solid var(--border-sep); }
.scale-intro { font-size: 14px; color: var(--ink-body); line-height: 1.6; margin-bottom: 12px; text-wrap: pretty; }
.scale-advice { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin-bottom: 16px; text-wrap: pretty; }
.scale-levels { display: flex; flex-wrap: wrap; gap: 12px; }
.scale-level-card {
  flex: 1 1 190px; min-width: 170px;
  background: var(--surface-soft); border: 1.5px solid var(--border-inner);
  border-left-width: 1.5px; border-radius: 14px; padding: 14px 16px;
}
.scale-level-card .lvl-num { font-size: 22px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.scale-level-card .lvl-name { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.scale-level-card .lvl-desc { font-size: 12.5px; color: var(--ink-body); line-height: 1.5; }

/* ---------- ACORDEÓN DE DISCIPLINA ---------- */
.assessment-section { padding-bottom: 32px; }
.discipline-accordion {
  margin-bottom: 14px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.disc-header { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border-sep); }
.disc-header .disc-icon {
  width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--icon-bg);
  color: var(--blue-400); display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.disc-header .disc-name { font-size: 14.5px; font-weight: 700; line-height: 1.3; color: var(--ink); flex: 1; }
.disc-header .disc-weight {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); background: var(--l3-bg); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.disc-header .disc-progress { font-size: 12.5px; color: var(--ink-meta); }
.disc-header .disc-progress.complete { color: var(--l5-fg); font-weight: 700; }
.disc-header .disc-score-badge {
  font-size: 13px; font-weight: 800; padding: 3px 12px; border-radius: 999px;
  background: var(--l3-bg); border: 1.5px solid var(--border); color: var(--ink-2);
  min-width: 46px; white-space: nowrap;
}
.disc-header .disc-score-badge.scored { background: var(--l4-bg); border-color: var(--l4-bc); color: var(--l4-fg); }
.disc-body { background: var(--surface); padding: 18px 20px; }

.criterion {
  margin-bottom: 14px; padding: 14px 16px; border-bottom: none;
  border: 1.5px solid var(--border-inner); border-radius: 14px; background: var(--surface-soft);
}
.criterion:last-child { margin-bottom: 0; }
.criterion-text { font-size: 14px; color: var(--ink); line-height: 1.6; margin-bottom: 12px; text-wrap: pretty; }
.criterion-number { color: var(--blue-600); font-weight: 800; margin-right: 6px; white-space: nowrap; }
.criterion.complete .criterion-text::before { content: "\2713 "; color: var(--l5-fg); font-weight: 800; }

.score-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.score-btn {
  flex: 1 1 74px; min-width: 64px; height: 42px;
  background: var(--surface); border: 1.5px solid var(--border-ctrl); color: var(--ink-2);
  border-radius: var(--radius-ctrl); font-size: 15px; font-weight: 800;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.score-btn:hover { border-color: var(--blue-500); background: var(--tint-hover); color: var(--ink); }
.score-btn.active { color: #fff; }
.score-btn[data-score="1"].active { background: var(--l1-bg); border-color: var(--l1-fg); color: var(--l1-fg); }
.score-btn[data-score="2"].active { background: var(--l2-bg); border-color: var(--l2-fg); color: var(--l2-fg); }
.score-btn[data-score="3"].active { background: var(--l3-bg); border-color: var(--ink-2);  color: var(--l3-fg); }
.score-btn[data-score="4"].active { background: var(--l4-bg); border-color: var(--l4-fg); color: var(--l4-fg); }
.score-btn[data-score="5"].active { background: var(--l5-bg); border-color: var(--l5-fg); color: var(--l5-fg); }
.score-btn.active:not([data-score]) { background: var(--l4-bg); border-color: var(--l4-fg); color: var(--l4-fg); }
.score-labels { display: flex; gap: 8px; margin-top: 6px; }
.score-labels span {
  flex: 1 1 74px; min-width: 64px; text-align: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-meta); line-height: 1.3;
}

/* comentario */
.criterion-comment { margin-top: 14px; }
.comment-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 6px; white-space: nowrap;
}
.comment-label .required-mark { color: var(--l1-fg); }
.comment-counter { font-size: 11px; color: var(--ink-meta); font-variant-numeric: tabular-nums; }
.comment-counter.ok { color: var(--l5-fg); }
.comment-counter.warn { color: var(--l2-fg); }
.comment-textarea {
  width: 100%; min-height: 68px; padding: 12px 14px;
  background: var(--surface); border: 1.5px solid var(--border-ctrl);
  border-radius: var(--radius-ctrl); color: var(--ink);
  font-size: 13.5px; line-height: 1.6; outline: none; transition: var(--transition);
}
.comment-hint { font-size: 12px; color: var(--ink-meta); margin-top: 6px; font-style: normal; }
.comment-hint.error { color: var(--l1-fg); font-weight: 700; }
.btn-voz {
  height: 26px; padding: 0 10px; background: var(--surface);
  border: 1.5px solid var(--border-ctrl); border-radius: 999px; color: var(--ink-2);
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; transition: var(--transition);
}
.btn-voz:hover { border-color: var(--blue-500); color: var(--blue-600); background: var(--tint-hover); }
.btn-voz.grabando { border-color: var(--l1-fg); color: var(--l1-fg); background: var(--l1-bg); animation: none; }
.comment-textarea.dictando { border-color: var(--l1-fg); }

/* evidencia */
.evidence-toggle {
  height: 34px; padding: 0 14px; background: var(--tint); border: 1.5px solid var(--border-chip);
  color: var(--blue-600); border-radius: 10px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.evidence-toggle:hover { background: #E1EDFF; border-color: var(--blue-500); color: var(--blue-600); }
.evidence-toggle.has-items { background: var(--l5-bg); border-color: var(--l5-bc); color: var(--l5-fg); }
.evidence-form {
  margin-top: 12px; padding: 14px; background: var(--surface-soft);
  border: 1.5px solid var(--border-inner); border-radius: 14px;
}
.evidence-btn {
  height: 38px; padding: 0 14px; background: var(--surface); border: 1.5px solid var(--border-ctrl);
  color: var(--ink); border-radius: 10px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.evidence-btn:hover { border-color: var(--blue-500); background: var(--tint-hover); color: var(--blue-600); }
.evidence-btn.primary { background: var(--grad-btn); border: none; color: #fff; box-shadow: var(--shadow-btn); }
.evidence-btn.primary:hover { background: var(--grad-btn-hover); }
.evidence-form-hint { font-size: 12px; color: var(--ink-meta); font-style: normal; margin-top: 8px; }
.evidence-chip {
  height: 34px; padding: 0 12px; background: var(--surface);
  border: 1.5px solid var(--border-ctrl); border-radius: 999px; font-size: 12.5px; font-weight: 600;
}
.evidence-chip.link { background: var(--l4-bg); border-color: var(--l4-bc); }
.evidence-chip.file { background: var(--l5-bg); border-color: var(--l5-bc); }
.evidence-chip .ev-chip-name { color: var(--ink); }
.evidence-chip .ev-chip-size { color: var(--ink-meta); font-size: 11px; }
.evidence-chip .ev-chip-remove { color: var(--ink-2); }
.evidence-chip .ev-chip-remove:hover { color: var(--l1-fg); }

/* ---------- FALTANTES ---------- */
.incomplete-warning, .missing-panel {
  background: var(--l1-bg); border: 1.5px solid var(--l1-bc); border-left: 1.5px solid var(--l1-bc);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; color: var(--l1-fg); font-size: 13.5px;
}
.missing-panel-title { font-size: 14px; font-weight: 700; color: var(--l1-fg); }
.missing-panel-break { font-size: 12.5px; color: var(--ink-body); }
.missing-panel-sub { font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px; }
.missing-chip {
  height: 30px; padding: 0 13px; background: var(--surface); border: 1.5px solid var(--l1-bc);
  color: var(--ink); border-radius: 999px; font-size: 12px; font-weight: 600; transition: var(--transition);
}
.missing-chip:hover { background: var(--l1-bg); transform: none; }
.missing-chip .mc-n { background: var(--l1-bg); color: var(--l1-fg); font-weight: 700; }
.missing-btn, .sticky-missing {
  height: 34px; padding: 0 16px; background: var(--l1-fg); color: #fff; border: none;
  border-radius: 10px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.sticky-missing { border-radius: 999px; }
.missing-btn:hover, .sticky-missing:hover { opacity: .9; }
.criterion.missing { box-shadow: inset 4px 0 0 var(--l1-fg); background: var(--surface-soft); border-color: var(--l1-bc); }
.criterion.focus-missing { animation: none; }
.missing-tag { background: var(--l1-bg); border: 1.5px solid var(--l1-bc); color: var(--l1-fg); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; }
.disc-pending { background: var(--l1-bg); border: 1.5px solid var(--l1-bc); color: var(--l1-fg); border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; }

/* ---------- AUTOSAVE ---------- */
.autosave-toast {
  background: var(--surface); border: 1.5px solid var(--l5-bc); color: var(--l5-fg);
  padding: 10px 18px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  box-shadow: var(--shadow-card);
}

/* ---------- RESULTADOS ---------- */
.results-section { padding: 24px 0 48px; }
.result-card, .radar-container, .breakdown, .gap-card, .no-gaps, .ai-section, .barra-gerencias {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card); margin-bottom: 18px;
}
.result-card { padding: 28px; text-align: left; }
.result-score { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--ink); margin-bottom: 8px; }
.result-label { font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin-bottom: 12px; }
.result-interp { font-size: 14px; color: var(--ink-body); line-height: 1.6; max-width: 76ch; margin: 0; text-wrap: pretty; }

.radar-container { padding: 0; overflow: hidden; }
.radar-container h3 {
  text-align: left; padding: 14px 20px; background: var(--surface-head);
  border-bottom: 1px solid var(--border-sep);
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue-600); white-space: nowrap;
}
.radar-svg-wrap { padding: 20px; }
.radar-legend { font-size: 12.5px; color: var(--ink-2); padding-bottom: 18px; }

.breakdown { padding: 0; overflow: hidden; }
.breakdown h3 {
  padding: 14px 20px; background: var(--surface-head); border-bottom: 1px solid var(--border-sep);
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-600);
}
.breakdown table { font-size: 14px; min-width: 680px; }
.breakdown th {
  padding: 10px 20px; background: var(--surface-head); border-bottom: 1px solid var(--border-sep);
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.breakdown td { padding: 12px 20px; border-bottom: 1px solid var(--border-sep); color: var(--ink); }
.breakdown tr:hover td { background: var(--surface-soft); }
.bar-track { height: 8px; background: var(--border-sep); border-radius: 999px; }
.bar-track .bar-fill { height: 100%; background: var(--grad-btn); border-radius: 999px; transition: width var(--transition); }

.gap-section h3, .comparativo > h3 {
  font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin-bottom: 12px;
}
.gap-card { border-left: 4px solid var(--l1-fg); padding: 18px 20px; }
.gap-card-header .gap-name { font-size: 14.5px; font-weight: 700; color: var(--ink); }
.gap-card-header .gap-score {
  background: var(--l1-bg); border: 1.5px solid var(--l1-bc); color: var(--l1-fg);
  border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.gap-risk { font-size: 14px; color: var(--ink-body); font-style: normal; line-height: 1.6; margin-bottom: 12px; text-wrap: pretty; }
.gap-actions li {
  font-size: 13.5px; color: var(--ink); line-height: 1.6;
  padding: 10px 12px 10px 30px; margin-bottom: 8px;
  background: var(--surface-soft); border: 1.5px solid var(--border-inner); border-radius: 14px;
}
.gap-actions li::before { content: "\2192"; color: var(--blue-400); font-size: 13px; top: 10px; left: 12px; }
.gap-chapter { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-meta); }
.no-gaps { border-left: 4px solid var(--l5-fg); padding: 18px 20px; color: var(--l5-fg); font-size: 14px; font-weight: 700; }

/* IA */
.ai-section { background: var(--surface); border-color: var(--border); padding: 0; }
.ai-section .ai-header {
  padding: 14px 20px; margin: 0; background: var(--surface-head);
  border-bottom: 1px solid var(--border-sep); gap: 12px;
}
.ai-section .ai-header h3 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-600);
}
.ai-section .ai-header .ai-badge {
  background: var(--tint); border: 1.5px solid var(--border-chip); color: var(--blue-600);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none;
}
#aiBody { padding: 20px; }
.ai-block h4 {
  font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue-600); margin-bottom: 10px;
}
.ai-block .ai-summary { font-size: 15px; line-height: 1.6; color: var(--ink); text-wrap: pretty; }
.ai-list li {
  background: var(--surface-soft); border: 1.5px solid var(--border-inner);
  border-left: 4px solid var(--l4-fg); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 8px; font-size: 13.5px; color: var(--ink); line-height: 1.6;
}
.ai-list li.critical { border-left-color: var(--l1-fg); }
.ai-list li.warning { border-left-color: var(--l2-fg); }
.ai-list li strong { color: var(--blue-600); }
.ai-list li.critical strong { color: var(--l1-fg); }
.ai-list li.warning strong { color: var(--l2-fg); }
.ai-list li .ai-evidence { font-size: 12.5px; color: var(--ink-body); font-style: normal; }
.ai-list li .ai-meta { font-size: 12px; color: var(--ink-meta); }
.ai-loading { color: var(--ink-2); }
.ai-loading .spinner { border-color: var(--border-sep); border-top-color: var(--blue-500); }
.ai-error { background: var(--l1-bg); border: 1.5px solid var(--l1-bc); color: var(--l1-fg); border-radius: 14px; padding: 14px; font-size: 13.5px; }

/* gerencias */
.barra-gerencias { padding: 14px 20px; }
.barra-gerencias .rotulo { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.ger-pastilla {
  height: 30px; padding: 0 12px; background: var(--surface);
  border: 1.5px solid var(--border-ctrl); border-radius: 999px; color: var(--ink-body);
  font-size: 12px; cursor: pointer; transition: var(--transition);
}
.ger-pastilla:hover { border-color: var(--blue-500); background: var(--tint-hover); color: var(--ink); }
.ger-pastilla.activa { background: var(--tint); border-color: var(--blue-500); color: var(--blue-600); font-weight: 700; }
.ger-pastilla .parcial { color: var(--ink-meta); font-size: 11px; }

/* comparativo */
.comparativo .sub { font-size: 13.5px; color: var(--ink-body); margin-bottom: 16px; }
.comp-aviso {
  background: var(--l2-bg); border: 1.5px solid var(--l2-bc); border-left: 4px solid var(--l2-fg);
  border-radius: 14px; padding: 14px 16px; font-size: 13.5px; color: var(--ink); margin-bottom: 18px;
}
.comp-aviso strong { color: var(--ink); }
.tabla-comp { font-size: 13px; min-width: 560px; }
.tabla-comp th, .tabla-comp td { padding: 10px 12px; border-bottom: 1px solid var(--border-sep); }
.tabla-comp th { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); background: var(--surface-head); }
.tabla-comp th.disc, .tabla-comp td.disc { color: var(--ink); }
.tabla-comp td.calor-1 { background: var(--l1-bg); color: var(--l1-fg); }
.tabla-comp td.calor-2 { background: var(--l2-bg); color: var(--l2-fg); }
.tabla-comp td.calor-3 { background: var(--l3-bg); color: var(--ink); }
.tabla-comp td.calor-4 { background: var(--l4-bg); color: var(--l4-fg); }
.tabla-comp td.calor-5 { background: var(--l5-bg); color: var(--l5-fg); }
.tabla-comp tr.total td { border-top: 1.5px solid var(--border); }
.brecha-alta { color: var(--l1-fg); }
.brecha-media { color: var(--l2-fg); }
.brecha-baja { color: var(--ink-meta); }
.ger-marca {
  color: var(--blue-600); background: var(--tint); border: 1.5px solid var(--border-chip);
  border-radius: 999px; padding: 2px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
}

/* ---------- BOTONES ---------- */
.btn {
  height: 42px; padding: 0 20px; border: 1.5px solid transparent;
  border-radius: var(--radius-ctrl); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn:hover { opacity: 1; }
.btn-primary { background: var(--grad-btn); color: #fff; border: none; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--grad-btn-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-ctrl); }
.btn-secondary:hover { border-color: var(--blue-500); background: var(--tint-hover); color: var(--blue-600); }
.btn-ai, .btn-add-ger { background: var(--tint); color: var(--blue-600); border-color: var(--border-chip); }
.btn-ai:hover, .btn-add-ger:hover { background: #E1EDFF; border-color: var(--blue-500); }
.btn-email { background: var(--surface); color: var(--ink); border-color: var(--border-ctrl); }
.btn-email:hover { border-color: var(--blue-500); background: var(--tint-hover); color: var(--blue-600); }
.btn-danger { background: var(--l1-bg); color: var(--l1-fg); border-color: var(--l1-bc); }
.btn-danger:hover { background: #FBE8E3; }
.actions-bar { gap: 10px; margin-bottom: 18px; padding: 16px 20px; background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); align-items: center; }

/* ---------- CTA ---------- */
.cta-block {
  position: relative; overflow: hidden; text-align: left;
  background: var(--grad-band); border: none; border-radius: var(--radius-card);
  padding: 28px 30px; margin-bottom: 18px;
}
.cta-block::after { content: ""; position: absolute; top: -90px; right: -40px; width: 360px; height: 320px; background: var(--glow); pointer-events: none; }
.cta-block h3 { position: relative; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: #fff; margin-bottom: 6px; }
.cta-block p { position: relative; color: rgba(200,218,255,.82); font-size: 14px; line-height: 1.6; max-width: 62ch; margin-bottom: 18px; }
.cta-block .btn-cta {
  position: relative; display: inline-flex; align-items: center; height: 42px; padding: 0 22px;
  background: #fff; color: #12306E; border-radius: var(--radius-ctrl);
  font-size: 14px; font-weight: 700; box-shadow: 0 10px 24px -12px rgba(6,13,38,.65);
}
.cta-block .btn-cta:hover { opacity: 1; background: #F4F8FF; text-decoration: none; }
.footer-ref { color: var(--ink-meta); font-size: 12.5px; padding: 20px 0; border-top: 1px solid var(--border); }

/* ---------- MODALES ---------- */
.modal-overlay, .lead-gate-overlay {
  background: rgba(6,13,38,.72); backdrop-filter: blur(10px) saturate(.85); padding: 24px;
}
.modal-box, .lead-gate-box {
  background: var(--surface); border: none; border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-modal); padding: 0; text-align: left;
}
.modal-box { max-width: 600px; width: 100%; }
.lead-gate-box { max-width: 760px; width: 100%; max-height: 92vh; overflow-y: auto; }
.modal-box h3, .lead-gate-box h3 {
  position: relative; background: var(--grad-band); color: #fff;
  font-size: 20px; font-weight: 800; letter-spacing: -.02em;
  padding: 22px 26px 6px; margin: 0; text-align: left;
}
.lead-gate-box .gate-subtitle {
  background: var(--grad-band); color: rgba(200,218,255,.82);
  font-size: 13.5px; line-height: 1.6; text-align: left; padding: 0 26px 22px; margin: 0;
}
.modal-box p { padding: 24px 26px; color: var(--ink-body); font-size: 14px; line-height: 1.6; margin: 0; text-wrap: pretty; }
.modal-actions { padding: 16px 26px; background: var(--surface-soft); border-top: 1px solid var(--border-sep); justify-content: flex-end; gap: 12px; }
.lead-gate-form { padding: 24px 26px; }
.lead-gate-form .form-row { display: flex; flex-wrap: wrap; gap: 14px; }
.lead-gate-form .field-error { font-size: 12px; color: var(--l1-fg); margin-top: 4px; }
.lead-gate-consents {
  margin: 18px 0 20px; padding: 16px 18px; background: var(--surface-soft);
  border: 1.5px solid var(--border-inner); border-radius: 14px;
}
.lead-gate-consents .consents-title {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.lead-gate-consent { font-size: 12.5px; color: var(--ink-body); line-height: 1.55; }
.lead-gate-consent input { accent-color: var(--blue-500); }
.lead-gate-consent a { color: var(--blue-400); }
.lead-gate-consent .required, .lead-gate-form label .required { color: var(--l1-fg); }
.lead-gate-actions { gap: 12px; }
.lead-gate-submit {
  height: 42px; padding: 0 22px; background: var(--grad-btn); color: #fff; border: none;
  border-radius: var(--radius-ctrl); font-size: 14px; font-weight: 700; box-shadow: var(--shadow-btn);
}
.lead-gate-submit:hover { background: var(--grad-btn-hover); opacity: 1; }
.lead-gate-submit:disabled { background: #F2F6FE; color: var(--ink-off); box-shadow: none; }
.lead-gate-cancel {
  height: 42px; padding: 0 18px; background: var(--surface); border: 1.5px solid var(--border-ctrl);
  color: var(--ink); border-radius: var(--radius-ctrl); font-size: 14px; font-weight: 700;
}
.lead-gate-cancel:hover { border-color: var(--blue-500); background: var(--tint-hover); color: var(--blue-600); }
.lead-gate-footer { font-size: 12px; color: var(--ink-meta); padding: 0 26px 24px; margin: 0; }

/* ---------- FOCO ---------- */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(46,123,255,.12);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .container, .hero-nav, .hero-head, .role-section, .sticky-bar { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 600px) {
  .form-row { flex-direction: column; }
  .hero h1 { font-size: 28px; }
  /* La cabecera de disciplina no cabe en una linea: nombre arriba, etiquetas debajo. */
  .disc-header { flex-wrap: wrap; gap: 8px; }
  .disc-header .disc-name { flex: 1 1 calc(100% - 46px); }
  .disc-header .disc-arrow { margin-left: auto; }
}

/* ---------- PRINT ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .sticky-bar, .phase-section, .project-info, .assessment-section, .actions-bar,
  .cta-block, .modal-overlay, .lead-gate-overlay, .incomplete-warning, .missing-panel,
  .autosave-toast, .role-section { display: none !important; }
  .hero { background: #fff; }
  .hero-head { padding: 24px 0; }
  .hero h1 { color: #0B1B44; }
  .hero .intro, .hero-eyebrow { color: #5A6B92; }
  .hero::before, .hero::after, .hero > .hero-wave, .hero-shape, .hero-nav, .hero-actions { display: none; }
  .results-section { display: block !important; padding-top: 0; }
  .result-card, .radar-container, .breakdown, .gap-card, .no-gaps, .ai-section {
    box-shadow: none; break-inside: avoid;
  }
  .container { max-width: 100%; }
}


/* ============================================================================
   CAPA ESTRUCTURAL — layout y estados de visibilidad que el JS conmuta.
   Se conserva tal cual estaba: solo cambia la piel, no el comportamiento.
   ========================================================================== */

.sticky-bar { display: none; }
.sticky-bar.visible { display: block; }
.sticky-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.progress-track { flex: 1; min-width: 120px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; transition: width var(--transition); }
.progress-text, .progress-score, .btn-calculate { white-space: nowrap; }
.sticky-missing { display: none; align-items: center; gap: 6px; }
.sticky-missing.visible { display: inline-flex; }

.role-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.phase-card, .disc-header, .collapsible-header, .scale-header { user-select: none; }

.collapsible-header, .scale-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.collapsible-body { display: none; }
.collapsible-body.open { display: block; }
.scale-body { display: none; }
.scale-body.open { display: block; }

.assessment-section { display: none; }
.assessment-section.visible { display: block; }
.disc-body { display: none; }
.disc-body.open { display: block; }

.comment-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment-acciones { display: flex; align-items: center; gap: 10px; flex: none; }
.btn-voz { display: inline-flex; align-items: center; gap: 5px; }
.btn-voz svg { width: 12px; height: 12px; flex: none; }

.evidence-section { margin-top: 12px; }
.evidence-toggle { display: inline-flex; align-items: center; gap: 6px; }
.evidence-form { display: none; }
.evidence-form.open { display: block; }
.evidence-form-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.evidence-form-row:last-child { margin-bottom: 0; }
.evidence-form input[type="url"] { flex: 1; min-width: 200px; }
.evidence-form input[type="file"] { display: none; }
.evidence-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.evidence-list:empty { display: none; }
.evidence-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.evidence-chip .ev-chip-icon { display: inline-flex; flex: none; font-size: 14px; }
.evidence-chip .ev-chip-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.evidence-chip a.ev-chip-name { text-decoration: none; }
.evidence-chip a.ev-chip-name:hover { text-decoration: underline; }
.evidence-chip .ev-chip-remove { background: transparent; border: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 2px; font-weight: 700; }

.autosave-toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 1100;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.autosave-toast.visible { opacity: 1; transform: translateY(0); }
@media print { .autosave-toast { display: none !important; } }

.incomplete-warning, .missing-panel { display: none; }
.incomplete-warning.visible, .missing-panel.visible { display: block; }
.missing-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.missing-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.missing-chip { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.missing-chip .mc-n { border-radius: 999px; padding: 1px 7px; font-size: 11px; font-variant-numeric: tabular-nums; }
.missing-tag { display: none; }
.criterion.missing .missing-tag { display: inline-flex; align-items: center; margin-bottom: 8px; }
.disc-pending { display: none; white-space: nowrap; font-variant-numeric: tabular-nums; margin-right: 6px; }
.disc-pending.visible { display: inline-block; }

.results-section { display: none; }
.results-section.visible { display: block; }
.radar-svg-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; overflow: visible; }
.radar-svg-wrap svg { max-width: 100%; height: auto; overflow: visible; }
.radar-legend { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.radar-legend .item { display: flex; align-items: center; gap: 8px; }
.radar-legend .swatch { width: 24px; height: 0; border-top-width: 2px; border-top-style: solid; }
.radar-legend .swatch.dashed { border-top-style: dashed; }

.breakdown table { width: 100%; border-collapse: collapse; }
.breakdown th { text-align: left; }
.breakdown td { vertical-align: middle; }
.breakdown tr:last-child td { border-bottom: none; }
.bar-cell { min-width: 120px; }

.gap-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.gap-actions { list-style: none; margin-bottom: 8px; }
.gap-actions li { position: relative; }
.gap-actions li::before { position: absolute; }

.ai-section { display: none; }
.ai-section.visible { display: block; }
.ai-section .ai-header { display: flex; align-items: center; flex-wrap: wrap; }
.ai-list { list-style: none; padding: 0; margin: 0; }
.ai-list li .ai-evidence, .ai-list li .ai-meta { display: block; margin-top: 4px; }
.ai-loading { text-align: center; padding: 40px 20px; }
.ai-loading .spinner {
  display: inline-block; width: 28px; height: 28px; border: 3px solid var(--border-sep);
  border-top-color: var(--blue-500); border-radius: 50%;
  animation: spin .8s linear infinite; margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.backend-only { display: none; }
.backend-enabled .backend-only { display: inline-flex; }

.actions-bar { display: flex; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn .mg-ico { font-size: 16px; }

.modal-overlay, .lead-gate-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  align-items: center; justify-content: center;
}
.modal-overlay { z-index: 1000; }
.lead-gate-overlay { z-index: 1500; }
.modal-overlay.visible, .lead-gate-overlay.visible { display: flex; }
.modal-actions { display: flex; flex-wrap: wrap; }
.modal-actions .btn { min-width: 110px; }
.lead-gate-form .form-group { margin-bottom: 0; }
.lead-gate-form .field-error { display: none; }
.lead-gate-form .form-group.error .field-error { display: block; }
.lead-gate-consent { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.lead-gate-consent input { margin-top: 3px; flex: none; }
.lead-gate-consents > div + div { margin-top: 10px; }
.lead-gate-actions { display: flex; flex-wrap: wrap; padding: 4px 0 0; }
.lead-gate-submit { flex: 1; min-width: 200px; cursor: pointer; transition: var(--transition); }
.lead-gate-cancel { cursor: pointer; transition: var(--transition); }

.barra-gerencias { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.barra-gerencias .sep { flex: 1 1 auto; }
.ger-pastilla { display: inline-flex; align-items: center; gap: 6px; line-height: 1; }
.ger-pastilla.activa { cursor: default; }
.ger-pastilla .puntaje { font-variant-numeric: tabular-nums; font-weight: 800; }
.ger-marca { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }

.comparativo { margin-top: 24px; }
.comp-leyenda { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 12px; }
.comp-leyenda .item { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.comp-leyenda .punto { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.tabla-comp-wrap { overflow-x: auto; margin-top: 20px; }
.tabla-comp { width: 100%; border-collapse: collapse; }
.tabla-comp th, .tabla-comp td { text-align: center; }
.tabla-comp th.disc, .tabla-comp td.disc { text-align: left; min-width: 180px; }
.tabla-comp td.val, .tabla-comp td.brecha { font-variant-numeric: tabular-nums; font-weight: 700; }
.tabla-comp tr.total td { border-bottom: none; padding-top: 12px; font-weight: 800; }
.tabla-comp tr.total td.disc { color: var(--ink-2); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }

.criterion.missing { padding-left: 14px; }
.role-section h2, .phase-section h2 { line-height: 1.3; }
