/* Constructor-specific styles */

/* Единый вид кнопок/полей внутри приложения конструктора (не переопределяем шапку/футер сайта) */
body.constructor-page .constructor-app button,
body.constructor-page .constructor-app input[type="number"],
body.constructor-page .constructor-app input[type="text"],
body.constructor-page .constructor-app select,
body.constructor-page .constructor-app textarea {
  font-family: inherit;
}
body.constructor-page .constructor-app button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
body.constructor-page .modal-overlay button,
body.constructor-page dialog button {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
}
body.constructor-page .constructor-app input[type="number"],
body.constructor-page .constructor-app input[type="text"] {
  -webkit-appearance: none;
  appearance: none;
}
body.constructor-page .constructor-svg-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  pointer-events: none;
}
body.constructor-page .btn.btn-icon > .constructor-svg-icon,
body.constructor-page .btn.btn-icon-outline > .constructor-svg-icon {
  margin: 0 auto;
}

/* Нижний дубль панели на /constructor: скрыт (на /sheet-constructor — отдельная нижняя панель с тем же id) */
body.constructor-page:not(.sheet-constructor-page) #constructorMobileDock {
  display: none !important;
}

/* Button icons */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Drop hint */
.drop-hint__text {
  display: block;
  line-height: 1.5;
  white-space: normal;
}

.drop-hint__important {
  font-size: 2em;
  font-weight: 700;
  display: block;
  margin: 0.28em 0 0.06em;
  color: #c85a5a;
}

.drop-hint__sheet-limits {
  display: block;
  margin-bottom: 0.45em;
  font-size: 0.95em;
  font-weight: 600;
  color: #1e3a5f;
  line-height: 1.45;
}

.drop-hint__sheet-limits strong {
  font-weight: 700;
}

.drop-hint__link {
  display: inline-flex;
  align-items: center;
  color: #005BFF;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
  margin-top: 0.5em;
}

.drop-hint__link:hover {
  color: #0050E0;
}

.drop-hint__link svg {
  margin-left: 6px;
  flex-shrink: 0;
}

.drop-hint__copies {
  display: block;
  margin: 0.5em 0;
}

.drop-hint__copies-mobile {
  display: none;
}

@media (max-width: 768px) {
  .drop-hint__copies-desktop {
    display: none;
  }

  .drop-hint__copies-mobile {
    display: block;
  }

}

/* Зона загрузки: синий при наведении/выборе файла (глобальный --accent в style.css — оранжевый) */
body.constructor-page .drop-hint:hover,
body.constructor-page .drop-hint:focus-within,
body.constructor-page .drop-hint:active {
  border-color: #005BFF;
  color: #005BFF;
}

body.constructor-page .drop-hint:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

/* Верхняя полоска загрузки файлов — как в проверенном layout-tool.css */
body.constructor-page .loading.active:not(.loading--cart) {
  background: linear-gradient(90deg, #005bff 30%, transparent 30%) !important;
  background-size: 200% 100% !important;
  animation: loading .8s linear infinite !important;
}
body.constructor-page .loading__fill {
  background: linear-gradient(90deg, #005BFF, rgba(0,91,255,.5)) !important;
}
body.constructor-page .loading__bar.loading__bar--indeterminate::before {
  background: linear-gradient(90deg, #e8ecf2 35%, #005BFF 50%, #e8ecf2 65%) !important;
  background-size: 50% 100% !important;
}

/* Выделение файла: синяя обводка (глобальный --accent из style.css — оранжевый, перекрывает layout-tool) */
body.constructor-page .file-card.selected {
  border-color: #005BFF;
}
body.constructor-page .file-card.oversize.selected {
  border-color: #005BFF;
  box-shadow: 0 0 0 1px #005BFF, var(--shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
}
body.constructor-page .file-card.can-add.selected {
  border-color: #005BFF;
}
body.constructor-page .file-card.duplicate.selected {
  border-color: #005BFF !important;
  box-shadow: 0 0 0 2px #005BFF, var(--shadow, 0 1px 3px rgba(0, 0, 0, 0.08)) !important;
}

/* Export confirmation modal */
.export-confirm-modal {
  text-align: center;
  width: 750px;
  min-width: 550px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.export-confirm__body {
  flex: 1;
  overflow-y: auto;
  line-height: 1.6;
}

.export-confirm__body--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.export-confirm__body--centered > * {
  width: 100%;
  box-sizing: border-box;
}

.export-confirm__text {
  margin-bottom: 1em;
}

.export-confirm__terms-link {
  color: var(--primary, #005bff);
  font-weight: 700;
  text-decoration: underline;
}
.export-confirm__terms-link:hover {
  color: var(--primary-hover, #0048cc);
}

.export-confirm__gap-agreed {
  text-align: center;
  margin: 0.5em 0 1em;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
}

.export-confirm__attention {
  color: #c00;
  font-weight: 700;
  text-align: center;
  margin: 1em 0 0.5em;
}

.export-confirm__block {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0.8em 0;
  text-align: left;
}

.export-confirm__block-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 0.5em;
  text-align: center;
}

.export-confirm__dpi-list {
  margin: 0.5em 0;
  text-align: left;
  font-size: 13px;
}

.export-confirm__dpi-warn {
  margin-top: 1em;
  font-size: 13px;
}

.export-confirm__recommend {
  font-weight: 700;
}

.export-confirm__risks {
  margin-top: 1em;
  font-weight: 600;
  text-align: center;
}

.export-confirm__actions {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1em;
  padding-top: 1em;
  border-top: 1px solid var(--border);
}

.export-confirm__actions .btn-small {
  font-size: 12px;
  padding: 5px 12px;
}

.export-confirm__submit {
  min-width: 160px;
  padding: 10px 24px;
}

.export-confirm__submit.btn--disabled,
.export-confirm__submit:disabled,
.export-confirm__submit[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Info modal */
.info-modal {
  text-align: center;
  max-width: 380px;
}

.info-modal__text {
  line-height: 1.6;
  margin-bottom: 1em;
}

.info-modal .modal-actions {
  justify-content: center;
}

/* Sheet limits block */
.sheet-limits-block {
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/*
 * Липкий блок «Ограничения»: top:0 относительно колонки .sheets-col (она уже ниже шапки сайта).
 * layout-tool mobile задаёт top:60px — перебиваем.
 */
body.constructor-page .sheet-limits-block {
  position: sticky;
  /* Ниже фикс. панелей (10218–10225), выше карточек листов — иначе блок «наезжает» на нижний док */
  z-index: 5;
  top: 0 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .export-confirm-modal {
    width: auto;
    min-width: 350px;
    max-width: 92vw;
    height: 100vh;
    max-height: 100vh;
  }
}

/* Cart button - blue */
.btn-cart {
  background: linear-gradient(135deg, #005BFF 0%, #005BFF 100%);
  color: #fff;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: all 0.2s;
}
.btn-cart:hover {
  background: linear-gradient(135deg, #005BFF 0%, #0050E0 100%);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .mobile-footer .btn-cart {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
  }
}

/* Green success button */
.btn-success {
  background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
  color: #fff;
}
.btn-success:hover {
  background: linear-gradient(135deg, #388E3C 0%, #2e7d32 100%);
}

/* Tech bar inline in toolbar (desktop) */
.tech-bar-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}
.tech-bar-inline .tech-bar-label,
.tech-bar .tech-bar-label {
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #1e3a8a;
  margin-right: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.2;
}
.tech-bar-inline:empty {
  display: none;
}
.tech-bar-inline .tech-btn {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.tech-bar-inline .tech-btn:hover {
  background: rgba(0,91,255,.06);
  border-color: #005BFF;
}
.tech-bar-inline .tech-btn.active {
  background: linear-gradient(135deg, #005BFF 0%, #0050E0 100%);
  color: #fff;
  border-color: #0050E0;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
}

/* Обёртка кнопки прайса + карточка «Ценовая политика» при наведении */
.tech-bar-inline .tech-btn-wrap,
.tech-bar .tech-btn-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 100%;
}
@media (min-width: 769px) {
  .tech-bar-inline .tech-btn-wrap:hover,
  .tech-bar-inline .tech-btn-wrap:focus-within {
    z-index: 5;
  }
}

.price-policy-tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 10222;
  width: min(320px, calc(100vw - 24px));
  padding: 18px 20px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #1A1A1A;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.price-policy-tooltip__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.price-policy-tooltip__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #4CAF50;
  color: #fff;
  flex-shrink: 0;
}

.price-policy-tooltip__title {
  font-weight: 700;
  font-size: 15px;
  color: #111827;
}

.price-policy-tooltip__base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(0,91,255,.06);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 13px;
}

.price-policy-tooltip__base-val {
  font-weight: 700;
  color: #005BFF;
  white-space: nowrap;
}

.price-policy-tooltip__discounts-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  color: #111827;
}

.price-policy-tooltip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  flex-shrink: 0;
}

.price-policy-tooltip__tiers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.price-policy-tooltip__tier {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--success-bg, rgba(76,175,80,.1));
  border-radius: 8px;
  font-size: 12px;
}

.price-policy-tooltip__tier--empty {
  justify-content: center;
  color: #666666;
  font-weight: 500;
}

.price-policy-tooltip__tier-val {
  font-weight: 700;
  color: #2e7d32;
  white-space: nowrap;
}

.price-policy-tooltip__footer {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid #E0E0E0;
}

.price-policy-tooltip__foot-col {
  flex: 1;
  min-width: 0;
}

.price-policy-tooltip__foot-label {
  font-weight: 700;
  font-size: 12px;
  color: #111827;
  margin-bottom: 2px;
}

.price-policy-tooltip__foot-val {
  font-size: 13px;
  color: var(--text-muted, #999);
}

/* Десктоп: без (hover:hover)+(pointer:fine) — в Safari карточка могла не показываться */
@media (min-width: 769px) {
  .tech-btn-wrap:hover .price-policy-tooltip,
  .tech-btn-wrap:focus-within .price-policy-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* Мобильная полоса прайсов: overflow-x ломает всплывашку; только десктоп с hover */
@media (max-width: 768px) {
  .price-policy-tooltip {
    display: none !important;
  }
  .tech-bar-inline {
    display: none !important;
  }
}

/* ── Встроен в сайт: шапка/футер + смещение фиксированной панели конструктора ── */
html.constructor-page,
body.constructor-page {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  /* layout-tool задаёт body { overflow:hidden } — модалка цвета на <dialog> (top layer) */
  overflow-y: visible !important;
}
body.constructor-page {
  --constructor-top: calc(env(safe-area-inset-top, 0px) + var(--header-height, 56px));
  --constructor-settings-h: 54px;
  --constructor-price-row-h: 40px;
  --toolbar-h: 0px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg, #f0f2f5);
}
/* Шапка сайта: фиксация к вьюпорту (не уезжает при прокрутке страницы) */
body.constructor-page > .site-chrome--header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  /* Выше .mobile-stats (10218) и нижнего дока (10225), чтобы выпадающее меню не перекрывалось */
  z-index: 10260;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  background: var(--card, #fff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}
body.constructor-page .header {
  overflow: visible;
  position: relative;
  top: auto;
}
/* konstruktor-local/layout-tool-local.css задаёт устаревший .header{height:48px;…} после style.css — иначе шапка и кнопки отличаются от остальных страниц */
body.constructor-page.page-site-content .site-chrome--header .header {
  height: auto !important;
  max-height: none;
  min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0) 16px 0 !important;
  gap: 0 !important;
  border-bottom: none !important;
  box-shadow: var(--shadow-sm) !important;
  display: flex !important;
  align-items: center !important;
  background: var(--card) !important;
}
body.constructor-page .header__constructor-toolbar {
  display: none !important;
}
body.constructor-page .constructor-app {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  width: 100%;
  margin-top: var(--constructor-top);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (max-width: 768px) {
  body.constructor-page .constructor-app {
    min-height: calc(100dvh - var(--constructor-top));
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: visible;
  }
}
/* Блок настроек: под полосой прайсов (десктоп) или под stats+tech (мобильный) */
body.constructor-page .constructor-settings-bar {
  display: flex;
  position: fixed;
  top: calc(var(--constructor-top) + var(--constructor-price-row-h));
  left: 0;
  right: 0;
  /* Выше шапки сайта (10200), иначе при заниженном --constructor-top клики уходят в header */
  z-index: 10220;
  min-height: 44px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px 12px;
  background: var(--bg-secondary, #FAFAFA);
  border-bottom: 1px solid var(--border, #E0E0E0);
  font-size: 12px;
  color: var(--text, #1A1A1A);
}
@media (max-width: 768px) {
  /* Панель настроек — прилипшая к низу экрана (как нижний док) */
  body.constructor-page .constructor-settings-bar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom: none;
    border-top: 1px solid var(--border, #E0E0E0);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 6px 10px;
    z-index: 10225;
  }
}
body.constructor-page .constructor-settings-bar__ctrl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
body.constructor-page .constructor-settings-bar__ctrl--check {
  white-space: normal;
  max-width: 200px;
  line-height: 1.25;
}
body.constructor-page .constructor-settings-bar__input {
  width: 44px;
  height: 36px;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid var(--border, #E0E0E0);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
}
body.constructor-page .constructor-settings-bar .btn-cart.constructor-settings-bar__cart {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
  white-space: nowrap;
  gap: 8px;
  border-radius: 8px;
}
body.constructor-page .constructor-settings-bar .constructor-settings-bar__cart-icon {
  flex-shrink: 0;
  display: block;
}

/* Синяя обводка кнопок панели конструктора (иконки и корзина) */
body.constructor-page .constructor-settings-bar .btn,
body.constructor-page .mobile-footer .constructor-help-btn.btn {
  border: 1px solid rgba(0,91,255,.35);
  box-sizing: border-box;
}
body.constructor-page .constructor-settings-bar .btn:hover,
body.constructor-page .mobile-footer .constructor-help-btn.btn:hover {
  border-color: #005BFF;
}
body.constructor-page .constructor-settings-bar .btn-cart {
  border-color: rgba(0,91,255,.5);
}
body.constructor-page .constructor-settings-bar .btn-cart:hover {
  border-color: #0050E0;
}

/* Иконки панели — та же высота, что у кнопки W (36px); в моб. футере — та же кнопка «?», что в панели */
body.constructor-page .constructor-settings-bar .btn.btn-icon,
body.constructor-page .mobile-footer .constructor-help-btn.btn.btn-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1;
}
body.constructor-page .constructor-settings-bar .btn.btn-icon svg,
body.constructor-page .constructor-settings-bar .btn.btn-icon .constructor-svg-icon,
body.constructor-page .mobile-footer .constructor-help-btn.btn.btn-icon svg,
body.constructor-page .mobile-footer .constructor-help-btn.btn.btn-icon .constructor-svg-icon {
  display: block;
  flex-shrink: 0;
}

/* Как у кнопки «?» в панели: не цвет акцента из .crop-modal__help-btn:hover */
body.constructor-page .mobile-footer .constructor-help-btn.btn.btn-icon:hover {
  background: #fff;
  color: var(--text, #1a1a1a);
}

/* Обновить раскладку — зелёная обводка, белый фон (как на макете) */
body.constructor-page .constructor-settings-bar #btnRecalc {
  border-color: #4CAF50;
  color: #2e7d32;
  background: #fff;
}
body.constructor-page .constructor-settings-bar #btnRecalc:hover {
  border-color: #388E3C;
  background: var(--success-bg, rgba(76,175,80,.1));
  color: #1b5e20;
}

/* Очистить — красная обводка, белый фон */
body.constructor-page .constructor-settings-bar #btnClear {
  border-color: #F44336;
  color: #d32f2f;
  background: #fff;
}
body.constructor-page .constructor-settings-bar #btnClear:hover {
  border-color: #d32f2f;
  background: var(--danger-bg, rgba(244,67,54,.1));
  color: #c62828;
}
body.constructor-page .constructor-settings-bar #btnClear .constructor-svg-icon,
body.constructor-page .constructor-settings-bar #btnFooterClear .constructor-svg-icon {
  color: inherit;
}

/* Полоса прайсов: сразу под шапкой (десктоп); на мобиле — techBarMobile */
body.constructor-page .constructor-price-row {
  position: fixed;
  top: var(--constructor-top);
  left: 0;
  right: 0;
  height: var(--constructor-price-row-h);
  /* Выше области листа (.main), чтобы карточка «Ценовая политика» не уходила под контент */
  z-index: 10230;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  gap: 8px;
  background: #fff;
  border-bottom: 1px solid var(--border, #E0E0E0);
  box-sizing: border-box;
}
body.constructor-page .constructor-price-row .tech-bar-inline {
  display: flex !important;
  margin-left: 0;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
}
body.constructor-page .constructor-price-summary {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #1A1A1A);
  text-align: center;
  line-height: 1.35;
}
body.constructor-page .constructor-price-summary:not([hidden]) {
  display: flex;
}
body.constructor-page .constructor-price-summary span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin: 0 6px;
  white-space: nowrap;
}
body.constructor-page .constructor-price-summary span.stats-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 2px;
  padding: 0 1px;
  min-width: 0;
  flex-shrink: 0;
  color: var(--muted, #6b7280);
  font-weight: 600;
  font-size: 1.1em;
  line-height: 1;
  user-select: none;
}
body.constructor-page .constructor-price-row.constructor-price-row--has-files .tech-bar-inline#techBar {
  display: none !important;
}
body.constructor-page .main {
  margin-top: calc(var(--constructor-settings-h) + var(--constructor-price-row-h));
  height: calc(100vh - var(--constructor-top) - var(--constructor-settings-h) - var(--constructor-price-row-h));
  height: calc(100dvh - var(--constructor-top) - var(--constructor-settings-h) - var(--constructor-price-row-h));
  min-height: 0;
  overflow: hidden;
  flex: 1 1 auto;
}
body.constructor-page .sheets-col {
  min-height: 0;
}
/* #loader снаружи .constructor-app — на всю ширину viewport (Safari: 100vw + translateZ, без клипа колонкой) */
body.constructor-page #loader.loading {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  top: 0 !important;
  z-index: 2147483647;
  contain: none;
}
body.constructor-page #loader.loading.loading--cart.active {
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  min-width: 100% !important;
  height: auto !important;
  min-height: 100dvh !important;
  z-index: 2147483647;
}
/* /sheet-constructor: полоса загрузки файлов всегда сверху, на всю ширину экрана */
body.constructor-page.sheet-constructor-page #loader.loading:not(.loading--cart) {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100vw !important;
  max-width: none !important;
  height: 3px !important;
  min-height: 0 !important;
  max-height: 3px !important;
  pointer-events: none !important;
  background: transparent !important;
}
body.constructor-page.sheet-constructor-page #loader.loading.active:not(.loading--cart) {
  background: linear-gradient(90deg, #005bff 30%, transparent 30%) !important;
  background-size: 200% 100% !important;
  animation: loading .8s linear infinite !important;
}
body.constructor-page .loading.loading--cart.active .loading__overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  min-height: 100dvh !important;
  margin: 0 !important;
}
body.constructor-page .loading.loading--cart.active .loading__card {
  position: relative;
  z-index: 1;
}
/*
 * Info / export: подключён style.css — там .modal-overlay всегда display:flex, но скрыт через
 * opacity:0 + visibility:hidden и показывается классом .active. Конструктор (layout-tool) использует .open.
 * Без переопределения окна остаются невидимыми при .open.
 */
body.constructor-page #infoModal.modal-overlay,
body.constructor-page #exportConfirmModal.modal-overlay,
body.constructor-page #systemWorkTermsModal.modal-overlay,
body.constructor-page #cropModal.modal-overlay,
body.constructor-page #cropHelpModal.modal-overlay,
body.constructor-page #constructorHelpModal.modal-overlay,
body.constructor-page #cropPreviewColorModal.modal-overlay,
body.constructor-page #duplicateListModal.modal-overlay {
  z-index: 10500;
  transition: none;
  opacity: 1;
  visibility: visible;
  padding: 16px;
  box-sizing: border-box;
}
body.constructor-page #infoModal.modal-overlay:not(.open),
body.constructor-page #exportConfirmModal.modal-overlay:not(.open),
body.constructor-page #systemWorkTermsModal.modal-overlay:not(.open),
body.constructor-page #cropModal.modal-overlay:not(.open),
body.constructor-page #cropHelpModal.modal-overlay:not(.open),
body.constructor-page #constructorHelpModal.modal-overlay:not(.open),
body.constructor-page #cropPreviewColorModal.modal-overlay:not(.open),
body.constructor-page #duplicateListModal.modal-overlay:not(.open) {
  display: none !important;
  pointer-events: none;
}
body.constructor-page #infoModal.modal-overlay.open,
body.constructor-page #exportConfirmModal.modal-overlay.open,
body.constructor-page #systemWorkTermsModal.modal-overlay.open,
body.constructor-page #cropModal.modal-overlay.open,
body.constructor-page #cropHelpModal.modal-overlay.open,
body.constructor-page #constructorHelpModal.modal-overlay.open,
body.constructor-page #cropPreviewColorModal.modal-overlay.open,
body.constructor-page #duplicateListModal.modal-overlay.open {
  display: flex !important;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
body.constructor-page #infoModal.modal-overlay.open .modal,
body.constructor-page #exportConfirmModal.modal-overlay.open .modal,
body.constructor-page #systemWorkTermsModal.modal-overlay.open .modal,
body.constructor-page #cropModal.modal-overlay.open .modal,
body.constructor-page #cropHelpModal.modal-overlay.open .modal,
body.constructor-page #constructorHelpModal.modal-overlay.open .modal,
body.constructor-page #cropPreviewColorModal.modal-overlay.open .modal,
body.constructor-page #duplicateListModal.modal-overlay.open .modal {
  transform: none;
}
body.constructor-page #cropHelpModal.modal-overlay { z-index: 10501; }
body.constructor-page #constructorHelpModal.modal-overlay { z-index: 10503; }
body.constructor-page #cropPreviewColorModal.modal-overlay { z-index: 10502; }
body.constructor-page #systemWorkTermsModal.modal-overlay { z-index: 10511; }
body.constructor-page #duplicateListModal.modal-overlay { z-index: 10510; }

body.constructor-page .drop-overlay {
  z-index: 10510;
  border-color: #005BFF;
  color: #005BFF;
  background: rgba(37, 99, 235, 0.12);
}
body.constructor-page .toast {
  z-index: 10520;
  /* css/style.css: .toast { animation: slideInRight } — перебивает transform из layout-tool (центр экрана),
   * тост уезжает/мигает с opacity из keyframes и может выглядеть «пустым» белым блоком */
  animation: none !important;
  transform: translate(-50%, -50%);
}
/* Успех «в корзину»: многострочный текст по центру экрана (базовая позиция — layout-tool.css) */
body.constructor-page .toast.toast-cart-success {
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 1.25rem 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  background: #d9f0dc;
  color: #1e3d22;
  border: 1px solid #b5d9bc;
  box-shadow: 0 6px 24px rgba(30, 61, 34, 0.12);
}
/* Подгонка под листа: превышение размеров */
body.constructor-page .toast.toast-oversize {
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 1.25rem 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  background: #fde8e8;
  color: #5c2222;
  border: 1px solid #e8b8b8;
  box-shadow: 0 6px 24px rgba(92, 34, 34, 0.1);
}
/* Прогресс восстановления/миграции сессии (долгие тосты) */
body.constructor-page .toast.toast-session {
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 1.1rem 1.35rem;
  font-weight: 500;
  line-height: 1.5;
  background: #e8eef5;
  color: var(--text, #1A1A1A);
  border: 1px solid var(--border, #E0E0E0);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}
/* Оранжевые тосты: перебить фон из css/style.css у .toast */
body.constructor-page .toast.toast-orange {
  background: #f59e0b;
  color: #fff;
  border: 1px solid #d97706;
  box-shadow: 0 6px 24px rgba(217, 119, 6, 0.25);
}
/* Во время тура: обычные тосты под затемнением и попапом Driver (overlay 10800, .driver-popover в driver-tour.css). */
body.constructor-page.driver-active .toast.visible:not(.toast-tour-prompt),
body.driver-active .toast.visible:not(.toast-tour-prompt) {
  z-index: 10520 !important;
}
/* Подсказки шагов тура («технология», «загрузите файлы») — над затемнением и попапом подсказки. */
body.constructor-page.driver-active .toast.visible.toast-tour-prompt,
body.driver-active .toast.visible.toast-tour-prompt {
  z-index: 1000000003 !important;
}
body.constructor-page .sheet-fullscreen {
  z-index: 10530;
}

/* Полоса перед футером: в site-chrome.css у .site-footer margin-top: 40px вне тёмного фона */
body.constructor-page > .site-chrome--footer .site-footer {
  margin-top: 0;
}

/* Мобильный информер: две строки, на всю ширину экрана (как isMobile() ≤768) */
@media (max-width: 768px) {
  body.constructor-page .mobile-stats.mobile-stats--constructor {
    position: fixed;
    top: var(--constructor-top, var(--site-header-offset, 0px));
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    z-index: 10218;
    min-height: 0;
    height: auto;
    box-sizing: border-box;
    padding: 6px max(12px, env(safe-area-inset-left)) 6px max(12px, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    background: var(--bg-secondary, #fafafa);
    border-bottom: 1px solid var(--border, #e0e0e0);
    font-size: clamp(11px, 2.9vw, 14px);
    font-weight: 700;
    color: var(--text, #1a1a1a);
    overflow: visible;
    text-align: center;
    line-height: 1.35;
    white-space: normal;
  }
  body.constructor-page .mobile-stats.mobile-stats--constructor .mobile-stats__row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
}

@media (max-width: 768px) {
  body.constructor-page {
    --constructor-price-row-h: 0px;
  }
  body.constructor-page .constructor-price-row {
    display: none !important;
  }
  body.constructor-page > .site-chrome--footer {
    display: none !important;
  }
  body.constructor-page .main {
    margin-top: 0;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    box-sizing: border-box;
    overflow: visible;
    /* layout-tool задаёт padding-bottom 52px под скрытый mobile-footer — убираем */
    padding-bottom: 0;
  }
  /* Область листа: фиксированная высота на мобильном */
  body.constructor-page .sheets-col {
    flex: 0 0 550px;
    height: 550px;
    min-height: 550px !important;
    max-height: 550px;
    box-sizing: border-box;
  }
  body.constructor-page .sheet-card {
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }
  body.constructor-page .sheet-card__canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    height: auto;
  }
  body.constructor-page .empty-sheets {
    height: 100%;
    min-height: 0;
    align-self: stretch;
  }
  body.constructor-page .files-col {
    padding-top: 4px;
    padding-bottom: 4px;
  }
  /* Полоса загрузки файлов — у верхнего края viewport в обоих конструкторах */
  body.constructor-page #loader.loading:not(.loading--cart) {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 3px !important;
    min-height: 0 !important;
  }
  body.constructor-page #loader.loading.loading--cart.active {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: 100vw !important;
    height: 3px !important;
    min-height: 0 !important;
    max-height: 3px !important;
    display: block !important;
    pointer-events: none !important;
    background: linear-gradient(90deg, #005bff 30%, transparent 30%) !important;
    background-size: 200% 100% !important;
    animation: loading 0.8s linear infinite !important;
  }
  /* Редактирование листа: на весь экран, колонка листов сворачивается */
  body.constructor-page.constructor-sheet-edit-fullscreen .sheets-col {
    flex: 0 0 0 !important;
    min-height: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: none !important;
  }
  body.constructor-page.constructor-sheet-edit-fullscreen .sheet-card.sheet-editing {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    z-index: 10280;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 0 0 2px var(--accent, #4a6cf7), var(--shadow, 0 1px 3px rgba(0, 0, 0, 0.08)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0);
    /* Без pinch/double-tap zoom по листу; перетаскивание через Pointer Events */
    touch-action: none;
  }
  body.constructor-page.constructor-sheet-edit-fullscreen .sheet-card.sheet-editing .sheet-card__canvas-wrap,
  body.constructor-page.constructor-sheet-edit-fullscreen .sheet-card.sheet-editing canvas {
    touch-action: none;
  }
  body.constructor-page.constructor-sheet-edit-fullscreen {
    overflow: hidden !important;
  }
  body.constructor-page .sheet-card__head,
  body.constructor-page .sheet-card__info {
    flex-shrink: 0;
  }
  /* Горизонтальный скролл: синяя полоса (WebKit; на iOS может оставаться оверлейной, но цвет заметнее) */
  body.constructor-page .files-col,
  body.constructor-page .sheets-col {
    scrollbar-width: thin;
    scrollbar-color: #005BFF rgba(0,91,255,.08);
  }
  body.constructor-page .files-col::-webkit-scrollbar,
  body.constructor-page .sheets-col::-webkit-scrollbar {
    display: block;
    height: 8px;
    width: 8px;
  }
  body.constructor-page .files-col::-webkit-scrollbar-track,
  body.constructor-page .sheets-col::-webkit-scrollbar-track {
    background: rgba(0,91,255,.08);
    border-radius: 4px;
    -webkit-box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
  }
  body.constructor-page .files-col::-webkit-scrollbar-thumb,
  body.constructor-page .sheets-col::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #005BFF 0%, #005BFF 100%);
    border-radius: 4px;
    border: 1px solid rgba(29, 78, 216, 0.35);
  }
  body.constructor-page .tech-bar::-webkit-scrollbar {
    display: block !important;
    height: 6px;
  }
  body.constructor-page .tech-bar::-webkit-scrollbar-track {
    background: rgba(0,91,255,.08);
    border-radius: 3px;
  }
  body.constructor-page .tech-bar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #005BFF 0%, #005BFF 100%);
    border-radius: 3px;
    border: 1px solid rgba(29, 78, 216, 0.3);
  }
  /* ✓ в режиме редактирования; ✎ не нужен */
  body.constructor-page .sheet-card.sheet-editing .sheet-edit-save {
    display: flex !important;
  }
  body.constructor-page .sheet-card.sheet-editing .sheet-edit-pencil {
    display: none !important;
  }
  body.constructor-page .tech-bar {
    z-index: 10216;
    justify-content: center;
    align-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap !important;
    height: auto !important;
    min-height: 36px;
    row-gap: 6px;
    column-gap: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
    white-space: normal !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
  }
  body.constructor-page .tech-bar .tech-bar-label {
    display: flex !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-bottom: 0;
    justify-content: center;
    text-align: center;
    white-space: normal !important;
    font-size: 13px;
    line-height: 1.25;
  }
  body.constructor-page .tech-bar .tech-btn-wrap {
    flex-shrink: 0;
  }
  body.constructor-page .tech-bar .tech-btn:hover {
    border-color: #005BFF;
    background: rgba(0,91,255,.06);
  }
  body.constructor-page .tech-bar .tech-btn.active {
    background: linear-gradient(135deg, #005BFF 0%, #0050E0 100%);
    color: #fff;
    border-color: #0050E0;
  }
  /* Мобильный Safari/Chrome: при font-size < 16px на input зумит весь viewport (в т.ч. шапку). */
  body.constructor-page input:not([type='checkbox']):not([type='radio']):not([type='range']):not([type='hidden']):not([type='file']):not([type='color']),
  body.constructor-page select,
  body.constructor-page textarea {
    font-size: 16px !important;
  }
  /* Снижает лишний double-tap zoom; не мешает скроллу */
  body.constructor-page {
    touch-action: manipulation;
  }
}

/* Модалка цвета: <dialog> — по центру вьюпорта (top layer) */
.color-settings-dialog {
  border: none;
  padding: 0;
  margin: 0;
  max-width: min(380px, 92vw);
  max-height: 90vh;
  width: min(380px, 92vw);
  background: transparent;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}
.color-settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.color-settings-dialog__inner {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  max-height: min(85vh, 90vh);
  overflow-y: auto;
  box-sizing: border-box;
}
.color-settings-dialog__title {
  font-size: 16px;
  margin: 0 0 14px;
  text-align: center;
  font-weight: 600;
}
.color-settings-dialog__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-bottom: 0;
}
.color-settings-dialog__label-text {
  text-align: center;
}
.color-settings-dialog__threshold {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
}
.color-settings-dialog__threshold-title {
  text-align: center;
  font-weight: 600;
}
.color-settings-dialog__actions {
  margin-top: 16px;
}
.color-settings-dialog .color-modal__row {
  display: flex;
  gap: 12px;
}
.color-settings-dialog .color-modal__row .color-settings-dialog__label {
  flex: 1;
}
.color-settings-dialog input[type='color'] {
  height: 28px;
  padding: 1px;
  width: 100%;
  cursor: pointer;
}
.color-settings-dialog input[type='range'] {
  width: 100%;
}
.color-settings-dialog.color-settings-dialog--polyfill {
  z-index: 2147483647 !important;
}

/* Product tour (Driver.js) */
/* driver-tour.css: .driver-popover * { font-family: sans-serif } перебивает глифы Font Awesome */
body.constructor-page .driver-popover i[class*='fa-'] {
  font-family: 'Font Awesome 6 Free' !important;
  font-style: normal;
  font-variant: normal;
}
body.constructor-page .driver-popover .fa-regular,
body.constructor-page .driver-popover .far {
  font-weight: 400 !important;
}
body.constructor-page .driver-popover .fa-solid,
body.constructor-page .driver-popover .fas {
  font-weight: 900 !important;
}
body.constructor-page .constructor-driver-popover {
  max-width: min(420px, calc(100vw - 32px));
  border-radius: 12px;
  box-shadow:
    0 10px 40px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(15, 23, 42, 0.06);
  font-family: inherit;
}
body.constructor-page .constructor-driver-popover .driver-popover-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
body.constructor-page .constructor-driver-popover .driver-popover-description {
  font-size: 0.9rem;
  color: #334155;
  line-height: 1.45;
  text-shadow: none;
  /* Длинные шаги (напр. «Параметры раскладки»): компактная высота + прокрутка текста */
  max-height: min(38vh, 260px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 6px;
  margin-right: -2px;
  scrollbar-gutter: stable;
}
/* Шаг «Параметры раскладки»: демо-иконки в колонке, текст рядом — без «наезда» текста под кнопки */
body.constructor-page .constructor-driver-popover .constructor-tour-settings-desc {
  display: flex;
  flex-direction: column;
  gap: 0.65em;
}
body.constructor-page .constructor-driver-popover .constructor-tour-settings-desc__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 12px;
}
body.constructor-page .constructor-driver-popover .constructor-tour-settings-desc__row--nowrap {
  display: block;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
body.constructor-page .constructor-driver-popover .constructor-tour-settings-desc__lead {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: flex-start;
  max-width: 100%;
}
body.constructor-page .constructor-driver-popover .constructor-tour-settings-desc__text {
  flex: 1 1 180px;
  min-width: 0;
  line-height: 1.45;
}
body.constructor-page .constructor-driver-popover .constructor-tour-settings-desc .constructor-tour-panel-demo--cart-first {
  margin-top: 4px;
}
body.constructor-page .constructor-driver-popover .driver-popover-close-btn {
  text-shadow: none !important;
}
body.constructor-page .constructor-driver-popover .driver-popover-footer button {
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border, #E0E0E0);
  /* driver.js по умолчанию: text-shadow + zoom — дают «мыльный» текст на «Готово» / «Далее» */
  text-shadow: none !important;
  zoom: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.constructor-page .constructor-driver-popover .driver-popover-next-btn {
  background: #005BFF !important;
  color: #fff !important;
  border-color: #005BFF !important;
}
body.constructor-page .constructor-driver-popover .driver-popover-next-btn:hover {
  background: #0050E0 !important;
}
body.constructor-page .constructor-driver-popover .driver-popover-prev-btn {
  text-shadow: none !important;
}
body.constructor-page .constructor-driver-popover .driver-popover-progress-text {
  color: #64748b;
  font-size: 12px;
  text-shadow: none;
  zoom: 1;
}

/* Подсказки внутри описания шага тура */
body.constructor-page .constructor-driver-popover .constructor-tour-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  vertical-align: middle;
  box-sizing: border-box;
}
body.constructor-page .constructor-driver-popover .constructor-tour-key--green {
  background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
  color: #fff !important;
  border: 1px solid #2e7d32;
  box-shadow: 0 1px 3px rgba(22, 163, 74, 0.35);
}
/* Демо: переключатели W и A+ножницы как в панели (.mfooter-toggle-btn) */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle-pair {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  vertical-align: middle;
  margin-right: 4px;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle-pair__item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle {
  pointer-events: none;
  user-select: none;
  cursor: default;
  flex-shrink: 0;
  font-family: inherit;
}
/* W: выкл. — как #headerSepWhite:not(:checked)+… */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--w-off {
  position: relative;
  overflow: hidden;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #e0e0e0;
  color: #999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--w-off::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 2px;
  height: 160%;
  background: rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 1px;
  pointer-events: none;
}
/* W: вкл. — как :checked */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--w-on {
  position: relative;
  overflow: hidden;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #4caf50;
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.25);
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-w-text {
  font-size: 28px;
  font-weight: 700;
  font-family: inherit;
  position: relative;
  z-index: 0;
  line-height: 1;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--w-on .constructor-tour-demo-w-text {
  color: #2e7d32;
}
/* A+ножницы: выкл. */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--autotrim-off {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  gap: 0;
  padding: 2px 4px 3px;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  background: #e0e0e0;
  color: #999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--autotrim-off::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 2px;
  height: 160%;
  background: rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 1px;
  pointer-events: none;
}
/* A+ножницы: вкл. */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--autotrim-on {
  position: relative;
  overflow: hidden;
  flex-direction: column;
  gap: 0;
  padding: 2px 4px 3px;
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #4caf50;
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  box-sizing: border-box;
  box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.25);
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-autotrim__a {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  margin-bottom: 1px;
  opacity: 0.85;
  position: relative;
  z-index: 0;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--autotrim-on .constructor-tour-demo-autotrim__a {
  color: #2e7d32;
  opacity: 1;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--autotrim-off svg,
body.constructor-page .constructor-driver-popover .constructor-tour-demo-toggle--autotrim-on svg {
  position: relative;
  z-index: 0;
  flex-shrink: 0;
  display: block;
  width: 14px;
  height: 14px;
}

/* Демо-кнопки как на панели настроек (только подсказка, не кликабельны) */
body.constructor-page .constructor-driver-popover .constructor-tour-panel-demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 10px 0 0 0;
  line-height: 1.45;
}
body.constructor-page .constructor-driver-popover .constructor-tour-panel-demo.constructor-tour-panel-demo--cart-first {
  margin-top: 4px;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn {
  pointer-events: none;
  user-select: none;
  cursor: default;
  flex-shrink: 0;
  font-family: inherit;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 8px;
  line-height: 1.2;
  color: #fff !important;
  border: 1px solid rgba(0,91,255,.5);
  background: linear-gradient(135deg, #005BFF 0%, #005BFF 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--help,
body.constructor-page .toast .constructor-tour-demo-btn--help {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid rgba(0, 91, 255, 0.35);
  box-sizing: border-box;
  background: #fff;
  color: #1a1a1a;
  vertical-align: middle;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
}
body.constructor-page .toast .constructor-tour-demo-btn--help {
  margin: 0 2px;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--help i[class*='fa-'],
body.constructor-page .toast .constructor-tour-demo-btn--help i[class*='fa-'] {
  font-family: 'Font Awesome 6 Free' !important;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
}
/* Как .btn-icon-outline #btnTrimming */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--trim-outline {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 8px;
  border: 1px solid var(--border, #e0e0e0);
  box-sizing: border-box;
  background: #fff;
  color: var(--text, #1a1a1a);
}
/* Как .btn-success.btn-icon-outline #btnRecalc */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--recalc {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 8px;
  border: 1px solid var(--green, #4caf50);
  box-sizing: border-box;
  background: #fff;
  color: #2e7d32;
}
/* Как .btn-icon-outline #btnColor — сетка-превью */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--palette {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--border, #e0e0e0);
  box-sizing: border-box;
  background: #fff;
  color: #1a1a1a;
  vertical-align: middle;
  box-shadow: none;
  overflow: hidden;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--palette .constructor-tour-svg--palette {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 1px;
}
/* Как .btn-danger.btn-icon-outline #btnClear */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--trash {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--red, #f44336);
  box-sizing: border-box;
  background: #fff;
  color: var(--red, #f44336);
  vertical-align: middle;
  box-shadow: none;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn .constructor-tour-svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
/* Как .file-card__crop — кнопка «Ножницы» (обрезка пустых полей) */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--scissors {
  width: 28px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  border-radius: 6px;
  border: 1px solid var(--border, #e0e0e0);
  box-sizing: border-box;
  background: #fff;
  color: var(--text, #1a1a1a);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--scissors svg {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
/* Как .file-card__remove в layout-tool: компактная × */
body.constructor-page .constructor-driver-popover .constructor-tour-demo-btn--remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0 3px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  vertical-align: middle;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #666666;
  box-shadow: none;
}
body.constructor-page .constructor-driver-popover .constructor-tour-demo-caption {
  flex: 1 1 160px;
  min-width: 0;
  font-weight: 400;
  color: #334155;
}
body.constructor-page .constructor-driver-popover .constructor-tour-panel-demo--help {
  margin-top: 12px;
}

/* Как модалка «На экран Домой» (.pwa-modal в includes/cookie-consent.php) */
body.constructor-page .toast.toast-tour,
body.constructor-page .toast:has(.toast-tour-block) {
  max-width: min(420px, calc(100vw - 32px));
  width: min(420px, calc(100vw - 32px));
  text-align: left;
  font-weight: 500;
  background: #fff !important;
  color: #333;
  border: none !important;
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}
body.constructor-page .toast .toast-tour-block {
  display: block;
}
body.constructor-page .toast.toast-tour .toast-tour-title {
  display: block;
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a2e;
  text-align: center;
}
body.constructor-page .toast.toast-tour .toast-tour-text {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
  color: #333;
}
body.constructor-page .toast.toast-tour .toast-tour-text:last-of-type {
  margin-bottom: 18px;
}
body.constructor-page .toast.toast-tour .toast-tour-text--note {
  font-size: 0.82rem;
  color: #666;
}
body.constructor-page .toast .toast-tour-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: stretch;
  align-items: stretch;
  margin-top: 0;
  width: 100%;
  text-align: center;
}
/* Как .pwa-btn в cookie-consent */
body.constructor-page .toast .toast-tour-btn,
body.constructor-page .toast .toast-tour-dismiss {
  margin: 0;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
body.constructor-page .toast.toast-tour .toast-tour-btn {
  border: none;
  background: #005bff;
  color: #fff;
}
body.constructor-page .toast.toast-tour .toast-tour-btn:hover:not(:disabled) {
  background: #0047cc;
}
body.constructor-page .toast.toast-tour .toast-tour-dismiss {
  border: none;
  color: #333;
  background: #f0f0f0;
}
body.constructor-page .toast.toast-tour .toast-tour-dismiss:hover:not(:disabled) {
  background: #e0e0e0;
}

/*
 * Driver.js: SVG оверлей по умолчанию z-index:10000 — ниже фикс. панелей конструктора (10220–10260),
 * из‑за этого прайс и настройки выглядели «одним» незатемнённым блоком, а листы — без затемнения.
 * Поднимаем оверлей и подсвечиваемый шаг выше панелей; попап тура остаётся из driver-tour.css (1e9).
 */
body.constructor-page.driver-active svg.driver-overlay,
body.driver-active svg.driver-overlay {
  z-index: 10800 !important;
}
body.constructor-page.driver-active .driver-active-element,
body.driver-active .driver-active-element {
  z-index: 10900 !important;
}
body.constructor-page.driver-active #driver-dummy-element,
body.driver-active #driver-dummy-element {
  z-index: 10900 !important;
}

/* Статичные цели тура: z-index срабатывает с position (grid/flex часто достаточно; подстраховка для колонки листов) */
body.constructor-page.driver-active #sheetsCol.driver-active-element {
  position: relative;
}

/* ── btn-icon-outline & btn-trim ── */

/* Обводка у иконок (триминг, палитра, обновление, корзина) и согласованный вид с кнопкой «В корзину» */
.btn-icon-outline {
  border: 1px solid var(--border);
  background: #fff;
  box-sizing: border-box;
}
.btn-icon-outline:hover {
  background: #eef0f4;
}
.toolbar .btn-icon.btn-trim--active,
.mobile-footer .btn-icon.btn-trim--active,
body.constructor-page .constructor-settings-bar .btn-icon.btn-trim--active {
  border-color: var(--green);
  color: #2e7d32;
  background: var(--success-bg, rgba(76,175,80,.1));
}
.toolbar .btn-icon.btn-trim--active:hover,
.mobile-footer .btn-icon.btn-trim--active:hover,
body.constructor-page .constructor-settings-bar .btn-icon.btn-trim--active:hover {
  background: #d1fae5;
  border-color: var(--green);
}
.toolbar .btn-success.btn-icon-outline,
.mobile-footer .btn-success.btn-icon-outline {
  border-color: var(--green);
  color: #2e7d32;
  background: #fff;
}
.toolbar .btn-success.btn-icon-outline:hover,
.mobile-footer .btn-success.btn-icon-outline:hover {
  background: var(--success-bg, rgba(76,175,80,.1));
}
.toolbar .btn-danger.btn-icon-outline,
.mobile-footer .btn-danger.btn-icon-outline {
  border-color: var(--red);
  color: var(--red);
  background: #fff;
}
.toolbar .btn-danger.btn-icon-outline:hover,
.mobile-footer .btn-danger.btn-icon-outline:hover {
  background: var(--danger-bg, rgba(244,67,54,.1));
}

/* ── Duplicate list modal ── */

.duplicate-list-modal {
  width: min(520px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  text-align: left;
}
.duplicate-list-modal__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  text-align: center;
  flex-shrink: 0;
}
.duplicate-list-modal__body {
  flex: 1;
  min-height: 0;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text, #1A1A1A);
  border: 1px solid var(--border, #E0E0E0);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fafbfc;
}
.duplicate-list-modal__row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #E0E0E0);
  word-break: break-word;
}
.duplicate-list-modal__row:last-child {
  border-bottom: none;
}
.duplicate-list-modal .modal-actions {
  flex-shrink: 0;
  margin-top: 12px;
}
.toast.toast-orange .toast-duplicate-btn {
  margin-top: 12px;
  font-weight: 600;
  border: 2px solid var(--primary, #005bff);
  background: #fff;
  color: var(--primary, #005bff);
  box-shadow: 0 0 0 1px rgba(0, 91, 255, 0.2);
}
.toast.toast-orange .toast-duplicate-btn:hover {
  background: var(--primary-light, rgba(0, 91, 255, 0.1));
  border-color: var(--primary-hover, #0047cc);
  color: var(--primary-hover, #0047cc);
}

/* ── Crop modal ── */

.modal.crop-modal {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(96vh, 920px);
  width: 100%;
  max-width: min(96vw, 920px);
  text-align: center;
}
.crop-modal__head {
  position: relative;
  flex-shrink: 0;
  z-index: 6;
  padding: 16px 48px 12px 20px;
  margin: 0;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid var(--border, #E0E0E0);
}
.crop-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  padding: 0 8px;
}
.modal.crop-modal .crop-modal__title {
  margin-bottom: 0;
}
.crop-modal__help-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border, #E0E0E0);
  border-radius: 50%;
  background: var(--bg-soft, #f4f5f7);
  color: var(--muted, #666666);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.crop-modal__help-btn:hover {
  border-color: var(--accent, #4a6cf7);
  color: var(--accent, #4a6cf7);
  background: #fff;
}
.crop-modal__help-btn--close {
  position: static;
  transform: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 22px;
  font-weight: 400;
}
.crop-modal__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 20px 8px;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}
.crop-modal__viewport {
  position: relative;
  display: block;
  width: 100%;
  height: min(65vh, 640px);
  max-height: min(65vh, 640px);
  margin: 0 auto 12px;
  overflow: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  min-height: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.crop-modal__viewport.crop-modal__viewport--panning {
  cursor: grabbing;
}
.crop-modal__viewport-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  width: max-content;
  min-height: 100%;
  height: max-content;
  box-sizing: border-box;
}
.crop-modal__zoom-inner {
  position: relative;
  display: block;
  flex: 0 0 auto;
}
.crop-modal__viewport img {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  user-select: none;
  pointer-events: none;
  vertical-align: top;
}
/* Сайт: img { max-width: 100% } — жёстко фиксируем превью, чтобы рамка обрезки совпадала с расчётом в JS */
body.constructor-page #cropModal img#cropImg {
  max-width: none !important;
}
.crop-modal__frame {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  box-sizing: border-box;
  border: 1px solid #52525b;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.48);
  cursor: move;
  touch-action: none;
}
.crop-modal__handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fafafa;
  border: 1px solid #52525b;
  border-radius: 2px;
  z-index: 2;
  box-sizing: border-box;
}
.crop-modal__handle[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.crop-modal__handle[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop-modal__handle[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop-modal__handle[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.crop-modal__footer {
  flex-shrink: 0;
  z-index: 6;
  margin: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border, #E0E0E0);
  background: #fff;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}
.crop-modal__footer-row--trim {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
}
.crop-modal__footer-left,
.crop-modal__footer-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.crop-modal__footer-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #666666);
  margin-right: 2px;
}

/* ── Crop help modal ── */

#cropHelpModal.modal-overlay {
  z-index: 210;
}
.crop-help-modal {
  max-width: min(95vw, 880px);
  width: 100%;
  text-align: left;
  container-type: inline-size;
  container-name: crophelp;
}
.crop-help-modal__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 0 40px;
  min-height: 36px;
}
.crop-help-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  flex: 1;
}
.crop-help-modal__head .crop-modal__help-btn--close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.crop-help-modal__body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text, #1A1A1A);
  max-height: min(62vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}
.crop-help-modal__body ul {
  margin: 0 0 12px;
  padding-left: 1.4em;
  list-style: disc outside;
  color: var(--muted, #4b5563);
}
.crop-help-modal__body ul li {
  display: list-item;
  margin-bottom: 6px;
}
.crop-help-modal__body ul li:last-child {
  margin-bottom: 0;
}
.crop-help-modal__body .crop-help-btn-img {
  height: 42px;
  width: auto;
  max-width: 100%;
  vertical-align: middle;
  margin: 0 6px 2px 0;
  object-fit: contain;
  display: inline-block;
}
.crop-help-modal__body .crop-help-btns-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  vertical-align: middle;
  margin-right: 4px;
}
.crop-help-modal__body .crop-help-btns-pair .crop-help-btn-img {
  margin: 0 0 2px 0;
}
.crop-help-modal__ul--tight {
  margin-top: -4px !important;
  list-style: circle outside;
}
.crop-help-modal__body li > .crop-help-modal__ul--tight {
  margin-top: 6px !important;
  margin-bottom: 4px;
}
.crop-help-modal__h5 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1A1A1A);
}
.crop-help-modal__sec--hotkeys .crop-help-modal__h5 {
  margin: 12px 0 6px;
}
.crop-help-modal__sec--hotkeys > .crop-help-modal__h5:first-of-type {
  margin-top: 4px;
}
.crop-help-modal__hotkeys-note {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #666666);
}
.crop-help-modal__sec--hotkeys > ul:last-of-type {
  margin-bottom: 0;
}

.crop-help-visual {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.crop-help-figure {
  margin: 0 0 14px;
  padding: 0;
  min-width: 0;
}
.crop-help-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 40px;
  object-fit: contain;
  object-position: left center;
  border-radius: 4px;
  border: 1px solid var(--border, #E0E0E0);
  box-sizing: border-box;
}

.crop-help-badge-block {
  margin: 0 0 14px;
}
.crop-help-badge-block__line {
  margin: 0 0 10px;
  color: var(--muted, #4b5563);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.crop-help-badge-block__line:last-child {
  margin-bottom: 0;
}
.crop-help-badge-block__line .alpha-badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 7px;
  line-height: 1.35;
  vertical-align: text-bottom;
  white-space: nowrap;
}
.crop-help-badge-block .crop-help-btn-img--badge {
  height: 28px;
  width: auto;
  max-width: 100%;
  margin: 0 4px 0 2px;
  vertical-align: -6px;
  object-fit: contain;
}
.crop-help-modal__sec {
  margin-bottom: 16px;
}
.crop-help-modal__sec:last-child {
  margin-bottom: 0;
}
.crop-help-modal__sec h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text, #1A1A1A);
}
.crop-help-modal__sec p {
  margin: 0 0 8px;
  color: var(--muted, #4b5563);
}
.crop-help-modal__sec p:last-child {
  margin-bottom: 0;
}
.crop-help-modal__actions {
  margin-top: 12px;
  justify-content: flex-end;
}

/* ── File card crop button (угол карточки, как × справа) ── */

.file-card__crop {
  position: absolute;
  z-index: 2;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border, #E0E0E0);
  border-radius: 6px;
  background: #fff;
  color: var(--text, #1a1a1a);
  opacity: 1;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}
.file-card__crop svg {
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  pointer-events: none;
}
.file-card__crop:hover {
  border-color: var(--primary, #005BFF);
  color: var(--primary, #005BFF);
}
.file-card--cropped .file-card__crop {
  border-color: var(--success, #4caf50);
  background: #e8f5e9;
  color: #2e7d32;
}

/* ── Тосты: standalone session / oversize ── */

.toast.toast-session {
  background: var(--info-bg, rgba(33,150,243,.1));
  color: var(--text, #1A1A1A);
  border: 1px solid var(--border, #E0E0E0);
  font-weight: 500;
}
.toast.toast-oversize {
  background: #fde8e8;
  color: #5c2222;
  border: 1px solid #e8b8b8;
  font-weight: 500;
}

/* ── Crop preview color modal ── */

.crop-preview-color-modal .modal{position:relative;width:min(440px,94vw);max-height:85vh;overflow-y:auto}
.crop-preview-color-modal .modal h3{font-size:14px;margin-bottom:8px;text-align:center}
.crop-preview-color-modal__hint{font-size:11px;color:var(--muted,#666666);margin:0 0 10px;line-height:1.4;text-align:center}
.crop-preview-color-modal__grid{display:grid;grid-template-columns:repeat(12,1fr);gap:4px;margin:0 0 8px;width:100%;box-sizing:border-box}
.crop-prev-swatch{aspect-ratio:1;width:100%;min-height:0;padding:0;border:1px solid rgba(0,0,0,.12);border-radius:4px;cursor:pointer;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
.crop-prev-swatch:hover{filter:brightness(1.06);z-index:1}
.crop-prev-swatch.selected{outline:2px solid var(--accent,#4a6cf7);outline-offset:1px;box-shadow:0 0 0 1px #fff}
.crop-preview-color-modal__details{width:100%;margin:0 0 4px;text-align:left}
.crop-preview-color-modal__summary{cursor:pointer;font-size:12px;font-weight:600;color:var(--accent,#4a6cf7);user-select:none;list-style:none;padding:6px 0}
.crop-preview-color-modal__summary::-webkit-details-marker{display:none}
.crop-preview-color-modal__details[open] .crop-preview-color-modal__summary{margin-bottom:0;color:var(--text,#1A1A1A)}
.crop-preview-color-modal__native-hidden{position:absolute;left:0;bottom:0;width:1px;height:1px;padding:0;margin:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0;opacity:0.001}
.crop-preview-color-modal__native-hidden input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:default}

/* ── Crop modal: mobile responsive ── */

@media (max-width: 768px) {
  .crop-modal__viewport {
    height: 50vh;
    max-height: 50vh;
  }
  .crop-modal__footer-row--trim {
    flex-direction: column;
    align-items: stretch;
  }
  .crop-modal__footer-left,
  .crop-modal__footer-right {
    justify-content: flex-start;
  }
}

/* ── /sheet-constructor (konstruktor-local): строка статистики и поля стоимости в шапке ── */
/* layout-tool задаёт .stats-bar { position:fixed } — внутри .constructor-price-row это ломает вёрстку: полоса пустая, текст уезжает */
body.constructor-page .constructor-price-row .stats-bar {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  z-index: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1a1a1a);
  overflow: visible;
  white-space: normal;
  background: transparent;
  padding: 0 12px;
  box-sizing: border-box;
}

body.constructor-page .constructor-settings-bar #headerExportDpi,
body.constructor-page .constructor-settings-bar #headerCostPerM {
  width: auto;
  min-width: 44px;
  max-width: 100px;
}

/* Конструктор листов: сводка (#statsBar) — сразу под панелью настроек (десктоп) */
@media (min-width: 769px) {
  body.sheet-constructor-page .constructor-settings-bar {
    top: var(--constructor-top);
    z-index: 10235;
  }
  body.sheet-constructor-page .constructor-price-row {
    top: calc(var(--constructor-top) + var(--constructor-settings-h));
    z-index: 10228;
  }
}

/* Нижняя панель /sheet-constructor на мобильном — те же обводки и акценты, что у верхней панели на десктопе */
@media (max-width: 768px) {
  body.sheet-constructor-page .mobile-footer .mfooter-top > .btn,
  body.sheet-constructor-page .mobile-footer .mfooter-bottom > .btn {
    border: 1px solid rgba(0, 91, 255, 0.35);
    box-sizing: border-box;
  }
  body.sheet-constructor-page .mobile-footer .mfooter-top > .btn:hover,
  body.sheet-constructor-page .mobile-footer .mfooter-bottom > .btn:hover {
    border-color: #005bff;
  }
  body.sheet-constructor-page .mobile-footer .mfooter-bottom .btn-cart {
    border-color: rgba(0, 91, 255, 0.5);
  }
  body.sheet-constructor-page .mobile-footer .mfooter-bottom .btn-cart:hover {
    border-color: #0050e0;
  }
  body.sheet-constructor-page .mobile-footer #btnFooterRecalc {
    border-color: #4caf50;
    color: #2e7d32;
    background: #fff;
  }
  body.sheet-constructor-page .mobile-footer #btnFooterRecalc:hover {
    border-color: #388e3c;
    background: rgba(76, 175, 80, 0.1);
    color: #1b5e20;
  }
  body.sheet-constructor-page .mobile-footer #btnFooterClear {
    border-color: #f44336;
    color: #d32f2f;
    background: #fff;
  }
  body.sheet-constructor-page .mobile-footer #btnFooterClear:hover {
    border-color: #d32f2f;
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
  }
  body.sheet-constructor-page .mobile-footer #btnFooterClear .constructor-svg-icon {
    color: inherit;
  }
}

/*
 * konstruktor-local/layout-tool-local.css задаёт глобальный .btn после css/style.css — кнопка «Вход» / ЛК
 * в шапке выглядит как кнопка конструктора. Восстанавливаем стили .btn-outline.btn-sm магазина.
 */
body.sheet-constructor-page .site-chrome--header .header .btn.btn-outline.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: 2px solid transparent;
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}
body.sheet-constructor-page .site-chrome--header .header .btn.btn-outline.btn-sm:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
