#mobileSheet { display: none; }
@media (max-width: 820px) {
  body.mobile-experience .topbar { top: max(8px, env(safe-area-inset-top)); left: 10px; right: 10px; gap: 8px; }
  body.mobile-experience .brand { padding: 7px 9px; gap: 7px; min-width: 0; }
  body.mobile-experience .brand-name { font-size: 9px; letter-spacing: .1em; }
  body.mobile-experience .brand-sub { display: none; }
  body.mobile-experience .brand h1 { font-size: 12px; margin-top: 3px; }
  body.mobile-experience .brand-mark, body.mobile-experience .brand-mark img { width: 30px; height: 30px; }
  body.mobile-experience .top-actions { padding: 3px; }
  body.mobile-experience .top-actions .icon-btn { width: 34px; height: 36px; }
  body.mobile-experience .location-card, body.mobile-experience .legend { display: none; }
  body.mobile-experience #mobileSheet { display: flex; flex-direction: column; position: fixed; z-index: 16; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); max-height: calc(100vh - 88px); max-height: calc(100dvh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 0 14px 12px; border: 1px solid #315263; border-radius: 20px; background: #0b1422f5; box-shadow: 0 12px 40px #0008; overflow: hidden; }
  #mobileSheet button { font: inherit; min-height: 44px; color: #e8f7fa; background: #183243; border: 1px solid #396071; border-radius: 9px; padding: 8px 12px; cursor: pointer; }
  #mobileSheet button:focus-visible { outline: 2px solid #65e6e0; outline-offset: 2px; }
  #mobileSheet button:disabled { opacity: .45; cursor: default; }
  #mobileSheet [hidden] { display: none; }
  #mobileSheet .mobile-sheet-handle { height: 24px; flex-shrink: 0; }
  #mobileSheet #mobileResize { display: grid; place-items: center; width: 100%; height: 24px; min-height: 24px; padding: 0; background: none; border: none; touch-action: none; }
  #mobileResize span { width: 40px; height: 4px; border-radius: 9px; background: #87a4ae; }
  .mobile-sheet-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  #mobileStop { margin: 0 0 4px; font-size: 10px; }
  #mobileTitle { margin: 0; font-size: 18px; line-height: 1.2; }
  #mobileSheet #mobileMap { background: none; white-space: nowrap; font-size: 12px; padding: 6px 8px; }
  #mobileIntro { margin: 8px 0 10px; color: #bbccd4; font-size: 13px; line-height: 1.45; }
  .mobile-sheet-actions { display: flex; gap: 8px; margin-top: 8px; flex-shrink: 0; }
  #mobileSheet #mobileContinue { flex: 1; background: #39cbd2; color: #031a24; border-color: #63e1e1; font-weight: 700; font-size: 14px; }
  #mobileSheet #mobilePrevious { padding: 8px 13px; }
  .mobile-secondary { display: flex; justify-content: space-between; gap: 6px; flex-shrink: 0; }
  #mobileSheet .mobile-secondary button { background: none; border: 0; padding: 4px; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
  #mobileSheet[data-size="collapsed"] .mobile-secondary { display: none; }
  #mobileSheet[data-size="collapsed"] #mobileIntro, #mobileSheet[data-size="collapsed"] .mobile-sheet-actions { display: none; }
  #mobileSheet[data-size="half"] { height: 54vh; height: 54dvh; }
  #mobileSheet[data-size="full"] { height: calc(100vh - 88px); height: calc(100dvh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  #mobileSheet[data-size="half"] #mobileIntro, #mobileSheet[data-size="full"] #mobileIntro { display: none; }
  #mobileDetails { min-height: 0; display: flex; flex-direction: column; margin-top: 10px; }
  #mobileDetails[hidden] { display: none; }
  .mobile-tabs { display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; padding-bottom: 8px; }
  #mobileSheet .mobile-tabs button { white-space: nowrap; font-size: 12px; padding: 6px 10px; }
  #mobileSheet .mobile-tabs [aria-pressed="true"] { background: #d1f8ef; color: #0a262b; }
  #mobileContents { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
  /* These overrides only apply to panels while they are inside the mobile sheet. */
  #mobileSheet [data-mobile-panel] { display: none !important; }
  #mobileSheet .mobile-active-panel { visibility: visible !important; }
  #mobileSheet [data-mobile-panel].mobile-active-panel { display: block !important; position: static !important; width: 100% !important; height: auto !important; max-height: none !important; margin: 0 !important; padding: 0; transform: none !important; opacity: 1 !important; pointer-events: auto !important; overflow: visible !important; border: 0; box-shadow: none; border-radius: 0; background: transparent; }
  #mobileSheet .story-body, #mobileSheet .science-content { overflow: visible; padding: 12px 0; }
  #mobileSheet .story-head, #mobileSheet .panel-head { padding: 12px 0; }
  #mobileSheet .story-head h2 { font-size: 17px; }
  #mobileSheet .story-body h3 { font-size: 21px; }
  #mobileSheet .section { padding: 12px 0; }
  #mobileSheet .stat-grid, #mobileSheet .chapters, #mobileSheet #returnSketch, #mobileSheet #showMapControls, #mobileSheet #sketchPause, #mobileSheet #journey { display: none; }
  #mobileSheet .timeline-top { grid-template-columns: 1fr 70px; }
  #mobileSheet .mode-pill { grid-column: 1 / -1; width: fit-content; }
  #mobileSheet .science-tabs { flex-wrap: wrap; }
  #mobileSheet .station-sketch-nav { flex-wrap: wrap; }
  #mobileSheet .story-progress { grid-template-columns: repeat(5, 1fr); }
  #mobileSheet .story-step { padding: 6px; }
  body.mobile-experience .modal { padding: 12px; }
  body.mobile-experience .loading { top: 66px; transform: translateX(-50%); padding: 8px 12px; width: min(350px, calc(100% - 24px)); pointer-events: none; }
  body.mobile-experience .loading .eyebrow { display: none; }
  body.mobile-experience .loading.done { opacity: 0; }
  body.mobile-experience .walk-help { bottom: 95px; width: calc(100% - 28px); text-align: center; }
  body.compatibility-mode #mobileSheet { display: none; }
}
@media (max-width: 820px) and (max-height: 500px) {
  body.mobile-experience #mobileSheet { left: auto; width: min(360px, 55vw); }
  #mobileIntro { display: none; }
}
