:root {
  color-scheme: dark;
  --bg: #05090e;
  --surface: #071119;
  --line: rgba(94, 219, 229, 0.18);
  --cyan: #4de2de;
  --green: #62e6a7;
  --muted: #7f9aa3;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  color: #e8f5f6;
  font-family: var(--sans);
}

.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.public-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 82px minmax(0, 1fr) 46px;
  background:
    radial-gradient(circle at 30% -10%, rgba(32, 124, 142, 0.16), transparent 38%),
    #05090e;
}

.public-header {
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 25px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 10, 15, 0.94);
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.public-brand__mark {
  width: 42px;
  height: 42px;
  position: relative;
  border: 1px solid rgba(77, 226, 222, 0.42);
  background:
    linear-gradient(var(--cyan), var(--cyan)) center / 18px 1px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) center / 1px 18px no-repeat,
    rgba(77, 226, 222, 0.04);
  box-shadow: inset 0 0 20px rgba(77, 226, 222, 0.03);
}

.public-brand p {
  margin: 0 0 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.public-brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.public-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #9ab4ba;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
}

#publicStatusDot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f3c766;
  box-shadow: 0 0 10px rgba(243, 199, 102, 0.72);
}

#publicStatusDot.is-live {
  background: var(--green);
  box-shadow: 0 0 11px rgba(98, 230, 167, 0.8);
}

#publicStatusDot.is-error {
  background: #ff5e73;
  box-shadow: 0 0 11px rgba(255, 94, 115, 0.75);
}

.public-map-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #03080c;
}

#publicMap {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(rgba(59, 144, 154, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 144, 154, 0.045) 1px, transparent 1px),
    #03080c;
  background-size: 30px 30px;
}

.leaflet-tile-pane {
  opacity: 0.86;
}

.leaflet-tile {
  filter: grayscale(1) brightness(0.42) contrast(1.28) sepia(0.22)
    hue-rotate(145deg) saturate(0.82);
}

.leaflet-control-attribution {
  background: rgba(3, 9, 13, 0.8) !important;
  color: #6f8991 !important;
  font-size: 9px !important;
  pointer-events: none;
}

.leaflet-control-attribution a {
  color: #78bfc2 !important;
  pointer-events: none;
}

.public-grid {
  position: absolute;
  z-index: 400;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(159, 245, 245, 0.05) 4px
  );
}

.public-corners {
  position: absolute;
  z-index: 450;
  inset: 15px;
  pointer-events: none;
}

.public-corners i {
  width: 24px;
  height: 24px;
  position: absolute;
  border-color: rgba(77, 226, 222, 0.34);
}

.public-corners i:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 1px solid;
  border-left: 1px solid;
}

.public-corners i:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 1px solid;
  border-right: 1px solid;
}

.public-corners i:nth-child(3) {
  right: 0;
  bottom: 0;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.public-corners i:nth-child(4) {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.public-live-label,
.public-legend {
  position: absolute;
  z-index: 500;
  border: 1px solid var(--line);
  background: rgba(3, 11, 16, 0.86);
  color: #8ba3aa;
  font-family: var(--mono);
  font-size: 9px;
  pointer-events: none;
}

.public-live-label {
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  letter-spacing: 0.12em;
}

.public-live-label span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px rgba(98, 230, 167, 0.78);
}

.public-legend {
  right: 24px;
  bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px 14px;
  padding: 10px 13px;
}

.public-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.public-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.legend-normal {
  background: #62e6a7;
}

.legend-crawler {
  background: #57a9ff;
}

.legend-bot {
  background: #ab8cff;
}

.legend-scanner {
  background: #ff985c;
}

.legend-suspicious {
  background: #ff5e73;
}

.legend-unknown {
  background: #f3c766;
}

.public-footer {
  position: relative;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 0 88px 0 20px;
  border-top: 1px solid var(--line);
  color: #718890;
  background: rgba(4, 10, 15, 0.94);
  font-size: 10px;
  text-align: center;
}

.public-admin-link {
  position: absolute;
  right: 18px;
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(94, 219, 229, 0.14);
  border-radius: 3px;
  color: rgba(127, 154, 163, 0.5);
  background: rgba(77, 226, 222, 0.025);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.public-admin-link:hover,
.public-admin-link:focus-visible {
  border-color: rgba(77, 226, 222, 0.36);
  color: rgba(179, 218, 223, 0.82);
  background: rgba(77, 226, 222, 0.07);
  outline: none;
}

.public-pulse-core,
.public-pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
}

.public-pulse-core {
  filter: drop-shadow(0 0 6px currentColor);
  animation:
    public-core 900ms ease-in-out 4,
    public-life 5.8s ease-out forwards;
}

.public-pulse-ring {
  filter: drop-shadow(0 0 5px currentColor);
  animation:
    public-ring 1.45s ease-out 4,
    public-life 5.8s ease-out forwards;
}

@keyframes public-core {
  0%,
  100% {
    transform: scale(0.82);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
}

@keyframes public-ring {
  0% {
    transform: scale(0.28);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes public-life {
  0%,
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (max-width: 620px) {
  .public-shell {
    grid-template-rows: 72px minmax(0, 1fr) 58px;
  }

  .public-header {
    padding: 0 14px;
  }

  .public-brand__mark {
    width: 35px;
    height: 35px;
  }

  .public-brand p {
    display: none;
  }

  .public-brand h1 {
    font-size: 17px;
  }

  .public-live-label {
    top: 15px;
    left: 15px;
  }

  .public-legend {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .public-footer {
    padding-right: 76px;
    padding-left: 10px;
    font-size: 8px;
  }

  .public-admin-link {
    right: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
