/* Arbre technologique : les retouches d'après les maquettes du 8 oct. 2026, après tools.css (qui garde le socle commun des outils).
   Une feuille par page : les sessions qui refont chaque page ne se marchent pas dessus. */

/* Les établis : l'onglet ouvert en brun éclairci, liseré miel en haut (pas d'aplat doré) */
.tt-benches .rd-tab.is-on,
.tt-benches button.rd-tab.is-on:hover,
.tt-benches button.rd-tab.is-on:focus-visible {
  border-color: var(--picked-edge);
  background: var(--picked-bg);
  box-shadow: inset 0 3px 0 var(--gold);
}
.tt-benches .rd-tab.is-on b {
  color: var(--cream);
}
.tt-benches .rd-tab.is-on small {
  color: var(--text);
}

/* La barre : la recherche, « Mes déblocages » (le compte, appuyé = mode marquage), le module en interrupteur */
.tt-toolbar {
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
}
.tt-search {
  display: flex;
  align-items: stretch;
}
.tt-search > i {
  top: 50%;
  transform: translateY(-50%);
}
.tt-search input {
  height: 100%;
  min-height: 42px;
  padding-left: 36px;
  border-color: #3a3128;
  background: rgba(10, 9, 7, 0.75);
  font-size: 0.95rem;
}
.tt-mine {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid #3a3128;
  background: var(--surface-1);
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tt-mine > i {
  color: var(--gold);
  font-size: 1.15rem;
}
.tt-mine span {
  display: grid;
}
.tt-mine small {
  color: var(--text-soft);
  font-size: 0.8rem;
}
.tt-mine b {
  font: 700 1.05rem "Roboto Condensed", sans-serif;
}
.tt-mine:hover,
.tt-mine:focus-visible {
  border-color: var(--gold);
  outline: none;
}
.tt-mine.is-on {
  border-color: var(--cream);
  background: var(--picked-bg);
}
.tt-module {
  flex: none;
}

/* L'arbre : plus de contraste pour ce qui est verrouillé (icône lisible, cadenas net), des liens plus visibles */
.tt-canvas {
  height: min(70vh, 720px);
  border-color: rgba(var(--gold-rgb), 0.25);
  background:
    radial-gradient(ellipse at 50% 0, rgba(var(--gold-rgb), 0.06), transparent 60%),
    #1b1914;
}
.tt-node.is-locked {
  border-color: rgba(232, 220, 198, 0.1);
  background: rgba(8, 7, 5, 0.35);
}
.tt-node.is-locked img {
  opacity: 0.72;
  filter: saturate(0.55) brightness(0.92);
}
.tt-node.is-locked:hover img,
.tt-node.is-locked:focus-visible img {
  opacity: 1;
  filter: none;
}
.tt-node__lock {
  top: 2px;
  left: 3px;
  color: rgba(232, 220, 198, 0.85);
  font-size: 0.8rem;
  text-shadow: 0 1px 2px #000;
}
.tt-node__ok {
  top: 2px;
  left: 3px;
  color: #c9e39a;
  font-size: 0.8rem;
  text-shadow: 0 1px 2px #000;
}
.tt-links path {
  stroke: rgba(232, 220, 198, 0.34);
}

/* Un objet choisi : le reste de l'arbre en retrait, le chemin agrandi et éclairé, chaque étape avec son nom et son coût */
.tt-node,
.tt-links path {
  transition: opacity 0.2s, border-color 0.12s, transform 0.2s, box-shadow 0.12s;
}
.tt-canvas.has-path .tt-node:not(.is-path) {
  opacity: 0.5;
}
.tt-canvas.has-path .tt-node:not(.is-path):hover {
  opacity: 1;
}
.tt-canvas.has-path .tt-links path:not(.is-lit) {
  opacity: 0.45;
}
.tt-links path.is-lit {
  stroke: var(--gold);
  stroke-width: 4;
  filter: drop-shadow(0 0 4px rgba(var(--gold-rgb), 0.6));
}
.tt-node.is-path,
.tt-node.is-path:hover,
.tt-node.is-path:focus-visible {
  z-index: 4;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 35%, #3a3128, #100d0a 85%);
  box-shadow: 0 0 12px rgba(var(--gold-rgb), 0.35);
  transform: scale(1.3);
}
.tt-node.is-path.is-on {
  z-index: 5;
  border-color: var(--value-strong);
  box-shadow: 0 0 0 1px var(--value-strong), 0 0 18px rgba(240, 192, 96, 0.55);
  transform: scale(1.45);
}
.tt-node.is-path .tt-node__lock {
  display: none;
}
.tt-node.is-path img {
  opacity: 1;
  filter: none;
}
.tt-node__tag {
  position: absolute;
  top: 50%;
  left: calc(100% + 7px);
  display: grid;
  gap: 1px;
  width: max-content;
  max-width: 150px;
  padding: 3px 7px;
  border-left: 2px solid var(--gold);
  background: rgba(18, 15, 11, 0.94);
  text-align: left;
  transform: translateY(-50%);
  pointer-events: none;
}
.tt-node__tag b {
  overflow: hidden;
  color: var(--cream);
  font: 700 0.8rem/1.15 "Roboto Condensed", sans-serif;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.tt-node.is-on .tt-node__tag b {
  color: #ffd27a;
}
.tt-node__tag small {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--text);
  font: 500 0.8rem Roboto, sans-serif;
  white-space: nowrap;
}
.tt-node__tag .tt-scrap {
  width: 10px;
  height: 10px;
}

/* La mini-carte en bas à gauche : l'arbre en petites cases, le cadre de la vue en miel */
.tt-mini {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 6;
  width: 200px;
  height: 130px;
  padding: 6px;
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  background: rgba(14, 12, 9, 0.92);
  cursor: crosshair;
  touch-action: none;
}
.tt-mini svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.tt-mini rect {
  fill: rgba(232, 220, 198, 0.3);
}
.tt-mini rect.is-open {
  fill: rgba(232, 220, 198, 0.55);
}
.tt-mini rect.is-owned {
  fill: rgba(150, 175, 90, 0.9);
}
.tt-mini rect.is-path {
  fill: var(--gold);
}
.tt-mini rect.tt-mini__view {
  fill: rgba(var(--gold-rgb), 0.08);
  stroke: var(--gold);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

/* Les commandes en bas à droite : zoom, départ, et « Voir tout l'arbre » à côté */
.tt-canvas > .tt-zoom {
  right: 10px;
  bottom: 10px;
}
.tt-canvas > .tt-zoom .pl-icon {
  width: 36px;
  height: 36px;
}
.tt-fit {
  position: absolute;
  right: 56px;
  bottom: 10px;
  z-index: 5;
  background: rgba(20, 16, 12, 0.92);
}

/* Le panneau de droite */
@media (min-width: 1101px) {
  .tt-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  }
}
.tt-detail {
  gap: 14px;
}
.tt-scrap {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.tt-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tt-head h3,
.tt-obj h3 {
  margin: 0;
  color: var(--cream);
  font: 700 1.35rem/1.15 "Roboto Condensed", sans-serif;
}
.tt-sum {
  padding-top: 0;
  border-top: 0;
}
.tt-pick {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(var(--sheen-rgb), 0.06);
}
.tt-pick .cf-slot {
  width: 72px;
  height: 72px;
  color: var(--text-soft);
  font-size: 1.6rem;
}
.tt-pick b {
  color: var(--cream);
  font: 700 1.1rem "Roboto Condensed", sans-serif;
}
.tt-pick p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.85rem;
  line-height: 1.4;
}
.tt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(var(--sheen-rgb), 0.06);
}
.tt-row span {
  color: var(--cream);
  font: 700 0.98rem "Roboto Condensed", sans-serif;
}
.tt-row b {
  color: var(--text-soft);
}

/* L'objet choisi : la ferraille à prévoir au premier plan, les déblocages restants à côté */
.tt-obj {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
.tt-obj .cf-slot.is-xl {
  width: 96px;
  height: 96px;
}
.tt-big {
  display: flex;
  align-items: stretch;
  gap: 14px;
  margin-top: 10px;
}
.tt-big > span {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 6px;
}
.tt-big > span + span {
  padding-left: 14px;
  border-left: 1px solid rgba(var(--sheen-rgb), 0.1);
  grid-template-columns: auto;
  justify-items: start;
}
.tt-big b {
  color: var(--cream);
  font: 700 2.1rem/1 "Roboto Condensed", sans-serif;
}
.tt-big > span + span small {
  white-space: normal;
}
.tt-big__scrap b {
  color: #ffd27a;
}
.tt-big__scrap .tt-scrap {
  width: 30px;
  height: 30px;
}
.tt-big small {
  grid-column: 1 / -1;
  white-space: nowrap;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.8rem;
}
.tt-alone {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 0.82rem;
}
.tt-alone .is-ok,
.tt-alone .is-ok i {
  color: #8fd17f;
}
.tt-alone .is-ok i {
  margin-right: 4px;
}
.tt-h {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--sheen-rgb), 0.06);
  color: var(--cream);
  font: 700 1.05rem "Roboto Condensed", sans-serif;
}
.tt-path {
  gap: 3px;
}
.tt-path button {
  grid-template-columns: 26px auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 5px 10px 5px 0;
  transition: border-color 0.15s;
}
.tt-path button:hover,
.tt-path button:focus-visible {
  border-color: var(--gold);
  outline: none;
}
.tt-path button::before {
  align-self: stretch;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(var(--sheen-rgb), 0.06);
}
.tt-path b {
  white-space: normal;
  line-height: 1.2;
}
.tt-path small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tt-path .is-target button {
  border-color: var(--gold);
  background: var(--picked-bg);
}
.tt-path .is-owned b {
  color: var(--text-soft);
}
.tt-actions {
  display: grid;
  gap: 8px;
}
.tt-actions .pl-btn {
  padding: 10px 12px;
  font-size: 0.95rem;
}
.tt-note {
  margin: -4px 0 0;
}
.tt-foot {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 12px;
  border-top: 1px solid rgba(var(--sheen-rgb), 0.06);
}
.tt-foot span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}
.tt-foot span + span {
  padding-left: 14px;
  border-left: 1px solid rgba(var(--sheen-rgb), 0.08);
}
.tt-foot span > :first-child {
  grid-row: span 2;
  width: 26px;
  height: 26px;
  color: var(--text-soft);
  font-size: 1.3rem;
  text-align: center;
}
.tt-foot b {
  color: var(--cream);
  font: 700 1.4rem/1 "Roboto Condensed", sans-serif;
}
.tt-foot small {
  color: var(--text-soft);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .tt-toolbar {
    flex-wrap: wrap;
  }
  .tt-search {
    flex-basis: 100%;
  }
  .tt-module {
    flex: 1 1 260px;
  }
}
@media (max-width: 640px) {
  .tt-canvas {
    height: 62vh;
  }
  .tt-mini {
    width: 120px;
    height: 84px;
    padding: 4px;
  }
  .tt-fit span {
    display: none;
  }
  .tt-fit {
    right: 52px;
    width: 36px;
    height: 36px;
    padding: 0;
  }
  .tt-mine {
    flex: 1 1 auto;
  }
  .tt-obj .cf-slot.is-xl {
    width: 72px;
    height: 72px;
  }
  .tt-big b {
    font-size: 1.8rem;
  }
}
.tt-path .is-owned small,
.tt-node__tag .fa-check {
  color: #8fd17f;
}

/* Le plein écran : l'arbre couvre tout (au-dessus de l'en-tête et du bandeau), le dessin prend la hauteur restante */
html.tt-fullpage {
  overflow: hidden;
}
.tt.is-full {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  overflow: hidden;
  background: #0f0d0b;
}
.tt.is-full .tt-grid {
  min-height: 0;
}
.tt.is-full .tt-canvas {
  height: 100%;
}
.tt.is-full .tt-detail {
  max-height: 100%;
  overflow-y: auto;
}
.tt-full {
  flex: 0 0 auto;
}
/* Écran étroit : le panneau passe sous le dessin ; en plein écran, l'arbre défile et le dessin garde sa hauteur */
@media (max-width: 1100px) {
  .tt.is-full {
    display: block;
    overflow-y: auto;
  }
  .tt.is-full > * + * {
    margin-top: 10px;
  }
  .tt.is-full .tt-canvas {
    height: 72vh;
  }
}
@media (max-width: 760px) {
  .tt-full span {
    display: none;
  }
}
