/*
 * maturity.css · Diagnóstico y resultado de madurez digital
 * Aareon Spain · landing digitalización
 * ──────────────────────────────────────────────────────────
 */

/* ════════════════════════════════════════════════
   TOKENS · complementan los de main.css
   ════════════════════════════════════════════════ */
:root {
  /* Radios */
  --radius-card:  24px;
  --radius-pill:  999px;
  --radius-input: 12px;
  --radius-sm:    16px;

  /* Altura del header principal (para offsets sticky) */
  --header-h:     72px;
  --tabs-h:       52px;

  /* Colores semánticos de nivel */
  --lvl1-bg:      #fde8e4;   --lvl1-fg:   #c9462a;
  --lvl2-bg:      #fdf3e0;   --lvl2-fg:   #b07414;
  --lvl3-bg:      #e8f0ff;   --lvl3-fg:   var(--royal);
  --lvl4-bg:      #e4e7f5;   --lvl4-fg:   var(--navy);

  /* Colores semánticos adicionales */
  --lvl1-checked-bg: #fff3f1;
  --lvl2-checked-bg: #fffbf0;
  --lvl3-checked-bg: #f0faf7;  --lvl3-checked-fg: #0f6e56;
  --lvl4-checked-bg: #f0f5ff;

  /* Colores de UI neutros */
  --border-default:  #eaebef;
  --border-light:    #d7d9de;
  --border-rule:     rgba(8,11,25,.07);
  --border-nav:      rgba(8,11,25,.07);
  --bg-progress:     rgba(8,11,25,.08);

  /* Colores de insight */
  --insight-fortaleza-bg:      #e8f0ff;
  --insight-fortaleza-border:  var(--royal);
  --insight-fortaleza-title:   #0c3d8a;
  --insight-fortaleza-texto:   #1c5bba;
  --insight-desequil-bg:       #fdf3e0;
  --insight-desequil-border:   #b07414;
  --insight-desequil-title:    #633806;
  --insight-desequil-texto:    #854f0b;

  /* Colores de distribución sectorial */
  --dist-band-bg:   #d7d9de;
  --dist-media-fg:  #b07414;
  --dist-you-fg:    var(--navy);
  --dist-meta-fg:   var(--royal);

  /* Color de cabecera de bloque (número decorativo) */
  --block-num-fg:   #d7d9de;

  /* Espaciados base */
  --gap-xs:   6px;
  --gap-sm:   10px;
  --gap-md:   14px;
  --gap-lg:   16px;
  --gap-xl:   20px;
  --gap-2xl:  28px;

  /* Márgenes de sección */
  --mb-section: 40px;
  --mb-block:   48px;
  --mb-list:    36px;

  /* Padding interno de tarjetas */
  --pad-card:   22px 26px;
  --pad-panel:  clamp(22px, 2.4vw, 32px);
  --pad-ctx:    clamp(24px, 3vw, 40px);
  --pad-submit: 24px 32px;
  --pad-cta:    clamp(32px, 3.5vw, 48px);
  --pad-cluster: 22px 24px;
  --pad-insight: 14px 18px;
  --pad-input:   10px 16px;
  --pad-opt:     11px 12px 10px;
  --pad-hm-cell: 14px 10px;
}


/* ════════════════════════════════════════════════
   COMPARTIDO · usado en ambas páginas
   ════════════════════════════════════════════════ */

.diag-hero,
.res-hero {
  background: var(--hero-grad);
  color: #fff;
  padding-block: clamp(48px, 5.5vw, 72px);
}
.diag-hero h1 { margin: 0 0 var(--gap-lg); font-size: clamp(2.2rem, 3.8vw, 3.4rem); }
.diag-hero p  { margin: 0; color: rgba(255,255,255,.9); font-size: 1.08rem; max-width: 52ch; }

/* KPIs */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-lg);
  margin-bottom: var(--mb-section);
}
.kpi {
  background: var(--cream-card);
  border-radius: var(--radius-card);
  padding: var(--pad-card);
}
.kpi-label { font-size: .82rem; color: var(--muted); margin-bottom: var(--gap-xs); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 2.2rem; color: var(--ink); line-height: 1; }
.kpi-sub   { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.tab-badge {
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background: var(--coral);
    color: #fff;
    line-height: 1.4;
}
/* Panel genérico */
.panel {
  background: var(--cream-card);
  border-radius: var(--radius-card);
  padding: var(--pad-panel);
}
.panel-label {
  font-size: .76rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 18px;
}

/* Barras de nivel por bloque */
.block-list { display: flex; flex-direction: column; gap: var(--gap-sm); }
.block-item { display: flex; align-items: center; gap: 12px; }
.block-name { font-size: .9rem; color: var(--ink-soft); flex: 1; min-width: 0; max-width: 350px;}
.bar-track  { width: 90px; height: 5px; background: var(--border-light); border-radius: var(--radius-pill); overflow: hidden; flex-shrink: 0; }
.bar-fill   { height: 100%; border-radius: var(--radius-pill); }
.bar-fill.n1 { background: var(--lvl1-fg); }
.bar-fill.n2 { background: var(--lvl2-fg); }
.bar-fill.n3 { background: var(--lvl3-fg); }
.bar-fill.n4 { background: var(--lvl4-fg); }

/* Nivel tag */
.nivel-tag {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 9px; border-radius: var(--radius-pill); flex-shrink: 0; white-space: nowrap;
}
.nt-1 { background: var(--lvl1-bg); color: var(--lvl1-fg); }
.nt-2 { background: var(--lvl2-bg); color: var(--lvl2-fg); }
.nt-3 { background: var(--lvl3-bg); color: var(--lvl3-fg); }
.nt-4 { background: var(--lvl4-bg); color: var(--lvl4-fg); }

/* Horizonte pills */
.horizonte-pill {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-pill);
  flex-shrink: 0; margin-top: 4px; white-space: nowrap;
}
.h-corto { background: var(--lvl1-bg); color: var(--lvl1-fg); }
.h-medio  { background: var(--lvl2-bg); color: var(--lvl2-fg); }
.h-largo  { background: var(--lvl3-bg); color: var(--lvl3-fg); }

/* Roadmap */
.roadmap { display: flex; flex-direction: column; gap: 0; margin-bottom: var(--mb-section); }
.roadmap-item {
  display: grid; grid-template-columns: 36px 1fr auto;
  align-items: flex-start; gap: var(--gap-md);
  padding: 18px 0; border-bottom: 1px solid var(--border-rule);
}
.roadmap-item:last-child { border-bottom: none; }
.ri-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cream-card); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .86rem; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}
.ri-block  { font-size: .97rem; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.ri-accion { font-size: .9rem; color: var(--ink-soft); line-height: 1.4; }
.ri-step { font-size: .75rem; font-weight: 700; padding: 1px 2px; border-radius: var(--radius-pill); border:solid 1px }

.ri-step-lvl-1 { color: var(--lvl1-fg); border-color: var(--lvl1-fg); background: var(--lvl1-checked-bg); }
.ri-step-lvl-2 { color: var(--lvl2-fg); border-color: var(--lvl2-fg); background: var(--lvl2-checked-bg); }
.ri-step-lvl-3 { color: var(--lvl3-fg); border-color: var(--lvl3-fg); background: var(--lvl3-checked-bg); }
.ri-step-lvl-4 { color: var(--lvl4-fg); border-color: var(--lvl4-fg); background: var(--lvl4-checked-bg); }
/* Roadmap · lista de pasos sin viñetas */
.roadmap-steps { list-style: none; margin: 8px 0 0; padding: 0; }
.roadmap-steps > li { margin-bottom: 12px; }
.roadmap-steps > li:last-child { margin-bottom: 0; }

/* Número de pregunta en círculo azul oscuro */
.ri-qnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: .78rem; font-weight: 700; line-height: 1;
  margin-right: 6px; flex-shrink: 0; vertical-align: middle;
}

  .mock-banner{
    background: var(--ink); color: rgba(255,255,255,.8);
    font-size:.78rem; letter-spacing:.04em; text-align:center;
    padding:8px 12px;
  }
  .mock-banner strong{ color:#fff; }

  .cluster-legend{ display:flex; flex-wrap:wrap; gap:var(--gap-md); margin-bottom:var(--mb-list); padding-top:var(--gap-md); }
  .cluster-legend-item{
    display:flex; align-items:center; gap:8px;
    font-size:.82rem; color:var(--ink-soft);
    background:var(--cream-card); padding:8px 14px; border-radius:var(--radius-pill);
  }
  .cluster-legend-item.is-you{ box-shadow: inset 0 0 0 1.5px var(--royal); color:var(--ink); font-weight:600; }
  .cl-swatch{ width:10px; height:10px; border-radius:50%; flex-shrink:0; }
  .cl-count{ color:var(--muted); font-weight:400; }

  .rank-note{ font-size:.82rem; color:var(--muted); margin: -8px 0 var(--mb-list); }

  .evo-summary{ display:flex; gap:var(--gap-xl); flex-wrap:wrap; margin-bottom:var(--gap-lg); }
  .evo-summary-item{ font-size:.85rem; color:var(--ink-soft); }
  .evo-summary-item strong{ color:var(--ink); font-weight:700; }
  .evo-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }

  .panel + .panel{ margin-top: var(--mb-list); }
  #resultado .panel + .panel{ margin-top: 0; }

  .section-note{ font-size:.85rem; color:var(--muted); margin: 6px 0 var(--mb-list); }

/* CTA final */
.res-cta {
  background: var(--navy); color: #fff;
  border-radius: var(--radius-card);
  padding: var(--pad-cta);
  text-align: center; margin-bottom: 0;
}
.res-cta h2 { margin: 0 0 12px; font-size: clamp(1.6rem, 2.8vw, 2.4rem); }
.res-cta p  { margin: 0 auto 28px; max-width: 52ch; color: rgba(255,255,255,.84); font-size: 1rem; }

/* Insights */
.insights { display: flex; flex-direction: column; gap: 12px; margin-bottom: var(--mb-list); }
.insight {
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--pad-insight);
}
.insight.fortaleza     { background: var(--insight-fortaleza-bg); border-left-color: var(--insight-fortaleza-border); }
.insight.desequilibrio { background: var(--insight-desequil-bg);  border-left-color: var(--insight-desequil-border); }
.insight-title { font-size: .9rem; font-weight: 700; margin-bottom: 4px; }
.insight.fortaleza     .insight-title { color: var(--insight-fortaleza-title); }
.insight.desequilibrio .insight-title { color: var(--insight-desequil-title); }
.insight-texto { font-size: .88rem; line-height: 1.5; }
.insight.fortaleza     .insight-texto { color: var(--insight-fortaleza-texto); }
.insight.desequilibrio .insight-texto { color: var(--insight-desequil-texto); }

/* ════════════════════════════════════════════════
   DIAGNÓSTICO · formulario
   ════════════════════════════════════════════════ */

.stage-chart { width: min(100%, var(--maxw)); max-width: 100%; aspect-ratio: 2 / 1; }

.progress-rail {
  height: 3px; background: var(--bg-progress);
  position: sticky; top: var(--header-h); z-index: 40;
}
.progress-fill {
  height: 100%; background: var(--royal); width: 0%;
  transition: width .35s cubic-bezier(.22,.61,.36,1);
}

/* Navegación por categorías (evaluate.handlebars) */
#formulario .tabs-nav { top: calc(var(--header-h) + 3px); z-index: 39; margin-bottom: var(--mb-list); }
#formulario .tab-btn  { gap: 9px; }

.tab-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--border-light);
  transition: background .18s;
}
.tab-status-dot.is-complete   { background: #1a9c5e; }
.tab-status-dot.is-incomplete { background: var(--coral); }

/* Listado de preguntas · menú lateral + zona principal (evaluate.handlebars) */
.questions-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--gap-2xl);
  align-items: start;
}
.side-nav {
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: calc(var(--header-h) + var(--tabs-h) + 3px + var(--gap-lg));
}
.side-nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: none; border-radius: var(--radius-input);
  background: none; text-align: left;
  font-size: .92rem; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: background .18s, color .18s;
}
.side-nav-btn:hover     { background: var(--cream-card); color: var(--ink); }
.side-nav-btn.is-active { background: var(--cream-card); color: var(--royal); }

.questions-main { min-width: 0; }

.block-panel { display: none; }
.block-panel.is-active { display: block; }

@media (max-width: 860px) {
  .questions-layout { grid-template-columns: 1fr; }
  .side-nav {
    position: static; flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; gap: 8px; padding-bottom: 6px; margin-bottom: var(--gap-lg);
  }
  .side-nav-btn { white-space: nowrap; flex-shrink: 0; }
}

.ctx-card {
  background: var(--cream-card); border-radius: var(--radius-card);
  padding: var(--pad-ctx); margin-bottom: var(--mb-section);
}
.ctx-tag {
  display: inline-block;
  font-size: .76rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--gap-xl);
}
.ctx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.ctx-field      { display: flex; flex-direction: column; gap: var(--gap-xs); }
.ctx-field.full { grid-column: 1 / -1; }
.ctx-field label { font-size: .94rem; font-weight: 600; color: var(--ink); }
.ctx-field input,
.ctx-field select,
.ctx-field textarea {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-input);
  padding: var(--pad-input);
  font-size: .97rem; font-family: var(--font-body);
  color: var(--ink); background: #fff;
  outline: none; transition: border-color .18s, box-shadow .18s;
}
.ctx-field input:focus,
.ctx-field select:focus,
.ctx-field textarea:focus {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(17,119,255,.18);
}
.ctx-field textarea { resize: vertical; min-height: 72px; }
.ctx-field input.is-invalid,
.ctx-field select.is-invalid,
.ctx-field textarea.is-invalid { border-color: var(--coral); }

.ctx-field select:disabled,.ctx-field input:disabled,.ctx-field textarea:disabled {  background-color: #fff7e6!important;}
/*
.ctx-field :is(input, select, textarea):is(:read-only, :disabled) { 
  background-color: #fff7e6;}
*/
.diag-block   { margin-bottom: var(--mb-block); }
.block-header {
  display: flex; align-items: baseline; gap: var(--gap-md);
  padding-bottom: var(--gap-md); border-bottom: 2px solid var(--cream);
  margin-bottom: var(--gap-xl);
}
.block-num   { font-family: var(--font-display); font-size: 2.4rem; color: var(--block-num-fg); line-height: 1; flex-shrink: 0; }
.block-title { font-size: 1.12rem; font-weight: 700; color: var(--ink); }

.q-card {
  background: #fff; border: 1.5px solid var(--border-default);
  border-radius: var(--radius-sm); padding: 20px 24px;
  margin-bottom: 12px; transition: border-color .18s;
}
.q-card:focus-within { border-color: var(--royal); }
.q-card.is-invalid   { border-color: var(--coral); }
.q-code  { font-size: .75rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--gap-xs); }
.q-label { font-size: .98rem; font-weight: 600; color: var(--ink); margin-bottom: var(--gap-md); line-height: 1.35; }
.q-card .alert { margin-top: var(--gap-xs); }

/* Indicador de guardado automático por pregunta */
.q-save {
  display: inline-block; margin-top: var(--gap-xs);
  font-size: .75rem; font-weight: 600;
}
.q-save.is-saving { color: var(--muted); }
.q-save.is-saved  { color: #1a9c5e; }
.q-save.is-error  { color: var(--coral); }

.options-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-xs); }
.opt input[type="radio"] { display: none; }
.opt label {
  display: flex; flex-direction: column; gap: 5px;
  padding: var(--pad-opt); border: 1.5px solid var(--border-default);
  border-radius: var(--radius-input); cursor: pointer;
  transition: border-color .15s, background .15s;
  min-height: 76px; user-select: none;
}
.opt label:hover { border-color: #b5c8f4; background: #f4f7ff; }
.lvl-tag {
  font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--radius-pill); align-self: flex-start;
  background: var(--border-default); color: var(--muted);
  transition: background .15s, color .15s;
}
.opt-text { font-size: .84rem; line-height: 1.35; color: var(--ink-soft); transition: color .15s; }

.opt[data-level="1"] input:checked + label { border-color: var(--lvl1-fg); background: var(--lvl1-checked-bg); }
.opt[data-level="1"] input:checked + label .lvl-tag  { background: var(--lvl1-fg); color: #fff; }
.opt[data-level="1"] input:checked + label .opt-text  { color: var(--lvl1-fg); }

.opt[data-level="2"] input:checked + label { border-color: var(--lvl2-fg); background: var(--lvl2-checked-bg); }
.opt[data-level="2"] input:checked + label .lvl-tag  { background: var(--lvl2-fg); color: #fff; }
.opt[data-level="2"] input:checked + label .opt-text  { color: var(--lvl2-fg); }

.opt[data-level="3"] input:checked + label { border-color: var(--lvl3-checked-fg); background: var(--lvl3-checked-bg); }
.opt[data-level="3"] input:checked + label .lvl-tag  { background: var(--lvl3-checked-fg); color: #fff; }
.opt[data-level="3"] input:checked + label .opt-text  { color: var(--lvl3-checked-fg); }

.opt[data-level="4"] input:checked + label { border-color: var(--lvl4-fg); background: var(--lvl4-checked-bg); }
.opt[data-level="4"] input:checked + label .lvl-tag  { background: var(--lvl4-fg); color: #fff; }
.opt[data-level="4"] input:checked + label .opt-text  { color: var(--lvl4-fg); }

.submit-zone {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--gap-lg);
  background: var(--cream-card); border-radius: var(--radius-card);
  padding: var(--pad-submit); margin-top: var(--mb-section);
}
.progress-label        { font-size: .94rem; color: var(--muted); }
.progress-label strong { color: var(--ink); font-weight: 700; }


/* ════════════════════════════════════════════════
   RESULTADO · informe
   ════════════════════════════════════════════════ */

.res-hero-grid {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: var(--gap-2xl);
}
.res-eyebrow { color: rgba(255,255,255,.65); }
.res-hero h1 { margin: 0; font-size: clamp(1.9rem, 3.4vw, 3rem); }
.score-wrap  { text-align: right; flex-shrink: 0; }
.score-big   { font-family: var(--font-body); font-size: clamp(3.2rem, 6vw, 5.2rem); line-height: 1; color: #fff; }

.score-sub   { font-size: .82rem; color: rgba(255,255,255,.6); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.nivel-pill  {
  display: inline-block; margin-top: 10px;
  padding: 5px 18px; border-radius: var(--radius-pill);
  font-size: .9rem; font-weight: 700;
  background: rgba(255,255,255,.18); color: #fff;
}

/* Tabs */
.tabs-nav {
  position: sticky; top: var(--header-h); z-index: 30;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--border-nav);
}
.tabs-nav-inner {
  display: flex; align-items: center; height: var(--tabs-h);
  overflow-x: auto; scrollbar-width: none;
}
.tabs-nav-inner::-webkit-scrollbar { display: none; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 22px; height: 100%;
  background: none; border: none; border-bottom: 2px solid transparent;
  font-size: .92rem; font-weight: 600; color: var(--muted);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: color .18s, border-color .18s;
}
.tab-btn:hover     { color: var(--ink); }
.tab-btn.is-active { color: var(--royal); border-bottom-color: var(--royal); }
.tab-btn .tab-dot  { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .45; flex-shrink: 0; }
.tab-btn.is-active .tab-dot { opacity: 1; }
.tab-panel          { display: none; }
.tab-panel.is-active { display: block; }

/* Radar + bloques */
.diag-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--gap-2xl); margin-bottom: var(--mb-section); align-items: start;
}
#radarChart { width: 100%; height: 300px; }

/* Sector */
.sector-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--gap-lg); margin-bottom: 32px; flex-wrap: wrap;
}
.sector-header h2 { margin: 0 0 4px; font-size: clamp(1.4rem, 2.4vw, 2rem); }
.sector-header p  { margin: 0; font-size: .94rem; color: var(--muted); }
.perfil-pill {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: var(--radius-pill);
  font-size: .82rem; font-weight: 700;
  background: var(--lvl3-bg); color: var(--lvl3-fg);
  white-space: nowrap; flex-shrink: 0;
}

/* Distribución */
.dist-section-label {
  font-size: .76rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--gap-md);
}
.dist-legend {
  display: flex; align-items: center; gap: var(--gap-xl);
  margin-bottom: var(--gap-xl); flex-wrap: wrap;
}
.dist-legend-item { display: flex; align-items: center; gap: var(--gap-xs); font-size: .82rem; color: var(--ink-soft); }
.leg-swatch-blue  { width: 12px; height: 12px; border-radius: 3px; background: var(--dist-you-fg);   flex-shrink: 0; }
.leg-swatch-gray  { width: 12px; height: 12px; border-radius: 3px; background: var(--dist-band-bg);  flex-shrink: 0; }
.leg-swatch-amber { width: 3px;  height: 14px; border-radius: 1px; background: var(--dist-media-fg); flex-shrink: 0; }

.dist-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: var(--mb-list); }
.dist-row  { display: grid; grid-template-columns: 120px 1fr 72px; align-items: center; gap: var(--gap-md); }
.dist-row-label { font-size: .88rem; color: var(--ink-soft); }
.dist-track {
  position: relative; height: 22px;
  background: var(--cream-card); border-radius: var(--radius-pill); overflow: visible;
}
.dist-band       { position: absolute; top: 6px; height: 10px; background: var(--dist-band-bg);  border-radius: var(--radius-pill); }
.dist-media-line { position: absolute; top: 2px; width: 3px;  height: 18px; background: var(--dist-media-fg); border-radius: 2px; transform: translateX(-50%); }
.dist-you-line   { position: absolute; top: 0;   width: 4px;  height: 22px; background: var(--dist-you-fg);   border-radius: 2px; transform: translateX(-50%); }
.dist-row-meta   { font-size: .78rem; font-weight: 700; color: var(--dist-meta-fg); text-align: right; white-space: nowrap; }

/* Heatmap */
.heatmap-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap-xs); margin-bottom: var(--mb-list); }
.hm-cell { border-radius: var(--radius-sm); padding: var(--pad-hm-cell); text-align: center; }
.hm-name { font-size: .78rem; color: var(--muted); margin-bottom: var(--gap-xs); }
.hm-val  { font-size: 1.3rem; font-weight: 700; line-height: 1; }
.hm-n1 { background: var(--lvl1-bg); } .hm-n1 .hm-val { color: var(--lvl1-fg); }
.hm-n2 { background: var(--lvl2-bg); } .hm-n2 .hm-val { color: var(--lvl2-fg); }
.hm-n3 { background: var(--lvl3-bg); } .hm-n3 .hm-val { color: var(--lvl3-fg); }
.hm-n4 { background: var(--lvl4-bg); } .hm-n4 .hm-val { color: var(--lvl4-fg); }

/* Cluster */
.cluster-card {
  display: flex; gap: var(--gap-lg); align-items: flex-start;
  border: 1.5px solid var(--border-default); border-radius: var(--radius-card);
  padding: var(--pad-cluster); margin-bottom: var(--mb-list);
}
.cluster-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--lvl3-bg); color: var(--lvl3-fg); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}
.cluster-name  { font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.cluster-desc  { font-size: .9rem; color: var(--ink-soft); line-height: 1.45; margin-bottom: 10px; }
.cluster-badge {
  display: inline-block;
  font-size: .7rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--lvl3-bg); color: var(--lvl3-fg);
}

/* Conclusiones */
.conclusiones-intro { font-size: 1.06rem; color: var(--ink-soft); margin-bottom: var(--mb-list); line-height: 1.55; }
.conclusion-item {
  display: grid; grid-template-columns: 36px 1fr;
  gap: var(--gap-md); align-items: flex-start;
  padding: 16px 0; border-bottom: 1px solid var(--border-rule);
}
.conclusion-item:last-child { border-bottom: none; }
.conclusion-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; flex-shrink: 0;
}
.conclusion-text        { font-size: .95rem; color: var(--ink); line-height: 1.5; }
.conclusion-text strong { color: var(--ink); }


/* ════════════════════════════════════════════════
   HOMEPAGE · buscador y alta de cliente
   ════════════════════════════════════════════════ */
.mode-switch {
  display: inline-flex; gap: 4px; background: var(--cream-card);
  border-radius: var(--radius-pill); padding: 4px; margin-bottom: var(--mb-list);
}
.mode-btn {
  border: none; background: none; cursor: pointer;
  padding: 10px 22px; border-radius: var(--radius-pill);
  font-size: .92rem; font-weight: 600; color: var(--muted);
  transition: background .18s, color .18s;
}
.mode-btn.is-active { background: #fff; color: var(--royal); box-shadow: 0 4px 14px -8px rgba(8,11,25,.35); }
.mode-panel { display: none; }
.mode-panel.is-active { display: block; }

.search-row { display: flex; gap: 12px; }
.search-row input {
  flex: 1;
  border: 1.5px solid var(--border-light); border-radius: var(--radius-input);
  padding: var(--pad-input); font-size: .97rem; font-family: var(--font-body);
  color: var(--ink); background: #fff; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.search-row input:focus { border-color: var(--royal); box-shadow: 0 0 0 3px rgba(17,119,255,.18); }

.search-status { font-size: .9rem; color: var(--muted); margin-top: var(--gap-md); }

.customer-results { display: flex; flex-direction: column; gap: 10px; margin-top: var(--gap-xl); }
.customer-card {
  display: flex; flex-direction: column; gap: var(--gap-md);
  background: #fff; border: 1.5px solid var(--border-default); border-radius: var(--radius-sm);
  padding: 16px 20px; transition: border-color .18s;
}
.customer-card:hover { border-color: #b5c8f4; }
.customer-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.customer-name { font-size: .98rem; font-weight: 700; color: var(--ink); }
.customer-meta { display: flex; gap: 6px; font-size: .82rem; color: var(--muted); margin-top: 3px; }
.customer-meta span + span::before { content: '·'; margin-right: 6px; color: var(--border-light); }

/* Assessments previos del cliente */
.assessment-list {
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--border-default); padding-top: var(--gap-md);
}
.assessment-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md);
  background: var(--cream-card); border-radius: var(--radius-input); padding: 8px 14px;
}
.assessment-meta { display: flex; align-items: center; gap: var(--gap-md); font-size: .84rem; color: var(--ink-soft); flex-wrap: wrap; }
.assessment-when  { font-weight: 600; color: var(--ink); }
.assessment-score { color: var(--muted); }
.assessment-status {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 9px; border-radius: var(--radius-pill); white-space: nowrap;
}
.assessment-status.st-in_progress { background: var(--lvl2-bg); color: var(--lvl2-fg); }
.assessment-status.st-completed   { background: var(--lvl4-bg); color: var(--lvl4-fg); }
.assessment-status.st-cancelled   { background: var(--lvl1-bg); color: var(--lvl1-fg); }
.assessment-item .btn { padding: 7px 16px; font-size: .84rem; }

@media (max-width: 620px) {
  .search-row { flex-direction: column; }
  .customer-card-top { flex-direction: column; align-items: flex-start; }
  .assessment-item { flex-direction: column; align-items: flex-start; }
}

/* ════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════ */

@media (max-width: 860px) {
  .res-hero-grid { grid-template-columns: 1fr; }
  .score-wrap    { text-align: left; }
  .diag-cols     { grid-template-columns: 1fr; }
  .kpi-row       { grid-template-columns: 1fr 1fr; }
  .heatmap-grid  { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .options-grid { grid-template-columns: 1fr 1fr; }
  .ctx-grid     { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .dist-row       { grid-template-columns: 88px 1fr 56px; }
  .kpi-row        { grid-template-columns: 1fr; }
  .heatmap-grid   { grid-template-columns: repeat(2, 1fr); }
  .roadmap-item   { grid-template-columns: 32px 1fr; }
  .horizonte-pill { grid-column: 2; }
}
@media (max-width: 480px) {
  .options-grid { grid-template-columns: 1fr; }
}