/* ===========================================================================
   Tableau de bord VPS — serveur commun Digital Systems
   Palette : instance de référence validée (validate_palette.js, clair + sombre).
   Les deux modes sont choisis, jamais inversés automatiquement.
   =========================================================================== */

:root {
  color-scheme: light;

  --surface-1: #fcfcfb;        /* surface des cartes et des graphiques */
  --plane: #f9f9f7;            /* fond de page */
  --surface-2: #f4f3f0;        /* lignes alternées, pistes */
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);

  --series-1: #2a78d6;  /* bleu    */
  --series-2: #eb6834;  /* orange  */
  --series-3: #1baf7a;  /* aqua    */
  --series-4: #eda100;  /* jaune   */
  --series-5: #e87ba4;  /* magenta */
  --series-6: #008300;  /* vert    */
  --series-7: #6250d6;  /* violet  */
  --series-8: #e34948;  /* rouge   */

  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --success-text: #006300;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 1px 1px rgba(11, 11, 11, 0.03);
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --plane: #0d0d0d;
    --surface-2: #232322;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;
    --series-7: #9085e9;
    --series-8: #e66767;
    --success-text: #0ca30c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --plane: #0d0d0d;
  --surface-2: #232322;
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --success-text: #0ca30c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--plane);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- en-tête */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand h1 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -0.01em; white-space: nowrap; }
.brand .host {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.topbar .spacer { flex: 1 1 auto; }

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 0;                 /* sans ça, un flex item « nowrap » pousse la page */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* En dessous de 760px, l'identité de la machine passe à la ligne plutôt que
   de déborder : le bandeau du haut reste lisible sur un téléphone. */
@media (max-width: 760px) {
  .topbar { gap: 10px 14px; padding: 10px 16px; }
  #uptimeLabel { flex: 1 1 100%; order: 10; white-space: normal; }
  .filterbar { top: auto; position: static; }
  main { padding: 0 16px 48px; }
  .banner { margin: 0 16px 12px; }
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.dot.off { background: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 22%, transparent); }
.dot.pulse { animation: pulse 1.1s ease-out; }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.7); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } }

/* ---------------------------------------------------------------- contrôles */

.btn {
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.small { font-size: 12px; padding: 3px 8px; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text-primary); }
.btn.danger { border-color: color-mix(in srgb, var(--critical) 50%, var(--border-strong)); }
.btn.danger:hover { background: color-mix(in srgb, var(--critical) 10%, var(--surface-1)); }

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-1); }
.segmented button {
  font: inherit; font-size: 12px; font-variant-numeric: tabular-nums;
  padding: 4px 10px; border: 0; background: transparent; color: var(--text-secondary); cursor: pointer;
  border-right: 1px solid var(--border);
}
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--text-primary); color: var(--plane); font-weight: 550; }
.segmented button:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }

/* ---------------------------------------------------------------- bandeaux */

.banner {
  margin: 0 20px 14px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface-1);
  display: flex;
  gap: 11px;
  align-items: flex-start;
  font-size: 13px;
}
.banner.error { border-left: 3px solid var(--critical); }
.banner.warn { border-left: 3px solid var(--warning); }
.banner.info { border-left: 3px solid var(--series-1); }
.banner .ico { flex: none; font-size: 15px; line-height: 1.3; }
.banner code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.banner .b-title { font-weight: 600; }
.banner .b-body { color: var(--text-secondary); }

/* ---------------------------------------------------------------- filtres */

.filterbar {
  position: sticky;
  top: 49px;                  /* juste sous la barre du haut */
  z-index: 30;
  background: color-mix(in srgb, var(--plane) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  padding-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 20px;
}
.filterbar label { font-size: 12px; color: var(--text-muted); }
.filterbar .note { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- mise en page */

main { padding: 0 20px 64px; max-width: 1680px; margin: 0 auto; }

section { margin-top: 26px; }
section > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 11px; flex-wrap: wrap; }
section > header h2 { font-size: 13px; font-weight: 600; margin: 0; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-secondary); }
section > header .sub { font-size: 12px; color: var(--text-muted); }
section > header .spacer { flex: 1 1 auto; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------------------------------------------------------------- bandeau héros */

.hero-band {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 14px;
  margin-top: 10px;
}
@media (max-width: 900px) { .hero-band { grid-template-columns: 1fr; } }

.hero { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.hero .label { font-size: 12px; color: var(--text-secondary); }
.hero .figure {
  font-size: 52px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.025em;
  /* Chiffres proportionnels : tabular-nums fait paraître un grand nombre lâche. */
}
.hero .figure .unit { font-size: 22px; font-weight: 500; color: var(--text-secondary); margin-left: 4px; letter-spacing: 0; }
.hero .of { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hero .verdict { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; }

.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; }
.meter-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.meter-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------------------------------------------------------------- tuiles */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 10px; }

.tile { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile .t-label { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.tile .t-value { font-size: 23px; font-weight: 600; line-height: 1.1; letter-spacing: -0.015em; }
.tile .t-value .unit { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }
.tile .t-sub { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; min-height: 15px; }
.tile .spark { height: 26px; margin: -2px -2px 0; }

.status { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 550; }
.status .s-ico { font-size: 11px; line-height: 1; }
.status.good { color: var(--success-text); }
.status.warning { color: var(--text-primary); }
.status.serious { color: var(--text-primary); }
.status.critical { color: var(--critical); }
.status.warning .s-ico { color: #8a5d00; }
:root[data-theme="dark"] .status.warning .s-ico { color: var(--warning); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .status.warning .s-ico { color: var(--warning); } }
.status.serious .s-ico { color: #a8491f; }
:root[data-theme="dark"] .status.serious .s-ico { color: var(--serious); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .status.serious .s-ico { color: var(--serious); } }

/* ---------------------------------------------------------------- graphiques */

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; }
@media (max-width: 620px) { .chart-grid { grid-template-columns: 1fr; } }

.chart-card { padding: 14px 16px 10px; display: flex; flex-direction: column; min-width: 0; }
.chart-card > header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px; flex-wrap: wrap; }
.chart-card h3 { font-size: 13px; font-weight: 600; margin: 0; }
.chart-card .c-sub { font-size: 11px; color: var(--text-muted); }
.chart-card > header .spacer { flex: 1 1 auto; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 7px 0 3px; font-size: 11.5px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.legend .key { flex: none; border-radius: 1px; }
.legend .key.line { width: 13px; height: 2px; }
.legend .key.rect { width: 9px; height: 9px; border-radius: 2px; }
.legend .val { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }

.plot { position: relative; width: 100%; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.plot.stale { opacity: 0.55; transition: opacity 0.2s ease; }  /* on garde le rendu, pas de squelette */
.plot:focus-visible { outline: 2px solid var(--series-1); outline-offset: 3px; border-radius: 4px; }

.gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.axisline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.reflinee { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.ticklabel { fill: var(--text-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; font-family: var(--font); }
.endlabel { fill: var(--text-primary); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--font); }
.reflabel { fill: var(--text-muted); font-size: 10px; font-family: var(--font); }
.gapband { fill: var(--grid); opacity: 0.5; }
.gaplabel { fill: var(--text-muted); font-size: 9.5px; font-family: var(--font); }
.crosshair { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.cursor-dot { stroke: var(--surface-1); stroke-width: 2; }

.tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  min-width: 158px;
  padding: 8px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(11, 11, 11, 0.13);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.1s ease;
}
.tooltip.on { opacity: 1; }
.tooltip .tt-head { color: var(--text-muted); font-size: 11px; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.tooltip .tt-row { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; }
.tooltip .tt-key { flex: none; width: 11px; height: 2px; border-radius: 1px; }
.tooltip .tt-val { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 10px; }
.tooltip .tt-name { color: var(--text-secondary); }

.tableview { max-height: 260px; overflow: auto; margin-top: 8px; border-top: 1px solid var(--border); }
.tableview[hidden] { display: none; }

/* ---------------------------------------------------------------- tableaux */

table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-1);
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.03em;
  white-space: nowrap; cursor: pointer; user-select: none;
}
table.data thead th.nosort { cursor: default; }
table.data thead th .arrow { opacity: 0.45; font-size: 9px; margin-left: 3px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr.off td { color: var(--text-muted); }
table.data .name { font-family: var(--mono); font-size: 12px; }
table.data td.mono { font-family: var(--mono); font-size: 11.5px; color: var(--text-secondary); }
.scroll { overflow: auto; max-height: 560px; border-radius: var(--radius); }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 550; padding: 1.5px 7px;
  border-radius: 99px; border: 1px solid var(--border-strong); color: var(--text-secondary);
  white-space: nowrap;
}
.pill.up { color: var(--success-text); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.pill.down { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); }
.pill.warn { border-color: color-mix(in srgb, var(--warning) 55%, var(--border)); }
.pill.net { font-family: var(--mono); font-size: 10px; }
.pill.net.pub { border-color: color-mix(in srgb, var(--series-2) 45%, var(--border)); }

.tagrow { display: flex; gap: 4px; flex-wrap: wrap; }
.bar-cell { display: flex; align-items: center; gap: 7px; min-width: 110px; }
.bar-track { flex: 1 1 auto; height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 40px; }
.bar-fill { height: 100%; border-radius: 99px; }

/* ---------------------------------------------------------------- disque */

.disk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; }
.panel { padding: 14px 16px; min-width: 0; }
.panel h3 { font-size: 12px; font-weight: 600; margin: 0 0 3px; }
.panel .p-sub { font-size: 11px; color: var(--text-muted); margin-bottom: 11px; }

.hbars { display: flex; flex-direction: column; gap: 9px; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline; }
.hbar .hb-label { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .hb-val { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hbar .hb-track { grid-column: 1 / -1; height: 10px; background: var(--surface-2); border-radius: 3px; overflow: hidden; display: flex; }
/* Écart de 2px en couleur de surface entre segments : c'est le blanc qui sépare, jamais un contour. */
.hbar .hb-track > span { height: 100%; border-right: 2px solid var(--surface-1); }
.hbar .hb-track > span:last-child { border-right: 0; border-radius: 0 3px 3px 0; }
.hbar .hb-track > span:first-child { border-radius: 3px 0 0 3px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 12.5px; }
.kv dt { color: var(--text-muted); white-space: nowrap; }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- actions */

.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.action { padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; }
.action .a-head { display: flex; align-items: center; gap: 8px; }
.action .a-label { font-size: 13px; font-weight: 600; }
.action .a-desc { font-size: 11.5px; color: var(--text-secondary); line-height: 1.4; }
.a-cmd {
  font-family: var(--mono); font-size: 11px; color: var(--text-secondary);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 8px; white-space: pre-wrap; word-break: break-word; margin: 0; line-height: 1.5;
}
dialog .a-cmd { font-size: 11.5px; }
.action .a-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }

.console {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.5;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  max-height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  color: var(--text-secondary); margin: 0;
}
.console:empty::before { content: "— aucune sortie —"; color: var(--text-muted); }

.log-entry { border-bottom: 1px solid var(--border); padding: 9px 0; }
.log-entry:last-child { border-bottom: 0; }
.log-head { display: flex; align-items: center; gap: 9px; font-size: 12px; flex-wrap: wrap; }
.log-head time { color: var(--text-muted); font-variant-numeric: tabular-nums; font-size: 11px; }
.log-head .l-label { font-weight: 600; }
.log-cmd { font-family: var(--mono); font-size: 11px; color: var(--text-secondary); margin-top: 3px; word-break: break-all; }

/* ---------------------------------------------------------------- dialogue */

dialog {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-1);
  color: var(--text-primary);
  padding: 0;
  max-width: min(680px, 92vw);
  width: 100%;
  box-shadow: 0 16px 48px rgba(11, 11, 11, 0.26);
}
dialog::backdrop { background: rgba(11, 11, 11, 0.42); backdrop-filter: blur(2px); }
dialog .d-head { padding: 16px 20px 0; }
dialog h3 { margin: 0 0 4px; font-size: 15px; }
dialog .d-sub { font-size: 12.5px; color: var(--text-secondary); margin: 0; }
dialog .d-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 11px; }
dialog .d-foot { padding: 12px 20px 16px; display: flex; gap: 9px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--border); }
dialog .d-foot .spacer { flex: 1 1 auto; }
dialog input[type="text"] {
  font: inherit; font-family: var(--mono); font-size: 13px;
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--plane); color: var(--text-primary); width: 100%;
}
dialog input[type="text"]:focus-visible { outline: 2px solid var(--series-1); outline-offset: 1px; }
dialog .warn-box {
  font-size: 12.5px; line-height: 1.5;
  border-left: 3px solid var(--warning); background: var(--surface-2);
  padding: 9px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
dialog .warn-box.crit { border-left-color: var(--critical); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.empty { padding: 26px 16px; text-align: center; color: var(--text-muted); font-size: 12.5px; }
.loading-skeleton { padding: 40px 20px; text-align: center; color: var(--text-muted); }


/* ---------------------------------------------------------- gain d'une action */

.gain {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 2px 8px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--series-2) 45%, var(--border));
  color: var(--text-primary); white-space: nowrap;
}
.gain.none { border-color: var(--border); color: var(--text-muted); font-weight: 500; }

.action.inert { opacity: 0.6; }
.action.inert .a-label { color: var(--text-secondary); }

.inert-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  padding: 10px 2px 0; grid-column: 1 / -1;
}

/* ---------------------------------------------------------- résultat avant/après */

.result {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 13px 15px; display: flex; flex-direction: column; gap: 4px;
}
.result.win { border-left: 3px solid var(--good); }
.result.zero { border-left: 3px solid var(--warning); }
.result.fail { border-left: 3px solid var(--critical); }
.result .r-label { font-size: 11px; color: var(--text-muted); }
.result .r-figure { font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.result .r-figure .unit { font-size: 15px; font-weight: 500; color: var(--text-secondary); margin-left: 3px; }
.result .r-sub { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

table.delta { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
table.delta th, table.delta td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: right; }
table.delta th:first-child, table.delta td:first-child { text-align: left; }
table.delta thead th { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
table.delta td { font-variant-numeric: tabular-nums; }
table.delta tbody tr:last-child td { border-bottom: 0; }
table.delta td.win { color: var(--success-text); font-weight: 600; }
table.delta td.flat { color: var(--text-muted); }


/* ---------------------------------------------------- tuile qui mène quelque part */

.tile.clickable { cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease; }
.tile.clickable:hover { border-color: var(--border-strong); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface-1)); }
.tile.clickable:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.tile .t-goto {
  font-size: 11px; color: var(--text-muted); margin-top: auto; padding-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile.clickable:hover .t-goto { color: var(--series-1); }
.tile .t-note { font-size: 11px; color: var(--text-secondary); }

/* Repère bref sur la cible d'un saut : on montre où on vient d'arriver. */
@keyframes flashring {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--series-1) 55%, transparent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}
.flash { animation: flashring 1.1s ease-out 1; border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }
