/* ============================================================
   PRO CALC — профессиональные дополнения
   ============================================================ */
.nesting-container {
  width: 100%; height: 100%; max-height: 620px;
  padding: 12px; overflow-y: auto; background: #f8f9fb;
}
.nesting-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px; color: #9ca3af; font-size: 14px;
  text-align: center; padding: 20px;
}
.nesting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Уменьшили минимальную ширину карточки */
  gap: 12px;
  align-items: start; /* ЗАПРЕЩАЕТ карточкам растягиваться по высоте друг друга */
}
.nesting-sheet {
  background: #fff; 
  border: 2px solid #e3e5ea; 
  border-radius: 10px;
  padding: 10px; 
  transition: all .15s;
  max-width: 240px; /* Ограничили максимальную ширину карточки */
}
.nesting-sheet:hover {
  border-color: rgba(255,92,26,.5);
  box-shadow: 0 4px 12px -4px rgba(255,92,26,.2);
}
.nesting-sheet-label {
  display: flex; justify-content: space-between;
  font-size: 11px; color: #6b7280; font-weight: 600; margin-bottom: 6px;
}
.nesting-canvas { 
  display: block; 
  width: 100%; 
  height: auto; 
  max-height: 300px; /* Ограничили высоту, чтобы вертикальные листы не вытягивались */
  border-radius: 4px; 
  object-fit: contain; /* Сохраняем пропорции, если высота ограничена */
  margin: 0 auto;
}

.calc-warnings {
  max-width: 1400px; margin: 16px auto;
  display: flex; flex-direction: column; gap: 8px;
}
.calc-warnings:empty { display: none; }
.calc-warning {
  padding: 10px 14px; border-radius: 9px; font-size: 13px;
  line-height: 1.5; display: flex; gap: 10px; align-items: flex-start;
}
.calc-warning.is-warn  { background:#fff7ed; border-left:3px solid #f59e0b; color:#92400e; }
.calc-warning.is-error { background:#fef2f2; border-left:3px solid #dc2626; color:#991b1b; font-weight:600; }
.calc-warning.is-info  { background:#eff6ff; border-left:3px solid #3b82f6; color:#1e40af; }

.calc-comparison { max-width: 1400px; margin: 32px auto 0; }
.calc-section-head { margin-bottom: 16px; }
.calc-section-sub { font-size: 13px; color: #6b7280; margin: 4px 0 0; }
.comparison-table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px -6px rgba(20,23,28,.06);
  border: 1px solid #e3e5ea;
}
.comparison-table th {
  background: #f8f9fb; padding: 12px 14px; text-align: left;
  font-size: 11px; font-weight: 800; color: #6b7280;
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid #e3e5ea;
}
.comparison-table td {
  padding: 12px 14px; border-bottom: 1px solid #f0f1f3;
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.comparison-table th:not(:first-child),
.comparison-table td:not(:first-child) { text-align: right; }
.comparison-table td:nth-child(3) {
  font-variant-numeric: tabular-nums;
}
.comparison-table tr:not(.best) td:nth-child(3):not(:has(span)) {
  color: #6b7280;
}
.comparison-table tr.best { background: #f0fdf4; }
.comparison-table tr.best td:first-child { font-weight: 700; color: #16a34a; }
.comparison-table tr.best td:last-child { font-weight: 800; color: #16a34a; font-size: 14px; }
.comparison-badge {
  display: inline-block; padding: 2px 8px; background: #22c55e;
  color: #fff; font-size: 9px; font-weight: 800; border-radius: 4px;
  margin-left: 8px; letter-spacing: .04em; vertical-align: middle;
}

.walls-breakdown { max-width: 1400px; margin: 32px auto 0; }
.wall-card {
  background: #fff; border: 1px solid #e3e5ea; border-radius: 10px;
  margin-bottom: 8px; overflow: hidden;
}
.wall-card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #fafbfc;
}
.wall-card-name { font-weight: 700; font-size: 13.5px; color: #14171c; }
.wall-card-dim  { color: #6b7280; font-size: 12px; margin-top: 2px; }
.wall-card-body { padding: 12px 16px; border-top: 1px solid #f0f1f3; }
.wall-card-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; font-size: 12.5px; color: #1f2937;
}
.wall-card-row span:first-child { color: #6b7280; }
.wall-card-row span:last-child  { font-weight: 700; }
.wall-openings {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e3e5ea;
}
.wall-opening {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; background: #f8f9fb; border-radius: 6px;
  margin-bottom: 4px; font-size: 12px;
}

.calc-fasteners { padding-top: 12px; border-top: 1px solid #e3e5ea; margin-top: 8px; }

@media (max-width: 768px) {
  .comparison-table { font-size: 11px; }
  .comparison-table th, .comparison-table td { padding: 8px 6px; }
  .nesting-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PDF-loader
   ============================================================ */
@keyframes __proSpin { to { transform: rotate(360deg); } }
.__pro-loader-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(10,12,16,.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.__pro-loader-card {
  background: #fff; border-radius: 16px; padding: 32px 40px;
  text-align: center; max-width: 400px;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,.5);
}
.__pro-loader-spinner {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border: 4px solid #f0f1f3; border-top-color: #ff5c1a;
  border-radius: 50%; animation: __proSpin 0.9s linear infinite;
}
.__pro-loader-title {
  font-size: 16px; font-weight: 800; color: #14171c; margin-bottom: 6px;
}
.__pro-loader-sub {
  font-size: 13px; color: #6b7280; line-height: 1.55;
}

/* ============================================================
   ФИКС ТАБЛИЦЫ СРАВНЕНИЯ НА МОБИЛЬНЫХ
   ============================================================ */
#comparisonBody {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.comparison-table {
  min-width: 580px;   /* ← гарантирует, что все 6 колонок не сожмутся */
}

@media (max-width: 768px) {
  .comparison-table th,
  .comparison-table td {
    padding: 8px 6px;
    font-size: 11px;
  }
  .comparison-table tr.best td:last-child {
    font-size: 12px;
  }
  .comparison-badge {
    font-size: 8px;
    padding: 1px 5px;
    margin-left: 4px;
  }
}