/**
 * VFM custom UI layer
 * Login branding + flexible workspace layouts.
 * Kept in _content/template so VFM core updates do not overwrite it.
 */

/* =========================
   LOGIN / PUBLIC FRONT PAGE
   ========================= */
body.unlogged {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--vfm-login-bg, #111827);
    font-size: var(--vfm-login-font-size, 16px);
}
body.unlogged::before,
body.unlogged::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}
body.unlogged::before {
    z-index: -2;
    background-color: var(--vfm-login-bg, #111827);
    background-image: var(--vfm-login-bg-image, none);
    background-repeat: no-repeat;
    background-position: var(--vfm-login-bg-position, center center);
    background-size: var(--vfm-login-bg-size, cover);
    filter: blur(var(--vfm-login-bg-blur, 0px));
    transform: scale(1.025);
}
body.unlogged::after {
    z-index: -1;
    background: var(--vfm-login-overlay, rgba(0,0,0,.2));
}
body.unlogged.vfm-login-clean > nav,
body.unlogged.vfm-login-clean > .navbar,
body.unlogged.vfm-login-clean .vfm-header,
body.unlogged.vfm-login-clean > footer {
    display: none !important;
}
body.unlogged.vfm-login-clean {
    padding-top: 0 !important;
}
body.unlogged > .container.mb-auto {
    width: 100%;
    max-width: none;
    padding-left: clamp(16px, 4vw, 72px);
    padding-right: clamp(16px, 4vw, 72px);
}
body.unlogged .main-content {
    min-height: calc(100vh - 2rem);
    align-items: stretch;
}
.vfm-login-stage {
    min-height: calc(100vh - 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 4vw, 64px);
}
.vfm-login-layout-left,
.vfm-login-layout-split-left { justify-content: flex-start; }
.vfm-login-layout-right,
.vfm-login-layout-split-right { justify-content: flex-end; }
.vfm-login-layout-top { align-items: flex-start; }
.vfm-login-layout-bottom { align-items: flex-end; }
.vfm-login-layout-split-left .vfm-login-wrap,
.vfm-login-layout-split-right .vfm-login-wrap {
    width: min(48vw, var(--vfm-login-card-width, 430px));
}
.vfm-login-wrap {
    width: min(100%, var(--vfm-login-card-width, 430px));
    margin: 0;
}
.vfm-login-card {
    width: 100%;
    color: var(--vfm-login-text, #111827);
    background: var(--vfm-login-card, rgba(255,255,255,.94));
    border-radius: var(--vfm-login-card-radius, 20px) !important;
    backdrop-filter: blur(var(--vfm-login-glass-blur, 10px));
    -webkit-backdrop-filter: blur(var(--vfm-login-glass-blur, 10px));
    overflow: hidden;
}
.vfm-login-card-body { padding: var(--vfm-login-card-padding, 26px); }
.vfm-login-brand { margin-bottom: 1.35rem; }
.vfm-login-logo {
    display: block;
    width: auto;
    max-width: min(100%, var(--vfm-login-logo-width, 180px));
    max-height: 160px;
    margin: 0 auto 1rem;
    object-fit: contain;
}
.vfm-login-appname {
    font-weight: 700;
    letter-spacing: .02em;
    margin-bottom: .35rem;
}
.vfm-login-title {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 650;
    margin: 0;
    color: inherit;
}
.vfm-login-form .input-group { min-height: var(--vfm-login-field-height, 50px); }
.vfm-login-form .input-group-text,
.vfm-login-form .form-control {
    min-height: var(--vfm-login-field-height, 50px);
    border-color: var(--vfm-login-field-border, #d1d5db);
    background: var(--vfm-login-field-bg, #fff);
    color: var(--vfm-login-field-text, #111827);
}
.vfm-login-form .input-group-text {
    border-radius: var(--vfm-login-field-radius, 12px) 0 0 var(--vfm-login-field-radius, 12px);
}
.vfm-login-form .form-control {
    border-radius: 0 var(--vfm-login-field-radius, 12px) var(--vfm-login-field-radius, 12px) 0;
    font-size: 1em;
}
.vfm-login-form .form-control::placeholder { color: color-mix(in srgb, var(--vfm-login-field-text, #111827) 55%, transparent); }
.vfm-login-form .form-control:focus {
    border-color: var(--vfm-login-button-bg, #0d6efd);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--vfm-login-button-bg, #0d6efd) 22%, transparent);
}
.vfm-login-submit {
    min-height: var(--vfm-login-field-height, 50px);
    border: 0;
    border-radius: var(--vfm-login-button-radius, 12px) !important;
    background: var(--vfm-login-button-bg, #0d6efd) !important;
    color: var(--vfm-login-button-text, #fff) !important;
    font-weight: 650;
}
.vfm-login-links a { color: inherit; opacity: .82; }
.vfm-login-links a:hover { opacity: 1; }
.vfm-login-server-field .form-control[readonly] { cursor: default; opacity: .82; }
@media (max-width: 767.98px) {
    .vfm-login-stage { padding: 18px 6px; }
    .vfm-login-layout-split-left .vfm-login-wrap,
    .vfm-login-layout-split-right .vfm-login-wrap { width: min(100%, var(--vfm-login-card-width, 430px)); }
}

/* =========================
   FLEXIBLE FILE WORKSPACE
   ========================= */
body.vfm-workspace-active {
    --vfm-ws-icon: 72px;
    --vfm-ws-tile: 210px;
    --vfm-ws-row: 48px;
    --vfm-ws-gap: 14px;
    --vfm-ws-radius: 16px;
    --vfm-ws-folder-width: 250px;
    --vfm-ws-preview-width: 380px;
    --vfm-ws-preview-height: 420px;
    --vfm-ws-thumb-fit: cover;
    --vfm-ws-bg: transparent;
    --vfm-ws-card: var(--color-light-lighter);
    --vfm-ws-text: var(--color-light-text);
    --vfm-ws-folder: #f6b73c;
    --vfm-ws-selection: var(--color-primary);
}
body.vfm-workspace-active > .container.mb-auto {
    transition: max-width .2s ease, width .2s ease;
}
body.vfm-workspace-active.vfm-ws-fluid > .container.mb-auto { max-width: none; width: 100%; }
body.vfm-workspace-active.vfm-ws-width-1200 > .container.mb-auto { max-width: 1200px; }
body.vfm-workspace-active.vfm-ws-width-1440 > .container.mb-auto { max-width: 1440px; }
body.vfm-workspace-active.vfm-ws-width-1800 > .container.mb-auto { max-width: 1800px; }

.vfm-workspace-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    width: 100%;
    margin: 0 0 1rem;
    padding: .6rem;
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: var(--vfm-ws-radius);
    background: var(--vfm-ws-card);
    color: var(--vfm-ws-text);
    box-shadow: 0 4px 18px rgba(0,0,0,.06);
    z-index: 1020;
}
body.vfm-ws-sticky .vfm-workspace-toolbar {
    position: sticky;
    top: 58px;
}
.vfm-workspace-toolbar .form-select,
.vfm-workspace-toolbar .btn { min-height: 38px; }
.vfm-workspace-toolbar .vfm-ws-preset-select { width: min(320px, 100%); }
.vfm-workspace-toolbar .vfm-ws-spacer { margin-left: auto; }
.vfm-workspace-toolbar .btn.active { background: var(--color-primary); color: var(--color-primary-text); }

.vfm-workspace-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--vfm-ws-gap);
    width: 100%;
    min-width: 0;
    align-items: start;
    background: var(--vfm-ws-bg);
    color: var(--vfm-ws-text);
}
.vfm-workspace-sidebar,
.vfm-workspace-preview,
.vfm-workspace-main,
.vfm-workspace-folder-column,
.vfm-workspace-file-column {
    min-width: 0;
}
.vfm-workspace-sidebar,
.vfm-workspace-preview {
    display: none;
    position: relative;
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: var(--vfm-ws-radius);
    background: var(--vfm-ws-card);
    overflow: hidden;
}
.vfm-workspace-sidebar.vfm-visible,
.vfm-workspace-preview.vfm-visible { display: block; }
.vfm-workspace-sidebar-inner,
.vfm-workspace-preview-inner { padding: 1rem; }
.vfm-workspace-sidebar-inner {
    max-height: calc(100vh - 150px);
    overflow: auto;
    position: sticky;
    top: 112px;
}
.vfm-workspace-preview-inner {
    position: sticky;
    top: 112px;
    max-height: calc(100vh - 150px);
    overflow: auto;
}
.vfm-workspace-panel-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 700;
    margin: 0 0 .75rem;
}
.vfm-workspace-preview-stage {
    min-height: 220px;
    border-radius: max(6px, calc(var(--vfm-ws-radius) - 5px));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: color-mix(in srgb, var(--vfm-ws-card) 82%, #808080 18%);
}
.vfm-workspace-preview-stage img,
.vfm-workspace-preview-stage video,
.vfm-workspace-preview-stage iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: min(62vh, 760px);
    object-fit: var(--vfm-ws-thumb-fit);
    border: 0;
}
.vfm-workspace-preview-stage iframe { min-height: 52vh; }
.vfm-workspace-preview-placeholder { font-size: 4rem; opacity: .35; }
.vfm-workspace-preview-name {
    margin-top: .9rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.vfm-workspace-preview-meta { font-size: .875rem; opacity: .7; margin-top: .35rem; }
.vfm-workspace-preview-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .85rem; }

/* Folder tree */
.vfm-workspace-tree ul { list-style: none; padding-left: 1rem; margin: .25rem 0; }
.vfm-workspace-tree > .wrap-foldertree > .foldertree { padding-left: 0; }
.vfm-workspace-tree li { position: relative; padding: .18rem 0; }
.vfm-workspace-tree a { text-decoration: none; display: inline-block; max-width: calc(100% - 1.5rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vfm-workspace-tree .toggle-tree,
.vfm-workspace-tree .toggle-all-tree { cursor: pointer; margin-right: .35rem; }
.vfm-workspace-tree .bi-folder,
.vfm-workspace-tree .bi-folder2-open,
.vfm-workspace-tree .bi-folder-fill { color: var(--vfm-ws-folder); }

/* Main VFM cards/tables */
.vfm-workspace-shell .vfm-workspace-folders,
.vfm-workspace-shell .vfm-workspace-files { width: 100%; margin-bottom: 0 !important; }
.vfm-workspace-shell .tableblock,
.vfm-workspace-shell .hidetable > section {
    border-radius: var(--vfm-ws-radius);
    background: var(--vfm-ws-card) !important;
    color: var(--vfm-ws-text);
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,.055) !important;
}
.vfm-workspace-shell table { color: inherit; }
.vfm-workspace-shell table tbody tr {
    transition: background-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.vfm-workspace-shell table tbody tr.vfm-selected-row,
.vfm-workspace-shell table tbody tr.attivo {
    outline: 2px solid color-mix(in srgb, var(--vfm-ws-selection) 72%, transparent);
    outline-offset: -2px;
}
.vfm-workspace-shell #foldertable .bi-folder-fill,
.vfm-workspace-shell #foldertable .bi-folder,
.vfm-workspace-shell #foldertable .bi-folder2-open { color: var(--vfm-ws-folder); }

/* List/details modes */
body.vfm-ws-mode-list #filetable { display: table !important; }
body.vfm-ws-mode-list #filetable tbody { display: table-row-group !important; }
body.vfm-ws-mode-list #filetable tbody > tr { display: table-row !important; width: auto !important; }
body.vfm-ws-mode-list #filetable tbody > tr > td { display: table-cell !important; vertical-align: middle; }
body.vfm-ws-mode-list #filetable tbody > tr > td.d-none { display: none !important; }
@media (min-width: 768px) {
    body.vfm-ws-mode-list #filetable tbody > tr > td.d-md-table-cell { display: table-cell !important; }
}
body.vfm-ws-mode-list #filetable .itemicon { width: calc(var(--vfm-ws-icon) + 18px) !important; }
body.vfm-ws-mode-list #filetable .icon-placeholder {
    width: var(--vfm-ws-icon);
    height: var(--vfm-ws-icon);
    max-width: var(--vfm-ws-icon);
    max-height: var(--vfm-ws-icon);
    border-radius: max(4px, calc(var(--vfm-ws-radius) / 2));
}
body.vfm-ws-mode-list #filetable .icon-placeholder img { width: 100%; height: 100%; object-fit: var(--vfm-ws-thumb-fit); }
body.vfm-ws-mode-list #filetable tbody tr { min-height: var(--vfm-ws-row); }
body.vfm-ws-mode-list #filetable tbody td { height: var(--vfm-ws-row); }
body.vfm-ws-compact #filetable tbody td,
body.vfm-ws-compact #foldertable tbody td { padding-top: .25rem; padding-bottom: .25rem; }
body.vfm-ws-comfortable #filetable tbody td,
body.vfm-ws-comfortable #foldertable tbody td { padding-top: .8rem; padding-bottom: .8rem; }

/* Tile / icon / gallery modes */
body.vfm-ws-mode-tiles #filetable,
body.vfm-ws-mode-gallery #filetable { display: block !important; }
body.vfm-ws-mode-tiles #filetable thead,
body.vfm-ws-mode-gallery #filetable thead { display: none !important; }
body.vfm-ws-mode-tiles #filetable .gridbody,
body.vfm-ws-mode-gallery #filetable .gridbody {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--vfm-ws-tile)), 1fr));
    gap: var(--vfm-ws-gap);
    padding: .25rem;
}
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: var(--vfm-ws-radius);
    background: color-mix(in srgb, var(--vfm-ws-card) 96%, currentColor 4%);
}
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa:hover,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(0,0,0,.11); }
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa td,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa td { display: none !important; border: 0; }
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .checkb,
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .itemicon,
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .name,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .checkb,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .itemicon,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .name { display: block !important; }
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .itemicon,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .itemicon {
    width: 100% !important;
    position: relative;
    padding: 0 !important;
}
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .itemicon:before,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .itemicon:before { content: ""; display: block; padding-top: 72%; }
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .itemicon:before { padding-top: 78%; }
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .itemicon .item,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .itemicon .item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    box-shadow: none !important;
}
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .icon-placeholder,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .icon-placeholder {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    font-size: clamp(2rem, calc(var(--vfm-ws-icon) / 2), 5rem);
}
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .icon-placeholder img,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .icon-placeholder img { width: 100%; height: 100%; object-fit: var(--vfm-ws-thumb-fit); }
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .name,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .name {
    position: static !important;
    width: 100% !important;
    padding: .55rem .7rem .7rem !important;
    font-size: .9rem;
}
body.vfm-ws-mode-tiles #filetable .grid-item-title,
body.vfm-ws-mode-gallery #filetable .grid-item-title { display: block; padding: 0; }
body.vfm-ws-mode-tiles #filetable .gridbody > .rowa .checkb,
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa .checkb { position: absolute; top: .35rem; left: .35rem; z-index: 5; }
body.vfm-ws-mode-gallery #filetable .gridbody > .rowa:not(.gallindex) { opacity: .88; }

/* Folder cards for tile-oriented views */
body.vfm-ws-folders-cards #foldertable { display: block !important; }
body.vfm-ws-folders-cards #foldertable thead { display: none !important; }
body.vfm-ws-folders-cards #foldertable tbody {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--vfm-ws-tile)), 1fr));
    gap: var(--vfm-ws-gap);
    padding: .25rem;
}
body.vfm-ws-folders-cards #foldertable tbody > tr {
    display: grid !important;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: max(76px, var(--vfm-ws-row));
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: var(--vfm-ws-radius);
    overflow: hidden;
}
body.vfm-ws-folders-cards #foldertable tbody > tr > td { display: none !important; border: 0; }
body.vfm-ws-folders-cards #foldertable tbody > tr > td.name,
body.vfm-ws-folders-cards #foldertable tbody > tr > td.folder-badges { display: block !important; }
body.vfm-ws-folders-cards #foldertable tbody > tr > td.name { padding: 1rem; font-size: 1rem; }
body.vfm-ws-folders-cards #foldertable tbody > tr > td.name .bi-folder-fill { font-size: calc(var(--vfm-ws-icon) * .58); vertical-align: middle; margin-right: .55rem; }
body.vfm-ws-folders-cards #foldertable tbody > tr > td.folder-badges { padding: .5rem; }

/* Metadata/action visibility */
body.vfm-ws-hide-metadata #filetable .h-filesize,
body.vfm-ws-hide-metadata #filetable .h-filedate,
body.vfm-ws-hide-metadata #filetable tbody td.reduce,
body.vfm-ws-hide-metadata #foldertable thead td:nth-child(3),
body.vfm-ws-hide-metadata #foldertable tbody td:nth-child(3) { display: none !important; }
body.vfm-ws-hide-actions .infopanel,
body.vfm-ws-hide-actions #filetable thead td.gridview-hidden,
body.vfm-ws-hide-actions #foldertable tbody td:not(.name):not(.folder-badges):not(:nth-child(3)) { display: none !important; }

/* Layout arrangements */
body.vfm-layout-explorer .vfm-workspace-shell,
body.vfm-layout-media-browser .vfm-workspace-shell {
    grid-template-columns: minmax(180px, var(--vfm-ws-folder-width)) minmax(0, 1fr);
}
body.vfm-layout-explorer .vfm-workspace-sidebar,
body.vfm-layout-media-browser .vfm-workspace-sidebar { grid-column: 1; grid-row: 1; }
body.vfm-layout-explorer .vfm-workspace-main,
body.vfm-layout-media-browser .vfm-workspace-main { grid-column: 2; grid-row: 1; }
body.vfm-layout-media-browser .vfm-workspace-shell { grid-template-columns: minmax(180px, var(--vfm-ws-folder-width)) minmax(0, 1fr) minmax(280px, var(--vfm-ws-preview-width)); }
body.vfm-layout-media-browser .vfm-workspace-preview { grid-column: 3; grid-row: 1; }

body.vfm-layout-preview-right .vfm-workspace-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, var(--vfm-ws-preview-width));
}
body.vfm-layout-preview-right .vfm-workspace-main { grid-column: 1; }
body.vfm-layout-preview-right .vfm-workspace-preview { grid-column: 2; }

body.vfm-layout-preview-bottom .vfm-workspace-shell { grid-template-columns: minmax(0, 1fr); }
body.vfm-layout-preview-bottom .vfm-workspace-main { grid-column: 1; }
body.vfm-layout-preview-bottom .vfm-workspace-preview { grid-column: 1; }
body.vfm-layout-preview-bottom .vfm-workspace-preview-inner { position: static; max-height: none; }
body.vfm-layout-preview-bottom .vfm-workspace-preview-stage { min-height: 320px; }

body.vfm-layout-dual .vfm-workspace-main,
body.vfm-layout-finder-columns .vfm-workspace-main {
    display: grid;
    grid-template-columns: minmax(220px, var(--vfm-ws-folder-width)) minmax(0, 1fr);
    gap: var(--vfm-ws-gap);
    align-items: start;
}
body.vfm-layout-dual .vfm-workspace-folders,
body.vfm-layout-finder-columns .vfm-workspace-folders { grid-column: 1; }
body.vfm-layout-dual .vfm-workspace-files,
body.vfm-layout-finder-columns .vfm-workspace-files { grid-column: 2; }
body.vfm-layout-finder-columns .vfm-workspace-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, var(--vfm-ws-preview-width));
}
body.vfm-layout-finder-columns .vfm-workspace-main { grid-column: 1; }
body.vfm-layout-finder-columns .vfm-workspace-preview { grid-column: 2; }
body.vfm-layout-finder-columns #foldertable tbody td { height: var(--vfm-ws-row); }
body.vfm-layout-finder-columns #foldertable thead { display: none; }

body.vfm-layout-finder-gallery .vfm-workspace-shell { display: flex; flex-direction: column; }
body.vfm-layout-finder-gallery .vfm-workspace-preview { order: 1; width: 100%; }
body.vfm-layout-finder-gallery .vfm-workspace-preview-inner { position: static; max-height: none; }
body.vfm-layout-finder-gallery .vfm-workspace-preview-stage { min-height: min(55vh, 620px); }
body.vfm-layout-finder-gallery .vfm-workspace-main { order: 2; width: 100%; }
body.vfm-layout-finder-gallery #filetable .gridbody {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: .75rem;
}
body.vfm-layout-finder-gallery #filetable .gridbody > .rowa {
    flex: 0 0 var(--vfm-ws-tile);
    scroll-snap-align: start;
}

body.vfm-layout-folder-focus .vfm-workspace-folders .tableblock { padding: 1.1rem !important; }
body.vfm-layout-folder-focus #foldertable tbody { grid-template-columns: repeat(auto-fill, minmax(max(220px, var(--vfm-ws-tile)), 1fr)); }

/* Settings offcanvas */
.vfm-workspace-settings .offcanvas-body { padding-bottom: 4rem; }
.vfm-workspace-settings .vfm-ws-section { border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent); padding-bottom: 1rem; margin-bottom: 1rem; }
.vfm-workspace-settings .vfm-ws-section:last-child { border-bottom: 0; }
.vfm-workspace-settings .vfm-ws-range-value { min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }
.vfm-workspace-settings .vfm-ws-color-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; }
.vfm-workspace-settings input[type="color"] { width: 100%; min-height: 38px; }

@media (max-width: 1199.98px) {
    body.vfm-layout-media-browser .vfm-workspace-shell,
    body.vfm-layout-explorer .vfm-workspace-shell { grid-template-columns: minmax(0, 1fr); }
    body.vfm-layout-media-browser .vfm-workspace-sidebar,
    body.vfm-layout-explorer .vfm-workspace-sidebar { display: none !important; }
    body.vfm-layout-media-browser .vfm-workspace-main,
    body.vfm-layout-explorer .vfm-workspace-main { grid-column: 1; }
    body.vfm-layout-media-browser .vfm-workspace-preview { grid-column: 1; grid-row: 2; }
    body.vfm-layout-finder-columns .vfm-workspace-shell,
    body.vfm-layout-preview-right .vfm-workspace-shell { grid-template-columns: minmax(0, 1fr); }
    body.vfm-layout-finder-columns .vfm-workspace-preview,
    body.vfm-layout-preview-right .vfm-workspace-preview { grid-column: 1; grid-row: 2; }
    .vfm-workspace-preview-inner { position: static; max-height: none; }
}
@media (max-width: 767.98px) {
    .vfm-workspace-toolbar { border-radius: max(8px, calc(var(--vfm-ws-radius) / 1.5)); }
    body.vfm-layout-dual .vfm-workspace-main,
    body.vfm-layout-finder-columns .vfm-workspace-main { grid-template-columns: minmax(0, 1fr); }
    body.vfm-layout-dual .vfm-workspace-folders,
    body.vfm-layout-dual .vfm-workspace-files,
    body.vfm-layout-finder-columns .vfm-workspace-folders,
    body.vfm-layout-finder-columns .vfm-workspace-files { grid-column: 1; }
    body.vfm-ws-mode-tiles #filetable .gridbody,
    body.vfm-ws-mode-gallery #filetable .gridbody,
    body.vfm-ws-folders-cards #foldertable tbody { grid-template-columns: repeat(auto-fill, minmax(min(46vw, var(--vfm-ws-tile)), 1fr)); }
}

/* Generic tree/preview toggles also work with ordinary presets. */
body.vfm-layout-standard.vfm-ws-tree-on:not(.vfm-ws-preview-on) .vfm-workspace-shell,
body.vfm-layout-folder-focus.vfm-ws-tree-on:not(.vfm-ws-preview-on) .vfm-workspace-shell {
    grid-template-columns: minmax(180px, var(--vfm-ws-folder-width)) minmax(0, 1fr);
}
body.vfm-layout-standard.vfm-ws-tree-on:not(.vfm-ws-preview-on) .vfm-workspace-sidebar,
body.vfm-layout-folder-focus.vfm-ws-tree-on:not(.vfm-ws-preview-on) .vfm-workspace-sidebar { grid-column: 1; grid-row: 1; }
body.vfm-layout-standard.vfm-ws-tree-on:not(.vfm-ws-preview-on) .vfm-workspace-main,
body.vfm-layout-folder-focus.vfm-ws-tree-on:not(.vfm-ws-preview-on) .vfm-workspace-main { grid-column: 2; grid-row: 1; }
body.vfm-layout-standard.vfm-ws-preview-on:not(.vfm-ws-tree-on) .vfm-workspace-shell,
body.vfm-layout-folder-focus.vfm-ws-preview-on:not(.vfm-ws-tree-on) .vfm-workspace-shell {
    grid-template-columns: minmax(0, 1fr) minmax(280px, var(--vfm-ws-preview-width));
}
body.vfm-layout-standard.vfm-ws-preview-on:not(.vfm-ws-tree-on) .vfm-workspace-main,
body.vfm-layout-folder-focus.vfm-ws-preview-on:not(.vfm-ws-tree-on) .vfm-workspace-main { grid-column: 1; grid-row: 1; }
body.vfm-layout-standard.vfm-ws-preview-on:not(.vfm-ws-tree-on) .vfm-workspace-preview,
body.vfm-layout-folder-focus.vfm-ws-preview-on:not(.vfm-ws-tree-on) .vfm-workspace-preview { grid-column: 2; grid-row: 1; }
body.vfm-layout-standard.vfm-ws-tree-on.vfm-ws-preview-on .vfm-workspace-shell,
body.vfm-layout-folder-focus.vfm-ws-tree-on.vfm-ws-preview-on .vfm-workspace-shell {
    grid-template-columns: minmax(180px, var(--vfm-ws-folder-width)) minmax(0, 1fr) minmax(280px, var(--vfm-ws-preview-width));
}
body.vfm-layout-standard.vfm-ws-tree-on.vfm-ws-preview-on .vfm-workspace-sidebar,
body.vfm-layout-folder-focus.vfm-ws-tree-on.vfm-ws-preview-on .vfm-workspace-sidebar { grid-column: 1; grid-row: 1; }
body.vfm-layout-standard.vfm-ws-tree-on.vfm-ws-preview-on .vfm-workspace-main,
body.vfm-layout-folder-focus.vfm-ws-tree-on.vfm-ws-preview-on .vfm-workspace-main { grid-column: 2; grid-row: 1; }
body.vfm-layout-standard.vfm-ws-tree-on.vfm-ws-preview-on .vfm-workspace-preview,
body.vfm-layout-folder-focus.vfm-ws-tree-on.vfm-ws-preview-on .vfm-workspace-preview { grid-column: 3; grid-row: 1; }
@media (max-width: 1199.98px) {
    body.vfm-layout-standard.vfm-ws-tree-on .vfm-workspace-shell,
    body.vfm-layout-standard.vfm-ws-preview-on .vfm-workspace-shell,
    body.vfm-layout-folder-focus.vfm-ws-tree-on .vfm-workspace-shell,
    body.vfm-layout-folder-focus.vfm-ws-preview-on .vfm-workspace-shell { grid-template-columns: minmax(0, 1fr); }
    body.vfm-layout-standard .vfm-workspace-sidebar,
    body.vfm-layout-folder-focus .vfm-workspace-sidebar { display: none !important; }
    body.vfm-layout-standard .vfm-workspace-main,
    body.vfm-layout-folder-focus .vfm-workspace-main { grid-column: 1 !important; grid-row: 1 !important; }
    body.vfm-layout-standard .vfm-workspace-preview,
    body.vfm-layout-folder-focus .vfm-workspace-preview { grid-column: 1 !important; grid-row: 2 !important; }
}

/* The custom workspace toolbar supersedes VFM's original two-state view switch. */
body.vfm-workspace-active .switchview { display: none !important; }

/* =========================
   EXTENDED LAYOUT LIBRARY
   ========================= */

/* Preview can be placed on the opposite side or above the browser. */
body.vfm-layout-preview-left .vfm-workspace-shell {
    grid-template-columns: minmax(280px, var(--vfm-ws-preview-width)) minmax(0, 1fr);
}
body.vfm-layout-preview-left .vfm-workspace-preview { grid-column: 1; grid-row: 1; }
body.vfm-layout-preview-left .vfm-workspace-main { grid-column: 2; grid-row: 1; }

body.vfm-layout-preview-top .vfm-workspace-shell { grid-template-columns: minmax(0, 1fr); }
body.vfm-layout-preview-top .vfm-workspace-preview { grid-column: 1; grid-row: 1; }
body.vfm-layout-preview-top .vfm-workspace-main { grid-column: 1; grid-row: 2; }
body.vfm-layout-preview-top .vfm-workspace-preview-inner,
body.vfm-layout-free.vfm-ws-preview-pos-top .vfm-workspace-preview-inner,
body.vfm-layout-free.vfm-ws-preview-pos-bottom .vfm-workspace-preview-inner { position: static; max-height: none; }
body.vfm-layout-preview-top .vfm-workspace-preview-stage,
body.vfm-layout-free.vfm-ws-preview-pos-top .vfm-workspace-preview-stage,
body.vfm-layout-free.vfm-ws-preview-pos-bottom .vfm-workspace-preview-stage {
    min-height: min(var(--vfm-ws-preview-height), 70vh);
}

/* Free builder: JS supplies grid areas and columns; CSS keeps panels usable. */
body.vfm-layout-free .vfm-workspace-shell { align-items: start; }
body.vfm-layout-free .vfm-workspace-main { min-width: 0; }
body.vfm-layout-free .vfm-workspace-preview-stage { min-height: min(var(--vfm-ws-preview-height), 72vh); }

/* Vertical filmstrips around a large inspector/preview. */
body.vfm-layout-filmstrip-left .vfm-workspace-shell {
    grid-template-columns: minmax(220px, var(--vfm-ws-folder-width)) minmax(0, 1fr);
}
body.vfm-layout-filmstrip-left .vfm-workspace-main { grid-column: 1; grid-row: 1; }
body.vfm-layout-filmstrip-left .vfm-workspace-preview { grid-column: 2; grid-row: 1; }
body.vfm-layout-filmstrip-right .vfm-workspace-shell {
    grid-template-columns: minmax(0, 1fr) minmax(220px, var(--vfm-ws-folder-width));
}
body.vfm-layout-filmstrip-right .vfm-workspace-preview { grid-column: 1; grid-row: 1; }
body.vfm-layout-filmstrip-right .vfm-workspace-main { grid-column: 2; grid-row: 1; }
body.vfm-layout-filmstrip-left #filetable .gridbody,
body.vfm-layout-filmstrip-right #filetable .gridbody,
body.vfm-layout-filmstrip-left #foldertable tbody,
body.vfm-layout-filmstrip-right #foldertable tbody { grid-template-columns: minmax(0, 1fr) !important; }
body.vfm-layout-filmstrip-left .vfm-workspace-preview-stage,
body.vfm-layout-filmstrip-right .vfm-workspace-preview-stage { min-height: min(var(--vfm-ws-preview-height), 72vh); }

/* Purpose-built photo aspect ratios. */
body.vfm-layout-mosaic-square #filetable .gridbody > .rowa .itemicon:before { padding-top: 100%; }
body.vfm-layout-mosaic-wide #filetable .gridbody > .rowa .itemicon:before { padding-top: 56.25%; }
body.vfm-layout-mosaic-portrait #filetable .gridbody > .rowa .itemicon:before { padding-top: 133.333%; }

/* Photo wall: almost edge-to-edge thumbnails, labels appear on hover. */
body.vfm-layout-photo-wall #filetable .gridbody { gap: max(1px, calc(var(--vfm-ws-gap) / 3)); padding: 0; }
body.vfm-layout-photo-wall #filetable .gridbody > .rowa {
    border: 0;
    border-radius: max(0px, calc(var(--vfm-ws-radius) / 3));
    box-shadow: none !important;
    background: transparent;
}
body.vfm-layout-photo-wall #filetable .gridbody > .rowa .name {
    position: absolute !important;
    left: 0; right: 0; bottom: 0;
    z-index: 4;
    padding: 1.5rem .6rem .5rem !important;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,.76));
    opacity: 0;
    transition: opacity .15s ease;
}
body.vfm-layout-photo-wall #filetable .gridbody > .rowa:hover .name,
body.vfm-layout-photo-wall #filetable .gridbody > .rowa.vfm-selected-row .name { opacity: 1; }

/* Horizontal cards: useful for documents when thumbnails and names both matter. */
body.vfm-layout-cards-list #filetable .gridbody { grid-template-columns: minmax(0, 1fr) !important; }
body.vfm-layout-cards-list #filetable .gridbody > .rowa {
    display: grid !important;
    grid-template-columns: clamp(120px, 20vw, 220px) minmax(0, 1fr);
    align-items: center;
}
body.vfm-layout-cards-list #filetable .gridbody > .rowa .itemicon { grid-column: 1; grid-row: 1; }
body.vfm-layout-cards-list #filetable .gridbody > .rowa .itemicon:before { padding-top: 62%; }
body.vfm-layout-cards-list #filetable .gridbody > .rowa .name {
    grid-column: 2; grid-row: 1;
    padding: 1rem !important;
    font-size: 1rem;
    align-self: stretch;
    display: flex !important;
    align-items: center;
}
body.vfm-layout-cards-list #filetable .gridbody > .rowa .checkb { top: .5rem; left: .5rem; }

/* Finder/Desktop-like borderless icon field. */
body.vfm-layout-minimal-icons .vfm-workspace-shell .tableblock { box-shadow: none !important; background: transparent !important; }
body.vfm-layout-minimal-icons #filetable .gridbody > .rowa,
body.vfm-layout-minimal-icons #foldertable tbody > tr {
    border-color: transparent;
    background: transparent;
    box-shadow: none !important;
}
body.vfm-layout-minimal-icons #filetable .gridbody > .rowa:hover,
body.vfm-layout-minimal-icons #foldertable tbody > tr:hover {
    background: color-mix(in srgb, var(--vfm-ws-selection) 10%, transparent);
    transform: none;
}
body.vfm-layout-minimal-icons #filetable .gridbody > .rowa .itemicon:before { padding-top: 82%; }
body.vfm-layout-minimal-icons #filetable .gridbody > .rowa .name { text-align: center; padding-top: .35rem !important; }

@media (max-width: 1199.98px) {
    body.vfm-layout-preview-left .vfm-workspace-shell,
    body.vfm-layout-filmstrip-left .vfm-workspace-shell,
    body.vfm-layout-filmstrip-right .vfm-workspace-shell { grid-template-columns: minmax(0, 1fr); }
    body.vfm-layout-preview-left .vfm-workspace-main,
    body.vfm-layout-filmstrip-left .vfm-workspace-main,
    body.vfm-layout-filmstrip-right .vfm-workspace-main { grid-column: 1; grid-row: 1; }
    body.vfm-layout-preview-left .vfm-workspace-preview,
    body.vfm-layout-filmstrip-left .vfm-workspace-preview,
    body.vfm-layout-filmstrip-right .vfm-workspace-preview { grid-column: 1; grid-row: 2; }
    body.vfm-layout-free .vfm-workspace-shell { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "main" "preview" !important; }
    body.vfm-layout-free .vfm-workspace-sidebar { display: none !important; }
    body.vfm-layout-free .vfm-workspace-main { grid-area: main !important; }
    body.vfm-layout-free .vfm-workspace-preview { grid-area: preview !important; }
}
@media (max-width: 767.98px) {
    body.vfm-layout-cards-list #filetable .gridbody > .rowa { grid-template-columns: minmax(96px, 32vw) minmax(0, 1fr); }
    body.vfm-layout-free .vfm-workspace-main { grid-template-columns: minmax(0, 1fr) !important; }
    body.vfm-layout-free .vfm-workspace-folders,
    body.vfm-layout-free .vfm-workspace-files { grid-column: 1 !important; grid-row: auto !important; }
}

/* ================================================================
   VFM Custom Workspace 2.1 reliability layer
   ================================================================ */

/* A sidebar tree is navigation, not a second copy of the current-folder grid. */
body.vfm-workspace-active.vfm-ws-tree-on.vfm-ws-tree-replaces-folders .vfm-workspace-main > .vfm-workspace-folders {
    display: none !important;
}

/* Independent settings drawer: no dependency on Bootstrap Offcanvas JS. */
.vfm-workspace-settings {
    position: fixed;
    z-index: 1095;
    top: 0;
    right: 0;
    width: min(520px, 100vw);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #212529);
    border-left: 1px solid rgba(128,128,128,.25);
    box-shadow: -16px 0 40px rgba(0,0,0,.18);
    transform: translate3d(102%,0,0);
    visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
    contain: layout paint;
}
.vfm-workspace-settings.is-open {
    transform: translate3d(0,0,0);
    visibility: visible;
    transition: transform .22s ease, visibility 0s;
}
.vfm-workspace-settings .offcanvas-header {
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(128,128,128,.18);
    background: inherit;
}
.vfm-workspace-settings .offcanvas-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-bottom: 4rem;
}
.vfm-workspace-settings-backdrop {
    position: fixed;
    z-index: 1090;
    inset: 0;
    background: rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s;
}
.vfm-workspace-settings-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .2s ease, visibility 0s;
}
body.vfm-ws-settings-open { overflow: hidden !important; }
.vfm-workspace-settings-fab {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 28px rgba(0,0,0,.22);
}

/* Make sure the custom toolbar remains an actual flex control even if a theme
   overrides generic .col-12 or form rules. */
.vfm-workspace-toolbar:not([hidden]) {
    display: flex !important;
}
.vfm-workspace-toolbar[hidden] {
    display: none !important;
}

@media (max-width: 575.98px) {
    .vfm-workspace-settings { width: 100vw; }
}

/* ================================================================
   VFM Custom Workspace 2.2 — compact, tested layout layer
   ================================================================ */
body.vfm-workspace-active {
    --vfm-ws-font: 14px;
    --vfm-ws-folder-font: 13px;
}
body.vfm-workspace-active.vfm-ws-width-1100 > .container.mb-auto { max-width: 1100px; width: 100%; }
body.vfm-workspace-active.vfm-ws-width-1200 > .container.mb-auto { max-width: 1200px; width: 100%; }
body.vfm-workspace-active.vfm-ws-width-1320 > .container.mb-auto { max-width: 1320px; width: 100%; }
body.vfm-workspace-active.vfm-ws-width-1440 > .container.mb-auto { max-width: 1440px; width: 100%; }
body.vfm-workspace-active.vfm-ws-width-1600 > .container.mb-auto { max-width: 1600px; width: 100%; }
body.vfm-workspace-active.vfm-ws-width-1800 > .container.mb-auto { max-width: 1800px; width: 100%; }
body.vfm-workspace-active.vfm-ws-width-2000 > .container.mb-auto { max-width: 2000px; width: 100%; }
body.vfm-workspace-active > .container.mb-auto {
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(12px, 1.7vw, 24px);
    padding-right: clamp(12px, 1.7vw, 24px);
}
body.vfm-workspace-active .vfm-workspace-main,
body.vfm-workspace-active .vfm-workspace-sidebar,
body.vfm-workspace-active .vfm-workspace-preview { font-size: var(--vfm-ws-font); }

/* Toolbar: shorter labels and predictable wrapping. */
.vfm-workspace-toolbar-22 {
    padding: .5rem .6rem;
    gap: .4rem;
    min-height: 52px;
}
.vfm-workspace-toolbar-22 .vfm-ws-toolbar-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-weight: 700;
    font-size: .82rem;
    white-space: nowrap;
}
.vfm-workspace-toolbar-22 .vfm-ws-preset-select {
    width: clamp(170px, 22vw, 245px);
    min-width: 0;
    font-size: .82rem;
}
.vfm-workspace-toolbar-22 .btn { white-space: nowrap; }
.vfm-workspace-toolbar-22 .vfm-ws-size-group .btn { min-width: 36px; }
.vfm-workspace-toolbar-22 .vfm-ws-hot-width {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    padding: 0 .15rem 0 .45rem;
    min-height: 38px;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-radius: .375rem;
    background: color-mix(in srgb, var(--vfm-ws-card) 94%, currentColor 6%);
    font-size: .78rem;
    white-space: nowrap;
}
.vfm-workspace-toolbar-22 .vfm-ws-hot-width > i { opacity: .72; }
.vfm-workspace-toolbar-22 .vfm-ws-width-hot {
    width: 86px;
    min-height: 34px;
    padding-top: .2rem;
    padding-bottom: .2rem;
    border: 0;
    background-color: transparent;
    font-size: .8rem;
    font-weight: 600;
    box-shadow: none;
}
.vfm-workspace-toolbar-22 .vfm-ws-width-hot:focus { box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--color-primary) 18%, transparent); }

.vfm-ws-save-pulse { box-shadow: 0 0 0 .18rem color-mix(in srgb, #198754 18%, transparent); }
@media (max-width: 767.98px) {
    .vfm-workspace-toolbar-22 .vfm-ws-toolbar-label span { display: none; }
    .vfm-workspace-toolbar-22 .vfm-ws-preset-select { flex: 1 1 180px; width: auto; }
    .vfm-workspace-toolbar-22 .vfm-ws-size-group { order: 3; }
}

/* Long file/folder names never escape a tile. */
body.vfm-workspace-active #filetable .grid-item-title,
body.vfm-workspace-active #filetable td.name,
body.vfm-workspace-active #foldertable td.name,
body.vfm-workspace-active .vfm-folder-label {
    overflow-wrap: anywhere;
    word-break: break-word;
}
body.vfm-workspace-active #filetable .grid-item-title {
    line-height: 1.28;
    font-size: var(--vfm-ws-font);
}
body.vfm-label-lines-1 #filetable .grid-item-title,
body.vfm-label-lines-1 .vfm-folder-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
body.vfm-label-lines-2 #filetable .grid-item-title,
body.vfm-label-lines-2 .vfm-folder-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
body.vfm-label-lines-3 #filetable .grid-item-title,
body.vfm-label-lines-3 .vfm-folder-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

/* Folder counter is no longer a dedicated left column. It is copied under/on the folder title by JS. */
body.vfm-workspace-active #foldertable thead td:first-child,
body.vfm-workspace-active #foldertable tbody td.folder-badges,
body.vfm-workspace-active #foldertable tbody td.vfm-folder-counter-source {
    display: none !important;
}
body.vfm-workspace-active #foldertable td.name {
    font-size: var(--vfm-ws-folder-font);
    min-width: 0;
}
body.vfm-workspace-active #foldertable td.name .relative { min-width: 0; }
body.vfm-workspace-active #foldertable td.name .relative > a {
    display: block;
    min-width: 0;
    text-decoration: none;
}
body.vfm-workspace-active .vfm-folder-title {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    width: 100%;
    text-align: left !important;
    line-height: 1.22;
}
body.vfm-workspace-active .vfm-folder-title > i {
    flex: 0 0 auto;
    color: var(--vfm-ws-folder);
}
body.vfm-workspace-active .vfm-folder-label {
    min-width: 0;
    flex: 1 1 auto;
    font-weight: 650;
    color: inherit;
}
body.vfm-workspace-active .vfm-folder-meta {
    display: flex;
    align-items: center;
    gap: .32rem;
    flex-wrap: wrap;
    margin-top: .3rem;
    font-size: max(10px, calc(var(--vfm-ws-folder-font) - 2px));
    line-height: 1.15;
    opacity: .68;
}
body.vfm-workspace-active .vfm-folder-stat {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    padding: .14rem .38rem;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 6%, transparent);
    white-space: nowrap;
}
body.vfm-folder-counter-hidden .vfm-folder-meta { display: none !important; }
body.vfm-folder-counter-badge .vfm-folder-title .vfm-folder-meta {
    position: absolute;
    left: 25px;
    top: -7px;
    z-index: 3;
    margin: 0;
    gap: 2px;
    opacity: 1;
}
body.vfm-folder-counter-badge .vfm-folder-title .vfm-folder-stat {
    min-width: 19px;
    min-height: 19px;
    justify-content: center;
    padding: 2px 5px;
    border: 2px solid var(--vfm-ws-card);
    background: var(--vfm-ws-selection);
    color: #fff;
    font-size: 9px;
    box-shadow: 0 2px 5px rgba(0,0,0,.14);
}
body.vfm-folder-counter-badge .vfm-folder-title .vfm-folder-stat i { display: none; }

/* Folder cards: title first, counters underneath. No left-side counter cell. */
body.vfm-ws-folders-cards #foldertable tbody {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, max(185px, var(--vfm-ws-folder-tile, var(--vfm-ws-tile)))), 1fr));
    gap: var(--vfm-ws-gap);
    padding: .2rem;
}
body.vfm-ws-folders-cards #foldertable tbody > tr {
    display: block !important;
    min-height: 76px;
    padding: 0 !important;
    border: 1px solid color-mix(in srgb, currentColor 9%, transparent);
    border-radius: max(8px, var(--vfm-ws-radius));
    background: color-mix(in srgb, var(--vfm-ws-card) 97%, currentColor 3%);
    overflow: hidden;
}
body.vfm-ws-folders-cards #foldertable tbody > tr > td { display: none !important; }
body.vfm-ws-folders-cards #foldertable tbody > tr > td.name { display: block !important; padding: .68rem .72rem .58rem !important; }
body.vfm-ws-folders-cards #foldertable tbody > tr:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--vfm-ws-selection) 26%, transparent);
    box-shadow: 0 5px 15px rgba(0,0,0,.07);
}
body.vfm-ws-folders-cards #foldertable td.name .hover { right: .35rem !important; top: .35rem; }

/* Four built-in icon treatments, no remote fonts/assets. */
body.vfm-iconpack-modern #foldertable .vfm-folder-title > i {
    width: var(--vfm-ws-folder-icon, 38px);
    height: var(--vfm-ws-folder-icon, 38px);
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--vfm-ws-folder-icon, 38px) * .58) !important;
    background: color-mix(in srgb, var(--vfm-ws-folder) 16%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vfm-ws-folder) 18%, transparent);
}
body.vfm-iconpack-classic #foldertable .vfm-folder-title > i { font-size: 27px !important; }
body.vfm-iconpack-outline #foldertable .vfm-folder-title > i {
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px !important; border: 1px solid color-mix(in srgb, var(--vfm-ws-folder) 32%, transparent); border-radius: 9px;
}
body.vfm-iconpack-mono #foldertable .vfm-folder-title > i { font-size: 25px !important; color: currentColor; opacity: .66; }
body.vfm-iconpack-modern #filetable .gridbody > .rowa .icon-placeholder:not(:has(img)) {
    background: color-mix(in srgb, var(--vfm-ws-selection) 7%, var(--vfm-ws-card));
}
body.vfm-iconpack-mono #filetable .gridbody > .rowa .icon-placeholder i { color: currentColor !important; opacity: .68; }

/* Modern layouts: calmer borders, tighter folder section and less wasted width. */
body.vfm-layout-modern .vfm-workspace-shell .tableblock,
body.vfm-layout-modern-list .vfm-workspace-shell .tableblock {
    border: 1px solid color-mix(in srgb, currentColor 7%, transparent);
    box-shadow: 0 2px 10px rgba(0,0,0,.035) !important;
}
body.vfm-layout-modern .vfm-workspace-folders .tableblock { padding: .7rem !important; }
body.vfm-layout-modern .vfm-workspace-files .tableblock { padding: .8rem !important; }
body.vfm-layout-modern #filetable .gridbody > .rowa {
    border-color: color-mix(in srgb, currentColor 7%, transparent);
    box-shadow: 0 1px 5px rgba(0,0,0,.035);
}
body.vfm-layout-modern #filetable .gridbody > .rowa:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--vfm-ws-selection) 25%, transparent);
    box-shadow: 0 7px 18px rgba(0,0,0,.075);
}
body.vfm-layout-modern #filetable .gridbody > .rowa .name { padding: .48rem .6rem .6rem !important; }
body.vfm-layout-modern-list #filetable tbody tr:hover,
body.vfm-layout-modern-list #foldertable tbody tr:hover { background: color-mix(in srgb, var(--vfm-ws-selection) 6%, transparent); }
body.vfm-layout-modern-list #foldertable td.name { padding-top: .45rem; padding-bottom: .45rem; }

/* Compact mode means compact, including folder cards. */
body.vfm-ws-compact.vfm-ws-folders-cards #foldertable tbody > tr { min-height: 62px; }
body.vfm-ws-compact.vfm-ws-folders-cards #foldertable tbody > tr > td.name { padding: .48rem .55rem .42rem !important; }
body.vfm-ws-compact.vfm-iconpack-modern #foldertable .vfm-folder-title > i { width: 32px; height: 32px; font-size: 18px !important; border-radius: 9px; }

/* Cleaner tree: toggles no longer sit on top of folder names. */
.vfm-workspace-tree {
    font-size: max(11px, calc(var(--vfm-ws-font) - 1px));
    line-height: 1.25;
}
.vfm-workspace-tree .wrap-foldertree { min-width: 0; }
.vfm-workspace-tree .toggle-all-tree {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    margin: 0 0 .35rem auto;
    border-radius: 7px;
    background: color-mix(in srgb, currentColor 6%, transparent);
    cursor: pointer;
}
.vfm-workspace-tree ul,
.vfm-workspace-tree .foldertree,
.vfm-workspace-tree .sub-tree { list-style: none; margin: 0; }
.vfm-workspace-tree .foldertree { padding-left: 0 !important; }
.vfm-workspace-tree .sub-tree {
    padding-left: 14px !important;
    margin-left: 8px;
    border-left: 1px solid color-mix(in srgb, currentColor 13%, transparent);
}
.vfm-workspace-tree li.vfm-tree-item {
    position: relative;
    min-width: 0;
    padding: 4px 31px 4px 3px !important;
    min-height: 29px;
    border-radius: 7px;
}
.vfm-workspace-tree li.vfm-tree-item:hover { background: color-mix(in srgb, var(--vfm-ws-selection) 7%, transparent); }
.vfm-workspace-tree li.vfm-tree-item > a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: 100% !important;
    min-width: 0;
    padding: 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vfm-workspace-tree li.vfm-tree-item > .toggle-tree {
    position: absolute;
    right: 3px;
    top: 3px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    border-radius: 6px;
    cursor: pointer;
}
.vfm-workspace-tree li.vfm-tree-item > .toggle-tree:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.vfm-workspace-tree .tree-toggler { background: transparent !important; }
.vfm-workspace-tree .search-highlight {
    background: transparent !important;
    color: inherit !important;
    font-weight: 700;
    padding: 0;
}
.vfm-workspace-tree .highlight { display: none !important; }
.vfm-workspace-tree .folderoot > i { margin-right: .3rem; color: var(--vfm-ws-folder); }
.vfm-workspace-tree .bi-folder,
.vfm-workspace-tree .bi-folder2,
.vfm-workspace-tree .bi-folder-fill,
.vfm-workspace-tree .bi-folder2-open { color: var(--vfm-ws-folder); }

/* Sidebar becomes genuinely compact. */
.vfm-workspace-sidebar-inner { padding: .72rem; }
.vfm-workspace-panel-title { margin-bottom: .5rem; font-size: .84rem; }
body.vfm-layout-explorer .vfm-workspace-shell {
    grid-template-columns: minmax(190px, var(--vfm-ws-folder-width)) minmax(0, 1fr);
}

/* Explicit save footer in the customizer. */
.vfm-workspace-settings .offcanvas-body { padding-bottom: 1rem !important; }
.vfm-workspace-settings .vfm-ws-savebar {
    flex: 0 0 auto;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(128,128,128,.18);
    background: inherit;
    box-shadow: 0 -8px 20px rgba(0,0,0,.04);
}
.vfm-workspace-settings .vfm-ws-dirty-label { margin-top: .15rem; min-height: 1.1em; }
.vfm-workspace-settings .vfm-ws-section { padding-bottom: .85rem; margin-bottom: .85rem; }

@media (max-width: 1199.98px) {
    body.vfm-layout-explorer .vfm-workspace-shell { grid-template-columns: minmax(0, 1fr); }
    body.vfm-layout-explorer .vfm-workspace-sidebar.vfm-visible { display: block !important; position: relative; margin-bottom: var(--vfm-ws-gap); }
    body.vfm-layout-explorer .vfm-workspace-sidebar-inner { position: static; max-height: 320px; }
    body.vfm-layout-explorer .vfm-workspace-main { grid-column: 1; }
}
@media (max-width: 575.98px) {
    body.vfm-ws-folders-cards #foldertable tbody { grid-template-columns: minmax(0,1fr); }
    body.vfm-workspace-active > .container.mb-auto { padding-left: 9px; padding-right: 9px; }
}

/* UI 2.2 — optional login card minimum height */
body.unlogged .vfm-login-card {
    min-height: var(--vfm-login-card-min-height, 0px);
}
body.unlogged .vfm-login-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* UI 2.2 final override: legacy folder-card CSS must never bring the old counter column back. */
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.folder-badges,
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.vfm-folder-counter-source {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr {
    grid-template-columns: minmax(0, 1fr) !important;
}

/* UI 2.2 final tree normalization: neutralize the legacy branch-line geometry. */
.vfm-workspace-tree .foldertree,
.vfm-workspace-tree .foldertree ul {
    margin: 0 !important;
}
.vfm-workspace-tree .foldertree ul {
    padding-left: 14px !important;
}
.vfm-workspace-tree .foldertree li::before,
.vfm-workspace-tree .foldertree li::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
}
.vfm-workspace-tree .foldertree li.folderoot {
    margin: 0 !important;
}
.vfm-workspace-tree .foldertree ul .toggle-tree,
.vfm-workspace-tree li.vfm-tree-item > .toggle-tree {
    left: auto !important;
    right: 2px !important;
    top: 3px !important;
}
.vfm-workspace-tree .wrap-foldertree {
    padding: 0 !important;
}
.vfm-workspace-tree .wrap-foldertree > .toggle-all-tree {
    position: static !important;
    float: right;
    margin: 0 0 .35rem .35rem !important;
}
.vfm-workspace-tree .wrap-foldertree::after {
    content: "";
    display: block;
    clear: both;
}
.vfm-workspace-tree .sub-tree {
    margin-left: 4px !important;
    padding-left: 10px !important;
}
/* Keep the global tree control in its own header row. */
.vfm-workspace-tree .wrap-foldertree {
    position: relative !important;
    padding: 34px 0 0 0 !important;
}
.vfm-workspace-tree .wrap-foldertree > .toggle-all-tree {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    float: none !important;
    margin: 0 !important;
    z-index: 5;
}


/* ==========================================================================\n   VFM Custom UI 2.3 — app-like navigation, quiet hover, large tile presets\n   ========================================================================== */

/* Hover should be a subtle neutral tint, not VFM's bright primary fill. */
body.vfm-workspace-active #filetable tbody > tr:hover:not(.vfm-selected-row):not(.attivo),
body.vfm-workspace-active #foldertable tbody > tr:hover:not(.vfm-selected-row):not(.attivo) {
    background: color-mix(in srgb, currentColor 5%, transparent) !important;
}
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .gridbody > .rowa:hover,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable .gridbody > .rowa:hover {
    background: color-mix(in srgb, var(--vfm-ws-card) 94%, currentColor 6%) !important;
    box-shadow: 0 5px 16px rgba(0,0,0,.075) !important;
    transform: translateY(-1px);
}
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr:hover {
    background: color-mix(in srgb, var(--vfm-ws-card) 94%, currentColor 6%) !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.065) !important;
    transform: translateY(-1px);
}

/* Smooth directory changes. Only the workspace fades; header/footer never blink. */
body.vfm-workspace-active .vfm-workspace-main {
    transition: opacity .16s ease, transform .16s ease, filter .16s ease;
    will-change: opacity, transform;
}
body.vfm-workspace-active.vfm-ws-route-loading .vfm-workspace-main {
    opacity: .48;
    transform: translateY(3px);
    filter: saturate(.88);
    pointer-events: none;
}
body.vfm-workspace-active.vfm-ws-route-enter .vfm-workspace-main {
    opacity: .94;
    transform: translateY(-2px);
}
body.vfm-workspace-active.vfm-ws-route-loading .vfm-workspace-toolbar {
    cursor: progress;
}
body.vfm-workspace-active.vfm-ws-route-loading .vfm-workspace-shell::before {
    content: "";
    position: absolute;
    z-index: 30;
    top: -1px;
    left: 0;
    height: 2px;
    width: 34%;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 38%, transparent);
    animation: vfm-ws-route-progress .8s ease-in-out infinite alternate;
}
@keyframes vfm-ws-route-progress {
    from { transform: translateX(0); opacity: .38; }
    to { transform: translateX(190%); opacity: .72; }
}
@media (prefers-reduced-motion: reduce) {
    body.vfm-workspace-active .vfm-workspace-main { transition: none; }
    body.vfm-workspace-active.vfm-ws-route-loading .vfm-workspace-shell::before { animation: none; width: 100%; }
}

/* Yandex-Disk-inspired light workspace: no copied logos/branding, only the light spacious layout idea. */
body.vfm-workspace-active.vfm-layout-yandex-light {
    --vfm-ws-bg: #f7f7f8;
    --vfm-ws-card: #ffffff;
    --vfm-ws-text: #202124;
    --vfm-ws-folder: #f2b733;
}
body.vfm-layout-yandex-light > .container.mb-auto {
    background: var(--vfm-ws-bg);
    border-radius: max(16px, var(--vfm-ws-radius));
    padding-left: clamp(12px, 2vw, 24px);
    padding-right: clamp(12px, 2vw, 24px);
}
body.vfm-layout-yandex-light .vfm-workspace-toolbar,
body.vfm-layout-yandex-light .vfm-workspace-shell .tableblock {
    box-shadow: none !important;
    border: 1px solid rgba(0,0,0,.055);
    background: #fff !important;
}
body.vfm-layout-yandex-light.vfm-ws-folders-cards #foldertable tbody > tr {
    min-height: 92px;
    background: #fff;
    border-color: rgba(0,0,0,.065);
    box-shadow: 0 1px 2px rgba(0,0,0,.025);
}
body.vfm-layout-yandex-light #foldertable .vfm-folder-title > i {
    font-size: 38px !important;
    color: #f2b733 !important;
    margin-right: .7rem;
}
body.vfm-layout-yandex-light .vfm-folder-label {
    font-weight: 550;
    letter-spacing: -.01em;
}
body.vfm-layout-yandex-light .vfm-folder-meta {
    opacity: .55;
}
body.vfm-layout-yandex-light.vfm-ws-mode-tiles #filetable .gridbody > .rowa {
    background: #fff;
    border-color: rgba(0,0,0,.06);
    box-shadow: 0 1px 2px rgba(0,0,0,.025);
}
body.vfm-layout-yandex-light.vfm-ws-mode-tiles #filetable .gridbody > .rowa:hover,
body.vfm-layout-yandex-light.vfm-ws-folders-cards #foldertable tbody > tr:hover {
    background: rgba(0,0,0,.035) !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.055) !important;
}

/* Large/medium/small tile presets all use the same reliable responsive grid. */
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .gridbody,
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody {
    align-items: stretch;
}
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .gridbody > .rowa,
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr {
    transition: background-color .13s ease, box-shadow .13s ease, transform .13s ease;
}

/* UI 2.3.1: VFM's native grid uses a bright primary overlay inside .itemicon.
   Neutralize it so hover feels like a desktop/cloud file browser. */
body.vfm-workspace-active .gridview .itemicon .hover {
    background: rgba(20, 24, 31, .055) !important;
    color: inherit !important;
}
body.vfm-workspace-active.vfm-layout-yandex-light .gridview .itemicon .hover {
    background: rgba(20, 24, 31, .04) !important;
}
body.vfm-workspace-active .gridview .itemicon .hover .round-btn {
    background: rgba(255,255,255,.82) !important;
}
body.vfm-layout-yandex-light.vfm-ws-folders-cards #foldertable tbody > tr {
    min-height: 104px;
}
body.vfm-layout-yandex-light #foldertable .vfm-folder-title > i {
    font-size: 44px !important;
}


/* ==========================================================================
   VFM Custom UI 2.4 — flex panels, clean tiles, fully light cloud view
   ========================================================================== */

/* Native VFM adds backgrounds to the title wrapper and selection button.
   Keep tile captions clean and keep circular controls actually circular. */
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .gridbody > .rowa .name .relative,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable .gridbody > .rowa .name .relative,
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .grid-item-title,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable .grid-item-title {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .grid-item-title,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable .grid-item-title {
    color: inherit !important;
    padding: .58rem .72rem .7rem !important;
}
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .gridbody > .rowa .name,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable .gridbody > .rowa .name {
    background: transparent !important;
    padding: 0 !important;
}
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .gridbody > .rowa .checkb,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable .gridbody > .rowa .checkb {
    background: transparent !important;
    border-radius: 50% !important;
}
body.vfm-workspace-active .gridview .checkb .round-btn,
body.vfm-workspace-active .gridview tbody > .rowa.attivo .checkb .round-btn,
body.vfm-workspace-active .gridview tbody > .rowa.vfm-selected-row .checkb .round-btn {
    width: 42px !important;
    height: 42px !important;
    line-height: 42px !important;
    border-radius: 50% !important;
    background: rgba(24, 28, 34, .58) !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(0,0,0,.18) !important;
    overflow: hidden !important;
}
body.vfm-workspace-active .gridview .itemicon .hover .round-btn,
body.vfm-workspace-active .gridview .infopanel .round-btn {
    border-radius: 50% !important;
    background: rgba(24, 28, 34, .56) !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(0,0,0,.16) !important;
}
body.vfm-workspace-active .gridview .itemicon .hover .round-btn:hover,
body.vfm-workspace-active .gridview .infopanel .round-btn:hover,
body.vfm-workspace-active .gridview .checkb .round-btn:hover {
    background: rgba(18, 21, 26, .72) !important;
}

/* Genuine flexible desktop workspace. Tree is left by default, Preview right;
   JS changes order for user-selected positions. */
body.vfm-workspace-active .vfm-workspace-shell {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    gap: 0 !important;
    min-width: 0;
}
body.vfm-workspace-active .vfm-workspace-main {
    flex: 1 1 0 !important;
    min-width: 280px !important;
    width: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
}
body.vfm-workspace-active .vfm-workspace-sidebar {
    flex: 0 0 var(--vfm-ws-folder-width) !important;
    width: var(--vfm-ws-folder-width) !important;
    max-width: min(46vw, 620px);
    grid-column: auto !important;
    grid-row: auto !important;
}
body.vfm-workspace-active .vfm-workspace-preview {
    flex: 0 0 var(--vfm-ws-preview-width) !important;
    width: var(--vfm-ws-preview-width) !important;
    max-width: min(56vw, 760px);
    grid-column: auto !important;
    grid-row: auto !important;
}
.vfm-workspace-resizer {
    display: block;
    flex: 0 0 10px;
    width: 10px;
    min-width: 10px;
    position: relative;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    z-index: 8;
}
.vfm-workspace-resizer[hidden] { display: none !important; }
.vfm-workspace-resizer::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 12%, transparent);
    transition: width .12s ease, left .12s ease, background .12s ease;
}
.vfm-workspace-resizer:hover::after,
.vfm-workspace-resizer.is-dragging::after {
    left: 3px;
    width: 4px;
    background: color-mix(in srgb, var(--vfm-ws-selection) 58%, transparent);
}
body.vfm-ws-resizing { cursor: col-resize !important; user-select: none !important; }
body.vfm-ws-resizing iframe { pointer-events: none !important; }
.vfm-workspace-preview-stage {
    height: var(--vfm-ws-preview-height) !important;
    min-height: 220px !important;
    max-height: min(72vh, 860px) !important;
}
.vfm-workspace-preview-stage img,
.vfm-workspace-preview-stage video,
.vfm-workspace-preview-stage iframe { height: 100% !important; max-height: 100% !important; }
.vfm-workspace-preview-height-resizer {
    height: 10px;
    margin: 2px 0 4px;
    cursor: row-resize;
    position: relative;
    touch-action: none;
    user-select: none;
}
.vfm-workspace-preview-height-resizer span {
    position: absolute;
    height: 2px;
    width: 46px;
    border-radius: 999px;
    left: 50%; top: 4px;
    transform: translateX(-50%);
    background: color-mix(in srgb, currentColor 18%, transparent);
}
.vfm-workspace-preview-height-resizer:hover span,
.vfm-workspace-preview-height-resizer.is-dragging span { height: 4px; top: 3px; background: color-mix(in srgb, var(--vfm-ws-selection) 55%, transparent); }

@media (max-width: 991.98px) {
    body.vfm-workspace-active .vfm-workspace-shell { flex-direction: column !important; gap: var(--vfm-ws-gap) !important; }
    body.vfm-workspace-active .vfm-workspace-main,
    body.vfm-workspace-active .vfm-workspace-sidebar,
    body.vfm-workspace-active .vfm-workspace-preview {
        order: initial !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }
    body.vfm-workspace-active .vfm-workspace-sidebar { order: 1 !important; }
    body.vfm-workspace-active .vfm-workspace-main { order: 2 !important; }
    body.vfm-workspace-active .vfm-workspace-preview { order: 3 !important; }
    .vfm-workspace-resizer { display: none !important; }
    .vfm-workspace-sidebar-inner, .vfm-workspace-preview-inner { position: static !important; max-height: none !important; }
}

/* Full light cloud preset. This deliberately overrides a globally enabled VFM dark mode. */
body.vfm-workspace-active.vfm-layout-yandex-light {
    --base-color-light: 220, 18%;
    --base-l-light: 98%;
    --base-color-dark: 220, 12%;
    --base-l-dark: 96%;
    --color-light: #f5f6f8;
    --color-light-lighter: #ffffff;
    --color-light-darker: #e9ecf1;
    --color-light-text: #20242a;
    --color-light-link: #353b44;
    --color-dark: #ffffff;
    --color-dark-lighter: #ffffff;
    --color-dark-darker: #edf0f4;
    --color-dark-text: #20242a;
    --color-dark-link: #353b44;
    --color-input: #ffffff;
    --color-input-darker: #f0f2f5;
    --color-input-text: #20242a;
    --color-header: rgba(255,255,255,.96);
    --color-header-text: #20242a;
    --vfm-ws-bg: #f5f6f8;
    --vfm-ws-card: #ffffff;
    --vfm-ws-text: #20242a;
    --vfm-ws-folder: #efb51f;
    --bs-body-bg: #f5f6f8;
    --bs-body-color: #20242a;
    --bs-secondary-color: rgba(32,36,42,.66);
    --bs-border-color: #e1e5ea;
    background: #f5f6f8 !important;
    color: #20242a !important;
}
body.vfm-layout-yandex-light .navbar.bg-dark,
body.vfm-layout-yandex-light .navbar,
body.vfm-layout-yandex-light footer.footer,
body.vfm-layout-yandex-light footer.bg-dark-lighter {
    background: rgba(255,255,255,.97) !important;
    color: #20242a !important;
    border-color: #e6e9ee !important;
    box-shadow: 0 1px 0 rgba(20,25,31,.07) !important;
}
body.vfm-layout-yandex-light .navbar a,
body.vfm-layout-yandex-light .navbar .nav-link,
body.vfm-layout-yandex-light footer a { color: #30353c !important; }
body.vfm-layout-yandex-light .navbar .dropdown-menu { background:#fff !important; color:#20242a !important; border-color:#e2e6eb !important; }
body.vfm-layout-yandex-light .navbar .dropdown-item { color:#20242a !important; }
body.vfm-layout-yandex-light .navbar .dropdown-item:hover { background:#f1f3f6 !important; }
body.vfm-layout-yandex-light > .container.mb-auto,
body.vfm-layout-yandex-light .main-content,
body.vfm-layout-yandex-light .uploadarea,
body.vfm-layout-yandex-light .vfm-workspace-shell { background: #f5f6f8 !important; color:#20242a !important; }
body.vfm-layout-yandex-light .uploadarea .form-control,
body.vfm-layout-yandex-light .uploadarea .input-group-text,
body.vfm-layout-yandex-light .uploadarea .form-select {
    background:#fff !important; color:#20242a !important; border-color:#dfe3e8 !important;
}
body.vfm-layout-yandex-light .uploadarea .form-control::placeholder { color:#8a9098 !important; opacity:1; }
body.vfm-layout-yandex-light .breadcrumb,
body.vfm-layout-yandex-light .breadcrumb a { color:#60666f !important; }
body.vfm-layout-yandex-light .vfm-workspace-toolbar,
body.vfm-layout-yandex-light .vfm-workspace-shell .tableblock,
body.vfm-layout-yandex-light .vfm-workspace-sidebar,
body.vfm-layout-yandex-light .vfm-workspace-preview,
body.vfm-layout-yandex-light .hidetable > section,
body.vfm-layout-yandex-light #biguploader {
    background: #fff !important;
    color:#20242a !important;
    border-color:#e1e5ea !important;
}
body.vfm-layout-yandex-light #biguploader {
    border: 2px dashed #d3d8df !important;
    color:#9ba2ab !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8) !important;
}
body.vfm-layout-yandex-light .vfm-workspace-toolbar .form-select,
body.vfm-layout-yandex-light .vfm-workspace-toolbar .btn-outline-secondary {
    background:#fff !important; color:#30353c !important; border-color:#d8dde4 !important;
}
body.vfm-layout-yandex-light .vfm-workspace-toolbar .btn-outline-secondary:hover { background:#f2f4f7 !important; }
body.vfm-layout-yandex-light.vfm-ws-folders-cards #foldertable tbody > tr {
    background: linear-gradient(145deg, #ffffff 0%, #fbfcfd 58%, #f2f4f7 100%) !important;
    color:#20242a !important;
    border:1px solid #e0e4e9 !important;
    box-shadow: 0 7px 20px rgba(29,35,42,.075), inset 0 1px 0 rgba(255,255,255,.92) !important;
    min-height: 112px;
}
body.vfm-layout-yandex-light.vfm-ws-folders-cards #foldertable tbody > tr:hover {
    background: linear-gradient(145deg,#fff 0%,#f7f9fb 100%) !important;
    box-shadow: 0 11px 28px rgba(29,35,42,.11), inset 0 1px 0 #fff !important;
    transform: translateY(-2px);
}
body.vfm-layout-yandex-light.vfm-iconpack-modern #foldertable .vfm-folder-title > i {
    width: 52px !important;
    height: 48px !important;
    border: 1px solid rgba(196,141,0,.16) !important;
    border-radius: 15px !important;
    color:#d99b00 !important;
    font-size:31px !important;
    background: linear-gradient(145deg,#fff5bd 0%,#ffe26c 52%,#ffc928 100%) !important;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -4px 8px rgba(206,142,0,.12), 0 6px 14px rgba(210,157,13,.18) !important;
    text-shadow: 0 1px 0 rgba(255,255,255,.58);
}
body.vfm-layout-yandex-light .vfm-folder-label,
body.vfm-layout-yandex-light #filetable .grid-item-title { color:#20242a !important; font-weight:600; }
body.vfm-layout-yandex-light .vfm-folder-meta { color:#6f7680 !important; opacity:1 !important; }
body.vfm-layout-yandex-light.vfm-ws-mode-tiles #filetable .gridbody > .rowa,
body.vfm-layout-yandex-light.vfm-ws-mode-gallery #filetable .gridbody > .rowa {
    background: linear-gradient(145deg,#fff,#f7f8fa) !important;
    color:#20242a !important;
    border-color:#e0e4e9 !important;
    box-shadow: 0 5px 16px rgba(29,35,42,.065) !important;
}
body.vfm-layout-yandex-light.vfm-ws-mode-tiles #filetable .gridbody > .rowa:hover,
body.vfm-layout-yandex-light.vfm-ws-mode-gallery #filetable .gridbody > .rowa:hover {
    background: linear-gradient(145deg,#fff,#f3f5f8) !important;
    box-shadow:0 10px 25px rgba(29,35,42,.105) !important;
}
body.vfm-layout-yandex-light .gridview .itemicon .hover { background:rgba(21,25,31,.035) !important; }
body.vfm-layout-yandex-light .gridview .checkb .round-btn,
body.vfm-layout-yandex-light .gridview .itemicon .hover .round-btn,
body.vfm-layout-yandex-light .gridview .infopanel .round-btn {
    background:rgba(28,32,38,.62) !important; color:#fff !important;
}
body.vfm-layout-yandex-light .vfm-workspace-preview-stage { background:#f0f2f5 !important; }
/* UI 2.4 light-theme specificity guard: VFM dark-mode utility classes use
   stronger selectors than generic .tableblock rules. Keep the cloud preset
   truly light even when the global installation is in dark mode. */
body.dark-mode.vfm-workspace-active.vfm-layout-yandex-light .vfm-workspace-shell section.tableblock.bg-light-lighter,
body.dark-mode.vfm-workspace-active.vfm-layout-yandex-light .vfm-workspace-shell section.vfmblock.tableblock.bg-light-lighter,
body.dark-mode.vfm-workspace-active.vfm-layout-yandex-light .vfm-workspace-shell .ghost.bg-light-lighter,
body.vfm-workspace-active.vfm-layout-yandex-light .vfm-workspace-shell section.tableblock.bg-light-lighter {
    background: #ffffff !important;
    color: #20242a !important;
    border-color: #e1e5ea !important;
    box-shadow: 0 5px 18px rgba(29,35,42,.055) !important;
}
body.dark-mode.vfm-layout-yandex-light .bg-light-lighter,
body.dark-mode.vfm-layout-yandex-light .bg-dark-lighter {
    background-color: #ffffff !important;
    color: #20242a !important;
}
body.vfm-layout-yandex-light .dataTables_info,
body.vfm-layout-yandex-light .dataTables_length,
body.vfm-layout-yandex-light .dataTables_filter,
body.vfm-layout-yandex-light .dataTables_paginate,
body.vfm-layout-yandex-light .table-controls-top,
body.vfm-layout-yandex-light .table-controls-bottom {
    color: #5f6670 !important;
}


/* UI 2.5 — contextual Preview: full viewer opens only from the loupe inside Preview. */
.vfm-workspace-preview-stage { position: relative; }
.vfm-workspace-preview-zoom {
    position: absolute;
    z-index: 8;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    background: color-mix(in srgb, var(--vfm-ws-card) 72%, transparent);
    color: var(--vfm-ws-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 18px rgba(0,0,0,.12);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
}
.vfm-workspace-preview-zoom:hover,
.vfm-workspace-preview-zoom:focus-visible {
    transform: scale(1.06);
    background: color-mix(in srgb, var(--vfm-ws-card) 88%, transparent);
    box-shadow: 0 7px 22px rgba(0,0,0,.17);
    outline: none;
}
body.vfm-layout-yandex-light .vfm-workspace-preview-zoom {
    background: rgba(255,255,255,.82) !important;
    color: #202124 !important;
    border-color: rgba(20,24,31,.10) !important;
}

/* ================================================================
   VFM Custom Workspace 2.8 — desktop navigation and actions
   ================================================================ */

/* App-like left navigation. It lives inside the same resizable sidebar as the
   permission-safe folder tree, so no second folder column is introduced. */
.vfm-workspace-appnav {
    display: grid;
    gap: .2rem;
    margin-bottom: .55rem;
}
.vfm-appnav-item,
.vfm-appnav-folder {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .46rem .55rem;
    border: 0;
    border-radius: max(7px, calc(var(--vfm-ws-radius) - 7px));
    background: transparent;
    color: inherit;
    text-decoration: none;
    text-align: left;
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
    transition: background .14s ease, transform .14s ease, color .14s ease;
}
.vfm-appnav-item:hover,
.vfm-appnav-folder:hover {
    background: color-mix(in srgb, var(--vfm-ws-selection) 7%, transparent);
    color: inherit;
}
.vfm-appnav-item.active,
.vfm-appnav-folder.active {
    background: color-mix(in srgb, var(--vfm-ws-selection) 11%, transparent);
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--vfm-ws-selection) 72%, transparent);
}
.vfm-appnav-item > i,
.vfm-appnav-folder > i {
    flex: 0 0 20px;
    width: 20px;
    text-align: center;
    opacity: .84;
}
.vfm-appnav-item > span,
.vfm-appnav-folder > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vfm-appnav-pin-current.is-pinned > i { color: #e6aa14; opacity: 1; }
.vfm-appnav-section { margin-top: .55rem; }
.vfm-appnav-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 0 .55rem .24rem;
    font-size: max(10px, calc(var(--vfm-ws-font) - 3px));
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
    opacity: .58;
}
.vfm-appnav-count {
    min-width: 18px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.vfm-appnav-empty {
    padding: .25rem .55rem;
    font-size: max(10px, calc(var(--vfm-ws-font) - 2px));
    opacity: .38;
}
.vfm-appnav-divider {
    height: 1px;
    margin: .62rem .2rem .7rem;
    background: color-mix(in srgb, currentColor 11%, transparent);
}

/* Selected-file action bar. It is intentionally separate from VFM's native
   action dropdown; every button delegates to that original control. */
.vfm-workspace-selectionbar {
    position: sticky;
    top: 112px;
    z-index: 1018;
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    width: 100%;
    margin: -.35rem 0 .8rem;
    padding: .48rem .55rem;
    border: 1px solid color-mix(in srgb, var(--vfm-ws-selection) 22%, currentColor 8%);
    border-radius: max(8px, calc(var(--vfm-ws-radius) - 4px));
    background: color-mix(in srgb, var(--vfm-ws-card) 92%, var(--vfm-ws-selection) 8%);
    color: var(--vfm-ws-text);
    box-shadow: 0 7px 22px rgba(0,0,0,.07);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.vfm-workspace-selectionbar[hidden] { display: none !important; }
.vfm-selection-summary {
    display: inline-flex;
    align-items: center;
    gap: .34rem;
    padding: 0 .2rem;
    white-space: nowrap;
}
.vfm-selection-summary > i { color: var(--vfm-ws-selection); }
.vfm-selection-count { font-variant-numeric: tabular-nums; }
.vfm-selection-actions {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
}
.vfm-selection-action {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    white-space: nowrap;
}
.vfm-selection-clear { margin-left: auto; }

/* Desktop context menu. No action is inserted unless the server supplied the
   corresponding GateKeeper permission and native row/group control. */
.vfm-workspace-contextmenu {
    position: fixed;
    z-index: 2000;
    width: min(292px, calc(100vw - 20px));
    padding: .38rem;
    border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 13px;
    background: color-mix(in srgb, var(--vfm-ws-card, #fff) 96%, transparent);
    color: var(--vfm-ws-text, #212529);
    box-shadow: 0 17px 46px rgba(0,0,0,.18), 0 2px 7px rgba(0,0,0,.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}
.vfm-workspace-contextmenu[hidden] { display: none !important; }
.vfm-context-title {
    display: grid;
    grid-template-columns: 24px minmax(0,1fr) auto;
    align-items: center;
    gap: .45rem;
    padding: .48rem .55rem .42rem;
    font-size: .82rem;
    font-weight: 700;
}
.vfm-context-title > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vfm-context-title > small {
    min-width: 22px;
    padding: .08rem .34rem;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 7%, transparent);
    text-align: center;
    font-weight: 600;
    opacity: .72;
}
.vfm-context-separator {
    height: 1px;
    margin: .24rem .3rem;
    background: color-mix(in srgb, currentColor 10%, transparent);
}
.vfm-context-item {
    width: 100%;
    min-height: 36px;
    display: grid;
    grid-template-columns: 24px minmax(0,1fr);
    align-items: center;
    gap: .45rem;
    padding: .42rem .55rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
}
.vfm-context-item:hover,
.vfm-context-item:focus-visible {
    background: color-mix(in srgb, var(--vfm-ws-selection, #0d6efd) 8%, transparent);
    outline: none;
}
.vfm-context-item.text-danger:hover { background: rgba(220,53,69,.08); }

/* Make selected rows readable in all modes without restoring the old blue
   opaque hover. */
body.vfm-workspace-active #filetable tbody > tr.attivo,
body.vfm-workspace-active #filetable tbody > tr.vfm-selected-row {
    outline: 1px solid color-mix(in srgb, var(--vfm-ws-selection) 35%, transparent);
    outline-offset: -1px;
    background-color: color-mix(in srgb, var(--vfm-ws-selection) 5%, transparent) !important;
}

/* Light cloud mode includes the new navigation/action surfaces. */
body.vfm-layout-yandex-light .vfm-workspace-selectionbar,
body.vfm-layout-yandex-light .vfm-workspace-contextmenu {
    background: rgba(255,255,255,.96) !important;
    color: #20242a !important;
    border-color: #e1e5ea !important;
}
body.vfm-layout-yandex-light .vfm-appnav-item,
body.vfm-layout-yandex-light .vfm-appnav-folder { color: #30353c !important; }
body.vfm-layout-yandex-light .vfm-appnav-heading { color: #69717c !important; opacity: 1; }

@media (max-width: 991.98px) {
    .vfm-workspace-selectionbar { position: static; top: auto; }
    .vfm-selection-action span { display: none; }
    .vfm-workspace-appnav { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .vfm-appnav-section { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
    .vfm-workspace-selectionbar { gap: .35rem; }
    .vfm-selection-actions { gap: .2rem; }
    .vfm-workspace-appnav { grid-template-columns: minmax(0,1fr); }
    .vfm-appnav-section { grid-column: auto; }
}


/* ========================================================================== 
   VFM Custom UI 2.9 — independent folder strip + clearer hot width + centered viewer
   ========================================================================== */

/* The horizontal current-folder cards are primary content and remain visible
   whether the optional navigation tree is on or off. */
body.vfm-workspace-active .vfm-workspace-main > .vfm-workspace-folders,
body.vfm-workspace-active.vfm-ws-tree-on.vfm-ws-tree-replaces-folders .vfm-workspace-main > .vfm-workspace-folders {
    display: block !important;
    visibility: visible !important;
}

/* Native select popups can otherwise render a white menu with inherited white
   text in a dark VFM theme. Explicitly advertise the proper system colour scheme
   and colour the options as a fallback. */
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-hot-width,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-width-hot {
    color-scheme: dark;
}
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-width-hot {
    color: #f3f5f7 !important;
    background-color: #2f3338 !important;
}
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-width-hot option {
    color: #f3f5f7 !important;
    background: #2f3338 !important;
}
body.vfm-layout-yandex-light .vfm-ws-hot-width,
body.vfm-layout-yandex-light .vfm-ws-width-hot {
    color-scheme: light;
}
body.vfm-layout-yandex-light .vfm-ws-width-hot {
    color: #252a31 !important;
    background-color: #fff !important;
}
body.vfm-layout-yandex-light .vfm-ws-width-hot option {
    color: #252a31 !important;
    background: #fff !important;
}

/* Full-view control belongs visually to the content being previewed. Center it
   over the preview rather than pinning it to the upper-right corner. */
.vfm-workspace-preview-zoom {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
}
.vfm-workspace-preview-zoom:hover,
.vfm-workspace-preview-zoom:focus-visible {
    transform: translate(-50%, -50%) scale(1.08) !important;
}

/* ==========================================================================
   VFM Custom UI 3.0 — clear selection + folder stats / share / ZIP actions
   ========================================================================== */

/* Selection should be unmistakable without hiding the photograph. The card gets
   a solid accent outline, the checkbox becomes a solid accent chip, and only the
   caption/surface receives a soft configurable tint. */
body.vfm-workspace-active {
    --vfm-ws-selection-tint: 18%;
}
body.vfm-workspace-active #filetable tbody > tr.attivo,
body.vfm-workspace-active #filetable tbody > tr.vfm-selected-row {
    outline: 3px solid var(--vfm-ws-selection) !important;
    outline-offset: -3px !important;
    border-color: var(--vfm-ws-selection) !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--vfm-ws-selection) 38%, transparent), 0 8px 22px rgba(0,0,0,.14) !important;
    background: color-mix(in srgb, var(--vfm-ws-card) calc(100% - var(--vfm-ws-selection-tint)), var(--vfm-ws-selection) var(--vfm-ws-selection-tint)) !important;
}
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .gridbody > .rowa.attivo .grid-item-title,
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable .gridbody > .rowa.vfm-selected-row .grid-item-title,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable .gridbody > .rowa.attivo .grid-item-title,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable .gridbody > .rowa.vfm-selected-row .grid-item-title {
    background: color-mix(in srgb, var(--vfm-ws-selection) var(--vfm-ws-selection-tint), transparent) !important;
    box-shadow: inset 0 2px 0 color-mix(in srgb, var(--vfm-ws-selection) 34%, transparent) !important;
}
body.vfm-workspace-active .gridview tbody > .rowa.attivo .checkb .round-btn,
body.vfm-workspace-active .gridview tbody > .rowa.vfm-selected-row .checkb .round-btn {
    background: var(--vfm-ws-selection) !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, #fff 80%, transparent), 0 4px 12px rgba(0,0,0,.24) !important;
    opacity: 1 !important;
}
body.vfm-workspace-active #filetable tbody > tr.attivo .checkb .round-btn::after,
body.vfm-workspace-active #filetable tbody > tr.vfm-selected-row .checkb .round-btn::after {
    font-weight: 800;
}
body.vfm-workspace-active.vfm-ws-mode-list #filetable tbody > tr.attivo > td,
body.vfm-workspace-active.vfm-ws-mode-list #filetable tbody > tr.vfm-selected-row > td {
    background: color-mix(in srgb, var(--vfm-ws-selection) var(--vfm-ws-selection-tint), transparent) !important;
}

/* Folder cards: statistics stay compact; action icons are explicit and never
   rely on the old generic hover glyph. */
body.vfm-workspace-active #foldertable td.name { position: relative; }
body.vfm-workspace-active #foldertable td.name .hover { display: none !important; }
body.vfm-workspace-active .vfm-folder-quickactions {
    position: absolute;
    right: .48rem;
    top: .46rem;
    z-index: 8;
    display: inline-flex;
    gap: .28rem;
    align-items: center;
}
body.vfm-workspace-active .vfm-folder-quickactions[hidden] { display: none !important; }
body.vfm-workspace-active .vfm-folder-quickaction {
    width: 31px;
    height: 31px;
    padding: 0;
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--vfm-ws-card) 88%, transparent);
    color: var(--vfm-ws-text);
    box-shadow: 0 2px 7px rgba(0,0,0,.08);
    opacity: .8;
    transition: transform .12s ease, opacity .12s ease, background-color .12s ease, border-color .12s ease;
}
body.vfm-workspace-active .vfm-folder-quickaction:hover,
body.vfm-workspace-active .vfm-folder-quickaction:focus-visible {
    opacity: 1;
    transform: translateY(-1px);
    color: var(--vfm-ws-selection);
    border-color: color-mix(in srgb, var(--vfm-ws-selection) 35%, transparent);
    background: color-mix(in srgb, var(--vfm-ws-selection) 9%, var(--vfm-ws-card));
    outline: none;
}
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.name {
    padding-right: 5.4rem !important;
}
body.vfm-workspace-active .vfm-folder-meta {
    min-height: 1.25rem;
}
body.vfm-workspace-active .vfm-folder-files,
body.vfm-workspace-active .vfm-folder-size {
    font-variant-numeric: tabular-nums;
}
body.vfm-workspace-active .vfm-folder-size i { opacity: .86; }

/* Folder share dialog */
#vfmFolderShareModal .vfm-folder-share-qr-image {
    width: 150px;
    height: 150px;
    max-width: 100%;
    border-radius: 12px;
    background: #fff;
    padding: 7px;
}
#vfmFolderShareModal .vfm-folder-share-name {
    overflow-wrap: anywhere;
}

body.vfm-layout-yandex-light .vfm-folder-quickaction {
    background: rgba(255,255,255,.94) !important;
    color: #30353c !important;
    border-color: rgba(35,42,50,.10) !important;
}
body.vfm-layout-yandex-light .vfm-folder-quickaction:hover {
    color: var(--vfm-ws-selection) !important;
    background: color-mix(in srgb, var(--vfm-ws-selection) 8%, #fff) !important;
}


/* ========================================================================== 
   VFM Custom UI 3.0 — smart folder names, XXL folders, durable live workspace
   ========================================================================== */

/* Folder cards use their own width independently from file thumbnails. */
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--vfm-ws-folder-tile, 210px)), 1fr)) !important;
    align-items: stretch;
}
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr {
    min-height: max(78px, calc(var(--vfm-ws-folder-icon, 38px) + 32px));
    height: auto !important;
}
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.name {
    min-height: inherit;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
}
body.vfm-workspace-active .vfm-folder-title > i {
    width: var(--vfm-ws-folder-icon, 38px) !important;
    height: var(--vfm-ws-folder-icon, 38px) !important;
    min-width: var(--vfm-ws-folder-icon, 38px) !important;
}
body.vfm-workspace-active.vfm-iconpack-modern #foldertable .vfm-folder-title > i {
    font-size: calc(var(--vfm-ws-folder-icon, 38px) * .58) !important;
    border-radius: max(10px, calc(var(--vfm-ws-folder-icon, 38px) * .27));
}
body.vfm-workspace-active.vfm-iconpack-outline #foldertable .vfm-folder-title > i {
    font-size: calc(var(--vfm-ws-folder-icon, 38px) * .63) !important;
}
body.vfm-workspace-active.vfm-iconpack-classic #foldertable .vfm-folder-title > i,
body.vfm-workspace-active.vfm-iconpack-mono #foldertable .vfm-folder-title > i {
    font-size: calc(var(--vfm-ws-folder-icon, 38px) * .68) !important;
}

/* Long directory names are fitted rather than silently disappearing at the end.
   The complete name remains available in the native title tooltip. */
body.vfm-workspace-active .vfm-folder-label {
    -webkit-line-clamp: 3 !important;
    line-clamp: 3;
    line-height: 1.17;
    max-height: none;
}
body.vfm-workspace-active .vfm-folder-label.vfm-folder-name-long {
    font-size: .92em;
    letter-spacing: -.01em;
}
body.vfm-workspace-active .vfm-folder-label.vfm-folder-name-xlong {
    font-size: .82em;
    line-height: 1.12;
    -webkit-line-clamp: 4 !important;
    line-clamp: 4;
}
body.vfm-workspace-active .vfm-folder-label.vfm-folder-name-xxlong {
    font-size: .74em;
    line-height: 1.08;
    -webkit-line-clamp: 4 !important;
    line-clamp: 4;
}
body.vfm-workspace-active .vfm-folder-title {
    align-items: flex-start;
}
body.vfm-workspace-active .vfm-folder-quickactions {
    background: color-mix(in srgb, var(--vfm-ws-card) 78%, transparent);
    border-radius: 999px;
    padding: 2px;
    backdrop-filter: blur(4px);
}
/* Ensure action buttons never cover the last characters of a wrapped label. */
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.name {
    padding-right: 5.8rem !important;
}
@media (max-width: 575.98px) {
    body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.name { padding-right: 4.8rem !important; }
}

/* Keep the folder strip compact: cards keep the chosen width instead of stretching
   to fill the whole row when only one or two folders are present. */
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--vfm-ws-folder-tile, 210px)), var(--vfm-ws-folder-tile, 210px))) !important;
    justify-content: start;
}
@media (max-width: 575.98px) {
    body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}


/* UI 3.0 final: folder labels get the full card width; actions live in the
   metadata row so long names are not chopped by two round buttons. */
body.vfm-workspace-active .vfm-folder-label {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    hyphens: auto;
}
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.name {
    padding-right: .9rem !important;
    padding-bottom: 2.7rem !important;
}
body.vfm-workspace-active .vfm-folder-quickactions {
    top: auto !important;
    right: .55rem !important;
    bottom: .48rem !important;
}
body.vfm-workspace-active .vfm-folder-meta {
    position: absolute;
    left: .78rem;
    bottom: .56rem;
    right: 5.2rem;
    margin: 0 !important;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable tbody > tr.attivo .itemicon,
body.vfm-workspace-active.vfm-ws-mode-tiles #filetable tbody > tr.vfm-selected-row .itemicon,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable tbody > tr.attivo .itemicon,
body.vfm-workspace-active.vfm-ws-mode-gallery #filetable tbody > tr.vfm-selected-row .itemicon {
    filter: none !important;
    opacity: 1 !important;
}


/* ========================================================================== 
   VFM Custom UI 3.1 — full folder names + giant folders + resilient selection
   ========================================================================== */

/* Folder names are data, not decoration: never silently cut the tail off.
   Cards grow vertically when required; length classes only reduce the font. */
body.vfm-workspace-active.vfm-ws-folders-cards .vfm-folder-label {
    display: block !important;
    -webkit-line-clamp: unset !important;
    line-clamp: unset !important;
    max-height: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
}
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr,
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.name {
    height: auto !important;
}
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody > tr > td.name {
    justify-content: flex-start !important;
    padding-top: .78rem !important;
    padding-bottom: 2.95rem !important;
}
body.vfm-workspace-active.vfm-ws-folders-cards .vfm-folder-title {
    width: 100%;
    min-width: 0;
}
body.vfm-workspace-active.vfm-ws-folders-cards .vfm-folder-label.vfm-folder-name-long { font-size: .92em !important; }
body.vfm-workspace-active.vfm-ws-folders-cards .vfm-folder-label.vfm-folder-name-xlong { font-size: .82em !important; line-height: 1.12 !important; }
body.vfm-workspace-active.vfm-ws-folders-cards .vfm-folder-label.vfm-folder-name-xxlong { font-size: .72em !important; line-height: 1.08 !important; }

/* Very large folder cards remain independent from photo/file thumbnail size. */
body.vfm-workspace-active.vfm-ws-folders-cards #foldertable tbody {
    grid-auto-rows: auto !important;
}

/* The checkbox/plus hit target gets an explicit pointer affordance; double-click
   logic is handled in workspace.js and no visual layer blocks pointer events. */
body.vfm-workspace-active #filetable td.checkb .round-btn,
body.vfm-workspace-active #filetable .checkbox .round-btn {
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}


/* ========================================================================== 
   VFM Custom UI 3.2 — 4.5.8 MOD stability, hot thumbnails, backgrounds, Reports
   ========================================================================== */
/* DataTables renders a synthetic empty row when the current directory has no
   child folders. Never turn that placeholder into a phantom folder card. */
body.vfm-workspace-active #foldertable tbody tr:has(td.dataTables_empty),
body.vfm-workspace-active #foldertable tbody tr:has(.dataTables_empty) { display:none !important; }
body.vfm-workspace-active .vfm-workspace-folders.vfm-ws-no-folders { display:none !important; }

/* The view toolbar is a persistent control surface whenever the administrator
   enables it; DataTables redraws and preset changes must not collapse it. */
body.vfm-workspace-active .vfm-workspace-toolbar:not([hidden]) { display:flex !important; visibility:visible !important; opacity:1 !important; }
.vfm-workspace-toolbar-22 .vfm-ws-hot-thumb {
    display:inline-flex; align-items:center; gap:.38rem; border:1px solid color-mix(in srgb,currentColor 14%,transparent);
    border-radius:9px; padding-left:.55rem; min-height:38px;
}
.vfm-workspace-toolbar-22 .vfm-ws-hot-thumb > i { opacity:.72; }
.vfm-workspace-toolbar-22 .vfm-ws-thumb-hot { width:78px; min-height:36px; border:0; border-left:1px solid color-mix(in srgb,currentColor 12%,transparent); border-radius:0 8px 8px 0; }
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-hot-thumb,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-thumb-hot { color-scheme:dark; color:#f3f5f7!important; background:#2f3338!important; }
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-thumb-hot option { color:#f3f5f7!important; background:#2f3338!important; }
body.vfm-layout-yandex-light .vfm-ws-hot-thumb,
body.vfm-layout-yandex-light .vfm-ws-thumb-hot { color-scheme:light; color:#252a31!important; background:#fff!important; }
body.vfm-layout-yandex-light .vfm-ws-thumb-hot option { color:#252a31!important; background:#fff!important; }

/* User workspace wallpaper. It is separate from the login wallpaper. */
.vfm-workspace-background-layer { position:absolute; inset:0; z-index:0; pointer-events:none; overflow:hidden; border-radius:var(--vfm-ws-radius,14px); display:none; }
body.vfm-workspace-active.vfm-ws-has-background .vfm-workspace-background-layer { display:block; }
.vfm-workspace-background-layer::before { content:""; position:absolute; inset:calc(var(--vfm-ws-bg-blur,0px) * -1.5); background-image:var(--vfm-ws-bg-image,none); background-repeat:no-repeat; background-size:var(--vfm-ws-bg-size,cover); background-position:var(--vfm-ws-bg-position,center center); filter:blur(var(--vfm-ws-bg-blur,0px)); transform:scale(1.015); }
.vfm-workspace-background-layer::after { content:""; position:absolute; inset:0; background:rgba(0,0,0,var(--vfm-ws-bg-overlay,.08)); }
body.vfm-workspace-active .vfm-workspace-toolbar,
body.vfm-workspace-active .vfm-workspace-selectionbar,
body.vfm-workspace-active .vfm-workspace-shell { position:relative; z-index:1; }
body.vfm-workspace-active.vfm-ws-has-background .vfm-workspace-shell { background:color-mix(in srgb,var(--vfm-ws-bg) 78%,transparent)!important; backdrop-filter:blur(4px); }
body.vfm-workspace-active.vfm-ws-has-background .vfm-workspace-main .tableblock { background:color-mix(in srgb,var(--vfm-ws-card) 86%,transparent)!important; backdrop-filter:blur(5px); }

/* ASPPA Reports media-only preset: spacious editorial cards modeled on the
   Reports page rhythm — wide media, clear title below, no article excerpt. */
body.vfm-layout-asppa-reports.vfm-ws-folders-cards #foldertable tbody { grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--vfm-ws-folder-tile,330px)),var(--vfm-ws-folder-tile,330px)))!important; gap:max(16px,var(--vfm-ws-gap)); }
body.vfm-layout-asppa-reports.vfm-ws-folders-cards #foldertable tbody>tr { min-height:150px; border-radius:max(16px,var(--vfm-ws-radius)); box-shadow:0 10px 30px rgba(0,0,0,.10); }
body.vfm-layout-asppa-reports #foldertable .vfm-folder-title { min-height:88px; align-items:center; }
body.vfm-layout-asppa-reports #foldertable .vfm-folder-title>i { width:72px!important; height:72px!important; min-width:72px!important; font-size:38px!important; }
body.vfm-layout-asppa-reports #foldertable .vfm-folder-label { font-size:15px!important; line-height:1.18!important; font-weight:700; }
body.vfm-layout-asppa-reports #filetable.gridview .gridbody { grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--vfm-ws-tile,330px)),var(--vfm-ws-tile,330px)))!important; gap:max(18px,var(--vfm-ws-gap)); justify-content:start; }
body.vfm-layout-asppa-reports #filetable.gridview .gridbody>.rowa { width:var(--vfm-ws-tile,330px)!important; max-width:100%; border-radius:max(16px,var(--vfm-ws-radius)); overflow:hidden; box-shadow:0 10px 30px rgba(0,0,0,.12); }
body.vfm-layout-asppa-reports #filetable.gridview .itemicon { aspect-ratio:3/2; height:auto!important; min-height:0!important; }
body.vfm-layout-asppa-reports #filetable.gridview .itemicon img { width:100%!important; height:100%!important; object-fit:cover!important; }
body.vfm-layout-asppa-reports #filetable.gridview .grid-item-title { min-height:58px; padding:.8rem 1rem!important; display:flex!important; align-items:center; font-size:15px!important; font-weight:650; }

/* The checkbox label contains a transparent native input. Keep the complete hit
   area available to the capture-phase double-click detector. */
body.vfm-workspace-active #filetable .checkbox.checkbox-circle,
body.vfm-workspace-active #filetable .checkbox.checkbox-circle .round-btn,
body.vfm-workspace-active #filetable .checkbox.checkbox-circle input.selecta { cursor:pointer!important; }

/* ========================================================================== 
   VFM Custom UI 3.2.1 HOTFIX — persistent toolbar stacking on VFM 4.5.8
   ========================================================================== */
/* UI 3.2 introduced a workspace wallpaper stacking context. A later generic
   z-index rule could reduce the sticky toolbar to the same layer as the shell,
   allowing the later-rendered folder strip to paint over it. Keep controls in
   their own layer and the file/folder workspace below them. */
body.vfm-workspace-active .vfm-workspace-toolbar {
    z-index: 1045 !important;
    isolation: isolate;
}
body.vfm-workspace-active.vfm-ws-sticky .vfm-workspace-toolbar {
    position: sticky !important;
    top: 58px;
    z-index: 1045 !important;
}
body.vfm-workspace-active:not(.vfm-ws-sticky) .vfm-workspace-toolbar {
    position: relative !important;
    z-index: 1045 !important;
}
body.vfm-workspace-active .vfm-workspace-selectionbar {
    position: relative;
    z-index: 1040 !important;
}
body.vfm-workspace-active .vfm-workspace-shell {
    position: relative;
    z-index: 1 !important;
}


/* ==========================================================================
   VFM Custom UI 3.2.2 HOTFIX — selection action row + thumbnail magnifier
   ========================================================================== */
/* VFM's native bulk-action toolbar stays in the DOM as the permission-aware
   command target, but is hidden visually while Custom UI is active. */
body.vfm-workspace-active #vfm-workspace-files > .tableblock > .action-group {
    display: none !important;
}

/* Selected-file actions are a real layout row between the view toolbar and the
   flex workspace. They never overlay thumbnails, the tree, or Preview. */
body.vfm-workspace-active .vfm-workspace-selectionbar {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 1035 !important;
    width: 100% !important;
    margin: .55rem 0 .8rem !important;
    flex: 0 0 auto;
    clear: both;
}
body.vfm-workspace-active .vfm-workspace-selectionbar:not([hidden]) { display:flex !important; }
body.vfm-workspace-active .vfm-workspace-selectionbar[hidden] { display:none !important; }
body.vfm-workspace-active .vfm-workspace-shell { clear:both; }

/* Magnifier is a direct full-view affordance even when Preview is enabled. */
body.vfm-workspace-active #filetable .itemicon a.item.file .hover .round-btn,
body.vfm-workspace-active #filetable .itemicon a.item.file .hover .bi-zoom-in {
    cursor: zoom-in !important;
    pointer-events: auto !important;
}


/* ========================================================================== 
   VFM Custom UI 3.2.3 — toolbar navigation controls
   ========================================================================== */
.vfm-workspace-toolbar-22 .vfm-ws-nav-group {
    flex: 0 0 auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent);
}
.vfm-workspace-toolbar-22 .vfm-ws-nav-group .btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    border-color: color-mix(in srgb, currentColor 13%, transparent);
    background: color-mix(in srgb, var(--vfm-ws-card) 96%, currentColor 4%);
}
.vfm-workspace-toolbar-22 .vfm-ws-nav-group .btn:first-child { border-radius: 10px 0 0 10px; }
.vfm-workspace-toolbar-22 .vfm-ws-nav-group .btn:last-child { border-radius: 0 10px 10px 0; }
.vfm-workspace-toolbar-22 .vfm-ws-nav-group .btn:not(:disabled):hover {
    background: color-mix(in srgb, var(--color-primary) 10%, var(--vfm-ws-card));
    color: var(--color-primary);
}
.vfm-workspace-toolbar-22 .vfm-ws-nav-group .btn:disabled { opacity: .34; }
.vfm-workspace-toolbar-22 .vfm-ws-nav-refresh.vfm-ws-refreshing i { animation: vfm-ws-nav-spin .75s linear infinite; }
@keyframes vfm-ws-nav-spin { to { transform: rotate(360deg); } }
body.vfm-layout-yandex-light .vfm-ws-nav-group .btn {
    background: #fff !important;
    color: #3a4048 !important;
    border-color: #dde2e8 !important;
}
body.vfm-layout-yandex-light .vfm-ws-nav-group .btn:not(:disabled):hover {
    background: #f3f6fa !important;
    color: #1769e0 !important;
}
@media (max-width: 575.98px) {
    .vfm-workspace-toolbar-22 .vfm-ws-nav-group .btn { width: 34px; min-width: 34px; height: 34px; min-height: 34px; }
}

/* ========================================================================== 
   VFM Custom UI 3.2.4 — Up / sorting / desktop status bar
   ========================================================================== */
.vfm-workspace-toolbar-22 .vfm-ws-sort-hot {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    border-radius: 9px;
    overflow: hidden;
    flex: 0 0 auto;
}
.vfm-workspace-toolbar-22 .vfm-ws-sort-hot > i {
    opacity: .72;
    padding: 0 .5rem 0 .6rem;
}
.vfm-workspace-toolbar-22 .vfm-ws-sort-key {
    width: 86px;
    min-height: 36px;
    border: 0;
    border-left: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 0;
    padding-left: .5rem;
    padding-right: 1.75rem;
}
.vfm-workspace-toolbar-22 .vfm-ws-sort-dir {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-left: 1px solid color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-sort-hot,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-sort-key,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-sort-dir {
    color-scheme: dark;
    color: #f3f5f7 !important;
    background: #2f3338 !important;
}
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-sort-key option {
    color: #f3f5f7 !important;
    background: #2f3338 !important;
}
body.vfm-layout-yandex-light .vfm-ws-sort-hot,
body.vfm-layout-yandex-light .vfm-ws-sort-key,
body.vfm-layout-yandex-light .vfm-ws-sort-dir {
    color-scheme: light;
    color: #252a31 !important;
    background: #fff !important;
    border-color: #dde2e8 !important;
}
body.vfm-layout-yandex-light .vfm-ws-sort-key option { color:#252a31 !important; background:#fff !important; }

/* A non-overlay status line, similar to a desktop file manager. */
body.vfm-workspace-active .vfm-workspace-statusbar {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 38px;
    margin: .7rem 0 0;
    padding: .45rem .75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.25rem;
    flex-wrap: wrap;
    border: 1px solid color-mix(in srgb, currentColor 10%, transparent);
    border-radius: max(9px, calc(var(--vfm-ws-radius) * .72));
    background: color-mix(in srgb, var(--vfm-ws-card) 96%, transparent);
    color: var(--vfm-ws-text);
    box-shadow: 0 2px 10px rgba(0,0,0,.035);
    font-size: 12.5px;
    line-height: 1.2;
}
.vfm-ws-status-main,
.vfm-ws-status-detail {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}
.vfm-ws-status-main > i,
.vfm-ws-status-detail > i { opacity: .72; }
.vfm-ws-status-dot { opacity: .46; padding: 0 .05rem; }
.vfm-ws-status-detail { margin-left: auto; }
.vfm-ws-status-detail small { opacity: .62; }
body.vfm-workspace-active.vfm-ws-has-background .vfm-workspace-statusbar {
    background: color-mix(in srgb, var(--vfm-ws-card) 84%, transparent);
    backdrop-filter: blur(5px);
}
body.vfm-layout-yandex-light .vfm-workspace-statusbar {
    background: #fff !important;
    color: #343a42 !important;
    border-color: #e4e8ed !important;
}

@media (max-width: 1199.98px) {
    .vfm-workspace-toolbar-22 .vfm-ws-sort-hot > i { display:none; }
    .vfm-workspace-toolbar-22 .vfm-ws-sort-key { border-left:0; width:78px; }
}
@media (max-width: 767.98px) {
    .vfm-workspace-toolbar-22 .vfm-ws-sort-key { width:70px; font-size:12px; }
    .vfm-workspace-toolbar-22 .vfm-ws-sort-dir { width:34px; min-width:34px; }
    body.vfm-workspace-active .vfm-workspace-statusbar { padding:.4rem .6rem; font-size:12px; }
    .vfm-ws-status-detail { margin-left:0; width:100%; }
}


/* Generic light VFM themes must not inherit the older non-Yandex dark control skin. */
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-hot-width,
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-width-hot,
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-hot-thumb,
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-thumb-hot,
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-sort-hot,
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-sort-key,
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-sort-dir {
    color-scheme: light;
    color: var(--bs-body-color, #212529) !important;
    background: var(--bs-body-bg, #ffffff) !important;
}
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-width-hot option,
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-thumb-hot option,
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-ws-sort-key option {
    color: var(--bs-body-color, #212529) !important;
    background: var(--bs-body-bg, #ffffff) !important;
}

/* VFM 4.5.8 exposes the selected Bootstrap theme on <html>. Its legacy
   VFM color variables still key off .dark-mode, so bridge the authoritative
   data-bs-theme state here. This removes light islands from the native upload,
   table, modal and form surfaces without changing the configured base palette. */
html[data-bs-theme="dark"] body {
    --color-light: hsl(var(--base-color-dark), var(--base-l-dark));
    --color-light-darker: hsl(var(--base-color-dark), calc(var(--base-l-dark) - 8%));
    --color-light-lighter: hsl(var(--base-color-dark), calc(var(--base-l-dark) + 8%));
    --color-light-text: var(--color-dark-text);
    --color-light-link: var(--color-dark-link);
    --color-input: var(--color-dark);
    --color-input-darker: var(--color-dark-darker);
    --color-input-text: var(--color-dark-text);
}
html[data-bs-theme="light"] body {
    --color-light: hsl(var(--base-color-light), var(--base-l-light));
    --color-light-darker: hsl(var(--base-color-light), calc(var(--base-l-light) - 5%));
    --color-light-lighter: hsl(var(--base-color-light), calc(var(--base-l-light) + 5%));
    --color-light-text: #212529;
    --color-light-link: #374048;
    --color-input: var(--color-light);
    --color-input-darker: var(--color-light-darker);
    --color-input-text: var(--color-light-text);
}

/* ==========================================================================
   VFM Custom UI 3.3.2 — theme coherence
   VFM 4.5.8 uses html[data-bs-theme], not body.dark-mode, as the active theme.
   Keep generic workspace surfaces dark in dark mode and light in light mode.
   The explicit yandex-light preset intentionally remains light.
   ========================================================================== */
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) {
    color-scheme: dark;
}
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-toolbar,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-shell .tableblock,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-sidebar,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-preview,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .hidetable > section,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-shell .bg-light-lighter {
    background-color: var(--vfm-ws-card) !important;
    color: var(--vfm-ws-text) !important;
    border-color: color-mix(in srgb, var(--vfm-ws-text) 12%, transparent) !important;
}
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-preview-stage {
    background: color-mix(in srgb, var(--vfm-ws-card) 78%, #000 22%) !important;
}
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) #filetable,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) #foldertable,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) #filetable_wrapper,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) #foldertable_wrapper,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .dataTables_info,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .dataTables_length,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .dataTables_filter,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .dataTables_paginate {
    color: var(--vfm-ws-text) !important;
}
html[data-bs-theme="light"] body.vfm-workspace-active:not(.vfm-ws-has-background):not(.vfm-layout-yandex-light) .vfm-workspace-shell {
    color-scheme: light;
}


/* ==========================================================================
   VFM Custom UI 3.3.3 — compact lazy tree + theme-aware scrollbars
   ========================================================================== */
@media (min-width: 1200px) {
    body.vfm-workspace-active .vfm-workspace-sidebar.vfm-visible {
        min-width: 280px !important;
    }
}
.vfm-workspace-tree .sub-tree {
    display: none;
    margin-left: 2px !important;
    padding-left: 9px !important;
}
.vfm-workspace-tree li.vfm-tree-item {
    padding-right: 28px !important;
}
.vfm-workspace-tree li.vfm-tree-item > a,
.vfm-workspace-tree .vfm-lazy-tree-label {
    max-width: 100% !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vfm-workspace-tree .toggle-tree[data-vfm-lazy-tree] {
    right: 1px !important;
}
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-sidebar-inner,
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-preview-inner,
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-tree {
    color-scheme: light;
    scrollbar-color: #b8bec6 #eef1f4;
}
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-sidebar-inner,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-preview-inner,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-tree {
    color-scheme: dark;
    scrollbar-color: #5d6670 #242a31;
}
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-sidebar-inner::-webkit-scrollbar,
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-preview-inner::-webkit-scrollbar { width: 11px; height: 11px; }
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-sidebar-inner::-webkit-scrollbar-track,
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-preview-inner::-webkit-scrollbar-track { background: #eef1f4; }
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-sidebar-inner::-webkit-scrollbar-thumb,
html[data-bs-theme="light"] body.vfm-workspace-active .vfm-workspace-preview-inner::-webkit-scrollbar-thumb { background: #b8bec6; border: 2px solid #eef1f4; border-radius: 10px; }
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-sidebar-inner::-webkit-scrollbar,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-preview-inner::-webkit-scrollbar { width: 11px; height: 11px; }
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-sidebar-inner::-webkit-scrollbar-track,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-preview-inner::-webkit-scrollbar-track { background: #242a31; }
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-sidebar-inner::-webkit-scrollbar-thumb,
html[data-bs-theme="dark"] body.vfm-workspace-active:not(.vfm-layout-yandex-light) .vfm-workspace-preview-inner::-webkit-scrollbar-thumb { background: #5d6670; border: 2px solid #242a31; border-radius: 10px; }


/* ==========================================================================
   VFM Custom UI 3.3.7 — lazy tree visibility contract
   ========================================================================== */
/* .sub-tree is collapsed by default. aria-expanded=true is the authoritative
   open state, so a successfully loaded branch cannot remain hidden by the
   default display:none rule. JS also sets display:block as an inline fallback. */
.vfm-workspace-tree .toggle-tree[data-vfm-lazy-tree][aria-expanded="true"] + .sub-tree[data-vfm-tree-branch] {
    display: block;
}

/* ==========================================================================
   VFM Custom UI 3.4.0 — public Share UI polish
   Presentation only: share tokens, CAPTCHA, passwords, ZIP/download URLs,
   one-time links and server-side security checks are unchanged.
   ========================================================================== */
body.vfm-share-public {
    --vfm-share-card-bg: rgba(255,255,255,.96);
    --vfm-share-card-text: #172033;
    --vfm-share-muted: #697386;
    --vfm-share-border: rgba(35,46,66,.10);
    --vfm-share-soft: #f5f7fb;
    --vfm-share-shadow: 0 28px 80px rgba(24,34,52,.16), 0 6px 22px rgba(24,34,52,.08);
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(13,110,253,.10), transparent 30rem),
        radial-gradient(circle at 90% 90%, rgba(13,110,253,.07), transparent 28rem),
        #f3f6fb;
}
html[data-bs-theme="dark"] body.vfm-share-public {
    --vfm-share-card-bg: rgba(28,34,43,.96);
    --vfm-share-card-text: #f3f6fb;
    --vfm-share-muted: #aab4c3;
    --vfm-share-border: rgba(255,255,255,.10);
    --vfm-share-soft: rgba(255,255,255,.055);
    --vfm-share-shadow: 0 30px 86px rgba(0,0,0,.35), 0 8px 26px rgba(0,0,0,.20);
    background:
        radial-gradient(circle at 15% 10%, rgba(64,133,255,.14), transparent 30rem),
        radial-gradient(circle at 90% 90%, rgba(64,133,255,.09), transparent 28rem),
        #171c24;
}
body.vfm-share-public .vfm-share-stage {
    min-height: clamp(520px, 76vh, 820px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 5vw, 64px) 16px;
}
body.vfm-share-public .vfm-share-card {
    width: min(100%, 760px);
    color: var(--vfm-share-card-text);
    background: var(--vfm-share-card-bg);
    border: 1px solid var(--vfm-share-border);
    border-radius: 24px;
    box-shadow: var(--vfm-share-shadow);
    padding: clamp(24px, 4vw, 40px);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
body.vfm-share-public .vfm-share-auth-card {
    width: min(100%, 470px);
}
body.vfm-share-public .vfm-share-card-head {
    max-width: 560px;
    margin: 0 auto 28px;
}
body.vfm-share-public .vfm-share-brand-mark {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(145deg, #0d6efd, #4c8dff);
    box-shadow: 0 14px 30px rgba(13,110,253,.24);
    font-size: 2rem;
}
body.vfm-share-public .vfm-share-brand-mark-muted {
    color: var(--vfm-share-muted);
    background: var(--vfm-share-soft);
    box-shadow: none;
}
body.vfm-share-public .vfm-share-eyebrow {
    margin-bottom: 7px;
    color: #0d6efd;
    font-size: .75rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}
body.vfm-share-public .vfm-share-title {
    margin: 0;
    color: var(--vfm-share-card-text);
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 720;
    line-height: 1.18;
    overflow-wrap: anywhere;
}
body.vfm-share-public .vfm-share-subtitle {
    margin: 10px auto 0;
    color: var(--vfm-share-muted);
    font-size: .97rem;
    line-height: 1.55;
}
body.vfm-share-public .vfm-share-auth-form .form-label {
    color: var(--vfm-share-card-text);
    font-size: .86rem;
    font-weight: 650;
}
body.vfm-share-public .vfm-share-auth-form .form-control,
body.vfm-share-public .vfm-share-auth-form .input-group-text {
    min-height: 52px;
    border-color: var(--vfm-share-border);
    color: var(--vfm-share-card-text);
    background: var(--vfm-share-soft);
}
body.vfm-share-public .vfm-share-auth-form .form-control {
    border-radius: 12px;
}
body.vfm-share-public .vfm-share-auth-form .form-control:focus {
    border-color: rgba(13,110,253,.55);
    background: var(--vfm-share-card-bg);
    box-shadow: 0 0 0 .22rem rgba(13,110,253,.12);
}
body.vfm-share-public .vfm-share-auth-form .captcha-group {
    margin-top: 4px;
}
body.vfm-share-public .vfm-share-auth-form .captcha-group .input-group {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) 50px;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--vfm-share-border);
    border-radius: 12px;
    background: var(--vfm-share-soft);
}
body.vfm-share-public .vfm-share-auth-form .captcha-group .captchadd {
    min-width: 112px;
    justify-content: center;
    border: 0;
    border-right: 1px solid var(--vfm-share-border);
    border-radius: 0;
    padding: 6px 10px;
    background: #fff;
}
body.vfm-share-public .vfm-share-auth-form .captcha-group #captcha {
    display: block;
    max-width: 100%;
    height: 40px;
    object-fit: contain;
}
body.vfm-share-public .vfm-share-auth-form .captcha-group #inputc {
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
body.vfm-share-public .vfm-share-auth-form .captcha-group #capreload {
    width: 50px;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 0;
    color: #0d6efd;
    border: 0;
    border-left: 1px solid var(--vfm-share-border);
    border-radius: 0;
    text-decoration: none;
}
body.vfm-share-public .vfm-share-primary {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 12px !important;
    font-weight: 680;
    box-shadow: 0 8px 20px rgba(13,110,253,.16);
}
body.vfm-share-public .vfm-share-secondary {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px !important;
    font-weight: 650;
}
body.vfm-share-public .vfm-share-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
    color: var(--vfm-share-muted);
    font-size: .78rem;
    line-height: 1.35;
    text-align: center;
}
body.vfm-share-public .vfm-share-zipbar {
    margin: -2px 0 20px;
}
body.vfm-share-public .vfm-share-zipbar .zipshare {
    width: 100%;
}
body.vfm-share-public .vfm-share-filelist {
    display: grid;
    gap: 10px;
}
body.vfm-share-public .vfm-share-file {
    display: grid;
    grid-template-columns: 48px minmax(0,1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 11px 12px;
    border: 1px solid var(--vfm-share-border);
    border-radius: 14px;
    background: var(--vfm-share-soft);
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
body.vfm-share-public .vfm-share-file:hover {
    border-color: rgba(13,110,253,.25);
    box-shadow: 0 8px 22px rgba(38,55,80,.07);
    transform: translateY(-1px);
}
body.vfm-share-public .vfm-share-file-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #0d6efd;
    border-radius: 12px;
    background: rgba(13,110,253,.10);
    font-size: 1.35rem;
}
body.vfm-share-public .vfm-share-file-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
body.vfm-share-public .vfm-share-file-name {
    min-width: 0;
    color: var(--vfm-share-card-text);
    font-size: .94rem;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
body.vfm-share-public .vfm-share-file-name:hover {
    color: #0d6efd;
}
body.vfm-share-public .vfm-share-file-size {
    color: var(--vfm-share-muted);
    font-size: .78rem;
}
body.vfm-share-public .vfm-share-file-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}
body.vfm-share-public .vfm-share-file-tools .service-btn,
body.vfm-share-public .vfm-share-preview-action .service-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0 !important;
    display: grid !important;
    place-items: center;
    overflow: hidden;
    border-radius: 10px !important;
}
body.vfm-share-public .vfm-share-preview-action .service-btn.thumb img {
    width: 42px !important;
    height: 42px !important;
    object-fit: cover;
}
body.vfm-share-public .vfm-share-download-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border-radius: 10px !important;
    font-size: .86rem;
    font-weight: 650;
}
body.vfm-share-public .vfm-share-folder-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 22px;
}
body.vfm-share-public .vfm-share-folder-stats > span {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 8px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--vfm-share-border);
    border-radius: 13px;
    background: var(--vfm-share-soft);
}
body.vfm-share-public .vfm-share-folder-stats i {
    grid-row: 1 / span 2;
    color: #0d6efd;
    font-size: 1.2rem;
}
body.vfm-share-public .vfm-share-folder-stats strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .9rem;
}
body.vfm-share-public .vfm-share-folder-stats small {
    color: var(--vfm-share-muted);
    font-size: .72rem;
}
body.vfm-share-public .vfm-share-actions {
    display: grid;
    gap: 10px;
}
body.vfm-share-public #error .alert-wrap {
    max-width: 760px;
}
@media (max-width: 640px) {
    body.vfm-share-public .vfm-share-stage {
        min-height: 68vh;
        padding: 22px 10px;
    }
    body.vfm-share-public .vfm-share-card {
        border-radius: 18px;
        padding: 22px 16px;
    }
    body.vfm-share-public .vfm-share-brand-mark {
        width: 62px;
        height: 62px;
        border-radius: 18px;
        font-size: 1.7rem;
    }
    body.vfm-share-public .vfm-share-file {
        grid-template-columns: 42px minmax(0,1fr);
        gap: 10px;
        padding: 10px;
    }
    body.vfm-share-public .vfm-share-file-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 1.15rem;
    }
    body.vfm-share-public .vfm-share-file-tools {
        grid-column: 1 / -1;
        justify-content: flex-end;
        padding-top: 2px;
    }
    body.vfm-share-public .vfm-share-download-btn {
        flex: 1;
    }
    body.vfm-share-public .vfm-share-folder-stats {
        grid-template-columns: 1fr;
    }
    body.vfm-share-public .vfm-share-auth-form .captcha-group .input-group {
        grid-template-columns: 104px minmax(0,1fr) 44px;
    }
    body.vfm-share-public .vfm-share-auth-form .captcha-group #capreload {
        width: 44px;
    }
}
/* Public share uses the same clean, distraction-free composition as login. */
body.vfm-share-public > nav.navbar,
body.vfm-share-public > .vfm-header,
body.vfm-share-public > footer.footer,
body.vfm-share-public > .to-top {
    display: none !important;
}
body.vfm-share-public > .container.mb-auto {
    width: 100%;
    max-width: none;
    padding-top: 0 !important;
    padding-left: 0;
    padding-right: 0;
}
body.vfm-share-public > .container.mb-auto > .main-content {
    margin: 0;
}
body.vfm-share-public .vfm-share-stage {
    min-height: 100vh;
}
