.nb-gallery {
  --gallery-paper: var(--paper, #f5f5f0);
  --gallery-ink: var(--ink, #20221f);
  --gallery-acid: var(--acid, #d2fc53);
  width: min(1240px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--gallery-paper);
  color: var(--gallery-ink);
  box-shadow: 0 32px 100px #0003;
  overflow: auto;
  overscroll-behavior: contain;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.nb-gallery::backdrop {
  background: rgb(24 27 24 / 68%);
  backdrop-filter: blur(7px);
}

.nb-gallery *,
.nb-gallery *::before,
.nb-gallery *::after { box-sizing: border-box; }
.nb-gallery button,
.nb-gallery a { -webkit-tap-highlight-color: transparent; }
.nb-gallery button { font: inherit; }
.nb-gallery button:focus-visible,
.nb-gallery a:focus-visible,
.nb-gallery [tabindex]:focus-visible {
  outline: 2px solid var(--gallery-ink);
  outline-offset: 4px;
}
.nb-gallery__shell { padding: 26px 32px 18px; }
.nb-gallery__header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.nb-gallery__heading { flex: 1; min-width: 0; }
.nb-gallery__category {
  margin: 0 0 7px;
  color: #60615b;
  font-size: 12px;
  line-height: 1.35;
}
.nb-gallery__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.nb-gallery__count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #60615b;
}
.nb-gallery__icon-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 11px;
  border: 1px solid #c5c6be;
  border-radius: 50%;
  background: transparent;
  color: var(--gallery-ink);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.nb-gallery__icon-button svg { width: 24px; height: 24px; }
.nb-gallery__icon-button:disabled { opacity: 0.3; cursor: default; }
.nb-gallery__stage { min-width: 0; touch-action: pan-y pinch-zoom; }
.nb-gallery__figure { margin: 0; }
.nb-gallery__viewport {
  display: flex;
  justify-content: center;
  align-items: center;
  height: min(54vh, 590px);
  height: min(54svh, 590px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 6px;
  background: #e8e9e2;
  scrollbar-width: thin;
}
.nb-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  user-select: none;
}
.nb-gallery__viewport--portrait { align-items: flex-start; }
.nb-gallery__viewport--portrait .nb-gallery__image {
  width: min(100%, 620px);
  height: auto;
  max-height: none;
  flex: 0 0 auto;
}
.nb-gallery__caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px 32px;
  padding: 20px 0 18px;
  font-size: 13px;
  line-height: 1.5;
}
.nb-gallery__caption strong {
  max-width: 42%;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.025em;
}
.nb-gallery__caption span { max-width: 57%; color: #60615b; }
.nb-gallery__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #d5d6ce;
  padding-top: 14px;
}
.nb-gallery__hint { flex: 1; margin: 0; font-size: 12px; color: #60615b; }
.nb-gallery__dots { display: flex; justify-content: center; }
.nb-gallery__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.nb-gallery__dot span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b3b5aa;
  transition: background-color 150ms ease, transform 150ms ease;
}
.nb-gallery__dot[aria-current="true"] span {
  background: var(--gallery-ink);
  transform: scale(1.3);
}
.nb-gallery__arrows { display: flex; flex: 1; justify-content: flex-end; gap: 9px; }
.nb-gallery__end {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: min(54vh, 590px);
  min-height: min(54svh, 590px);
  margin-bottom: 22px;
  padding: 36px 24px;
  border-radius: 6px;
  background: var(--gallery-acid);
  text-align: center;
}
.nb-gallery__end-label { margin-bottom: 18px; font-size: 12px; }
.nb-gallery__end h3 {
  margin: 0;
  font-size: clamp(36px, 5.3vw, 68px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: -0.065em;
}
.nb-gallery__end p { max-width: 470px; margin: 20px 0 24px; font-size: 15px; line-height: 1.5; }
.nb-gallery__visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 50px;
  padding: 12px 21px;
  border: 1px solid var(--gallery-ink);
  border-radius: 999px;
  background: var(--gallery-ink);
  color: var(--gallery-paper);
  font-size: 14px;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease;
}
.nb-gallery__visit svg { width: 21px; height: 21px; }
.nb-gallery__domain { max-width: 100%; margin-top: 15px; font-size: 11px; overflow-wrap: anywhere; }
.nb-gallery__end--development { background: #e6e8de; }
.nb-gallery__development-note { font-size: 12px; color: #60615b; }
.nb-gallery__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (hover: hover) {
  .nb-gallery__icon-button:hover:not(:disabled) { border-color: var(--gallery-acid); background: var(--gallery-acid); }
  .nb-gallery__dot:hover span { background: var(--gallery-ink); }
  .nb-gallery__visit:hover { color: var(--gallery-ink); background: transparent; }
}
@media (max-width: 640px) {
  .nb-gallery {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 10px;
  }
  .nb-gallery__shell { padding: 18px 16px 12px; }
  .nb-gallery__header { align-items: flex-start; gap: 10px; margin-bottom: 18px; }
  .nb-gallery__category { max-width: 220px; font-size: 10px; }
  .nb-gallery__title { font-size: 26px; }
  .nb-gallery__count { align-self: center; font-size: 10px; }
  .nb-gallery__icon-button { width: 44px; height: 44px; padding: 10px; }
  .nb-gallery__close { margin-top: 0; }
  .nb-gallery__viewport { height: min(48vh, 440px); height: min(48svh, 440px); }
  .nb-gallery__viewport:not(.nb-gallery__viewport--portrait) { height: auto; aspect-ratio: 1.8; }
  .nb-gallery__caption { display: block; padding: 15px 0 16px; font-size: 12px; }
  .nb-gallery__caption strong { display: block; max-width: none; margin-bottom: 4px; font-size: 16px; }
  .nb-gallery__caption span { display: block; max-width: none; }
  .nb-gallery__footer { gap: 8px; padding-top: 8px; }
  .nb-gallery__hint { display: none; }
  .nb-gallery__dot { width: 44px; }
  .nb-gallery__arrows { flex: 0 0 auto; gap: 6px; }
  .nb-gallery__end { min-height: 340px; padding: 30px 16px; margin-bottom: 16px; }
  .nb-gallery__end h3 { font-size: 40px; }
  .nb-gallery__end p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .nb-gallery *, .nb-gallery *::before, .nb-gallery *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Full-page screenshots share one scrollable viewport at every breakpoint. */
.nb-gallery{border-radius:0;border-top:6px solid var(--acid)}
.nb-gallery__viewport.nb-gallery__viewport--fullpage{display:block;height:auto;max-height:min(62vh,700px);max-height:min(62dvh,700px);aspect-ratio:auto;border-radius:0;overflow:auto;background:var(--gallery-ink);scrollbar-width:auto;scrollbar-color:var(--gallery-acid) var(--gallery-ink)}
.nb-gallery__viewport--fullpage .nb-gallery__image{display:block;width:100%;height:auto;max-width:none;max-height:none;object-fit:initial}
.nb-gallery__viewport:focus-visible{outline-color:var(--violet)}
.nb-gallery__end--development{background:var(--violet);color:#fff}
.nb-gallery__end--development .nb-gallery__development-note{color:#fff}
.nb-gallery__dot[aria-current="true"] span{background:var(--violet)}
.nb-gallery__hint{font-size:13px}
@media(max-width:640px){.nb-gallery__viewport.nb-gallery__viewport--fullpage{height:auto;max-height:55vh;max-height:55dvh}.nb-gallery__shell{padding:16px 12px 10px}.nb-gallery__caption{padding-block:12px}.nb-gallery__header{margin-bottom:14px}}

@media(max-width:640px){
  .nb-gallery__footer:has(.nb-gallery__dot:nth-child(5)){flex-wrap:wrap}
  .nb-gallery__footer:has(.nb-gallery__dot:nth-child(5)) .nb-gallery__dots{width:100%}
  .nb-gallery__footer:has(.nb-gallery__dot:nth-child(5)) .nb-gallery__arrows{margin-left:auto}
}

.nb-gallery__description{margin:0 0 22px;max-width:850px;font-size:16px;line-height:1.5;color:#60615b}
.nb-gallery__description[hidden]{display:none}
