.tracking-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 17px 19px;
  border: 2px solid #5d83a8;
  border-left-width: 7px;
  border-radius: 9px;
  background: #edf5fb;
  color: #17384c;
}
.tracking-alert strong,
.tracking-alert span,
.tracking-alert small { display: block; }
.tracking-alert strong { font-size: 17px; margin-bottom: 5px; }
.tracking-alert span { font-size: 13px; line-height: 1.5; }
.tracking-alert small { margin-top: 6px; color: #536d7b; line-height: 1.5; }
.tracking-alert.active { border-color: #13825e; background: #e4f5eb; }
.tracking-alert [data-slot=button] { flex: none; }
.live-location-link {
  background: #e3f4ea !important;
  border-color: #53a983 !important;
  color: #075d40 !important;
}
.live-location-ready {
  display: inline-flex;
  align-items: center;
  padding: 9px 11px;
  border-radius: 6px;
  background: #e3f4ea;
  color: #075d40;
  font-size: 12px;
  font-weight: 700;
}
.live-tracking-panel {
  margin-top: 14px;
  border: 1px solid #bdd4c8;
  border-radius: 9px;
  overflow: hidden;
  background: #f7faf8;
}
.live-tracking-panel > summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #075d40;
  font-size: 14px;
  font-weight: 800;
  list-style-position: inside;
}
.live-tracking-panel[open] > summary { border-bottom: 1px solid #d9e5de; }
.live-map-shell { padding: 12px; }
.live-map,
.live-map-empty {
  position: relative;
  width: 100%;
  height: 360px;
  overflow: hidden;
  border: 1px solid #aebfb5;
  border-radius: 8px;
  background: #dce8e1;
  isolation: isolate;
}
.live-map-empty {
  display: grid;
  place-items: center;
  height: 180px;
  padding: 20px;
  color: #66776e;
  text-align: center;
}
.live-map > img {
  position: absolute;
  width: 256px;
  height: 256px;
  max-width: none;
  z-index: 1;
  user-select: none;
}
.live-route-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}
.live-route-layer polyline {
  fill: none;
  stroke: #1677d2;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px #fff);
  stroke-dasharray: 14 10;
  animation: live-route-flow .8s linear infinite;
}
@keyframes live-route-flow { to { stroke-dashoffset: -24; } }
.live-marker {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 3px 5px #102d2588);
}
.live-marker.courier {
  width: 48px;
  height: 48px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #087c62;
  font-size: 24px;
  transition: left 1.8s linear, top 1.8s linear;
  animation: live-pulse 1.5s ease-in-out infinite;
}
.live-marker.destination {
  width: 27px;
  height: 27px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #dc3528;
  color: #fff;
}
.live-map-status {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  padding: 9px 12px;
  border-radius: 7px;
  background: #fffffff2;
  box-shadow: 0 3px 12px #12382d33;
}
.live-map-status strong,
.live-map-status span { display: block; }
.live-map-status strong { font-size: 12px; }
.live-map-status span { margin-top: 3px; font-size: 10px; color: #5f7168; }
.live-map-status.online strong { color: #087c62; }
.live-map-status.stale strong { color: #a33b2e; }
.live-map-zoom {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 6;
  display: grid;
  overflow: hidden;
  border: 1px solid #9cb0a5;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 12px #12382d33;
}
.live-map-zoom button {
  width: 42px;
  height: 42px;
  border: 0;
  border-bottom: 1px solid #d4dfd8;
  background: #fff;
  color: #103f36;
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.live-map-zoom button:last-child { border-bottom: 0; }
.live-map-zoom button:hover { background: #edf5f0; }
.live-map-zoom button:disabled { color: #aab5af; cursor: default; }
.live-map-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  padding: 10px 3px 0;
  font-size: 11px;
  color: #52685c;
}
.live-map-legend span { display: flex; align-items: center; gap: 5px; }
.live-map-legend i { width: 10px; height: 10px; border-radius: 50%; }
.courier-dot { background: #087c62; }
.destination-dot { background: #dc3528; }
.live-map-legend small { margin-left: auto; }
.pin-panel { grid-column: 1 / -1; }
.pin-editor { margin-top: 18px; }
.pin-editor-heading,
.pin-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}
.pin-editor-heading strong,
.pin-editor-heading span { display: block; }
.pin-editor-heading span { margin-top: 4px; color: #64776c; font-size: 12px; }
.pin-editor-heading button {
  border: 1px solid #a9c1b4;
  border-radius: 6px;
  background: #f1f7f3;
  color: #0b654d;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}
.pin-map { cursor: crosshair; }
.live-marker.destination.editable { pointer-events: none; box-shadow: 0 0 0 8px #dc352833; }
.pin-editor-footer span { color: #52685c; font-size: 12px; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 9px #087c6233; } }
@media (max-width: 650px) {
  .tracking-alert { align-items: stretch; flex-direction: column; }
  .tracking-alert [data-slot=button] { width: 100%; }
  .live-map, .live-map-empty { height: 300px; }
  .live-map-legend small { width: 100%; margin-left: 0; }
  .pin-editor-heading, .pin-editor-footer { align-items: stretch; flex-direction: column; }
  .pin-editor-footer [data-slot=button] { width: 100%; }
}
.courier-map-actions { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: .8rem 0; }
.courier-map-actions small { color: #56657a; }
.courier-map-expanded { position: fixed; inset: 0; z-index: 1000; background: #eef4f7; padding: .75rem; overflow: auto; }
.courier-map-expanded > header { position: sticky; top: 0; z-index: 12; display: flex; justify-content: space-between; align-items: center; gap: .8rem; margin-bottom: .6rem; padding: .7rem; border-radius: .7rem; background: #fff; box-shadow: 0 2px 10px #0f253322; }
.courier-map-expanded > header div { display: grid; gap: .15rem; min-width: 0; }
.courier-map-expanded > header small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.courier-map-expanded .live-map { min-height: 360px; }
.courier-map-safety { margin-top: .65rem; padding: .75rem; border-radius: .65rem; background: #fff3cd; color: #6b4e00; font-weight: 800; text-align: center; }
@media (max-width: 600px) { .courier-map-expanded { padding: .35rem; } .courier-map-expanded > header { align-items: stretch; flex-direction: column; } .courier-map-expanded > header button { width: 100%; } }
.courier-map-header-actions { display: flex !important; gap: .5rem; flex-wrap: wrap; }
.courier-map-expanded:fullscreen { width: 100vw; height: 100vh; inset: 0; }
.courier-map-expanded:fullscreen { padding: 0; overflow: hidden; background: #dbe7eb; }
.courier-map-expanded:fullscreen > header,
.courier-map-expanded:fullscreen > .courier-map-safety,
.courier-map-expanded:fullscreen .live-map-legend,
.courier-map-expanded:fullscreen .live-map-status,
.courier-map-expanded:fullscreen .map-credit { display: none !important; }
.courier-map-expanded:fullscreen .map-recenter {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 1002;
  display: block !important;
}
.courier-map-expanded:fullscreen .live-map-zoom {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 1002;
  display: grid !important;
  box-shadow: 0 4px 18px #0006;
}
.courier-map-expanded:fullscreen .live-map-shell,
.courier-map-expanded:fullscreen .live-map { width: 100vw; height: 100vh !important; min-height: 100vh; margin: 0; border: 0; border-radius: 0; }
@media (max-width: 600px) { .courier-map-header-actions { width: 100%; } .courier-map-header-actions button { flex: 1; } }
