:root {
  --bg: #f3f4f6;
  --sidebar: #ffffff;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  /* Совпадает с основной кнопкой «Начать анализ» (.analyze-setup-submit-btn в теме DS) */
  --accent: #5368e8;
  --accent-hover: #4558d6;
  --success: #059669;
  --error: #ef4444;
  --ds-focus: #7f95ff;
  --ds-focus-ring: 0 0 0 3px rgba(127, 149, 255, 0.35);
  --control-min-height: 48px;
  --transition-interactive: 0.18s ease;
  --transition-panel: 0.22s ease;
}

* {
  box-sizing: border-box;
}

/* Клавиатурный фокус (мышь не подсвечивает лишний раз) */
:focus:not(:focus-visible) {
  outline: none;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
.tab:focus-visible,
.workspace-sidebar-toggle:focus-visible,
.drawer-close:focus-visible,
.cabinet-export-btn:focus-visible {
  outline: 2px solid var(--ds-focus);
  outline-offset: 3px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--ds-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes uiFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes ds-modal-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes ds-modal-dialog-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(14px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes uiPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Обучение / Guided tour —— */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.tour-overlay.hidden {
  display: none;
}

.tour-overlay.tour-overlay--above-modals {
  z-index: 12500;
}

/* Обучение: шаг «чертёж прикреплён» — скрываем крупную кнопку загрузки, показываем блок импорта */
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--tour-drawing-attached
  .analyze-setup-drawing-dropzone {
  display: none;
}

.tour-dimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tour-dimmer-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tour-spotlight {
  position: absolute;
  z-index: 1;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  outline: 2px solid rgba(127, 149, 255, 0.9);
  outline-offset: 2px;
  transition:
    left 0.32s ease,
    top 0.32s ease,
    width 0.32s ease,
    height 0.32s ease,
    border-radius 0.32s ease,
    opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.tour-tooltip {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: 28px;
  width: min(520px, calc(100vw - 56px));
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  padding: 16px 16px 14px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: #111827;
  pointer-events: auto;
  animation: ds-modal-dialog-in 0.22s ease;
}

.tour-tooltip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tour-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.tour-step {
  font-size: 12px;
  color: #6b7280;
  font-weight: 700;
}

.tour-body {
  font-size: 14px;
  line-height: 1.45;
  color: #111827;
  margin-bottom: 12px;
  white-space: pre-line;
}

.tour-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(120deg, #2e2d36, #3a4050, #2f3745, #2e2d36);
  background-size: 300% 300%;
  animation: bgFlow 20s ease-in-out infinite;
  color: var(--text);
  min-height: 100vh;
}

@keyframes bgFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* —— Экран авторизации (макет DesignScroll) —— */
.auth-screen--ds {
  --ds-line: rgba(255, 255, 255, 0.12);
  --ds-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --ds-muted: rgba(247, 248, 251, 0.62);
  --ds-text: #f7f8fb;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 28px;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--ds-text);
  background:
    linear-gradient(120deg, rgba(10, 12, 18, 0.72), rgba(12, 16, 25, 0.92)),
    radial-gradient(circle at top left, rgba(127, 149, 255, 0.26), transparent 36%);
  backdrop-filter: blur(24px);
  animation: uiFadeIn 0.35s ease;
}

.auth-screen--ds.hidden {
  display: none;
}

.auth-card--ds {
  width: min(1020px, 100%);
  min-height: min(650px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border: 1px solid var(--ds-line);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--ds-shadow);
  overflow: hidden;
}

.auth-screen--ds .auth-visual {
  position: relative;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 28% 22%, rgba(185, 199, 255, 0.28), transparent 34%);
}

.auth-screen--ds .auth-visual::after {
  content: "";
  position: absolute;
  inset: 90px -80px auto auto;
  width: min(290px, 55vw);
  height: min(290px, 55vw);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.auth-visual-top {
  position: relative;
  z-index: 1;
}

.auth-visual-org {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-muted);
}

.auth-logo-wordmark {
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.auth-visual-tagline {
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ds-muted);
}

.auth-screen--ds .auth-claim {
  max-width: 510px;
  position: relative;
  z-index: 1;
}

.auth-claim-title {
  margin: 0 0 18px;
  font-size: clamp(32px, 4.5vw, 54px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  font-weight: 800;
}

.auth-claim-text {
  margin: 0;
  color: var(--ds-muted);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.65;
}

.auth-screen--ds .auth-panel {
  padding: 44px;
  background: rgba(255, 255, 255, 0.94);
  color: #141722;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
}

/* Правая колонка как в DesignNextUp.html */
.auth-screen--ds .auth-panel--nextup {
  gap: 20px;
}

.auth-panel-title {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.auth-screen--ds .auth-panel--nextup .auth-panel-title {
  font-size: 29px;
  letter-spacing: -0.045em;
  transition:
    opacity 0.28s ease,
    transform 0.36s cubic-bezier(0.33, 1, 0.68, 1);
}

.auth-panel-desc {
  margin: 0;
  color: #697083;
  font-size: 15px;
  line-height: 1.55;
}

.auth-screen--ds .auth-panel--nextup .auth-panel-desc {
  margin: -6px 0 0;
  line-height: 1.6;
  transition:
    opacity 0.28s ease,
    transform 0.36s cubic-bezier(0.33, 1, 0.68, 1);
}

.auth-login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-field-stack {
  display: grid;
  gap: 12px;
}

.auth-forms-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.auth-form-pane {
  grid-area: 1 / 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(10px) scale(0.992);
  pointer-events: none;
  transition:
    opacity 0.38s cubic-bezier(0.33, 1, 0.68, 1),
    transform 0.42s cubic-bezier(0.32, 0.72, 0, 1);
}

.auth-form-pane--active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  z-index: 1;
}

.auth-form-pane:not(.auth-form-pane--active) {
  z-index: 0;
}

.auth-screen--ds .auth-panel--nextup .admin-entry {
  align-self: center;
  margin-top: 2px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: #9aa1af;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: color 0.25s ease;
}

.auth-screen--ds .auth-panel--nextup .admin-entry:hover {
  color: #697083;
}

.auth-screen--ds .auth-field-grid {
  display: grid;
  gap: 12px;
}

.auth-screen--ds .auth-field {
  display: grid;
  gap: 8px;
  color: #697083;
  font-size: 13px;
  font-weight: 700;
}

.auth-screen--ds .auth-field input {
  width: 100%;
  min-height: var(--control-min-height);
  border: 1px solid #dce1eb;
  border-radius: 16px;
  padding: 12px 16px;
  color: #141722;
  background: #ffffff;
  outline: none;
  transition:
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    background-color var(--transition-interactive);
  font-size: 15px;
}

.auth-screen--ds .auth-field input:hover {
  border-color: #c5cce0;
}

.auth-screen--ds .auth-field input:focus-visible {
  border-color: var(--ds-focus);
}

.auth-screen--ds .primary-btn.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: linear-gradient(135deg, #151a27, #5368e8);
  box-shadow: 0 18px 36px rgba(83, 104, 232, 0.26);
  transition:
    transform var(--transition-interactive),
    box-shadow var(--transition-panel),
    filter var(--transition-interactive);
}

.auth-screen--ds .primary-btn.auth-submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.auth-screen--ds .primary-btn.auth-submit:focus-visible {
  outline: 2px solid #f0f4ff;
  outline-offset: 3px;
}

.auth-screen--ds .auth-error {
  min-height: 22px;
  margin: 0 !important;
  padding: 0 4px;
  color: #c62828 !important;
  text-align: center !important;
  font-weight: 700;
  font-size: 13px;
}

@media (max-width: 1060px) {
  .auth-card--ds {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .auth-screen--ds .auth-visual {
    min-height: 220px;
    padding: 28px 26px;
  }

  .auth-screen--ds .auth-panel {
    padding: 28px 26px;
  }

  .auth-screen--ds .auth-visual::after {
    inset: auto -40px -60px auto;
    opacity: 0.55;
  }
}

@media (max-width: 760px) {
  .auth-screen--ds {
    align-items: flex-start;
    overflow-y: auto;
    place-items: start center;
    padding: 14px;
  }

  .auth-card--ds {
    margin: auto 0;
    border-radius: 28px;
  }

  .auth-screen--ds .auth-visual,
  .auth-screen--ds .auth-panel {
    padding: 22px 18px;
  }
}

@media (max-width: 400px) {
  .auth-screen--ds {
    padding: 10px;
  }

  .auth-card--ds {
    border-radius: 22px;
  }
}

/* Промежуточный экран после входа (макет DesignScroll) */
.post-auth--ds {
  --pa-line: rgba(255, 255, 255, 0.12);
  --pa-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --pa-text: #f7f8fb;
  --pa-muted: rgba(247, 248, 251, 0.62);
  --pa-panel: rgba(255, 255, 255, 0.08);
  min-height: 100vh;
  padding: 22px;
  box-sizing: border-box;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--pa-text);
  background:
    radial-gradient(circle at 12% 8%, rgba(127, 149, 255, 0.22), transparent 34%),
    radial-gradient(circle at 78% 12%, rgba(137, 230, 194, 0.12), transparent 28%),
    linear-gradient(135deg, #090b10 0%, #121722 48%, #0c1019 100%);
  animation: uiFadeIn 0.35s ease;
}

/* Личный кабинет по кнопке с именем в шапке */
.user-profile-modal-overlay .user-profile-modal-dialog.user-profile-modal-dialog {
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  max-height: min(92vh, 900px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.user-profile-modal-overlay .user-profile-modal-surface.post-auth--ds {
  min-height: 0;
  padding: 18px 20px 22px;
  background: transparent;
  background-image: none;
  box-shadow: none;
  animation: none;
}

.cabinet-head--with-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.cabinet-head--with-actions .workspace-btn {
  flex-shrink: 0;
}

button.workspace-user-chip {
  appearance: none;
  margin: 0;
}

button.workspace-user-chip.workspace-user-chip--ds {
  cursor: pointer;
  font: inherit;
  line-height: 1.25;
  text-align: center;
}

.post-auth-frame--ds {
  max-width: 1220px;
  margin: 0 auto;
  min-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pa-line);
  border-radius: var(--radius-xl, 34px);
  background: rgba(19, 24, 36, 0.92);
  box-shadow: var(--pa-shadow);
  overflow-x: hidden;
  overflow-y: auto;
}

.post-auth-head--ds {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--pa-line);
  background: rgba(255, 255, 255, 0.06);
}

.post-auth-muted {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pa-muted);
}

.post-auth-meta {
  justify-self: end;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--pa-muted);
  line-height: 1.55;
}

.post-auth-brand {
  text-align: center;
}

.post-auth-title--ds {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--pa-text);
  line-height: 1.05;
}

.post-auth-sub--ds {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--pa-muted);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 8px 0 4px;
  border-radius: 50%;
  background: #6fe0a1;
  box-shadow: 0 0 14px rgba(111, 224, 161, 0.95);
  filter: blur(0.8px);
  vertical-align: middle;
}

.post-auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 28px 36px;
  min-height: 0;
}

.post-auth-centered-wrap {
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
}

.landing-intro--ds {
  text-align: center;
}

.landing-intro--ds p {
  margin: 0 0 14px;
  color: var(--pa-muted);
  font-size: clamp(15px, 1.55vw, 17px);
  line-height: 1.65;
}

.landing-intro--ds p:last-child {
  margin-bottom: 0;
}

.cabinet-card--ds {
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--pa-line);
  background: rgba(20, 24, 35, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.cabinet-head--ds {
  margin-bottom: 14px;
}

.cabinet-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--pa-text);
}

.cabinet-subtitle {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--pa-muted);
}

.dashboard-grid--ds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dash-card--ds {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--pa-line);
}

.dash-card--ds span {
  display: block;
  color: var(--pa-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dash-card--ds strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--pa-text);
}

.cabinet-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.cabinet-profile-field {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--pa-line);
}

.cabinet-profile-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pa-muted);
}

.cabinet-profile-field strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--pa-text);
  line-height: 1.35;
  word-break: break-word;
}

.cabinet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cabinet-export-btn {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 13px;
  color: var(--pa-text);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid var(--pa-line);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cabinet-export-btn:hover {
  transform: translateY(-1px);
}

.post-auth-actions--ds {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-top: 6px;
}

.post-auth--ds .primary-btn.landing-analyze-btn {
  width: 100%;
  min-height: 52px;
  padding: 16px 20px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #ffffff;
  background: linear-gradient(135deg, #151a27, #5368e8);
  box-shadow: 0 18px 36px rgba(83, 104, 232, 0.26);
  transition:
    transform var(--transition-interactive),
    box-shadow var(--transition-panel),
    filter var(--transition-interactive);
}

.post-auth--ds .primary-btn.landing-analyze-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.post-auth--ds .primary-btn.landing-analyze-btn:focus-visible {
  outline-offset: 3px;
  box-shadow: 0 18px 36px rgba(83, 104, 232, 0.35), var(--ds-focus-ring);
}

.post-auth--ds .secondary-btn.landing-support-btn {
  width: 100%;
  min-height: 48px;
  padding: 14px 18px;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--pa-text);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid var(--pa-line);
  transition:
    transform var(--transition-interactive),
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    filter var(--transition-interactive);
}

.post-auth--ds .secondary-btn.landing-support-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
}

.post-auth--ds .secondary-btn.landing-support-btn:focus-visible {
  outline-offset: 3px;
}

.post-auth--ds .ghost-btn.landing-logout-btn {
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  color: var(--pa-muted);
  background: transparent;
  border: 1px solid var(--pa-line);
  transition:
    color var(--transition-interactive),
    border-color var(--transition-interactive),
    background-color var(--transition-interactive),
    transform var(--transition-interactive);
}

.post-auth--ds .ghost-btn.landing-logout-btn:hover {
  color: var(--pa-text);
  border-color: rgba(127, 149, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.post-auth--ds .ghost-btn.landing-logout-btn:focus-visible {
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .post-auth-actions--ds {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .post-auth-actions--ds .primary-btn.landing-analyze-btn,
  .post-auth-actions--ds .secondary-btn.landing-support-btn,
  .post-auth-actions--ds .ghost-btn.landing-logout-btn {
    flex: 1;
    min-width: 160px;
  }

  .dashboard-grid--ds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cabinet-profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .post-auth-head--ds {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .post-auth-meta {
    justify-self: center;
    text-align: center;
  }

  .post-auth--ds {
    padding: 14px;
  }

  .post-auth-frame--ds {
    border-radius: 26px;
  }
}

@media (max-width: 480px) {
  .post-auth-actions--ds {
    flex-direction: column;
  }

  .post-auth-actions--ds .primary-btn.landing-analyze-btn,
  .post-auth-actions--ds .secondary-btn.landing-support-btn,
  .post-auth-actions--ds .ghost-btn.landing-logout-btn {
    flex: none;
    width: 100%;
    min-width: 0;
  }

  .dashboard-grid--ds {
    grid-template-columns: 1fr;
  }
}

.layout {
  display: block;
  min-height: 100vh;
  padding: 18px;
  background: rgba(46, 45, 54, 0.45);
  backdrop-filter: blur(9px);
  animation: uiFadeIn 0.3s ease;
}

.layout.layout--ds {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  background:
    radial-gradient(circle at 12% 8%, rgba(127, 149, 255, 0.18), transparent 34%),
    radial-gradient(circle at 78% 12%, rgba(137, 230, 194, 0.1), transparent 28%),
    linear-gradient(135deg, #090b10 0%, #121722 48%, #0c1019 100%);
}

/* Рабочая область: цепочка высоты от viewport до main */
body:has(#appLayout:not(.hidden)) {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0;
  box-sizing: border-box;
}

#appLayout:not(.hidden) {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#appLayout:not(.hidden) > .layout.layout--ds {
  flex: 1 1 0;
  min-height: 0;
}

.workspace-frame {
  min-height: calc(100vh - 36px);
  border: none;
  border-radius: 30px;
  background: #f2f4f7;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 34px rgba(6, 8, 13, 0.35);
}

.workspace-frame.workspace-frame--ds {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl, 34px);
  background: rgba(19, 24, 36, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.layout.layout--ds .workspace-frame.workspace-frame--ds {
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  max-height: none;
}

.workspace-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 20px 26px 14px;
  background: #f2f4f7;
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  border-bottom: 1px solid rgba(50, 56, 67, 0.25);
}

.workspace-head.workspace-head--ds {
  padding: 18px 22px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-top-left-radius: var(--radius-xl, 34px);
  border-top-right-radius: var(--radius-xl, 34px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.workspace-org {
  font-size: 14px;
  color: #2f3239;
}

.workspace-org.workspace-org--ds {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(247, 248, 251, 0.62);
}

.workspace-brand {
  text-align: center;
}

.workspace-brand-title {
  font-size: 40px;
  font-weight: 700;
  color: #1f242d;
}

.workspace-brand-title.workspace-brand-title--ds {
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f7f8fb;
}

.workspace-brand-sub {
  font-size: 14px;
  color: #2f3239;
}

.workspace-brand-sub.workspace-brand-sub--ds {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(247, 248, 251, 0.62);
}

.workspace-connection {
  justify-self: end;
  color: #2f3239;
  font-size: 13px;
}

.workspace-connection.workspace-connection--ds {
  color: rgba(247, 248, 251, 0.72);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
  text-align: right;
}

.workspace-meta-chips {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workspace-quota-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid rgba(127, 149, 255, 0.35);
  background: rgba(127, 149, 255, 0.12);
  color: #f7f8fb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.workspace-quota-chip.workspace-quota-warn {
  border-color: rgba(83, 104, 232, 0.55);
  background: rgba(83, 104, 232, 0.16);
  color: #dbeafe;
}

.workspace-user-chip {
  margin-top: 6px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 10px;
  border: 1px solid rgba(70, 74, 83, 0.34);
  background: #e8edf4;
}

.workspace-user-chip.workspace-user-chip--ds {
  margin-top: 0;
  padding: 6px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f8fb;
  font-size: 12px;
  font-weight: 700;
}

#quotaDetails.quota-warn {
  color: #2563eb;
  font-weight: 800;
}

.workspace-body {
  display: block;
  padding: 14px 14px 18px;
  min-height: 0;
  flex: 1;
  position: relative;
  background: #404652;
  border-radius: 14px;
  --tools-lane-width: 220px;
  --tools-panel-width: 146px;
}

.workspace-frame.workspace-frame--ds .workspace-body {
  background: linear-gradient(180deg, rgba(9, 11, 16, 0.5) 0%, rgba(18, 23, 34, 0.92) 28%);
  border-radius: 0 0 calc(var(--radius-xl, 34px) - 2px) calc(var(--radius-xl, 34px) - 2px);
}

.layout.layout--ds .workspace-body {
  --sidebar-expanded: 286px;
  --sidebar-collapsed: 78px;
  --sidebar-line: rgba(255, 255, 255, 0.12);
  --sidebar-panel-strong: rgba(255, 255, 255, 0.13);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  align-content: stretch;
  column-gap: 0;
  /* padding-top: 0 — левая панель визуально стыкуется с нижним краем шапки */
  padding: 0 14px 18px 0;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.layout.layout--ds .workspace-body:has(#workspaceMainIdle:not(.hidden)),
.layout.layout--ds .workspace-body:has(#workspaceAnalysisShell:not(.hidden)) {
  padding: 0 10px 10px 0;
}

.layout.layout--ds .workspace-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #f7f8fb;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  transition:
    filter var(--transition-interactive),
    border-color var(--transition-interactive),
    background-color var(--transition-interactive),
    transform var(--transition-interactive);
}

.layout.layout--ds .workspace-btn:hover {
  filter: brightness(1.08);
}

.layout.layout--ds .workspace-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
}

.layout.layout--ds .workspace-mini-btn,
.layout.layout--ds .workspace-inline-btn,
.layout.layout--ds .workspace-support-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #f7f8fb;
  transition:
    filter var(--transition-interactive),
    border-color var(--transition-interactive),
    background-color var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

/* —— Рабочая область: панели DesignScroll (контент, этап 4) —— */
.layout.layout--ds .workspace-head.workspace-head--ds {
  gap: 14px;
  padding: 20px 24px 18px;
  flex-shrink: 0;
}

.layout.layout--ds .workspace-main {
  margin-left: 0;
}

.layout.layout--ds .workspace-main.workspace-main--ds {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 20px 18px 14px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  overflow: auto;
}

/* Экран ввода и экран анализа: одинаковые отступы main, без внешнего скролла — две колонки заполняют высоту */
.layout.layout--ds .workspace-main.workspace-main--ds:has(#workspaceMainIdle:not(.hidden)),
.layout.layout--ds .workspace-main.workspace-main--ds:has(#workspaceAnalysisShell:not(.hidden)) {
  overflow: hidden;
  gap: 0;
  padding: 6px 10px 8px 8px;
}

.layout.layout--ds .workspace-analysis-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 0;
  min-height: 0;
}

.layout.layout--ds .workspace-analysis-shell .workspace-progress-region {
  flex-shrink: 0;
}

.layout.layout--ds .workspace-analysis-shell.hidden {
  display: none;
}

.layout.layout--ds .workspace-main-idle {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 4px 6px 6px;
  overflow: hidden;
}

.layout.layout--ds .workspace-main-idle.hidden {
  display: none;
}

.layout.layout--ds .workspace-main-idle .workspace-idle-body,
.layout.layout--ds .workspace-main-idle .workspace-analyze-setup-root {
  height: 100%;
}

.workspace-idle-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  align-self: stretch;
  gap: 0;
}

.workspace-analyze-setup-root {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.analyze-setup-dialog--idle-inline {
  width: 100%;
  max-width: none;
  max-height: none;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
}

.analyze-setup-shell--split5050 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-forms-column {
  overflow-y: auto;
}

.workspace-idle-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 20px;
  flex-shrink: 0;
  padding-top: 2px;
}

.layout.layout--ds .workspace-main-idle-actions.post-auth-actions--ds {
  margin-top: 0;
}

@media (max-width: 960px) {
  .analyze-setup-shell--split5050:not(.analyze-setup-shell--ds-hero) {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

  .layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell.analyze-setup-shell--ds-hero.analyze-setup-shell--split5050 {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  .layout.layout--ds .workspace-analyze-setup-root .analyze-setup-submit-wrap--grid-span {
    grid-column: 1;
    grid-row: 3;
  }
}

/* DesignScroll_new.html: hero — glass «intro-card» + светлый «blueprint-card» с полем чертежа */
.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell.analyze-setup-shell--ds-hero.analyze-setup-shell--split5050 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(8px, 1.2vw, 14px);
  column-gap: clamp(8px, 1.2vw, 14px);
  row-gap: clamp(6px, 1vh, 12px);
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  align-content: stretch;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--ds-hero > .analyze-setup-forms-column,
.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--ds-hero > .analyze-setup-preview-column {
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  align-self: stretch;
  height: auto;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-submit-wrap--grid-span {
  grid-column: 1 / -1;
  grid-row: 2;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
  transition:
    max-height 0.78s cubic-bezier(0.18, 0.82, 0.25, 1),
    opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    padding-block 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell.analyze-setup-shell--ds-hero.analyze-setup-shell--setup-expanded .analyze-setup-submit-wrap--grid-span {
  max-height: 140px;
  opacity: 1;
  pointer-events: auto;
  padding: clamp(4px, 0.8vh, 10px) 0 clamp(2px, 0.5vh, 6px);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog.analyze-setup-dialog--idle-inline {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-forms-column.ds-intro-card {
  --intro-card-pad-x: clamp(12px, 1.5vw, 18px);
  --intro-card-pad-y: clamp(12px, 1.8vh, 18px);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  align-self: stretch;
  height: 100%;
  max-height: 100%;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  padding: var(--intro-card-pad-y) var(--intro-card-pad-x);
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

/* Заголовок по вертикали посередине между верхом панели и верхом блока с «Изображение чертежа» */
.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-head-gap {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tail-spacer {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  pointer-events: none;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-intro-stack {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  flex: 0 1 auto;
  gap: clamp(6px, 1.1vh, 12px);
}

/* Обёртка зоны «прикрепите чертёж»; в фазе ожидания — крупная активная полупрозрачная площадка */
.analyze-setup-drawing-dropzone {
  position: relative;
  width: 100%;
  pointer-events: none;
  cursor: default;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-drawing-dropzone #setupDrawingBtn,
.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-drawing-dropzone .analyze-setup-attached-list,
.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-drawing-dropzone .analyze-setup-attached-remove {
  pointer-events: auto;
}

.analyze-setup-drawing-dropzone__shimmer {
  display: none;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell:not(.analyze-setup-shell--drawing-wait)
  .analyze-setup-drawing-dropzone {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: default;
  min-height: 0;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell:not(.analyze-setup-shell--drawing-wait)
  .analyze-setup-drawing-dropzone__shimmer {
  display: none !important;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-drawing-dropzone {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: min(52vh, 440px);
  margin: clamp(6px, 1.5vh, 16px) 0;
  padding: clamp(28px, 5vh, 56px) clamp(18px, 3.5vw, 40px);
  border-radius: clamp(22px, 2.8vw, 34px);
  border: 1px solid rgba(127, 149, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
  cursor: default;
  overflow: hidden;
  isolation: isolate;
  transition:
    border-color 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease,
    opacity 0.45s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-drawing-dropzone:hover {
  border-color: rgba(127, 149, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-drawing-dropzone #setupDrawingBtn:hover:not(:disabled):not(.is-disabled) {
  border-color: rgba(160, 180, 255, 0.55);
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-drawing-dropzone:has(#setupDrawingBtn:disabled),
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-drawing-dropzone:has(#setupDrawingBtn.is-disabled) {
  cursor: not-allowed;
  opacity: 0.78;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-drawing-dropzone:has(#setupDrawingBtn:disabled):hover,
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-drawing-dropzone:has(#setupDrawingBtn.is-disabled):hover {
  border-color: rgba(127, 149, 255, 0.35);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-drawing-dropzone
  .analyze-setup-required--primary {
  position: relative;
  z-index: 1;
}

/* Плавное исчезновение заголовка и зоны кнопки перед показом формы */
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-head-gap {
  transition:
    opacity 0.42s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.42s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait.analyze-setup-shell--drawing-hero-out
  .analyze-setup-drawing-dropzone {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait.analyze-setup-shell--drawing-hero-out
  .analyze-setup-head-gap {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

@keyframes analyzeSetupPrimaryReveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-primary--enter-animate:not(.analyze-setup-primary--hero) {
  animation: analyzeSetupPrimaryReveal 0.58s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

/* Фаза до прикрепления чертежа: заголовок сверху по центру колонки, крупная кнопка, без «Сбросить» и без нижнего спейсера */
.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--drawing-wait .analyze-setup-tail-spacer {
  display: none;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--drawing-wait .analyze-setup-reset-strip {
  display: none;
}

/* Скрываем без display:none — при смене на expanded тот же grid, без рывка пересборки дерева.
   Важно: цепочка с .ds-intro-card, иначе ниже общее правило .ds-intro-card .analyze-setup-deferred перебивает по порядку каскада. */
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .ds-intro-card
  .analyze-setup-deferred {
  display: grid;
  grid-template-rows: 0fr;
  min-height: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  border: none;
  transition: none;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--drawing-wait .analyze-setup-head-gap {
  flex: 0 0 auto;
  min-height: 0;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(6px, 1.6vh, 18px);
  padding-bottom: clamp(4px, 1vh, 12px);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--drawing-wait .analyze-setup-head-gap .analyze-setup-head {
  justify-content: center;
  width: 100%;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--drawing-wait .analyze-setup-head-gap .analyze-setup-head h2 {
  width: 100%;
  text-align: center;
  font-size: clamp(20px, 2.45vw, 31px);
  letter-spacing: -0.055em;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--drawing-wait .analyze-setup-intro-stack {
  flex: 1 1 0;
  min-height: 0;
  justify-content: center;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--drawing-wait .analyze-setup-required--primary.analyze-setup-primary--hero {
  margin-top: 0;
}

/* Фаза «только чертёж»: одна центральная карточка фиксированной ширины + полноширинная кнопка (пропорции em, без «узкой таблетки») */
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-primary--hero
  .analyze-setup-tile.analyze-setup-tile--drawing-hero {
  width: min(440px, 92%);
  max-width: 100%;
  margin-inline: auto;
  padding: clamp(14px, 2vh, 20px) clamp(14px, 2.2vw, 22px);
  gap: clamp(8px, 1.2vh, 12px);
  border-radius: clamp(18px, 2.2vw, 26px);
  border: 1px solid rgba(127, 149, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-primary--hero
  .analyze-setup-tile.analyze-setup-tile--drawing-hero
  .analyze-setup-tooltip-host--drawing-centered {
  align-items: stretch;
  width: 100%;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-primary--hero
  .analyze-setup-tile.analyze-setup-tile--drawing-hero
  .analyze-setup-file-block {
  width: 100%;
  text-align: center;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-primary--hero
  .analyze-setup-tile.analyze-setup-tile--drawing-hero
  .analyze-setup-file {
  margin-top: clamp(4px, 0.7vh, 8px);
  font-size: clamp(11px, 1.35vw, 13px);
  font-weight: 600;
  color: rgba(247, 248, 251, 0.72);
}

/* Кнопка внутри shell (диалог — родитель shell в разметке, не потомок) */
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-btn.analyze-setup-btn--drawing-primary {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  white-space: normal;
  /* +0.5 к текущему размеру: ×1.5 к «половинному» базовому блоку */
  font-size: clamp(1rem, calc((3.8vw / 1.5 + 0.33rem) * 0.75), 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  min-height: 2em;
  min-width: 0;
  padding: calc(0.88em / 2) calc(1em / 2);
  border-radius: calc(0.42em / 2);
  background: linear-gradient(90deg, #121725 0%, #2a3f9e 42%, #5368e8 72%, #6380ff 100%);
  box-shadow:
    0 calc(0.65em / 2) calc(1.35em / 2) rgba(83, 104, 232, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  /* transform/filter не в transition — иначе конфликт с @keyframes и рывки */
  transition:
    min-height 0.58s cubic-bezier(0.33, 1, 0.68, 1),
    padding 0.58s cubic-bezier(0.33, 1, 0.68, 1),
    border-radius 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    font-size 0.48s cubic-bezier(0.33, 1, 0.68, 1),
    box-shadow var(--transition-interactive);
  transform: translateZ(0);
  will-change: transform;
  /* Только scale на GPU — без box-shadow/filter в анимации (они дают лаги и «прерывания») */
  animation: analyzeDrawingPrimaryAwait 3.6s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-btn.analyze-setup-btn--drawing-primary:hover:not(:disabled) {
  animation: none;
  will-change: auto;
  box-shadow:
    0 calc(0.78em / 2) calc(1.55em / 2) rgba(83, 104, 232, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-btn.analyze-setup-btn--drawing-primary:disabled,
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-btn.analyze-setup-btn--drawing-primary.is-disabled {
  animation: none;
}

@keyframes analyzeDrawingPrimaryAwait {
  0% {
    transform: translateZ(0) scale3d(1, 1, 1);
  }
  100% {
    transform: translateZ(0) scale3d(1.008, 1.008, 1);
  }
}

/* После выбора файла: сначала уменьшается кнопка, затем открывается блок — «Сбросить» только вместе с раскрытием */
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--expanded:not(.analyze-setup-shell--setup-expanded)
  .analyze-setup-reset-strip {
  display: none;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--expanded:not(.analyze-setup-shell--drawing-wait):not(.analyze-setup-shell--setup-expanded)
  .analyze-setup-head-gap {
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: flex-start;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-shell--setup-expanded .analyze-setup-head-gap {
  flex: 1 1 0;
  min-height: 0;
  align-items: center;
  justify-content: flex-start;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--expanded:not(.analyze-setup-shell--drawing-wait)
  .analyze-setup-head-gap
  .analyze-setup-head
  h2 {
  text-align: left;
  font-size: clamp(22px, 2.4vw, 34px);
  letter-spacing: -0.06em;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--expanded:not(.analyze-setup-shell--drawing-wait)
  .analyze-setup-intro-stack {
  flex: 0 1 auto;
  justify-content: flex-start;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-forms-column.ds-intro-card::before {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(127, 149, 255, 0.18);
  filter: blur(4px);
  pointer-events: none;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card > * {
  position: relative;
  z-index: 1;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-head-gap .analyze-setup-head {
  width: 100%;
  margin: 0;
  justify-content: flex-start;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-head-gap .analyze-setup-head h2 {
  margin: 0;
  text-align: left;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-head h2 {
  font-size: clamp(18px, 1.95vw, 27px);
  letter-spacing: -0.06em;
  line-height: 1.05;
  color: #f7f8fb;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-note {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(247, 248, 251, 0.62);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-group-title {
  color: rgba(247, 248, 251, 0.92);
}

/* Раскрытая форма: подсказки поверх контента, без сдвига макета и без внутреннего скролла */
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--setup-expanded
  .analyze-setup-forms-column.ds-intro-card,
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--setup-expanded
  .analyze-setup-intro-stack,
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--setup-expanded
  .ds-intro-card
  .analyze-setup-deferred,
.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--setup-expanded
  .ds-intro-card
  .analyze-setup-extra {
  overflow: visible;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  transition:
    padding 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    gap 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    border-radius 0.35s ease;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-file {
  margin-top: 0;
  color: rgba(247, 248, 251, 0.58);
  transition:
    font-size 0.4s ease,
    margin-top 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-file-block {
  margin-top: clamp(4px, 0.8vh, 8px);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-attached-item {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-attached-name {
  color: rgba(247, 248, 251, 0.92);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-attached-remove {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 248, 251, 0.82);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-attached-remove:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-cad-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-counter {
  border-color: rgba(83, 104, 232, 0.55);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-lock-hint {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(247, 248, 251, 0.88);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-required--primary {
  position: relative;
  z-index: 8;
  margin-top: 0;
  transition:
    margin-top 0.48s cubic-bezier(0.33, 1, 0.68, 1),
    gap 0.48s cubic-bezier(0.33, 1, 0.68, 1);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-required--primary.analyze-setup-primary--hero {
  margin-top: clamp(22px, 4.5vh, 52px);
  gap: clamp(12px, 2vh, 22px);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-primary--hero .analyze-setup-tile {
  padding: clamp(14px, 2.2vh, 22px) clamp(16px, 2.4vw, 24px);
  gap: clamp(8px, 1.3vh, 14px);
  border-radius: clamp(14px, 1.8vw, 20px);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-btn {
  transition:
    min-height 0.48s cubic-bezier(0.33, 1, 0.68, 1),
    font-size 0.4s ease,
    padding 0.48s cubic-bezier(0.33, 1, 0.68, 1),
    border-radius 0.36s ease,
    filter var(--transition-interactive),
    border-color var(--transition-interactive),
    background-color var(--transition-interactive),
    transform var(--transition-interactive);
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-primary--hero
  .analyze-setup-btn:not(.analyze-setup-btn--drawing-primary) {
  min-height: clamp(52px, 7.5vh, 80px);
  font-size: clamp(14px, 1.9vw, 18px);
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-primary--hero .analyze-setup-file {
  margin-top: clamp(6px, 1vh, 10px);
  font-size: clamp(11px, 1.35vw, 13px);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-required--drawing-centered {
  gap: 0;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tile--drawing-hero {
  border: 1px dashed rgba(127, 149, 255, 0.38);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
}

/* Главный шаг: как «Начать анализ» по шрифту (inherit / 700), крупнее вторичных кнопок (12px) и основного CTA (15px) */
.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog .analyze-setup-btn--drawing-primary {
  min-width: min(320px, 100%);
  min-height: clamp(56px, 9vh, 88px);
  padding: 18px 32px;
  border-radius: 18px;
  border: 0;
  font-family: inherit;
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 700;
  letter-spacing: normal;
  line-height: 1.25;
  background: linear-gradient(135deg, #151a27, #5368e8);
  color: #f7f8fb;
  box-shadow:
    0 18px 36px rgba(83, 104, 232, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    min-height 0.58s cubic-bezier(0.33, 1, 0.68, 1),
    min-width 0.58s cubic-bezier(0.33, 1, 0.68, 1),
    padding 0.58s cubic-bezier(0.33, 1, 0.68, 1),
    border-radius 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    font-size 0.48s cubic-bezier(0.33, 1, 0.68, 1),
    transform var(--transition-interactive),
    filter var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog .analyze-setup-btn--drawing-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog .analyze-setup-btn--drawing-primary:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.98);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog .analyze-setup-btn--drawing-primary.is-disabled,
.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog .analyze-setup-btn--drawing-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--drawing-wait
  .analyze-setup-btn.analyze-setup-btn--drawing-primary:active:not(:disabled) {
  animation: none;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tooltip-host {
  position: relative;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tooltip-host--narrow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  isolation: isolate;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tooltip-host--drawing-centered {
  align-items: stretch;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tooltip-host--narrow:hover:not(.analyze-setup-tooltip-host--suppress),
.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tooltip-host--narrow:focus-within:not(.analyze-setup-tooltip-host--suppress) {
  z-index: 50;
}

/* Поднять flex-строку над соседями — иначе фон подсказки уходит под «Дополнительные параметры» */
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-ai-row:has(.analyze-setup-tooltip-host--narrow:hover:not(.analyze-setup-tooltip-host--suppress)),
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-ai-row:has(.analyze-setup-tooltip-host--narrow:focus-within:not(.analyze-setup-tooltip-host--suppress)),
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-reset-strip:has(.analyze-setup-tooltip-host--narrow:hover:not(.analyze-setup-tooltip-host--suppress)),
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-reset-strip:has(.analyze-setup-tooltip-host--narrow:focus-within:not(.analyze-setup-tooltip-host--suppress)),
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-extra:has(.analyze-setup-tooltip-host--narrow:hover:not(.analyze-setup-tooltip-host--suppress)),
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-extra:has(.analyze-setup-tooltip-host--narrow:focus-within:not(.analyze-setup-tooltip-host--suppress)) {
  position: relative;
  z-index: 55;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .analyze-setup-shell--ui-animating
  .ds-intro-card
  .analyze-setup-hint-tooltip {
  visibility: hidden !important;
  transform: translateY(-4px) !important;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-hint-tooltip {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  bottom: auto;
  z-index: 60;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  color: #f4f6fb;
  background-color: #05060a;
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  mix-blend-mode: normal;
  opacity: 1;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    visibility 0.22s ease,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  word-wrap: break-word;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tooltip-host--narrow:hover:not(.analyze-setup-tooltip-host--suppress) .analyze-setup-hint-tooltip,
.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tooltip-host--narrow:focus-within:not(.analyze-setup-tooltip-host--suppress) .analyze-setup-hint-tooltip {
  visibility: visible;
  transform: translateY(0);
  background-color: #05060a;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-note.analyze-setup-hint-tooltip {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  color: #f4f6fb;
  background-color: #05060a;
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 1;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-tooltip-host--preview-zoom {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-tooltip-host--preview-zoom .ds-drawing-zoom {
  pointer-events: auto;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-tooltip-host--preview-zoom:hover,
.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-tooltip-host--preview-zoom:focus-within {
  z-index: 8;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-tooltip-host--preview-zoom .analyze-setup-hint-tooltip--light {
  top: auto;
  bottom: 52px;
  left: 10px;
  right: 10px;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-hint-tooltip--light {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  z-index: 2;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  color: #12151d;
  background-color: #eef1f8;
  background-image: linear-gradient(180deg, #fafbfd 0%, #e6eaf3 100%);
  border: 1px solid rgba(21, 25, 37, 0.2);
  box-shadow: 0 18px 42px rgba(15, 18, 28, 0.28);
  mix-blend-mode: normal;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.22s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    visibility 0.22s ease,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  word-wrap: break-word;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-tooltip-host--preview-zoom:hover .analyze-setup-hint-tooltip--light,
.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-tooltip-host--preview-zoom:focus-within .analyze-setup-hint-tooltip--light {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@keyframes analyzeSetupDeferredRowIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-deferred {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-rows: 0fr;
  transition:
    grid-template-rows 0.52s cubic-bezier(0.25, 0.1, 0.25, 1),
    opacity 0.42s cubic-bezier(0.25, 0.1, 0.25, 1),
    visibility 0s linear 0.52s;
  opacity: 0;
  visibility: hidden;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-deferred.analyze-setup-deferred--open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition:
    grid-template-rows 0.52s cubic-bezier(0.25, 0.1, 0.25, 1),
    opacity 0.42s cubic-bezier(0.25, 0.1, 0.25, 1),
    visibility 0s linear 0s;
  overflow: visible;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-deferred-inner {
  overflow: hidden;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.1vh, 12px);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-deferred.analyze-setup-deferred--open .analyze-setup-deferred-inner {
  padding-top: clamp(6px, 1vh, 12px);
  overflow: visible;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > * {
  opacity: 0;
  animation: analyzeSetupDeferredRowIn 0.52s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(1) {
  animation-delay: 0.05s;
}
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(2) {
  animation-delay: 0.09s;
}
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(3) {
  animation-delay: 0.13s;
}
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(4) {
  animation-delay: 0.17s;
}
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(5) {
  animation-delay: 0.21s;
}
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(6) {
  animation-delay: 0.25s;
}
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(7) {
  animation-delay: 0.29s;
}
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(8) {
  animation-delay: 0.33s;
}
.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred.analyze-setup-deferred--open
  .analyze-setup-deferred-inner
  > *:nth-child(n + 9) {
  animation-delay: 0.37s;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-deferred:not(.analyze-setup-deferred--open) .analyze-setup-deferred-inner {
  pointer-events: none;
  animation: none;
}

.layout.layout--ds
  .workspace-analyze-setup-root
  .ds-intro-card
  .analyze-setup-deferred:not(.analyze-setup-deferred--open)
  .analyze-setup-deferred-inner
  > * {
  animation: none;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .layout.layout--ds
    .workspace-analyze-setup-root
    .analyze-setup-shell--drawing-wait
    .analyze-setup-drawing-dropzone {
    transition: none;
  }

  .layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-deferred,
  .layout.layout--ds .workspace-analyze-setup-root .analyze-setup-submit-wrap--grid-span {
    transition: none;
  }

  .layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-hint-tooltip,
  .layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-hint-tooltip--light {
    transition: none;
  }

  .layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-required--primary,
  .layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-tile,
  .layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-btn,
  .layout.layout--ds .workspace-analyze-setup-root .ds-intro-card .analyze-setup-file {
    transition: none;
  }

  .layout.layout--ds
    .workspace-analyze-setup-root
    .ds-intro-card
    .analyze-setup-deferred.analyze-setup-deferred--open
    .analyze-setup-deferred-inner {
    animation: none;
  }

  .layout.layout--ds
    .workspace-analyze-setup-root
    .analyze-setup-shell--drawing-wait
    .analyze-setup-btn.analyze-setup-btn--drawing-primary {
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }

  .layout.layout--ds
    .workspace-analyze-setup-root
    .ds-intro-card
    .analyze-setup-deferred.analyze-setup-deferred--open
    .analyze-setup-deferred-inner
    > * {
    animation: none !important;
    opacity: 1 !important;
  }

  .layout.layout--ds .workspace-analyze-setup-root .analyze-setup-primary--enter-animate {
    animation: none !important;
  }
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-preview-column.ds-blueprint-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-self: stretch;
  padding: clamp(12px, 1.8vh, 16px) clamp(12px, 1.5vw, 16px);
  border-radius: 34px;
  border: 1px solid rgba(226, 232, 244, 0.95);
  background: #f8f9fc;
  color: #151925;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.22);
  gap: clamp(6px, 1vh, 10px);
}

.ds-blueprint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.ds-blueprint-head strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #151925;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-preview-card {
  background: transparent;
  border: 0;
  margin-top: 0;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-preview-card.ds-drawing-shell {
  overflow: visible;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-drawing-shell,
.layout.layout--ds .workspace-analysis-shell .workspace-preview-drawing-shell.ds-drawing-shell {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-preview-wrap.ds-drawing-area,
.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .workspace-preview-wrap.ds-drawing-area {
  flex: 1 1 0;
  min-height: 0;
  margin: 0;
  border-radius: 24px;
  border: 1px solid #dde3ef;
  background:
    linear-gradient(#edf1f8 1px, transparent 1px),
    linear-gradient(90deg, #edf1f8 1px, transparent 1px),
    #ffffff;
  background-size: 28px 28px;
  display: grid;
  place-items: center;
  overflow: auto;
  overscroll-behavior: contain;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-preview-wrap.ds-drawing-area:has(#setupPreviewImg:not(.hidden)),
.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .workspace-preview-wrap.ds-drawing-area:has(#previewImg:not(.hidden)) {
  display: block;
  background: #ffffff;
  text-align: center;
}

.layout.layout--ds .workspace-analysis-shell .workspace-preview-zoom-host.analyze-setup-tooltip-host--preview-zoom {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.layout.layout--ds .workspace-analysis-shell .workspace-preview-zoom-host .ds-drawing-zoom {
  pointer-events: auto;
}

.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint.workspace-panel--preview {
  padding: 0;
  overflow: hidden;
  background: #f8f9fc;
  border: 1px solid rgba(226, 232, 244, 0.95);
  border-radius: 34px;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.22);
  color: #151925;
}

.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .workspace-preview-head--blueprint {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: clamp(12px, 1.8vh, 16px) clamp(12px, 1.5vw, 16px);
  border-bottom: 1px solid rgba(226, 232, 244, 0.95);
  background: transparent;
}

.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .workspace-preview-title--blueprint {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #151925;
  text-transform: none;
}

.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .workspace-preview-wrap.ds-drawing-area .preview-placeholder {
  color: #536179;
  font-weight: 700;
  font-size: 12px;
}

.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .workspace-preview-drawing-shell {
  padding: 0 clamp(10px, 1.4vw, 14px) clamp(10px, 1.6vh, 14px);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-drawing-zoom,
.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .ds-drawing-zoom {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  padding: 6px;
  border-radius: 999px;
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dde3ef;
  box-shadow: 0 4px 16px rgba(21, 25, 37, 0.12);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-drawing-zoom .preview-zoom-btn,
.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .ds-drawing-zoom .preview-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #dde3ef;
  background: #eef2ff;
  color: #151925;
  font-weight: 900;
  line-height: 1;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-drawing-zoom .preview-zoom-btn--text,
.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .ds-drawing-zoom .preview-zoom-btn--text {
  min-width: 48px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.layout.layout--ds .workspace-analyze-setup-root .ds-drawing-zoom .preview-zoom-btn:hover,
.layout.layout--ds .workspace-analysis-shell .workspace-preview-card--blueprint .ds-drawing-zoom .preview-zoom-btn:hover {
  background: #e0e7ff;
  border-color: rgba(127, 149, 255, 0.55);
}

.layout.layout--ds .workspace-analyze-setup-root .ds-blueprint-card .analyze-setup-preview-placeholder {
  color: #536179;
  font-weight: 700;
  font-size: 12px;
}

.analyze-setup-submit-wrap--centered {
  width: 100%;
  justify-content: center;
  padding: clamp(4px, 0.8vh, 10px) 0 clamp(2px, 0.5vh, 6px);
  flex-shrink: 0;
}

.layout.layout--ds .workspace-progress-region {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.layout.layout--ds .workspace-status-wrap {
  /* Скрыто визуально: #status остаётся в DOM, JS по-прежнему пишет textContent */
  display: none;
}

.layout.layout--ds .workspace-status-wrap .workspace-status--ds,
.layout.layout--ds #status.workspace-status--ds {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  color: rgba(247, 248, 251, 0.88);
}

/* Как в DesignScroll: «Прогресс анализа» (всегда видна: idle / running / completed) */
.layout.layout--ds .analysis-progress.analysis-progress--ds {
  display: grid;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.28);
  gap: 12px;
  transition:
    opacity 0.25s ease,
    border-color 0.25s ease,
    filter 0.25s ease,
    box-shadow 0.25s ease;
}

.layout.layout--ds .analysis-progress.analysis-progress--idle {
  opacity: 0.72;
  filter: saturate(0.88);
}

.layout.layout--ds .analysis-progress.analysis-progress--idle .flow-fill {
  opacity: 0.35;
}

.layout.layout--ds .analysis-progress.analysis-progress--running {
  opacity: 1;
  filter: none;
}

.layout.layout--ds .analysis-progress.analysis-progress--completed {
  opacity: 1;
  filter: none;
  border-color: rgba(137, 230, 194, 0.28);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.layout.layout--ds .analysis-progress.analysis-progress--completed #flowPercent {
  color: #89e6c2;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .progress-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .progress-headline h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #f7f8fb;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds #flowPercent {
  font-size: 14px;
  font-weight: 800;
  color: rgba(247, 248, 251, 0.72);
  font-variant-numeric: tabular-nums;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-line {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7f95ff, #89e6c2);
  transition: width 0.35s ease;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-pill {
  min-height: 58px;
  padding: 10px;
  border-radius: 16px;
  color: rgba(247, 248, 251, 0.62);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  box-sizing: border-box;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-pill strong {
  display: block;
  color: #f7f8fb;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 800;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-pill.current {
  border-color: rgba(127, 149, 255, 0.45);
  background: rgba(127, 149, 255, 0.12);
  color: rgba(247, 248, 251, 0.88);
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-pill.done {
  color: #89e6c2;
  border-color: rgba(137, 230, 194, 0.35);
  background: rgba(137, 230, 194, 0.08);
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-pill.done strong {
  color: #f7f8fb;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-pill.flow-pill--placeholder {
  grid-column: 1 / -1;
  max-width: none;
  text-align: center;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  color: rgba(247, 248, 251, 0.42);
  border-style: dashed;
  font-weight: 700;
}

.layout.layout--ds .analysis-progress.analysis-progress--ds .flow-pill.flow-pill--placeholder strong {
  color: rgba(247, 248, 251, 0.55);
}

/* Как у analyze-setup-shell--ds-hero: левая колонка = зона ввода, правая = превью (та же доля ширины) */
.layout.layout--ds .workspace-content-row.workspace-content-row--ds {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(8px, 1.2vw, 14px);
  align-items: stretch;
}

/* Кнопка «Экспорт» — по центру области анализа */
.layout.layout--ds .workspace-analysis-shell > .workspace-bottom-actions {
  align-self: center;
  width: 100%;
  max-width: none;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.layout.layout--ds .workspace-panel {
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.28);
}

.layout.layout--ds .workspace-tabs-card.workspace-panel--tabs {
  padding: 0;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.layout.layout--ds .workspace-tab-toolbar {
  --workspace-tab-row-h: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.layout.layout--ds .workspace-tab-select {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  max-width: min(240px, 86vw);
  height: var(--workspace-tab-row-h);
  min-height: var(--workspace-tab-row-h);
  padding: 6px 32px 6px 12px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(127, 149, 255, 0.45);
  background-color: rgba(255, 255, 255, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23f7f8fb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  color: #f7f8fb;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  color-scheme: dark;
  box-sizing: border-box;
  transition:
    border-color var(--transition-interactive),
    background-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.layout.layout--ds .workspace-tab-select:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background-color: rgba(255, 255, 255, 0.09);
}

.layout.layout--ds .workspace-tab-select option {
  background: #131824;
  color: #f7f8fb;
  font-weight: 700;
}

.layout.layout--ds .workspace-tab-toolbar .workspace-mini-btn.workspace-tab-toolbar-rebuild {
  position: static;
  top: auto;
  right: auto;
  flex: 0 0 auto;
  margin: 0;
  align-self: center;
  height: var(--workspace-tab-row-h);
  min-height: var(--workspace-tab-row-h);
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 800;
}

.layout.layout--ds .workspace-tabs-card .tab-panels {
  padding: 14px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.14);
  margin: 0;
  border: none;
}

.layout.layout--ds .workspace-tabs-card .tab-panel {
  min-height: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
}

/*
 * Один скролл: для вкладок с одним .text-out прокрутка на .tab-panel (внутри #outCad flex + overflow
 * давали второй скролл у CAD и др.). Результат — по-прежнему .panel-result-scroll.
 */
.layout.layout--ds .workspace-tabs-card .tab-panels > .tab-panel.active {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.layout.layout--ds .workspace-tabs-card .tab-panels > .tab-panel.active:not(#panel-result) {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.layout.layout--ds .workspace-tabs-card .tab-panels > .tab-panel.active:not(#panel-result) > .text-out {
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

/* Сырой CAD в <pre> — сброс UA overflow, иначе два вертикальных скролла рядом */
.layout.layout--ds
  .workspace-tabs-card
  .tab-panels
  > .tab-panel.active:not(#panel-result)
  pre.result-section-body {
  overflow: visible;
  max-height: none;
}

.layout.layout--ds #panel-result.active {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  --panel-result-footer-bg: rgba(22, 26, 36, 0.98);
}

.layout.layout--ds #panel-result.active .panel-result-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.layout.layout--ds #panel-result.active .panel-result-scroll .text-out {
  flex: none;
  min-height: min(360px, 52vh);
  max-height: none;
  padding-bottom: 12px;
  overflow: visible;
}

.layout.layout--ds #panel-result.active .panel-result-ask-footer {
  position: relative;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 14px 14px;
  background: var(--panel-result-footer-bg);
}

.layout.layout--ds #panel-result.active .panel-result-ask-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 76px;
  pointer-events: none;
  background: linear-gradient(
    to top,
    var(--panel-result-footer-bg) 0%,
    rgba(22, 26, 36, 0.55) 48%,
    transparent 100%
  );
}

.layout.layout--ds #panel-result.active .panel-result-ask-footer .workspace-inline-btn {
  margin: 0;
  width: min(420px, 92%);
}

.layout.layout--ds .workspace-tabs-card .text-out {
  background: transparent;
  color: rgba(247, 248, 251, 0.92);
  border: none;
}

.layout.layout--ds .workspace-tabs-card pre.text-out {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
}

.layout.layout--ds .result-section {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.layout.layout--ds .result-section-title {
  color: #b9c7ff;
}

.layout.layout--ds .workspace-preview-card.workspace-panel--preview {
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.layout.layout--ds .workspace-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.layout.layout--ds .workspace-preview-title {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(247, 248, 251, 0.62);
}

.layout.layout--ds .preview-zoom-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.layout.layout--ds .preview-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #f7f8fb;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.layout.layout--ds .preview-zoom-btn--text {
  min-width: 52px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.layout.layout--ds .preview-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.layout.layout--ds .workspace-preview-wrap:not(.ds-drawing-area) {
  margin: 14px;
  min-height: 400px;
  border-radius: 18px;
  border: 1px solid rgba(18, 22, 33, 0.12);
  background: rgba(248, 249, 252, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  display: block;
  overflow: auto;
  text-align: center;
  flex: 1 1 0;
}

.layout.layout--ds .workspace-preview-wrap img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  vertical-align: middle;
  box-sizing: border-box;
}

.layout.layout--ds .workspace-preview-wrap .preview-placeholder {
  color: #64748b;
}

/* —— Левая колонка как в DesignScroll: ширина, blur, стык ‹ › —— */
.layout.layout--ds .workspace-sidebar-shell {
  position: relative;
  align-self: stretch;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.layout.layout--ds .workspace-tools.workspace-tools--ds.workspace-sidebar {
  position: relative;
  left: auto;
  top: auto;
  z-index: 2;
  flex: 1 1 0;
  min-height: 0;
  width: var(--sidebar-expanded);
  margin: 0;
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border-right: 1px solid var(--sidebar-line);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 0 0 0 calc(var(--radius-xl, 34px) - 2px);
  box-sizing: border-box;
  transition: width 0.28s ease;
}

.layout.layout--ds .workspace-tools.workspace-sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.layout.layout--ds .workspace-sidebar-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 2px;
  margin-right: -2px;
}

.layout.layout--ds .workspace-sidebar-tail {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 8px;
  border-top: 1px solid var(--sidebar-line);
}

.layout.layout--ds .workspace-sidebar-nav {
  display: grid;
  gap: 7px;
  flex-shrink: 0;
}

.layout.layout--ds .workspace-sidebar-nav-title {
  padding: 8px 12px 2px;
  color: rgba(247, 248, 251, 0.62);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.22s ease;
}

.layout.layout--ds .workspace-nav-btn {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  margin: 0;
  border: 0;
  border-radius: 16px;
  color: #f7f8fb;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background 0.2s ease, transform 0.2s ease;
}

.layout.layout--ds .workspace-nav-btn:hover {
  background: var(--sidebar-panel-strong);
}

.layout.layout--ds .workspace-nav-btn:active {
  transform: scale(0.99);
}

.layout.layout--ds .workspace-nav-btn.drawer-btn:hover {
  background: rgba(127, 149, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(127, 149, 255, 0.35);
}

.layout.layout--ds .workspace-nav-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: currentcolor;
}

.layout.layout--ds .workspace-nav-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  white-space: nowrap;
  transition: opacity 0.22s ease;
}

.layout.layout--ds .workspace-nav-text strong {
  font-size: 14px;
  font-weight: 800;
}

.layout.layout--ds .workspace-nav-text span {
  color: rgba(247, 248, 251, 0.62);
  font-size: 12px;
  font-weight: 600;
}

/* display:none: иначе у flex-элементов min-width:auto не даёт сжать текст до 0 — кнопка «Выйти» и пункты меню обрезались */
.layout.layout--ds .workspace-sidebar.collapsed .workspace-sidebar-nav-title,
.layout.layout--ds .workspace-sidebar.collapsed .workspace-nav-text,
.layout.layout--ds .workspace-sidebar.collapsed .workspace-sidebar-logout-label {
  display: none;
}

.layout.layout--ds .workspace-sidebar.collapsed .workspace-nav-btn {
  justify-content: center;
  gap: 0;
  padding-inline: 10px;
}

.layout.layout--ds .workspace-sidebar-footer {
  flex-shrink: 0;
  padding-top: 10px;
  margin-top: 0;
  border-top: 1px solid var(--sidebar-line);
  padding-bottom: 4px;
  /* без отдельного тёмного блока — фон как у всей панели (blur остаётся на aside) */
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.layout.layout--ds .workspace-sidebar-logout {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px 14px;
  margin: 0;
  border-radius: 18px;
  color: #f7f8fb;
  background: var(--sidebar-panel-strong);
  border: 1px solid var(--sidebar-line);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, filter 0.2s ease;
}

.layout.layout--ds .workspace-sidebar-logout:hover {
  filter: brightness(1.08);
}

.layout.layout--ds .workspace-sidebar.collapsed .workspace-sidebar-logout {
  justify-content: center;
  padding-inline: 10px;
}

.layout.layout--ds .workspace-sidebar-toggle {
  position: absolute;
  left: calc(100% - 17px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  color: #f7f8fb;
  background: rgba(19, 24, 36, 0.92);
  border: 1px solid var(--sidebar-line);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  transition:
    filter var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.layout.layout--ds .workspace-sidebar-toggle:hover {
  filter: brightness(1.1);
  border-color: rgba(127, 149, 255, 0.45);
}

.workspace-body.tools-collapsed {
  display: block;
}

.layout.layout--ds .workspace-body.tools-collapsed {
  display: grid;
}

.workspace-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  position: absolute;
  left: calc((var(--tools-lane-width) - var(--tools-panel-width)) / 2);
  top: 52px;
  width: var(--tools-panel-width);
  z-index: 3;
}

.workspace-tools-toggle {
  width: 62px;
  height: 62px;
  margin: 0 auto 8px;
  border-radius: 50%;
  border: 1px solid rgba(184, 192, 206, 0.45);
  background: rgba(238, 242, 249, 0.88);
  color: #2b3038;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
  align-self: center;
  transition: transform 0.32s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.workspace-tools.is-collapsed .workspace-tools-toggle {
  align-self: center;
  transform: translateX(0);
}

.workspace-tools:not(.is-collapsed) .workspace-tools-toggle {
  align-self: center;
  transform: translateX(0);
}

.gear-icon {
  display: inline-block;
  font-size: 54px;
  line-height: 1;
  animation: gearSpin 1.8s linear infinite;
}

.workspace-tools.is-collapsed .workspace-tools-toggle:hover {
  transform: scale(1.02);
}

.workspace-tools.is-collapsed .workspace-tools-toggle:active {
  transform: scale(0.99);
}

.workspace-tools:not(.is-collapsed) .workspace-tools-toggle:hover {
  transform: translateY(-1px) scale(1.01);
}

.workspace-tools:not(.is-collapsed) .workspace-tools-toggle:active {
  transform: translateY(1px) scale(0.99);
}

@keyframes gearSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.tool-actions {
  border: 1px solid rgba(184, 192, 206, 0.32);
  border-radius: 14px;
  background: #2f3645;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.28s ease, opacity 0.22s ease, max-height 0.28s ease;
  transform-origin: top left;
  max-height: 520px;
  opacity: 1;
}

.workspace-tools.is-collapsed .tool-actions {
  transform: translateX(-165%);
  opacity: 0;
  max-height: 0;
  pointer-events: none;
}

.workspace-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: var(--tools-lane-width);
  padding-right: 18px;
  position: relative;
  padding-bottom: 76px;
}

.workspace-content-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: stretch;
}

.workspace-btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(156, 168, 192, 0.36);
  background: #f7f9fd;
  color: #2b3038;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.18);
  transition: box-shadow 0.22s ease, transform 0.16s ease, filter 0.22s ease;
}

.workspace-btn-ghost {
  background: #eef2f8;
}

.workspace-btn-primary-large {
  min-width: 280px;
  padding: 12px 22px;
  border-radius: 14px;
  border: 1px solid rgba(83, 104, 232, 0.65);
  background: #5368e8;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.22);
  transition: box-shadow 0.22s ease, transform 0.16s ease, filter 0.22s ease;
}

.layout.layout--ds .workspace-btn-primary-large {
  border: 0;
  background: linear-gradient(135deg, #151a27, #5368e8);
  box-shadow: 0 18px 36px rgba(83, 104, 232, 0.26);
}

.layout.layout--ds .workspace-btn-primary-large:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.workspace-tabs-card {
  position: relative;
  background: #2f3442;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  margin: 0;
}

.workspace-preview-card {
  border-radius: 16px;
  background: #2f3442;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.workspace-preview-title {
  margin: 0 0 8px;
  color: #d5dbe8;
  font-size: 15px;
  font-weight: 700;
}

.workspace-preview-wrap {
  min-height: 420px;
  max-height: 60vh;
  border-radius: 12px;
  border: 1px solid rgba(184, 192, 206, 0.24);
}

.workspace-mini-btn {
  position: absolute;
  top: 58px;
  right: 18px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(73, 79, 92, 0.3);
  background: #f7f9fd;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  transition: box-shadow 0.22s ease, transform 0.16s ease, filter 0.22s ease;
}

.workspace-inline-btn {
  display: block;
  width: min(420px, 86%);
  margin: 0 auto;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(73, 79, 92, 0.3);
  background: #f7f9fd;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  z-index: 2;
  transition: box-shadow 0.22s ease, transform 0.16s ease, filter 0.22s ease;
}

.workspace-bottom-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  align-self: flex-start;
  width: calc(100% - 334px);
}

.workspace-support-btn {
  margin: 0;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(73, 79, 92, 0.3);
  background: #f7f9fd;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
  position: absolute;
  right: 18px;
  bottom: 16px;
  transition: box-shadow 0.22s ease, transform 0.16s ease, filter 0.22s ease;
}

.legacy-controls {
  display: none !important;
}

.btn {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px 10px;
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: box-shadow 0.22s ease, transform 0.16s ease, filter 0.22s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.24);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid transparent;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.16);
}

.btn-secondary:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.file-label {
  cursor: pointer;
}

.file-label.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.settings-panel {
  width: calc(100% - 40px);
  margin: 0 20px 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}

.settings-panel summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.settings-panel label {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.settings-panel input,
.settings-panel textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: 12px "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: #fff;
}

.settings-panel textarea {
  resize: vertical;
}

.settings-panel .csv-import-label {
  display: block;
  margin-top: 6px;
  padding: 8px;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  color: var(--accent);
  background: #fff;
  text-align: center;
  cursor: pointer;
}

.mini-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font: 12px "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  cursor: pointer;
}

.btn-export.btn-word {
  background: #eff6ff;
  color: #1e40af;
}
.btn-export.btn-excel {
  background: #ecfdf5;
  color: #047857;
}
.btn-export.btn-td {
  background: #eef2ff;
  color: #1e40af;
}
.btn-export.btn-norm {
  background: #f5f3ff;
  color: #6d28d9;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid #cbd5e1;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.14);
}

.logout-btn {
  margin-top: 8px;
}

.btn-ghost:hover {
  background: #f1f5f9;
}

.btn:hover,
.workspace-btn:hover,
.landing-btn:hover,
.workspace-inline-btn:hover,
.workspace-mini-btn:hover,
.workspace-support-btn:hover,
.analyze-setup-submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.28);
}

.btn:active,
.workspace-btn:active,
.landing-btn:active,
.workspace-inline-btn:active,
.workspace-mini-btn:active,
.workspace-support-btn:active,
.analyze-setup-submit-btn:active {
  transform: translateY(1px) scale(0.992);
  filter: brightness(0.98);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.16);
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  margin: 28px 20px 8px;
}

.required-counter {
  width: calc(100% - 40px);
  margin: 2px 20px 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(83, 104, 232, 0.38);
  background: #eef2ff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 700;
}

.main {
  flex: 1;
  padding: 30px;
  min-width: 0;
}

.title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 700;
}

.status {
  margin: 0 0 8px;
  font-size: 13px;
  color: #d5dbe8;
}

.progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress.hidden {
  display: none;
}

.progress-bar {
  height: 100%;
  width: 40%;
  background: var(--accent);
  animation: indet 1s ease-in-out infinite;
}

@keyframes indet {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

.content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: stretch;
  min-height: 520px;
}

.clarifications-card {
  flex: 1 1 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 18px 22px;
  border-radius: 15px;
  background: linear-gradient(135deg, #eef2ff 0%, #dbeafe 100%);
  border: 1px solid rgba(83, 104, 232, 0.42);
}

.clarifications-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 800;
  color: #1e3a8a;
}

.clarifications-intro {
  margin: 0 0 14px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.45;
}

.clarifications-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.clarifications-list li {
  margin: 8px 0;
}

.file-label-required .req-mark {
  color: #2563eb;
  font-weight: 800;
}

.preview-card {
  width: 520px;
  flex-shrink: 0;
}

.tabs-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
}

.preview-wrap {
  min-height: 480px;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  overflow: auto;
}

.preview-placeholder {
  color: #9ca3af;
}

#previewImg {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.05s ease-out;
}

.hidden {
  display: none !important;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  justify-content: flex-end;
  animation: uiFadeIn 0.2s ease;
}

.drawer.drawer-centered {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.drawer-panel {
  width: min(760px, 100%);
  height: 100%;
  overflow: auto;
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 70px rgba(15, 23, 42, 0.18);
  animation: uiFadeIn 0.24s ease;
}

.drawer.drawer-centered .drawer-panel {
  width: min(1080px, 92vw);
  height: auto;
  max-height: 88vh;
  border-radius: 18px;
  border: 1px solid rgba(188, 196, 210, 0.36);
  border-left: 1px solid rgba(188, 196, 210, 0.36);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  overflow: auto;
}

.drawer.drawer-centered .drawer-head {
  border-radius: 18px 18px 0 0;
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.drawer-head h2 {
  margin: 0;
}

.drawer-close {
  border: 0;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

#drawerContent {
  padding: 20px 22px 32px;
}

.drawer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.drawer-table th,
.drawer-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.drawer-table tbody tr {
  cursor: pointer;
}

.drawer-table tbody tr:hover {
  background: #f8fafc;
}

.drawer-table tbody tr.loading {
  opacity: 0.55;
  pointer-events: none;
}

.drawer-table.admin-users-table tbody tr {
  cursor: default;
}

.drawer-table.admin-users-table tbody tr:hover {
  background: transparent;
}

.drawer-hint {
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 12px;
}

.admin-users-toolbar .mini-btn {
  margin-top: 0;
}

.admin-users-scroll {
  overflow: auto;
  max-height: min(42vh, 360px);
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-users-form-title {
  margin: 18px 0 8px;
  font-size: 15px;
}

.admin-users-form .mini-btn {
  margin-top: 12px;
}

.admin-quota-label {
  margin-bottom: 6px !important;
}

.admin-quota-picker {
  margin: 0 0 14px;
}

.admin-quota-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-quota-pill {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  font: 12px/1.25 "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.admin-quota-pill:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.admin-quota-pill.is-active {
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  border-color: var(--accent);
  color: #1e40af;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}

.admin-quota-pill-note {
  font-weight: 600;
  opacity: 0.85;
}

.admin-quota-slider-block {
  padding: 14px 14px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.admin-quota-slider-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.admin-quota-slider-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 2.2ch;
}

.admin-quota-slider-caption {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.admin-quota-range {
  width: 100%;
  height: 8px;
  margin: 4px 0 8px;
  border-radius: 4px;
  appearance: none;
  background: linear-gradient(90deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
  cursor: pointer;
}

.admin-quota-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.admin-quota-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

.admin-quota-range::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: transparent;
}

.admin-quota-range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
}

.drawer-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.drawer-check input {
  width: auto;
  margin: 0;
}

.mini-btn.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.mini-btn.danger:hover {
  background: #fee2e2;
}

.drawer-label {
  display: block;
  margin: 14px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.drawer-label input,
.drawer-label textarea,
.admin-toolbar input,
.admin-toolbar select,
.admin-form input {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: 13px "Segoe UI", system-ui, sans-serif;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.chip {
  padding: 7px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font: 12px "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.drawer-item {
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

/* —— Drawer в стиле DesignScroll (тёмная панель, blur overlay) —— */
.drawer.drawer--ds {
  background: rgba(4, 6, 12, 0.62);
  backdrop-filter: blur(16px);
}

.drawer.drawer--ds .drawer-panel {
  background: rgba(20, 24, 35, 0.97);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -28px 0 90px rgba(0, 0, 0, 0.45);
  color: #f7f8fb;
}

.drawer.drawer--ds:not(.drawer-centered) .drawer-panel {
  border-radius: 26px 0 0 26px;
}

.drawer.drawer--ds.drawer-centered {
  justify-content: center;
  align-items: center;
  padding: 18px;
}

.drawer.drawer--ds.drawer-centered .drawer-panel {
  width: min(1080px, 92vw);
  height: auto;
  max-height: 88vh;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.drawer.drawer--ds .drawer-head {
  background: rgba(20, 24, 35, 0.95);
  backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.drawer.drawer--ds .drawer-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #f7f8fb;
}

.drawer.drawer--ds .drawer-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
  font-size: 22px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f8fb;
  transition:
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    color var(--transition-interactive);
}

.drawer.drawer--ds .drawer-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.drawer.drawer--ds #drawerContent {
  padding: 12px 22px 28px;
}

.drawer.drawer--ds .muted,
.drawer.drawer--ds p.muted {
  color: rgba(247, 248, 251, 0.62) !important;
}

.drawer.drawer--ds .drawer-hint {
  color: rgba(247, 248, 251, 0.78);
}

.drawer.drawer--ds .drawer-table {
  color: rgba(247, 248, 251, 0.92);
}

.drawer.drawer--ds .drawer-table th {
  color: rgba(247, 248, 251, 0.55);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.drawer.drawer--ds .drawer-table td {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.drawer.drawer--ds .drawer-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

.drawer.drawer--ds .drawer-label {
  color: rgba(247, 248, 251, 0.65);
}

.drawer.drawer--ds .drawer-label input,
.drawer.drawer--ds .drawer-label textarea,
.drawer.drawer--ds .admin-toolbar input,
.drawer.drawer--ds .admin-toolbar select,
.drawer.drawer--ds .admin-form input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f7f8fb;
  border-radius: 14px;
  transition: border-color var(--transition-interactive), background-color var(--transition-interactive);
}

.drawer.drawer--ds .drawer-label input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.drawer.drawer--ds .admin-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.drawer.drawer--ds .admin-toolbar select,
.drawer.drawer--ds .admin-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  min-height: var(--control-min-height);
}

.drawer.drawer--ds .drawer-label textarea {
  min-height: 72px;
  resize: vertical;
}

.drawer.drawer--ds .drawer-label input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
.drawer.drawer--ds .admin-toolbar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover,
.drawer.drawer--ds .admin-toolbar select:hover,
.drawer.drawer--ds .admin-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover {
  border-color: rgba(255, 255, 255, 0.24);
}

.drawer.drawer--ds .admin-users-scroll {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.drawer.drawer--ds .drawer-item {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(247, 248, 251, 0.88);
}

.drawer.drawer--ds .chip {
  border: 1px solid rgba(127, 149, 255, 0.45);
  background: rgba(127, 149, 255, 0.14);
  color: #dce3ff;
  transition:
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    filter var(--transition-interactive);
}

.drawer.drawer--ds .chip:hover {
  background: rgba(127, 149, 255, 0.22);
}

.drawer.drawer--ds .mini-btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #f7f8fb;
  min-height: 40px;
  padding-inline: 12px;
  transition:
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    filter var(--transition-interactive);
}

.drawer.drawer--ds .mini-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.drawer.drawer--ds .mini-btn.danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(239, 68, 68, 0.15);
}

.drawer.drawer--ds .mini-btn.danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.drawer.drawer--ds .admin-quota-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f7f8fb;
}

.drawer.drawer--ds .admin-quota-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.drawer.drawer--ds .admin-quota-pill.is-active {
  background: rgba(127, 149, 255, 0.22);
  border-color: rgba(127, 149, 255, 0.55);
  color: #eef1ff;
  box-shadow: inset 0 0 0 1px rgba(127, 149, 255, 0.25);
}

.drawer.drawer--ds .admin-quota-slider-block {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.drawer.drawer--ds .admin-quota-slider-caption {
  color: rgba(247, 248, 251, 0.55);
}

.drawer.drawer--ds .admin-users-form-title {
  color: rgba(247, 248, 251, 0.92);
}

.drawer.drawer--ds .drawer-check {
  color: rgba(247, 248, 251, 0.78);
}

.drawer.drawer--ds h3 {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgba(247, 248, 251, 0.92);
}

.admin-toolbar,
.admin-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-form-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px 0 14px;
}

.import-label {
  display: block;
  text-align: center;
}

.enterprise-ops-table input.enterprise-ops-input {
  width: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  padding: 8px 9px;
  font: inherit;
  font-size: 11.5px;
  outline: none;
}

.enterprise-ops-scroll {
  max-height: none;
  overflow: visible;
  background: rgba(0, 0, 0, 0.2);
}

.material-edit-scroll {
  max-height: none;
  margin-bottom: 12px;
}

.material-edit-table input.material-row-input {
  width: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  padding: 8px 9px;
  font: inherit;
  font-size: 11.5px;
  outline: none;
}

.drawer.drawer--ds .material-edit-scroll.eco-table-wrap,
.drawer.drawer--ds .enterprise-ops-scroll.eco-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.2);
}

.drawer.drawer--ds .material-edit-table.eco-data-table,
.drawer.drawer--ds .enterprise-ops-table.eco-data-table {
  margin: 0;
  border: 0;
}

.admin-enterprise-actions {
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 10px 0;
  border-bottom: 1px solid rgba(139, 146, 159, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.tab {
  padding: 7px 10px;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  color: #c6cfde;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tab:hover {
  color: #f2f6ff;
  transform: translateY(-1px);
}

.tab.active {
  color: #1f242d;
  background: #f2f4f7;
}

.tab-panels {
  flex: 1;
  min-height: 420px;
}

.tab-panel {
  display: none;
  height: 100%;
  min-height: 420px;
}

.tab-panel.active {
  display: block;
  animation: uiPanelIn 0.24s ease;
}

#panel-result.active {
  display: flex;
  flex-direction: column;
  background: #242937;
  position: relative;
  overflow: hidden;
}

.panel-result-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.panel-result-ask-footer {
  position: relative;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 16px 18px;
  background: #242937;
}

.panel-result-ask-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 64px;
  pointer-events: none;
  background: linear-gradient(to top, #242937 0%, rgba(36, 41, 55, 0.65) 45%, transparent 100%);
}

.text-out {
  margin: 0;
  padding: 16px;
  font-family: "Gill Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  min-height: 380px;
  max-height: 60vh;
  overflow: auto;
  color: #e8edf8;
  background: #242937;
}

#panel-result .text-out {
  flex: none;
  margin-bottom: 0;
  max-height: none;
  padding-bottom: 16px;
  overflow: visible;
}

.text-out-rich {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-section {
  border: 1px solid rgba(184, 192, 206, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
}

.result-section-title {
  margin: 0 0 6px;
  color: #5368e8;
  font-weight: 700;
  font-size: 15px;
}

.result-section-body {
  color: #e8edf8;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ask-ai-history {
  margin: 0 22px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 13px;
  color: var(--text);
  max-height: 140px;
  overflow: auto;
  line-height: 1.4;
}

.param-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(238, 242, 249, 0.72);
}

.param-list-text {
  flex: 1;
}

.param-del-btn {
  border: 1px solid rgba(73, 79, 92, 0.3);
  background: #fff;
  color: #b42318;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  padding: 3px 8px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.ask-ai-fields {
  padding: 0 22px;
  max-height: 180px;
  overflow: auto;
}

.ask-ai-add-row {
  padding: 0 22px 8px;
  display: flex;
  justify-content: flex-start;
}

.text-tech {
  color: #1e40af;
  background: #fff;
}

.text-otk {
  color: #1e40af;
  background: #eef2ff;
}

.text-glossary {
  color: #0369a1;
  background: #f0f9ff;
  font-size: 13px;
}

.text-economics {
  color: #166534;
  background: #f0fdf4;
  font-size: 14px;
}

.text-logs {
  color: var(--muted);
  background: #f9fafb;
  font-size: 12px;
}

.tag-error {
  color: var(--error);
}

.tag-warning {
  color: #2563eb;
}

.tag-critical {
  color: #b91c1c;
}

.tag-it6 {
  background: #dbeafe;
  color: #1e40af;
}

.tag-dfr {
  color: #7c3aed;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  backdrop-filter: blur(2px);
  animation: uiFadeIn 0.2s ease;
}

.modal-overlay > .modal-dialog {
  flex: 0 1 auto;
  margin-top: auto;
  margin-bottom: auto;
  max-width: 100%;
}

.modal-overlay.hidden {
  display: none;
}

#askAiModal.modal-overlay {
  z-index: 2100;
}

.modal-dialog {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  animation: uiFadeIn 0.24s ease;
}

.clarify-dialog {
  padding: 0;
}

.clarify-dialog h2 {
  margin: 0;
  padding: 20px 22px 8px;
  font-size: 1.15rem;
}

.modal-intro {
  margin: 0;
  padding: 0 22px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

#clarifyModalFields {
  padding: 0 22px;
  overflow-y: auto;
  flex: 1;
  max-height: 50vh;
}

.clarify-field {
  margin-bottom: 16px;
}

.clarify-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.35;
}

.clarify-field textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 18px 22px 20px;
  border-top: 1px solid var(--border);
  background: #fafafa;
  border-radius: 0 0 16px 16px;
}

.export-dialog {
  width: min(780px, 94vw);
  max-height: min(88vh, 760px);
  border-radius: 24px;
  border: 1px solid rgba(188, 196, 210, 0.36);
  background: #eceff4;
  padding: 16px 18px 20px;
  overflow: hidden;
  min-height: 0;
}

.export-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.export-dialog-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #2b3038;
}

.export-dialog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-height: calc(min(88vh, 760px) - 120px);
  overflow: auto;
  min-height: 0;
}

.export-dialog-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-dialog-col-right {
  justify-content: center;
}

.export-option {
  text-align: center;
  font-size: 18px;
  padding: 10px 14px;
}

.export-option-large {
  padding: 14px 14px;
  font-size: 24px;
}

.analyze-setup-dialog:not(.analyze-setup-dialog--idle-inline) {
  width: min(1000px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  border-radius: 20px;
  border: 1px solid rgba(188, 196, 210, 0.36);
  background: #eceff4;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  min-height: 0;
  box-sizing: border-box;
}

.analyze-setup-shell {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 38%);
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.analyze-setup-forms-column {
  border: 1px solid rgba(160, 170, 188, 0.36);
  border-radius: 14px;
  background: #f3f5f9;
  padding: 8px 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analyze-setup-preview-column {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.analyze-setup-preview-heading {
  margin: 0;
  flex-shrink: 0;
}

.analyze-setup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.analyze-setup-head--solo {
  justify-content: flex-start;
}

.analyze-setup-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: #2b3038;
}

.analyze-setup-note {
  font-size: 11px;
  line-height: 1.3;
  color: #596170;
  margin: 0 0 4px;
}

.analyze-setup-counter {
  margin-bottom: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(83, 104, 232, 0.35);
  background: #eef2ff;
  color: #1e40af;
  font-size: 11px;
  font-weight: 700;
}

.analyze-setup-lock-hint {
  margin-bottom: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(120, 132, 152, 0.35);
  background: #eef2f8;
  color: #4c5564;
  font-size: 11px;
  line-height: 1.3;
}

.analyze-setup-group-title {
  font-size: 13px;
  font-weight: 700;
  color: #2d3440;
  margin: 2px 0 0;
}

.analyze-setup-required {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.analyze-setup-required--drawing-centered {
  display: flex;
  justify-content: center;
  align-items: stretch;
  grid-template-columns: unset;
}

.analyze-setup-tile--drawing-hero {
  flex: 0 1 auto;
  width: 100%;
  max-width: min(440px, 100%);
  margin-inline: auto;
  padding: clamp(14px, 2vh, 22px) clamp(16px, 2.5vw, 26px);
  border-width: 2px;
  border-radius: 14px;
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.07);
}

.analyze-setup-btn--drawing-primary {
  font-weight: 800;
  letter-spacing: 0.02em;
  min-height: 52px;
  font-size: clamp(14px, 1.6vw, 17px);
  padding: 14px 20px;
  border-radius: 14px;
}

.analyze-setup-tooltip-host--drawing-centered {
  align-items: center;
}

.analyze-setup-tile {
  border: 1px solid rgba(160, 170, 188, 0.3);
  border-radius: 10px;
  background: #eef2f8;
  padding: 6px 8px;
}

.analyze-setup-btn {
  width: 100%;
  text-align: center;
}

.analyze-setup-btn.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.analyze-setup-btn--reset {
  border: 1px solid rgba(180, 95, 75, 0.45);
  background: rgba(255, 242, 238, 0.92);
  color: #5c3d38;
}

.analyze-setup-btn--reset:hover {
  border-color: rgba(160, 75, 55, 0.65);
  background: rgba(255, 232, 226, 0.98);
}

.analyze-setup-reset-strip {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(140, 155, 175, 0.22);
}

.analyze-setup-file {
  margin-top: 4px;
  font-size: 11px;
  color: #626a79;
  text-align: center;
}

.analyze-setup-file-block {
  margin-top: 6px;
  width: 100%;
  min-width: 0;
}

.analyze-setup-attached-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.analyze-setup-attached-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(160, 170, 188, 0.35);
  background: rgba(255, 255, 255, 0.65);
}

.analyze-setup-attached-name {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  color: #3d4554;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analyze-setup-attached-remove {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(120, 132, 152, 0.45);
  background: rgba(255, 255, 255, 0.95);
  color: #5c6575;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.analyze-setup-attached-remove:hover:not(:disabled) {
  background: #fee2e2;
  border-color: rgba(185, 80, 70, 0.55);
  color: #991b1b;
}

.analyze-setup-attached-remove:focus-visible {
  outline: 2px solid var(--ds-focus, #5368e8);
  outline-offset: 2px;
}

.analyze-setup-attached-remove:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.analyze-setup-attached-remove svg {
  display: block;
}

.analyze-setup-hint {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.3;
  color: #586172;
  text-align: center;
}

.analyze-setup-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.analyze-setup-cad-wrap {
  margin-top: 0;
}

.analyze-setup-ai-row {
  flex-shrink: 0;
}

.analyze-setup-ai-row--top {
  margin: 0;
  padding-top: 0;
}

.analyze-setup-preview-card {
  margin-top: 0;
  border: 1px solid rgba(160, 170, 188, 0.35);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.analyze-setup-preview-card--side {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.analyze-setup-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(160, 170, 188, 0.28);
  background: #eef2f8;
  flex-shrink: 0;
}

.analyze-setup-preview-head .preview-zoom-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.analyze-setup-preview-label {
  font-size: 12px;
  font-weight: 700;
  color: #4c5564;
}

.preview-zoom-toolbar--setup .preview-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid rgba(120, 132, 152, 0.45);
  background: #fff;
  color: #2d3440;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.preview-zoom-toolbar--setup .preview-zoom-btn--text {
  min-width: 50px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.preview-zoom-toolbar--setup .preview-zoom-btn:hover {
  background: #f1f5f9;
  border-color: rgba(83, 104, 232, 0.45);
}

.analyze-setup-preview-wrap {
  flex: 1 1 0%;
  min-height: 0;
  max-height: 100%;
  margin: 6px;
  border-radius: 8px;
  border: 1px solid rgba(160, 170, 188, 0.35);
  background: #f8fafc;
  display: block;
  overflow: auto;
  overscroll-behavior: contain;
  text-align: center;
  isolation: isolate;
}

.preview-pan-enabled {
  cursor: grab;
  user-select: none;
}

.preview-pan-enabled.is-preview-panning {
  cursor: grabbing;
}

.analyze-setup-preview-placeholder {
  padding: 10px 12px;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.analyze-setup-preview-img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  vertical-align: middle;
  box-sizing: border-box;
}

.analyze-setup-preview-hint {
  margin: 0 6px 5px;
  font-size: 10px;
  color: #64748b;
  text-align: center;
  flex-shrink: 0;
}

.analyze-setup-submit-wrap {
  display: flex;
  justify-content: center;
  padding-top: 0;
  flex-shrink: 0;
}

.analyze-setup-submit-btn {
  min-width: 200px;
  padding: 8px 18px;
  border-radius: 12px;
  border: 1px solid rgba(83, 104, 232, 0.65);
  background: #5368e8;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.22);
  transition: box-shadow 0.22s ease, transform 0.16s ease, filter 0.22s ease;
}

.params-dialog {
  width: min(760px, 94vw);
  max-height: min(88vh, 760px);
  border-radius: 20px;
  border: 1px solid rgba(188, 196, 210, 0.36);
  background: #eceff4;
  overflow: hidden;
  min-height: 0;
}

.params-head {
  padding: 16px 20px 6px;
}

.params-head h2 {
  margin: 0;
  color: #2b3038;
}

.params-grid {
  padding: 0 20px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  max-height: calc(min(88vh, 760px) - 120px);
  overflow: auto;
  min-height: 0;
}

.params-grid .drawer-label {
  margin: 0;
}

.params-grid .drawer-label textarea,
.params-grid .drawer-label input,
#economicsParamsText {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: 13px "Segoe UI", system-ui, sans-serif;
}

.economics-param-list {
  grid-column: 1 / -1;
  max-height: 220px;
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(160, 170, 188, 0.3);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  color: #2d3440;
  font-size: 13px;
  line-height: 1.4;
}

/* —— Модальные окна DesignScroll: overlay + диалог + primary/secondary —— */
.modal-overlay.modal-overlay--ds {
  background: rgba(4, 6, 12, 0.62);
  backdrop-filter: blur(16px);
  animation: ds-modal-backdrop-in 0.28s ease forwards;
}

.modal-overlay.modal-overlay--ds .modal-dialog.modal-dialog--ds {
  background: rgba(20, 24, 35, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  color: #f7f8fb;
  animation: ds-modal-dialog-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.modal-overlay.modal-overlay--ds .modal-actions {
  background: rgba(0, 0, 0, 0.28);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0 0 28px 28px;
}

.modal-overlay.modal-overlay--ds .btn.btn-primary {
  border: 0;
  border-radius: 16px;
  min-height: var(--control-min-height);
  padding: 12px 22px;
  font-weight: 800;
  font-size: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #151a27, #5368e8);
  box-shadow: 0 18px 36px rgba(83, 104, 232, 0.26);
  transition:
    transform var(--transition-interactive),
    filter var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.modal-overlay.modal-overlay--ds .btn.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 22px 44px rgba(83, 104, 232, 0.32);
}

.modal-overlay.modal-overlay--ds .btn.btn-secondary {
  border-radius: 16px;
  min-height: var(--control-min-height);
  padding: 12px 20px;
  font-weight: 800;
  font-size: 14px;
  color: #f7f8fb;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
  transition:
    background-color var(--transition-interactive),
    transform var(--transition-interactive),
    border-color var(--transition-interactive);
}

.modal-overlay.modal-overlay--ds .btn.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.modal-overlay.modal-overlay--ds .workspace-btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f8fb;
  box-shadow: none;
  min-height: var(--control-min-height);
  transition:
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    filter var(--transition-interactive);
}

.modal-overlay.modal-overlay--ds .workspace-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  filter: none;
}

.modal-overlay.modal-overlay--ds .clarify-dialog h2 {
  color: #f7f8fb;
}

.modal-overlay.modal-overlay--ds .modal-intro {
  color: rgba(247, 248, 251, 0.62);
}

.modal-overlay.modal-overlay--ds .clarify-field label {
  color: rgba(247, 248, 251, 0.58);
}

.modal-overlay.modal-overlay--ds .clarify-field textarea {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: #f7f8fb;
  min-height: 72px;
  transition: border-color var(--transition-interactive), background-color var(--transition-interactive);
}

.modal-overlay.modal-overlay--ds .clarify-field textarea:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.modal-overlay.modal-overlay--ds .ask-ai-history {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(247, 248, 251, 0.88);
}

.modal-overlay.modal-overlay--ds .param-list-item {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-overlay.modal-overlay--ds .param-del-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.modal-overlay.modal-overlay--ds .export-dialog {
  background: rgba(20, 24, 35, 0.97);
  border-color: rgba(255, 255, 255, 0.12);
}

.modal-overlay.modal-overlay--ds .export-dialog-head h2 {
  color: #f7f8fb;
}

.modal-overlay.modal-overlay--ds .export-option {
  font-weight: 800;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog {
  background: rgba(20, 24, 35, 0.97);
  border-color: rgba(255, 255, 255, 0.12);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-forms-column {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog .analyze-setup-btn,
.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-dialog .analyze-setup-head .workspace-btn {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 10px;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-head h2 {
  color: #f7f8fb;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-note {
  color: rgba(247, 248, 251, 0.62);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-counter {
  border-color: rgba(127, 149, 255, 0.45);
  background: rgba(83, 104, 232, 0.14);
  color: #dbeafe;
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-lock-hint {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(247, 248, 251, 0.78);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-group-title {
  color: rgba(247, 248, 251, 0.92);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-forms-column:not(.ds-intro-card) .analyze-setup-tile {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-file {
  color: rgba(247, 248, 251, 0.58);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-hint {
  color: rgba(247, 248, 251, 0.52);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-preview-card:not(.ds-drawing-shell) {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-preview-head {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-preview-label {
  color: rgba(247, 248, 251, 0.75);
}

.modal-overlay.modal-overlay--ds .preview-zoom-toolbar--setup .preview-zoom-btn,
.layout.layout--ds .workspace-analyze-setup-root .preview-zoom-toolbar--setup:not(.ds-drawing-zoom) .preview-zoom-btn {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: #f7f8fb;
}

.modal-overlay.modal-overlay--ds .preview-zoom-toolbar--setup .preview-zoom-btn:hover,
.layout.layout--ds .workspace-analyze-setup-root .preview-zoom-toolbar--setup:not(.ds-drawing-zoom) .preview-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(127, 149, 255, 0.45);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-preview-wrap:not(.ds-drawing-area) {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(248, 249, 252, 0.08);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-preview-column:not(.ds-blueprint-card) .analyze-setup-preview-placeholder {
  color: rgba(247, 248, 251, 0.55);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-preview-column:not(.ds-blueprint-card) .analyze-setup-preview-hint {
  color: rgba(247, 248, 251, 0.45);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-submit-btn {
  border: 0;
  background: linear-gradient(135deg, #151a27, #5368e8);
  box-shadow: 0 18px 36px rgba(83, 104, 232, 0.26);
  min-height: 38px;
  transition:
    transform var(--transition-interactive),
    filter var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

.layout.layout--ds .workspace-analyze-setup-root .analyze-setup-submit-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.modal-overlay.modal-overlay--ds .params-dialog {
  background: rgba(20, 24, 35, 0.97);
  border-color: rgba(255, 255, 255, 0.12);
}

.modal-overlay.modal-overlay--ds .params-head h2 {
  color: #f7f8fb;
}

.modal-overlay.modal-overlay--ds .params-grid .drawer-label {
  color: rgba(247, 248, 251, 0.62);
}

.modal-overlay.modal-overlay--ds .params-grid .drawer-label textarea,
.modal-overlay.modal-overlay--ds .params-grid .drawer-label input,
.modal-overlay.modal-overlay--ds #economicsParamsText {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: #f7f8fb;
}

.enterprise-params-modal-material {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.enterprise-params-modal-material-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.modal-overlay.modal-overlay--ds .enterprise-params-modal-material-scroll {
  max-height: min(260px, 42vh);
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-overlay.modal-overlay--ds .enterprise-params-material-table {
  width: 100%;
  min-width: 0;
}

.modal-overlay.modal-overlay--ds .enterprise-params-material-table th,
.modal-overlay.modal-overlay--ds .enterprise-params-material-table td {
  padding: 6px 8px;
  vertical-align: middle;
}

.modal-overlay.modal-overlay--ds .enterprise-params-material-cell {
  width: 100%;
  box-sizing: border-box;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #f7f8fb;
  font-family: inherit;
  font-size: 12px;
}

.modal-overlay.modal-overlay--ds #enterpriseParamsFields .drawer-label {
  color: rgba(247, 248, 251, 0.62);
}

.modal-overlay.modal-overlay--ds #enterpriseParamsFields input,
.modal-overlay.modal-overlay--ds #enterpriseParamsFields textarea,
.modal-overlay.modal-overlay--ds #enterpriseParamsFields select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: #f7f8fb;
  transition: border-color var(--transition-interactive), background-color var(--transition-interactive);
}

.modal-overlay.modal-overlay--ds .params-grid .drawer-label input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.modal-overlay.modal-overlay--ds #enterpriseParamsFields input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.modal-overlay.modal-overlay--ds #enterpriseParamsFields select {
  min-height: var(--control-min-height);
}

.modal-overlay.modal-overlay--ds .params-grid .drawer-label textarea,
.modal-overlay.modal-overlay--ds #economicsParamsText,
.modal-overlay.modal-overlay--ds #enterpriseParamsFields textarea {
  min-height: 72px;
}

.modal-overlay.modal-overlay--ds .params-grid .drawer-label input:not([type="file"]):hover,
.modal-overlay.modal-overlay--ds .params-grid .drawer-label textarea:hover,
.modal-overlay.modal-overlay--ds #economicsParamsText:hover,
.modal-overlay.modal-overlay--ds #enterpriseParamsFields input:not([type="file"]):hover,
.modal-overlay.modal-overlay--ds #enterpriseParamsFields textarea:hover,
.modal-overlay.modal-overlay--ds #enterpriseParamsFields select:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.modal-overlay.modal-overlay--ds #erpIntegrationModal .params-grid select,
.modal-overlay.modal-overlay--ds #erpIntegrationModal .params-grid .drawer-label input[type="date"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: #f7f8fb;
  min-height: var(--control-min-height);
}

.modal-overlay.modal-overlay--ds #erpIntegrationModal .params-grid select:hover,
.modal-overlay.modal-overlay--ds #erpIntegrationModal .params-grid .drawer-label input[type="date"]:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.modal-overlay.modal-overlay--ds .erp-inline-check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

/* Окно «Подключение к ERP»: компактная колонка, без лишних «полей» под кнопками */
#erpIntegrationModal .erp-integration-dialog {
  display: flex;
  flex-direction: column;
  width: min(560px, 94vw);
  max-height: min(88vh, 680px);
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#erpIntegrationModal .erp-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#erpIntegrationModal .erp-integration-dialog .params-head {
  padding: 16px 22px 8px;
}

#erpIntegrationModal .erp-integration-dialog .modal-intro {
  margin: 6px 0 0;
}

#erpIntegrationModal .params-grid.params-grid--erp {
  padding: 4px 22px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  max-height: none;
  overflow: visible;
}

#erpIntegrationModal .params-grid--erp .erp-field-span-2 {
  grid-column: 1 / -1;
}

#erpIntegrationModal .params-grid.params-grid--erp-checks {
  padding: 0 22px 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  max-height: none;
  overflow: visible;
}

#erpIntegrationModal .params-grid.params-grid--erp-dates {
  padding: 0 22px 12px;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  max-height: none;
  overflow: visible;
}

#erpIntegrationModal .erp-import-heading {
  margin: 6px 22px 8px;
}

#erpIntegrationModal .erp-row-actions {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 1.35fr);
  gap: 12px 14px;
  align-items: center;
  padding: 10px 22px 14px;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
}

#erpIntegrationModal .erp-row-actions--import {
  padding-bottom: 16px;
}

#erpIntegrationModal .erp-row-actions .btn-erp-action {
  width: 100%;
  margin: 0;
}

#erpIntegrationModal .erp-status-text {
  display: block;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

#erpIntegrationModal .modal-actions.modal-actions--erp-footer {
  flex-shrink: 0;
  margin-top: 0;
  justify-content: stretch;
  gap: 10px;
  padding: 14px 22px 18px;
}

#erpIntegrationModal .modal-actions.modal-actions--erp-footer .btn {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 520px) {
  #erpIntegrationModal .params-grid.params-grid--erp-checks {
    grid-template-columns: 1fr;
  }

  #erpIntegrationModal .erp-row-actions {
    grid-template-columns: 1fr;
  }
}

.modal-overlay.modal-overlay--ds .economics-param-list {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(247, 248, 251, 0.88);
}

/* —— Этап 7: узкая ширина — workspace-сетка, модальные формы —— */
@media (max-width: 900px) {
  .workspace-content-row {
    grid-template-columns: 1fr;
  }

  .layout.layout--ds .workspace-content-row.workspace-content-row--ds {
    grid-template-columns: 1fr;
  }

  .layout.layout--ds .workspace-main.workspace-main--ds {
    padding-right: 12px;
  }

  .layout.layout--ds .workspace-tabs-card .tab-panels {
    min-height: 0;
  }

  .layout.layout--ds .workspace-tabs-card .tab-panel {
    min-height: 0;
  }

  .layout.layout--ds .workspace-preview-wrap:not(.ds-drawing-area) {
    min-height: 260px;
    max-height: 52vh;
  }

  .analyze-setup-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(140px, 28vh);
  }

  .analyze-setup-required,
  .analyze-setup-extra {
    grid-template-columns: 1fr;
  }

  .export-dialog-grid {
    grid-template-columns: 1fr;
    max-height: min(72vh, 620px);
  }

  .params-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .layout.layout--ds {
    padding: 10px;
  }

  .layout.layout--ds .workspace-frame.workspace-frame--ds {
    min-height: 0;
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .layout.layout--ds .workspace-body {
    --sidebar-expanded: min(286px, 82vw);
    --sidebar-collapsed: 72px;
  }

  .layout.layout--ds .workspace-head.workspace-head--ds {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    padding: 14px 14px 12px;
    gap: 12px;
  }

  .layout.layout--ds .workspace-org.workspace-org--ds {
    justify-self: center;
  }

  .layout.layout--ds .workspace-connection.workspace-connection--ds {
    justify-self: center;
    text-align: center;
    font-size: 11px;
    line-height: 1.45;
  }

  .layout.layout--ds .workspace-meta-chips {
    justify-content: center;
  }

  .workspace-body {
    padding: 10px 10px 14px;
  }

  .workspace-main {
    padding-right: 8px;
    padding-bottom: 88px;
  }

  .layout.layout--ds .workspace-inline-btn {
    margin: 0 auto;
    width: min(420px, 100%);
  }

  .layout.layout--ds .workspace-tabs-card.workspace-panel--tabs {
    display: flex;
    flex-direction: column;
  }

  .analyze-setup-dialog:not(.analyze-setup-dialog--idle-inline) {
    padding: 8px 10px;
    gap: 6px;
  }

  .analyze-setup-submit-btn {
    min-width: min(200px, 100%);
    width: auto;
  }

  .export-dialog {
    padding: 12px 14px 16px;
  }

  .modal-overlay.modal-overlay--ds .modal-dialog.modal-dialog--ds {
    margin-top: auto;
    margin-bottom: auto;
    margin-left: 10px;
    margin-right: 10px;
    max-width: calc(100vw - 20px);
  }

  .drawer.drawer--ds.drawer-centered {
    padding: 12px;
  }
}

@media (max-width: 1100px) {
  .content {
    flex-direction: column;
  }
  .preview-card {
    width: 100%;
  }
  .admin-toolbar,
  .admin-form {
    grid-template-columns: 1fr;
  }
}


/* ═══ ECONOMICS MODULE (DesignScroll) ═══ */
/* ══════════════════════════════════════
       ECONOMICS MODAL
       ══════════════════════════════════════ */
    .eco-modal {
      position: fixed;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background: rgba(10, 12, 18, 0.62);
      backdrop-filter: blur(14px);
      overflow-y: auto;
    }
    .eco-dialog {
      width: min(1020px, 100%);
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      border: 1px solid var(--line);
      border-radius: var(--radius-xl);
      background: rgba(18, 23, 34, 0.98);
      box-shadow: var(--shadow);
      overflow: hidden;
      margin: auto;
    }
    body.light .eco-dialog {
      background: rgba(255, 255, 255, 0.98);
    }
    .eco-dialog-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 18px 24px 14px;
      border-bottom: 1px solid var(--line);
      flex-shrink: 0;
    }
    .eco-dialog-head h2 {
      margin: 0 0 2px;
      font-size: 18px;
      letter-spacing: -0.04em;
    }
    .eco-dialog-head p {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
    }
    .eco-dialog-head .eco-head-actions {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .eco-back-btn {
      min-height: 36px;
      padding: 7px 14px;
      border-radius: 12px;
      color: var(--muted);
      background: var(--panel);
      border: 1px solid var(--line);
      cursor: pointer;
      font-size: 13px;
      font-weight: 700;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .eco-back-btn:hover {
      color: var(--text);
      background: var(--panel-strong);
    }
    .eco-dialog-body {
      padding: 18px 24px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .eco-dialog-footer-actions {
      display: flex;
      gap: 10px;
      justify-content: space-between;
      align-items: center;
      padding-top: 10px;
      border-top: 1px solid var(--line);
      margin-top: 2px;
    }
    .eco-planned-preview-btn {
      flex-shrink: 0;
    }

    /* mode selector (sliding glider) */
    .eco-mode-selector {
      position: relative;
    }
    .eco-mode-selector-row {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
    }
    .eco-mode-glider {
      position: absolute;
      z-index: 0;
      top: 0;
      left: 0;
      width: calc((100% - 16px) / 3);
      height: 100%;
      border-radius: 14px;
      background: rgba(127, 149, 255, 0.12);
      border: 1.5px solid var(--accent-strong);
      box-sizing: border-box;
      pointer-events: none;
      box-shadow: 0 0 0 1px rgba(127, 149, 255, 0.08);
      transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
      transform: translateX(calc(var(--eco-mode-index, 0) * (100% + 8px)));
      will-change: transform;
    }
    body.light .eco-mode-glider {
      background: rgba(127, 149, 255, 0.14);
      border-color: var(--accent-strong);
      box-shadow: 0 2px 12px rgba(127, 149, 255, 0.12);
    }
    .eco-mode-opt {
      padding: 11px 14px;
      border-radius: 14px;
      border: 1.5px solid var(--line);
      background: transparent;
      cursor: pointer;
      display: flex;
      align-items: flex-start;
      gap: 10px;
      transition: border-color 0.35s ease, background 0.35s ease, color 0.25s ease;
      text-align: left;
    }
    .eco-mode-opt.selected {
      border-color: transparent;
    }
    .eco-mode-opt:not(.selected):hover {
      border-color: rgba(127, 149, 255, 0.45);
      background: rgba(127, 149, 255, 0.05);
    }
    .eco-mode-opt .eco-mode-icon {
      width: 32px;
      height: 32px;
      border-radius: 9px;
      background: var(--panel-strong);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      color: var(--accent);
    }
    .eco-mode-opt.selected .eco-mode-icon {
      background: rgba(127, 149, 255, 0.2);
    }
    .eco-mode-opt .eco-mode-icon svg {
      width: 16px;
      height: 16px;
    }
    .eco-mode-opt-text { display: flex; flex-direction: column; gap: 3px; }
    .eco-mode-opt strong {
      font-size: 13px;
      font-weight: 700;
      display: block;
    }
    .eco-mode-opt span {
      font-size: 11.5px;
      color: var(--muted);
      line-height: 1.4;
      display: block;
    }

    /* file strip */
    .eco-file-strip {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 11px 16px;
      border: 1.5px dashed rgba(255, 255, 255, 0.28);
      border-radius: 14px;
      background: var(--panel);
    }
    body.light .eco-file-strip {
      border-color: rgba(18, 22, 33, 0.2);
    }
    .eco-file-strip strong {
      font-size: 13px;
    }
    .eco-file-strip span {
      flex: 1;
      font-size: 12px;
      color: var(--muted);
    }

    /* main params two-column */
    .eco-params-split {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    .eco-params-block {
      border: 1px solid var(--line);
      border-radius: 14px;
      overflow: hidden;
    }
    .eco-field-row {
      display: flex;
      align-items: center;
      border-bottom: 1px solid var(--line);
    }
    .eco-field-row:last-child {
      border-bottom: none;
    }
    .eco-field-label {
      flex: 1;
      padding: 8px 14px;
      font-size: 12px;
      color: var(--muted);
      line-height: 1.3;
    }
    .eco-field-input {
      width: 120px;
      border: none;
      border-left: 1px solid var(--line);
      background: var(--panel-strong);
      color: #ffffff;
      font: inherit;
      font-size: 13px;
      font-weight: 700;
      padding: 8px 12px;
      text-align: right;
      outline: none;
      transition: background 0.15s;
    }
    .eco-field-input:focus {
      background: rgba(127, 149, 255, 0.12);
    }
    .eco-checkbox-wrap {
      padding: 8px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 12px;
      color: var(--muted);
    }
    .eco-checkbox-wrap input[type=checkbox] {
      width: 15px;
      height: 15px;
      accent-color: var(--accent-strong);
      cursor: pointer;
    }

    /* cycle grid */
    .eco-cycle-table {
      width: 100%;
      border-collapse: collapse;
    }
    .eco-cycle-table th {
      padding: 7px 12px;
      font-size: 10.5px;
      font-weight: 800;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--muted);
      border-bottom: 1px solid var(--line);
      text-align: center;
    }
    .eco-cycle-table th:first-child { text-align: left; }
    .eco-cycle-table td {
      padding: 0;
      border-bottom: 1px solid var(--line);
      font-size: 12px;
    }
    .eco-cycle-table tr:last-child td { border-bottom: none; }
    .eco-cycle-table .eco-cycle-lbl {
      padding: 8px 14px;
      color: var(--muted);
      display: block;
      line-height: 1.3;
    }
    .eco-cycle-input {
      width: 100%;
      border: none;
      border-left: 1px solid var(--line);
      background: rgba(127, 149, 255, 0.1);
      color: #ffffff;
      font: inherit;
      font-size: 12.5px;
      font-weight: 800;
      padding: 8px 12px;
      text-align: center;
      outline: none;
      transition: background 0.15s;
    }
    .eco-cycle-input:focus {
      background: rgba(127, 149, 255, 0.2);
    }
    body.light .eco-cycle-input {
      background: rgba(127, 149, 255, 0.12);
      color: #4a5fd4;
    }

    /* light theme fixes for eco inputs */
    body.light .eco-field-input {
      background: rgba(16, 20, 31, 0.06);
      color: #141722;
    }
    body.light .eco-field-input:focus {
      background: rgba(127, 149, 255, 0.14);
    }
    body.light .eco-params-block {
      border-color: rgba(16, 20, 31, 0.12);
      background: #ffffff;
    }
    body.light .eco-field-row {
      border-bottom-color: rgba(16, 20, 31, 0.08);
    }
    body.light .eco-field-label {
      color: rgba(20, 23, 34, 0.65);
    }
    body.light .eco-field-input {
      border-left-color: rgba(16, 20, 31, 0.1);
    }
    body.light .eco-cycle-table th,
    body.light .eco-cycle-table td {
      border-color: rgba(16, 20, 31, 0.08);
    }
    body.light .eco-cycle-lbl {
      color: rgba(20, 23, 34, 0.65);
    }
    body.light .eco-action-tile {
      background: #ffffff;
      border-color: rgba(16, 20, 31, 0.12);
      color: #141722;
    }
    body.light .eco-action-tile:hover {
      border-color: #7f95ff;
      background: rgba(127, 149, 255, 0.08);
    }
    body.light .eat-icon {
      background: rgba(127, 149, 255, 0.12);
    }
    body.light .eco-mode-opt {
      background: transparent;
      border-color: rgba(16, 20, 31, 0.12);
    }
    body.light .eco-mode-opt.selected {
      border-color: transparent;
    }
    body.light .eco-mode-opt:not(.selected):hover {
      border-color: rgba(127, 149, 255, 0.55);
      background: rgba(127, 149, 255, 0.06);
    }
    body.light .eco-mode-icon {
      background: rgba(127, 149, 255, 0.12);
    }
    body.light .eco-dialog-head {
      border-bottom-color: rgba(16, 20, 31, 0.1);
    }
    body.light .eco-section-label {
      color: rgba(20, 23, 34, 0.5);
    }
    body.light .eco-checkbox-wrap {
      color: rgba(20, 23, 34, 0.65);
    }

    /* action buttons */
    .eco-actions-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }
    .eco-action-tile {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 11px 14px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--panel);
      cursor: pointer;
      transition: border-color 0.15s, background 0.15s, transform 0.15s;
      font: inherit;
      color: var(--text);
      text-align: left;
    }
    .eco-action-tile:hover {
      border-color: var(--accent-strong);
      background: rgba(127, 149, 255, 0.1);
      transform: translateY(-1px);
    }
    .eco-action-tile .eat-icon {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: var(--panel-strong);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      color: var(--accent);
    }
    .eco-action-tile .eat-icon svg {
      width: 17px;
      height: 17px;
    }
    .eco-action-tile-text { display: flex; flex-direction: column; gap: 2px; }
    .eco-action-tile strong {
      font-size: 12.5px;
      font-weight: 700;
      line-height: 1.3;
    }
    .eco-action-tile span {
      font-size: 11px;
      color: var(--muted);
    }

    /* detail table modal (nested) */
    .eco-table-modal {
      position: fixed;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 24px;
      background: rgba(10, 12, 18, 0.7);
      backdrop-filter: blur(12px);
    }
    .eco-table-dialog {
      width: min(1480px, 98vw);
      max-height: 90vh;
      display: flex;
      flex-direction: column;
      border: 1px solid var(--line);
      border-radius: var(--radius-xl);
      background: rgba(18, 23, 34, 0.99);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    body.light .eco-table-dialog {
      background: rgba(255, 255, 255, 0.99);
    }
    body.light .eco-table-head {
      border-bottom-color: rgba(16, 20, 31, 0.1);
    }
    body.light .eco-data-table td {
      border-bottom-color: rgba(16, 20, 31, 0.07);
    }
    body.light .eco-data-table td input {
      color: #141722;
    }
    body.light .eco-data-table td select.eco-vat-select {
      color: #141722;
    }
    body.light .eco-table-modal .eco-data-table td.eco-cell-vat select.eco-vat-select {
      color: #141722 !important;
    }
    body.light .eco-data-table td input:focus {
      background: rgba(127, 149, 255, 0.08);
    }
    body.light .eco-table-footer {
      border-top-color: rgba(16, 20, 31, 0.1);
    }
    body.light .eco-total-chip {
      background: rgba(16, 20, 31, 0.05);
      border-color: rgba(16, 20, 31, 0.1);
    }
    body.light .eco-total-chip strong {
      color: #4a5fd4;
    }
    .eco-table-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 18px 24px;
      border-bottom: 1px solid var(--line);
      flex-shrink: 0;
    }
    .eco-table-head h3 { margin: 0; font-size: 17px; letter-spacing: -0.03em; }
    .eco-table-actions { display: flex; gap: 10px; align-items: center; }
    .eco-table-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; }
    .eco-data-table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
      font-size: 12.5px;
    }
    .eco-data-table th {
      position: sticky;
      top: 0;
      padding: 9px 12px;
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      background: rgba(18, 23, 34, 0.97);
      border-bottom: 1px solid var(--line);
      white-space: normal;
      word-break: break-word;
      text-align: left;
    }
    body.light .eco-data-table th {
      background: rgba(248, 249, 252, 0.97);
    }
    .eco-data-table td {
      padding: 0;
      border-bottom: 1px solid var(--line);
      vertical-align: middle;
    }
    .eco-data-table tr:last-child td { border-bottom: none; }
    .eco-data-table td input {
      width: 100%;
      border: none;
      background: transparent;
      color: #ffffff;
      font: inherit;
      font-size: 11.5px;
      padding: 8px 9px;
      outline: none;
      min-width: 0;
    }
    .eco-data-table td input:focus {
      background: rgba(127, 149, 255, 0.08);
    }
    .eco-data-table .td-new td { background: rgba(137, 230, 194, 0.06); }
    .eco-table-footer {
      padding: 14px 24px;
      border-top: 1px solid var(--line);
      display: flex;
      align-items: center;
      gap: 12px;
      flex-shrink: 0;
      flex-wrap: wrap;
    }
    .eco-total-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      border-radius: 12px;
      background: var(--panel);
      border: 1px solid var(--line);
      font-size: 12px;
    }
    .eco-total-chip strong {
      font-size: 14px;
      font-weight: 800;
      color: var(--accent);
    }
    .eco-file-only-notice {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 12px;
      background: rgba(137, 230, 194, 0.08);
      border: 1px solid rgba(137, 230, 194, 0.3);
      font-size: 12.5px;
      color: var(--success);
      line-height: 1.5;
    }
    .eco-file-only-notice svg {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
    }
    .eco-section-label {
      font-size: 10.5px;
      font-weight: 800;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 6px;
    }

/* demo: переменные темы для экономического модуля */
.eco-modal,
.eco-table-modal {
  --eco-line: rgba(255, 255, 255, 0.14);
  --eco-muted: rgba(247, 248, 251, 0.58);
  --eco-text: #f7f8fb;
  --eco-panel: rgba(255, 255, 255, 0.06);
  --eco-panel-strong: rgba(255, 255, 255, 0.11);
  --eco-accent: #7f95ff;
  --eco-accent-strong: rgba(127, 149, 255, 0.85);
  --eco-success: #89e6c2;
  --eco-danger: #f87171;
  --eco-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --eco-radius-xl: 34px;
}

.eco-modal .eco-dialog,
.eco-table-modal .eco-table-dialog {
  --line: var(--eco-line);
  --muted: var(--eco-muted);
  --text: var(--eco-text);
  --panel: var(--eco-panel);
  --panel-strong: var(--eco-panel-strong);
  --accent: var(--eco-accent);
  --accent-strong: var(--eco-accent-strong);
  --success: var(--eco-success);
  --danger: var(--eco-danger);
  --shadow: var(--eco-shadow);
  --radius-xl: var(--eco-radius-xl);
  /* Иначе наследуется тёмный :root/body color — нечитаемо на тёмном фоне модалки */
  color: var(--text);
}
body.light .eco-modal .eco-dialog,
body.light .eco-table-modal .eco-table-dialog {
  color: #141722;
}

/* Кнопки режима ввода: у <button> иначе цвет текста сбрасывается на системный тёмный */
.eco-modal .eco-mode-opt,
.eco-modal .eco-mode-opt strong {
  color: #ffffff;
}

.eco-modal .eco-mode-opt span {
  color: rgba(255, 255, 255, 0.92);
}

body.light .eco-modal .eco-mode-opt,
body.light .eco-modal .eco-mode-opt strong {
  color: #141722;
}

body.light .eco-modal .eco-mode-opt span {
  color: rgba(20, 23, 34, 0.78);
}

#economicsParamsModal.eco-modal {
  z-index: 2050;
}

/* Поверх «Экономические параметры» (2050): предупреждение и таблица предпросмотра */
#plannedCalcPreviewWarnModal.modal-overlay {
  z-index: 2060;
}

#plannedCalcModal.modal-overlay {
  z-index: 2070;
}

#ecoTableModal.eco-table-modal:not(.hidden) {
  display: grid !important;
}

#ecoTableModal.eco-table-modal {
  z-index: 12000;
}

/* Иначе средняя колонка flex может схлопнуться в 0px — таблицы «не видны». */
#ecoTableModal .eco-table-dialog {
  min-height: min(560px, 90vh);
}

#ecoTableModal #ecoTableMount.eco-table-wrap {
  flex: 1 1 auto;
  min-height: min(360px, 72vh);
  max-height: min(78vh, 920px);
}

.eco-modal .secondary-btn,
.eco-modal .primary-btn,
.eco-table-modal .secondary-btn,
.eco-table-modal .primary-btn {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.eco-modal .secondary-btn {
  color: rgba(247, 248, 251, 0.92);
  background: rgba(255, 255, 255, 0.08);
}

.eco-modal .secondary-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.eco-modal .primary-btn {
  color: #ffffff;
  border: 0;
  background: linear-gradient(135deg, #151a27, #5368e8);
  box-shadow: 0 14px 28px rgba(83, 104, 232, 0.28);
}

.eco-modal .primary-btn:hover {
  filter: brightness(1.05);
}

.eco-table-modal .icon-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: rgba(247, 248, 251, 0.55);
  padding: 4px 10px;
  border-radius: 10px;
}

.eco-table-modal .icon-close:hover {
  color: #f7f8fb;
  background: rgba(255, 255, 255, 0.08);
}

.eco-table-section {
  margin-bottom: 28px;
}
.eco-table-section:last-child {
  margin-bottom: 8px;
}
.eco-table-section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.35;
  color: var(--text);
}
.eco-table-doc-head {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.eco-table-doc-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.eco-table-doc-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
}
.eco-table-doc-subtitle {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}
.eco-table-section-sub {
  font-size: 11px;
  color: var(--muted);
  margin: -4px 0 10px;
}
.eco-table-section-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.eco-table-section-actions .secondary-btn {
  font-size: 12px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 10px;
}

.eco-cell-yellow,
.eco-data-table td.eco-cell-yellow input,
.eco-data-table td.eco-cell-yellow select {
  background: rgba(83, 104, 232, 0.2) !important;
}
body.light .eco-cell-yellow,
body.light .eco-data-table td.eco-cell-yellow input,
body.light .eco-data-table td.eco-cell-yellow select {
  background: rgba(83, 104, 232, 0.14) !important;
}

/* Заполняемые ячейки на подсветке — белый текст на тёмном фоне модалки */
.eco-table-modal .eco-data-table td.eco-cell-yellow input,
.eco-table-modal .eco-data-table td.eco-cell-yellow select,
.eco-table-modal .eco-data-table td.eco-cell-green input {
  color: #ffffff !important;
}
body.light .eco-table-modal .eco-data-table td.eco-cell-yellow input,
body.light .eco-table-modal .eco-data-table td.eco-cell-yellow select,
body.light .eco-table-modal .eco-data-table td.eco-cell-green input {
  color: #141722 !important;
}

.eco-cell-green,
.eco-data-table td.eco-cell-green input {
  background: rgba(137, 230, 194, 0.28) !important;
}
body.light .eco-cell-green,
body.light .eco-data-table td.eco-cell-green input {
  background: rgba(120, 200, 160, 0.38) !important;
}

.eco-cell-readonly input,
.eco-cell-calc input {
  cursor: default;
  font-variant-numeric: tabular-nums;
}
.eco-cell-readonly input {
  opacity: 0.92;
}

.eco-data-table td.eco-cell-muted {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 9px;
  vertical-align: middle;
}

.eco-data-table td.eco-cell-strong {
  font-weight: 700;
  font-size: 11.5px;
  padding: 8px 9px;
  color: var(--text);
}

.eco-table-modal .eco-data-table td.eco-cell-material-name {
  background: rgba(255, 255, 255, 0.06);
}
body.light .eco-table-modal .eco-data-table td.eco-cell-material-name {
  background: rgba(16, 20, 31, 0.06);
}
.eco-table-modal .eco-data-table td.eco-cell-material-name input {
  color: #ffffff !important;
}
body.light .eco-table-modal .eco-data-table td.eco-cell-material-name input {
  color: #141722 !important;
}

.eco-table-modal .eco-data-table td.eco-cell-vat {
  background: rgba(255, 255, 255, 0.04);
}
body.light .eco-table-modal .eco-data-table td.eco-cell-vat {
  background: rgba(16, 20, 31, 0.05);
}

.eco-table-modal .eco-data-table td.eco-cell-calc input {
  color: #ffffff !important;
  font-weight: 700;
}
body.light .eco-table-modal .eco-data-table td.eco-cell-calc input {
  color: #0d5034 !important;
}

.eco-table-modal .eco-data-table input::placeholder {
  color: rgba(247, 248, 251, 0.42);
}
body.light .eco-table-modal .eco-data-table input::placeholder {
  color: rgba(20, 23, 34, 0.45);
}

.eco-table-modal .eco-table-section-title,
.eco-table-modal .eco-norms-doc-title {
  color: var(--text);
}

.eco-material-row-del {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 18px;
  line-height: 1;
  color: rgba(247, 248, 251, 0.55);
}
.eco-material-row-del:hover {
  color: var(--eco-danger, #f87171);
}
body.light .eco-material-row-del {
  color: rgba(20, 23, 34, 0.45);
}

.eco-data-table.eco-materials-table {
  border: 2px solid rgba(83, 104, 232, 0.55);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
body.light .eco-data-table.eco-materials-table {
  border-color: rgba(83, 104, 232, 0.45);
}

.eco-data-table.eco-materials-table thead tr.eco-material-head-row th {
  position: relative;
  top: auto;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 700;
  font-size: 10px;
  line-height: 1.25;
}
.eco-data-table.eco-materials-table thead .eco-material-banner-cell,
.eco-data-table.eco-materials-table thead tr.eco-material-colnums th {
  position: relative;
  top: auto;
}
.eco-material-banner-cell {
  padding: 14px 16px !important;
  background: rgba(127, 149, 255, 0.1);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
body.light .eco-material-banner-cell {
  background: rgba(127, 149, 255, 0.12);
}
.eco-material-banner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  text-align: center;
}
.eco-material-form-num {
  align-self: flex-end;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.eco-material-banner-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

/* Шапка формы № 7 (услуги сторонних организаций) */
.eco-services-form-banner .eco-services-banner-line {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
}
.eco-services-meta-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}
.eco-services-meta-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.eco-services-meta-underline {
  flex: 1;
  max-width: min(420px, 100%);
  min-height: 1.1em;
  border-bottom: 1px solid var(--line);
}
.eco-services-meta-hint {
  font-size: 10.5px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.35;
}

/* Шапка блока «Расшифровка основной ЗП» в оценке трудочасов */
.eco-labor-salary-banner .eco-labor-salary-banner-line {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}
.eco-labor-salary-banner .eco-labor-salary-paren {
  font-weight: 600;
  font-style: italic;
  color: var(--muted);
}
.eco-data-table td.eco-labor-total-x {
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.eco-material-colnums th {
  text-align: center;
  font-weight: 800;
  font-size: 11px;
  color: var(--muted);
  padding: 6px 8px !important;
}
.eco-material-actions-head {
  width: 40px;
}
.eco-material-form-wrap {
  margin-bottom: 28px;
}

.eco-data-table td select.eco-vat-select {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  padding: 8px 9px;
  outline: none;
  color: #ffffff;
  cursor: pointer;
}
.eco-table-modal .eco-data-table td.eco-cell-vat select.eco-vat-select {
  color: #ffffff !important;
}

.eco-norms-footnote {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

/* Бланк «Нормативы» — как макет формы (рамка, центрирование колонок 1–4). */
.eco-norms-doc-title {
  text-align: center;
  font-weight: 800;
}
.eco-data-table.eco-norms-table {
  border: 2px solid rgba(83, 104, 232, 0.55);
  border-radius: 6px;
  overflow: hidden;
}
body.light .eco-data-table.eco-norms-table {
  border-color: rgba(83, 104, 232, 0.45);
}
.eco-data-table.eco-norms-table thead tr:first-child th:first-child,
.eco-data-table.eco-norms-table thead tr:first-child th:nth-child(3),
.eco-data-table.eco-norms-table thead tr:first-child th:nth-child(4) {
  text-align: center;
}
.eco-data-table.eco-norms-table thead tr:first-child th:nth-child(2) {
  text-align: left;
}
.eco-data-table.eco-norms-table tbody td:first-child,
.eco-data-table.eco-norms-table tbody td:nth-child(3),
.eco-data-table.eco-norms-table tbody td:nth-child(4) {
  text-align: center;
}
.eco-data-table.eco-norms-table tbody td:nth-child(2) {
  text-align: left;
}
.eco-data-table.eco-norms-table td.eco-cell-yellow input {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Нормативы: шапка и сноска читаемее на тёмном фоне модалки */
.eco-table-modal .eco-data-table.eco-norms-table thead th {
  color: rgba(247, 248, 251, 0.9);
}
body.light .eco-table-modal .eco-data-table.eco-norms-table thead th {
  color: rgba(20, 23, 34, 0.78);
}
.eco-table-modal .eco-data-table.eco-norms-table tbody td.eco-cell-muted {
  color: rgba(247, 248, 251, 0.78);
}
body.light .eco-table-modal .eco-data-table.eco-norms-table tbody td.eco-cell-muted {
  color: rgba(20, 23, 34, 0.55);
}
.eco-table-modal .eco-norms-wrap .eco-norms-footnote {
  color: rgba(247, 248, 251, 0.82);
}
body.light .eco-table-modal .eco-norms-wrap .eco-norms-footnote {
  color: rgba(20, 23, 34, 0.68);
}

/* Компактные кнопки детальных таблиц (ручной ввод в окне экономики) */
.eco-table-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(208px, 1fr));
  gap: 10px;
  align-items: stretch;
  margin-top: 4px;
}
.eco-table-shortcut-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 12px;
  text-align: center;
  white-space: normal;
  box-sizing: border-box;
}

/* Блок входа в таблицу «Нормативы» в окне экономики — всегда на всю ширину колонки */
.eco-norms-promo {
  margin-top: 6px;
  margin-bottom: 6px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
body.light .eco-norms-promo {
  background: rgba(16, 20, 31, 0.04);
  border-color: rgba(16, 20, 31, 0.12);
}
.eco-norms-promo-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}
.eco-norms-open-btn {
  width: 100%;
  justify-content: center;
  min-height: 44px;
  font-weight: 800;
  font-size: 14px;
  border-radius: 14px;
}

.eco-actions-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.eco-actions-grid--one {
  grid-template-columns: minmax(0, 1fr);
}

/* Плановая калькуляция */
.planned-calc-preview-warn-dialog {
  width: min(520px, 92vw);
}
.planned-calc-preview-warn-body {
  padding: 0 24px 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}
.planned-calc-preview-warn-body p {
  margin: 0 0 12px;
}
.planned-calc-preview-warn-body p:last-child {
  margin-bottom: 0;
}
.planned-calc-dialog {
  width: min(920px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.planned-calc-dialog .params-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.planned-calc-modal-intro,
.planned-calc-modal-status {
  padding: 0 24px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
}
.planned-calc-modal-intro {
  color: var(--muted);
}
.planned-calc-modal-status {
  min-height: 1.35em;
}
.planned-calc-subhead-row th {
  text-align: center;
  font-size: 10px;
  font-style: italic;
  font-weight: 600;
  background: rgba(127, 149, 255, 0.08);
}
body.light .planned-calc-subhead-row th {
  background: rgba(83, 104, 232, 0.08);
}
.planned-calc-table--readonly td.planned-total-cell input[readonly] {
  cursor: default;
}
.planned-calc-currency-hint {
  text-align: right;
  padding: 0 24px 8px;
  font-size: 11px;
  color: var(--muted);
}
.planned-calc-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 24px 16px;
}
.planned-calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 2px solid rgba(83, 104, 232, 0.55);
}
body.light .planned-calc-table {
  border-color: rgba(83, 104, 232, 0.45);
}
.planned-calc-table th {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: rgba(127, 149, 255, 0.12);
  font-size: 11px;
  font-weight: 800;
}
.planned-calc-table td {
  border: 1px solid var(--line);
  padding: 0;
  vertical-align: middle;
}
.planned-calc-table td.planned-name-cell {
  padding: 7px 12px;
  line-height: 1.35;
}
.planned-calc-table td.planned-num-cell {
  padding: 7px 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 72px;
}
.planned-calc-table td.planned-total-cell input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  outline: none;
  color: #ffffff;
}
body.light .planned-calc-table td.planned-total-cell input {
  color: #141722;
}
.planned-calc-table td.planned-total-cell.planned-total--readonly input {
  cursor: default;
  opacity: 0.85;
}
.planned-row-indent-1 .planned-name-cell {
  padding-left: 28px;
  font-style: italic;
  color: var(--muted);
  font-size: 11.5px;
}
.planned-row-indent-2 .planned-name-cell {
  padding-left: 44px;
}

@media (max-width: 960px) {
  .eco-mode-glider {
    display: none;
  }
  .eco-mode-selector-row {
    grid-template-columns: 1fr;
  }
  .eco-mode-opt.selected {
    border-color: var(--accent-strong);
    background: rgba(127, 149, 255, 0.1);
  }
  body.light .eco-mode-opt.selected {
    border-color: #7f95ff;
    background: rgba(127, 149, 255, 0.08);
  }
  .eco-params-split {
    grid-template-columns: 1fr;
  }
  .eco-actions-grid {
    grid-template-columns: 1fr 1fr;
  }
  .eco-actions-grid.eco-actions-grid--two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .eco-actions-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Страница поддержки (support.html): DS + анимированное звёздное небо за текстом ─── */
body.support-space-page {
  margin: 0;
  min-height: 100vh;
  animation: none;
  background: #070910;
  color: #f7f8fb;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

.support-space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.support-space-nebula {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 130% 90% at 50% 115%, rgba(83, 104, 232, 0.35), transparent 58%),
    radial-gradient(ellipse 70% 55% at 12% 18%, rgba(127, 149, 255, 0.18), transparent 52%),
    radial-gradient(ellipse 55% 45% at 88% 22%, rgba(83, 104, 232, 0.12), transparent 48%),
    linear-gradient(185deg, #06070f 0%, #0f141f 42%, #080b14 100%);
}

.support-stars {
  position: absolute;
  inset: -10%;
  background-repeat: repeat;
  will-change: background-position;
}

.support-stars--far {
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 32px 48px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 188px 96px, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 268px 22px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(2px 2px at 104px 212px, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 312px 284px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 72px 276px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 216px 34px, rgba(255, 255, 255, 0.42), transparent),
    radial-gradient(1px 1px at 142px 166px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 380px 140px, rgba(255, 255, 255, 0.38), transparent),
    radial-gradient(1px 1px at 420px 60px, rgba(255, 255, 255, 0.62), transparent);
  background-size: 440px 440px;
  animation: support-starfield-drift-a 110s linear infinite;
}

.support-stars--mid {
  opacity: 0.72;
  background-image:
    radial-gradient(1px 1px at 24px 112px, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 156px 44px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 220px 188px, rgba(247, 248, 251, 0.55), transparent),
    radial-gradient(1px 1px at 88px 240px, rgba(255, 255, 255, 0.48), transparent),
    radial-gradient(1px 1px at 300px 72px, rgba(255, 255, 255, 0.72), transparent),
    radial-gradient(1px 1px at 360px 260px, rgba(255, 255, 255, 0.36), transparent),
    radial-gradient(1px 1px at 48px 320px, rgba(255, 255, 255, 0.58), transparent),
    radial-gradient(2px 2px at 132px 156px, rgba(255, 255, 255, 0.42), transparent);
  background-size: 280px 280px;
  animation: support-starfield-drift-b 68s linear infinite;
}

.support-stars--near {
  opacity: 0.88;
  background-image:
    radial-gradient(1.5px 1.5px at 56px 68px, rgba(255, 255, 255, 0.95), transparent),
    radial-gradient(2px 2px at 190px 124px, rgba(210, 228, 255, 0.75), transparent),
    radial-gradient(1px 1px at 118px 206px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(2px 2px at 246px 48px, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 340px 220px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.5px 1.5px at 22px 284px, rgba(247, 248, 251, 0.85), transparent);
  background-size: 360px 360px;
  animation: support-starfield-drift-c 42s linear infinite;
}

@keyframes support-starfield-drift-a {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 440px 220px;
  }
}

@keyframes support-starfield-drift-b {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -280px 280px;
  }
}

@keyframes support-starfield-drift-c {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 360px 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-stars--far,
  .support-stars--mid,
  .support-stars--near {
    animation: none;
  }
}

.support-space-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 40px);
}

.support-space-card {
  width: min(560px, 100%);
  padding: clamp(28px, 4.5vw, 44px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 23, 34, 0.82);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  text-align: center;
}

.support-space-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(127, 149, 255, 0.92);
}

.support-space-title {
  margin: 0 0 14px;
  font-size: clamp(26px, 5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.045em;
  color: #f7f8fb;
}

.support-space-lead {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 500;
  color: rgba(247, 248, 251, 0.92);
}

.support-space-note {
  margin: 0 0 28px;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(247, 248, 251, 0.58);
}

.support-space-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.support-space-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-min-height);
  padding: 0 22px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition:
    border-color var(--transition-interactive),
    background-color var(--transition-interactive),
    transform var(--transition-interactive),
    filter var(--transition-interactive);
}

.support-space-btn--primary {
  border: none;
  background: linear-gradient(135deg, #151a27, #5368e8);
  color: #f7f8fb;
  box-shadow: 0 16px 36px rgba(83, 104, 232, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.support-space-btn--primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.support-space-btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f7f8fb;
}

.support-space-btn--ghost:hover {
  border-color: rgba(127, 149, 255, 0.45);
  background: rgba(127, 149, 255, 0.1);
}

.support-space-btn:focus-visible {
  outline: 2px solid var(--ds-focus);
  outline-offset: 3px;
}

