.gallery-dialog {
  width: 96vw;
  height: 96svh;
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #ffffff24;
  background: #0e131b;
  color: #f1f0eb;
  box-shadow: 0 25px 100px #0008;
}
.gallery-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.gallery-dialog::backdrop { background: #06090df2; backdrop-filter: blur(15px); }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; padding: 10px 24px; border-bottom: 1px solid #ffffff20; }
.gallery-identity { display: flex; align-items: center; gap: 30px; }
.gallery-brand { font-size: 9px; letter-spacing: .12em; }
.gallery-counter { font-size: 11px; color: #bdc4f1; font-variant-numeric: tabular-nums; }
.gallery-close { min-width: 80px; min-height: 44px; font-size: 10px; letter-spacing: .08em; }
.gallery-viewport { position: relative; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; user-select: none; background: radial-gradient(ellipse at center, #1b2230 0, #0e131b 75%); }
.gallery-image { position: absolute; top: 50%; left: 50%; display: block; max-width: none; max-height: none; object-fit: contain; transform-origin: center; will-change: transform; user-select: none; -webkit-user-drag: none; }
.gallery-can-pan { cursor: grab; }
.gallery-is-panning { cursor: grabbing; }
.gallery-message { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 30px; }
.gallery-status { max-width: 440px; font-size: 13px; line-height: 1.8; color: #b5bdcc; text-align: center; }
.gallery-retry { padding: 12px 20px; min-height: 44px; font-size: 12px; border: 1px solid #bdc4f160; }
.gallery-footer { padding: 16px 24px 12px; border-top: 1px solid #ffffff20; background: #111720; }
.gallery-caption { max-width: 100%; overflow-wrap: anywhere; font-size: 12px; color: #d4dae4; line-height: 1.6; }
.gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 10px; }
.gallery-navigation, .gallery-zoom-controls { display: flex; align-items: center; gap: 4px; }
.gallery-navigation { gap: 8px; }
.gallery-control { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid #ffffff30; font-size: 23px; line-height: 1; transition: background .2s, border-color .2s; }
.gallery-control:hover:not(:disabled) { background: #bdc4f120; border-color: #bdc4f1; }
.gallery-control:disabled, .gallery-fit:disabled { opacity: .3; cursor: default; }
.gallery-zoom-value { display: inline-block; min-width: 64px; text-align: center; font-size: 11px; color: #bdc4f1; font-variant-numeric: tabular-nums; }
.gallery-fit { min-height: 44px; padding: 0 14px; font-size: 10px; }
.gallery-original { display: flex; align-items: center; min-height: 44px; padding: 0 4px; font-size: 10px; white-space: nowrap; color: #c4cbee; }
.gallery-hint { margin-top: 8px; font-size: 11px; letter-spacing: .01em; line-height: 1.6; color: #a7b2c4; }
.gallery-dialog button:focus-visible, .gallery-dialog a:focus-visible { outline: 2px solid #bdc4f1; outline-offset: 3px; }
@media (max-width: 760px) {
  .gallery-toolbar { min-height: 62px; padding: 8px 14px; gap: 12px; }
  .gallery-identity { align-items: flex-start; flex-direction: column; gap: 6px; }
  .gallery-brand { font-size: 7px; }
  .gallery-counter { font-size: 10px; }
  .gallery-close { min-width: 64px; font-size: 9px; }
  .gallery-footer { padding: 12px 12px 10px; }
  .gallery-caption { font-size: 10px; }
  .gallery-controls { flex-wrap: wrap; gap: 8px 10px; margin-top: 8px; }
  .gallery-navigation { order: 1; gap: 6px; }
  .gallery-original { order: 2; margin-left: auto; font-size: 9px; }
  .gallery-zoom-controls { order: 3; justify-content: center; width: 100%; border-top: 1px solid #ffffff15; padding-top: 6px; }
  .gallery-fit { padding: 0 10px; }
  .gallery-zoom-value { min-width: 56px; }
  .gallery-hint { display: none; }
  .gallery-status { font-size: 12px; }
}
@media (max-height: 520px) and (min-width: 600px) {
  .gallery-toolbar { min-height: 50px; padding-top: 3px; padding-bottom: 3px; }
  .gallery-footer { padding-top: 8px; padding-bottom: 8px; }
  .gallery-controls { margin-top: 3px; }
  .gallery-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-dialog *, .gallery-dialog *::before, .gallery-dialog *::after { animation: none !important; transition: none !important; }
}
