/**
 * Google Drive–style UI layer (scoped to .fc-drive-ui)
 */
.fc-drive-ui {
    --drive-sidebar: 256px;
    --drive-bg: #f8f9fa;
    --drive-surface: #fff;
    --drive-border: #e0e0e0;
    --drive-text: #202124;
    --drive-text-secondary: #5f6368;
    --drive-hover: #f1f3f4;
    --drive-active: #e8f0fe;
    --drive-primary: #1a73e8;
    --drive-primary-hover: #1765cc;
    --drive-radius: 24px;
    --drive-radius-sm: 8px;
    --drive-shadow-hover: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --drive-font: 'Google Sans', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

.fc-drive-ui body,
.fc-drive-ui {
    font-family: var(--drive-font);
    color: var(--drive-text);
}

.fc-drive-ui .main-content {
    padding: 0;
    background: var(--drive-surface);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.fc-drive-ui .main-content .page-header {
    display: none !important;
}

.fc-drive-ui .main-content > .site-powered-by {
    display: none;
}

.fc-drive-ui .app-navbar {
    background: var(--drive-surface);
    border-bottom: 1px solid var(--drive-border);
    height: 64px;
}

.fc-drive-ui .sidebar {
    width: var(--drive-sidebar);
    background: var(--drive-surface);
    border-inline-end: 1px solid var(--drive-border);
    display: flex;
    flex-direction: column;
}

.fc-drive-ui .sidebar-top {
    border-bottom: none;
    padding: 0.5rem 0.75rem 0;
}

.fc-drive-ui .sidebar .brand {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--drive-text-secondary);
    padding: 0.75rem 0.5rem;
}

.fc-drive-ui .sidebar .brand:hover {
    color: var(--drive-text);
}

.fc-drive-ui .drive-new-wrap {
    padding: 0.5rem 0.75rem 1rem;
}

.fc-drive-ui .btn-drive-new {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1.35rem 0.55rem 1rem;
    border: none;
    border-radius: var(--drive-radius);
    background: #fff;
    color: var(--drive-text);
    font-weight: 500;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    transition: box-shadow 0.15s ease, background 0.15s ease;
}

.fc-drive-ui .btn-drive-new:hover,
.fc-drive-ui .btn-drive-new:focus,
.fc-drive-ui .btn-drive-new.show {
    background: var(--drive-hover);
    box-shadow: var(--drive-shadow-hover);
    color: var(--drive-text);
}

.fc-drive-ui .btn-drive-new .bi-plus-lg {
    font-size: 1.25rem;
    color: var(--drive-primary);
}

.fc-drive-ui .sidebar {
    display: flex;
    flex-direction: column;
}

.fc-drive-ui .sidebar .nav.flex-column {
    padding-top: 0 !important;
    margin-top: 0 !important;
    display: flex;
    flex-direction: column;
}

.fc-drive-ui .sidebar .nav-link {
    border-radius: 0 var(--drive-radius) var(--drive-radius) 0;
    margin: 1px 0.5rem 1px 0;
    padding: 0.5rem 1.5rem 0.5rem 1.25rem;
    min-height: 40px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--drive-text);
}

.fc-drive-ui .sidebar .nav-link i {
    font-size: 1.125rem;
    color: var(--drive-text-secondary);
}

.fc-drive-ui .sidebar .nav-link.active {
    background: var(--drive-active);
    color: var(--drive-primary);
}

.fc-drive-ui .sidebar .nav-link.active i {
    color: var(--drive-primary);
}

.fc-drive-ui .sidebar .nav-link:hover:not(.active) {
    background: var(--drive-hover);
    color: var(--drive-text);
}

.fc-drive-ui .sidebar .nav-divider {
    height: 1px;
    background: var(--drive-border);
    margin: 0.5rem 1rem;
}

.fc-drive-ui .sidebar .nav-link--muted {
    font-weight: 400;
    font-size: 0.8125rem;
}

/* Show Drive chrome only on Drive-layout pages */
.d-drive-nav {
    display: none;
}

.fc-drive-ui .d-drive-nav {
    display: flex;
}

.fc-drive-ui .drive-new-wrap.d-drive-nav {
    display: block;
}

.fc-drive-ui .sidebar .nav.d-drive-nav,
.fc-drive-ui .sidebar .nav .d-drive-nav.nav-link {
    display: flex;
}

.fc-drive-ui .sidebar .nav-divider.d-drive-nav {
    display: block;
}

.fc-drive-ui #sidebarStorageWrap.d-drive-nav:not([hidden]) {
    display: block;
}

.fc-drive-ui #sidebarStorageWrap {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--drive-border);
}

.fc-drive-ui #sidebarStorageLabel {
    font-size: 0.75rem;
    color: var(--drive-text-secondary);
}

.fc-drive-ui #sidebarStorageBar {
    background-color: var(--drive-primary);
}

/* —— Drive main chrome —— */
.drive-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.drive-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.5rem 0.75rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.drive-toolbar-spacer {
    flex: 1;
    min-width: 0.5rem;
}

.drive-search {
    flex: 1;
    min-width: 0;
    max-width: 720px;
    position: relative;
}

.drive-search .form-control {
    border-radius: var(--drive-radius);
    border: none;
    background: var(--drive-hover);
    padding: 0.65rem 3rem 0.65rem 2.75rem;
    font-size: 0.9375rem;
    min-height: 48px;
}

.drive-search .form-control:focus {
    background: #fff;
    box-shadow: 0 1px 1px 0 rgba(65, 69, 73, 0.3), 0 1px 3px 1px rgba(65, 69, 73, 0.15);
}

.drive-search-icon {
    position: absolute;
    inset-inline-start: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--drive-text-secondary);
    pointer-events: none;
    font-size: 1.125rem;
}

.drive-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.drive-toolbar-actions .btn-drive-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--drive-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.drive-toolbar-actions .btn-drive-icon:hover,
.drive-toolbar-actions .btn-drive-icon.active {
    background: var(--drive-hover);
    color: var(--drive-text);
}

.drive-toolbar-actions .btn-drive-icon.active {
    background: var(--drive-active);
    color: var(--drive-primary);
}

.drive-sort-select {
    border: none;
    background: transparent;
    color: var(--drive-text-secondary);
    font-size: 0.8125rem;
    max-width: 140px;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
}

.drive-sort-select:focus {
    box-shadow: none;
    outline: none;
}

.drive-path-bar {
    padding: 0 1rem 0.5rem 1.75rem;
    flex-shrink: 0;
}

.drive-path-bar .breadcrumb {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 400;
}

.drive-path-bar .breadcrumb-item + .breadcrumb-item::before {
    color: var(--drive-text-secondary);
}

.drive-path-bar .btn-link,
.drive-path-bar .fc-breadcrumb-root,
.drive-path-bar .fc-breadcrumb-folder {
    color: var(--drive-text);
    font-weight: 500;
    text-decoration: none;
    font-size: 1.125rem;
}

.drive-path-bar .breadcrumb-item.active {
    color: var(--drive-text);
}

.drive-selection-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin: 0 1rem 0.5rem;
    background: var(--drive-active);
    border-radius: var(--drive-radius-sm);
    flex-shrink: 0;
}

.drive-selection-bar[hidden] {
    display: none !important;
}

.drive-content {
    flex: 1;
    overflow: auto;
    padding: 0.25rem 1rem 2rem 1.75rem;
    -webkit-overflow-scrolling: touch;
}

.drive-hint {
    font-size: 0.75rem;
    color: var(--drive-text-secondary);
    margin: 0 0 0.75rem;
}

/* —— Grid (Drive tiles) —— */
.fc-drive-ui .fc-files-grid:not(.fc-files-list) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 0.5rem 1rem;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card {
    border: 1px solid transparent;
    border-radius: var(--drive-radius-sm);
    background: transparent;
    box-shadow: none;
    padding: 0.5rem 0.35rem 0.75rem;
    position: relative;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card:hover {
    background: var(--drive-hover);
    border-color: transparent;
    box-shadow: none;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card--selected {
    background: var(--drive-active);
    outline: none;
    border-color: var(--drive-primary);
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-thumb {
    height: 120px !important;
    aspect-ratio: auto;
    margin-bottom: 0.35rem;
    border-radius: var(--drive-radius-sm);
    background: transparent;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-folder-card .fc-file-card-thumb {
    background: transparent;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-folder-card .fc-file-card-thumb i {
    font-size: 3.5rem;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-thumb--icon .file-icon-lg {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    background: transparent;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-name {
    font-weight: 500;
    font-size: 0.8125rem;
    text-align: center;
    -webkit-line-clamp: 2;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-meta,
.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-badges,
.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-owner {
    display: none !important;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-actions {
    opacity: 0;
    transition: opacity 0.12s ease;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card:hover .fc-file-card-actions,
.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card:focus-within .fc-file-card-actions,
.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-actions:has(.show) {
    opacity: 1;
    z-index: 10;
}

.dropdown.fc-file-card-actions {
    z-index: 10;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-menu {
    background: var(--drive-surface);
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .btn-drive-star {
    position: absolute;
    top: 0.35rem;
    inset-inline-start: 0.35rem;
    z-index: 4;
    opacity: 0;
}

.fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card:hover .btn-drive-star,
.fc-drive-ui .fc-files-grid:not(.fc-files-list) .btn-drive-star.is-starred {
    opacity: 1;
}

/* —— List table (Drive list view) —— */
.fc-drive-ui .fc-files-grid.fc-files-list {
    display: block;
}

.fc-drive-ui .drive-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.fc-drive-ui .drive-list-table thead th {
    text-align: start;
    font-weight: 500;
    color: var(--drive-text-secondary);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--drive-border);
    white-space: nowrap;
}

.fc-drive-ui .drive-list-table thead th.drive-col-name {
    padding-inline-start: 3rem;
}

.fc-drive-ui .drive-list-table tbody tr {
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
}

.fc-drive-ui .drive-list-table tbody tr:hover {
    background: var(--drive-hover);
}

.fc-drive-ui .drive-list-table tbody tr.drive-row--selected {
    background: var(--drive-active);
}

.fc-drive-ui .drive-list-table td {
    padding: 0.4rem 0.75rem;
    vertical-align: middle;
    color: var(--drive-text-secondary);
}

.fc-drive-ui .drive-list-table td.drive-col-name {
    color: var(--drive-text);
    font-weight: 500;
    max-width: 0;
    width: 45%;
}

.fc-drive-ui .drive-list-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.fc-drive-ui .drive-list-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc-drive-ui .drive-list-icon .bi-folder-fill {
    font-size: 1.25rem;
}

.fc-drive-ui .drive-list-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fc-drive-ui .drive-list-table .btn-drive-star {
    flex-shrink: 0;
    margin-inline-end: 0.25rem;
}

.fc-drive-ui .drive-list-actions {
    opacity: 0;
    text-align: end;
}

.fc-drive-ui .drive-list-table tbody tr:hover .drive-list-actions {
    opacity: 1;
}

.fc-drive-ui .btn-drive-star {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--drive-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fc-drive-ui .btn-drive-star:hover {
    background: var(--drive-hover);
}

.fc-drive-ui .btn-drive-star.is-starred {
    color: #f4b400;
    opacity: 1 !important;
}

.fc-drive-ui .drive-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--drive-text-secondary);
    font-size: 0.9375rem;
}

.fc-drive-ui #pagination {
    padding: 1rem 1.75rem;
}

.fc-drive-ui #pagination .page-link {
    border-radius: 50%;
    border: none;
    color: var(--drive-text-secondary);
}

.fc-drive-ui #pagination .page-item.active .page-link {
    background: var(--drive-primary);
}

/* Floating + button — all drive screens */
.drive-mobile-fab-host {
    display: none !important;
}

.fc-drive-ui .drive-mobile-fab-host {
    display: block !important;
    position: fixed;
    bottom: calc(1rem + var(--fc-safe-bottom));
    z-index: 1060;
    inset-inline-end: 1rem;
    inset-inline-start: auto;
    pointer-events: auto;
}

.fc-drive-ui .drive-mobile-fab {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--drive-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px 2px rgba(60, 64, 67, 0.25), 0 4px 12px 4px rgba(60, 64, 67, 0.15);
}

.fc-drive-ui .drive-mobile-fab .bi-plus-lg {
    font-size: 1.5rem;
}

.fc-drive-ui .drive-mobile-fab:hover,
.fc-drive-ui .drive-mobile-fab:focus,
.fc-drive-ui .drive-mobile-fab.show {
    background: var(--drive-primary-hover);
    color: #fff;
}

.fc-drive-ui .drive-mobile-fab-dropup .dropdown-menu {
    position: fixed;
    min-width: 12.5rem;
    margin-bottom: 0.65rem;
    border-radius: var(--drive-radius-sm);
    z-index: 1060;
}

.fc-drive-ui .drive-mobile-fab-dropup .dropdown-item {
    min-height: 44px;
    display: flex;
    align-items: center;
}

.fc-drive-ui .drive-content {
    padding-bottom: calc(5.5rem + var(--fc-safe-bottom));
}

.fc-drive-ui .drive-new-wrap .dropdown {
    position: relative;
}

.fc-drive-ui .drive-new-wrap .dropdown-menu {
    z-index: 1060;
}

.fc-drive-ui .btn-drive-new.dropdown-toggle::after {
    margin-inline-start: 0.35rem;
    vertical-align: middle;
}

.fc-drive-ui .drive-mobile-fab.dropdown-toggle::after {
    display: none;
}

@media (max-width: 991.98px) {
    .fc-drive-ui .app-main {
        min-height: 100dvh;
    }

    .fc-drive-ui .main-content {
        padding: 0;
        padding-bottom: var(--fc-safe-bottom);
    }

    .fc-drive-ui .app-navbar {
        height: 56px;
        padding-inline: 0.5rem;
    }

    .fc-drive-ui .app-navbar-title {
        font-size: 1rem;
        max-width: 42vw;
    }

    .fc-drive-ui .sidebar {
        --fc-drawer-width: min(288px, 86vw);
        width: var(--fc-drawer-width);
        max-width: 86vw;
    }

    .fc-drive-ui .sidebar-top {
        padding-inline: 0.75rem;
    }

    .fc-drive-ui .sidebar .nav-link {
        min-height: 44px;
        margin-inline: 0.35rem 0.5rem;
        border-radius: 0 var(--drive-radius-sm) var(--drive-radius-sm) 0;
    }

    html[dir="rtl"] .fc-drive-ui .sidebar .nav-link,
    html.rtl .fc-drive-ui .sidebar .nav-link {
        border-radius: var(--drive-radius-sm) 0 0 var(--drive-radius-sm);
    }

    .fc-drive-ui #sidebarStorageWrap {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .fc-drive-ui .drive-new-wrap .dropdown-menu {
        position: fixed;
    }

    .drive-toolbar {
        padding: 0.5rem 0.5rem 0.25rem;
        gap: 0.35rem;
    }

    .drive-toolbar-actions {
        flex-wrap: nowrap;
    }

    .drive-toolbar-actions .btn-drive-icon {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .drive-sort-select {
        max-width: 7.5rem;
        min-height: 44px;
        font-size: 0.75rem;
    }

    .drive-path-bar {
        padding: 0 0.5rem 0.35rem;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .drive-path-bar::-webkit-scrollbar {
        display: none;
    }

    .drive-path-bar .breadcrumb {
        flex-wrap: nowrap;
        font-size: 1rem;
        white-space: nowrap;
    }

    .drive-path-bar .btn-link,
    .drive-path-bar .fc-breadcrumb-root,
    .drive-path-bar .fc-breadcrumb-folder {
        font-size: 1rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .drive-selection-bar {
        margin: 0 0.5rem 0.5rem;
        padding: 0.5rem;
        flex-wrap: wrap;
        gap: 0.35rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .drive-selection-bar .btn {
        min-height: 40px;
        flex-shrink: 0;
    }

    .drive-content {
        padding: 0.25rem 0.5rem 0;
    }

    .drive-search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
    }

    .drive-search .form-control {
        min-height: 44px;
        font-size: 1rem;
    }

    .fc-drive-ui .fc-files-grid:not(.fc-files-list) {
        grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
        gap: 0.35rem 0.5rem;
    }

    .fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-thumb {
        height: 96px !important;
    }

    .fc-drive-ui #pagination {
        padding: 0.75rem 0.5rem 0.25rem;
    }

    /* List view → stacked rows on tablet/phone */
    .fc-drive-ui .fc-files-grid.fc-files-list .drive-list-table thead {
        display: none;
    }

    .fc-drive-ui .fc-files-grid.fc-files-list .drive-list-table tbody tr {
        display: block;
        margin-bottom: 0.5rem;
        border: 1px solid var(--drive-border);
        border-radius: var(--drive-radius-sm);
        background: var(--drive-surface);
        padding: 0.65rem 3rem 0.65rem 0.75rem;
        position: relative;
    }

    .fc-drive-ui .fc-files-grid.fc-files-list .drive-list-table tbody tr:hover {
        background: var(--drive-hover);
    }

    .fc-drive-ui .fc-files-grid.fc-files-list .drive-list-table td {
        display: block;
        padding: 0.15rem 0;
        border: none;
        width: auto !important;
        max-width: none;
    }

    .fc-drive-ui .fc-files-grid.fc-files-list .drive-list-table td.drive-col-name {
        padding-bottom: 0.25rem;
    }

    .fc-drive-ui .fc-files-grid.fc-files-list .drive-list-table td:not(.drive-col-name):not(.drive-list-actions) {
        font-size: 0.75rem;
        color: var(--drive-text-secondary);
    }

    .fc-drive-ui .fc-files-grid.fc-files-list .drive-list-actions {
        position: absolute;
        top: 0.5rem;
        inset-inline-end: 0.35rem;
        opacity: 1;
    }

}

@media (max-width: 575.98px) {
    .fc-drive-ui .fc-files-grid:not(.fc-files-list) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fc-drive-ui .navbar-profile-toggle {
        /* max-width: 44px; */
        padding-inline: 0.25rem;
    }

    .fc-drive-ui .drive-path-bar .breadcrumb-item.active .fc-breadcrumb-label {
        max-width: 40vw;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        vertical-align: bottom;
    }

    .fc-drive-ui .fc-details-offcanvas {
        width: 100vw;
        max-width: 100vw;
    }

    .fc-drive-ui .drive-panel {
        padding: 1rem;
    }
}

/* Touch devices: no hover — show file actions & stars always */
@media (hover: none) and (pointer: coarse) {
    .fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-actions,
    .fc-drive-ui .fc-files-grid:not(.fc-files-list) .btn-drive-star {
        opacity: 1;
    }

    .fc-drive-ui .fc-files-grid:not(.fc-files-list) .fc-file-card-menu {
        width: 20px;
        height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background-color: transparent !important;
        box-shadow: none !important;
    }

    .fc-drive-ui .drive-list-actions {
        opacity: 1;
    }

    .fc-drive-ui .drive-list-table .btn-drive-star,
    .fc-drive-ui .btn-drive-star {
        width: 44px;
        height: 44px;
    }

    .fc-drive-context-menu .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

@media (min-width: 992px) {
    /* Desktop: right-click for actions; hide ⋮ overflow menus */
    .fc-drive-ui .fc-file-card-actions,
    .fc-drive-ui .drive-list-actions,
    .fc-drive-ui .drive-list-table .drive-col-actions {
        display: none !important;
    }

    .fc-drive-ui.sidebar-collapsed .sidebar {
        width: 72px;
    }

    .fc-drive-ui.sidebar-collapsed .sidebar .brand span,
    .fc-drive-ui.sidebar-collapsed .sidebar .nav-link span,
    .fc-drive-ui.sidebar-collapsed .btn-drive-new span,
    .fc-drive-ui.sidebar-collapsed #sidebarStorageLabel {
        display: none;
    }

    .fc-drive-ui.sidebar-collapsed .btn-drive-new {
        padding: 0.55rem;
        border-radius: 50%;
        width: 48px;
        height: 48px;
        justify-content: center;
    }

    .fc-drive-ui.sidebar-collapsed .sidebar .nav-link {
        justify-content: center;
        padding: 0.5rem;
        border-radius: 50%;
        width: 48px;
        margin: 4px auto;
    }
}

/* —— Dashboard & profile (same shell as My Drive) —— */
.fc-drive-ui .drive-stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    background: var(--drive-surface);
    border: 1px solid var(--drive-border);
    border-radius: var(--drive-radius-sm);
    color: var(--drive-text);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.fc-drive-ui .drive-stat-card:hover {
    background: var(--drive-hover);
    box-shadow: var(--drive-shadow-hover);
    color: var(--drive-text);
}

.fc-drive-ui .drive-stat-label {
    font-size: 0.8125rem;
    color: var(--drive-text-secondary);
    font-weight: 500;
}

.fc-drive-ui .drive-stat-value {
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--drive-text);
}

.fc-drive-ui .drive-panel {
    background: var(--drive-surface);
    border: 1px solid var(--drive-border);
    border-radius: var(--drive-radius-sm);
    padding: 1.25rem 1.5rem;
}

.fc-drive-ui .drive-panel--center {
    text-align: center;
}

.fc-drive-ui .drive-panel-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--drive-text-secondary);
    margin: 0 0 1rem;
    text-transform: none;
}

.fc-drive-ui .drive-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fc-drive-ui .drive-profile-avatar {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--drive-border);
}

.fc-drive-ui .drive-profile-layout .form-control {
    border-radius: var(--drive-radius-sm);
    border-color: var(--drive-border);
}

.fc-drive-ui .drive-profile-layout .form-control:focus {
    border-color: var(--drive-primary);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.fc-drive-ui .drive-panel .fc-files-grid:not(.fc-files-list) {
    margin-top: 0.5rem;
}

/* Right-click context menu (replaces browser menu on drive surfaces) */
.fc-drive-context-menu {
    position: fixed;
    z-index: 1080;
    min-width: 12rem;
    padding: 0;
    pointer-events: none;
}

.fc-drive-context-menu.is-open {
    pointer-events: auto;
}

.fc-drive-context-menu .dropdown-menu {
    position: static;
    display: block;
    margin: 0;
    border: 1px solid var(--drive-border);
    border-radius: var(--drive-radius-sm);
    padding: 0.35rem 0;
}

.fc-drive-context-menu .dropdown-item {
    padding: 0.45rem 1rem;
    font-size: 0.875rem;
    color: var(--drive-text);
}

.fc-drive-context-menu .dropdown-item:hover,
.fc-drive-context-menu .dropdown-item:focus {
    background: var(--drive-hover);
    color: var(--drive-text);
}

.fc-drive-context-menu .dropdown-item.text-danger:hover,
.fc-drive-context-menu .dropdown-item.text-danger:focus {
    background: #fce8e6;
    color: #c5221f;
}

/* Background upload progress (modal closes; upload continues) */
.upload-bg-panel {
    position: fixed;
    z-index: 1075;
    bottom: calc(1.25rem + var(--fc-safe-bottom, 0px));
    right: 1.25rem;
    width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

.upload-bg-panel:not(.d-none) {
    pointer-events: auto;
}

.upload-bg-panel-inner {
    background: #fff;
    border: 1px solid var(--drive-border, #e8eaed);
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

.upload-bg-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.upload-bg-panel-icon {
    color: var(--drive-primary, #1a73e8);
    line-height: 1;
}

.upload-bg-panel-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.875rem;
    color: var(--drive-text, #3c4043);
}

.upload-bg-panel.is-done .upload-bg-panel-icon {
    color: #188038;
}

.upload-bg-panel.is-error .upload-bg-panel-icon {
    color: #c5221f;
}

.upload-bg-panel-progress {
    height: 6px;
    border-radius: 3px;
    background: #e8eaed;
}

.upload-bg-panel-progress .progress-bar {
    background: var(--drive-primary, #1a73e8);
}

.upload-bg-panel.is-done .progress-bar,
.upload-bg-panel.is-error .progress-bar {
    animation: none;
}

.upload-bg-panel-text {
    margin-top: 0.45rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[dir="rtl"] .upload-bg-panel {
    right: auto;
    left: 1.25rem;
}

.fc-drive-ui .upload-bg-panel {
    bottom: calc(5.5rem + var(--fc-safe-bottom, 0px));
}

#uploadBackgroundPanel:not(.d-none) + #downloadBackgroundPanel:not(.d-none) {
    bottom: calc(8.5rem + var(--fc-safe-bottom, 0px));
}

@media (max-width: 991.98px) {
    .fc-drive-ui #uploadBackgroundPanel:not(.d-none) + #downloadBackgroundPanel:not(.d-none) {
        bottom: calc(12.75rem + var(--fc-safe-bottom, 0px));
    }
}
