/* ============================================
   ONE CLOSE FOR EVERY MENU OFF THE UPPER PANEL
   ------------------------------------------------------------
   The diary's "✕ CLOSE" — a thin bordered stamp in the top-right
   corner of the paper — is the close for all of them now: DIARY,
   WORK, CHARACTER (the witness dossier), DOSSIERS and APARTMENT
   (the author, 2026-10-03: "така сама і в тому ж місці"). Each
   panel keeps its own class; this sheet loads after theirs, so the
   same specificity wins by order. The MAP is a section, not a
   menu — it keeps its BACK TO THE SCENE.
   ============================================ */

#diaryPanel .diary-close-btn,
#workPanel .work-close-btn,
#playerProfileSection .pp-close-btn,
#dossierV4Overlay .dv4-close-x,
#apartmentViewerModal .apt-x {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  bottom: auto;
  width: auto;
  height: auto;
  margin: 0;
  display: inline-block;
  background: none;
  border: 1px solid #8E7F7F;
  border-radius: 0;
  box-shadow: none;
  color: #5F5449;
  font-family: 'Courier Prime', 'Courier New', Courier, monospace;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.5;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  cursor: pointer;
  z-index: 20;
  transition: color .2s, border-color .2s, background .2s;
}

#diaryPanel .diary-close-btn:hover,
#workPanel .work-close-btn:hover,
#playerProfileSection .pp-close-btn:hover,
#dossierV4Overlay .dv4-close-x:hover,
#apartmentViewerModal .apt-x:hover {
  color: #8B0000;
  border-color: #8B0000;
  background: rgba(139, 0, 0, 0.10);
  filter: none;
}

/* The witness dossier's header is the positioned box the close sits
   in; it used to be a 26px square with an ×. */
#playerProfileSection .pp-header { position: relative; }

/* The subject dossier keeps its EYES ONLY stamp — it steps left of
   the close. */
#dossierV4Overlay .corner-stamp { right: 7.4rem; }

/* The floor plan styles itself from a <style> inside the modal, which
   lands after this sheet in document order — the child combinator
   gives these rules the extra specificity to win. The OPEN FILE tab
   sat beside the old ×; it slides left of the close now, and keeps
   its ride onto the drawer's seam. */
/* The box was 92vh — but vh ignores the html zoom (1.25 at 1600px),
   so the plan stood taller than the zoomed viewport and its top edge,
   close and all, sat above the screen. Sized off the zoomed viewport
   (--vh100, fbi-document-style.css); the plan itself fits the box. */
#apartmentViewerModal > div.apt-box { max-height: calc(var(--vh100, 100vh) * 0.92); }   /* (1,1,1) over the inline sheet's (1,1,0) */
#apartmentViewerModal .apt-svg-pane > svg {
  width: auto; max-width: 100%; height: auto;
  max-height: calc(var(--vh100, 100vh) * 0.92 - 2rem);
  margin: 0 auto;
}
#apartmentViewerModal .apt-box > .apt-x {
  position: absolute; top: 16px; right: 16px; left: auto;
  width: auto; height: auto; line-height: 1.5; font-size: 11px; border-radius: 0;
}
#apartmentViewerModal .apt-box > .apt-x:hover { background: rgba(139, 0, 0, 0.10); }
#apartmentViewerModal .apt-box > .apt-file-toggle { right: 112px; top: 14px; }
#apartmentViewerModal.drawer-open .apt-box > .apt-file-toggle { right: 492px; }   /* 380px drawer + the same 112 */
