/* ==========================================================================
   Carnet des Songes — visionneuse de combats (combats.html)
   Reprend les variables et composants de styles.css ; seules la grille,
   les jetons et la lecture ont leurs propres règles.
   ========================================================================== */

:root {
  --tile-a: #332c64;
  --tile-b: #3a3370;
  --tile-line: rgba(180, 165, 255, 0.3);
  --hole: rgba(160, 140, 255, 0.025);
  --hole-line: rgba(160, 140, 255, 0.06);
  --block-top: #4b4478;
  --block-left: #2f2a55;
  --block-right: #3a3466;
  --camp-nous: #2ee6d6;
  --camp-ennemi: #ff6b6b;
  --lance: #ffc94d;
  --hp: #34e0a1;
  --hp-low: #ff6b6b;
  --shield: #9ad7ff;
  --zone-nous: rgba(255, 201, 77, 0.42);
  --zone-ennemi: rgba(255, 107, 107, 0.42);
  --token-bg: #1a1730;
}

:root[data-theme="clair"] {
  --tile-a: #ffffff;
  --tile-b: #f1eeff;
  --tile-line: #c9c0ff;
  --hole: rgba(80, 60, 200, 0.02);
  --hole-line: rgba(80, 60, 200, 0.06);
  --block-top: #b3a8e8;
  --block-left: #8f84cc;
  --block-right: #a197db;
  --camp-nous: #0891b2;
  --camp-ennemi: #e11d48;
  --lance: #d97706;
  --hp: #059669;
  --hp-low: #e11d48;
  --shield: #3b82f6;
  --zone-nous: rgba(245, 158, 11, 0.4);
  --zone-ennemi: rgba(225, 29, 72, 0.3);
  --token-bg: #ffffff;
}

.cb-page { padding-bottom: 24px; }
.tabs a.tab { text-decoration: none; display: inline-block; }
.tabs a.tab[aria-current="page"] { color: var(--surface); background: var(--ink); }
.topbar-right > a.btn { text-decoration: none; }

.cb-banner {
  margin: 16px 0 0; padding: 14px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.cb-banner p { margin: 0; }
.cb-banner p + p { margin-top: 6px; color: var(--ink-2); font-size: 13.5px; }
.cb-banner.is-demo { border-style: dashed; padding: 8px 14px; font-size: 13px; color: var(--ink-2); }
.cb-banner a { color: var(--paradoxe); font-weight: 700; }

.cb-foot { margin-top: 28px; font-size: 12px; color: var(--ink-muted); }
.cb-foot a { color: inherit; }

/* ------------------------------------------------------------- liste -- */

.cb-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.cb-filters select, #cb-metric {
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-xs);
  padding: 6px 10px; min-width: 150px;
}
.cb-fav-filter { padding: 6px 12px; }
.cb-fav-filter[aria-pressed="true"] { color: var(--gold); border-color: color-mix(in srgb, var(--gold-mark) 45%, transparent); background: var(--gold-wash); }
.cb-count { margin-left: auto; font-size: 12.5px; color: var(--ink-muted); align-self: center; }

.cb-list { display: grid; gap: 8px; margin-top: 12px; }
.cb-empty { padding: 28px 16px; text-align: center; color: var(--ink-muted); }

.cb-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1.6fr) minmax(0, 1fr) auto auto;
  gap: 6px 16px; align-items: center;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none; cursor: pointer;
  transition: border-color 0.16s ease, transform 0.12s ease;
}
.cb-row:hover { border-color: var(--line-strong); }
.cb-row:focus-visible { outline: 2px solid var(--paradoxe); outline-offset: 2px; }
.cb-row-issue { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.cb-row-main { min-width: 0; }
.cb-row-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-row-sub { font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-row-team { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.cb-row-team .cb-vs { font-size: 12px; color: var(--ink-muted); margin-left: 6px; white-space: nowrap; }
.cb-row-stats { display: flex; gap: 14px; font-variant-numeric: tabular-nums; }
.cb-stat { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.cb-stat b { font-size: 14px; }
.cb-stat span { font-size: 10.5px; color: var(--ink-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.cb-row-end { display: flex; align-items: center; gap: 8px; }
.chip.limit { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning) 10%, transparent); }
.chip.kind { color: var(--ink-2); }
.chip.ver { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--ink-2); }

.cb-star {
  appearance: none; border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: 20px; line-height: 1; width: 36px; height: 36px; border-radius: 9px;
  color: var(--ink-muted); opacity: 0.55;
}
.cb-star:hover { opacity: 1; border-color: var(--line); }
.cb-star[aria-pressed="true"] { color: var(--gold-mark); opacity: 1; }
.cb-more { display: flex; justify-content: center; margin-top: 12px; }

/* Petits jetons (liste, barre d'initiative) */
.cb-tok {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; overflow: hidden;
  font-size: 10px; font-weight: 800; color: #fff;
  background: var(--token-bg); border: 2px solid var(--camp-nous);
}
.cb-tok.ennemi { border-color: var(--camp-ennemi); }
.cb-tok img { width: 100%; height: 100%; object-fit: cover; }
.cb-tok.lance { border-radius: 3px; transform: rotate(45deg) scale(0.72); background: var(--lance); border-color: var(--lance); }

@media (max-width: 900px) {
  .cb-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cb-row-issue { flex-direction: row; grid-column: 1 / -1; order: -1; }
  .cb-row-team { grid-column: 1 / 3; }
  .cb-row-stats { grid-column: 1 / 3; justify-content: flex-start; }
  .cb-stat { align-items: flex-start; }
  .cb-row-end { grid-column: 3; grid-row: 2 / 5; align-self: start; }
  .cb-row-main { grid-column: 1 / 3; }
}

/* ------------------------------------------------------- visionneuse -- */

.cb-head { display: flex; align-items: center; gap: 12px; padding: 18px 0 12px; }
.cb-head > a.btn { text-decoration: none; flex: none; }
.cb-head-title { flex: 1; min-width: 0; }
.cb-head h1 {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(19px, 2.6vw, 26px); letter-spacing: -0.01em; line-height: 1.2;
  font-variation-settings: "SOFT" 24, "WONK" 1;
}
.cb-head-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }

.cb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.cb-layout .card + .card { margin-top: 0; }
.cb-side { display: grid; gap: 14px; }
@media (max-width: 1040px) {
  .cb-layout { grid-template-columns: minmax(0, 1fr); }
}

.cb-stage { padding: 12px; }

/* Barre d'initiative */
.cb-initiative {
  display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.cb-ini {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 40px; padding: 4px 0 3px; border-radius: 9px; border: 1px solid transparent;
  transition: opacity 0.3s ease, background 0.2s ease, border-color 0.2s ease;
}
.cb-ini .cb-tok { width: 30px; height: 30px; }
.cb-ini-hp { width: 30px; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.cb-ini-hp i { display: block; height: 100%; background: var(--hp); }
.cb-ini.is-current { background: var(--surface-2); border-color: var(--line-strong); box-shadow: var(--glow-violet); }
.cb-ini.is-dead { opacity: 0.32; filter: grayscale(1); }
.cb-ini.is-summon .cb-tok { width: 24px; height: 24px; }

/* Plateau */
.cb-board-wrap {
  overflow: auto; border-radius: var(--radius-sm);
  background:
    radial-gradient(90% 70% at 50% 40%, color-mix(in srgb, var(--paradoxe) 7%, transparent), transparent 75%),
    var(--surface-2);
  border: 1px solid var(--line);
  touch-action: pan-x pan-y;
}
.cb-board { display: block; width: 100%; height: auto; user-select: none; }
.cb-board .t-sol, .cb-legend .t-sol { fill: var(--tile-a); stroke: var(--tile-line); stroke-width: 0.6; }
.cb-board .t-sol.t-alt { fill: var(--tile-b); }
.cb-board .t-trou, .cb-legend .t-trou { fill: var(--hole); stroke: var(--hole-line); stroke-width: 0.5; }
.cb-board .b-top, .cb-legend .b-top { fill: var(--block-top); }
.cb-board .b-left, .cb-legend .b-left { fill: var(--block-left); }
.cb-board .b-right, .cb-legend .b-right { fill: var(--block-right); }
.cb-board .z-cell { fill: var(--zone-nous); stroke: color-mix(in srgb, var(--gold-mark) 70%, transparent); stroke-width: 0.8; }
.cb-board .z-cell.ennemi { fill: var(--zone-ennemi); stroke: color-mix(in srgb, var(--camp-ennemi) 70%, transparent); }
.cb-board .z-target { fill: none; stroke: var(--gold-mark); stroke-width: 1.8; }
.cb-board .z-target.ennemi { stroke: var(--camp-ennemi); }
.cb-board .z-path { fill: none; stroke: var(--camp-nous); stroke-width: 1.6; stroke-dasharray: 3 3; stroke-linecap: round; opacity: 0.8; }
.cb-board .z-path.ennemi { stroke: var(--camp-ennemi); }
.cb-board .z-cast { stroke: var(--gold-mark); stroke-width: 1.8; stroke-linecap: round; fill: none; }
.cb-board .z-cast.ennemi { stroke: var(--camp-ennemi); }
.cb-board .z-push { stroke: var(--ink-2); stroke-width: 1.4; fill: none; stroke-dasharray: 2 2; }

.cb-board .ent { transition: opacity 0.6s ease; }
.cb-board .ent.is-dead { opacity: 0; }
.cb-board .ent.is-absent { opacity: 0; }
.cb-board .ent-shadow { fill: rgba(0, 0, 0, 0.35); }
:root[data-theme="clair"] .cb-board .ent-shadow { fill: rgba(40, 20, 120, 0.18); }
.cb-board .ent-ring { fill: none; stroke: var(--camp-nous); stroke-width: 2.2; }
.cb-board .ennemi .ent-ring { stroke: var(--camp-ennemi); }
.cb-board .ent-bg { fill: var(--token-bg); }
.cb-board .ent-txt { font: 800 8px var(--font-ui); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.cb-board .ent-hp-bg { fill: rgba(0, 0, 0, 0.55); }
:root[data-theme="clair"] .cb-board .ent-hp-bg { fill: rgba(40, 20, 120, 0.22); }
.cb-board .ent-hp { fill: var(--hp); }
.cb-board .ent-hp.is-low { fill: var(--hp-low); }
.cb-board .ent-sh { fill: var(--shield); }
.cb-board .ent-halo { fill: none; stroke: var(--ink); stroke-width: 1.2; opacity: 0; }
.cb-board .ent.is-current .ent-halo { opacity: 0.9; animation: cb-pulse 1.3s ease-in-out infinite; }
.cb-board .lance-mark { fill: var(--lance); stroke: var(--ground); stroke-width: 1; }
.cb-board .ent.lance .ent-ring { display: none; }

.cb-board .fx-num {
  font: 800 11px var(--font-ui); text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: var(--ground); stroke-width: 3px; stroke-linejoin: round;
  fill: var(--critical);
  animation: cb-float 1.4s ease-out forwards;
}
.cb-board .fx-num.heal { fill: var(--good); }
.cb-board .fx-num.still { animation: none; }
.cb-board .fx-skull { font: 700 12px var(--font-ui); text-anchor: middle; fill: var(--ink); animation: cb-float 1.4s ease-out forwards; }

@keyframes cb-float {
  0% { opacity: 0; transform: translateY(4px); }
  15% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px); }
}
@keyframes cb-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) {
  .cb-board .fx-num, .cb-board .fx-skull { animation: none; }
  .cb-board .ent.is-current .ent-halo { animation: none; }
}

.cb-now {
  margin-top: 10px; padding: 9px 12px; min-height: 42px;
  border-radius: var(--radius-xs); background: var(--surface-2); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
}
.cb-now small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-muted); letter-spacing: 0.06em; text-transform: uppercase; }

.cb-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 10px; }
.cb-buttons { display: flex; gap: 6px; align-items: center; }
.cb-buttons .icon-btn { font-size: 13px; }
.cb-play { min-width: 112px; justify-content: center; }
.cb-zoom { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.cb-zoom .icon-btn { font-size: 16px; font-weight: 700; }

.cb-timeline { position: relative; margin-top: 12px; padding-top: 16px; }
.cb-timeline input[type="range"] { width: 100%; accent-color: var(--paradoxe); margin: 0; }
.cb-ticks { position: absolute; left: 8px; right: 8px; top: 0; height: 16px; }
.cb-ticks b {
  position: absolute; top: 0; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 800; color: var(--ink-muted); cursor: pointer; pointer-events: auto;
}
.cb-ticks b::after { content: ""; position: absolute; left: 50%; top: 12px; width: 1px; height: 8px; background: var(--axis); }
.cb-ticks i { position: absolute; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--critical); transform: translateX(-50%); opacity: 0.8; }
.cb-pos { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Journal */
.cb-log-card { padding: 14px 10px 10px 14px; }
.cb-log {
  list-style: none; margin: 8px 0 0; padding: 0 4px 0 0;
  max-height: 340px; overflow-y: auto; font-size: 12.5px; scrollbar-width: thin;
}
.cb-log li { padding: 3px 7px; border-radius: 6px; cursor: pointer; color: var(--ink-2); }
.cb-log li:hover { background: var(--surface-2); color: var(--ink); }
.cb-log li.t-tour { color: var(--ink); font-weight: 700; margin-top: 6px; }
.cb-log li.t-fin { color: var(--ink-muted); font-size: 11.5px; }
.cb-log li.t-mort { color: var(--critical); font-weight: 600; }
.cb-log li.is-future { opacity: 0.5; }
.cb-log li.is-current { background: color-mix(in srgb, var(--paradoxe) 18%, transparent); color: var(--ink); opacity: 1; }
@media (max-width: 1040px) { .cb-log { max-height: 240px; } }

.cb-dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 10px 0 0; font-size: 13px; }
.cb-dl dt { color: var(--ink-muted); }
.cb-dl dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.cb-legend ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.cb-legend li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-legend svg { width: 26px; height: 16px; flex: none; }
.cb-leg-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--camp-nous); }
.cb-leg-dot.ennemi { border-color: var(--camp-ennemi); }
.cb-leg-lance { display: inline-block; width: 8px; height: 8px; background: var(--lance); transform: rotate(45deg); }

/* ------------------------------------------------------- évolution -- */

.cb-chart { position: relative; margin-top: 8px; }
.cb-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.cb-chart .grid line { stroke: var(--grid); }
.cb-chart .axis text { fill: var(--ink-muted); font: 500 11px var(--font-ui); }
.cb-chart .baseline { stroke: var(--axis); }
.cb-chart .series { fill: none; stroke: var(--paradoxe-mark); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cb-chart .dot { fill: var(--paradoxe-mark); stroke: var(--surface); stroke-width: 2; }
.cb-chart .dot.is-hover { r: 6; }
.cb-chart .cross { stroke: var(--axis); stroke-dasharray: 3 3; }
.cb-chart .label { fill: var(--ink); font: 700 11.5px var(--font-ui); }
.cb-chart .hit { fill: transparent; cursor: crosshair; }

.cb-tooltip {
  position: fixed; z-index: 90; pointer-events: none; max-width: 260px;
  padding: 8px 10px; border-radius: 9px; font-size: 12.5px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.cb-tooltip b { display: block; }
.cb-tooltip span { color: var(--ink-muted); }

.cb-table-wrap { overflow-x: auto; margin-top: 8px; }
.cb-table { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 100%; }
.cb-table th, .cb-table td { padding: 5px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.cb-table th:first-child, .cb-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.cb-table thead th { color: var(--ink-muted); font-weight: 700; font-size: 11px; }
.cb-table th.is-sel, .cb-table td.is-sel { color: var(--paradoxe); font-weight: 700; }

@media (max-width: 560px) {
  .cb-page { padding-left: 12px; padding-right: 12px; }
  .cb-stage { padding: 8px; }
  .cb-zoom { margin-left: 0; }
  .cb-controls { justify-content: space-between; }
  .cb-count { margin-left: 0; flex: 1 1 100%; }
  .cb-filters .field, .cb-filters select { flex: 1 1 140px; min-width: 0; }
}

/* ------------------------------------------- évolution : décisions -- */

.cb-chart .dot.is-rejete { fill: var(--surface); stroke: var(--paradoxe-mark); }
.cb-evo-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; color: var(--ink-muted); }
.cb-evo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cb-evo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--paradoxe-mark); border: 2px solid var(--paradoxe-mark); }
.cb-evo-dot.is-rejete { background: transparent; }
.cb-table .cb-td-left { text-align: left; }
.cb-table td.cb-td-raisons { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------ entraînement -- */

.tr-live { font-size: 12px; align-self: center; }
.tr-live.is-on { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.tr-live.is-on::before { content: "● "; }
.tr-live.is-off { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }

.tr-card.is-stale { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.tr-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tr-card-head .card-title { margin: 0; }
.tr-card-head a.btn { text-decoration: none; }

.tr-head { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.tr-head-sp { flex: 1; }
.tr-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 8px;
  border-radius: 999px; font-weight: 800; font-size: 14px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink);
}
.tr-badge-i { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 50%; font-size: 9.5px; background: var(--line); }
.tr-badge.is-good { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.tr-badge.is-warn { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 10%, transparent); }
.tr-badge.is-bad { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); background: color-mix(in srgb, var(--critical) 10%, transparent); }
.tr-badge.is-idle { color: var(--ink-2); }
.tr-raison { font-weight: 600; color: var(--ink-2); }
.tr-age { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-muted); }
.tr-age.is-stale { color: var(--warning); font-weight: 700; }
.tr-age.is-stale::before { content: "⚠ "; }
.tr-message { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); }
.tr-muted { color: var(--ink-muted); font-size: 13px; margin: 6px 0 0; }

.tr-phase { margin-top: 14px; }
.tr-phase-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.tr-k { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted); }
.tr-phase-sub { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tr-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.tr-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--paradoxe-mark); transition: width 0.6s ease; }
.tr-bar.is-thin { height: 6px; }
.tr-bar.is-none { visibility: hidden; }
.tr-bar.is-indet > i { width: 30%; animation: tr-indet 1.6s ease-in-out infinite; }
@keyframes tr-indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .tr-bar.is-indet > i { animation: none; } .tr-bar > i { transition: none; } }

.tr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 28px; margin-top: 16px; }
.tr-h3 { margin: 0 0 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.tr-dl { margin-top: 0; }
.tr-phases { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: 13px; }
.tr-phases li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.tr-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--axis); }
.tr-phases .is-faite .tr-dot { background: var(--good); border-color: var(--good); }
.tr-phases .is-en_cours .tr-dot { background: var(--paradoxe-mark); border-color: var(--paradoxe-mark); box-shadow: 0 0 0 3px color-mix(in srgb, var(--paradoxe-mark) 25%, transparent); }
.tr-phases .is-en_cours .tr-ph-nom { font-weight: 800; }
.tr-phases .is-a_venir { color: var(--ink-muted); }
.tr-ph-etat { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr-combat-t { font-weight: 700; overflow-wrap: anywhere; }
.tr-combat-c { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tr-combat-c a.btn { text-decoration: none; }

.tr-res { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 28px; margin-top: 10px; }
.tr-gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.tr-gauge-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-bottom: 4px; }
.tr-gauge-top span { color: var(--ink-muted); }
.tr-gauge-top b { font-variant-numeric: tabular-nums; }
.tr-gauge-sub { margin-top: 3px; font-size: 11.5px; color: var(--ink-muted); }
.tr-gauge.is-over .tr-bar > i { background: var(--warning); }

.tr-multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 20px; margin-top: 14px; }
.tr-multi-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.tr-fig { margin: 0; min-width: 0; }
.tr-fig figcaption { display: flex; align-items: baseline; gap: 4px; font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.tr-fig figcaption span { font-weight: 500; color: var(--ink-muted); }
.tr-fig .tr-last { margin-left: auto; font-variant-numeric: tabular-nums; }
.tr-fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.tr-fig .grid line { stroke: var(--grid); }
.tr-fig .axis text { fill: var(--ink-muted); font: 500 10.5px var(--font-ui); }
.tr-fig .baseline { stroke: var(--axis); }
.tr-fig .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.tr-fig .series.tr-s1 { stroke: var(--paradoxe-mark); }
.tr-fig .series.tr-s2 { stroke: var(--reve-mark); stroke-dasharray: 5 3; }
.tr-fig .dot { stroke: var(--surface); stroke-width: 2; }
.tr-fig .dot.tr-s1 { fill: var(--paradoxe-mark); }
.tr-fig .dot.tr-s2 { fill: var(--reve-mark); }
.tr-fig .cross { stroke: var(--axis); stroke-dasharray: 3 3; }
.tr-fig .hit { fill: transparent; cursor: crosshair; }
.tr-fig .tr-ref { stroke: var(--ink-muted); stroke-dasharray: 2 3; stroke-width: 1; }
.tr-fig .tr-ref-t { fill: var(--ink-muted); font: 600 10px var(--font-ui); }
.tr-vide { padding: 30px 0; text-align: center; }
.tr-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.tr-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tr-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tr-sw { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--paradoxe-mark); vertical-align: middle; }
.tr-sw.tr-s2 { border-top: 2px dashed var(--reve-mark); }
.cb-tooltip .tr-sw { margin-right: 5px; }

.tr-table td.tr-td-raison { text-align: left; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 560px) {
  .tr-gauges { grid-template-columns: minmax(0, 1fr); }
  .tr-multi, .tr-multi-3, .tr-res, .tr-cols { grid-template-columns: minmax(0, 1fr); }
  .tr-badge { font-size: 13px; }
}
