:root {
  --paper: #f6f1e9;
  --ink: #1c1b19;
  --muted: #6f6b63;
  --line: #d8d0c4;
  --panel: #fffdf8;
  --brick: #9c3d2e;
  --steel: #2f6473;
  --moss: #556b46;
  --gold: #b98230;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(28, 27, 25, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(28, 27, 25, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg width='720' height='420' viewBox='0 0 720 420' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%231c1b19' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M62 344h582M116 344V156l68-48 72 48v188M184 108v236M116 156h140M320 344V118h162v226M320 174h162M320 232h162M320 290h162M512 344V202l74-56 72 56v142M586 146v198M512 202h146'/%3E%3Cpath d='M78 344c32-32 74-42 124-31M286 344c44-30 88-36 132-18M486 344c30-22 72-28 126-16'/%3E%3C/g%3E%3C/svg%3E");
  background-position: right 8vh top 18vh;
  background-repeat: no-repeat;
}

a { color: inherit; }

.site-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(14px, 3vw, 42px);
  border-bottom: 1px solid rgba(28, 27, 25, 0.14);
  background: rgba(246, 241, 233, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 210px;
  font-weight: 760;
}

.brand span:first-child {
  color: var(--brick);
  letter-spacing: 0;
}

.brand span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.filter-button,
.search-box input,
.modal-download-option {
  border-radius: 8px;
}

.filter-button {
  appearance: none;
  border: 1px solid rgba(28, 27, 25, 0.18);
  background: var(--panel);
  color: var(--ink);
  padding: 6px 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.filter-button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.search-box { width: min(230px, 22vw); }

.search-box input {
  width: 100%;
  border: 1px solid rgba(28, 27, 25, 0.22);
  background: rgba(255, 253, 248, 0.88);
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  min-height: min(66vh, 720px);
  border-bottom: 1px solid var(--line);
}

.intro-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 6vw, 76px) clamp(20px, 5vw, 64px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--steel);
  font-weight: 760;
  letter-spacing: 0;
}

h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(34px, 5.8vw, 76px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro-copy > p {
  max-width: 760px;
  margin: 20px 0 0;
  color: #34302b;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.62;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
  max-width: 680px;
}

.stat {
  border-top: 2px solid var(--brick);
  padding-top: 10px;
}

.stat:nth-child(2) { border-color: var(--steel); }
.stat:nth-child(3) { border-color: var(--moss); }

.stat strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.usage-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.guide-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(28, 27, 25, 0.13);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.68);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.guide-icon {
  width: 17px;
  height: 17px;
  color: var(--steel);
}

.intro-image {
  position: relative;
  min-height: 430px;
  border-left: 1px solid var(--line);
  overflow: hidden;
  background: #1c1b19;
  contain: layout paint;
  isolation: isolate;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.04) saturate(0.92);
  opacity: 0;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: opacity 760ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.hero-slide.is-current {
  z-index: 1;
  opacity: 1;
}

.hero-slide.is-next {
  z-index: 2;
  opacity: 0;
}

.intro-image.is-animating .hero-slide.is-current {
  opacity: 0;
}

.intro-image.is-animating .hero-slide.is-next {
  opacity: 1;
}

.intro-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 48%, rgba(28, 27, 25, 0.22));
}

.hero-caption {
  position: absolute;
  right: 18px;
  bottom: 16px;
  z-index: 4;
  display: grid;
  gap: 3px;
  max-width: min(72%, 320px);
  color: #fffdf8;
  text-align: right;
  text-shadow: 0 1px 12px rgba(28, 27, 25, 0.68);
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 240ms ease,
    transform 240ms ease;
}

.hero-caption.is-updating {
  opacity: 0;
  transform: translateY(4px);
}

.hero-caption-cn {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.22;
}

.hero-caption-en {
  color: rgba(255, 253, 248, 0.76);
  font-size: 11px;
  line-height: 1.22;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide {
    transition: opacity 320ms ease;
  }
}

.project-index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.index-link {
  min-height: 82px;
  padding: 13px 14px;
  background: var(--panel);
  text-decoration: none;
}

.index-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.index-count {
  display: inline-grid;
  min-width: 19px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(28, 27, 25, 0.12);
  border-radius: 999px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1;
}

.index-title {
  display: block;
  font-size: 14px;
  line-height: 1.32;
}

.project-section {
  padding: clamp(36px, 6vw, 68px) clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.5);
}

.project-section:nth-of-type(3n) { background: rgba(242, 236, 226, 0.72); }

.project-header {
  max-width: 1180px;
  margin: 0 auto 24px;
}

.project-kicker {
  color: var(--brick);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: 0;
  margin-bottom: 10px;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 3.8vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

.en-title {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 20px);
}

.summary {
  max-width: 900px;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.68;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: clamp(20px, 3.5vw, 42px);
  max-width: 1180px;
  margin: 0 auto 24px;
  align-items: start;
}

.sketch-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  overflow: hidden;
}

.sketch-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 27 / 14;
  object-fit: contain;
  background: #fffefa;
  border-bottom: 1px solid var(--line);
}

.facts {
  margin: 0;
  padding: 13px 15px;
}

.fact-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(28, 27, 25, 0.1);
}

.fact-row:last-child { border-bottom: 0; }

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 0;
  line-height: 1.55;
  font-size: 13px;
}

.narrative {
  font-size: 17px;
  line-height: 1.82;
}

.narrative p {
  margin: 0 0 18px;
  max-width: 880px;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.source-links a {
  border-bottom: 1px solid currentColor;
  color: var(--steel);
  text-decoration: none;
  font-size: 14px;
}

.gallery-grid {
  max-width: 1320px;
  margin: 26px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 11px;
}

.photo-card {
  margin: 0;
  border: 1px solid rgba(28, 27, 25, 0.13);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.photo-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-card figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 7px 8px 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.photo-caption {
  flex: 1 1 116px;
  min-width: 0;
}

.photo-filename,
.photo-credit {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-credit {
  margin-top: 2px;
  color: rgba(111, 107, 99, 0.72);
  font-size: 10px;
}

.download-size {
  color: currentColor;
  font-size: 10px;
  opacity: 0.72;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(18, 17, 16, 0.86);
}

.modal.is-open {
  display: block;
}

.modal-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 28px;
  color: var(--paper);
  background: linear-gradient(180deg, rgba(18, 17, 16, 0.76), rgba(18, 17, 16, 0));
}

.modal-meta {
  min-width: 0;
  flex: 1 1 auto;
  max-width: min(760px, 58vw);
  display: grid;
  gap: 5px;
  padding-top: 1px;
}

.modal-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #fffdf8;
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: 0;
  text-wrap: balance;
}

.modal-caption {
  display: block;
  min-width: 0;
  max-width: min(560px, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(246, 241, 233, 0.72);
  font-size: 12px;
  line-height: 1.25;
}

.modal-photo-details {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin: 8px 0 0;
  padding: 0;
  color: rgba(246, 241, 233, 0.78);
  font-size: 11px;
  line-height: 1.2;
}

.modal-photo-details:empty {
  display: none;
}

.modal-photo-details div {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid rgba(246, 241, 233, 0.16);
  border-radius: 6px;
  background: rgba(246, 241, 233, 0.07);
}

.modal-photo-details dt {
  color: rgba(246, 241, 233, 0.56);
  white-space: nowrap;
}

.modal-photo-details dd {
  margin: 0;
  max-width: min(360px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.download-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.modal-download-option,
.modal-close {
  border: 1px solid rgba(246, 241, 233, 0.28);
  background: rgba(246, 241, 233, 0.08);
  color: var(--paper);
  text-decoration: none;
  font: inherit;
  padding: 7px 9px;
  cursor: pointer;
}

.modal-download-option {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.modal-download-option .download-size {
  font-size: 11px;
}

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 19px;
  line-height: 1;
  padding: 0;
}

.modal-step {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 38px;
  height: 58px;
  border: 1px solid rgba(246, 241, 233, 0.2);
  border-radius: 8px;
  background: rgba(18, 17, 16, 0.32);
  color: var(--paper);
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
}

.modal-step:disabled {
  opacity: 0.28;
  cursor: default;
}

.modal-prev { left: 12px; }
.modal-next { right: 12px; }

.modal-frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 126px 18px 126px;
  overflow: hidden;
  pointer-events: auto;
  touch-action: pan-y;
}

.modal-frame img {
  max-width: calc(100dvw - 36px);
  max-height: calc(100dvh - 252px);
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: auto;
  border-radius: 4px;
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.36);
  cursor: zoom-in;
}

.modal.is-zoomed .modal-frame {
  place-items: start center;
  overflow: auto;
  padding: 138px 18px 138px;
}

.modal.is-zoomed .modal-frame img {
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.modal-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 clamp(96px, 9vw, 156px);
  pointer-events: none;
}

.modal-status .modal-photo-details {
  margin: 0;
  justify-content: center;
}

.modal-progress {
  position: absolute;
  right: clamp(18px, 3vw, 42px);
  bottom: 0;
  min-width: 54px;
  padding: 5px 10px;
  border: 1px solid rgba(246, 241, 233, 0.24);
  border-radius: 999px;
  background: rgba(18, 17, 16, 0.58);
  color: var(--paper);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.site-footer {
  padding: 28px clamp(18px, 4vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 13px;
}

.visit-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(28, 27, 25, 0.11);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.5);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.visit-counter strong {
  color: var(--ink);
  font-size: 13px;
}

.visit-divider {
  color: rgba(28, 27, 25, 0.32);
}

.references {
  padding: clamp(36px, 5vw, 64px) clamp(18px, 4vw, 54px);
  background: #1c1b19;
  color: var(--paper);
}

.references h2 {
  max-width: 1180px;
  margin: 0 auto 20px;
  font-size: clamp(24px, 3vw, 38px);
}

.references ol {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 22px;
  columns: 2;
  column-gap: 44px;
}

.references li {
  break-inside: avoid;
  margin: 0 0 10px;
  color: rgba(246, 241, 233, 0.76);
  font-size: 13px;
  line-height: 1.55;
}

.references a {
  color: inherit;
  text-decoration-color: rgba(246, 241, 233, 0.34);
}

.is-hidden { display: none !important; }

@media (max-width: 880px) {
  .topbar {
    position: static;
    display: grid;
    gap: 8px;
    padding: 9px 12px;
  }

  .topbar nav {
    padding-bottom: 4px;
  }

  .search-box {
    width: 100%;
  }

  .intro {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .intro-copy {
    padding: 28px 16px 22px;
  }

  h1 {
    font-size: clamp(31px, 10vw, 48px);
  }

  .intro-copy > p {
    margin-top: 16px;
  }

  .intro-image {
    aspect-ratio: 2 / 3;
    min-height: min(136vw, 620px);
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .hero-caption {
    right: 14px;
    bottom: 13px;
    max-width: 74%;
  }

  .hero-caption-cn {
    font-size: 12px;
  }

  .hero-caption-en {
    font-size: 10px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 22px;
  }

  .usage-guide {
    gap: 6px;
    margin-top: 16px;
  }

  .guide-item {
    min-height: 28px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .project-body {
    grid-template-columns: 1fr;
  }

  .project-index {
    position: sticky;
    top: 0;
    z-index: 18;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 6px 10px 7px;
    border-top: 0;
    border-bottom: 1px solid rgba(28, 27, 25, 0.08);
    background: rgba(246, 241, 233, 0.78);
    backdrop-filter: blur(18px) saturate(1.08);
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .project-index::-webkit-scrollbar {
    display: none;
  }

  .index-link {
    position: relative;
    flex: 0 0 auto;
    width: clamp(104px, 31vw, 166px);
    min-height: 34px;
    padding: 6px 10px 7px;
    border: 1px solid rgba(28, 27, 25, 0.1);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.52);
    scroll-snap-align: start;
    box-shadow: none;
  }

  .index-meta {
    gap: 5px;
    margin-bottom: 2px;
    font-size: 9px;
    line-height: 1;
  }

  .index-count {
    min-width: 16px;
    height: 15px;
    border-color: rgba(28, 27, 25, 0.1);
    font-size: 9px;
  }

  .index-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    line-height: 1.12;
  }

  .index-link.is-current {
    background: rgba(47, 100, 115, 0.1);
    color: var(--ink);
    border-color: rgba(47, 100, 115, 0.28);
  }

  .index-link.is-current .index-meta {
    color: var(--steel);
  }

  .index-link.is-current .index-count {
    border-color: rgba(47, 100, 115, 0.34);
    color: var(--steel);
  }

  .index-link.is-current::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 3px;
    height: 1px;
    border-radius: 999px;
    background: rgba(47, 100, 115, 0.72);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
  }

  .photo-button img {
    aspect-ratio: 3 / 4;
  }

  .photo-card figcaption {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    min-height: 42px;
    padding: 6px 7px 7px;
    font-size: 10px;
    line-height: 1.25;
  }

  .photo-caption {
    flex: 0 1 auto;
    width: 100%;
  }

  .photo-credit {
    margin-top: 1px;
  }

  .modal-bar {
    display: block;
    min-height: 58px;
    padding: 12px 58px 16px 14px;
    background: linear-gradient(180deg, rgba(18, 17, 16, 0.9), rgba(18, 17, 16, 0.58) 64%, rgba(18, 17, 16, 0));
  }

  .modal-meta {
    max-width: none;
  }

  .modal-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 720;
    line-height: 1.18;
  }

  .modal-caption {
    max-width: calc(100vw - 92px);
    font-size: 10px;
    line-height: 1.2;
    color: rgba(246, 241, 233, 0.58);
  }

  .modal-photo-details {
    gap: 4px;
    width: 100%;
    max-height: none;
    margin: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    font-size: 10px;
    scrollbar-width: none;
  }

  .modal-photo-details::-webkit-scrollbar {
    display: none;
  }

  .modal-photo-details div {
    flex: 0 0 auto;
    padding: 3px 5px;
  }

  .modal-photo-details dd {
    max-width: 168px;
  }

  .modal-actions {
    display: contents;
  }

  .download-menu {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 84px;
    z-index: 4;
    width: max-content;
    max-width: calc(100dvw - 20px);
    padding: 5px;
    transform: translateX(-50%);
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
    border: 1px solid rgba(246, 241, 233, 0.1);
    border-radius: 999px;
    background: rgba(18, 17, 16, 0.28);
    backdrop-filter: blur(10px);
  }

  .download-menu::-webkit-scrollbar {
    display: none;
  }

  .modal-download-option {
    padding: 6px 8px;
    font-size: 12px;
  }

  .modal-close {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 31px;
    height: 31px;
  }

  .modal-step {
    display: none;
  }

  .modal-frame {
    inset: 58px 0 126px;
    padding: 8px 10px;
  }

  .modal-frame img {
    max-width: 100%;
    max-height: 100%;
  }

  .modal.is-zoomed .modal-frame {
    inset: 52px 0 0;
    padding: 10px;
  }

  .modal-status {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 8px 10px max(10px, env(safe-area-inset-bottom));
    background: linear-gradient(0deg, rgba(18, 17, 16, 0.88), rgba(18, 17, 16, 0.62) 70%, rgba(18, 17, 16, 0));
    pointer-events: auto;
  }

  .modal-progress {
    position: static;
    right: auto;
    bottom: auto;
  }

  .modal.is-zoomed .modal-status {
    display: none;
  }

  .references ol {
    columns: 1;
  }
}