/* Токены темы — общие для Django-шаблонов и будущих Dash-страниц. */
:root {
  /* Значения — из фирменного слоя lAIght (brand.css), чтобы экраны задач совпадали с каркасом приложения. */
  --bg: #0a0c0d;
  --surface: #101416;
  --surface-2: #141a1c;
  --border: #242d30;  /* --lg-line-field: у полей мастеров границы должны читаться */
  --text: #e8ecee;
  --text-muted: #98a3a7;
  --accent: oklch(0.82 0.13 205);
  --accent-contrast: #05161c;
  --danger: oklch(0.7 0.17 25);
  --success: oklch(0.78 0.14 155);
  --warning: oklch(0.83 0.14 80);
  --color-si: #8f7cf7;
  --color-sio2: #4cc9c0;
  --radius: 8px;
  --font: "Space Grotesk", Helvetica, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { color: var(--text); font-weight: 600; }

.page { max-width: 1080px; margin: 0 auto; padding: 24px 16px; }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.message {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.message--error { border-color: var(--danger); }
.message--success { border-color: var(--success); }

.muted { color: var(--text-muted); }

.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar__user form { margin: 0; }

/* Кнопки */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.button:hover { border-color: var(--accent); text-decoration: none; }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.button--primary:hover { filter: brightness(1.08); }
.button--ghost { background: transparent; padding: 6px 12px; }
.button--block { width: 100%; }

/* Формы */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; color: var(--text-muted); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field__error { margin: 0; font-size: 13px; color: var(--danger); }
.form-error {
  padding: 10px 14px;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger);
}
.form-error p { margin: 0; }

/* Карточка входа/регистрации */
.auth-card {
  max-width: 380px;
  margin: 8vh auto 0;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.auth-card__title { margin: 0 0 20px; font-size: 22px; }
.auth-card__footer { margin: 20px 0 0; text-align: center; color: var(--text-muted); }

/* Заголовок страницы */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.page-header__title { margin: 0; font-size: 26px; }
.button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

/* Список задач */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.task-card {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--status-color, var(--border));
  border-radius: var(--radius);
}
.task-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.task-card__heading { min-width: 0; }
.task-card__title { margin: 0; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.task-card__type { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }
.task-card__stage { margin: 10px 0 0; font-size: 14px; }
.task-card__hint { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); font-style: italic; }
.task-card__description {
  margin: 10px 0 0;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-card__error {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.task-card__meta { margin: 12px 0 0; font-size: 12px; color: var(--text-muted); }

/* Цвет статуса: метка и полоса слева у карточки */
.task-card--draft, .badge--draft { --status-color: var(--text-muted); }
.task-card--queued, .badge--queued { --status-color: #7f8ba3; }
.task-card--running, .badge--running { --status-color: var(--accent); }
.task-card--awaiting_input, .badge--awaiting_input { --status-color: var(--warning); }
.task-card--completed, .badge--completed { --status-color: var(--success); }
.task-card--failed, .badge--failed { --status-color: var(--danger); }
.task-card--cancelling, .badge--cancelling { --status-color: #e8875b; }
.task-card--cancelled, .badge--cancelled { --status-color: #6b7385; }

.badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--status-color) 45%, transparent);
  background: color-mix(in srgb, var(--status-color) 14%, transparent);
  color: var(--status-color);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.progress { margin-top: 8px; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progress__bar { height: 100%; background: var(--accent); transition: width 0.4s ease; }

.chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.chip__label { color: var(--text-muted); font-family: var(--font-mono); }

.empty-state {
  padding: 48px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state__title { margin: 0 0 6px; font-size: 18px; font-weight: 600; }

@media (max-width: 560px) {
  .task-card { padding: 14px 16px; }
  .task-card__head { flex-direction: column-reverse; gap: 8px; }
}

/* Широкая страница (мастер с панелью предпросмотра) */
.page--wide { max-width: 1440px; }

.breadcrumbs { margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.breadcrumbs span { margin: 0 4px; }

.field__hint { margin: 0; font-size: 12px; color: var(--text-muted); }
.field__hint--derived { margin-top: 6px; font-variant-numeric: tabular-nums; }
.field__hint--derived:empty { display: none; }
.message--warning { border-color: var(--warning); }
.task-card__title a { color: inherit; }
.task-card__title a:hover { color: var(--accent); text-decoration: none; }
.detail-note { margin-top: 16px; }
.empty-state .button { margin-top: 16px; }

/* Каталог типов задач */
.catalog { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
a.catalog-card:hover { border-color: var(--accent); text-decoration: none; }
.catalog-card--disabled { opacity: 0.6; }
.catalog-card__title { margin: 0; font-size: 18px; }
.catalog-card__description { margin: 0; color: var(--text-muted); }
.catalog-card__stages { margin: 4px 0 0; padding-left: 20px; font-size: 13px; color: var(--text-muted); }
.catalog-card__action { margin-top: auto; padding-top: 8px; color: var(--accent); font-weight: 600; }

/* Мастер */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr); gap: 24px; align-items: start; }
.wizard__main {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.wizard__panel { display: flex; flex-direction: column; gap: 20px; }
.wizard__panel-title { margin: 0; font-size: 20px; }
.wizard__note { margin: 0; font-size: 13px; color: var(--text-muted); }
/* Почему заблокированы «Далее» и «Запустить расчёт» — под кнопками, пусто по умолчанию */
.wizard__note--blocking { margin-top: 10px; color: var(--warning); }
.wizard__note--blocking:empty { display: none; }
.wizard__nav { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.wizard__nav-spacer { flex: 1; }
.wizard__status { min-height: 20px; margin-top: 12px; font-size: 13px; }
.status--ok { color: var(--success); }
.status--error { color: var(--danger); }

.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-row > div { min-width: 0; }
.field textarea { resize: vertical; min-height: 64px; }
.field__error:empty { display: none; }

.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 20px; padding: 0 0 16px; border-bottom: 1px solid var(--border); }
.stepper__item { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 14px; }
.stepper__num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.stepper__item--current { color: var(--text); font-weight: 600; }
.stepper__item--current .stepper__num { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.stepper__item--done .stepper__num { border-color: var(--success); color: var(--success); }
.stepper__item--invalid .stepper__num { border-color: var(--danger); color: var(--danger); background: transparent; }

.profile-block { margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.profile-block__legend { padding: 0 6px; font-weight: 600; }
.profile-block__formula { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }

/* Компоненты Dash 4: тема через их CSS-переменные */
.django-plotly-dash {
  --Dash-Fill-Interactive-Strong: var(--accent);
  --Dash-Fill-Interactive-Weak: color-mix(in srgb, var(--accent) 12%, transparent);
  --Dash-Fill-Inverse-Strong: var(--bg);
  --Dash-Fill-Disabled: rgba(255, 255, 255, 0.08);
  --Dash-Fill-Primary-Hover: rgba(255, 255, 255, 0.04);
  --Dash-Fill-Primary-Active: rgba(255, 255, 255, 0.08);
  --Dash-Stroke-Strong: var(--border);
  --Dash-Stroke-Weak: var(--border);
  --Dash-Text-Primary: var(--text);
  --Dash-Text-Strong: var(--text);
  --Dash-Text-Weak: var(--text-muted);
  --Dash-Text-Disabled: var(--text-muted);
  --Dash-Shading-Strong: rgba(0, 0, 0, 0.5);
  --Dash-Shading-Weak: rgba(0, 0, 0, 0.3);
  --Dash-Tooltip-Background-Color: var(--surface-2);
  --Dash-Tooltip-Border-Color: var(--border);
}
.field .dash-input-container { height: 40px; border-radius: var(--radius); }
.field .dash-input-container .dash-input-element {
  padding: 9px 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-variant-numeric: tabular-nums;
}
/* Кнопки ± меняют значение на 1 — для λ, f, D в нм/мкм бесполезны */
.field .dash-input-stepper { display: none; }

/* Сегментированный переключатель поверх dcc.RadioItems */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-self: flex-start;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.segmented .dash-options-list-option {
  align-items: center;
  margin: 0;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
}
.segmented .dash-options-list-option:hover { color: var(--text); }
.segmented .dash-options-list-option.selected { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.segmented .dash-options-list-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Радиокнопка остаётся доступной с клавиатуры, но не видна */
.segmented .dash-options-list-option-wrapper { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Панель предпросмотра поля */
.wizard__preview {
  position: sticky;
  top: 16px;
  padding: 16px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 0;
}
.preview__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.preview__title { margin: 0; font-size: 16px; }
.preview__subtitle { margin: 12px 0 0; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.preview__legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
/* Цвета серий графиков — как TARGET/OPTIMIZED в apps/metalens/figures.py */
.legend-item::before { content: ""; width: 18px; border-top: 2px solid #3987e5; }
.legend-item--ideal::before { border-top: 2px dashed var(--text-muted); }
.legend-item--optimized::before { border-top-color: #d95926; }
.legend-item--assembled::before { border-top-color: #199e70; }
.preview__graph { min-width: 0; }
.preview__warning { margin: 8px 0 0; font-size: 12px; color: var(--warning); }
.preview__warning:empty { display: none; }
.lens-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 12px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.lens-facts dt { font-size: 11px; color: var(--text-muted); }
.lens-facts dd { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }

/* Dash: скрыть служебную надпись загрузки и отладочное меню */
.django-plotly-dash-direct ._dash-loading { color: var(--text-muted); padding: 24px; }

@media (max-width: 1080px) {
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .wizard__preview { position: static; }
}
@media (max-width: 560px) {
  .wizard__main { padding: 16px; }
  .field-row, .field-row--3 { grid-template-columns: minmax(0, 1fr); }
  .wizard__nav { flex-wrap: wrap; }
}

/* Действия на странице задачи */
.task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.button--danger { border-color: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); background: transparent; }
.button--danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.notice { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.notice--warning { border-color: color-mix(in srgb, var(--warning) 60%, transparent); }

.task-card__next { margin: 6px 0 0; font-size: 14px; font-weight: 500; }

/* Шаг «Сборка металинзы» */
.lens-facts--inline { margin: 0; padding-top: 0; border-top: none; }
.library-list { display: flex; flex-direction: column; gap: 6px; }
.library-list .dash-options-list-option {
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.library-list .dash-options-list-option:hover { border-color: var(--text-muted); }
.library-list .dash-options-list-option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.library-list .dash-options-list-option:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.library-option__body { display: flex; flex-direction: column; gap: 2px; }
.library-option__name { color: var(--text); }
.library-option__meta { font-size: 12px; color: var(--text-muted); }
.library-option__warning { font-size: 12px; color: var(--warning); }

/* Экран задачи: шаги-вкладки, статус этапа, результаты, скачивание */
.stepper__item { cursor: pointer; border-radius: 6px; padding: 2px 4px; }
.stepper__item:hover .stepper__title { color: var(--text); }
.stepper__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stepper__item--locked { cursor: default; opacity: 0.45; }
.stepper__item--locked:hover .stepper__title { color: inherit; }
.stepper__item--done .stepper__num { border-color: var(--success); color: var(--success); }
.stepper__item--current.stepper__item--done .stepper__num { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.stepper__item--active .stepper__num { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); animation: pulse 1.6s ease-in-out infinite; }
.stepper__item--stopped .stepper__num { border-color: var(--danger); color: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 10%, transparent); } }
@media (prefers-reduced-motion: reduce) { .stepper__item--active .stepper__num { animation: none; } }

.stage-status:empty { display: none; }
.stage-status { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.stage-status--running, .stage-status--queued { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.stage-status--failed { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.stage-status--done { border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.stage-status__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stage-status__text { font-size: 14px; color: var(--text-muted); }
.stage-status .task-card__error { margin: 0; }

.results { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.results__title { margin: 0; font-size: 15px; }
.results__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.results__header .preview__subtitle { margin-top: 12px; }
.download-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; color: var(--text); white-space: nowrap;
}
.download-link::before { content: "↓"; color: var(--accent); }
.download-link:hover { border-color: var(--accent); text-decoration: none; }
/* Та же «таблетка», но ведёт на другую страницу, а не скачивает файл. */
.open-link::before { content: "→"; }

/* Тест сходимости RCWA: список крайних точек, которые будут посчитаны */
.point-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.point-list__item { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.point-list__item::before { content: "•"; color: var(--accent); margin-right: 6px; }

/* Поля в режиме просмотра */
.field .dash-input-container:has(.dash-input-element:disabled) { opacity: 1; background: var(--surface); border-style: dashed; }
.field .dash-input-element:disabled, .field textarea:disabled { color: var(--text); cursor: default; }
.field textarea:disabled { background: var(--surface); border-style: dashed; }
.segmented .dash-options-list-option:has(input:disabled) { cursor: default; }
.segmented .dash-options-list-option:has(input:disabled):not(.selected) { opacity: 0.5; }

/* Правая колонка экрана задачи: входные данные и все результаты расчётов */
.preview__section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.preview__section-title { margin: 0; font-size: 15px; }
.preview__section .field__hint { margin-top: 4px; }
.stage-result + .stage-result { margin-top: 8px; }
.stage-result .lens-facts { margin-top: 6px; }
@media (min-width: 1081px) {
  /* Колонка прилипает к верху экрана и прокручивается сама — иначе низ высокой колонки недоступен. */
  .wizard__preview { max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
}

/* Библиотека метаатомов: стек слоёв и диапазоны параметров формы */
.layers-list { display: flex; flex-direction: column; gap: 8px; }
.layer-card { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.layer-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.layer-card__title { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.layer-card__role { padding: 1px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.preview-sliders { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.preview-slider { display: flex; flex-direction: column; gap: 4px; }
.layer-card__tools { display: flex; gap: 4px; }
.layer-card__tool { min-width: 32px; padding: 2px 8px; }
.field-row--layer { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr); }
/* Под полями материала: название своего материала либо набор измерений и ссылка на публикацию */
.layer-card__source { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.layer-card__source .field--material { flex: 1 1 260px; min-width: 0; }
.layer-card__reference { flex: 1 1 260px; min-width: 0; font-size: 12px; color: var(--text-muted); }
.layer-card__reference:empty { display: none; }
.layer-card__reference a { color: var(--text-muted); }
.layers-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.range-row { display: flex; flex-direction: column; gap: 6px; }
.range-row__label { font-weight: 600; font-size: 14px; }
.range-row .field__hint:empty { display: none; }
.points { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.points:empty { display: none; }
.points--shape { color: var(--text-muted); }
/* Блок диапазонов одной формы метаатома — виден, пока форма выбрана */
.shape-block { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; }
.shape-block__title { margin: 0; font-size: 14px; font-weight: 600; }
@media (max-width: 560px) {
  .field-row--layer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Собранная металинза: слой карты, шкала-легенда */
.lens-map__controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.lens-map__param { min-width: 96px; }
.map-legend { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.map-legend__item { font-size: 12px; color: var(--text-muted); }
.map-legend__bar { height: 10px; border-radius: 4px; margin: 3px 0 2px; }
.map-legend__ends { display: flex; justify-content: space-between; }
