.directory-picker-v2-body {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 2px 16px 0;
}

.directory-picker-v2-path {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.directory-picker-v2-actions {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
}

.directory-picker-v2-suggestions {
  position: absolute;
  z-index: 20;
  top: 36px;
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 4px;
  border: 1px solid var(--v2-border-border-base);
  border-radius: 6px;
  background: var(--v2-background-bg-layer-02);
  box-shadow: var(--v2-elevation-overlay);
}

.directory-picker-v2-suggestions button {
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--v2-text-text-muted);
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-picker-v2-suggestions button:hover,
.directory-picker-v2-suggestions button[data-active] {
  color: var(--v2-text-text-base);
  background: var(--v2-overlay-simple-overlay-hover);
}

.directory-picker-v2-main {
  display: flex;
  min-height: 0;
  flex: 1;
  gap: 12px;
}

.directory-picker-v2-rail {
  display: flex;
  overflow-y: auto;
  width: 176px;
  flex-shrink: 0;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
  scrollbar-width: thin;
}

.directory-picker-v2-rail-title {
  padding: 8px 6px 2px;
  color: var(--v2-text-text-faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.directory-picker-v2-rail-title:first-child {
  padding-top: 0;
}

.directory-picker-v2-rail-item {
  display: flex;
  align-items: center;
  border-radius: 4px;
  color: var(--v2-text-text-muted);
}

.directory-picker-v2-rail-item:hover,
.directory-picker-v2-rail-item[data-active] {
  color: var(--v2-text-text-base);
  background: var(--v2-overlay-simple-overlay-hover);
}

.directory-picker-v2-rail-nav {
  display: flex;
  overflow: hidden;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 12px;
  text-align: left;
}

.directory-picker-v2-rail-nav span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-picker-v2-rail-remove {
  display: none;
  flex-shrink: 0;
  padding: 4px;
  color: var(--v2-text-text-faint);
}

.directory-picker-v2-rail-item:hover .directory-picker-v2-rail-remove {
  display: block;
}

.directory-picker-v2-rail-remove:hover {
  color: var(--v2-text-text-base);
}

.directory-picker-v2-browser {
  position: relative;
  z-index: 0;
  isolation: isolate;
  min-height: 0;
  flex: 1;
  overflow: auto;
  border: 1px solid var(--v2-border-border-base);
  border-radius: 6px;
  background: transparent;
}

.directory-picker-v2-tree {
  display: block;
  width: 100%;
  height: 100%;
  --trees-bg-override: transparent;
  --trees-fg-override: var(--v2-text-text-base);
  --trees-fg-muted-override: var(--v2-text-text-muted);
  --trees-bg-muted-override: transparent;
  --trees-selected-bg-override: transparent;
  --trees-selected-fg-override: var(--v2-text-text-base);
  --trees-selected-focused-border-color-override: transparent;
  --trees-focus-ring-color-override: transparent;
  --trees-focus-ring-width-override: 0px;
  --trees-focus-ring-offset-override: 0px;
  --trees-border-color-override: var(--v2-border-border-base);
  --trees-font-family-override: var(--font-family-sans);
  --trees-font-size-override: 12px;
  --trees-item-height: 24px;
  --trees-border-radius-override: 4px;
}

.directory-picker-v2-context-menu {
  position: fixed;
  z-index: 60;
  display: flex;
  min-width: 180px;
  flex-direction: column;
  padding: 4px;
  border: 1px solid var(--v2-border-border-base);
  border-radius: 6px;
  background: var(--v2-background-bg-layer-02);
  box-shadow: var(--v2-elevation-overlay);
}

.directory-picker-v2-context-menu-path {
  overflow: hidden;
  padding: 4px 8px 2px;
  color: var(--v2-text-text-faint);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-picker-v2-context-menu button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--v2-text-text-base);
  font-size: 12px;
  text-align: left;
}

.directory-picker-v2-context-menu button:hover {
  background: var(--v2-overlay-simple-overlay-hover);
}

.directory-picker-v2-state {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--v2-text-text-muted);
  font-size: 12px;
  pointer-events: none;
}

.directory-picker-v2-selection {
  overflow: hidden;
  flex-shrink: 0;
  color: var(--v2-text-text-muted);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Save-As filename row, shown only when the caller asks the picker for a name. */
.directory-picker-v2-filename {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem 0;
}
.directory-picker-v2-filename > span {
  color: var(--v2-text-text-muted);
  font-size: var(--font-size-small);
  white-space: nowrap;
}
.directory-picker-v2-filename > input {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid var(--v2-border-border-base);
  background: var(--v2-background-bg-layer-01);
  color: var(--v2-text-text-base);
  font-size: var(--font-size-small);
  outline: none;
}
.directory-picker-v2-filename > input:focus {
  border-color: var(--v2-border-border-focus);
}
