@media (max-height:600px),(max-width:900px){
 main.screen-only{padding:0!important}
 main.screen-only>div:first-child{max-width:min(100vw,calc((100dvh - 44px)*16/9))!important;border-radius:0!important;box-shadow:none!important}
}
.rotate-hint{display:none}
@media (orientation:portrait) and (max-width:700px){
 .rotate-hint{display:flex;position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom) + 72px);transform:translateX(-50%);z-index:50;align-items:center;gap:8px;padding:8px 14px;border-radius:999px;background:rgba(112,47,138,.92);color:#fff;font:600 13px/1 Inter,system-ui,sans-serif;white-space:nowrap;pointer-events:none;transition:opacity .4s}
 html.idle .rotate-hint{opacity:0}
}

/* Mobile-safe presentation layout */
html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

main.screen-only {
  width: 100%;
  overflow: hidden;
}

/* Desktop: original slide size; slide sits at top, controls get the space below */
@media (min-width: 901px) and (min-height: 601px) {
  main.screen-only {
    align-items: flex-start !important;
    padding-top: 24px !important;
  }
  main.screen-only > nav {
    bottom: 20px !important;
  }
}

/* Phones and small screens */
@media (max-width: 900px), (max-height: 600px) {
  main.screen-only {
    height: 100dvh !important;
    min-height: 100svh;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left)) !important;
  }
  main.screen-only > div:first-child {
    width: min(100%, calc((100dvh - 140px) * 16 / 9)) !important;
    max-width: min(100%, calc((100dvh - 140px) * 16 / 9)) !important;
    flex: none;
    border-radius: clamp(0px, 1vw, 12px) !important;
  }
}

/* Preserve the presentation's original 1600 × 900 slide canvas */
.slide-scale {
  width: 1600px;
  height: 900px;
  transform: scale(var(--s, 1));
  transform-origin: top left;
}

/* Keep navigation clear of phone gesture areas */
main.screen-only > nav {
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
  gap: 8px !important;
  max-width: calc(100vw - 24px);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgb(21 18 23 / 78%);
  backdrop-filter: blur(10px);
}

/* Give previous and next controls a comfortable touch target */
main.screen-only > nav button[aria-label="Previous slide"],
main.screen-only > nav button[aria-label="Next slide"] {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  padding: 0 !important;
  touch-action: manipulation;
}

/* On narrow phones, use arrows and the slide counter.
   The ten tiny direct-jump dots are too crowded to tap comfortably. */
@media (max-width: 700px) {
  main.screen-only > nav button[aria-label^="Go to slide"] {
    display: none !important;
  }

  main.screen-only > nav {
    gap: 10px !important;
  }

  .rotate-hint {
    display: flex !important;
    bottom: calc(env(safe-area-inset-bottom) + 72px) !important;
    opacity: 1 !important;
  }
}

/* Landscape phones can display the slide markers */
@media (max-width: 900px) and (orientation: landscape) {
  main.screen-only > nav button[aria-label^="Go to slide"] {
    min-width: 30px;
    min-height: 40px;
    padding: 0 !important;
  }

  .rotate-hint {
    display: none !important;
  }
}

/* Leave enough room for controls on short screens */
@media (max-height: 500px) {
  main.screen-only {
    padding: 8px !important;
  }

  main.screen-only > div:first-child {
    width: min(100%, calc((100dvh - 124px) * 16 / 9)) !important;
    max-width: min(100%, calc((100dvh - 124px) * 16 / 9)) !important;
  }

  main.screen-only > nav {
    bottom: max(4px, env(safe-area-inset-bottom)) !important;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .deck-slide,
  .deck-slide *,
  .rotate-hint {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keep keyboard focus visible */
main.screen-only > nav button:focus-visible {
  outline: 3px solid #bb9dd6;
  outline-offset: 3px;
}

.facility-capabilities summary:focus-visible{outline:3px solid #bb9dd6;outline-offset:3px;border-radius:6px}
