.key-photo-dialog {
  position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
  width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none;
  background: #070b09; color: #fff; overflow: hidden;
}
.key-photo-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.key-photo-dialog::backdrop { background: rgba(0,0,0,.95); }
.key-photo-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; z-index: 2;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid #29362f; background: #101813;
}
.key-photo-toolbar > span { margin-right: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.key-photo-dialog button, .key-photo-toolbar a {
  font: inherit; font-size: 13px; font-weight: 600; color: #fff;
  background: #1c2921; border: 1px solid #3a4e40; border-radius: 999px;
  padding: 10px 15px; cursor: pointer; text-decoration: none; min-height: 44px;
}
.key-photo-dialog button:focus-visible, .key-photo-toolbar a:focus-visible { outline: 2px solid #ffda4d; outline-offset: 3px; }
.key-photo-stage { position: relative; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 14px 64px max(14px, env(safe-area-inset-bottom)); touch-action: pan-y pinch-zoom; }
.key-photo-stage img { display: block; width: 100% !important; height: 100% !important; max-width: 100% !important; max-height: 100% !important; object-fit: contain !important; border-radius: 0; }
.key-photo-dialog.is-natural .key-photo-stage { display: block; overflow: auto; padding: 0; touch-action: auto; }
.key-photo-dialog.is-natural .key-photo-stage img { width: auto !important; height: auto !important; max-width: none !important; max-height: none !important; margin: 0 auto; }
.key-photo-dialog .key-photo-prev, .key-photo-dialog .key-photo-next { position: absolute; top: 52%; z-index: 2; width: 46px; height: 52px; padding: 0; font-size: 34px; background: rgba(18,31,23,.85); }
.key-photo-prev { left: 10px; } .key-photo-next { right: 10px; }
.key-photo-dialog button:disabled { opacity: .3; cursor: default; }
.key-photo-error { position: absolute; bottom: 20px; padding: 12px; background: #152219; border-radius: 12px; }
@media(max-width:620px) {
  .key-photo-toolbar { gap: 7px; padding-left: 10px; padding-right: 10px; }
  .key-photo-dialog button, .key-photo-toolbar a { font-size: 11px; padding: 9px 10px; }
  .key-photo-stage { padding-left: 0; padding-right: 0; }
  .key-photo-dialog .key-photo-prev, .key-photo-dialog .key-photo-next { width: 34px; height: 44px; }
  .key-photo-prev { left: 4px; } .key-photo-next { right: 4px; }
}
