.folder-explorer { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.folder-explorer :where(.folder-explorer-toolbar > button, .folder-explorer-history > button, .folder-explorer-presets > button, .folder-explorer-sidebar .location, .folder-explorer-pagination > button, .folder-explorer-path > button) { border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink); padding: 5px 9px; font-size: 12px; line-height: 1.4; }
.folder-explorer :where(.folder-explorer-toolbar > button, .folder-explorer-history > button, .folder-explorer-presets > button, .folder-explorer-sidebar .location, .folder-explorer-pagination > button, .folder-explorer-path > button):hover:not(:disabled) { background: #e4eaf2; }
.folder-explorer :where(.folder-explorer-toolbar > button, .folder-explorer-history > button, .folder-explorer-presets > button, .folder-explorer-sidebar .location, .folder-explorer-pagination > button, .folder-explorer-path > button):disabled { cursor: default; opacity: .4; }
.folder-explorer-toolbar { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; padding: 6px 8px; border-bottom: 1px solid var(--line); background: #f5f7fa; }
.folder-explorer-history { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.folder-explorer-history button { min-width: 30px; padding: 4px 8px; border-color: var(--line); background: var(--paper); font-size: 16px; }
.folder-explorer-title { flex: 1 1 0; min-width: 0; max-width: min(240px, 35vw); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.folder-explorer-presets { display: flex; flex: 0 0 auto; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: #e9eef5; }
.folder-explorer-presets button[aria-pressed=true] { border-color: #c6d2e1; background: var(--paper); font-weight: 600; }
.folder-explorer-toolbar-actions { display: flex; flex: 0 0 auto; min-width: 0; max-width: 100%; }
.folder-explorer:has(.matter-document-more[open], .folder-explorer-columns[open]) { overflow: visible; }
.folder-explorer-columns { position: relative; flex: none; font-size: 12px; }
.folder-explorer-columns > summary { cursor: pointer; padding: 5px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); }
.folder-explorer-column-choices { position: absolute; top: calc(100% + 4px); right: 0; z-index: 12; box-sizing: border-box; width: min(260px, calc(100vw - 40px)); max-height: min(360px, 50dvh); padding: 4px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); box-shadow: 0 8px 24px #172b4d1a; }
.folder-explorer-column-choices label { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 4px; cursor: pointer; color: var(--ink); overflow-wrap: anywhere; }
.folder-explorer-column-choices label:has(:disabled) { color: var(--muted); cursor: default; }
.folder-explorer-column-choices label:hover, .folder-explorer-column-choices label:focus-within { background: #f0f3f7; }
.folder-explorer-column-choices input { flex: none; width: auto; margin: 0; accent-color: var(--teal); }
.folder-explorer-toolbar-actions .matter-actions.matter-document-toolbar-actions { position: static; flex: 1; align-items: center; gap: 6px; min-width: 0; }
.folder-explorer-toolbar-actions .matter-document-toolbar-actions :is(button, .matter-document-more > summary) { min-height: 30px; padding: 4px 8px; font-size: 12px; line-height: 20px; white-space: nowrap; }
.folder-explorer-toolbar-actions .matter-actions .matter-document-more { position: static; }
.folder-explorer-toolbar-actions .matter-document-menu { left: auto; right: 8px; width: min(450px, calc(100% - 16px)); }
.folder-explorer-empty > p { margin: 0; }
.folder-explorer-subfolders { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.folder-explorer-subfolders input { margin: 0; accent-color: var(--teal); }
.folder-explorer-sidebar-toggle { flex: 0 0 auto; }
.folder-explorer-body { display: grid; grid-template-columns: var(--folder-sidebar-width, 200px) 6px minmax(0, 1fr); min-width: 0; }
.folder-explorer-sidebar-resize { cursor: col-resize; touch-action: none; background: #f0f3f7; border-right: 1px solid var(--line); }
.folder-explorer-sidebar-resize:hover, .folder-explorer-sidebar-resize:focus-visible { background: #b5c2d2; }
.folder-explorer-sidebar-resize:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.folder-explorer.sidebar-collapsed .folder-explorer-body { grid-template-columns: minmax(0, 1fr); }
.folder-explorer.sidebar-collapsed .folder-explorer-sidebar { display: none; }
.folder-explorer-sidebar { min-width: 0; max-height: min(64vh, 740px); overflow: auto; overscroll-behavior: contain; padding: 8px 5px; border-right: 1px solid var(--line); background: #f0f3f7; }
.folder-explorer.folders-narrow .folder-explorer-body { grid-template-columns: minmax(0, 1fr); }
.folder-explorer.folders-narrow .folder-explorer-sidebar { max-height: min(40vh, 320px); border-right: 0; border-bottom: 1px solid var(--line); }
.folder-explorer-sidebar h4 { margin: 0 8px 7px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .025em; }
.folder-explorer-sidebar h4:not(:first-child) { margin-top: 18px; }
.folder-explorer-sidebar .location { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; width: 100%; text-align: left; padding: 5px 6px; }
.folder-explorer-location-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-explorer-location-row, .folder-explorer-tree-row { display: flex; align-items: center; min-width: 0; }
.folder-explorer-location-row { flex: 1; }
.folder-explorer-count { flex: none; margin-left: auto; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.folder-explorer-tree, .folder-explorer-tree ul { list-style: none; margin: 0; padding: 0; }
.folder-explorer-tree ul { margin-left: 9px; padding-left: 5px; border-left: 1px solid var(--line); }
.folder-explorer-tree .folder-explorer-icon { flex: none; width: 15px; height: 11px; margin: 2px 0 0; }
.folder-explorer-tree-toggle { flex: none; width: 20px; min-height: 28px; border: 0; padding: 0; background: transparent; color: var(--muted); font: inherit; }
.folder-explorer-tree-toggle:disabled { cursor: default; opacity: 0; }
.folder-explorer-binders { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.folder-explorer-binders > summary { margin: 0 8px 6px; color: var(--muted); font-size: 11px; cursor: pointer; }
.folder-explorer-sidebar .location[aria-current=page] { color: var(--ink); background: #dce4ee; font-weight: 600; }
.folder-explorer-sidebar .folder-explorer-pagination { flex-wrap: wrap; justify-content: flex-start; margin-top: 9px; font-size: 10px; }
.folder-explorer-sidebar .folder-explorer-pagination button { padding: 4px 6px; font-size: 10px; }
.folder-explorer-main { min-width: 0; }
.folder-explorer-library { min-width: 0; padding: 12px; }
.folder-explorer-scroll { min-width: 0; min-height: 240px; max-height: min(60vh, 660px); overflow: auto; scrollbar-gutter: stable; }
.folder-explorer-list { table-layout: fixed; border-spacing: 0; border-collapse: separate; text-align: left; font-size: 12px; outline: none; }
.folder-explorer-list th { position: sticky; top: 0; z-index: 1; padding: 6px 8px 6px 26px; border-bottom: 1px solid var(--line); background: #fafbfd; color: var(--muted); font-size: 10px; font-weight: 550; }
.folder-explorer-reorder { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 18px; padding: 3px 0; border: 0; background: transparent; color: inherit; cursor: grab; }
.folder-explorer-reorder::before { content: '⠿'; font-size: 16px; }
.folder-explorer-reorder:active { cursor: grabbing; }
.folder-explorer-reorder:focus-visible { outline: 2px solid var(--teal); outline-offset: -1px; }
.folder-explorer-list th[data-drop-position=before] { box-shadow: inset 3px 0 var(--teal); }
.folder-explorer-list th[data-drop-position=after] { box-shadow: inset -3px 0 var(--teal); }
.folder-explorer-sort { position: relative; display: block; width: 100%; padding: 4px 36px 4px 0; border: 0; background: transparent; color: inherit; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-explorer-sort::after { content: '↕'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); }
.folder-explorer-list [aria-sort=ascending] .folder-explorer-sort::after { content: '▲'; }
.folder-explorer-list [aria-sort=descending] .folder-explorer-sort::after { content: '▼'; }
.folder-explorer-sort:hover, .folder-explorer-list [aria-sort] .folder-explorer-sort { color: var(--ink); }
.folder-explorer-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: col-resize; touch-action: none; }
.folder-explorer-resize::after { content: ''; position: absolute; top: 20%; bottom: 20%; right: 3px; border-right: 1px solid #b5c2d2; }
.folder-explorer-resize:hover::after, .folder-explorer-resize:focus-visible::after { border-right: 2px solid var(--teal); }
.folder-explorer-resize:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.folder-explorer.resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.folder-explorer-list td { height: 32px; padding: 5px 8px; border-bottom: 1px solid #eef1f5; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.folder-explorer-list td.name { color: var(--ink); }
.folder-explorer-list th.size, .folder-explorer-list td.size { text-align: right; font-variant-numeric: tabular-nums; }
.folder-explorer-list tr[data-key] { cursor: default; user-select: none; -webkit-user-select: none; }
.folder-explorer-list tr[data-key]:hover { background: #f5f7fa; }
.folder-explorer-list tr[aria-selected=true] { background: #e1e7ef; }
.folder-explorer-list tr[aria-selected=true] td { color: var(--ink); }
.folder-explorer-list:focus-within tr[aria-selected=true] { background: #dbeafe; }
.folder-explorer-list:focus-within tr[aria-selected=true] td { border-bottom-color: #bfd0e7; color: var(--ink); }
.folder-explorer-list:focus-visible tr[data-focused=true] { outline: 2px solid #7c9ac1; outline-offset: -2px; }
.folder-explorer-list:focus-visible { box-shadow: inset 0 0 0 2px #7c9ac1; }
.folder-explorer-selection { width: 16px; height: 16px; margin: 0 8px 0 0; vertical-align: middle; accent-color: var(--teal); cursor: pointer; }
.folder-explorer-name { display: inline-block; max-width: calc(100% - 49px); overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.folder-explorer-list tr[aria-selected=true] .folder-explorer-name { color: inherit; }
.folder-explorer-bates { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 1px 0 0 49px; color: var(--muted); font-size: 10px; line-height: 1.25; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.folder-explorer-bates:empty { display: none; }
.folder-explorer-list:focus-within tr[aria-selected=true] .folder-explorer-bates { color: inherit; }
.folder-explorer-document-details, .folder-explorer-document-actions { max-width: 100%; margin: 2px 0 0 49px; font-size: 11px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.folder-explorer-document-details:empty, .folder-explorer-document-actions:empty { display: none; }
.folder-explorer-document-details > :first-child { margin-top: 0; }
.folder-explorer-document-details > :last-child { margin-bottom: 0; }
.folder-explorer-document-details .matter-search-passage { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.folder-explorer-document-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px 8px; }
.folder-explorer-document-actions .matter-document-actions { max-width: 100%; margin-top: 0; }
.folder-explorer-document-actions .matter-document-actions > summary { color: inherit; }
.folder-explorer-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 19px; height: 20px; margin-right: 5px; vertical-align: middle; color: var(--muted); }
.folder-explorer-icon.folder { width: 20px; height: 14px; margin-top: 3px; border: 1px solid #5d97c8; border-radius: 2px; background: #a8d4f1; }
.folder-explorer-icon.folder::before { content: ''; position: absolute; top: -4px; left: -1px; width: 10px; height: 5px; border: 1px solid #5d97c8; border-bottom: 0; border-radius: 2px 2px 0 0; background: #a8d4f1; }
.folder-explorer-icon.file { height: 22px; border: 1px solid #a5b2c2; border-radius: 2px; background: #fff; color: #52647d; font-size: 6px; font-weight: 700; line-height: 1; }
.folder-explorer-list:focus-within tr[aria-selected=true] .folder-explorer-icon.folder { border-color: #d5eafa; background: #b8ddf7; }
.folder-explorer-list:focus-within tr[aria-selected=true] .folder-explorer-icon.folder::before { border-color: #d5eafa; background: #b8ddf7; }
.folder-explorer-list.review { font-size: 13px; }
.folder-explorer-list.review td { height: 34px; padding-block: 0; }
.review-name-line, .review-value-line { display: flex; align-items: center; min-width: 0; }
.review-name-line .folder-explorer-name { flex: 1; min-width: 0; max-width: none; }
.review-name-line .folder-explorer-context, .review-name-line .folder-explorer-document-actions { flex: none; margin: 0 0 0 4px; }
.review-name-line .folder-explorer-document-actions > button { padding: 2px 4px; border: 0; background: transparent; color: var(--muted); }
.review-grid-details { max-width: min(560px, calc(100vw - 32px)); max-height: 80dvh; overflow: auto; overflow-wrap: anywhere; }
.review-field-detail { white-space: pre-wrap; }
.review-grid-details > button { margin-top: 12px; }
.folder-explorer-list.review :is(th, td).name { position: sticky; left: 0; z-index: 2; }
.folder-explorer-list.review.name-scrolls :is(th, td).name { left: auto; }
.folder-explorer-list.review td.name { background: var(--paper); }
.folder-explorer-list.review th.name { z-index: 4; background: #fafbfd; }
.folder-explorer-list.review .review-cell { display: block; width: 100%; min-width: 0; padding: 0 8px; height: 33px; text-align: left; font: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-explorer-list.review tr[data-document-id] > td:not(.name) { padding-inline: 0; }
.folder-explorer-list.review .review-field { background: transparent; color: inherit; border: 0; }
.folder-explorer-list.review tbody :is(a, .text-button, .review-cell) { text-decoration: none; }
.folder-explorer-list.review tbody :is(a, .text-button, .review-cell):is(:hover, :focus-visible) { text-decoration: underline; }
.folder-explorer-list.review .review-cell:focus-visible { outline-offset: -3px; }
.folder-explorer-progress { margin-top: 3px; }
.folder-explorer-progress progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 2px; appearance: none; background: var(--line); }
.folder-explorer-progress progress::-webkit-progress-bar { border-radius: 2px; background: var(--line); }
.folder-explorer-progress progress::-webkit-progress-value { border-radius: 2px; background: var(--teal); }
.folder-explorer-progress progress::-moz-progress-bar { border-radius: 2px; background: var(--teal); }
.folder-explorer-progress span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.folder-explorer-list.review td.review-cell-waiting, .folder-explorer-list.review td.review-cell-analyzing { color: var(--muted); }
.folder-explorer-list.review td.review-cell-analyzing .review-field::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--teal); animation: review-cell-pulse 1.1s ease-in-out infinite; }
@keyframes review-cell-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .folder-explorer-list.review td.review-cell-analyzing .review-field::after { animation: none; } }
.folder-explorer-list.review .review-state { overflow: hidden; text-overflow: ellipsis; padding-right: 4px; font-size: 9px; line-height: 1.3; }
.folder-explorer-list:focus-within tr[aria-selected=true] :is(.text-button, .review-state) { color: inherit; }
.folder-explorer-list.review tr[data-key]:hover td.name { background: #f5f7fa; }
.folder-explorer-list.review tr[aria-selected=true] td.name { background: #e1e7ef; }
.folder-explorer-list.review:focus-within tr[aria-selected=true] td.name { background: #dbeafe; }
.folder-explorer-empty { margin: 0; padding: 38px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.folder-explorer-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 14px; min-height: 36px; padding: 5px 11px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.folder-explorer-controls > p { flex: 1 1 auto; margin: 0; color: var(--muted); font-size: 11px; }
.folder-explorer-page-controls { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px 14px; max-width: 100%; }
.folder-explorer-page-size { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; max-width: 100%; color: var(--muted); font-size: 11px; }
.folder-explorer-page-size select { width: auto; min-width: 64px; padding: 4px 6px; font-size: 11px; }
.folder-explorer-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 11px; }
.folder-explorer-pagination > span { white-space: nowrap; }
.folder-explorer-pagination button { font-size: 11px; }
.folder-explorer-path { display: flex; align-items: center; gap: 2px; min-height: 33px; padding: 4px 8px; border-bottom: 1px solid var(--line); background: #fafbfd; overflow-x: auto; }
.folder-explorer-path button, .folder-explorer-path [aria-current], .folder-explorer-path-file { flex: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.folder-explorer-path [aria-current] { padding: 5px 9px; color: var(--ink); font-weight: 550; }
.folder-explorer-path > span:not([aria-current]):not(.folder-explorer-path-file) { color: #8a9bb0; font-size: 12px; }
@media (max-width: 680px) {
  .folder-explorer-toolbar { gap: 6px; }
  .folder-explorer-list th, .folder-explorer-list td { padding-right: 7px; }
  .folder-explorer-list td { padding-left: 7px; }
}
@media (max-width: 430px) {
}

.folder-document-details > small { display: block; }

.column-filter-dialog { width: min(360px, calc(100vw - 32px)); max-height: 80dvh; overflow: auto; }
.column-filter-dialog form { display: grid; gap: 12px; }
.column-filter-dialog h2 { margin: 0; font-size: 18px; }
.column-filter-dialog select[multiple] { min-height: 100px; max-height: 180px; }
.column-filter-dialog input[type=checkbox] { width: auto; margin-right: 8px; }
.folder-column-filter { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 2px 5px; border: 0; background: transparent; color: var(--muted); }
.column-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.column-filter-chips button { font-size: 12px; }
.folder-column-filter::before { content: '▽'; }
.folder-column-filter[aria-pressed=true] { color: var(--teal); background: var(--soft); }
.column-filter-dialog .hint:empty { display: none; }
.column-filter-dialog .form-actions { margin-top: 4px; }
.column-filter-dialog select { min-height: 36px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); }
