:is(#wmDrawTools, #wmNodesPanel) > .wm-layout-panel {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  overflow: visible !important;
  box-sizing: border-box;
}
/* Fade on creation and re-entry from hidden/off-screen states. Movement of
   already-visible labels stays immediate; camera transforms never tween. */
@keyframes wm-place-label-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
.wm-globe-place-label {
  animation: wm-place-label-enter 420ms ease-in-out both;
}
@media (prefers-reduced-motion: reduce) {
  .wm-globe-place-label { animation: none; }
}
/* Shared strategic-site symbols: same geometry on maps, globe and legends.
   Scale comes from the existing base-marker zoom listener, never a new loop. */
.wm-site-symbol {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  vertical-align: middle;
}
.wm-site-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: calc(26px * var(--wm-site-scale, .76));
  height: calc(26px * var(--wm-site-scale, .76));
  min-width: 0 !important;
  min-height: 0 !important;
  padding: calc(2px * var(--wm-site-scale, .76));
  border: 1px solid #c8c8c480;
  border-radius: 3px;
  background: #202020eb;
  color: #f4f4f1;
  cursor: pointer;
  pointer-events: auto;
}
.wm-site-marker .wm-site-symbol {
  width: calc(20px * var(--wm-site-scale, .76));
  height: calc(20px * var(--wm-site-scale, .76));
}
.wm-site-map-marker {
  margin: calc(13px - 13px * var(--wm-site-scale, .76));
}
.wm-site-marker:hover,
.wm-site-marker:focus-visible {
  color: #f4f4f1;
  border-color: #f4f4f1;
  background: #363634;
}
.wm-site-marker:focus-visible {
  outline: 2px solid #f4f4f1;
  outline-offset: 3px;
}
.wm-site-map-icon {
  background: transparent;
  border: 0;
}
.wm-site-swatch {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  color: #e8e8e4;
  vertical-align: middle;
}
.wm-base-insignia {
  display: inline-flex;
  align-items: center;
  gap: calc(3px * var(--wm-base-scale, 1));
  vertical-align: middle;
}
.wm-base-flag {
  width: calc(24px * var(--wm-base-scale, 1));
  height: calc(16px * var(--wm-base-scale, 1));
  object-fit: contain;
  flex-shrink: 0;
}
.wm-base-operator { font-size: calc(10px * var(--wm-base-scale, 1)); }
.wm-news-symbol {
  width: calc(18px * var(--wm-base-scale, 1));
  height: calc(18px * var(--wm-base-scale, 1));
  display: block;
}
.wm-news-symbol-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0,0,0,.65);
  border: 1px solid #ffffff66;
  border-radius: 2px;
  padding: calc(2px * var(--wm-base-scale, 1));
  min-width: 0;
  min-height: 0;
  cursor: pointer;
  pointer-events: auto;
}
.wm-news-symbol-wrap:hover, .wm-news-symbol-wrap:focus-visible {
  border-color: #fff;
  background: #000;
}
.wm-base-sword {
  width: calc(22px * var(--wm-base-scale, 1));
  height: calc(22px * var(--wm-base-scale, 1));
}
.wm-base-globe-marker {
  padding: calc(2px * var(--wm-base-scale, 1)) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  font-size: calc(12px * var(--wm-base-scale, 1)) !important;
}
.wm-base-globe-marker[data-country-overlap] {
  visibility: hidden !important;
  pointer-events: none !important;
}
.wm-base-map-marker .wm-base-label {
  font-size: calc(10px * var(--wm-base-scale, 1)) !important;
}
/* Town/base associations stay inside the marker's visibility boundary. Text
   has its own readable size; the flag and sword retain their zoom scale. */
.wm-base-city-label {
  color: #f4f4f1;
  font: 600 11px/1.35 "DM Sans", "Avenir Next", sans-serif;
  white-space: nowrap;
  text-shadow: 0 1px 3px #202020, 0 0 5px #202020;
}
.wm-base-map-marker .wm-base-city-label {
  font-size: 11px !important;
  width: max-content;
  max-width: 280px;
  position: relative;
  left: 50%;
  transform: translateX(-50%) !important;
  transform-origin: center;
  padding: 2px 5px;
  border-radius: 2px;
  background: #202020df;
}
.wm-base-globe-marker .wm-base-city-label { display: none; }
#worldGlobeCanvas.wm-base-labels .wm-base-globe-marker .wm-base-city-label {
  display: inline-block;
  margin: 0 5px;
}
.wm-base-map-marker[data-country-overlap],
.wm-base-globe-marker[data-country-overlap] .wm-base-city-label {
  visibility: hidden !important;
  pointer-events: none !important;
}
.wm-base-town-icon {
  background: transparent;
  border: 0;
  overflow: visible;
}
.wm-base-town-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 6px;
  height: 6px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  overflow: visible;
  color: #f4f4f1;
  font: 600 11px/1.2 "DM Sans", "Avenir Next", sans-serif;
  text-shadow: 0 1px 3px #202020;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
}
.wm-base-town-marker:hover,
.wm-base-town-marker:focus-visible {
  color: white;
}
.wm-base-town-caption {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  animation: wm-place-label-enter 420ms ease-in-out both;
}
.wm-base-town-icon .wm-base-town-marker { transform: translate(-3px,-3px); }
@media (prefers-reduced-motion: reduce) { .wm-base-town-caption { animation:none; } }
.wm-base-town-marker:focus-visible { outline: 2px solid #f4f4f1; outline-offset: 2px; }
.wm-base-town-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border: 1px solid #f4f4f1;
  border-radius: 50%;
  background: #bcbcb8;
  box-shadow: 0 0 0 2px #202020a8;
}
.wm-base-town-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.wm-base-town-marker .wm-base-insignia { --wm-base-scale: .65; gap: 2px; }
.wm-base-town-marker .wm-base-flag { width: 16px; height: 11px; }
.wm-base-town-marker .wm-base-sword { width: 14px; height: 14px; }
.wm-base-town-globe-marker { transform: translate(-50%, -50%); }
.wm-base-town-marker[data-country-overlap] {
  visibility: hidden !important;
  pointer-events: none !important;
}
.wm-base-association {
  margin: 8px 0 12px;
  padding: 9px 10px;
  border-left: 2px solid #969692;
  background: #202020;
  color: #c8c8c4;
  font-size: 11px;
  line-height: 1.55;
}
.wm-base-association a { color: #f4f4f1; text-underline-offset: 3px; }
.wm-linked-base {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid #96969255;
  background: transparent;
  color: #f4f4f1;
  text-align: left;
  cursor: pointer;
}
.wm-linked-base:hover { background: #202020; }
.wm-linked-base-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.wm-linked-base strong { display: block; font-size: 12px; line-height: 1.4; }
.wm-linked-base small { display: block; margin-top: 3px; color: #bcbcb8; font-size: 10px; line-height: 1.5; }
.wm-linked-base .wm-base-insignia { --wm-base-scale: .72; }
/* World intelligence console — presentation only. Map layers and their palette
   remain owned by worldmap.js; this sheet styles the surrounding interface. */
.wm-animation-disclosure {
  position: relative;
  flex: 1 0 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.27);
  color: #fff;
}
.wm-animation-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 9px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 2px;
  background: #080808;
  color: #fff;
  font: 700 10px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
}
.wm-animation-toggle::after { content: "+"; font-size: 14px; }
.wm-animation-toggle[aria-expanded="true"]::after { content: "−"; }
.wm-animation-toggle:hover,
.wm-animation-toggle[aria-expanded="true"] { background: #242424; border-color: #fff; }
.wm-animation-panel {
  position: static;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 12px 0 2px;
  background: transparent;
  color-scheme: dark;
}
.wm-animation-panel[hidden] { display: none !important; }
.wm-animation-heading {
  margin: 0 0 14px;
  font: 700 10px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.wm-animation-fields { display: grid; grid-template-columns: minmax(0, 1fr) 68px; gap: 8px; align-items: end; }
.wm-animation-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wm-animation-field label { font-size: 10px; color: rgba(255,255,255,.7); }
.wm-animation-field select,
.wm-animation-field input[type="search"] {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 2px;
  background: #111;
  color: #fff;
  font-size: 11px;
}
.wm-animation-selection { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin: 8px 0; font-size: 10px; color: rgba(255,255,255,.7); }
.wm-animation-bulk { display: flex; gap: 5px; }
#wmDrawTools .wm-animation-bulk button { min-height: 28px; padding: 3px 7px; font-size: 10px; cursor: pointer; }
.wm-animation-routes { max-height: 104px; overflow: auto; overscroll-behavior: contain; border: 1px solid rgba(255,255,255,.25); border-radius: 2px; scrollbar-width: thin; }
.wm-animation-panel { max-height: min(36dvh, 290px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.wm-animation-route { display: flex; align-items: flex-start; gap: 8px; padding: 8px; min-height: 32px; box-sizing: border-box; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; cursor: pointer; }
.wm-animation-route + .wm-animation-route { border-top: 1px solid rgba(255,255,255,.1); }
.wm-animation-route:hover, .wm-animation-route:focus-within { background: #202020; }
.wm-animation-route input, .wm-animation-isolation input { flex: 0 0 auto; width: 14px; height: 14px; margin: 1px 0 0; accent-color: #f1f1ed; }
.wm-animation-no-match { margin: 0; padding: 10px 8px; font-size: 11px; color: rgba(255,255,255,.65); }
.wm-animation-isolation { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; line-height: 1.5; cursor: pointer; }
#wmDrawTools .wm-animation-actions .wm-animation-play { background: #f1f1ed !important; color: #080808 !important; border-color: #f1f1ed !important; }
.wm-animation-actions { display: flex; gap: 6px; margin-top: 12px; }
.wm-animation-actions button {
  flex: 1;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 2px;
  background: #111;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.wm-animation-actions .wm-animation-play { background: #f1f1ed; color: #080808; border-color: #f1f1ed; font-weight: 700; }
.wm-animation-actions button:hover:not(:disabled) { background: #303030; border-color: #fff; color: #fff; }
.wm-animation-panel :disabled { opacity: .45; cursor: not-allowed; }
.wm-animation-status { margin-top: 13px; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.wm-animation-progress { display: block; width: 100%; height: 3px; margin-top: 8px; accent-color: #fff; border: 0; }
.wm-animation-progress::-webkit-progress-bar { background: #303030; }
.wm-animation-progress::-webkit-progress-value { background: #f1f1ed; }
.wm-animation-progress::-moz-progress-bar { background: #f1f1ed; }
.wm-animation-empty { margin: 10px 0 0; color: rgba(255,255,255,.8); font-size: 11px; line-height: 1.5; }
.wm-animation-note { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.58); font-size: 10px; line-height: 1.5; }
.worldmap-view {
  --wm-ink: #fff;
  --wm-muted: rgba(246, 246, 243, .66);
  --wm-line: rgba(255, 255, 255, .27);
  --wm-panel: #000;
  --wm-panel-raised: #000;
  --wm-radius: 3px;
  color: var(--wm-ink);
  font-family: "DM Sans", "Avenir Next", Avenir, sans-serif;
}

.worldmap-view button,
.worldmap-view input,
.worldmap-view textarea,
.worldmap-view select {
  font-family: inherit;
}

.worldmap-view button {
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
}

.worldmap-view button:focus-visible,
.worldmap-view input:focus-visible,
.worldmap-view textarea:focus-visible,
.worldmap-view select:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Search desk */
.wm-supply-panel {
  top: 14px !important;
  width: min(620px, calc(100% - 600px)) !important;
  max-width: 620px !important;
  min-width: 360px;
  padding-top: 24px;
  transform: translateX(-50%);
}
.wm-supply-panel::before {
  content: "WORLD INTELLIGENCE  /  FIELD SEARCH";
  position: absolute;
  top: 0;
  left: 2px;
  color: rgba(255,255,255,.78);
  font: 700 9px/16px ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .15em;
}
.wm-supply-panel form {
  gap: 5px !important;
  padding: 5px !important;
  background: var(--wm-panel) !important;
  border: 1px solid var(--wm-line) !important;
  border-radius: var(--wm-radius) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.55) !important;
  backdrop-filter: blur(14px) !important;
}
.wm-supply-panel input,
.wm-supply-panel textarea {
  color: #fff !important;
  background: #000 !important;
  border: 1px solid rgba(255,255,255,.19) !important;
  border-radius: 2px !important;
  font-size: 12px !important;
}
.wm-supply-panel input::placeholder,
.wm-supply-panel textarea::placeholder { color: rgba(255,255,255,.52); }
.wm-supply-panel input:focus,
.wm-supply-panel textarea:focus { border-color: #fff !important; }
.wm-supply-panel button {
  min-height: 32px;
  padding: 6px 10px !important;
  border: 1px solid rgba(255,255,255,.54) !important;
  border-radius: 2px !important;
  background: #fff !important;
  color: #000 !important;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: .015em;
}
.wm-supply-panel button:hover:not(:disabled) {
  background: #fff !important;
  border-color: #fff !important;
}
.wm-supply-panel button:disabled { opacity: .55; }
.wm-supply-panel button.active {
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
  box-shadow: inset 0 -2px 0 #000;
}
.wm-fp-form button,
.wm-country-prompt-form button {
  color: #fff !important;
  background: #000 !important;
  border-color: rgba(255,255,255,.4) !important;
}
.wm-fp-form button:hover:not(:disabled),
.wm-country-prompt-form button:hover:not(:disabled) {
  background: #fff !important;
  color: #000 !important;
}
.wm-country-prompt-form textarea {
  min-height: 52px;
  resize: vertical;
}
.wm-supply-msg,
.wm-country-prompt-result,
.wm-fp-legend {
  color: #fff !important;
  background: var(--wm-panel) !important;
  border-color: var(--wm-line) !important;
  border-radius: 2px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.wm-fp-legend { padding: 8px !important; }

/* Layer rail */
.wm-controls {
  top: 62px !important;
  right: 14px !important;
  width: 246px !important;
  max-height: calc(100% - 86px) !important;
  padding: 14px !important;
  color: #fff !important;
  background: var(--wm-panel) !important;
  border: 1px solid var(--wm-line) !important;
  border-radius: var(--wm-radius) !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.48) !important;
  backdrop-filter: blur(12px) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.42) transparent;
}
.wm-panel-title {
  color: #fff !important;
  font: 700 10px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace !important;
  letter-spacing: .14em !important;
  padding-bottom: 8px;
  margin-bottom: 7px !important;
  border-bottom: 1px solid var(--wm-line);
}
.wm-toggle {
  min-height: 27px;
  color: rgba(255,255,255,.92) !important;
}
.wm-toggle-sub { color: rgba(255,255,255,.73) !important; }
.wm-toggle input { accent-color: #fff !important; }
.wm-solo {
  border-color: rgba(255,255,255,.32) !important;
  background: #0b0b0b !important;
  color: #fff !important;
}
.wm-solo-on,
.wm-solo-on:hover {
  color: #000 !important;
  background: #fff !important;
  border-color: #fff !important;
}
.wm-legend-row { color: rgba(255,255,255,.78) !important; }
.wm-live {
  color: rgba(255,255,255,.68) !important;
  border-color: var(--wm-line) !important;
}

/* Secondary controls and information surfaces */
#wmGlobeToggle {
  top: 14px !important;
  right: 14px !important;
  z-index: 951 !important;
  padding: 7px 12px !important;
  background: #fff !important;
  border: 1px solid #fff !important;
  border-radius: 2px !important;
  color: #050505 !important;
  font: 700 11px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace !important;
  letter-spacing: .06em;
  box-shadow: 0 8px 22px rgba(0,0,0,.38);
}
#wmGlobeToggle:hover { background: #fff !important; }
/* Passive city-fetch status stays below the map switch, clear of the layer tab. */
#worldGlobeCanvas .wm-city-loading {
  position: absolute;
  top: 52px;
  right: 14px;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  max-width: calc(100% - 28px);
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 999px;
  background: rgba(0,0,0,.9);
  color: #fff;
  font: 500 10px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace;
  pointer-events: none;
}
#worldGlobeCanvas .wm-city-loading[hidden] { display: none !important; }
.wm-city-loading-spinner {
  display: inline-block;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  border: 1.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wm-city-loading-spin .85s linear infinite;
}
@keyframes wm-city-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .wm-city-loading-spinner { animation: none; }
}
#wmGlobeOpacityCtl {
  right: 14px !important;
  bottom: 14px !important;
  background: var(--wm-panel) !important;
  border: 1px solid var(--wm-line) !important;
  border-radius: 2px !important;
  color: #fff !important;
  backdrop-filter: blur(12px);
}
#wmGlobeOpacity { accent-color: #fff !important; }
.wm-respanel { top: 90px !important; left: 14px !important; bottom: auto !important; }
.wm-respanel-btn,
.wm-respanel-body {
  color: #fff !important;
  background: var(--wm-panel) !important;
  border: 1px solid var(--wm-line) !important;
  border-radius: 2px !important;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  backdrop-filter: blur(12px) !important;
}
.wm-respanel-btn:hover { background: #171717 !important; border-color: #fff !important; }
.wm-res-group-title { color: #fff !important; }
.wm-res-row { color: rgba(255,255,255,.84) !important; }
.wm-res-row:hover { background: #1a1a1a !important; }
.wm-detail {
  top: 14px !important;
  left: 14px !important;
  width: 330px !important;
  max-height: calc(100% - 28px) !important;
  padding: 20px !important;
  background: var(--wm-panel) !important;
  border: 1px solid var(--wm-line) !important;
  border-radius: 2px !important;
  box-shadow: 0 16px 44px rgba(0,0,0,.58) !important;
  backdrop-filter: blur(14px) !important;
}
.wm-detail-close {
  color: #fff !important;
  background: #111 !important;
  border: 1px solid var(--wm-line) !important;
  border-radius: 2px !important;
}
.wm-detail-close:hover { color: #000 !important; background: #fff !important; }
.wm-detail h3 { color: #fff !important; }
.wm-summary,
.wm-parent,
.wm-fact,
.wm-row,
.wm-leader-profile { color: rgba(255,255,255,.78) !important; }
.wm-section-title { color: #fff !important; }
.wm-leader,
.wm-export { background: #0c0c0c !important; border-color: rgba(255,255,255,.18) !important; border-radius: 2px !important; }
.wm-news-panel {
  left: 14px !important;
  bottom: 64px !important;
  background: var(--wm-panel) !important;
  border: 1px solid var(--wm-line) !important;
  border-radius: 2px !important;
  box-shadow: 0 12px 34px rgba(0,0,0,.48) !important;
  backdrop-filter: blur(12px) !important;
}
.wm-news-head { color: #fff !important; }
.wm-news-head:hover,
.wm-news-row:hover { background: #1a1a1a !important; }
.wm-news-body { border-color: var(--wm-line) !important; }
.wm-news-row-title,
.wm-news-item .wm-news-title { color: rgba(255,255,255,.92) !important; }
.wm-news-meta { color: rgba(255,255,255,.62) !important; }
.wm-news-refresh { color: #fff !important; }
.wm-customize-btn,
.wm-customize-panel,
.wm-draw-tools,
.wm-layout-panel {
  color: #fff !important;
  background: var(--wm-panel) !important;
  border: 1px solid var(--wm-line) !important;
  border-radius: 2px !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.48) !important;
  backdrop-filter: blur(12px) !important;
}
.wm-customize-btn:hover,
.wm-customize-btn.active { color: #000 !important; background: #fff !important; border-color: #fff !important; }
.wm-cust-title,
.wm-cust-label { color: #fff !important; }
.wm-draw-tools button,
.wm-cust-tabs button,
.wm-cust-seg button,
.wm-layout-row button,
.wm-layout-bar button {
  background: #101010 !important;
  border-color: rgba(255,255,255,.32) !important;
  border-radius: 2px !important;
  color: rgba(255,255,255,.83) !important;
}
.wm-draw-tools button:hover,
.wm-cust-seg button:hover,
.wm-layout-row button:hover,
.wm-layout-bar button:hover { background: #242424 !important; color: #fff !important; }
.wm-layout-name { color: #fff !important; }
.wm-layout-status { color: rgba(255,255,255,.72) !important; }
.wm-layout-row.active,
.wm-cust-tabs button.active,
.wm-cust-seg button.active,
.wm-draw-tools button.active {
  background: #fff !important;
  border-color: #fff !important;
  color: #000 !important;
}
.wm-cust-reset {
  color: rgba(255,255,255,.72) !important;
  border-color: rgba(255,255,255,.32) !important;
  border-radius: 2px !important;
}
.wm-cust-reset:hover { color: #000 !important; background: #fff !important; }
.wm-country-prompt-result { color: #fff !important; }
.wm-alliance-banner {
  background: var(--wm-panel) !important;
  border-radius: 2px !important;
  color: #fff !important;
}
.wm-banner-close,
.wm-banner-learn { color: #fff !important; border-radius: 2px !important; }

/* Keep attribution visible and legible over either map mode. */
.worldmap-view .leaflet-control-attribution {
  color: rgba(255,255,255,.74) !important;
  background: rgba(0,0,0,.86) !important;
}
.worldmap-view .leaflet-control-attribution a { color: #fff !important; }
.worldmap-view .leaflet-bar a {
  background: #080808 !important;
  color: #fff !important;
  border-color: rgba(255,255,255,.4) !important;
}
.worldmap-view .leaflet-bar a:hover { background: #222 !important; }

@media (prefers-reduced-motion: reduce) {
  .worldmap-view button { transition: none !important; }
}

/* The flat map and its surrounding controls stay monochrome. The globe has
   its own soft color palette and retains its underlying raster texture. */
.worldmap-view #worldMapCanvas { filter: grayscale(1); }
.worldmap-view #worldMapCanvas.wm-tour-color { filter: none; } /* country tour highlight (worldmap.js renderTour2D) */
.worldmap-view #worldMapCanvas .leaflet-tile,
.worldmap-view #worldMapCanvas .leaflet-marker-icon img,
.worldmap-view .wm-country-flag-badge {
  filter: grayscale(1) contrast(1.06);
}
.worldmap-view #worldGlobeCanvas canvas,
.worldmap-view .wm-country-flag-globe,
.worldmap-view .wm-country-flag-wave { filter: none !important; }
.worldmap-view .wm-controls [style*="color:"],
.worldmap-view .wm-controls .wm-dot,
.worldmap-view .wm-controls .wm-swatch,
.worldmap-view .wm-controls .wm-lane-swatch,
.worldmap-view .wm-respanel [style*="color:"],
.worldmap-view .wm-detail [style*="color:"],
.worldmap-view .wm-news-panel [style*="color:"],
.worldmap-view .wm-supply-panel [style*="color:"],
.worldmap-view .wm-country-prompt-result [style*="color:"],
.worldmap-view .wm-fp-legend [style*="color:"],
.worldmap-view .wm-alliance-banner [style*="color:"] {
  filter: grayscale(1);
}
.worldmap-view .wm-news-badge,
.worldmap-view .wm-news-count,
.worldmap-view .wm-news-live-dot,
.worldmap-view .wm-news-place,
.worldmap-view .wm-news-status,
.worldmap-view .wm-country-flag-inline,
.worldmap-view .wm-cprompt-flag-btn {
  filter: grayscale(1);
}
.worldmap-view .wm-news-status { color: rgba(255,255,255,.78) !important; }
.worldmap-view .wm-news-body { scrollbar-color: rgba(255,255,255,.4) transparent !important; }
.worldmap-view .wm-news-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.4) !important; }
.worldmap-view .wm-news-live-dot {
  background: #d8d8d4 !important;
  box-shadow: 0 0 6px rgba(255,255,255,.45) !important;
}

/* Deliberate map-console drawers. Keep the desktop and touch layouts on the
   same explicit state model; no invisible hover zones sit over the map. */
.worldmap-view .wm-hotzone { display: none !important; }
.worldmap-view .wm-autohide {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.worldmap-view .wm-mobile-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 960;
  min-height: 36px;
  padding: 7px 12px !important;
  color: #080808 !important;
  background: #f1f1ed !important;
  border: 1px solid #f1f1ed !important;
  border-radius: 2px !important;
  font: 700 11px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace !important;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.worldmap-view .wm-mobile-toggle:hover { background: #fff !important; }
#wmSearchToggle { top: 14px; left: 50%; transform: translateX(-50%); }
#wmLayersToggle { top: 14px; right: 112px; }
#wmSupplyPanel {
  top: 58px !important;
  left: 50% !important;
  width: min(620px, calc(100% - 32px)) !important;
  max-width: 620px !important;
  min-width: 0 !important;
  padding-top: 0 !important;
  transform: translateX(-50%);
  z-index: 955 !important;
}
#wmSupplyPanel::before { display: none; }
#wmSupplyPanel:not(.wm-ui-search-open) { display: none !important; }
.worldmap-view .wm-supply-panel.wm-ui-search-open {
  max-height: min(70dvh, 620px);
  overflow: auto;
  padding-top: 36px !important;
}
#worldMapControls {
  top: 58px !important;
  right: 14px !important;
  max-height: calc(100% - 78px) !important;
  z-index: 958 !important;
  display: none !important;
}
#worldMapControls.wm-ui-layers-open {
  display: block !important;
  padding-top: 40px !important;
}
#worldMapResPanel { top: 62px !important; left: 14px !important; z-index: 945 !important; }
.wm-respanel-body { max-height: min(52dvh, 420px) !important; overflow-y: auto; }
.worldmap-view.wm-ui-drawer-active #worldMapResPanel,
.worldmap-view.wm-ui-drawer-active .wm-news-panel {
  visibility: hidden;
  pointer-events: none;
}
.wm-detail { z-index: 970 !important; }
.wm-news-panel { z-index: 944 !important; }
.wm-news-head { display: flex; align-items: center; gap: 6px; padding: 3px 6px !important; }
.wm-news-collapse {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 34px;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.wm-news-collapse:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.wm-news-refresh { flex: 0 0 auto; }
.wm-news-panel.collapsed .wm-news-body { display: none; }
.wm-news-panel:not(.collapsed) .wm-news-body { max-height: min(280px, 35dvh); overflow-y: auto; }
.wm-panel-close {
  position: absolute;
  z-index: 3;
  top: 5px;
  right: 5px;
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 2px;
  background: #080808;
  color: #fff;
  font-size: 10px;
  cursor: pointer;
}
#wmCustomizePanel, #wmDrawTools, #wmNodesPanel { z-index: 965 !important; }
#wmCustomizePanel { bottom: 62px !important; left: 12px !important; padding-top: 34px !important; }
#wmDrawTools { bottom: 62px !important; left: 56px !important; padding-top: 34px !important; width: 324px; max-width: calc(100% - 80px); box-sizing: border-box; flex-wrap: wrap; align-content: flex-start; overscroll-behavior: contain; scrollbar-width: thin; }
.wm-customize-btn { z-index: 966 !important; }
.wm-ui-search-open > .wm-panel-close,
#worldMapControls.wm-ui-layers-open > .wm-panel-close,
#wmCustomizePanel.open > .wm-panel-close,
#wmDrawTools.open > .wm-panel-close { display: block; }
#wmSupplyPanel:not(.wm-ui-search-open) > .wm-panel-close { display: none; }
#wmCustomizeBtn, #wmDrawBtn, #wmNodesBtn {
  width: auto !important;
  min-width: 84px;
  height: 36px !important;
  border-radius: 2px !important;
  font: 700 10px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace !important;
  letter-spacing: .03em;
}
#wmCustomizeBtn { left: 12px !important; }
#wmCustomizeBtn::after { content: "Map style"; margin-left: 6px; }
#wmDrawBtn { left: 104px !important; }
#wmDrawBtn::after { content: "Draw"; margin-left: 6px; }
#wmNodesBtn { left: 196px !important; }
/* The button text already says "Nodes" (no ::after label, unlike the icon-only buttons). */
#wmNodesBtn[aria-expanded="true"] { color: #000 !important; background: #fff !important; border-color: #fff !important; }
#wmNodesPanel {
  position: absolute;
  display: none;
  bottom: 62px !important;
  left: 196px !important;
  width: 324px;
  max-width: calc(100% - 80px);
  max-height: min(60dvh, 520px, calc(100% - 80px));
  box-sizing: border-box;
  flex-wrap: wrap;
  align-content: flex-start;
  padding: 34px 12px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
#wmNodesPanel.open { display: flex; }
#wmCustomizePanel.open { max-height: min(60dvh, 520px); overflow: auto; }
#wmDrawTools.open {
  max-height: min(60dvh, 520px, calc(100% - 80px));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 900px) {
  #wmGlobeToggle { top: auto !important; bottom: 14px !important; right: 14px !important; }
  #wmGlobeOpacityCtl {
    right: 12px !important;
    bottom: 60px !important;
    width: calc(100% - 24px);
    max-width: 370px;
    box-sizing: border-box;
  }
  #wmGlobeOpacity { min-width: 0; width: 100% !important; flex: 1; }
  .worldmap-view .leaflet-control-zoom { margin-top: 64px; }
  #wmSearchToggle { top: 12px; left: 12px; transform: none; }
  #wmLayersToggle { top: 12px; right: 12px; bottom: auto; }
  #wmSupplyPanel { top: 56px !important; width: calc(100% - 24px) !important; }
  #worldMapControls {
    top: 56px !important;
    bottom: auto !important;
    right: 12px !important;
    width: min(260px, calc(100% - 24px)) !important;
    max-height: min(55dvh, 440px) !important;
  }
  #worldMapResPanel { top: 58px !important; left: 12px !important; }
  .wm-detail {
    top: 58px !important;
    bottom: auto !important;
    right: 12px !important;
    left: auto !important;
    width: min(330px, calc(100% - 24px)) !important;
    max-height: 48dvh !important;
  }
  .wm-news-panel { left: 12px !important; bottom: 112px !important; }
  #wmCustomizePanel, #wmDrawTools, #wmNodesPanel { bottom: 58px !important; }
  #wmCustomizeBtn { bottom: 12px !important; left: 12px !important; }
  #wmDrawBtn { bottom: 12px !important; left: 104px !important; }
  #wmNodesBtn { bottom: 12px !important; left: 196px !important; }
}
@media (max-width: 520px) {
  .wm-supply-panel form { flex-wrap: wrap; }
  .wm-supply-panel form > input { flex-basis: 100%; min-height: 36px; }
  .wm-supply-panel form button { flex: 1 1 auto; }
  .wm-country-prompt-form textarea { flex: 1 1 100%; }
  #worldMapControls { width: min(300px, calc(100% - 24px)) !important; }
  .wm-news-panel { left: 12px !important; bottom: 112px !important; width: min(350px, calc(100% - 24px)) !important; }
  #wmCustomizePanel { left: 12px !important; width: min(290px, calc(100% - 24px)) !important; }
  #wmDrawTools { left: 12px !important; max-width: calc(100% - 24px) !important; }
  #wmNodesPanel { left: 12px !important; width: min(324px, calc(100% - 24px)); max-width: calc(100% - 24px); }
  .wm-detail { right: 12px !important; }
}
@media (max-width: 360px) {
  #wmCustomizeBtn, #wmDrawBtn, #wmNodesBtn { min-width: 66px; padding-inline: 5px !important; font-size: 9px !important; }
  #wmCustomizeBtn { left: 12px !important; }
  #wmDrawBtn { left: 82px !important; }
  #wmNodesBtn { left: 152px !important; }
}
#wmNodesPanel > .wm-panel-close { display: block; }
.wm-node-preset {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(255,255,255,.27);
  color: #fff;
}
.wm-node-preset h3 {
  margin: 0 0 7px;
  font: 700 10px/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.wm-node-preset p {
  margin: 0 0 9px;
  color: rgba(255,255,255,.68);
  font-size: 10px;
  line-height: 1.5;
}
.wm-node-preset-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wm-node-preset button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 2px;
  background: #f1f1ed;
  color: #080808;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.wm-node-preset-secondary {
  display: flex;
  gap: 6px;
}
.wm-node-preset-secondary button { flex: 1 1 0; }
.wm-node-preset button:hover:not(:disabled) { background: #fff; }
.wm-node-preset button:disabled { opacity: .45; cursor: wait; }
.wm-node-preset-status {
  min-height: 14px;
  margin: 7px 0 0 !important;
  overflow-wrap: anywhere;
}
.wm-node-preset-status.is-error { color: #fff; text-decoration: underline; text-decoration-style: dotted; }
#wmSearchToggle[data-update="true"]::after { content: " · Updated"; }
#worldMapResPanel { max-height: max(100px, calc(100% - 236px)); overflow-y: auto; }
#wmGlobeOpacityCtl { height: 34px; box-sizing: border-box; }
#wmGlobeOpacity { height: 18px; min-height: 0; margin: 0; padding: 0; }

/* A narrow physical edge tab owns the only hover target. The drawer meets its
   inner edge, so travel from tab to panel never crosses an uncovered gap. */
#wmLayersToggle.wm-layer-edge-tab {
  top: 50% !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto !important;
  width: 30px !important;
  min-width: 0 !important;
  min-height: 86px !important;
  height: auto !important;
  padding: 9px 5px !important;
  gap: 7px;
  flex-direction: column;
  writing-mode: vertical-rl;
  transform: translateY(-50%) !important;
  z-index: 961 !important;
  border-right: 0 !important;
  border-radius: 2px 0 0 2px !important;
}
#wmLayersToggle.wm-layer-edge-tab span { font: 700 15px/1 ui-monospace, monospace; }
#worldMapControls {
  display: block !important;
  position: absolute !important;
  top: 50% !important;
  right: 30px !important;
  bottom: auto !important;
  left: auto !important;
  width: min(246px, calc(100% - 42px)) !important;
  max-height: min(72dvh, calc(100dvh - 24px)) !important;
  overflow: auto !important;
  z-index: 958 !important;
  transform: translate(0, -50%) translateX(calc(100% + 2px)) !important;
  visibility: hidden;
  pointer-events: none !important;
  transition: transform .24s cubic-bezier(.2,.7,.2,1), visibility 0s linear .24s;
  will-change: transform;
}
#worldMapControls.wm-ui-layers-open {
  display: block !important;
  padding-top: 40px !important;
  transform: translate(0, -50%) !important;
  visibility: visible;
  pointer-events: auto !important;
  transition-delay: 0s;
}
@media (max-width: 900px) {
  #wmLayersToggle.wm-layer-edge-tab {
    top: 50% !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
  }
  #worldMapControls {
    top: 50% !important;
    right: 30px !important;
    width: min(300px, calc(100% - 42px)) !important;
    max-height: min(62dvh, calc(100dvh - 24px)) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #worldMapControls { transition-duration: .01ms; transition-delay: 0s; }
}
