/* FDS extension: visual display layout editor in catalog administration. */
.ss-layout-editor { display: grid; gap: 12px; min-width: 0; }
.ss-layout-toolbar, .ss-layout-cases, .ss-layout-list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ss-layout-toolbar .ss-grow { flex: 1; }
.ss-layout-muted { color: var(--fds-text-secondary); font-size: 12px; margin: 0; }
.ss-layout-ok { color: var(--fds-green-700); }
.ss-layout-warn { color: var(--fds-amber-700); }
.ss-layout-bad { color: var(--fds-red-700); }
.ss-layout-sep { width: 1px; height: 20px; background: var(--fds-border); }
.ss-layout-chip { height: var(--ssa-compact-control, auto); min-height: var(--ssa-compact-control, 0px); box-sizing: border-box; padding: 3px 10px; border: 1px solid var(--fds-border); border-radius: var(--ssa-control-radius, var(--fds-radius-pill)); background: var(--fds-bg-panel); color: var(--fds-text-primary); font: inherit; font-size: var(--ssa-compact-font, 12px); cursor: pointer; white-space: nowrap; }
.ss-layout-chip.is-on { border-color: var(--fds-blue-600); background: var(--fds-blue-50); color: var(--fds-blue-600); font-weight: 600; }
.ss-layout-chip:focus-visible, .ss-layout-item:focus-visible, .ss-layout-mini:focus-visible, .ss-layout-tile:focus-visible { outline: 2px solid var(--fds-blue-600); outline-offset: 2px; }

.ss-layout-body { display: grid; grid-template-columns: 200px minmax(0, 1fr) 260px; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-md); min-width: 0; }
.ss-layout-col { padding: 12px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.ss-layout-col + .ss-layout-col { border-left: 1px solid var(--fds-border); }
.ss-layout-list { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.ss-layout-item { display: grid; gap: 2px; padding: 8px 10px; text-align: left; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-md); background: var(--fds-bg-panel); color: var(--fds-text-primary); font: inherit; font-size: 13px; cursor: pointer; }
.ss-layout-item.is-on { border-color: var(--fds-blue-600); box-shadow: 0 0 0 1px var(--fds-blue-600); }
.ss-layout-item strong { overflow-wrap: anywhere; }
.ss-layout-item small { font-size: 11.5px; }

.ss-layout-stage { background: var(--fds-bg-muted); border-radius: var(--fds-radius-md); padding: 6px; }
.ss-layout-canvas { display: block; width: 100%; height: auto; max-height: 360px; touch-action: none; user-select: none; }
.ss-layout-canvas-text { fill: var(--fds-text-secondary); }
.ss-layout-area { fill: var(--fds-bg-panel); stroke: var(--fds-border-strong); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ss-layout-safe { fill: none; stroke: var(--fds-text-secondary); stroke-dasharray: 6 5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ss-layout-piece { fill: var(--fds-gray-300); stroke: var(--fds-gray-500); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ss-layout-piece.is-focus { fill: var(--fds-gray-500); }
.ss-layout-handle { fill: transparent; stroke: var(--fds-blue-600); stroke-opacity: .5; stroke-dasharray: 5 4; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: grab; }
.ss-layout-handle.is-row { fill: var(--fds-blue-600); fill-opacity: .06; cursor: ns-resize; }
.ss-layout-handle:hover { stroke-opacity: 1; }
.ss-layout-handle.is-selected { stroke-opacity: 1; stroke-dasharray: none; stroke-width: 2; fill: var(--fds-blue-600); fill-opacity: .12; }
.ss-layout-handle:focus-visible { outline: none; stroke-width: 3; stroke-opacity: 1; }
/* Path slots: the line the pieces follow, and a round marker that selects the slot (not dragged). */
.ss-layout-path { fill: none; stroke: var(--fds-blue-600); stroke-opacity: .45; stroke-width: 1.5; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; pointer-events: none; }
.ss-layout-handle.is-path { fill: var(--fds-white); cursor: pointer; }

.ss-layout-panel { display: grid; gap: 10px; }
.ss-layout-panel h3 { margin: 0; font-size: 14px; }
.ss-layout-field { display: grid; gap: 4px; font-size: 12px; color: var(--fds-text-secondary); }
.ss-layout-field .fds-input, .ss-layout-field .fds-select { width: 100%; }
.ss-layout-field > .fds-btn { justify-self: start; }
.ss-layout-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ss-layout-pair:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.ss-layout-check { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.ss-layout-models { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--fds-text-primary); }
.ss-layout-panel > .fds-btn { justify-self: start; }

.ss-layout-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.ss-layout-mini { flex: 0 0 132px; display: grid; gap: 4px; padding: 6px; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-md); background: var(--fds-bg-panel); color: var(--fds-text-primary); font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.ss-layout-mini.is-on { border-color: var(--fds-blue-600); }
.ss-layout-mini.is-misfit { border-color: var(--fds-red-700); color: var(--fds-red-700); }
.ss-layout-mini-svg { width: 100%; height: 44px; }
.ss-layout-issues { font-size: 13px; }
.ss-layout-issues p { margin: 0; font-weight: 600; }
.ss-layout-issues ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 2px; }
.ss-layout-json pre { max-height: 260px; overflow: auto; font-size: 11.5px; background: var(--fds-bg-muted); padding: 8px; border-radius: var(--fds-radius-md); }
.ss-layout-json summary { cursor: pointer; color: var(--fds-text-secondary); font-size: 12px; }

.ss-layout-picker { width: min(860px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.ss-layout-picker .ss-dialog-body { display: grid; gap: 12px; }
.ss-layout-picker-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.ss-layout-picker-head .fds-input { width: min(240px, 100%); }
.ss-layout-picker-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; align-items: start; }
.ss-layout-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 56dvh; overflow-y: auto; padding: 2px; }
.ss-layout-tile { position: relative; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-md); background: var(--fds-bg-panel); color: var(--fds-text-primary); font: inherit; font-size: 11.5px; text-align: left; cursor: pointer; }
.ss-layout-tile.is-chosen { border-color: var(--fds-blue-600); box-shadow: 0 0 0 1px var(--fds-blue-600); }
.ss-layout-tile.is-unfit { opacity: .6; }
.ss-layout-photo { display: grid; place-items: center; height: 64px; border-radius: 6px; background: var(--fds-bg-muted); overflow: hidden; }
.ss-layout-photo img { max-width: 100%; max-height: 64px; object-fit: contain; }
.ss-layout-rank { position: absolute; top: -6px; left: -6px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--fds-blue-600); color: var(--fds-white); font-size: 11px; }
.ss-layout-order { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ss-layout-order li { display: flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid var(--fds-border); border-radius: var(--fds-radius-md); font-size: 12px; }
.ss-layout-order li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ss-layout-order .fds-btn { min-height: var(--ssa-compact-control, 26px); padding: 0 8px; }

@media (max-width: 900px) {
  .ss-layout-body { grid-template-columns: minmax(0, 1fr); }
  .ss-layout-col + .ss-layout-col { border-left: 0; border-top: 1px solid var(--fds-border); }
  .ss-layout-list { max-height: 220px; }
  .ss-layout-picker-body { grid-template-columns: minmax(0, 1fr); }
}
/* FDS extension: aligned controls and compact preview/rules navigation. */
.ss-layout-panel .fds-input, .ss-layout-panel .fds-select { height: var(--ssa-compact-control, 40px); box-sizing: border-box; font: inherit; font-size: var(--ssa-compact-input-font, inherit); }
.ss-layout-issues li[tabindex] { cursor: pointer; padding-block: var(--fds-space-2); }
.ss-layout-mobile-switch { display: none; }
@media(max-width:768px){.ss-layout-mobile-switch{display:flex;gap:var(--fds-space-2);margin-bottom:var(--fds-space-3)}.ss-layout-editor[data-mobile-view=preview] .ss-layout-right{display:none}.ss-layout-editor[data-mobile-view=rules] .ss-layout-center{display:none}.ss-layout-panel .ssa-form-grid{grid-template-columns:minmax(0,1fr)}}
