:root {
  --bg: #f6f4ef;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --text: #222018;
  --muted: #706a5d;
  --line: rgba(34, 32, 24, 0.12);
  --amber: #f6bd18;
  --orange: #f47c20;
  --red: #db3d2a;
  --blue: #2384b8;
  --green: #2f8f62;
  --shadow: 0 18px 45px rgba(31, 26, 17, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: relative;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  background: rgba(250, 249, 246, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  font-weight: 850;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--amber);
  color: #2b2413;
  font-size: 19px;
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, 0.08);
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.topbar nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.emergency {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--orange);
  color: white;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(244, 124, 32, 0.24);
}

.workspace {
  position: relative;
  min-height: calc(100vh - 64px);
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  background: #d9e3e8;
}

.controls {
  position: absolute;
  z-index: 450;
  top: 22px;
  left: 22px;
  display: grid;
  gap: 12px;
  max-width: min(440px, calc(100vw - 44px));
}

.search-row,
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  min-width: min(270px, 100%);
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

button {
  font: inherit;
}

.pill {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(31, 26, 17, 0.11);
  backdrop-filter: blur(14px);
}

.pill.active,
.position {
  border-color: rgba(246, 189, 24, 0.65);
  background: var(--amber);
  color: #261e0b;
}

.incident-card {
  width: min(385px, calc(100vw - 44px));
  margin-top: 36px;
  padding: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(219, 61, 42, 0.1);
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.weak {
  background: rgba(246, 189, 24, 0.18);
  color: #7b5800;
}

.badge.satellite {
  background: rgba(35, 132, 184, 0.12);
  color: var(--blue);
}

.badge.zone {
  background: rgba(47, 143, 98, 0.12);
  color: var(--green);
}

.close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #f2eee7;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

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

.incident-title {
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 1.15;
}

.facts {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.confidence {
  margin: 16px 0;
  display: grid;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

.bar {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: #eee8dc;
}

.bar span {
  display: block;
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, var(--amber), var(--orange), var(--red));
  border-radius: inherit;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source {
  padding: 11px;
  border-radius: 15px;
  background: #f8f5ee;
  border: 1px solid rgba(34, 32, 24, 0.08);
  font-size: 13px;
  line-height: 1.38;
}

.source strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
}

.source a {
  display: inline-block;
  margin-top: 6px;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.media-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
}

.media-note {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-weight: 800;
}

.share {
  width: 100%;
  min-height: 39px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  font-weight: 800;
  cursor: pointer;
}

.live-panel {
  position: absolute;
  z-index: 440;
  top: 0;
  right: 0;
  width: min(385px, 100vw);
  height: 100%;
  padding: 18px;
  background: rgba(255, 255, 255, 0.88);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: -18px 0 45px rgba(31, 26, 17, 0.12);
  overflow: auto;
}

.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.live-head h1 {
  font-size: 23px;
}

#listener {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.list-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 999px;
  background: #f1ede4;
}

.list-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
  color: var(--muted);
}

.list-tabs button.active {
  background: white;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(31, 26, 17, 0.11);
}

.section-label {
  margin: 17px 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.feed {
  display: grid;
  gap: 2px;
}

.feed-item {
  display: grid;
  grid-template-columns: 11px 1fr auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 12px 4px;
  border: 0;
  border-bottom: 1px solid rgba(34, 32, 24, 0.08);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--amber);
}

.dot.probable {
  background: var(--orange);
}

.dot.corroborated {
  background: var(--red);
}

.dot.satellite {
  background: var(--blue);
}

.feed-title {
  font-weight: 850;
  line-height: 1.2;
}

.feed-meta,
.empty {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.method {
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.method h2 {
  color: var(--text);
  font-size: 16px;
}

.alert-zone {
  position: absolute;
  z-index: 430;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  min-height: 48px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--amber);
  color: #241b08;
  font-weight: 900;
  box-shadow: 0 18px 36px rgba(246, 189, 24, 0.32);
  cursor: pointer;
}

.marker {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 8px;
  transform: rotate(-45deg);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(31, 26, 17, 0.3);
}

.marker span {
  transform: rotate(45deg);
  color: white;
  font-weight: 950;
  font-size: 17px;
  line-height: 1;
}

.marker.weak {
  background: var(--amber);
}

.marker.probable {
  background: var(--orange);
}

.marker.corroborated {
  background: var(--red);
}

.marker.satellite {
  background: var(--blue);
}

.leaflet-control-attribution {
  font-size: 10px;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .topbar p {
    width: 100%;
    order: 3;
  }

  .topbar nav {
    margin-left: 0;
  }

  .live-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 39%;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .controls {
    top: 14px;
    left: 14px;
    right: 14px;
    max-width: none;
  }

  .incident-card {
    margin-top: 10px;
  }

  .alert-zone {
    bottom: 41%;
    width: min(330px, calc(100vw - 32px));
  }
}

@media (max-width: 560px) {
  .brand {
    min-width: 0;
  }

  .topbar nav {
    width: 100%;
    justify-content: space-between;
  }

  .search {
    width: 100%;
  }

  .pill {
    min-height: 38px;
    padding-inline: 12px;
  }
}
