.wmd-map {
  --surface: #0c1b31;
  --text: #edf6ff;
  --muted: #a6bdd0;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  container-type: inline-size;
  width: 100%;
  min-width: 0;
  padding: 15px;
  overflow: hidden;
  border: 1px solid #55799b55;
  border-radius: 20px;
  background: radial-gradient(circle at 8% 0%, #254c70 0%, transparent 43%),
              linear-gradient(150deg, #142c48, #0a192f 68%, #081527);
  box-shadow: 0 17px 35px #0b203238, inset 0 1px #ffffff2a;
  color: var(--text);
  font: 400 14px/1.4 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.wmd-map *, .wmd-map *::before, .wmd-map *::after { box-sizing: border-box; }
.wmd-map::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #43b9ec, #62e2af 60%, transparent);
}
.wmd-map .wmd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.wmd-map .wmd-kicker { display: block; margin-bottom: 3px; color: #9bc5e2; font-size: 10px; font-weight: 700; letter-spacing: .13em; line-height: 1.2; text-transform: uppercase; }
.wmd-map .wmd-heading { color: var(--text); font-size: 20px; font-weight: 760; letter-spacing: -.025em; line-height: 1.15; }
.wmd-map button { font-family: inherit; text-transform: none; letter-spacing: normal; box-shadow: none; }
.wmd-map button:focus-visible { outline: 2px solid #96dfff; outline-offset: 2px; }
.wmd-map .wmd-zoom { display: flex; gap: 4px; flex: 0 0 auto; }
.wmd-map .wmd-zoom button {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid #aac8e342;
  border-radius: 8px;
  background: #dcefff16;
  color: #eaf5ff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.wmd-map .wmd-zoom button:last-child { font-size: 11px; }
.wmd-map .wmd-zoom button:hover { background: #dcefff2f; transform: translateY(-1px); }
.wmd-map .wmd-zoom button:disabled { opacity: .4; cursor: default; transform: none; }
.wmd-map .wmd-viewport {
  --light-x: 50%;
  --light-y: 35%;
  position: relative;
  width: 100%;
  aspect-ratio: 590 / 555;
  overflow: hidden;
  border: 1px solid #87b2d938;
  border-radius: 14px;
  background: radial-gradient(circle at var(--light-x) var(--light-y), #3879a54d, transparent 50%),
              linear-gradient(#9abbd80b 1px, transparent 1px),
              linear-gradient(90deg, #9abbd80b 1px, transparent 1px),
              linear-gradient(165deg, #142e4c, #0b1b32 65%, #09172b);
  background-size: auto, 25px 25px, 25px 25px, auto;
  touch-action: pan-y;
  cursor: crosshair;
}
.wmd-map .wmd-viewport.wmd-grabbable { cursor: grab; touch-action: none; }
.wmd-map .wmd-viewport.wmd-dragging { cursor: grabbing; }
.wmd-map .wmd-content {
  position: absolute;
  top: 3%; left: 6%;
  width: 88%;
  aspect-ratio: 590 / 555;
  transform: translate(var(--wmd-x, 0px), var(--wmd-y, 0px)) scale(var(--wmd-scale, 1));
  transform-origin: center;
  will-change: transform;
}
.wmd-map .wmd-content img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; margin: 0; user-select: none; -webkit-user-drag: none; }
.wmd-map .wmd-base { filter: drop-shadow(0 7px 0 #050c18dc) drop-shadow(0 22px 15px #000b18a8); }
.wmd-map .wmd-overlay { pointer-events: none; opacity: 0; transition: opacity .2s ease; }
.wmd-map .wmd-overlay.wmd-active { opacity: 1; filter: drop-shadow(0 0 8px #b6eaffb0); }
.wmd-map .wmd-tip {
  display: none;
  position: absolute;
  z-index: 2;
  min-width: 142px;
  padding: 8px 10px;
  border: 1px solid #b5dcfa50;
  border-radius: 9px;
  background: #0a1a30ed;
  color: #eaf6ff;
  box-shadow: 0 9px 18px #0008;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}
.wmd-map .wmd-tip.wmd-visible { display: block; }
.wmd-map .wmd-tip strong { display: block; color: #fff; font-size: 12px; font-weight: 700; }
.wmd-map .wmd-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.wmd-map .wmd-legend button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #9dc0de35;
  border-radius: 11px;
  background: linear-gradient(135deg, #bcdcff13, #bcdcff07);
  color: #eaf5ff;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.wmd-map .wmd-legend button:hover { transform: translateY(-2px); border-color: #9ed8f58e; background: #bcdcff1c; }
.wmd-map .wmd-legend button[aria-pressed="true"] { border-color: #a8dfff; background: #7cc9fb24; box-shadow: inset 0 0 0 1px #b0e6ff42; }
.wmd-map .wmd-swatch { width: 16px; height: 23px; flex: 0 0 16px; border-radius: 5px; box-shadow: inset 0 1px #fff5, 0 3px 9px currentColor; }
.wmd-map .wmd-blue { color: #42b9ff; background: linear-gradient(145deg, #4ac7ff, #0070c0); }
.wmd-map .wmd-green { color: #37db8b; background: linear-gradient(145deg, #50e9a0, #00b050); }
.wmd-map .wmd-yellow { color: #f4d45c; background: linear-gradient(145deg, #fff49b, #efbd08); }
.wmd-map .wmd-red { color: #ff6a71; background: linear-gradient(145deg, #ff8788, #dd1a29); }
.wmd-map .wmd-navy { color: #8296d4; background: linear-gradient(145deg, #90a8df, #3f5480); }
.wmd-map .wmd-color { display: block; color: #a4bbce; font-size: 11px; line-height: 1.2; }
.wmd-map .wmd-legend strong { display: block; color: #f3f8ff; font-size: 12px; font-weight: 700; line-height: 1.27; overflow-wrap: anywhere; }
.wmd-map .wmd-selection { min-height: 34px; margin-top: 11px; padding: 9px 11px; border: 1px solid #a8c8df25; border-radius: 9px; background: #06142770; color: #a9c0d3; font-size: 12px; line-height: 1.4; }
.wmd-map .wmd-selection strong { color: #fff; }
@container (max-width: 350px) {
  .wmd-map .wmd-legend { grid-template-columns: 1fr; }
  .wmd-map .wmd-legend button { min-height: 45px; }
}
@container (max-width: 310px) { .wmd-map .wmd-heading { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) {
  .wmd-map .wmd-overlay, .wmd-map .wmd-legend button, .wmd-map .wmd-zoom button { transition: none; }
}
