.lx-gallery-trigger { display: inline-flex; flex: 0 0 36px; align-items: center; justify-content: center; border-radius: 10px; cursor: zoom-in; }
.lx-gallery-trigger:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 3px; }
.lx-gallery-trigger:hover .list-item-thumb { border-color: var(--blue-bright); }
.lx-gallery {
  width: min(800px, calc(100vw - 24px));
  height: min(860px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.38);
  overflow: hidden;
}
.lx-gallery[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lx-gallery::backdrop { background: rgb(3 9 20 / 0.82); }
.lx-gallery-bar { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.lx-gallery-heading { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; min-width: 0; }
.lx-gallery-heading strong { font-size: 1.2rem; overflow-wrap: anywhere; }
.lx-gallery-heading span { color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.lx-gallery-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.lx-gallery-media { display: flex; align-items: center; justify-content: center; height: clamp(220px, 40dvh, 380px); padding: 16px; background: var(--bg); touch-action: pan-y; }
.lx-gallery-media img { width: 100%; height: 100%; object-fit: contain; }
.lx-gallery-details { padding: 20px; border-top: 1px solid var(--line); }
.lx-gallery-description { margin: 0 0 18px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.lx-gallery-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; margin: 0; }
.lx-gallery-stats > div { min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lx-gallery-stats dt { margin: 0 0 5px; color: var(--muted); font-size: .8rem; line-height: 1.35; overflow-wrap: anywhere; }
.lx-gallery-stats dd { margin: 0; font-size: 1rem; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.lx-gallery-stats .is-number dd { font-variant-numeric: tabular-nums; }
.lx-gallery-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.lx-gallery-close, .lx-gallery-controls button, .lx-gallery-table { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-deep); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.lx-gallery-close { flex: 0 0 44px; width: 44px; padding: 0; font-size: 1.5rem; line-height: 1; }
.lx-gallery-controls button:disabled { opacity: .45; cursor: default; }
.lx-gallery-close:hover, .lx-gallery-controls button:not(:disabled):hover, .lx-gallery-table:hover { border-color: var(--blue-bright); }
.lx-gallery-close:focus-visible, .lx-gallery-controls button:focus-visible, .lx-gallery-table:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 2px; }
.lx-gallery-details[hidden], .lx-gallery-description[hidden], .lx-gallery-stats[hidden] { display: none; }
@media (min-width: 800px) {
  .lx-gallery-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .lx-gallery { width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .lx-gallery-bar { padding: 10px 12px; }
  .lx-gallery-media { height: clamp(190px, 36dvh, 320px); padding: 12px; }
  .lx-gallery-details { padding: 16px; }
  .lx-gallery-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .lx-gallery-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 12px; gap: 8px; }
  .lx-gallery-table { grid-column: 1 / -1; grid-row: 2; }
  .lx-gallery-controls [data-lx-gallery-next] { grid-column: 2; grid-row: 1; }
}
