/* Base compartida: reset + tokens + componentes de analitica */
:root {
  --ql-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ql-background: #0d0d0d;
  --ql-surface: #15151f;
  --ql-primary: #2a78d6;
  --ql-text: #ffffff;
  --ql-text-secondary: #c3c2b7;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--ql-font);
  color: var(--ql-text);
  background: var(--ql-background);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button {
  font-family: inherit;
  cursor: pointer;
}
.ql-hidden { display: none !important; }

.ql-correct-badge {
  color: #0ca30c;
  font-weight: 800;
}

/* -------------------- Barras -------------------- */
.ql-bar-chart { display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 22px); width: 100%; }
.ql-bar-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2.2fr) auto; align-items: center; gap: clamp(10px, 1.4vw, 20px); }
.ql-bar-label { font-weight: 700; font-size: clamp(0.95rem, 1.6vw, 1.5rem); text-align: right; overflow-wrap: anywhere; }
.ql-bar-track { position: relative; height: clamp(20px, 3.6vh, 46px); background: color-mix(in srgb, var(--ql-text) 12%, transparent); border-radius: 999px; overflow: hidden; }
.ql-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.ql-bar-value { font-weight: 800; font-size: clamp(0.95rem, 1.6vw, 1.4rem); min-width: 3.5em; }
.ql-bar-pct { font-weight: 500; color: var(--ql-text-secondary); font-size: 0.8em; }

/* -------------------- Circular -------------------- */
.ql-pie-chart { display: flex; align-items: center; gap: clamp(16px, 3vw, 48px); flex-wrap: wrap; justify-content: center; width: 100%; }
.ql-pie-donut {
  width: clamp(160px, 26vw, 340px);
  height: clamp(160px, 26vw, 340px);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.ql-pie-hole {
  width: 58%; height: 58%; border-radius: 50%;
  background: var(--ql-surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ql-pie-hole span { font-size: clamp(1.4rem, 2.6vw, 2.4rem); font-weight: 800; }
.ql-pie-hole small { color: var(--ql-text-secondary); font-size: clamp(0.65rem, 1vw, 0.9rem); }
.ql-pie-legend { display: flex; flex-direction: column; gap: clamp(8px, 1.4vh, 16px); min-width: 0; }
.ql-legend-row { display: flex; align-items: center; gap: 10px; font-size: clamp(0.9rem, 1.5vw, 1.3rem); }
.ql-swatch { width: 0.9em; height: 0.9em; border-radius: 4px; flex-shrink: 0; }
.ql-legend-label { font-weight: 700; overflow-wrap: anywhere; }
.ql-legend-value { color: var(--ql-text-secondary); font-weight: 600; margin-left: auto; padding-left: 12px; }

/* -------------------- Conceptos -------------------- */
.ql-concepts-chart { display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 18px); width: 100%; }
.ql-concept-row {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center; gap: clamp(10px, 1.6vw, 20px);
  background: color-mix(in srgb, var(--ql-text) 6%, transparent);
  border-radius: 16px;
  padding: clamp(8px, 1.2vh, 14px) clamp(12px, 1.6vw, 20px);
  transform: scale(var(--ql-concept-scale, 1));
  transform-origin: left center;
}
.ql-concept-rank { font-weight: 900; color: var(--ql-text-secondary); font-size: clamp(0.9rem, 1.6vw, 1.4rem); }
.ql-concept-text { font-weight: 800; font-size: clamp(1rem, 2vw, 1.8rem); overflow-wrap: anywhere; }
.ql-concept-track { height: 8px; background: color-mix(in srgb, var(--ql-text) 12%, transparent); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.ql-concept-fill { height: 100%; border-radius: 999px; }
.ql-concept-value { font-weight: 800; font-size: clamp(0.9rem, 1.6vw, 1.3rem); text-align: right; }
.ql-concept-value small { display: block; color: var(--ql-text-secondary); font-weight: 500; font-size: 0.7em; }

/* -------------------- Nube de ideas -------------------- */
.ql-cloud-chart {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: clamp(10px, 2vw, 26px); width: 100%; padding: clamp(8px, 2vh, 24px);
}
.ql-cloud-word { font-weight: 800; line-height: 1; white-space: nowrap; }

.ql-chart-empty {
  width: 100%; text-align: center; padding: 3em 1em;
  color: var(--ql-text-secondary); font-size: clamp(1rem, 2vw, 1.4rem); font-weight: 600;
}
