/* A complete preview stays in the page; detailed inspection belongs in the viewer. */
.case-screen .screen-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: clamp(320px, 39vw, 560px);
  overflow: hidden;
  cursor: zoom-in;
}
.case-screen .screen-canvas > img {
  display: block;
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  height: auto;
  max-width: min(100%, var(--image-natural-width, 100%));
  max-height: 100%;
  object-fit: contain;
}
.case-screen .screen-portrait { height: clamp(420px, 42vw, 570px); padding: 32px; }
.case-screen .screen-portrait > img { height: 100%; width: auto; }
.case--givon .case-screen .screen-canvas { height: auto; padding: 32px; }
.case--givon .case-screen .screen-canvas > img { width: 100%; max-height: none; }
.case-screen .screen-canvas:focus-visible { outline: 2px solid var(--case-accent, #2556e8); outline-offset: 4px; }

html.image-viewer-open { overflow: hidden; }
.image-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: #f3f4ee;
  background: #111b19;
  overflow: hidden;
  overscroll-behavior: none;
  color-scheme: dark;
  font-family: var(--font);
}
.image-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: viewer-enter .28s var(--ease); }
.image-viewer::backdrop { background: #111b19; }
.image-viewer button { border: 0; background: none; color: inherit; font: inherit; padding: 0; cursor: pointer; touch-action: manipulation; }
.image-viewer button:focus-visible, .image-viewer [tabindex]:focus-visible { outline: 2px solid #d5ee81; outline-offset: -3px; }
.viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 25px 32px 22px; border-bottom: 1px solid #ffffff16; }
.viewer-heading { min-width: 0; }
.viewer-brand { color: #9fae9f; font: 9px/1.5 Arial, sans-serif; letter-spacing: 1.3px; margin: 0 0 7px; }
.viewer-heading h2 { color: #f3f4ee; font-size: 21px; line-height: 1.4; font-weight: 500; letter-spacing: -.5px; }
.viewer-controls { display: flex; align-items: center; flex: none; gap: 8px; }
.viewer-zoom { display: flex; align-items: center; border: 1px solid #ffffff24; border-radius: 4px; }
.viewer-zoom button { width: 36px; height: 36px; font: 23px Arial, sans-serif; }
.viewer-scale { font: 10px monospace; min-width: 47px; text-align: center; color: #d9e0d4; }
.image-viewer .viewer-size { height: 38px; padding-inline: 12px; font-size: 11px; border-radius: 4px; color: #bdc8bb; }
.image-viewer .viewer-size[aria-pressed="true"] { color: #d5ee81; background: #d5ee810b; }
.image-viewer .viewer-close { display: flex; align-items: center; justify-content: center; gap: 8px; padding-left: 20px; margin-left: 12px; height: 38px; border-left: 1px solid #ffffff24; font-size: 12px; }
.viewer-close > span:first-child { font: 30px/1 Arial, sans-serif; }
.viewer-body { min-height: 0; min-width: 0; position: relative; background: radial-gradient(ellipse at center, #26332b80, transparent 72%); }
.viewer-stage { height: 100%; width: 100%; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #718274 #19221e; }
.viewer-image-layout { display: flex; align-items: center; justify-content: center; }
.viewer-image { max-width: none; flex: none; display: block; user-select: none; -webkit-user-drag: none; object-fit: contain; box-shadow: 0 20px 70px #0003; }
.viewer-stage.can-pan { cursor: grab; }
.viewer-stage.is-dragging { cursor: grabbing; }
.image-viewer .viewer-direction { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 1px solid #c2d2b43d; border-radius: 50%; background: #15221deb; box-shadow: 0 4px 20px #0002; display: grid; place-items: center; font: 24px Arial, sans-serif; color: #e0edca; transition: background .2s, border-color .2s; }
.viewer-previous { left: 20px; }
.viewer-next { right: 20px; }
.viewer-message { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 12px; color: #c5cfbd; line-height: 1.8; }
.viewer-message > span { display: block; }
.image-viewer .viewer-message button { border-bottom: 1px solid #d5ee8170; font-size: 12px; margin-top: 15px; padding-bottom: 5px; color: #d5ee81; }
.viewer-footer { padding: 19px 32px 21px; padding-bottom: max(21px, env(safe-area-inset-bottom)); border-top: 1px solid #ffffff16; }
.viewer-caption { display: flex; align-items: baseline; gap: 20px; }
.viewer-counter { flex: none; font: 11px monospace; color: #d5ee81; letter-spacing: 1px; }
.viewer-caption p { margin: 0; font-size: 12px; color: #bac6b7; line-height: 1.7; }
.viewer-keyboard-hint { margin-left: auto; flex: none; font-size: 9px; letter-spacing: .3px; color: #82927f; }
.viewer-keyboard-hint i { font-style: normal; margin-inline: 10px; }
.viewer-thumbnails { display: flex; justify-content: safe center; gap: 10px; overflow: auto; margin-top: 17px; padding: 3px; scrollbar-width: thin; }
.viewer-thumbnails button { display: grid; place-items: center; width: 68px; height: 48px; flex: none; padding: 4px; border-radius: 3px; border: 1px solid #ffffff1c; background: #b3c3a90a; opacity: .55; transition: opacity .2s, border-color .2s, background .2s; }
.viewer-thumbnails button[aria-pressed="true"] { opacity: 1; border-color: #d5ee81; background: #b3c3a91a; }
.viewer-thumbnails img { width: 100%; height: 100%; max-height: 38px; object-fit: contain; }
@keyframes viewer-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (hover: hover) {
  .viewer-direction:hover, .viewer-zoom button:hover, .image-viewer .viewer-size:hover { background: #d5ee811a; }
  .viewer-thumbnails button:hover { opacity: 1; }
  .image-viewer .viewer-close:hover { color: #d5ee81; }
}
@media (max-width: 850px) {
  .viewer-header { padding: 20px; gap: 15px; }
  .viewer-heading h2 { font-size: 18px; }
  .viewer-brand { font-size: 8px; }
  .viewer-footer { padding: 16px 20px; }
  .viewer-keyboard-hint { display: none; }
  .viewer-caption p { font-size: 11px; }
}
@media (max-width: 600px) {
  .case-screen .screen-canvas:not(.screen-portrait) { height: auto; max-height: none; min-height: 0; padding: 16px; overflow: hidden; justify-content: center; }
  .case-screen .screen-canvas:not(.screen-portrait) > img { width: 100%; min-width: 0; height: auto; max-height: none; }
  .case-screen .screen-portrait { height: 440px; padding: 24px; }
  .viewer-header { position: relative; display: block; padding: max(17px, env(safe-area-inset-top)) 16px 12px; }
  .viewer-heading { padding-right: 55px; }
  .viewer-brand { font-size: 7px; letter-spacing: 1px; margin-bottom: 6px; }
  .viewer-heading h2 { font-size: 17px; }
  .viewer-controls { margin-top: 12px; gap: 7px; }
  .viewer-zoom button { width: 34px; height: 32px; font-size: 21px; }
  .viewer-scale { font-size: 9px; min-width: 41px; }
  .image-viewer .viewer-size { font-size: 10px; height: 34px; padding-inline: 10px; }
  .image-viewer .viewer-close { position: absolute; right: 16px; top: 17px; width: 38px; height: 38px; border: 1px solid #ffffff24; border-radius: 50%; padding: 0; margin: 0; }
  .viewer-close > span:last-child { display: none; }
  .viewer-footer { padding: 13px 16px max(14px, env(safe-area-inset-bottom)); }
  .viewer-caption { gap: 13px; }
  .viewer-counter { font-size: 9px; letter-spacing: .3px; }
  .viewer-caption p { font-size: 10px; }
  .viewer-thumbnails { margin-top: 10px; gap: 8px; }
  .viewer-thumbnails button { width: 56px; height: 40px; padding: 3px; }
  .viewer-thumbnails img { max-height: 32px; }
  .image-viewer .viewer-direction { width: 32px; height: 32px; font-size: 19px; }
  .viewer-previous { left: 8px; }
  .viewer-next { right: 8px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .viewer-header { display: flex; padding: 10px 16px; }
  .viewer-heading { padding: 0; }
  .viewer-heading h2 { font-size: 14px; }
  .viewer-brand { font-size: 6px; margin-bottom: 3px; }
  .viewer-controls { margin: 0; }
  .image-viewer .viewer-close { position: static; margin-left: 5px; }
  .viewer-footer { padding: 8px 16px; }
  .viewer-thumbnails { display: none; }
  .viewer-caption p { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .image-viewer[open] { animation: none; }
  .image-viewer * { transition: none !important; scroll-behavior: auto !important; }
}
