/* Universal tree widget visuals. Self-contained — no external deps. */

.ms-tree-root,
.ms-tree-panel {
  position: fixed;
  z-index: 6;
  font: 13px/1.4 system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.ms-tree-root {
  background: rgba(20, 20, 22, 0.92);
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ms-tree-root:hover { background: rgba(40, 40, 44, 0.95); }
.ms-tree-root.open  { background: #2d6cdf; color: #fff; border-color: #2d6cdf; }
.ms-tree-root.draggable { cursor: grab; }
.ms-tree-root.dragging  { cursor: grabbing; opacity: 0.9; }

.ms-tree-panel {
  background: rgba(20, 20, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  gap: 4px;
}
.ms-tree-panel[data-axis="horizontal"] { flex-direction: row; }
.ms-tree-panel[data-axis="vertical"]   { flex-direction: column; }

.ms-tree-node {
  background: transparent;
  color: #bbb;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.ms-tree-node:hover { background: rgba(255, 255, 255, 0.06); color: #ddd; }

.ms-tree-node[data-state="on"]      { color: #2d6cdf; }
.ms-tree-node[data-state="on"]:hover{ color: #4a8af0; background: rgba(45, 108, 223, 0.10); }
.ms-tree-node[data-state="off"]     { color: #555; }
.ms-tree-node[data-state="off"]:hover { color: #888; }
.ms-tree-node[data-state="partial"] { color: #6f8fc8; position: relative; }
.ms-tree-node[data-state="partial"]::after {
  content: "";
  position: absolute; left: 4px; right: 4px; bottom: 2px; height: 0;
  border-bottom: 2px dashed rgba(45, 108, 223, 0.7);
  pointer-events: none;
}
.ms-tree-node[data-state="partial"]:hover { color: #9ab4e0; background: rgba(45, 108, 223, 0.08); }
.ms-tree-node.open { outline: 2px solid rgba(45, 108, 223, 0.6); outline-offset: 1px; }

.ms-tree-icon {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 22px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

.ms-tree-text {
  font-size: 12px;
  font-weight: 500;
  display: none;
}
.ms-tree-root.show-text .ms-tree-text,
.ms-tree-panel.show-text .ms-tree-text,
.ms-tree-node.show-text .ms-tree-text {
  display: inline;
}

/* Touch / no-hover devices (phones, tablets): show text labels by default
 * because there's no tooltip-on-hover affordance. Desktops stay compact
 * icons-only. Two media features for compatibility: hover:none catches
 * iOS Safari; pointer:coarse catches Android Chrome. */
@media (hover: none), (pointer: coarse) {
  .ms-tree-text { display: inline; }
}
