/* Device file browser and explicit local backup controls. All filenames remain ordinary buttons. */
.workspace-page[data-page=files] {padding:clamp(22px,4vw,58px) clamp(14px,4vw,68px) 42px;}
.files-workspace {max-width:1180px;margin:0 auto;}
.files-heading {display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px;margin-bottom:26px;}
.workspace-page[data-page=files] .files-heading h1 {
    color:var(--ink);font-size:clamp(27px,3vw,43px);line-height:1.08;letter-spacing:-.052em;font-weight:720;
}
.files-heading p {margin:9px 0 0;font-size:14px;line-height:1.5;color:var(--muted);}
.files-actions,.files-new-document,.files-open-document,.files-backups summary,.files-folder-choice,.files-open-section,.files-recent {
    display:inline-flex;align-items:center;gap:8px;
}
.files-actions {flex-wrap:wrap;gap:8px;}
.files-actions :is(button,summary),.files-open-section,.files-folder-choice,.files-open-file,.files-recent {font:inherit;cursor:pointer;}
.files-new-document,.files-open-document,.files-backups summary {
    box-sizing:border-box;min-height:40px;padding:7px 12px;border:1px solid var(--line);border-radius:8px;
    font-size:14px!important;font-weight:650!important;line-height:1.3;white-space:nowrap;
}
.files-new-document {color:var(--on-action);background:var(--action);border-color:var(--action);}
.files-new-document:hover {background:var(--navy);}
.files-open-document {color:var(--ink);background:var(--surface);}
.files-open-document:hover {background:var(--selection);}
.files-backups {position:relative;justify-self:end;font-family:inherit;}
.files-backups summary {background:var(--surface);color:var(--ink);list-style:none;}
.files-backups summary::-webkit-details-marker {display:none;}
.files-backups[open] summary,.files-backups summary:hover {border-color:var(--control-edge);background:var(--selection);}
.files-backup-panel {
    position:absolute;inset-block-start:calc(100% + 6px);inset-inline-end:0;z-index:6;min-width:186px;
    max-width:calc(100vw - 30px);padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 24px #27113b24;
}
.files-backup-group h3 {margin:5px 8px 2px;font-size:12px;line-height:1.3;color:var(--muted);}
.files-backup-group+.files-backup-group {margin-top:4px;padding-top:4px;border-top:1px solid var(--line);}
.files-backup-group button {display:block;width:100%;min-height:36px;text-align:left;border:0;border-radius:5px;background:var(--surface);padding:5px 8px;color:var(--ink);font-size:14px;}
.files-backup-group button:hover {background:var(--selection);}
.files-recent {padding:0;margin:0 0 13px;border:0;background:none;color:var(--accent);font-size:14px;text-align:left;overflow-wrap:anywhere;}
.files-workspace>.device-status {padding:8px 12px;border-inline-start:3px solid #8b65bf;background:var(--selection);color:var(--ink);}
.files-folders {display:flex;flex-wrap:wrap;gap:5px;padding:4px;margin-bottom:14px;width:max-content;max-width:100%;border:1px solid var(--line);border-radius:10px;background:var(--background);}
.files-folder-choice {min-height:36px;padding:5px 11px;border:1px solid transparent;border-radius:7px;background:transparent;color:var(--muted);font-size:13px;font-weight:620;}
.files-folder-choice[aria-pressed=true] {background:var(--surface);border-color:var(--control-edge);color:var(--accent);box-shadow:0 1px 3px #24133412;}
.files-folder-choice:hover {color:var(--ink);background:var(--selection);}
.files-count {font-size:12px;font-weight:550;color:var(--muted);font-variant-numeric:tabular-nums;}
.files-contents {overflow:hidden;border:1px solid var(--line);border-radius:13px;background:var(--surface);}
.files-group+.files-group {border-top:1px solid var(--line);}
.files-group-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px clamp(13px,2vw,24px);background:var(--background);}
.files-group-heading h2 {display:flex;align-items:center;gap:10px;margin:0;font-weight:670;font-size:17px;line-height:1.3;letter-spacing:-.018em;}
.files-group-heading h2 .files-icon {color:var(--accent);}
.files-open-section {border:0;background:none;color:var(--accent);font-size:13px;font-weight:610;padding:4px 1px;}
.files-open-section:hover,.files-open-file:hover .files-filename,.files-recent:hover {text-decoration:underline;text-underline-offset:3px;}
.files-kind-heading {margin:12px clamp(15px,2vw,25px) 3px;color:var(--muted);font-size:12px;font-weight:620;}
.files-list {margin:0 0 8px;padding:0;list-style:none;}
.files-open-file {
    display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;
    box-sizing:border-box;width:100%;min-height:40px;padding:3px clamp(15px,2vw,25px);border:0;
    background:none;color:var(--ink);text-align:start;font-size:14px;font-weight:540;line-height:1.4;overflow-wrap:anywhere;
}
.files-open-file:hover,.files-open-file:focus {background:var(--selection);}
.files-open-file:focus-visible {outline:2px solid var(--accent);outline-offset:-2px;}
.files-open-file .files-icon {color:var(--muted);}
.files-meta {color:var(--muted);font-size:12px;}
.files-empty {margin:0;padding:12px clamp(15px,2vw,25px) 18px;color:var(--muted);font-size:14px;}
.files-icon {display:inline-block;flex:none;width:17px;height:17px;background:currentColor;mask:center/contain no-repeat var(--file-symbol);}
@media(max-width:820px) {
    .files-heading {grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:13px 8px;}
    .files-actions {grid-column:1/-1;grid-row:2;}
    .files-backups {grid-column:2;grid-row:1;}
}
@media(max-width:600px) {
    .files-heading {align-items:flex-start;gap:15px;margin-bottom:18px;}
    .files-folders {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;gap:2px;}
    .files-folder-choice {padding:4px;justify-content:center;gap:4px;}
    .files-folder-choice .files-icon {display:none;}
    .files-group-heading {padding-block:10px;}
}
@media(pointer:coarse) {.files-backups summary,.files-new-document,.files-open-document,.files-folder-choice,.files-open-file,.files-open-section,.files-backup-group button {min-height:44px;}}
@media(forced-colors:active){.files-icon {background:CanvasText;}.files-folder-choice[aria-pressed=true] {outline:2px solid Highlight;}}
.icon-folder {--file-symbol:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%207a2%202%200%200%201%202-2h5l2%202h7a2%202%200%200%201%202%202v9a2%202%200%200%201-2%202H5a2%202%200%200%201-2-2z%22%2F%3E%3C%2Fsvg%3E");}
.icon-library {--file-symbol:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%205h7v6H3z%20M14%205h7v6h-7z%20M3%2015h7v5H3z%20M14%2015h7v5h-7z%22%2F%3E%3C%2Fsvg%3E");}
.icon-document {--file-symbol:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%203h9l5%205v13H5z%20M14%203v6h5%20M8%2013h8%20M8%2017h5%22%2F%3E%3C%2Fsvg%3E");}
.icon-open {--file-symbol:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2018V6h7l2%202h7v3%20M3%2019l3-8h15l-3%208z%22%2F%3E%3C%2Fsvg%3E");}
.icon-archive {--file-symbol:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%204h18v5H3z%20M5%209v11h14V9%20M9%2013h6%22%2F%3E%3C%2Fsvg%3E");}
.icon-arrow {--file-symbol:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M5%2012h13%20M13%207l5%205-5%205%22%2F%3E%3C%2Fsvg%3E");}
.icon-chevron {--file-symbol:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M6%209l6%206%206-6%22%2F%3E%3C%2Fsvg%3E");}
.icon-recent {--file-symbol:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2012a9%209%200%201%201%203%206%20M3%205v7h7%20M12%207v5l3%202%22%2F%3E%3C%2Fsvg%3E");}

.icon-new {--file-symbol:var(--file-document-plus);--file-document-plus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 3h9l5 5v13H5z M14 3v6h5 M9 15h6 M12 12v6'/%3E%3C/svg%3E");}
