/* Inherit Hacom's operational palette, system font, native controls and spacing. */
.drive-external-section { border-top: 1px solid var(--border); }
.drive-external-section[hidden], [hidden].external-warning { display: none; }
.drive-external-section [hidden] { display: none !important; }
.drive-external-section h3 { font-size: 18px; margin: 0 0 8px; }
.external-help { color: #475569; font-size: 14px; line-height: 1.6; margin: 8px 0 16px; }
.external-warning { color: #92400e; background: #fffbeb; padding: 12px; border-radius: 8px; font-size: 14px; line-height: 1.6; }
.drive-external-section label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.drive-external-section input, .drive-external-section select, .drive-external-section textarea {
    display: block; width: 100%; min-height: 44px; border: 1px solid #94a3b8; border-radius: 8px;
    padding: 10px 12px; color: #0f172a; background: white; font: inherit; font-size: 14px; box-sizing: border-box;
}
.drive-external-section textarea { resize: vertical; }
.drive-external-section button { min-height: 44px; margin-top: 12px; }
.drive-external-section :focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.external-grant { padding: 14px 0; border-top: 1px solid #e2e8f0; overflow-wrap: anywhere; }
.external-grant strong, .external-grant small { display: block; }
.external-grant small, #drive-external-status { font-size: 14px; color: #475569; line-height: 1.6; }
.external-grant button + button { margin-left: 8px; }
.external-activity { padding-left: 20px; font-size: 14px; line-height: 1.7; }
.external-guest { margin: 0; background: #e9edf2; color: #0f172a; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.external-guest *, .external-guest *::before, .external-guest *::after { box-sizing: border-box; }
.external-guest [hidden] { display: none !important; }
.external-guest ::selection { background: #dbeafe; }
.external-guest :focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.external-guest-header { height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: white; border-bottom: 1px solid #d1d9e4; position: sticky; top: 0; z-index: 3; }
.external-guest-header img { width: 96px; height: auto; flex-shrink: 0; }
.external-guest-header h1 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external-permission { font-size: 12px; padding: 3px 8px; background: #f1f5f9; color: #475569; white-space: nowrap; border-radius: 4px; }
.external-info { position: relative; flex-shrink: 0; }
.external-info summary { cursor: pointer; padding: 10px 4px; color: #334155; }
.external-info > div { position: absolute; top: 44px; right: 0; width: min(340px, calc(100vw - 32px)); padding: 12px 16px; background: white; box-shadow: 0 6px 20px #0f172a26; border-radius: 8px; }
.external-info p { overflow-wrap: anywhere; color: #475569; margin: 8px 0; }
.external-guest-main { min-height: calc(100dvh - 56px); }
.external-guest button { min-height: 40px; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: white; color: #0f172a; font: inherit; }
.external-guest button { cursor: pointer; }
.external-guest button:hover { background: #f1f5f9; }
.external-guest button:disabled { cursor: default; color: #64748b; background: #f8fafc; }
.external-guest #external-status { margin: 0; padding: 32px 24px 12px; max-width: 70ch; color: #334155; }
.external-guest #external-retry { margin: 0 24px; }
.external-paper { overflow: auto; padding: 24px 24px 84px; height: calc(100dvh - 56px); box-sizing: border-box; scrollbar-color: #94a3b8 #e9edf2; overflow-anchor: none; }
#external-preview { position: relative; }
.external-zoom-controls { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; padding: 4px; background: white; border-radius: 8px; box-shadow: 0 3px 14px #0f172a33; }
.external-guest .external-zoom-controls button { border: 0; min-width: 40px; padding: 8px; }
.external-zoom-controls svg { display: block; width: 18px; height: 18px; }
.external-guest #external-zoom-reset { min-width: 56px; font-variant-numeric: tabular-nums; }
#external-pages { margin: 0 auto; }
.external-document-page { position: relative; width: 100%; margin-bottom: 24px; background: white; box-shadow: 0 3px 12px #0f172a1f; }
.external-guest canvas { display: block; width: 100%; max-width: none; height: auto; margin: 0 auto; background: white; box-shadow: 0 3px 12px #0f172a1f; }
.external-guest canvas { box-shadow: none; }
.external-guest canvas[width="0"] { visibility: hidden; }
.external-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.external-guest #external-image { display: block; max-width: calc(100% - 48px); height: auto; margin: 24px auto; }
.drive-external-section { padding-top: 20px; }
.external-folder-navigation { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 20px; background: #f8fafc; border-bottom: 1px solid #d1d9e4; }
.external-folder-navigation span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external-folder-navigation button { flex-shrink: 0; white-space: nowrap; }
.external-folder { max-width: 1000px; padding: 16px 24px; margin: 0 auto; }
.external-folder p { color: #475569; }
.external-folder ul { list-style: none; margin: 16px 0; padding: 0; background: white; }
.external-folder li { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid #d1d9e4; }
.external-folder li span { color: #475569; font-size: 14px; flex-shrink: 0; }
.external-guest .external-folder-open { flex: 1; min-width: 0; border: 0; text-align: left; overflow-wrap: anywhere; font-size: 16px; color: #1d4ed8; }
.external-in-folder .external-paper { height: calc(100dvh - 109px); }
@media (max-width: 600px) {
    .external-guest-header { gap: 8px; padding: 0 12px; }
    .external-guest-header img { width: 64px; }
    .external-guest-header h1 { font-size: 14px; }
    .external-permission { display: none; }
    .external-guest button { min-height: 44px; padding: 8px; }
    .external-info summary { padding: 12px 4px; }
    .external-paper { padding: 12px 12px 84px; }
    .external-folder { padding: 12px; }
    .external-folder li { flex-direction: column; align-items: stretch; gap: 2px; }
    .external-guest-header #external-download { font-size: 14px; padding: 8px; }
}
