/* Технология: устройство — схема и нумерованная легенда */
.tech-device {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
  gap: 32px clamp(32px, 5vw, 72px);
  margin-top: 32px;
}

.tech-scheme {
  position: relative;
  margin: 0;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(1, 14, 27, .28);
}

.tech-scheme figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.tech-scheme__zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #c9d9e6;
  border-radius: 10px;
  background: #fff;
  color: var(--brand-navy);
  cursor: pointer;
}

.tech-scheme__zoom svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Схема заказчика: рисунок + наложенные цифры и подсветка */
.tech-scheme__stage {
  position: relative;
}

.tech-scheme__stage img,
.tech-zoom__scroll .tech-scheme__stage img {
  display: block;
  width: 100%;
  height: auto;
}

.tech-scheme__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ts-hl {
  fill: rgba(255, 138, 31, .32);
  stroke: #e06a00;
  stroke-width: 5;
  opacity: 0;
  pointer-events: none;
}

.ts-hot {
  cursor: pointer;
}

.ts-badge {
  fill: #08677b;
}

.ts-hot text {
  fill: #fff;
  font-family: var(--font-body);
  font-size: 40px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}

.ts-hot.is-active .ts-hl {
  opacity: 1;
}

.ts-hot.is-active .ts-badge {
  fill: #ff8a1f;
}

.ts-hot.is-active text {
  fill: #03182b;
}

.tech-parts--legend {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 14px;
  counter-reset: tech-part;
  list-style: none;
}

.tech-parts--legend li {
  position: relative;
  display: block;
  min-height: 36px;
  padding-left: 52px;
  align-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  counter-increment: tech-part;
}

.tech-parts--legend li::before {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #0f8a9d;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  content: counter(tech-part);
  transform: translateY(-50%);
}

.tech-part {
  display: block;
  width: 100%;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tech-part:focus-visible {
  outline: 2px solid #8fd6ff;
  outline-offset: 2px;
}

.tech-parts--legend li.is-active::before {
  background: #ff8a1f;
  color: #03182b;
}

.tech-parts--legend li.is-active .tech-part {
  color: #ffc88a;
}

.tech-parts--legend small {
  display: block;
  color: rgba(255, 255, 255, .72);
  font-size: 15px;
  font-weight: 400;
}

@media (max-width: 900px) {
  /* Телефон: схема закреплена под шапкой, список листается под ней */
  .tech-device {
    display: block;
  }

  .tech-scheme {
    position: sticky;
    z-index: 5;
    top: 104px;
    margin-bottom: 24px;
    padding: 8px 8px 6px;
  }

  .tech-scheme__stage {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
  }

  /* Высота задана заранее: до загрузки картинка не схлопывается в 0 и блок не прыгает */
  .tech-scheme__stage img {
    width: auto;
    max-width: 100%;
    height: min(40svh, calc((100vw - 48px) * 0.878));
    aspect-ratio: 1116 / 980;
    object-fit: contain;
  }

  .tech-scheme figcaption {
    display: none;
  }
}

/* Увеличенная схема */
.tech-zoom {
  width: min(1100px, 100vw);
  max-width: 100vw;
  height: min(860px, 100dvh);
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--brand-navy);
  overflow: hidden;
}

.tech-zoom[open] {
  display: flex;
  flex-direction: column;
}

.tech-zoom::backdrop {
  background: rgba(3, 24, 43, .8);
}

.tech-zoom__bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #dbe6ef;
}

.tech-zoom__bar button {
  width: 48px;
  height: 48px;
  border: 1px solid #c9d9e6;
  border-radius: 10px;
  background: #fff;
  color: var(--brand-navy);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.tech-zoom__scroll {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
}

.tech-zoom__scroll svg {
  display: block;
  height: auto;
  margin: 0 auto;
}



.tech-zoom__scroll .tech-scheme__stage {
  max-width: none;
  margin: 0 auto;
}

.tech-zoom__scroll .tech-scheme__stage img {
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
}


/* Светлая подложка (страницы ТВЭС-1 и ТВЭС-2) */
.tech-device--light .tech-scheme { border: 1px solid #dbe8f1; box-shadow: 0 12px 30px rgba(3, 24, 43, .1); }
.tech-device--light .tech-parts--legend li { color: var(--brand-navy); }
.tech-device--light .tech-parts--legend small { color: var(--muted); }
.tech-device--light .tech-parts--legend li.is-active .tech-part { color: #b35200; }
.tech-device--light .tech-part:focus-visible { outline-color: var(--brand-blue); }
.tech-scheme-note { max-width: 46em; margin: 20px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
