@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-0: #0b0c0e;
  --bg-1: #12151a;
  --bg-2: #1a1f27;
  --panel: rgba(12, 14, 18, 0.88);
  --panel-border: rgba(232, 156, 74, 0.28);
  --ink: #e8e4dc;
  --muted: #9a9488;
  --accent: #e89c4a;
  --accent-hot: #ff6a2a;
  --danger: #c44b3c;
  --ok: #7fb069;
  --threat-low: #7fb069;
  --threat-medium: #d4b45a;
  --threat-high: #e89c4a;
  --threat-critical: #d9634a;
  --threat-extreme: #c44b3c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --radius: 4px;
  --ui-font: "Barlow", sans-serif;
  --display: "Rajdhani", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--ui-font);
}

body {
  background:
    radial-gradient(1200px 700px at 15% 0%, rgba(232, 156, 74, 0.08), transparent 55%),
    radial-gradient(900px 600px at 90% 100%, rgba(196, 75, 60, 0.08), transparent 50%),
    linear-gradient(160deg, #0b0c0e 0%, #151920 45%, #0d1014 100%);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #0a0b0d;
}

.chrome {
  position: absolute;
  z-index: 500;
  pointer-events: none;
}

.chrome > * {
  pointer-events: auto;
}

.topbar {
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 12px;
  align-items: stretch;
  max-width: 720px;
}

.brand-block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  min-width: 132px;
}

.brand-kicker {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.22em;
  font-size: 0.68rem;
  color: var(--accent);
  text-transform: uppercase;
}

.brand-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-top: 2px;
}

.brand-title span {
  color: var(--muted);
  font-size: 0.95rem;
  margin-left: 6px;
  letter-spacing: 0.12em;
}

.search-shell {
  flex: 1 1 auto;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.search-row svg {
  flex: 0 0 auto;
  opacity: 0.75;
}

#search-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 1rem/1.2 var(--ui-font);
  min-width: 0;
}

#search-input::placeholder {
  color: var(--muted);
}

#search-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 500 0.85rem var(--ui-font);
  padding: 4px 6px;
}

#search-clear:hover {
  color: var(--ink);
}

.suggestions {
  display: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  max-height: 280px;
  overflow: auto;
}

.suggestions.open {
  display: block;
}

.suggestion {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  font: 500 0.95rem/1.25 var(--ui-font);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.suggestion:hover,
.suggestion[aria-selected="true"] {
  background: rgba(232, 156, 74, 0.12);
}

.suggestion small {
  color: var(--muted);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.sidebar {
  top: 96px;
  left: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 140px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(0);
  transition: transform 180ms ease, opacity 180ms ease;
}

#panel-locations .poi-list {
  flex: 1;
  min-height: 0;
}

.sidebar.collapsed {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
}

.tab-row {
  display: flex;
  gap: 4px;
}

.tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--muted);
  font: 600 0.78rem/1 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 10px;
  cursor: pointer;
}

.tab.active {
  color: var(--bg-0);
  background: var(--accent);
  border-color: var(--accent);
}

.tab-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.intel-root,
.detail-root {
  overflow: auto;
  padding: 10px 12px 16px;
  display: grid;
  gap: 12px;
}

.detail-hero {
  width: 100%;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a0b0d;
  max-height: 220px;
  object-fit: cover;
  object-position: top center;
}

.detail-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.detail-thumbs button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.detail-thumbs img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  display: block;
}

.detail-sub {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: grid;
  gap: 6px;
}

.popup-thumb {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  object-position: top center;
  display: block;
  margin: 8px 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-more {
  margin-top: 8px;
  border: 1px solid rgba(232, 156, 74, 0.4);
  background: rgba(232, 156, 74, 0.12);
  color: var(--accent);
  font: 600 0.72rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 10px;
  cursor: pointer;
  width: 100%;
}

.intel-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
}

.intel-card h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 0.98rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intel-card p,
.intel-card li {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.intel-card ul {
  margin: 8px 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 4px;
}

.intel-card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.hotspot-btn {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
}

.hotspot-btn:hover h3 {
  color: var(--accent);
}

.arch-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.arch-swatch.rot { background: #c44b3c; }
.arch-swatch.blau { background: #4f84c4; }
.arch-swatch.gruen,
.arch-swatch.grün { background: #7fb069; }

.popup-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.popup-intel {
  margin: 8px 0 0;
  padding-left: 1.05rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  display: grid;
  gap: 4px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: 500 0.72rem/1 var(--ui-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 9px;
  border-radius: 999px;
  cursor: pointer;
}

.chip.active {
  color: var(--bg-0);
  background: var(--accent);
  border-color: var(--accent);
}

.poi-list {
  list-style: none;
  margin: 0;
  padding: 0 0 12px;
  overflow: auto;
}

.poi-list li button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font: 500 0.95rem/1.3 var(--ui-font);
}

.poi-list li button:hover,
.poi-list li button.active {
  background: rgba(232, 156, 74, 0.1);
}

.poi-list .meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

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

.poi-name {
  min-width: 0;
}

.threat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font: 500 0.68rem/1.2 var(--ui-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.threat-pill.threat-low {
  color: #102012;
  background: var(--threat-low);
  border-color: #5f8f4f;
}

.threat-pill.threat-medium {
  color: #1d1605;
  background: var(--threat-medium);
  border-color: #b8993f;
}

.threat-pill.threat-high {
  color: #1a120a;
  background: var(--threat-high);
  border-color: #c98335;
}

.threat-pill.threat-critical {
  color: #1a0b09;
  background: var(--threat-critical);
  border-color: #b54d38;
}

.threat-pill.threat-extreme {
  color: #fff4f2;
  background: var(--threat-extreme);
  border-color: #9e3a2e;
}

.chip.threat-low.active,
.chip.threat-medium.active,
.chip.threat-high.active,
.chip.threat-critical.active,
.chip.threat-extreme.active {
  color: #0b0c0e;
}

.threat-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.threat-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.threat-list em {
  font-style: normal;
  opacity: 0.85;
  text-transform: none;
  letter-spacing: 0;
}

.threat-max {
  margin: 4px 0 2px;
  font-size: 0.8rem;
  color: var(--muted);
}

.status .threat-pill {
  vertical-align: middle;
}

.controls {
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.control-stack {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.control-stack button,
.ghost-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 42px;
  height: 42px;
  cursor: pointer;
  font: 700 1.2rem/1 var(--display);
}

.control-stack button + button {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.control-stack button:hover,
.ghost-btn:hover {
  background: rgba(232, 156, 74, 0.14);
  color: var(--accent);
}

.ghost-btn {
  width: auto;
  min-width: 42px;
  padding: 0 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.layer-btn.is-on {
  color: var(--bg-0) !important;
  background: var(--accent) !important;
  border-color: var(--accent) !important;
}

.status {
  left: 16px;
  bottom: 16px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  font: 500 0.78rem/1.2 var(--ui-font);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.status strong {
  color: var(--accent);
  font-weight: 500;
}

.toggle-panel {
  top: 16px;
  right: 16px;
}

a.link-chip {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.leaflet-container {
  background: #0a0b0d;
  font: inherit;
}

.leaflet-control-attribution {
  display: none;
}

.leaflet-bar {
  border: 1px solid var(--panel-border) !important;
  box-shadow: var(--shadow) !important;
}

/* Pin: Punkt in der Mitte, Label unmittelbar darüber, Area separat als Kreis */
.poi-pin-icon {
  background: transparent !important;
  border: 0 !important;
  overflow: visible !important;
}

.poi-pin {
  position: relative;
  width: 18px;
  height: 18px;
}

.poi-pin-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  background: rgba(12, 14, 18, 0.92);
  border: 1px solid rgba(232, 156, 74, 0.4);
  color: #e8e4dc;
  font: 500 0.68rem/1.1 var(--ui-font);
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.poi-pin.is-active .poi-pin-label {
  border-color: var(--accent);
  color: var(--accent);
}

.poi-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #1a120a;
  box-shadow: 0 0 0 2px rgba(232, 156, 74, 0.35), 0 6px 16px rgba(0, 0, 0, 0.55);
  transform-origin: center;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.poi-marker.threat-low { background: var(--threat-low); box-shadow: 0 0 0 2px rgba(127, 176, 105, 0.35), 0 6px 16px rgba(0, 0, 0, 0.55); }
.poi-marker.threat-medium { background: var(--threat-medium); box-shadow: 0 0 0 2px rgba(212, 180, 90, 0.35), 0 6px 16px rgba(0, 0, 0, 0.55); }
.poi-marker.threat-high { background: var(--threat-high); box-shadow: 0 0 0 2px rgba(232, 156, 74, 0.35), 0 6px 16px rgba(0, 0, 0, 0.55); }
.poi-marker.threat-critical { background: var(--threat-critical); box-shadow: 0 0 0 2px rgba(217, 99, 74, 0.4), 0 6px 16px rgba(0, 0, 0, 0.55); }
.poi-marker.threat-extreme { background: var(--threat-extreme); box-shadow: 0 0 0 2px rgba(196, 75, 60, 0.45), 0 6px 16px rgba(0, 0, 0, 0.55); }

.poi-pin.is-active .poi-marker,
.poi-pin:hover .poi-marker {
  box-shadow: 0 0 0 3px rgba(232, 156, 74, 0.5), 0 6px 16px rgba(0, 0, 0, 0.55);
}

.leaflet-popup-content-wrapper {
  background: #12151a;
  color: var(--ink);
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}

.leaflet-popup-tip {
  background: #12151a;
}

.leaflet-popup-content {
  margin: 12px 14px;
  font: 500 0.92rem/1.35 var(--ui-font);
}

.leaflet-popup-content strong {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 4px;
}

.leaflet-popup-content .cat {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  margin-bottom: 8px;
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--muted);
}

.map-fade-in {
  animation: mapIn 700ms ease both;
}

@keyframes mapIn {
  from { opacity: 0; filter: saturate(0.7) brightness(0.85); }
  to { opacity: 1; filter: none; }
}

.pulse-ring {
  animation: pulse 1.4s ease-out 1;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 156, 74, 0.55); }
  100% { box-shadow: 0 0 0 18px rgba(232, 156, 74, 0); }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    max-width: none;
  }

  .brand-block {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
  }

  .sidebar {
    top: auto;
    bottom: 72px;
    max-height: 42vh;
    width: calc(100vw - 32px);
  }

  .status {
    left: 16px;
    right: 70px;
    bottom: 16px;
  }
}
