html.portal-image-viewer-open { overflow: hidden; }
.portal-image-viewer { position: fixed; inset: 0; width: min(1500px, 94vw); max-width: 94vw; max-height: 92vh; max-height: 92dvh; margin: auto; padding: 0; border: 1px solid #d9d5cd; border-radius: 10px; background: #fffdf9; color: #242d36; box-shadow: 0 24px 80px #0006; }
.portal-image-viewer[open] { display: flex; flex-direction: column; }
.portal-image-viewer::backdrop { background: #101923cc; }
.portal-image-viewer__header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #d9d5cd; flex-shrink: 0; }
.portal-image-viewer__header h2 { font-size: 17px; line-height: 1.4; letter-spacing: 0; }
.portal-image-viewer__actions { display: flex; gap: 10px; }
.portal-image-viewer__actions button { min-height: 44px; padding: 8px 14px; border: 1px solid #b8bbb9; border-radius: 5px; background: #fff; color: #242d36; cursor: pointer; font: inherit; font-size: 14px; }
.portal-image-viewer__actions button:hover { background: #eae7e0; }
.portal-image-viewer button:focus-visible, .portal-image-viewer__stage:focus-visible { outline: 3px solid #a83c2e; outline-offset: -3px; }
.portal-image-viewer__stage { overflow: auto; overscroll-behavior: contain; min-height: 0; padding: 12px; background: #eae7e0; }
.portal-image-viewer__stage img { display: block; width: auto; height: auto; max-width: 100%; max-height: 72vh; max-height: 72dvh; margin: 0 auto; object-fit: contain; }
.portal-image-viewer--actual-size .portal-image-viewer__stage img { max-width: none; max-height: none; margin: 0; }
.portal-image-viewer .portal-image-viewer__error { padding: 12px 18px; color: #963326; }
@media (max-width: 680px) {
    .portal-image-viewer__header { padding: 10px 12px; }
    .portal-image-viewer__header h2 { font-size: 15px; }
    .portal-image-viewer__stage { padding: 6px; }
}


.fx-portal-preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.fx-portal-preview-card { margin: 0; min-width: 0; border: 1px solid #d9d5cd; border-radius: 8px; overflow: hidden; background: #fffdf9; }
.fx-portal-preview-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; }
.fx-portal-preview-image { display: block; padding: 12px; background: #eae7e0; }
.fx-portal-preview-image img { display: block; width: 100%; height: auto; }
.fx-portal-preview-card figcaption { padding: 24px; }
.fx-portal-preview-card figcaption span, .fx-portal-preview-note { font-size: 13px; }
.fx-portal-preview-note { margin-top: 16px; }
@media (max-width: 768px) { .fx-portal-preview-grid, .fx-portal-preview-card:first-child { grid-template-columns: minmax(0, 1fr); } }
