/* File controls are confined to Settings; the Piste document is unchanged. */
body.settings-page .rtm-file-workspace { min-width: 0; }
body.settings-page .rtm-file-workspace :is(.file-explorer-toolbar, .file-picker-toolbar) :is(#fileExplorerRename, #fileExplorerDelete, #fileExplorerDownload, #filePickerRename, #filePickerDelete) { display: none; }
body.settings-page .rtm-file-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 12px 0; font-size: 13px; }
body.settings-page .rtm-file-breadcrumb button { font: inherit; color: var(--accent); border: 0; background: transparent; padding: 5px 3px; cursor: pointer; overflow-wrap: anywhere; }
body.settings-page .rtm-file-breadcrumb button[aria-current] { color: var(--text); font-weight: 650; cursor: default; }
body.settings-page .rtm-file-breadcrumb > span { color: var(--muted); }
body.settings-page .rtm-file-tools { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 220px); gap: 12px; margin: 12px 0; }
body.settings-page .rtm-file-tools label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
:root body.settings-page .rtm-file-workspace :is(input:not([type=file]), select) { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--field-border) !important; border-radius: 6px; background: var(--field-bg) !important; color: var(--input-text) !important; font: inherit; color-scheme: inherit; }
:root body.settings-page .rtm-file-workspace :is(input, select)::placeholder { color: var(--muted); }
body.settings-page .rtm-file-count { color: var(--muted); margin: 4px 0 12px; font-size: 12px; }
body.settings-page .rtm-file-technical { margin: 10px 0; font-size: 12px; }
body.settings-page .rtm-file-technical summary { cursor: pointer; color: var(--muted); padding: 5px 0; }
body.settings-page .rtm-file-technical code { display: block; margin-top: 7px; overflow-wrap: anywhere; color: var(--text); }
body.settings-page .rtm-file-technical .file-explorer-path,
body.settings-page .rtm-file-technical .file-picker-path { padding: 8px 0; }
:root body.settings-page .rtm-file-workspace .rtm-file-list,
:root body.settings-page .rtm-file-workspace .rtm-file-details { background: var(--panel); color: var(--text); border-color: var(--line); }
body.settings-page .rtm-file-list { display: block; padding: 0; }
body.settings-page .rtm-file-table-header,
body.settings-page .rtm-file-table-row { display: grid; grid-template-columns: minmax(150px, 1fr) 80px 80px 140px; align-items: center; gap: 10px; padding: 10px 12px; }
body.settings-page .rtm-file-table-header { position: sticky; top: 0; z-index: 1; background: var(--panel-2); color: var(--muted); font-size: 11px; font-weight: 650; border-bottom: 1px solid var(--line); }
body.settings-page .rtm-file-table-row { border-bottom: 1px solid var(--line); font-size: 12px; min-width: 0; }
body.settings-page .rtm-file-table-row > :first-child { min-width: 0; }
body.settings-page .rtm-file-table-row > :not(:first-child) { color: var(--muted); overflow-wrap: anywhere; }
body.settings-page .rtm-file-table-row:last-child { border-bottom: 0; }
body.settings-page .rtm-file-table-row.selected { background: var(--accent-soft); }
:root body.settings-page .rtm-file-workspace button.rtm-file-name.file-browser-item { display: block; min-height: 36px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text); box-shadow: none; }
:root body.settings-page .rtm-file-workspace button.rtm-file-name.file-browser-item strong { color: inherit; font-size: 13px; }
body.settings-page .rtm-file-name .file-item-main { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
body.settings-page .rtm-file-name .file-type-icon { width: 28px; height: 30px; }
body.settings-page .rtm-file-empty { padding: 28px 16px; color: var(--muted); line-height: 1.5; }
body.settings-page .rtm-file-details { gap: 16px; }
body.settings-page .file-preview-surface { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; padding: 12px; }
body.settings-page .file-preview-surface img { width: 100%; max-height: 320px; object-fit: contain; }
body.settings-page .file-preview-surface .rtm-file-preview-note { color: #263447; background: #f3f5f7; }
body.settings-page .rtm-file-workspace .rtm-file-name strong { white-space: normal; overflow-wrap: anywhere; }
body.settings-page .rtm-file-workspace :is(.file-picker-toolbar,.file-explorer-toolbar) { flex-wrap: wrap; gap: 8px; }
body.settings-page .rtm-file-metadata { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 12px; }
body.settings-page .rtm-file-metadata dt { color: var(--muted); }
body.settings-page .rtm-file-metadata dd { margin: 0; overflow-wrap: anywhere; }
body.settings-page .rtm-file-preview-note { padding: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; line-height: 1.5; font-size: 12px; }
body.settings-page .rtm-file-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
body.settings-page .rtm-file-access { margin: 8px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
body.settings-page .rtm-file-action-dialog { width: min(490px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); padding: 22px; }
body.settings-page .rtm-file-action-dialog::backdrop { background: #0009; }
body.settings-page .rtm-file-action-dialog h2 { font-size: 19px; margin: 0 0 14px; }
body.settings-page .rtm-file-action-dialog p { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
body.settings-page .rtm-file-action-dialog label { display: grid; gap: 8px; font-size: 13px; }
body.settings-page .rtm-file-action-dialog .rtm-file-detail-actions { justify-content: flex-end; margin-top: 20px; }
body.settings-page .rtm-file-action-dialog .rtm-file-dialog-error { color: var(--danger); }
body.settings-page .rtm-file-workspace :is(button, input, select, summary):focus-visible { outline: 3px solid var(--field-focus); outline-offset: 2px; }
body.settings-page .rtm-file-workspace .file-explorer-layout { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); min-height: 360px; }
body.settings-page .rtm-file-workspace .file-picker-layout { grid-template-columns: minmax(0, 1fr) minmax(230px, 300px); }
body.settings-page .rtm-file-workspace.file-picker-modal { width: min(1150px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: auto; }
body.settings-page .rtm-file-workspace.file-picker-modal > :is(.rtm-file-breadcrumb, .rtm-file-tools, .rtm-file-count, .rtm-file-technical, .rtm-file-access) { margin-left: 18px; margin-right: 18px; }
@media (max-width: 1180px) {
  body.settings-page .rtm-file-table-header, body.settings-page .rtm-file-table-row { grid-template-columns: minmax(120px, 1fr) 70px 70px; }
  body.settings-page .rtm-file-table-header > :last-child, body.settings-page .rtm-file-table-row > :last-child { display: none; }
}
@media (max-width: 860px) {
  body.settings-page .rtm-file-workspace .file-explorer-layout,
  body.settings-page .rtm-file-workspace .file-picker-layout { grid-template-columns: minmax(0, 1fr); max-height: none; min-height: 0; overflow: visible; }
  body.settings-page .rtm-file-workspace .rtm-file-list { min-height: 150px; max-height: 350px; }
  body.settings-page .rtm-file-workspace .rtm-file-details { min-height: 160px; max-height: none; }
  body.settings-page .rtm-file-workspace .file-picker-layout { padding: 0 12px; flex: 1 0 auto; }
}
@media (max-width: 460px) {
  body.settings-page .rtm-file-tools { grid-template-columns: minmax(0, 1fr); }
  body.settings-page .rtm-file-table-header, body.settings-page .rtm-file-table-row { grid-template-columns: minmax(0, 1fr) 58px; padding: 9px; gap: 7px; }
  body.settings-page .rtm-file-table-header > :nth-child(2), body.settings-page .rtm-file-table-row > :nth-child(2) { display: none; }
  body.settings-page .rtm-file-workspace.file-picker-modal { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  body.settings-page .rtm-file-workspace .file-picker-toolbar { padding: 10px 12px 0; }
}
