.root {
  position: relative;
}

.trigger {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 28px;
  padding: 3px 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dsw-alias-label-tertiary);
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
}

.count {
  margin: 0 5px;
}

.activitySlot {
  display: inline-flex;
  flex: none;
  width: 10px;
  height: 10px;
}

.trigger:hover,
.trigger:focus-visible {
  color: var(--dsw-alias-label-secondary);
}

.trigger svg {
  transition: transform 120ms ease;
}

.triggerOpen {
  transform: rotate(180deg);
}

.menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  z-index: 100;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 336px;
  max-width: min(400px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 140px));
  padding: 4px;
  overflow: auto;
  border-radius: 12px;
  background: var(--dsw-specific-menu);
  --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);
  --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);
  box-shadow: var(--dsw-shadow-lv3);
}

.node {
  position: relative;
  min-width: 0;
}
.menu > .node {
  margin-left: -3px;
}

.row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  padding: 7px 8px 7px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dsw-alias-label-primary);
  font-size: 13px;
  line-height: 18px;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.row:hover > .clickarea,
.row:focus-visible > .clickarea {
  background: var(--dsw-alias-interactive-bg-hover);
}

.clickarea {
  box-sizing: border-box;
  display: flex;
  flex: 1;
  align-self: stretch;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  margin: -7px -8px -7px;
  padding: 7px 8px;
  border-radius: 8px;
}

.row > :global([data-state]),
.clickarea > :global([data-state]) {
  margin-top: 4px;
}

.disabled {
  color: var(--dsw-alias-label-dimmed);
  cursor: not-allowed;
}

.disabled:hover {
  background: transparent;
}

.loadingRow {
  cursor: default;
}

.disclosure,
.disclosureSpace {
  flex: none;
  width: 14px;
  height: 18px;
}

.disclosure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dsw-alias-label-tertiary);
  cursor: pointer;
  transition: transform 120ms ease;
}

.disclosure:hover {
  color: var(--dsw-alias-label-primary);
}

.disclosureOpen {
  transform: rotate(90deg);
}

.content {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.label,
.summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.label {
  color: inherit;
  font-weight: 400;
}

.summary,
.metrics {
  color: var(--dsw-alias-label-tertiary);
  font-size: 11px;
  line-height: 16px;
}

.metrics {
  display: grid;
  grid-template-rows: 18px 16px;
  flex: none;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.metricToken {
  grid-row: 1;
  line-height: 18px;
}

.metricDuration {
  grid-row: 2;
}

.children {
  position: relative;
  margin-left: 18px;
  padding-left: 4px;
}

.children::before,
.children > .node::before {
  content: '';
  position: absolute;
  left: 0;
  border-left: 1px solid var(--dsw-alias-border-l2);
}

.children::before {
  top: -26px;
  height: 26px;
}

.children[aria-busy='true']::before {
  content: none;
}

.children > .node::before {
  top: 0;
  bottom: 0;
  left: -4px;
}

.children > .node:last-child::before {
  bottom: auto;
  height: 17px;
}

.children > .node > .row::before {
  content: '';
  position: absolute;
  top: 16px;
  left: -4px;
  width: 14px;
  border-top: 1px solid var(--dsw-alias-border-l2);
}

.notice,
.error {
  padding: 10px 12px;
  color: var(--dsw-alias-label-tertiary);
  font-size: 12px;
  line-height: 18px;
}

.error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--dsw-alias-state-error-primary);
}

.refresh {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.refresh:hover {
  background: var(--dsw-alias-interactive-bg-hover);
}
