/* ============================================================
   noise.widgita.xyz — all styles (tokens + base + map-specific)
   ============================================================ */

:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --font-ui: "Inter", "InterVariable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "JetBrainsMono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-18: 18px;
  --fs-22: 22px;
  --fs-28: 28px;
  --fs-36: 36px;

  --motion-fast: 120ms;
  --motion-mid: 200ms;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);

  --nav-h: 48px;
  --sidebar-w: 340px;
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1014;
  --bg-elev: #14171d;
  --surface: #181c24;
  --surface-2: #1d212a;
  --surface-3: #232834;
  --surface-hover: #20242e;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(110, 231, 209, 0.55);
  --text: #e6e9ef;
  --text-strong: #f3f5f9;
  --text-muted: #9aa3b2;
  --text-faint: #6b7280;
  --accent: #6ee7d1;
  --accent-strong: #34d3b6;
  --accent-soft: rgba(110, 231, 209, 0.12);
  --accent-on: #07171a;
  --danger: #ec7676;
  --warning: #e6c06b;
  --success: #6dd29a;
  --info: #7eb6e6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.45);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf9f6;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --surface-3: #ebeae5;
  --surface-hover: #f0efea;
  --border: rgba(20, 22, 28, 0.10);
  --border-strong: rgba(20, 22, 28, 0.18);
  --border-focus: rgba(20, 130, 110, 0.55);
  --text: #1e2230;
  --text-strong: #0c1018;
  --text-muted: #5b6373;
  --text-faint: #8a92a1;
  --accent: #0e9d82;
  --accent-strong: #0a8770;
  --accent-soft: rgba(14, 157, 130, 0.10);
  --accent-on: #ffffff;
  --danger: #c1453f;
  --warning: #b08416;
  --success: #1f9d63;
  --info: #2d6cb6;
  --shadow-sm: 0 1px 2px rgba(20, 22, 28, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 22, 28, 0.10);
  --shadow-lg: 0 20px 40px rgba(20, 22, 28, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------- Nav bar */
.nw-nav {
  position: relative;
  z-index: 30;
  height: var(--nav-h);
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.nw-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nw-brand:hover { text-decoration: none; opacity: 0.9; }
.nw-brand-mark {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--accent-on);
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: var(--fs-13);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15) inset;
}
.nw-brand-word {
  font-size: var(--fs-14);
  font-weight: 600;
}
.nw-nav-title {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-left: var(--space-2);
  padding-left: var(--space-3);
  border-left: 1px solid var(--border);
}
.nw-nav-tool {
  font-family: var(--font-mono);
  font-size: var(--fs-13);
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
.nw-nav-sub {
  font-size: var(--fs-12);
  color: var(--text-muted);
}
@media (max-width: 540px) { .nw-nav-sub { display: none; } }

.nw-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.nw-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--space-3);
  color: var(--text-muted);
  font-size: var(--fs-13);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.nw-nav-link:hover {
  color: var(--text-strong);
  background: var(--surface-hover);
  text-decoration: none;
}
.nw-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px; height: 32px;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease;
}
.nw-icon-btn:hover { color: var(--text-strong); background: var(--surface-hover); }
.nw-icon-btn .nw-icon-sun { display: none; }
.nw-icon-btn .nw-icon-moon { display: block; }
:root[data-theme="dark"] .nw-icon-btn .nw-icon-sun { display: block; }
:root[data-theme="dark"] .nw-icon-btn .nw-icon-moon { display: none; }

/* ----------------------------------------------------------- Layout */
.nw-app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: calc(100dvh - var(--nav-h));
  position: relative;
}

.nw-sidebar {
  grid-column: 1;
  overflow-y: auto;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.nw-sidebar-inner {
  padding: var(--space-5) var(--space-4) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.nw-sheet-handle { display: none; }

.nw-map-wrap {
  grid-column: 2;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
.nw-map {
  position: absolute;
  inset: 0;
}

/* ----------------------------------------------------------- Mobile */
@media (max-width: 820px) {
  .nw-app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .nw-map-wrap { grid-column: 1; grid-row: 1; }

  .nw-sidebar {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    border-right: 0;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--bg-elev);
    box-shadow: var(--shadow-lg);
    max-height: 85dvh;
    transform: translateY(calc(100% - 52px));
    transition: transform var(--motion-mid) var(--ease-standard);
    z-index: 20;
    will-change: transform;
  }
  .nw-sidebar.nw-sidebar-expanded { transform: translateY(0); }

  .nw-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    height: 52px;
    padding: 0 var(--space-4);
    background: transparent;
    color: var(--text-muted);
    font-size: var(--fs-13);
    border-bottom: 1px solid var(--border);
  }
  .nw-sheet-grip {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--border-strong);
  }
  .nw-sheet-handle-label {
    font-weight: 500;
    color: var(--text);
  }
}

/* ----------------------------------------------------------- Section */
.nw-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.nw-section-h {
  margin: 0;
  font-size: var(--fs-11);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* ----------------------------------------------------------- Search */
.nw-search { position: relative; }
.nw-search-input {
  width: 100%;
  padding: 10px 34px 10px 34px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-strong);
  font-size: var(--fs-14);
  font-family: var(--font-ui);
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}
.nw-search-input::placeholder { color: var(--text-faint); }
.nw-search-input:hover { background: var(--surface-hover); }
.nw-search-input:focus {
  outline: 0;
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.nw-search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.nw-search-clear {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  display: grid; place-items: center;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.nw-search-clear:hover { color: var(--text-strong); background: var(--surface-hover); }

.nw-search-results {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 4px;
  list-style: none;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 15;
  max-height: 320px;
  overflow-y: auto;
}
.nw-search-result {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nw-search-result[aria-selected="true"],
.nw-search-result:hover { background: var(--surface-hover); }
.nw-search-result-primary {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--text-strong);
}
.nw-search-result-secondary {
  font-size: var(--fs-12);
  color: var(--text-muted);
}
.nw-search-result-type {
  align-self: flex-start;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}
.nw-search-result-empty {
  padding: 10px;
  font-size: var(--fs-13);
  color: var(--text-muted);
  text-align: center;
}

/* ----------------------------------------------------------- Presets */
.nw-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nw-preset {
  padding: 4px 10px;
  font-size: var(--fs-12);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-pill);
  transition: all var(--motion-fast) ease;
}
.nw-preset:hover {
  border-color: var(--accent);
  color: var(--text-strong);
  background: var(--accent-soft);
}

.nw-geo-row { display: flex; }
.nw-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--fs-13);
  transition: all var(--motion-fast) ease;
}
.nw-btn:hover { background: var(--surface-hover); color: var(--text-strong); }
.nw-btn-ghost { background: transparent; }
.nw-btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
  font-weight: 600;
}
.nw-btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--accent-on);
}
.nw-btn-sm { padding: 4px 10px; font-size: var(--fs-12); }

/* ----------------------------------------------------------- Layer list */
.nw-section-hint {
  margin: 0 0 var(--space-2);
  font-size: var(--fs-12);
  color: var(--text-muted);
  line-height: 1.4;
}
.nw-layer-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nw-layer {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: stretch;
  gap: var(--space-2);
  padding: 4px 4px 4px 0;
  border-radius: var(--radius-md);
  user-select: none;
  min-height: 36px;
  position: relative;
  background: transparent;
  transition: background var(--motion-fast) ease,
              box-shadow var(--motion-fast) ease,
              transform var(--motion-fast) ease;
}
.nw-layer:hover { background: var(--surface-hover); }
.nw-layer-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  cursor: grab;
  border-radius: var(--radius-sm);
  padding: 0;
  touch-action: none;
  align-self: center;
}
.nw-layer-handle:hover { color: var(--text); background: var(--surface-3); }
.nw-layer-handle:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
  color: var(--text);
}
.nw-layer:active .nw-layer-handle,
.nw-layer-dragging .nw-layer-handle { cursor: grabbing; }
.nw-layer-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  min-height: 36px;
  flex: 1;
  min-width: 0;
}
.nw-layer-head {
  display: grid;
  grid-template-columns: 18px 14px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  min-height: 24px;
}
.nw-layer-head input {
  margin: 0;
  width: 16px; height: 16px;
  accent-color: var(--accent);
}
.nw-layer-swatch {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 1px solid var(--border-strong);
}
.nw-layer-name {
  font-size: var(--fs-13);
  color: var(--text);
  font-weight: 500;
}
.nw-layer-source {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* Per-layer opacity slider. */
.nw-layer-opacity {
  display: grid;
  grid-template-columns: 1fr 34px;
  align-items: center;
  gap: var(--space-2);
  padding: 0 2px 2px 30px; /* indent under checkbox + swatch */
  transition: opacity var(--motion-fast) ease;
}
.nw-layer-opacity[data-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
}
.nw-opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  background: transparent;
  margin: 0;
  cursor: pointer;
}
.nw-opacity-slider:focus-visible { outline: none; }
.nw-opacity-slider::-webkit-slider-runnable-track {
  height: 3px;
  background: var(--border-strong);
  border-radius: 999px;
}
.nw-opacity-slider::-moz-range-track {
  height: 3px;
  background: var(--border-strong);
  border-radius: 999px;
}
.nw-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-elev);
  margin-top: -5px;
  box-shadow: 0 0 0 1px var(--border-strong);
  transition: transform var(--motion-fast) ease;
}
.nw-opacity-slider::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-elev);
  box-shadow: 0 0 0 1px var(--border-strong);
  transition: transform var(--motion-fast) ease;
}
.nw-opacity-slider:hover::-webkit-slider-thumb { transform: scale(1.15); }
.nw-opacity-slider:hover::-moz-range-thumb { transform: scale(1.15); }
.nw-opacity-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.nw-opacity-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.nw-opacity-value {
  font-size: 10px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-family: var(--font-mono);
}

/* Drag-and-drop visual affordance. */
.nw-layer-dragging {
  opacity: 0.5;
  box-shadow: 0 0 0 1px var(--accent-soft) inset;
}
.nw-layer-drop-above::before,
.nw-layer-drop-below::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  pointer-events: none;
}
.nw-layer-drop-above::before { top: -1px; }
.nw-layer-drop-below::after { bottom: -1px; }

/* ----------------------------------------------------------- Score panel */
.nw-score-section { min-height: 64px; }
.nw-score-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.nw-score-empty {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
}
.nw-score-empty p { margin: 0; font-size: var(--fs-13); line-height: 1.4; }
.nw-score-empty strong { color: var(--text); display: block; }
.nw-score-empty svg { flex: 0 0 auto; color: var(--accent); }

.nw-score-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}
.nw-score-ring { position: relative; width: 72px; height: 72px; flex: 0 0 auto; }
.nw-score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.nw-score-ring circle.bg {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 8;
}
.nw-score-ring circle.fg {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 600ms var(--ease-standard), stroke 300ms ease;
}
.nw-score-ring .nw-score-ring-num {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.nw-score-ring .nw-score-ring-num small {
  font-size: 10px; color: var(--text-faint); font-weight: 500; margin-left: 1px;
}
.nw-score-head-text {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.nw-score-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.nw-score-headline {
  font-size: var(--fs-15);
  font-weight: 600;
  color: var(--text-strong);
}
.nw-score-interp {
  margin: 4px 0 0;
  font-size: var(--fs-13);
  color: var(--text);
  line-height: 1.4;
}

.nw-score-breakdown {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.nw-score-row {
  display: grid;
  grid-template-columns: 64px 1fr 34px auto;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-12);
}
.nw-score-row-label {
  color: var(--text);
  font-weight: 500;
}
.nw-score-row-bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.nw-score-row-bar-fill {
  position: absolute; inset: 0;
  border-radius: 999px;
  transform-origin: left center;
  transition: transform 600ms var(--ease-standard), background 300ms ease;
  transform: scaleX(0);
}
.nw-score-row-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
}
.nw-score-row-source {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.nw-score-meta {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
}
.nw-score-coords {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  color: var(--text-muted);
}
.nw-score-actions {
  display: flex;
  gap: 6px;
}

/* ----------------------------------------------------------- Legend */
.nw-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.nw-legend-source {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}
.nw-legend-source[data-kind="eea"] {
  color: var(--accent);
  background: var(--accent-soft);
}
.nw-ramp {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nw-ramp-bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    #4CAF50 0%,
    #8BC34A 20%,
    #FFC107 42%,
    #FF9800 58%,
    #FF5722 72%,
    #F44336 86%,
    #B71C1C 100%
  );
}
.nw-ramp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nw-legend-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-12);
  color: var(--text-muted);
}
.nw-legend-list li { display: flex; align-items: center; gap: 8px; }
.nw-dot {
  width: 10px; height: 10px; border-radius: 3px;
  border: 1px solid var(--border-strong);
  flex: 0 0 auto;
}

/* ----------------------------------------------------------- Disclosure */
.nw-disclosure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}
.nw-disclosure summary {
  cursor: pointer;
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nw-disclosure summary::-webkit-details-marker { display: none; }
.nw-disclosure summary::after {
  content: "+";
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-14);
}
.nw-disclosure[open] summary::after { content: "−"; }
.nw-disclosure-body {
  padding: var(--space-3) 0 var(--space-2);
  font-size: var(--fs-12);
  color: var(--text);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nw-disclosure-body p { margin: 0; }
.nw-disclosure-body strong { color: var(--text-strong); }

/* ----------------------------------------------------------- Map overlays */
.nw-map-overlay {
  position: absolute;
  pointer-events: none;
}
.nw-map-overlay-loading {
  top: var(--space-4); left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-12);
  transition: opacity var(--motion-mid) ease;
  z-index: 5;
}
.nw-map-overlay-loading[hidden] { display: none; }
.nw-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: nw-spin 0.9s linear infinite;
}
.nw-spinner-sm { width: 11px; height: 11px; border-width: 1.5px; }
@keyframes nw-spin { to { transform: rotate(360deg); } }

.nw-tile-loading {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-12);
  pointer-events: none;
  z-index: 5;
  opacity: 0.95;
}
.nw-tile-loading[hidden] { display: none; }

.nw-source-badge {
  position: absolute;
  right: var(--space-4);
  bottom: var(--space-4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: var(--fs-12);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
  z-index: 5;
}
.nw-source-badge-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 2px rgba(230, 192, 107, 0.25);
}
.nw-source-badge[data-kind="eea"] .nw-source-badge-dot {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
@media (max-width: 820px) {
  .nw-source-badge { bottom: calc(52px + var(--space-3)); }
}

.nw-toast {
  position: absolute;
  left: 50%; bottom: var(--space-4);
  transform: translateX(-50%) translateY(20px);
  background: var(--text-strong);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-13);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-mid) ease, transform var(--motion-mid) var(--ease-standard);
  z-index: 10;
}
.nw-toast.nw-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------------- Pin marker */
.nw-pin {
  width: 22px; height: 22px;
  transform: translate(-50%, -100%);
}
.nw-pin-dot {
  width: 12px; height: 12px;
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: 50%;
  position: absolute;
  left: 5px; top: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 4px var(--accent-soft);
}
.nw-pin-pulse {
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: nw-pulse 1.6s ease-out infinite;
  opacity: 0.6;
}
@keyframes nw-pulse {
  0% { transform: scale(0.4); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ----------------------------------------------------------- MapLibre tweaks */
.maplibregl-ctrl-attrib {
  background: color-mix(in srgb, var(--bg-elev) 80%, transparent) !important;
  color: var(--text-muted) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 10px !important;
}
.maplibregl-ctrl-attrib a { color: var(--text) !important; }
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right { margin: var(--space-2) !important; }
@media (max-width: 820px) {
  .maplibregl-ctrl-bottom-left,
  .maplibregl-ctrl-bottom-right { margin-bottom: calc(52px + var(--space-2)) !important; }
}

/* ----------------------------------------------------------- Misc */
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
