/* Canonical drawer chrome. Load after page/profile/filter CSS. Content geometry
   (portrait aspect ratio, saved image crops, typography and tabs) stays local. */
:root {
  --archive-drawer-duration: 260ms;
  --archive-drawer-easing: cubic-bezier(.2,.75,.25,1);
  --archive-drawer-top-gap: max(10px, env(safe-area-inset-top, 0px));
  --archive-drawer-gutter: 15px;
  --archive-drawer-radius: 24px;
  --archive-drawer-handle-width: 80px;
  --archive-drawer-handle-height: 48px;
  --archive-drawer-pill-width: 42px;
  --archive-drawer-pill-height: 4px;
  --archive-toast-duration: 180ms;
  --archive-control-inset: 12px;
}
.archive-drawer-overlay { z-index:65000; }
html[data-theme] body .archive-drawer__media { position: relative; border-radius: var(--archive-drawer-radius); }
html[data-theme] body .archive-modal .archive-drawer__media { border-radius:var(--archive-drawer-radius) !important; overflow:hidden; }
html[data-theme] body .archive-share-button {
  position: absolute !important; inset: 12px auto auto 12px !important;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px !important; height: 40px !important; min-width: 40px !important; min-height: 40px !important; padding: 0 !important;
  background: rgb(20 20 19 / 90%); border: 1px solid rgb(244 241 233 / 35%);
  border-radius: 8px !important; color: #f4f1e9; z-index: 5 !important;
}
html[data-theme] body .archive-share-button.is-confirmed { background: #276749; border-color: #9ae6b4; color: #f7fff9; }
html[data-theme] body .archive-share-button .material-symbols-outlined { font-size: 20px; line-height: 1; }
html[data-theme] body .archive-copy-toast {
  display: block !important; position: absolute !important;
  inset: auto 12px 12px auto !important; margin: 0 !important;
  width: max-content !important; max-width: calc(100% - 24px) !important;
  padding: 10px 12px !important; font: 700 12px/16px var(--body) !important;
  background: #276749 !important; color: #f7fff9 !important;
  border: 1px solid #9ae6b4 !important; border-radius: 0 !important;
  text-align: center; text-transform: uppercase; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateY(8px) !important; z-index: 6 !important;
  transition: opacity var(--archive-toast-duration) ease, transform var(--archive-toast-duration) ease, visibility 0s linear var(--archive-toast-duration) !important;
}
html[data-theme] body .archive-copy-toast.is-visible {
  opacity: 1; visibility: visible; transform: translateY(0) !important;
  transition-delay: 0s !important;
}
.archive-share-button:focus-visible { outline: 2px solid #f4f1e9; outline-offset: 3px; }
@media (max-width: 768px) {
  html[data-theme] body .archive-drawer-overlay .archive-drawer {
    --sheet-card-gutter: var(--archive-drawer-gutter);
    top: var(--archive-drawer-top-gap); bottom: auto;
    height: calc(100dvh - var(--archive-drawer-top-gap));
    max-height: calc(100dvh - var(--archive-drawer-top-gap));
    width: var(--archive-viewport-width, 100vw);
    transition: transform var(--archive-drawer-duration) var(--archive-drawer-easing);
  }
  html[data-theme] body .archive-drawer__panel {
    border: 0 !important; outline: 0 !important;
    border-radius: var(--archive-drawer-radius) var(--archive-drawer-radius) 0 0;
    width: calc(var(--archive-viewport-width, 100vw) - 2 * var(--sheet-card-gutter));
    flex-basis: calc(var(--archive-viewport-width, 100vw) - 2 * var(--sheet-card-gutter));
  }
  html[data-theme] body .archive-drawer .archive-drawer__media {
    border: 0 !important; border-radius: var(--archive-drawer-radius) !important; overflow: hidden;
  }
  html[data-theme] body .archive-drawer .archive-share-button {
    inset: 12px 12px auto auto !important;
    width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important;
  }
  /* Compatibility bridge: legacy page modal rules used z-index:10010. */
  html[data-theme] body.detail-modal-open .archive-drawer-overlay .archive-drawer .archive-drawer__panel .archive-modal .archive-drawer__media .archive-share-button {
    position:absolute !important;
    inset:12px 12px auto auto !important;
    z-index:5 !important;
  }
}
html[data-theme] body .archive-drawer__handle {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  display: block; width: var(--archive-drawer-handle-width); height: var(--archive-drawer-handle-height);
  min-height: var(--archive-drawer-handle-height); padding: 0; margin: 0; border: 0;
  background: transparent; touch-action: pan-x pinch-zoom; cursor: ns-resize; z-index: 7;
}
.archive-drawer__handle::after {
  content: ""; position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  width: var(--archive-drawer-pill-width); height: var(--archive-drawer-pill-height);
  border-radius: 3px; background: #000; box-shadow: 0 0 0 1px rgb(244 241 233 / 40%);
}
.archive-drawer__handle:focus-visible::after { outline: 2px solid #f4f1e9; outline-offset: 4px; }
html[data-theme] body .archive-drawer__handle:focus-visible { outline:none; }
html[data-theme] body .archive-drawer.is-dragging { transition: none !important; }
html body .archive-drawer--filter { transition: transform var(--archive-drawer-duration) var(--archive-drawer-easing) !important; }
@media (max-width:1120px) {
  html[data-theme]:has(body.filter-sheet-open),
  html[data-theme]:has(.vault-room-page:is(.is-vault-filter-sheet-open,.is-vault-filter-sheet-closing)) { scrollbar-gutter:auto !important; }
  body:has(.vault-room-page:is(.is-vault-filter-sheet-open,.is-vault-filter-sheet-closing)) .site-header { visibility:hidden !important; pointer-events:none !important; }
  html[data-theme] body .archive-share-button { width:44px !important; height:44px !important; min-width:44px !important; min-height:44px !important; }
  html body .archive-drawer--filter {
    height:auto !important; min-height:0 !important;
    max-height:calc(100dvh - var(--archive-drawer-top-gap)) !important;
    border:0 !important; outline:0 !important;
    border-radius:var(--archive-drawer-radius) var(--archive-drawer-radius) 0 0 !important;
    z-index:65000 !important;
    transition: transform var(--archive-drawer-duration) var(--archive-drawer-easing) !important;
  }
  html body .archive-drawer--filter > .archive-drawer__handle {
    position: relative; top: auto; left: auto; transform: none; flex: 0 0 48px;
    width: 80px; height: 48px; margin: 0 auto;
  }
  html body .archive-drawer--filter .archive-drawer__handle { touch-action: none; }
}
@media (max-width:768px) {
  html body .archive-drawer--filter { width:100vw !important; }
  html body .vault-room-page .archive-drawer--filter { padding:0 !important; }
  html body .vault-room-page .archive-drawer--filter > :not(.archive-drawer__handle) { margin-inline:20px; }
}
.archive-drawer-overlay::before { transition: opacity var(--archive-drawer-duration) ease; }
@keyframes archiveModalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes archiveModalFadeOut { from { opacity: 1; } to { opacity: 0; } }
@media (min-width:769px) {
  html[data-theme] body .archive-modal:is(.is-open,.is-modal-open) {
    animation: archiveModalFadeIn var(--archive-drawer-duration) var(--archive-drawer-easing) both !important;
    transition-duration: var(--archive-drawer-duration) !important;
    transition-timing-function: var(--archive-drawer-easing) !important;
  }
  html[data-theme] body .archive-modal.is-modal-closing {
    animation: archiveModalFadeOut var(--archive-drawer-duration) var(--archive-drawer-easing) both !important;
  }
  .vault-stream-page .vault-hero.archive-modal.is-open .vault-hero__poster { animation:none !important; }
}
@media (min-width:1121px) { html body .archive-drawer--filter > .archive-drawer__handle { display:none; } }
/* The recovered Vault is an adapter, with the same primary media and chrome. */
.stream-match-view .vault-hero__photo { display:block; height:40dvh; }
.stream-match-view .vault-info-rail { display:flex; flex-direction:column; }
.stream-match-view .vault-info-rail__inner { width:100%; flex:0 0 auto; }
.stream-match-view .vault-button--report { align-self:center; }
@media (min-width:769px) {
  .vault-stream-page .vault-hero .vault-hero__photo.archive-drawer__media {
    display:block; position:absolute; inset:0 280px 0 0;
    background-image:var(--hero-image); background-size:var(--hero-image-size,cover);
    background-position:var(--hero-image-position,center); background-repeat:no-repeat;
    pointer-events:none; z-index:auto;
  }
  .vault-stream-page .vault-hero.archive-modal .vault-hero__poster::before { display:none; }
  .vault-stream-page .vault-hero__photo .archive-share-button { pointer-events:auto; }
}
@media (min-width:769px) and (max-width:1120px) {
  .vault-stream-page .vault-hero .vault-hero__photo.archive-drawer__media { inset:0 0 auto; height:clamp(18rem,54vw,25rem); }
}
@media (prefers-reduced-motion:reduce) {
  html[data-theme] body :is(.archive-drawer,.archive-copy-toast,.archive-modal) { transition: none !important; animation: none !important; }
  .archive-drawer-overlay::before { transition: none !important; }
  html[data-theme] body .archive-modal:is(.is-open,.is-modal-open,.is-modal-closing) { animation:none !important; transition:none !important; }
}
