/* kitchenparametric.pro — окно «Параметры»: плитки разделов, раздел «Контекст» (поля, карточки стен, коммуникаций, блоков, таблицы участков и зазоров, переключатели) */
/* «Параметры»: заголовок «параметры.» с красной точкой. Плитки — спокойная поверхность чуть светлее панели;
   иконки «как чертёж»: только красные контуры, без заливки;
   красный — только контуры и рамка при наведении, без больших красных площадей.
   Нажатого состояния нет: по клику откроется окно раздела. Иконки и раскладка — из Mooduline v1_1 */
#params { --tile: #1f1f1f; --tile-hover: #262626; --fill: transparent; --top-face: transparent; --frame: var(--accent); }
.win-h {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center;
  height: var(--bar-h); padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--border);
  font-size: 17px; font-weight: 900; letter-spacing: .01em; color: var(--ink);
}
.win-h .dot { color: var(--accent-text); font-weight: 400; }
#params .pad { padding: 14px; }
.mtypes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 10px; }
/* узкая колонка — плитки по 2 в ряд (считаем по ширине самого блока, а не окна) */
#mtypebox { container-type: inline-size; }
@container (max-width: 340px) { .mtypes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mt {
  position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer;
  padding: 10px 4px 0; user-select: none; -webkit-tap-highlight-color: transparent;
}
/* подложка плитки; иконка выступает за её низ на 12px, как в образце */
.mt::before {
  content: ""; position: absolute; inset: 0 0 12px 0; border-radius: 8px;
  background: var(--tile); box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .25s ease, background-color .25s ease;
}
/* рамка при наведении (и при выборе с клавиатуры) плавно появляется и плавно исчезает */
.mt:hover::before, .mt:has(input:focus-visible)::before { background: var(--tile-hover); box-shadow: inset 0 0 0 2px var(--frame); }
.mt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
/* подпись плитки — как заголовки «меню.» и «параметры.»: строчные, самое жирное начертание, лёгкая разрядка;
   красная точка проявляется при наведении (место под неё зарезервировано — текст не сдвигается) */
.mt-n {
  position: relative; display: flex; align-items: baseline; justify-content: center; height: 20px; max-width: 100%;
  font-size: 14px; font-weight: 900; letter-spacing: .01em; text-transform: lowercase; white-space: nowrap; overflow: hidden;
  color: #e6e6e6; transition: color .25s ease;
}
.mt-n::after { content: "."; font-weight: 400; color: transparent; transition: color .25s ease; }
.mt:hover .mt-n, .mt:has(input:focus-visible) .mt-n { color: #fff; }
.mt:hover .mt-n::after, .mt:has(input:focus-visible) .mt-n::after { color: var(--accent-text); }
.mt svg {
  position: relative; display: block; width: 100%; max-width: 104px; height: auto; margin-top: 4px;
  transform-origin: 50% 100%; transition: transform .18s ease;
}
.mt:hover svg { transform: translateY(-2px); }
.mt svg .o { stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
/* контур иконок красный; заливки нет ни у чего внутри контуров (корпуса, цоколи, кромки, ручки, розетки); точки — красные;
   габаритные блоки «Контекста» — только красные рамки, полностью прозрачные; стены — в тон плитки, пол чуть светлее, линии стен приглушены */
.mt svg { --ink: var(--accent); }
.mt svg [fill="#AEB8BE"], .mt svg [fill="#2A3238"], .mt svg [fill="#3E474E"], .mt svg [fill="#F1ECE3"], .mt svg [fill="#fff"] { fill: var(--fill); }
.mt svg [fill="#101820"] { fill: var(--accent); }
.mt-ctx svg [fill="var(--cf)"], .mt-ctx svg [fill="#12191F"] { fill: none; }
.mt svg [stroke="#9AA6AF"] { stroke: #6a6a6a; }
.mt-ctx svg [fill="#F3F5F7"] { fill: #2c2c2c; }
.mt-ctx svg [fill="#E8ECEF"] { fill: #272727; }
.mt-ctx svg [fill="#EFE9DF"] { fill: #363636; }
/* «Контекст» — плитка на всю ширину: помещение с коммуникациями и контейнерами */
.mt.mt-ctx { grid-column: 1 / -1; --cf: var(--fill); }
.mt.mt-ctx .mt-n { font-size: 16px; height: 22px; }
/* очень узкая панель (маленькое окно) — подписи мельче, чтобы не обрезались */
@container (max-width: 240px) { .mt-n { font-size: 11px; letter-spacing: -.02em; } }
.mt.mt-ctx svg { max-width: 250px; margin-top: 6px; }
.mt.mt-ctx:hover svg { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .mt::before, .mt svg, .mt-n, .mt-n::after { transition: none; } }

/* ---------- «Контекст»: окно раздела в «Параметрах» ---------- */
/* шапка раздела: «контекст.» как заголовки окон, «назад» — как пункт меню (серый, при наведении красный) */
.sub-h { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.sub-t { font-size: 16px; font-weight: 900; letter-spacing: .01em; color: var(--ink); }
.sub-t .dot { color: var(--accent-text); font-weight: 400; }
.back {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px 0 4px; border: 0; border-radius: 6px;
  background: none; font: inherit; font-size: 13.5px; color: var(--ink-2); cursor: pointer; transition: color .15s ease;
}
.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { color: var(--accent-text); }
.back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* разделы и подзаголовки — строчные, жирные, как в логотипе */
.cx-grp {
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 900; letter-spacing: .01em; color: var(--ink);
}
.cx-grp:first-child { margin-top: 0; }
.cx-sub { margin: 14px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.cx-sub:first-child { margin-top: 2px; }

/* поле: подпись сверху, под ней тёмное поле ввода или список */
.cx-r { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin-bottom: 8px; align-items: end; }
.cx-r.r1 { grid-template-columns: 1fr; }
.cx-r.rd { grid-template-columns: minmax(0, 1fr) 84px; }
.cx-r.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-r.r3 { grid-template-columns: minmax(0, .7fr) minmax(0, 1fr) minmax(0, 1fr); }
.cx-r.r3 .f > span { white-space: nowrap; }
.cx-r.r3e { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cx-r.r3e .f > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* подписи габаритов — цветами осей, как в САПР: длина — красная, высота — синяя, глубина — зелёная */
.f.ax-x > span, .seg-t th.ax-x { color: var(--ax-x); }
.f.ax-y > span, .seg-t th.ax-y { color: var(--ax-y); }
.f.ax-z > span, .seg-t th.ax-z { color: var(--ax-z); }

/* таблица участков блока */
.seg-t { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin: -4px 0 4px; table-layout: fixed; }
.seg-t th { padding: 0 3px; font-size: 12px; font-weight: 400; text-align: left; color: var(--muted); }
.seg-t th:first-child, .seg-t td.n { width: 16px; }
.seg-t th:last-child { width: 30%; }
.seg-t td { padding: 0 3px; }
.seg-t td.n { padding: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg-t td.mut { padding-left: 10px; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg-t input, .seg-t select {
  width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--dark); font: inherit; font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.seg-t select {
  appearance: none; -webkit-appearance: none; padding: 0 18px 0 7px; cursor: pointer;
  background-image: url("../img/arrow.svg");
  background-repeat: no-repeat; background-position: right 4px center; background-size: 11px;
}
.seg-t input:hover, .seg-t select:hover { border-color: #666; }
.seg-t input:focus, .seg-t select:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* таблица зазоров: заголовок элемента с линией, подпись слева, значение справа */
.gap-t { width: 100%; border-collapse: separate; border-spacing: 0 4px; margin: -2px 0 4px; table-layout: fixed; }
.gap-t col.v { width: 72px; }   /* ширина — здесь: первая строка таблицы — объединённый заголовок */
.gap-t tr.gr th { padding: 10px 0 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 700; text-align: left; color: var(--ink); }
.gap-t tr.gr:first-child th { padding-top: 2px; }
.gap-t td { padding: 0 0 0 6px; font-size: 13px; line-height: 1.2; color: var(--ink-2); }
.gap-t td:first-child { padding-left: 0; }
.gap-t input {
  width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--dark); font: inherit; font-size: 13.5px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums;
}
.gap-t input:hover { border-color: #666; }
.gap-t input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f[hidden] { display: none; }
.f > span { font-size: 12px; line-height: 1.25; color: var(--muted); }
.f input, .f select, .cx-add select {
  width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--dark); font: inherit; font-size: 13.5px; color: var(--ink); transition: border-color .15s ease;
}
.f input { font-variant-numeric: tabular-nums; }
.f input::placeholder { color: var(--muted); }
.f select, .cx-add select {
  appearance: none; -webkit-appearance: none; padding-right: 26px; cursor: pointer;
  background-image: url("../img/arrow.svg");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
}
.f input:hover, .f select:hover:not(:disabled), .cx-add select:hover { border-color: #666; }
.f input:focus, .f select:focus, .cx-add select:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
/* считается автоматически (привязка высокого блока) — видно значение, ввести нельзя */
.f input:disabled { color: var(--muted); border-style: dashed; cursor: default; }
/* списки из базы данных — пока прочерк: выглядят как поле, но не раскрываются */
.f select.db { cursor: default; color: var(--muted); background-image: none; }

/* карточки стен, коммуникаций, блоков: свёрнутая — название и где/какого размера; раскрыта одна */
.cx-c { margin-bottom: 8px; border-radius: 8px; background: var(--filler); box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .2s ease; }
.cx-c.on { box-shadow: inset 0 0 0 1px var(--border-strong); }
.cx-hd { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; cursor: pointer; border-radius: 8px; }
.cx-hd:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cx-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cx-n { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-n::after { content: "."; font-weight: 400; color: transparent; transition: color .2s ease; }
.cx-c.on .cx-n::after, .cx-hd:hover .cx-n::after { color: var(--accent-text); }
.cx-t small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cx-del {
  flex: none; height: 26px; padding: 0 8px; border: 0; border-radius: 6px; background: none;
  font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: color .15s ease;
}
.cx-del:hover { color: var(--accent-text); }
.cx-bd { padding: 2px 12px 12px; }
/* коммуникации — внутри карточки своей стены: чуть светлее, чтобы читалась вложенность */
.cx-bd .cx-c { background: #282828; }
.cx-bd .cx-c.on { box-shadow: inset 0 0 0 1px #555; }

/* кнопки «+ …»: пунктир, при наведении — красные */
.cx-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cx-add select { flex: 1 1 120px; width: auto; }
.cx-btn {
  flex: 1 1 0; min-width: max-content; height: 32px; padding: 0 12px; border: 1px dashed var(--border-strong); border-radius: 6px;
  background: none; font: inherit; font-size: 13.5px; color: var(--ink-2); cursor: pointer; transition: color .15s ease, border-color .15s ease;
}
.cx-btn:hover:not(:disabled) { color: var(--accent-text); border-color: var(--accent); }
.cx-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cx-btn:disabled { opacity: .45; cursor: default; }

/* переключатель из нескольких кнопок (система открывания): выбранная — тёмно-красная с красной рамкой */
.seg { display: flex; margin-bottom: 8px;
  border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.seg button {
  flex: 1 1 auto; height: 32px; padding: 0 6px; border: 0; background: var(--dark); font: inherit; font-size: 13px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: color .15s ease, background-color .15s ease;
}
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--accent-soft); color: #fff; box-shadow: inset 0 0 0 1px var(--accent); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .seg button { transition: none; } }
.seg.sm { margin: 0; }
.seg.sm button { height: 28px; padding: 0 3px; font-size: 12.5px; }
/* выбранное «нет» — нейтрально-серое: красным выделено только то, что включено */
.seg button.on[data-v="no"], .seg button.on[data-v="none"] { background: #2b2b2b; color: var(--ink); box-shadow: inset 0 0 0 1px #5a5a5a; }

/* концы ряда: «слева» и «справа» — каждая сторона: выбор (ничего / боковина / добор), под ним настройки выбранного */
.end-s { margin-bottom: 12px; }
.end-h { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.end-r { display: grid; grid-template-columns: minmax(0, 1fr) 176px; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.end-r input {
  width: 100%; height: 28px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--dark); font: inherit; font-size: 13px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums;
}
.end-r input:hover { border-color: #666; }
.end-r input:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cx-sub i { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 4px; }

@media (prefers-reduced-motion: reduce) { .back, .cx-c, .cx-n::after, .cx-del, .cx-btn, .f input, .f select, .rs svg [data-p] { transition: none; } }

/* ---------- «Проект»: списки «материал (поставщик)», подсветки, «ном.», предупреждения (этап 1б, задача 3) ---------- */
.cx-r.rd.rd3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }      /* три поля (декор, толщина, формат) не помещаются в одну строку колонки: декор — на всю ширину, ниже толщина и формат */
.cx-r.rd.rd3 > :first-child { grid-column: 1 / -1; }
.f.pf select { text-overflow: ellipsis; }
/* «нет в базе» (state absent / сочетания нет в базе) — красная сплошная рамка; «нет у поставщика» — жёлтая пунктирная; значение остаётся на месте */
.f.pf.miss-base select { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background-color: var(--accent-soft); }      /* «нет в базе»: красная рамка и тёмно-красный фон — отличается от фокуса (контур снаружи) */
/* фокус на подсвеченном поле — контур снаружи, чтобы не сливался с рамкой подсветки */
.f.pf.miss-base select:focus, .f.pf.miss-supplier select:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.f.pf.miss-supplier select { border: 1px dashed var(--warn); }
.f.pf .pn { font-size: 11.5px; line-height: 1.25; }
.f.pf .ps { font-size: 11.5px; line-height: 1.25; color: var(--ink-2); }      /* поставщик выбранного материала — целиком, закрытый список его обрезает */
.pn.miss-base-t { color: var(--accent-text); }
.f.pf.miss-base .pn::before { content: '× '; }                              /* красная пометка — со знаком, не только цветом/рамкой */
.f.pf.miss-supplier .pn::before { content: '! '; }
.f.pf.miss-base .pn { color: var(--accent-text); }
.f.pf.miss-supplier .pn { color: var(--warn); }
.f.pf .pn.mut { color: var(--muted); }
/* значок толщины («ном.», «16,3 мм · замер», «16 мм · по каталогу») — кнопка над подписью поля, вне label; открывает строку замера */
.pfw { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; }
button.nom { align-self: flex-start; max-width: 100%; margin: 0; padding: 0 4px; background: none; border: 1px solid var(--border-strong); border-radius: 4px; font: inherit; font-size: 10px; line-height: 1.4; color: var(--ink-2); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.nom:hover { border-color: var(--muted); color: var(--ink); }
button.nom:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button.nom[aria-expanded="true"] { border-color: var(--accent); }
/* строка замера под парой «декор · толщина»: «Замер, мм [__] · убрать» */
.cx-r.meas { grid-template-columns: minmax(0, 1fr) auto; }
.cx-r.meas > small { grid-column: 1 / -1; }
.cx-r.meas > .meas-ask, .cx-r.meas > .meas-ask-b { grid-column: 1 / -1; margin: 0; }
.meas-ask-b { display: flex; gap: 8px; }
/* список предупреждений проекта */
.pw { list-style: none; margin: 0 0 8px; padding: 0; }
.pw li { padding: 6px 0 6px 12px; border-left: 2px solid var(--warn); font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.pw li + li { margin-top: 4px; }
.pw li[data-code="absent"], .pw li[data-code="doc"], .pw li[data-code="db"] { border-left-color: var(--accent); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.om-msg { margin: 0; padding: 4px 12px 8px; font-size: 12px; color: var(--accent-text); }
.meas-ask { color: var(--ink); border-left: 2px solid var(--ink-2); padding-left: 8px; }      /* вопрос Р-121 — нейтральный, не ошибка */
.pn.meas-err::before { content: '× '; }
