/* Студия мерча (/lab): сцена с 3D-изделием и панель настроек. Правила оформления в history/DESIGN.md */

.lab,
.lab-spec {
  --lab-blue: #0b6fd6;
  --lab-blue-hover: #0a5fbb;
  --lab-seam: rgba(30, 144, 255, 0.55);
  --lab-text: #444;
}

/* ---------- Заголовок ---------- */

.lab-head {
  box-sizing: border-box;
  width: 100%;
  max-width: 1760px;
  margin-inline: auto;
  padding: clamp(96px, 8vw, 130px) clamp(16px, 3vw, 70px) clamp(12px, 1.6vw, 22px);
}

.lab-kicker {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lab-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-shadow: none;
}

.lab-head h1 {
  margin: 0 0 10px;
  color: #000;
  font-size: clamp(30px, 3.4vw, 58px);
  font-weight: 700;
  line-height: 1.12;
  text-shadow: none;
}

.lab-head h1 span {
  color: var(--lab-blue);
}

.lab-lead {
  max-width: 70ch;
  margin: 0;
  color: var(--lab-text);
  font-size: clamp(15px, 0.9vw + 8px, 19px);
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- Студия: сцена и панель ---------- */

.lab-studio {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 1.6vw, 24px);
  width: 100%;
  max-width: 1760px;
  margin: 0 auto clamp(40px, 5vw, 80px);
  padding-inline: clamp(16px, 3vw, 70px);
}

@media (min-width: 1024px) {
  .lab-studio {
    grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
    align-items: start;
  }
}

.lab-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: calc(100vh - 120px);
  border-radius: clamp(28px, 3vw, 48px);
  background: #fff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
  .lab-stage {
    position: sticky;
    top: 90px;
    width: 100%;
    aspect-ratio: auto;
    height: min(78vh, 820px);
  }
}

.lab-poster,
.lab-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lab-poster {
  object-fit: contain;
  transition: opacity 0.3s;
}

.lab-poster.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.lab-canvas {
  display: block;
  cursor: grab;
  touch-action: none;
}

.lab-canvas:active {
  cursor: grabbing;
}

.lab-status {
  position: absolute;
  top: 18px;
  left: 50%;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(248, 248, 255, 0.92);
  color: #333;
  font-size: 13px;
  font-weight: 700;
  text-shadow: none;
  transform: translateX(-50%);
  white-space: nowrap;
}

.lab-status[hidden] {
  display: none;
}

.lab-views {
  position: absolute;
  left: 50%;
  bottom: 44px;
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(248, 248, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateX(-50%);
}

.lab-views button {
  min-height: 36px;
  padding: 6px 14px;
  border: 2px solid var(--lab-blue);
  border-radius: 999px;
  background: #fff;
  color: var(--lab-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-shadow: none;
  cursor: pointer;
}

.lab-views button[aria-pressed="true"] {
  background: var(--lab-blue);
  color: #fff;
}

.lab-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  margin: 0;
  color: #777;
  font-size: 12px;
  text-align: center;
  text-shadow: none;
}

/* ---------- Панель ---------- */

.lab-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.lab-block {
  padding: clamp(18px, 1.8vw, 26px);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  outline: 2px dashed var(--lab-seam);
  outline-offset: -7px;
}

.lab-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  color: #000;
  font-size: clamp(18px, 1.2vw + 8px, 24px);
  font-weight: 900;
  text-shadow: none;
}

.lab-color-code {
  color: var(--lab-blue);
  font-size: 14px;
  font-weight: 900;
}

.lab-note {
  margin: 10px 0 0;
  color: #666;
  font-size: 13px;
  line-height: 1.45;
  text-shadow: none;
}

.lab-products {
  display: grid;
  gap: 8px;
}

/* Вкладки групп изделий над списком */
.lab-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.lab-groups button {
  min-height: 34px;
  padding: 5px 12px;
  border: 2px solid #dde3ee;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-shadow: none;
  cursor: pointer;
}

.lab-groups button span {
  color: #888;
  font-weight: 700;
}

.lab-groups button[aria-pressed="true"] {
  border-color: var(--lab-blue);
  background: var(--lab-blue);
  color: #fff;
}

.lab-groups button[aria-pressed="true"] span {
  color: rgba(255, 255, 255, 0.75);
}

.lab-product[hidden] {
  display: none;
}

.lab-product {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px 8px 8px;
  border: 2px solid #dde3ee;
  border-radius: 18px;
  background: #fff;
  color: #000;
  font: inherit;
  text-align: left;
  text-shadow: none;
  cursor: pointer;
}

.lab-product[aria-checked="true"] {
  border-color: var(--lab-blue);
}

.lab-product img {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 19%;
  background: #f4f6fa;
  object-fit: contain;
}

.lab-product span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lab-product b {
  font-size: 15px;
  font-weight: 900;
}

.lab-product small {
  color: #666;
  font-size: 12px;
}

.lab-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 8px;
}

.lab-swatch {
  aspect-ratio: 1 / 1;
  width: 100%;
  min-width: 30px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
}

.lab-swatch[aria-checked="true"] {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--lab-blue);
}

.lab-soon {
  background: #f8f8ff;
}

.lab-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lab-btn {
  flex: 1 1 180px;
  min-height: 48px;
  padding: 14px 22px;
  border: 0;
  border-radius: 12px;
  background: var(--lab-blue);
  color: #fff;
  font: inherit;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  text-shadow: none;
  cursor: pointer;
}

.lab-btn-ghost {
  border: 2px solid var(--lab-blue);
  background: transparent;
  color: var(--lab-blue);
}

@media (hover: hover) {
  .lab-btn:hover {
    background: var(--lab-blue-hover);
  }
  .lab-btn-ghost:hover {
    background: var(--lab-blue);
    color: #fff;
  }
  .lab-views button:hover,
  .lab-product:hover {
    border-color: var(--lab-blue-hover);
  }
}

.lab button:focus-visible,
.lab a:focus-visible {
  outline: 3px solid #1e90ff;
  outline-offset: 2px;
}

@media (max-width: 599.98px) {
  .lab-hint-more {
    display: none;
  }
  .lab-views {
    bottom: 38px;
  }
  .lab-views button {
    padding: 6px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab-poster {
    transition: none;
  }
}

/* ---------- Принты и надписи ---------- */

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

.lab-zones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.lab-zone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 2px solid var(--lab-blue);
  border-radius: 999px;
  background: #fff;
  color: var(--lab-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-shadow: none;
  cursor: pointer;
}

.lab-zone[aria-checked="true"] {
  background: var(--lab-blue);
  color: #fff;
}

.lab-zone-count:empty {
  display: none;
}

.lab-zone-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--lab-blue);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.lab-zone[aria-checked="false"] .lab-zone-count {
  background: var(--lab-blue);
  color: #fff;
}

.lab-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-btn-small {
  flex: 1 1 150px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
}

.lab-add label {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lab-file {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}

.lab-items {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.lab-items:empty {
  display: none;
}

.lab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 10px 6px 6px;
  border: 2px solid #dde3ee;
  border-radius: 14px;
  background: #fff;
  color: #000;
  font: inherit;
  text-align: left;
  text-shadow: none;
  cursor: pointer;
}

.lab-item[aria-pressed="true"] {
  border-color: var(--lab-blue);
}

.lab-item-thumb {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: repeating-conic-gradient(#eef1f6 0 25%, #fff 0 50%) 50% / 12px 12px;
}

.lab-item-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.lab-item-label small {
  color: #666;
  font-size: 12px;
  font-weight: 500;
}

.lab-edit {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px dashed var(--lab-seam);
}

.lab-edit[hidden],
.lab-edit [hidden] {
  display: none;
}

.lab-edit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.lab-link {
  flex: none;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--lab-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.lab-link-danger {
  color: #c62828;
}

.lab-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  text-shadow: none;
}

.lab-edit textarea,
.lab-edit select,
.lab-dims input {
  box-sizing: border-box;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #c5c9d6;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
}

.lab-edit textarea {
  resize: vertical;
}

.lab-dims input[readonly] {
  background: #f4f6fa;
  color: #555;
}

.lab-fonts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.lab-font {
  min-height: 44px;
  border: 2px solid #dde3ee;
  border-radius: 12px;
  background: #fff;
  color: #000;
  font-size: 18px;
  text-shadow: none;
  cursor: pointer;
}

.lab-font[aria-checked="true"] {
  border-color: var(--lab-blue);
}

.lab-inks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-ink {
  width: 32px;
  min-width: 32px;
}

.lab-ink-custom {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red);
  cursor: pointer;
}

.lab-ink-custom input {
  position: absolute;
  inset: -8px;
  width: 48px;
  height: 48px;
  opacity: 0;
  cursor: pointer;
}

/* Поворот на 90° и отражение: четыре кнопки в ряд, на узком экране по две */
.lab-turns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.lab-turns .lab-btn {
  padding-inline: 6px;
  white-space: nowrap;
}

.lab-turns .lab-btn[aria-pressed="true"] {
  background: #0b6fd6;
  color: #fff;
}

@media (max-width: 599.98px) {
  .lab-turns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lab-dims {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lab-dims label {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  color: #333;
  font-size: 12px;
  font-weight: 700;
  text-shadow: none;
}

.lab-range {
  width: 100%;
  margin: 12px 0 4px;
  accent-color: var(--lab-blue);
}

.lab-tips {
  display: grid;
  gap: 6px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.lab-tip {
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  text-shadow: none;
}

.lab-tip-ok { background: #e7f6ec; color: #1d5e33; }
.lab-tip-info { background: #e8f1fd; color: #0b4f99; }
.lab-tip-warn { background: #fff3d6; color: #7a4f00; }
.lab-tip-bad { background: #fdecea; color: #a12020; }

@media (min-width: 1024px) and (max-width: 1279.98px) {
  .lab-fonts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 399.98px) {
  .lab-fonts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.lab-note-top {
  margin: 0 0 12px;
}

.lab-btn-wide {
  width: 100%;
}

/* ---------- Техмакет: лист А4 поверх страницы, при печати только он ---------- */

.lab-spec {
  position: fixed;
  inset: 0;
  /* Выше шапки сайта (меню до 10000), иначе она закрывает панель с кнопками */
  z-index: 10050;
  overflow-y: auto;
  padding: 0 16px 40px;
  background: #e6e6fa;
  -webkit-overflow-scrolling: touch;
}

.lab-spec[hidden] {
  display: none;
}

html.lab-spec-open {
  overflow: hidden;
}

.lab-spec-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 -16px 16px;
  padding: 12px 16px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.lab-spec-bar b {
  margin-right: auto;
  font-size: 16px;
  text-shadow: none;
}

.lab-spec-bar .lab-btn-small {
  flex: 0 0 auto;
}

/* Кнопки под листом: что делать дальше */
.lab-spec-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 210mm;
  margin: 20px auto 0;
}

.lab-spec-foot[hidden] {
  display: none;
}

.lab-spec-hint {
  flex-basis: 100%;
  color: #666;
  font-size: 12px;
  text-shadow: none;
}

.lab-spec-sheet {
  box-sizing: border-box;
  max-width: 210mm;
  margin: 0 auto;
  padding: 12mm;
  background: #fff;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  color: #000;
  font-size: 12px;
  line-height: 1.4;
  text-shadow: none;
  /* Печатать заливки как на экране: кружок цвета ткани и фон миниатюр.
     Без этого браузер при печати убирает фоновые цвета, если не включены «Фоновые изображения» */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.lab-spec-sheet * {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.lab-spec-wait {
  padding: 60px 0;
  font-size: 15px;
  text-align: center;
}

.lab-spec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #0b6fd6;
}

.lab-spec-logo {
  width: 120px;
  height: auto;
}

.lab-spec-head div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.lab-spec-head b {
  font-size: 20px;
}

.lab-spec-head span {
  color: #555;
  font-size: 11px;
}

.lab-spec-facts {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.lab-spec-facts div {
  padding: 8px 10px;
  border: 1px solid #dde3ee;
  border-radius: 8px;
}

.lab-spec-facts dt {
  color: #666;
  font-size: 10px;
}

.lab-spec-facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.lab-spec-facts small {
  flex-basis: 100%;
  color: #555;
  font-size: 10px;
  font-weight: 400;
}

.lab-spec-chip {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  background: var(--c);
}

.lab-spec-views {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lab-spec-view,
.lab-spec-photo {
  margin: 0;
  break-inside: avoid;
}

.lab-spec-img {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  background: #fff;
}

.lab-spec-img img,
.lab-spec-img svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lab-spec-view figcaption,
.lab-spec-photo figcaption {
  margin-top: 4px;
  color: #333;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.lab-spec-photo figcaption a {
  margin-left: 6px;
  color: #0b6fd6;
  font-weight: 400;
}

.lab-dim line {
  stroke: #0b6fd6;
  stroke-width: 2.5;
}

.lab-dim text {
  fill: #0b6fd6;
  font-size: 22px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 6px;
  stroke-linejoin: round;
}

.lab-dim-n rect {
  fill: #0b6fd6;
}

.lab-dim-n text {
  fill: #fff;
  font-size: 15px;
  font-weight: 700;
}

.lab-spec-photos {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.lab-spec-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #dde3ee;
  border-radius: 8px;
  background: #f8f8ff;
  object-fit: contain;
}

.lab-spec-table h3,
.lab-spec-notes h3 {
  margin: 14px 0 6px;
  font-size: 14px;
}

.lab-spec-table table {
  width: 100%;
  border-collapse: collapse;
}

.lab-spec-table th,
.lab-spec-table td {
  padding: 5px 6px;
  border: 1px solid #c5c9d6;
  font-size: 11px;
  text-align: left;
  vertical-align: middle;
}

.lab-spec-table th {
  background: #f4f6fa;
  font-size: 10px;
}

.lab-spec-table small {
  color: #555;
  font-size: 10px;
}

.lab-spec-n {
  font-weight: 700;
  text-align: center;
}

.lab-spec-num {
  white-space: nowrap;
}

.lab-spec-thumb {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: repeating-conic-gradient(#eef1f6 0 25%, #fff 0 50%) 50% / 10px 10px;
}

.lab-spec-notes ul {
  margin: 0;
  padding-left: 16px;
  color: #333;
  font-size: 11px;
}

@media (max-width: 599.98px) {
  .lab-spec-sheet {
    padding: 14px;
  }
  .lab-spec-facts,
  .lab-spec-views {
    grid-template-columns: minmax(0, 1fr);
  }
  .lab-spec-photos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lab-spec-table {
    overflow-x: auto;
  }
  .lab-spec-table table {
    min-width: 560px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }
  html.lab-spec-open,
  html.lab-spec-open body {
    overflow: visible;
    background: #fff;
  }
  html.lab-spec-open body > *:not(.lab-spec) {
    display: none !important;
  }
  .lab-spec {
    position: static;
    overflow: visible;
    padding: 0;
    background: #fff;
  }
  .lab-spec-bar,
  .lab-spec-foot {
    display: none;
  }
  .lab-spec-sheet {
    max-width: none;
    padding: 0;
    box-shadow: none;
  }
  .lab-spec-facts,
  .lab-spec-views {
    grid-template-columns: 2fr 1fr 1fr;
  }
  /* Один лист, если всё помещается. Вторая страница появляется сама, когда нанесений много:
     блоки, строки таблицы и примечания не разрываются, заголовок «Нанесения» не отрывается от таблицы */
  .lab-spec-head,
  .lab-spec-facts,
  .lab-spec-views,
  .lab-spec-photos,
  .lab-spec-notes,
  .lab-spec-table tr,
  .lab-spec-table-short {
    break-inside: avoid;
  }
  .lab-spec-table h3 {
    break-after: avoid;
  }
  .lab-spec-views {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 172mm;
    margin: 0 auto;
  }
  .lab-spec-photos {
    /* до шести снимков (рукава и капюшон) в один ряд */
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: 6px;
  }
  .lab-spec-photo figcaption a {
    display: none;
  }
  .lab-spec-table h3,
  .lab-spec-notes h3 {
    margin: 10px 0 4px;
  }
  .lab-spec-table table {
    min-width: 0;
  }
  .lab-spec-table th,
  .lab-spec-table td {
    padding: 3px 6px;
  }
  .lab-spec-thumb {
    width: 34px;
    height: 34px;
  }
}

/* ---------- Оформление заказа ---------- */

.lab-order-sheet {
  max-width: 760px;
  padding: clamp(18px, 3vw, 32px);
  font-size: 14px;
}

.lab-order-set {
  margin: 0 0 14px;
  padding: 12px 14px 4px;
  border: 1px solid #dde3ee;
  border-radius: 14px;
}

.lab-order-set legend {
  padding: 0 6px;
  font-size: 14px;
  font-weight: 900;
}

.lab-order-sizes {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.lab-order-sizes label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.lab-order-sizes input,
.lab-order-form .lab-dims input,
.lab-order-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #c5c9d6;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 15px;
}

.lab-order-sizes input {
  text-align: center;
}

.lab-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.lab-order-form [hidden],
.lab-order-done[hidden],
.lab-order-form[hidden] {
  display: none;
}

.lab-order-done p {
  color: #333;
  font-size: 15px;
}

.lab-order-link {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.lab-order-link input {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #c5c9d6;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
}

.lab-orders-mine a {
  color: var(--lab-blue);
  font-weight: 700;
}

/* ---------- Страница заказа (lab-order) ---------- */

.lab-order-wrap {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 1760px;
  margin: 0 auto 14px;
  padding-inline: clamp(16px, 3vw, 70px);
}

@media (min-width: 1024px) {
  .lab-order-wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.lab-steps {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

/* Шаги без номеров: пройденный с галочкой, текущий залит синим, будущий пунктиром */
.lab-steps li {
  position: relative;
  padding: 10px 14px 10px 40px;
  border: 2px dashed #dde3ee;
  border-radius: 14px;
  color: #777;
  font-weight: 700;
}

.lab-steps li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid #c5c9d6;
  border-radius: 50%;
  transform: translateY(-50%);
}

.lab-steps li.is-done {
  border-style: solid;
  border-color: #cfe0f7;
  color: #0b4f99;
}

.lab-steps li.is-done::before {
  content: "✓";
  width: auto;
  height: auto;
  border: 0;
  color: #0b6fd6;
  font-size: 16px;
  line-height: 1;
}

.lab-steps li.is-now {
  border-style: solid;
  border-color: var(--lab-blue);
  background: var(--lab-blue);
  color: #fff;
}

.lab-steps li.is-now::before {
  border-color: #fff;
  background: #fff;
}

.lab-order-msg {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff3d6;
  color: #5a3d00;
}

.lab-order-msg p {
  margin: 4px 0 0;
}

.lab-order-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.lab-order-facts div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--lab-seam);
}

.lab-order-facts dt {
  color: #666;
  font-size: 13px;
}

.lab-order-facts dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  font-weight: 700;
}

.lab-order-facts small {
  flex-basis: 100%;
  color: #555;
  font-weight: 400;
}

.lab-order-gallery {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 1760px;
  margin: 0 auto 14px;
  padding-inline: clamp(16px, 3vw, 70px);
}

.lab-order-gallery figure {
  margin: 0;
}

.lab-order-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.lab-order-gallery figcaption {
  margin-top: 6px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.lab-order-prints {
  box-sizing: border-box;
  width: calc(100% - 2 * clamp(16px, 3vw, 70px));
  max-width: calc(1760px - 2 * clamp(16px, 3vw, 70px));
  margin: 0 auto 14px;
}

.lab-order-prints .lab-spec-table {
  overflow-x: auto;
}

.lab-order-prints table {
  min-width: 620px;
}

.lab-order-new {
  margin: 0 auto 60px;
  text-align: center;
}

@media (max-width: 599.98px) {
  .lab-order-sizes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .lab-order-facts div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* ==========================================================================
   Студия на весь экран (2026-11-09): верхняя строка со шкалой шагов вместо меню сайта и вводного блока,
   три колонки на компьютере (шаг слева, сцена, свойства справа), две на планшете, одна на телефоне.
   Шаги 3 и 4 (техмакет, заявка) открываются окнами под верхней строкой, шкала остаётся видна.
   ========================================================================== */

.lab-app {
  --lab-bar-h: 64px;
  --lab-blue: #0b6fd6;
  --lab-seam: rgba(30, 144, 255, 0.55);
}

/* Меню сайта на этой странице не показывается: его заменяет верхняя строка студии.
   Сам блок меню подключён: большое меню открывает кнопка «Меню», форма заявки нужна кнопке в футере */
.lab-app .pc-nav,
.lab-app #main-menu,
.lab-app .mp-badge--burger {
  display: none !important;
}

/* ---------- Верхняя строка ---------- */

.lab-bar {
  position: sticky;
  top: 0;
  z-index: 900;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px clamp(12px, 1.4vw, 24px);
  height: var(--lab-bar-h);
  padding: 0 clamp(12px, 1.4vw, 24px);
  background: #fff;
  border-bottom: 2px dashed var(--lab-seam);
}

.lab-bar-logo {
  display: flex;
}

.lab-bar-logo img {
  width: auto;
  height: 26px;
}

.lab-bar-title {
  margin: 0;
  color: #000;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: none;
}

.lab-bar-title span {
  color: var(--lab-blue);
}

.lab-bar-actions {
  display: flex;
  gap: 8px;
}

/* Шкала шагов: подпись и полоска под ней. Пройденный шаг: полоска голубая, текущий: синяя */
.lab-progress ol {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lab-progress button {
  position: relative;
  min-width: clamp(96px, 9vw, 150px);
  padding: 4px 12px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #8a8f99;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
  text-shadow: none;
  cursor: pointer;
}

.lab-progress small {
  display: block;
  color: #a5abb5;
  font-size: 11px;
  font-weight: 700;
}

.lab-progress button::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 4px;
  border-radius: 2px;
  background: #dde3ee;
}

.lab-progress button.is-done {
  color: #333;
}

.lab-progress button.is-done small::after {
  content: " \2713";
  color: var(--lab-blue);
}

.lab-progress button.is-done::after {
  background: #8cc4ff;
}

.lab-progress button[aria-current="step"] {
  color: #000;
}

.lab-progress button[aria-current="step"] small {
  color: var(--lab-blue);
}

.lab-progress button[aria-current="step"]::after {
  background: var(--lab-blue);
}

@media (hover: hover) {
  .lab-progress button:hover {
    background: #f1f5fc;
  }
}

/* ---------- Студия ---------- */

.lab-app .main-content.lab {
  padding: 0;
}

.lab-app .lab-studio {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(300px, 360px);
  grid-template-areas: "left stage right";
  align-items: stretch;
  gap: 12px;
  height: calc(100vh - var(--lab-bar-h));
  height: calc(100dvh - var(--lab-bar-h));
  min-height: 620px;
  max-width: none;
  margin: 0;
  padding: 12px;
}

.lab-side {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  outline: 2px dashed var(--lab-seam);
  outline-offset: -7px;
  scrollbar-width: thin;
}

.lab-side-l {
  grid-area: left;
}

.lab-side-r {
  grid-area: right;
}

/* Панели шагов: на шаге 1 модель и цвет, с шага 2 места нанесения и свойства принта */
.lab-studio[data-step="1"] [data-pane="2"],
.lab-studio:not([data-step="1"]) [data-pane="1"] {
  display: none;
}

.lab-pane > .lab-h:first-child {
  margin-top: 0;
}

.lab-app .lab-stage {
  grid-area: stage;
  position: relative;
  top: auto;
  width: auto;
  height: auto;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  border-radius: 28px;
}

.lab-empty {
  margin: 0;
  padding: 16px;
  border: 2px dashed var(--lab-seam);
  border-radius: 18px;
  color: #555;
  font-size: 14px;
  line-height: 1.5;
  text-shadow: none;
}

.lab-empty[hidden] {
  display: none;
}

/* «Назад» и «Далее»: внизу правой колонки, всегда на виду */
.lab-next {
  position: sticky;
  bottom: -18px;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin: auto -18px -18px;
  padding: 12px 18px 18px;
  border-radius: 0 0 24px 24px;
  background: #fff;
}

.lab-next .lab-btn {
  flex: 1 1 auto;
}

.lab-next .lab-btn[hidden] {
  display: none;
}

/* ---------- Сцена: отмена, магнит, черновик, подсказка ---------- */

.lab-tools {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 6px;
}

.lab-tools button {
  width: 40px;
  height: 40px;
  border: 2px solid var(--lab-blue);
  border-radius: 50%;
  background: #fff;
  color: var(--lab-blue);
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.lab-tools button:disabled {
  border-color: #dde3ee;
  color: #b8bec8;
  cursor: default;
}

.lab-snap {
  position: absolute;
  top: 18px;
  left: 50%;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--lab-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-shadow: none;
  transform: translateX(-50%);
  pointer-events: none;
}

.lab-snap[hidden],
.lab-draft[hidden] {
  display: none;
}

.lab-draft {
  position: absolute;
  top: 66px;
  left: 50%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 12px 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  transform: translateX(-50%);
}

.lab-draft span {
  color: #222;
  font-size: 14px;
  font-weight: 700;
  text-shadow: none;
}

/* Режим проекта кабинета: для какого изделия техмакет и что с отправкой */
.lab-target {
  z-index: 3;
}

.lab-target small {
  flex-basis: 100%;
  color: #444;
  font-size: 13px;
  text-align: center;
}

.lab-target small:empty {
  display: none;
}

.lab-target a {
  color: #0b6fd6;
  font-weight: 700;
}

.lab-app .lab-hint {
  left: 50%;
  right: auto;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(248, 248, 255, 0.85);
  color: #555;
  transform: translateX(-50%);
}

/* ---------- Окна техмакета и заказа: под верхней строкой ---------- */

.lab-app .lab-spec {
  inset: var(--lab-bar-h) 0 0;
  z-index: 880;
}

/* ---------- Планшет: сцена слева, колонки шагов справа одна под другой ---------- */

@media (max-width: 1199.98px) {
  .lab-app .lab-studio {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-areas: "stage left" "stage right";
  }
}

/* ---------- Телефон: строка в два ряда, всё одной колонкой, «Далее» прилипает к низу экрана ---------- */

@media (max-width: 759.98px) {
  .lab-app {
    --lab-bar-h: 104px;
  }

  .lab-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 48px auto;
    gap: 0 10px;
    padding-bottom: 6px;
  }

  .lab-bar-logo img {
    height: 22px;
  }

  .lab-bar-title {
    font-size: 14px;
  }

  .lab-bar-tg {
    display: none;
  }

  .lab-progress {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .lab-bar-actions {
    grid-row: 1;
    grid-column: 3;
  }

  .lab-progress ol {
    gap: 2px;
  }

  .lab-progress li {
    flex: 1 1 0;
  }

  .lab-progress button {
    width: 100%;
    min-width: 0;
    padding: 2px 6px 11px;
    font-size: 13px;
  }

  .lab-progress small {
    font-size: 10px;
  }

  .lab-progress button::after {
    left: 6px;
    right: 6px;
  }

  .lab-app .lab-studio {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    padding: 10px;
  }

  .lab-app .lab-stage {
    order: -1;
    flex: none;
    height: min(62svh, 560px);
    min-height: 340px;
  }

  .lab-side {
    overflow: visible;
  }

  /* «Далее» закреплена внизу экрана: колонка шага на телефоне длинная */
  .lab-next {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 850;
    margin: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.08);
  }

  .lab-app .lab-studio {
    padding-bottom: 84px;
  }

  .lab-app .lab-hint {
    display: none;
  }
}

/* Студия: кнопки внизу колонки в одну строку, поворот и отражение в две колонки (колонка узкая) */
.lab-next .lab-btn {
  padding-inline: 16px;
  white-space: nowrap;
}

.lab-next [data-lab-prev] {
  flex: 0 0 auto;
}

.lab-studio .lab-turns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Шаг 1, под палитрой: как устроена работа, коротко */
.lab-how {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.lab-how li {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f4f7fc;
  color: #444;
  font-size: 13px;
  line-height: 1.45;
  text-shadow: none;
}

.lab-how b {
  display: block;
  color: #000;
  font-size: 14px;
}
