/* iOS polish (viewer-ios-polish): presentation only -- ids, data-attributes and hidden toggles stay owned by src/main.js. */
:root { --bg: #f3f2ef; --ink: #1c1c1a; --ink-2: #4a4741; --muted: #6b6862; --sep: rgba(60,52,40,.12); --fill: rgba(120,108,90,.11);
  --fill-press: rgba(120,108,90,.2); --surface: rgba(255,255,255,.86); --card: #fff; --accent: #235d67; --accent-fill: rgba(35,93,103,.11);
  --shadow: 0 1px 2px rgba(30,24,16,.06), 0 8px 28px rgba(30,24,16,.12); --r-card: 18px; --gutter: 12px; --hair: .5px; }
/* Hairlines: half a pixel on Retina, a whole one where .5px would vanish. */
@media (max-resolution: 1.5dppx) { :root { --hair: 1px; } }
/* Компактнее на компьютере (владелец 19.10.2026: «на 100 % как для бабушки»): весь интерфейс поверх модели мельче,
   сцена и подписи на ней (#stage, #annotations) — как были. Попап «Отменить?» ставится по координатам кнопки — без zoom.
   Карточка детали у курсора пересчитывает left/top на этот zoom (dock-anchor.js). */
@media (pointer: fine) and (min-width: 901px) {
  body > :not(#stage):not(#annotations):not(.undo-confirm):not(.draw-carry):not(script) { zoom: .85; }
  /* нижняя панель и правая панель — ещё мельче (владелец 27.10.2026: «слишком громоздко»); планшет (касание) — как был */
  body.dock-final .toolbar, body.dock-final > .project-pill { zoom: .8 !important; }
  body > .part-dock, body.dock-final > .chat-panel { zoom: .76 !important; }   /* у общего правила выше специфичность id (:not(#stage)) */
  /* этап B (30.10.2026): панель компактная (zoom .76), но мелкий текст не ниже ~11 px на экране (скилл ui-ux-pro-max:
     текст < 12 px — антипаттерн): подписи и описания чуть крупнее в своих px, сама панель не растёт */
  body > .part-dock :is(.rw-sec, .insp-sec, h3.rw-sec) { font-size: 14px !important; }
  body > .part-dock :is(.rw-corp em, .insp-row-item em, .rw-item .num, .cut-hint, .rw-row span, .corpus-row span, .insp-sub, .insp-mat, .insp-meta, .bay-note) { font-size: 15px !important; }
  body > .part-dock :is(.rw-row, .corpus-row, .rw-row b, .corpus-row b, .rw-item b) { font-size: 16px !important; }
  body > .part-dock :is(.cut-field > span, .shelf-label, .cut-templates .btn, .cut-status, .cut-range) { font-size: 14.5px !important; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bg); color: var(--ink);
  font: 13px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0; }
[hidden] { display: none !important; }
#stage { position: absolute; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#stage canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
#stage canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
@media (pointer: fine) { #stage canvas { cursor: crosshair !important; } #stage canvas.shelf-grab { cursor: ns-resize !important; } }
/* Loading: the stage is empty until the renderer mounts its canvas. */
#stage:empty::before { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -30px 0 0 -11px; border-radius: 50%;
  border: 2px solid var(--sep); border-top-color: var(--muted); animation: spin .8s linear infinite; }
#stage:empty::after { content: "Загрузка модели…"; position: absolute; left: 0; right: 0; top: 50%; margin-top: 4px; text-align: center; color: var(--muted); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #stage:empty::before { animation-duration: 2.4s; } }

/* Buttons: one system -- plain (toolbar/menu), tinted (card actions), chip (floating over the model). */
.btn { pointer-events: auto; height: 44px; min-width: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--fill); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; text-decoration: none; cursor: pointer;
  display: inline-grid; place-items: center; touch-action: manipulation; transition: background-color .15s, color .15s, transform .1s, opacity .15s; }
.btn:active { background: var(--fill-press); transform: scale(.97); }
@media (hover: hover) { .btn:hover { background: var(--fill-press); } }
.btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn:focus-visible, .perf:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Debug header (?debug=1). */
.bar { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
/* While the 3D moves (main.js markMoving): no backdrop blur -- iOS re-blurs the moving canvas under every glass panel
   each frame; the panels turn a touch more opaque instead (17.10.2026). */
body[data-moving] { --surface: rgba(255,255,255,.95); }
body[data-moving] * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.bar .btn { background: var(--surface); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-size: 13px; }
.title { flex: 1; min-width: 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.title b { color: var(--ink); font-weight: 500; }
.tag { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #8a5a22; background: #f6e7d2; padding: 2px 6px; border-radius: 5px; margin-right: 6px; }
.perf { position: absolute; left: 10px; bottom: max(10px, env(safe-area-inset-bottom)); background: rgba(20,20,18,.78); color: #e9e7e2; border-radius: 10px;
  padding: 7px 10px; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; pointer-events: auto; cursor: pointer; max-width: calc(100% - 20px); overflow: hidden;
  min-height: 44px; display: grid; align-items: center; }
.perf.min { opacity: .7; }

/* Toolbar: one floating capsule, Вид · Размеры · Замер. */
.toolbar { position: absolute; top: calc(env(safe-area-inset-top) + 10px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 16px; background: var(--surface); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 0 0 var(--hair) var(--sep), 0 4px 16px rgba(30,24,16,.08); max-width: calc(100% - 2 * var(--gutter)); }
/* Above the project pill and account avatar: the «Вид» list drops over them, taps must reach it. */
.toolbar { z-index: 25; }
body[data-debug="true"] .toolbar { top: calc(env(safe-area-inset-top) + 64px); }
.toolbar .btn { height: 44px; min-width: 44px; padding: 0 13px; border-radius: 13px; background: transparent; font-size: 14px; }
.toolbar .btn:active { background: var(--fill); }
@media (hover: hover) { .toolbar .btn:hover { background: var(--fill); } }
.toolbar .btn[aria-pressed="true"] { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(30,24,16,.12), 0 0 0 var(--hair) var(--sep); }
.toolbar .btn[aria-expanded="true"] { background: var(--fill); }
/* «Скрыть фасады»: icon only; the slash appears while facades are hidden. */
.toolbar .btn.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 44px; }
.toolbar .btn.icon-btn[hidden] { display: none; }
.toolbar .icon-btn .slash { display: none; }
.toolbar .icon-btn[aria-pressed="true"] .slash { display: inline; }
.tools { display: flex; gap: 2px; align-items: center; }
.view-tools { position: relative; }
#view-menu { display: inline-grid; min-width: 104px; overflow: hidden; text-overflow: ellipsis; }
#view-menu .mode-short { display: none; }
#measure-step { padding: 0 10px; color: var(--accent); font-size: 14px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Popover: an iOS menu -- separators, checkmark for the current mode instead of a filled row. */
.view-presets { display: none; position: absolute; top: calc(100% + 8px); left: -3px; width: 230px; padding: 0; overflow: hidden; border-radius: 14px;
  background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 0 0 var(--hair) var(--sep), 0 10px 32px rgba(30,24,16,.16); transform-origin: top left; animation: pop .16s ease-out; }
.view-tools[data-open="true"] .view-presets { display: grid; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
.view-presets .btn { position: relative; width: 100%; height: 44px; justify-items: start; padding: 0 40px 0 16px; border-radius: 0; background: transparent; font-weight: 400; font-size: 15px; box-shadow: none; }
.view-presets .btn + .btn { box-shadow: inset 0 var(--hair) 0 var(--sep); }
.view-presets .btn[aria-pressed="true"] { background: transparent; color: var(--ink); font-weight: 500; }
.view-presets .btn[aria-pressed="true"]::after { content: ""; position: absolute; right: 18px; top: 50%; width: 5px; height: 10px; margin-top: -7px;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.view-presets .btn:active { background: var(--fill); transform: none; }
/* Camera angles: a 2×2 grid of compact buttons at the top of the menu. */

/* Client link: no «Вид» menu; camera angles and «Открыть» in a round pill at the bottom. */
.angle-pill { display: none; position: absolute; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 16px);
  align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 0 0 var(--hair) var(--sep), 0 4px 16px rgba(30,24,16,.08); max-width: calc(100% - 2 * var(--gutter)); }
.angle-pill .btn { height: 44px; padding: 0 14px; border-radius: 999px; background: transparent; font-size: 14px; white-space: nowrap; }
.angle-pill .btn:active { background: var(--fill); }
@media (hover: hover) { .angle-pill .btn:hover { background: var(--fill); } }
.angle-pill .pill-fronts { margin-left: 4px; position: relative; color: var(--accent); font-weight: 500; }
.angle-pill .pill-fronts::before { content: ""; position: absolute; left: -4px; top: 12px; bottom: 12px; width: var(--hair); background: var(--sep); }
.angle-pill .pill-fronts[aria-pressed="true"] { background: var(--accent-fill); }
@media (max-width: 400px) { .angle-pill .btn { padding: 0 10px; font-size: 13px; } }
body[data-client="true"] .angle-pill { display: flex; }
body[data-client="true"] #view-tools, body[data-client="true"] .toolbar #open-fronts, body[data-client="true"] .toolbar #hide-facades { display: none !important; }
body:has(#part-card:not([hidden])) .angle-pill, body:has(#block-card:not([hidden])) .angle-pill, body:has(#measurement-card:not([hidden])) .angle-pill { display: none; }
/* Подпись «Замер» / «Вид» (dock-layout.js дописывает её в кнопку) нужна только новой панели (dock-final, от 601 px — там
   показывается ниже). На телефоне у кнопки свой текст — подпись шла вторым словом: «Замер Замер» (11.11.2026). */
.dock-tool-label { display: none; }
.client-views { display: none; }
.angle-views, .angle-acts { display: contents; }   /* группы нижней капсулы — только для телефона; на компьютере капсула как была */
/* Клиентская ссылка на телефоне (портрет ≤600 px и альбомная, низкий экран) — одна система плавающих капсул:
   высота 44, радиус 22, кнопки 36 (зона касания 44), шрифт 13, отступ от края 12 + safe-area, нажатое — var(--accent-fill).
   Верх: [Спереди | 3D] · Размеры · Замер. Низ: ракурсы сегментом; «Открыть» / «Расстановка» — своей капсулой над ним,
   если в строку не влезают (на 360–390 px не влезают никогда — переносится целиком, без обрезки и прокрутки). */
@media (max-width: 600px), (max-height: 500px) {
  body[data-client="true"] { --float-edge: 12px; --float-shadow: 0 0 0 var(--hair) var(--sep), 0 4px 16px rgba(30,24,16,.10); }
  body[data-client="true"] :is(.toolbar, .angle-views, .angle-acts) { display: flex; align-items: center; gap: 2px; height: 44px; padding: 4px; border-radius: 22px;
    background: var(--surface); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: var(--float-shadow); pointer-events: auto; }
  body[data-client="true"] .toolbar { top: calc(env(safe-area-inset-top) + var(--float-edge)); white-space: nowrap;
    max-width: calc(100% - 2 * var(--float-edge) - env(safe-area-inset-left) - env(safe-area-inset-right)); }
  body[data-client="true"] .client-views { display: flex; gap: 2px; }
  body[data-client="true"] .toolbar .tools { gap: 2px; }
  body[data-client="true"] .toolbar .tools::before { content: ""; flex: none; width: 1px; height: 20px; margin: 0 4px; background: var(--sep); }
  body[data-client="true"] :is(.client-views, .tools, .dim-tools, .angle-views, .angle-acts) > .btn { position: relative; height: 36px; min-width: 40px; padding: 0 11px; margin: 0;
    border-radius: 18px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; box-shadow: none; }
  body[data-client="true"] :is(.client-views, .tools, .dim-tools, .angle-views, .angle-acts) > .btn::after { content: ""; position: absolute; inset: -4px 0; }   /* касание — на всю высоту капсулы */
  body[data-client="true"] :is(.client-views, .tools, .dim-tools, .angle-views, .angle-acts) > .btn[aria-expanded="true"] { background: var(--fill); }
  body[data-client="true"] :is(.client-views, .tools, .dim-tools, .angle-views, .angle-acts) > .btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); }
  body[data-client="true"] .dim-mode { display: none; }
  /* замер: «Точка 1» — подсказкой под капсулой, «Очистить» — значком: капсула не растёт и не переносится */
  body[data-client="true"] #measure-step:not([hidden]) { position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 14px;
    background: var(--surface); box-shadow: var(--float-shadow); font-size: 13px; pointer-events: none; }
  body[data-client="true"] .tools > #clear-measure { width: 36px; min-width: 36px; padding: 0; font-size: 0; }
  body[data-client="true"] #clear-measure::before { content: ""; width: 18px; height: 18px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat; }
  /* низ: контейнер во всю ширину и прозрачный для касаний — модель крутится и между капсулами */
  body[data-client="true"] .angle-pill { display: flex; flex-flow: row wrap-reverse; justify-content: center; align-items: center; gap: 8px;
    left: calc(env(safe-area-inset-left) + var(--float-edge)); right: calc(env(safe-area-inset-right) + var(--float-edge)); bottom: calc(env(safe-area-inset-bottom) + var(--float-edge));
    transform: none; max-width: none; padding: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
  body[data-client="true"] .angle-acts:not(:has(> .btn:not([hidden]))) { display: none; }
  body[data-client="true"] .angle-acts > .pill-fronts { color: var(--accent); }
  body[data-client="true"] .angle-acts > .pill-fronts::before { display: none; }
}

/* Context cards: a floating card on desktop, a bottom sheet on phones. */
.part-dock { position: absolute; right: max(var(--gutter), env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 16px);
  width: min(360px, calc(100% - 2 * var(--gutter))); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.part-dock > .btn { height: 44px; padding: 0 16px; border-radius: 22px; background: var(--surface); color: var(--accent);
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: 0 0 0 var(--hair) var(--sep), 0 4px 14px rgba(30,24,16,.1); }
@media not all and (pointer: fine) { #hide-selected, #isolate-selected { display: none !important; } }
/* Desktop: dock-anchor.js places the card next to the click (left/top set inline). */
.part-dock.at-pointer { right: auto !important; bottom: auto !important; }
@media (pointer: fine) and (min-width: 601px) and (min-height: 501px) { .part-dock .part-head { cursor: grab; } .part-dock.dragging, .part-dock.dragging .part-head { cursor: grabbing; user-select: none; } }
.part-dock > .btn:active { background: rgba(255,255,255,.7); }
.part-card { width: 100%; padding: 0 16px 16px; border-radius: var(--r-card); background: var(--card); box-shadow: 0 0 0 var(--hair) var(--sep), var(--shadow);
  pointer-events: auto; max-height: min(440px, 52dvh); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  font-size: 14px; animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@supports not (height: 1dvh) { .part-card { max-height: 52vh; } }
.part-head { position: sticky; top: 0; z-index: 1; display: flex; gap: 8px; align-items: flex-start; margin: 0 -16px; padding: 14px 6px 4px 16px; background: var(--card); }
/* Soft fade under the sticky header so scrolled content does not end on a hard cut. */
.part-head::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; background: linear-gradient(var(--card), rgba(255,255,255,0)); pointer-events: none; }
.part-head h2 { flex: 1; min-width: 0; margin: 9px 0 0; font-size: 17px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }
/* Close: a 30px glyph inside a 44px hit area. */
.part-head .btn { position: relative; flex-shrink: 0; width: 44px; padding: 0; margin-top: -2px; background: transparent; color: var(--muted); font-size: 0; }
.part-head .btn::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--fill); transition: background-color .15s; }
.part-head .btn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  background: linear-gradient(currentColor,currentColor) center/100% 2px no-repeat, linear-gradient(currentColor,currentColor) center/2px 100% no-repeat; transform: rotate(45deg); border-radius: 1px; }
.part-head .btn:active, .part-head .btn:hover { background: transparent; }
.part-head .btn:active::before { background: var(--fill-press); }
.part-size { margin: 0 0 12px; font-size: 15px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.part-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
#part-card .part-size { margin-bottom:8px; font-size:14px; }
#part-card .tech-group { margin-bottom:8px; }
#part-card .tech-row { padding:8px 0; }
#part-card .edge-section { padding:0; }
#part-card .action-group .part-actions { min-height:44px; }
#part-card #part-validation { display:block; margin-bottom:4px; }
#part-card #part-validation[hidden] { display:none; }
.part-footer { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
#drilling-details { margin:0; }
#drilling-details[open] { flex-basis:100%; order:1; }
#drilling-details summary { min-height:44px; display:flex; align-items:center; cursor:pointer; color:var(--muted); font-size:13px; }
#drilling-details summary::before { content:'›'; margin-right:6px; }
#drilling-details[open] summary::before { transform:rotate(90deg); }
#block-count { margin: 0 0 12px; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* Grouped inset list: label | value, hairline between visible rows; an all-hidden group collapses to nothing. */
.tech-group { margin: 0 0 12px; padding: 0 12px; border-radius: 12px; background: var(--fill); }
.tech-group:not(:has(> :not([hidden]))) { display: none; }
.tech-row { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 10px; padding: 11px 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.tech-label { color: var(--muted); font-size: 13px; line-height: 1.45; }
.edge-section { padding: 11px 0 0; }
.edge-section > .tech-label { display: block; padding-bottom: 4px; }
.edge-row { width: 100%; display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 10px; min-height: 44px; padding: 11px 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; text-align: left; overflow-wrap: anywhere; }
.edge-summary { display:block; color:var(--accent); font-weight:500; }
.edge-row + .edge-row { box-shadow: inset 0 var(--hair) 0 var(--sep); }
.edge-row:active { background: var(--fill); }
.edge-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.edge-row:disabled { opacity: 1; }
.tech-group > :not([hidden]) ~ :not([hidden]) { box-shadow: inset 0 var(--hair) 0 var(--sep); }
/* Toggle rows inside a group: title left, compact action right. */
.part-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.action-group .part-actions { min-height: 52px; margin: 0 -6px 0 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.action-group .part-actions > span:first-child { min-width: 0; overflow-wrap: anywhere; }
/* 44px touch target, 36px visible pill: the transparent border is part of the hit area. */
.action-group .btn { height: 44px; padding: 0 14px; border: 4px solid transparent; border-radius: 22px; background: var(--card) padding-box; color: var(--accent); font-size: 14px; }
.action-group .btn[aria-pressed="true"] { background: var(--accent) padding-box; color: #fff; }
.action-group .btn:active { background: var(--fill-press) padding-box; }
.action-group .btn[aria-pressed="true"]:active { background: #1b4a52 padding-box; }
@media (hover: hover) { .action-group .btn:hover { background: #fbfaf8 padding-box; } .action-group .btn[aria-pressed="true"]:hover { background: #1b4a52 padding-box; } }
.action-group .part-actions > .btn:only-child { margin-left: auto; }
#drilling-count, #block-drilling-count { white-space: nowrap; }
#drilling-info { margin: -4px 4px 12px; white-space: pre-line; font-size: 12px; line-height: 1.5; }
/* Primary card action: full width, tinted. */
.part-card > .part-actions:last-child { margin-top: 0; }
.part-card > .part-actions:last-child .btn { width: 100%; }
/* three actions in a narrow card (Материал / Вырез / Скрыть деталь): they wrap instead of the label spilling out of its button */
.part-card > .part-actions:last-child { flex-wrap: wrap; }
.part-card > .part-actions:last-child .btn { flex: 1 1 auto; width: auto; }
/* the part buttons (Материал / Вырез / Паз / Радиус / Сдвинуть / Скрыть деталь): rows of equal buttons, never one cramped line (24.10.2026) */
.part-card .part-buttons { flex-wrap: wrap; justify-content: stretch; gap: 8px; margin: 0; }
.part-card .part-buttons .btn { flex: 1 1 calc(33% - 8px); min-width: 0; width: auto; padding-inline: 10px; white-space: nowrap; text-align: center; }
.part-card .part-buttons .btn[hidden] { display: none; }
.part-card .part-buttons #hide-part { flex-basis: 100%; }
/* ---- Единый Inspector (бета 28.10.2026, по /design/migman-cad-final/): одна карточка, вкладки, форма полки внутри ---- */
.insp-card { --insp-soft: rgba(29,36,38,.045); --insp-soft2: rgba(29,36,38,.08); --insp-teal-soft: rgba(35,93,103,.11); }
.insp-card .part-size { font-size: 26px !important; font-weight: 650; letter-spacing: -.02em; color: var(--ink); line-height: 1.15; margin: 2px 0 6px !important; }
.insp-mat { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; overflow-wrap: anywhere; }
.insp-mat[hidden] { display: none; }
.insp-card #part-validation { min-height: 32px; padding: 0 10px; border-radius: 10px; font-size: 13px; background: var(--insp-teal-soft); color: var(--accent); text-align: left; width: auto !important; display: inline-flex !important; align-items: center; margin: 0 0 10px !important; }
.insp-card #part-validation[hidden] { display: none !important; }
.insp-card #part-validation[data-state="ok"] { font-size: 0 !important; }
.insp-card #part-validation[data-state="ok"]::before { content: "✓ Модель корректна"; font-size: 13px; }
.insp-card #part-validation[data-state="issues"] { background: rgba(183,121,31,.14); color: #8a5a12; }
.insp-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0 0 10px; }
.insp-tabs[hidden] { display: none; }
.insp-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 6px 2px; border: 0; border-radius: 12px;
  background: var(--insp-soft); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; transition: background-color .14s, color .14s; }
.insp-tabs button:hover { background: var(--insp-soft2); }
.insp-tabs button[aria-selected="true"] { background: var(--insp-teal-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1.5px rgba(35,93,103,.35); }
.insp-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.insp-pane[hidden] { display: none !important; }
.insp-card:not([data-tab]) .insp-pane[data-pane="more"] { display: none; }
.insp-pane { animation: insp-in .16s cubic-bezier(.23,1,.32,1); }
@keyframes insp-in { from { opacity: .3; transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .insp-pane { animation: none; } }
.insp-start .btn { flex-basis: 100% !important; background: var(--accent-fill); color: var(--accent); }
.insp-start .btn[hidden] { display: none; }
.insp-more { display: flex; flex-direction: column; gap: 6px; }
.insp-more .btn { width: 100%; min-height: 44px; justify-content: flex-start; text-align: left; background: var(--insp-soft); }
/* footer: what is selected, «Удалить» — тихая; красный только при наведении / фокусе */
.insp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px -16px -16px; padding: 6px 8px 6px 16px; border-top: var(--hair) solid var(--sep);
  position: sticky; bottom: -16px; background: var(--card); font-size: 12px; color: var(--muted); min-height: 44px; }
.insp-foot:has(#part-delete[hidden]):has(#insp-foot-label:empty):not(:has(.part-delete:not([hidden]))) { display: none; }
.insp-card #part-delete { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 22px; background: transparent; color: var(--muted); font-size: 13px; transition: color .14s, background-color .14s; }
.insp-card #part-delete[hidden] { display: none; }
.insp-card #part-delete:hover, .insp-card #part-delete:focus-visible { color: #b3261e; background: rgba(179,38,30,.09); }
/* the shelf / rod sheet docked into the card: no frame of its own, no second title, fields as in the prototype */
.material-sheet.docked { position: static; inset: auto; width: auto; max-height: none; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; animation: none; z-index: auto; }
.material-sheet.docked .spec-head { padding: 0 0 6px; border: 0; background: transparent; }
.material-sheet.docked .spec-head::before { display: none; }
.material-sheet.docked .spec-title { display: none; }
.material-sheet.docked .cut-part { display: none; }   /* имя и место детали — уже в шапке Inspector-а */
.material-sheet.docked .cut-body { padding: 4px 0 8px; }
.material-sheet.docked .material-foot { position: static; padding: 8px 0 0; background: transparent; border: 0; }
.material-sheet.docked .cut-field input { font-size: 22px; font-weight: 650; color: var(--accent); min-height: 48px; font-variant-numeric: tabular-nums; }
.material-sheet.docked #apply-shelf, .material-sheet.docked #apply-struct { min-height: 44px; border-radius: 22px; }
/* «Положение» и «Крепёж» — одна форма, разные её части */
#part-card[data-tab="joint"] #shelf-sheet :is(.cut-gaps, .cut-range, .cut-hint, .cut-templates:not(.shelf-joints), .shelf-count) { display: none !important; }
#part-card[data-tab="pos"] #shelf-sheet :is(.shelf-joints, .shelf-joint-label) { display: none !important; }
#part-card[data-tab="joint"] #shelf-sheet .shelf-joint-label { display: none; }
@media (pointer: coarse) { .insp-tabs button { min-height: 56px; } }
/* «Положение» существующей полки / штанги как в migman-cad-final (бета 28.10.2026, shelf-edit.js stepForm) */
.gap-rows { display: flex; flex-direction: column; }
.gap-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.gap-label { display: flex; flex-direction: column; font-size: 14px; color: var(--ink-2); }
.gap-label small { font-size: 12px; color: var(--muted); }
.gap-ctl { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 14px; background: rgba(29,36,38,.05); }
.gap-step { width: 44px; height: 48px; border: 0; border-radius: 11px; background: transparent; font: inherit; font-size: 22px; color: var(--ink-2); cursor: pointer; }
.gap-step:hover { background: #fff; } .gap-step:active { transform: scale(.94); }
.gap-ctl input { width: 88px; height: 48px; padding: 0; border: 0; background: transparent; text-align: center; font: inherit; font-size: 28px; font-weight: 650; letter-spacing: -.02em;
  color: var(--accent); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; outline: none; }
.gap-ctl input::-webkit-inner-spin-button, .gap-ctl input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gap-ctl:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.gap-link { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.gap-link span { flex: 1; height: 1px; background: var(--sep); } .gap-link b { font-weight: 500; }
.gap-steps { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.gap-stepv { min-width: 40px; height: 32px; border: 0; border-radius: 16px; background: rgba(29,36,38,.05); font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.gap-stepv[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); font-weight: 650; }
.gap-steps em { margin-left: auto; font-style: normal; text-align: right; line-height: 1.3; }
.gap-range { font-size: 12px !important; color: var(--muted) !important; }
#shelf-sheet .material-foot.gap-own { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#shelf-sheet .material-foot.gap-own .cut-status { flex-basis: 100%; font-size: 13px; }
#shelf-sheet .material-foot.gap-dirty { margin-top: 10px; padding: 8px 8px 8px 14px !important; border-radius: 14px; background: #f7ecd8 !important; }
.gap-draft { flex: 1; color: #9a6a1c; font-size: 13px; font-weight: 600; }
.gap-draft:empty { display: none; }
.gap-reset { height: 40px; padding: 0 12px; border-radius: 20px; background: transparent; color: var(--ink-2); }
.gap-reset[hidden] { display: none; }
#shelf-sheet .gap-own #apply-shelf { width: auto; height: 40px; min-height: 40px; padding: 0 16px; border-radius: 20px; }
.shelf-joint-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
#part-card[data-tab="pos"] #shelf-sheet .shelf-joint-note { display: none; }
#part-card[data-tab="joint"] #shelf-sheet .shelf-joints { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
#part-card[data-tab="joint"] #shelf-sheet .shelf-joints .btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 64px;
  padding: 10px 12px; border-radius: 12px; background: rgba(29,36,38,.05); color: var(--ink); text-align: left; white-space: normal; }
#part-card[data-tab="joint"] #shelf-sheet .shelf-joints .btn b { font-size: 13px; font-weight: 600; }
#part-card[data-tab="joint"] #shelf-sheet .shelf-joints .btn small { font-size: 12px; color: var(--muted); }
#part-card[data-tab="joint"] #shelf-sheet .shelf-joints .btn[aria-pressed="true"] { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
/* окно корпуса */
.corpus-body { display: flex; flex-direction: column; margin-bottom: 12px; }
.corpus-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: var(--hair) solid var(--sep); font-size: 13px; }
.corpus-row span { color: var(--muted); } .corpus-row b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.corpus-row:first-child { border-top: 0; }
.insp-actions-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 16px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 600; justify-content: center; }
.insp-actions-btn:hover { background: #1b4a52; }
/* этап B3 (30.10.2026): карточка детали без технического шума — «Отверстия» повторяли «Присадка · N», полное имя детали —
   в шапке и подсказке; включённые «Присадка / Фурнитура» — мягким акцентом, а не тёмной кнопкой (не главное действие) */
body.dock-final .insp-card #part-holes-row, body.dock-final .insp-card .insp-name-row, body.dock-final .insp-card #part-material-row { display: none !important; }
body.dock-final .insp-card .action-group .btn[aria-pressed="true"] { background: var(--accent-fill) padding-box; color: var(--accent); }
body.dock-final .insp-card .action-group .btn[aria-pressed="true"]:active { background: var(--fill-press) padding-box; }
#corpus-ctor { background: var(--fill); color: var(--accent); }
#corpus-ctor:hover { background: var(--accent-fill); }

/* окно отсека и ручка «тянуть» (бета 28.10.2026, migman-cad-final) */
.insp-meta { margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.fill-opening { display: flex; flex-direction: column; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 600; }
.fill-opening select { width: 100%; min-height: 44px; padding: 0 38px 0 14px; border: 1px solid var(--sep); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.fill-opening select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fill-actions { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.fill-actions .btn { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 44px; height: auto; padding: 10px 12px; border-radius: 14px; font-weight: 600; line-height: 1.25; text-align: center; }
.fill-actions .fill-cancel { background: var(--accent-fill); color: var(--accent); }
.fill-actions .fill-cancel:hover:not(:disabled) { background: #d3e4e5; }
.fill-actions .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 360px) { .fill-actions { grid-template-columns: 1fr; } }
.btn.fill-apply:not(:disabled) { background: var(--accent); color: #fff; }
.btn.fill-apply:not(:disabled):active { background: #1b4a52; }
@media (hover: hover) { .btn.fill-apply:not(:disabled):hover { background: #1b4a52; } }
.bay-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.bay-act { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 96px; padding: 14px 12px 12px; border: 0; border-radius: 14px;
  background: rgba(29,36,38,.05); color: var(--accent); font: inherit; text-align: left; cursor: pointer; transition: background-color .14s, transform .12s cubic-bezier(.23,1,.32,1); }
.bay-act b { margin-top: 4px; color: var(--ink); font-size: 14px; font-weight: 650; }
.bay-act small { color: var(--muted); font-size: 12px; }
.bay-act:hover { background: var(--accent-fill); } .bay-act:active { transform: scale(.97); }
.bay-act[aria-disabled="true"] { color: var(--muted); opacity: .6; cursor: default; }
.bay-act[hidden] { display: none !important; }
.bay-act[aria-disabled="true"]:hover { background: rgba(29,36,38,.05); }
.bay-note { margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
.insp-grab { position: absolute; z-index: 4; left: 0; top: 0; width: 56px; height: 32px; margin: -16px 0 0 -28px; padding: 0; border: 0; border-radius: 16px; background: var(--accent);
  box-shadow: 0 0 0 3px #fff, 0 6px 16px -4px rgba(35,93,103,.6); cursor: ns-resize; touch-action: none; pointer-events: auto; display: grid; place-items: center; }
.insp-grab[hidden] { display: none; }
.insp-grab::before { content: ""; width: 20px; height: 10px; border-top: 2px solid #fff; border-bottom: 2px solid #fff; }
.insp-grab.partition::before { transform: rotate(90deg); }
.number-limit-hint { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.number-limit-hint button { cursor: pointer; }
.insp-grab::after { content: ""; position: absolute; inset: -10px; }
.insp-grab:active { background: #1b4a52; }
/* ---- Нижняя панель и кнопки вида как в /design/migman-cad-final/ (бета 28.10.2026, dock-layout.js) ---- */
@media (min-width: 601px) and (min-height: 501px) {
  body.dock-final .toolbar { gap: 4px; padding: 6px; border-radius: 18px; background: rgba(252,252,251,.92);
    box-shadow: 0 0 0 var(--hair) rgba(60,52,40,.10), 0 1px 2px rgba(20,30,30,.06), 0 12px 32px -14px rgba(20,30,30,.22); }
  body.dock-final .toolbar .tools { gap: 4px; }
  body.dock-final .toolbar .btn { border-radius: 12px; color: var(--ink-2); font-weight: 550; }
  body.dock-final .toolbar .btn:hover { background: rgba(29,36,38,.05); color: var(--ink); }
  body.dock-final .toolbar .btn[aria-pressed="true"], body.dock-final .toolbar .btn[aria-expanded="true"] { background: var(--accent-fill); color: var(--accent); box-shadow: none; }
  body.dock-final .toolbar :is(#open-fronts, #undo-edit, #hide-facades, #open-estimate) { display: none !important; }
  body.dock-final .chat-launch { display: none !important; }
  body.dock-final .dock-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; }
  body.dock-final .dock-btn svg { flex: none; }
  body.dock-final .dock-btn[hidden] { display: none; }
  body.dock-final :is(.dock-icon, #measure, #view-menu) { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 44px; padding: 0; }
  body.dock-final :is(#measure, #view-menu, #dimensions) { font-size: 0; }
  body.dock-final :is(#measure, #view-menu, #dimensions) > * { display: none; }
  body.dock-final :is(#measure, #view-menu, #dimensions)::before { content: ""; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--dock-icon) center / contain no-repeat; mask: var(--dock-icon) center / contain no-repeat; }
  body.dock-final #measure { --dock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z'/%3E%3Cpath d='m14.5 12.5 2-2'/%3E%3Cpath d='m11.5 9.5 2-2'/%3E%3Cpath d='m8.5 6.5 2-2'/%3E%3Cpath d='m17.5 15.5 2-2'/%3E%3C/svg%3E"); }
  body.dock-final #view-menu { --dock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='13.5' cy='6.5' r='1' fill='black'/%3E%3Ccircle cx='17.5' cy='10.5' r='1' fill='black'/%3E%3Ccircle cx='8.5' cy='7.5' r='1' fill='black'/%3E%3Ccircle cx='6.5' cy='12.5' r='1' fill='black'/%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.93 0 1.65-.75 1.65-1.69 0-.44-.18-.84-.44-1.13-.29-.29-.44-.65-.44-1.13a1.64 1.64 0 0 1 1.67-1.67h2c3.05 0 5.56-2.5 5.56-5.55C21.97 6.01 17.46 2 12 2z'/%3E%3C/svg%3E"); }
  body.dock-final #dimensions { --dock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); display: inline-flex; align-items: center; justify-content: center; width: 22px; min-width: 22px; padding: 0; margin-left: -4px; }
  body.dock-final #dimensions::before { width: 14px; height: 14px; }
  body.dock-final #dimensions[aria-pressed="true"]:not([aria-expanded="true"]) { background: transparent; color: var(--ink-2); }
  body.dock-final .dock-sep { width: 1px; height: 26px; margin: 0 4px; background: var(--sep); flex: none; }
  body.dock-final[data-drawing="true"] .dock-select { display: none; }
  body.dock-final #open-draw { padding: 0 14px; }
  /* верх справа: [Спереди | 3D] [Скрыть фасады | Открыть | Развертка] [Конструктор] [↶] [Смета] — слева от «?» и «Аккаунт» (right ставит dock-layout.js) */
  .view-hud { position: absolute; z-index: 24; top: calc(env(safe-area-inset-top) + 12px); right: 120px; display: flex; align-items: center; gap: 8px; }
  body[data-debug="true"] .view-hud { top: calc(env(safe-area-inset-top) + 66px); }
  .view-hud-pill { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 4px; border-radius: 22px; background: var(--surface);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 0 0 var(--hair) var(--sep), 0 3px 12px rgba(30,24,16,.07); }
  .view-hud .btn { height: 36px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 18px; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; }
  .view-hud .btn:hover { background: var(--fill); color: var(--ink); }
  .view-hud .btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); font-weight: 600; }
  .view-hud .btn[hidden] { display: none; }
  .view-hud .btn:disabled { opacity: .45; cursor: default; }
  .view-hud .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .view-hud .view-hud-round { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 22px; background: var(--surface);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 0 0 var(--hair) var(--sep), 0 3px 12px rgba(30,24,16,.07); }
  .view-hud .view-hud-round[data-busy="true"] svg { opacity: .4; }
  .view-hud .view-hud-est { height: 44px; padding: 0 16px; border-radius: 22px; color: var(--ink); font-size: 14px; font-weight: 600; }
  body[data-start="true"] .view-hud { display: none; }
  /* этап B (30.10.2026): [ракурс] [показ] [Конструктор] — отдельными пилюлями; «Конструктор» — инструмент, значок и подпись */
  .view-hud .view-hud-pill[hidden] { display: none; }
  .view-hud .view-hud-tool { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; color: var(--ink); font-size: 13px; font-weight: 600; }
  .view-hud .view-hud-tool svg { flex: none; color: var(--accent); }
  .view-hud .view-hud-tool[aria-pressed="true"] { background: var(--accent); color: #fff; }
  .view-hud .view-hud-tool[aria-pressed="true"] svg { color: #fff; }
  /* крупнее (владелец 28.10.2026: «для планшетов удобнее»): панель без общего zoom .85, кнопки 48 px, на касании — 52 */
  @media (pointer: coarse) { body.dock-final .toolbar { zoom: 1 !important; } }
  body.dock-final .toolbar { padding: 6px; gap: 4px; border-radius: 20px; }
  body.dock-final .toolbar .btn, body.dock-final .draw-tile, body.dock-final .draw-more { height: 44px; border-radius: 13px; font-size: 14.5px; }
  body.dock-final :is(.dock-icon, #measure, #view-menu), body.dock-final .draw-more, body.dock-final[data-drawing="true"] #open-draw { width: 48px; min-width: 48px; }
  body.dock-final .dock-btn, body.dock-final #open-draw, body.dock-final .draw-tile { padding: 0 16px; gap: 8px; }
  body.dock-final .toolbar svg { width: 21px; height: 21px; }
  body.dock-final :is(#measure, #view-menu)::before { width: 21px; height: 21px; }
  body.dock-final #dimensions { width: 24px; min-width: 24px; }
  body.dock-final .dock-sep { height: 28px; margin: 0 4px; }

}
/* ---- Inspector справа сверху, высота по содержимому (бета 28.10.2026, migman-cad-final — источник дизайна) ---- */
@media (min-width: 601px) and (min-height: 501px) {
  /* одна правая панель, закреплена (бета 28.10.2026, migman-cad-final): от верхних кнопок до нижней панели, всё внутри неё */
  body .part-dock, body[data-chat-ready="true"] .part-dock, body[data-chat-open="true"] .part-dock { top: 72px; bottom: 96px; right: 16px; left: auto; width: 464px; max-width: calc(100vw - 32px);
    display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; pointer-events: auto; overflow: hidden auto; overscroll-behavior: contain;
    border-radius: 20px; background: rgba(252,252,251,.95); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 0 0 var(--hair) rgba(60,52,40,.10), 0 1px 2px rgba(20,30,30,.06), 0 14px 36px -14px rgba(20,30,30,.24); z-index: 22; }
  body[data-start="true"] .part-dock { display: none; }
  .part-dock > .part-card { width: 100%; max-height: none !important; overflow: visible; border-radius: 0; background: transparent; box-shadow: none !important; animation: none; flex: none; }
  .part-dock > #part-card { flex: 1 0 auto; display: flex; flex-direction: column; }
  .part-dock > #part-card .insp-foot { margin-top: auto; }
  .part-dock > #product-card, .part-dock > #place-card { flex: 1 0 auto; }
  /* пилюли («Материал · N», «Оставить только выбранное», «Скрыть», «Показать всё», «Сбросить присадку») — строками панели */
  .part-dock > .btn { flex: none; align-self: stretch; height: 44px; margin: 8px 14px 0; padding: 0 14px; border-radius: 12px; background: rgba(29,36,38,.05);
    box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; color: var(--accent); font-weight: 600; text-align: left; justify-content: flex-start; }
  .part-dock > .btn:hover { background: var(--accent-fill); }
  .part-dock > #show-all { box-shadow: inset 0 0 0 1px rgba(31, 98, 111, .38); }
  .part-dock > .btn[hidden] { display: none; }
  .part-dock > .preview-note { margin: 8px 14px 0; background: rgba(29,36,38,.05); box-shadow: none; }
  /* страница панели: окно инструмента вместо карточки, со своей шапкой и «Скрыть» */
  body[data-insp-page] .part-dock > :not(#insp-page) { display: none !important; }
  .insp-page { flex: 1 0 auto; display: flex; flex-direction: column; }
  .insp-page[hidden] { display: none; }
  .material-sheet.paged { position: static; inset: auto; width: auto; max-height: none; flex: 1 0 auto; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; animation: insp-in .16s cubic-bezier(.23,1,.32,1); z-index: auto; }
  .material-sheet.paged .spec-head { position: sticky; top: 0; z-index: 2; padding: 14px 18px 10px; background: rgba(252,252,251,.98); border-bottom: var(--hair) solid var(--sep); }
  .material-sheet.paged .material-foot { position: sticky; bottom: 0; margin-top: auto; background: rgba(252,252,251,.98); }
  .material-sheet.paged .material-list { overflow: visible; max-height: none; }
  .part-dock .insp-card { border-radius: 0; padding: 0 18px 16px; }
  /* чат — окошко над нижней панелью, как в прототипе (кнопка «Чат» в панели) */
  /* чат — та же правая поверхность (Right Workspace V1, /design/migman-cad-right-final/): пока он открыт, инспектора нет; закрыл — инспектор снова тут */
  body.dock-final .chat-panel, body.dock-final[data-ws] .chat-panel { top: 72px; bottom: 96px; right: 16px; left: auto; width: 464px; max-width: calc(100vw - 32px); height: auto; max-height: none;
    padding-top: 0; border-radius: 20px; transform-origin: 100% 50%; animation: rw-in .18s cubic-bezier(.23,1,.32,1); }
  body.dock-final[data-chat-open="true"] .part-dock { display: none !important; }
  body.dock-final .ws-switch { display: none !important; }
  body.dock-final .corpus-tags[hidden] { display: none !important; }   /* пилюли корпусов на модели: корпус — уровнем выше или строкой обзора в панели */
  /* спецификация и проверка модели — страницей панели, не окном поверх */
  dialog.specification.paged { position: static; inset: auto; margin: 0; width: auto; max-width: none; max-height: none; flex: 1 0 auto; padding: 0; border: 0; border-radius: 0;
    box-shadow: none; background: transparent; overflow: visible; }
  /* Конструктор и расстановка просят шире (их листы рассчитаны на 440 px) */
  body[data-insp-page="layout-sheet"] .part-dock { width: 440px; }
  body.dock-final[data-ws] .constructor-sheet.paged, .constructor-sheet.paged { padding-top: 0; }
  body[data-insp-page="constructor-sheet"] .part-dock { overflow: hidden; }
  body[data-insp-page="constructor-sheet"] .insp-page { flex: 1 1 0; min-height: 0; overflow: hidden; }
  .constructor-sheet.paged { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .constructor-sheet.paged .spec-head { flex: none; }
  .constructor-sheet.paged .spec-body { overflow: hidden; flex: 1 1 0; min-height: 0; }
  .constructor-sheet.paged .spec-title { display: flex !important; }
}
/* ---- Right Workspace V1 (бета 27.10.2026, источник — /design/migman-cad-right-final/): паспорт изделия, разделы вместо вкладок ---- */
@media (min-width: 601px) and (min-height: 501px) {
  .rw-sec { margin: 14px 0 4px; padding-top: 12px; border-top: var(--hair) solid var(--sep); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .rw-sec[hidden] { display: none; }
  .rw-rows:empty { display: none; }
  .rw-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; padding: 0; border: 0; background: transparent;
    font: inherit; font-size: 13.5px; color: var(--ink-2); text-align: left; }
  .rw-row b { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
  button.rw-row { cursor: pointer; border-radius: 9px; margin: 0 -6px; padding: 0 6px; width: calc(100% + 12px); }
  button.rw-row:hover { background: var(--fill); }
  .rw-warn b { color: #8a5a12; }
  .rw-sw { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); flex: none; }
  .pp-head { display: flex; align-items: center; gap: 8px; }
  .pp-name { font-size: 15px; font-weight: 650; color: var(--ink); }
  .pp-ver { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: rgba(29,36,38,.06); color: var(--ink-2); }
  .insp-overview .part-size { margin-top: 6px !important; }
  .insp-overview .insp-ok { padding: 0; margin: 0 0 2px !important; }
  .insp-overview .rw-sec:first-of-type { margin-top: 8px; }
  #product-corpora { margin: 0 -6px; }
  .rw-corp { display: flex !important; flex-direction: column; align-items: flex-start !important; gap: 2px !important; min-height: 52px; padding: 8px 6px !important; border-top: 0 !important; }
  .rw-ct { display: flex; align-items: baseline; gap: 8px; }
  .rw-ct .num { font-weight: 600; color: var(--ink-2); font-size: 14px; }
  .rw-corp em { text-align: left !important; white-space: normal !important; }
  /* этап B (30.10.2026): строка-переход — со стрелкой «›» справа (как на макете), набор — заголовком изделия с его габаритом */
  .rw-corp, button.rw-row { position: relative; }
  .rw-corp { padding-right: 28px !important; }
  .rw-chev { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: grid; color: var(--muted); }
  .rw-corp:hover .rw-chev, button.rw-row:hover .rw-chev { color: var(--accent); }
  button.rw-row.rw-warn { padding-right: 28px; }
  .rw-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 10px 6px 2px; padding-top: 10px; border-top: var(--hair) solid var(--sep); }
  .rw-item:first-child { margin-top: 2px; padding-top: 0; border-top: 0; }
  .rw-item b { font-size: 13px; font-weight: 650; }
  .rw-item .num { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
  /* деталь: вкладок нет — разделы друг под другом; главная правка (положение / крепёж в форме) видна сразу */
  #part-card .insp-tabs, #corpus-card .insp-tabs { display: none !important; }
  #part-card[data-tab] .insp-pane[hidden] { display: block !important; animation: none; }
  #part-card .insp-pane[data-pane="pos joint"]:not(:has(#part-pos-slot > :not([hidden]))):not(:has(#part-shelf:not([hidden]))):not(:has(#part-pjoint:not([hidden]))) { display: none !important; }
  #part-card .insp-pane[data-pane="pos joint"]::before { content: "Положение и крепёж"; }
  /* вкладки «Крепёж» больше нет — выбор крепежа полки сразу под положением, плитками как была вкладка (27.10.2026, владелец: «где выбор крепежа?») */
  #part-card[data-tab="pos"] #shelf-sheet .shelf-joint-label { display: block !important; margin: 14px 0 6px; }
  #part-card[data-tab="pos"] #shelf-sheet .shelf-joint-note { display: block; }
  #part-card[data-tab="pos"] #shelf-sheet .shelf-joints { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  #part-card[data-tab="pos"] #shelf-sheet .shelf-joints .btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 56px;
    padding: 8px 12px; border-radius: 12px; background: rgba(29,36,38,.05); color: var(--ink); text-align: left; white-space: normal; }
  #part-card[data-tab="pos"] #shelf-sheet .shelf-joints .btn b { font-size: 13px; font-weight: 600; }
  #part-card[data-tab="pos"] #shelf-sheet .shelf-joints .btn small { font-size: 12px; color: var(--muted); }
  #part-card[data-tab="pos"] #shelf-sheet .shelf-joints .btn[aria-pressed="true"] { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
  #part-card .insp-pane[data-pane="mat"]::before { content: "Материал и свойства"; }
  #part-card .insp-pane[data-pane="more"]::before { content: "Дополнительно"; }
  #part-card .insp-pane::before { display: block; margin: 12px 0 4px; padding-top: 12px; border-top: var(--hair) solid var(--sep); font-size: 11px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted); }
  #part-card .insp-pane[data-pane="more"]:not(:has(.insp-row:not([hidden]))):not(:has(#part-drilling:not([hidden]))):not(:has(#part-hardware:not([hidden]))) { display: none !important; }
  /* корпус: разделы сразу; правка корпуса — Конструктор на этом корпусе (другого доказанного пути пока нет) */
  #corpus-card .bay-note { display: none; }
  #corpus-card .corpus-body .rw-sec:first-child { margin-top: 8px; }
  #corpus-card .corpus-row:first-child, #corpus-card .rw-sec + .corpus-row { border-top: 0; }
  .insp-bay .rw-sec { margin-top: 16px; }
  @keyframes rw-in { from { opacity: .4; transform: translateX(10px); } }
}
@media (min-width: 601px) and (min-height: 501px) and (prefers-reduced-motion: reduce) { body.dock-final .chat-panel { animation: none; } }
@media (prefers-reduced-motion: reduce) { .part-dock .insp-card { animation: none; } }
.insp-card .part-head { margin: 0 -18px; padding: 6px 6px 0 18px; }
.insp-card .part-head::after { display: none; }
.insp-card .part-head h2 { flex: none; margin-top: 10px; padding: 3px 9px; border-radius: 7px; background: var(--accent-fill); color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.insp-card .part-head { align-items: center; justify-content: space-between; }
.insp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 14px 0 0; font-size: 12px; color: var(--muted); }
.insp-crumbs:empty { display: none; }
.insp-crumbs button { min-height: 28px; padding: 0 6px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.insp-crumbs button:hover { background: var(--fill); color: var(--ink); }
.insp-crumbs > span { padding: 0 4px; }
.insp-crumbs .sep { padding: 0 1px; opacity: .6; }
.insp-crumbs .here { color: var(--ink-2); font-weight: 600; }
.insp-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.insp-sub[hidden] { display: none; }
.insp-card .part-size { font-size: 28px !important; margin: 8px 0 8px !important; }
.insp-mat { display: flex; align-items: center; gap: 8px; }
.insp-mat i[hidden] { display: none; }
.insp-mat i { flex: none; width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.insp-card #part-validation, .insp-ok { min-height: 28px; padding: 0 8px; margin: 0 0 12px !important; background: transparent; box-shadow: none; }
.insp-card .tech-group { margin: 0 0 10px; padding: 0; border: 0; background: transparent; }
.insp-card .tech-row { padding: 9px 0; border-top: var(--hair) solid var(--sep); font-size: 13px; }
.insp-actions { gap: 8px; }
.insp-actions .btn { min-height: 44px; border-radius: 14px; background: var(--accent-fill); color: var(--accent); font-weight: 600; }
.insp-more .btn { border-radius: 12px; font-weight: 500; }
.insp-more .btn[hidden] { display: none; }
/* «Положение»: значения крупнее подписей, без карточек внутри карточки */
.material-sheet.docked .cut-gaps { align-items: end; }
.material-sheet.docked .cut-field { font-size: 12px; }
.material-sheet.docked .cut-field input { min-height: 52px; font-size: 26px; letter-spacing: -.02em; background: rgba(29,36,38,.045); border-radius: 12px; }
.material-sheet.docked .cut-range { font-size: 12px; color: var(--muted); }
.material-sheet.docked .cut-hint { font-size: 12px; }
.material-sheet.docked .cut-status { font-size: 13px; }
/* «Крепёж»: компактные чипы, не плитки */
/* обзор изделия */
.insp-overview { padding-top: 16px !important; }
.insp-kind { display: inline-flex; padding: 3px 8px; border-radius: 6px; background: var(--accent-fill); color: var(--accent); font-size: 12px; font-weight: 600; }
.insp-overview .insp-sub { margin-top: 8px; }
.insp-ok { display: inline-flex; align-items: center; color: #2e7d32; font-size: 13px; cursor: default; }
.insp-ok[data-state="issues"] { color: #8a5a12; cursor: pointer; }
.insp-list { display: flex; flex-direction: column; margin: 0 -6px 10px; }
.insp-list[hidden] { display: none; }
.insp-row-item { display: grid; grid-template-columns: 40px auto 1fr; align-items: baseline; gap: 10px; min-height: 44px; padding: 0 6px; border: 0; border-top: var(--hair) solid var(--sep);
  border-radius: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; align-content: center; }
#corpus-body .insp-row-item {display:block;width:100%;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.insp-row-item b { color: var(--ink); font-weight: 650; font-size: 14px; }
.insp-row-item em { font-style: normal; color: var(--muted); font-size: 12px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-row-item:hover { background: var(--fill); border-radius: 10px; }
.insp-row-item:hover b { color: var(--accent); }
.insp-how { margin: 4px 0 8px; padding: 12px 14px; border-radius: 14px; background: rgba(29,36,38,.04); }
.insp-how b { font-size: 12px; font-weight: 600; color: var(--muted); }
.insp-how p { display: flex; gap: 10px; margin: 8px 0 0; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.insp-how svg { flex: none; margin-top: 1px; color: var(--accent); }
.insp-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 8px; border-radius: 12px; background: transparent; color: var(--accent); font-size: 14px; justify-content: flex-start; }
.insp-link:hover { background: var(--accent-fill); }
/* Рисовать: карточка панели, пока инструмент в руке (как viewPlacing в migman-cad-final) */
.insp-place .part-size:empty, .place-pair:empty { display: none; }
.place-how { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; padding: 14px; border-radius: 14px; background: rgba(29,36,38,.04); color: var(--ink-2); font-size: 14px; }
.place-how[hidden] { display: none; }
.place-how svg { flex: none; color: var(--accent); }
.place-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.place-pair > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--accent-fill); }
.place-pair span { font-size: 12px; color: var(--accent); }
.place-pair b { font-size: 34px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.place-rows > div { display: flex; justify-content: space-between; gap: 12px; min-height: 40px; align-items: center; border-top: var(--hair) solid var(--sep); font-size: 13px; color: var(--muted); }
.place-rows > div b { font-weight: 500; color: var(--ink); text-align: right; }
.place-foot { margin: 14px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.place-label { display: block; margin: 4px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.place-sublabel { display: block; margin: 6px 0 6px; font-size: 12px; color: var(--muted); }
.place-joints { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 12px; }
.place-joints .btn { min-height: 48px; padding: 4px 8px; white-space: normal; line-height: 1.2; border-radius: 12px; background: rgba(29,36,38,.05); color: var(--ink-2); font-size: 14px; font-weight: 500; }
.place-joints .btn[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); font-weight: 600; }
/* окно детали после клика — внутри этой же карточки: шапка карточки остаётся, цифры окна крупно */
.insp-place { display: flex; flex-direction: column; }
.insp-place > .insp-kind { align-self: flex-start; }
.insp-place[data-placed] #place-mock { display: none; }
.place-mock-sheet .cut-field input { pointer-events: none; }
.place-slot { display: flex; flex-direction: column; flex: 1 0 auto; margin: 4px -18px 0; }
.place-slot:empty { display: none; }
.place-slot .cut-gaps { align-items: end; }
.place-slot > .material-sheet { flex: 1 0 auto; display: flex; flex-direction: column; }
.place-slot > .material-sheet .spec-head { display: none; }
/* задняя стенка из «Рисовать» → «+» (back-edit.js, 28.10.2026): варианты плитками */
.back-options { display: grid; gap: 8px; }
.back-options .back-option { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 56px; padding: 8px 14px; border-radius: 12px;
  background: rgba(29,36,38,.05); color: var(--ink); text-align: left; white-space: normal; }
.back-options .back-option b { font-size: 14px; font-weight: 600; }
.back-options .back-option small { font-size: 12px; color: var(--muted); }
.back-options .back-option[aria-checked="true"] { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
/* крепёж стоящей перегородки в её карточке (partition-joint.js, 28.10.2026) */
.part-pjoint[hidden] { display: none; }
.part-pjoint .part-joint-label { display: block; margin: 12px 0 6px; }
.part-pjoint .pj-joints { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.part-pjoint .pj-joints .btn { min-height: 48px; border-radius: 12px; background: rgba(29,36,38,.05); color: var(--ink); white-space: normal; }
.part-pjoint .pj-joints .btn[aria-pressed="true"] { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); font-weight: 600; }
.part-pjoint .cut-status { margin: 10px 0 0; font-size: 13px; }
.part-pjoint .pj-apply { width: 100%; min-height: 44px; margin-top: 10px; border-radius: 22px; background: var(--accent); color: #fff; }
.part-pjoint .pj-apply:disabled { opacity: .5; }
.part-pjoint .pj-flip { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 6px; font-size: 14px; cursor: pointer; }
.part-pjoint .pj-flip input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
/* шапки с «Скрыть» тут нет — передумал ставить: «Отмена» под «Установить» (на планшете нет Esc; владелец 28.10.2026) */
.material-foot .place-cancel { display: none; }
.place-slot .material-foot .place-cancel { display: block; background: transparent; color: var(--muted); }
.place-slot .cut-field input { min-height: 60px; font-size: 32px; font-weight: 650; letter-spacing: -.02em; color: var(--accent); background: var(--accent-fill); border-radius: 12px; font-variant-numeric: tabular-nums; }
/* the part card has Материал / Скрыть деталь itself: the pills over it are a second copy (owner 27.10.2026) */
body:has(#part-card:not([hidden])) :is(#material-selected, #isolate-selected, #hide-selected) { display: none; }
.cut-drawing { margin: 0 0 10px; padding: 6px 4px; background: #faf8f4; border-radius: 12px; text-align: center; }
.cut-drawing[hidden] { display: none; }
.groove-scheme { width: 100%; max-width: 330px; height: auto; max-height: 200px; }
/* Measurement. */
.measure-card { padding: 14px 16px 16px; }
.measure-card strong { display: block; margin-bottom: 6px; font-size: 17px; }
.measure-card[data-end-mm] strong { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.measure-card .part-meta { font-variant-numeric: tabular-nums; }
.measure-card .part-meta + .part-meta { margin-top: 4px; }
#annotations { position: absolute; inset: 0; pointer-events: none; overflow: hidden; isolation: isolate; }
/* isolation (owner 23.10.2026: «размеры поверх всплывающих меню»): the z-index of the inner labels stays inside this layer. */
/* The engine's warnings (warnings-ui.js): an amber badge over the parts, a tap shows the words. */
.warn-layer { position: absolute; inset: 0; pointer-events: none; }
.warn-badge { position: absolute; transform: translate(-50%, -50%); min-width: 26px; height: 26px; padding: 0 6px; border: 0; border-radius: 13px;
  background: #e08a00; color: #fff; font: 700 13px/26px system-ui, sans-serif; box-shadow: 0 2px 6px rgba(0,0,0,.25); cursor: pointer; pointer-events: auto; }
.warn-badge[hidden], .warn-pop[hidden] { display: none; }
.warn-pop { position: absolute; transform: translateX(-50%); max-width: min(320px, calc(100vw - 32px)); padding: 8px 12px; border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow); font-size: 13px; line-height: 1.4; color: var(--ink); pointer-events: auto; }
.warn-pop p { margin: 0 0 4px; } .warn-pop p:last-child { margin: 0; }
.dimension-label { position: absolute; transform: translate(-50%, -50%); padding: 3px 7px; border-radius: 7px; background: rgba(255,255,255,.94);
  color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 var(--hair) var(--sep), 0 1px 4px rgba(0,0,0,.1); }
.measure-label { color: var(--accent); }
.elevation-hint { position: absolute; transform: translate(-50%, -50%); width: 48px; height: 48px; color: var(--accent); opacity: .55; pointer-events: none; z-index: 2; transition: opacity .15s; filter: drop-shadow(0 0 2px rgba(255,255,255,.9)); }
.elevation-hint-text { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 600 12px/1 sans-serif; color: var(--accent); text-shadow: 0 0 3px #fff; }
.elevation-hint[hidden] { display: none; }
.elevation-depth { position: absolute; transform: translate(-50%, -50%); width: 34px; height: 34px; padding: 0; border: 0; border-radius: 17px; background: rgba(255,255,255,.85); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); opacity: .75; cursor: move; z-index: 3; touch-action: none; pointer-events: auto; transition: opacity .15s, background-color .15s, box-shadow .15s; }
.elevation-depth:hover { opacity: 1; background: #fff; box-shadow: inset 0 0 0 2.5px var(--accent), 0 0 0 4px rgba(35,100,112,.18); }
.elevation-depth svg { display: block; margin: auto; }
.elevation-depth[hidden] { display: none; }
.elevation-depth.dragging { opacity: 1; cursor: move; }
.ip-back-hint { color: var(--accent); }
.elevation-hint.dragging { opacity: .22; }
.elevation-hint svg { display: block; }
/* Корпуса при «Размерах» (corpus-tags.js): имя корпуса, тап — выделить и в чат пилюлей. */
.corpus-tags { position: absolute; inset: 0; z-index: 3; }
.corpus-tags[hidden], .corpus-tag[hidden] { display: none; }
body[data-client="true"] .corpus-tags { display: none !important; }   /* клиенту по ссылке — одни размеры */
/* Клиентская ссылка (data-client из main.js): без правой панели и без «Выбор / Чат»; «Спереди | 3D» + инструменты — по центру сверху.
   Правила dock-final (28.10) включали .part-dock и нижние кнопки безусловно и data-client не учитывали. */
body[data-client="true"] .part-dock, body[data-client="true"] .dock-select, body[data-client="true"] .dock-chat, body[data-client="true"] .toolbar .dock-sep { display: none !important; }
body[data-client="true"] .view-hud { right: auto !important; left: 50%; transform: translateX(-50%); }   /* !important: dock-layout.js fit() пишет right инлайном */
.corpus-tag { position: absolute; left: 0; top: 0; padding: 4px 10px; border: 0; border-radius: 999px; background: var(--accent); color: #fff;
  font: 650 13px/1.2 system-ui, sans-serif; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.22); cursor: pointer; pointer-events: auto; }
.corpus-tag:hover { filter: brightness(1.12); }
.corpus-tag[aria-pressed="true"] { background: #fff; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent), 0 2px 6px rgba(0,0,0,.22); }
/* Inner dimensions: smaller, blue, only the number (the unit is the same as outside); a facade in front hides them. */
.inner-label { z-index: 2; padding: 1px 5px; border-radius: 6px; font-size: 11px; color: #1d5fd1; }
.dimension-label { transition: opacity .15s; }
/* BAZIS-style dimension (20.10.2026): the olive number along the line in a small white pill, no shadow. */
.dimension-label.bazis-dim { padding: 1px 6px; border-radius: 999px; background: #fff; box-shadow: none; color: #6b6b00; font-weight: 600;
  line-height: 1.25; text-shadow: none; }
.dimension-label.bazis-dim.inner-label { padding: 0 5px; font-size: 11px; }
/* Размеры как на макете migman-cad-final (бета 28.10.2026): графитовое число без плашки, светлый ореол вместо фона */
.dimension-label.bazis-dim { padding: 0 4px; border-radius: 4px; background: transparent; color: #1f2a2c; font-size: 14px; font-weight: 600; letter-spacing: .01em;
  text-shadow: 0 0 3px #f4f5f3, 0 0 3px #f4f5f3, 0 0 6px #f4f5f3, 0 0 1px #f4f5f3; }
.dimension-label.bazis-dim.inner-label { font-size: 12px; color: #3f4a4c; }
/* The wrapper is a flex box: a plain block would put the button on a text baseline and lift its label. */
.dim-tools { display: flex; align-items: center; }
.dim-tools[hidden] { display: none; }
.dim-menu { left: auto; right: -3px; width: 220px; transform-origin: top right; }
.dim-mode { margin-left: 4px; color: var(--accent); font-weight: 400; }
.measure-marker { position: absolute; transform: translate(-50%, -50%); width: 18px; height: 18px; border: 2px solid white; border-radius: 50%;
  background: var(--accent); color: white; font-size: 10px; line-height: 14px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.err { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); background: var(--bg); font-size: 15px; }
.err a { color: var(--accent); }

/* Desktop: room for the whole passport without scrolling. */
@media (min-width: 601px) and (min-height: 501px) { .part-card { max-height: min(600px, calc(100dvh - 140px)); } }
/* Phone portrait: the card is a bottom sheet anchored to the screen edge. */
@media (max-width: 600px) {
  :root { --gutter: 8px; }
  .part-dock { left: var(--gutter); right: var(--gutter); width: auto; bottom: max(var(--gutter), env(safe-area-inset-bottom)); }
  .part-card { --r-card: 22px; max-height: min(460px, 56dvh); }
  @supports not (height: 1dvh) { .part-card { max-height: 56vh; } }
  .toolbar .btn { padding: 0 9px; }
  #view-menu { min-width: 72px; }
  #view-menu .mode-full { display: none; }
  #view-menu .mode-short { display: inline; }
  .dim-mode { display: none; }
  .toolbar #hide-facades { display: none !important; }
}
@media (max-width: 360px) { .toolbar .btn { padding: 0 7px; font-size: 13px; } #view-menu { min-width: 60px; } }
/* Phone landscape: little height -- the card docks on the right and may grow to just under the toolbar. */
@media (max-height: 500px) and (min-width: 601px) {
  .toolbar { top: max(8px, env(safe-area-inset-top)); }
  /* The dock spans from under the toolbar to the bottom; chips keep their size, the card shrinks and scrolls. */
  .part-dock { top: calc(max(8px, env(safe-area-inset-top)) + 58px); bottom: max(8px, env(safe-area-inset-bottom)); width: min(340px, 44vw); justify-content: flex-end; }
  .part-dock > .btn { flex-shrink: 0; }
  .part-card { max-height: none; min-height: 0; flex: 0 1 auto; }
}

#open-specification { border-top: var(--hair) solid var(--sep); border-radius: 0 0 10px 10px; }
.specification { position: fixed; inset: 80px 18px auto auto; margin: 0; width: min(440px, calc(100vw - 36px)); max-height: calc(100dvh - 104px); padding: 0; border: var(--hair) solid var(--sep); border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 12px 48px rgba(30,24,16,.18); overflow: hidden; }
.specification::backdrop { background: rgba(30,24,16,.16); }
.specification[open] { display: flex; flex-direction: column; }
.spec-head { padding: 14px 18px 12px; flex: none; border-bottom: var(--hair) solid var(--sep); }
.spec-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spec-title h2 { font-size: 20px; margin: 0; }
#close-specification { min-width: 44px; min-height: 44px; }
#spec-summary { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 4px 0 12px; }
#spec-search { box-sizing: border-box; width: 100%; min-height: 44px; border: 0; border-radius: 12px; padding: 10px 12px; background: var(--fill); color: inherit; font: inherit; font-size: 16px; }
.spec-nav { display: flex; gap: 2px; margin-top: 8px; }
.spec-nav .btn { flex: 1; min-width: 0; padding: 0 5px; font-size: 13px; }
.spec-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 0 18px 18px; }
.spec-body h3 { font-size: 15px; margin: 20px 0 8px; color: var(--muted); }
.spec-item { box-sizing: border-box; display: flex; flex-direction: column; gap: 5px; width: 100%; min-height: 44px; padding: 13px 0; border: 0; border-bottom: var(--hair) solid var(--sep); text-align: left; color: inherit; background: transparent; font: inherit; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
button.spec-item { cursor: pointer; }
.spec-flip { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.spec-flip-btn { flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; }
button.spec-item:active { background: var(--fill); }
.spec-item strong { font-size: 15px; font-weight: 600; }
.specification :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 600px) {
  .specification { inset: auto 0 0; width: 100%; max-width: none; height: calc(100dvh - env(safe-area-inset-top) - 24px); max-height: none; border-radius: 24px 24px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  .spec-head::before { content: ''; display: block; width: 34px; height: 5px; border-radius: 4px; background: var(--sep); margin: -5px auto 8px; }
}
/* Material preview: Viewer-only decor overrides. Side sheet on desktop, bottom sheet on phones; 3D stays visible. */
.material-sheet { position: fixed; z-index: 20; inset: 80px auto auto max(18px, env(safe-area-inset-left)); width: min(420px, calc(100vw - 36px)); max-height: calc(100dvh - 104px);
  display: flex; flex-direction: column; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: 0 0 0 var(--hair) var(--sep), 0 12px 40px rgba(30,24,16,.16); overflow: hidden; animation: rise .18s ease-out; }
.material-sheet[hidden] { display: none; }
/* «Расстановка» (23.10.2026): план сверху, изделия тянутся вдоль стен; справа на компьютере, снизу на телефоне. */
.layout-sheet { inset: 80px max(18px, env(safe-area-inset-right)) auto auto; width: min(440px, calc(100vw - 36px)); }
.layout-note { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.layout-body { padding: 10px 16px; overflow: auto; }
.layout-plan { display: block; width: 100%; aspect-ratio: 4 / 3; touch-action: none; user-select: none; }
.layout-room { fill: #f6f3ee; stroke: #8b8478; stroke-width: 12; }
.layout-wall-label { font: 600 90px system-ui, sans-serif; fill: #8b8478; text-anchor: middle; }
.layout-item rect { fill: #c9b79c; stroke: #6b5a43; stroke-width: 8; }
.layout-item.movable { cursor: grab; }
.layout-item.bad rect { fill: #f2c4bd; stroke: #b3261e; }
.layout-front { stroke: var(--accent); stroke-width: 28; stroke-linecap: round; }
.layout-name { font: 700 120px system-ui, sans-serif; fill: #3d3324; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.layout-room-size { margin: 10px 0; font-size: 13px; color: var(--muted); }
.layout-room-size input, .layout-row input { width: 82px; height: 36px; border: 0; border-radius: 9px; background: var(--fill); padding: 0 8px; font: inherit; }
.layout-items { display: grid; gap: 6px; }
.layout-row { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 6px; font-size: 13px; }
.layout-row select { height: 36px; border: 0; border-radius: 9px; background: var(--fill); font: inherit; }
.layout-status { margin: 10px 0 0; font-size: 13px; }
.layout-status[data-bad="true"] { color: #b3261e; }
.layout-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.layout-reset { width: 100%; border: 0; background: none; padding: 4px 0 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.layout-reset:hover { color: #b3261e; }
.layout-reset[hidden] { display: none; }
/* «Развертка» (24.10.2026): изделия в ряд для правок, сохранённая расстановка ждёт — плашка сверху возвращает её. */
.layout-unfolded { position: fixed; z-index: 15; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 36px); padding: 6px 6px 6px 14px; border-radius: 999px;
  background: var(--card); color: var(--ink); box-shadow: 0 0 0 var(--hair) var(--sep), 0 8px 24px rgba(30,24,16,.12); font-size: 13px; animation: rise .18s ease-out; }
.layout-unfolded[hidden] { display: none; }
.layout-unfolded span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.layout-unfolded .btn { white-space: nowrap; }
/* клиенту развертку переключает кнопка в панели ракурсов (#pill-unfold) — плашка не нужна */
body[data-client="true"] .layout-unfolded { display: none; }
/* новая панель (dock-final): «Расстановка» — в кнопках вида сверху справа, плашка дублирует её и наезжает */
body.dock-final .layout-unfolded { display: none; }
@media (max-width: 700px) { .layout-unfolded { top: calc(max(10px, env(safe-area-inset-top)) + 56px); } }
.material-sheet.constructor-sheet { inset: 80px max(18px, env(safe-area-inset-right)) 18px auto; width: min(440px, calc(100vw - 36px)); max-height: none; }
.material-sheet.constructor-sheet, .material-sheet.facade-sheet { --cx-fill: #f1f3f5; --cx-line: #e2e5e9; --cx-input: #f1f3f5; --cx-off: #d5dadf; --cx-muted: #5f676d; }
/* У фасада панель не вложена в spec-body с отступами, а сегмент материала должен оставлять место подписи. */
.facade-sheet > .cx-bar { margin: 0; display: grid; container-type: inline-size; }
.facade-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: 2px; min-width: 0; }
.facade-sheet .facade-actions .btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; white-space: nowrap; }
.facade-sheet .facade-actions .btn:hover { background: var(--fill); }
.facade-sheet .facade-actions .part-delete { margin-left: auto; color: #b3261e; }
.facade-sheet .facade-actions [hidden] { display: none; }
@container (max-width: 340px) { .facade-sheet .facade-actions .btn { padding-inline: 2px; gap: 3px; font-size: 12px; } }
.facade-sheet > .cx-bar .cx-go { width: 100%; box-sizing: border-box; }
.facade-sheet .cx-row2[data-facade-field="material"] { grid-template-columns: minmax(0, 1fr) minmax(0, 250px); }
.facade-sheet .cx-row2[data-facade-field="material"] .cx-opt { min-width: 0; padding-inline: 4px; font-size: 12px; }
/* Нейтральная холодная гамма Конструктора (владелец 19.10.2026: «бледно-розовый — лаконичнее, серьёзнее»), акцент прежний. */
@media (min-width: 601px) and (min-height: 501px) { .material-sheet.constructor-sheet.paged { width: 100%; } }
.constructor-sheet .spec-body { padding: 0 14px; }
.cx-context { display: flex; align-items: center; gap: 4px; margin: 2px 2px 4px; font-size: 13px; color: var(--cx-muted); }
.cx-context strong { color: var(--ink); font-weight: 500; }
.cx-context-note { font-size: 12px; }
.cx-context .cx-link { margin-left: auto; }
.constructor-sheet .spec-title { justify-content: space-between; }
.constructor-sheet .spec-title h2 { min-width: 0; overflow-wrap: anywhere; }
.constructor-sheet .cx-close { margin-left: auto; flex: none; }
.constructor-sheet .spec-title h2 { font-size: 18px; }
.cx-items { display: flex; gap: 6px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; }   /* изделия набора (25.10.2026) */
.cx-item { display: flex; flex-direction: column; align-items: flex-start; flex: 1 1 0; min-width: 96px; padding: 6px 10px; border: 0; border-radius: 10px;
  background: var(--cx-fill); box-shadow: inset 0 0 0 1px var(--cx-line); color: var(--ink-2, #394246); font: inherit; text-align: left; cursor: pointer; }
.cx-item b { font-size: 13px; font-weight: 700; }
.cx-item span { font-size: 12px; color: var(--cx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cx-item[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.cx-item[aria-pressed="true"] span { color: rgba(255,255,255,.85); }
.cx-item:disabled { opacity: .6; cursor: default; }
.cx-modes { display: inline-flex; gap: 2px; margin: 0 auto 0 12px; padding: 2px; border-radius: 9px; background: var(--cx-fill); box-shadow: inset 0 0 0 1px var(--cx-line); }
.cx-modes button { min-height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--cx-muted); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.cx-modes button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.cx-modes button:disabled { opacity: .45; cursor: default; }
.cx-close { width: 36px; min-width: 36px; height: 36px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; }
.cx-presets[hidden] { display: none; }
.cx-presets-tumba { max-height: min(45vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.cx-preset-header { width: 100%; margin: 10px 0 2px; padding: 6px 4px; border: 0; background: transparent; color: var(--cx-muted); font: inherit; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.cx-preset-header[aria-expanded="false"] { color: var(--accent); border-radius: 8px; background: var(--accent-fill); padding: 9px 12px; }
.cx-preset-header:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cx-preset-row[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .cx-preset-row:not([hidden]) { animation: cx-preset-reveal .18s ease-out; } @keyframes cx-preset-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } } }
.cx-preset.cx-on { background: var(--accent-fill); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cx-preset-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 4px 0 6px; }
.cx-preset-group { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.cx-preset-kinds { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--cx-line); }
.cx-preset-kinds:only-child { padding-bottom: 0; border-bottom: 0; }
.cx-preset-group-title { grid-column: 1 / -1; margin: 8px 4px 2px; color: var(--cx-muted); font: inherit; font-size: 12px; font-weight: 600; }
.cx-preset { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 52px; padding: 8px 11px; border: 0; border-radius: 12px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--cx-line); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cx-preset b { font-size: 14px; font-weight: 600; }
.cx-preset small { font-size: 12px; color: var(--cx-muted); }
@media (hover: hover) { .cx-preset:hover { box-shadow: inset 0 0 0 1.5px var(--accent); } }
.cx-tier { margin: 14px 4px 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--cx-muted); }
.cx-catalog-link { border:0; background:transparent; color:var(--accent); font:inherit; font-size:13px; font-weight:600; padding:8px 0; cursor:pointer; }
.cx-catalog-link:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.cx-link { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; min-height: 32px; }
.cx-sure { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--ink); }
.cx-danger { color: #b3261e; }
.cx-status { margin: 0 0 8px; min-height: 16px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.cx-status-error { color: #c0392b; }
.cx-group { border-bottom: var(--hair) solid var(--sep); }
.cx-group summary { display: flex; align-items: center; min-height: 44px; font-size: 13px; color: var(--muted); cursor: pointer; }
.facade-advanced > summary { color: var(--accent); font-weight: 650; list-style: none; gap: 7px; }
.facade-advanced > summary::-webkit-details-marker { display: none; }
.facade-advanced > summary::before { content: '›'; font-size: 19px; line-height: 1; transition: transform .15s; }
.facade-advanced[open] > summary::before { transform: rotate(90deg); }
/* Назначить положение изделия — блок обзора правой панели (бета 09.11.2026): токены панели (--fill, --sep, --accent-fill), без рамок */
#item-place[hidden], #item-place [hidden] { display: none !important; }
#item-place .rw-sec { margin-top: 14px; }

.product-status-footer { margin-top: 16px; }
.layout-shortcut { margin-left: auto; flex: 0 0 36px; width: 36px; height: 36px; padding: 7px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(35,93,103,.18); border-radius: 10px; background: var(--accent-fill); color: var(--accent); cursor: pointer; }
.layout-shortcut[hidden] { display: none; }
@media (hover: hover) { .layout-shortcut:hover { background: var(--fill-press); border-color: var(--accent); } }
.layout-shortcut:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ip-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; margin: 6px 0 0; }
.ip-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; min-height: 48px; padding: 7px 10px; border: 1px solid rgba(35,93,103,.16); border-radius: 10px;
  background: linear-gradient(180deg, rgba(35,93,103,.045), rgba(35,93,103,.085)); box-shadow: 0 1px 2px rgba(35,93,103,.08); color: var(--ink); font: inherit; text-align: left; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.ip-item b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.ip-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .ip-item:hover { background: linear-gradient(180deg, rgba(35,93,103,.08), rgba(35,93,103,.14)); border-color: rgba(35,93,103,.4); box-shadow: 0 2px 6px rgba(35,93,103,.16); } }
.ip-item:active { transform: translateY(1px); box-shadow: 0 0 1px rgba(35,93,103,.12); }
.ip-item[aria-checked="true"] { background: var(--accent-fill); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(35,93,103,.2); }
.ip-item[aria-checked="true"] span { color: var(--accent); }
.ip-item:disabled { opacity: .55; cursor: default; box-shadow: none; }
.ip-item:focus-visible, .ip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ip-pick, .ip-note { margin: 8px 2px 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.ip-note:empty, .ip-status:empty { display: none; }
.ip-body { margin-top: 8px; }
.ip-axis { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; border-top: var(--hair) solid var(--sep); font-size: 13.5px; color: var(--ink-2); }
.ip-axis:first-child { border-top: 0; }
.ip-step { display: inline-grid; grid-template-columns: 36px 92px 36px; align-items: center; height: 38px; border-radius: 10px; background: var(--fill); }
.ip-step:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); }
.ip-btn { height: 100%; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
@media (hover: hover) { .ip-btn:hover:not(:disabled) { background: var(--fill-press); } }
.ip-btn:disabled { color: var(--muted); opacity: .5; cursor: default; }
.ip-val { display: flex; align-items: baseline; justify-content: center; gap: 3px; min-width: 0; }
.ip-val input { width: 6ch; min-width: 0; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; }
.ip-val input::-webkit-inner-spin-button, .ip-val input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ip-val i { font-style: normal; font-size: 12px; color: var(--muted); }
.ip-axis select { width: 164px; height: 38px; padding: 0 8px; border: 0; border-radius: 10px; background: var(--fill); color: var(--ink); font: inherit; font-size: 13px; }
.ip-fix[hidden] { display: none; }
.ip-fix button { margin-top: 4px; display: block; cursor: pointer; font: inherit; font-weight: 600; color: var(--accent); background: none; border: 1px solid var(--accent); border-radius: 6px; padding: 5px 10px; }
.ip-status { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.ip-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ip-foot .btn { min-height: 40px; border-radius: 10px; justify-content: center; }
#elevation-apply:not(:disabled) { background: var(--accent); color: #fff; }
/* Удалить изделие — опасная кнопка на всю ширину: красный контур и текст, как у удаления деталей (#b3261e) */
.ip-delete { margin-top: 12px; padding-top: 12px; border-top: var(--hair) solid var(--sep); }
.ip-delete-btn { width: 100%; min-height: 44px; justify-content: center; border-radius: 10px; background: none; color: #b3261e; box-shadow: inset 0 0 0 1.5px #b3261e; font-weight: 600; }
@media (hover: hover) { .ip-delete-btn:hover:not(:disabled) { background: rgba(179,38,30,.09); } }
.ip-delete-btn:disabled { color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--sep); cursor: default; }
.ip-confirm { padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1.5px #b3261e; background: rgba(179,38,30,.05); }
.ip-confirm-text { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink); }
.ip-delete-yes:not(:disabled) { background: #b3261e; color: #fff; }
.cx-meta { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.constructor-sheet .spec-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; padding: 0 14px; }
.constructor-sheet .spec-body > * { flex: none; }
.constructor-sheet .spec-body > .cx-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.cx-form > .cx-presets, .cx-form > .cx-scheme, .cx-form > .cx-tabs, .cx-form > .cx-bar { flex: none; }
.cx-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cx-ic-xs { width: 14px; height: 14px; }
/* вкладки */
.cx-tabs { display: grid; grid-template-columns: repeat(4, 1fr); margin: 6px -2px 0; border-bottom: 1px solid var(--cx-line); }
.cx-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 58px; padding: 7px 2px 9px; border: 0; background: none;
  color: var(--cx-muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.cx-tab .cx-ic { width: 22px; height: 22px; }
.cx-tab[aria-selected="true"] { color: var(--accent); }
.cx-tab[aria-selected="true"]::after { content: ''; position: absolute; left: 16%; right: 16%; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
@media (hover: hover) { .cx-tab:hover:not([aria-selected="true"]) { color: var(--ink); } }
.cx-tab-dot { position: absolute; top: 7px; left: calc(50% + 10px); width: 8px; height: 8px; border-radius: 50%; background: #b8640f; }
.cx-tab-dot[hidden] { display: none; }
.cx-tab-body::-webkit-scrollbar { display: none; }
.cx-tab-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -14px; padding: 2px 14px 18px; scrollbar-width: none; }
.cx-grp { margin-top: 12px; }
.cx-grp h3 { margin: 0 4px 2px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
/* строка: подпись и вторая строка слева, ручка справа; высота постоянная */
.cx-tip { display:flex; flex-direction:column; gap:6px; margin:12px 0 4px; padding:12px 14px; border-radius:12px; background:#fff7e6; box-shadow:inset 0 0 0 1px #f1dcae; color:#5b4a1f; font-size:13.5px; line-height:1.4; }
.cx-tip[hidden] { display:none; }
.cx-tip b { font-size:14.5px; color:#3d3214; }
.cx-tip-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:2px; }
.cx-tip-btn { min-height:34px; padding:0 14px; border:0; border-radius:9px; background:#fff; box-shadow:0 0 0 1px #e6cf9b, 0 1px 2px rgba(0,0,0,.05); font:inherit; font-size:13.5px; font-weight:600; color:var(--accent,#2a7d7a); cursor:pointer; }
.cx-tip-btn:hover { box-shadow:0 0 0 1.5px var(--accent,#2a7d7a); }
.cx-tip small { color:#8a7643; font-size:12.5px; }
.cx-front-box { display:inline-flex; align-items:center; gap:4px; padding:0 12px; }
.cx-front-box .cx-front-h { width:72px; text-align:right; }
.cx-front-box .cx-unit { font-size:13px; color:var(--cx-muted, #5f676d); }
.cx-row2 { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 62px; padding: 7px 4px; border-top: 1px solid var(--cx-line); }
.cx-grp h3 + .cx-row2, .cx-grp .cx-tiles + .cx-row2 { border-top: 0; }
.cx-row-compact { min-height: 0; padding: 4px 4px; }
.cx-row-compact > .cx-row-label { gap: 0; }
.cx-row-compact .cx-meta2:not(.cx-meta-err):not(.cx-meta-lock):not(:has(button)) { display: none; }
.cx-mz { display: block; }
.cx-mz-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 0 0 6px; }
.cx-mz-line[hidden], .cx-mz-line > [hidden] { display: none; }
.cx-mz-line > .cx-row2 { display: flex; align-items: center; gap: 8px; border-top: 0; padding: 0 4px; }
.cx-mz-line .cx-row-title { font-size: 14px; font-weight: 500; color: var(--cx-muted); }
.cx-mz-line .cx-seg .cx-opt { min-height: 30px; padding: 0 12px; font-size: 13px; }
.cx-mz .cx-row-title { align-items: center; }
.side-hint-btn { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--cx-fill); box-shadow: inset 0 0 0 1px var(--cx-line); color: var(--cx-muted); font: 600 12px/1 inherit; cursor: pointer; }
.side-hint { position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 32px); box-sizing: border-box; padding: 14px 16px 14px; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.18), 0 0 0 1px var(--cx-line); pointer-events: none; font-size: 13px; line-height: 1.4; }
.side-hint-title { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.side-hint-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.side-hint-note { margin: 8px 0 0; color: var(--cx-muted); }
.cx-row-wide { grid-template-columns: 1fr; gap: 8px; padding: 9px 4px 11px; }
.cx-row-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cx-row-wide .cx-row-label { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cx-row-title { display: inline-flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 600; color: var(--ink); }
.cx-row-title .cx-ic { color: var(--cx-muted); width: 18px; height: 18px; }
.cx-meta2 { display: inline-flex; align-items: center; gap: 5px; min-height: 18px; font-size: 12.5px; color: var(--cx-muted); line-height: 1.3; }
.cx-meta-err { color: #b3261e; }
.cx-meta-lock .cx-ic { width: 14px; height: 14px; }
.cx-was2 { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 0; border-radius: 999px; background: #fbf0e3; color: #a65a0d; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .cx-was2:hover { text-decoration: underline; } }
.cx-row2[data-k="back"].cx-off .cx-select { opacity: .5; }
.cx-off .cx-row-title { color: #9aa2a8; }
.cx-off .cx-stepper, .cx-off .cx-toggle, .cx-off .cx-choice { opacity: .4; pointer-events: none; }
.cx-locked { display: inline-flex; align-items: center; gap: 2px; }
.cx-locked b { font-size: 15.5px; padding-right: 4px; }
.cx-ghost { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--accent);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cx-ghost .cx-ic { width: 16px; height: 16px; }
@media (hover: hover) { .cx-ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, #fff); } }
.cx-add-head { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px 0 9px; border: 1px solid color-mix(in srgb, var(--accent) 45%, #fff); border-radius: 999px; background: color-mix(in srgb, var(--accent) 8%, #fff); color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
@media (hover: hover) { .cx-add-head:hover { background: color-mix(in srgb, var(--accent) 16%, #fff); } }
.cx-ghost:disabled { color: #a3abb1; cursor: default; }
.cx-soft { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--cx-fill); box-shadow: inset 0 0 0 1px var(--cx-line); color: var(--ink);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.cx-chat-more { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; }
.cx-spread2 { margin: 2px 0 0 auto; display: flex; }
.cx-select { position: relative; display: inline-flex; width: 200px; }
.cx-row2[data-k="board_thickness"] .cx-select { width: 164px; }
.cx-select select { width: 100%; height: 42px; padding: 0 30px 0 12px; border: 0; border-radius: 12px; background: var(--cx-fill); box-shadow: inset 0 0 0 1px var(--cx-line);
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-overflow: ellipsis; appearance: none; -webkit-appearance: none; cursor: pointer; outline: none; }
.cx-select::after { content: ''; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 2px solid var(--cx-muted); border-bottom: 2px solid var(--cx-muted); transform: rotate(45deg); pointer-events: none; }
.cx-select select:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); background: #fff; }
.cx-select.cx-changed select { background: #fbf0e3; box-shadow: inset 0 0 0 1.5px #c27215; color: #a65a0d; }
/* «− N +» */
.cx-stepper { display: inline-grid; grid-template-columns: 40px 1fr 40px; align-items: center; width: 164px; height: 42px; border-radius: 12px; background: var(--cx-fill);
  box-shadow: inset 0 0 0 1px var(--cx-line); }
.cx-st-btn { height: 100%; border: 0; background: none; display: grid; place-items: center; border-radius: 12px; color: var(--ink); cursor: pointer; }
.cx-st-btn .cx-ic { width: 17px; height: 17px; stroke-width: 2.2; }
@media (hover: hover) { .cx-st-btn:hover:not(:disabled) { background: #e5e9ec; } }
.cx-st-btn:active:not(:disabled) { transform: scale(.94); }
.cx-st-btn:disabled { color: #c3c9ce; cursor: default; }
.cx-st-val { display: flex; align-items: baseline; justify-content: center; gap: 3px; min-width: 0; }
.cx-st-input { width: 100%; min-width: 0; border: 0; background: none; text-align: center; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); padding: 0; font-variant-numeric: tabular-nums; outline: none; }
.cx-st-val:has(.cx-st-unit) .cx-st-input { width: 5ch; text-align: right; }
.cx-st-unit { font-size: 12px; color: var(--cx-muted); }
.cx-stepper:focus-within { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); }
.cx-stepper.cx-changed { background: #fbf0e3; box-shadow: inset 0 0 0 1.5px #c27215; }
.cx-stepper.cx-default .cx-st-input { color: var(--cx-muted); }
.cx-stepper.cx-bad { box-shadow: inset 0 0 0 1.5px #b3261e; }
/* переключатель */
.cx-facade-controls {display:flex;align-items:center;gap:12px}.cx-facade-visibility {width:40px;height:40px;display:grid;place-items:center;border:0;border-radius:10px;background:transparent;color:var(--muted);cursor:pointer}.cx-facade-visibility:hover,.cx-facade-visibility[aria-pressed="true"] {background:var(--accent-fill);color:var(--accent)}.cx-facade-visibility:disabled {opacity:.4;cursor:default}.cx-facade-visibility:not([aria-pressed="true"]) .eye-slash {display:none}.cx-facade-visibility:focus-visible {outline:2px solid var(--accent);outline-offset:2px}
.cx-toggle { position: relative; width: 50px; height: 30px; flex: none; padding: 0; border: 0; border-radius: 15px; background: #cdd3d8; cursor: pointer; transition: background .15s; }
.cx-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.cx-toggle.cx-on { background: var(--accent); }
.cx-toggle.cx-on .cx-knob { transform: translateX(20px); }
.cx-toggle.cx-changed { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px #c27215; }
.cx-toggle:focus-visible, .cx-opt:focus-visible, .cx-tile:focus-visible, .cx-cp:focus-visible, .cx-tab:focus-visible, .cx-pin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* варианты на виду */
.cx-choice { display: grid; gap: 6px; }
.cx-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-seg { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px; border-radius: 12px; background: var(--cx-fill); box-shadow: inset 0 0 0 1px var(--cx-line); }
.cx-swatch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx-opt { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 4px 10px; border: 0; border-radius: 11px; background: var(--cx-fill);
  box-shadow: inset 0 0 0 1px var(--cx-line); color: var(--ink-2, #394246); font: inherit; font-size: 14px; font-weight: 500; line-height: 1.15; text-align: center; cursor: pointer; }
.cx-seg .cx-opt { background: none; box-shadow: none; min-height: 38px; border-radius: 9px; }
.cx-swatch .cx-opt { justify-content: flex-start; text-align: left; }
.cx-swatch .cx-default-color {grid-column:1 / -1;min-height:34px;padding:4px 8px;background:transparent;color:var(--muted);font-size:13px;font-weight:400;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:none;}
.cx-swatch .cx-default-color.cx-on {background:transparent;color:var(--muted);font-weight:500;box-shadow:none;}
.cx-swatch .cx-default-color.cx-on::before {content:'✓';color:var(--accent);font-weight:700;}
.cx-swatch .cx-default-color:not(.cx-on)::before {content:'○';color:var(--muted);}
.cx-dot2 { width: 22px; height: 22px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.16); }
@media (hover: hover) { .cx-opt:hover:not(.cx-on):not(:disabled) { background: #e5e9ec; } }
.cx-opt.cx-on { background: #fff; color: var(--accent); font-weight: 650; box-shadow: inset 0 0 0 2px var(--accent); }
.cx-seg .cx-opt.cx-on { box-shadow: 0 1px 2px rgba(0,0,0,.1), inset 0 0 0 1.5px var(--accent); }
.cx-choice.cx-changed .cx-opt.cx-on { color: #a65a0d; box-shadow: inset 0 0 0 2px #c27215; }
/* Видимые стороны (11.11.2026): сегмент с мини-схемой корпуса — видимая боковина жирная, у стены пунктир */
.cx-sides .cx-opt { flex-direction: column; gap: 2px; min-height: 52px; padding: 5px 2px 4px; font-size: 13px; }
.cx-sides-ic { width: 28px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; }
.cx-sides-ic .cx-sides-body { stroke-width: 1.4; opacity: .45; }
.cx-sides-ic .cx-side-off { stroke-width: 1.4; opacity: .45; stroke-dasharray: 2 2.4; }
.cx-sides-ic .cx-side-on { stroke-width: 3.2; }
/* Фасады (25.10.2026): галочка маленькой строкой под глубиной и плитки корпусов во «Виде» */
.cx-checkline { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; margin-top: -6px; padding: 0 4px 6px; }
.cx-check { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.cx-check:disabled { cursor: default; opacity: .6; }
.cx-check-title { font-weight: 600; }
.cx-check-note { font-size: 12.5px; color: var(--cx-muted); }
.cx-check-box { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1.5px #b9c0c6; transition: background .12s, box-shadow .12s; }
.cx-check-box .cx-ic { width: 14px; height: 14px; color: #fff; stroke-width: 3; opacity: 0; transition: opacity .12s; }
.cx-on > .cx-check-box { background: var(--accent); box-shadow: none; }
.cx-on > .cx-check-box .cx-ic { opacity: 1; }
.cx-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.cx-corpora { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }   /* корпуса делят всю ширину строки */
.cx-corp { justify-content: flex-start; gap: 8px; min-height: 44px; padding: 4px 12px; }
.cx-corp small { white-space: nowrap; }
.cx-corp b { font-size: 14px; font-weight: 650; }
.cx-corp small { margin-left: auto; font-size: 11.5px; color: var(--cx-muted); font-weight: 500; }
.cx-corp:not(.cx-on) b { color: var(--cx-muted); text-decoration: line-through; text-decoration-color: #b9c0c6; }
.cx-corp.cx-changed { box-shadow: inset 0 0 0 2px #c27215; }
.cx-corp.cx-changed.cx-on { color: #a65a0d; }
/* корпус и наполнение */
.cx-corpus-pick { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; padding: 10px 0 6px; background: var(--card); }
.cx-cp { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 50px; border: 0; border-radius: 12px;
  background: var(--cx-fill); box-shadow: inset 0 0 0 1px var(--cx-line); color: var(--ink); font: inherit; cursor: pointer; }
.cx-cp b { font-size: 15px; } .cx-cp small { font-size: 12px; color: var(--cx-muted); }
.cx-cp.cx-on { background: var(--accent); box-shadow: none; color: #fff; }
.cx-cp.cx-on small { color: rgba(255,255,255,.82); }
.cx-cp-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #c27215; }
.cx-cp-dot[hidden] { display: none; }
.btn.cx-edit3d { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; margin: 6px 0 0; background: var(--accent); color: #fff; font-weight: 600; }
.btn.cx-edit3d:active { background: #1b4a52; }
@media (hover: hover) { .btn.cx-edit3d:hover { background: #1b4a52; } }
.cx-edit3d-hint { margin: 4px 4px 0; font-size: 12px; line-height: 1.35; color: var(--muted, #6b747a); text-align: center; }
.cx-fill-now { margin: 10px 4px; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
.cx-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 4px 0 6px; }
.cx-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 4px 8px; border: 0; border-radius: 13px; background: var(--cx-fill);
  box-shadow: inset 0 0 0 1px var(--cx-line); color: var(--ink); font: inherit; cursor: pointer; }
.cx-tile span { font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; }
.cx-picto { height: 66px; width: auto; }
.cx-pc-box { fill: #fff; stroke: #7f8b91; stroke-width: 1.3; }
.cx-pc-shelf { stroke: #56636a; stroke-width: 1.4; }
.cx-pc-drawer { fill: #eef1f2; stroke: #8b979d; stroke-width: 1; }
.cx-pc-handle { stroke: #56636a; stroke-width: 1.3; stroke-linecap: round; }
.cx-pc-rod { stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.cx-pc-hanger { fill: none; stroke: #8b979d; stroke-width: 1; stroke-linejoin: round; }
@media (hover: hover) { .cx-tile:hover:not(:disabled):not(.cx-on) { box-shadow: inset 0 0 0 1.5px var(--accent); } }
.cx-tile.cx-on { background: color-mix(in srgb, var(--accent) 11%, #fff); box-shadow: inset 0 0 0 2px var(--accent); }
.cx-tile:disabled { opacity: .45; cursor: default; }
/* полоса внизу */
.cx-bar { position: relative; margin: 0 -14px; padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--cx-line); display: grid; gap: 6px; }
.cx-status2 { display: flex; align-items: center; gap: 8px; min-height: 24px; margin: 0; padding: 0 2px; font-size: 12.5px; line-height: 1.3; color: var(--cx-muted); overflow-wrap: anywhere; }
.cx-status2.cx-ok { color: #2f7a4b; } .cx-status2.cx-err { color: #b3261e; }
.cx-status2.cx-ok::before { content: '✓'; font-weight: 700; }
.cx-status2.cx-wait::before { content: ''; width: 13px; height: 13px; flex: none; border-radius: 50%; border: 2px solid #cdd3d8; border-top-color: var(--accent); animation: spin .8s linear infinite; }
.cx-bar-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.cx-bar-row-new { grid-template-columns: minmax(0, 1fr); }
.cx-bar-row-new .cx-count2 { display: none; }
.cx-bar-row-new .cx-go { width: 100%; min-height: 48px; font-size: 16px; }
.cx-count2 { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 11px; border: 0; border-radius: 11px; background: var(--cx-fill); color: var(--cx-muted);
  font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.cx-count2:disabled { cursor: default; }
.cx-count2.cx-has { background: #fbf0e3; color: #a65a0d; }
.cx-chev2 { width: 7px; height: 7px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(-45deg); margin-top: 3px; }
.cx-count2[aria-expanded="true"] .cx-chev2 { transform: rotate(135deg); margin-top: -4px; }
.cx-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 11px; background: var(--accent);
  color: #fff; font: inherit; font-size: 14.5px; font-weight: 650; white-space: nowrap; cursor: pointer; }
@media (hover: hover) { .cx-go:hover:not(:disabled) { filter: brightness(1.1); } }
.cx-go:disabled { background: #dfe4e7; color: #8d969c; cursor: default; }
.cx-price { padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 12.5px; }
.cx-go:disabled .cx-price { background: none; }
.cx-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .8s linear infinite; }
.cx-go.cx-add2 { min-height: 34px; background: #fff; color: var(--accent); font-size: 13px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, #fff); }
.cx-go.cx-add2:disabled { color: #9aa3aa; box-shadow: inset 0 0 0 1.5px #c9d1d6; background: #fff; }
.cx-bar-note { margin: -2px 0 0; font-size: 11.5px; color: var(--cx-muted); text-align: center; }
.cx-bar-links { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin: -4px -6px -4px; }
.cx-bar-links .cx-ghost { min-height: 30px; font-size: 12.5px; }
.cx-drop2 { color: var(--cx-muted); font-weight: 500; }
.cx-changes { position: absolute; left: 10px; right: 10px; bottom: calc(100% + 8px); max-height: 46vh; overflow: auto; padding: 12px; border-radius: 16px; background: #fff;
  box-shadow: 0 0 0 1px var(--cx-line), 0 18px 48px rgba(20,28,32,.2); }
.cx-changes[hidden] { display: none; }
.cx-ch-head { margin: 0 4px 4px; font-size: 15px; }
.cx-changes ul { list-style: none; margin: 0; padding: 0; }
.cx-changes li { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; border-top: 1px solid var(--cx-line); }
.cx-ch-go { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 6px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
@media (hover: hover) { .cx-ch-go:hover { background: var(--cx-fill); } }
.cx-ch-what { font-size: 13.5px; font-weight: 600; } .cx-ch-val { font-size: 13.5px; } .cx-ch-val s { color: var(--cx-muted); } .cx-ch-val b { color: #a65a0d; }
.cx-ch-undo { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--cx-muted); display: grid; place-items: center; cursor: pointer; }
@media (hover: hover) { .cx-ch-undo:hover { background: var(--cx-fill); color: var(--ink); } }
/* окно корпуса у модели и метки над корпусами (только компьютер) */
.cx-pins { position: fixed; inset: 0; z-index: 18; pointer-events: none; }
.cx-pins[hidden] { display: none; }
.cx-pin { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: baseline; gap: 6px; min-height: 34px; padding: 7px 12px; border: 0; border-radius: 999px;
  background: #fff; color: var(--ink); box-shadow: 0 0 0 1px rgba(20,28,32,.08), 0 6px 20px rgba(20,28,32,.14); font: inherit; font-size: 13.5px; white-space: nowrap; cursor: pointer; will-change: transform; }
.cx-pin[hidden] { display: none; }
.cx-pin b { font-weight: 700; } .cx-pin span { color: var(--cx-muted); font-size: 12.5px; }
.cx-pin::after { content: ''; position: absolute; left: 50%; bottom: -4px; width: 9px; height: 9px; background: inherit; transform: translateX(-50%) rotate(45deg); }
@media (hover: hover) { .cx-pin:hover:not(.cx-on) { box-shadow: 0 0 0 2px var(--accent), 0 6px 20px rgba(20,28,32,.14); } }
.cx-pin.cx-on { background: var(--accent); color: #fff; } .cx-pin.cx-on span { color: rgba(255,255,255,.82); }
/* «Чат» при открытом Конструкторе — левее листа, не поверх его полосы «Собрать» (владелец 25.10.2026) */
body[data-constructor-open="true"] .chat-launch { right: calc(max(18px, env(safe-area-inset-right)) + min(440px, calc(100vw - 36px)) + 14px); }
.cx-rough { display: flex; gap: 7px; margin: 6px 0 0; padding: 9px 11px; border-radius: 11px; background: #fbf0e3; color: #7a4a10; font-size: 12.5px; line-height: 1.35; }
.cx-rough[hidden] { display: none; }
/* P0 (бета 28.10.2026): ручное наполнение — только для чтения, явная замена; кухня / .b3d — причина вместо формы */
.cx-btn { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--fill); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cx-btn:hover { background: var(--fill-press); }
.cx-btn-danger { background: #a33a26; color: #fff; }
.cx-btn-danger:hover { background: #8d3020; }
.cx-btn:disabled { opacity: .5; cursor: default; }
.cx-btn:focus-visible, .cx-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cx-partial { margin: 0 0 10px; padding: 9px 11px; border-radius: 11px; background: #fbf0e3; color: #6a4210; font-size: 12.5px; line-height: 1.4; }
.cx-partial[hidden] { display: none; }
.cx-unavailable { display: grid; gap: 8px; justify-items: start; padding: 16px; border-radius: 14px; background: var(--fill); color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.cx-unavailable strong { color: var(--ink); font-size: 15px; }
.cx-unavailable p { margin: 0; }
.draw-tools button[aria-disabled="true"] { opacity: .5; }
.gate-notice { position: fixed; z-index: 90; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateX(-50%); width: min(420px, calc(100vw - 32px));
  padding: 14px 16px; border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: var(--shadow), 0 0 0 var(--hair) var(--sep); font-size: 13.5px; line-height: 1.45;
  animation: gate-in .2s cubic-bezier(.23,1,.32,1); }
@keyframes gate-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.gate-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gate-head strong { flex: 1; font-size: 14.5px; }
.gate-warn .gate-head .gate-i { color: #9a6418; }
.gate-info .gate-head .gate-i { color: var(--accent); }
.gate-notice p { margin: 0 0 12px; color: var(--ink-2); }
.gate-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.gate-x:hover { background: var(--fill); }
.gate-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.gate-btn { min-height: 38px; padding: 0 14px; border: 0; border-radius: 11px; background: var(--fill); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.gate-btn:hover { background: var(--fill-press); }
.gate-primary { background: var(--accent); color: #fff; }
.gate-primary:hover { background: #1b4c54; }
.gate-backdrop { position: fixed; inset: 0; z-index: 89; background: rgba(28,28,26,.32); }
.gate-notice.gate-center { z-index: 90; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; animation: gate-center-in .2s cubic-bezier(.23,1,.32,1); }
@keyframes gate-center-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)); } }
.gate-center .gate-head strong { font-size: 17px; }
.gate-center p { font-size: 14px; }
@media (max-width: 600px) { .gate-notice.gate-center { padding: 16px; } .gate-center .gate-acts { flex-direction: column-reverse; } .gate-center .gate-btn { width: 100%; } }
.gate-btn:focus-visible, .gate-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.project-pill .project-new { flex: none; gap: 5px; padding: 0 10px; color: var(--accent); font-weight: 600; }
.np-dialog { width: min(600px, calc(100vw - 32px)); padding: 20px; border: 0; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.np-dialog::backdrop { background: rgba(28,28,26,.28); }
.np-dialog header { display: flex; align-items: center; justify-content: space-between; }
.np-dialog h2 { margin: 0; font-size: 19px; font-weight: 650; }
.np-x { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 11px; background: none; color: var(--muted); cursor: pointer; }
.np-x:hover { background: var(--fill); }
.np-sub { margin: 18px 0 10px; color: var(--muted); font-size: 13.5px; }
.np-meta { display: grid; grid-template-columns: 1fr 1.15fr; gap: 10px; margin-top: 16px; }
.np-folder-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.np-folder-row > .np-select, .np-folder-row > .np-newfolder { flex: 1; min-width: 0; }
.np-addfolder, .np-createfolder { flex: none; height: 36px; border: 0; border-radius: 10px; background: var(--fill); color: var(--accent); font: inherit; cursor: pointer; }
.np-addfolder { width: 36px; display: grid; place-items: center; }
.np-createfolder { padding: 0 10px; font-size: 12px; }
.np-addfolder[hidden], .np-createfolder[hidden] { display: none; }
.np-addfolder:hover, .np-createfolder:hover { background: var(--accent-fill); }
.np-field { display: grid; gap: 6px; min-width: 0; }
.np-field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.np-field input, .np-select select { width: 100%; height: 44px; border: 0; border-radius: 12px; background: var(--fill); color: var(--ink); font: inherit; font-size: 14px; }
.np-field > input, .np-name input { padding: 0 14px; }
.np-field input::placeholder { color: #9a968e; }
.np-select, .np-newfolder { position: relative; display: flex; align-items: center; }
.np-select[hidden], .np-newfolder[hidden] { display: none; }
.np-select .gate-i, .np-newfolder > .gate-i { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.np-select select { padding: 0 34px 0 38px; appearance: none; -webkit-appearance: none; cursor: pointer;
  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' stroke='%236b6862' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; text-overflow: ellipsis; }
.np-newfolder input { padding: 0 40px 0 38px; box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--card); }
.np-back { position: absolute; right: 6px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.np-back:hover { background: var(--fill); color: var(--ink); }
.np-field input:focus-visible, .np-select select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--card); }
.np-error { margin: 12px 0 0; padding: 9px 12px; border-radius: 11px; background: #f8e5e0; color: #8d3020; font-size: 13px; }
.np-error[hidden] { display: none; }
.np-busy .np-grid { opacity: .55; pointer-events: none; transition: opacity .15s; }
.np-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.np-opt { display: grid; gap: 6px; justify-items: start; text-align: left; padding: 14px; border: 0; border-radius: 14px; background: var(--fill); color: var(--ink); font: inherit; cursor: pointer; }
.np-opt:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.np-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.np-opt b { font-size: 15px; }
.np-opt b em { font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: #f7ecd8; color: #8a5a14; vertical-align: 2px; }
.np-opt b .pro-badge { display: inline-block; margin-left: 4px; vertical-align: 2px; color: #fff; font-size: 9px; }
.np-opt span:not(.np-ic) { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.np-opt[aria-disabled="true"] { cursor: default; opacity: .6; }
.np-opt[aria-disabled="true"]:hover { box-shadow: none; }
.np-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-fill); color: var(--accent); }
@media (max-width: 600px) { .np-grid { grid-template-columns: 1fr; } .project-pill .project-new span { display: none; } }
.cx-pin-h { cursor: default; } .cx-pin-h::after { display: none; } .cx-pin-h b { color: var(--cx-muted); font-weight: 600; }
.cx-reset.cx-sure-on { color: #b3261e; }

.start-constructor { position: fixed; z-index: 15; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); min-height: 44px; padding: 0 18px; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 var(--hair) var(--sep), 0 6px 24px rgba(30,24,16,.14); }
body:not([data-start]) .start-constructor { display: none; }
/* Конструктор только на компьютере и планшете (владелец 25.10.2026): на телефоне кнопок нет, лист не открывается (constructor-ui.js) */
@media (max-width: 700px) { #open-constructor, .start-constructor, .constructor-sheet { display: none !important; } }
@media (max-width: 600px) { .draw-tools { display: none !important; } }
.material-sheet .spec-head { padding: 14px 16px 12px; }
.material-sheet .spec-title h2 { font-size: 18px; }
.material-scopes { display: flex; gap: 2px; padding: 3px; margin: 8px 0; border-radius: 12px; background: var(--fill); }
#material-scopes { flex-wrap: wrap; }
#material-scopes button { flex: 1 1 30%; }
.material-scopes button { flex: 1; min-width: 0; min-height: 44px; padding: 4px 2px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; white-space: nowrap; }
.material-scopes button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.material-scopes button:disabled { opacity: .45; }
#material-target { margin: 2px 0 10px; font-size: 12px; color: var(--muted); }
#material-target strong { color: var(--accent); font-weight: 500; }
#material-search { box-sizing: border-box; width: 100%; min-height: 44px; border: 0; border-radius: 11px; padding: 8px 12px; background: var(--fill); color: inherit; font: inherit; font-size: 16px; }
.material-brands { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.material-brands::-webkit-scrollbar { display: none; }
.material-brands .btn { flex: none; height: 44px; padding: 0 12px; border-radius: 16px; background: var(--fill); font-size: 13px; }
.material-brands .btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.material-list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 6px 10px; }
.material-item { box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 7px 6px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.material-item:active { background: var(--fill); }
@media (hover: hover) { .material-item:hover { background: var(--fill); } }
.material-item[aria-pressed="true"] { background: var(--accent-fill); }
.material-item:disabled { opacity: .5; cursor: default; }
.material-swatch { flex: none; width: 52px; height: 52px; border-radius: 9px; background-size: 260% auto; background-position: center; object-fit: cover; box-shadow: inset 0 0 0 var(--hair) rgba(0,0,0,.14); }
.material-item[data-unresolved] { opacity: 1; }
.material-item[data-unresolved] .material-swatch { background: repeating-linear-gradient(135deg, var(--fill) 0 5px, transparent 5px 10px); }
.material-item[data-unresolved] .material-text { color: var(--muted); }
.material-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.35; }
.material-text strong { font-size: 14px; font-weight: 600; }
.material-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-brand { color: var(--muted); font-size: 12px; }
.material-empty { padding: 16px 8px; color: var(--muted); font-size: 13px; }
.material-foot { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: 8px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: var(--hair) solid var(--sep); }
.material-foot .btn { flex: 1 1 100%; min-height: 44px; border-radius: 12px; background: var(--fill); font-size: 14px; color: var(--accent); }
.material-foot p { width: 100%; margin: 0; font-size: 12px; line-height: 1.45; }
#apply-project-material { background: var(--accent); color: white; }
#apply-viewer-material { background: var(--accent); color: white; }
#material-viewer-status { color: var(--muted); }
.material-foot .btn[hidden] { display: none; }
.preview-note { box-sizing: border-box; max-width: 100%; display: flex; align-items: center; gap: 4px; padding: 0 4px 0 14px; height: 44px; border-radius: 22px; background: var(--surface); pointer-events: auto;
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: 0 0 0 var(--hair) var(--sep), 0 4px 14px rgba(30,24,16,.1); font-size: 13px; color: var(--ink-2); }
.preview-note[hidden] { display: none; }
.preview-note > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-note .btn { flex: none; height: 36px; padding: 0 12px; border-radius: 18px; background: transparent; color: var(--accent); font-size: 13px; }
/* «Рисовать» (27.10.2026): the toolbar «Конструктор» gives way to it (the Constructor stays in the panel «Чат | Конструктор»);
   a small menu of things to carry onto the cabinet -- a shelf for now. Built for a tablet too: big tiles, pointer drag. */
#open-constructor { display: none !important; }
.draw-tools { position: relative; display: flex; align-items: center; }
/* Create dock (beta 28.10.2026, /design/migman-cad-final/): «Рисовать» turns the toolbar itself into [←][Полка][Перегородка][Штанга][+] */
#open-draw { display: inline-flex; align-items: center; gap: 6px; }
.pro-badge { font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: .04em; padding: 2px 4px; border-radius: 4px; background: var(--ink-2, #555); color: #fff; opacity: .75; }
#open-draw .draw-icon, #open-draw .draw-back { display: inline-grid; }
#open-draw .draw-back { display: none; }
body[data-drawing="true"] #open-draw { width: 44px; padding: 0; justify-content: center; background: transparent; box-shadow: none; color: var(--ink-2); }
body[data-drawing="true"] #open-draw :is(.draw-icon, .draw-label) { display: none; }
body[data-drawing="true"] #open-draw .draw-back { display: inline-grid; }
body[data-drawing="true"] .toolbar > .view-tools, body[data-drawing="true"] .tools > :not(.draw-tools):not(#undo-edit) { display: none !important; }
.draw-menu { display: none; align-items: center; gap: 2px; }
.draw-tools[data-open="true"] .draw-menu { display: flex; animation: draw-in .18s cubic-bezier(.23,1,.32,1); }
@keyframes draw-in { from { opacity: 0; transform: translateX(-6px); } }
@media (prefers-reduced-motion: reduce) { .draw-tools[data-open="true"] .draw-menu { animation: none; } }
.draw-tile { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 13px; border: 0; border-radius: 13px; background: transparent;
  color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: background-color .14s, color .14s, transform .12s cubic-bezier(.23,1,.32,1); }
.draw-tile svg { flex: none; color: var(--accent); }
.draw-tile:hover { background: var(--fill); color: var(--ink); }
.draw-tile:active { transform: scale(.97); }
.draw-tile[aria-pressed="true"] { background: var(--accent); color: #fff; }
.draw-tile[aria-pressed="true"] svg { color: #fff; }
.draw-tile:focus-visible, .draw-more:focus-visible, .draw-cat-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.draw-more { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 13px; background: transparent; color: var(--ink-2); cursor: pointer; }
.draw-more:hover, .draw-more[aria-expanded="true"] { background: var(--fill); color: var(--ink); }
/* «+»: the whole catalogue of the dock -- what works arms its tool, the rest is honestly «скоро» */
.draw-catalog { position: absolute; bottom: calc(100% + 12px); right: -3px; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; width: 440px; padding: 12px 14px 14px;
  border-radius: 18px; background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 0 0 var(--hair) var(--sep), 0 12px 32px rgba(30,24,16,.18); animation: pop .16s ease-out; transform-origin: bottom right; }
.draw-catalog[hidden] { display: none; }
.draw-cat-group { display: flex; flex-direction: column; gap: 2px; }
.draw-cat-group p { margin: 6px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.draw-cat-item { position: relative; display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 0 10px; border: 0; border-radius: 11px; background: transparent;
  color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.draw-cat-item svg { flex: none; color: var(--accent); }
.draw-cat-item:hover { background: var(--accent-fill); }
.draw-cat-item[aria-disabled="true"] { color: var(--muted); cursor: default; }
.draw-cat-item[aria-disabled="true"] svg { color: var(--muted); opacity: .7; }
.draw-cat-item[aria-disabled="true"]:hover { background: transparent; }
.draw-cat-item em { margin-left: auto; font-style: normal; font-size: 11px; color: #9a6a1c; }
body[data-drawing="true"][data-draw-tool] #stage canvas { cursor: crosshair !important; }
@media (pointer: coarse) { .draw-tile, .draw-more { height: 48px; } .draw-more { width: 48px; } .draw-cat-item { min-height: 44px; } }
@media (pointer: coarse) and (min-width: 601px) and (min-height: 501px) {
  body .part-dock, body[data-chat-ready="true"] .part-dock, body[data-chat-open="true"] .part-dock { bottom: 108px; }
  body.dock-final .toolbar { padding: 8px; gap: 6px; border-radius: 24px; }
  body.dock-final .toolbar .btn, body.dock-final .draw-tile, body.dock-final .draw-more { height: 54px; font-size: 16px; border-radius: 15px; }
  body.dock-final :is(.dock-icon, #measure, #view-menu), body.dock-final .draw-more, body.dock-final[data-drawing="true"] #open-draw { width: 56px; min-width: 56px; }
  body.dock-final .toolbar svg, body.dock-final :is(#measure, #view-menu)::before { width: 24px; height: 24px; }
  body.dock-final #dimensions { width: 30px; min-width: 30px; }
  .view-hud-pill, .view-hud .view-hud-round, .view-hud .view-hud-est { height: 52px; }
  .view-hud .view-hud-round { width: 52px; border-radius: 26px; }
  .view-hud .btn { height: 44px; font-size: 15px; }
}
@media (max-width: 1100px) { .draw-catalog { width: min(440px, calc(100vw - 32px)); } }
.draw-carry { position: fixed; z-index: 60; left: 0; top: 0; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; pointer-events: none;
  background: var(--card); color: var(--accent); box-shadow: 0 0 0 var(--hair) var(--sep), 0 8px 24px rgba(30,24,16,.22); transform: translate(-50%, -50%) scale(1); transition: opacity .12s, transform .12s; }
.draw-carry[data-over="true"] { opacity: .35; transform: translate(-50%, -50%) scale(.8); }
body[data-drawing="true"] #stage canvas { cursor: default !important; }
/* «Перегородка» (27.10.2026): a floor / ceiling shelf on supports -- said plainly with the one button that fixes it */
.part-end { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: #fbf1ec; }
.part-end .cut-status, .part-end .cut-hint { margin: 0; }
.part-end-btn { justify-self: start; }
.part-joint-label { color: var(--accent); font-weight: 600; }
.part-delete-all { width: 100%; background: #b3261e; color: #fff; }
#stage canvas.partition-grab { cursor: ew-resize; }
/* «Полка»: how many at once and the fastening */
.shelf-count { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shelf-label { font-size: 12px; color: var(--muted); }
.shelf-stepper { display: flex; align-items: center; border-radius: 12px; background: var(--fill); }
.shelf-stepper .btn { width: 44px; min-height: 40px; padding: 0; background: transparent; font-size: 20px; color: var(--accent); }
.shelf-stepper .btn:disabled { opacity: .35; }
.shelf-stepper output { min-width: 32px; text-align: center; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.shelf-joints .btn { min-height: 38px; padding: 0 12px; }
/* «Вырез»: the material sheet's frame; templates, two offsets from the part's edges, sizes, the engine's answer. */
.cut-part { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.cutout-sheet { overflow-y: auto; overscroll-behavior: contain; }
.cut-body { flex: none; padding: 4px 16px 8px; display: flex; flex-direction: column; gap: 10px; }
.cutout-sheet .material-foot { position: sticky; bottom: 0; background: var(--card); }
.cut-templates { display: flex; flex-wrap: wrap; gap: 6px; }
.cut-templates .btn { min-height: 44px; padding: 0 14px; border-radius: 16px; background: var(--fill); font-size: 13px; }
.cut-templates .btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.cut-shape { margin: 0; }
.cut-center { align-self: flex-start; margin: 8px 0 2px; }
.cut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cut-offset { display: flex; flex-direction: column; gap: 4px; }
.cut-offset select { min-height: 36px; border: 0; border-radius: 9px; padding: 0 8px; background: var(--fill); color: inherit; font: inherit; font-size: 14px; }
.cut-gaps { grid-template-columns: 1fr auto 1fr; gap: 6px; }
.cut-ratio { align-self: end; display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 7px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.cut-ratio:hover { background: var(--fill); }
.cut-ratio[aria-pressed="true"] { background: var(--accent); color: #fff; }
.cut-ratio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cut-ratio[hidden] { display: none; }
.cut-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.rod-shelf-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; color: var(--ink); font-size: 15px; font-weight: 600; }
.cut-field.drawer-move-field input { min-height: 60px; font-size: 32px; font-weight: 650; letter-spacing: -.02em; color: var(--accent); background: var(--accent-fill); font-variant-numeric: tabular-nums; }
.drawer-hardware { display:flex; flex-direction:column; gap:10px; margin-top:18px; padding-top:16px; border-top:1px solid var(--sep); }
.drawer-hardware .cut-hint { margin:0; }
.drawer-hardware-select { box-sizing:border-box; width:100%; min-height:48px; border:1px solid var(--sep); border-radius:12px; padding:8px 12px; color:var(--ink); background:var(--fill); font:inherit; font-size:15px; }
.drawer-hardware-select:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.drawer-metal-color[hidden] { display:none; }
.cut-field input { box-sizing: border-box; width: 100%; min-height: 44px; border: 0; border-radius: 11px; padding: 6px 10px; background: var(--fill); color: var(--ink); font: inherit; font-size: 16px; }
.cut-hint { margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.cut-group { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.cut-group input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.part-legacy { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: var(--hair) solid var(--sep); }
.part-legacy[hidden] { display: none; }
.part-legacy p { flex: 1; margin: 0; font-size: 12px; line-height: 1.4; color: var(--muted); }
.part-legacy .btn { flex: none; }
.cut-range { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink); font-variant-numeric: tabular-nums; }
.cut-existing { display: flex; flex-direction: column; gap: 4px; }
.cut-head { color: var(--muted); font-size: 11px; }
.cut-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.cut-row .btn { min-height: 36px; padding: 0 12px; border-radius: 12px; background: var(--fill); color: #9a3b1f; font-size: 13px; }
.cut-drawing { display: block; width: calc(100% - 32px); max-height: 380px; margin: 0 16px 8px; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 var(--hair) var(--sep); }
.cut-drawing[hidden] { display: none; }
.cut-status { min-height: 18px; color: var(--muted); overflow-wrap: anywhere; }
.cut-status.cut-ok { color: #2e7d32; }
.cut-status.place-refused { color: #b45f06; font-size: 15px; font-weight: 600; line-height: 1.4; }   /* «Рисовать»: сервер отказал этому отсеку */
.cut-status.cut-bad { color: #9a3b1f; }
#apply-cutout, #apply-groove, #apply-radius, #apply-shelf, #apply-partition, #apply-rod, #apply-struct, #apply-back, #apply-drawer, #apply-front-block { background: var(--accent); color: #fff; }
#undo-edit[data-busy="true"] svg { opacity: .4; }
@media (max-width: 600px) { #undo-edit { display: none; } }
.undo-confirm { position: fixed; z-index: 100; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(400px, calc(100vw - 32px)); box-sizing: border-box; padding: 24px; border-radius: 20px; background: var(--card); color: var(--ink);
  box-shadow: 0 0 0 100vmax rgba(20, 30, 30, .32), 0 16px 48px rgba(20, 30, 30, .2); }
.undo-confirm[hidden] { display: none; }
.undo-title { margin: 0 0 10px; font-size: 20px; line-height: 1.25; font-weight: 650; }
.undo-note { margin: 0 0 24px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.undo-row { display: flex; gap: 10px; justify-content: flex-end; }
.undo-row .btn { min-height: 44px; padding: 0 18px; font-size: 14px; font-weight: 600; }
.undo-row .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.undo-yes { background: var(--accent); color: #fff; }
.material-part { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; }
.material-part[hidden] { display: none; }
.material-part-head, .material-part-status { margin: 0; font-size: 13px; color: var(--muted); }
.material-part .material-part-option[aria-pressed="true"] { background: var(--accent); color: #fff; }
.material-part .material-part-apply { background: var(--accent); color: #fff; }
#apply-cutout:disabled, #apply-groove:disabled, #apply-radius:disabled, #apply-shelf:disabled, #apply-partition:disabled, #apply-rod:disabled, #apply-struct:disabled, #apply-back:disabled, #apply-drawer:disabled, #apply-front-block:disabled { opacity: .5; }
@media (max-width: 600px) {
  .cutout-sheet { max-height: 56dvh; }
  body[data-cutout-open="true"] #stage, body[data-groove-open="true"] #stage, body[data-radius-open="true"] #stage { bottom: 56dvh; }
  body[data-cutout-open="true"] .chat-launch, body[data-groove-open="true"] .chat-launch, body[data-radius-open="true"] .chat-launch { display: none; }
  body[data-cutout-open="true"] .part-dock, body[data-groove-open="true"] .part-dock, body[data-radius-open="true"] .part-dock { display: none; }
  body[data-shelf-open="true"] #stage { bottom: 56dvh; }
  body[data-shelf-open="true"] .chat-launch, body[data-shelf-open="true"] .part-dock { display: none; }
  body[data-drawer-open="true"] #stage { bottom: 56dvh; }
  body[data-drawer-open="true"] .chat-launch, body[data-drawer-open="true"] .part-dock { display: none; }
  .cut-drawing { max-height: 300px; }
}
@media (max-width: 600px) {
  .material-sheet { inset: auto 0 0 0; width: 100%; max-height: 48dvh; border-radius: 20px 20px 0 0; }
  .material-sheet .spec-head::before { content: ''; display: block; width: 34px; height: 5px; border-radius: 4px; background: var(--sep); margin: -4px auto 8px; }
  body[data-material-open="true"] #stage { bottom: 48dvh; }
  body[data-material-open="true"] .part-dock { display: none; }
  /* Phones keep the compact sheet: the bigger desktop sizes stop here. */
  .material-sheet .spec-head { padding: 12px 14px 10px; }
  .material-sheet .spec-title h2 { font-size: 17px; }
  .material-scopes button { font-size: 12px; }
  .material-list { padding: 4px 8px; }
  .material-item { min-height: 56px; padding: 6px; }
  .material-swatch { width: 44px; height: 44px; }
  .material-text { line-height: 1.3; }
}
#part-validation[data-state="ok"] { background:transparent; color:#28834a; font-size:13px; font-weight:400; padding:0 8px; border-radius:6px; }
#part-validation[data-state="ok"]:hover, #part-validation[data-state="ok"]:active { background:transparent; }
#project-validation { height:auto; max-height: min(70dvh, 640px); }
.validation-error { padding-left:10px; border-left: 3px solid #c65b59; } .validation-warning { padding-left:10px; border-left: 3px solid #bf8b35; } #validation-summary { color:var(--muted); font-size:13px; }
/* Personal project navigation stays separate from the model toolbar. */
.project-pill { position:absolute; top:calc(env(safe-area-inset-top) + 12px); left:12px; display:flex; align-items:center; max-width:min(300px, calc(50vw - 164px)); height:44px; padding:0 5px; border-radius:16px; background:var(--surface); backdrop-filter:blur(20px); box-shadow:0 0 0 var(--hair) var(--sep),0 3px 12px rgba(30,24,16,.07); color:var(--ink); }
.project-pill button { display:flex; align-items:center; gap:8px; min-width:0; height:44px; border:0; background:transparent; color:inherit; font:inherit; font-size:13px; cursor:pointer; padding:0 10px; border-radius:12px; white-space:nowrap; }
.project-name { flex:1 1 auto; overflow:hidden; }
.project-name svg { flex:none; color:var(--muted); }
.project-name span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-pill .project-version { flex:none; min-width:54px; padding:0 9px; font-variant-numeric:tabular-nums; }
.project-dot { color:var(--muted); }
.project-pill .project-share { flex:none; width:44px; padding:0; justify-content:center; color:var(--muted); }
.project-pill .project-expand { display: none; }
.project-pill button:hover { background:var(--fill); }
@media (min-width: 601px) and (min-height: 501px) {
  body.dock-final .project-pill .project-expand { display: flex; justify-content: center; width: 32px; padding: 0; color: var(--muted); flex: none; }
  body.dock-final .project-pill .project-expand svg { transition: transform .2s ease; }
  body.dock-final .project-pill.project-expanded .project-expand svg { transform: rotate(180deg); }
  body.dock-final .project-pill:not(.project-expanded) :is(.project-name, .project-dot, .project-version, .project-share) { display: none; }
  body.dock-final .project-pill .project-new { background: var(--accent-fill); color: var(--accent); box-shadow: none; }
  body.dock-final .project-pill .project-new:hover { background: rgba(35,93,103,.18); }
}
.project-pill button:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
/* Account (09.10.2026): initial + name top right; on a phone only the initial, in the project pill's row. */
.account-pill { position:absolute; top:calc(env(safe-area-inset-top) + 12px); right:12px; display:flex; align-items:center; gap:8px; max-width:200px; height:44px; padding:0 12px 0 6px; border:0; border-radius:22px; background:var(--surface); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); box-shadow:0 0 0 var(--hair) var(--sep),0 3px 12px rgba(30,24,16,.07); color:var(--ink); font:inherit; font-size:13px; cursor:pointer; }
.account-pill:hover { background:#fff; }
.guest-save { position:absolute; top:calc(env(safe-area-inset-top) + 12px); right:64px; z-index:24; display:flex; align-items:center; gap:8px; height:44px; padding:0 16px 0 14px; border-radius:22px; background:var(--surface); color:var(--accent); font:inherit; font-size:13px; font-weight:600; white-space:nowrap; text-decoration:none; cursor:pointer; backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); box-shadow:0 0 0 var(--hair) var(--accent),0 3px 12px rgba(30,24,16,.07); }
.guest-save:hover { background:var(--accent-fill); }
.guest-save:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.guest-save[hidden] { display:none; }
body[data-debug="true"] .guest-save { top:calc(env(safe-area-inset-top) + 66px); }
@media (max-width:1024px) { .guest-save { width:44px; padding:0; justify-content:center; } .guest-save span { display:none; } }   /* только значок, подсказка — title */
@media (max-width:600px) { .guest-save { display:none; } }   /* телефон — своя плашка (mobile-actions.js) */
body.m-phone .guest-save { display:none; }

.account-pill:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.account-avatar { flex:none; width:32px; height:32px; border-radius:50%; display:grid; place-items:center; background:var(--accent); color:#fff; font-weight:600; font-size:14px; }
.account-avatar.big { width:44px; height:44px; font-size:18px; }
.account-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-dot { position:absolute; top:7px; left:31px; width:9px; height:9px; border-radius:50%; background:#d9822b; box-shadow:0 0 0 2px var(--card); }
.account-sheet { position:fixed; margin:0; inset:66px 12px auto auto; width:300px; max-width:calc(100vw - 24px); padding:0 0 8px; border:0; border-radius:18px; background:var(--card); color:var(--ink); box-shadow:var(--shadow); z-index:40; }
.account-sheet header { display:flex; align-items:center; gap:12px; padding:14px 8px 10px 16px; }
.account-sheet header div { flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.account-sheet header strong { font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-sheet header small { color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.account-sheet .account-close { background:transparent; font-size:14px; }
.account-balance { display:flex; justify-content:space-between; align-items:center; gap:12px; min-height:68px; margin:0 12px; padding:10px 12px; border-radius:12px; background:var(--fill); }
.account-balance > div { display:flex; flex-direction:column; gap:4px; }
.account-topup { position:relative; isolation:isolate; flex:none; height:44px; padding:0 10px; border:0; background:transparent; color:#fff; font:inherit; font-size:12px; font-weight:600; cursor:pointer; }
.account-topup::before { content:""; position:absolute; inset:6px 0; z-index:-1; border-radius:8px; background:#b35a0f; }
.account-topup:hover::before { background:#9a4e0c; }
.account-topup:active::before { background:#85430a; }
.account-notice { margin:8px 16px; color:var(--muted); font-size:12px; line-height:1.4; }
.avatar-upload { border:0; padding:0; cursor:pointer; overflow:hidden; }
.avatar-upload:hover { box-shadow:0 0 0 3px var(--accent-fill); }
.account-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }
.account-balance span { color:var(--muted); }
.account-balance b { font-size:16px; font-variant-numeric:tabular-nums; }
.account-verify { margin:10px 12px 0; padding:10px 14px; border-radius:12px; background:#f6e7d2; color:#8a5a22; font-size:13px; }
.account-verify p { margin:0 0 4px; }
.account-verify button { min-height:32px; padding:0; border:0; background:none; color:inherit; font:inherit; font-weight:600; text-decoration:underline; cursor:pointer; }
.account-verify small { display:block; }
.account-sheet nav { display:flex; flex-direction:column; padding:8px 8px 0; }
.account-row { display:flex; align-items:center; min-height:44px; padding:0 12px; border:0; border-radius:10px; background:transparent; color:var(--ink); font:inherit; font-size:14px; text-align:left; text-decoration:none; cursor:pointer; }
.account-row:hover { background:var(--fill); }
.account-row:active { background:var(--fill-press); }
.account-row .profile-icon { flex:none; margin-right:10px; }
.account-row .profile-label { min-width:0; }
.account-logout { color:#a33a2a; }
.account-links { display:flex; align-items:center; gap:4px; padding:0 4px; color:var(--muted); font-size:12px; white-space:nowrap; }
.account-links a { display:inline-flex; align-items:center; min-height:44px; padding:0 8px; color:inherit; text-decoration:none; border-radius:8px; }
.account-links a:hover { color:var(--ink); background:var(--fill); }
.account-links a:active { color:var(--ink); background:var(--fill-press); }
.send-sheet { width:320px; padding:0 0 10px; }
.send-sheet .send-head { margin:0; padding:12px 8px 0 16px; justify-content:space-between; }
.send-sheet .send-pane { padding-top:6px; min-width:0; }
.send-sheet .pane-status { overflow-wrap:anywhere; white-space:pre-line; min-width:0; }
.account-pane { display:flex; flex-direction:column; gap:10px; padding:4px 14px 6px; }
.pane-head { display:flex; align-items:center; gap:6px; margin-left:-8px; }
.pane-head .pane-back { background:transparent; font-size:18px; }
.pane-head strong { font-size:15px; }
.pane-hint, .pane-status, .pane-card { margin:0; font-size:13px; line-height:1.4; }
.pane-hint { color:var(--muted); }
.pane-status:empty, .pane-card:empty { display:none; }
.pane-card { white-space:pre-wrap; max-height:40vh; overflow:auto; padding:10px 12px; border-radius:12px; background:var(--fill); }
.pane-actions { display:flex; flex-direction:column; gap:8px; }
.pane-actions:empty { display:none; }
.pane-actions .btn { justify-content:flex-start; text-align:left; }
.account-pane .pane-primary { background:var(--accent); color:#fff; }
.account-pane .pane-primary:disabled { opacity:.55; }
.pane-form { display:flex; flex-direction:column; gap:8px; }
.pane-form input[type=email], .pane-form input[type=password] { height:44px; padding:0 12px; border:0; border-radius:12px; background:var(--fill); color:var(--ink); font:inherit; font-size:15px; }
.pane-consent { display:flex; gap:8px; align-items:flex-start; font-size:13px; line-height:1.4; color:var(--muted); }
.pane-consent input { width:18px; height:18px; margin:1px 0 0; accent-color:var(--accent); }
.pane-consent a { color:var(--accent); }
.pane-text { width:100%; box-sizing:border-box; padding:10px 12px; border:0; border-radius:12px; background:var(--fill); color:var(--ink); font:inherit; font-size:14px; resize:vertical; }
.chat-msg .chat-cancel { align-self:flex-start; background:var(--card); color:#a33a2a; height:36px; margin-top:6px; padding:0 12px; font-size:13px; }
body[data-debug="true"] .account-pill { top:calc(env(safe-area-inset-top) + 66px); }
@media (max-width:900px) { .account-pill { padding:0 6px; width:44px; } .account-pill .account-name { display:none; } .account-dot { left:30px; } }
@media (max-width:600px) {
  .account-pill { top:calc(env(safe-area-inset-top) + 72px); padding:0 6px; width:44px; }
  .account-pill .account-name { display:none; }
  .account-dot { left:30px; }
  .account-sheet { inset:auto 0 0 0; width:100%; max-width:none; border-radius:18px 18px 0 0; padding-bottom:max(12px, env(safe-area-inset-bottom)); }
  body:has(.account-pill:not([hidden])) .project-pill { max-width:min(300px, calc(100vw - 80px)); }
  body[data-debug="true"] .account-pill { top:calc(env(safe-area-inset-top) + 126px); }
}
.project-dialog { position:fixed; margin:0; inset:66px auto auto 12px; width:300px; max-width:calc(100vw - 24px); max-height:calc(100dvh - 90px); padding:0; border:0; border-radius:20px; background:var(--card); color:var(--ink); box-shadow:0 0 0 var(--hair) var(--sep), 0 2px 6px rgba(30,24,16,.06), 0 18px 48px rgba(30,24,16,.16); }
.project-dialog[open] { display:flex; flex-direction:column; overflow:hidden; animation:project-pop .16s cubic-bezier(.2,.8,.3,1); }
.project-dialog > * { flex:none; }
@keyframes project-pop { from { opacity:0; transform:translateY(-4px) scale(.985); } }
@keyframes project-fade { from { opacity:0; } }
.project-dialog[data-tab="projects"] { width:392px; }
.project-dialog::backdrop { background:rgba(30,24,16,.10); }
.project-dialog header { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:12px 10px 4px 20px; }
.project-heading { flex:1; min-width:0; display:flex; flex-direction:column; gap:3px; }
.project-dialog header strong { font-size:17px; font-weight:650; letter-spacing:-.015em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-heading small { color:var(--ink-2); font-size:12.5px; line-height:1.45; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.project-dialog header .btn { width:36px; height:36px; min-width:36px; padding:0; background:transparent; font-size:15px; color:var(--ink-2); }
.project-dialog nav { display:none; gap:4px; padding:8px 12px; }
.project-dialog nav .btn { flex:1; font-size:14px; background:transparent; }
.project-dialog nav .btn[aria-pressed="true"] { background:var(--fill); color:var(--ink); }
.project-search { padding:8px 14px 6px; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.project-search[hidden] { display:none; }
.project-search input[type="search"] { flex:1 0 100%; min-width:0; height:40px; border:0; background:var(--fill); border-radius:12px; padding:0 14px; font:inherit; font-size:14px; color:var(--ink); outline:none; box-shadow:0 0 0 0 transparent; transition:box-shadow .15s, background-color .15s; }
.project-search input[type="search"]::placeholder { color:var(--muted); }
.project-search input[type="search"]:focus { background:var(--card); box-shadow:0 0 0 1.5px var(--accent); }
.project-new-folder, .project-new-in-folder, .project-upload { flex:none; height:32px; padding:0 10px; margin-left:-4px; margin-right:4px; border:0; border-radius:9px; background:transparent; color:var(--accent); font:inherit; font-size:13px; font-weight:550; cursor:pointer; transition:background-color .15s; }
.project-new-folder:hover, .project-new-in-folder:hover, .project-upload:hover { background:var(--accent-fill); }
.project-new-folder:focus-visible, .project-new-in-folder:focus-visible, .project-upload:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.project-new-folder[hidden], .project-new-in-folder[hidden], .project-upload[hidden] { display:none; }
.project-upload:disabled { opacity:.55; cursor:default; }
.project-upload-status { padding:0 20px 8px; color:var(--ink-2); font-size:12.5px; }
/* Ход загрузки своего .b3d (upload-progress.js, 22.10.2026): поверх экрана, видна и с закрытым окном проектов. */
.upload-progress { position:fixed; z-index:60; top:calc(env(safe-area-inset-top) + 12px); left:50%; transform:translateX(-50%); width:min(440px, calc(100vw - 32px)); box-sizing:border-box; padding:12px 14px 12px 16px; border-radius:16px; background:var(--card); box-shadow:0 0 0 var(--hair) var(--sep), var(--shadow); color:var(--ink); font-size:13px; }
.upload-progress-head { display:flex; align-items:center; gap:8px; min-width:0; }
.upload-progress-head strong { font-size:14px; white-space:nowrap; }
.upload-progress-name { flex:1; min-width:0; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upload-progress-x { flex:none; width:32px; height:32px; border:0; border-radius:10px; background:var(--fill); color:var(--ink-2); font-size:14px; cursor:pointer; }
.upload-progress-x:hover { background:var(--fill-press); }
.upload-progress-steps { display:flex; gap:6px; margin:10px 0 8px; padding:0; list-style:none; counter-reset:step; }
.upload-progress-steps li { flex:1; min-width:0; color:var(--muted); font-size:11.5px; line-height:1.25; counter-increment:step; }
.upload-progress-steps li::before { content:counter(step); display:inline-grid; place-items:center; width:17px; height:17px; margin-right:5px; border-radius:50%; background:var(--fill); font-size:10.5px; font-weight:600; }
.upload-progress-steps li[data-state="now"] { color:var(--ink); font-weight:600; }
.upload-progress-steps li[data-state="now"]::before { background:var(--accent); color:#fff; }
.upload-progress-steps li[data-state="done"]::before { content:"✓"; background:var(--accent-fill); color:var(--accent); }
.upload-progress-bar { position:relative; height:6px; border-radius:3px; background:var(--fill); overflow:hidden; }
.upload-progress-bar i { position:absolute; inset:0 auto 0 0; width:0; border-radius:3px; background:var(--accent); transition:width .25s ease; }
.upload-progress-bar[data-mode="busy"] i { width:35%; animation:upload-busy 1.2s ease-in-out infinite; }
@keyframes upload-busy { from { left:-35%; } to { left:100%; } }
.upload-progress-detail { margin-top:7px; color:var(--ink-2); font-size:12.5px; line-height:1.35; font-variant-numeric:tabular-nums; }
.upload-progress[data-state="error"] .upload-progress-detail { color:#a3352b; }
.upload-progress[data-state="error"] .upload-progress-bar i { background:#c4574b; }
@media (prefers-reduced-motion: reduce) { .upload-progress-bar[data-mode="busy"] i { animation:none; width:100%; opacity:.4; } }
/* The list takes what is left of the dialog and scrolls inside it: the end is never cut by the dialog's edge. */
.project-dialog > .project-list { flex:1 1 auto; min-height:0; overflow-y:auto; padding:2px 8px 12px; overscroll-behavior:contain; }
.project-list h3 { font-size:12px; color:var(--ink-2); margin:14px 12px 4px; font-weight:600; }
.project-list h3:first-child { margin-top:6px; }
/* The row never changes its box on hover: «⋯» fades in over a padding that is always reserved (no jumping text). */
.project-row { width:100%; position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:3px; min-height:56px; padding:9px 44px 9px 12px; border:0; background:transparent; color:var(--ink); border-radius:12px; text-align:left; cursor:pointer; font:inherit; transition:background-color .12s; }
.project-row b { font-size:14px; font-weight:550; letter-spacing:-.01em; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.project-row small { color:var(--ink-2); font-size:12px; line-height:1.4; max-width:100%; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.project-dialog[data-tab="projects"] .project-row small { display:flex; align-items:baseline; gap:8px; width:100%; white-space:nowrap; }
.project-item-detail { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.project-item-meta { flex:none; margin-left:auto; color:var(--muted); font-variant-numeric:tabular-nums; }
.project-row:hover { background:var(--fill); }
.project-row:active { background:var(--fill-press); }
.project-row:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.project-row:disabled { cursor:default; opacity:.55; }
/* Open project: accent tint, accent title, a check where «⋯» lives. */
.project-row[aria-current="page"] { background:var(--accent-fill); }
.project-row[aria-current="page"] b { color:var(--accent); }
.project-row[aria-current="page"]:hover { background:rgba(35,93,103,.16); }
.project-dialog[data-tab="projects"] .project-row[aria-current="page"]::after { content:""; position:absolute; right:14px; top:50%; width:16px; height:16px; margin-top:-8px; background:var(--accent); -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; transition:opacity .12s; }
.project-item { position:relative; }
.project-item + .project-item { margin-top:2px; }
.project-item[hidden], .project-item > [hidden] { display:none; }
.project-more-actions { position:absolute; right:4px; top:50%; width:36px; height:36px; margin-top:-18px; display:grid; place-items:center; border:0; border-radius:10px; background:transparent; color:var(--ink-2); cursor:pointer; opacity:0; transition:opacity .12s, background-color .12s; }
.project-item:hover .project-more-actions, .project-more-actions:focus-visible { opacity:1; }
.project-item:hover .project-row[aria-current="page"]::after { opacity:0; }
.project-more-actions:hover { color:var(--ink); background:var(--fill-press); }
.project-more-actions:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
.project-dialog[data-tab="projects"] .project-row.project-folder-row { flex-direction:row; align-items:center; gap:10px; min-height:48px; padding:0 44px 0 12px; }
.project-folder-row svg { flex:none; color:var(--accent); }
.project-folder-row b { flex:1; min-width:0; }
.project-dialog[data-tab="projects"] .project-folder-row small { display:block; width:auto; flex:none; color:var(--muted); font-variant-numeric:tabular-nums; }
.project-folder-row i { font-style:normal; color:var(--muted); font-size:18px; line-height:1; transition:opacity .12s; }
.project-folder-item:hover .project-folder-row i { opacity:0; }
.project-back { flex:none; width:36px; height:36px; padding:0; margin-left:-10px; background:transparent !important; font-size:22px; line-height:1; color:var(--ink); }
.project-back[hidden] { display:none; }
.project-rename-form { flex:1; display:flex; align-items:center; gap:6px; min-width:0; }
.project-rename-form input, .project-confirm select, .project-confirm > input { flex:1; min-width:0; height:36px; border:0; border-radius:9px; padding:0 10px; background:var(--card); color:var(--ink); font:inherit; font-size:14px; outline:none; box-shadow:0 0 0 1px var(--sep); }
.project-rename-form input:focus, .project-confirm select:focus, .project-confirm > input:focus { box-shadow:0 0 0 1.5px var(--accent); }
.project-confirm > input[hidden] { display:none; }
/* The inline bar takes exactly the row's place (height set from the row in JS), fades in, never jumps. */
.project-confirm { display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-height:56px; padding:8px 8px 8px 10px; border-radius:12px; background:var(--fill); font-size:13px; outline:none; animation:project-fade .12s ease-out; }
.project-confirm span { flex:1; min-width:0; font-size:13px; line-height:1.35; color:var(--ink); overflow-wrap:anywhere; }
.project-confirm .btn { flex:none; height:34px; padding:0 12px; border-radius:9px; font-size:13px; background:var(--card); box-shadow:0 0 0 var(--hair) var(--sep), 0 1px 2px rgba(30,24,16,.06); }
.project-confirm .btn:hover { background:var(--card); box-shadow:0 0 0 1px var(--sep), 0 1px 3px rgba(30,24,16,.1); }
.project-confirm .btn:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.project-confirm .project-close { margin-left:auto; width:34px; min-width:34px; padding:0; background:transparent; box-shadow:none; color:var(--ink-2); }
.project-confirm .project-close:hover { background:var(--fill-press); box-shadow:none; }
.project-confirm.project-actions { flex-wrap:nowrap; }
.project-confirm-yes { color:#b3261e; }
.project-confirm .project-confirm-yes:hover { background:#fdecea; }
@media (pointer:coarse) {
  .project-more-actions { opacity:1; width:44px; height:44px; margin-top:-22px; right:0; color:var(--muted); }
  .project-dialog[data-tab="projects"] .project-row[aria-current="page"]::after { content:none; }
  .project-folder-row i { display:none; }
  .project-rename-form input, .project-confirm select, .project-confirm > input { height:44px; font-size:16px; }
  .project-new-folder, .project-new-in-folder, .project-upload { height:40px; }
  .project-back { width:44px; height:44px; }
  .project-dialog header .btn { width:44px; height:44px; }
  .project-confirm .btn { height:44px; }
  .project-confirm .project-close { width:44px; }
}
.project-more { width:100%; margin-top:8px; }
.project-notice { position:absolute; top:78px; left:12px; right:12px; padding:14px; background:var(--card); border-radius:14px; box-shadow:var(--shadow); }
.project-notice.toast { right:auto; padding:8px 14px; font-size:14px; border-radius:999px; animation:toast-out 1.8s ease forwards; pointer-events:none; }
@keyframes toast-out { 0%,75% { opacity:1; } 100% { opacity:0; } }
body[data-debug="true"] .project-pill { top:calc(env(safe-area-inset-top) + 66px); }
@media(max-width:600px) {
 /* Phone: a compact folder chip — icon · vN · share; the project name lives in the sheet header. */
 .project-pill, body:has(.account-pill:not([hidden])) .project-pill { top:calc(env(safe-area-inset-top) + 72px); max-width:calc(100vw - 80px); padding:0 2px; border-radius:16px; }
 .project-pill .project-name { flex:none; width:44px; padding:0; justify-content:center; }
 .project-pill .project-name span, .project-pill .project-dot { display:none; }
 .project-pill .project-name svg { display:block; color:var(--ink); }
 .project-pill .project-version { min-width:0; padding:0 8px; }
 .project-dialog,.project-dialog[data-tab="projects"] { inset:auto 0 0; width:100%; max-width:100%; max-height:75dvh; border-radius:22px 22px 0 0; padding-bottom:env(safe-area-inset-bottom); }
 .project-dialog nav { display:flex; }
 .project-dialog header { padding:12px 10px 2px 20px; }
 .project-search input[type="search"] { flex-basis:100%; font-size:16px; }
 .project-dialog > .project-list { min-height:130px; padding:4px 12px 18px; }
 .project-row { min-height:60px; padding-top:10px; padding-bottom:10px; }
 .project-row b { font-size:15px; } .project-row small { font-size:12.5px; }
 body[data-debug="true"] .project-pill { top:calc(env(safe-area-inset-top) + 126px); }
}

/* Полная смета (20.10.2026): рабочий инструмент — разделы скрипта Кирилла, правка количеств и цен в строке,
   итог внизу, карта раскроя второй вкладкой. На компьютере — окно по центру, на телефоне — лист на весь экран. */
.estimate-dialog { box-sizing:border-box; border:0; border-radius:22px; padding:0; width:min(880px, calc(100vw - 48px)); max-width:none; height:min(860px, calc(100dvh - 48px)); max-height:none;
  color:var(--ink); background:var(--card); box-shadow:0 0 0 var(--hair) var(--sep), 0 16px 56px rgba(30,24,16,.22); overflow:hidden; }
.estimate-dialog[open] { display:flex; flex-direction:column; animation:rise .18s ease-out; }
.estimate-dialog::backdrop { background:rgba(30,24,16,.22); }
.estimate-header { flex:none; display:flex; align-items:center; gap:12px; padding:14px 16px 12px 22px; border-bottom:var(--hair) solid var(--sep); }
.estimate-header h2 { margin:0; font-size:19px; font-weight:600; letter-spacing:-.01em; white-space:nowrap; }
.estimate-header .material-scopes { margin:0 auto 0 8px; width:220px; }
.estimate-header .btn { min-width:44px; min-height:44px; padding:0 14px; }
.estimate-body { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:4px 22px 18px; font-size:14px; line-height:1.4; transition:opacity .15s; }
.estimate-body.es-busy { opacity:.55; pointer-events:none; }
.es-status { margin:24px 0; color:var(--muted); }
.es-warn { margin:12px 0 0; padding:9px 12px; border-radius:11px; background:#fbf1e2; color:#7a4a00; font-size:13px; }
.es-group { margin:20px 0 2px; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.es-sec { margin-top:6px; }
.es-sec-head { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:10px 0 6px; border-bottom:1px solid var(--ink); }
.es-sec-head h3 { margin:0; font-size:15px; font-weight:600; }
.es-sec-sum { font-weight:600; font-variant-numeric:tabular-nums; }
.es-row { display:grid; grid-template-columns:28px minmax(0,1fr) auto; align-items:center; gap:4px 10px; min-height:48px; padding:6px 0; border-bottom:var(--hair) solid var(--sep); }
.es-check { width:28px; height:28px; padding:0; border:0; border-radius:8px; background:transparent; cursor:pointer; display:grid; place-items:center; }
.es-check::before { content:''; width:16px; height:16px; border-radius:5px; box-shadow:inset 0 0 0 1.5px var(--muted); }
.es-check[aria-pressed="true"]::before { background:var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; box-shadow:none; }
.es-row.is-off .es-name, .es-row.is-off .es-nums { opacity:.42; }
.es-label { overflow-wrap:anywhere; }
.es-sub { color:var(--muted); }
.es-meta { display:flex; flex-wrap:wrap; align-items:center; gap:2px 10px; margin-top:2px; font-size:12px; color:var(--muted); }
.es-bad { color:#a14a00; }
.es-unit { height:26px; padding:0 22px 0 8px; border:0; border-radius:8px; background:var(--accent-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23235d67' stroke-width='1.4'/%3E%3C/svg%3E") right 7px center/9px no-repeat;
  color:var(--accent); font:inherit; font-size:12px; font-weight:500; appearance:none; -webkit-appearance:none; cursor:pointer; }
.es-nums { display:flex; align-items:center; gap:6px; justify-content:flex-end; font-variant-numeric:tabular-nums; }
.es-qty, .es-price { position:relative; display:flex; align-items:center; gap:4px; }
.es-in { box-sizing:border-box; width:74px; height:34px; padding:0 8px; border:0; border-radius:9px; background:var(--fill); color:var(--ink); font:inherit; font-size:14px; text-align:right; font-variant-numeric:tabular-nums; }
.es-price .es-in { width:84px; }
.es-in:focus { outline:2px solid var(--accent); outline-offset:0; background:#fff; }
.es-in.is-manual { background:var(--accent-fill); color:var(--accent); font-weight:600; }
.es-u { min-width:34px; font-size:12px; color:var(--muted); white-space:nowrap; }
.es-price .es-u { min-width:44px; }
.es-x { color:var(--muted); font-size:12px; }
.es-sum { min-width:92px; text-align:right; font-weight:600; white-space:nowrap; }
.es-reset { position:absolute; left:-24px; width:22px; height:22px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--accent); font-size:14px; cursor:pointer; }
.es-row.is-extra .es-price .es-in { width:110px; }
.es-custom { display:flex; align-items:center; gap:4px; }
.es-in.es-in-name { flex:1; width:auto; text-align:left; }
.es-in.es-in-unit { width:52px; text-align:left; }
.es-del { width:30px; height:30px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--muted); font-size:18px; cursor:pointer; }
.es-add { margin-top:8px; height:40px; padding:0 14px; border:0; border-radius:11px; background:var(--accent-fill); color:var(--accent); font:inherit; font-size:14px; font-weight:500; cursor:pointer; }
.es-settings { margin:26px 0 6px; border-radius:14px; background:var(--fill); }
.es-settings summary { padding:12px 14px; font-weight:500; cursor:pointer; list-style:none; }
.es-settings summary::-webkit-details-marker { display:none; }
.es-settings summary::after { content:'›'; float:right; color:var(--muted); transition:transform .15s; }
.es-settings[open] summary::after { transform:rotate(90deg); }
.es-set-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:6px 18px; padding:0 14px 6px; }
.es-set { display:flex; align-items:center; gap:8px; min-height:40px; font-size:13px; }
.es-set > span:first-child { flex:1; }
.es-set .es-in { width:64px; background:#fff; }
.es-set-acts { display:flex; flex-wrap:wrap; gap:8px; padding:8px 14px 4px; }
.es-set-acts .btn { height:38px; font-size:13px; background:#fff; }
.es-hint { margin:8px 14px 12px; font-size:12px; color:var(--muted); }
.es-cut .es-hint { margin:12px 0 4px; }
.estimate-foot { flex:none; display:flex; align-items:center; gap:14px; padding:12px 16px 12px 22px; border-top:var(--hair) solid var(--sep); background:var(--card); }
.estimate-foot[hidden] { display:none; }
.es-savebar { flex:1 1 100%; display:flex; align-items:center; gap:8px; margin:-2px 0 2px; padding:8px 8px 8px 14px; border-radius:13px; background:var(--accent-fill); color:var(--accent); font-size:13px; font-weight:500; }
.es-savebar span { margin-right:auto; }
.es-savebar .btn { height:36px; font-size:13px; background:#fff; }
.es-savebar .btn.es-primary { background:var(--accent); color:#fff; }
.estimate-foot { flex-wrap:wrap; }
.es-toast { flex:1 1 100%; padding:8px 14px; border-radius:13px; background:#e6f2ea; color:#21613a; font-size:13px; font-weight:500; animation:rise .18s ease-out; }
.es-count { display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); }
.es-count > span { margin-right:2px; }
.es-step { width:34px; min-width:34px; height:34px; padding:0; border-radius:10px; font-size:18px; }
.es-step:disabled { opacity:.35; }
.es-count-n { min-width:20px; text-align:center; color:var(--ink); font-variant-numeric:tabular-nums; }
.es-total { margin-left:auto; display:flex; align-items:baseline; gap:10px; }
.es-total span { font-size:13px; color:var(--muted); }
.es-total strong { font-size:22px; font-weight:650; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.es-acts { display:flex; gap:6px; }
.es-acts .btn { height:40px; font-size:14px; }
.es-mat { margin-top:18px; }
.es-mat-head { display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; padding-bottom:8px; border-bottom:1px solid var(--ink); }
.es-mat-title { flex:1 1 100%; font-size:15px; }
.es-mat-stat { font-size:13px; color:var(--muted); }
.es-switch { display:flex; align-items:center; gap:7px; height:32px; padding:0 10px 0 4px; border:0; border-radius:16px; background:var(--fill); color:var(--ink); font:inherit; font-size:13px; cursor:pointer; }
.es-switch-knob { position:relative; width:30px; height:18px; border-radius:9px; background:#c9c5bd; transition:background .15s; }
.es-switch-knob::after { content:''; position:absolute; top:2px; left:2px; width:14px; height:14px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.2); transition:transform .15s; }
.es-switch[aria-checked="true"] .es-switch-knob { background:var(--accent); }
.es-switch[aria-checked="true"] .es-switch-knob::after { transform:translateX(12px); }
.es-format { margin-left:auto; display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); }
.es-format .es-in { width:64px; height:30px; }
.es-sheets { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:14px; margin-top:12px; }
.es-sheet { margin:0; }
.es-sheet svg { display:block; width:100%; height:auto; border-radius:6px; }
.es-sheet-bg { fill:#efede8; }
.es-part { stroke:#5f5a50; stroke-width:4; }
.es-part-text { fill:#3d3a34; text-anchor:middle; dominant-baseline:central; font-family:system-ui, sans-serif; }
.es-sheet figcaption { margin-top:5px; font-size:12px; color:var(--muted); }
@media(max-width:600px) {
 .estimate-dialog { margin:0; position:fixed; inset:auto 0 0; width:100%; height:calc(100dvh - env(safe-area-inset-top) - 12px); border-radius:22px 22px 0 0; }
 .estimate-header { flex-wrap:wrap; padding:12px 14px 10px 18px; }
 .estimate-header .material-scopes { order:3; width:100%; margin:0; }
 .estimate-header h2 { flex:1; }
 .estimate-body { padding:2px 16px 18px; }
 .es-row { grid-template-columns:28px minmax(0,1fr); padding:8px 0; }
 .es-nums { grid-column:2; justify-content:flex-start; flex-wrap:wrap; }
 .es-sum { margin-left:auto; }
 .es-reset { position:static; }
 .estimate-foot { flex-wrap:wrap; gap:10px; padding:10px 14px calc(10px + env(safe-area-inset-bottom)); }
 .es-total { order:-1; width:100%; justify-content:space-between; }
 .es-acts { margin-left:auto; }
 .es-sheets { grid-template-columns:1fr; }
 .toolbar .btn { padding:0 9px; }
}
/* «Базис чат»: the bot's pipeline for the opened revision. A floating launcher in the bottom-right corner,
   the panel opens above it on desktop and as a bottom sheet on phones. */
.chat-launch { position:absolute; z-index:22; right:max(16px, env(safe-area-inset-right)); bottom:calc(env(safe-area-inset-bottom) + 16px); display:flex; align-items:center; gap:8px; height:52px; padding:0 22px 0 18px; border:0; border-radius:26px;
  color:#fff; font:inherit; font-size:15px; font-weight:600; letter-spacing:.01em; cursor:pointer; overflow:hidden; isolation:isolate;
  background:linear-gradient(135deg, #2f7f86 0%, #235d67 45%, #3d4f86 100%);
  box-shadow:0 0 0 1px rgba(255,255,255,.18) inset, 0 6px 18px rgba(35,93,103,.35), 0 0 28px rgba(92,140,220,.28); transition:transform .15s ease, box-shadow .2s ease; }
.chat-launch svg { flex:none; filter:drop-shadow(0 0 4px rgba(255,255,255,.55)); }
.chat-launch::after { content:''; position:absolute; inset:0; z-index:-1; background:linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 48%, transparent 66%); transform:translateX(-120%); animation:chat-sheen 5.5s ease-in-out 1.2s infinite; }
@keyframes chat-sheen { 0%, 70% { transform:translateX(-120%); } 100% { transform:translateX(120%); } }
.chat-launch:active { transform:scale(.97); }
@media (hover:hover) { .chat-launch:hover { box-shadow:0 0 0 1px rgba(255,255,255,.24) inset, 0 8px 22px rgba(35,93,103,.42), 0 0 36px rgba(92,140,220,.42); } }
.chat-launch[hidden] { display:none; }
.chat-launch[aria-expanded="true"] { background:linear-gradient(135deg, #235d67, #2c3f6e); }
.chat-launch:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media (prefers-reduced-motion: reduce) { .chat-launch::after { animation:none; } }
/* «Установить на компьютер» (install-hint.js): облачко над «Чат», хвостик к кнопке. */
.install-hint { position:fixed; z-index:23; right:max(16px, env(safe-area-inset-right)); bottom:calc(env(safe-area-inset-bottom) + 80px); width:280px; padding:14px 14px 12px; border-radius:16px; background:var(--card); color:var(--ink);
  box-shadow:0 0 0 var(--hair) var(--sep), 0 12px 32px rgba(30,24,16,.18); animation:chat-pop .2s ease-out; }
.install-hint::after { content:''; position:absolute; right:42px; bottom:-6px; width:12px; height:12px; background:var(--card); transform:rotate(45deg); box-shadow:2px 2px 0 -1px var(--sep); }
.install-hint-top { display:flex; align-items:center; gap:8px; color:var(--accent); }
.install-hint-top strong { color:var(--ink); font-size:14px; }
.install-hint p { margin:6px 0 12px; color:var(--muted); }
.install-hint-actions { display:flex; gap:8px; }
.install-hint-actions button { height:34px; padding:0 14px; border:0; border-radius:17px; font:inherit; font-weight:600; cursor:pointer; }
.install-hint-yes { background:var(--accent); color:#fff; }
.install-hint-no { background:var(--fill); color:var(--ink-2); }
body[data-cutout-open="true"] .install-hint, body[data-groove-open="true"] .install-hint, body[data-radius-open="true"] .install-hint, body[data-shelf-open="true"] .install-hint, body[data-drawer-open="true"] .install-hint { display:none; }
body[data-chat-ready="true"] .part-dock { bottom:calc(env(safe-area-inset-bottom) + 80px); }
.chat-panel { position:fixed; z-index:21; right:max(16px, env(safe-area-inset-right)); bottom:calc(env(safe-area-inset-bottom) + 80px); width:min(400px, calc(100vw - 32px)); max-height:min(620px, calc(100dvh - 170px)); display:flex; flex-direction:column; border-radius:22px; background:var(--card); color:var(--ink); box-shadow:0 0 0 var(--hair) var(--sep), 0 18px 48px rgba(30,24,16,.18); overflow:hidden; transform-origin:100% 100%; animation:chat-pop .2s ease-out; }
@keyframes chat-pop { from { opacity:0; transform:translateY(10px) scale(.97); } }
/* Чат + Конструктор — одна панель справа (workspace.js, 26.10.2026): то же место и размер, что у листа Конструктора, сверху
   капсула «Чат | Конструктор»; переход — новая сторона проявляется поверх старой, цветная плашка переезжает. */
body[data-ws] .chat-panel { top:80px; bottom:18px; right:max(18px, env(safe-area-inset-right)); width:min(440px, calc(100vw - 36px)); max-height:none; border-radius:20px; padding-top:58px; animation:none; }
body[data-ws] .constructor-sheet { padding-top:58px; }
body[data-ws] .chat-panel h2, body[data-ws] #constructor-title { display:none; }
body[data-ws] .chat-launch, body[data-ws] .install-hint { display:none; }
.ws-enter { z-index:23 !important; animation:ws-in .26s cubic-bezier(.2,.8,.2,1) both !important; }
@keyframes ws-in { from { opacity:0; transform:translateX(14px) scale(.985); } }
.ws-switch { position:fixed; z-index:24; top:90px; right:calc(max(18px, env(safe-area-inset-right)) + 12px); width:calc(min(440px, calc(100vw - 36px)) - 24px); height:44px;
  display:grid; grid-template-columns:1fr 1fr; padding:4px; border-radius:14px; background:#eef1f3; box-shadow:inset 0 0 0 1px #e2e5e9; }
.ws-switch[hidden] { display:none; }
.ws-pill { position:absolute; top:4px; bottom:4px; left:4px; width:calc(50% - 4px); border-radius:10px; background:linear-gradient(135deg, #2b6f78, #2c3f6e);
  box-shadow:0 4px 14px rgba(44,63,110,.32), inset 0 0 0 1px rgba(255,255,255,.14); transition:transform .34s cubic-bezier(.3,.9,.3,1), background .34s; }
.ws-switch[data-at="constructor"] .ws-pill { transform:translateX(100%); background:linear-gradient(135deg, #235d67, #2f7d5b); box-shadow:0 4px 14px rgba(35,93,103,.32), inset 0 0 0 1px rgba(255,255,255,.14); }
.ws-switch button { position:relative; z-index:1; display:inline-flex; align-items:center; justify-content:center; gap:7px; border:0; border-radius:10px; background:none;
  color:var(--muted); font:inherit; font-size:14px; font-weight:600; cursor:pointer; transition:color .25s; }
.ws-switch button[aria-selected="true"] { color:#fff; cursor:default; }
@media (hover:hover) { .ws-switch button[aria-selected="false"]:hover { color:var(--ink); } }
.ws-switch button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (prefers-reduced-motion: reduce) { .ws-enter { animation:none !important; } .ws-pill { transition:none; } }
.chat-panel[hidden] { display:none; }
/* app.bazis.migman.ru/ (owner 14.10.2026): no model yet -- the chat in the middle, the rest waits for the first build */
body[data-start="true"] .toolbar, body[data-start="true"] .chat-launch, body[data-start="true"] .chat-mode, body[data-start="true"] .chat-close { display:none; }
body[data-start="true"]:not([data-docked]) .chat-panel { left:auto; top:auto; right:50%; bottom:50%; height:auto; border-radius:22px; animation:none; transform:translate(50%, 50%); width:min(560px, calc(100vw - 32px)); max-height:min(560px, calc(100dvh - 140px)); transform-origin:50% 50%; }
body[data-start="true"]:not([data-docked]) .chat-log { min-height:160px; }
.start-wait { position:absolute; left:50%; top:50%; transform:translate(-50%, -50%); display:flex; align-items:center; gap:10px; color:var(--muted); font-size:15px; }
.start-wait[hidden] { display:none; }
.start-wait .spin { width:18px; height:18px; border:2px solid var(--sep); border-top-color:var(--accent); border-radius:50%; animation:start-spin .9s linear infinite; }
@keyframes start-spin { to { transform:rotate(360deg); } }
.chat-head { display:flex; align-items:center; gap:12px; padding:12px 10px 12px 14px; border-bottom:var(--hair) solid var(--sep); flex:none; }
.chat-heading { flex:1; min-width:0; }
.chat-head h2 { margin:0; font-size:16px; font-weight:600; }
.chat-sub { display:block; color:var(--muted); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-mode { flex:none; height:36px; padding:0 12px; border-radius:18px; background:var(--accent-fill); color:var(--accent); font-size:13px; font-weight:500; white-space:nowrap; }
.chat-panel[data-mode="new"] .chat-mode { background:var(--fill); color:var(--ink-2); }
.chat-panel[data-mode="new"] .chat-options .btn.chat-primary { background:var(--accent); color:#fff; }
.chat-close { flex:none; width:44px; height:44px; border-radius:22px; background:transparent; color:var(--muted); font-size:16px; }
.chat-log { flex:1 1 auto; min-height:120px; overflow-y:auto; overscroll-behavior:contain; padding:14px; display:flex; flex-direction:column; gap:8px; }
.chat-empty { margin:auto 0; color:var(--ink-2); font-size:15px; line-height:1.5; text-align:center; }
.chat-start { margin:auto 0; display:flex; flex-direction:column; gap:8px; padding:8px 4px; }
.chat-start strong { font-size:19px; line-height:1.25; font-weight:700; color:var(--ink); }
.chat-start p { margin:0 0 6px; color:var(--ink-2); font-size:15px; line-height:1.5; }
.chat-start-label { color:var(--accent); font-size:12px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.chat-start-ex { display:flex; flex-direction:column; gap:6px; text-align:left; padding:12px 14px 10px 16px; border:0; border-left:4px solid var(--accent); border-radius:14px; background:var(--accent-fill); color:var(--ink); font:inherit; cursor:pointer; transition:background .15s; }
.chat-start-ex:hover { background:rgba(35,93,103,.17); }
.chat-start-quote { font-size:15px; line-height:1.45; }
.chat-start-ex small { color:var(--accent); font-size:12px; }
.chat-msg { max-width:86%; padding:9px 12px; border-radius:16px; font-size:14px; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; }
.chat-me { align-self:flex-end; color:#fff; background:linear-gradient(135deg, #2b6f78, #235d67); border-bottom-right-radius:6px; }
.chat-bot { align-self:flex-start; display:flex; flex-direction:column; gap:3px; background:var(--fill); border-bottom-left-radius:6px; }
.chat-bot strong { font-weight:600; }
.chat-who { color:var(--muted); font-size:11px; }
.chat-foot { color:var(--ink-2); font-size:12px; }
.chat-usage { display:block; margin-top:2px; }
/* A running job: stage · clock, four segments with names under them; the current segment shimmers. */
.chat-progress { width:min(300px, 86%); gap:0; padding:10px 14px 12px; }
.chat-progress-head { display:flex; align-items:baseline; gap:12px; margin:4px 0 10px; }
.chat-progress-head strong { flex:1; min-width:0; font-size:14.5px; font-weight:600; color:var(--ink); }
.chat-progress-time { flex:none; font-size:13px; font-weight:500; color:var(--ink-2); font-variant-numeric:tabular-nums; }
.chat-steps { display:grid; grid-template-columns:repeat(4, 1fr); gap:4px; }
.chat-steps i { height:4px; border-radius:2px; background:rgba(120,108,90,.18); overflow:hidden; position:relative; transition:background-color .3s; }
.chat-steps i.done { background:var(--accent); }
.chat-steps i.now { background:rgba(35,93,103,.28); }
.chat-steps i.now::after { content:""; position:absolute; inset:0; width:45%; border-radius:2px; background:var(--accent); animation:chat-shimmer 1.3s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes chat-shimmer { from { transform:translateX(-100%); } to { transform:translateX(230%); } }
.chat-step-names { display:grid; grid-template-columns:repeat(4, 1fr); gap:4px; margin-top:6px; }
.chat-step-names span { font-size:11px; line-height:1.2; color:var(--muted); opacity:.75; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat-step-names span.done { opacity:1; }
.chat-step-names span.now { color:var(--accent); font-weight:600; opacity:1; }
.chat-progress .chat-cancel { margin-top:10px; }
@media (prefers-reduced-motion: reduce) { .chat-steps i.now::after { animation:none; width:100%; opacity:.6; } }
.chat-old { margin:0 12px 8px; padding:10px 12px; border-radius:14px; background:#f6e7d2; font-size:13px; line-height:1.45; }
.chat-old[hidden] { display:none; }
.chat-old p { margin:0 0 8px; }
.chat-go { min-height:44px; padding:0 14px; border-radius:14px; background:var(--accent); color:#fff; }
.chat-go[hidden], .chat-revert[hidden] { display:none; }
.chat-old-actions { display:flex; flex-wrap:wrap; gap:8px; }
.chat-revert { min-height:44px; padding:0 14px; border-radius:14px; background:var(--accent); color:#fff; }
.chat-old-actions .chat-revert:not([hidden]) + .chat-go { background:transparent; color:var(--accent); box-shadow:inset 0 0 0 1px var(--accent); }
.chat-revert:disabled { opacity:.5; }
.chat-name { display:flex; flex-direction:column; gap:4px; padding:0 12px 10px; }
.chat-name[hidden] { display:none; }
.chat-name span { color:var(--accent); font-size:13px; font-weight:600; }
.chat-name input { box-sizing:border-box; min-height:44px; padding:0 14px; border:1.5px solid rgba(35,93,103,.3); border-radius:22px; background:#fff; transition:border-color .15s, box-shadow .15s; color:inherit; font:inherit; font-size:16px; }
.chat-name input:hover { border-color:rgba(35,93,103,.55); }
.chat-name input:focus, .chat-name input:focus-visible { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-fill); }
.chat-name input:disabled { opacity:.6; }
.chat-options { display:flex; flex-wrap:wrap; gap:6px; padding:0 12px; }
.chat-options:not(:empty) { padding-bottom:8px; }
.chat-options .btn { min-height:44px; padding:0 14px; border-radius:22px; background:var(--accent-fill); color:var(--accent); font-size:13px; }
.chat-focus { display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:0 12px 8px; }
.chat-focus[hidden] { display:none; }
.chat-focus-head { width:100%; color:var(--muted); font-size:11px; }
.chat-chip { display:inline-flex; align-items:center; max-width:100%; min-height:32px; padding-left:12px; border-radius:16px; background:var(--accent-fill); color:var(--accent); font-size:13px; }
.chat-chip-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-chip-x { position:relative; flex:none; width:32px; height:32px; border:0; background:none; color:inherit; font-size:12px; cursor:pointer; }
.chat-chip-x::after { content:""; position:absolute; inset:-6px; }
.chat-chip-more { padding-right:12px; }
.chat-me-focus { display:block; margin-top:4px; font-size:12px; opacity:.8; }
.chat-notice { margin:0 12px 8px; font-size:12px; line-height:1.45; color:#9a3b1f; }
.chat-notice[hidden] { display:none; }
.chat-locked { position:fixed; z-index:60; left:50%; bottom:calc(env(safe-area-inset-bottom) + 84px); transform:translateX(-50%); width:min(320px, calc(100vw - 32px)); box-sizing:border-box;
  display:flex; align-items:center; gap:12px; padding:12px 12px 12px 16px; border-radius:14px; background:var(--bg); color:var(--ink); border:1px solid var(--sep); box-shadow:0 8px 28px rgba(0,0,0,.18); }
.chat-locked[hidden] { display:none; }
.chat-locked p { margin:0; flex:1; font-size:14px; line-height:1.4; }
.chat-locked .btn { flex:none; min-height:36px; padding:0 12px; font-size:13px; }
.chat-notice .btn { min-height:36px; padding:0 10px; font-size:12px; }
.chat-form { display:flex; align-items:flex-end; gap:6px; padding:8px 10px 4px 12px; border-top:var(--hair) solid var(--sep); flex:none; }
.chat-form textarea { flex:1; box-sizing:border-box; min-height:44px; max-height:120px; resize:none; border:1.5px solid rgba(35,93,103,.45); border-radius:22px; padding:10px 14px; background:#fff; transition:border-color .15s, box-shadow .15s; color:inherit; font:inherit; font-size:16px; line-height:1.35; }
.chat-form textarea:hover { border-color:rgba(35,93,103,.7); }
.chat-form textarea:focus, .chat-form textarea:focus-visible { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-fill); }
.chat-form textarea:disabled { opacity:.6; }
.chat-send { flex:none; width:44px; height:44px; border-radius:22px; color:#fff; font-size:18px; background:linear-gradient(135deg, #2f7f86, #235d67 50%, #3d4f86); }
.chat-send:disabled, .chat-send.idle { background:var(--fill-press); }
.chat-send[hidden], .chat-mic[hidden] { display:none; }
/* voice: the mic stands where «send» is while the field is empty; tap -- record, tap -- stop */
.chat-mic { position:relative; flex:none; width:44px; height:44px; padding:0; display:grid; place-items:center; border-radius:22px; color:#fff;
  background:linear-gradient(135deg, #2f7f86, #235d67 50%, #3d4f86); box-shadow:0 2px 8px rgba(35,93,103,.28); transition:background-color .2s, transform .1s; }
.chat-mic > * { grid-area:1/1; }
.chat-mic:active { transform:scale(.94); }
.chat-mic:disabled { background:var(--fill-press); box-shadow:none; color:var(--muted); }
.chat-mic .chat-mic-stop, .chat-mic .chat-mic-spin { display:none; }
.chat-mic[data-state="recording"] { background:#e0483b; box-shadow:0 2px 10px rgba(224,72,59,.4); }
.chat-mic[data-state="recording"]::before { content:''; position:absolute; inset:-5px; border-radius:50%; border:2px solid rgba(224,72,59,.45); animation:chat-mic-ring 1.3s ease-out infinite; }
.chat-mic[data-state="sending"] .chat-mic-on { display:none; }
.chat-mic { touch-action:none; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; transition:transform .12s, background-color .15s, box-shadow .15s; }
.chat-mic[data-state="recording"] { transform:scale(1.12); }
.chat-mic[data-state="sending"] { background:var(--accent-fill); box-shadow:none; }
.chat-mic[data-state="sending"] .chat-mic-spin { display:block; width:18px; height:18px; border-radius:50%; border:2px solid rgba(35,93,103,.25); border-top-color:var(--accent); animation:chat-mic-spin .8s linear infinite; }
/* the common .btn:hover would paint them grey: keep the colour, just lift a little */
@media (hover: hover) {
  .chat-send:not(:disabled):not(.idle):hover, .chat-mic:not(:disabled):not([data-state]):hover, .chat-mic[data-state="idle"]:not(:disabled):hover {
    background:linear-gradient(135deg, #3a8d94, #2a6c77 50%, #4a5d98); box-shadow:0 4px 12px rgba(35,93,103,.36); }
  .chat-mic[data-state="recording"]:hover { background:#d23c30; }
  .chat-mic[data-state="sending"]:hover { background:var(--accent-fill); }
  .chat-mic:disabled:hover, .chat-send:disabled:hover, .chat-send.idle:hover { background:var(--fill-press); }
}
@keyframes chat-mic-ring { from { transform:scale(.9); opacity:1; } to { transform:scale(1.35); opacity:0; } }
@keyframes chat-mic-spin { to { transform:rotate(360deg); } }
.chat-panel[data-voice="recording"] .chat-form textarea { opacity:1; }
.chat-panel[data-voice="recording"] .chat-form textarea::placeholder { color:#c8372b; font-variant-numeric:tabular-nums; }
.chat-panel[data-voice="sending"] .chat-form textarea { opacity:1; }
@media (prefers-reduced-motion: reduce) { .chat-mic[data-state="recording"]::before { animation:none; } .chat-mic[data-state="sending"] .chat-mic-spin { animation-duration:2.4s; } }
.chat-price { margin:0; padding:0 16px calc(10px + env(safe-area-inset-bottom)); color:var(--muted); font-size:11px; flex:none; }
.chat-price:empty { padding-bottom:calc(6px + env(safe-area-inset-bottom)); }
@media (max-width:600px) {
 .chat-launch { right:max(12px, env(safe-area-inset-right)); bottom:calc(env(safe-area-inset-bottom) + 12px); height:50px; }
 body[data-chat-ready="true"] .part-dock { bottom:calc(max(var(--gutter), env(safe-area-inset-bottom)) + 64px); }
 body[data-chat-open="true"] .chat-launch { display:none; }
 .chat-panel { inset:auto 0 0 0; width:100%; max-height:none; height:58dvh; border-radius:22px 22px 0 0; animation:rise .18s ease-out; }
 .chat-head { position:relative; padding-top:18px; }
 .chat-head::before { content:''; position:absolute; left:calc(50% - 17px); top:6px; width:34px; height:5px; border-radius:4px; background:var(--sep); }
 body[data-chat-open="true"] #stage { bottom:58dvh; }
 body[data-chat-open="true"] .part-dock { display:none; }
}
@media (max-height:500px) and (min-width:601px) { body[data-chat-ready="true"] .part-dock { bottom:calc(max(8px, env(safe-area-inset-bottom)) + 64px); } }
/* Панели внизу (20.10.2026, владелец — тест): инструменты у нижнего края на компьютере и планшете; телефон
   (≤600 px или низкий экран в альбомной) — как был. Отступ снизу 16 px — как у «Чат». Меню, что раньше падали вниз, открываются вверх.
   Проект внизу — только на широком экране (от 1280 px); уже — он наверху, как раньше, внизу одни инструменты. */
@media (min-width: 601px) and (min-height: 501px) {
  .toolbar, body[data-debug="true"] .toolbar { top: auto; bottom: calc(env(safe-area-inset-bottom) + 16px); }
  /* Тень побольше — панели читаются у нижнего края (владелец 20.10.2026; серый фон внутри — нет). */
  .toolbar { box-shadow: 0 0 0 var(--hair) rgba(60,52,40,.16), 0 2px 6px rgba(30,24,16,.08), 0 10px 30px rgba(30,24,16,.16); }
  .view-presets { top: auto; bottom: calc(100% + 8px); transform-origin: bottom left; }
  .dim-menu { transform-origin: bottom right; }
  .angle-pill { bottom: calc(env(safe-area-inset-bottom) + 74px); }
  .beta-toast { bottom: calc(env(safe-area-inset-bottom) + 80px); }
  .perf { bottom: calc(env(safe-area-inset-bottom) + 74px); }
}
@media (min-width: 1280px) and (min-height: 501px) {
  .project-pill, body[data-debug="true"] .project-pill, body:has(.account-pill:not([hidden])) .project-pill { top: auto; bottom: calc(env(safe-area-inset-bottom) + 20px); max-width: min(390px, calc(50vw - 164px)); }
  .project-pill { box-shadow: 0 0 0 var(--hair) rgba(60,52,40,.16), 0 2px 6px rgba(30,24,16,.08), 0 10px 30px rgba(30,24,16,.16); }
  /* Проект — той же высоты и тем же шрифтом, что инструменты: капсула 50 px (кнопки 44 + 3 px), 14 px, 500 (владелец 20.10.2026). */
  .project-pill { height: 56px; padding: 6px; border-radius: 20px; max-width: min(390px, calc(50vw - 164px)); }
  .project-pill button { height: 44px; border-radius: 13px; font-size: 14px; font-weight: 500; letter-spacing: -.01em; }
  .project-dialog { inset: auto auto calc(env(safe-area-inset-bottom) + 74px) 12px; }
  .project-notice { top: auto; bottom: calc(env(safe-area-inset-bottom) + 74px); }
}
/* Без уменьшения интерфейса (до 900 px) инструменты по центру доходят до «Чат» — «Чат», его окно и подсказка над ним поднимаются. */
@media (min-width: 601px) and (max-width: 900px) and (min-height: 501px) {
  .chat-launch { bottom: calc(env(safe-area-inset-bottom) + 76px); }
  .chat-panel, .install-hint, body[data-chat-ready="true"] .part-dock { bottom: calc(env(safe-area-inset-bottom) + 140px); }
}

/* Окно гостя (бета 11.11.2026): слева, ~520 px, модель справа не закрыта; ≤600 px — лист снизу на всю ширину */
.demo-card { position: fixed; z-index: 25; top: 64px; left: 16px; bottom: 16px; width: min(520px, calc(100% - 32px)); box-sizing: border-box; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 24px 26px 20px; border-radius: var(--r-card); background: var(--card); color: var(--ink); border: 1px solid var(--sep); box-shadow: 0 2px 4px rgba(30,24,16,.08), 0 14px 40px rgba(30,24,16,.2); animation: demo-in .2s ease-out; }
.demo-card[hidden], .demo-help[hidden], .demo-chips[hidden] { display: none; }
@keyframes demo-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.demo-x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font: inherit; font-size: 16px; cursor: pointer; }
.demo-x:hover { background: var(--fill); color: var(--ink); }
.demo-title { display: block; padding-right: 28px; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.015em; }
.demo-lead { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.demo-build { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--fill); border: 1px solid var(--sep); }
.demo-build-title { font-size: 17px; font-weight: 600; }
.demo-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.demo-fields label { display: grid; align-content: start; font-size: 13px; gap: 4px; color: var(--ink-2); min-width: 0; }
.demo-name { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 500; }
.demo-fi { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(35,93,103,.1); color: var(--accent); }
.demo-input { position: relative; display: block; }
.demo-input em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--muted); pointer-events: none; }
.demo-fields input { width: 100%; box-sizing: border-box; height: 48px; padding: 0 38px 0 12px; border: 1px solid rgba(60,52,40,.3); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: 18px; font-weight: 600; }
.demo-fields input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.demo-fields small { color: #b42318; min-height: 0; }
.demo-card .btn { height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .demo-card .btn:hover:not(:disabled) { background: #1b4a52; } }
.demo-card .btn:active:not(:disabled) { background: #153b42; }
.demo-card .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-card .btn:disabled { opacity: .55; cursor: default; }
.demo-minute { text-align: center; color: var(--muted); font-size: 13px; }
.demo-status { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.demo-status:empty { display: none; }
.demo-example { height: 46px; border: 1px solid var(--accent); border-radius: 14px; background: transparent; color: var(--accent); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
@media (hover: hover) { .demo-example:hover { background: var(--accent-fill); } }
.demo-example:focus-visible, .demo-help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-perks { margin: auto 0 0; padding: 12px 0 0; border-top: 1px solid var(--sep); list-style: none; display: grid; gap: 6px; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.demo-help { position: fixed; z-index: 24; left: 16px; bottom: 16px; height: 40px; padding: 0 16px; border: 1px solid var(--sep); border-radius: 20px; background: var(--card); color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 10px rgba(30,24,16,.15); }
.demo-chips { position: fixed; z-index: 24; left: 50%; top: 72px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: calc(100% - 32px); cursor: pointer; }
.demo-chip { padding: 8px 14px; border-radius: 999px; background: rgba(30,24,16,.82); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 4px 14px rgba(30,24,16,.25); animation: demo-chip-in .25s ease-out; }
@keyframes demo-chip-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* панель детали при первом входе гостя закрыта: пока открыто окно и пока видны подсказки */
body[data-demo="true"][data-welcome] .part-dock { display: none; }
@media (max-width: 600px) {
  .demo-card { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 78vh; border-radius: var(--r-card) var(--r-card) 0 0; padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); gap: 10px; animation-name: demo-up; }
  .demo-title { font-size: 21px; }
  .demo-lead { font-size: 14px; }
  .demo-fields { gap: 8px; }
  .demo-fields input { padding: 0 30px 0 10px; font-size: 16px; }
  .demo-input em { right: 8px; }
  .demo-help { bottom: calc(env(safe-area-inset-bottom) + 76px); left: 12px; }
  .demo-chips { top: 56px; }
}
@keyframes demo-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .demo-card, .demo-chip { animation: none; } }

.download-compact { display:none; }
@media (max-width:600px) { #download-b3d, #send-b3d { display:none; } }
@media (min-width: 601px) {
  .download-compact { display:block; position:absolute; z-index:24; top:12px; right:120px; }
  .download-compact .btn { height:44px; padding:0 16px; border-radius:22px; background:var(--accent); color:white; font-weight:600; }
  .view-hud .view-hud-download, .view-hud .view-hud-download:hover { height:44px; padding:0 16px; background:var(--accent); color:white; font-weight:600; }
  body.dock-final .view-hud .view-hud-tool[aria-pressed="true"] svg { color:var(--accent); }
  body.dock-final .view-hud .view-hud-tool[aria-pressed="true"], body.dock-final .insp-actions-btn { background:var(--accent-fill); color:var(--accent); }
}

.cx-width-dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-sizing: border-box; padding: 20px; border: 0; border-radius: 20px; background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.cx-width-dialog::backdrop { background: rgba(28,28,26,.28); }
.cx-width-dialog:focus { outline: none; }
.cx-width-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.cx-width-header h3 { margin: 0; font-size: 19px; font-weight: 650; }
.cx-width-header p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.cx-width-list { display: grid; gap: 8px; }
.cx-width-option { width: 100%; min-height: 56px; border: 0; border-radius: 14px; padding: 12px; background: var(--soft, #f2f2f0); color: var(--ink); text-align: left; cursor: pointer; }
.cx-width-option:hover:not(:disabled), .cx-width-option:active:not(:disabled) { background: var(--accent-fill); }
.cx-width-option:disabled { opacity: .5; cursor: default; }
.cx-width-option strong { display: block; font-size: 15px; font-weight: 600; }
.cx-width-description, .cx-width-error { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.cx-width-strip { display: block; width: 100%; height: 28px; margin-top: 9px; border-radius: 6px; overflow: hidden; }
.cx-width-strip rect.cx-width-segment { fill: #a7aaa8; }
.cx-width-strip rect.cx-width-segment-changed { fill: var(--accent); }
.cx-width-strip text { fill: white; font-size: 12px; font-weight: 600; }
.cx-width-footer { display: flex; justify-content: flex-end; margin-top: 16px; }
.cx-width-dialog button:focus { outline: none; }
.cx-width-dialog button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.cx-fill-parameters { display:grid; gap:0; min-width:0; margin:12px 0; padding:6px 12px; border:1px solid var(--sep); border-radius:16px; background:var(--card); }
.cx-fill-parameters .cx-field { display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-width:0; padding:3px 0; color:var(--ink); font-size:14px; }
.cx-fill-parameters .cx-field > span { flex:1 1 130px; padding-right:8px; }
.cx-fill-parameters select, .cx-fill-parameters input[type=number] { box-sizing:border-box; width:160px; max-width:100%; min-width:0; min-height:36px; padding:6px 28px 6px 10px; border:1px solid transparent; border-radius:10px; background-color:var(--soft, #f2f2f0); color:var(--ink); font:inherit; }
.cx-fill-parameters input[type=number] { padding-right:10px; }
.cx-fill-parameters select:hover, .cx-fill-parameters input[type=number]:hover { border-color:var(--sep); }
.cx-fill-parameters select:focus-visible, .cx-fill-parameters input:focus-visible, .cx-fill-parameters button:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.cx-fill-parameters button { width:36px; height:36px; border:0; border-radius:10px; background:var(--soft, #f2f2f0); color:var(--accent); font:inherit; font-size:20px; cursor:pointer; }
.cx-fill-parameters button.cx-apply-height { width:auto; padding:0 10px; font-size:12px; font-weight:600; }
.cx-fill-parameters button:hover:not(:disabled) { background:var(--accent-fill); }
.cx-fill-parameters button:disabled { opacity:.4; cursor:default; }
.cx-fill-parameters output { min-width:34px; text-align:center; font-weight:600; font-variant-numeric:tabular-nums; }
.cx-fill-parameters .fill-field-error { flex-basis:100%; font-size:12px; line-height:1.35; }
.cx-fill-parameters option:disabled { color:#999; }
.cx-fill-parameters .cx-tip { flex-basis:100%; margin:8px 0; font-size:13.5px; }
.cx-fill-parameters .cx-tip button.cx-tip-btn { width:auto; height:auto; min-height:34px; padding:6px 14px; font-size:13.5px; font-weight:600; background:#fff; }
.cx-fill-parameters input[data-automatic="true"] { color:var(--cx-muted); }

/* степпер «− N мм +» внутри блока параметров (ящики: установка и правка, 05.11.2026) — общий вид Конструктора, не кнопки блока */
.cx-fill-parameters { --cx-fill:#f1f3f5; --cx-line:#e2e5e9; --cx-muted:#5f676d; }
.cx-fill-parameters .cx-stepper { flex:0 0 auto; margin-left:auto; }
.cx-fill-parameters .cx-stepper input.cx-st-input:focus-visible, .cx-fill-parameters .cx-stepper button.cx-st-btn:focus-visible { outline:none; }
.cx-fill-parameters .cx-stepper:focus-within { background:#fff; box-shadow:inset 0 0 0 2px var(--accent); }
.cx-fill-parameters .cx-stepper input.cx-st-input { width:5ch; min-height:0; height:auto; padding:0; border:0; background:none; text-align:right; }
.cx-fill-parameters button.cx-apply-height { height:42px; border-radius:12px; }
.cx-fill-parameters .cx-stepper button.cx-st-btn { width:auto; height:100%; border-radius:12px; background:none; color:var(--ink); font-size:18px; }
.cx-fill-parameters .cx-stepper button.cx-st-btn:hover:not(:disabled) { background:#e5e9ec; }
.cx-fill-parameters button.cx-link { width:auto; height:auto; min-height:28px; background:none; color:var(--accent); font-size:13px; font-weight:600; }
.cx-fill-parameters button.cx-link:hover { background:none; text-decoration:underline; }
.cx-fill-parameters .cx-fronts-head { padding-top:10px; }
.cx-fill-parameters .cx-field > span > .cx-meta2 { display:block; }
.cx-choice.cx-fill-sets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cx-fill-sets .cx-opt { min-height: 62px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; border-radius: 12px; }
.cx-fill-sets .cx-opt b { font-size: 14px; font-weight: 600; }
.cx-fill-sets .cx-opt small { margin-top: 3px; font-size: 12px; color: var(--muted); }
.cx-fill-sets .cx-opt.cx-on { background: var(--accent-fill); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cx-fill-corpora { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 12px; }
.cx-fill-corpus { display: inline-flex; align-items: center; gap: 3px; min-height: 38px; padding: 7px 12px; border: 1px solid #d8dfe1; border-radius: 10px; background: #f2f4f4; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
.cx-fill-corpus:hover { background: #e6eeee; border-color: #9bb9bc; }
.cx-fill-corpus.cx-on { background: var(--accent-fill); color: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cx-fill-corpus small { font-size: inherit; color: inherit; }
.cx-fill-corpus:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 440px) { .cx-choice.cx-fill-sets { grid-template-columns: 1fr; } }
.first-hint {position:fixed;z-index:90;left:16px;bottom:90px;max-width:calc(100vw - 16px);padding:10px 14px;border:0;border-radius:12px;background:#243b3e;color:white;font:inherit;font-size:13px;box-shadow:0 4px 20px #0003;}
.chat-price.insufficient {color:#b42c24;}
@media(min-width:601px){body.dock-final .dock-dims {width:auto;min-width:100px;gap:6px;padding:0 10px;} body.dock-final :is(#measure,#view-menu){width:auto;min-width:100px;gap:6px;padding:0 10px;}body.dock-final :is(#measure,#view-menu)::after{content:attr(data-tool-label);font-size:13px;}}
@media(min-width:601px) and (max-width:1024px){body.dock-final :is(.dock-dims,#measure,#view-menu){flex-direction:column;gap:3px;font-size:11px;min-width:64px;padding:4px;}body.dock-final :is(#measure,#view-menu)::after{font-size:11px;}}
@media(min-width:601px){body.dock-final :is(#measure,#view-menu) > .dock-tool-label{display:inline;font-size:13px;}body.dock-final :is(#measure,#view-menu)::after{display:none;}}
.download-ready-wrap {display:flex;flex-direction:column;align-items:center;gap:3px}.download-readiness {border:0;background:transparent;color:var(--muted);font:inherit;font-size:11px;cursor:pointer}.download-readiness:empty{display:none}@media(max-width:600px){.hud-readiness{display:none}}
#product-card #product-items {border-top:0}
#product-items > summary.rw-sec {margin:14px 0 4px;list-style:none;min-height:44px}
#product-items > summary.rw-sec::-webkit-details-marker {display:none}
#product-items > summary.rw-sec::before {content:"\25B8";width:1.2em}
#product-items[open] > summary.rw-sec::before {content:"\25BE"}
#product-items[hidden] {display:none}
#product-corpora {margin:0 0 10px}
#product-card #product-corpora > details {border:0}
#product-corpora > details > summary {padding:8px 4px;line-height:1.35}
#product-corpora .passport-heading {min-width:0;overflow-wrap:anywhere}
#product-corpora .rw-corp {box-sizing:border-box;width:100%;min-height:58px;padding:9px 36px 9px 12px !important;border-radius:10px;}
#product-corpora .rw-corp em {max-width:100%;line-height:1.35}
#product-corpora .rw-chev {right:12px}
#product-card summary {min-height:44px;display:flex;align-items:center;cursor:pointer;gap:6px}#product-card .passport-heading{flex:1}#product-card .passport-edit{min-width:44px;min-height:44px;border:0;background:transparent;color:var(--muted)}#product-card .passport-name{width:100%;min-height:44px;font:inherit}#product-card details{border-top:var(--hair) solid var(--sep)}#passport-estimate{width:100%;min-height:44px;text-align:left;border:0;background:transparent;color:var(--accent);font:inherit}#product-actions{display:grid;grid-template-columns:1fr 1fr}#product-actions .bay-act{min-height:64px}#product-size{font-variant-numeric:tabular-nums}
.corpus-row{width:100%;min-height:44px;background:transparent;border:0;font:inherit;text-align:left}.corpus-delete{width:100%;min-height:44px;border:0;background:transparent;color:#b42c24;font:inherit}.corpus-delete:disabled{opacity:.5}#corpus-body{--cx-fill:#f1f3f5;--cx-line:#e2e5e9;--cx-input:#f1f3f5;--cx-muted:#5f676d}#corpus-body .bay-acts{display:grid;grid-template-columns:1fr 1fr}#corpus-body .bay-act{min-height:64px}
.product-check-detail{margin:2px 0 12px;color:var(--muted);font-size:12px;line-height:1.35;overflow-wrap:anywhere}

@media (min-width:601px) and (min-height:501px) {
  body.dock-final #measure-step:not([hidden]) {position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);padding:6px 12px;border-radius:10px;background:var(--card);box-shadow:var(--shadow);pointer-events:none;}
  body.dock-final .toolbar #dock-dimensions {flex:0 0 auto;width:auto;min-width:132px;padding-inline:14px;gap:8px;white-space:nowrap;outline-offset:-2px;}
  @media (max-width:1024px) { body.dock-final .toolbar #dock-dimensions {min-width:80px;padding:4px 8px;gap:3px;} }
  body.dock-final #dim-tools, body.dock-final #dimensions {flex:0 0 auto;}
  body.dock-final #dimensions {margin-left:0;font-size:0;}
}
body.dock-final .toolbar #toggle-corpus-tags {padding-left:16px;padding-right:40px;text-align:left;white-space:nowrap;}
#product-card #passport-estimate:not([hidden]) { display:flex; flex-direction:column; align-items:stretch; gap:0; margin-top:16px; padding:16px; border:1px solid var(--sep); border-radius:16px; background:var(--fill); line-height:1.35; cursor:pointer; }
#product-card #passport-estimate:hover { border-color:#9cb7ba; }
#product-card #passport-estimate:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
#passport-estimate .estimate-title { font-size:12px; font-weight:650; color:var(--muted); }
#passport-estimate .estimate-head { display:flex; flex-wrap:wrap; align-items:end; justify-content:space-between; gap:8px 12px; margin-top:10px; }
#passport-estimate .estimate-price { display:flex; flex-direction:column; gap:3px; }
#passport-estimate .estimate-kicker { font-size:11px; color:var(--muted); }
#passport-estimate .estimate-amount { font-size:24px; font-weight:700; letter-spacing:-.02em; color:var(--ink); font-variant-numeric:tabular-nums; }
#passport-estimate .estimate-area { font-size:12px; color:var(--muted); padding-bottom:3px; white-space:nowrap; }
#passport-estimate .estimate-contents { display:flex; flex-direction:column; gap:7px; margin-top:14px; padding-top:12px; border-top:1px solid var(--sep); }
#passport-estimate .estimate-contents-title { font-size:11px; font-weight:650; color:var(--muted); }
#passport-estimate .estimate-item { display:flex; justify-content:space-between; gap:12px; align-items:baseline; font-size:13px; color:var(--ink); }
#passport-estimate .estimate-item-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#passport-estimate .estimate-item-value { flex:none; font-size:12px; font-weight:650; font-variant-numeric:tabular-nums; }
#passport-estimate .estimate-more { font-size:11px; color:var(--muted); }
#passport-estimate .estimate-open { font-size:13px; font-weight:600; color:var(--accent); margin-top:14px; }
#product-actions .bay-act {display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:7px;padding:14px 8px;min-height:70px;background:#eef2f2;box-shadow:inset 0 0 0 1px rgba(31,98,111,.12);text-align:left;}
#product-actions .bay-act:hover:not(:disabled) {background:var(--accent-fill);box-shadow:inset 0 0 0 1px rgba(31,98,111,.25);}
#product-actions .bay-act:focus-visible {outline:2px solid var(--accent);outline-offset:2px;}
#product-actions .product-action-copy {display:flex;min-width:0;flex-direction:column;gap:4px;}
#product-actions .product-action-icon {flex:0 0 30px;width:30px;height:30px;color:var(--accent);}
#product-actions .product-action-icon svg {display:block;width:100%;height:100%;}
#product-actions .product-action-title {color:var(--accent);font-size:13px;font-weight:550;line-height:1.25;}
#product-actions .product-action-copy small {font-size:12px;line-height:1.3;color:var(--muted);}
#part-action-tiles {display:none}
@media (min-width:601px) and (min-height:501px) {
  #part-action-tiles {display:grid;grid-template-columns:1fr 1fr;margin:12px 0}
  #part-action-tiles .bay-act {min-height:64px}
  #part-card .insp-pane::before {display:none}
  #part-card :is(.insp-start,.insp-actions,.insp-more,#part-front,#part-hinges) {display:none}
  #part-card #part-technical {margin:12px 0;border-top:var(--hair) solid var(--sep)}
  #part-technical > summary {min-height:44px;display:flex;align-items:center;cursor:pointer;color:var(--muted)}
  #part-card .insp-foot {display:flex;gap:8px;justify-content:space-between}
  #part-card .insp-foot #hide-part {min-height:44px}
  /* the card footer (04.11): «Скрыть деталь» left, one delete right; the group name is already in the card head */
  #part-card .insp-foot {flex-wrap:nowrap;align-items:center}
  #part-card .insp-foot:has(#hide-part) #insp-foot-label {display:none}
  #part-card .insp-foot #hide-part {flex:0 0 auto;padding:0 16px;white-space:nowrap}
  #part-card .insp-foot .part-delete {flex:0 1 auto;margin-left:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  #part-card .insp-foot:has(#part-delete:not([hidden])) .part-delete:not(#part-delete) {display:none}
}
#front-block-body { display:flex; flex-direction:column; gap:0; }
.front-block-hint { margin:0 0 6px !important; }
.front-block-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px; min-height:52px; padding:6px 2px; border-top:1px solid #e2e5e9; }
.front-block-hint + .front-block-row { border-top:0; }
.front-block-label { display:flex; flex-direction:column; gap:1px; min-width:0; }
.front-block-label strong { font-size:15px; font-weight:600; color:var(--ink); }
.front-block-label small { font-size:12.5px; color:#5f676d; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.front-block-options { display:inline-grid; grid-auto-flow:column; grid-auto-columns:minmax(44px,auto); gap:3px; padding:3px; border-radius:12px; background:#f1f3f5; box-shadow:inset 0 0 0 1px #e2e5e9; }
.front-block-options .btn { min-height:34px; padding:0 11px; border:0; border-radius:9px; background:none; box-shadow:none; font-size:14px; color:#394246; }
.front-block-options .btn[aria-pressed="true"] { background:#fff; color:var(--accent,#2a7d7a); font-weight:600; box-shadow:0 1px 2px rgba(0,0,0,.1), inset 0 0 0 1.5px var(--accent,#2a7d7a); }
.front-block-more { display:block; width:100%; margin:4px 0 0; padding:12px 2px; border:0; border-top:1px solid #e2e5e9; background:none; font:inherit; font-size:14.5px; font-weight:600; color:var(--accent,#2a7d7a); text-align:left; cursor:pointer; }
.front-block-more small { font-weight:400; color:#5f676d; }
.front-block-gap { min-height:46px; }
.front-block-step { display:inline-grid; grid-template-columns:34px 76px 34px; align-items:center; padding:3px; border-radius:12px; background:#f1f3f5; box-shadow:inset 0 0 0 1px #e2e5e9; }
.front-block-step .btn { min-height:32px; padding:0; border:0; background:none; box-shadow:none; font-size:16px; color:#394246; }
.front-block-step span { text-align:center; font-weight:600; font-size:14.5px; }
#front-block-sheet .material-foot { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
#front-block-sheet .material-foot .cut-status { flex-basis:100%; margin:0; }
#front-block-sheet .material-foot #apply-front-block { flex:1; }
#front-block-sheet .material-foot .place-cancel { flex:0 0 auto; background:none; box-shadow:none; color:#5f676d; } .front-block-unavailable { opacity:.5; pointer-events:none; } #part-delete.front-block-delete { color:#b3261e; }
/* Реактор, срез 1 (04.11.2026, флаг ?reactor=1): «Размеры», «Замер», «Вид» — в верхней пилюле, меню открываются вниз */
@media (min-width: 601px) and (min-height: 501px) {
  body.reactor-top .account-pill { padding:0 6px; width:44px; }
  body.reactor-top .account-pill .account-name { display:none; }
  body.reactor-top .account-dot { left:30px; }
  body.reactor-top .view-hud { gap:6px; white-space:nowrap; }
  /* Джойстик (12.11.2026, dock-layout.js): круг справа внизу сцены — центр-ракурс, по венцу 6 значков. right/bottom пишет fitJoy()
     (24 px до правой панели, низ вровень с нижней). Положение значка — --dx/--dy слота (единичный вектор) × радиус венца. */
  body.reactor-top .view-joystick { --joy-d: 132px; --joy-r: 49px; --joy-b: 32px; --joy-c: 48px; --joy-i: 64px; --joy-t: .14s;
    position: absolute; z-index: 24; right: 24px; bottom: calc(env(safe-area-inset-bottom) + 16px); width: var(--joy-d); height: var(--joy-d); border-radius: 50%;
    background: var(--surface); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: 0 0 0 1px var(--sep), 0 1px 2px rgba(20,30,30,.05), 0 12px 32px -14px rgba(20,30,30,.22); font-size: 12px; }
  body.reactor-top .view-joystick:has([data-open="true"]) { z-index: 90; }
  body[data-start="true"] .view-joystick { display: none; }
  body.reactor-top .view-joystick > .view-hud-pill { display: none; }
  body.reactor-top .view-joy-ring { position: absolute; inset: 0; border-radius: 50%; }
  body.reactor-top .view-joy-ring::before { content: ""; position: absolute; left: 50%; top: 50%; width: var(--joy-i); height: var(--joy-i); margin: calc(var(--joy-i) / -2) 0 0 calc(var(--joy-i) / -2);
    border-radius: 50%; box-shadow: inset 0 0 0 1px var(--sep); pointer-events: none; }
  body.reactor-top .view-joy-slot, body.reactor-top .view-joystick :is(.view-tools, .dim-tools) { display: contents; }
  body.reactor-top .view-joystick :is(.view-joy-slot, .view-tools, .dim-tools)[hidden] { display: none; }
  body.reactor-top .view-joystick .view-joy-slot :is(.dock-dims, #measure, #view-menu, .view-hud-facades, .view-hud-fronts, .view-hud-unfold) {
    position: absolute; left: calc(50% + var(--dx, 0) * var(--joy-r) - var(--joy-b) / 2); top: calc(50% + var(--dy, -1) * var(--joy-r) - var(--joy-b) / 2);
    display: grid; place-items: center; width: var(--joy-b); min-width: var(--joy-b); height: var(--joy-b); margin: 0; padding: 0; gap: 0; border: 0; border-radius: 50%;
    background: transparent; box-shadow: none; color: var(--ink-2); font-size: 0; cursor: pointer; transition: background-color var(--joy-t) ease, color var(--joy-t) ease; }
  body.reactor-top .view-joystick .view-joy-slot :is(.dock-dims, #measure, #view-menu, .view-hud-facades, .view-hud-fronts, .view-hud-unfold)[hidden] { display: none; }
  body.reactor-top .view-joystick .view-joy-slot :is(.dock-dims, #measure, #view-menu, .view-hud-facades, .view-hud-fronts, .view-hud-unfold):hover { background: var(--fill); color: var(--ink); }
  body.reactor-top .view-joystick .view-joy-slot :is(.dock-dims, #measure, #view-menu, .view-hud-facades, .view-hud-fronts, .view-hud-unfold):is([aria-pressed="true"], [aria-expanded="true"]) { background: var(--accent-fill); color: var(--accent); }
  body.reactor-top .view-joystick .view-joy-slot :is(.dock-dims, #measure, #view-menu, .view-hud-facades, .view-hud-fronts, .view-hud-unfold):disabled { opacity: .45; cursor: default; }
  body.reactor-top .view-joystick .view-joy-slot :is(.dock-dims, #measure, #view-menu, .view-hud-facades, .view-hud-fronts, .view-hud-unfold):focus-visible { outline: 1.5px solid var(--accent); outline-offset: 1px; }
  body.reactor-top .view-joystick .view-joy-slot svg { width: 18px; height: 18px; stroke-width: 1.5; }
  body.reactor-top .view-joystick .dock-dims span, body.reactor-top .view-joystick :is(#measure, #view-menu) > .dock-tool-label { display: none; }
  body.reactor-top .view-joystick :is(#measure, #view-menu)::before { width: 18px; height: 18px; }
  body.reactor-top .view-joystick :is(#measure, #view-menu)::after { display: none; }
  body.reactor-top .view-joystick #measure { --dock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z'/%3E%3Cpath d='m14.5 12.5 2-2'/%3E%3Cpath d='m11.5 9.5 2-2'/%3E%3Cpath d='m8.5 6.5 2-2'/%3E%3Cpath d='m17.5 15.5 2-2'/%3E%3C/svg%3E"); }
  body.reactor-top .view-joystick #view-menu { --dock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='13.5' cy='6.5' r='1' fill='black'/%3E%3Ccircle cx='17.5' cy='10.5' r='1' fill='black'/%3E%3Ccircle cx='8.5' cy='7.5' r='1' fill='black'/%3E%3Ccircle cx='6.5' cy='12.5' r='1' fill='black'/%3E%3Cpath d='M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.93 0 1.65-.75 1.65-1.69 0-.44-.18-.84-.44-1.13-.29-.29-.44-.65-.44-1.13a1.64 1.64 0 0 1 1.67-1.67h2c3.05 0 5.56-2.5 5.56-5.55C21.97 6.01 17.46 2 12 2z'/%3E%3C/svg%3E"); }
  body.reactor-top .view-joystick .facade-slash { display: none; }
  body.reactor-top .view-joystick [aria-pressed="true"] .facade-slash { display: block; }
  /* шеврон меню «Размеров» — маленький кружок у значка снизу справа */
  body.reactor-top .view-joystick .view-joy-slot #dimensions { position: absolute; z-index: 1; left: calc(50% + var(--dx, 0) * var(--joy-r) + var(--joy-b) / 2 - 11px); top: calc(50% + var(--dy, -1) * var(--joy-r) + var(--joy-b) / 2 - 12px);
    display: grid; place-items: center; width: 15px; min-width: 15px; height: 15px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--card);
    box-shadow: 0 0 0 1px var(--sep); color: var(--ink-2); font-size: 0; cursor: pointer; transition: background-color var(--joy-t) ease, color var(--joy-t) ease; }
  body.reactor-top .view-joystick .view-joy-slot #dimensions::before { width: 11px; height: 11px; }
  body.reactor-top .view-joystick .view-joy-slot #dimensions:hover, body.reactor-top .view-joystick .view-joy-slot #dimensions[aria-expanded="true"] { background: var(--accent-fill); color: var(--accent); }
  /* центр — ракурс: подпись текущего, нажатие — другой */
  body.reactor-top .view-joy-angle { position: absolute; left: 50%; top: 50%; width: var(--joy-c); height: var(--joy-c); margin: calc(var(--joy-c) / -2) 0 0 calc(var(--joy-c) / -2); padding: 0;
    border: 0; border-radius: 50%; background: rgba(255,255,255,.72); box-shadow: 0 0 0 1px var(--sep); color: var(--ink); font: inherit; font-size: 11.5px; font-weight: 600; letter-spacing: -.01em;
    cursor: pointer; transition: background-color var(--joy-t) ease, color var(--joy-t) ease; }
  body.reactor-top .view-joy-angle:hover { background: var(--accent-fill); color: var(--accent); }
  body.reactor-top .view-joy-angle:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }
  /* подпись — слева от круга, на высоте значка */
  body.reactor-top .view-joy-tip { position: absolute; right: calc(100% + 10px); top: calc(50% + var(--dy, 0) * var(--joy-r)); transform: translateY(-50%); padding: 4px 9px; border-radius: 8px;
    background: var(--card); box-shadow: 0 0 0 1px var(--sep), 0 4px 14px rgba(30,24,16,.08); color: var(--ink); font-size: 12px; white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity var(--joy-t) ease; }
  body.reactor-top .view-joy-tip[data-show="true"] { opacity: 1; }
  body.reactor-top .view-joystick:has([data-open="true"]) .view-joy-tip { display: none; }
  /* меню «Размеры» и «Вид» — вверх-влево от джойстика (правый край — по краю круга, т. е. левее правой панели) */
  body.reactor-top .view-joystick .view-presets { top: auto; left: auto; right: 0; bottom: calc(100% + 10px); max-height: calc(100vh - var(--joy-d) - 60px); overflow-y: auto; transform-origin: bottom right; }
  body.reactor-top .view-joystick #measure-step:not([hidden]) { position: absolute; left: auto; right: calc(100% + 10px); top: 10px; bottom: auto; transform: none; }
  body.reactor-top .view-joystick #clear-measure:not([hidden]) { position: absolute; right: calc(100% + 10px); bottom: 10px; height: 32px; padding: 0 12px; border: 0; border-radius: 16px;
    background: var(--card); box-shadow: 0 0 0 1px var(--sep); color: var(--ink-2); font-size: 13px; white-space: nowrap; }
}
@media (min-width: 601px) and (max-width: 1024px) and (min-height: 501px) {
  body.reactor-top .view-hud { gap:4px; }
  body.reactor-top .view-joystick { --joy-d: 120px; --joy-r: 44px; --joy-b: 30px; --joy-c: 44px; --joy-i: 58px; }
  body.reactor-top .view-hud .view-hud-tool { gap:5px; padding:0 10px; }
  body.reactor-top .view-hud .view-hud-download { padding:0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  body.reactor-top .view-joystick { --joy-t: 0s; }
  body.reactor-top .view-joystick .view-presets { animation: none; }
}
/* Клиентская ссылка от 601 px (компьютер, планшет в обеих ориентациях; 11.11.2026): та же система капсул, что на телефоне —
   высота 44, радиус 22, кнопки 36 (касание — на всю высоту капсулы), отступ 12 + safe-area, нажатое — var(--accent-fill).
   Верх — одна капсула [Спереди | 3D] · Размеры · Замер (+ показ фасадов, если есть), а не две пилюли. Внизу у клиента
   пустая панель .toolbar (всё из неё уехало наверх или скрыто) — была точкой под .angle-pill, убрана; ракурсы опускаются к краю.
   После правил reactor-top: их ширины кнопок (36 / 32 до 1024 px) и высоты касания (52) перебиваются здесь. */
@media (min-width: 601px) and (min-height: 501px) {
  body[data-client="true"] { --float-edge: 12px; --float-shadow: 0 0 0 var(--hair) var(--sep), 0 4px 16px rgba(30,24,16,.10); }
  body[data-client="true"] .view-hud { top: calc(env(safe-area-inset-top) + var(--float-edge)); gap: 0; height: 44px; padding: 4px; border-radius: 22px; white-space: nowrap;
    background: var(--surface); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: var(--float-shadow); }
  body[data-client="true"] .view-hud > :is(.view-hud-pill, .view-hud-round) { height: 36px; padding: 0; gap: 2px; border-radius: 18px; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  body[data-client="true"] .view-hud > .view-hud-pill:empty { display: none; }
  body[data-client="true"] .view-hud > .view-hud-looks::before { content: ""; flex: none; width: 1px; height: 20px; margin: 0 4px; background: var(--sep); }
  /* только кнопки самой капсулы: пункты меню «Размеры» (.dim-menu .btn, галочка в ::after) не задеваются; у значков (#measure,
     #dimensions) шрифт 0 из dock-final остаётся — специфичность ниже id */
  body[data-client="true"] .view-hud > .view-hud-pill > .btn, body[data-client="true"] .view-hud > .btn { position: relative; height: 36px; min-width: 40px; padding: 0 11px; border-radius: 18px; color: var(--ink); font-size: 13px; font-weight: 500; }
  body[data-client="true"] .view-hud > .view-hud-pill > .btn[aria-pressed="true"], body[data-client="true"] .view-hud > .btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); font-weight: 500; }
  body[data-client="true"] .view-hud > .view-hud-pill > .btn::after { content: ""; position: absolute; inset: -4px 0; }   /* касание — на всю высоту капсулы */
  body[data-client="true"] .view-hud-looks :is(#measure, #dimensions)::after { content: ""; display: block; position: absolute; inset: -4px 0; font-size: 0; }
  body[data-client="true"] .view-hud-looks #dimensions { position: relative; }
  body[data-client="true"] .view-hud-looks :is(.dock-dims, #measure, #view-menu, .view-hud-facades, .view-hud-fronts, .view-hud-unfold) { width: 36px; min-width: 36px; padding: 0; }
  body[data-client="true"] .view-hud-looks #dimensions { width: 18px; min-width: 18px; padding: 0; }
  body[data-client="true"] .view-hud > .view-hud-round { width: 36px; min-width: 36px; padding: 0; }
  body[data-client="true"].reactor-top .toolbar { display: none !important; }
  body[data-client="true"] .angle-pill { bottom: calc(env(safe-area-inset-bottom) + var(--float-edge)); gap: 2px; height: 44px; padding: 4px; border-radius: 22px; box-shadow: var(--float-shadow); }
  body[data-client="true"] .angle-pill .btn { position: relative; height: 36px; min-width: 40px; padding: 0 11px; border-radius: 18px; color: var(--ink); font-size: 13px; font-weight: 500; }
  body[data-client="true"] .angle-pill .btn::after { content: ""; position: absolute; inset: -4px 0; }
  body[data-client="true"] .angle-pill .btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); }
  body[data-client="true"] .angle-pill .pill-fronts { color: var(--accent); }
  body[data-client="true"] .angle-pill .pill-fronts::before { top: 8px; bottom: 8px; }
}
/* Реактор, срез 2 (04.11.2026): крепёж полки «Съёмная / Жёсткая», у жёсткой — строка фурнитуры */
.rx-joint { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rx-joint .btn { justify-content: center; }
.rx-joint-hard { display: flex; gap: 6px; margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--accent-fill, #e2f0ee); }
.rx-joint-hard[hidden] { display: none; }
.rx-joint-hard .btn { flex: 1 1 0; min-height: 34px; font-size: 13px; }

/* Полка: спокойные связанные переключатели, одинаковый ритм полей и действий. */
:is(#shelf-sheet, .place-mock-sheet) .rx-joint { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--fill); }
:is(#shelf-sheet, .place-mock-sheet) .rx-joint .btn { min-width: 0; min-height: 40px; padding: 8px 10px; border-radius: 11px; background: transparent; color: var(--ink-2); font-weight: 600; line-height: 1.2; }
:is(#shelf-sheet, .place-mock-sheet) .rx-joint .btn[aria-pressed="true"] { background: var(--card); color: var(--accent); box-shadow: 0 1px 4px rgba(30,24,16,.12); }
:is(#shelf-sheet, .place-mock-sheet) .rx-joint-hard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; padding: 0; border: 0; }
:is(#shelf-sheet, .place-mock-sheet) .rx-joint-hard[hidden] { display: none; }
:is(#shelf-sheet, .place-mock-sheet) .rx-joint-hard .btn { min-width: 0; min-height: 38px; padding: 7px 4px; border-radius: 11px; background: var(--fill); color: var(--ink-2); font-weight: 500; line-height: 1.2; }
:is(#shelf-sheet, .place-mock-sheet) .rx-joint-hard .btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
:is(#shelf-sheet, .place-mock-sheet) :is(.rx-joint, .rx-joint-hard) .btn:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--accent-fill); color: var(--accent); }
:is(#shelf-sheet, .place-mock-sheet) :is(.rx-joint, .rx-joint-hard) .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#part-card[data-tab] #shelf-sheet .rx-joint-hard { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
#part-card[data-tab] #shelf-sheet :is(.rx-joint, .rx-joint-hard) .btn { align-items: center; justify-content: center; min-height: 40px; padding: 7px 4px; text-align: center; }
#part-card[data-tab] #shelf-sheet .rx-joint .btn[aria-pressed="true"] { background: var(--card); color: var(--accent); box-shadow: 0 1px 4px rgba(30,24,16,.12); }
#part-card[data-tab] #shelf-sheet .rx-joint-hard .btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
#shelf-body { gap: 12px; }
#shelf-body .shelf-joint-label { margin-top: 2px; }
#shelf-body .cut-gaps { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); align-items: end; gap: 8px; }
#shelf-body .cut-gaps:has(.cut-ratio[hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#shelf-body .cut-field { min-width: 0; gap: 6px; }
#shelf-body .cut-field input { min-height: 44px; font-variant-numeric: tabular-nums; }
#shelf-body .cut-center { align-self: stretch; min-height: 40px; margin: 0; border-radius: 12px; background: var(--accent-fill); color: var(--accent); font-weight: 600; }
#shelf-body .cut-center:hover:not(:disabled) { background: #d3e4e5; }
#shelf-body .cut-center:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#shelf-body .cut-range { margin: 0; color: var(--muted); }

/* Перегородка: одинаковая сетка крепежа до и после выбора отсека. */
:is(#partition-body .shelf-joints, .place-mock-sheet .shelf-joints:has([data-place-top]), .place-mock-sheet .shelf-joints:has([data-place-bottom])) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
:is(#partition-body .shelf-joints, .place-mock-sheet .shelf-joints:has([data-place-top]), .place-mock-sheet .shelf-joints:has([data-place-bottom])) .btn { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 40px; padding: 7px 4px; border-radius: 11px; background: var(--fill); color: var(--ink-2); font-weight: 500; line-height: 1.2; text-align: center; white-space: normal; }
:is(#partition-body .shelf-joints, .place-mock-sheet .shelf-joints:has([data-place-top]), .place-mock-sheet .shelf-joints:has([data-place-bottom])) .btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
:is(#partition-body .shelf-joints, .place-mock-sheet .shelf-joints:has([data-place-top]), .place-mock-sheet .shelf-joints:has([data-place-bottom])) .btn:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--accent-fill); color: var(--accent); }
:is(#partition-body .shelf-joints, .place-mock-sheet .shelf-joints:has([data-place-top]), .place-mock-sheet .shelf-joints:has([data-place-bottom])) .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#partition-body { gap: 12px; }
#partition-body .cut-gaps { grid-template-columns: minmax(0, 1fr) 0 minmax(0, 1fr); gap: 8px; }
#partition-body .cut-field { min-width: 0; gap: 6px; }
#partition-body .cut-field input { min-height: 44px; font-variant-numeric: tabular-nums; }
#partition-body .cut-center { align-self: stretch; min-height: 40px; margin: 0; border-radius: 12px; background: var(--accent-fill); color: var(--accent); font-weight: 600; }
#partition-body .cut-center:hover:not(:disabled) { background: #d3e4e5; }
#partition-body .cut-center:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#partition-body .cut-range { margin: 0; color: var(--muted); }


/* Реактор, срез 3 (04.11.2026): «‹» в крошках, явный выход из «Рисовать» */
:is(#part-crumbs, #bay-crumbs, #corpus-crumbs) .rx-back { display: inline-flex; align-items: center; height: 28px; min-height: 28px; margin: 0 8px 0 -2px; padding: 0 10px; border: 0; border-radius: 14px; background: var(--accent-fill, #e2f0ee); color: var(--accent, #0f7c78); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
:is(#part-crumbs, #bay-crumbs, #corpus-crumbs) .rx-back:hover { background: var(--accent, #0f7c78); color: #fff; }
.rx-draw-back { align-self: flex-start; margin: 0 0 6px -4px; padding: 4px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.rx-draw-back:hover { background: var(--fill, #eef0ee); color: var(--ink); }
.rx-draw-done { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: var(--hair, 1px) solid var(--sep, #e3e6e4); font-size: 12px; color: var(--muted); }
.rx-draw-done span { flex: 1; } .rx-draw-done b { display: block; font-size: 13px; color: var(--ink); }
.rx-draw-done .btn { min-height: 40px; padding: 0 18px; border: 0; border-radius: 20px; background: var(--accent); color: #fff; font-weight: 600; }
.insp-place[data-placed] .rx-draw-done { display: none; }
/* Конструктор, наполнение списком (04.11.2026) */
.cx-fill-sub { margin: 14px 0 2px; font-size: 12px; font-weight: 650; letter-spacing: .02em; color: var(--accent, #0f7c78); }
.cx-fill-drawers :is([data-param="count"], [data-param="shelves"]) { display: none !important; }

.project-list { transition: opacity .12s ease; }
.project-list[data-loading="true"] { opacity: .55; pointer-events: none; }
.project-skeleton { height: 58px; margin: 6px 8px; border-radius: 12px; background: var(--fill); opacity: .6; }
.project-breadcrumbs { padding: 8px 16px; color: var(--muted); font-size: 13px; }
.project-breadcrumbs[hidden] { display:none; }
.project-crumb { border:0; background:none; color:var(--accent); cursor:pointer; font:inherit; padding:3px; }

.project-stages { display:flex; gap:6px; padding:4px 16px 8px; overflow-x:auto; flex:none; }
.project-stages[hidden], .project-client[hidden] { display:none; }
.project-stage-filter { border:0; border-radius:14px; padding:6px 10px; background:var(--fill); color:var(--ink-2); white-space:nowrap; font:inherit; font-size:12px; cursor:pointer; }
.project-stage-filter[aria-pressed="true"] { background:var(--accent-fill); color:var(--accent); font-weight:600; }
.project-stage { align-self:flex-start; padding:2px 7px; border-radius:8px; font-size:11px; background:#e8eef8; color:#345b95; }
.project-stage[data-stage="1"] { background:#eee9f7; color:#6d4b92; }
.project-stage[data-stage="2"] { background:#e1f1e8; color:#267246; }
.project-stage[data-stage="3"] { background:#fff1d9; color:#956008; }
.project-stage[data-stage="4"] { background:#e6ecec; color:#435c5b; }
.project-client { padding:2px 16px 8px; display:flex; flex-wrap:wrap; gap:6px 12px; color:var(--muted); font-size:13px; }
.project-client a { color:var(--accent); }
.project-client details { width:100%; white-space:pre-wrap; }
.project-client details p { margin:4px 0; }
.project-client-form { display:grid; grid-template-columns:1fr 1fr; gap:8px; width:100%; }
.project-client-form label { display:grid; gap:3px; color:var(--ink-2); }
.project-client-form :is(input,textarea) { width:100%; box-sizing:border-box; border:1px solid var(--sep); border-radius:8px; padding:8px; font:inherit; background:var(--card); color:var(--ink); }
.project-client-form label:last-of-type { grid-column:1 / -1; }
/* the row's «…» menu (04.11): one row of equal icon buttons, ✕ at the end */
.project-confirm.project-actions { flex-wrap:nowrap; gap:6px; }
.project-confirm.project-actions .project-act { width:40px; min-width:40px; height:40px; padding:0; display:grid; place-items:center; color:var(--ink-2); }
.project-confirm.project-actions .project-act.project-confirm-yes { color:#b3261e; }
.project-list h3 { position:sticky; top:0; z-index:1; padding:5px 0; background:var(--surface); }
.project-dialog[data-tab="projects"] .project-row { min-height:64px; }
.project-dialog[data-tab="projects"] .project-row b { font-size:15px; }
.project-item-meta { margin-left:0; }
.project-dialog[data-tab="projects"] .project-folder-row { min-height:58px; }
.project-subfolder .project-folder-row svg { opacity:.65; }
.project-drop { outline:2px solid var(--accent); background:var(--accent-fill); }
.project-empty { padding:20px 12px; color:var(--muted); }
@media (max-width:600px) { .project-client-form { grid-template-columns:1fr; } .project-client-form label:last-of-type { grid-column:auto; } }

/* ===== Телефон ≤600 px (12.11.2026, mobile-actions.js ставит body.m-phone; клиентская ссылка — не сюда) =====
   «3D-просмотрщик в одну руку»: таблетки сверху (проект · аккаунт), одна панель снизу в зоне большого пальца, шторки снизу.
   Общие классы (.m-surface, .m-pill, .m-bar, .m-bar-btn, .m-chip) и переменные --m-* — переиспользуемые: потом ими же
   приведём кнопки клиентской ссылки к одному виду. Сейчас клиентскую ссылку не перекрашиваем. */
:root { --m-edge: 12px; --m-pill-h: 40px; --m-radius: 20px; --m-bar-h: 60px; --m-note-h: 0px; --m-anim: .18s;
  --m-shadow: 0 0 0 var(--hair) var(--sep), 0 4px 16px rgba(30,24,16,.10); --m-scrim: rgba(20,16,10,.2); }
@media (prefers-reduced-motion: reduce) { :root { --m-anim: 0s; } }
.m-surface { background: var(--surface); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6); box-shadow: var(--m-shadow); }
body.m-phone { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body.m-phone :is(.m-pill, .m-bar, .m-measure, .m-sheet, .m-scrim, .account-pill, .account-sheet) { -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.m-phone :is(.m-pill, .m-bar, .m-measure, .m-scrim, .account-pill, .m-sheet-grip, .m-sheet-head) { touch-action: none; }   /* щипок по панели — не масштаб страницы */
body.m-phone :is(.m-sheet, .account-sheet) { touch-action: pan-y; }
/* что на телефоне не нужно: верхняя капсула и панель проекта, чат, «Рисовать», «Конструктор», карточки деталей, джойстик */
body.m-phone :is(.toolbar, .angle-pill, .view-hud, .view-joystick, .download-compact, .project-pill, .chat-launch, .part-dock, .draw-tools) { display: none !important; }
/* сцена — от верха до шторки: открытая шторка ужимает её (как каталог материалов), а не перекрывает */
body.m-phone #stage { bottom: var(--m-sheet-h, 0px); }
body.m-phone[data-start="true"] :is(.m-bar, .m-measure) { display: none; }
/* ---- таблетки сверху: одна высота, одно скругление ---- */
.m-pill { position: absolute; z-index: 30; top: calc(env(safe-area-inset-top) + var(--m-edge)); height: var(--m-pill-h); margin: 0; border: 0;
  border-radius: var(--m-radius); color: var(--ink); font: inherit; cursor: pointer; }
.m-pill::after { content: ""; position: absolute; inset: -3px -2px; }   /* касание ≥44 px */
.m-pill:active { background: rgba(255,255,255,.96); }
.m-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.m-project { left: calc(env(safe-area-inset-left) + var(--m-edge)); display: flex; align-items: center; gap: 5px; padding: 0 10px 0 15px;
  max-width: calc(100% - 3 * var(--m-edge) - var(--m-pill-h) - env(safe-area-inset-left) - env(safe-area-inset-right)); font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.m-project-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-project-ver { flex: none; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-project-ver:empty { display: none; }
.m-project svg { flex: none; margin-left: -1px; color: var(--muted); }
body.m-phone .account-pill { top: calc(env(safe-area-inset-top) + var(--m-edge)); right: calc(env(safe-area-inset-right) + var(--m-edge)); z-index: 30;
  width: var(--m-pill-h); height: var(--m-pill-h); max-width: none; padding: 0; gap: 0; justify-content: center; border-radius: var(--m-radius); box-shadow: var(--m-shadow); }
body.m-phone .account-pill .account-name { display: none; }
body.m-phone .account-pill .account-avatar { width: 32px; height: 32px; }
body.m-phone .account-dot { left: 28px; }
body.m-phone[data-debug="true"] .account-pill { top: calc(env(safe-area-inset-top) + var(--m-edge)); }
/* ---- нижняя панель ---- */
.m-bar { position: absolute; z-index: 30; left: calc(env(safe-area-inset-left) + var(--m-edge)); right: calc(env(safe-area-inset-right) + var(--m-edge));
  bottom: calc(env(safe-area-inset-bottom) + 10px); display: flex; gap: 2px; height: var(--m-bar-h); padding: 4px; border-radius: 22px; }
.m-bar-btn { flex: 1 1 0; min-width: 44px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  margin: 0; padding: 0 2px; border: 0; border-radius: 18px; background: transparent; color: var(--ink); font: inherit; font-size: 11px; font-weight: 500;
  line-height: 1.1; cursor: pointer; transition: background-color .15s, color .15s; }
.m-bar-btn svg { flex: none; }
.m-bar-btn .m-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-bar-btn:active { background: var(--fill); }
.m-bar-btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); }
.m-bar-btn:disabled { color: var(--muted); opacity: .45; }
.m-bar-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* ---- замер: шаги над панелью (место под тонкую строку-плашку — --m-note-h, следующая задача) ---- */
.m-measure { position: absolute; z-index: 30; left: calc(env(safe-area-inset-left) + var(--m-edge)); right: calc(env(safe-area-inset-right) + var(--m-edge));
  bottom: calc(env(safe-area-inset-bottom) + 10px + var(--m-bar-h) + 8px + var(--m-note-h)); display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 4px 0 12px; border-radius: 22px; color: var(--ink); font-size: 13px; }
.m-measure[hidden] { display: none; }
.m-measure > svg { flex: none; color: var(--accent); }
.m-measure-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-chip { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: var(--fill); color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.m-chip[hidden] { display: none; }
.m-chip-accent { background: var(--accent-fill); color: var(--accent); }
/* ---- шторки ---- */
.m-scrim { position: fixed; inset: 0; z-index: 60; background: var(--m-scrim); animation: m-fade var(--m-anim) ease-out; }
.m-scrim[hidden] { display: none; }
@keyframes m-fade { from { opacity: 0; } }
.m-sheet { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; max-height: 72dvh;
  padding: 0 0 max(12px, env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--card); color: var(--ink);
  box-shadow: 0 -1px 0 var(--hair) var(--sep), 0 -8px 28px rgba(30,24,16,.12); transform: translateY(100%); transition: transform var(--m-anim) cubic-bezier(.2,.8,.2,1); }
.m-sheet[hidden] { display: none; }
.m-sheet[data-open="true"] { transform: none; }
.m-sheet-grip, body.m-phone .account-sheet::before { flex: none; display: block; width: 36px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--sep); content: ""; }
.m-sheet-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 6px 2px 18px; }
.m-sheet-head strong { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.m-sheet-close { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22px; background: transparent; color: var(--muted); cursor: pointer; }
.m-sheet-close:active { background: var(--fill); }
.m-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 4px; }
.m-section[hidden], .m-tiles[hidden], .m-rows[hidden] { display: none; }
.m-section + .m-section { margin-top: 6px; }
.m-section-title { margin: 10px 6px 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.m-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 68px; margin: 0; padding: 8px 2px;
  border: 0; border-radius: 14px; background: var(--fill); color: var(--ink); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.m-tile[hidden], .m-row[hidden] { display: none; }
.m-tile:active { background: var(--fill-press); }
.m-tile[aria-pressed="true"] { background: var(--accent-fill); color: var(--accent); box-shadow: inset 0 0 0 1.5px rgba(35,93,103,.35); }
.m-tile:disabled, .m-row:disabled { opacity: .45; }
.m-rows { display: flex; flex-direction: column; }
.m-row { display: flex; align-items: center; gap: 14px; min-height: 50px; margin: 0; padding: 0 8px; border: 0; border-radius: 12px; background: transparent;
  color: var(--ink); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.m-row svg { flex: none; color: var(--ink-2); }
.m-row .m-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row .m-hint { flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.m-row:active { background: var(--fill); }
.m-row[aria-pressed="true"], .m-row[aria-pressed="true"] svg { color: var(--accent); }
:is(.m-tile, .m-row):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* шторка аккаунта — та же: снизу, ручка, над затемнением */
body.m-phone .account-sheet { z-index: 61; max-height: 80dvh; overflow-y: auto; animation: m-rise var(--m-anim) cubic-bezier(.2,.8,.2,1); }
@keyframes m-rise { from { transform: translateY(100%); } }
/* ===== Телефон, этап 2 (13.11.2026) ===== */
/* подложки читаются на светлом полу сцены: плотнее фон, чуть глубже тень; одно скругление у таблеток, панели и строк */
body.m-phone .m-surface, body.m-phone .account-pill { background: rgba(255,255,255,.9); }
:root { --m-shadow: 0 0 0 var(--hair) rgba(30,24,16,.14), 0 4px 16px rgba(30,24,16,.14); }
.m-bar, .m-measure { border-radius: var(--m-radius); }
.m-bar-btn { border-radius: 16px; }
/* форма «Постройте свой шкаф» (demo-ui.js): снизу, три поля и кнопка, ≤40% экрана; пример над ней (сцена ужата, без затемнения);
   клавиатура поднимает форму (--m-kb из visualViewport), сцена и панель на месте */
.demo-phone-title { display: none; }
body.m-phone .demo-card { top: auto; bottom: var(--m-kb, 0px); max-height: 40dvh; gap: 10px; padding: 14px 16px calc(12px + env(safe-area-inset-bottom)); transition: bottom .12s ease-out; }
body.m-phone .demo-card :is(.demo-title, .demo-lead, .demo-build-title, .demo-minute, .demo-example, .demo-perks, .demo-fi) { display: none; }
body.m-phone .demo-phone-title { display: block; padding-right: 40px; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
body.m-phone .demo-build { gap: 10px; padding: 0; border: 0; background: none; }
body.m-phone .demo-fields label { gap: 4px; font-size: 12px; }
body.m-phone .demo-fields input { height: 44px; }
body.m-phone .demo-card .btn { height: 48px; }
body.m-phone .demo-x { top: 4px; right: 4px; width: 44px; height: 44px; }
body.m-phone .demo-help { left: calc(env(safe-area-inset-left) + var(--m-edge)); bottom: calc(env(safe-area-inset-bottom) + 10px + var(--m-bar-h) + 8px); height: var(--m-pill-h); border-radius: var(--m-radius); }
body.m-phone[data-welcome="open"] :is(.m-bar, .m-measure, .m-note, .m-info, .demo-help) { display: none; }
/* плашка над панелью: строка текста + кнопка, ✕ сворачивает в ⓘ справа над панелью */
.m-note { position: absolute; z-index: 30; left: calc(env(safe-area-inset-left) + var(--m-edge)); right: calc(env(safe-area-inset-right) + var(--m-edge));
  bottom: calc(env(safe-area-inset-bottom) + 10px + var(--m-bar-h) + 8px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 4px 6px; padding: 6px 4px 6px 14px; border-radius: var(--m-radius); color: var(--ink); animation: m-fade var(--m-anim) ease-out; }
.m-note[hidden], .m-info[hidden] { display: none; }
.m-note-text { grid-column: 1 / -1; padding: 2px 10px 0 0; font-size: 12px; line-height: 1.3; color: var(--ink-2); }   /* вся ширина: одна строка и на 360 px */
.m-note-go { grid-column: 1; justify-self: start; max-width: 100%; white-space: nowrap; font-weight: 600; }
.m-note-close { grid-column: 2; grid-row: 2; position: relative; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 18px; background: transparent; color: var(--muted); cursor: pointer; }
.m-note-close::after, .m-info::after { content: ""; position: absolute; inset: -4px; }   /* касание ≥44 px */
.m-note-close:active { background: var(--fill); }
.m-info { position: absolute; z-index: 30; right: calc(env(safe-area-inset-right) + var(--m-edge)); bottom: calc(env(safe-area-inset-bottom) + 10px + var(--m-bar-h) + 8px);
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 18px; color: var(--accent); cursor: pointer; }
.m-info:active { background: #fff; }
:is(.m-note-go, .m-note-close, .m-info):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.m-phone[data-m-measure="true"] .m-info, body.m-phone[data-m-sheet="open"] :is(.m-note, .m-info) { display: none; }
/* низкий экран (телефон боком в окне ≤600 px): панель — только иконки, шторки и форма — не выше экрана */
@media (max-width: 600px) and (max-height: 500px) {
  :root { --m-bar-h: 52px; }
  .m-bar-btn .m-label { display: none; }
  body.m-phone .demo-card { max-height: 60dvh; }
}
/* загрузка: вместо пустого кадра — лёгкий индикатор по центру (до первого кадра модели; клиентская ссылка — без изменений) */
@media (max-width: 600px) {
  body:not([data-client="true"]):not([data-viewer-ready]) #stage:not(:has(.err))::after { content: ""; position: absolute; left: 50%; top: 50%; width: 28px; height: 28px;
    margin: -14px 0 0 -14px; box-sizing: border-box; border-radius: 50%; border: 2.5px solid rgba(35,93,103,.16); border-top-color: var(--accent); animation: m-spin .8s linear infinite; pointer-events: none; }
}
@keyframes m-spin { to { transform: rotate(360deg); } }
