/* Fold only touch-landscape navigation. Existing map, quest and Rune-action
   nodes remain the source of truth, including their original hidden states. */
#hudJourneyToggles[hidden], #hudJourneyPanels[hidden], #hudMinimapToggle[hidden],
#hudQuestToggle[hidden] { display: none !important; }
.hudMobileQuestLabel { display: none; }

body.touchDevice.mobileMatchMode .hudLayoutActive #hudJourneyStack[data-mobile-journey="true"] {
  width: max-content;
  max-width: calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - 16px);
  display: block;
  max-height: none;
  overflow: visible;
  pointer-events: none;
}
body.touchDevice.mobileMatchMode #hudJourneyStack[data-mobile-journey="true"] .hudJourneyToggles {
  display: flex;
  align-items: start;
  gap: 6px;
  width: max-content;
  pointer-events: none;
}
body.touchDevice.mobileMatchMode #hudJourneyToggles :is(#hudMinimapToggle, #hudQuestToggle) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 80px;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 8px 23px 8px 10px;
  box-sizing: border-box;
  border: 1px solid #9daec142;
  border-radius: 9px;
  background: #132132ed;
  box-shadow: 0 3px 10px #0004;
  color: #eadfc4;
  font: 700 12px/1.25 system-ui, sans-serif;
  text-align: left;
  pointer-events: auto;
  touch-action: manipulation;
}
body.touchDevice.mobileMatchMode #hudJourneyToggles #hudQuestToggle { width: 86px; }
body.touchDevice.mobileMatchMode #hudJourneyToggles .hudMobileQuestLabel { display: inline; }
body.touchDevice.mobileMatchMode #hudJourneyToggles :is(#hudMinimapToggle, #hudQuestToggle)::after {
  content: '+';
  position: absolute;
  right: 9px;
  top: 12px;
  color: #d9bc83;
  font: 600 16px/1 system-ui, sans-serif;
}
body.touchDevice.mobileMatchMode #hudJourneyToggles :is(#hudMinimapToggle, #hudQuestToggle)[aria-expanded="true"] {
  border-color: #d5b5789c;
  background: #293445;
}
body.touchDevice.mobileMatchMode #hudJourneyToggles :is(#hudMinimapToggle, #hudQuestToggle)[aria-expanded="true"]::after { content: '−'; }
body.touchDevice.mobileMatchMode #hudJourneyToggles button:focus-visible { outline: 2px solid #f3d492; outline-offset: 2px; }

/* Expanded reading stays beside the movement pad. On narrow phones both
   sections share this scroll region; collapse controls never scroll away. */
body.touchDevice.mobileMatchMode #hudJourneyStack[data-mobile-journey="true"] #hudJourneyPanels {
  position: absolute;
  top: 50px;
  left: calc(var(--mobile-move-size, 120px) + 12px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  width: min(300px, calc(100vw - var(--mobile-safe-left) - var(--mobile-safe-right) - var(--mobile-move-size, 120px) - var(--mobile-orbit-width, 210px) - 28px));
  min-width: 108px;
  max-height: calc(100dvh - var(--mobile-safe-top) - var(--mobile-safe-bottom) - 138px);
  padding: 5px;
  box-sizing: border-box;
  border: 1px solid #a3b4c442;
  border-radius: 10px;
  background: #0d1928f5;
  box-shadow: 0 7px 22px #0006;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  touch-action: pan-y pinch-zoom;
  pointer-events: auto;
  scroll-padding: 5px;
}
body.touchDevice.mobileMatchMode #hudJourneyStack[data-mobile-journey="true"][data-mobile-map-expanded="false"] #exploreMinimapHud,
body.touchDevice.mobileMatchMode #hudJourneyStack[data-mobile-journey="true"][data-mobile-quest-expanded="false"] #questTracker { display: none !important; }
body.touchDevice.mobileMatchMode #hudJourneyPanels :is(#exploreMinimapHud, #questTracker) { width: 100%; max-width: none; min-width: 0; }
body.touchDevice.mobileMatchMode #hudJourneyPanels #exploreMinimapHud { padding: 5px; }
body.touchDevice.mobileMatchMode #hudJourneyPanels .exploreMapOpen { min-height: 44px; }
body.touchDevice.mobileMatchMode #hudJourneyPanels .exploreMinimapArea { font-size: 11px; }
body.touchDevice.mobileMatchMode #hudJourneyPanels #questTracker { padding: 9px; box-sizing: border-box; }
body.touchDevice.mobileMatchMode #hudJourneyPanels #questTracker > .questTrackerHead { margin-bottom: 8px; }
body.touchDevice.mobileMatchMode #hudJourneyPanels .questTrackerHead > span { display: none; }
body.touchDevice.mobileMatchMode #hudJourneyPanels .questTrackerHead strong { font: 700 12px/1.4 system-ui, sans-serif; overflow-wrap: anywhere; }
body.touchDevice.mobileMatchMode #hudJourneyPanels #questTracker > #questTrackerTask { display: block; padding: 0; font: 500 12px/1.45 system-ui, sans-serif; }
body.touchDevice.mobileMatchMode #hudJourneyPanels .hudQuestDetails { max-height: none; overflow: visible; padding: 0; margin-top: 7px; }
body.touchDevice.mobileMatchMode #hudJourneyPanels #questTracker > #questTrackerRuneAction {
  min-height: 44px;
  margin: 9px 0 0;
  max-width: 100%;
  padding: 8px;
  font-size: 12px;
  white-space: normal;
}
