:root {
  color-scheme: dark;
  --ink: #f7fbfb;
  --muted: rgba(247, 251, 251, 0.68);
  --dim: rgba(247, 251, 251, 0.45);
  --glass: rgba(6, 13, 15, 0.72);
  --glass-soft: rgba(6, 13, 15, 0.56);
  --line: rgba(255, 255, 255, 0.16);
  --water: #42a5ff;
  --power: #f7bd4a;
  --road: #ff6f61;
  --weather: #31d0b4;
  --safety: #b7a7ff;
  --live-red: #ff2f3f;
  --map-water: #9bcad0;
  --map-land: #cad8c6;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #071113;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.map-app,
.map-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 620px;
  overflow: hidden;
}

.map-stage {
  background: #d7e2df;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #d7e2df;
}

.map-canvas::before {
  content: none;
}

.leaflet-container {
  width: 100%;
  height: 100%;
  background: #d7e2df;
  cursor: grab;
  font-family: inherit;
}

.leaflet-container:active {
  cursor: grabbing;
}

.leaflet-tile-pane {
  filter: saturate(0.98) brightness(1) contrast(1);
}

.leaflet-control-attribution {
  border-radius: 8px 0 0 0;
  background: rgba(6, 13, 15, 0.72) !important;
  color: rgba(247, 251, 251, 0.72) !important;
  font-size: 0.68rem;
}

.leaflet-control-attribution a {
  color: #ffffff !important;
}

.leaflet-control-zoom {
  margin-right: 20px !important;
  margin-top: 84px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(6, 13, 15, 0.72);
}

.leaflet-control-zoom a {
  border: 0 !important;
  background: rgba(6, 13, 15, 0.72) !important;
  color: var(--ink) !important;
  font-size: 1.15rem !important;
  font-weight: 900;
}

.map-unavailable {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: var(--weather);
  color: #081012;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36);
  font-size: 0.76rem;
  font-weight: 950;
}

.map-pin {
  position: relative;
  transform: none;
  pointer-events: auto;
}

.map-pin.selected {
  transform: scale(1.12);
}

.pin.water {
  background: var(--water);
}

.pin.power {
  background: var(--power);
}

.pin.road {
  background: var(--road);
}

.pin.safety {
  background: var(--safety);
}

.pin.selected {
  outline: 6px solid rgba(255, 255, 255, 0.22);
  transform: translate(-50%, -50%) scale(1.12);
}

.map-pin.pin.selected {
  transform: scale(1.12);
}

.map-pin.phase-live {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.36), 0 0 0 4px rgba(255, 47, 63, 0.82);
}

.map-pin.phase-live::before {
  position: absolute;
  inset: -10px;
  border: 3px solid rgba(255, 47, 63, 0.84);
  border-radius: 999px;
  content: "";
  pointer-events: none;
  animation: livePinPulse 1.9s ease-out infinite;
}

@keyframes livePinPulse {
  0% {
    opacity: 0.88;
    transform: scale(0.78);
  }

  70% {
    opacity: 0;
    transform: scale(1.35);
  }

  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-pin.phase-live::before {
    animation: none;
  }
}

.pin-count {
  position: absolute;
  right: -10px;
  top: -10px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: #081012;
  color: #ffffff;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
}

.top-overlay,
.notice-sheet,
.selected-popover,
.sponsor-strip {
  position: absolute;
  z-index: 1000;
}

.top-overlay {
  top: 20px;
  left: 20px;
  width: min(540px, calc(100vw - 40px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.brand-row,
.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 3.8vw, 3rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.feed-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 7px 10px;
  font-weight: 900;
  white-space: nowrap;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.filter-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.filter-button.active {
  background: #f7fbfb;
  color: #081012;
}

.notice-sheet {
  left: 20px;
  bottom: 78px;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(36vh - 8px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.sponsor-strip {
  left: 20px;
  bottom: 20px;
  width: min(560px, calc(100vw - 40px));
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 13, 15, 0.5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.sponsor-strip span,
.inline-ad .notice-kicker {
  color: rgba(255, 224, 163, 0.86);
}

.sponsor-strip span {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sponsor-strip strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sponsor-strip.adsense-active {
  display: block;
  min-height: 116px;
  overflow: hidden;
  padding: 12px;
}

body.adsense-strip-active .notice-sheet {
  bottom: 156px;
  max-height: calc(36vh - 86px);
}

.adsense-label {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 224, 163, 0.86);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.adsense-unit {
  display: block;
  width: 100%;
  min-height: 90px;
}

.adsense-strip-ad {
  min-width: 300px;
}

.sheet-top {
  margin-bottom: 10px;
}

#resetButton {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  padding: 7px 10px;
  font-weight: 900;
}

.notice-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
  scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
}

.notice-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
  color: var(--muted);
  padding: 4px 2px 0;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.notice-section-heading span:last-child {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 0 7px;
  letter-spacing: 0;
}

.notice-section-heading.live {
  color: #ffb9bf;
}

.notice-section-heading.live span:last-child {
  background: rgba(255, 47, 63, 0.18);
  color: #ffd6da;
}

.notice-card,
.inline-ad {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  padding: 9px;
  text-align: left;
}

.notice-card.selected {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.16);
}

.notice-card.phase-live {
  border-color: rgba(255, 47, 63, 0.42);
  background: linear-gradient(90deg, rgba(255, 47, 63, 0.14), rgba(255, 255, 255, 0.08) 42%);
}

.notice-card.phase-live.selected {
  border-color: rgba(255, 210, 214, 0.7);
  background: linear-gradient(90deg, rgba(255, 47, 63, 0.22), rgba(255, 255, 255, 0.16) 48%);
}

.inline-ad {
  background: rgba(255, 190, 78, 0.1);
}

.inline-ad.adsense-active {
  display: block;
  min-height: 126px;
  overflow: hidden;
  padding: 12px;
}

.inline-ad.adsense-active .adsense-unit {
  min-height: 100px;
}

.category-line {
  width: 8px;
  min-height: 100%;
  border-radius: 999px;
  background: var(--weather);
}

.category-line.water {
  background: var(--water);
}

.category-line.power {
  background: var(--power);
}

.category-line.road {
  background: var(--road);
}

.category-line.safety {
  background: var(--safety);
}

.category-line.ad {
  background: #ffe0a3;
}

.notice-main {
  min-width: 0;
}

.notice-kicker,
.notice-meta,
.selected-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.35;
  text-transform: uppercase;
}

.notice-title {
  margin: 3px 0 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.selected-popover {
  right: 20px;
  bottom: 20px;
  width: min(390px, calc(100vw - 40px));
  min-height: 150px;
  padding: 16px 16px 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-left: 8px solid var(--weather);
  border-radius: 8px;
  background: rgba(5, 10, 12, 0.86);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  backdrop-filter: blur(18px);
}

.selected-popover.is-hidden {
  display: none;
}

.selected-popover.water {
  border-left-color: var(--water);
}

.selected-popover.power {
  border-left-color: var(--power);
}

.selected-popover.road {
  border-left-color: var(--road);
}

.selected-popover.safety {
  border-left-color: var(--safety);
}

.selected-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.selected-live {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(247, 251, 251, 0.9);
  padding: 5px 8px;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.selected-label-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.selected-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(247, 251, 251, 0.92);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
}

.selected-close:hover,
.selected-close:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.selected-popover h3 {
  margin: 9px 0 8px;
  color: #ffffff;
  font-size: 1.28rem;
  line-height: 1.16;
}

.selected-popover .selected-meta + .selected-meta {
  margin-top: 3px;
}

.selected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.selected-popover .source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  background: #f7fbfb;
  color: #081012;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.selected-popover .source-button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.empty-state {
  padding: 24px 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .selected-popover {
    right: 16px;
    bottom: calc(36vh + 94px);
    width: min(370px, calc(100vw - 32px));
  }

  body.adsense-strip-active .selected-popover {
    bottom: calc(36vh + 172px);
  }
}

@media (max-width: 720px) {
  .map-app,
  .map-stage {
    min-height: 100svh;
  }

  .top-overlay {
    top: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    padding: 13px;
  }

  .filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-button {
    min-height: 36px;
  }

  .notice-sheet {
    left: 12px;
    bottom: 60px;
    width: calc(100vw - 24px);
    max-height: calc(38vh - 8px);
    padding: 12px;
  }

  .sponsor-strip {
    left: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    justify-content: flex-start;
    min-height: 36px;
    padding: 7px 10px;
  }

  .sponsor-strip:not(.adsense-active) strong {
    display: none;
  }

  body.adsense-strip-active .sponsor-strip {
    width: calc(100vw - 24px);
    min-height: 112px;
    padding: 10px;
  }

  body.adsense-strip-active .notice-sheet {
    bottom: 140px;
    max-height: calc(38vh - 88px);
  }

  .selected-popover {
    left: 12px;
    right: auto;
    bottom: calc(38vh + 116px);
    width: calc(100vw - 24px);
    min-height: 0;
    padding: 12px 12px 12px 16px;
  }

  body.adsense-strip-active .selected-popover {
    bottom: calc(38vh + 176px);
  }

  .pin {
    width: 32px;
    height: 32px;
  }

  .selected-popover h3 {
    margin: 6px 0;
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .selected-popover .source-button {
    min-height: 34px;
    padding: 7px 10px;
  }

  .selected-actions {
    margin-top: 9px;
  }
}

@media (max-width: 420px) {
  .brand-row {
    align-items: flex-start;
  }

  .feed-count {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .notice-title {
    white-space: normal;
  }
}
