/* Generated by brand/scripts/build-components.mjs from brand/components/. Do not edit. Load public/tokens/tokens.css first. */

/* Map (N6 of nuevauno/nu#341, nuevauno/nu#465): the pieces every app's map is drawn with. The frame holds the map that MapLibre draws
   (nu-ui's map, over nu-maps' style); on it, the markers (a point, a vehicle with its plate, an alert), the dashed zone and the floating
   card. The consumer puts the state on each marker. The lines and areas MapLibre paints read these same tokens. */
.nu-map {
  position: relative;
  width: 100%;
  min-height: calc(var(--nu-control-row) * 3);
  overflow: hidden;
  border: var(--nu-border-width) solid var(--nu-color-border);
  background: var(--nu-color-background);
}

.nu-map--fill {
  position: absolute;
  inset: 0;
  min-height: 0;
  border: 0;
}

.nu-map__canvas {
  width: 100%;
  height: 100%;
}

.nu-map__failed {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: var(--nu-space-16);
  color: var(--nu-color-muted);
  font-size: var(--nu-size-small);
  text-align: center;
}

.nu-map__card {
  position: absolute;
  top: var(--nu-space-12);
  right: var(--nu-space-12);
  z-index: 3;
  display: grid;
  width: min(calc(var(--nu-layout-card-min) * 1.7), calc(100% - var(--nu-space-24)));
  max-height: calc(100% - var(--nu-space-24));
}

/* A point: a pickup site, a stop, a pin. Accent unless its state says otherwise. */
.nu-map-dot {
  display: block;
  width: var(--nu-space-16);
  height: var(--nu-space-16);
  padding: 0;
  border: calc(var(--nu-border-width) * 2) solid var(--nu-color-surface);
  background: var(--nu-color-accent);
  box-shadow: var(--nu-shadow-floating);
  cursor: default;
}

button.nu-map-dot {
  cursor: pointer;
}

.nu-map-dot--ok {
  background: var(--nu-color-success);
}

.nu-map-dot--warning {
  background: var(--nu-color-warning);
}

.nu-map-dot--danger {
  background: var(--nu-color-error);
}

.nu-map-dot--neutral {
  background: var(--nu-color-faint);
}

/* A vehicle: a square with its plate in mono. Orange while it moves, faded and red without signal; the chosen one dark, beating. */
.nu-map-vehicle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--nu-space-6);
  height: var(--nu-control-pointer-small);
  padding: 0 var(--nu-space-8) 0 var(--nu-space-6);
  border: var(--nu-border-width) solid var(--nu-color-ink);
  background: var(--nu-color-surface);
  color: var(--nu-color-ink);
  font-family: var(--nu-font-family-mono);
  font-size: var(--nu-size-caption);
  white-space: nowrap;
  box-shadow: var(--nu-shadow-floating);
  cursor: default;
}

button.nu-map-vehicle {
  cursor: pointer;
}

.nu-map-vehicle:focus-visible,
.nu-map-dot:focus-visible,
.nu-map-alert:focus-visible {
  outline: var(--nu-border-focus) solid var(--nu-color-accent);
  outline-offset: var(--nu-border-focus);
}

.nu-map-vehicle__plate {
  max-width: calc(var(--nu-control-large) * 3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.nu-map-vehicle__dot {
  position: relative;
  width: var(--nu-space-10);
  height: var(--nu-space-10);
  background: var(--nu-color-info);
}

.nu-map-vehicle--moving .nu-map-vehicle__plate {
  max-width: calc(var(--nu-control-large) * 3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.nu-map-vehicle__dot {
  background: var(--nu-color-accent);
}

.nu-map-vehicle--silent {
  opacity: var(--nu-opacity-disabled);
}

.nu-map-vehicle--silent .nu-map-vehicle__plate {
  max-width: calc(var(--nu-control-large) * 3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.nu-map-vehicle__dot {
  background: var(--nu-color-error);
}

.nu-map-vehicle--selected {
  z-index: 2;
  opacity: 1;
  background: var(--nu-color-ink);
  color: var(--nu-color-surface);
}

.nu-map-vehicle--selected .nu-map-vehicle__plate {
  max-width: calc(var(--nu-control-large) * 3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.nu-map-vehicle__dot {
  background: var(--nu-color-accent);
}

.nu-map-vehicle--selected .nu-map-vehicle__dot::after {
  position: absolute;
  inset: 0;
  background: var(--nu-color-accent);
  content: "";
  animation: nu-map-ring calc(var(--nu-motion-count) * 2) var(--nu-motion-ease-out) infinite;
}

/* An alert where it happened (a stop, a speeding, a full container): a red diamond that beats. */
.nu-map-alert {
  display: block;
  width: var(--nu-space-14);
  height: var(--nu-space-14);
  padding: 0;
  border: calc(var(--nu-border-width) * 2) solid var(--nu-color-surface);
  background: var(--nu-color-error);
  box-shadow: var(--nu-shadow-floating);
  transform: rotate(45deg);
  animation: nu-map-alert calc(var(--nu-motion-count) * 2) var(--nu-motion-ease-in-out) infinite;
  cursor: default;
}

button.nu-map-alert {
  cursor: pointer;
}

/* A zone as the map draws it, for a legend or a chip: an area with a dashed border; the chosen one stronger. */
.nu-map-zone {
  display: inline-block;
  width: var(--nu-space-16);
  height: var(--nu-space-12);
  border: calc(var(--nu-border-width) * 2) dashed var(--nu-color-border-strong);
  background: var(--nu-color-accent-soft);
  vertical-align: middle;
}

.nu-map-zone--selected {
  border-color: var(--nu-color-accent);
}

@keyframes nu-map-ring {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(2.6);
  }
}

@keyframes nu-map-alert {
  50% {
    box-shadow: 0 0 0 var(--nu-space-6) var(--nu-color-accent-soft);
  }
}

@media (max-width: 767px) {
  .nu-map__card {
    position: static;
    width: auto;
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nu-map-vehicle--selected .nu-map-vehicle__dot::after,
  .nu-map-alert {
    animation: none;
  }
}
