/* Access screen layout repair. Presentation only; auth and saved data unchanged. */
#gate.gate {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  z-index: 1150 !important;
  display: grid !important;
  place-items: center !important;
  padding: clamp(12px, 3vw, 36px) !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  background-color: #0b0a09 !important;
}
#gate .book-stage {
  position: relative !important;
  margin: auto !important;
  width: min(1120px, 100%) !important;
  height: min(760px, calc(100dvh - 48px)) !important;
  max-width: 100% !important;
  min-height: 0 !important;
  flex-shrink: 0;
}
#gate .book-shell { width: 100% !important; height: 100% !important; }
/* Do not expose private planning pages or navigation before successful access. */
#book.is-locked { display: none !important; }
/* The radio and mini-player live inside the unlocked experience. */
body:not(.vault-access-granted) .vault-mini-player { visibility: hidden !important; pointer-events: none !important; }
@media (max-width: 700px) {
  #gate.gate { padding: 12px !important; align-items: start !important; }
  #gate .book-stage { width: 100% !important; height: auto !important; min-height: min(720px, calc(100dvh - 24px)) !important; }
  #gate .book-shell { min-height: inherit !important; }
  #gate .inside-page { min-width: 0 !important; }
  #gate .gate-panel { max-width: 100% !important; }
}
@media (max-height: 680px) and (min-width: 701px) {
  #gate .book-stage { height: 620px !important; }
}

/* Auth state takes precedence over the centered gate layout. */
#gate.gate.unlocked,
#gate.gate.unlocked.is-ready {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  display: none !important;
}
#gate.gate[style*="display: none"] { display: none !important; }
