/* DMC Graphic Demo — strict Imppulsor palette only */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@400;500;600&display=swap');

:root {
  --c-deep: #030F23;
  --c-navy: #001857;
  --c-blue: #126CFB;
  --c-sky: #54C4F5;
  --c-pale: #9CDEFA;
  --c-gray: #747882;
  --c-white: #F0F2F6;

  --font: 'Jost', system-ui, sans-serif;
  /* Design canvas max width; fluid below 1200px */
  --shell-w: 1200px;
  --shell-h: 900px;
  --header-h: 86px;
  /* Same band height for pager + copyright */
  --band-h: 36px;
  --footer-h: var(--band-h);
  --copy-h: var(--band-h);
  --sidebar-w: 320px;
  /* Chart meta / heatmap / bullet labels (v2) — real 15px */
  --meta-size: 15px;
  --radius: 10px;
  --radius-sm: 6px;
  /* Single spacing rhythm for shell, charts, sidebar, pager */
  --gap: 16px;
  /* Side legend column — constant so plot + grid lines match every chart */
  --chart-legend-w: 240px;
  /* Shared hover motion across the dashboard */
  --ease-hover: 0.25s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Elegant hover transitions for all interactive UI */
button,
a,
.header__salir,
.header__lang,
.header__nav-btn,
.chart-btn,
.dl-menu button,
.filter-btn,
.nav-item,
.pager__btn,
.shell__social,
.shell__copy a.shell__copy-line,
.heatmap-cell {
  transition:
    background-color var(--ease-hover),
    background var(--ease-hover),
    color var(--ease-hover),
    border-color var(--ease-hover),
    opacity var(--ease-hover),
    filter var(--ease-hover),
    transform var(--ease-hover),
    box-shadow var(--ease-hover);
}

html {
  margin: 0;
  padding: 0;
  /* Document is the scrollport so position:sticky can pin to the viewport */
  height: auto;
  overflow-x: hidden;
  overflow-y: scroll;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  color: var(--c-deep);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

body {
  display: block;
  min-height: 100dvh;
  height: auto;
  max-height: none;
  overflow: visible;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ——— Shell (max 1200px; fluid on smaller viewports; sticky header) ——— */
.shell {
  position: relative;
  width: 100%;
  max-width: var(--shell-w);
  min-width: 0;
  height: auto;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: visible;
  background: #ffffff;
  color: #000;
  border-radius: 0;
  box-shadow: none;
}

/* ——— Boot screen (covers empty shell until charts are ready) ——— */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

.boot__logo {
  width: min(320px, 72vw);
  height: auto;
  opacity: 0.95;
}

.boot__spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(18, 108, 251, 0.18);
  border-top-color: var(--c-blue);
  border-radius: 50%;
  animation: bootSpin 0.7s linear infinite;
}

.boot__label {
  margin: 0;
  max-width: 320px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  color: #000000;
  opacity: 1;
}

@keyframes bootSpin {
  to {
    transform: rotate(360deg);
  }
}

.shell--booting .shell__body,
.shell--booting .header,
.shell--booting .site-footer {
  visibility: hidden;
}

.shell__body {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--gap);
  align-items: stretch;
  min-height: 0;
  width: 100%;
  height: calc(var(--shell-h) - var(--header-h));
  min-height: calc(var(--shell-h) - var(--header-h));
  padding: var(--gap);
  background: #ffffff;
  overflow: hidden;
}

/* ——— Header ——— */
.header {
  /* Sticky inside a column flex: must NOT stretch to full shell height */
  position: sticky;
  top: 0;
  z-index: 100;
  align-self: flex-start;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  width: 100%;
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 10px 16px;
  background: #ffffff;
  color: #000000;
  border-bottom: 1px solid #000000;
  transition:
    background 0.25s ease,
    background-color 0.25s ease,
    backdrop-filter 0.25s ease,
    -webkit-backdrop-filter 0.25s ease;
}

.header.is-scrolled {
  background: #ffffff;
  background-color: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.header__logo {
  flex-shrink: 0;
  width: 181px;
  height: 56px;
}

.header__logo img {
  width: 181px;
  height: 56px;
  object-fit: contain;
  filter: none;
}

.header__nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 42px;
  min-width: 0;
}

.header__nav-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: #000000;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  cursor: default;
}

/* Salir (left) + flags (right), like Imppulsor web Contacto + langs */
.header__actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 30px;
}

.header__salir {
  box-sizing: border-box;
  margin: 0;
  padding: 6px 32px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: #126cfb;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.header__salir:hover {
  background: #02133d;
  color: #ffffff;
}

.header__langs {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header__lang {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 16px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.8;
}

.header__lang:hover,
.header__lang.is-active {
  opacity: 1;
}

.header__flag {
  display: block;
  width: 24px;
  height: 16px;
  object-fit: cover;
}

/* Title + client under header (white content) */
.page-meta {
  margin: 0 0 var(--gap);
  padding-bottom: var(--gap);
  border-bottom: 1px solid #e3e3e3;
}

.page-meta__title {
  margin: 0 0 4px;
  font-size: 23px;
  font-weight: 600;
  color: #000;
  line-height: 1.2;
}

.page-meta__title .reg,
.page-meta__title sup {
  font-size: 0.55em;
  font-weight: 600;
  line-height: 0;
  vertical-align: super;
  position: relative;
  top: -0.15em;
}

.page-meta__cliente {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  color: #4a4f57;
}

/* ——— Main charts area ——— */
/* display:contents → head / stage / footer participate in shell__body grid */
.main {
  display: contents;
}

.main__head {
  grid-column: 1;
  grid-row: 1;
  flex-shrink: 0;
  margin-bottom: 0;
}

.main__section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #000;
}

.main__section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.main__section-row .main__section-title {
  flex: 1 1 auto;
  min-width: 0;
}

.charts-stage {
  position: relative;
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.page {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: var(--gap);
  animation: pageIn 0.35s ease;
}

.page.is-active {
  display: flex;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* v2: one chart fills the stage */
.page--single {
  display: none;
}

.page--single.is-active {
  display: flex;
}

.page--single > .chart-card {
  flex: 1;
  min-height: 0;
}

/* v2 typography — chart content + legends 16px (CSS px, not viewBox units) */
.bullet-band-label,
.bullet-pin-label,
.heatmap-matrix-header__cell,
.heatmap-cell,
.heatmap-cell__name,
.heatmap-cell__score {
  font-size: 15px;
}

/* Real 15px on all chart SVG text/numbers (viewBox must not shrink them) */
.chart-card__plot svg text,
.chart-card__plot svg tspan {
  font-size: 15px !important;
}

/* Bar + radar axis / scale numbers — real 14px */
.chart-card__plot svg text.chart-scale-label,
.chart-card__plot svg text.chart-scale-label tspan {
  font-size: 14px !important;
}

/* Scores inside vertical bars */
.chart-card__plot svg text.chart-bar-score,
.chart-card__plot svg text.chart-bar-score tspan {
  font-size: 15px !important;
  font-weight: 400 !important;
}

/* Radar scores: white numbers on electric-blue badge */
.chart-card__plot svg text.radar-score-label,
.chart-card__plot svg text.radar-score-label tspan {
  fill: #ffffff !important;
  font-weight: 400 !important;
}

/* Names under each bar — real 15px */
.chart-card__plot svg text.chart-bar-name,
.chart-card__plot svg text.chart-bar-name tspan {
  font-size: 15px !important;
  font-weight: 400 !important;
  fill: #000000 !important;
}

/* Maturity gauges: scale chrome 14px (uses --c-gray) */
.chart-card[data-chart-id='bullet'] .chart-card__plot svg text.maturity-scale-num,
.chart-card[data-chart-id='bullet'] .chart-card__plot svg text.maturity-scale-band,
.chart-card[data-chart-id='bullet-focos'] .chart-card__plot svg text.maturity-scale-num,
.chart-card[data-chart-id='bullet-focos'] .chart-card__plot svg text.maturity-scale-band {
  font-size: 14px !important;
  fill: var(--c-gray) !important;
}

.chart-card[data-chart-id='bullet'] .chart-card__plot svg line.maturity-scale-tick,
.chart-card[data-chart-id='bullet-focos'] .chart-card__plot svg line.maturity-scale-tick {
  stroke: var(--c-gray) !important;
}

/* Maturity pin names + scores: HTML at real 15px (not SVG viewBox units) */
.maturity-pin-html-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.maturity-pin-html {
  position: absolute;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--font);
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: none;
}

.maturity-pin-html__name,
.maturity-pin-html__score {
  font-size: 15px !important;
  line-height: 1.15;
}

.maturity-pin-html__name {
  font-weight: 400;
}

.maturity-pin-html__score {
  font-size: 15px !important;
  font-weight: 400 !important;
  margin-top: 6px;
}

.chart-legend,
.chart-legend__label {
  font-size: 15px !important;
  font-family: var(--font);
  font-weight: 400;
  color: #000000;
}

/*
 * Shared plot frame = dumbbell reference (610×339), centered in the card body.
 * Heatmaps stay full-bleed; maturity gauges use a taller box so pin scores are not clipped.
 */
.chart-card:not([data-chart-id^='heatmap-']) .chart-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  grid-template-columns: none;
  grid-template-rows: none;
  padding-left: 80px;
  padding-right: 80px;
  box-sizing: border-box;
}

.chart-card:not([data-chart-id^='heatmap-']) .chart-card__plot {
  width: 610px;
  height: 339px;
  max-width: 100%;
  flex: 0 0 339px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  text-align: center;
  align-self: center;
  overflow: visible;
}

.chart-card[data-chart-id='bullet'] .chart-card__plot,
.chart-card[data-chart-id='bullet-focos'] .chart-card__plot {
  height: 450px;
  flex-basis: 450px;
}

.chart-card:not([data-chart-id^='heatmap-']) .chart-card__plot > svg,
.chart-card:not([data-chart-id^='heatmap-']) .chart-card__plot > canvas {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 auto !important;
  max-width: none !important;
  overflow: visible;
}

.chart-card[data-chart-id='silueta'] .chart-card__plot svg line.dumbbell-gap-line {
  stroke: #747882 !important;
  stroke-width: 1px !important;
  stroke-opacity: 1 !important;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
}

.chart-card[data-chart-id='silueta'] .chart-card__plot svg text.dumbbell-score,
.chart-card[data-chart-id='silueta'] .chart-card__plot svg text.dumbbell-score tspan {
  font-size: 15px !important;
  font-weight: 400 !important;
}

.dumbbell-foot-legend {
  position: absolute;
  left: 50%;
  bottom: var(--gap);
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 40px; /* same band as logo → vertical center with logo */
  pointer-events: none;
}

/* One SVG per item (icon + label) — stable in screen + html2canvas */
.dumbbell-foot-legend__svg {
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

/* Heatmap + maturity scale legends only — real 14px CSS (HTML, not viewBox) */
.maturity-scale-legend__num,
.maturity-scale-legend__band {
  font-size: 14px !important;
  font-family: var(--font);
  font-weight: 400;
  line-height: 1;
}

/* Bullet: content-sized SVG; gauge sits near subtitle, labels free below */
.bullet-plot {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding-top: 0;
  box-sizing: border-box;
}

.bullet-plot__wrap {
  position: relative;
  width: 100%;
  max-height: none;
  flex: 0 0 auto;
  min-height: 0;
  line-height: 0;
  overflow: visible;
}

.bullet-plot__wrap > svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
}

.bullet-bands {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.bullet-band-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font);
  font-size: var(--meta-size);
  font-weight: 400;
  line-height: 1.2;
  color: #000000;
  white-space: nowrap;
  text-align: center;
}

/* Pin labels — same 10px / 400 as band names (Inicial, Intermedio, …) */
.bullet-pin-label {
  position: absolute;
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
  pointer-events: none;
  font-family: var(--font);
  font-size: var(--meta-size);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.bullet-pin-label--up {
  transform: translate(-50%, -100%);
}

.bullet-pin-label__line {
  display: block;
}

.bullet-pin-label__score {
  font-weight: 600;
}

.bullet-plot--alternate {
  justify-content: center;
}

.bullet-plot--alternate .bullet-plot__wrap {
  flex: 1 1 auto;
  height: 100%;
}

.bullet-plot--alternate .bullet-plot__wrap > svg {
  height: 100%;
}

/* Liquid focos gauge — centered in plot; foot legend is separate */
.bullet-plot--liquid {
  justify-content: center;
  align-items: stretch;
  overflow: visible;
}

.bullet-plot--liquid .bullet-plot__wrap {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.bullet-plot--liquid .bullet-plot__wrap > svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ——— Chart card ——— */
.chart-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fafafa;
  border: none;
  border-radius: 0;
  padding: var(--gap);
  overflow: visible;
  box-shadow: none;
}

.chart-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap);
  flex-shrink: 0;
  margin-bottom: 6px;
}

/* Heatmaps: air between subtitle and matrix */
.chart-card[data-chart-id='heatmap-empresa'] .chart-card__top,
.chart-card[data-chart-id='heatmap-benchmark'] .chart-card__top {
  margin-bottom: 20px;
}

/* Heatmaps + maturity: scale legend in foot (left); logo is absolute on card */
.chart-card[data-chart-id='heatmap-empresa'] .chart-card__foot--with-scale,
.chart-card[data-chart-id='heatmap-benchmark'] .chart-card__foot--with-scale,
.chart-card[data-chart-id='bullet'] .chart-card__foot--with-scale,
.chart-card[data-chart-id='bullet-focos'] .chart-card__foot--with-scale {
  justify-content: flex-start;
  align-items: flex-end;
  min-height: 40px;
  margin-top: 4px;
  padding-right: 140px; /* clear absolute logo */
}

.chart-card[data-chart-id='heatmap-empresa'] .chart-card__foot--with-scale .maturity-scale-legend,
.chart-card[data-chart-id='heatmap-benchmark'] .chart-card__foot--with-scale .maturity-scale-legend,
.chart-card[data-chart-id='bullet'] .chart-card__foot--with-scale .maturity-scale-legend,
.chart-card[data-chart-id='bullet-focos'] .chart-card__foot--with-scale .maturity-scale-legend {
  position: static;
  left: auto;
  bottom: auto;
  transform: none;
  width: 480px;
  flex-shrink: 0;
}

/* Empresa: numbers on ticks; band names a bit lower (nearer the bar), between nums */
.maturity-scale-legend--bands-above .maturity-scale-legend__top {
  position: relative;
  width: 100%;
  height: 22px;
  margin-bottom: 0;
}

.maturity-scale-legend--bands-above .maturity-scale-legend__num,
.maturity-scale-legend--bands-above .maturity-scale-legend__band {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  line-height: 1;
}

.maturity-scale-legend--bands-above .maturity-scale-legend__num {
  top: 0;
}

.maturity-scale-legend--bands-above .maturity-scale-legend__band {
  top: 10px; /* drop below number baseline, closer to the bar */
}

/* Shared Empresa-style scale legend: 13px nums/bands */
.chart-card[data-chart-id='heatmap-empresa'] .maturity-scale-legend__num,
.chart-card[data-chart-id='heatmap-empresa'] .maturity-scale-legend__band,
.chart-card[data-chart-id='heatmap-benchmark'] .maturity-scale-legend__num,
.chart-card[data-chart-id='heatmap-benchmark'] .maturity-scale-legend__band,
.chart-card[data-chart-id='bullet'] .maturity-scale-legend__num,
.chart-card[data-chart-id='bullet'] .maturity-scale-legend__band,
.chart-card[data-chart-id='bullet-focos'] .maturity-scale-legend__num,
.chart-card[data-chart-id='bullet-focos'] .maturity-scale-legend__band {
  font-size: 13px !important;
}

.chart-card__titles {
  min-width: 0;
}

.chart-card__title {
  margin: 0;
  font-size: 20px !important;
  font-weight: 600;
  color: #000;
  line-height: 1.25;
}

.chart-card__subtitle {
  margin: 2px 0 0;
  font-size: 18px !important;
  font-weight: 400;
  color: #4a4f57;
  line-height: 1.25;
  min-height: calc(18px * 1.25);
}

/* Keep title-block height identical when a chart has no real subtitle (dumbbell ref) */
.chart-card__subtitle--spacer,
.chart-card[data-chart-id='silueta'] .chart-card__subtitle {
  visibility: hidden;
}

.chart-card__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  position: relative;
}

.chart-btn {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--c-gray);
}

.chart-btn:hover,
.chart-btn:focus-visible {
  color: var(--c-blue);
  background: rgba(18, 108, 251, 0.12);
  outline: none;
}

.chart-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-btn__dl-icon {
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  display: block;
  padding-left: 50px;
  overflow: hidden;
  object-fit: contain;
  opacity: 1;
  background-color: #757575;
  -webkit-mask-image: url('icon-descarga.png');
  mask-image: url('icon-descarga.png');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.chart-btn:hover .chart-btn__dl-icon,
.chart-btn:focus-visible .chart-btn__dl-icon {
  background-color: #4a4f57;
  opacity: 1;
}

.dl-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  min-width: 120px;
  padding: 6px;
  margin-top: 4px;
  background: var(--c-white);
  border: 1px solid var(--c-gray);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(3, 15, 35, 0.12);
  display: none;
}

.dl-menu.is-open {
  display: block;
}

.dl-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  font-size: var(--meta-size);
  font-weight: 600;
  color: var(--c-deep);
  border-radius: 4px;
}

.dl-menu button:hover {
  background: var(--c-white);
  color: var(--c-blue);
}

.chart-card__body {
  flex: 1;
  min-height: 0;
  display: grid;
  /* Fixed legend column → identical plot width on every page/card */
  grid-template-columns: minmax(0, 1fr) var(--chart-legend-w);
  gap: var(--gap);
  align-items: stretch;
}

.chart-card__body--stack {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
}

.chart-card__body--full {
  grid-template-columns: 1fr;
}

/* Short legends — free plot width instead of unused legend column */
.chart-card__body--legend-compact {
  --chart-legend-w: 180px;
}

.chart-card__plot {
  min-width: 0;
  min-height: 0;
  position: relative;
  width: 100%;
  height: 100%;
}

.chart-card__plot svg,
.chart-card__plot canvas,
.chart-card__plot .heatmap-root {
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 4px 8px;
  width: var(--chart-legend-w);
  min-width: var(--chart-legend-w);
  max-width: var(--chart-legend-w);
  box-sizing: border-box;
  color: #000000;
}

.chart-legend__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chart-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.chart-legend__swatch--circle {
  border-radius: 50%;
}

.chart-legend__line-svg {
  display: block;
  width: 40px;
  height: 12px;
  flex-shrink: 0;
  overflow: visible;
}

.chart-legend__label {
  min-width: 0;
  line-height: 1.25;
  font-size: 15px !important;
}

.chart-card__body--stack .chart-legend {
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 6px 0 0;
  justify-content: flex-start;
  align-items: stretch;
}

.chart-legend--horizontal {
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.chart-legend__svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.chart-legend__svg--gradient {
  width: 58px;
  max-width: 58px;
}

.chart-legend__svg--gradient-h {
  width: 100%;
  max-width: 280px;
  height: 36px;
}

.chart-legend--gradient {
  align-items: center;
}

.chart-legend--horizontal.chart-legend--gradient {
  justify-content: center;
  /* Heatmap symbology: drop below the matrix */
  margin-top: 20px;
}

.chart-card__foot {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  margin-top: 4px;
  padding-top: 2px;
  gap: var(--gap);
  min-height: 40px;
  box-sizing: border-box;
}

/* Por Foco / heatmaps: scale overlay bottom-left — HTML nums/bands at real 14px */
.maturity-scale-legend {
  position: absolute;
  left: var(--gap);
  bottom: var(--gap);
  z-index: 2;
  pointer-events: none;
  width: 480px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.maturity-scale-legend__nums,
.maturity-scale-legend__bands {
  position: relative;
  width: 100%;
  height: 14px;
}

.maturity-scale-legend__num,
.maturity-scale-legend__band {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}

.maturity-scale-legend__num {
  color: var(--c-gray);
  font-size: 13px !important;
}

.maturity-scale-legend__band {
  color: var(--c-gray);
  font-size: 13px !important;
}

.maturity-scale-legend__svg {
  display: block;
  width: 480px;
  height: auto;
  overflow: visible;
}

/* Por Dominios: numbers → dotted ticks → bar → band labels */
.maturity-scale-legend--bands {
  gap: 0;
}

.maturity-scale-legend--bands .maturity-scale-legend__nums {
  height: 16px;
  margin-bottom: 1px;
}

.maturity-scale-legend--bands .maturity-scale-legend__svg {
  height: 22px; /* 8px tick stem + 14px bar */
}

.maturity-scale-legend--bands .maturity-scale-legend__bands {
  height: 16px;
  margin-top: 4px;
}

.maturity-scale-legend--no-bands .maturity-scale-legend__bands {
  display: none;
}

.chart-card__logo {
  position: absolute;
  right: var(--gap);
  bottom: var(--gap);
  z-index: 4;
  height: 40px;
  width: auto;
  margin: 0;
  opacity: 1;
  filter: none;
  pointer-events: none;
}

/* Title / logo fade-in; plot owns the motion */
.chart-card__titles,
.chart-card__logo {
  animation: chartChromeIn 0.45s ease both;
}

.chart-card.is-exporting .chart-card__titles,
.chart-card.is-exporting .chart-card__logo,
.chart-card.is-exporting .chart-card__plot,
.chart-card.is-exporting .chart-card__plot * {
  animation: none !important;
  transition: none !important;
}

.chart-card.is-exporting .chart-card__actions,
.chart-card.is-exporting .dl-menu,
.chart-card.is-exporting .chart-btn {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes chartChromeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.chart-card__plot.chart-anim-ready {
  animation: chartPlotIn 0.35s ease both;
}

@keyframes chartPlotIn {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

/* Expand overlay — confined to charts-stage */
.expand-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  background: var(--c-white);
  background-color: #F0F2F6;
  border: none;
  border-radius: 0;
  padding: var(--gap);
  box-shadow: 0 12px 40px rgba(3, 15, 35, 0.18);
}

.expand-overlay.is-open {
  display: flex;
}

/* Hide chrome controls while capturing download */
.expand-overlay.is-exporting #expand-close {
  visibility: hidden;
  pointer-events: none;
}

.expand-overlay__top {
  display: none;
}

.expand-overlay__close {
  position: absolute;
  top: var(--gap);
  right: var(--gap);
  z-index: 2;
}

.expand-overlay__plot {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.expand-overlay__plot--fill,
.expand-overlay__plot--wc {
  align-items: stretch;
  justify-content: stretch;
}

.expand-overlay > .chart-card__foot {
  display: none;
}

.expand-clone--card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
  box-shadow: none;
}

.expand-clone--card .chart-card__body {
  flex: 1;
  min-height: 0;
  background: transparent;
}

/* Full-bleed expand (wordclouds + bullet): title top-left, logo bottom-right, sharp SVG/logo */
.expand-clone--fill,
.expand-clone--wc-fill {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: calc(var(--gap) + 8px);
  box-sizing: border-box;
  background: transparent;
  overflow: visible;
}

.expand-clone--fill .chart-card__top,
.expand-clone--wc-fill .chart-card__top {
  margin-bottom: 10px;
  padding-right: 36px; /* room for close button */
}

.expand-clone--fill .chart-card__title,
.expand-clone--wc-fill .chart-card__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.expand-clone--fill .chart-card__subtitle,
.expand-clone--wc-fill .chart-card__subtitle {
  margin-top: 4px;
  font-size: var(--meta-size);
  font-weight: 400;
}

.expand-clone--fill .chart-card__body,
.expand-clone--wc-fill .chart-card__body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
}

.expand-clone--fill .chart-card__body--full,
.expand-clone--wc-fill .chart-card__body--full {
  grid-template-columns: minmax(0, 1fr);
}

.expand-clone--fill .chart-card__plot,
.expand-clone--wc-fill .chart-card__plot {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.expand-clone--fill .chart-card__foot,
.expand-clone--wc-fill .chart-card__foot {
  margin-top: 4px;
  padding-top: 2px;
  min-height: 40px;
}

.expand-clone--fill .chart-card__logo,
.expand-clone--wc-fill .chart-card__logo {
  height: 40px;
  right: calc(var(--gap) + 8px);
  bottom: calc(var(--gap) + 8px);
}

/* Bullet gauge: top-aligned under subtitle */
.expand-clone--fill .bullet-plot {
  justify-content: flex-start;
  padding-top: 0;
}

.expand-clone--fill .bullet-plot__wrap > svg {
  width: 100%;
  height: auto;
  max-height: none;
}

.expand-clone-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.expand-clone-scaler {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.expand-clone {
  position: absolute;
  top: 0;
  left: 0;
  flex-shrink: 0;
  transform-origin: top left;
  will-change: transform;
}

/* ——— Sidebar (island) — same row as charts-stage ——— */
.sidebar {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin-top: 0;
  background: #fafafa;
  border: none;
  border-radius: 0;
  box-shadow: none;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.sidebar__diag-title {
  flex-shrink: 0;
  z-index: 3;
  margin: 0;
  padding: 12px 16px 10px;
  font-size: 20px;
  font-weight: 600;
  color: #000;
  background: #fafafa;
  border-bottom: 1px solid #e4e4e4;
}

.sidebar__scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 16px 18px;
  -webkit-overflow-scrolling: touch;
}

.sidebar__block-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.filter-list,
.nav-list,
.download-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-item {
  position: relative;
  width: 100%;
}

.filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-btn__label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.filter-btn__chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.7;
}

.filter-item.is-open .filter-btn__chevron,
.nav-group.is-open .filter-btn__chevron {
  transform: rotate(-135deg) translateY(-1px);
}

.filter-menu {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  z-index: 12;
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid #e4e4e4;
  box-shadow: 0 8px 20px rgba(2, 19, 59, 0.12);
}

.filter-item.is-open .filter-menu {
  display: block;
}

.filter-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: #000;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.filter-option:hover,
.filter-option.is-selected {
  background: #efefef;
}

.filter-btn,
.nav-item,
.download-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  color: #000;
  background: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 0;
  cursor: pointer;
}

.filter-btn:hover,
.nav-item:hover,
.download-btn:hover,
.filter-btn.is-active,
.nav-item.is-active {
  background: #02133d;
  border-color: #02133d;
  color: var(--c-white);
}

.nav-group {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-group__toggle {
  font-weight: 600;
}

.nav-group__items {
  display: none;
  flex-direction: column;
  gap: 6px;
}

.nav-group.is-open .nav-group__items {
  display: flex;
}

.nav-item--sub {
  font-size: 16px;
  font-weight: 400;
  padding: 8px;
}

/* ——— Pager row (main) ——— */
.main__footer {
  grid-column: 1;
  grid-row: 3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  height: auto;
  min-height: 0;
  padding: 0;
  margin-top: 0;
  border-top: none;
}

.footer__page {
  font-size: 14px;
  font-weight: 400;
  color: #000;
  line-height: 1.25;
}

.pager {
  display: flex;
  align-items: center;
  gap: var(--gap);
}

.pager__btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  background: #02133d;
  border-radius: 0;
  border: 1px solid #02133d;
  /* Equal width; SVG flex-shrink:0 keeps chevron size */
  width: 90px;
  min-width: 90px;
  max-width: 90px;
}

.pager__btn .pager__label {
  white-space: nowrap;
  opacity: 1;
  max-width: none;
  overflow: visible;
  flex: 0 1 auto;
}

.pager__btn:hover:not(:disabled),
.pager__btn:focus-visible:not(:disabled) {
  background: #126CFB;
  border-color: #126CFB;
  color: #fff;
  outline: none;
}

.pager__btn:disabled,
.pager__btn.is-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.pager__btn svg {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ——— Site footer (Imppulsor.com) ——— */
.site-footer {
  flex-shrink: 0;
  width: 100%;
  background: #ffffff;
  color: #000000;
  border-top: 1px solid #000000;
  font-size: 14px !important;
  font-weight: 400;
  line-height: 1.5;
}

.site-footer,
.site-footer h3,
.site-footer p,
.site-footer a,
.site-footer span {
  font-size: 14px !important;
}

.site-footer__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--shell-w);
  margin: 0 auto;
  padding: 56px 32px 28px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr minmax(0, 2.7fr);
  gap: 32px 40px;
  align-items: stretch;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  align-self: stretch;
  min-height: 100%;
  gap: 0;
}

.site-footer__logo {
  width: 190px;
  height: auto;
  display: block;
}

.site-footer__social {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 48px;
}

.site-footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: #000000;
  text-decoration: none;
}

.site-footer__social-link:hover {
  opacity: 0.8;
}

.site-footer__social-link svg,
.site-footer__social-icon {
  width: 24px !important;
  height: 24px !important;
  max-width: none;
  display: block;
  object-fit: contain;
}

.site-footer__social-icon {
  filter: brightness(0);
  opacity: 1;
}

.site-footer__social-link:hover .site-footer__social-icon {
  opacity: 0.8;
}

.site-footer__col {
  min-width: 0;
}

.site-footer__col-title {
  margin: 0 0 22px;
  color: #000000;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.3;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer__links a {
  color: #000000;
  text-decoration: none;
  font-size: 14px !important;
  font-weight: 400;
  line-height: 1.5;
}

.site-footer__links a:hover {
  text-decoration: underline;
}

/*
 * Europa + América Latina share one 2-col grid so each office row
 * has equal height → España aligns with Perú.
 */
.site-footer__locations {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  column-gap: 40px;
  row-gap: 28px;
  align-items: start;
  min-width: 0;
}

.site-footer__locations .site-footer__col-title {
  margin: 0;
}

.site-footer__place {
  margin: 0;
  min-width: 0;
}

.site-footer__place-name {
  margin: 0 0 6px;
  color: #000000;
  font-size: 14px !important;
  font-weight: 600;
  line-height: 1.35;
}

.site-footer__place-addr {
  margin: 0;
  color: #000000;
  font-size: 14px !important;
  font-weight: 400;
  line-height: 1.5;
}

.site-footer__place-name--hub {
  display: none;
}

.site-footer__bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #000000;
}

.site-footer__copy {
  margin: 0;
  color: #000000;
  font-size: 14px !important;
  font-weight: 400;
}

@media (max-width: 980px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__locations {
    grid-column: 1 / -1;
  }
}

/* ——— Tooltip (legend name only) ——— */
.chart-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  padding: 5px 9px;
  border-radius: 0;
  background: #ffffff;
  color: var(--c-deep);
  font-family: var(--font);
  font-size: var(--meta-size);
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(3, 15, 35, 0.1), 0 1px 2px rgba(3, 15, 35, 0.06);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity var(--ease-hover), transform var(--ease-hover);
  max-width: none;
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: none;
}

/* ——— Heatmap matrix (12 dims × 3 subs) ——— */
.heatmap-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.heatmap-matrix-header,
.heatmap-matrix-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.15fr) repeat(3, minmax(72px, 1fr));
  gap: 0;
  column-gap: 0;
  row-gap: 0;
}

/* Only vertical divider: Dimensiones | Subdimensiones (1px, no horizontal borders) */
.heatmap-matrix-header > :first-child,
.heatmap-matrix-row > .heatmap-cell:first-child {
  border-right: 1px solid #ffffff;
  padding-right: 8px;
  margin-right: 0;
}

.heatmap-matrix-header > :nth-child(2),
.heatmap-matrix-row > .heatmap-cell:nth-child(2) {
  padding-left: 8px;
}

.heatmap-matrix-header {
  flex: 0 0 auto;
  align-items: flex-end;
  padding-bottom: 4px;
  background: transparent;
  border-bottom: none;
}

.heatmap-matrix-header__cell {
  min-width: 0;
  padding: 0 6px;
  font-size: var(--meta-size);
  font-weight: 600;
  text-transform: none;
  color: #000;
  text-align: left;
}

.heatmap-matrix-row {
  flex: 1 1 0;
  align-items: stretch;
  min-height: 0;
  border: none;
  border-bottom: none;
  background: transparent;
  margin: 0;
  /* Kill subpixel hairlines between rows */
  margin-top: -1px;
}

.heatmap-matrix-header + .heatmap-matrix-row {
  margin-top: 0;
}

.heatmap-matrix-row:last-child {
  margin-bottom: 0;
}

.heatmap-matrix-row > .heatmap-cell + .heatmap-cell {
  /* Flush subdimension cells — no vertical grid lines */
  margin-left: 0;
  border-left: none;
}

.heatmap-cell {
  align-self: stretch;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 4px 8px;
  border-radius: 0;
  border: none;
  outline: none;
  box-shadow: none;
  font-family: inherit;
  font-size: var(--meta-size);
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  color: #ffffff;
  cursor: default;
  filter: none;
  overflow: hidden;
  /* JS swaps background to a blue-darkened fill on hover */
  transition: background-color var(--ease-hover), background var(--ease-hover);
}

.heatmap-root.heatmap-fade {
  animation: heatmapFadeIn 0.35s ease both;
}

@keyframes heatmapFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .heatmap-cell,
  .heatmap-root.heatmap-fade,
  .chart-card__titles,
  .chart-card__logo,
  .chart-card__plot.chart-anim-ready {
    animation: none !important;
  }
}

.heatmap-cell:hover,
.heatmap-cell:focus,
.heatmap-cell:focus-visible {
  filter: none;
  outline: none;
  box-shadow: none;
  z-index: 1;
  color: #ffffff !important;
}

.heatmap-cell,
.heatmap-cell .heatmap-cell__name,
.heatmap-cell .heatmap-cell__score,
.heatmap-cell:hover .heatmap-cell__name,
.heatmap-cell:hover .heatmap-cell__score,
.heatmap-cell:focus .heatmap-cell__name,
.heatmap-cell:focus .heatmap-cell__score {
  color: #ffffff !important;
}

.heatmap-cell__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--meta-size);
  font-weight: 400;
  line-height: 1.35;
}

.heatmap-cell__score {
  font-size: var(--meta-size);
  font-weight: 400;
  line-height: 1.35;
  flex-shrink: 0;
}

/* Word cloud */
.wc-host {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
}

.wc-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  max-height: none;
}

.wc-empty {
  font-size: 12px;
  color: var(--c-gray);
}

/* Scale hint for smaller windows — artboard stays fixed; page scrolls around it */

/* ——— Responsive: tablet + mobile (hybrid) ——— */

/* Toggle + backdrop: hidden on desktop/tablet */
.sidebar-toggle {
  display: none;
}

.sidebar-backdrop {
  display: none;
}

body.sidebar-open {
  overflow: hidden;
}

@media (max-width: 1199px) {
  .shell__body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 12px;
    gap: 12px;
  }

  .main__head {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .main__section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .main__section-row .main__section-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 0 0 auto;
    align-self: center;
    margin: 0;
    padding: 6px 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: #ffffff;
    background: #02133d;
    border: 1px solid #02133d;
    border-radius: 0;
    cursor: pointer;
  }

  .sidebar-toggle:hover,
  .sidebar-toggle:focus-visible {
    background: #126cfb;
    border-color: #126cfb;
    color: #ffffff;
  }

  .sidebar-toggle__icon {
    display: block;
    width: 16px;
    height: 12px;
    flex-shrink: 0;
    background:
      linear-gradient(#ffffff, #ffffff) 0 0 / 100% 2px no-repeat,
      linear-gradient(#ffffff, #ffffff) 0 5px / 100% 2px no-repeat,
      linear-gradient(#ffffff, #ffffff) 0 10px / 100% 2px no-repeat;
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 140;
    background: rgba(2, 19, 61, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .sidebar-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .charts-stage {
    grid-column: 1;
    grid-row: 2;
    min-height: 360px;
  }

  .main__footer {
    grid-column: 1;
    grid-row: 3;
  }

  /* Drawer — same as mobile; no inline filters below the chart */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 150;
    grid-column: unset;
    grid-row: unset;
    width: min(320px, 92vw);
    height: 100%;
    max-height: none;
    margin: 0;
    box-shadow: 8px 0 28px rgba(2, 19, 61, 0.22);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    overflow: hidden;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar__scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar__close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px 16px 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #000;
    background: #fafafa;
    border: none;
    border-bottom: 1px solid #e4e4e4;
    cursor: pointer;
    text-align: left;
  }

  .sidebar__close-x {
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    color: #000;
  }

  .sidebar__diag-title {
    display: none;
  }

  .page--single > .chart-card {
    min-height: 420px;
  }

  /* Fluid plot frame — desktop 610×339 preserved above 1200 */
  .chart-card:not([data-chart-id^='heatmap-']) .chart-card__body {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Fluid plot frame — same 610×339 on every chart below desktop */
  .chart-card .chart-card__plot,
  .chart-card:not([data-chart-id^='heatmap-']) .chart-card__plot,
  .chart-card[data-chart-id^='heatmap-'] .chart-card__plot,
  .chart-card[data-chart-id='bullet'] .chart-card__plot,
  .chart-card[data-chart-id='bullet-focos'] .chart-card__plot {
    width: 100%;
    max-width: 610px;
    height: auto;
    aspect-ratio: 610 / 339;
    flex: 0 0 auto;
    overflow: hidden;
  }

  .maturity-scale-legend,
  .maturity-scale-legend__svg,
  .chart-card[data-chart-id='heatmap-empresa'] .chart-card__foot--with-scale .maturity-scale-legend,
  .chart-card[data-chart-id='heatmap-benchmark'] .chart-card__foot--with-scale .maturity-scale-legend,
  .chart-card[data-chart-id='bullet'] .chart-card__foot--with-scale .maturity-scale-legend,
  .chart-card[data-chart-id='bullet-focos'] .chart-card__foot--with-scale .maturity-scale-legend {
    width: 100%;
    max-width: 480px;
  }

  .maturity-scale-legend__svg {
    width: 100%;
    max-width: 480px;
    height: auto;
  }

  .header {
    padding: 10px 12px;
  }

  .header__logo {
    width: 140px;
    height: 44px;
  }

  .header__logo img {
    width: 140px;
    height: 44px;
  }

  .header__salir {
    padding: 6px 20px;
  }

  .page-meta__title {
    font-size: 22px;
  }

  .main__section-title {
    font-size: 18px;
  }

  /* Footer compact: logo → rrss → legal → Hub Irlanda → divider → copy */
  .site-footer__inner {
    padding: 40px 20px 24px;
  }

  .site-footer__grid {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }

  .site-footer__brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 40px;
    min-height: 0;
    width: 100%;
  }

  .site-footer__social {
    margin-top: 0;
    padding-top: 0;
  }

  .site-footer__col {
    width: 100%;
  }

  .site-footer__locations {
    display: block;
    width: 100%;
    grid-column: auto;
    grid-template-columns: none;
    column-gap: 0;
    row-gap: 0;
  }

  .site-footer__locations .site-footer__col-title,
  .site-footer__locations .site-footer__place:not(.site-footer__place--hub) {
    display: none;
  }

  .site-footer__place--hub {
    display: block;
  }

  .site-footer__place-name--full {
    display: none;
  }

  .site-footer__place-name--hub {
    display: inline;
  }

  .site-footer__bottom {
    margin-top: 40px;
    width: 100%;
  }

  .site-footer__logo {
    width: 160px;
  }
}

@media (max-width: 767px) {
  .shell__body {
    grid-template-rows: auto auto auto;
    padding: 10px;
    gap: 10px;
  }

  .charts-stage {
    min-height: 300px;
  }

  .chart-card[data-chart-id='heatmap-empresa'] .chart-card__top,
  .chart-card[data-chart-id='heatmap-benchmark'] .chart-card__top {
    margin-bottom: 6px;
  }

  .chart-card[data-chart-id='heatmap-empresa'] .maturity-scale-legend,
  .chart-card[data-chart-id='heatmap-benchmark'] .maturity-scale-legend,
  .chart-card[data-chart-id='heatmap-empresa'] .chart-card__foot--with-scale .maturity-scale-legend,
  .chart-card[data-chart-id='heatmap-benchmark'] .chart-card__foot--with-scale .maturity-scale-legend {
    display: none !important;
  }

  .page--single > .chart-card {
    min-height: 0;
  }

  .chart-card {
    padding: 8px;
  }

  /* Same body inset for every chart (incl. heatmap) → identical plot width.
     Must beat the 1199px `:not(heatmap)` padding:16 rule (higher specificity). */
  .chart-card .chart-card__body,
  .chart-card:not([data-chart-id^='heatmap-']) .chart-card__body,
  .chart-card[data-chart-id^='heatmap-'] .chart-card__body {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .main__head {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .main__section-row .main__section-title {
    font-size: 15px;
  }

  .header__logo {
    width: 120px;
    height: 38px;
  }

  .header__logo img {
    width: 120px;
    height: 38px;
  }

  .header__actions {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 12px;
  }

  .header__salir {
    padding: 6px 14px;
    height: 32px;
    font-size: 13px;
  }

  .page-meta {
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .page-meta__title {
    font-size: 16px;
  }

  .page-meta__cliente {
    font-size: 13px;
  }

  .main__footer {
    position: sticky;
    bottom: 0;
    z-index: 50;
    padding: 8px 0;
    background: #ffffff;
    border-top: 1px solid #e4e4e4;
    box-shadow: 0 -4px 12px rgba(2, 19, 61, 0.06);
  }

  .footer__page {
    font-size: 13px;
  }

  /* Card chrome — compact, identical header height on every chart */
  .chart-card__top,
  .chart-card[data-chart-id='heatmap-empresa'] .chart-card__top,
  .chart-card[data-chart-id='heatmap-benchmark'] .chart-card__top {
    flex: 0 0 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    margin-bottom: 2px;
    overflow: hidden;
    gap: 8px;
  }

  .chart-card__title {
    font-size: 13px !important;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .chart-card__subtitle {
    font-size: 11px !important;
    min-height: calc(11px * 1.2);
    max-height: calc(11px * 1.2);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .chart-btn {
    width: 28px;
    height: 28px;
  }

  .chart-btn__dl-icon {
    width: 20px;
    height: 20px;
    padding-left: 32px;
  }

  .chart-card__logo {
    height: 22px;
    right: 8px;
    bottom: 8px;
  }

  .chart-card__foot,
  .chart-card__foot--with-scale,
  .chart-card[data-chart-id='heatmap-empresa'] .chart-card__foot--with-scale,
  .chart-card[data-chart-id='heatmap-benchmark'] .chart-card__foot--with-scale,
  .chart-card[data-chart-id='bullet'] .chart-card__foot--with-scale,
  .chart-card[data-chart-id='bullet-focos'] .chart-card__foot--with-scale {
    flex: 0 0 32px;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    margin-top: 2px;
    padding-right: 80px;
    padding-bottom: 0;
    overflow: hidden;
  }

  .dumbbell-foot-legend {
    left: 8px;
    right: auto;
    transform: none;
    max-width: calc(100% - 96px);
    gap: 8px;
    bottom: 8px;
    min-height: 16px;
    justify-content: flex-start;
  }

  .maturity-scale-legend,
  .maturity-scale-legend__svg,
  .chart-card[data-chart-id='heatmap-empresa'] .chart-card__foot--with-scale .maturity-scale-legend,
  .chart-card[data-chart-id='heatmap-benchmark'] .chart-card__foot--with-scale .maturity-scale-legend,
  .chart-card[data-chart-id='bullet'] .chart-card__foot--with-scale .maturity-scale-legend,
  .chart-card[data-chart-id='bullet-focos'] .chart-card__foot--with-scale .maturity-scale-legend {
    position: static;
    width: 100% !important;
    max-width: 100% !important;
    left: auto;
    bottom: auto;
    flex-shrink: 1;
  }

  .maturity-scale-legend__svg {
    width: 100% !important;
    max-width: 100% !important;
    height: 12px !important;
  }

  .maturity-scale-legend--bands .maturity-scale-legend__svg {
    height: 16px !important;
  }

  .maturity-scale-legend__nums,
  .maturity-scale-legend__bands {
    height: 10px;
  }

  .maturity-scale-legend--bands-above .maturity-scale-legend__top {
    height: 16px;
  }

  .maturity-scale-legend--bands-above .maturity-scale-legend__band {
    top: 8px;
  }

  .maturity-scale-legend__num,
  .maturity-scale-legend__band,
  .chart-card[data-chart-id='heatmap-empresa'] .maturity-scale-legend__num,
  .chart-card[data-chart-id='heatmap-empresa'] .maturity-scale-legend__band,
  .chart-card[data-chart-id='heatmap-benchmark'] .maturity-scale-legend__num,
  .chart-card[data-chart-id='heatmap-benchmark'] .maturity-scale-legend__band,
  .chart-card[data-chart-id='bullet'] .maturity-scale-legend__num,
  .chart-card[data-chart-id='bullet'] .maturity-scale-legend__band,
  .chart-card[data-chart-id='bullet-focos'] .maturity-scale-legend__num,
  .chart-card[data-chart-id='bullet-focos'] .maturity-scale-legend__band {
    font-size: 8px !important;
  }

  /* Same plot box on every chart — content must not grow the frame */
  .chart-card .chart-card__plot,
  .chart-card[data-chart-id='bullet'] .chart-card__plot,
  .chart-card[data-chart-id='bullet-focos'] .chart-card__plot,
  .chart-card[data-chart-id^='heatmap-'] .chart-card__plot {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 610 / 339 !important;
    flex: 0 0 auto !important;
    flex-basis: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden !important;
    position: relative;
  }

  .chart-card[data-chart-id='silueta'] .chart-card__plot,
  .chart-card[data-chart-id='silueta'] .chart-card__plot > svg {
    overflow: hidden !important;
  }

  .shell,
  .shell__body,
  .main,
  .charts-stage,
  .chart-card,
  .chart-card__body,
  .chart-card__plot {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Chart SVG text mobile — radiales a 7px (gana sobre overrides de scale-label) */
  .chart-card__plot svg text,
  .chart-card__plot svg tspan {
    font-size: 7px !important;
  }

  .chart-card[data-chart-id^='dim-radar-'] .chart-card__plot svg text,
  .chart-card[data-chart-id^='dim-radar-'] .chart-card__plot svg tspan,
  .chart-card[data-chart-id^='dim-radar-'] .chart-card__plot svg text.chart-scale-label,
  .chart-card[data-chart-id^='dim-radar-'] .chart-card__plot svg text.chart-scale-label tspan {
    font-size: 7px !important;
  }

  .chart-card__plot svg text.chart-scale-label,
  .chart-card__plot svg text.chart-scale-label tspan,
  .chart-card[data-chart-id='bullet'] .chart-card__plot svg text.maturity-scale-num,
  .chart-card[data-chart-id='bullet'] .chart-card__plot svg text.maturity-scale-band,
  .chart-card[data-chart-id='bullet-focos'] .chart-card__plot svg text.maturity-scale-num,
  .chart-card[data-chart-id='bullet-focos'] .chart-card__plot svg text.maturity-scale-band {
    font-size: 8px !important;
  }

  .chart-card__plot svg text.chart-bar-score,
  .chart-card__plot svg text.chart-bar-score tspan,
  .chart-card__plot svg text.chart-bar-name,
  .chart-card__plot svg text.chart-bar-name tspan,
  .chart-card[data-chart-id='silueta'] .chart-card__plot svg text.dumbbell-score,
  .chart-card[data-chart-id='silueta'] .chart-card__plot svg text.dumbbell-score tspan {
    font-size: 9px !important;
  }

  .heatmap-root {
    position: absolute;
    inset: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
  }

  .heatmap-matrix-header,
  .heatmap-matrix-row {
    grid-template-columns: minmax(0, 1.05fr) repeat(3, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .heatmap-matrix-header > :first-child,
  .heatmap-matrix-row > .heatmap-cell:first-child {
    padding-right: 3px;
  }

  .heatmap-matrix-header > :nth-child(2),
  .heatmap-matrix-row > .heatmap-cell:nth-child(2) {
    padding-left: 3px;
  }

  .heatmap-cell {
    padding: 1px 2px;
    gap: 2px;
    font-size: 7px;
  }

  .heatmap-cell__name,
  .heatmap-cell__score,
  .heatmap-matrix-header,
  .heatmap-matrix-header__cell {
    font-size: 7px !important;
  }

  .maturity-pin-html {
    max-width: 76px;
    white-space: normal;
    line-height: 1.05;
  }

  .maturity-pin-html__name,
  .maturity-pin-html__score,
  .bullet-plot.is-narrow .maturity-pin-html__name,
  .bullet-plot.is-narrow .maturity-pin-html__score {
    font-size: 8px !important;
    margin-top: 1px;
  }

  .site-footer__inner {
    padding: 32px 16px 20px;
  }
}

/* Desktop: hide drawer close; tablet/mobile show it via ≤1199 block */
@media (min-width: 1200px) {
  .sidebar__close {
    display: none;
  }
}

