/* ── evolucio.css ─────────────────────────────────────────────────────────────
   Estils per a la vista evolutiva d'estadístiques (heatmap, sparklines,
   selecció múltiple, cicle de vida). Tokens compatibles amb tokens.css.

   La taula usa les classes `results-table estadistiques-table evolucio-table`
   i hereta tots els estils globals de `results.css` (sticky `thead th`,
   `sortable-th-inner`, `.sort-btn`, zebra, etc.) i de `estadistiques.css`.
   Aquí només definim tokens cromàtics i ajustos específics de la vista.
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Tokens específics de la vista evolutiva ───────────────────────────────── */
:root {
  --trend-up: #15803d;
  --trend-flat: #94a3b8;
  --trend-down: #b91c1c;

  --life-active: #276749;
  --life-pre: #4a7fd4;
  --life-post: #94a3b8;

  --heat-0: transparent;
  --heat-1: rgba(39, 103, 73, 0.02);
  --heat-2: rgba(39, 103, 73, 0.05);
  --heat-3: rgba(39, 103, 73, 0.09);
  --heat-4: rgba(39, 103, 73, 0.14);
  --heat-5: rgba(39, 103, 73, 0.20);
}

/* ── Shell de la vista ─────────────────────────────────────────────────────── */

#section-estadistiques.section-estadistiques--evolucio.main {
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

#section-estadistiques .evolucio-results-header {
  flex-direction: column;
  align-items: stretch;
  align-content: stretch;
  gap: 0;
}

#section-estadistiques .evolucio-results-header__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  min-width: 0;
}

#section-estadistiques .evolucio-results-header .evolucio-legend {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

#section-estadistiques .evolucio-results-header #evolucioSelBarMount {
  width: 100%;
  box-sizing: border-box;
}

/* ── Llegenda ──────────────────────────────────────────────────────────────── */

.evolucio-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 8px 18px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border-subtle, var(--line));
}

.evolucio-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.evolucio-legend-swatch {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.evolucio-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* ── Barra de selecció ─────────────────────────────────────────────────────── */

.evolucio-selection-bar-wrap {
  padding: 0 18px;
}

.evolucio-selection-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 0;
  background: linear-gradient(
    to right,
    rgba(var(--color-primary-rgb), 0.07),
    rgba(var(--color-primary-rgb), 0.02)
  );
  border: 1px solid rgba(var(--color-primary-rgb), 0.18);
  border-radius: 10px;
  flex-wrap: wrap;
  transition: opacity 0.2s, max-height 0.2s;
}

.evolucio-selection-bar[hidden] {
  display: none;
}

.evolucio-sel-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

.evolucio-sel-count strong {
  font-size: 16px;
  font-feature-settings: 'tnum';
}

.evolucio-sel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong, rgba(31, 42, 55, 0.18));
  background: var(--card);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--fg, var(--ink));
  transition: all 0.15s;
}

.evolucio-sel-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.evolucio-sel-toggle.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.evolucio-sel-btn {
  padding: 5px 10px;
  border: 1px solid var(--line-strong, rgba(31, 42, 55, 0.18));
  background: var(--card);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}

.evolucio-sel-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.evolucio-sel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.evolucio-sel-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  background: var(--card);
  border: 1px solid rgba(var(--color-primary-rgb), 0.25);
  border-radius: 14px;
  font-size: 12px;
  color: var(--fg, var(--ink));
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evolucio-sel-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(31, 42, 55, 0.08);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.evolucio-sel-chip-remove:hover {
  background: var(--trend-down);
  color: #fff;
}

/* ── Taula evolutiva — ajustos específics (el gruix ve de results.css) ────── */

table.evolucio-table {
  table-layout: fixed;
  --evo-w-check: 32px;
  --evo-w-num: 58px;
  --evo-w-num-fmt: 74px;
  --evo-w-spark: 100px;
  --evo-w-spark-life: 120px;
  /* Columnes sense `<col>` fix: només mínim (no imposa l’amplada per defecte). */
  --evo-min-flex-col: 20ch;
  --evo-min-life-year-col: 8ch;
}

/* Tipografia unificada: capçalera i cos hereten la mateixa escala que results.css */
table.evolucio-table thead th {
  font-size: var(--font-xs);
}

table.evolucio-table tbody td {
  font-size: var(--font-md);
  line-height: 1.18;
}

/* Columna de selecció / desselecció */
table.evolucio-table th.evo-col-check,
table.evolucio-table td.evo-col-check {
  width: var(--evo-w-check);
  min-width: var(--evo-w-check);
  max-width: var(--evo-w-check);
  box-sizing: border-box;
  padding: 6px 4px 6px 10px;
  text-align: center;
}

table.evolucio-table th.evo-col-check {
  cursor: default;
}

table.evolucio-table input.evo-cobla-check {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--color-primary);
  margin: 0;
  vertical-align: middle;
}

table.evolucio-table th.evo-col-check .evo-deselect-visible-btn {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xl);
  line-height: 1;
  font-weight: 800;
}

/* Nom de cobla: width 1% reparteix l’espai lliure; min-width evita col·lapse sota table-layout:fixed */
table.evolucio-table th.evo-col-cobla,
table.evolucio-table td.evo-col-cobla {
  width: 1%;
  min-width: var(--evo-min-flex-col);
}

table.evolucio-table th.evo-col-cobla {
  padding-left: 14px;
}

/* Columnes any (heatmap): ample per 7 xifres + marge mínim */
table.evolucio-table th.evo-year,
table.evolucio-table td.evo-year {
  text-align: right;
  width: var(--evo-w-num);
  min-width: var(--evo-w-num);
  max-width: var(--evo-w-num);
  box-sizing: border-box;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  padding-left: 4px;
  padding-right: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.evolucio-table th.evo-year.is-focal-header {
  background: rgba(var(--color-primary-rgb), 0.10);
  color: var(--color-primary);
}

/* Parcial: text inferior petit a la capçalera de l'any */
table.evolucio-table th.evo-year .evo-year-partial {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.1;
  margin-top: 1px;
}

table.evolucio-table th.evo-col-spark,
table.evolucio-table td.evo-col-spark {
  width: var(--evo-w-spark);
  min-width: var(--evo-w-spark);
  max-width: var(--evo-w-spark);
  box-sizing: border-box;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

table.evolucio-table th.evo-col-spark-life,
table.evolucio-table td.evo-col-spark-life {
  width: var(--evo-w-spark-life);
  min-width: var(--evo-w-spark-life);
  max-width: var(--evo-w-spark-life);
  box-sizing: border-box;
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

/* Capçaleres sparkline: layout stacked centrat (▲▼ a la fila superior) */
table.evolucio-table th.evo-col-spark .sortable-th-inner--stacked .sortable-th-row-btns,
table.evolucio-table th.evo-col-spark-life .sortable-th-inner--stacked .sortable-th-row-btns {
  justify-content: center;
}

table.evolucio-table th.evo-col-spark .sortable-th-inner--stacked .sortable-th-row-label,
table.evolucio-table th.evo-col-spark-life .sortable-th-inner--stacked .sortable-th-row-label {
  text-align: center;
}

table.evolucio-table thead th.evo-col-spark,
table.evolucio-table thead th.evo-col-spark-life {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

table.evolucio-table th.evo-col-total,
table.evolucio-table td.evo-col-total {
  width: var(--evo-w-num-fmt);
  min-width: var(--evo-w-num-fmt);
  max-width: var(--evo-w-num-fmt);
  box-sizing: border-box;
  text-align: right;
  padding-left: 4px;
  padding-right: 6px;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.evolucio-table th.evo-col-range-total,
table.evolucio-table td.evo-col-range-total {
  width: var(--evo-w-num-fmt);
  min-width: var(--evo-w-num-fmt);
  max-width: var(--evo-w-num-fmt);
  box-sizing: border-box;
  text-align: right;
  padding-left: 4px;
  padding-right: 6px;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.evolucio-table td.evo-col-range-total {
  font-weight: 500;
  color: var(--fg, var(--ink));
}

table.evolucio-table th.evo-col-delta,
table.evolucio-table td.evo-col-delta {
  width: var(--evo-w-num);
  min-width: var(--evo-w-num);
  max-width: var(--evo-w-num);
  box-sizing: border-box;
  text-align: right;
  padding-left: 4px;
  padding-right: 6px;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Creació / dissolució: sense amplada fixa; mínim 8ch per als 4 dígits d’any */
table.evolucio-table th.evo-col-life-year,
table.evolucio-table td.evo-col-life-year {
  box-sizing: border-box;
  text-align: right;
  padding-left: 4px;
  padding-right: 6px;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  width: 1%;
  min-width: var(--evo-min-life-year-col);
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.evolucio-table th.evo-col-life-year {
  white-space: normal;
  line-height: 1.15;
  hyphens: manual;
  word-break: normal;
  overflow-wrap: anywhere;
  overflow: visible;
  text-overflow: clip;
}

table.evolucio-table thead th.evo-col-cobla,
table.evolucio-table thead th.evo-col-town,
table.evolucio-table thead th.evo-col-county,
table.evolucio-table thead th.evo-col-life-year,
table.evolucio-table thead th.evo-year,
table.evolucio-table thead th.evo-col-delta,
table.evolucio-table thead th.evo-col-range-total,
table.evolucio-table thead th.evo-col-total {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

table.evolucio-table td.evo-col-life-year {
  color: var(--fg, var(--ink));
  font-weight: 500;
}

table.evolucio-table td.evo-col-life-year.is-current {
  color: var(--color-primary);
  font-weight: 600;
}

table.evolucio-table td.evo-col-life-year.is-old {
  color: var(--muted);
}

/* Població i comarca: sense amplada forçada; mínim 20ch; el redimensionament ho ajusta */
table.evolucio-table th.evo-col-town,
table.evolucio-table td.evo-col-town,
table.evolucio-table th.evo-col-county,
table.evolucio-table td.evo-col-county {
  width: 1%;
  min-width: var(--evo-min-flex-col);
  max-width: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

table.evolucio-table td.evo-col-county {
  color: var(--muted);
}

/* Cel·la nom */
table.evolucio-table td.evo-col-cobla {
  padding-left: 14px;
  font-weight: 500;
  color: var(--fg, var(--ink));
  overflow-wrap: anywhere;
  word-break: break-word;
  position: relative;
}

table.evolucio-table td.evo-col-cobla .evo-life-marker {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

table.evolucio-table td.evo-col-cobla .evo-life-marker.active {
  background: var(--life-active);
}

table.evolucio-table td.evo-col-cobla .evo-life-marker.pre {
  background: var(--life-pre);
}

table.evolucio-table td.evo-col-cobla .evo-life-marker.post {
  background: var(--life-post);
}

/* Cel·les any (heatmap): estats cromàtics */
table.evolucio-table td.evo-year {
  color: var(--fg, var(--ink));
  position: relative;
}

table.evolucio-table td.evo-year.heat-0 { color: #cbd5e1; }
table.evolucio-table td.evo-year.heat-1 { background: var(--heat-1); }
table.evolucio-table td.evo-year.heat-2 { background: var(--heat-2); }
table.evolucio-table td.evo-year.heat-3 { background: var(--heat-3); }
table.evolucio-table td.evo-year.heat-4 { background: var(--heat-4); font-weight: 500; }
table.evolucio-table td.evo-year.heat-5 { background: var(--heat-5); font-weight: 600; }

table.evolucio-table td.evo-year.life-pre { color: var(--life-pre); opacity: 0.6; }
table.evolucio-table td.evo-year.life-post { color: var(--life-post); }

/* Sparkline: l’SVG té amplada intrínseca fixa (100/120 px); escalar dins la cel·la
   perquè no desbordi amb padding o després de redimensionar columnes. */
table.evolucio-table td.evo-col-spark {
  text-align: center;
  padding: 4px 6px;
  overflow: hidden;
}

table.evolucio-table td.evo-col-spark svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  overflow: hidden;
}

/* Sparkline vida sencera */
table.evolucio-table td.evo-col-spark-life {
  text-align: center;
  padding: 4px 6px;
  position: relative;
  overflow: hidden;
}

table.evolucio-table td.evo-col-spark-life svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  overflow: hidden;
}

table.evolucio-table td.evo-col-spark-life .life-range {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-feature-settings: 'tnum';
  margin-top: 1px;
  line-height: 1;
}

/* Total i delta (cos de la taula) */
table.evolucio-table td.evo-col-total {
  font-weight: 600;
  color: var(--fg, var(--ink));
}

table.evolucio-table td.evo-col-delta {
  font-weight: 600;
}

table.evolucio-table td.evo-col-delta.up { color: var(--trend-up); }
table.evolucio-table td.evo-col-delta.down { color: var(--trend-down); }
table.evolucio-table td.evo-col-delta.flat { color: var(--muted); }

table.evolucio-table td.evo-col-delta .arrow {
  margin-right: 1px;
}

/* Fila seleccionada */
table.evolucio-table tbody tr.evo-is-selected { background: rgba(var(--color-primary-rgb), 0.10) !important; }
table.evolucio-table tbody tr.evo-is-selected:hover { background: rgba(var(--color-primary-rgb), 0.15) !important; }
table.evolucio-table tbody tr.evo-is-selected td.evo-col-cobla { border-left: 3px solid var(--color-primary); padding-left: 11px; }

/* Fila sticky resum */
table.evolucio-table tfoot { position: sticky; bottom: 0; z-index: 2; }
table.evolucio-table tfoot tr { background: #ffffff; font-weight: 600; box-shadow: 0 -1px 0 rgba(var(--color-primary-rgb), 0.3); }
table.evolucio-table tfoot td { border-bottom: none; border-top: 2px solid var(--color-primary); padding: 8px 6px; color: var(--fg, var(--ink)); }
table.evolucio-table tfoot td.evo-col-cobla { padding-left: 14px; font-weight: 700; color: var(--color-primary); }
table.evolucio-table tfoot td.evo-year { font-weight: 600; }
table.evolucio-table tfoot td.evo-col-total { font-weight: 700; }

/* ── Tooltip sparkline ─────────────────────────────────────────────────────── */

.evolucio-tooltip {
  position: fixed;
  background: var(--fg, #111827);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 100;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.1s;
}

.evolucio-tooltip.visible { opacity: 1; }
.evolucio-tooltip .yr { font-weight: 600; color: var(--color-accent, #52c4a8); margin-right: 6px; }

/* Tooltip de capçalera (sparklines, Δ%): mateix estil que el HUD de redimensionament. */
table.evolucio-table th.evo-col-spark,
table.evolucio-table th.evo-col-spark-life,
table.evolucio-table th.evo-col-delta {
  overflow: visible;
}

.evolucio-th-hint {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--color-primary-70);
  color: #fff;
  font: 700 13px system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border: 1px solid var(--actionable-line);
  box-shadow: 0 4px 12px rgb(var(--shadow-rgb) / 0.18);
  pointer-events: none;
}

.evolucio-th-hint--fixed {
  position: fixed;
  z-index: 2147483646;
  transform: translate(-50%, calc(-100% - 6px));
  opacity: 0;
  transition: opacity 0.15s ease;
}

.evolucio-th-hint--fixed::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--color-primary-70);
  border-right: 1px solid var(--actionable-line);
  border-bottom: 1px solid var(--actionable-line);
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 2px 2px 4px rgb(var(--shadow-rgb) / 0.08);
}

.evolucio-th-hint--fixed.visible {
  opacity: 1;
}

/* ── Sidebar: rang temporal (dos inputs en una línia) ──────────────────────── */

.evolucio-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.evolucio-range-input-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.evolucio-range-input-wrap > .input {
  width: 100%;
  padding-right: 32px;
}

.evolucio-range-input-wrap > .input-clear {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
}

.evolucio-range-sep {
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar .evolucio-range-input-wrap > .input:hover:not(:focus) {
  background-color: var(--filter-option-hover-bg);
}

/* ── Sidebar evolutiu: dues cards apilades ─────────────────────────────────
   La vista evolutiva mostra dues cards independents (com dues sidebars una
   sota l'altra): «filtres» (cobles) i «període temporal» (rang + fórmula +
   posició + selectors). L'embolcall general del content-nav es torna transparent
   perquè no quedin cards niuades. Es delimita amb :has() perquè només afecti
   aquesta vista (la resta d'estadístiques conserven l'embolcall únic). */
.card.content-nav-card:has(.evolucio-period-card) {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

.evolucio-period-card,
.evolucio-filters-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 10px 11px;
}

.evolucio-period-card > .field,
.evolucio-filters-card > .field {
  margin: 0;
}

.evolucio-period-card > .field + .field,
.evolucio-filters-card > .field + .field {
  margin-top: 12px;
}

/* ── Sidebar: controls de finestra (columnes · gra · posició · readout) ────── */

.evolucio-window-controls .label:not(:first-child) {
  margin-top: 12px;
}

/* Selector segmentat discret (columnes i anys per columna) */
.evolucio-seg {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.evolucio-seg-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line-strong, rgba(31, 42, 55, 0.18));
  background: var(--card);
  color: var(--fg, var(--ink));
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
  user-select: none;
}

.evolucio-seg-btn:hover:not(:disabled):not(.is-active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.05);
}

.evolucio-seg-btn.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Mode «Tot»: selector de gra visible però desactivat (esmorteït + cadenat) */
.evolucio-seg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.evolucio-seg.is-locked .evolucio-seg-btn.is-active {
  background: var(--muted);
  border-color: var(--muted);
  color: #fff;
}

.evolucio-seg.is-locked .evolucio-seg-btn.is-active::after {
  content: ' \1F512'; /* cadenat: fixat pel mode «Tot» */
  font-size: 10px;
}

/* Lectura derivada (readout): rang de dates resultant */
/* Fórmula derivada (N columnes × M anys = X anys al rang): sota els camps de
   text i abans del slider. Sense fons, centrada; el rang ja es veu als camps. */
.evolucio-readout {
  margin: 6px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-feature-settings: 'tnum';
}

/* Nombre d'anys representats, al costat de l'etiqueta «Rang temporal». */
.evolucio-range-years {
  font-weight: 400;
  color: var(--muted);
  font-feature-settings: 'tnum';
}

/* ── Sidebar: control de posició (slider + botons − / +) ───────────────────── */

.evolucio-range-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.evolucio-range-slider-row.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.evolucio-range-slider-row input[type='range']:disabled {
  cursor: not-allowed;
}

.evolucio-range-slider-row input[type='range'] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--line-strong, rgba(31, 42, 55, 0.18));
  border-radius: 2px;
  outline: none;
}

.evolucio-range-slider-row input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s;
}

.evolucio-range-slider-row input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.evolucio-range-slider-row input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.evolucio-year-step {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong, rgba(31, 42, 55, 0.18));
  background: var(--card);
  color: var(--fg, var(--ink));
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.1s;
  user-select: none;
}

.evolucio-year-step:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.05);
}

.evolucio-year-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  color: var(--muted);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  table.evolucio-table th.evo-col-county,
  table.evolucio-table td.evo-col-county {
    display: none;
  }
}

@media (max-width: 700px) {
  table.evolucio-table th.evo-col-town,
  table.evolucio-table td.evo-col-town,
  table.evolucio-table th.evo-col-life-year,
  table.evolucio-table td.evo-col-life-year {
    display: none;
  }
}
