.content:has(.files-page) {
 overflow: hidden;
}

.files-page {
 --page-title-size: 2rem;
 --page-title-line-height: 1.25;
 --page-title-leading: calc(
  var(--page-title-size) *
   var(--page-title-line-height)
 );
 display: flex;
 flex: 1;
 min-height: 0;
 width: 100%;
 height: 100%;
 background: var(--background);
}

.files-pane {
 display: flex;
 flex-direction: column;
 width: 260px;
 flex-shrink: 0;
 min-height: 0;
 border-right: 1px solid var(--border);
 background: var(--shell-surface);
 padding-top: calc(
  32px + var(--page-title-leading)
 );
}

.files-pane-header {
 display: flex;
 flex-direction: column;
 gap: 8px;
 padding: 0 12px 8px;
}

.files-pane-header h1 {
 margin: 0;
 font-size: var(--page-title-size);
 line-height: var(
  --page-title-line-height
 );
 font-weight: 600;
}

.files-list {
 display: flex;
 flex-direction: column;
 gap: 4px;
 flex: 1;
 min-height: 0;
 overflow: auto;
 padding: 8px 12px 16px;
}

.files-item {
 display: flex;
 align-items: center;
 gap: 8px;
 width: 100%;
 padding: 8px 12px;
 border: 0;
 border-radius: var(--radius-md);
 background: transparent;
 color: var(--foreground);
 font: inherit;
 text-align: left;
 cursor: pointer;
}

.files-item span {
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.files-item:hover,
.files-item.active {
 background: var(--sidebar-item-hover);
}

.files-main {
 display: flex;
 flex-direction: column;
 flex: 1;
 min-width: 0;
 min-height: 0;
 padding: calc(
   32px + var(--page-title-leading)
  )
  24px 24px;
}

.files-main-header {
 display: flex;
 align-items: flex-start;
 justify-content: space-between;
 gap: 12px;
 margin-bottom: 16px;
}

.files-crumbs {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 4px;
 margin: 0;
 font-size: var(--text-sm);
}

.files-crumb {
 border: 0;
 background: transparent;
 color: var(--muted-foreground);
 font: inherit;
 cursor: pointer;
 padding: 0;
}

.files-crumb.current {
 color: var(--foreground);
 font-weight: 600;
 cursor: default;
}

.files-actions {
 display: flex;
 gap: 8px;
 flex-shrink: 0;
}

.files-rows {
 display: flex;
 flex-direction: column;
 gap: 4px;
 min-height: 0;
 overflow: auto;
}

.files-row {
 display: flex;
 align-items: center;
 gap: 8px;
 width: 100%;
 min-width: 0;
}

.files-row-open {
 display: flex;
 align-items: center;
 gap: 10px;
 flex: 1;
 min-width: 0;
 padding: 10px 12px;
 border: 0;
 border-radius: var(--radius-md);
 background: transparent;
 color: var(--foreground);
 font: inherit;
 text-align: left;
 cursor: pointer;
}

.files-row-open:hover {
 background: var(--sidebar-item-hover);
}

.files-row-copy {
 display: flex;
 flex-direction: column;
 min-width: 0;
}

.files-name {
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 font-weight: 600;
 font-size: var(--text-sm);
}

.files-meta {
 font-size: var(--text-xs);
}

.files-empty {
 margin: 8px 0;
}

.files-error {
 margin-top: 8px;
}

.files-file-input {
 display: none;
}

.files-picker {
 display: flex;
 flex-direction: column;
 gap: 12px;
 min-height: 240px;
}

.files-picker-list {
 display: flex;
 flex-direction: column;
 gap: 4px;
 max-height: 360px;
 overflow: auto;
}

.files-picker-row {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 8px;
 border-radius: var(--radius-md);
 cursor: pointer;
}

.files-picker-row:hover {
 background: var(--sidebar-item-hover);
}

.files-picker-text {
 display: flex;
 flex-direction: column;
 min-width: 0;
}

.files-picker-check {
 width: 16px;
 height: 16px;
 margin: 0;
 accent-color: var(--primary);
}

.dialog.files-picker-dialog {
 width: min(560px, calc(100vw - 32px));
}

@media (max-width: 720px) {
 .files-page {
  flex-direction: column;
 }

 .files-pane {
  width: 100%;
  max-height: 38%;
  border-right: none;
  border-bottom: 1px solid var(--border);
  padding-top: calc(
   16px + var(--page-title-leading)
  );
 }

 .files-main {
  padding: 16px;
 }
}
