    dialog[aria-labelledby="viewer-title"] {
      padding: 0;
      margin: auto;
      width: min(76rem, calc(100% - 1.5rem));
      max-width: none;
      height: min(52rem, calc(100% - 1.5rem));
      height: min(52rem, calc(100dvh - 1.5rem));
      max-height: none;
      --viewer-line: #465465;
      border: 1px solid var(--viewer-line);
      border-radius: .8rem;
      background: #1a1e25;
      color: inherit;
      box-shadow: 0 1.5rem 5rem #070b14a6;
      overflow: hidden;
    }
    dialog[aria-labelledby="viewer-title"]::backdrop { background: #0b1019d9; }
    dialog[aria-labelledby="viewer-title"] .viewer-shell {
      height: 100%;
      display: grid;
      grid-template: auto minmax(0, 1fr) / minmax(0, 1fr);
      container-type: inline-size;
      /* Match the embedded viewer's padding at the width of this dialog. */
      --toolbar-inset: clamp(.65rem, 1.5cqw, 1.1rem);
    }
    dialog[aria-labelledby="viewer-title"] .viewer-bar {
      padding: .7rem clamp(.7rem, 1.8vw, 1.3rem);
      padding-inline-end: var(--toolbar-inset);
      border-bottom: 1px solid var(--viewer-line);
      background: linear-gradient(112deg, #27333f, #1b212a 20rem, #222d3b);
      display: grid;
      grid-template-columns: minmax(0, max-content) minmax(0, 1fr) max-content;
      grid-template-areas: "title doors close";
      align-items: center;
      gap: .55rem clamp(.8rem, 2.2vw, 1.5rem);
    }
    dialog[aria-labelledby="viewer-title"] #viewer-title {
      grid-area: title;
      margin: 0;
      font: 400 clamp(1.55rem, 3.5vw, 2.25rem)/1.05 var(--display, var(--serif, Georgia, serif));
      letter-spacing: -.04em;
      overflow-wrap: anywhere;
    }
    dialog[aria-labelledby="viewer-title"] #viewer-title::before {
      content: "";
      display: block;
      width: 1.7rem;
      height: .16rem;
      margin-bottom: .28rem;
      border-radius: .15rem;
      background: linear-gradient(90deg, var(--red) 45%, transparent 45% 55%, var(--cyan) 55%);
    }
    dialog[aria-labelledby="viewer-title"] .viewer-bar > form { grid-area: close; place-self: center end; display: flex; margin: 0; }
    dialog[aria-labelledby="viewer-title"] .viewer-bar button, dialog[aria-labelledby="viewer-title"] #exit-fullscreen {
      min-height: 2.75rem;
      padding: .4rem .75rem;
      border: 1px solid var(--viewer-line);
      border-radius: .4rem;
      background: #1a2029;
      color: inherit;
      font: inherit;
      font-size: .85rem;
      font-weight: normal;
      cursor: pointer;
    }
    dialog[aria-labelledby="viewer-title"] .viewer-bar .viewer-close {
      display: grid;
      place-items: center;
      inline-size: 2.75rem;
      block-size: 2.75rem;
      padding: 0;
    }
    dialog[aria-labelledby="viewer-title"] .viewer-bar .viewer-close:is(:hover, :focus-visible) {
      color: var(--cyan);
      border-color: currentColor;
    }
    dialog[aria-labelledby="viewer-title"] :is(button, a):focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
    dialog[aria-labelledby="viewer-title"] :is(.viewer-bar button, #exit-fullscreen):hover {
      border-color: #718398;
      background: var(--hover);
    }
    dialog[aria-labelledby="viewer-title"] #viewer-doors { grid-area: doors; display: flex; flex-wrap: wrap; gap: .4rem; }
    dialog[aria-labelledby="viewer-title"] #viewer-doors[hidden] { display: none; }
    dialog[aria-labelledby="viewer-title"] #viewer-doors a {
      display: inline-flex;
      align-items: center;
      gap: .4rem;
      min-height: 2.75rem;
      padding: .35rem .65rem;
      border: 1px solid var(--viewer-line);
      border-radius: .4rem;
      background: #22313c;
      color: var(--cyan);
      font-size: .8rem;
      line-height: 1.25;
      font-weight: normal;
      text-decoration: none;
    }
    dialog[aria-labelledby="viewer-title"] #viewer-doors a:hover { border-color: var(--cyan); background: #2b414b; color: var(--cyan-hover); }
    dialog[aria-labelledby="viewer-title"] #viewer-host {
      position: relative;
      container-type: inline-size;
      display: grid;
      grid-template-rows: minmax(0, 1fr) auto;
    }
    dialog[aria-labelledby="viewer-title"] #viewer-host iframe { display: block; width: 100%; height: 100%; border: 0; }
    .viewer-footer {
      display: flex;
      align-items: center;
      gap: .75rem;
      min-height: 2.75rem;
      padding-inline: clamp(.7rem, 1.8vw, 1.3rem);
      border-top: 1px solid var(--viewer-line);
      background: #1b212a;
    }
    .viewer-collection {
      margin-inline-end: auto;
      padding-block: .4rem;
      color: var(--muted, #c1c9d2);
      font-size: .875rem;
      line-height: 1.4;
      overflow-wrap: anywhere;
    }
    .viewer-footer .panorama-music { flex: 0 1 auto; padding: 0; border: 0; }
    dialog[aria-labelledby="viewer-title"][data-view-kind="object"] {
      height: fit-content;
      max-height: calc(100dvh - 1.5rem);
      max-width: max(16rem, calc(200dvh - 3.2rem - var(--object-fit-offset, 0px)));
    }
    dialog[data-view-kind="object"] .viewer-shell { height: auto; max-height: calc(100dvh - 1.6rem); }
    dialog[data-view-kind="object"] #viewer-host:not(:fullscreen) { min-height: 0; }
    dialog[data-view-kind="object"] #viewer-host:not(:fullscreen) iframe { height: var(--object-height, min(50vw, 60vh)); max-height: 100%; }
    #viewer-host > iframe.loading-document { visibility: hidden; }
    #viewer-host > .viewer-loading { display: none; grid-area: 1 / 1 / 2 / 2; }
    dialog[aria-labelledby="viewer-title"] .viewer-music-control {
      position: absolute;
      inset-block-start: var(--toolbar-inset);
      inset-inline: var(--toolbar-inset);
      container-type: inline-size;
      z-index: 1;
      pointer-events: none;
    }
    dialog[aria-labelledby="viewer-title"] .viewer-music-control button { pointer-events: auto; }
    dialog[aria-labelledby="viewer-title"] #viewer-host:fullscreen .viewer-music-control { --toolbar-inset: .65rem; }
    dialog[aria-labelledby="viewer-title"] #viewer-host:fullscreen {
      grid-template-rows: minmax(0, 1fr);
      background: #13171d;
    }
    #viewer-host:fullscreen > .viewer-footer { display: none; }
    dialog[aria-labelledby="viewer-title"] #exit-fullscreen { display: none; }
    dialog[aria-labelledby="viewer-title"] #viewer-host:fullscreen #exit-fullscreen {
      display: block;
      position: absolute;
      z-index: 1;
      top: .65rem;
      right: .65rem;
    }
    @media (max-width: 52rem) {
      dialog[aria-labelledby="viewer-title"] .viewer-bar {
        grid-template-columns: minmax(0, 1fr) max-content;
        grid-template-areas: "title close" "doors close";
      }
      dialog[aria-labelledby="viewer-title"] .viewer-bar:has(> #viewer-doors[hidden]) {
        grid-template-areas: "title close";
      }
    }
    @media (max-width: 40rem) {
      dialog[aria-labelledby="viewer-title"] {
        width: calc(100% - .85rem);
        height: calc(100% - .85rem);
        height: calc(100dvh - .85rem);
      }
    }
