/* Authored values override the native HUD only where a profile contains an override. */
html:not([data-layout-ready]) :is(#mercenary-ranking, [data-mobile-panel="mercenary-ranking"]) {
  display: none !important;
}
#layout-announcements {
  position: fixed;
  z-index: 4;
  inset: auto auto calc(82px + env(safe-area-inset-bottom)) 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 24px));
  max-height: 36dvh;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 6px;
}
#layout-announcements:empty { display: none; }
.tw-layout-promo {
  margin: 0;
  padding: clamp(10px, 1.4vw, 18px);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--tw-promo-color, var(--cyan));
  border-radius: 6px;
  background: #101e2b;
  color: var(--text);
  overflow-wrap: anywhere;
}
.tw-layout-promo h2 { display: flex; align-items: center; gap: .45em; margin: 0; font: var(--hud-heading-font); }
.tw-layout-promo h2 svg { color: var(--tw-promo-color, var(--cyan)); }
.tw-layout-promo p { margin: .4em 0 0; white-space: pre-line; font: 400 clamp(14px,1vw,17px)/1.4 Barlow,sans-serif; }
.tw-layout-original-glyph { display: none !important; }
/* Testing lists should preserve native touch and wheel scrolling without activating gameplay controls. */
html[data-layout-scroll-test] :is(button,input,textarea,select,summary,label,a[href],[contenteditable=true]),
html[data-layout-scroll-test] :is(button,label,a[href]) * { pointer-events:none !important; }
body #tw-layout-overflow {
  position: fixed;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
body #tw-layout-overflow[hidden] { display: none; }
html body #tw-layout-overflow > :where(*) {
  position: relative !important;
  inset: auto !important;
  flex: none !important;
  width: auto !important;
  min-width: 0 !important;
  height: var(--tw-card-height, auto) !important;
  min-height: 44px;
  max-width: 100% !important;
  overflow: auto;
}
html body :is(button,input,select,a,summary,[role=button])[data-layout-touch] {
  min-inline-size: var(--tw-touch) !important;
  min-block-size: var(--tw-touch) !important;
}
.tw-layout-hidden-sample { position:fixed; z-index:12; left:12px; top:24%; width:max-content; max-width:80vw; padding:8px; border:1px dashed var(--cyan); background:var(--panel); color:var(--text); }
.tw-layout-glyph { display: inline-block; flex: none; width: 1em; height: 1em; vertical-align: middle; }
body [data-layout-scroll] {
  flex: none !important;
  height: var(--tw-rows-height,auto) !important;
  min-height: 0 !important;
  max-height: var(--ranking-height-limit, var(--tw-rows-height,none)) !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}
body #command-panel :is(#battle-feed-list,#standings-list,#soldiers-list,#enemy-influence-bars)[data-layout-scroll] {
  display: flex !important;
  flex-direction: column !important;
  overflow-x: hidden !important;
}
body [data-layout-scroll] > * { flex-shrink: 0; }
html body [data-layout-reveal="block"] { display: block !important; visibility: visible !important; }
html body [data-layout-reveal="flow"] { display: contents !important; visibility: visible !important; }
html body dialog[data-layout-reveal="dialog"] {
  display: block !important;
  position: fixed;
  inset: 12px auto auto 50%;
  transform: translateX(-50%);
  z-index: 9;
  margin: 0;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
}
@media (max-width:780px),(pointer:coarse) and (max-width:900px) {
  :root { --tw-phone-label: clamp(12px,3.2vw,16px); }
  .command-dock .dock-item { font-size: clamp(11px,2.95vw,15px); }
  #mobile-menu-items button { font-size: clamp(15px,3.9vw,20px); }
  .mobile-map-tools #open-mobile-menu, .econ-body .econ-pool { font-size: var(--tw-phone-label); }
  body [data-layout-scroll] button, .tw-layout-promo button { min-height: 44px; }
  body > .tw-layout-promo { max-width: calc(100vw - 8px); }
}
