/* Windows 11 Global Theme */
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI Variable Text', 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: #fafafa !important; /* Windows 11 app background */
    color: #333;
}

/* Hide Filament's own chrome — the window frame provides all of it.
   Scoped to Filament's classes rather than the bare `header` and `aside`
   elements: a blanket rule swallows every semantic header a page writes in
   its own body, which is how the section titles on the structure page
   became invisible. */
.fi-sidebar,
.fi-topbar,
.fi-topbar > *,
.fi-page > header.fi-header,
.fi-page > section > header.fi-header,
.fi-main > header.fi-header,
.fi-sidebar-nav,
aside.fi-sidebar {
    display: none !important;
}

main.fi-main {
    padding: 24px 32px !important; /* Proper padding for form/tables */
    margin: 0 !important;
    max-width: 100% !important;
    height: 100vh;
    background-color: #fafafa !important;
    overflow-y: auto !important; /* Allow scrolling inside the iframe */
}

.fi-layout {
    background: #fafafa !important;
    padding: 0 !important;
}

/* Desktop Environment (Only active on the Desktop Page) */
.desktop-container {
    height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden; /* Prevent scrolling on the desktop itself */
    display: flex;
    flex-direction: column;
    background: transparent; /* wallpaper set on main.fi-main via config('winui.wallpaper') */
}

/* Desktop Icons Grid */
.desktop-icons {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 5px;
    gap: 2px;
    position: relative;
}

@media (min-width: 769px) {
    .desktop-icon.dragging {
        opacity: 0.65;
        z-index: 10;
    }
}

.desktop-icon {
    width: 74px;
    height: 86px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    font-size: 11px;
    text-align: center;
    padding-top: 8px;
    transition: background 0.1s;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.desktop-icon.selected {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.desktop-icon svg {
    width: 40px;
    height: 40px;
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

/* Windows 11 Taskbar (Floating Dock Style) */
.taskbar {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    height: 52px;
    background: rgba(32, 32, 32, 0.75); /* Dark frosted glass */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Start Button */
.start-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    border-radius: 6px;
    transition: background 0.1s;
}

.start-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.start-btn svg {
    width: 24px;
    height: 24px;
}

.start-btn-orb svg {
    filter: drop-shadow(0 0 3px rgba(79, 195, 247, 0.9)) drop-shadow(0 0 7px rgba(124, 77, 255, 0.7));
    transition: filter 0.15s;
}
.start-btn-orb:hover svg {
    filter: drop-shadow(0 0 5px rgba(79, 195, 247, 1)) drop-shadow(0 0 11px rgba(124, 77, 255, 0.9));
}

.taskbar-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 5px;
}

.taskbar-app {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    border-radius: 6px;
    position: relative;
    transition: background 0.1s, transform 0.1s;
}

.taskbar-app:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Active indicator is a small pill below the icon in Win11 */
.taskbar-app.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 16px;
    height: 3px;
    background: var(--win-accent, #0078d4);
    border-radius: 3px;
}
.taskbar-app.inactive-open::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 6px;
    height: 3px;
    background: #888;
    border-radius: 3px;
}

/* System Tray (Floating Pill) */
.system-tray-floating {
    position: fixed;
    bottom: 12px;
    right: 12px;
    height: 52px;
    background: rgba(32, 32, 32, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 5px;
    color: white;
    font-size: 12px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.tray-item {
    padding: 0 10px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.1s;
}
.tray-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Window Component - Win11 Rounded Corners & Mica */
.win-window {
    position: absolute;
    background: rgba(243, 243, 243, 0.68); /* Win11 Mica glass */
    backdrop-filter: blur(36px) saturate(160%);
    -webkit-backdrop-filter: blur(36px) saturate(160%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 32px rgba(0,0,0,0.3);
    border-radius: 8px; /* Win11 has rounded corners */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
    z-index: 1000;
}

.win-window.active {
    z-index: 1001;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 12px 48px rgba(0,0,0,0.4);
    border: 1px solid rgba(0, 120, 212, 0.5); /* Blue accent border */
}

.win-titlebar {
    /* Roomy enough to grab and read, like a real title bar.
       flex-shrink must be off: this is a flex child of .win-window, and a
       plain height was being squeezed down to ~20px whenever the window's
       contents were taller than the window. */
    flex: 0 0 auto;
    height: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    user-select: none;
    cursor: grab;
    background: transparent;
}

.win-titlebar:active {
    cursor: grabbing;
}

.win-titlebar-title {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .002em;
    color: #1b1b1b;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding-right: 12px;
}
.win-titlebar-title > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.win-titlebar-title svg,
.win-titlebar-title img {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* Win11 Controls on the right */
.win-controls {
    display: flex;
    height: 100%;
}

.win-btn {
    width: 46px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
}

.win-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.win-btn.close:hover {
    background: #e81123;
    color: white;
}

.win-content {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.win-iframe-container {
    flex-grow: 1;
    position: relative;
    background: #fff;
}

/* A document viewer is only the document: title bar, then the page. */
.win-window.is-viewer .explorer-address-bar,
.win-window.is-viewer .explorer-status-bar {
    display: none;
}

.win-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Explorer UI layout classes moved below */

/* Folder specific views */
.folder-view-grid {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 15px;
    gap: 10px;
    background: transparent;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}

.folder-icon {
    width: 80px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
    font-size: 11px;
    text-align: center;
    padding-top: 8px;
}
.folder-icon:hover {
    background: rgba(0, 120, 212, 0.1);
}
.folder-icon svg {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
}

/* Menu Items inside left sidebar */
.sidebar-item {
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-item:hover {
    background: rgba(0, 0, 0, 0.05);
}
.sidebar-item.active {
    background: rgba(0, 120, 212, 0.1);
    color: var(--win-accent, #0078d4);
    font-weight: 500;
}
.sidebar-item svg {
    width: 16px;
    height: 16px;
}

/* Window Resizers */
.resizer {
    position: absolute;
    z-index: 1002;
    background: transparent;
}
.resizer.n { top: 0; left: 5px; right: 5px; height: 8px; cursor: n-resize; }
.resizer.s { bottom: 0; left: 5px; right: 5px; height: 8px; cursor: s-resize; }
.resizer.e { top: 5px; bottom: 5px; right: 0; width: 5px; cursor: e-resize; }
.resizer.w { top: 5px; bottom: 5px; left: 0; width: 5px; cursor: w-resize; }
.resizer.ne { top: 0; right: 0; width: 8px; height: 8px; cursor: ne-resize; }
.resizer.nw { top: 0; left: 0; width: 8px; height: 8px; cursor: nw-resize; }
.resizer.se { bottom: 0; right: 0; width: 8px; height: 8px; cursor: se-resize; }
.resizer.sw { bottom: 0; left: 0; width: 8px; height: 8px; cursor: sw-resize; }

.iframe-blocked {
    pointer-events: none !important;
}

/* =========================================================
   NATIVE WINDOWS 11 FILE EXPLORER DETAILS VIEW (BREAD UI)
   ========================================================= */

/* Remove card wrappers, borders, and shadows */
.fi-ta {
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* The actual white area */
.fi-ta > .fi-ta-content {
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
    background: #ffffff !important;
    border-top: 1px solid #e5e5e5 !important;
}

/* Strip Tailwind rings/shadows */
.fi-ta-content, .fi-ta-table, .fi-ta-header, .fi-ta-record-checkbox {
    --tw-ring-shadow: none !important;
    --tw-shadow: none !important;
}

/* Table Header Row (Compact & Clean) */
.fi-ta-table thead {
    background-color: #ffffff !important;
}
.fi-ta-table thead tr {
    background-color: transparent !important;
    border-bottom: 1px solid #e5e5e5 !important;
}
.fi-ta-table th {
    background-color: transparent !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #555 !important;
    border: none !important;
    border-right: 1px solid transparent !important;
}
.fi-ta-table th:hover {
    border-right: 1px solid #e5e5e5 !important;
}

/* Table Rows (No borders, compact) */
.fi-ta-table tbody tr {
    border-bottom: none !important;
    background-color: #ffffff !important;
    transition: background 0.1s;
}

/* Windows 11 Details View (Table View) */
.fi-ta-content {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #ffffff !important;
}

.fi-ta-table {
    border-collapse: collapse !important;
    width: 100% !important;
}

.fi-ta-header-cell {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e5e5 !important;
    border-right: 1px solid transparent !important;
    padding: 6px 12px !important;
}

.fi-ta-header-cell:hover {
    background: #f3f3f3 !important;
    border-right: 1px solid #e5e5e5 !important;
}

.fi-ta-header-cell-label {
    font-weight: 400 !important;
    color: #444 !important;
    font-size: 0.85rem !important;
}

.fi-ta-row {
    border-bottom: 1px solid transparent !important;
    background: transparent !important;
    transition: background-color 0.1s;
}

.fi-ta-row:hover {
    background: #f3f9ff !important;
}

.fi-ta-row[data-selected="true"],
.fi-ta-record[data-selected="true"] {
    background: #cce8ff !important;
    outline: 1px solid #99d1ff !important;
    outline-offset: -1px;
}

.fi-ta-cell {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    color: #222 !important;
    vertical-align: middle !important;
    border: none !important;
}

/* Action buttons inside rows */
.fi-ta-actions .fi-btn {
    background: transparent !important;
    box-shadow: none !important;
    color: var(--win-accent, #0078d4) !important;
    padding: 2px 6px !important;
    border: none !important;
}

.fi-ta-actions .fi-btn:hover {
    background: #e5f3ff !important;
}

/* Remove default table shadows and borders */
.fi-ta-content .divide-y > :not([hidden]) ~ :not([hidden]) {
    border-color: transparent !important;
}

/* Top Action Header (hidden by default; explorer command bar replaces it) */
.fi-ta-header, .fi-ta-header-ctn {
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important; /* The elements can still be clicked via JS .click() */
}

/* Revealed on demand (Filter / Options commands add this class) so the
   native toolbar and its filter dropdown have a visible anchor */
body.winui-toolbar-open .fi-ta-header,
body.winui-toolbar-open .fi-ta-header-ctn {
    position: static !important;
    top: auto !important;
    left: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    flex: none;
    background: #f9f9f9 !important;
    border-bottom: 1px solid #e5e5e5 !important;
}
body.winui-toolbar-open .fi-ta-header-toolbar {
    padding: 6px 12px !important;
}

/* Bottom Pagination */
.fi-ta-pagination {
    border-top: 1px solid #e5e5e5 !important;
    background: #fafafa !important;
    padding: 10px 15px !important;
}

/* =========================================================
   NATIVE WINDOWS 11 FILE EXPLORER THUMBNAIL GRID (LARGE ICONS)
   ========================================================= */

/* The grid container */
.fi-ta-content > .grid,
.fi-ta-grid {
    gap: 15px !important;
    padding: 20px !important;
}

/* Individual Grid Card (Thumbnail) */
.fi-ta-record {
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 15px 5px !important;
    text-align: center;
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
}

/* Inject a fake File Icon above the text */
.fi-ta-record::before {
    content: '';
    display: block;
    width: 54px;
    height: 54px;
    margin-bottom: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230078D4'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    background-size: cover;
}

/* Hover & Selected States */
.fi-ta-record:hover {
    background: #e5f3ff !important;
    border: 1px solid #cce8ff !important;
}

.fi-ta-record[data-selected="true"],
.fi-ta-record:has(input[type="checkbox"]:checked) {
    background: #cce8ff !important;
    border: 1px solid #99d1ff !important;
}

/* Fix text alignments */
.fi-ta-record * {
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Hide action buttons by default, show on hover */
.fi-ta-record .fi-ta-actions {
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: 10px;
}
.fi-ta-record:hover .fi-ta-actions {
    opacity: 1;
}

/* =========================================================
   NATIVE WINDOWS 11 EXPLORER WINDOW LAYOUT
   ========================================================= */

.explorer-command-bar {
    height: 44px;
    background: rgba(255, 255, 255, 0.42);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 2px;
}

.explorer-btn {
    height: 32px;
    padding: 0 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #111;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s;
}
.explorer-btn:hover { background: rgba(0, 0, 0, 0.05); }
.explorer-btn.disabled { opacity: 0.45; pointer-events: none; }
.explorer-btn svg { width: 16px; height: 16px; color: #555; }

.explorer-divider {
    width: 1px;
    height: 20px;
    background: #ccc;
    margin: 0 5px;
}

.explorer-address-bar {
    flex: 0 0 auto;
    height: 40px;
    min-height: 40px;
    background: rgba(255, 255, 255, 0.42);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
}

.explorer-nav-btns {
    display: flex;
    gap: 2px;
}
.explorer-nav-btn {
    width: 32px; height: 32px;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #555;
}
.explorer-nav-btn:hover { background: rgba(0, 0, 0, 0.05); }
.explorer-nav-btn svg { width: 16px; height: 16px; }

.explorer-path {
    flex-grow: 1;
    height: 28px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 0;
    font-size: 12.5px;
    color: #111;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}
.explorer-path svg { flex: none; }

/* Each crumb is its own inline group; the blanket rule that used to ellipsis
   every span in here squeezed them all instead of the path as a whole. */
.explorer-path > span {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex: 0 1 auto;
}

/* Responsive to the window itself, not the viewport */
.win-window { container-type: inline-size; }
.explorer-search { flex: 0 1 250px; min-width: 110px; }
@container (max-width: 620px) {
    .explorer-path { display: none; }
    .explorer-search { flex: 1 1 auto; }
}
.explorer-path svg { width: 14px; height: 14px; }
.explorer-path:hover { border-color: #ccc; }

.explorer-search {
    width: 250px;
    height: 28px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 5px;
}
.explorer-search svg { width: 14px; height: 14px; color: #777; }
.explorer-search input {
    border: none; outline: none; background: transparent;
    font-size: 12px; width: 100%; color: #111;
}
.explorer-search:hover { border-color: #ccc; }

.explorer-main-area {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    background: transparent;
}

/* Narrow windows shed panes in order of how little they are missed: the
   details pane first, then the date, and only last the type column — which
   is where a document's reporting period is shown. */
.explorer-main-area.is-narrow .explorer-right-pane {
    display: none !important;
}
.explorer-main-area.is-cramped .file-list-date {
    display: none;
}
.explorer-main-area.is-cramped .explorer-left-pane {
    width: 180px;
    flex: 0 0 180px;
}
.explorer-main-area.is-tight .file-list-type {
    display: none;
}

.explorer-left-pane {
    width: 220px;
    flex: 0 0 220px;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.30);
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    overflow-y: auto;
}

.nav-pane-section {
    font-size: 11px;
    font-weight: 600;
    color: #777;
    padding: 5px 15px;
    margin-top: 10px;
}

.nav-pane-item {
    /* A minimum, not a fixed height — category names like "Disclosures &
       Announcements" wrap to two lines and used to overlap the next row. */
    min-height: 32px;
    padding: 6px 12px 6px 15px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.35;
    color: #111;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 8px 1px;
    transition: background 0.1s;
}
/* Labels take the leftover width and wrap inside it. */
.nav-pane-item > span:not(.nav-badge) {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}
/* Icons must not shrink or drift down beside a wrapped label. */
.nav-pane-item > svg {
    flex: 0 0 auto;
    margin-top: 1px;
}
.nav-pane-item:hover { background: rgba(0, 0, 0, 0.05); }
.nav-pane-item.active { background: rgba(0, 120, 212, 0.1); font-weight: 500; color: var(--win-accent, #0078d4); }
.nav-pane-item svg { width: 16px; height: 16px; color: #555; }
.nav-pane-item .nav-badge { flex: 0 0 auto; margin-top: 1px; }
.nav-pane-item.active svg { color: var(--win-accent, #0078d4); }

.explorer-center-pane {
    flex-grow: 1;
    /* Without this the file list's own width wins the flex negotiation and
       squeezes the details pane down to one character per line. */
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.82);
    position: relative;
}

.explorer-right-pane {
    width: 280px;
    flex: 0 0 280px;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.38);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.details-preview {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 120px; margin-bottom: 20px;
}
.details-preview svg { width: 96px; height: 96px; }
.details-image {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #e5e5e5;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.details-title { font-size: 18px; font-weight: 600; color: #111; margin-bottom: 20px; word-break: break-all; }
.details-prop-group { margin-bottom: 15px; }
.details-label { font-size: 11px; color: #777; margin-bottom: 4px; font-weight: 600; }
.details-value { font-size: 13px; color: #111; }

/* ── EXPLORER TREE NAVIGATION ── */
.nav-tree-item { position: relative; padding-left: 22px; }
.nav-tree-indent-1 { padding-left: 38px; }
.nav-tree-indent-2 { padding-left: 54px; }
.nav-tree-leaf { padding-left: 38px; }
.nav-tree-leaf.nav-tree-indent-2 { padding-left: 54px; }
/* A wider hit area for the chevron, so toggling doesn't need pixel aim. */
.nav-tree-chevron-hit {
    position: absolute;
    top: 2px;
    left: 0;
    width: 22px;
    height: 26px;
    cursor: pointer;
}

.nav-tree-chevron {
    position: absolute;
    top: 8px;
    left: 4px;
    width: 14px !important;
    height: 14px !important;
    color: #888 !important;
    transition: transform 0.1s ease;
    cursor: pointer;
}
.nav-tree-indent-1 .nav-tree-chevron { left: 20px; }
.nav-tree-indent-2 .nav-tree-chevron { left: 36px; }

.nav-tree-chevron.expanded {
    transform: rotate(90deg);
}
.nav-tree-children {
    display: flex;
    flex-direction: column;
}
.nav-badge {
    margin-left: auto;
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    color: #666;
}

/* ── EXPLORER NATIVE FILE LIST (Details View) ── */
.explorer-file-list {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background: transparent;
    height: 100%;
    overflow-y: auto;
}
.file-list-row {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #f3f3f3;
    font-size: 13px;
    color: #111;
    cursor: default;
    user-select: none;
    border-radius: 3px;
    border: 1px solid transparent;
}
.file-list-row:hover {
    background: #f4f9ff;
}
.file-list-row.selected {
    background: #cce8ff;
    border: 1px solid #99d1ff;
}
.file-list-icon {
    width: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
}
.file-list-icon svg {
    width: 18px;
    height: 18px;
}
/* A live filing: the exchange hosts the file, we hold the link. */
.icon-live {
    position: relative;
    display: inline-flex;
    line-height: 0;
}
.icon-live .live-dot {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, .25);
}
.file-list-name {
    flex: 3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-list-type {
    flex: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #555;
}
.file-list-count, .file-list-date {
    flex: 1.5;
    color: #555;
    text-align: right;
}

/* =========================================================
   WIN11 NATIVE FEEL: ANIMATIONS, MENUS, START, SNAP, STATUS
   ========================================================= */

/* Window open animation (Win11: scale up + fade, slight rise) */
@keyframes winOpen {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.win-window { animation: winOpen 0.18s cubic-bezier(0, 0, 0, 1); }

/* Smooth geometry changes (maximize, restore, snap) — applied only during
   programmatic moves so dragging/resizing stays 1:1 with the cursor */
.win-window.geo-anim {
    transition:
        top 0.22s cubic-bezier(0.2, 0, 0, 1),
        left 0.22s cubic-bezier(0.2, 0, 0, 1),
        width 0.22s cubic-bezier(0.2, 0, 0, 1),
        height 0.22s cubic-bezier(0.2, 0, 0, 1);
}

/* Close: quick scale-down + fade (Win11 dismiss) */
@keyframes winClose {
    to { opacity: 0; transform: scale(0.92); }
}
.win-window.closing {
    animation: winClose 0.14s cubic-bezier(0.4, 0, 1, 1) forwards;
    pointer-events: none;
}

/* Minimize: drop toward the taskbar while shrinking */
@keyframes winMinimize {
    to { opacity: 0; transform: translateY(45vh) scale(0.45); }
}
.win-window.minimizing {
    animation: winMinimize 0.22s cubic-bezier(0.4, 0, 1, 1) forwards;
    transform-origin: center bottom;
    pointer-events: none;
}

/* Restore from taskbar: reverse of minimize */
@keyframes winRestore {
    from { opacity: 0; transform: translateY(45vh) scale(0.45); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.win-window.restoring {
    animation: winRestore 0.22s cubic-bezier(0, 0, 0, 1);
    transform-origin: center bottom;
}

/* Inactive window: dimmed titlebar */
.win-window:not(.active) .win-titlebar-title { color: #999; }
.win-window:not(.active) .win-titlebar-title svg { opacity: 0.6; }
.win-window:not(.active) .win-btn { color: #999; }

/* ── Rubber Band Selection ── */
.selection-rect {
    position: fixed;
    background: rgba(0, 120, 212, 0.15);
    border: 1px solid rgba(0, 120, 212, 0.6);
    z-index: 900;
    pointer-events: none;
}

/* ── Win11 Context Menu (acrylic flyout) ── */
.win-context-menu {
    position: fixed;
    z-index: 99999;
    min-width: 220px;
    background: rgba(249, 249, 249, 0.96);
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    padding: 4px;
    font-size: 13px;
    color: #1b1b1b;
    animation: winOpen 0.1s ease-out;
}
.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 32px;
    padding: 0 12px;
    border-radius: 4px;
    cursor: default;
    user-select: none;
}
.ctx-item:hover { background: rgba(0, 0, 0, 0.05); }
.ctx-item.danger { color: #c42b1c; }
.ctx-item.disabled { opacity: 0.4; cursor: default; }
.ctx-item.disabled:hover { background: transparent; }
.ctx-icon { width: 16px; height: 16px; display: flex; align-items: center; }
.ctx-icon svg { width: 15px; height: 15px; }
.ctx-separator { height: 1px; background: rgba(0, 0, 0, 0.08); margin: 4px 8px; }

/* ── Win11 Start Menu ── */
.start-menu {
    position: fixed;
    bottom: 76px;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    max-height: 640px;
    background: rgba(243, 243, 243, 0.9);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.35);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 0 24px;
    color: #1b1b1b;
}
.start-menu-enter { animation: startIn 0.18s ease-out; }
@keyframes startIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.start-search {
    height: 36px;
    background: #ffffff;
    border: 1px solid #d1d1d1;
    border-bottom: 2px solid #8a8a8a;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    margin-bottom: 20px;
    color: #666;
}
.start-search:focus-within { border-bottom-color: var(--win-accent, #0078d4); }
.start-search input {
    border: none; outline: none; background: transparent;
    width: 100%; font-size: 13px; color: #1b1b1b;
}
.start-section-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.start-pinned-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    overflow-y: auto;
    flex: 0 1 auto;
    max-height: 264px;
    padding-bottom: 16px;
    min-height: 180px;
}
.start-app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    transition: background 0.1s;
}
.start-app:hover { background: rgba(255, 255, 255, 0.7); }
.start-app svg { width: 32px; height: 32px; }
.start-app span {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.start-empty { grid-column: 1 / -1; text-align: center; color: #777; padding: 30px 0; font-size: 13px; }
.start-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 0 -24px;
    padding: 12px 32px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 0 0 12px 12px;
}
.start-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.start-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #d1d1d1;
    display: flex; align-items: center; justify-content: center;
    color: #555;
}
.start-power {
    width: 36px; height: 36px;
    border: none; background: transparent;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #1b1b1b;
}
.start-power:hover { background: rgba(0, 0, 0, 0.06); }

/* ── Snap Layouts Flyout ── */
.snap-flyout {
    position: absolute;
    top: 48px;
    right: 0;
    z-index: 99999;
    background: rgba(249, 249, 249, 0.96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    padding: 10px;
    display: flex;
    gap: 8px;
    cursor: default;
}
.snap-layout {
    width: 72px;
    height: 44px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    background: transparent;
}
.snap-layout-quarters { grid-template-rows: 1fr 1fr; }
.snap-zone {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.1s;
}
.snap-zone:hover { background: var(--win-accent, #0078d4); }

/* ── Explorer Status Bar ── */
.explorer-status-bar {
    flex: none;
    height: 24px;
    background: rgba(255, 255, 255, 0.42);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    font-size: 11px;
    color: #555;
    user-select: none;
}
.status-divider { width: 1px; height: 12px; background: #ccc; }

/* ── Win11 native tooltips feel: suppress default cursor artifacts ── */
.desktop-icon, .taskbar-app, .start-btn, .tray-item { -webkit-user-select: none; user-select: none; }

/* =========================================================
   WIN11 FLUENT SKIN FOR FILAMENT CONTENT (inside iframe)
   ========================================================= */

/* Page header / breadcrumbs — explorer frame already provides chrome */
.fi-breadcrumbs { display: none !important; }
.fi-header {
    padding: 0 0 12px 0 !important;
}
.fi-header-heading {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #111 !important;
}
.fi-header-subheading { font-size: 12px !important; color: #777 !important; }

/* ── Buttons ── */
.fi-btn {
    border-radius: 4px !important;
    box-shadow: none !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    padding: 5px 14px !important;
    border: 1px solid #d1d1d1 !important;
    background: #fbfbfb !important;
    color: #1b1b1b !important;
    transition: background 0.1s;
}
.fi-btn:hover { background: #f3f3f3 !important; }
.fi-btn:active { background: #ebebeb !important; }

/* Primary (accent) button */
.fi-btn-color-primary,
.fi-btn[type="submit"] {
    background: var(--win-accent, #0078d4) !important;
    border: 1px solid #0067b8 !important;
    color: #ffffff !important;
}
.fi-btn-color-primary:hover,
.fi-btn[type="submit"]:hover { background: #106ebe !important; }
.fi-btn-color-primary:active,
.fi-btn[type="submit"]:active { background: #005a9e !important; }

.fi-btn-color-danger {
    background: #fbfbfb !important;
    border: 1px solid #d1d1d1 !important;
    color: #c42b1c !important;
}
.fi-btn-color-danger:hover { background: #fdf3f2 !important; }

/* Icon-only buttons */
.fi-icon-btn {
    border-radius: 4px !important;
    color: #555 !important;
}
.fi-icon-btn:hover { background: rgba(0, 0, 0, 0.05) !important; }

/* ── Inputs (Win11: subtle border, thick accent bottom border on focus) ── */
.fi-input-wrp {
    border-radius: 4px !important;
    box-shadow: none !important;
    background: #ffffff !important;
    border: 1px solid #d1d1d1 !important;
    border-bottom: 1px solid #8a8a8a !important;
    --tw-ring-shadow: none !important;
    --tw-ring-color: transparent !important;
    transition: border-color 0.1s;
}
.fi-input-wrp:focus-within {
    border-color: #d1d1d1 !important;
    border-bottom: 2px solid var(--win-accent, #0078d4) !important;
    --tw-ring-shadow: none !important;
}
.fi-input,
.fi-select-input,
.fi-textarea {
    font-size: 13px !important;
    color: #1b1b1b !important;
    background: transparent !important;
}
.fi-input::placeholder { color: #999 !important; }

/* Field labels */
.fi-fo-field-wrp-label .fi-fo-field-wrp-label-text,
.fi-fo-field-wrp label {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #1b1b1b !important;
}
.fi-fo-field-wrp-hint, .fi-fo-field-wrp-helper-text { font-size: 11px !important; color: #777 !important; }

/* ── Checkboxes / toggles ── */
.fi-checkbox-input,
input[type="checkbox"] {
    border-radius: 3px !important;
    border: 1px solid #8a8a8a !important;
    box-shadow: none !important;
    --tw-ring-shadow: none !important;
}
.fi-checkbox-input:checked,
input[type="checkbox"]:checked {
    background-color: var(--win-accent, #0078d4) !important;
    border-color: var(--win-accent, #0078d4) !important;
}
.fi-toggle > button { box-shadow: none !important; }

/* Hide table bulk-select checkbox column — explorer selection instead */
.fi-ta-selection-cell,
.fi-ta-table th:has(.fi-ta-header-checkbox),
.fi-ta-table td:has(.fi-ta-record-checkbox) { display: none !important; }

/* ── Sections / cards (form pages) ── */
.fi-section {
    border-radius: 6px !important;
    box-shadow: none !important;
    border: 1px solid #e5e5e5 !important;
    background: #fbfbfb !important;
}
.fi-section-header-heading {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1b1b1b !important;
}
.fi-fo-component-ctn { gap: 14px !important; }

/* ── Tabs (Win11 pivot style) ── */
.fi-tabs {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 4px !important;
}
.fi-tabs-item {
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: #444 !important;
    position: relative;
}
.fi-tabs-item:hover { background: rgba(0, 0, 0, 0.04) !important; }
.fi-tabs-item[aria-selected="true"] {
    background: transparent !important;
    color: var(--win-accent, #0078d4) !important;
    font-weight: 600 !important;
}
.fi-tabs-item[aria-selected="true"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 3px;
    border-radius: 2px;
    background: var(--win-accent, #0078d4);
}

/* ── Dropdown menus (Win11 flyout) ── */
.fi-dropdown-panel {
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14) !important;
    background: rgba(249, 249, 249, 0.98) !important;
    backdrop-filter: blur(20px);
    padding: 4px !important;
}
.fi-dropdown-list-item {
    border-radius: 4px !important;
    font-size: 13px !important;
    color: #1b1b1b !important;
}
.fi-dropdown-list-item:hover { background: rgba(0, 0, 0, 0.05) !important; }

/* ── Modals (Win11 dialog) ── */
.fi-modal-window {
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.35) !important;
    background: rgba(250, 250, 250, 0.98) !important;
    backdrop-filter: blur(20px);
}
.fi-modal-header {
    background: transparent !important;
    border-bottom: none !important;
    padding: 20px 24px 8px 24px !important;
}
.fi-modal-heading { font-size: 16px !important; font-weight: 600 !important; color: #1b1b1b !important; }
.fi-modal-footer {
    background: #f3f3f3 !important;
    border-top: 1px solid #e5e5e5 !important;
    padding: 16px 24px !important;
}
.fi-modal-close-btn { border-radius: 4px !important; }
.fi-modal-close-btn:hover { background: #e81123 !important; color: #fff !important; }

/* ── Notifications (Win11 toast) ── */
.fi-no-notification {
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    background: rgba(249, 249, 249, 0.98) !important;
    backdrop-filter: blur(20px);
    font-size: 13px !important;
}

/* ── Badges ── */
.fi-badge {
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    box-shadow: none !important;
}

/* ── Pagination (explorer status-bar look) ── */
.fi-ta-pagination {
    font-size: 12px !important;
    color: #555 !important;
}
.fi-pagination-items { gap: 2px !important; }
.fi-pagination-item {
    border-radius: 4px !important;
    box-shadow: none !important;
    border: none !important;
    font-size: 12px !important;
    color: #444 !important;
}
.fi-pagination-item:hover { background: rgba(0, 0, 0, 0.05) !important; }
.fi-pagination-item-active,
.fi-pagination-item[aria-current="page"] {
    background: rgba(0, 120, 212, 0.1) !important;
    color: var(--win-accent, #0078d4) !important;
    font-weight: 600 !important;
}
.fi-pagination-overview, .fi-ta-pagination label { font-size: 12px !important; color: #666 !important; }

/* Per-page select compact */
.fi-ta-pagination .fi-input-wrp {
    border: 1px solid #d1d1d1 !important;
    border-radius: 4px !important;
}

/* ── Scrollbars (Win11 thin) ── */
*::-webkit-scrollbar { width: 12px; height: 12px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: #999; background-clip: content-box; }

/* ── Filters dropdown / search field inside table (hidden chrome kept clickable) ── */
.fi-ta-search-field .fi-input-wrp { border-radius: 4px !important; }

/* ── Empty state (Filament) ── */
.fi-ta-empty-state {
    background: #ffffff !important;
    color: #999 !important;
}
.fi-ta-empty-state-icon-ctn {
    background: transparent !important;
    box-shadow: none !important;
}
.fi-ta-empty-state-heading { font-size: 14px !important; font-weight: 400 !important; color: #999 !important; }

/* =========================================================
   BREAD LIST SCREENS = WINDOWS EXPLORER FOLDER VIEW
   ========================================================= */

/* List pages fill window edge-to-edge, no admin-page chrome */
.fi-resource-list-records-page main.fi-main,
.fi-page:has(.fi-ta) main.fi-main,
main.fi-main:has(.fi-resource-list-records-page),
body:has(.fi-resource-list-records-page) main.fi-main {
    padding: 0 !important;
    background: #ffffff !important;
}
.fi-resource-list-records-page .fi-header,
body:has(.fi-resource-list-records-page) .fi-header {
    display: none !important; /* titlebar + command bar already show this */
}
.fi-resource-list-records-page .fi-page-content,
body:has(.fi-resource-list-records-page) .fi-page-content {
    gap: 0 !important;
}

/* Content flat white, no divider chrome */
.fi-ta-content {
    border-top: none !important;
}

/* ── Explorer "Details view" column headers ── */
.fi-ta-table thead tr {
    background: #ffffff !important;
}
.fi-ta-header-cell {
    padding: 4px 10px !important;
    border-bottom: 1px solid #e5e5e5 !important;
    height: 30px !important;
}
.fi-ta-header-cell-label,
.fi-ta-header-cell button span {
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #555 !important;
}
.fi-ta-header-cell .fi-ta-sort-indicator,
.fi-ta-header-cell svg {
    width: 12px !important;
    height: 12px !important;
    color: var(--win-accent, #0078d4) !important;
}

/* ── Thin explorer rows ── */
.fi-ta-row {
    height: 34px !important;
}
.fi-ta-cell {
    padding: 0 !important;
    border: none !important;
}
.fi-ta-text {
    padding: 6px 10px !important;
    gap: 0 !important;
    font-size: 13px !important;
    color: #111 !important;
}
.fi-ta-text-item-label {
    font-size: 13px !important;
    color: #111 !important;
}
/* Secondary/description lines muted, single-line */
.fi-ta-text-item + .fi-ta-text-item .fi-ta-text-item-label,
.fi-ta-cell .text-gray-500 {
    color: #777 !important;
    font-size: 12px !important;
}

/* ── File icon in first data column (selection cell hidden before it) ── */
.fi-ta-row .fi-ta-selection-cell + .fi-ta-cell .fi-ta-text::before,
.fi-ta-row .fi-ta-cell:first-child:not(.fi-ta-selection-cell) .fi-ta-text::before {
    content: '';
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230078D4'%3E%3Cpath d='M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}
.fi-ta-row .fi-ta-selection-cell + .fi-ta-cell .fi-ta-text,
.fi-ta-row .fi-ta-cell:first-child:not(.fi-ta-selection-cell) .fi-ta-text {
    display: flex !important;
    align-items: center !important;
}

/* ── Row actions: hidden until hover, compact (like explorer) ── */
.fi-ta-row .fi-ta-actions {
    opacity: 0;
    transition: opacity 0.15s;
}
.fi-ta-row:hover .fi-ta-actions,
.fi-ta-row[data-selected="true"] .fi-ta-actions {
    opacity: 1;
}
.fi-ta-actions .fi-icon-btn svg { width: 14px !important; height: 14px !important; }

/* Row link fills the row, no underline */
.fi-ta-cell a { text-decoration: none !important; }

/* ── Full-height layout: table fills window, pagination stick bottom ── */
body:has(.fi-resource-list-records-page) {
    overflow: hidden !important;
}
body:has(.fi-resource-list-records-page) main.fi-main {
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}
.fi-page.fi-resource-list-records-page {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
}
/* Content wrapper: section.flex.flex-col.gap-y-8.py-8 — kill padding, fill height */
.fi-page.fi-resource-list-records-page > section {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
}
/* Collapse intermediate wrapper divs between section and .fi-ta */
.fi-resource-list-records-page > section > div:not(.fi-ta),
.fi-resource-list-records-page > section > div > .grid,
.fi-resource-list-records-page > section > div > .grid > div:not(.fi-ta) {
    display: contents !important;
}
.fi-resource-list-records-page .fi-ta {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
}
/* The card container: strip rounded/shadow, become the flex column */
.fi-resource-list-records-page .fi-ta-ctn {
    flex: 1 1 auto;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0;
    border-radius: 0 !important;
    box-shadow: none !important;
    --tw-ring-shadow: none !important;
    --tw-shadow: none !important;
    border: none !important;
}
.fi-resource-list-records-page .fi-ta-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
}
.fi-resource-list-records-page .fi-ta-pagination {
    flex: none;
    margin-top: auto !important;
}

/* ── Pagination = explorer status bar ── */
.fi-ta-pagination {
    padding: 4px 12px !important;
    min-height: 30px !important;
    background: #f9f9f9 !important;
}
.fi-ta-pagination .fi-btn { padding: 2px 8px !important; font-size: 12px !important; }

/* ── EMPTY STATE ── */
.explorer-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}
.explorer-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

/* ── MOBILE RESPONSIVE TWEAKS ── */
@media (max-width: 768px) {
    /* Full screen windows */
    .win-window {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100% - 52px) !important; /* taskbar height */
        border-radius: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    .win-titlebar {
        border-radius: 0 !important;
    }
    
    /* Hide minimize and maximize on mobile, keep close */
    .win-controls .win-btn:not(.close) {
        display: none !important;
    }
    
    /* Larger close button for touch */
    .win-controls .win-btn.close {
        width: 44px !important;
        height: 44px !important;
    }
    
    .win-window.maximized {
        height: calc(100vh - 52px) !important;
    }

    /* Disable resizing and snapping */
    .resizer, .snap-flyout {
        display: none !important;
    }

    /* Taskbar tweaks */
    .taskbar {
        width: 100vw !important;
        bottom: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }

    /* Start Menu tweaks */
    .start-menu {
        bottom: 52px !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 52px) !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    /* Stack sidebars for mobile instead of hiding them, so navigation trees are visible */
    .explorer-left-pane {
        width: 100% !important;
        max-height: 40vh;
        border-right: none !important;
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
    
    .explorer-right-pane {
        display: none !important; 
    }

    .explorer-main-area {
        flex-direction: column !important;
    }

    /* Desktop icons adjustment */
    .desktop-icons {
        padding: 10px !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-content: flex-start !important;
        gap: 10px !important;
        overflow-y: auto !important; /* Allow scrolling if icons exceed height */
    }

    /* Context menu touch targets */
    .ctx-item {
        padding: 12px 15px !important;
        font-size: 14px !important;
    }

    /* System tray adjustments */
    .system-tray-floating {
        display: none !important; 
    }
}

/* =========================================================
   MOBILE (≤ 768px): SINGLE-SCREEN MODE
   Windows are fullscreen pages — no dragging, resizing,
   or snapping. Active window is simply the visible screen.
   ========================================================= */
@media (max-width: 768px) {

    /* Every window becomes a fullscreen sheet above the taskbar */
    .win-window {
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 68px) !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* No drag/resize affordances */
    .resizer { display: none !important; }
    .snap-flyout { display: none !important; }
    .win-titlebar { cursor: default; }
    .win-titlebar:active { cursor: default; }

    /* Maximize button is meaningless when fullscreen */
    .win-controls .win-btn:nth-child(2) { display: none; }
    .win-btn { width: 52px; } /* bigger touch targets */

    /* Explorer panes: content only */
    .explorer-left-pane { display: none !important; }
    .explorer-right-pane { display: none !important; }

    /* Command + address bars: horizontal scroll instead of overflow */
    .explorer-command-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .explorer-command-bar::-webkit-scrollbar { display: none; }
    .explorer-btn { flex: none; }
    .explorer-nav-btns .explorer-nav-btn:nth-child(2) { display: none; }
    .explorer-search { flex: 1 1 auto; min-width: 0; }
    .explorer-path { display: none; }

    /* Desktop icons: horizontal grid rows like a phone home screen */
    .desktop-icons {
        flex-direction: row;
        flex-wrap: wrap;
        align-content: flex-start;
        justify-content: flex-start;
        padding: 12px 8px;
        gap: 6px;
    }
    .desktop-icon { width: 22%; min-width: 72px; }

    /* Taskbar: full-width dock, no floating pill overlap */
    .taskbar {
        left: 8px;
        right: 8px;
        transform: none;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .taskbar::-webkit-scrollbar { display: none; }
    .taskbar-app { flex: none; }

    /* Tray would overlap the dock — hide it */
    .system-tray-floating { display: none !important; }

    /* Start menu: full-width bottom sheet */
    .start-menu {
        left: 8px;
        right: 8px;
        width: auto;
        transform: none;
        bottom: 72px;
        max-height: 70vh;
        padding: 16px 16px 0 16px;
    }
    .start-menu-enter { animation: startInMobile 0.18s ease-out; }
    .start-pinned-grid { grid-template-columns: repeat(4, 1fr); }
    .start-footer { margin: 0 -16px; padding: 10px 20px; }

    /* File list: hide type/date columns, keep name + size */
    .file-list-type, .file-list-date { display: none; }

    /* Context menu: keep on screen */
    .win-context-menu { max-width: calc(100vw - 16px); }

    /* Details pane preview inside selection unavailable — status bar compact */
    .explorer-status-bar { height: 28px; }
}

@keyframes startInMobile {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   WIN11 LOCK SCREEN LOGIN PAGE
   ========================================================= */
.fi-simple-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(rgba(0, 30, 60, 0.35), rgba(0, 15, 35, 0.55)),
        linear-gradient(135deg, #0f2c4c 0%, var(--win-accent, #0078d4) 55%, #35b0e0 100%);
    padding: 24px;
}

.fi-simple-main-ctn {
    width: 100%;
    display: flex;
    justify-content: center;
}

.fi-simple-main {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(40px) saturate(1.6);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 20px 64px rgba(0, 0, 0, 0.35);
    padding: 40px 36px 32px !important;
    animation: winOpen 0.22s cubic-bezier(0, 0, 0, 1);
}

.fi-simple-header {
    text-align: center;
    padding-bottom: 20px !important;
}

.fi-logo {
    justify-content: center !important;
    margin-bottom: 8px;
}

.fi-simple-header-heading {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #1b1b1b !important;
}

.fi-simple-header-subheading {
    font-size: 13px !important;
    color: #666 !important;
}

.fi-simple-main .fi-btn[type="submit"] {
    width: 100%;
    justify-content: center !important;
    height: 38px;
    font-size: 14px !important;
    border-radius: 4px !important;
}

.fi-simple-main .fi-input-wrp {
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 4px !important;
}

.fi-simple-footer {
    text-align: center;
    margin-top: 16px !important;
    font-size: 12px !important;
    color: #777 !important;
}

/* =========================================================
   WIN11 "SHOW DESKTOP" CORNER STRIP
   ========================================================= */
.show-desktop-strip {
    position: fixed;
    bottom: 12px;
    right: 0;
    width: 6px;
    height: 52px;
    cursor: pointer;
    z-index: 9999;
    background: transparent;
    border-left: 1px solid transparent;
    transition: border-color 0.1s, background 0.1s;
}
.show-desktop-strip:hover {
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
}
@media (max-width: 768px) {
    .show-desktop-strip { display: none !important; }
}

/* =========================================================
   SETTINGS / PERSONALIZATION APP
   ========================================================= */
.settings-panel {
    display: flex;
    flex: 1 1 auto;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
}
.settings-nav {
    width: 180px;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.settings-nav-item {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}
.settings-nav-item:hover { background: rgba(0, 0, 0, 0.05); }
.settings-nav-item.active {
    background: rgba(0, 120, 212, 0.1);
    color: var(--win-accent, #0078d4);
    font-weight: 600;
}
.settings-content {
    flex: 1 1 auto;
    padding: 24px 28px;
    overflow-y: auto;
}
.settings-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px;
}
.settings-content h3:not(:first-child) { margin-top: 24px; }
.settings-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.settings-swatch {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.settings-swatch.active {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}
.settings-swatch-custom {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}
.settings-wallpaper-thumb {
    width: 72px;
    height: 44px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    background-size: cover;
    background-position: center;
}
.settings-wallpaper-thumb.active {
    border-color: var(--win-accent, #0078d4);
}
.settings-input {
    margin-top: 12px;
    width: 100%;
    max-width: 320px;
    height: 32px;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 13px;
    background: #fff;
}
.settings-btn {
    margin-top: 12px;
    height: 34px;
    padding: 0 16px;
    border-radius: 4px;
    border: 1px solid #0067b8;
    background: var(--win-accent, #0078d4);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}
.settings-btn:hover { filter: brightness(1.08); }

/* =========================================================
   NOTIFICATION CENTER + TOASTS
   ========================================================= */
.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    border-radius: 7px;
    background: var(--win-accent, #0078d4);
    color: #fff;
    font-size: 9px;
    line-height: 14px;
    text-align: center;
}
.notif-center {
    position: fixed;
    bottom: 76px;
    right: 12px;
    width: 320px;
    max-height: 60vh;
    background: rgba(249, 249, 249, 0.96);
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    color: #1b1b1b;
}
.notif-center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
}
.notif-clear-all {
    font-size: 12px;
    font-weight: 400;
    color: var(--win-accent, #0078d4);
    cursor: pointer;
}
.notif-center-list {
    overflow-y: auto;
    padding: 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.notif-empty {
    text-align: center;
    color: #999;
    font-size: 12px;
    padding: 30px 0;
}
.notif-card, .toast-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-left: 3px solid var(--win-accent, #0078d4);
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.notif-card.notif-success, .toast-card.notif-success { border-left-color: #107c10; }
.notif-card.notif-warning, .toast-card.notif-warning { border-left-color: #ca5010; }
.notif-card-title { font-size: 13px; font-weight: 600; color: #1b1b1b; }
.notif-card-message { font-size: 12px; color: #555; margin-top: 2px; }
.notif-card-time { font-size: 11px; color: #999; margin-top: 4px; }

.toast-stack {
    position: fixed;
    bottom: 76px;
    right: 12px;
    width: 300px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}
.toast-card { pointer-events: auto; }
.toast-enter { transition: all 0.2s ease-out; }
.toast-enter-start { opacity: 0; transform: translateY(12px); }
.toast-enter-end { opacity: 1; transform: translateY(0); }
.toast-leave { transition: all 0.15s ease-in; }
.toast-leave-start { opacity: 1; }
.toast-leave-end { opacity: 0; transform: translateX(20px); }

/* =========================================================
   START MENU: DOCUMENT SEARCH RESULTS
   ========================================================= */
.start-doc-results {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 10px;
}
.start-doc-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.start-doc-result:hover { background: rgba(255, 255, 255, 0.7); }
.start-doc-result-title { font-size: 13px; color: #1b1b1b; }
.start-doc-result-label { font-size: 11px; color: #777; }

/* =========================================================
   THIS PC VIEW
   ========================================================= */
.thispc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 20px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    align-content: flex-start;
}
.thispc-drive {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}
.thispc-drive:hover { background: #f3f9ff; border-color: #cce8ff; }
.thispc-drive-icon svg { width: 36px; height: 36px; }
.thispc-drive-info { flex: 1; min-width: 0; }
.thispc-drive-title { font-size: 13px; color: #111; margin-bottom: 4px; }
.thispc-drive-bar {
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}
.thispc-drive-bar-fill {
    height: 100%;
    background: var(--win-accent, #0078d4);
    border-radius: 3px;
}
.thispc-drive-count { font-size: 11px; color: #777; }

/* =========================================================
   DRAG & DROP: MOVE DOCUMENTS BETWEEN FOLDERS
   ========================================================= */
.file-list-row[draggable="true"] { cursor: grab; }
.file-list-row.drop-target,
.nav-pane-item.drop-target {
    background: #cce8ff !important;
    outline: 2px dashed var(--win-accent, #0078d4);
    outline-offset: -2px;
}

/* =========================================================
   CLICKABLE BREADCRUMB
   ========================================================= */
/* Breadcrumb: a bare text node is a 15px-tall click target, so the crumbs
   get padding — but they must not each ellipsis independently. */
.breadcrumb-sep {
    flex: none;
    padding: 0 1px;
    color: #8a8a8a;
}
.breadcrumb-seg {
    display: inline-block;
    padding: 4px 6px;
    border-radius: 4px;
    max-width: 26ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.breadcrumb-seg.is-link {
    cursor: pointer;
}
.breadcrumb-seg.is-link:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--win-accent, #0078d4);
}
/* The last crumb is where you are — give it a little weight. */
.explorer-path > span:last-child .breadcrumb-seg {
    font-weight: 600;
    color: #1b1b1b;
}

.details-status {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    text-transform: capitalize;
    background: rgba(0, 0, 0, 0.06);
    color: #444;
}
.details-status.is-published { background: rgba(27, 107, 71, 0.14); color: #1b6b47; }
.details-status.is-draft { background: rgba(154, 98, 18, 0.14); color: #9a6212; }
.details-status.is-superseded { background: rgba(151, 48, 42, 0.12); color: #97302a; }
.details-download {
    display: inline-block;
    margin-top: 14px;
    padding: 5px 12px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 4px;
    font-size: 12px;
    color: inherit;
    text-decoration: none;
}
.details-download:hover { border-color: var(--win-accent, #0078d4); color: var(--win-accent, #0078d4); }
.details-hint { margin-top: 8px; font-size: 12px; color: #888; }

/* Loading placeholder: a folder mid-fetch must not read as empty. */
.explorer-skeleton { padding: 4px 0; }
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
}
.skeleton-cell {
    height: 11px;
    border-radius: 5px;
    background: linear-gradient(90deg, rgba(0,0,0,.055) 25%, rgba(0,0,0,.11) 37%, rgba(0,0,0,.055) 63%);
    background-size: 400% 100%;
    animation: winui-shimmer 1.3s ease-in-out infinite;
}
.skeleton-cell.sk-icon { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.skeleton-cell.sk-name { flex: 1 1 auto; max-width: 340px; }
.skeleton-cell.sk-meta { width: 74px; flex: none; }
@keyframes winui-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .skeleton-cell { animation: none; }
}

/* A window that can receive the item being dragged says so. */
.explorer-file-list.move-drop-active {
    outline: 2px dashed rgba(0, 120, 212, .55);
    outline-offset: -6px;
    background: rgba(0, 120, 212, .04);
}

/* Status at a glance in the file list: a draft should be obvious without
   reading a column. */
.file-list-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-list-name > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.status-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b9bcc2;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .65);
}
.status-dot.is-published { background: #1b8a4b; }
.status-dot.is-draft { background: #d9922b; }
.status-dot.is-superseded { background: #8a5cd6; }
.status-dot.is-archived { background: #9aa0a8; }

/* The document's state as a chip beside its name. Green is not used here:
   in the explorer green belongs to the live-filing dot on the icon. */
.status-chip {
    flex: 0 0 auto;
    padding: 0 7px;
    border-radius: 9px;
    font-size: 10.5px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: capitalize;
    background: rgba(0, 0, 0, 0.06);
    color: #555;
}
.status-chip.is-draft { background: rgba(217, 146, 43, 0.18); color: #8a5a12; }
.status-chip.is-superseded { background: rgba(138, 92, 214, 0.16); color: #5b34a8; }
.status-chip.is-archived { background: rgba(0, 0, 0, 0.08); color: #6b7280; }
.file-list-row.selected .status-chip { background: rgba(255, 255, 255, 0.7); }

/* A notification can carry one call to action. */
.notif-action {
    margin-top: 8px;
    padding: 4px 12px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--win-accent, #0078d4);
    background: rgba(0, 120, 212, 0.10);
    border: 1px solid rgba(0, 120, 212, 0.28);
    border-radius: 4px;
    cursor: pointer;
}
.notif-action:hover { background: rgba(0, 120, 212, 0.18); }

/* This PC: sections of drives and installed apps */
.thispc-scroll { padding: 18px 20px; overflow-y: auto; height: 100%; }
/* The grid used to be the scroll container; inside a section it is just a grid. */
.thispc-scroll .thispc-grid {
    padding: 0;
    height: auto;
    overflow: visible;
}
.thispc-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin: 4px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}
.thispc-scroll > div + div .thispc-section-title { margin-top: 22px; }
.thispc-drive-sub {
    font-size: 11px;
    color: #777;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.thispc-drive-bar-fill.is-low { background: #d13438; }
.thispc-drive-icon .pkg-app-glyph svg { width: 34px; height: 34px; }

/* =========================================================
   PROPERTIES DIALOG (Win11 modal)
   ========================================================= */
.win-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}
.win-modal-dialog {
    background: rgba(249, 249, 249, 0.98);
    backdrop-filter: blur(30px) saturate(1.5);
    -webkit-backdrop-filter: blur(30px) saturate(1.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.35);
    width: 340px;
    animation: winOpen 0.15s ease-out;
    color: #1b1b1b;
}
.properties-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.properties-title {
    font-size: 15px;
    font-weight: 600;
    word-break: break-word;
}
.properties-body {
    padding: 12px 20px;
}
.properties-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
}
.properties-label { color: #777; flex: none; }
.properties-value { text-align: right; word-break: break-all; }
.properties-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px 20px;
}

/* =========================================================
   INLINE RENAME (Explorer F2 rename)
   ========================================================= */
.task-manager-dialog {
    width: 460px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}
.task-manager-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 4px 20px 12px;
}
.task-manager-row {
    display: grid;
    grid-template-columns: 1fr 100px 90px;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 13px;
}
.task-manager-header {
    color: #777;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.task-manager-name {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-manager-row .fi-btn {
    padding: 3px 10px !important;
    font-size: 12px !important;
}
.task-manager-empty {
    text-align: center;
    color: #999;
    padding: 30px 0;
    font-size: 13px;
}

/* =========================================================
   LOCK SCREEN
   ========================================================= */
.lock-screen {
    position: fixed;
    inset: 0;
    z-index: 200000;
    background:
        linear-gradient(rgba(0, 10, 30, 0.45), rgba(0, 5, 20, 0.65)),
        linear-gradient(135deg, #0f2c4c 0%, #0078d4 55%, #35b0e0 100%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}
.lock-screen-time {
    font-size: 88px;
    font-weight: 600;
    letter-spacing: -2px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.lock-screen-date {
    font-size: 22px;
    font-weight: 400;
    margin-top: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
/* =========================================================
   WIDGETS PANEL
   ========================================================= */
.widgets-panel {
    position: fixed;
    bottom: 76px;
    left: 12px;
    width: 340px;
    max-height: 640px;
    overflow-y: auto;
    background: rgba(243, 243, 243, 0.9);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.35);
    z-index: 9998;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #1b1b1b;
}
.widget-card {
    background: rgba(255, 255, 255, 0.75);
    border-radius: 8px;
    padding: 16px;
}
.widget-card-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
}
.widget-clock-card { text-align: center; }
.widget-clock-time { font-size: 34px; font-weight: 600; }
.widget-clock-date { font-size: 13px; color: #666; margin-top: 2px; }

.widget-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.widget-calendar-dow { font-size: 11px; color: #777; font-weight: 600; padding-bottom: 4px; }
.widget-calendar-cell { font-size: 12px; padding: 4px 0; border-radius: 50%; }
.widget-calendar-cell.is-empty { visibility: hidden; }
.widget-calendar-cell.is-today {
    background: var(--win-accent, #0078d4);
    color: #fff;
    font-weight: 600;
}

.widget-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 4px 0;
}
.widget-stat-row span:last-child { font-weight: 600; color: var(--win-accent, #0078d4); }

/* Desktop widgets pinned top-right */
.desktop-widgets {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
    pointer-events: auto;
}
.desk-widget {
    background: rgba(243, 243, 243, 0.72);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    color: #1b1b1b;
}
.widget-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}
.widget-summary-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--win-accent, #0078d4);
    line-height: 1.1;
}
.widget-summary-label {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}
.widget-stat-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border-radius: 6px;
    padding: 5px 8px;
    margin: 0 -8px;
    transition: background 0.12s ease;
}
.widget-stat-link:hover {
    background: rgba(0, 0, 0, 0.06);
}

@media (max-width: 768px) {
    .widgets-panel { left: 8px; right: 8px; width: auto; bottom: 60px; }
    .desktop-widgets { display: none; }
}

.lock-screen-hint {
    position: absolute;
    bottom: 48px;
    font-size: 13px;
    opacity: 0.85;
    animation: lockHintPulse 2.4s ease-in-out infinite;
}
@keyframes lockHintPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.95; }
}
@media (max-width: 768px) {
    .lock-screen-time { font-size: 56px; }
    .lock-screen-date { font-size: 16px; }
}

.file-list-rename-input {
    flex: 3;
    font-size: 13px;
    color: #111;
    background: #fff;
    border: 1px solid var(--win-accent, #0078d4);
    border-radius: 2px;
    padding: 1px 4px;
    outline: none;
}

/* ── Account panel in Settings ───────────────────────────────────────── */
.account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 8px 0 12px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 48px;
}

.account-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--winui-accent, #0078D4);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.account-card-text {
    min-width: 0;
}

.account-name {
    font-size: 14px;
    font-weight: 600;
    color: #1b1b1b;
}

.account-meta {
    font-size: 12px;
    color: #777;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-role {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(0, 120, 212, 0.1);
    color: var(--winui-accent, #0078D4);
    font-size: 11px;
    font-weight: 600;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── Start menu: pinned icons, then Recommended ──────────────────────── */
.start-app .start-app-glyph {
    display: block;
    width: 32px;
    height: 32px;
    overflow: visible;
    -webkit-line-clamp: none;
}

.start-app .start-app-glyph svg {
    width: 32px;
    height: 32px;
    display: block;
}

.start-section-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.start-section-more {
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #1b1b1b;
    cursor: pointer;
}

.start-section-more:hover { background: rgba(0, 0, 0, 0.1); }

.start-recommended {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 14px;
    margin-top: 2px;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.start-recent-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    padding-bottom: 12px;
}

.start-recent {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: default;
}

.start-recent.is-openable { cursor: pointer; }
.start-recent.is-openable:hover { background: rgba(255, 255, 255, 0.7); }

.start-recent-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8a8a8a;
}

/* The colours read the same as the badges in the History feed. */
.start-recent-dot.evt-published { background: #107C10; }
.start-recent-dot.evt-created,
.start-recent-dot.evt-uploaded,
.start-recent-dot.evt-restored,
.start-recent-dot.evt-prepared,
.start-recent-dot.evt-linked { background: #0078D4; }
.start-recent-dot.evt-updated,
.start-recent-dot.evt-renamed,
.start-recent-dot.evt-filed,
.start-recent-dot.evt-moved,
.start-recent-dot.evt-unpublished { background: #C77700; }
.start-recent-dot.evt-deleted { background: #C42B1C; }

.start-recent-text {
    flex: 1 1 auto;
    min-width: 0;
}

.start-recent-title {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.start-recent-meta {
    font-size: 11px;
    color: #6b6b6b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.start-recent-sep { margin: 0 4px; }

.start-recent-ago {
    flex: 0 0 auto;
    font-size: 11px;
    color: #6b6b6b;
    font-variant-numeric: tabular-nums;
}

/* The footer chip is a button now that it opens your profile. */
.start-user {
    border: none;
    background: transparent;
    padding: 4px 8px 4px 4px;
    border-radius: 18px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    font-size: 13px;
}

.start-user:hover { background: rgba(0, 0, 0, 0.06); }

.start-user-avatar {
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
}

.start-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── New link dialog ─────────────────────────────────────────────────── */
.link-dialog { width: 440px; max-width: calc(100vw - 32px); }

.link-dialog-body {
    padding: 16px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.link-dialog-hint {
    margin: 0;
    font-size: 12px;
    color: #6b6b6b;
}

.link-dialog-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    color: #4a4a4a;
}

.link-dialog-field input {
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d1d1d1;
    border-bottom: 2px solid #8a8a8a;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    color: #1b1b1b;
}

.link-dialog-field input:focus {
    outline: none;
    border-bottom-color: var(--winui-accent, #0078D4);
}

.link-dialog-error {
    margin: 0;
    font-size: 12px;
    color: #C42B1C;
}

/* The address in the details pane wraps rather than overflowing. */
.details-link {
    color: var(--winui-accent, #0078D4);
    text-decoration: none;
    word-break: break-all;
}

.details-link:hover { text-decoration: underline; }

/* ── Impersonation banner ────────────────────────────────────────────── */
.impersonation-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 16px;
    background: repeating-linear-gradient(
        135deg, #8a4b00, #8a4b00 12px, #7a4200 12px, #7a4200 24px
    );
    color: #fff;
    font-size: 13px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.impersonation-bar svg { width: 18px; height: 18px; flex: 0 0 18px; }

.impersonation-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.impersonation-by { opacity: 0.85; }

.impersonation-bar form { margin: 0; }

.impersonation-exit {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.impersonation-exit:hover { background: rgba(255, 255, 255, 0.28); }

/* Push the desktop down so the banner never covers the taskbar or icons. */
.desktop-container.is-impersonating {
    top: 40px;
    height: calc(100% - 40px);
}

/* ── Security panel in Settings ──────────────────────────────────────── */
.security-state {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    margin: 8px 0 12px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #e5e5e5;
    background: #fff;
}

.security-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.security-state.is-on .security-dot { background: #107C10; }
.security-state.is-off .security-dot { background: #C77700; }
.security-state.is-on { border-color: #bfe3c4; background: #f4fbf5; }
.security-state.is-off { border-color: #f0dca8; background: #fffbf0; }

/* ── Wallpaper picker ────────────────────────────────────────────────── */
.settings-wallpapers {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 10px;
    margin: 8px 0 14px;
}

.settings-wallpaper {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.settings-wallpaper-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    border: 2px solid transparent;
    outline: 1px solid rgba(0, 0, 0, 0.12);
    outline-offset: -1px;
    background-size: cover !important;
    background-position: center !important;
    transition: border-color 0.12s;
}

.settings-wallpaper:hover .settings-wallpaper-thumb { border-color: rgba(0, 120, 212, 0.45); }
.settings-wallpaper.active .settings-wallpaper-thumb { border-color: var(--winui-accent, #0078D4); }

.settings-wallpaper-label {
    font-size: 11px;
    color: #5c5c5c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-wallpaper.active .settings-wallpaper-label { color: #1b1b1b; font-weight: 600; }

/* ── Wallpaper upload ────────────────────────────────────────────────── */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

.wallpaper-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.settings-btn-quiet {
    background: transparent;
    border: 1px solid #d1d1d1;
    color: #444;
}

.settings-btn-quiet:hover { background: rgba(0, 0, 0, 0.04); }

.wallpaper-hint {
    flex: 1 0 100%;
    margin: 2px 0 0;
    font-size: 11px;
    color: #777;
    line-height: 1.45;
}

.wallpaper-error {
    flex: 1 0 100%;
    margin: 0;
    font-size: 12px;
    color: #C42B1C;
}

/* The uploaded one sits first and is marked as yours. */
.settings-wallpaper.is-custom .settings-wallpaper-label::after {
    content: " ●";
    color: var(--winui-accent, #0078D4);
}

/* ── Date & time panel ───────────────────────────────────────────────── */
.clock-preview {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 8px 0 10px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.clock-preview-time {
    font-size: 26px;
    font-weight: 600;
    color: #1b1b1b;
    font-variant-numeric: tabular-nums;
}

.clock-preview-zone { font-size: 12px; color: #777; }

.settings-choice {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.settings-choice label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    cursor: pointer;
}

.settings-choice em {
    font-style: normal;
    color: #777;
    font-variant-numeric: tabular-nums;
}

/* A select inherits Filament's chevron as a background image. The shorthand
   `background: #fff` above resets background-repeat to its initial value, so
   that chevron tiles across the whole control. Draw our own instead. */
select.settings-input {
    height: 32px;
    padding: 0 30px 0 10px;
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235c6470' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 16px;
    cursor: pointer;
}

select.settings-input:disabled {
    background-color: #f3f3f3;
    color: #8a8a8a;
    cursor: not-allowed;
}

/* ── Snap preview ────────────────────────────────────────────────────── */
.snap-preview {
    position: fixed;
    z-index: 9000;
    pointer-events: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    transition: left 0.12s ease, top 0.12s ease, width 0.12s ease, height 0.12s ease;
}
