html,
body {
  height: 100%;
}

#root {
  min-height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: #020b1d;
}

/* Event map marker shared by /event and report map previews. The marker is
   rendered by Mapbox outside the page style scope, so these rules must be
   global to keep the popup anchored and readable in every report. */
.biltech-event-overlay {
  position: relative;
  z-index: 10;
  width: 1px;
  height: 1px;
  pointer-events: none;
  color: #17233d;
}

.biltech-event-pulse {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.biltech-event-pulse span {
  position: absolute;
  inset: 50%;
  width: 34px;
  height: 34px;
  border: 1px solid currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.2);
  opacity: 0;
  animation: biltech-event-radar 4.4s ease-out 1 forwards;
}

.biltech-event-pulse span:nth-child(2) { animation-delay: .3s; }
.biltech-event-pulse span:nth-child(3) { animation-delay: .6s; }

.biltech-event-popover {
  position: absolute;
  left: 50%;
  bottom: 38px;
  transform: translateX(calc(-50% + var(--biltech-event-popover-offset, 0px)));
  width: min(198px, calc(100vw - 20px));
  min-width: 0;
  padding: 7px 8px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 7px;
  box-shadow: 0 5px 14px rgba(15, 23, 42, .14);
  color: #17233d;
  white-space: normal;
  overflow-wrap: anywhere;
  z-index: 2;
}

.biltech-event-popover::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #e3e8ef;
  border-bottom: 1px solid #e3e8ef;
  transform: translateX(-50%) rotate(45deg);
}

.biltech-event-popover-title {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

.biltech-event-popover-icon {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.biltech-event-popover-icon svg {
  width: 14px;
  height: 14px;
}

.biltech-event-popover-meta {
  position: relative;
  z-index: 1;
  margin-top: 3px;
  padding-left: 28px;
  color: #46566e;
  font-size: 9.5px;
  line-height: 1.2;
}

.biltech-event-popover-meta strong { color: #dc2626; }

@keyframes biltech-event-radar {
  0% { opacity: .65; transform: translate(-50%, -50%) scale(.2); }
  75% { opacity: .18; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(3.2); }
}

.biltech-loader {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  min-width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  color: #fff;
  background: #020b1d;
  opacity: 1;
  transition: opacity 300ms ease;
  animation: biltech-loader-enter 360ms ease both;
  isolation: isolate;
  user-select: none;
  touch-action: none;
}

.biltech-loader--leaving {
  opacity: 0;
  pointer-events: none;
}

.biltech-loader__backdrop {
  position: absolute;
  inset: -2px;
  z-index: -1;
  background:
    radial-gradient(
      circle at center,
      rgba(2, 11, 29, 0.94) 0%,
      rgba(2, 13, 34, 0.75) 40%,
      rgba(1, 10, 28, 0.7) 100%
    ),
    linear-gradient(rgba(2, 13, 34, 0.64), rgba(2, 13, 34, 0.88)),
    url('/biltech-loader-map.webp') center / cover no-repeat;
}

.biltech-loader__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(88vw, 440px);
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  text-align: center;
  transform: scale(1);
  transition: transform 300ms ease;
}

.biltech-loader--leaving .biltech-loader__content {
  transform: scale(0.975);
}

.biltech-loader__visual {
  position: relative;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
}

.biltech-loader__pulse {
  position: absolute;
  inset: 27px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(16, 125, 255, 0.14) 0%,
    rgba(11, 91, 205, 0.07) 56%,
    transparent 72%
  );
  animation: biltech-loader-pulse 2.4s ease-in-out infinite;
}

.biltech-loader__ring {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: conic-gradient(
    from 20deg,
    #0759d7 0deg,
    #0b85ff 215deg,
    #5ee9ff 320deg,
    transparent 350deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
  animation: biltech-loader-spin 1.45s linear infinite;
}

.biltech-loader__dot {
  position: absolute;
  top: 15px;
  right: 28px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d8fbff;
  box-shadow:
    0 0 6px #fff,
    0 0 14px #55e6ff;
}

.biltech-loader__icon {
  position: relative;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  object-fit: cover;
}

.biltech-loader__brand {
  margin-top: 30px;
  font:
    700 clamp(1.55rem, 3vw, 2.15rem) / 1.1 Arial,
    sans-serif;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}

.biltech-loader__brand span:last-child {
  color: #1685ff;
}

.biltech-loader__message {
  min-height: 1.4em;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.7);
  font:
    400 clamp(0.82rem, 1.5vw, 0.96rem) / 1.4 Arial,
    sans-serif;
  letter-spacing: 0.025em;
  opacity: 0;
  transition: opacity 180ms ease;
}

.biltech-loader__message--visible {
  opacity: 1;
}

@keyframes biltech-loader-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes biltech-loader-spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes biltech-loader-pulse {
  0%,
  100% {
    opacity: 0.28;
  }
  50% {
    opacity: 0.68;
  }
}

@media (max-width: 600px) {
  .biltech-loader__visual {
    width: 166px;
    height: 166px;
  }

  .biltech-loader__icon {
    width: 108px;
    height: 108px;
    border-radius: 50%;
  }

  .biltech-loader__brand {
    margin-top: 24px;
  }

  .biltech-loader__message {
    margin-top: 18px;
  }
}

@media (max-height: 440px) and (orientation: landscape) {
  .biltech-loader__content {
    transform: scale(0.76);
  }

  .biltech-loader__brand {
    margin-top: 12px;
  }

  .biltech-loader__message {
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .biltech-loader,
  .biltech-loader__message {
    animation: none;
    transition-duration: 1ms;
  }

  .biltech-loader__ring,
  .biltech-loader__pulse {
    animation: none;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: black;
  }
}

.root {
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media print {
  html,
  body,
  #root {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body {
    margin: 0;
  }

  .trip-print-content {
    page: trip-report;
    color: #0f172a;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

@page trip-report {
  size: A4 portrait;
  margin: 10mm;
}
