html { scrollbar-gutter: stable; }
html:has(.sheet-viewer[open]) { overflow: hidden; }
.sheet-viewer {
  inset: 0;
  margin: auto;
  padding: 0;
  width: min(1120px, 94vw);
  max-width: none;
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
  border: var(--line);
  border-radius: var(--r);
  background: white;
  color: var(--ink);
  box-shadow: 5px 6px 0 var(--ink);
}
.sheet-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.sheet-viewer::backdrop { background: rgb(22 25 44 / 78%); }
.sheet-viewer header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px 8px 18px;
  border-bottom: var(--thin);
  background: var(--cream);
}
.sheet-viewer h2 { font-size: clamp(14px, 1.6vw, 19px); line-height: 1.45; }
.sheet-viewer button {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: var(--sun);
  border: var(--thin);
  border-radius: 8px;
  color: var(--ink);
}
.sheet-viewer__image { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.sheet-viewer__image img { display: block; width: 100%; height: auto; }
