/* PicSeller 2.0 — стили модуля «Редактор материала» (js/screens/editor.js, #/editor/:id, раскладка focus). Классы только с префиксом ed-.
   Нижняя панель на телефоне сообщается ядру через App.bottomBar — плашка и тосты поднимаются над ней сами.
   Module "editor" styles: layout, canvas, panels, sheets. Tokens and components come from base.css. */

/* ==================================================================
   1. Раскладка / Layout
   ================================================================== */
.ed-screen { --ed-rail: 84px; --ed-fly: 300px; --ed-right: 340px; --ed-strip: 120px; }
.ed-top { gap: 6px; padding: 0 12px 0 8px; }
.ed-tb { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; max-width: 340px; }
.ed-top .ed-name { font-size: 14.5px; line-height: 1.15; }
.ed-status { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; max-width: 100%; padding: 0; border: 0; background: none; color: var(--muted); font: 500 12px/1.2 var(--font); white-space: nowrap; cursor: pointer; }
.ed-status .i { color: var(--ok); flex: none; }
.ed-status:hover { color: var(--ink); }
.ed-status:hover span { text-decoration: underline; text-underline-offset: 2px; }
.ed-spin { width: 12px; height: 12px; border-width: 1.5px; color: var(--muted); }
.ed-hist { display: inline-flex; gap: 2px; }
.ed-mp > button { min-width: 52px; }
.ed-score { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px 0 9px; border: 1px solid transparent; border-radius: var(--r-pill); font: 600 13px/1 var(--font); white-space: nowrap; cursor: pointer; transition: filter .15s; }
.ed-score b { font: 800 14px/1 var(--font-head); }
.ed-score.is-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.ed-score.is-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.ed-score.is-err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 25%, transparent); }
.ed-score:hover { filter: brightness(.97); }
.ed-hb { height: 36px; padding: 0 12px; gap: 6px; }
.ed-pub { height: 36px; padding: 0 14px; gap: 7px; }
.ed-mbar { display: none; }

.ed-body { position: relative; display: grid; grid-template-columns: var(--ed-rail) minmax(0, 1fr) var(--ed-right); grid-template-rows: minmax(0, 1fr); min-height: 0; }
.ed-body.has-fly { grid-template-columns: var(--ed-rail) var(--ed-fly) minmax(0, 1fr) var(--ed-right); }
.ed-fly[hidden] { display: none; }

/* Рейка инструментов / Tool rail (низ свободен под пилюлю макета / bottom kept free for the mock pill) */
.ed-rail { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-height: 0; padding: 10px 8px 64px; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); scrollbar-width: none; }
.ed-rail::-webkit-scrollbar { display: none; }
.ed-rail-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 60px; padding: 8px 2px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink-2); font: 600 12px/1.15 var(--font); text-align: center; cursor: pointer; transition: background-color .15s, color .15s; }
.ed-rail-btn .i { color: var(--muted); transition: color .15s; }
.ed-rail-btn:hover { background: var(--surface-2); color: var(--ink); }
.ed-rail-btn:hover .i { color: var(--ink); }
.ed-rail-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); }
.ed-rail-btn[aria-pressed="true"] .i { color: var(--primary); }

/* Выезжающая панель / Flyout */
.ed-fly { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); border-right: 1px solid var(--line); }
.ed-fly-head, .ed-rhead { flex: none; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); }
.ed-fly-title, .ed-rhead-t { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; font: 700 15px/1.2 var(--font-head); color: var(--ink); }
.ed-fly-title .i, .ed-rhead-t .i { color: var(--primary); }
.ed-fly-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px 24px; }

/* ==================================================================
   2. Центр: полоса слайда, холст, лента / Center: bar, canvas, strip
   ================================================================== */
.ed-center { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.ed-stagebar { flex: none; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px 0 18px; background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); min-width: 0; }
.ed-sb-l { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ed-sb-l b { color: var(--ink); font-weight: 700; }
.ed-sb-of { color: var(--muted); }
.ed-sb-sel { color: var(--sel); font-weight: 600; }
.ed-sb-l .badge { margin-left: 6px; }
.ed-snapbtn { color: var(--muted); }
.ed-snapbtn[aria-pressed="true"] { color: var(--primary); background: var(--primary-soft); }
.ed-safe { font-size: 13px; color: var(--ink-2); margin-left: 6px; }
.ed-safe input { width: 32px; height: 18px; }
.ed-safe input::after { width: 12px; height: 12px; }
.ed-safe input:checked::after { transform: translateX(14px); }

.ed-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; padding: 44px; background-color: var(--bg); background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 0); background-size: 22px 22px; }
.ed-board { position: relative; flex: none; margin: auto; background: #fff; border-radius: 3px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent), 0 14px 36px rgba(20, 36, 28, .14), 0 2px 6px rgba(20, 36, 28, .08); touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
.ed-board.is-kbd:focus { box-shadow: 0 0 0 2px var(--focus), 0 14px 36px rgba(20, 36, 28, .14); }
.ed-board.is-preview { box-shadow: 0 0 0 2px var(--info), 0 14px 36px rgba(20, 36, 28, .14); }
.ed-art, .ed-art > svg { display: block; width: 100%; height: 100%; }
.ed-art > svg { border-radius: 3px; }

/* Рамка выделения: ручки для мыши поверх ручек Art.scene / hit areas over Art.scene handles */
.ed-hs { position: absolute; pointer-events: none; }
.ed-h { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; pointer-events: auto; border-radius: 4px; }
.ed-h-nw { left: 0; top: 0; cursor: nwse-resize; } .ed-h-n { left: 50%; top: 0; cursor: ns-resize; } .ed-h-ne { left: 100%; top: 0; cursor: nesw-resize; }
.ed-h-e { left: 100%; top: 50%; cursor: ew-resize; } .ed-h-se { left: 100%; top: 100%; cursor: nwse-resize; } .ed-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.ed-h-sw { left: 0; top: 100%; cursor: nesw-resize; } .ed-h-w { left: 0; top: 50%; cursor: ew-resize; }
.ed-hs.is-locked .ed-h { cursor: not-allowed; }
@media (pointer: coarse) { .ed-h { width: 30px; height: 30px; margin: -15px 0 0 -15px; } }

/* Панель над выделением / Floating selection toolbar */
.ed-ctx { position: absolute; z-index: 4; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); white-space: nowrap; animation: popIn .12s ease; }
.ed-ctx-role { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; margin-right: 2px; border-radius: 8px; background: color-mix(in srgb, var(--sel) 12%, var(--surface)); color: var(--sel); font: 700 12px/1 var(--font); }
.ed-ctx-b { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.ed-ctx-b:hover { background: var(--surface-2); color: var(--ink); }
.ed-ctx-ai { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: var(--accent-soft); color: var(--ink); font: 600 13px/1 var(--font); cursor: pointer; }
.ed-ctx-ai .i { color: var(--primary); }
.ed-ctx-ai:hover { background: var(--accent); color: var(--on-accent); }
.ed-ctx-sep { width: 1px; height: 20px; margin: 0 3px; background: var(--line); }

.ed-meas { position: absolute; z-index: 5; transform: translateX(-50%); padding: 4px 8px; border-radius: 6px; background: var(--sel); color: #fff; font: 600 12px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.ed-pend { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); color: var(--ink-2); font-size: 13px; }
.ed-pend[hidden] { display: none; }
.ed-pend b { font: 700 15px/1.2 var(--font-head); color: var(--ink); }
.ed-pend .spinner { width: 22px; height: 22px; color: var(--primary); }
.ed-inline { position: absolute; z-index: 6; margin: 0; padding: 0; border: 0; background: color-mix(in srgb, #ffffff 35%, transparent); outline: 2px solid var(--sel); outline-offset: 3px; border-radius: 2px; resize: none; overflow: hidden; white-space: pre-wrap; box-sizing: content-box; caret-color: var(--sel); }

/* Просмотр версии / Version preview bar */
.ed-vbar { position: absolute; top: 58px; left: 50%; z-index: 8; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 6px 6px 6px 14px; border-radius: var(--r-pill); background: var(--toast-bg); color: var(--toast-fg); box-shadow: var(--shadow-3); font-size: 13px; animation: popIn .15s ease; }
.ed-vbar[hidden] { display: none; }
.ed-vbar-t { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ed-vbar-l { opacity: .8; }
.ed-vbar .btn { height: 30px; border-radius: var(--r-pill); }
.ed-vbar .ed-vbar-x { --btn-bg: transparent; --btn-fg: var(--toast-fg); --btn-bd: color-mix(in srgb, var(--toast-fg) 30%, transparent); --btn-bg-h: color-mix(in srgb, var(--toast-fg) 12%, transparent); }

/* Масштаб / Zoom */
.ed-zoom { position: absolute; right: 16px; bottom: calc(var(--ed-strip) + 14px); z-index: 6; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); }
.ed-zb, .ed-zv, .ed-zfit { display: inline-flex; align-items: center; justify-content: center; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 600 12.5px/1 var(--font); cursor: pointer; }
.ed-zb { width: 30px; }
.ed-zv { min-width: 52px; padding: 0 6px; color: var(--ink); }
.ed-zfit { padding: 0 10px; }
.ed-zfit[aria-pressed="true"] { color: var(--primary); }
.ed-zb:hover, .ed-zv:hover, .ed-zfit:hover { background: var(--surface-2); color: var(--ink); }
.ed-zsep { width: 1px; height: 18px; margin: 0 2px; background: var(--line); }

/* Лента слайдов / Slide strip */
.ed-strip { flex: none; height: var(--ed-strip); background: var(--surface); border-top: 1px solid var(--line); min-width: 0; }
.ed-strip-in { display: flex; align-items: center; gap: 12px; height: 100%; padding: 0 16px 0 28px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.ed-th { position: relative; flex: none; height: 88px; }
.ed-th-btn { position: relative; display: block; height: 100%; padding: 0; overflow: hidden; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ed-th-btn > svg { width: 100%; height: 100%; }
.ed-th-btn:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line-2)); }
.ed-th.is-on .ed-th-btn { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.ed-th-n { position: absolute; left: 5px; bottom: 5px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 6px; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); font: 700 12px/1 var(--font); box-shadow: var(--shadow-1); pointer-events: none; }
.ed-th.is-on .ed-th-n { background: var(--primary); color: var(--on-primary); }
.ed-th-more { position: absolute; top: 4px; right: 4px; display: inline-grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1); opacity: 0; cursor: pointer; transition: opacity .12s; }
.ed-th:hover .ed-th-more, .ed-th-more:focus-visible, .ed-th-more[aria-expanded="true"] { opacity: 1; }
.ed-th-wait { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--primary); }
.ed-th.is-drag { opacity: .45; }
.ed-th.drop-before::before, .ed-th.drop-after::after { content: ''; position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--primary); }
.ed-th.drop-before::before { left: -8px; }
.ed-th.drop-after::after { right: -8px; }
.ed-th-add { flex: none; height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; border: 1.5px dashed var(--line-2); border-radius: 6px; background: transparent; color: var(--muted); font: 600 12px/1 var(--font); cursor: pointer; }
.ed-th-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ==================================================================
   3. Правая панель / Right panel
   ================================================================== */
.ed-right { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); border-left: 1px solid var(--line); }
.ed-rtabs { flex: none; display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); }
.ed-rtab { position: relative; flex: 1 1 auto; height: 42px; padding: 0 6px; border: 0; background: none; color: var(--muted); font: 600 13px/1 var(--font); white-space: nowrap; cursor: pointer; }
.ed-rtab:hover { color: var(--ink); }
.ed-rtab.is-on { color: var(--ink); }
.ed-rtab.is-on::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.ed-rtab.has-warn::before { content: ''; position: absolute; top: 9px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }
.ed-rbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 16px 28px; }

/* Общие элементы панелей / Shared panel parts */
.ed-hint { display: block; margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.ed-hint .i { vertical-align: -2px; margin-right: 4px; }
p.ed-hint { margin: 0 0 12px; }
.ed-note { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.ed-note > .i { flex: none; margin-top: 1px; color: var(--info); }
.ed-note.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.ed-note.warn > .i { color: var(--warn); }
.ed-sec-t { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 10px; font: 700 12px/1.2 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ed-sec-t:first-child { margin-top: 2px; }
.ed-sec-prod { justify-content: flex-start; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 13px; }
.ed-count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font: 600 12px/1 var(--font); letter-spacing: 0; text-transform: none; }
.ed-src { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font: 500 12px/1 var(--font); white-space: nowrap; }
.ed-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--primary); font: 600 12.5px/1.2 var(--font); cursor: pointer; }
.ed-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.ed-mono { font-family: var(--mono); font-size: 12.5px; }

/* Инспектор / Inspector */
.ed-ih { display: flex; align-items: center; gap: 8px; min-width: 0; margin: -2px 0 14px; }
.ed-role-chip { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 26px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--sel) 12%, var(--surface)); color: var(--sel); font: 700 12.5px/1 var(--font); }
.ed-ih-name { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--muted); }
.ed-ih-acts { display: inline-flex; flex: none; gap: 0; margin-right: -6px; }
.ed-field { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; min-width: 0; }
.ed-lbl { display: flex; align-items: center; gap: 6px; font: 600 12.5px/1.2 var(--font); color: var(--ink-2); }
.ed-lbl-v { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-weight: 600; color: var(--muted); }
.ed-lbl .ed-link { margin-left: 8px; }
.ed-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ed-two > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ed-two .seg { width: 100%; }
.ed-two .seg > button { flex: 1 1 0; padding: 0 6px; }
.ed-ta { min-height: 64px; font-size: 14px; }
.ed-factline { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.ed-factline > .i { flex: none; margin-top: 2px; color: var(--ok); }
.ed-range-row { display: flex; align-items: center; gap: 10px; }
.ed-range { -webkit-appearance: none; appearance: none; flex: 1 1 auto; min-width: 0; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; }
.ed-range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
.ed-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); box-shadow: var(--shadow-1); }
.ed-range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
.ed-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); }
.ed-range:focus-visible { outline: none; }
.ed-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.ed-numwrap { position: relative; flex: none; width: 74px; }
.ed-num { padding-right: 26px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.ed-num::-webkit-outer-spin-button, .ed-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ed-unit { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
.ed-sws { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ed-sw { position: relative; display: inline-block; flex: none; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); background: var(--sw); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.ed-sw:hover { transform: scale(1.08); }
.ed-sw.is-on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary); }
.ed-sw-own { overflow: hidden; background: conic-gradient(from 0deg, #c46a3e, #e9c46a, #6fa36b, #4f8fc0, #8b6bb8, #c46a3e); }
.ed-sw-own.is-on { background: var(--sw); }
.ed-sw-own input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ed-all { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.ed-all .switch { font-weight: 600; font-size: 13.5px; }
.ed-sw-all { margin-top: 2px; font-size: 13px; }
.ed-geo { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.ed-geo > summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; font: 600 13px/1.2 var(--font); color: var(--ink-2); }
.ed-geo > summary::-webkit-details-marker { display: none; }
.ed-geo > summary .ed-hint { margin-left: auto; }
.ed-geo[open] > summary { margin-bottom: 12px; }
.ed-geo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ed-geo-f { display: flex; flex-direction: column; gap: 4px; font: 600 12px/1 var(--font); color: var(--muted); }
.ed-geo-f .ed-num { padding: 0 6px; }

/* Фото в инспекторе / Photo inspector */
.ed-phcur { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.ed-phcur-art { display: block; flex: none; width: 64px; height: 64px; border-radius: 10px; background: #EEE8DD; overflow: hidden; }
.ed-phcur-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; color: var(--muted); }
.ed-phcur-t b { color: var(--ink); font-weight: 600; font-size: 14px; }
.ed-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.ed-tool { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 600 13px/1.2 var(--font); cursor: pointer; text-align: left; }
.ed-tool .i { color: var(--primary); flex: none; }
.ed-tool:hover { border-color: var(--primary); background: var(--primary-soft); }
.ed-tool:disabled { opacity: .55; cursor: progress; }
.ed-run { margin: 0 0 14px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.ed-state { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 8px 8px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.ed-state > .i { color: var(--ok); flex: none; }
.ed-state > span { flex: 1; min-width: 0; }
.ed-mask { margin: 0 0 14px; font-size: 13px; }

/* Ничего не выбрано / Nothing selected */
.ed-vsw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ed-vs { display: flex; align-items: center; gap: 8px; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink-2); font: 600 12.5px/1 var(--font); cursor: pointer; }
.ed-vs i { flex: none; width: 18px; height: 18px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); box-shadow: inset 0 0 0 1px color-mix(in srgb, #000 12%, transparent); position: relative; }
.ed-vs i::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%; background: var(--c); border: 1.5px solid var(--surface); }
.ed-vs span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-vs:hover { border-color: var(--primary); color: var(--ink); }
.ed-vs.is-on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.ed-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ed-preset { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink-2); font: 600 12px/1.2 var(--font); text-align: center; cursor: pointer; }
.ed-preset-art { display: block; overflow: hidden; border-radius: 5px; background: var(--surface-2); }
.ed-preset-art > svg, .ed-tpl-art > svg, .ed-var-art > svg, .ed-rs-art > svg, .ed-exp-art > svg, .ed-ba-art > svg, .ed-msl-art > svg, .ed-scn-art > svg, .ed-crop-art > svg, .ed-show-th > svg, .ed-show-art > svg, .ed-ph-art > svg { display: block; width: 100%; height: 100%; }
.ed-preset:hover { border-color: var(--primary); }
.ed-preset.is-on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); color: var(--primary); }
.ed-brandbox .btn { margin-top: 2px; }
.ed-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.ed-brand-dots { display: inline-flex; }
.ed-brand-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface-2); margin-left: -5px; box-shadow: 0 0 0 1px color-mix(in srgb, #000 10%, transparent); }
.ed-brand-dots i:first-child { margin-left: 0; }
.ed-brand-f { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ed-brand-f b { font-weight: 600; font-size: 15px; color: var(--ink); }
.ed-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-roles .ed-count { margin-left: 2px; height: 16px; min-width: 16px; padding: 0 4px; font-size: 12px; }

/* ==================================================================
   4. Левые панели / Left panels
   ================================================================== */
.ed-tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ed-tpl { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.ed-tpl-art { display: block; overflow: hidden; border-radius: 8px; border: 1px solid var(--line-2); transition: border-color .15s, box-shadow .15s; }
.ed-tpl:hover .ed-tpl-art { border-color: var(--primary); }
.ed-tpl.is-on .ed-tpl-art { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.ed-tpl-name { margin-top: 4px; font: 600 13px/1.25 var(--font); }
.ed-tpl-name .badge { height: 18px; padding: 0 6px; font-size: 12px; }
.ed-tpl-meta { font-size: 12px; line-height: 1.35; color: var(--muted); }
.ed-tpl-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.ed-phs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ed-ph { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink-2); font: 600 12px/1.25 var(--font); text-align: left; cursor: pointer; }
.ed-ph-art { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; border: 1px solid var(--line-2); transition: border-color .15s; }
.ed-ph:hover .ed-ph-art { border-color: var(--primary); }
.ed-ph-b { position: absolute; top: 6px; left: 6px; }
.ed-ph.is-dark { color: var(--muted); }
.ed-addt { display: flex; flex-direction: column; gap: 8px; }
.ed-addt-b { display: flex; align-items: center; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.ed-addt-b:hover { border-color: var(--primary); background: var(--primary-soft); }
.ed-addt-h { font: 600 21px/1.15 var(--font-brand-head); }
.ed-addt-s { font: 500 15px/1.3 var(--font-brand); }
.ed-addt-c span { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: var(--r-pill); background: #fff; color: #1F2622; font: 500 13px/1 var(--font-brand); box-shadow: 0 0 0 1px #E4DBCB; }
.ed-facts { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ed-fact { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 500 13.5px/1.35 var(--font); text-align: left; cursor: pointer; }
.ed-fact:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.ed-fact:disabled { cursor: not-allowed; color: var(--muted); background: var(--surface-2); }
.ed-els-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-el-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border: 0; border-radius: var(--r-pill); background: var(--c-bg); color: var(--c-fg); box-shadow: 0 0 0 1px color-mix(in srgb, #000 10%, transparent); font: 500 13px/1 var(--font-brand); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.ed-el-chip:hover { transform: translateY(-1px); box-shadow: 0 0 0 1.5px var(--primary); }
.ed-els-stamps { display: flex; flex-wrap: wrap; gap: 12px; }
.ed-el-stamp { display: grid; place-items: center; width: 78px; height: 78px; padding: 0; border: 0; border-radius: 50%; background: var(--c-bg); color: var(--c-fg); font: 700 12px/1.12 var(--font-brand); letter-spacing: .04em; text-align: center; transform: rotate(-10deg); cursor: pointer; box-shadow: inset 0 0 0 4px var(--c-bg), inset 0 0 0 5px color-mix(in srgb, var(--c-fg) 55%, transparent); transition: transform .12s; }
.ed-el-stamp:hover { transform: rotate(-10deg) scale(1.06); }
.ed-els-shapes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ed-el-shape { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; padding: 8px 6px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink-2); font: 600 12px/1.2 var(--font); cursor: pointer; text-align: center; }
.ed-el-shape:hover { border-color: var(--primary); color: var(--ink); }
.ed-el-shape i { flex: none; display: grid; place-items: center; width: 28px; height: 28px; }
.ed-sh-rect::before { content: ''; width: 26px; height: 18px; border-radius: 4px; background: #DDD0BA; }
.ed-sh-circle::before { content: ''; width: 24px; height: 24px; border-radius: 50%; background: #C46A3E; }
.ed-sh-line::before { content: ''; width: 26px; height: 3px; border-radius: 2px; background: var(--ink); }
.ed-vars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 4px; }
.ed-var { display: flex; flex-direction: column; gap: 5px; padding: 0; border: 0; background: none; color: var(--ink-2); font: 600 12px/1.2 var(--font); text-align: center; cursor: pointer; }
.ed-var-art { display: block; overflow: hidden; border-radius: 6px; border: 1px solid var(--line-2); }
.ed-var:hover .ed-var-art { border-color: var(--primary); }
.ed-var.is-on { color: var(--primary); }
.ed-var.is-on .ed-var-art { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.ed-layers-h { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; color: var(--ink-2); }
.ed-layers-h .ed-count { margin-left: auto; }
.ed-layers { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ed-layer { display: flex; align-items: center; gap: 2px; border-radius: 8px; }
.ed-layer:hover { background: var(--surface-2); }
.ed-layer.is-on { background: color-mix(in srgb, var(--sel) 12%, var(--surface)); }
.ed-layer-main { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; height: 34px; padding: 0 6px 0 8px; border: 0; background: none; color: var(--ink); font: 500 13px/1.2 var(--font); text-align: left; cursor: pointer; }
.ed-layer-ic { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.ed-layer.is-on .ed-layer-ic { background: var(--sel); color: #fff; }
.ed-layer-name { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ed-role { flex: none; font: 600 12px/1 var(--font); color: var(--muted); }
.ed-layer.is-hidden .ed-layer-name, .ed-layer.is-hidden .ed-role { color: var(--faint); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--faint) 60%, transparent); }
.ed-layer-btn { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--faint); cursor: pointer; opacity: .75; }
.ed-layer:hover .ed-layer-btn, .ed-layer-btn[aria-pressed="true"], .ed-layer-btn:focus-visible { opacity: 1; color: var(--ink-2); }
.ed-layer-btn.is-on { color: var(--warn); }
.ed-layer-btn:hover { background: var(--surface-3); color: var(--ink); }
.ed-rs-list, .ed-exp-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ed-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.ed-opt:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--line-2)); }
.ed-opt.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.ed-opt-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ed-opt-main b { font: 600 13.5px/1.2 var(--font); }
.ed-opt-main span { font-size: 12px; line-height: 1.35; color: var(--muted); }
.ed-opt-main .warn-text { color: var(--warn); font-weight: 600; }
.ed-rs-gw { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; background: var(--surface-2); color: var(--muted); }
.ed-rs-g { display: block; border: 1.5px solid currentColor; border-radius: 3px; background: var(--surface); }
.ed-opt.is-on .ed-rs-gw { background: var(--primary); color: var(--on-primary); }
.ed-opt.is-on .ed-rs-g { background: color-mix(in srgb, var(--on-primary) 22%, transparent); }
.ed-rs-box { margin: 2px 0 12px; padding: 12px; border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--line); }
.ed-rs-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.ed-rs-head b { font-weight: 600; color: var(--ink); font-size: 13px; }
.ed-rs-note { margin-top: 12px; }
.ed-rs-prev { display: grid; gap: 10px; margin: 0 0 10px; }
.ed-rs-mid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed-rs-tall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed-rs-wide { grid-template-columns: minmax(0, 1fr); }
.ed-rs-th { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ed-rs-art { display: block; overflow: hidden; border-radius: 6px; border: 1px solid var(--line-2); }
.ed-rs-th figcaption { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; color: var(--muted); text-align: center; }
.ed-wrapbtn { height: auto; min-height: 40px; padding: 9px 14px; white-space: normal; line-height: 1.3; text-align: center; }
.ed-rs-cap { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--ok); font-weight: 600; }
.ed-rs-cap .i { flex: none; margin-top: 1px; }

/* ==================================================================
   5. Помощник / Assistant
   ================================================================== */
.ed-ai-top { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 12px; }
.ed-ai-seg { display: flex; width: 100%; }
.ed-ai-seg > button { flex: 1 1 0; gap: 6px; }
.ed-ai-mhint { font-size: 12px; line-height: 1.3; color: var(--muted); text-align: center; }
.ed-ai-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 8px; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s; }
.ed-ai-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.ed-ai-ctx { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font: 600 12.5px/1 var(--font); }
.ed-ai-ctx.is-sel { padding-right: 4px; background: color-mix(in srgb, var(--sel) 12%, var(--surface)); color: var(--sel); }
.ed-ai-ctx-x { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.ed-ai-ctx-x:hover { background: color-mix(in srgb, var(--sel) 18%, transparent); }
.ed-ai-field { display: block; }
.ed-ai-input { display: block; width: 100%; min-height: 48px; padding: 2px 2px; border: 0; outline: none; resize: none; background: transparent; color: var(--ink); font: 400 14.5px/1.45 var(--font); }
.ed-ai-input::placeholder { color: var(--muted); }
.ed-ai-send { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ed-ai-kbd { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.ed-ai-sugg { margin: 12px 0 14px; gap: 6px; }
.ed-ai-more { margin: 18px 0 0; }
.ed-ai-more + .ed-ai-sugg { margin-top: 8px; }
.ed-ai-sugg .chip { height: auto; min-height: 28px; padding: 5px 11px; white-space: normal; text-align: left; line-height: 1.3; }
.ed-ai-empty { padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--r-l); color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.ed-ai-empty p { margin: 0 0 10px; }
.ed-ai-empty ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ed-ai-empty li { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); }
.ed-ai-empty li .i { flex: none; margin-top: 1px; color: var(--primary); }
.ed-ai-mock { margin-top: 14px; }
.ed-think { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--line); }
.ed-think b { display: block; font: 700 14px/1.3 var(--font-head); color: var(--ink); }
.ed-think span:not(.ed-think-dots) { font-size: 12.5px; color: var(--muted); }
.ed-think-dots { display: inline-flex; gap: 4px; flex: none; }
.ed-think-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: edDot 1s ease-in-out infinite; }
.ed-think-dots i:nth-child(2) { animation-delay: .15s; }
.ed-think-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes edDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ed-plan { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-1); animation: popIn .18s ease; }
.ed-plan.is-refuse { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); background: var(--warn-bg); }
.ed-plan-q { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 8px; font: 600 13.5px/1.4 var(--font); color: var(--ink); }
.ed-plan-q > .i { flex: none; margin-top: 2px; color: var(--muted); }
.ed-plan-q > span:first-of-type { flex: 1 1 160px; min-width: 0; }
.ed-plan-scope { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--sel) 12%, var(--surface)); color: var(--sel); font: 600 12px/1 var(--font); white-space: nowrap; }
.ed-ba { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.ed-ba-fig { display: flex; flex-direction: column; gap: 6px; margin: 0; min-width: 0; }
.ed-ba-fig figcaption { font: 700 12px/1 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ed-ba-fig.is-after figcaption { color: var(--ok); }
.ed-ba-art { display: block; overflow: hidden; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); }
.ed-ba-fig.is-after .ed-ba-art { border-color: color-mix(in srgb, var(--ok) 55%, var(--line-2)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 22%, transparent); }
.ed-ba-arrow { display: grid; place-items: center; width: 26px; height: 26px; margin-top: 18px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.ed-ba-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-plan-sum { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ed-plan-sum .ed-link { gap: 4px; font-size: 12px; }
.ed-ba-xl { grid-template-columns: minmax(0, 360px) auto minmax(0, 360px); justify-content: center; gap: 16px; }
.ed-ba-xl .ed-ba-arrow { width: 34px; height: 34px; }
.ed-ba-tabs-c { justify-content: center; margin-top: 14px; }
.ed-plan-g { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.ed-plan-gt { display: flex; align-items: center; gap: 6px; font: 700 12px/1.2 var(--font); letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.ed-plan-gt .i { color: var(--ok); }
.ed-plan-g.is-ai .ed-plan-gt .i { color: var(--mock); }
.ed-ops { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ed-ops li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--ink); }
.ed-ops li > .i { flex: none; margin-top: 2px; color: var(--ok); }
.ed-plan-g.is-ai .ed-ops li > .i { color: var(--mock); }
.ed-ops li > span { min-width: 0; }
.ed-op-fact { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.ed-op-fact .i { flex: none; color: var(--ok); }
.ed-plan-note { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2); }
.ed-plan-note > .i { flex: none; margin-top: 2px; color: var(--info); }
.ed-plan.is-refuse .ed-plan-note > .i { color: var(--warn); }
.ed-plan-acts { display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.ed-plan-acts .btn { width: 100%; }
.ed-plan-acts .btn-ghost { height: 34px; }
.ed-plan-done { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: var(--r); background: var(--surface-2); font: 600 13px/1.3 var(--font); color: var(--ink-2); }
.ed-plan-done > span { flex: 1; }
.ed-plan-done.ok { background: var(--ok-bg); color: var(--ok); }
.ed-answer-b { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.ed-answer-b p { margin: 0 0 8px; }
.ed-tips { display: flex; flex-direction: column; gap: 8px; margin: 0 0 8px; padding: 0 0 0 18px; }
.ed-tips b { color: var(--ink); }
.ed-answer-acts { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==================================================================
   6. Проверка / Checks
   ================================================================== */
.ed-chk-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ed-ring { --c: var(--ok); position: relative; flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); }
.ed-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.ed-ring b { position: relative; font: 800 20px/1 var(--font-head); color: var(--ink); }
.ed-ring.is-warn { --c: var(--warn); }
.ed-ring.is-err { --c: var(--err); }
.ed-chk-hm { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ed-chk-title { font: 700 15px/1.25 var(--font-head); color: var(--ink); }
.ed-chk-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ed-chk-sum { font-size: 12.5px; color: var(--muted); }
.ed-fixall { margin-bottom: 14px; }
.ed-chk-ok { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 10px 12px; border-radius: var(--r); background: var(--ok-bg); color: var(--ok); font: 600 13px/1.3 var(--font); }
.ed-cis { display: flex; flex-direction: column; margin: 0 0 6px; padding: 0; list-style: none; }
.ed-ci { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ed-ci:last-child { border-bottom: 0; }
.ed-ci-ic { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; }
.ed-ci.is-ok .ed-ci-ic { background: var(--ok-bg); color: var(--ok); }
.ed-ci.is-warn .ed-ci-ic { background: var(--warn-bg); color: var(--warn); }
.ed-ci-b { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ed-ci-t { font: 600 13px/1.4 var(--font); color: var(--ink); }
.ed-ci-t .badge { height: 18px; padding: 0 6px; margin-left: 2px; vertical-align: 1px; }
.ed-ci-d { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ed-ci.is-warn .ed-ci-d { color: var(--ink-2); }
.ed-ci-p { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; margin-top: 2px; border-radius: var(--r); background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }
.ed-ci-a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ed-gain { margin-left: auto; padding: 2px 7px; border-radius: var(--r-pill); background: var(--ok-bg); color: var(--ok); font: 700 12px/1.2 var(--font); }
.ed-chk-mock { margin-top: 14px; }

/* ==================================================================
   7. Версии / Versions
   ================================================================== */
.ed-vlist { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ed-vi { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.ed-vi:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line-2)); }
.ed-vi.is-on { border-color: var(--info); background: var(--info-bg); box-shadow: inset 0 0 0 1px var(--info); }
.ed-vi.is-cur { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.ed-vi-n { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font: 800 13px/1 var(--font-head); }
.ed-vi.is-cur .ed-vi-n { background: var(--primary); color: var(--on-primary); }
.ed-vi-m { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ed-vi-l { font: 600 13px/1.35 var(--font); }
.ed-vi-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ed-vi-by { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.ed-vi-by > span:last-child { min-width: 0; }
.ed-vi-by .avatar-sm { --s: 20px; }
.ed-vk-cur { background: var(--primary-soft); color: var(--primary); }
.ed-vk { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font: 600 12px/1 var(--font); }
.ed-vk-ai { background: var(--mock-bg); color: var(--mock); }
.ed-vk-publish { background: var(--ok-bg); color: var(--ok); }
.ed-vk-manual { background: var(--info-bg); color: var(--info); }
.ed-vk-restore { background: var(--warn-bg); color: var(--warn); }
.ed-vi-go { flex: none; align-self: center; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.ed-vi:hover .ed-vi-go, .ed-vi.is-on .ed-vi-go { color: var(--primary); background: var(--primary-soft); }

/* ==================================================================
   8. Скачать / Export
   ================================================================== */
.ed-opt-ic { display: grid; place-items: center; flex: none; width: 46px; height: 30px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font: 800 12px/1 var(--font); letter-spacing: .02em; }
.ed-opt.is-on .ed-opt-ic { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ed-exp-sl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.ed-exp-th { position: relative; display: block; cursor: pointer; }
.ed-exp-th input { position: absolute; top: 4px; left: 4px; z-index: 1; width: 15px; height: 15px; margin: 0; accent-color: var(--primary); }
.ed-exp-art { display: block; overflow: hidden; border-radius: 5px; border: 1px solid var(--line-2); opacity: .45; transition: opacity .15s, border-color .15s; }
.ed-exp-th.is-on .ed-exp-art { opacity: 1; border-color: var(--primary); }
.ed-exp-n { position: absolute; right: 4px; bottom: 4px; font: 700 12px/1 var(--font); color: var(--ink); background: color-mix(in srgb, var(--surface) 88%, transparent); padding: 2px 4px; border-radius: 4px; }
.ed-tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-tokens .chip { font-family: var(--mono); font-size: 12px; }
.ed-exp-sum { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.ed-exp-sum .i { color: var(--muted); flex: none; }
.ed-exp .btn-block + .ed-hint { margin-top: 10px; text-align: center; }

/* ==================================================================
   9. Окна / Modals
   ================================================================== */
.ed-show { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.ed-show-art { justify-self: center; height: min(62vh, 640px); max-width: 100%; overflow: hidden; border-radius: 6px; box-shadow: var(--shadow-2); }
.ed-show-nav { width: 44px; height: 44px; border-radius: 50%; }
.ed-show-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 10px; }
.ed-show-n { font: 600 13.5px/1.2 var(--font); color: var(--ink); }
.ed-show-ths { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; }
.ed-show-th { flex: none; height: 72px; padding: 0; overflow: hidden; border: 1px solid var(--line-2); border-radius: 5px; background: var(--surface-2); cursor: pointer; }
.ed-show-th[aria-current="true"] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.ed-lib .ed-phs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ed-scns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ed-scn { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink); text-align: left; font-size: 13px; cursor: pointer; }
.ed-scn b { margin-top: 4px; font-weight: 600; }
.ed-scn span:last-child { font-size: 12px; line-height: 1.35; color: var(--muted); }
.ed-scn:hover { border-color: var(--primary); }
.ed-scn.is-on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.ed-scn-art { position: relative; display: block; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); }
.ed-scn-own { margin-bottom: 14px; }
.ed-scn-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.ed-scn-acts .ed-hint { flex: 1 1 220px; }
.ed-scn-acts .spacer { flex: 1 1 auto; }
.ed-scn-run { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 20px; padding: 8px 0 4px; }
.ed-scn-veil { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, #fff 45%, transparent); color: var(--primary); }
.ed-scn-veil .spinner { width: 26px; height: 26px; }
.ed-scn-run .ed-run { margin: 0; }
.ed-ba-lg { max-width: 520px; margin: 0 auto 14px; }
.ed-crop { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.ed-crop-art { display: block; overflow: hidden; border-radius: 6px; border: 1px solid var(--line-2); }
.ed-crop-ctl { display: flex; flex-direction: column; }

/* ==================================================================
   10. Листы на телефоне / Mobile sheets
   ================================================================== */
.ed-drawer .drawer-body { padding: 14px 16px 22px; }
.ed-msl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ed-msl-th { display: flex; flex-direction: column; gap: 5px; padding: 0; border: 0; background: none; color: var(--ink-2); font: 600 12px/1.2 var(--font); text-align: left; cursor: pointer; }
.ed-msl-art { display: block; overflow: hidden; border-radius: 6px; border: 1px solid var(--line-2); }
.ed-msl-th.is-on { color: var(--primary); }
.ed-msl-th.is-on .ed-msl-art { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.ed-msl-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-more-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ed-more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.ed-more-t { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 76px; padding: 10px 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--ink); font: 600 13px/1.2 var(--font); cursor: pointer; }
.ed-more-t .i { color: var(--primary); }
.ed-more-t:hover { background: var(--primary-soft); }
.ed-more-sw { display: flex; flex-direction: column; gap: 12px; }
.ed-nf { display: grid; place-items: center; padding: 32px 16px; }

/* ==================================================================
   11. Адаптивность / Responsive
   ================================================================== */
@media (max-width: 1279px) {
  .ed-screen { --ed-right: 312px; }
  .ed-hb span, .ed-score-l { display: none; }
  .ed-hb { width: 36px; padding: 0; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .ed-screen { --ed-rail: 76px; --ed-right: 296px; }
  .ed-body.has-fly { grid-template-columns: var(--ed-rail) minmax(0, 1fr) var(--ed-right); }
  .ed-fly { position: absolute; left: var(--ed-rail); top: 0; bottom: 0; z-index: 20; width: var(--ed-fly); box-shadow: var(--shadow-3); }
  .ed-tb { max-width: 220px; }
  .ed-safe { font-size: 0; gap: 0; }
  .ed-snapbtn { font-size: 0; gap: 0; }
  .ed-rtabs { padding: 6px 4px 0; gap: 0; }
  .ed-rtab { padding: 0 3px; font-size: 12.5px; }
  .ed-rtab.is-on::after { left: 3px; right: 3px; }
}
@media (min-width: 900px) { .ed-only-m { display: none !important; } }
@media (max-width: 899px) {
  .ed-screen { --ed-strip: 88px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .ed-hide-m { display: none !important; }
  .ed-top { gap: 2px; padding: 0 6px 0 4px; }
  .ed-tb { flex: 1 1 auto; }
  .ed-pub { width: 40px; height: 40px; padding: 0; }
  .ed-pub span { display: none; }
  .ed-body { display: flex; flex-direction: column; }
  .ed-rail, .ed-fly, .ed-right { display: none !important; }
  .ed-center { flex: 1 1 auto; }
  .ed-stagebar { justify-content: space-between; padding: 0 6px; }
  .ed-sb-l { justify-content: center; }
  .ed-stage { flex: none; padding: 12px; overflow: visible; }
  .ed-vbar { top: 54px; padding-left: 12px; font-size: 12.5px; }
  .ed-vbar-l { display: none; }
  .ed-strip-in { padding: 0 12px; gap: 10px; }
  .ed-th, .ed-th-add { height: 64px; }
  .ed-th-n { min-width: 18px; height: 18px; font-size: 12px; }
  .ed-ctx-ai span, .ed-ctx [data-ed-act="lock"], .ed-ctx [data-ed-act="dup"] { display: none; }
  .ed-ctx-ai { width: 32px; padding: 0; justify-content: center; }
  .ed-mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); height: calc(64px + env(safe-area-inset-bottom)); padding: 4px 0 env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(16, 30, 24, .06); }
  .ed-mb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: 600 12px/1 var(--font); cursor: pointer; }
  .ed-mb span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.02em; }
  .ed-mb:active { background: var(--surface-2); }
  .ed-mb-score { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 22px; height: 16px; padding: 0 4px; border-radius: 8px; font: 800 12px/16px var(--font); text-align: center; }
  .ed-mb-score.is-ok { background: var(--ok-bg); color: var(--ok); }
  .ed-mb-score.is-warn { background: var(--warn-bg); color: var(--warn); }
  .ed-mb-score.is-err { background: var(--err-bg); color: var(--err); }
  .ed-exp-sl { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ed-lib .ed-phs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ed-scns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ed-scn span:last-child { display: none; }
  .ed-scn-run { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
  .ed-crop { grid-template-columns: minmax(0, 1fr); }
  .ed-crop-art { max-width: 220px; margin: 0 auto; }
  .ed-show { gap: 4px; }
  .ed-show-nav { width: 36px; height: 36px; }
  .ed-show-art { height: min(56vh, 520px); }
}
@media (max-width: 599px) {
  .ed-ba-arrow { width: 22px; height: 22px; }
  .ed-vars { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .ed-think-dots i { animation: none; opacity: .7; } }
