.source-dialog .folder-browser {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  height: min(480px, calc(100vh - 240px));
  min-height: 320px;
  padding: 0;
  overflow: hidden;
}

.folder-sidebar {
  min-width: 0;
  padding: 14px 10px;
  overflow: auto;
  background: #141414;
  border-right: 1px solid var(--line);
}

.folder-pane-title {
  padding: 0 8px 8px;
  color: var(--muted);
  font-size: 12px;
}

.folder-shortcuts {
  display: grid;
  gap: 2px;
}

.folder-shortcut {
  min-height: 34px;
  padding: 0 8px;
  overflow: hidden;
  background: transparent;
  border-radius: 5px;
  color: var(--muted);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-shortcut:hover,
.folder-shortcut.is-current {
  background: var(--surface-3);
  color: var(--text);
}

.folder-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.folder-toolbar {
  align-items: center;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.folder-toolbar .secondary-button,
.folder-toolbar .quiet-button {
  min-height: 34px;
}

.folder-breadcrumbs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.folder-crumb {
  min-height: 30px;
  padding: 0 5px;
  background: transparent;
  color: var(--muted);
}

.folder-crumb:hover,
.folder-crumb:last-child {
  color: var(--text);
}

.folder-crumb + .folder-crumb::before {
  margin-right: 8px;
  color: var(--faint);
  content: "/";
}

.folder-browser-summary {
  min-height: 36px;
  padding: 9px 14px;
  color: var(--muted);
  font-size: 12px;
}

.folder-list-header,
.folder-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px 128px;
  gap: 14px;
  align-items: center;
}

.folder-list-header {
  min-height: 30px;
  padding: 0 14px;
  background: #141414;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
}

.folder-list {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.folder-row {
  width: 100%;
  min-height: 48px;
  padding: 7px 14px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  text-align: left;
}

.folder-row:hover,
.folder-row:focus-visible {
  background: var(--surface-2);
}

.folder-name,
.folder-meta,
.folder-modified {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-name {
  font-weight: 600;
}

.folder-meta,
.folder-modified {
  color: var(--muted);
  font-size: 12px;
}

.folder-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.folder-selection {
  padding: 12px 16px;
  background: #141414;
  border-top: 1px solid var(--line);
}
