/* Редактор (F6) — по прототипу `visualization.html` (.ed*, .presets). Размеры и положение рамки — через CSSOM
   (`style:` в Leptos): CSP `style-src 'self'` запрещает встроенные стили. */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; align-items: start; }
.ed-stage { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface-3) 0 50%) 0 0 / 16px 16px; border-radius: 12px;
  height: 480px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; touch-action: none; }
.ed-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ed-frame { position: relative; flex: none; }
.ed-frame img { position: absolute; max-width: none; pointer-events: none; }
.ed-crop { position: absolute; border: 1.5px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); cursor: move; touch-action: none; box-sizing: border-box; }
.ed-crop::before, .ed-crop::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.ed-crop::before { border-left: 1px solid rgba(255, 255, 255, .35); border-right: 1px solid rgba(255, 255, 255, .35); left: 33.33%; right: 33.33%; }
.ed-crop::after { border-top: 1px solid rgba(255, 255, 255, .35); border-bottom: 1px solid rgba(255, 255, 255, .35); top: 33.33%; bottom: 33.33%; }
.ed-h { position: absolute; width: 22px; height: 22px; background: #fff; border: 1px solid #333; border-radius: 4px; touch-action: none; }
.ed-h.nw { left: -11px; top: -11px; cursor: nwse-resize; } .ed-h.ne { right: -11px; top: -11px; cursor: nesw-resize; }
.ed-h.sw { left: -11px; bottom: -11px; cursor: nesw-resize; } .ed-h.se { right: -11px; bottom: -11px; cursor: nwse-resize; }
.ed-side { display: flex; flex-direction: column; gap: 12px; }
.ed-side .tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ed-side .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { height: 32px; padding: 0 12px; border: 1px solid var(--rule-2); background: var(--surface); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; color: inherit; }
.presets button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.ed-poster { max-width: 100%; max-height: 100%; object-fit: contain; }
.ed-sec { display: flex; gap: 8px; align-items: center; }
.ed-sec input { width: 96px; }
.ed-missing { padding: 48px 0; text-align: center; }
@media (max-width: 760px) { .ed { grid-template-columns: 1fr; } .ed-stage { height: 360px; } }
