/* GSForever : calculateur de talents (/building), thème « Forge cyan ».
   Chargé uniquement par resources/views/site/building.blade.php.
   Classes produites par la vue et par public/js/calculator.js (ne pas renommer). */

/* ---------- En-tête façon affiche ---------- */
.page-head.building-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px 40px;
  max-width: 1192px;
  margin: 40px auto 0;
  padding: 44px 44px 40px;
  overflow: hidden;
  border: 3px solid var(--ink-900);
  border-radius: var(--r-lg);
  background:
    repeating-linear-gradient(-55deg, transparent 0 22px, rgba(22, 212, 238, .05) 22px 24px),
    linear-gradient(125deg, var(--ink-600) 0%, var(--ink-700) 45%, var(--ink-800) 100%);
  box-shadow: 7px 7px 0 var(--cyan);
  text-align: left;
}
/* Bande cyan en biais dans le coin, comme un ruban d'affiche */
.page-head.building-header::after {
  content: "";
  position: absolute;
  top: -40px;
  right: -60px;
  width: 260px;
  height: 64px;
  background: var(--cyan);
  border-block: 3px solid var(--ink-900);
  transform: rotate(28deg);
  pointer-events: none;
}
.bh-copy { position: relative; z-index: 1; min-width: 0; }
.building-header .kicker {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  border: 2px solid var(--ink-900);
  border-radius: 6px;
  background: var(--cyan);
  color: var(--ink-900);
  box-shadow: 3px 3px 0 var(--ink-900);
  transform: rotate(-2deg);
}
.building-header h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.9rem);
  line-height: .95;
  text-shadow: 4px 4px 0 var(--ink-900);
}
.building-header .lead { max-width: 64ch; margin: 0 0 12px; color: var(--text); }
.bh-credit { display: block; color: var(--text-soft); }

/* Trois chiffres en pastilles empilées */
.bh-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bh-stats li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 210px;
  padding: 8px 16px;
  border: 3px solid var(--ink-900);
  border-radius: var(--r-md);
  background: var(--ink-900);
  box-shadow: 4px 4px 0 var(--teal);
}
.bh-stats strong {
  min-width: 2ch;
  color: var(--cyan-bright);
  font-size: 2rem;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bh-stats span {
  color: var(--text-soft);
  font-size: .78rem;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- Structure du calculateur ---------- */
.calc { display: flex; flex-direction: column; gap: 24px; }
.calc .card > p { margin: 0; }

/* Titres d'étape : numéro en autocollant cyan */
.calc .step {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}
.calc .step label { display: inline; color: inherit; font: inherit; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 3px solid var(--ink-900);
  border-radius: var(--r-sm);
  background: var(--cyan);
  color: var(--ink-900);
  box-shadow: 3px 3px 0 var(--ink-900);
  font-size: 1.25rem;
  font-weight: 900;
  font-style: italic;
  transform: rotate(-5deg);
}

.calc-setup { display: flex; flex-direction: column; gap: 20px; }
.calc-setup .card { gap: 16px; }

/* Grille des 9 classes, liseré à la couleur de la classe (--c posé par le JS) */
.class-picker {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;
}
.class-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  border: 2px solid var(--line-soft);
  border-bottom: 4px solid var(--c, var(--cyan));
  border-radius: var(--r-sm);
  background: var(--ink-850);
  color: var(--text-soft);
  font: italic 700 .88rem/1.1 var(--font);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.class-chip img {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink-900);
  border-radius: 6px;
}
.class-chip:hover {
  color: var(--white);
  background: var(--ink-800);
  transform: translate(-1px, -2px);
  box-shadow: 3px 3px 0 var(--c, var(--cyan));
}
.class-chip.active,
.class-chip[aria-pressed="true"] {
  border-color: var(--ink-900);
  border-bottom-color: var(--c, var(--cyan));
  background: color-mix(in srgb, var(--c, var(--cyan)) 24%, var(--ink-800));
  color: var(--white);
  box-shadow: 4px 4px 0 var(--c, var(--cyan));
  transform: translate(-2px, -2px);
}

/* Carte du niveau : une seule ligne sur ordinateur */
.calc-level-card {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 16px 24px;
}
.calc-level-card select {
  width: auto;
  min-width: 250px;
  border-color: var(--cyan);
  color: var(--cyan-bright);
  font-weight: 700;
}

.calc-step { display: flex; flex-direction: column; gap: 10px; }
.calc-step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.calc-step-head .btn.small { min-height: 44px; }
.calc-help { margin: 0; max-width: 90ch; }

/* ---------- Barre collante des points ---------- */
.calc-bar {
  position: sticky;
  top: 80px;
  z-index: 20;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 14px 22px;
  border-color: var(--ink-900);
  border-radius: var(--r-md);
  background: linear-gradient(100deg, var(--ink-900) 0%, var(--ink-800) 100%);
  box-shadow: 5px 5px 0 var(--cyan);
}
.calc-bar-spec { display: flex; flex-direction: column; flex: 1 1 260px; min-width: 0; }
.calc-bar-spec .kicker { margin: 0 0 2px; }
.calc-bar-spec strong {
  color: var(--white);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1.25;
}
.calc-bar-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 14px;
  border: 2px solid var(--cyan);
  border-radius: var(--r-sm);
  background: var(--ink-850);
}
.calc-bar-left strong {
  color: var(--cyan-bright);
  font-size: 2.1rem;
  font-style: italic;
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.calc-bar-left span {
  color: var(--text-soft);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Message d'état (ligne réservée pour éviter les sauts) */
.calc-msg {
  min-height: 24px;
  margin: -8px 0;
  color: var(--cyan-bright);
  font-weight: 700;
}
.calc-msg:not(:empty)::before { content: "› "; color: var(--cyan); }

/* ---------- Arbres de talents ---------- */
.trees {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.tree {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 0 12px 20px;
  overflow: hidden;
  border: 3px solid var(--ink-900);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(22, 212, 238, .08), transparent 70%),
    linear-gradient(180deg, var(--ink-750) 0%, var(--ink-900) 100%);
  box-shadow: var(--hard);
}
.tree .tree-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 -12px 6px;
  padding: 12px 14px;
  border-bottom: 3px solid var(--ink-900);
  background: var(--ink-700);
}
.tree .tree-head img {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink-900);
  border-radius: 6px;
}
.tree .tree-head strong {
  flex-grow: 1;
  min-width: 0;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.tree .tree-head span {
  flex-shrink: 0;
  padding: 2px 10px;
  border: 2px solid var(--ink-900);
  border-radius: 6px;
  background: var(--cyan);
  color: var(--ink-900);
  font-size: .82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Un palier = numéro de points requis + 4 colonnes comme en jeu */
.tier { display: flex; align-items: flex-start; gap: 6px; }
.tier .req {
  flex-shrink: 0;
  width: 20px;
  padding-top: 15px;
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cells { display: flex; flex-grow: 1; justify-content: center; gap: 5px; }
.cells .slot-empty { flex-shrink: 0; width: 76px; }

/* Une case de talent */
.talent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  width: 76px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}
.talent .tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink-600);
  border-radius: var(--r-sm);
  background: var(--ink-900);
  box-shadow: 3px 3px 0 var(--ink-900);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.talent .tile img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  pointer-events: none;
}
/* Initiales quand l'icône ne charge pas */
.talent .tile > b:not(.rank) { color: var(--text-soft); font-style: italic; font-weight: 900; }
.talent .rank {
  position: absolute;
  right: -8px;
  bottom: -7px;
  padding: 0 5px;
  border: 2px solid var(--ink-600);
  border-radius: 5px;
  background: var(--ink-900);
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.talent .name {
  color: var(--text-soft);
  font-size: .7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-wrap: pretty;
  hyphens: auto;
  overflow-wrap: break-word;
  padding: 1px 4px;
  border-radius: 4px;
}
/* Nom posé sur un fond sombre : une flèche de prérequis passe derrière sans le rayer. La marge reste
   la même avec ou sans flèches, sinon les noms se replient autrement et décalent les flèches déjà tracées. */
.tree .req-arrows ~ .tier .talent .name { background: var(--ink-850); }

/* Disponible : vert jeu */
.talent.avail .tile { border-color: var(--ok); }
.talent.avail .rank { border-color: var(--ok); color: var(--ok); }
/* Investi : vert plein */
.talent.active .tile { border-color: var(--ok); box-shadow: 3px 3px 0 var(--ok); }
.talent.active .rank { border-color: var(--ink-900); background: var(--ok); color: var(--ink-900); }
.talent.active .name { color: var(--white); }
/* Rang maximum : or WoW */
.talent.maxed .tile { border-color: var(--wow-gold); box-shadow: 3px 3px 0 var(--wow-gold); }
.talent.maxed .rank { border-color: var(--ink-900); background: var(--wow-gold); color: var(--ink-900); }
.talent.maxed .name { color: var(--wow-gold); }
/* Verrouillé : icône éteinte */
.talent.locked { cursor: not-allowed; }
.talent.locked .tile { border-color: var(--line-soft); box-shadow: none; }
.talent.locked .tile img { filter: grayscale(1) brightness(.55); }
.talent.locked .name { color: var(--text-muted); }

/* Survol et focus clavier */
.talent:not(.locked):hover .tile { transform: translate(-2px, -2px); }
.talent.avail:hover .tile { box-shadow: 4px 4px 0 var(--ok); }
.talent.active:hover .tile { box-shadow: 5px 5px 0 var(--ok); }
.talent.maxed:hover .tile { box-shadow: 5px 5px 0 var(--wow-gold); }
.talent:focus-visible .tile { outline: 3px solid var(--cyan-bright); outline-offset: 4px; }

/* Prérequis : flèches dessinées du talent requis vers le talent qu'il débloque (calque SVG sous les cases) */
.tree { position: relative; }
.tree > *:not(.req-arrows) { position: relative; z-index: 1; }
.req-arrows { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.req-arrows .halo { fill: none; stroke: var(--ink-900); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.req-arrows .line { fill: none; stroke: #4c6470; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.req-arrows .head { fill: #4c6470; stroke: var(--ink-900); stroke-width: 2; stroke-linejoin: round; }
.req-arrows .is-open .line { stroke: var(--ok); }
.req-arrows .is-open .head { fill: var(--ok); }
.req-arrows .is-done .line { stroke: var(--wow-gold); }
.req-arrows .is-done .head { fill: var(--wow-gold); }

/* ---------- Infobulle façon jeu ---------- */
.tooltip {
  position: absolute;
  z-index: 3000;
  width: 340px;
  padding: 14px 16px;
  border: 2px solid #8a9aa6;
  border-radius: 6px;
  background: rgba(4, 8, 14, .97);
  box-shadow: 0 0 0 2px var(--ink-900), 5px 5px 0 var(--ink-900);
  color: var(--white);
  font-size: .88rem;
  line-height: 1.45;
  pointer-events: none;
}
.tip-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.tip-head img {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink-600);
  border-radius: 6px;
}
.tip-head div { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.tip-head strong { color: var(--white); font-size: 1.05rem; font-weight: 800; line-height: 1.2; }
.tip-head span { color: var(--text-soft); font-size: .8rem; font-weight: 600; }
.tooltip p { margin: 0 0 10px; color: var(--wow-gold); }
.tooltip .muted { color: var(--text-muted); }
.tip-next { color: var(--white); font-weight: 800; }

/* Statut du talent par rapport à Classic */
.st {
  align-self: flex-start;
  flex-shrink: 0;
  padding: 1px 7px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: .68rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.st.new { color: var(--wow-green); }
.st.mod { color: var(--warn); }
.st.moved { color: var(--wow-blue); }
.st.same { color: var(--text-muted); }

/* ---------- Ordre des talents ---------- */
.order { display: flex; flex-wrap: wrap; gap: 8px; }
.order-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 3px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--ink-850);
  color: var(--text-soft);
  font-size: .8rem;
  font-weight: 600;
}
.order-chip .oc-rank { color: var(--wow-gold, var(--cyan-bright)); font-weight: 800; white-space: nowrap; }
.order-chip b {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--cyan);
  color: var(--ink-900);
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- Partage et Mes builds ---------- */
.calc-share { margin: 0; }
.calc-share .card { gap: 12px; }
.calc-share h3 { margin: 0; }
.calc-share .btn { align-self: flex-start; }
.saved-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.saved-tools input { flex: 1 1 160px; min-width: 0; }
.saved-tools select { flex: 1 1 160px; width: auto; min-width: 0; max-width: 100%; }

/* Trois builds visibles, la suite défile */
#calc-saved {
  max-height: 336px;
  overflow-y: auto;
  padding: 2px 6px 6px 2px;
  scrollbar-color: var(--ink-600) var(--ink-900);
}
#calc-saved > p { margin: 0; }
.saved {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 2px solid var(--ink-900);
  border-left: 5px solid var(--cyan);
  border-radius: var(--r-sm);
  background: var(--ink-850);
  box-shadow: 3px 3px 0 var(--ink-900);
}
.saved > div:first-child { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.saved > div:first-child strong { font-style: italic; font-weight: 800; overflow-wrap: anywhere; }
.saved > div:first-child span { overflow-wrap: anywhere; }
.saved > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex-shrink: 0; }
.saved .btn.small { min-height: 40px; }
.saved-name { min-height: 38px; padding: 4px 10px; font-weight: 700; }

/* ---------- Panneaux de référence (races, héritage) ---------- */
.calc-panel {
  padding: 36px;
  border: 3px solid var(--ink-900);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--ink-750), var(--ink-850));
  box-shadow: var(--hard);
}
.calc-panel > h2 { margin-bottom: 10px; }
.calc-panel > .lead { margin: 0; }
.faction {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 30px 0 0;
  font-size: 1.3rem;
  text-transform: uppercase;
}
.faction::after { content: ""; flex: 1; height: 3px; border-radius: 2px; background: currentColor; opacity: .35; }
.faction.alliance { color: var(--wow-blue); }
.faction.horde { color: var(--horde); }

.calc-panel .race,
.calc-panel .legacy-tree {
  gap: 12px;
  padding: 18px;
  border-width: 2px;
  border-radius: var(--r-md);
  background: var(--ink-850);
  box-shadow: 3px 3px 0 var(--ink-900);
}
.race-head { display: flex; align-items: center; gap: 10px; }
.race-head img {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 2px solid var(--cyan);
  border-radius: 50%;
}
.race-head strong { font-size: 1.05rem; font-style: italic; font-weight: 800; }
.trait { display: flex; align-items: flex-start; gap: 9px; }
.trait > img { flex: none; margin-top: 1px; border: 1px solid var(--ink-900); border-radius: 4px; }
.trait > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.trait strong { color: var(--cyan-bright); font-size: .9rem; }
.trait span { color: var(--text-soft); font-size: .86rem; line-height: 1.45; }

.legacy-tree .tree-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.legacy-tree .tree-head img { width: 36px; height: 36px; border: 2px solid var(--ink-900); border-radius: 6px; }
.legacy-tree .tree-head strong { flex: 1; color: var(--cyan-bright); font-size: 1.1rem; font-style: italic; font-weight: 900; text-transform: uppercase; }
.perk { display: flex; align-items: flex-start; gap: 12px; }
.perk img { flex-shrink: 0; width: 28px; height: 28px; margin-top: 2px; border: 2px solid var(--ink-900); border-radius: 5px; }
.perk div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perk strong { font-size: .92rem; }
.perk em { margin-left: 6px; color: var(--text-muted); font-size: .75rem; font-style: normal; font-weight: 700; }
.perk span { color: var(--text-soft); font-size: .86rem; line-height: 1.45; }

/* ---------- Responsive ---------- */
@media (max-width: 1150px) {
  .class-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .trees { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .page-head.building-header { grid-template-columns: 1fr; }
  .bh-stats { flex-direction: row; flex-wrap: wrap; }
  .bh-stats li { flex: 1 1 140px; min-width: 0; }
  .trees { grid-template-columns: minmax(0, 1fr); }
  .tree { max-width: 460px; width: 100%; margin: 0 auto; }
}
@media (max-width: 640px) {
  .page-head.building-header {
    margin: 24px 16px 0;
    padding: 30px 18px 24px;
    box-shadow: 5px 5px 0 var(--cyan);
  }
  .page-head.building-header::after { display: none; }
  .bh-stats { flex-wrap: nowrap; gap: 8px; }
  .bh-stats li { flex: 1 1 0; padding: 6px 10px; flex-direction: column; gap: 0; box-shadow: 3px 3px 0 var(--teal); }
  .bh-stats strong { font-size: 1.6rem; }
  .bh-stats span { font-size: .66rem; letter-spacing: .5px; }
  .class-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .class-chip { gap: 6px; padding: 8px 6px; font-size: .8rem; }
  .class-chip img { width: 22px; height: 22px; }
  .calc-level-card { padding: 16px 18px; }
  .calc-level-card select { flex: 1 1 100%; min-width: 0; }
  .calc-bar { top: 66px; padding: 10px 12px; gap: 6px 10px; }
  .calc-bar-spec { flex-basis: 0; }
  .calc-bar-spec .kicker { display: none; }
  .calc-bar-spec strong { font-size: .88rem; }
  .calc-bar-left { padding: 2px 10px; }
  .calc-bar-left strong { font-size: 1.6rem; }
  .calc-bar-left span { font-size: .66rem; }
  .tree { padding: 0 8px 16px; }
  .tree .tree-head { margin: 0 -8px 6px; padding: 10px 12px; }
  .tier { gap: 4px; }
  .tier .req { width: 14px; }
  .cells { gap: 4px; }
  .talent, .cells .slot-empty { width: 64px; }
  .talent .tile { width: 44px; height: 44px; }
  .talent .name { font-size: .66rem; }
  .calc-share .btn { align-self: stretch; }
  .saved { flex-wrap: wrap; }
  .saved > div:first-child { flex-basis: 100%; }
  .saved > div:last-child { justify-content: flex-start; }
  #calc-saved { max-height: 420px; }
  .calc-panel { padding: 24px 16px; }
}
@media (max-width: 380px) {
  .class-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .talent, .cells .slot-empty { width: 60px; }
}

/* ---------- Écran large : ordre des talents à droite des arbres ---------- */
.calc-work { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 1500px) {
  /* La zone s'élargit d'autant que la colonne ajoutée : les arbres gardent leur taille. */
  .section.calc { max-width: 1580px; }
  .calc-work { display: grid; grid-template-columns: minmax(0, 1fr) 316px; gap: 24px; align-items: stretch; }
  /* La carte prend la hauteur des arbres (« contain: size » : sa liste ne l'agrandit pas) ; la liste défile dedans. */
  .calc-order-card { contain: size; display: flex; flex-direction: column; min-height: 420px; margin: 0; }
  .calc-order-card .order { flex: 1 1 auto; flex-direction: column; flex-wrap: nowrap; gap: 6px; min-height: 0; overflow-y: auto; padding-right: 4px; }
  .calc-order-card .order-chip { border-radius: 8px; padding: 4px 10px 4px 4px; font-size: .82rem; }
  .calc-order-card .order-chip { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; }
  .calc-order-card .order-chip b { text-align: center; }
}
