#documents-view {
    color: var(--panel-ink);
    min-width: 0;
    font-size: 13px;
    letter-spacing: 0;
}
#documents-view [hidden] { display: none !important; }
#documents-view .drive-heading,
#documents-view .drive-toolbar,
#documents-view .drive-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
#documents-view .drive-heading,
#documents-view .drive-toolbar { justify-content: space-between; }
#documents-view .drive-heading { margin-bottom: 22px; }
#documents-view h2 { margin: 0; font-size: 24px; font-weight: 600; }
#documents-view h3 { font-size: 17px; font-weight: 600; }
#drive-account { color: var(--panel-muted); font-size: 12px; overflow-wrap: anywhere; }
#documents-view .drive-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--panel-line);
    border-radius: 6px;
    background: var(--panel-surface-strong);
    color: var(--panel-ink);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
#documents-view .drive-button:hover { background: var(--panel-bg-soft); }
#documents-view .drive-primary,
#documents-view .drive-primary:hover { background: #FF2E12; border-color: #FF2E12; color: #fff; }
#documents-view button:disabled { opacity: .45; cursor: default; }
#documents-view .drive-icon { padding: 0; width: 36px; min-width: 36px; height: 36px; min-height: 36px; }
#documents-view input:not([type="file"]) {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    background: var(--panel-surface-strong) !important;
    color: var(--panel-ink) !important;
    border: 1px solid var(--panel-line) !important;
    border-radius: 6px;
    font: inherit;
    font-size: 12px;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
#documents-view input:focus-visible,
#documents-view button:focus-visible,
#documents-view a:focus-visible { outline: 2px solid #FF2E12; outline-offset: 3px; }
#documents-view input::placeholder { color: var(--panel-muted); }
#documents-view .drive-search { position: relative; width: 210px; }
#documents-view .drive-search i { position: absolute; left: 12px; top: 13px; color: var(--panel-muted); }
#documents-view .drive-search input { padding-left: 34px; }
#documents-view .drive-toolbar { padding-bottom: 16px; gap: 16px; }
#drive-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
#drive-breadcrumb button { color: var(--panel-ink); padding: 4px; overflow-wrap: anywhere; text-align: left; }
#drive-breadcrumb button:last-child { color: #FF2E12; font-weight: 600; }
#drive-breadcrumb span { color: var(--panel-muted); }
#documents-view .drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; align-items: start; }
#documents-view .drive-card { min-width: 0; overflow: hidden; background: var(--panel-surface-strong); border: 1px solid var(--panel-line); border-radius: 8px; }
#documents-view .drive-card:hover { border-color: #FF2E12; }
#documents-view .drive-card-open { display: block; width: 100%; padding: 0; text-align: left; color: var(--panel-ink); }
#documents-view .drive-thumbnail { display: flex; position: relative; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--panel-bg-soft); border-bottom: 1px solid var(--panel-line); }
#documents-view .drive-thumbnail > i { font-size: 44px; color: #FF2E12; }
#documents-view .drive-thumbnail > .fa-folder { color: #d99915; }
#documents-view .drive-thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--panel-bg-soft); }
#documents-view .drive-file-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; height: 48px; padding: 12px 12px 0; line-height: 18px; font-size: 12px; font-weight: 600; text-transform: none !important; }
#documents-view .drive-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px 12px; }
#documents-view .drive-file-actions { display: flex; margin-left: auto; gap: 4px; }
#documents-view .drive-meta { display: flex; flex-direction: column; gap: 3px; font-size: 11px; line-height: 16px; color: var(--panel-muted); }
#documents-view .drive-file-actions .drive-icon { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
#documents-view .drive-empty { grid-column: 1 / -1; text-align: center; padding: 52px 20px !important; color: var(--panel-muted); }
#documents-view .drive-empty > i { display: block; font-size: 26px; margin-bottom: 14px; }
#drive-message { padding: 12px 15px; margin-bottom: 16px; border-left: 3px solid #FF2E12; background: var(--panel-surface-strong); overflow-wrap: anywhere; }
#drive-message[data-error="true"] { color: #dc2626; }
#drive-setup-message[data-error="true"] { color: #dc2626; }
#drive-progress { margin: 4px 0 20px; }
#drive-progress-label { display: block; margin-bottom: 8px; font-size: 12px; overflow-wrap: anywhere; }
#drive-progress-bar { width: 100%; height: 7px; accent-color: #FF2E12; }
#drive-dialog { width: min(440px, calc(100vw - 32px)); margin: auto; border: 1px solid var(--panel-line); border-radius: 8px; padding: 24px; background: var(--panel-surface-strong); color: var(--panel-ink); }
#drive-dialog::backdrop { background: rgba(0, 0, 0, .5); }
#drive-dialog p { color: var(--panel-muted); margin: 10px 0; font-size: 12px; overflow-wrap: anywhere; }
#drive-dialog #drive-dialog-error { color: #dc2626; }
#drive-dialog .drive-controls { justify-content: flex-end; margin-top: 20px; }
#drive-preview { width: min(1120px, calc(100vw - 32px)); height: min(840px, calc(100dvh - 40px)); max-width: none; max-height: none; margin: auto; padding: 0; border: 1px solid var(--panel-line); border-radius: 8px; background: var(--panel-surface-strong); color: var(--panel-ink); }
#drive-preview[open] { display: flex; flex-direction: column; }
#drive-preview::backdrop { background: rgba(0, 0, 0, .75); }
#drive-preview .drive-preview-toolbar { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 12px; border-bottom: 1px solid var(--panel-line); }
#drive-preview-title { flex: 1; min-width: 0; margin: 0 !important; font-size: 13px !important; line-height: 20px; overflow-wrap: anywhere; text-transform: none !important; }
#drive-preview-content { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; overflow: auto; background: var(--panel-bg-soft); }
#drive-preview-content img { width: 100%; height: 100%; object-fit: contain; }
#drive-preview-content .drive-preview-full { position: absolute; inset: 0; }
#drive-preview-content iframe { width: 100%; height: 100%; border: 0; }
#drive-preview-content > i { font-size: 64px; color: var(--panel-muted); }
#drive-preview-status { margin: 0; padding: 8px 12px; min-height: 32px; font-size: 12px; color: var(--panel-muted); }
@media (max-width: 767px) {
    #documents-view { padding: 18px 12px; }
    #documents-view h2 { font-size: 20px; }
    #documents-view .drive-heading { align-items: flex-start; gap: 14px; }
    #documents-view .drive-search { flex: 1 1 100%; width: 100%; }
    #documents-view .drive-toolbar > .drive-controls { width: 100%; }
    #documents-view .drive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #documents-view .drive-card-footer { padding: 8px; gap: 6px; }
    #documents-view .drive-meta { flex-basis: 100%; flex-direction: row; justify-content: space-between; font-size: 10px; }
    #documents-view .drive-file-name { padding: 10px 8px 0; }
    #documents-view .drive-file-actions { width: 100%; justify-content: flex-end; }
    #drive-preview { width: calc(100vw - 16px); height: calc(100dvh - 24px); }
}
