/* Panoul de setări ghidat al editorului de temă (I1-T, U4): capul cu „Ascunde” și „⋯”, descrierea, câmpurile pe grupuri, arborele cu
   mâner, lacăt, „Ascunsă” și „+” de inserare, plus tooltipul CSS. Fiecare regulă e sub .te. */

/* Starea goală și rândurile informative din setări */
.te .te-settings-hint { display: flex; align-items: flex-start; gap: 0.5rem; }
.te .te-settings-hint .i { flex: none; margin-top: 0.125rem; }
.te .te-locked { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; color: var(--te-muted); font-size: 0.875rem; }
.te .te-section-desc { margin: 0 0 0.75rem; color: var(--te-muted); font-size: 0.875rem; line-height: 1.45; }

/* Capul: titlul, „Ascunde”/„Arată” și meniul */
.te .te-settings-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.te .te-settings-head .te-pane-title { flex: 1 1 8rem; margin: 0; min-width: 0; }
.te .te-settings-head .btn { display: inline-flex; align-items: center; gap: 0.375rem; }
.te .te-menu { position: relative; }
.te .te-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  min-width: 11rem;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--te-surface);
  border: 1px solid var(--te-border-strong);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgb(16 24 20 / 18%);
}
.te .te-menu-list[hidden] { display: none; }
.te .te-menu-item { display: flex; align-items: center; width: 100%; padding: 0.5rem 0.625rem; background: none; border: 0; border-radius: 6px; color: var(--te-text); font: inherit; text-align: left; cursor: pointer; }
.te .te-menu-item:hover { background: var(--te-hover); }
.te .te-menu-item.te-menu-danger { color: var(--te-danger); }

/* „Mută sus” / „Mută jos” urcate sub descriere */
.te .te-settings .te-actions { padding: 0 0 0.75rem; border-top: 0; }

/* Câmpurile pe grupuri */
.te .te-form { gap: 1rem; }
.te .te-field-group { display: grid; gap: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--te-border); }
.te .te-field-group .field { margin: 0; }
.te .te-field-group-title { margin: 0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--te-muted); }

/* Arborele: mânerul, lacătul, „Ascunsă” */
.te .te-handle { position: relative; cursor: grab; }
.te .te-item.is-dragging .te-handle, .te .te-item.is-dragging { cursor: grabbing; }
.te .te-badge { display: inline-flex; align-items: center; gap: 0.25rem; }
.te .te-badge .i { width: 0.875rem; height: 0.875rem; }
.te .te-lock { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 6px; color: var(--te-muted); }

/* „+” de inserare: rând de ~10 px, fără să împingă conținutul */
.te .te-insert { position: relative; list-style: none; height: 10px; margin: 0; padding: 0; }
.te .te-insert::before { content: ""; position: absolute; left: 6px; right: 4px; top: 50%; height: 1px; background: transparent; }
.te .te-insert:hover::before, .te .te-insert:focus-within::before { background: var(--te-accent); }
.te .te-insert-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  transform: translate(-50%, -50%);
  background: var(--te-accent);
  color: #fff;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}
.te .te-insert-btn .i { width: 1rem; height: 1rem; }
.te .te-insert:hover .te-insert-btn, .te .te-insert-btn:focus-visible { opacity: 1; pointer-events: auto; }
.te .te-insert-btn:focus-visible { outline-color: var(--te-text); }
/* Săgeata de desfacere a blocurilor (H5): la stânga numelui, cât un buton tactil. */
.te .te-expand { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.75rem; height: 1.75rem; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--te-muted); cursor: pointer; }
.te .te-expand:hover { background: var(--te-hover); color: var(--te-text); }
.te .te-expand:focus-visible { outline: 2px solid var(--te-accent); outline-offset: 1px; }
.te .te-expand .i { width: 1rem; height: 1rem; }
@media (hover: none) {
  /* REVIZIE-PANOU R6: pe ecran tactil rândul „+” are loc pentru buton (nu mai iese peste numele secțiunilor vecine). */
  .te .te-insert { height: 28px; }
  .te .te-insert-btn { opacity: 1; pointer-events: auto; }
  .te .te-insert::before { background: var(--te-border-strong); }
}

/* Tooltipul CSS: text din data-tip, contrast peste AA (alb pe #1b211d). Mânerul (la stânga) îl aliniază la stânga, lacătul (la
   dreapta) la dreapta, ca marginea panoului să nu-l taie. Escape îl ascunde (clasa te-tip-off, tree-hover.js). */
.te .te-tip[data-tip]:hover::after, .te .te-tip[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 4px);
  z-index: 30;
  width: max-content;
  max-width: 14rem;
  padding: 0.25rem 0.5rem;
  background: #1b211d;
  color: #fff;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.3;
  white-space: normal;
  text-align: left;
  pointer-events: none;
}
.te .te-handle[data-tip]:hover::after, .te .te-handle[data-tip]:focus-visible::after { left: 0; }
.te .te-lock[data-tip]:hover::after, .te .te-lock[data-tip]:focus-visible::after { right: 0; }
.te .te-insert-btn[data-tip]:hover::after, .te .te-insert-btn[data-tip]:focus-visible::after { left: 50%; transform: translateX(-50%); }
.te .te-tip.te-tip-off[data-tip]::after { display: none !important; }
