/* File browser page (pages/files.js) */
.fi { display: inline-flex; flex: none; color: var(--text-2); }
.fi svg { width: 16px; height: 16px; }
.fi-folder { color: var(--accent); }
.fi-link { color: var(--series-3); }
.fi-image { color: var(--series-2); }
.fi-archive { color: var(--warning-ink); }
.fi-big svg { width: 40px; height: 40px; stroke-width: 1.5; }
.fi-flip { transform: rotate(180deg); }

.fb-pathbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 6px; }
.fb-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 0; flex: 1; min-width: 0; cursor: text; }
.fb-crumb { height: 26px; padding: 0 6px; border: 0; background: none; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.fb-crumb:hover { background: var(--surface-2); color: var(--text); }
.fb-crumb.on { color: var(--text); font-weight: 650; }
.fb-crumb-sep { color: var(--text-3); font-family: var(--mono); }
.fb-pathinput { display: none; flex: 1; height: 28px; }
.fb-pathinput.show { display: block; }
.fb-elev { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning-ink); border-color: transparent; }
.fb-elev .ico svg { width: 12px; height: 12px; }

.fb-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .fb-layout { grid-template-columns: 1fr; } .fb-side { display: none; } }
.fb-places { display: flex; flex-direction: column; gap: 2px; }
.fb-places a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--text-2); text-decoration: none; font-size: 13px; }
.fb-places a:hover { background: var(--surface-2); color: var(--text); }
.fb-places a.on { background: var(--accent-wash); color: var(--accent-ink); }

.fb-main { position: relative; min-height: 420px; }
.fb-main.fb-drop { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-wash); }
.fb-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 12px 0; align-items: center; }
.fb-toolbar .fi svg { width: 14px; height: 14px; }
.fb-toolbar button.primary .fi { color: #fff; }
.fb-toolbar button.danger .fi { color: var(--critical-ink); }
.fb-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.fb-filters { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.fb-info { font-size: 12.5px; }
@media (max-width: 1300px) { .fb-tlabel { display: none; } .fb-toolbar button.sm { width: 30px; padding: 0; } }

.fb-list { min-height: 200px; }
.fb-list.fb-loading { opacity: .55; }
.fb-table th.fb-sort { cursor: pointer; user-select: none; }
.fb-table th.fb-sort.on { color: var(--text); }
.fb-table .fb-check { width: 32px; padding-right: 0; }
.fb-row { cursor: default; user-select: none; }
.fb-row.sel td { background: var(--accent-wash) !important; }
.fb-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fb-nm { font-weight: 520; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }
.fb-target { font-size: 12px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

.fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; padding: 12px; }
.fb-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 8px; border-radius: 10px; cursor: default; user-select: none; border: 1px solid transparent; }
.fb-tile:hover { background: var(--surface-2); }
.fb-tile.sel { background: var(--accent-wash); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.fb-tile-name { font-size: 12.5px; text-align: center; word-break: break-all; line-height: 1.3; max-height: 2.6em; overflow: hidden; }

.fb-uploads { padding: 8px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.fb-up { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 160px auto; gap: 10px; align-items: center; font-size: 13px; }
.fb-up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-up-meter { height: 6px; }
.fb-up.err .fb-up-meter > span { background: var(--critical); }

.fb-editor { height: 64vh; }
.fb-editor textarea.fb-ta { color: var(--text); }
.fb-editor textarea.fb-ta::selection { color: inherit; }
.modal.fb-editor-modal { width: min(1200px, 100%); }
.fb-perm { width: auto; }
.fb-perm td, .fb-perm th { padding: 4px 12px; text-align: center; }
.fb-perm td:first-child { text-align: left; }
