/* File explorer owns its layout; generic ledger controls stay unchanged. */
body:has(.file-explorer) #workspace:not(.directory-collapsed):not([hidden]){grid-template-columns:var(--directory-width,260px) minmax(0,1fr);gap:18px}
body:has(.file-explorer) .page-path{flex-wrap:nowrap;min-width:0}
body:has(.file-explorer) .page-path-items{flex-wrap:nowrap;overflow:auto;white-space:nowrap;min-width:0}
body:has(.file-explorer) .page-path-items>*{flex:none}
body:has(.file-explorer) .page-path-items>button{max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body:has(.file-explorer) .page-path-items>button[aria-current=page]{opacity:1;color:#333;cursor:default}
body:has(.file-explorer) .table-directory{overflow:visible;border-radius:10px;align-self:start}
body:has(.file-explorer) .table-directory>details{max-height:calc(100vh - 150px);overflow:auto}
body:has(.file-explorer) #tabs{display:block;padding:8px}
body:has(.file-explorer) #tabs>button{display:block;width:100%;text-align:left;margin:2px 0}
body #sidebar-file-tree{overflow:auto;padding:10px 0;max-height:65vh}
body #sidebar-file-tree .explorer-tree-row{display:flex;align-items:center;height:36px;width:max-content;min-width:100%;box-sizing:border-box;padding-left:calc(var(--depth)*14px);border-radius:6px}
body #sidebar-file-tree .explorer-tree-row[aria-selected=true]{background:#f6e9ed;color:#961932}
body #sidebar-file-tree .explorer-tree-toggle{padding:0!important;min-height:32px;width:24px;flex:0 0 24px;background:transparent}
body #sidebar-file-tree .explorer-tree-name{display:flex;align-items:center;gap:8px;width:195px;min-height:32px;padding:4px!important;font-size:13px;overflow:hidden;text-overflow:ellipsis;background:transparent;text-align:left;white-space:nowrap}
.explorer-tree-name .ui-icon{width:18px;height:18px;color:#aa8856}
.explorer-tree-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
body #sidebar-file-tree .explorer-tree-name{width:calc(var(--directory-width,260px) - 55px)}
.explorer-resize{position:absolute;right:-7px;top:0;bottom:0;width:12px;cursor:col-resize;touch-action:none}
.explorer-resize:hover,.explorer-resize:focus-visible{background:#96193222}
body .file-explorer{padding:18px 20px;border-radius:10px;position:relative}
body .file-explorer .file-status:empty{display:none}
body .explorer-location{display:flex;align-items:center;gap:8px;min-width:0;margin-bottom:12px}
body .explorer-location h2{font-size:20px;line-height:1.4;margin:0;padding:0;background:transparent;border:0;box-shadow:none;color:#303744;overflow-wrap:anywhere;flex:1;min-width:0}
body .explorer-location>button{background:transparent;font-size:12px;flex:none}
body .explorer-location .file-tools{position:relative;margin-left:auto}
body .explorer-path{display:none}
body .explorer-toolbar{display:flex;flex-wrap:wrap;gap:8px;position:relative;margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid #edf0f3}
body .explorer-toolbar>select{width:140px;flex:none;font-size:12px}
body .explorer-toolbar>.file-tools{margin-left:auto}
body .explorer-create>summary{display:none}
body .explorer-create>div{display:flex;gap:6px}
body .explorer-create button:first-child{background:#971a32;color:white}
body .explorer-search{display:flex;gap:6px;flex:1 1 280px;min-width:0;margin:0 0 0 auto;align-items:center}
body .explorer-search input{min-width:80px;width:100%;flex:1}
body .explorer-search select{max-width:112px;padding:8px;font-size:12px}
body .file-explorer .file-tools{order:5;position:relative}
body .explorer-settings{order:4;position:relative}
body .explorer-settings>summary,body .file-explorer .file-tools>summary{cursor:pointer;list-style:none;padding:9px 12px;font-size:12px;border-radius:6px;background:#f3f5f7}
body .explorer-settings[open] .table-display-controls,body .file-explorer .file-tools-menu{position:absolute;right:0;top:100%;z-index:30;background:white;box-shadow:0 8px 28px #18223722;border:1px solid #e1e5ea;padding:14px;border-radius:8px;width:290px;max-width:80vw;box-sizing:border-box}
body .explorer-settings .table-display-controls{display:flex;flex-wrap:wrap;gap:8px;font-size:12px}
body .file-explorer .file-tools-menu{display:grid;gap:6px}
body .explorer-grid{width:100%;overflow:auto}
body .explorer-grid{min-height:0}
.explorer-mobilemeta{display:none}
body .explorer-grid table{min-width:680px;border:0;table-layout:fixed}
body .explorer-grid th{font-size:12px;color:#7b808a;background:#fafbfc;border:0;border-bottom:1px solid #e9edf1;font-weight:500}
body .explorer-grid td{border:0;border-bottom:1px solid #f0f2f4;vertical-align:middle;background:white;font-size:13px;color:#717784}
body .explorer-grid tbody tr:hover td{background:#fafbfc}
body .explorer-grid tbody tr.is-selected td{background:#fcf0f3}
body .explorer-grid td.explorer-name>button{display:flex;align-items:center;gap:12px;width:100%;font-size:14px;line-height:1.45;color:#303744;overflow-wrap:anywhere}
.explorer-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 30px;height:30px;border-radius:5px}
.explorer-icon.is-folder{background:#fff1cd;color:#ad7915;font-size:29px;font-weight:bold}
.explorer-icon.is-file{background:#eaf0fa;color:#5273a1;font-size:9px;font-weight:700}
body .explorer-grid .explorer-meta{font-size:11px;color:#8a929f;margin:0 0 0 42px}
body .explorer-grid .explorer-source{font-size:11px!important;color:#8a929f!important;margin-left:42px;width:calc(100% - 42px)!important;text-decoration:underline}
body .explorer-status{font-size:12px;color:#9096a0;margin:12px 0 0}
body .explorer-select,body .explorer-select-all,body .explorer-view{display:none}
body .file-explorer .file-more-menu .file-link{display:block;text-align:left;background:transparent;font-size:12px}
body .picker-path{display:flex;flex-wrap:wrap;gap:4px;align-items:center;font-size:12px}
body .picker-path button{background:transparent;padding:5px;font-size:12px;overflow-wrap:anywhere}
body .picker-list{display:grid;gap:4px;max-height:50vh;overflow:auto}
body .picker-list button{display:flex;align-items:center;gap:12px;min-height:48px;text-align:left;background:#f7f8fa;overflow-wrap:anywhere}
@media(max-width:760px){
 body:has(.file-explorer) #workspace:not(.directory-collapsed):not([hidden]){display:block}
 body:has(.file-explorer) .table-directory{display:none!important}
 body:has(.file-explorer) .page-path-items{display:none}
 body .file-explorer{padding:12px!important;border-radius:10px}
 body .explorer-location{flex-wrap:wrap;gap:4px;margin:0 0 8px}
 body .explorer-location h2{flex:1 1 100%;font-size:18px;order:-1}
 body .explorer-location .file-tools{margin-left:auto}
 body .explorer-location>button{min-height:36px;font-size:12px;padding:5px 8px}
 body .explorer-path{display:block;margin:0 0 12px;font-size:12px;color:#7e8590}
 body .explorer-path summary{padding:6px;cursor:pointer}
 body .explorer-path .file-breadcrumb{display:flex;flex-wrap:wrap;gap:3px;margin:6px 0}
 body .explorer-toolbar{display:flex!important;gap:8px;margin-bottom:4px;padding-bottom:10px}
 body .explorer-toolbar>*{width:auto!important;flex:none}
 body .explorer-toolbar .explorer-search{order:-1;width:100%!important;flex:1 1 100%;margin:0}
 body .explorer-search input{width:0!important;font-size:13px;padding:10px}
 body .explorer-search button{padding:9px!important;min-height:44px}
 body .explorer-search select{width:84px;font-size:11px;padding:7px}
 body .explorer-create{position:relative}
 body .explorer-create>summary{display:block;list-style:none;background:#971a32;color:white;padding:12px 10px;border-radius:7px;font-size:12px;cursor:pointer}
 body .explorer-create:not([open])>div{display:none}
 body .explorer-create[open]>div{display:grid;position:absolute;top:100%;left:0;z-index:25;background:white;border:1px solid #e2e5ea;box-shadow:0 8px 24px #15203022;border-radius:8px;padding:8px;width:170px}
 body .explorer-create button{min-height:44px!important;width:100%}
 body .explorer-toolbar>select{font-size:12px;width:116px!important;min-height:44px;padding:8px}
 body .explorer-select{display:block;min-height:44px;font-size:12px;margin-left:auto}
 body .explorer-settings>summary,body .file-explorer .file-tools>summary{min-height:44px;box-sizing:border-box;padding:12px 8px}
 body .explorer-view{display:block;margin:8px 0;font-size:12px;min-height:44px}
 body .explorer-settings[open]{position:static}
 body .explorer-settings[open] .table-display-controls{right:0;top:100%;width:100%;max-width:100%}
 body .explorer-grid:not(.is-full-table){overflow:visible}
 body .explorer-grid:not(.is-full-table) table,body .explorer-grid:not(.is-full-table) tbody{display:block!important;width:100%!important;min-width:0!important}
 body .explorer-grid:not(.is-full-table) colgroup,body .explorer-grid:not(.is-full-table) thead{display:none!important}
 body .explorer-grid:not(.is-full-table) tr{display:grid;grid-template-columns:minmax(0,1fr) 40px;padding:10px 0;border-bottom:1px solid #edf0f3;gap:0;min-height:65px}
 body .explorer-grid:not(.is-full-table) td{display:none!important;border:0;padding:0!important;min-width:0;height:auto!important;background:transparent!important}
 body .explorer-grid:not(.is-full-table) td.explorer-name{display:block!important;grid-column:1;grid-row:1}
 body .explorer-grid:not(.is-full-table) td:last-child{display:block!important;grid-column:2;grid-row:1;align-self:center}
 body .explorer-grid:not(.is-full-table) td.explorer-name>button{padding:0!important;min-height:32px;font-size:14px;line-height:1.5;display:flex;align-items:flex-start;text-align:left}
 body .explorer-grid:not(.is-full-table) .explorer-meta{display:block;font-size:11px;margin:4px 0 0 42px}
 body .explorer-filename{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
 body .explorer-mobilemeta{display:inline}
 body .explorer-grid:not(.is-full-table) .file-more>summary{width:40px;min-height:44px;padding:14px 8px;text-align:center;box-sizing:border-box}
 body .explorer-grid.is-selecting:not(.is-full-table) tr{grid-template-columns:28px minmax(0,1fr) 40px}
 body .explorer-grid.is-selecting:not(.is-full-table) td:first-child{display:flex!important;align-items:center;grid-column:1;grid-row:1}
 body .explorer-grid.is-selecting:not(.is-full-table) td.explorer-name{grid-column:2}
 body .explorer-grid.is-selecting:not(.is-full-table) td:last-child{grid-column:3}
 body .explorer-grid.is-selecting .explorer-select-all{display:flex;align-items:center;gap:10px;min-height:44px;font-size:12px}
 body .file-explorer:has(.file-selection-bar:not([hidden])){padding-bottom:150px!important}
 body .file-explorer .file-selection-bar{position:fixed;top:auto;bottom:calc(64px + env(safe-area-inset-bottom));left:8px;right:8px;z-index:40;margin:0;padding:10px;gap:6px;display:flex;border-radius:10px;box-shadow:0 -3px 20px #17203911}
 body .file-explorer .file-selection-bar strong{flex:1 1 100%}
 body .file-explorer .file-selection-bar button{min-height:42px;font-size:12px;padding:8px;flex:1 1 auto}
 body dialog.file-dialog[open]{width:100vw!important;max-width:100vw;height:100dvh;max-height:100dvh!important;margin:0;border:0;border-radius:0;padding:20px 16px!important;box-sizing:border-box;display:flex;flex-direction:column}
 body .file-dialog-content{min-height:0;overflow:auto;flex:1}
 body .file-dialog>.file-toolbar{flex:none;margin-top:16px;padding-bottom:env(safe-area-inset-bottom)}
 body .picker-list{max-height:none}
 body .file-more[open] .file-more-menu{left:8px!important;right:8px;top:auto!important;bottom:calc(74px + env(safe-area-inset-bottom));width:auto;padding:12px}
 body .file-more-menu button,body .file-more-menu .file-link{min-height:44px!important;font-size:14px!important}
}
