/* Gráfico de evolución semanal. Superficies y texto: variables de base.css.
   Colores de serie: paleta categórica validada (ΔE para daltonismo y contraste) sobre el fondo claro y el oscuro.
   El color va siempre con el nombre al lado (fichas y globo), nunca solo. */
.grafico { padding: 14px; display: grid; gap: 10px; --gr-c: var(--acc); }
.gr-s-global { --gr-c: var(--tx); }
.gr-s-entrenamiento { --gr-c: #2a78d6; }
.gr-s-salud { --gr-c: #eb6834; }
.gr-s-nutricion { --gr-c: #1baf7a; }
.gr-s-direccion { --gr-c: #eda100; }
@media (prefers-color-scheme: dark) {
  .gr-s-entrenamiento { --gr-c: #3987e5; }
  .gr-s-salud { --gr-c: #d95926; }
  .gr-s-nutricion { --gr-c: #199e70; }
  .gr-s-direccion { --gr-c: #c98500; }
}

.gr-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.gr-cab h2 { margin: 0; font-size: 16px; }

/* Fichas de serie (chips de filtro M3): leyenda e interruptor */
.gr-fichas { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.gr-ficha { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--out); background: transparent; color: var(--tx); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background-color .15s; }
.gr-ficha:hover { background: color-mix(in srgb, var(--tx) 8%, transparent); }
.gr-ficha[aria-pressed="true"] { background: var(--sec); color: var(--sec-tx); border-color: transparent; }
.gr-muestra { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--gr-c); }

.gr-zona { position: relative; width: 100%; min-width: 0; }
.gr-oculto { display: none; }
.gr-svg { display: block; touch-action: pan-y; user-select: none; -webkit-user-select: none; border-radius: 6px; cursor: crosshair; }
.gr-svg:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.gr-rejilla { stroke: var(--bor); stroke-width: 1; fill: none; }
.gr-guia { stroke: var(--mut); stroke-width: 1; }
.gr-linea { fill: none; stroke: var(--gr-c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.gr-linea.gr-s-global { stroke-width: 2.5; }
.gr-punto { fill: var(--gr-c); stroke: var(--sup); stroke-width: 2; }
.gr-eje { fill: var(--mut); font-size: 11px; }
.gr-x-act { fill: var(--tx); font-weight: 700; }
.gr-valor { fill: var(--tx); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--sup); stroke-width: 3px; stroke-linejoin: round; }

.gr-vacio { margin: 0; padding: 20px 4px; color: var(--mut); font-size: 14px; text-align: center; }

/* Globo de la semana: es un botón (lleva a esa semana) */
.gr-tip { position: absolute; z-index: 2; display: grid; gap: 1px; max-width: calc(100% - 8px); padding: 8px 12px; margin: 0; text-align: left; font: inherit; background: var(--sup); border: 1px solid var(--out); border-radius: 12px; box-shadow: var(--som); color: var(--tx); font-size: 13px; line-height: 1.35; cursor: pointer; }
.gr-tip.gr-oculto { display: none; }
.gr-tip:disabled { cursor: default; }
.gr-tip:not(:disabled):hover { background: var(--sup2); }
.gr-tip-tit { margin-bottom: 4px; color: var(--mut); white-space: nowrap; font-weight: 600; }
.gr-tip-fila { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.gr-tip-nom { flex: 1; }
.gr-tip-val { font-variant-numeric: tabular-nums; font-weight: 700; margin-left: 12px; }
.gr-tip-off { color: var(--mut); }
.gr-tip-off .gr-tip-val { font-weight: 400; }
.gr-tip-ir { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--bor); color: var(--enl); font-weight: 600; }

@media (max-width: 640px) {
  .gr-fichas { width: 100%; gap: 4px; }
  .gr-ficha { min-height: 36px; padding: 0 6px; gap: 5px; font-size: 12.5px; flex: 1 1 auto; justify-content: center; }
}
