/* Names use remaining space; uploader and date share growth within readable bounds. */
.archive-explorer-shell { background: #fff; border: 1px solid #cbd5e1; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 5px #0f172a06; min-width: 0; }
.archive-explorer-toolbar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid #e2e8f0; }
.archive-explorer-toolbar h3 { display: flex; align-items: center; gap: 8px; font-weight: 800; color: #075985; }
.archive-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.archive-toolbar-actions button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 12px; color: #075985; background: #f8fafc; }
.archive-toolbar-actions button:disabled { opacity: .45; cursor: not-allowed; }
.archive-toolbar-actions button[hidden], #archive-folder-sidebar[hidden] { display: none; }
.archive-toolbar-actions .material-symbols-outlined { font-size: 19px; }
#btn-archive-reopen-folders[hidden] { display: none; }
#btn-archive-reopen-folders { align-self: stretch; flex: 0 0 42px; display: inline-flex; align-items: flex-start; justify-content: center; padding-top: 15px; border: 0; border-right: 1px solid #cbd5e1; background: #f8fafc; color: #0369a1; cursor: pointer; }
#btn-archive-reopen-folders:hover, #btn-archive-reopen-folders:focus-visible { background: #e0f2fe; color: #005e9f; outline: none; }
#btn-archive-reopen-folders .material-symbols-outlined { font-size: 22px; }
.archive-help-popover[hidden] { display: none; }
.archive-help-popover { position: absolute; z-index: 60; top: calc(100% + 10px); right: 16px; width: min(420px, calc(100% - 32px)); background: #fff; border: 1px solid #b8d7ee; border-radius: 12px; box-shadow: 0 12px 35px #0f172a26; color: #334155; font-size: 13px; line-height: 1.65; animation: archive-help-in .14s ease-out; }
.archive-help-popover::before { content: ''; position: absolute; right: 45px; top: -7px; width: 12px; height: 12px; background: #fff; border-left: 1px solid #b8d7ee; border-top: 1px solid #b8d7ee; transform: rotate(45deg); }
.archive-help-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 8px; }
.archive-help-heading h4 { color: #075985; font-weight: 800; }
.archive-help-heading button { display: flex; padding: 4px; border-radius: 6px; }
.archive-help-heading button:hover { background: #eff6ff; }
.archive-help-body { padding: 0 16px 16px; max-height: min(360px, 55vh); overflow-y: auto; }
.archive-help-body ol { list-style: decimal; padding-left: 20px; margin: 12px 0; }
.archive-help-body li + li { margin-top: 7px; }
.archive-help-note { font-size: 12px; color: #64748b; margin-top: 10px; }
#archive-help-button[aria-expanded="true"] { background: #e0f2fe; border-color: #0077c8; }
@keyframes archive-help-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .archive-help-popover { animation: none; } }
#archive-folder-sidebar { background: #f8fafc; border-right: 1px solid #e2e8f0; }
.archive-explorer-shell .archive-path { margin: 0; border-radius: 0; border-bottom: 1px solid #e2e8f0; padding: 12px 20px; background: #fff; }
.archive-tree-children { margin-left: 18px; padding-left: 5px; border-left: 1px solid #cbd5e1; font-size: 12px; }
.archive-folder-dialog { width: min(460px, calc(100% - 32px)); border: 1px solid #cbd5e1; border-radius: 16px; padding: 24px; color: #1e293b; box-shadow: 0 20px 70px #0f172a40; }
.archive-folder-dialog::backdrop { background: #0f172a80; backdrop-filter: blur(3px); }
.archive-folder-dialog h3 { font-weight: 800; font-size: 18px; margin-bottom: 8px; }
#archive-folder-location { font-size: 12px; color: #64748b; margin-bottom: 20px; }
.archive-folder-dialog label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.archive-folder-dialog input { width: 100%; padding: 10px 12px; border: 1px solid #94a3b8; border-radius: 8px; }
#archive-folder-error { min-height: 28px; color: #b91c1c; font-size: 12px; padding-top: 8px; }
.archive-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.archive-dialog-actions button { padding: 8px 18px; border-radius: 8px; border: 1px solid #cbd5e1; }
#archive-folder-submit { background: #0077c8; color: white; border-color: #0077c8; }
#archive-folder-submit:disabled { opacity: .5; }
#archive-explorer-layout { min-width: 0; height: clamp(560px, 65vh, 760px); --archive-heading-height: 52px; }
#archive-folder-sidebar { min-height: 0; }
.archive-folder-heading { box-sizing: border-box; border-bottom: 1px solid #cbd5e1; height: var(--archive-heading-height); flex-shrink: 0; padding: 12px 16px; }
.archive-file-scroll { min-height: 0; container-type: inline-size; }
.archive-list-footer { flex-shrink: 0; padding: 10px 16px; border-top: 1px solid #e2e8f0; background: #fff; }
.archive-list-footer:has(#archive-item-count:empty) { display: none; }
.archive-table thead th { box-sizing: border-box; position: sticky; top: 0; z-index: 10; background: #f8fafc; border-bottom: 1px solid #cbd5e1; height: var(--archive-heading-height); border-radius: 0; text-align: center; }
.archive-table th[hidden] { display: none; }
#archive-folder-sidebar:not(.invisible) { width: clamp(230px, 25vw, 380px); }
#archive-main-gallery-area { min-width: 0; padding: 0; }
.archive-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin-bottom: 16px; padding: 10px; background: #f1f5f9; border-radius: 8px; }
.archive-path button { color: #0369a1; }
.archive-name { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.archive-tree-row { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px; border-radius: 8px; text-align: left; }
.archive-tree-row:hover { background: #f1f5f9; }
.archive-tree-row[aria-current="page"] { background: #dbeafe; color: #075985; }
.archive-tree-row > button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; text-align: left; }
.archive-tree-row > .archive-tree-toggle { flex: 0 0 24px; justify-content: center; }
.archive-tree-files { margin-left: 22px; padding-left: 8px; border-left: 1px solid #cbd5e1; }
.archive-tree-file { display: flex; gap: 6px; align-items: flex-start; padding: 7px 4px; font-size: 11px; }
.archive-tree-file:hover { color: #0369a1; background: #eff6ff; }
.archive-table { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; }
.archive-table th, .archive-table td { vertical-align: middle; padding: 12px 8px; overflow-wrap: anywhere; }
.archive-table th:nth-child(2) { width: 72px; }
.archive-table th:nth-child(3) { width: clamp(100px, 12cqw, 200px); }
.archive-table th:nth-child(4) { width: clamp(160px, 20cqw, 300px); }
.archive-table th:nth-child(5) { width: 84px; }
.archive-file-name { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 8px; }
.archive-file-name > span:last-child:not(:first-child) { max-width: 100%; grid-column: 2; width: fit-content; }
.archive-folder-open { display: flex; gap: 8px; align-items: center; text-align: left; width: 100%; color: #0369a1; }
aside.collapsed nav a.bg-primary-container,
aside.collapsed nav a.sidebar-active { background-color: rgba(0, 119, 200, .5) !important; background-image: none !important; }
aside.collapsed nav a.bg-primary-container .material-symbols-outlined,
aside.collapsed nav a.sidebar-active .material-symbols-outlined { color: #073c63 !important; opacity: 1; }
@media (max-width: 1100px) {
    #archive-explorer-layout { flex-direction: column; min-height: 0 !important; height: auto; }
    #btn-archive-reopen-folders { align-self: auto; flex: 0 0 42px; min-height: 42px; width: 100%; align-items: center; padding-top: 0; border-right: 0; border-bottom: 1px solid #cbd5e1; }
    .archive-file-scroll { max-height: 60vh; min-height: 180px; flex-basis: auto; }
    #archive-folder-sidebar:not(.invisible) { width: 100%; max-height: 280px; }
    #archive-folder-sidebar.invisible { display: none; }
    #archive-main-gallery-area { width: 100%; }
    .archive-table th:nth-child(3), .archive-table td:nth-child(3),
    .archive-table th:nth-child(4), .archive-table td:nth-child(4) { display: none; }
    .archive-table th:nth-child(2) { width: 60px; }
    .archive-table th:nth-child(5) { width: 84px; }
    .archive-root-view .archive-table th:nth-child(3), .archive-root-view .archive-table td:nth-child(3),
    .archive-root-view .archive-table th:nth-child(4), .archive-root-view .archive-table td:nth-child(4) { display: table-cell; }
    .archive-root-view .archive-table th:nth-child(3) { width: 65px; }
    .archive-root-view .archive-table th:nth-child(4) { width: 70px; }
}
@media (max-width: 540px) {
    #archive-main-gallery-area { padding: 0; }
    .archive-list-footer { padding: 10px; }
    .archive-table th:nth-child(2), .archive-table td:nth-child(2) { display: none; }
    .archive-table th, .archive-table td { padding: 10px 4px; }
    .archive-root-view .archive-table th:nth-child(2), .archive-root-view .archive-table td:nth-child(2) { display: table-cell; }
    .archive-root-view .archive-table th:nth-child(2) { width: 55px; }
}
.archive-table tbody td { border-bottom: 1px solid #e2e8f0; }
.archive-upload-dialog { width: min(560px, calc(100% - 32px)); max-height: 90vh; overflow-y: auto; }
.archive-upload-label { display: block; font-size: 12px; color: #64748b; }
#archive-upload-location { font-size: 13px; margin: 4px 0 16px; color: #075985; }
#archive-drop-zone { display: block; width: 100%; min-height: 160px; }
.archive-upload-prompt { display: block; margin: 8px 0; font-size: 14px; font-weight: 700; }
#archive-upload-status { margin-top: 16px; font-size: 13px; color: #475569; }
#archive-upload-results { margin-top: 8px; max-height: 180px; overflow-y: auto; font-size: 12px; overflow-wrap: anywhere; }
#archive-upload-results li { padding: 6px 0; border-bottom: 1px solid #e2e8f0; }
.archive-upload-error { color: #b91c1c; }
.archive-upload-dialog button:disabled { opacity: .5; cursor: wait; }
