.wm-filters { display: grid; gap: 8px; margin: 18px 0 4px; }
.wm-row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 10px; align-items: start; }
.wm-lab { font: 600 .78rem var(--font-ui); color: var(--dim); padding-top: 9px; }
.wm-chips, .wm-tiers { display: flex; flex-wrap: wrap; gap: 6px; }
.wm-filters .chip { padding: 4px 10px; }
.wm-filters .chip .ic { width: 20px; height: 20px; image-rendering: pixelated; }
.wm-filters .chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 600px) {
  .wm-row { grid-template-columns: 1fr; gap: 4px; }
  .wm-lab { padding-top: 0; }
}
.wm-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 12px 0 10px; }
.wm-bar label { display: grid; gap: 4px; font: 600 .78rem var(--font-ui); color: var(--dim); }
.wm-bar select, .wm-bar input { font: inherit; font-size: .95rem; font-weight: 400; color: var(--ink); background: var(--cell); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 9px; min-height: 38px; }
.wm-bar #wm-find { width: 14em; max-width: 100%; }
#wm-count { color: var(--dim); font-size: .85rem; margin-left: auto; align-self: center; }

.wm-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; }
#wm-wrap { position: relative; aspect-ratio: 16384 / 9012; max-height: 68vh; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
#wm-wrap:active { cursor: grabbing; }
#wm-svg { display: block; width: 100%; height: 100%; }
/* Hidden until the script has drawn, so the box never shows a half-built map */
html.js .wm:not(.ready) #wm-svg, .wm.failed #wm-wrap { visibility: hidden; }
#wm-wrap.on-place { cursor: pointer; }
/* Light lines on a dark edge, so the paths read on snow, grass and water alike */
.wm-road { fill: none; stroke: #fff; stroke-opacity: .95; stroke-width: 2.5px; stroke-dasharray: 7 4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 1.5px #161512) drop-shadow(0 0 1px #161512); }
.wm-check { display: flex !important; align-items: center; gap: 8px; min-height: 38px; color: var(--text) !important; font-size: .9rem !important; cursor: pointer; }
.wm-check input { width: 18px; height: 18px; accent-color: var(--accent); }
/* Markers: a dark disc ringed in the type's colour with the game icon on top; the art underneath is busy, so the disc keeps the icon readable */
.wm-n circle { fill: #161512; fill-opacity: .82; stroke: var(--accent); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.wm-n image { image-rendering: pixelated; }
.wm-n.t-combat circle { stroke: var(--g-combat); }
.wm-n.t-bank circle { stroke: #f1ece2; stroke-width: 2px; }
.wm-n.off { display: none; }
.wm-n.landmark { opacity: .4; }
.wm-n.faded { opacity: .35; }
.wm-n.faded.sel, .wm-n.faded.hot { opacity: 1; }
.wm-n.hot circle { stroke: #fff; stroke-width: 2.5px; fill-opacity: 1; }
.wm-n.hot { filter: drop-shadow(0 0 4px rgba(255, 255, 255, .8)); opacity: 1; }
.wm-n.sel circle { stroke: #fff; stroke-width: 3px; fill-opacity: 1; }
/* Town names sit on the map art in both themes, so they keep light text on a dark halo */
.wm-labels { fill: #f1ece2; stroke: #161512; paint-order: stroke; font-family: var(--font-ui); font-weight: 600; text-anchor: middle; pointer-events: none; }
.wm-labels.quiet { fill-opacity: .7; }
.wm-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 4px; }
.wm-zoom button { width: 34px; height: 34px; font: 600 1.1rem var(--font-ui); color: var(--ink); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.wm-zoom button:hover { background: var(--hover); }
.wm-zoom button#wm-fit { font-size: .7rem; }

#wm-info { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; align-self: start; }
#wm-info h2 { font-size: 1.05rem; margin: 0 0 2px; }
#wm-info p { margin: 6px 0; }
.wm-type { color: var(--dim); font-size: .85rem; }
/* Close, mid, far: the walk to the bank against every other place's */
.wm-d { font-weight: 600; white-space: nowrap; }
.wm-list .wm-d { display: block; }
.wm-d.r0 { color: var(--good); }
.wm-d.r1 { color: var(--warn); }
.wm-d.r2 { color: var(--bad); }
.wm-acts { list-style: none; padding: 0; margin: 6px 0 0; font-size: .9rem; }
.wm-acts li { display: flex; gap: 10px; padding: 3px 0; border-top: 1px solid var(--border); }
.wm-acts li span { color: var(--dim); min-width: 4.8em; font-variant-numeric: tabular-nums; }
.wm-acts li.locked { opacity: .45; }
.wm-key { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--dim); margin: 8px 0 0; }
.wm-credit { font-size: .8rem; color: var(--dim); margin: 4px 0 0; }
.wm-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.wm-list h3 { margin-top: 22px; }
.wm-grp { border-top: 1px solid var(--border); }
.wm-grp:last-of-type { border-bottom: 1px solid var(--border); }
.wm-grp summary { cursor: pointer; padding: 11px 4px; font: 600 1rem var(--font-ui); color: var(--ink); min-height: 44px; box-sizing: border-box; }
.wm-grp summary span { font-weight: 400; font-size: .85rem; color: var(--dim); margin-left: 8px; }
.wm-grp summary:hover { color: var(--accent); }
.wm-grp[open] summary { border-bottom: 1px solid var(--border); }
.wm-grp .wm-tbl { margin: 4px 0 14px; }
.wm-tbl { overflow-x: auto; }
.wm-list table th { position: static; }
@media (max-width: 860px) {
  .wm-body { grid-template-columns: 1fr; }
  #wm-wrap { height: 58vh; aspect-ratio: auto; }
  #wm-count { margin-left: 0; }
  .wm-zoom button { width: 44px; height: 44px; }
}
