/* ═══════════════════════════════════════════════════════════════════════
   AE Wallet Map — styles
   ─────────────────────────────────────────────────────────────────────
   All styling via CSS custom properties so the brand pass is a single-
   file change. Tokens will be re-aligned to /css/brand.css from the App
   Hub once the visual scaffold is in place.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* Wallet Map tokens — aliased to AE brand tokens (defined in
     /css/brand.css, loaded first). Keeping the --wm-* layer means
     wallet-map-specific overrides are still possible without
     touching the shared brand sheet. */

  /* Surface */
  --wm-bg: var(--ae-grey-light, #F4F4F5);
  --wm-fg: var(--ae-text, #262626);
  --wm-fg-muted: var(--ae-text-secondary, #6B6B6B);
  --wm-fg-subtle: var(--ae-text-muted, #999999);
  --wm-border: var(--ae-grey-border, #E5E5E5);
  --wm-card-bg: var(--ae-white, #FFFFFF);
  --wm-radius: var(--ae-radius-md, 10px);
  --wm-shadow: var(--ae-shadow-md, 0 4px 12px rgba(38, 38, 38, 0.08));

  /* Brand */
  --wm-accent: var(--ae-purple, #5F51D5);
  --wm-accent-bg: var(--ae-purple-20, #DFDDF7);

  /* Motion fills — placeholder colors, brand pass overrides these */
  --wm-motion-direct:     #16A34A;   /* green */
  --wm-motion-direct-bg:  #DCFCE7;
  --wm-motion-proxy:      #5F51D5;   /* purple */
  --wm-motion-proxy-bg:   #DFDDF7;
  --wm-motion-nam-routed: #2563EB;   /* blue */
  --wm-motion-nam-routed-bg: #DBEAFE;
  --wm-motion-unbundled:  #B45309;   /* amber-dark */
  --wm-motion-unbundled-bg: #FEF3C7;
  --wm-motion-no-go:      #DC2626;   /* red */
  --wm-motion-no-go-bg:   #FECACA;
  --wm-motion-pending:    #64748B;   /* slate */
  --wm-motion-pending-bg: #CBD5E1;
  --wm-map-bg:            #EEF2F7;   /* subtle blue-grey behind countries */

  /* Typography — DM Sans is the AE brand font (loaded by brand.css). */
  --wm-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--wm-font);
  background: var(--wm-bg);
  color: var(--wm-fg);
  min-height: 100vh;
}

a { color: var(--wm-accent); }

/* ── Header — matches the established .dash-* pattern across AE
   sibling tools (Quote Tool, SOW Handover, Email Generator). ── */

.dash-header {
  background: #fff;
  border-bottom: 1px solid var(--wm-border);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.dash-logo { display: flex; align-items: center; gap: 12px; }
.dash-logo img { height: 22px; }
.dash-logo-divider { width: 1px; height: 22px; background: var(--wm-border); }
.dash-logo-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wm-fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dash-user { display: flex; align-items: center; gap: 14px; font-size: 0.8125rem; }
.dash-user img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--wm-bg);
}
.dash-user a { color: var(--wm-fg-muted); text-decoration: none; }
.dash-user a:hover { color: var(--wm-accent); }
.dash-user span { font-weight: 500; }

@media (max-width: 720px) {
  .dash-header { padding: 12px 16px; }
}

/* ── Main / Loading / Denied ────────────────────────────────────── */

.wm-main {
  position: relative;
  padding: 0;
}

.wm-loading,
#wm-denied {
  background: var(--wm-card-bg);
  border: 1px solid var(--wm-border);
  border-radius: var(--wm-radius);
  padding: 48px;
  text-align: center;
  margin: 32px auto;
  max-width: 600px;
}

.wm-loading { color: var(--wm-fg-muted); font-size: 0.875rem; }

#wm-denied h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 12px; }
#wm-denied p { margin: 0; color: var(--wm-fg-muted); line-height: 1.5; }

/* ── App layout ─────────────────────────────────────────────────── */

.wm-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "toolbar toolbar"
    "map     drawer";
  height: calc(100vh - 55px);   /* dash-header is ~55px tall */
  transition: grid-template-columns 0.18s ease;
}

.wm-app.wm-drawer-open {
  grid-template-columns: minmax(0, 1fr) 420px;
}

.wm-toolbar {
  grid-area: toolbar;
  background: #fff;
  border-bottom: 1px solid var(--wm-border);
  padding: 0;
  display: flex;
  flex-direction: column;
}

.wm-toolbar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 24px;
}

.wm-toolbar-row-primary {
  justify-content: space-between;
  min-height: 56px;
}

.wm-toolbar-row-filters {
  border-top: 1px solid var(--wm-border);
  background: #FAFAFC;
  min-height: 44px;
  font-size: 0.75rem;
}

.wm-page-title {
  font-size: 1.125rem; font-weight: 700; margin: 0;
  letter-spacing: -0.01em;
}

.wm-toolbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── View toggle (flat ⇄ globe) ─────────────────────────────────── */

.wm-view-toggle {
  display: inline-flex;
  background: var(--wm-bg);
  border: 1px solid var(--wm-border);
  border-radius: 999px;
  padding: 2px;
  font-size: 0.75rem;
}

.wm-toggle-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 14px;
  border: none;
  background: transparent;
  color: var(--wm-fg-muted);
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: 0.02em;
  transition: background 0.12s ease, color 0.12s ease;
}

.wm-toggle-btn:hover { color: var(--wm-fg); }

.wm-toggle-btn-active {
  background: #fff;
  color: var(--wm-accent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.wm-toolbar-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--wm-border);
  background: #fff;
  color: var(--wm-fg-muted);
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: 0.02em;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.wm-toolbar-btn:hover {
  color: var(--wm-fg);
  border-color: var(--wm-fg-muted);
}

/* ── Search ─────────────────────────────────────────────────────── */

.wm-search {
  position: relative;
}

.wm-search input {
  font-family: inherit;
  font-size: 0.8125rem;
  padding: 7px 14px 7px 34px;
  width: 260px;
  border: 1px solid var(--wm-border);
  border-radius: 999px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>") 12px center no-repeat;
  outline: none;
  color: var(--wm-fg);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.wm-search input:focus {
  border-color: var(--wm-accent);
  box-shadow: 0 0 0 3px rgba(95, 81, 213, 0.12);
}
.wm-search input::placeholder { color: var(--wm-fg-subtle); }

.wm-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  list-style: none;
  margin: 0;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--wm-border);
  border-radius: 8px;
  box-shadow: var(--wm-shadow);
  max-height: 320px;
  overflow-y: auto;
  z-index: 30;
}

.wm-search-result {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
}
.wm-search-result:hover,
.wm-search-result.wm-search-active {
  background: var(--wm-accent-bg);
}
.wm-search-result-iso {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--wm-fg-muted);
  padding: 2px 6px;
  background: var(--wm-bg);
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.wm-search-result-name { flex: 1; font-weight: 500; }
.wm-search-result-motion {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.wm-search-empty {
  padding: 14px;
  text-align: center;
  color: var(--wm-fg-subtle);
  font-size: 0.8125rem;
}

/* ── Filter chips ───────────────────────────────────────────────── */

.wm-filter-group {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}

.wm-filter-divider {
  width: 1px;
  height: 16px;
  background: var(--wm-border);
}

.wm-filter-spacer { flex: 1; }

.wm-filter-stats {
  font-size: 0.6875rem;
  color: var(--wm-fg-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.wm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--wm-border);
  background: #fff;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--wm-fg-muted);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease, opacity 0.1s ease;
  user-select: none;
}
.wm-chip:hover { color: var(--wm-fg); border-color: var(--wm-fg-muted); }
.wm-chip-count {
  font-size: 0.625rem;
  opacity: 0.7;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.wm-chip-swatch {
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--wm-motion-pending);
}

.wm-chip[data-motion="direct"]     .wm-chip-swatch { background: var(--wm-motion-direct); }
.wm-chip[data-motion="proxy"]      .wm-chip-swatch { background: var(--wm-motion-proxy); }
.wm-chip[data-motion="nam-routed"] .wm-chip-swatch { background: var(--wm-motion-nam-routed); }
.wm-chip[data-motion="unbundled"]  .wm-chip-swatch { background: var(--wm-motion-unbundled); }
.wm-chip[data-motion="no-go"]      .wm-chip-swatch { background: var(--wm-motion-no-go); }
.wm-chip[data-motion="pending"]    .wm-chip-swatch { background: var(--wm-motion-pending); }

.wm-chip.wm-chip-inactive {
  opacity: 0.4;
  border-style: dashed;
}
.wm-chip.wm-chip-inactive:hover { opacity: 0.7; }

/* ── Country dimming when filtered out ──────────────────────────── */

.wm-country.wm-filtered {
  opacity: 0.18;
  pointer-events: none;
}

/* ── Admin table view ───────────────────────────────────────────── */

.wm-table-frame {
  grid-area: map;
  background: #fff;
  overflow: auto;
  height: 100%;
}

.wm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  background: #fff;
}

.wm-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #FAFAFC;
}

.wm-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--wm-fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--wm-border);
  white-space: nowrap;
}

.wm-th-sortable {
  cursor: pointer;
  user-select: none;
}
.wm-th-sortable:hover { color: var(--wm-fg); }
.wm-th-sortable[data-sort-active]::after {
  content: '↑';
  display: inline-block;
  margin-left: 6px;
  font-size: 0.75rem;
  color: var(--wm-accent);
}
.wm-th-sortable[data-sort-active="desc"]::after { content: '↓'; }

.wm-table tbody tr {
  border-bottom: 1px solid var(--wm-border);
  cursor: pointer;
  transition: background 0.08s ease;
}
.wm-table tbody tr:hover { background: var(--wm-bg); }
.wm-table tbody tr.wm-row-selected { background: var(--wm-accent-bg); }
.wm-table tbody tr.wm-row-filtered {
  opacity: 0.35;
}
.wm-table tbody tr.wm-row-saving { background: rgba(34, 197, 94, 0.08); }

.wm-table td {
  padding: 9px 14px;
  vertical-align: middle;
  color: var(--wm-fg);
  white-space: nowrap;
}
.wm-table td.wm-td-empty { color: var(--wm-fg-subtle); }

.wm-td-country {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wm-td-iso {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--wm-fg-muted);
  background: var(--wm-bg);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.wm-td-name { font-weight: 500; }

.wm-td-inline-select {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 3px 6px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.1s ease, background 0.1s ease;
}
.wm-td-inline-select:hover { border-color: var(--wm-border); background: #fff; }
.wm-td-inline-select:focus { border-color: var(--wm-accent); background: #fff; }

.wm-td-wallet-status {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--wm-motion-pending-bg);
  color: var(--wm-motion-pending);
}
.wm-td-wallet-status[data-status="available"]   { background: var(--wm-motion-direct-bg);    color: var(--wm-motion-direct); }
.wm-td-wallet-status[data-status="restricted"]  { background: var(--wm-motion-unbundled-bg); color: var(--wm-motion-unbundled); }
.wm-td-wallet-status[data-status="unavailable"] { background: var(--wm-motion-no-go-bg);     color: var(--wm-motion-no-go); }

.wm-td-updated {
  color: var(--wm-fg-muted);
  font-size: 0.75rem;
}

.wm-table-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--wm-fg-muted);
  font-size: 0.875rem;
}

@media (max-width: 720px) {
  .wm-table-frame { display: none; }
}

/* ── Drawer Edit button + edit-form mode ────────────────────────── */

.wm-edit-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border: 1px solid var(--wm-border);
  background: #fff;
  color: var(--wm-fg);
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.wm-edit-btn:hover {
  background: var(--wm-accent-bg);
  border-color: var(--wm-accent);
  color: var(--wm-accent);
}

.wm-edit-form {
  padding-bottom: 80px;   /* room for sticky footer */
}

.wm-edit-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--wm-motion-no-go-bg);
  color: var(--wm-motion-no-go);
  font-size: 0.8125rem;
  font-weight: 500;
}

.wm-edit-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--wm-border);
}
.wm-edit-row:last-child { border-bottom: none; }

.wm-edit-label {
  font-size: 0.75rem;
  color: var(--wm-fg-muted);
  font-weight: 500;
}

.wm-edit-control { display: block; }

.wm-input {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 7px 10px;
  width: 100%;
  border: 1px solid var(--wm-border);
  border-radius: 6px;
  background: #fff;
  color: var(--wm-fg);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.wm-input:focus {
  border-color: var(--wm-accent);
  box-shadow: 0 0 0 3px rgba(95, 81, 213, 0.12);
}
textarea.wm-input { resize: vertical; min-height: 60px; line-height: 1.5; }

.wm-edit-providers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.wm-provider-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--wm-bg);
  border: 1px solid var(--wm-border);
  border-radius: 8px;
  padding: 10px 12px;
}

.wm-provider-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.wm-provider-fields .wm-edit-row {
  border-bottom: 1px dashed var(--wm-border);
  padding: 4px 0;
}
.wm-provider-fields .wm-edit-row:last-child { border-bottom: none; }

.wm-provider-remove {
  background: none;
  border: 1px solid var(--wm-border);
  color: var(--wm-fg-muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  margin-top: 4px;
}
.wm-provider-remove:hover {
  background: var(--wm-motion-no-go-bg);
  border-color: var(--wm-motion-no-go);
  color: var(--wm-motion-no-go);
}

.wm-edit-add-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px dashed var(--wm-border);
  background: #fff;
  color: var(--wm-accent);
  cursor: pointer;
  border-radius: 6px;
}
.wm-edit-add-btn:hover {
  border-color: var(--wm-accent);
  background: var(--wm-accent-bg);
}

.wm-wallet-edit-row {
  display: grid;
  grid-template-columns: 90px 130px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--wm-border);
}
.wm-wallet-edit-row:last-child { border-bottom: none; }
.wm-wallet-edit-label {
  font-size: 0.75rem;
  color: var(--wm-fg-muted);
  font-weight: 600;
}

.wm-edit-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 16px -24px 0;
  padding: 12px 24px;
  background: #fff;
  border-top: 1px solid var(--wm-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  z-index: 2;
}

.wm-edit-btn-primary, .wm-edit-btn-secondary {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.wm-edit-btn-primary {
  background: var(--wm-accent);
  color: #fff;
}
.wm-edit-btn-primary:hover { filter: brightness(1.05); }
.wm-edit-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wm-edit-btn-secondary {
  background: #fff;
  color: var(--wm-fg-muted);
  border-color: var(--wm-border);
}
.wm-edit-btn-secondary:hover {
  border-color: var(--wm-fg-muted);
  color: var(--wm-fg);
}

/* ── Modal (bulk import) ────────────────────────────────────────── */

.wm-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

/* HTML `hidden` attribute would normally apply display:none from
   the UA stylesheet, but our display:flex above wins. Make hidden
   actually hide the modal. */
.wm-modal-root[hidden] { display: none !important; }

.wm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.wm-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: min(720px, 100%);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.wm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--wm-border);
}
.wm-modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
}
.wm-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--wm-fg-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.wm-modal-close:hover { background: var(--wm-bg); color: var(--wm-fg); }

.wm-modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.wm-format-toggle {
  display: inline-flex;
  background: var(--wm-bg);
  border: 1px solid var(--wm-border);
  border-radius: 999px;
  padding: 2px;
  font-size: 0.75rem;
  align-self: flex-start;
}

.wm-import-help {
  margin: 0;
  padding: 8px 12px;
  background: var(--wm-bg);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--wm-fg-muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.wm-import-textarea {
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 220px;
}

.wm-import-diff {
  border: 1px solid var(--wm-border);
  border-radius: 8px;
  padding: 12px;
  background: var(--wm-bg);
  font-size: 0.8125rem;
  max-height: 280px;
  overflow-y: auto;
}

.wm-diff-summary {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--wm-border);
  margin-bottom: 12px;
  font-weight: 600;
}
.wm-diff-summary span { display: inline-flex; align-items: center; gap: 6px; }
.wm-diff-summary .wm-diff-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--wm-fg-muted);
}
.wm-diff-summary .wm-diff-new   .wm-diff-dot { background: var(--wm-motion-direct); }
.wm-diff-summary .wm-diff-upd   .wm-diff-dot { background: var(--wm-motion-proxy); }
.wm-diff-summary .wm-diff-skip  .wm-diff-dot { background: var(--wm-motion-pending); }
.wm-diff-summary .wm-diff-err   .wm-diff-dot { background: var(--wm-motion-no-go); }

.wm-diff-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
}
.wm-diff-list li {
  padding: 4px 0;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.wm-diff-list li.wm-diff-error { color: var(--wm-motion-no-go); }
.wm-diff-iso {
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  width: 30px;
}

.wm-import-progress {
  font-size: 0.75rem;
  color: var(--wm-fg-muted);
  text-align: center;
  padding: 4px 0;
}

.wm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--wm-border);
  background: #FAFAFC;
}

/* ── Drawer copy-summary button ─────────────────────────────────── */

.wm-copy-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border: 1px solid var(--wm-border);
  background: #fff;
  color: var(--wm-fg-muted);
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-right: 6px;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.wm-copy-btn:hover {
  background: var(--wm-accent-bg);
  border-color: var(--wm-accent);
  color: var(--wm-accent);
}
.wm-copy-btn.wm-copy-flash {
  background: var(--wm-motion-direct-bg);
  border-color: var(--wm-motion-direct);
  color: var(--wm-motion-direct);
}

/* ── Legend ─────────────────────────────────────────────────────── */

.wm-legend {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 0.75rem;
}

.wm-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--wm-border);
  border-radius: 999px;
  background: #fff;
  color: var(--wm-fg-muted);
  font-weight: 500;
}

.wm-legend-swatch {
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--wm-motion-pending);
}

.wm-legend-item[data-motion="direct"]     .wm-legend-swatch { background: var(--wm-motion-direct); }
.wm-legend-item[data-motion="proxy"]      .wm-legend-swatch { background: var(--wm-motion-proxy); }
.wm-legend-item[data-motion="nam-routed"] .wm-legend-swatch { background: var(--wm-motion-nam-routed); }
.wm-legend-item[data-motion="unbundled"]  .wm-legend-swatch { background: var(--wm-motion-unbundled); }
.wm-legend-item[data-motion="no-go"]      .wm-legend-swatch { background: var(--wm-motion-no-go); }
.wm-legend-item[data-motion="pending"]    .wm-legend-swatch { background: var(--wm-motion-pending); }

/* ── Map ────────────────────────────────────────────────────────── */

.wm-map-frame {
  grid-area: map;
  position: relative;
  background: var(--wm-map-bg);
  overflow: hidden;
}

.wm-map {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.wm-map:active { cursor: grabbing; }

/* ── Globe view ─────────────────────────────────────────────────── */

.wm-globe-sphere {
  fill: #F8FAFB;
  stroke: var(--wm-border);
  stroke-width: 1;
}

.wm-graticule {
  fill: none;
  stroke: rgba(38, 38, 38, 0.06);
  stroke-width: 0.5;
  stroke-linejoin: round;
  pointer-events: none;
}

.wm-app[data-view="globe"] .wm-map-frame {
  background: #FFFFFF;
}

.wm-country {
  fill: var(--wm-motion-pending-bg);
  stroke: #fff;
  stroke-width: 0.5;
  stroke-linejoin: round;
  transition: fill 0.12s ease, stroke 0.12s ease;
  cursor: pointer;
}

.wm-country[data-motion="direct"]     { fill: var(--wm-motion-direct-bg); }
.wm-country[data-motion="proxy"]      { fill: var(--wm-motion-proxy-bg); }
.wm-country[data-motion="nam-routed"] { fill: var(--wm-motion-nam-routed-bg); }
.wm-country[data-motion="unbundled"]  { fill: var(--wm-motion-unbundled-bg); }
.wm-country[data-motion="no-go"]      { fill: var(--wm-motion-no-go-bg); }
.wm-country[data-motion="pending"]    { fill: var(--wm-motion-pending-bg); }

.wm-country.wm-no-record {
  fill: #DDE2E9;
  cursor: not-allowed;
}

.wm-country:hover {
  stroke: var(--wm-fg);
  stroke-width: 1;
  filter: brightness(0.95);
}

.wm-country.wm-selected {
  stroke: var(--wm-accent);
  stroke-width: 1.5;
  filter: brightness(0.92);
}

.wm-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wm-fg-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.wm-map-loading.hidden { display: none; }

/* ── Tooltip ────────────────────────────────────────────────────── */

.wm-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(38, 38, 38, 0.92);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 8px));
  opacity: 0;
  transition: opacity 0.1s ease;
  z-index: 5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.wm-tooltip.visible { opacity: 1; }

.wm-tooltip-name { font-weight: 600; }
.wm-tooltip-motion {
  font-size: 0.6875rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ── Drawer ─────────────────────────────────────────────────────── */

.wm-drawer {
  grid-area: drawer;
  background: #fff;
  border-left: 1px solid var(--wm-border);
  overflow-y: auto;
  width: 0;
  transition: width 0.18s ease;
  display: flex;
  flex-direction: column;
}

.wm-app.wm-drawer-open .wm-drawer {
  width: 420px;
}

.wm-drawer-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--wm-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.wm-drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.wm-drawer-subtitle {
  font-size: 0.75rem;
  color: var(--wm-fg-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.wm-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--wm-fg-muted);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  line-height: 1;
}
.wm-drawer-close:hover { background: var(--wm-bg); color: var(--wm-fg); }

.wm-drawer-body {
  padding: 16px 24px 24px;
}

.wm-drawer-section {
  margin-bottom: 20px;
}

.wm-drawer-section h3 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wm-fg-muted);
  margin: 0 0 8px;
}

.wm-motion-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--wm-motion-pending-bg);
  color: var(--wm-motion-pending);
}
.wm-motion-pill[data-motion="direct"]     { background: var(--wm-motion-direct-bg); color: var(--wm-motion-direct); }
.wm-motion-pill[data-motion="proxy"]      { background: var(--wm-motion-proxy-bg); color: var(--wm-motion-proxy); }
.wm-motion-pill[data-motion="nam-routed"] { background: var(--wm-motion-nam-routed-bg); color: var(--wm-motion-nam-routed); }
.wm-motion-pill[data-motion="unbundled"]  { background: var(--wm-motion-unbundled-bg); color: var(--wm-motion-unbundled); }
.wm-motion-pill[data-motion="no-go"]      { background: var(--wm-motion-no-go-bg); color: var(--wm-motion-no-go); }
.wm-motion-pill[data-motion="pending"]    { background: var(--wm-motion-pending-bg); color: var(--wm-motion-pending); }

.wm-field {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--wm-border);
}
.wm-field:last-child { border-bottom: none; }
.wm-field-label { color: var(--wm-fg-muted); font-weight: 500; }
.wm-field-value { color: var(--wm-fg); word-break: break-word; }
.wm-field-value.wm-empty { color: var(--wm-fg-subtle); font-style: italic; }

.wm-wallet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.wm-wallet-card {
  border: 1px solid var(--wm-border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  background: #fff;
}
.wm-wallet-card .wm-wallet-name {
  font-size: 0.75rem;
  color: var(--wm-fg-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.wm-wallet-card .wm-wallet-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wm-wallet-card[data-status="available"]   { background: var(--wm-motion-direct-bg);    border-color: var(--wm-motion-direct); }
.wm-wallet-card[data-status="available"]   .wm-wallet-status { color: var(--wm-motion-direct); }
.wm-wallet-card[data-status="restricted"]  { background: var(--wm-motion-unbundled-bg); border-color: var(--wm-motion-unbundled); }
.wm-wallet-card[data-status="restricted"]  .wm-wallet-status { color: var(--wm-motion-unbundled); }
.wm-wallet-card[data-status="unavailable"] { background: var(--wm-motion-no-go-bg);     border-color: var(--wm-motion-no-go); }
.wm-wallet-card[data-status="unavailable"] .wm-wallet-status { color: var(--wm-motion-no-go); }
.wm-wallet-card[data-status="unknown"]     { background: var(--wm-motion-pending-bg);   border-color: var(--wm-border); }
.wm-wallet-card[data-status="unknown"]     .wm-wallet-status { color: var(--wm-motion-pending); }

/* ── Mobile ─────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .wm-app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "toolbar" "map";
    height: calc(100vh - 47px);
  }
  .wm-app.wm-drawer-open .wm-drawer {
    position: fixed;
    inset: 0;
    width: 100%;
    z-index: 100;
    border-left: none;
  }
}
