/* â”€â”€ explorer.css                             File explorer tree, filter, context menu, error states â”€â”€ */
.explorer-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 8px 6px;
  padding: 4px 8px;
  background: var(--input-bg);
  border: 1px solid var(--outline);
  border-radius: 4px;
}

.explorer-filter .codicon {
  color: var(--muted);
  font-size: 14px !important;
}

.explorer-filter input {
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.explorer-filter input::placeholder {
  color: var(--placeholder);
}

.explorer-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 8px;
}

.explorer-empty {
  padding: 16px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.explorer-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.explorer-loading-icon {
  flex-shrink: 0;
  font-size: 16px !important;
  color: var(--blue);
  animation: spin 0.9s linear infinite;
}


.explorer-section-head {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 22px;
  padding: 0 8px;
  color: var(--text);
  font: 600 11px/1 var(--font-body);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  user-select: none;
}

.tree-local-badge,
.tree-generated-badge {
  flex-shrink: 0;
  margin-left: 4px;
  padding: 1px 5px;
  font: 600 9px/1.4 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
}

.tree-local-badge {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.tree-generated-badge {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
}


.explorer-section-head .codicon {
  font-size: 14px !important;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding-right: 8px;
  padding-left: calc(8px + var(--depth, 0) * var(--tree-indent));
  cursor: pointer;
  position: relative;
  user-select: none;
}

.tree-item:hover {
  background: var(--sidebar-hover);
}

.tree-item.selected {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active);
}

.tree-item.selected .tree-name {
  color: var(--sidebar-active);
  font-weight: 500;
}

.tree-item.project-root {
  height: 26px;
  margin-top: 2px;
}

.tree-item.project-root .tree-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tree-item.project-root .tree-badge {
  display: none;
}

.tree-item.project-root .explorer-root-actions {
  margin-left: auto;
}

.tree-item.project-root .tree-action-btn {
  width: 20px;
  height: 20px;
}

.tree-item.project-root .tree-action-btn .codicon {
  font-size: 14px !important;
}

.tree-item.project-root .tree-icon-img {
  display: none;
}

.tree-twistie {
  flex: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 3px;
}

.tree-twistie:hover {
  background: var(--hover-overlay);
}

.tree-twistie .codicon {
  font-size: 14px !important;
}

.tree-twistie.hidden {
  display: flex !important;
  visibility: hidden !important;
}

.tree-icon-img {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.tree-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
}

.tree-status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
  line-height: 14px;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.status-u {
  color: #188038;
  background: #e6f4ea;
}

.status-m {
  color: #1a73e8;
  background: #e8f0fe;
}

.status-d {
  color: #d93025;
  background: #fce8e6;
}

.tree-badge {
  flex: 0 0 auto;
  padding: 1px 5px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  font-size: 10px;
}

.tree-item.inline-create-item {
  padding-right: 8px;
}

.inline-create-input {
  flex: 1;
  min-width: 0;
  margin-left: 4px;
  padding: 2px 6px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--outline-strong);
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.inline-create-input::placeholder {
  color: var(--placeholder);
}

.inline-create-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.tree-actions {
  display: none;
  align-items: center;
  gap: 2px;
}

.tree-item:hover .tree-actions,
.tree-item.selected .tree-actions {
  display: flex;
}

.tree-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 3px;
}

.tree-action-btn .codicon {
  font-size: 14px !important;
  line-height: 1;
}

.tree-action-btn.preview-btn {
  width: 18px;
  height: 18px;
}

.tree-action-btn.preview-btn .codicon {
  font-size: 13px !important;
}

.tree-action-btn:hover {
  color: var(--sidebar-active);
  background: rgba(0, 0, 0, 0.06);
}

.tree-action-btn.delete-btn:hover {
  color: #d93025;
  background: #fce8e6;
}

/* â”€â”€ Explorer context menu â”€â”€ */
.explorer-context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 180px;
  padding: 6px;
  background: var(--dropdown-bg);
  border: 1px solid var(--outline);
  border-radius: 8px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: scale(0.95);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.explorer-context-menu.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.context-menu-item:hover {
  background: var(--hover-overlay);
}
.context-menu-item.danger {
  color: #d93025;
}
.context-menu-item.danger:hover {
  background: #fce8e6;
}
.context-menu-item .codicon {
  font-size: 14px;
  width: 16px;
  text-align: center;
}
.context-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: var(--outline);
}

.tab-bar {
  display: flex;
  flex-shrink: 0;
  align-items: stretch;
  min-height: 35px;
  overflow-x: auto;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}

.tab-bar::-webkit-scrollbar {
  height: 4px;
}

.file-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  height: 35px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--tab-inactive-bg);
  border: 0;
  border-right: 1px solid var(--outline);
  font-size: 12px;
  white-space: nowrap;
}

.file-tab:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.file-tab.active {
  background: var(--tab-active-bg);
  color: var(--text);
  border-top: 1px solid var(--outline-strong);
}

.file-tab .tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.file-tab .tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-tab .tab-dirty {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sidebar-active);
  opacity: 0;
}

.file-tab.dirty .tab-dirty {
  opacity: 1;
}

.file-tab .tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  opacity: 0;
}

.file-tab:hover .tab-close,
.file-tab.active .tab-close {
  opacity: 1;
}

.file-tab .tab-close:hover {
  color: var(--text);
  background: var(--hover-overlay-strong);
}

.breadcrumb {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 12px/1.3 var(--font-mono);
  letter-spacing: -0.01em;
}

