/* Новый раздел в любом месте дерева (23.10.2026) — окно «где + название» и «+» на узле схемы. */
#newsec-modal { z-index: 2200; } /* поверх окна выбора разделов карточки (2150) */
#ns-search { width: 100%; box-sizing: border-box; margin: 4px 0 8px; }
.ns-list { max-height: 38vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.ns-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.ns-row:hover { background: var(--bg); }
.ns-row.is-on { background: #eef6fd; box-shadow: inset 3px 0 0 var(--primary); }
.ns-row.is-hidden .ns-nm { color: var(--muted); }
.ns-mark { flex: 0 0 14px; color: var(--primary); font-size: 11px; text-align: center; }
.ns-nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.ns-field { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.ns-field input, .ns-field textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; color: var(--text); }
.ns-preview { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 13px; overflow-wrap: anywhere; }
.ns-lbl { color: var(--muted); }
.ns-path { font-weight: 600; }
.ns-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ns-warn { color: #b42318; margin-top: 6px; }
.ns-note { color: #8a5a00; margin-top: 6px; font-size: 12px; }

/* «+» на узле раздела в «Структуре сайта» — подраздел одним нажатием, без меню «⋯». */
.st-add-btn {
  flex: 0 0 26px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #8b95a3;
  font-size: 18px;
  font-weight: 700;
  padding: 0;
  min-height: 0;
  cursor: pointer;
}
.st-add-btn:hover { background: #eef0f3; color: var(--primary); }

html[data-theme="dark"] .ns-row.is-on { background: #1d2a38; }
html[data-theme="dark"] .st-add-btn { color: #9ea7b2; }
html[data-theme="dark"] .st-add-btn:hover { background: #222429; }
html[data-theme="dark"] .ns-warn { color: #f97066; }
html[data-theme="dark"] .ns-note { color: #fdb022; }

@media (max-width: 600px) {
  .ns-list { max-height: 30vh; }
}

/* Фото раздела (23.10.2026) — миниатюра на схеме и окно «Фото раздела». */
.st-sec-pic { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid var(--border); vertical-align: -6px; margin-right: 6px; }
#secpic-modal { z-index: 2200; }
.sp-body { position: relative; border: 2px dashed transparent; border-radius: 10px; padding: 2px; }
.sp-body.sp-drag { border-color: var(--primary); background: var(--bg); }
.sp-body.sp-busy { opacity: 0.55; pointer-events: none; }
.sp-now { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.sp-frame { flex: 0 0 180px; height: 150px; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.sp-frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sp-none { color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }
.sp-now-actions { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sp-upload { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; cursor: pointer; background: var(--primary); color: #fff; font-weight: 600; }
.danger-text { color: #b42318; }
.sp-h { margin: 16px 0 8px; font-size: 14px; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 34vh; overflow-y: auto; }
.sp-tile { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; text-align: left; min-height: 0; }
.sp-tile:hover { border-color: var(--primary); }
.sp-tile img { width: 100%; height: 80px; object-fit: contain; background: #fff; border-radius: 4px; }
.sp-tile span { font-size: 11px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--text); }
html[data-theme="dark"] .sp-frame, html[data-theme="dark"] .sp-tile img, html[data-theme="dark"] .st-sec-pic { background: #f4f5f7; }
html[data-theme="dark"] .danger-text { color: #f97066; }
@media (max-width: 600px) { .sp-frame { flex-basis: 100%; } }
/* 25.10.2026: картинка товара не загрузилась — подпись вместо пустого квадрата */
.sp-tile .sp-nophoto { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; font-size: 12px; color: var(--muted, #6b7280); background: var(--bg-soft, #f3f5f8); border-radius: 6px; }
