.case-viewer-open { overflow: hidden; }
.case-viewer { width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); box-sizing: border-box; border: 0; background: #191e1b; color: #f7f5ed; }
.case-viewer::backdrop { background: #191e1b; }
.case-viewer:not([open]) { display: none; }
.case-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.case-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.case-viewer-header h2 { margin: 0; font-size: clamp(14px, 2vw, 22px); line-height: 1.6; }
.case-viewer button { min-width: 48px; min-height: 48px; padding: 10px 16px; border: 1px solid #b09b65; background: transparent; color: #f7f5ed; font: inherit; cursor: pointer; }
.case-viewer button:focus-visible, .case-viewer a:focus-visible { outline: 3px solid #d4bc7b; outline-offset: 3px; }
.case-viewer button:disabled { opacity: .3; cursor: default; }
.case-viewer-stage { min-height: 0; display: grid; place-items: center; position: relative; }
.case-viewer-photo { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.case-viewer-footer { width: min(100%, 960px); margin-inline: auto; }
.case-viewer-caption { margin: 0 0 10px; font-size: clamp(14px, 2vw, 18px); line-height: 1.6; text-align: center; }
.case-viewer-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.case-viewer-controls button { background: #b09b65; color: #191e1b; }
.case-viewer-count { min-width: 60px; text-align: center; font-variant-numeric: tabular-nums; }
.case-viewer-original { display: block; width: fit-content; margin: 10px auto 0; font-size: 13px; color: #f7f5ed; }
.case-viewer-error { position: absolute; padding: 16px; background: #191e1b; }
@media (max-height: 500px) { .case-viewer { gap: 4px; padding: 6px 16px; } .case-viewer-caption { margin-bottom: 4px; } .case-viewer-original { margin-top: 2px; } }
