.device-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 0.35fr) minmax(0, 0.65fr);
}

.device-tree-panel,
.device-list-panel {
  min-height: calc(100vh - 240px);
}

.device-tree {
  max-height: calc(100vh - 320px);
  overflow: auto;
  padding-right: 4px;
}

.device-list-table {
  max-height: calc(100vh - 340px);
  overflow: auto;
  padding-right: 4px;
}

.tree-node {
  position: relative;
  padding: 8px 0 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.tree-node::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 11px;
  border-left: 1px solid var(--line);
}

.tree-node-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.tree-node-row::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 11px;
  width: 10px;
  border-top: 1px solid var(--line);
}

.tree-toggle {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.tree-toggle-placeholder {
  display: inline-block;
  border-color: transparent;
  background: transparent;
}

.tree-children {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  margin-left: 22px;
  padding-left: 12px;
}

.tree-chip {
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  font-size: 13px;
}

.tree-empty {
  padding: 16px;
  color: var(--muted);
}

.compact-segmented {
  flex-wrap: nowrap;
}
