/* The project reuses the portfolio drawer. Its figures adapt to the drawer width. */
#stay-dialog { container-type: inline-size; }
.stay-detail figure { margin: 20px 0 0; min-width: 0; }
.stay-detail img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.stay-detail figcaption, .stay-detail small { color: var(--muted); font-size: 14px; line-height: 1.65; }
.stay-detail img + figcaption { margin-top: 8px; }
.stay-detail figcaption h4 { margin: 0; color: var(--ink); font: 600 17px/1.35 var(--display); }
.stay-scope { margin: 20px 0 0; padding: 16px 20px; background: #f1ecf5; }
.stay-scope dt { color: var(--purple); font-weight: 650; }
.stay-scope dd { margin: 4px 0 12px; line-height: 1.65; }
.stay-scope dd:last-child { margin-bottom: 0; }
.stay-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; margin-top: 8px; }
.stay-versions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.stay-versions figure { display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 12px; align-items: start; }
.stay-mobile figure { display: grid; grid-template-columns: 1fr 1.1fr; align-items: start; gap: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.stay-mobile small { grid-column: 2; }
.stay-mobile small a { text-decoration: underline; }
@container (max-width: 520px) {
  .stay-versions, .stay-versions figure, .stay-mobile figure { display: block; }
  .stay-detail figcaption + img { margin-top: 12px; }
}
#stay-pdf-dialog {
  width: min(1440px,100vw); height: 100dvh; max-width: none; max-height: none;
  margin: 0 auto; padding: 0; border: 0; background: var(--paper); color: var(--ink);
}
#stay-pdf-dialog[open] { display: flex; flex-direction: column; }
#stay-pdf-dialog::backdrop { background: #20102c90; }
#stay-pdf-dialog .dialog-header { position: static; flex: none; padding: 14px clamp(14px,3vw,32px); background: var(--paper); }
#stay-pdf-dialog h2 { font-size: clamp(18px,3vw,29px); line-height: 1.2; }
.stay-pdf-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; padding: 5px clamp(12px,3vw,32px); border-block: 1px solid var(--line); }
.stay-pdf-controls label { color: var(--muted); font-size: 14px; }
.stay-pdf-controls button, .stay-pdf-controls select {
  min-width: 44px; min-height: 44px; padding-inline: 8px; border: 1px solid var(--line); background: white; color: var(--purple); font: inherit;
}
.stay-pdf-controls button:disabled { opacity: .45; cursor: default; }
.stay-pdf-controls .portfolio-reference { margin: 0 0 0 auto; }
.stay-pdf-status { padding: 8px 18px; }
.stay-pdf-status:empty { display: none; }
.stay-pdf-sheet { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; background: #e8e4eb; }
.stay-pdf-sheet canvas { display: block; margin: 0 auto; background: white; }
@media(max-width: 500px) {
  .stay-pdf-controls { gap: 4px 8px; }
  .stay-pdf-controls .portfolio-reference { margin-left: 0; }
  #stay-pdf-dialog .dialog-close { font-size: 13px; }
}
