html,
body,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  position: relative;
}

.imd-legend {
  position: absolute;
  z-index: 10;
  left: 12px;
  bottom: 28px;
  max-width: min(360px, calc(100vw - 24px));
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: #1a1a1a;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}

.imd-legend-heading {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.imd-legend-lead {
  margin: 0 0 8px;
  color: #333;
}

.imd-legend-scheme-note {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: #0d4a6e;
}

.imd-legend-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: flex-end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.imd-legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 28px;
}

.imd-legend-swatch {
  display: block;
  width: 22px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.imd-legend-decile-label {
  font-size: 11px;
  font-weight: 600;
  color: #222;
}

.a11y-demo-callout {
  position: fixed;
  z-index: 30;
  max-width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(13, 74, 110, 0.35);
  background: linear-gradient(165deg, #f0f8ff 0%, #ffffff 55%);
  color: #14232c;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.7) inset,
    0 8px 28px rgba(13, 74, 110, 0.22);
  pointer-events: none;
  animation: a11y-demo-callout-in 0.55s ease-out both;
}

.a11y-demo-callout-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #0d4a6e;
}

.a11y-demo-callout-body {
  margin: 0;
}

.a11y-demo-callout-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

@keyframes a11y-demo-callout-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-color-scheme: dark) {
  .imd-legend {
    background: rgba(22, 26, 32, 0.92);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f0f4f8;
  }

  .imd-legend-lead {
    color: #c9d4df;
  }

  .imd-legend-scheme-note {
    color: #9fd4ff;
  }

  .imd-legend-swatch {
    border-color: rgba(255, 255, 255, 0.35);
  }

  .imd-legend-decile-label {
    color: #e8eef4;
  }

  .a11y-demo-callout {
    background: linear-gradient(165deg, #1a2836 0%, #243241 55%);
    border-color: rgba(120, 190, 255, 0.35);
    color: #e8eef4;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06) inset,
      0 8px 28px rgba(0, 0, 0, 0.45);
  }

  .a11y-demo-callout-title {
    color: #b8ddff;
  }
}

.maplibregl-ctrl-top-right-link {
  z-index: 10;
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
  border-radius: 5px;
  text-decoration: none;
  color: #1a1a1a;
  margin: 4px;
}

.maplibregl-ctrl-top-right{
  right: 5px;
  top: 10px;
  pointer-events: all;
}
