/* Shared desktop workspace tree: compact, keyboard-accessible, and theme-driven. */
.prom-workspace-file-tree-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 220px);
}

.prom-workspace-file-tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.prom-workspace-file-tree-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.side-chat-workspace-button {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 10px;
  background: var(--panel-2);
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.side-chat-workspace-button:hover {
  border-color: var(--brand);
  color: var(--text);
}

.prom-workspace-file-tree-path {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font: 10px/1.35 'IBM Plex Mono', monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prom-workspace-file-tree-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.prom-file-tree-pane,
.prom-workspace-file-tree-viewer {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.prom-file-tree-pane {
  overflow: auto;
  padding: 10px;
  background: color-mix(in srgb, var(--panel) 94%, var(--brand) 6%);
}

.prom-file-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 100%;
}

.prom-file-tree-node {
  position: relative;
}

.prom-file-tree-branch {
  position: relative;
  margin-left: 16px;
  padding-left: 7px;
  border-left: 1px solid color-mix(in srgb, var(--line) 78%, var(--brand) 22%);
  animation: prom-file-tree-branch-in 160ms ease-out;
}

@keyframes prom-file-tree-branch-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

.prom-file-tree-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  gap: 7px;
  padding: 5px 8px;
  padding-left: calc(8px + (var(--file-tree-depth, 0) * 14px));
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.prom-file-tree-row:hover {
  background: color-mix(in srgb, var(--panel-2) 78%, var(--brand) 22%);
}

.prom-file-tree-row:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 72%, white 28%);
  outline-offset: -2px;
}

.prom-file-tree-file-row.is-selected {
  background: color-mix(in srgb, var(--brand) 18%, var(--panel-2) 82%);
  box-shadow: inset 2px 0 0 var(--brand);
  transform: translateX(2px);
}

.prom-file-tree-chevron {
  position: relative;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
}

.prom-file-tree-chevron::before {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  content: '';
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}

.prom-file-tree-node.is-expanded > .prom-file-tree-folder-row .prom-file-tree-chevron::before {
  top: 1px;
  transform: rotate(45deg);
}

.prom-file-tree-folder-icon {
  position: relative;
  flex: 0 0 13px;
  width: 13px;
  height: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 65%, var(--muted) 35%);
  border-radius: 2px;
  opacity: .9;
}

.prom-file-tree-folder-icon::before {
  position: absolute;
  top: -3px;
  left: 1px;
  width: 6px;
  height: 3px;
  border: 1px solid color-mix(in srgb, var(--brand) 65%, var(--muted) 35%);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  content: '';
}

.prom-file-tree-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prom-file-tree-count,
.prom-file-tree-file-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.prom-file-tree-file-leading {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.prom-file-tree-file-tag,
.prom-file-tree-agent-tag,
.prom-file-tree-reader-tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border-radius: 4px;
  padding: 2px 4px;
  font: 800 8px/1 'IBM Plex Mono', monospace;
  letter-spacing: .04em;
}

.prom-file-tree-file-tag--json,
.prom-file-tree-file-tag--typescript { color: #9cc4ff; background: rgba(44, 105, 190, .25); }
.prom-file-tree-file-tag--markdown,
.prom-file-tree-file-tag--data { color: #8de0a8; background: rgba(32, 130, 76, .24); }
.prom-file-tree-file-tag--log { color: #f4cd77; background: rgba(157, 111, 25, .25); }
.prom-file-tree-file-tag--html,
.prom-file-tree-file-tag--markup { color: #ffb486; background: rgba(177, 84, 28, .24); }
.prom-file-tree-file-tag--javascript,
.prom-file-tree-file-tag--stylesheet { color: #ead38a; background: rgba(160, 124, 24, .24); }
.prom-file-tree-file-tag--image { color: #d6b2ff; background: rgba(117, 64, 169, .25); }
.prom-file-tree-file-tag--file,
.prom-file-tree-file-tag--text,
.prom-file-tree-file-tag--shell { color: var(--muted); background: var(--panel-2); }

.prom-file-tree-agent-tag { color: #9cc4ff; background: rgba(44, 105, 190, .22); font-weight: 650; letter-spacing: 0; }
.prom-file-tree-reader-tag { color: #8de0a8; background: rgba(32, 130, 76, .2); font-weight: 650; letter-spacing: 0; }

.prom-file-tree-empty {
  display: grid;
  min-height: 160px;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.prom-workspace-file-tree-viewer {
  display: flex;
  flex-direction: column;
}

.prom-workspace-file-tree-viewer .workspace-file-viewer-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

@media (max-width: 780px) {
  .prom-workspace-file-tree-layout { grid-template-columns: 1fr; }
  .prom-file-tree-pane { max-height: 280px; }
}
