/* STORE-11: only the explicit system overview editor creates these elements. */
.system-overview-editor {
  position: fixed; z-index: 10020; left: 12px; top: 86px; width: 286px;
  max-width: calc(100vw - 24px); max-height: calc(100dvh - 100px); overflow: auto;
  border: 1px solid var(--ex-line-2); border-radius: 12px; background: var(--surface);
  color: var(--ex-text); box-shadow: 0 16px 48px rgba(0, 0, 0, .38); font: 13px/1.45 var(--body);
}
.soe-header { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--ex-line-2); background: var(--surface); cursor: move; touch-action: none; }
.soe-header > div:first-child { min-width: 0; }
.soe-header-actions { display: flex; gap: 5px; flex: none; }
.soe-header strong { font: 700 17px/1.2 var(--display); }
.soe-header small { display: block; margin-top: 3px; color: var(--ex-dim); font: 10px/1.4 var(--mono); }
.soe-body { padding: 12px; }
.soe-intro { margin: 0 0 12px; color: var(--ex-dim); }
.soe-arrangement-status { margin: 0 0 8px; color: var(--ex-dim); font-size: 11px; }
.system-overview-editor .soe-use-arrangement { display: block; width: 100%; margin-bottom: 12px; border-color: var(--brand-ink); }
.soe-grid-controls { margin-bottom: 12px; padding: 10px; border: 1px solid var(--ex-line-2); border-radius: 8px; }
.soe-grid-controls .soe-row { margin: 0 0 9px; }
.soe-grid-controls .soe-field, .soe-grid-controls .soe-help { margin-bottom: 0; }
.soe-grid-controls [aria-pressed="true"] { border-color: var(--brand-ink); color: var(--brand-ink); }
.system-overview-editor button, .system-overview-editor input, .system-overview-editor select { font: inherit; }
.system-overview-editor button {
  min-height: 40px; padding: 7px 8px; border: 1px solid var(--ex-line-2); border-radius: 7px;
  background: var(--surface-soft); color: var(--ex-text); cursor: pointer;
}
.system-overview-editor button:disabled { opacity: .45; cursor: default; }
.system-overview-editor :is(button,input,select):focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; }
.soe-header button { min-width: 40px; font-size: 20px; }
.soe-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-bottom: 12px; }
.soe-tools button { font-size: 11px; min-height: 44px; }
.soe-tools button[aria-pressed="true"], .system-overview-editor .soe-primary { background: var(--brand); border-color: var(--brand-ink); }
.soe-field { display: block; margin: 0 0 11px; color: var(--ex-dim); }
.soe-field input, .soe-field select, .soe-position input { display: block; width: 100%; margin-top: 5px; box-sizing: border-box; }
.system-overview-editor input:not([type="file"]), .system-overview-editor select {
  min-height: 40px; padding: 7px 8px; border: 1px solid var(--ex-line-2); border-radius: 6px;
  background: var(--bg-soft); color: var(--ex-text); min-width: 0;
}
.system-overview-editor input:disabled, .system-overview-editor select:disabled { opacity: .5; }
.soe-position { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0 0 11px; }
.soe-position label { color: var(--ex-dim); font-size: 11px; }
.soe-help { margin: 10px 0; color: var(--ex-dim); font-size: 11px; }
.soe-line-repair { display: grid; gap: 6px; margin: 12px 0; }
.soe-target-controls { margin: 12px 0; padding: 10px; border: 1px solid var(--ex-line-2); border-radius: 8px; }
.soe-target-controls button { width: 100%; }
.soe-target-controls .soe-help { margin-bottom: 0; }
.soe-line-repair button { width: 100%; min-height: 44px; font-weight: 600; }
.system-overview-editor .soe-line-handles-toggle { width: 100%; margin-bottom: 4px; }
.soe-endpoint-help, .soe-delete-help { padding-left: 9px; border-left: 2px solid var(--ex-line-2); }
.soe-appearance { margin: 12px 0; padding: 0 10px; border: 1px solid var(--ex-line-2); border-radius: 8px; }
.soe-appearance summary { min-height: 42px; display: flex; align-items: center; cursor: pointer; color: var(--brand-ink); }
.soe-appearance summary::before { content: "+"; margin-right: 8px; }
.soe-appearance[open] summary::before { content: "−"; }
.soe-appearance summary:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; }
.soe-row { display: flex; gap: 6px; margin: 10px 0; }
.soe-row button { flex: 1 1 0; min-width: 0; font-size: 11px; }
.soe-nudge { display: flex; gap: 6px; }
.soe-nudge button { flex: 1; font-size: 18px; min-height: 44px; }
.soe-import { display: block; margin: 12px 0; color: var(--ex-dim); font-size: 11px; }
.soe-import input { display: block; width: 100%; margin-top: 6px; font-size: 11px; }
.system-overview-editor .soe-export { display: block; width: 100%; }
.soe-routing-status { color: var(--ex-conversion); font-size: 11px; margin: 10px 0; }
.soe-status { color: var(--brand-ink); font-size: 11px; margin: 12px 0 8px; min-height: 32px; }
.soe-foot { display: block; color: var(--ex-dim); font-size: 10px; }
.soe-collapsed { width: 330px; }
.soe-collapsed .soe-body { display: none; }
.soe-collapsed .soe-header { border-bottom: 0; }
.soe-collapsed .soe-header strong { font-size: 15px; }
.soe-collapsed .soe-header [data-action="collapse"] { font-size: 11px; }
.soe-collapsed-hint { display: none; margin: 0; padding: 0 12px 10px; color: var(--ex-dim); font-size: 11px; }
.soe-collapsed .soe-collapsed-hint { display: block; }
.system-overview-editor [hidden], .soe-handles[hidden], .soe-guides[hidden] { display: none !important; }
.soe-guides { position: fixed; inset: 0; z-index: 10005; pointer-events: none; overflow: hidden; }
.soe-grid-plane {
  position: absolute; pointer-events: none; outline: 1px solid color-mix(in srgb, var(--brand-ink) 38%, transparent);
  background-image: linear-gradient(to right, color-mix(in srgb, var(--brand-ink) 18%, transparent) 1px, transparent 1px), linear-gradient(to bottom, color-mix(in srgb, var(--brand-ink) 18%, transparent) 1px, transparent 1px);
}
.soe-centre-guide { position: absolute; pointer-events: none; }
.soe-centre-vertical { top: 0; bottom: 0; border-left: 1px dashed var(--ex-quasar); }
.soe-centre-horizontal { left: 0; right: 0; border-top: 1px dashed var(--ex-quasar); }
.soe-handles { position: fixed; inset: 0; pointer-events: none; z-index: 10010; }
.soe-handle {
  position: absolute; display: grid; place-items: center; pointer-events: auto; touch-action: none;
  width: 44px; height: 44px; padding: 0; transform: translate(-50%, -50%);
  border: 2px solid var(--brand-ink); border-radius: 7px; background: var(--bg-soft); color: var(--ex-text);
  font: 600 20px/1 var(--body); cursor: grab; box-shadow: 0 0 0 3px var(--bg);
}
.soe-handle:active { cursor: grabbing; }
.soe-handle:focus-visible { z-index: 3; outline: 2px solid var(--ex-text); outline-offset: 4px; }
.soe-anchor-handle { border-radius: 50%; cursor: crosshair; }
.soe-route-handle { cursor: ns-resize; }
.soe-family-handle { width: 124px; height: 40px; padding: 0 8px; font-size: 11px; white-space: nowrap; }
.soe-source-handle { width: 150px; height: 36px; padding: 0 8px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soe-line-handle { width: 24px; height: 24px; border: 0; background: transparent; box-shadow: none; font-size: 12px; }
.soe-bend-handle::before { content: ""; width: 6px; height: 6px; border: 1px solid var(--brand-ink); border-radius: 50%; }
.soe-handle.soe-endpoint-handle { z-index: 5; width: 30px; height: 30px; border-radius: 50%; }
.soe-endpoint-handle::before { content: ""; width: 14px; height: 14px; border: 1px solid var(--ex-quasar); border-radius: 50%; }
.soe-endpoint-handle::after { content: attr(data-port-label); position: absolute; left: calc(50% + 10px); top: calc(50% - 20px); padding: 1px 3px; border-radius: 3px; background: var(--bg-soft); color: var(--ex-text); font: 600 10px/1.2 var(--mono); }
.soe-handle.soe-endpoint-handle:focus-visible { z-index: 6; }
.soe-segment-handle { width: 22px; height: 22px; cursor: ns-resize; opacity: 0; }
.soe-segment-handle.soe-vertical-segment { cursor: ew-resize; }
.soe-segment-handle:is(.soe-selected-handle,:hover,:focus-visible) { opacity: 1; }
.soe-caption-handle { width: 40px; border-radius: 16px; }
.soe-resize-handle { width: 28px; height: 28px; border-radius: 4px; font-size: 16px; cursor: nwse-resize; }
.soe-selected-handle { z-index: 2; border-color: var(--ex-quasar); }
.soe-selected-handle::before { border-color: var(--ex-quasar); }
.soe-editing :is([data-system-source],[data-system-line-label]) { pointer-events: auto; cursor: grab; touch-action: none; user-select: none; }
.soe-lines-editing [data-system-link] .system-wire-hit { pointer-events: stroke; cursor: move; touch-action: none; }
.soe-lines-editing [data-system-link].soe-selected-line .system-wire-glow { opacity: .32; }
.soe-editing :is([data-system-product],[data-system-family]) { touch-action: none; cursor: grab; pointer-events: auto; user-select: none; }
.soe-lines-editing :is([data-system-product],[data-system-family]) { pointer-events: none; cursor: default; }
.soe-editing :is([data-system-product],[data-system-family]):active { cursor: grabbing; }
.soe-editing :is([data-system-product],[data-system-family]).soe-selected { outline: 2px dashed var(--brand-ink); outline-offset: 5px; border-radius: 9px; }
@media (hover: hover) {
  .system-overview-editor button:not(:disabled):hover { border-color: var(--brand-ink); }
  .soe-handle:hover { background: var(--brand-deep); }
  .soe-line-handle:hover { background: transparent; }
}
@media (max-width: 920px) {
  .system-overview-editor { top: 68px; left: 8px; width: 268px; max-width: calc(100vw - 16px); max-height: calc(100dvh - 80px); }
  .system-overview-editor :is(button,input:not([type="file"]),select) { min-height: 44px; }
  .soe-family-handle { width: 124px; height: 44px; }
  .soe-line-handle, .soe-source-handle, .soe-resize-handle { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .system-overview-editor *, .soe-handle { scroll-behavior: auto; } }
/* Canvas inspection is separate from authored product and line geometry. */
.soe-view-controls { padding: 10px 12px; border-bottom: 1px solid var(--ex-line-2); background: var(--surface); }
.soe-zoom-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: end; gap: 6px; }
.soe-zoom-row label { color: var(--ex-dim); font-size: 11px; }
.soe-zoom-row input { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; }
.soe-view-controls .soe-row { margin: 8px 0 0; }
.soe-view-help { margin: 6px 0 0; color: var(--ex-dim); font-size: 10px; }
.soe-view-controls [aria-pressed="true"] { border-color: var(--brand-ink); color: var(--brand-ink); }
.soe-pan-surface { position: fixed; z-index: 10009; cursor: grab; touch-action: none; background: transparent; }
.soe-pan-surface[hidden] { display: none; }
.soe-pan-surface:active { cursor: grabbing; }
.soe-pan-surface:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: -3px; }
.soe-view-panning .soe-handle { pointer-events: none; }
