.window-files {
  --explorer-surface: #fff;
  --explorer-text: #202020;
  --explorer-muted: #53647a;
  --explorer-caption: #dce3eb;
  --explorer-nav: #f2f5f8;
  --explorer-field: #fbfbfc;
  --explorer-line: #d8dde4;
  --explorer-hover: #edf4fa;
  --explorer-selected: #dcebf9;
  --explorer-side-selected: #d8d8d8;
  container-type: inline-size;
  border-radius: 8px 8px 5px 5px;
}
.window-files > .window-titlebar {
  height: 36px;
  min-height: 36px;
  gap: 0;
  padding: 0;
  background: var(--explorer-caption);
  color: var(--explorer-text);
}
.window-files:has(.explorer-storage-grid) > .window-titlebar { background: #e7e7e7; }
.window-files > .window-titlebar > .window-controls { margin-left: auto; background: transparent; }
.window-files > .window-titlebar > .window-controls button { width: 46px; height: 36px; }
.window-files .window-content { overflow: hidden; padding: 0; background: var(--explorer-surface); }
.window-files .app-head { display: none; }
.window-files .app-panel, .window-files .explorer-shell { height: 100%; min-height: 0; padding: 0; }
.window-files .explorer {
  display: grid;
  grid-template: 49px 47px minmax(0, 1fr) 23px / 220px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  gap: 0;
  background: var(--explorer-surface);
  color: var(--explorer-text);
  font: 12px/1.35 "Segoe UI Variable", "Segoe UI", Tahoma, sans-serif;
}
.window-files .explorer button, .window-files .explorer-tabs button { font-family: inherit; }
.window-files .explorer svg, .window-files .explorer-tabs svg { display: block; width: 16px; height: 16px; flex: none; }

.window-files .explorer-tabs {
  display: flex;
  align-items: end;
  flex: 1;
  gap: 4px;
  height: 36px;
  min-width: 0;
  padding: 4px 8px 0;
  overflow: auto;
  scrollbar-width: none;
}
.window-files .explorer-tab {
  display: flex;
  align-items: center;
  flex: 0 1 240px;
  gap: 8px;
  height: 32px;
  min-width: 108px;
  max-width: 240px;
  padding: 0 7px 0 8px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--explorer-text);
  text-align: left;
}
.window-files .explorer-tab.active { border-color: #d5dbe2; background: #f7f9fb; }
.window-files .explorer-tab:not(.active):hover { background: #edf1f4; }
.window-files .explorer-tab-icon { display: grid; place-items: center; flex: none; color: #159cc6; }
.window-files .explorer-tab-title, .window-files .explorer-tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.window-files .explorer-tab-label { display: flex; align-items: center; gap: 8px; flex: 1; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.window-files .explorer-tab-close, .window-files .explorer-tab-add {
  display: grid;
  place-items: center;
  flex: none;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--explorer-text);
  font-size: 15px;
  line-height: 1;
}
.window-files .explorer-tab-close { margin-left: auto; }
.window-files .explorer-tab-add { align-self: center; margin: 0 3px; }
.window-files .explorer-tab-close:hover, .window-files .explorer-tab-add:hover { background: #d4dce3; }

.window-files .explorer-navrow, .window-files .explorer-commandbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-width: 0;
  border-bottom: 1px solid var(--explorer-line);
}
.window-files .explorer-navrow { grid-row: 1; gap: 8px; padding: 0 8px; background: var(--explorer-nav); }
body:not([data-theme=dark]) .window-files:has(.explorer-storage-grid) .explorer-navrow { background: #f5f5f5; }
.window-files .explorer-navrow > button {
  display: grid; place-items: center; flex: 0 0 40px; height: 32px;
  padding: 0; border: 0; border-radius: 4px; background: transparent;
  color: var(--explorer-text); font-size: 17px;
}
.window-files .explorer button:disabled { opacity: .36; cursor: default; }
.window-files .explorer-navrow > button:hover:not(:disabled) { background: var(--explorer-hover); }
.window-files .explorer-address {
  display: flex; align-items: center; flex: 1; gap: 10px; height: 32px; min-width: 100px; padding: 0 10px;
  overflow: hidden; border-radius: 5px; background: var(--explorer-field); color: var(--explorer-text); white-space: nowrap;
}
.window-files .explorer-breadcrumbs { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: auto; scrollbar-width: none; }
.window-files .explorer-address-icon { display: grid; flex: none; place-items: center; color: var(--explorer-muted); }
.window-files .explorer-crumb { flex: none; border: 0; border-radius: 3px; background: transparent; color: inherit; padding: 4px 5px; font-size: 12px; }
.window-files .explorer-crumb:hover { background: var(--explorer-hover); }
.window-files .explorer-chev, .window-files .explorer-separator { color: var(--explorer-muted); }
.window-files .explorer-searchbox { position: relative; flex: 0 1 246px; min-width: 125px; }
.window-files .explorer-searchbox > .explorer-glyph { position: absolute; right: 11px; top: 8px; color: var(--explorer-muted); pointer-events: none; }
.window-files .explorer-search {
  display: block; width: 100%; height: 32px; padding: 0 30px 0 13px;
  border: 0; border-radius: 5px; outline: 0;
  background: var(--explorer-field); color: var(--explorer-text); font: inherit;
}
.window-files .explorer-search:focus { box-shadow: inset 0 -2px #0078d4; }

.window-files .explorer-commandbar { grid-row: 2; gap: 3px; padding: 0 8px; overflow: auto; scrollbar-width: none; }
.window-files .explorer-commandbar button {
  display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 6px; height: 33px; min-width: 44px;
  padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--explorer-text);
  font-size: 12px; white-space: nowrap;
}
.window-files .explorer-commandbar button:hover:not(:disabled) { background: var(--explorer-hover); }
.window-files .explorer-commandbar button svg { color: #346b99; }
.window-files .explorer-command-primary { min-width: 76px; justify-content: start; }
.window-files .explorer-command-divider { height: 30px; margin: 0 4px; border-left: 1px solid var(--explorer-line); }
.window-files .explorer-commandbar .explorer-more { font-size: 17px; }
.window-files .explorer-spacer { flex: 1; }
.window-files .explorer-commandbar [aria-pressed=true] { background: var(--explorer-selected); }

.window-files .explorer-sidebar {
  grid-row: 3; grid-column: 1; display: block; min-width: 0; min-height: 0; overflow: auto;
  padding: 5px 6px 10px 3px; border-right: 1px solid var(--explorer-line); scrollbar-gutter: stable;
}
.window-files .explorer-sidebar::-webkit-scrollbar { width: 12px; }
.window-files .explorer-sidebar::-webkit-scrollbar-thumb { background: #b1b1b1; border: 4px solid var(--explorer-surface); }
.window-files .explorer-nav-label, .window-files .explorer-nav-separator { height: 0; margin: 14px 8px; border-bottom: 1px solid var(--explorer-line); font-size: 0; }
.window-files .explorer-tree-row { display: flex; align-items: center; min-width: 0; height: 32px; border: 1px solid transparent; }
.window-files .explorer-tree-row:hover { background: var(--explorer-hover); }
.window-files .explorer-tree-row.active { background: var(--explorer-side-selected); border-color: #a2a2a2; }
.window-files .explorer-tree-toggle {
  display: grid; place-items: center; flex: 0 0 22px; height: 30px; padding: 0;
  border: 0; background: transparent; color: var(--explorer-muted); font-size: 14px;
}
.window-files :is(.explorer-nav, .explorer-tree-item) {
  display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; height: 30px; padding: 0 5px 0 6px;
  border: 0; border-radius: 0; background: transparent; color: var(--explorer-text); text-align: left; font-size: 12px;
  overflow: hidden; white-space: nowrap;
}
.window-files .explorer-sidebar > .explorer-nav { padding-left: 27px; }
.window-files :is(.explorer-nav, .explorer-tree-item):hover { background: var(--explorer-hover); }
.window-files :is(.explorer-nav, .explorer-tree-item).active { outline: 1px solid #a2a2a2; outline-offset: -1px; background: var(--explorer-side-selected); }
.window-files .explorer-tree-row :is(.explorer-nav, .explorer-tree-item).active { outline: 0; }
.window-files .explorer-nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-files .explorer-pinned-location .explorer-tree-item::after { content: ""; flex: none; width: 10px; height: 10px; margin-left: auto; background: #9ba5ad; clip-path: polygon(38% 0,62% 0,65% 46%,100% 65%,61% 72%,54% 100%,47% 100%,39% 72%,0 65%,35% 46%); transform: rotate(39deg); }

.window-files .explorer-main {
  grid-row: 3; grid-column: 2; display: flex; min-width: 0; min-height: 0; overflow: hidden;
  background: var(--explorer-surface);
}
.window-files .explorer-info-pane { flex: 0 1 220px; min-width: 112px; overflow: auto; padding: 15px; border-left: 1px solid var(--explorer-line); overflow-wrap: anywhere; }
.window-files .explorer-info-pane p { margin: 6px 0; color: var(--explorer-muted); }
.window-files .explorer-stage {
  position: relative; align-content: start; flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 0;
  background: var(--explorer-surface);
}
.window-files .explorer-stage.details {
  --name-column: 257px; --date-column: 144px; --type-column: 120px; --size-column: 80px;
  display: block; padding-left: 13px;
}
.window-files .explorer-details-header, .window-files .explorer-stage.details .explorer-file {
  display: grid; grid-template-columns: var(--name-column) var(--date-column) var(--type-column) var(--size-column);
  align-items: center; width: max-content; min-width: 0; gap: 0;
}
.window-files .explorer-details-header {
  position: sticky; top: 0; z-index: 2; height: 27px; color: #486074; background: var(--explorer-surface); font-size: 12px;
}
.window-files .explorer-details-header > * { position: relative; height: 100%; display: flex; align-items: center; padding: 0 8px; border: 0; border-right: 1px solid var(--explorer-line); background: transparent; color: inherit; font: inherit; }
.window-files .explorer-details-header > button:hover { background: var(--explorer-hover); }
.window-files .explorer-details-header > button.active::after { content: "⌃"; position: absolute; left: 50%; top: -2px; }
.window-files .explorer-details-header > :first-child { padding-left: 16px; }
.window-files .explorer-file {
  border: 1px solid transparent; border-radius: 0; background: transparent; color: var(--explorer-text); text-align: left; font: inherit;
}
.window-files .explorer-file .file-name { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.window-files .explorer-file .file-glyph { width: 16px; height: 16px; display: inline-grid; place-items: center; }
.window-files .explorer-file:hover { background: var(--explorer-hover); }
.window-files .explorer-file.selected { background: var(--explorer-selected); }
.window-files .explorer-file:focus-visible { outline: 1px solid #343434; outline-offset: -1px; }
.window-files .explorer-stage.details .explorer-file { min-height: 28px; padding: 1px 0; }
.window-files .explorer-stage.details .explorer-file.selected:focus { outline: 1px solid var(--explorer-text); outline-offset: -1px; background: var(--explorer-surface); }
.window-files .explorer-stage.details .explorer-file:has(> .file-glyph) { grid-template-columns: 22px calc(var(--name-column) - 22px) var(--date-column) var(--type-column) var(--size-column); }
.window-files .explorer-stage.details .explorer-file > .file-glyph { margin-left: 4px; }
.window-files .explorer-stage.details .explorer-name { display: flex; align-items: center; gap: 4px; min-width: 0; padding-left: 4px; }
.window-files :is(.file-date, .file-type, .file-size) { padding: 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--explorer-muted); font-size: 11px; }

.window-files .explorer-stage.icons {
  display: grid; grid-template-columns: repeat(auto-fill, 111px); gap: 9px 9px; justify-content: start; padding: 10px 9px;
}
.window-files .explorer-stage.icons .explorer-file {
  display: flex; flex-direction: column; align-items: center; justify-content: start; gap: 3px;
  width: 111px; min-height: 128px; padding: 0 1px 5px; text-align: center;
}
.window-files .explorer-thumbnail { display: grid; place-items: center; flex: none; width: 90px; height: 90px; }
.window-files .explorer-thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; }
.window-files .explorer-thumbnail .file-glyph, .window-files .explorer-thumbnail svg { width: 64px; height: 64px; }
.window-files .explorer-stage.icons .file-name {
  display: -webkit-box;
  max-width: 106px;
  max-height: 2.44em;
  overflow: hidden;
  line-height: 1.22;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.window-files .explorer-select-box { background: #0078d429; border: 1px solid #0078d4; }
.window-files .explorer-file.drop-target, .window-files .explorer-stage.stage-drop-target { outline: 2px solid #0078d4; outline-offset: -2px; }
.window-files .explorer-stage .app-empty { margin: 30px 0; padding: 0; border: 0; background: transparent; color: var(--explorer-muted); }

.window-files .explorer-storage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 250px)); gap: 6px 8px; padding: 8px 9px 10px; }
.window-files .explorer-section-title { grid-column: 1 / -1; margin: 0 0 2px; color: #245391; font-size: 15px; font-weight: 400; }
.window-files .explorer-section-title::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 6px 3px 3px; border: solid #78828d; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.window-files .explorer-storage-card {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 7px; align-items: center;
  min-height: 49px; padding: 3px 4px 3px 11px; border: 1px solid transparent; border-radius: 2px;
  background: transparent; color: var(--explorer-text); text-align: left;
}
.window-files .explorer-storage-card:hover { border-color: #c7deef; background: var(--explorer-hover); }
.window-files .explorer-storage-card.selected { border-color: #8fc5ec; background: var(--explorer-selected); }
.window-files .explorer-storage-icon { grid-row: 1 / 4; display: grid; place-items: center; width: 44px; }
.window-files .explorer-storage-icon svg { width: 44px; height: 39px; }
.window-files .explorer-storage-card strong { font-weight: 400; }
.window-files .explorer-storage-card small { color: var(--explorer-muted); font-size: 11px; white-space: nowrap; }
.window-files .explorer-capacity-bar { height: 13px; border: 1px solid #b9b9b9; background: #e6e6e6; }
.window-files .explorer-capacity-bar > i { display: block; height: 100%; background: #0078d4; }
.window-files .explorer-capacity-bar.danger > i { background: #c93126; }

.window-files .explorer-status {
  grid-row: 4; grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; margin: 0;
  padding: 0 4px 0 13px; border-top: 1px solid var(--explorer-line); color: var(--explorer-text); font-size: 11px;
}
.window-files .explorer-status > :first-child { margin-right: auto; }
.window-files .explorer-status button { display: grid; place-items: center; width: 22px; height: 20px; border: 1px solid transparent; padding: 2px; background: transparent; color: inherit; }
.window-files .explorer-status button:hover, .window-files .explorer-status button.active { border-color: #97c4f3; background: var(--explorer-selected); }
.window-files .explorer-status button svg { width: 13px; height: 13px; }

body[data-theme=dark] .window-files {
  --explorer-surface: #202020; --explorer-text: #eee; --explorer-muted: #b3bcc9; --explorer-caption: #303844;
  --explorer-nav: #272727; --explorer-field: #343434; --explorer-line: #42454b; --explorer-hover: #344658;
  --explorer-selected: #263e59; --explorer-side-selected: #414955;
}
body[data-theme=dark] .window-files:has(.explorer-storage-grid) > .window-titlebar { background: var(--explorer-caption); }
body[data-theme=dark] .window-files .explorer-tab.active { background: var(--explorer-nav); border-color: var(--explorer-line); }
body[data-theme=dark] .window-files .explorer-tab:not(.active):hover, body[data-theme=dark] .window-files .explorer-tab-close:hover { background: var(--explorer-hover); }
body[data-theme=dark] .window-files :is(.explorer-section-title, .explorer-details-header, .explorer-commandbar button svg) { color: #a8cfe9; }

@container (max-width: 680px) {
  .window-files .explorer { grid-template-columns: minmax(86px, 25%) minmax(0, 1fr); }
  .window-files .explorer-navrow { gap: 2px; }
  .window-files .explorer-navrow > button { flex-basis: 28px; }
  .window-files .explorer-searchbox { flex-basis: 122px; min-width: 82px; }
  .window-files .explorer-stage.details { --name-column: 175px; --date-column: 115px; --type-column: 108px; --size-column: 66px; padding-left: 4px; }
}
