/*
 * Reporte ejecutivo de un estudio de her (/test/her/consulta/:code), sobre la superficie de marca:
 * usa la columna y el encabezado del detalle (test-detail.css), con los aros arriba y sin cinta.
 * Cada herida lleva el color de su nivel en --level (barra, punto, arco) y --level-ink (texto),
 * de los tokens --wound-* (tokens.css).
 */
.her-report__main {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  padding-block: var(--space-6) max(var(--space-10), calc(env(safe-area-inset-bottom) + var(--space-6)));
}

.her-report__title {
  font-size: clamp(1.5rem, 6.8vw, 1.875rem);
  font-weight: var(--weight-black);
  line-height: 1.08;
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.her-report__team {
  margin-top: var(--space-3);
  color: var(--brand-text-muted);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.her-report__team:empty,
.her-report__responded:empty {
  display: none;
}

.her-report__responded {
  margin-top: var(--space-1);
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  line-height: var(--text-small-leading);
  font-variant-numeric: tabular-nums;
}

.her-report__body {
  display: grid;
  gap: var(--space-8);
  margin-top: var(--space-6);
}

.her-report__unit {
  margin-left: 1px;
  font-size: 0.6em;
  font-weight: var(--weight-bold);
}

/* ------------------------------------------------------------------
 * Promedio general: aro + nivel
 * ------------------------------------------------------------------ */
.her-report__summary {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--brand-glass-border);
  border-radius: var(--brand-radius-panel);
  background: var(--brand-glass);
}

.her-report__gauge {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
}

.her-report__gauge-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.her-report__gauge-track,
.her-report__gauge-arc {
  fill: none;
  stroke-width: 9;
}

.her-report__gauge-track {
  stroke: var(--wound-track);
}

.her-report__gauge-arc {
  stroke: var(--level);
  stroke-linecap: round;
}

.her-report__gauge-value {
  position: relative;
  font-size: 1.75rem;
  font-weight: var(--weight-black);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.her-report__summary-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.her-report__summary-title {
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  line-height: 1.3;
}

.her-report__summary-level {
  color: var(--level-ink);
  font-size: 1.25rem;
  font-weight: var(--weight-black);
  line-height: 1.25;
}

.her-report__summary-note {
  margin-top: var(--space-1);
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  line-height: 1.4;
}

/* ------------------------------------------------------------------
 * Mapa de presencia: un panel, una fila por herida, la escala al pie
 * ------------------------------------------------------------------ */
.her-report__heading {
  margin-bottom: var(--space-3);
  font-size: var(--text-heading);
  font-weight: var(--weight-bold);
  line-height: 1.25;
}

.her-report__panel {
  overflow: hidden;
  border: 1px solid var(--brand-glass-border);
  border-radius: var(--brand-radius-panel);
  background: var(--brand-glass);
}

/* Arriba el nombre y el porcentaje; abajo la barra y el nivel. El nivel tiene ancho fijo para
 * que todas las barras midan lo mismo y se puedan comparar. */
.her-report__wound {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
}

.her-report__wound + .her-report__wound {
  border-top: 1px solid var(--brand-glass-border);
}

.her-report__wound-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.her-report__wound-name {
  min-width: 0;
  font-size: 1rem;
  font-weight: var(--weight-bold);
  line-height: 1.3;
}

.her-report__wound-value {
  flex: none;
  font-size: 1.5rem;
  font-weight: var(--weight-black);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.her-report__wound-level {
  flex: none;
  width: 8.5rem;
  color: var(--level-ink);
  font-size: var(--text-small);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.her-report__bar {
  flex: 1;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--wound-track);
}

.her-report__bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--level);
  transform-origin: left center;
}

.her-report__scale {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--brand-glass-border);
}

.her-report__scale-title {
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  font-weight: var(--weight-bold);
}

.her-report__scale-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: var(--space-2) var(--space-4);
}

.her-report__scale-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  line-height: 1.3;
}

.her-report__scale-item::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--level);
}

/* ------------------------------------------------------------------
 * Heridas prioritarias: bloque con el degradado de marca y fichas claras
 * ------------------------------------------------------------------ */
.her-report__priorities {
  padding: var(--space-5);
  border-radius: var(--brand-radius-panel);
  background: linear-gradient(135deg, var(--brand-magenta), var(--brand-violet) 70%, var(--brand-blue));
  box-shadow: 0 14px 32px -12px var(--brand-magenta-glow);
}

.her-report__priorities-title {
  color: var(--brand-on-gradient);
  font-size: var(--text-heading);
  font-weight: var(--weight-black);
  line-height: 1.25;
}

.her-report__priority-list {
  display: grid;
  padding: 0;
  list-style: none;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* Con espacio, 2 × 2 como en el boceto; en el celular, una columna para no partir los nombres. */
@media (min-width: 440px) {
  .her-report__priority-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Las fichas son claras en los dos temas: van sobre el degradado, no sobre el fondo. */
.her-report__priority {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 100%;
  padding: var(--space-3) var(--space-4);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.95);
  color: #14122B;
}

.her-report__priority-rank {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-magenta);
  color: #FFFFFF;
  font-size: 0.9375rem;
  font-weight: var(--weight-black);
  font-variant-numeric: tabular-nums;
}

.her-report__priority-name {
  font-size: 1.0625rem;
  font-weight: var(--weight-bold);
  line-height: 1.25;
  overflow-wrap: break-word;
}

/* ------------------------------------------------------------------
 * Informe de un participante: su coherencia, entre el resumen y el mapa
 * ------------------------------------------------------------------ */
.her-report__coherence {
  display: grid;
  gap: var(--space-1);
  margin-top: calc(var(--space-8) * -1 + var(--space-3));
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--brand-glass-border);
  border-radius: var(--brand-radius-panel);
  background: var(--brand-glass);
}

.her-report__coherence-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
}

.her-report__coherence-title {
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  line-height: 1.3;
}

.her-report__coherence-value {
  font-size: 1.25rem;
  font-weight: var(--weight-black);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.her-report__coherence-level {
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  font-weight: var(--weight-bold);
}

.her-report__coherence-hint {
  color: var(--brand-text-muted);
  font-size: var(--text-small);
  line-height: var(--text-small-leading);
}

.her-report__coherence--warning .her-report__coherence-value,
.her-report__coherence--warning .her-report__coherence-level,
.her-report__coherence--warning .her-report__coherence-hint {
  color: var(--brand-error);
}
