/* Shared public viewer: institution, document title and accessible actions. */
.portal-document-preview-modal .portal-document-preview-header { display:flex; align-items:center; flex-wrap:nowrap; gap:.85rem; padding:.8rem 1rem; background:#fff; }
.portal-document-preview-brand { display:flex; flex:0 0 112px; align-items:center; justify-content:flex-start; min-width:0; }
.portal-document-preview-brand img { display:block; width:112px; height:48px; object-fit:contain; object-position:left center; }
.portal-document-preview-brand span { color:var(--portal-dark,#17324d); font-weight:700; font-size:.9rem; }
.portal-document-preview-modal .portal-document-preview-header-main { min-width:0; gap:0; }
.portal-document-preview-modal .portal-document-preview-title { margin:0; font-size:clamp(.95rem,1.4vw,1.2rem); line-height:1.3; font-weight:700; overflow-wrap:anywhere; }
.portal-document-preview-modal .portal-document-preview-header-actions { width:auto; flex:none; margin:0 0 0 auto; padding:0; gap:.45rem; align-items:center; flex-wrap:nowrap; }
.portal-document-preview-modal .portal-document-preview-header-actions a.portal-document-preview-action { position:relative; display:inline-flex; align-items:center; justify-content:center; flex:none; width:44px; height:44px; min-height:44px; padding:0; border:1px solid #d2dce6; border-radius:.5rem; background:#fff; color:var(--portal-dark,#17324d); }
.portal-document-preview-header-actions a.portal-document-preview-action[hidden] { display:none !important; }
.portal-document-preview-header-actions a.portal-document-preview-action i { font-size:1.2rem; }
.portal-document-preview-header-actions a.portal-document-preview-action:hover { background:#edf3f8; }
.portal-document-preview-header-actions a.portal-document-preview-action:focus-visible { outline:3px solid var(--portal-primary,#0056a6); outline-offset:2px; }
.portal-document-preview-modal .portal-document-preview-header > .btn-close { flex:none; width:44px; height:44px; min-width:44px; margin:0; padding:0; background-size:14px; }
.portal-viewer-tooltip { position:absolute; z-index:5; top:calc(100% + 7px); right:0; width:max-content; max-width:180px; padding:.4rem .6rem; border-radius:.3rem; background:#17324d; color:#fff; font-size:.75rem; font-weight:500; line-height:1.3; opacity:0; visibility:hidden; pointer-events:none; }
.portal-document-preview-action:hover > .portal-viewer-tooltip,.portal-document-preview-action:focus-visible > .portal-viewer-tooltip { opacity:1; visibility:visible; }
/* Keep the public tools together beside the fixed Libras control. */
.portal-floating-sidebar { top:0; right:max(var(--portal-floating-right,16px),env(safe-area-inset-right)); bottom:auto; align-items:flex-start; gap:.7rem; z-index:1045; }
.portal-client-layout-body .portal-floating-sidebar { bottom:auto; }
.portal-floating-sidebar .portal-floating-buttons { gap:.65rem; align-items:flex-end; }
.portal-floating-sidebar .portal-floating-button { position:fixed; right:max(var(--portal-floating-right,16px),env(safe-area-inset-right)); min-width:44px; min-height:44px; width:44px; height:44px; flex-shrink:0; }
.portal-floating-sidebar .portal-floating-button--expandable { --floating-button-size:44px; width:auto; }
.portal-floating-sidebar .portal-floating-button.is-shortcut-ouvidoria { background:#c24b0a; border-color:transparent; color:#fff; }
.portal-floating-sidebar .portal-floating-button.is-shortcut-ouvidoria:hover,.portal-floating-sidebar .portal-floating-button.is-shortcut-ouvidoria:focus-visible { background:#a43d05; color:#fff; }
.portal-floating-sidebar .portal-floating-button-label { transition:max-width .5s ease,padding .5s ease,opacity .5s ease,transform .5s ease; }
.portal-floating-sidebar .portal-floating-panel { position:fixed; top:16px; right:calc(var(--portal-floating-right,16px) + 60px); width:min(22rem,calc(100vw - var(--portal-floating-right,16px) - 76px)); max-height:calc(100dvh - 32px); overflow:auto; }
@media(max-width:575.98px) {
    .portal-document-preview-modal .portal-document-preview-header { gap:.4rem; padding:.65rem .75rem; }
    .portal-document-preview-brand { flex-basis:68px; }
    .portal-document-preview-brand img { width:68px; height:40px; }
    .portal-document-preview-modal .portal-document-preview-header-actions { gap:.3rem; }
    .portal-document-preview-modal .portal-document-preview-header > .btn-close { width:44px; min-width:44px; }
    .portal-floating-sidebar { right:max(var(--portal-floating-right,16px),env(safe-area-inset-right)); }
}
@media(max-width:359.98px) {
    .portal-document-preview-brand { flex-basis:48px; }
    .portal-document-preview-brand img { width:48px; }
    .portal-document-preview-modal .portal-document-preview-title { font-size:.85rem; }
}
@media(prefers-reduced-motion:reduce) { .portal-floating-sidebar .portal-floating-button-label { transition:none; } }

/* e-SIC: yellow information speech bubble, original PNG from the gov.br page supplied by the user. */
.portal-floating-sidebar .portal-floating-button.is-shortcut-esic { background:#ffcc00; border-color:transparent; color:#005b32; }
.portal-floating-sidebar .portal-floating-button.is-shortcut-esic:hover,.portal-floating-sidebar .portal-floating-button.is-shortcut-esic:focus-visible { background:#f4c300; color:#005b32; }
.portal-floating-sidebar .is-shortcut-esic > .bi { display:inline-flex; align-items:center; justify-content:center; }
.portal-floating-sidebar .is-shortcut-esic > .bi::before { content:""; display:block; width:27px; height:27px; background:center / contain no-repeat url("../img/esic-acesso-informacao.png"); }

/* Font Awesome Free: original solid SVG, no raster or shadow effects. */
.portal-floating-sidebar .is-accessibility > .bi { display:inline-flex; align-items:center; justify-content:center; filter:none; }
.portal-floating-sidebar .is-accessibility > .bi::before { content:""; display:block; width:26px; height:26px; background-color:#fff; opacity:1; filter:none; -webkit-mask:url("../img/accessibility-wheelchair.svg") center / contain no-repeat; mask:url("../img/accessibility-wheelchair.svg") center / contain no-repeat; mask-mode:alpha; }

/* Keep Calendar visible with the other sidebar controls while dialogs are open. */
body:has(.modal.show) .portal-floating-sidebar .portal-global-calendar-button { visibility:visible; }
