/* Files */
.win[data-app="files"] .win-title { display: none; }
.win[data-app="files"] .win-bar { gap: 8px; }

/* title-bar toolbar */
.files-nav { display: flex; gap: 0; flex: 0 0 auto; }
.files-nav .icon-btn { width: 30px; height: 30px; }
.files-crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1; overflow: hidden; }
.files-crumb { height: 28px; padding: 0 8px; border: 0; background: none; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; min-width: 0; }
.files-crumb span { overflow: hidden; text-overflow: ellipsis; }
.files-crumb:hover { background: var(--hover); color: var(--text); }
.files-crumb.cur { color: var(--text); font-weight: 700; }
.files-crumb-sep { color: var(--text-3); flex: 0 0 auto; }
.files-crumb.drop-on { background: rgba(var(--accent-rgb), .22); color: var(--text); }
.files-tools { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.files-viewseg button { height: 26px; padding: 0 8px; }
.files-searchwrap { width: 170px; margin-left: 4px; }
.files-search { height: 30px; background: var(--tile); box-shadow: none; }

/* sidebar */
.files-side { width: 200px; }
.files-side .side-item.drop-on { background: rgba(var(--accent-rgb), .22); }
.files-meter { margin-top: auto; padding: 14px 10px 6px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.files-meter-top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.files-meter-top span { display: inline-flex; align-items: center; gap: 6px; }
.files-meter-top .ic { color: var(--accent); }
.files-meter small { font-size: 11.5px; }

/* main */
.files-main { position: relative; container-type: inline-size; }
.files-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.files-banner[hidden] { display: none; }
.files-banner span { display: inline-flex; align-items: center; gap: 8px; }
.files-content { flex: 1; min-height: 0; overflow: auto; outline: none; }
.files-status { height: 30px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--line); }
.files-clip { display: inline-flex; align-items: center; gap: 6px; }

/* grid */
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); align-content: start; gap: 6px; padding: 14px; }
.files-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border-radius: 12px; min-width: 0; }
.files-tile:hover { background: var(--hover); }
.files-tile.sel { background: rgba(var(--accent-rgb), .16); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); }
.files-tile.drop-on { background: rgba(var(--accent-rgb), .3); }
.files-tile.cut { opacity: .45; }
.files-big { height: 64px; display: grid; place-items: center; }
.files-tile .files-name { font-size: 12.5px; font-weight: 500; text-align: center; line-height: 1.25; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }

.files-thumb { width: 72px; height: 54px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-2), 0 3px 10px rgba(0, 0, 0, .25); background-size: cover !important; }
.files-cover { width: 54px; height: 54px; border-radius: 8px; display: grid; place-items: center; color: rgba(255, 255, 255, .92); box-shadow: 0 3px 10px rgba(0, 0, 0, .25); }
.files-pkg { position: relative; width: 52px; height: 52px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 3px 10px rgba(0, 0, 0, .25); }
.files-pkg em { font-style: normal; font-size: 8px; font-weight: 800; text-transform: uppercase; opacity: .9; }
.files-pkg.rt-android { background: linear-gradient(150deg, #34d399, #15803d); }
.files-pkg.rt-windows { background: linear-gradient(150deg, #60a5fa, #1d4ed8); }
.files-pkg.rt-linux { background: linear-gradient(150deg, #fcd34d, #b45309); color: #1a1300; }
.files-mini .file-folder { width: 20px; height: 15px; margin-top: 3px; border-radius: 2px 3px 3px 3px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.files-mini .file-folder::before { width: 9px; height: 4px; top: -3px; border-radius: 2px 3px 0 0; }
.files-mini .file-folder::after { height: 4px; }

/* list */
.files-list { padding: 0 8px 10px; }
.files-row { display: grid; grid-template-columns: minmax(180px, 1fr) 170px 90px 140px; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13px; }
.files-list .files-item:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.files-list .files-item:hover { background: var(--hover); }
.files-list .files-item.sel { background: var(--accent); color: var(--accent-fg); }
.files-list .files-item.sel .files-col { color: inherit; }
.files-list .files-item.cut { opacity: .45; }
.files-list .files-item.drop-on { box-shadow: inset 0 0 0 2px var(--accent); }
.files-head { position: sticky; top: 0; z-index: 1; background: var(--surface); border-radius: 0; border-bottom: 1px solid var(--line); margin: 0 -8px 4px; padding: 0 18px; height: 32px; }
.files-head .files-col { border: 0; background: none; padding: 0; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.files-head .files-col.sorted { color: var(--text); }
.files-col { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.files-col.c-name { display: flex; align-items: center; gap: 10px; color: var(--text); }
.files-mini { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; }
.files-mini .files-thumb { width: 22px; height: 17px; border-radius: 3px; }
.files-mini .files-cover { width: 20px; height: 20px; border-radius: 4px; }
.files-mini .files-pkg { width: 20px; height: 20px; border-radius: 6px; }
.files-mini .files-pkg em { display: none; }
.files-mini .file-doc { width: 16px; height: 20px; border-radius: 2px; }
.files-row .files-name { overflow: hidden; text-overflow: ellipsis; }
.files-loc { color: var(--text-3); font-size: 11.5px; margin-left: 6px; }

/* empty + places */
.files-place-ic { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: rgba(var(--accent-rgb), .14); color: var(--accent); margin-bottom: 6px; }

/* drop from computer */
.files-drop { position: absolute; inset: 10px; border-radius: 14px; border: 2px dashed rgba(var(--accent-rgb), .7); background: rgba(var(--accent-rgb), .1); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--accent); pointer-events: none; }
.files-main.importing .files-drop { display: flex; }

@container (max-width: 560px) { .files-row { grid-template-columns: 1fr 90px; } .files-row .c-mtime, .files-row .c-kind { display: none; } }
[data-layout="mobile"] .files-side, [data-layout="mobile"] .files-searchwrap { display: none; }
@media (max-width: 1000px) { .files-searchwrap { width: 120px; } }
.files-content.files-empty { display: flex; padding: 0; }
.files-content.files-empty .empty-state p { max-width: 340px; }
