/* wygge Admin Cockpit — „Shop-Gestaltung“ (W-S4, FND-2138; route shopdesign, shop_design*.jsx).
   The window is the Design-Studio's own (design_studio.css: .ds-root / .ds-window / .ds-layout / .ds-nav / .ds-controls / .ds-stagecol and the controls .ds-row .ds-input .ds-select .ds-seg …), so the
   two screens look and behave alike (Designer-Muster); this file adds only what the shop screen has on top: the grouped navigator, the toolbar's „Gilt für“, the list rows (chips, counters, pager),
   the lock / deviation / history rows and the shop frame. Colours, radii and fonts only through var(--ad-…) (style contract C9). 8-pt grid (4 for tight inner gaps).
   Gate: .verify/check_shop_design.mjs (rules) + tools/shop_design_fit.mjs (measured in Chromium and WebKit at 1440x900 and 1280x800). */

.sd-root { min-width: 0; }
/* the navigator is a little wider than the Design-Studio's: „Abweichungsbericht“ must not break inside the word */
@container dsroot (min-width: 960px) { .sd-root .ds-layout { grid-template-columns: 232px minmax(340px, 1.05fr) minmax(360px, 1fr); } }
.sd-nav .ds-nav-label { overflow-wrap: break-word; }
.sd-stage .ds-tab { padding: 4px 8px; }
/* text rows: input, counter and reset share ONE line (the Design-Studio's wide input would wrap them) */
.sd-row .ds-input-wide { flex: 1 1 0; width: auto; min-width: 0; }
.sd-root *, .sd-root *::before, .sd-root *::after { box-sizing: border-box; }

/* toolbar: „Gilt für“ */
.sd-for { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.sd-for-l { font-size: 12px; font-weight: 700; color: var(--ad-text-subtle); white-space: nowrap; }
.sd-for .ds-select select { max-width: 232px; }

/* navigator: four groups, 32 px entries so that 14 entries + 4 group heads fit the window at 1280x800 without scrolling */
.sd-nav { display: flex; flex-direction: column; gap: 4px; }
.sd-navgroup { display: flex; flex-direction: column; }
.sd-navhead { padding: 4px 12px 0; font-family: var(--ad-font-label); font-size: calc(10px * var(--ad-label-fs-scale, 1)); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ad-label-color, var(--ad-text-subtle)); }
.sd-nav ul { gap: 0; }
.sd-nav button { min-height: 32px; padding: 4px 12px; }
.sd-nav .ds-count.sd-count-warn, .sd-count-warn { background: var(--ad-warn-bg); color: var(--ad-warn-fg); }

/* section head tools (Anrede, „So wirkt das“) */
.sd-titleline { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
.ds-section-head > .sd-headtools { grid-column: 2; grid-row: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sd-headtools .ds-mode { gap: 8px; }
.sd-explain-btn { margin-top: 0; }
.sd-explain { padding: 8px 12px; border-radius: 8px; background: var(--ad-info-bg); color: var(--ad-info-fg); }
.sd-readonly { display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin: 4px 0; border-radius: 8px; background: var(--ad-surface-inset); color: var(--ad-text-muted); }
@container dsctl (max-width: 430px) { .sd-headtools .ds-mode-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

/* panels, rows */
.sd-panel { display: flex; flex-direction: column; min-width: 0; }
.sd-rows, .sd-devrows, .sd-lockrows { display: flex; flex-direction: column; min-width: 0; }
.sd-row .ds-row-head { align-items: center; justify-content: space-between; }
.sd-chips { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.sd-chip-lock { background: var(--ad-warn-bg); color: var(--ad-warn-fg); gap: 4px; }
.sd-hint { margin: 0; }
.sd-row .ds-hint.sd-hint { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
/* lists: every row has the same fixed height (--sd-row-h = SD_ROW_H in shop_design_model.jsx) so that the page size can be computed from the height the list really has; the hint shows one line, the whole
   sentence is the tooltip and part of the accessible description. */
.ds-controls { --sd-row-h: 88px; --sd-dev-h: 60px; }
.ds-controls > .sd-panel-list { flex: 1 1 0; min-height: 0; }
.sd-panel-list > .sd-rows, .sd-panel-list > .sd-devrows { flex: 1 1 0; min-height: 0; overflow: hidden; }
.sd-rows > .sd-row { height: var(--sd-row-h); overflow: hidden; align-content: start; }
.sd-rows .ds-hint.sd-hint { -webkit-line-clamp: 1; }
.sd-devrows > .sd-devrow { height: var(--sd-dev-h); overflow: hidden; }
.sd-listhint { margin: 4px 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sd-invalid { color: var(--ad-danger-fg); }
.sd-count-chars { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ad-text-subtle); white-space: nowrap; }
.sd-count-chars.sd-over { color: var(--ad-danger-fg); }
.sd-row[data-sd-changed="1"] { box-shadow: inset 2px 0 0 var(--ad-accent-deep); padding-left: 8px; }
.sd-row[data-sd-state="readonly"] .ds-label { color: var(--ad-text-muted); }
.sd-slotinfo { min-width: 0; overflow-wrap: anywhere; }
.sd-thumb { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: var(--ad-surface-inset); color: var(--ad-text-faint); border: 1px solid var(--ad-border); }
.sd-find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0 4px; }
.sd-search { position: relative; display: inline-flex; align-items: center; flex: 1 1 140px; min-width: 0; }
.sd-search > svg { position: absolute; left: 8px; color: var(--ad-text-subtle); pointer-events: none; }
.sd-search .ds-input { width: 100%; padding-left: 28px; }
.sd-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; min-height: 32px; }
.sd-empty { padding: 16px 0; }
.sd-state { padding: 24px 0; }

/* Freigaben & Sperren, Abweichungen, Verlauf */
.sd-locktarget { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0 4px; }
.sd-lockrow, .sd-devrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 34px; padding: 1px 0; border-bottom: 1px solid var(--ad-divider); }
.sd-lockrow { height: 34px; }
.sd-lockrow > *, .sd-devrow > * { min-width: 0; }
.sd-lockname, .sd-devname { display: flex; flex-direction: column; min-width: 0; }
.sd-lockrow .ds-btn-outline { justify-content: center; min-width: 104px; }
.sd-devrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; }
.sd-devvals { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.sd-devrow[data-sd-dev-pending="1"] { opacity: 0.6; }
.sd-devhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 4px; }
.sd-devbtns { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.sd-clean { display: flex; align-items: center; gap: 8px; padding: 16px 8px; margin: 8px 0; border-radius: 8px; background: var(--ad-success-bg); color: var(--ad-success-fg); font-size: 13px; font-weight: 600; }

/* preview column */
.sd-stagecol { display: flex; flex-direction: column; }
.sd-stage { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 8px; }
.sd-panewrap { position: relative; flex: 1 1 auto; min-height: 320px; overflow: hidden; border-radius: 8px; border: 1px solid var(--ad-border); background: var(--ad-surface-inset); }
.sd-pane-clip { position: relative; overflow: hidden; margin: 0 auto; }
.sd-pane-zoom { position: relative; transform-origin: 0 0; }
.sd-layer { position: absolute; inset: 0; overflow: hidden; background: var(--ad-surface); }
.sd-layer.sd-before { z-index: 1; }
.sd-frame { background: var(--ad-surface); }
.sd-mock { font-synthesis: none; }
.sd-mock [data-sd-focus="1"] { outline: 2px dashed var(--ad-info); outline-offset: -2px; }
.sd-stage .ds-split { z-index: 2; }

/* narrow (< 960 px): the page scrolls as usual, the preview gets a fixed height, lists keep their natural size (the page size stays SD_PAGE_SIZE) */
@container dsroot (max-width: 959px) { .sd-panewrap { min-height: 420px; } .ds-controls > .sd-panel-list { flex: 0 0 auto; } .sd-panel-list > .sd-rows, .sd-panel-list > .sd-devrows { flex: 0 0 auto; overflow: visible; } .sd-rows > .sd-row, .sd-devrows > .sd-devrow { height: auto; } .sd-rows .ds-hint.sd-hint { -webkit-line-clamp: 3; } .sd-nav { flex-direction: row; flex-wrap: wrap; } .sd-nav ul { flex-wrap: wrap; overflow-x: visible; } .sd-navgroup { flex-direction: row; align-items: center; } .sd-navhead { display: none; } }
@media (prefers-reduced-motion: reduce) { .sd-root * { transition: none !important; animation: none !important; } }
