#mobileMenuOverview,#mobileSettingsBack,#questToggle,#questCollapse{display:none}
.menu-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--s3)}

/* Phone play in both orientations. Keep this after the feature stylesheets.
   Wide touch screens with little height need the same controls as portrait phones. */
@media (max-width:760px), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  :root{--map:96px;--gap:8px;--mobile-bar-height:70px}

  #hud .tl{max-width:calc(100vw - var(--map) - 3 * var(--gap) - var(--sl) - var(--sr))}
  #hud .tlrow{min-width:0;width:100%}
  #tracker{max-width:100%;max-height:min(38dvh,320px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  #tracker p{font-size:14px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  #tracker .qn{display:flex;font-size:15px;overflow-wrap:anywhere}
  #tracker .track-meta{flex-wrap:wrap}
  #tracker #trackMap{min-height:44px;min-width:44px;font-size:12px;padding-inline:var(--s1)}
  /* one row: the step's own action wider, Help and Hide beside it (a second row only for Resume or Open Bag) */
  #islandGuide .guide-actions{display:flex;flex-wrap:wrap}
  #islandGuide .guide-actions .btn{flex:1 1 0;min-width:0}
  #islandGuide #islandGuideGo{flex-grow:1.7}
  #islandGuideMain:not([hidden]),#islandGuideOpen:not([hidden]){flex-basis:100%}
  #islandGuide .btn{font-size:12px;padding:var(--s1);white-space:normal}
  #tracker #islandGuideText{font-size:13px;line-height:1.3}

  #hud .tr{display:flex;flex-direction:column;align-items:flex-end;width:var(--map)}
  #hud .orbs{order:2;display:flex;flex-direction:row;align-items:center;gap:var(--s1);padding:0}
  #hud .orbs .chips{display:none}
  #hud .orb{width:44px;height:44px}
  #hud .orb span{font-size:13px;margin-top:9px}
  #hud .orb svg{top:4px;width:12px;height:12px}
  #compass{width:44px;height:44px;left:-8px;top:-8px}
  #miniMapBtn{top:-8px}
  #hud .profile-chip{order:3;width:var(--map);min-height:44px;gap:6px;padding:var(--s1)}
  #hud .profile-avatar{width:28px;height:28px;font-size:18px}
  #hud .profile-chip-copy strong{font-size:14px}
  #hud .profile-chip-copy>span{font-size:11px}

  #gameControls{max-width:calc(100vw - var(--map) - 3 * var(--gap) - var(--sl) - var(--sr));gap:var(--s1)}
  #gameControls>.btn{min-height:44px;min-width:44px;padding:var(--s2);font-size:15px}
  #gameControls #menu{width:min(384px,calc(100vw - 2 * var(--gap) - var(--sl) - var(--sr)));max-height:calc(var(--mobile-height,100dvh) - 128px - var(--st) - var(--sb));scroll-padding-block:var(--s3)}
  #menu .menu-heading{position:sticky;top:0;z-index:3;background:var(--wood-surface);padding-block:var(--s1)}
  #gameControls:has(#menu.mobile-menu-mode){top:calc(var(--gap) + var(--st));max-width:calc(100vw - 2 * var(--gap) - var(--sl) - var(--sr))}
  #gameControls:has(#menu.mobile-menu-mode) #menuBtn{width:44px;height:44px;padding:var(--s2);gap:0;font-size:0}
  #gameControls:has(#menu.mobile-menu-mode) #menuBtn svg{display:block;width:24px;height:24px}
  #gameControls:has(#menu.mobile-menu-mode) #mapBtn{display:none}
  #gameControls #menu.mobile-menu-mode{top:52px;max-height:calc(var(--mobile-height,100dvh) - 76px - var(--st) - var(--sb))}
  #menu.mobile-menu-mode:not(.mobile-settings-open)>:not(.menu-heading):not(#mobileMenuOverview){display:none}
  #menu.mobile-menu-mode #mobileMenuOverview{display:grid;gap:var(--s3)}
  #menu.mobile-menu-mode.mobile-settings-open #mobileMenuOverview{display:none}
  #menu.mobile-menu-mode.mobile-settings-open #mobileSettingsBack{display:flex}
  #mobileMenuOverview .btn{min-height:44px;min-width:44px;font-size:16px}
  #mobileMenuOverview>.btn,#mobileLogoutSlot>.btn{width:100%;justify-content:flex-start}
  #mobileProfileSlot #profileBtn{width:100%;min-height:64px;padding:var(--s2);gap:var(--s3)}
  #mobileProfileSlot .profile-avatar{width:40px;height:40px;font-size:22px}
  #mobileProfileSlot .profile-chip-copy strong{font-size:18px}
  #mobileProfileSlot .profile-chip-copy>span{font-size:14px}
  #mobileOnlineCount{display:block;font-size:16px;font-weight:700;color:var(--wood-gold)}
  #mobileOnlineDetail{font-size:14px;line-height:1.35;overflow-wrap:anywhere}
  #mobileCommunitySlot #discordJoin{position:static;width:100%;justify-content:flex-start;font-size:16px}
  #mobileCommunitySlot #discordJoin span::before{content:'Discord · '}
  #mobileCommunitySlot #discordJoin svg{animation:none}
  #onlinePlayers{display:none}
  #menu :is(button,summary),#hud :is(button,[role=tab]),#shop button,#wmap button,#ctx button,dialog button{min-height:44px;min-width:44px}
  :is(.say,.wfinder,.arrival-dialog,.wardrobe) :is(input,select,textarea){font-size:16px;min-height:44px}

  #hud .br{position:static;width:auto}
  #hud #dock{position:static;padding:0;background:none;border:0;border-image:none;box-shadow:none;isolation:auto;max-height:none}
  #dock::before,#dock::after{display:none}
  #hud .mbar{
    position:fixed;left:0;right:0;bottom:0;z-index:var(--z-bar);
    display:grid;grid-template-columns:minmax(0,5fr) minmax(44px,1fr);gap:2px;
    padding:var(--s1) calc(var(--s1) + var(--sr)) calc(var(--s1) + var(--sb)) calc(var(--s1) + var(--sl));
    background:var(--wood-surface);background-size:auto,420px 420px;
    border-top:2px solid var(--wood-light);box-shadow:0 -4px 16px var(--wood-shadow);
  }
  #hud .tabs{min-width:0;gap:2px;grid-template-columns:repeat(6,minmax(44px,1fr))}
  #hud .tab{min-height:60px;min-width:44px;font-size:11px;padding-inline:0;flex-direction:column;gap:2px}
  #hud .tab .ti{height:24px}
  #hud .tab svg{width:24px;height:24px}
  #hud .ctab{display:flex}
  #hud .panel{
    position:fixed;left:0;right:0;bottom:calc(var(--mobile-bar-height) + var(--sb));z-index:var(--z-bar);
    max-height:min(62dvh,calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - var(--st) - var(--sb) - 16px));min-height:0;
    padding:0 calc(var(--s4) + var(--sr)) var(--s4) calc(var(--s4) + var(--sl));
    border:var(--s1) solid var(--wood-edge);border-bottom:0;border-radius:var(--s2) var(--s2) 0 0;
    background:var(--wood-surface);box-shadow:0 -1px 0 var(--wood-light),0 -8px 24px var(--wood-shadow);scrollbar-gutter:auto;
  }
  #panel .sheet-h{
    position:sticky;top:0;z-index:2;display:flex;
    margin:0 calc(-1 * var(--s4) - var(--sr)) var(--s3) calc(-1 * var(--s4) - var(--sl));
    padding:var(--s2) calc(var(--s4) + var(--sr)) var(--s3) calc(var(--s4) + var(--sl));
    background:var(--wood-divider) center bottom/100% 24px no-repeat,var(--wood-surface);
  }
  #panel .sheet-h button{width:44px;flex:none}
  #panel .pack-help summary{min-height:44px;padding-block:var(--s3)}
  #panel .slot{min-height:44px}
  #panel .skg{grid-template-columns:repeat(2,minmax(0,1fr))}

  #hud .bl{left:calc(var(--gap) + var(--sl));right:calc(var(--gap) + var(--sr));bottom:calc(var(--mobile-bar-height) + var(--sb) + 6px);width:auto}
  #hud.sheet .bl,#hud.sheet .event-feedback,#hud.sheet .search-cue{visibility:hidden}
  #hud.sheet .tl,#hud.sheet .tr{visibility:hidden}
  body:has(#menu:not([hidden])) #hud :is(.tl,.tr,.bl,.event-feedback,.search-cue){visibility:hidden}
  #chat.min:not(.has-recent-message){visibility:hidden;pointer-events:none}
  #hud:has(.event-feedback:not([hidden]) .feedback-card:not([hidden])) #chat.min{visibility:hidden;pointer-events:none}
  #chat{max-height:calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - var(--st) - var(--sb) - 24px)}
  #chat .chat-h{flex:none}
  #chat .chat-h [role=tab],#chat .chat-x{min-height:44px;min-width:44px}
  #chat .chat-h [role=tab]{padding-inline:var(--s2)}
  #chat .log{height:min(36dvh,240px);min-height:44px;flex:1 1 auto}
  #chat .say{flex:none}
  #chat.min .chat-h{display:none}
  #chat.min{background:rgba(23,17,11,.9)}
  #chat .ticker{font-size:13px}

  #dlg{
    left:calc(var(--gap) + var(--sl));right:calc(var(--gap) + var(--sr));bottom:calc(var(--mobile-bar-height) + var(--sb) + 8px);
    grid-template-columns:64px minmax(0,1fr);gap:var(--s3);padding:var(--s3);
    max-height:min(48dvh,calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - var(--st) - var(--sb) - 24px));overflow-y:auto;overscroll-behavior:contain;
  }
  #hud.talking #dlg{z-index:calc(var(--z-bar) + 1)}   /* a conversation that opens mid-fight sits above an open drawer */
  #dlg .portrait{width:64px;height:64px;margin-top:0}
  #dlg .plate{margin-top:0;max-width:100%;line-height:1.25;overflow-wrap:anywhere}
  #dlg p{font-size:16px;min-height:0}
  #dlg .dlg-f{flex-wrap:wrap;gap:var(--s2)}
  #dlg .kh{display:none}
  #dlgBtn{min-height:44px}

  #shop{
    left:0;top:0;transform:none;width:100%;height:var(--mobile-height,100dvh);max-height:none;border:0;border-image:none;
    padding:calc(var(--s2) + var(--st)) calc(var(--s3) + var(--sr)) calc(var(--s3) + var(--sb)) calc(var(--s3) + var(--sl));
  }
  #shop > *{flex-shrink:0} /* Details must not move item buttons during a touch. */
  .wardrobe button[aria-pressed=true]{color:var(--wood-ivory,#f6ecd2)}
  #shop .shop-h{position:sticky;top:0;z-index:2;min-height:52px;background:var(--wood-surface);padding-block:var(--s1)}
  #shop .shop-cols{grid-template-columns:minmax(0,1fr)}
  #shopX{width:44px;height:44px}
  #shop .sitem{min-height:58px}

  #wmap{padding:0}
  #wmap .wmap-in{border:0;border-image:none;padding:calc(var(--s2) + var(--st)) calc(var(--s2) + var(--sr)) calc(var(--s2) + var(--sb)) calc(var(--s2) + var(--sl))}
  #wmap .wmap-h{gap:var(--s1)}
  #wmap .wmap-h h2{font-size:18px;padding-right:112px;min-height:44px}
  #wmap #wtabs{min-width:0;margin-right:0;gap:var(--s1)}
  #wmap #wtabs button{min-width:0;padding-inline:var(--s2);font-size:14px}
  #wmap .wrose{display:none}
  body.map-open #gameControls{max-width:none;right:calc(64px + var(--sr));top:calc(var(--s2) + var(--st))}
  #wmap .wsearch-row input{font-size:16px}
  #wmap .wfoot{font-size:13px;gap:var(--s1);line-height:1.2}
  /* The finder and chart share the remaining height beneath the icon tabs. */
  #wmap:has(.wlayout) .wmap-in{overflow:hidden}
  #wmap:has(.wlayout) .wmap-h{display:grid;grid-template-columns:minmax(0,1fr) 44px}
  #wmap:has(.wlayout) .wmap-h h2{grid-column:1;grid-row:1;padding-right:0}
  #wmap:has(.wlayout) #wtabs{grid-column:1/-1;grid-row:2;width:100%}
  #wmap:has(.wlayout) #wmapX{grid-column:2;grid-row:1}
  #wmap:has(.wlayout) :is(.wmap-h,.wfoot){flex-shrink:0}
  #wmap .wlayout{flex:1 1 0;min-height:0;overflow:hidden}
  #wmap .wlayout .wfinder{max-height:min(45%,calc(100% - 120px));overflow-y:auto;overscroll-behavior:contain}
  #wmap .wlayout .wresults{position:static;flex:none;max-height:144px;box-shadow:none}
  #wmap .wlayout .wbody{flex:1 1 0;min-height:0}
  #wmap .wlayout .wctl{right:var(--s2);bottom:var(--s2);display:grid;grid-template-columns:44px 44px;gap:var(--s1)}
  #wmap .wlayout .wlocal{left:var(--s2);bottom:var(--s2);display:flex;flex-direction:column;max-width:calc(100% - 112px);max-height:calc(100% - 16px)}
  #wmap .wlayout .wlocalkey{flex:1 1 auto;min-height:0;max-height:none}
  #wmap .wlayout .wlocal button{flex:none}
  #ctx{max-width:calc(100vw - 16px - var(--sl) - var(--sr));max-height:calc(var(--mobile-height,100dvh) - 16px - var(--st) - var(--sb));overflow-y:auto;overscroll-behavior:contain}
  #ctx button{white-space:normal;overflow-wrap:anywhere}
  #tip{max-width:min(260px,calc(100vw - 16px - var(--sl) - var(--sr)))}
  #hover{display:none}
  #hud .event-feedback{max-height:calc(var(--mobile-height,100dvh) - max(calc(220px + var(--st)),var(--quest-feedback-top,220px)) - var(--mobile-bar-height) - var(--sb) - 16px);overflow-y:auto;overscroll-behavior:contain}
  #hud .feedback-card{pointer-events:auto}
  #hud .feedback-actions{flex-wrap:wrap}

  dialog:is(.arrival-dialog,.profile-dialog,.island-handbook,.wardrobe,.skilling-dialog,#quantityDialog,.game-logout-dialog){
    inset:var(--st) var(--sr) var(--sb) var(--sl);margin:auto;
    max-width:calc(100vw - 16px - var(--sl) - var(--sr));max-height:calc(var(--mobile-height,100dvh) - 16px - var(--st) - var(--sb));
    overscroll-behavior:contain;
  }
  #cloudNotice{bottom:calc(var(--mobile-bar-height) + var(--sb) + var(--s2));max-width:calc(100vw - 16px - var(--sl) - var(--sr));max-height:calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - var(--st) - var(--sb) - 24px);overflow-y:auto}
  body.arriving .arrival{left:calc(var(--gap) + var(--sl));width:min(340px,calc(100vw - 2 * var(--gap) - var(--sl) - var(--sr)))}

  /* The browser keeps its layout viewport when the phone keyboard opens.
     The visual viewport height is supplied only while an editable field owns focus. */
  .keyboard-open #hud .mbar{visibility:hidden;pointer-events:none}
  .keyboard-open #hud .tl,.keyboard-open #hud .tr,.keyboard-open #hud .event-feedback,.keyboard-open #hud .search-cue{visibility:hidden}
  .keyboard-open #hud .bl{bottom:calc(var(--keyboard-inset,0px) + var(--s2));max-height:calc(var(--mobile-height,100dvh) - 16px - var(--st) - var(--sb))}
  .keyboard-open #chat{max-height:calc(var(--mobile-height,100dvh) - 16px - var(--st) - var(--sb))}
  .keyboard-open #chat .log{height:auto;max-height:calc(var(--mobile-height,100dvh) - 128px - var(--st) - var(--sb))}
  .keyboard-open #wmap{top:var(--mobile-top,0px);bottom:auto;height:var(--mobile-height,100dvh)}
  .keyboard-open #wmap .wmap-in{overflow-y:auto}
  .keyboard-open #wmap .wlayout{flex:none;min-height:240px}
  .keyboard-open dialog:is(.arrival-dialog,.profile-dialog,.island-handbook,.wardrobe,.skilling-dialog,#quantityDialog,.game-logout-dialog){top:calc(var(--mobile-top,0px) + var(--s2) + var(--st));bottom:auto}
}

/* The current goal shares the menu row and expands only when requested. */
@media (max-width:760px), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tlrow{margin-top:0}
  #hud .tl .logo{display:none}
  #hud .tl #tracker{position:relative;padding:0;border:0;background:none;box-shadow:none;overflow:visible;max-height:none;width:100%;pointer-events:none}
  #hud #questToggle,#hud #trackerContent{pointer-events:auto}
  #hud .tl #tracker.quest-folded{width:44px;height:44px}
  #hud .tl #tracker.quest-folded{left:52px}
  #hud .tl #tracker.quest-folded #questToggle{left:0}
  #hud #questToggle{display:grid;place-items:center;position:relative;left:52px;width:44px;height:44px;padding:var(--s2);color:var(--wood-gold)}
  #questToggle svg{width:26px;height:26px}
  #hud #trackerContent{margin-top:var(--s2);padding:var(--s3);border:1px solid var(--wood-light);border-radius:var(--s1);background:var(--wood-quest-surface);box-shadow:var(--wood-bevel),var(--wood-elevation);max-height:min(38dvh,calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - 76px - var(--st) - var(--sb)));overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:var(--s2);scrollbar-width:thin}
  #hud #questCollapse{display:flex;float:right;width:44px;height:44px;margin:calc(-1 * var(--s1)) calc(-1 * var(--s1)) var(--s1) var(--s2);padding:var(--s2);font-size:24px}
}

/* Portrait status stays around the smaller minimap. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .tl{width:calc(100vw - 2 * var(--gap) - var(--sl) - var(--sr));max-width:none}
  html.portrait-hud #hud .tl .logo{display:none}
  html.portrait-hud #hud .tlrow{margin-top:0}
  html.portrait-hud #hud .tr{display:block;width:var(--map)}
  html.portrait-hud #onlinePlayers{display:none}
  html.portrait-hud #hud .mapring .orbs{position:absolute;left:0;right:0;bottom:-12px;z-index:2;display:flex;flex-direction:row;justify-content:space-between;pointer-events:none}
  html.portrait-hud #hud .mapring #runOrb{pointer-events:auto}
  html.portrait-hud #hud .mapring #compass{z-index:3}
  html.portrait-hud #hud .mapring #skyMark{z-index:4}   /* the sun or moon stays above the compass rim */

  html.portrait-hud #hud #tracker{width:min(344px,100%);max-width:100%;max-height:none;padding:0;border:0;background:none;box-shadow:none;overflow:visible}
  html.portrait-hud #hud #tracker.quest-folded{width:44px;height:44px}
  html.portrait-hud #hud #questToggle{display:grid;place-items:center;width:44px;height:44px;padding:var(--s2);color:var(--wood-gold)}
  html.portrait-hud #questToggle svg{width:26px;height:26px}
  html.portrait-hud #hud #trackerContent{
    margin-top:calc(var(--map) - 20px);padding:var(--s3);border:1px solid var(--wood-light);border-radius:var(--s1);
    background:var(--wood-quest-surface);background-size:auto,320px 320px;box-shadow:var(--wood-bevel),var(--wood-elevation);
    max-height:min(38dvh,max(64px,calc(var(--search-cue-top,var(--mobile-height,100dvh)) - var(--map) - 108px - var(--st))));
    overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:var(--s2);scrollbar-width:thin;
  }
  html.portrait-hud #hud #questCollapse{display:flex;float:right;width:44px;height:44px;margin:calc(-1 * var(--s1)) calc(-1 * var(--s1)) var(--s1) var(--s2);padding:var(--s2);font-size:24px}
  html.portrait-hud #hud:has(#searchCue:not([hidden])):has(#tracker:not(.quest-folded)) #chat:not(.min) .log{max-height:44px}
  html.portrait-hud #hud:has(#searchCue:not([hidden])):has(#tracker:not(.quest-folded)) #chat:not(.min) #sayF{padding-block:2px}
  html.portrait-hud #hud .event-feedback{
    top:max(calc(var(--map) + 28px + var(--st)),var(--quest-feedback-top,144px));
    max-height:max(0px,calc(min(var(--search-cue-top,var(--mobile-height,100dvh)),calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - var(--sb) - 8px)) - max(calc(var(--map) + 28px + var(--st)),var(--quest-feedback-top,144px)) - 8px));
  }
}

/* Six 44px targets fit even a 320px phone; safe-area insets stay reserved. */
@media (max-width:360px){
  #hud .mbar{padding-inline:var(--sl) var(--sr);gap:0}
  #hud .tabs{gap:0}
  #gameControls>.btn svg{display:none}
  #hud .panel{padding-inline:var(--s3)}
  #panel .sheet-h{margin-inline:calc(-1 * var(--s3));padding-inline:var(--s3)}
  #dlg{grid-template-columns:48px minmax(0,1fr);gap:var(--s2)}
  #dlg .portrait{width:48px;height:48px}
}

/* Rotate naturally: keep the world open between compact corner controls.
   Panels become a scrolling drawer, while the chart and its finder sit together. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  :root{--map:88px;--mobile-bar-height:58px}
  #hud .tl .logo{display:none}
  #hud .tl{width:min(232px,32vw);max-width:calc(100vw - var(--map) - 72px - var(--sl) - var(--sr))}
  #hud .tlrow{margin-top:0}
  #gameControls{top:calc(var(--gap) + var(--st));max-width:calc(100vw - var(--map) - 80px - var(--sl) - var(--sr))}
  #gameControls #menu{max-height:calc(var(--mobile-height,100dvh) - 76px - var(--st) - var(--sb))}
  #tracker{max-height:calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - 76px - var(--st) - var(--sb));padding:var(--s2)}
  #tracker p{-webkit-line-clamp:2}
  #tracker #islandGuideText{max-height:none;overflow:visible}
  #hud .tr{display:grid;grid-template-columns:44px var(--map);width:calc(var(--map) + 52px);gap:var(--s2)}
  #hud .orbs{grid-column:1;grid-row:1;order:initial;flex-direction:column;gap:var(--s1)}
  #hud .mapring{grid-column:2;grid-row:1}
  #hud .profile-chip{grid-column:1/-1;grid-row:2;order:initial;width:100%;min-height:44px}
  #hud .mbar{padding-block:var(--s1) calc(var(--s1) + var(--sb))}
  #hud .tab{min-height:48px;gap:0}
  #hud .tab .ti{height:22px}
  #hud .tab svg{width:22px;height:22px}
  #hud .panel{
    left:auto;right:calc(var(--gap) + var(--sr));width:min(344px,56vw);min-width:256px;
    max-height:calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - 2 * var(--gap) - var(--st) - var(--sb));
    padding:0 var(--s3) var(--s3);border-bottom:var(--s1) solid var(--wood-edge);border-radius:var(--s2);
  }
  #panel .sheet-h{margin-inline:calc(-1 * var(--s3));padding-inline:var(--s3)}
  #hud.sheet .tr{visibility:hidden}
  #hud .bl{right:auto;width:min(420px,calc(100vw - 2 * var(--gap) - var(--sl) - var(--sr)))}
  #chat .log{height:18dvh;min-height:44px}
  #chat .chat-h [role=tab]{padding-inline:var(--s2)}
  #dlg{max-width:640px;max-height:calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - 24px - var(--st) - var(--sb));grid-template-columns:64px minmax(0,1fr)}
  #dlg .portrait{width:64px;height:64px}
  #dlg p{line-height:1.35}
  #shop .shop-cols{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  #shop .shop-h{min-height:44px}

  #wmap .wmap-in{gap:var(--s1);overflow:hidden}
  #wmap .wmap-h{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:var(--s1)}
  #wmap .wmap-h h2{grid-column:1;grid-row:1;font-size:18px}
  #wmap .wmap-h h2 small{display:none}
  #wmapX{grid-column:2;grid-row:1}
  #wmap #wtabs{grid-column:1/-1;grid-row:2;width:100%;min-height:44px}
  /* The legacy map keeps separate account and presence rows. Its header
     fits on one line so the chart still holds every 44px map control. */
  #wmap:not(:has(.wlayout)) .wmap-h{grid-template-columns:minmax(0,1fr) auto 44px}
  #wmap:not(:has(.wlayout)) .wmap-h h2{padding-right:0;min-height:44px}
  #wmap:not(:has(.wlayout)) #wtabs{grid-column:2;grid-row:1;width:auto;min-height:44px}
  #wmap:not(:has(.wlayout)) #wmapX{grid-column:3;grid-row:1}
  #wmap:has(.wlayout) .wmap-h{grid-template-columns:minmax(0,1fr) auto 44px}
  #wmap:has(.wlayout) #wtabs{grid-column:2;grid-row:1;width:auto}
  #wmap:has(.wlayout) #wmapX{grid-column:3;grid-row:1}
  #wmap .wlayout .wfinder{max-height:none}
  #wmap .wlayout{display:grid;grid-template-columns:minmax(208px,32%) minmax(0,1fr);flex:1;min-height:0;gap:var(--s2)}
  #wmap .wlayout .wbody{min-width:0;min-height:0}
  #wmap .wfinder{min-width:0;min-height:0;overflow-y:auto;padding:var(--s2);gap:var(--s1)}
  #wmap .wfinder label{font-size:13px}
  #wmap .wresults{display:none;position:static;flex:none;max-height:144px;padding:var(--s1);box-shadow:none}
  #wmap .wfinder.searching .wresults{display:flex}
  #wmap .wdestination{padding-top:var(--s2)}
  #wmap .wdestination h3{font-size:18px}
  #wmap .wdest-actions{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px}
  #wmap #wdestClear{grid-column:auto}
  #wmap .wctl{right:var(--s2);bottom:var(--s2);display:grid;grid-template-columns:44px 44px;gap:var(--s1)}
  #wmap .wlocal{left:var(--s2);bottom:var(--s2);max-width:calc(100% - 112px)}
  #wmap .wlocalkey{max-height:calc(var(--mobile-height,100dvh) - 168px);padding:var(--s2);font-size:11px}
  #wmap #whint{display:none}
  #wmap .wsearch-status{display:none}

  #hud .event-feedback{top:calc(var(--gap) + var(--st));left:max(34%,calc(248px + var(--sl)));right:calc(var(--map) + 72px + var(--sr));width:auto;min-width:0;transform:none;gap:var(--s1);max-height:calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - var(--st) - var(--sb) - 24px);overflow-y:auto}
  #hud .feedback-receipt:nth-child(n+2){display:none}
  #hud .feedback-card{padding:var(--s2)}
  #hud .feedback-title{font-size:17px}
  #hud .feedback-detail{font-size:13px}
  #hud .feedback-quest .feedback-detail{max-height:3.9em;overflow:auto}
  #hud:has(#searchCue:not([hidden])) .event-feedback{max-height:min(calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - var(--st) - var(--sb) - 24px),max(0px,calc(var(--search-cue-top,var(--mobile-height,100dvh)) - var(--st) - 16px)))}
  #hud .search-cue{left:calc(min(232px,32vw) + 2 * var(--gap) + var(--sl));right:auto;bottom:max(calc(var(--mobile-bar-height) + var(--sb) + 44px),var(--search-chat-clearance,0px));width:min(380px,calc(100vw - min(232px,32vw) - var(--map) - 96px - var(--sl) - var(--sr)));padding:var(--s2)}
  #hud:has(#chat:not(.min)) .bl{left:auto;right:calc(var(--gap) + var(--sr));width:min(344px,calc(100vw - min(232px,32vw) - 3 * var(--gap) - var(--sl) - var(--sr)))}
  #searchCue:not([hidden])~.bl .chat:not(.min) .log{max-height:44px}
  .arrival-dialog .arrival-look{grid-template-columns:120px minmax(0,1fr)}
  .arrival-look canvas{width:120px;height:132px}
  body.arriving .arrival{top:calc(60px + var(--st));max-height:calc(var(--mobile-height,100dvh) - 68px - var(--st) - var(--sb));padding:var(--s3)}
  #ztitle{top:calc(var(--s2) + var(--st));max-width:calc(100vw - 2 * var(--gap) - var(--sl) - var(--sr))}
  #ztitle .card{padding-block:var(--s1)}
  #ztitle .zs,#ztitle .rebung{display:none}
  #sail{padding:calc(var(--s2) + var(--st)) calc(var(--s2) + var(--sr)) calc(var(--s2) + var(--sb)) calc(var(--s2) + var(--sl))}
  #sail .chart{width:min(440px,100%);max-height:100%;overflow-y:auto}
  #sail .chart svg{max-height:calc(var(--mobile-height,100dvh) - 104px - var(--st) - var(--sb))}
}

@media (max-width:700px) and (max-height:600px) and (orientation:landscape){
  #hud .search-cue strong,#hud .search-cue p{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  /* Keep both notice actions in one 44px row inside the short scroll lane. */
  #hud .feedback-actions{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:var(--s1)}
  #hud .feedback-actions .feedback-button{min-width:0;padding-inline:var(--s1);font-size:13px}
  /* Float channel controls and Close beside the first message so the cue and
     a scrollable notice still fit above a public composer. */
  #hud:has(#searchCue:not([hidden])) #chat:has(#sayF:not([hidden])){position:relative}
  #hud:has(#searchCue:not([hidden])) #chat:has(#sayF:not([hidden])) .chat-h{position:absolute;right:0;top:0;z-index:2;padding:0;border:0;background:none}
  #hud:has(#searchCue:not([hidden])) #chat:has(#sayF:not([hidden])) .log{padding-right:264px}
}

@media (pointer:coarse) and (min-width:700px) and (max-height:600px) and (orientation:landscape){
  #wmap .wmap-h{grid-template-columns:minmax(0,1fr) 44px;gap:var(--s2)}
  #wmap .wmap-h h2{padding-right:0}
  #wmap #wtabs{grid-column:2;grid-row:1}
  #wmapX{grid-column:2}
}

.mobile-compass-ring{display:none}
/* Keep the phone map and supplies readable without covering its touch target. */
@media (max-width:760px) and (orientation:portrait){
  :root{--map:144px}
  #hud .mapring .orbs .chips{display:flex;position:absolute;top:52px;right:0;gap:4px;align-items:flex-end;flex-direction:column}
  #hud .mapring .orbs .chip{min-height:24px;font-size:12px;padding:3px 7px}
  #hud #compass{pointer-events:auto;touch-action:manipulation}
  #hud.sheet .tl{visibility:hidden}
}

/* The map is the compass: the frame and directions turn with the chart. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring::before{display:none}
  html.portrait-hud #hud .mapring .ring,html.portrait-hud #hud .mapring #compass{display:none}
  html.portrait-hud #hud #mini{left:12%;top:12%;width:76%;height:76%}
  html.portrait-hud #hud .mobile-compass-ring{display:block;position:absolute;inset:0;z-index:1;pointer-events:none;background:url('images/compass-frame.png') center/contain no-repeat;transform:rotate(var(--heading,0rad));filter:drop-shadow(0 2px 2px #22180d99)}
  html.portrait-hud #hud .mobile-compass-ring span{position:absolute;width:16px;height:16px;display:grid;place-items:center;font:700 11px/1 Georgia,serif;color:#fbe8b4;text-shadow:0 1px 2px #220c07;transform:translate(-50%,-50%) rotate(calc(-1 * var(--heading,0rad)))}
  html.portrait-hud #hud .mobile-compass-ring .north{left:50%;top:12%}
  html.portrait-hud #hud .mobile-compass-ring .east{left:89%;top:50%}
  html.portrait-hud #hud .mobile-compass-ring .south{left:50%;top:87%}
  html.portrait-hud #hud .mobile-compass-ring .west{left:11%;top:50%}
  html.portrait-hud #hud .mapring .orbs{z-index:2}
}

/* Carved status plate below the portrait compass. */
.bullet-chip{display:none}
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring .orbs{left:auto;right:50%;bottom:auto;top:calc(100% - 5px);transform:translateX(50%);width:160px;padding:7px;display:grid;grid-template-columns:1fr;gap:4px;background:var(--wood-surface);background-size:auto,240px 240px;border:2px solid var(--wood-light);border-radius:8px;box-shadow:var(--wood-bevel),var(--wood-elevation);pointer-events:none}
  html.portrait-hud #hud .mapring .orb{width:100%;height:23px;border-radius:12px;border:1px solid #aa8149;background:#1b130e;box-shadow:inset 0 1px 3px #000;overflow:hidden}
  html.portrait-hud #hud .mapring .orb i{left:25px;right:2px;top:3px;bottom:3px;width:auto;height:auto;border-radius:8px;transform-origin:left center;transform:scaleX(var(--f,1))}
  html.portrait-hud #hud .mapring .orb::before{position:absolute;left:5px;z-index:2;font:14px/1 sans-serif;text-shadow:0 1px #000}
  html.portrait-hud #hud #hpOrb::before{content:'♥';color:#ff7b69}
  html.portrait-hud #hud #runOrb::before{content:'ϟ';color:#f8d779}
  html.portrait-hud #hud .mapring .orb::after{display:none}
  html.portrait-hud #hud .mapring .orb span{z-index:2;margin:0;font:700 12px/1 var(--display);text-shadow:0 1px 2px #000}
  html.portrait-hud #hud .mapring .orbs .chips{position:static;display:flex;flex-direction:row;justify-content:space-between;gap:2px;width:100%}
  html.portrait-hud #hud .mapring .orbs .chip{min-width:0;min-height:23px;padding:3px 4px;gap:2px;font:700 10px/1 var(--mono);border-radius:4px}
  html.portrait-hud #hud .mapring .orbs .chip svg{width:12px;height:12px}
  html.portrait-hud #hud .mapring .orbs .bullet-chip{display:flex}
  html.portrait-hud #hud .mapring #runOrb{pointer-events:auto;min-width:44px;min-height:44px;margin-block:-10px;z-index:3}
  html.portrait-hud #hud .mapring #runOrb i{top:13px;bottom:13px}
  html.portrait-hud #hud .mapring #runOrb::before{top:15px}
}

/* A carved teak plate joins the status display to the compass. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring .orbs{width:190px;padding:18px 23px 17px;gap:3px;border:0;border-radius:0;background:url('images/status-carved-panel.png') center/100% 100% no-repeat;box-shadow:none}
  html.portrait-hud #hud .mapring .orb{border-color:#b79255;background:linear-gradient(#17100c,#2e1c10);box-shadow:0 1px 1px #d3aa61,inset 0 2px 4px #000}
  html.portrait-hud #hud .mapring .orb i{box-shadow:inset 0 1px 2px #fff7,inset 0 -2px 2px #0005}
  html.portrait-hud #hud .mapring #runOrb{margin:0;min-height:44px;height:44px;background:transparent;border:0;box-shadow:none;overflow:visible}
  html.portrait-hud #hud .mapring #runOrb::after{content:'';display:block;position:absolute;inset:10px 0;border-radius:12px;background:linear-gradient(#17100c,#2e1c10);border:1px solid #b79255;box-shadow:inset 0 2px 4px #000;z-index:-1}
  html.portrait-hud #hud .mapring .orbs .chip{color:#fce5b0;background:linear-gradient(#4b301d,#24170f);border:1px solid #98713e;box-shadow:inset 0 1px #c69a5b55;font-size:10px}
}

/* Enamel medallions and inset, shaded meters for the mobile status plate. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring #hpOrb::before,
  html.portrait-hud #hud .mapring #runOrb::before{content:'';position:absolute;left:0;top:0;width:24px;height:24px;background:center/contain no-repeat;z-index:3;filter:drop-shadow(0 1px 1px #140b06)}
  html.portrait-hud #hud .mapring #hpOrb::before{background-image:url('images/health-medallion.png')}
  html.portrait-hud #hud .mapring #runOrb::before{top:10px;background-image:url('images/run-medallion.png')}
  html.portrait-hud #hud .mapring .orb.hp i{background:linear-gradient(#ff9380 0%,#eb4b3c 25%,#af261e 65%,#711912 100%)}
  html.portrait-hud #hud .mapring .orb.run i{background:linear-gradient(#a8eced 0%,#35bacb 25%,#147486 65%,#124856 100%)}
  html.portrait-hud #hud .mapring .orb.run.tired i{background:linear-gradient(#b7ac8d,#73644c)}
  html.portrait-hud #hud .mapring .orb span{color:#fff7db;text-shadow:0 1px 2px #210e08,0 0 3px #210e08}
}

/* Brass-rimmed wells with rounded enamel fills, matching the carved panel. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring .orb.hp{border:1px solid #aa7b3c;background:linear-gradient(#120b08,#382517 50%,#140d09);box-shadow:0 1px 1px #d7b57a,inset 0 0 0 1px #382313,inset 0 2px 4px #000}
  html.portrait-hud #hud .mapring .orb.run::after{z-index:0;border:1px solid #aa7b3c;background:linear-gradient(#120b08,#382517 50%,#140d09);box-shadow:0 1px 1px #d7b57a,inset 0 0 0 1px #382313,inset 0 2px 4px #000}
  html.portrait-hud #hud .mapring .orb i{z-index:1;left:25px;right:4px;border-radius:9px;box-shadow:inset 0 1px 1px #fff9,inset 0 -2px 2px #0008,0 0 2px #000}
  html.portrait-hud #hud .mapring .orb.hp i{background:linear-gradient(to bottom,#ffb49b 0%,#fb5e45 17%,#db3123 46%,#a11d18 51%,#b9231b 77%,#71120f 100%)}
  html.portrait-hud #hud .mapring .orb.run i{background:linear-gradient(to bottom,#b6ffff 0%,#4ce0eb 17%,#11a6c3 46%,#08768d 51%,#098da6 77%,#065366 100%)}
  html.portrait-hud #hud .mapring .orb.run.tired i{background:linear-gradient(#c9b89b,#8e7a5c 48%,#65543c 52%,#88765a)}
}

/* Individual meters float below the map, with medallions outside the wells. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring .orbs{width:168px;padding:0;gap:0;background:none;border:0;box-shadow:none}
  html.portrait-hud #hud .mapring .orb.hp,
  html.portrait-hud #hud .mapring .orb.run{height:32px;min-height:32px;overflow:visible;background:none;border:0;box-shadow:none;isolation:isolate}
  html.portrait-hud #hud .mapring .orb.hp::after,
  html.portrait-hud #hud .mapring .orb.run::after{content:'';display:block;position:absolute;inset:6px 0 6px 21px;width:auto;height:auto;border:1px solid #aa7b3c;border-radius:12px;background:linear-gradient(#120b08,#382517 50%,#140d09);box-shadow:0 1px 1px #d7b57a,inset 0 0 0 1px #382313,inset 0 2px 4px #000;z-index:0}
  html.portrait-hud #hud .mapring .orb.hp i,
  html.portrait-hud #hud .mapring .orb.run i{left:24px;right:3px;top:9px;bottom:9px;height:auto;z-index:1}
  html.portrait-hud #hud .mapring #hpOrb::before,
  html.portrait-hud #hud .mapring #runOrb::before{left:0;top:4px;width:24px;height:24px}
  html.portrait-hud #hud .mapring #runOrb{min-height:44px;height:44px;margin:-6px 0}
  html.portrait-hud #hud .mapring #runOrb::after{top:12px;bottom:12px}
  html.portrait-hud #hud .mapring #runOrb i{top:15px;bottom:15px}
  html.portrait-hud #hud .mapring #runOrb::before{top:10px}
  html.portrait-hud #hud .mapring .orbs .chips{padding-top:3px}
}

/* Larger medallions lead into shorter, attached meters. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring .orbs{width:144px}
  html.portrait-hud #hud .mapring .orb.hp::after,
  html.portrait-hud #hud .mapring .orb.run::after{left:27px}
  html.portrait-hud #hud .mapring .orb.hp i,
  html.portrait-hud #hud .mapring .orb.run i{left:30px}
  html.portrait-hud #hud .mapring #hpOrb::before,
  html.portrait-hud #hud .mapring #runOrb::before{width:32px;height:32px;top:0}
  html.portrait-hud #hud .mapring #runOrb::before{top:6px}
}

/* A single carved strip groups the three supplies beneath the meters. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring .orbs{width:166px;gap:3px}
  html.portrait-hud #hud .mapring .orb.hp{height:38px;min-height:38px}
  html.portrait-hud #hud .mapring .orb.hp::after{left:34px;top:9px;bottom:9px}
  html.portrait-hud #hud .mapring .orb.hp i{left:37px;top:12px;bottom:12px}
  html.portrait-hud #hud .mapring #hpOrb::before{width:38px;height:38px;top:0}
  html.portrait-hud #hud .mapring #runOrb::before{width:38px;height:38px;top:3px}
  html.portrait-hud #hud .mapring #runOrb::after{left:34px}
  html.portrait-hud #hud .mapring #runOrb i{left:37px}
  html.portrait-hud #hud .mapring .orbs .chips{padding:5px 9px;gap:3px;border:1px solid #a77c45;border-radius:6px;background:var(--wood-surface);background-size:auto,240px 240px;box-shadow:var(--wood-bevel),0 2px 4px #1b110bb3;align-items:center}
  html.portrait-hud #hud .mapring .orbs .chip{flex:1;justify-content:center;padding:2px 1px;background:none;border:0;box-shadow:none;white-space:nowrap}
}

/* Keep each supply icon distinct and its abbreviated count legible. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring .orbs .chip{gap:3px;min-width:0;font-size:11px;font-variant-numeric:tabular-nums}
  html.portrait-hud #hud .mapring .orbs .chip svg{width:15px;height:15px;display:block}
  html.portrait-hud #hud .mapring .orbs .chip>span:first-child{flex:none}
}

/* Anchor the wider status strip to the same safe right edge as the map. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .tr{right:calc(var(--gap) + var(--sr));top:calc(var(--gap) + var(--st))}
  html.portrait-hud #hud .mapring .orbs{right:0;left:auto;transform:none;width:min(166px,calc(100vw - 2 * var(--gap) - var(--sl) - var(--sr)))}
}

@media (max-width:760px) and (orientation:portrait){html.portrait-hud #hud .mapring #hpOrb>svg,html.portrait-hud #hud .mapring #runOrb>svg{display:none}}

/* Keep north reset on the approved N medallion, using the existing semantic button. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud .mapring #compass{--compass-top:max(0px,calc(var(--map) * .12 - 22px));display:grid;place-items:center;left:calc(50% - 22px);right:auto;top:var(--compass-top);width:44px;height:44px;padding:0;background:transparent;border:0;box-shadow:none;color:transparent;transform-origin:22px calc(var(--map) * .5 - var(--compass-top));transform:rotate(var(--heading,0rad));z-index:3}
  html.portrait-hud #hud .mapring #compass>i{visibility:hidden}
  html.portrait-hud #hud .mapring #compass:focus-visible{outline:3px solid var(--brass-300,#f3d27a);outline-offset:2px;border-radius:50%}
}

/* Keep the map visible above open phone panels and reserve space for its meters. */
@media (max-width:760px) and (orientation:portrait){
  html.portrait-hud #hud.sheet .tr{visibility:visible}
  html.portrait-hud #hud .tr>.daily-shortcut{top:calc(100% + 116px)}
  html.portrait-hud #hud.sheet .tr>.daily-shortcut{visibility:hidden}
  html.portrait-hud #hud.sheet .panel{max-height:min(62dvh,max(120px,calc(var(--mobile-height,100dvh) - var(--mobile-bar-height) - var(--map) - 120px - var(--st) - var(--sb))))}
}
/* Use the same compass chart on phones held sideways. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  :root{--map:112px}
  #hud{--map:112px}
  #hud .mapring::before,#hud .mapring .ring{display:none}
  #hud #mini{left:12%;top:12%;width:76%;height:76%}
  #hud .mobile-compass-ring{display:block;position:absolute;inset:0;z-index:1;pointer-events:none;background:url('images/compass-frame.png') center/contain no-repeat;transform:rotate(var(--heading,0rad));filter:drop-shadow(0 2px 2px #22180d99)}
  #hud .mobile-compass-ring span{position:absolute;width:16px;height:16px;display:grid;place-items:center;font:700 11px/1 Georgia,serif;color:#fbe8b4;text-shadow:0 1px 2px #220c07;transform:translate(-50%,-50%) rotate(calc(-1 * var(--heading,0rad)))}
  #hud .mobile-compass-ring .north{left:50%;top:12%}
  #hud .mobile-compass-ring .east{left:89%;top:50%}
  #hud .mobile-compass-ring .south{left:50%;top:87%}
  #hud .mobile-compass-ring .west{left:11%;top:50%}
  #hud .mapring #compass{--compass-top:max(0px,calc(var(--map) * .12 - 22px));z-index:4;left:calc(50% - 22px);top:var(--compass-top);width:44px;height:44px;background:transparent;border:0;box-shadow:none;transform-origin:22px calc(var(--map) * .5 - var(--compass-top));transform:rotate(var(--heading,0rad))}
  #hud .mapring #miniMapBtn{left:auto;right:calc(100% + 4px);top:0}
  #hud .mapring #compass .compass-face,#hud .mapring #compass>i{visibility:hidden}
  #hud .mapring #compass:focus-visible{outline:3px solid var(--brass-300,#f3d27a);outline-offset:2px}
}

/* Landscape uses the same status artwork and meters. */
.bullet-chip{display:none}
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr .orbs{left:auto;right:50%;bottom:auto;top:calc(100% - 5px);transform:translateX(50%);width:160px;padding:7px;display:grid;grid-template-columns:1fr;gap:4px;background:var(--wood-surface);background-size:auto,240px 240px;border:2px solid var(--wood-light);border-radius:8px;box-shadow:var(--wood-bevel),var(--wood-elevation);pointer-events:none}
  #hud .tr .orb{width:100%;height:23px;border-radius:12px;border:1px solid #aa8149;background:#1b130e;box-shadow:inset 0 1px 3px #000;overflow:hidden}
  #hud .tr .orb i{left:25px;right:2px;top:3px;bottom:3px;width:auto;height:auto;border-radius:8px;transform-origin:left center;transform:scaleX(var(--f,1))}
  #hud .tr .orb::before{position:absolute;left:5px;z-index:2;font:14px/1 sans-serif;text-shadow:0 1px #000}
  #hud #hpOrb::before{content:'♥';color:#ff7b69}
  #hud #runOrb::before{content:'ϟ';color:#f8d779}
  #hud .tr .orb::after{display:none}
  #hud .tr .orb span{z-index:2;margin:0;font:700 12px/1 var(--display);text-shadow:0 1px 2px #000}
  #hud .tr .orbs .chips{position:static;display:flex;flex-direction:row;justify-content:space-between;gap:2px;width:100%}
  #hud .tr .orbs .chip{min-width:0;min-height:23px;padding:3px 4px;gap:2px;font:700 10px/1 var(--mono);border-radius:4px}
  #hud .tr .orbs .chip svg{width:12px;height:12px}
  #hud .tr .orbs .bullet-chip{display:flex}
  #hud .tr #runOrb{pointer-events:auto;min-width:44px;min-height:44px;margin-block:-10px;z-index:3}
  #hud .tr #runOrb i{top:13px;bottom:13px}
  #hud .tr #runOrb::before{top:15px}
}

/* A carved teak plate joins the status display to the compass. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr .orbs{width:190px;padding:18px 23px 17px;gap:3px;border:0;border-radius:0;background:url('images/status-carved-panel.png') center/100% 100% no-repeat;box-shadow:none}
  #hud .tr .orb{border-color:#b79255;background:linear-gradient(#17100c,#2e1c10);box-shadow:0 1px 1px #d3aa61,inset 0 2px 4px #000}
  #hud .tr .orb i{box-shadow:inset 0 1px 2px #fff7,inset 0 -2px 2px #0005}
  #hud .tr #runOrb{margin:0;min-height:44px;height:44px;background:transparent;border:0;box-shadow:none;overflow:visible}
  #hud .tr #runOrb::after{content:'';display:block;position:absolute;inset:10px 0;border-radius:12px;background:linear-gradient(#17100c,#2e1c10);border:1px solid #b79255;box-shadow:inset 0 2px 4px #000;z-index:-1}
  #hud .tr .orbs .chip{color:#fce5b0;background:linear-gradient(#4b301d,#24170f);border:1px solid #98713e;box-shadow:inset 0 1px #c69a5b55;font-size:10px}
}

/* Enamel medallions and inset, shaded meters for the mobile status plate. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr #hpOrb::before,
  #hud .tr #runOrb::before{content:'';position:absolute;left:0;top:0;width:24px;height:24px;background:center/contain no-repeat;z-index:3;filter:drop-shadow(0 1px 1px #140b06)}
  #hud .tr #hpOrb::before{background-image:url('images/health-medallion.png')}
  #hud .tr #runOrb::before{top:10px;background-image:url('images/run-medallion.png')}
  #hud .tr .orb.hp i{background:linear-gradient(#ff9380 0%,#eb4b3c 25%,#af261e 65%,#711912 100%)}
  #hud .tr .orb.run i{background:linear-gradient(#a8eced 0%,#35bacb 25%,#147486 65%,#124856 100%)}
  #hud .tr .orb.run.tired i{background:linear-gradient(#b7ac8d,#73644c)}
  #hud .tr .orb span{color:#fff7db;text-shadow:0 1px 2px #210e08,0 0 3px #210e08}
}

/* Brass-rimmed wells with rounded enamel fills, matching the carved panel. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr .orb.hp{border:1px solid #aa7b3c;background:linear-gradient(#120b08,#382517 50%,#140d09);box-shadow:0 1px 1px #d7b57a,inset 0 0 0 1px #382313,inset 0 2px 4px #000}
  #hud .tr .orb.run::after{z-index:0;border:1px solid #aa7b3c;background:linear-gradient(#120b08,#382517 50%,#140d09);box-shadow:0 1px 1px #d7b57a,inset 0 0 0 1px #382313,inset 0 2px 4px #000}
  #hud .tr .orb i{z-index:1;left:25px;right:4px;border-radius:9px;box-shadow:inset 0 1px 1px #fff9,inset 0 -2px 2px #0008,0 0 2px #000}
  #hud .tr .orb.hp i{background:linear-gradient(to bottom,#ffb49b 0%,#fb5e45 17%,#db3123 46%,#a11d18 51%,#b9231b 77%,#71120f 100%)}
  #hud .tr .orb.run i{background:linear-gradient(to bottom,#b6ffff 0%,#4ce0eb 17%,#11a6c3 46%,#08768d 51%,#098da6 77%,#065366 100%)}
  #hud .tr .orb.run.tired i{background:linear-gradient(#c9b89b,#8e7a5c 48%,#65543c 52%,#88765a)}
}

/* Individual meters float below the map, with medallions outside the wells. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr .orbs{width:168px;padding:0;gap:0;background:none;border:0;box-shadow:none}
  #hud .tr .orb.hp,
  #hud .tr .orb.run{height:32px;min-height:32px;overflow:visible;background:none;border:0;box-shadow:none;isolation:isolate}
  #hud .tr .orb.hp::after,
  #hud .tr .orb.run::after{content:'';display:block;position:absolute;inset:6px 0 6px 21px;width:auto;height:auto;border:1px solid #aa7b3c;border-radius:12px;background:linear-gradient(#120b08,#382517 50%,#140d09);box-shadow:0 1px 1px #d7b57a,inset 0 0 0 1px #382313,inset 0 2px 4px #000;z-index:0}
  #hud .tr .orb.hp i,
  #hud .tr .orb.run i{left:24px;right:3px;top:9px;bottom:9px;height:auto;z-index:1}
  #hud .tr #hpOrb::before,
  #hud .tr #runOrb::before{left:0;top:4px;width:24px;height:24px}
  #hud .tr #runOrb{min-height:44px;height:44px;margin:-6px 0}
  #hud .tr #runOrb::after{top:12px;bottom:12px}
  #hud .tr #runOrb i{top:15px;bottom:15px}
  #hud .tr #runOrb::before{top:10px}
  #hud .tr .orbs .chips{padding-top:3px}
}

/* Larger medallions lead into shorter, attached meters. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr .orbs{width:144px}
  #hud .tr .orb.hp::after,
  #hud .tr .orb.run::after{left:27px}
  #hud .tr .orb.hp i,
  #hud .tr .orb.run i{left:30px}
  #hud .tr #hpOrb::before,
  #hud .tr #runOrb::before{width:32px;height:32px;top:0}
  #hud .tr #runOrb::before{top:6px}
}

/* A single carved strip groups the three supplies beneath the meters. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr .orbs{width:166px;gap:3px}
  #hud .tr .orb.hp{height:38px;min-height:38px}
  #hud .tr .orb.hp::after{left:34px;top:9px;bottom:9px}
  #hud .tr .orb.hp i{left:37px;top:12px;bottom:12px}
  #hud .tr #hpOrb::before{width:38px;height:38px;top:0}
  #hud .tr #runOrb::before{width:38px;height:38px;top:3px}
  #hud .tr #runOrb::after{left:34px}
  #hud .tr #runOrb i{left:37px}
  #hud .tr .orbs .chips{padding:5px 9px;gap:3px;border:1px solid #a77c45;border-radius:6px;background:var(--wood-surface);background-size:auto,240px 240px;box-shadow:var(--wood-bevel),0 2px 4px #1b110bb3;align-items:center}
  #hud .tr .orbs .chip{flex:1;justify-content:center;padding:2px 1px;background:none;border:0;box-shadow:none;white-space:nowrap}
}

/* Keep each supply icon distinct and its abbreviated count legible. */
@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr .orbs .chip{gap:3px;min-width:0;font-size:11px;font-variant-numeric:tabular-nums}
  #hud .tr .orbs .chip svg{width:15px;height:15px;display:block}
  #hud .tr .orbs .chip>span:first-child{flex:none}
}


@media (max-width:760px) and (max-height:600px) and (orientation:landscape), (pointer:coarse) and (max-height:600px) and (orientation:landscape){
  #hud .tr{display:block;width:var(--map)}
  #hud .tr .orbs{position:absolute;left:auto;right:0;top:calc(100% - 5px);bottom:auto;transform:none;z-index:2;width:166px}
  #hud .tr #hpOrb>svg,#hud .tr #runOrb>svg{display:none}
  #hud .tr>.daily-shortcut{right:calc(100% + 62px);top:calc(var(--map) + 8px)}
}
