:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #5f6672;
  --line: #dce3e4;
  --panel: #ffffff;
  --page: #f4f7f4;
  --teal: #0b6f6a;
  --teal-dark: #084f4b;
  --rose: #c85058;
  --amber: #d99b2b;
  --blue: #4378bf;
  --green: #5f8f4e;
  --shadow: 0 18px 45px rgba(26, 46, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 247, 244, 0.92), rgba(244, 247, 244, 1)),
    url("data:image/svg+xml,%3Csvg width='140' height='140' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ccd8d5' stroke-width='1'%3E%3Cpath d='M0 40h140M0 100h140M40 0v140M100 0v140'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(20px, 5vw, 64px) 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

.freshness {
  display: grid;
  gap: 4px;
  min-width: 170px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.freshness span {
  color: var(--muted);
  font-size: 0.82rem;
}

.freshness strong {
  color: var(--teal-dark);
  font-size: 1.15rem;
}

.topbar-link {
  flex: 0 0 auto;
  color: var(--teal-dark);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.shell {
  display: grid;
  grid-template-columns: minmax(310px, 400px) minmax(0, 1fr);
  gap: 22px;
  padding: 0 clamp(20px, 5vw, 64px) 44px;
}

.info-page {
  display: grid;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 28px;
}

.info-panel {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.info-panel h2 {
  margin: 0;
  font-size: 1.35rem;
}

.info-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 0 20px 28px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.site-footer a {
  color: var(--teal-dark);
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.admin-reports {
  display: grid;
  gap: 10px;
}

.admin-report {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-report.is-hidden {
  opacity: 0.58;
}

.admin-report p,
.admin-report small {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-panel {
  min-width: 0;
  padding: 22px;
}

.section-heading h2,
.map-toolbar h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.section-heading p,
.map-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.trust-note,
.data-note {
  border: 1px solid #d5dddc;
  border-radius: 8px;
  background: #f8faf9;
  color: #46505a;
}

.trust-note {
  margin: 16px 0 0;
  padding: 11px 12px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.data-note {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 12px 14px;
}

.data-note strong {
  color: var(--teal-dark);
  font-size: 0.9rem;
}

.data-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.illness-key {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -2px 0 14px;
  padding: 10px 12px;
  border: 1px solid #d5dddc;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.illness-key > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.illness-key > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}

.key-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3c4149;
  font-size: 0.82rem;
  font-weight: 750;
  --illness-color: var(--teal);
}

.key-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(32, 33, 36, 0.14);
  border-radius: 50%;
  background: var(--illness-color);
}

.report-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  min-width: 0;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span,
legend {
  color: #3c4149;
  font-size: 0.9rem;
  font-weight: 750;
}

input,
select,
textarea {
  max-width: 100%;
  min-width: 0;
  width: 100%;
  border: 1px solid #c9d3d2;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 43px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 11px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 111, 106, 0.16);
}

.field-hint {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.district-lock-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  min-height: 20px;
  margin-top: -8px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chips label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d5dddc;
  border-radius: 999px;
  background: #f9fbfa;
  color: #343a40;
  font-size: 0.88rem;
  font-weight: 650;
}

.chips input {
  width: 15px;
  height: 15px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.optional-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 -2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.optional-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.captcha-placeholder {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px dashed #a9b8b6;
  border-radius: 8px;
  background: #f8faf9;
}

.captcha-placeholder strong,
.captcha-placeholder span {
  display: block;
}

.captcha-placeholder span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.84rem;
}

.turnstile-widget {
  max-width: 100%;
  min-width: 300px;
  min-height: 65px;
  overflow: hidden;
}

.turnstile-widget[hidden] {
  display: none;
}

.primary-button,
.text-button {
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  min-height: 46px;
  background: var(--teal);
  color: white;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--teal-dark);
}

.text-button {
  flex: 0 0 auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--teal-dark);
  font-size: 0.84rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--teal);
}

.form-message {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.form-message:empty {
  display: none;
}

.form-message.success-message {
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border: 1px solid rgba(11, 111, 106, 0.24);
  border-radius: 8px;
  background: #eef8f5;
  color: #164c48;
  font-weight: 650;
}

.form-message.error-message {
  padding: 10px 12px;
  border: 1px solid rgba(173, 51, 63, 0.28);
  border-radius: 8px;
  background: #fff1f2;
  color: #9f2432;
}

.form-message.info-message {
  padding: 10px 12px;
  border: 1px solid rgba(67, 120, 191, 0.24);
  border-radius: 8px;
  background: #f0f6ff;
  color: #27527d;
}

.form-message.success-message strong {
  font-size: 0.95rem;
}

.form-message.success-message span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.form-message.success-message small {
  color: #486864;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

.map-area {
  min-width: 0;
}

.map-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.map-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.compact-filter {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.compact-filter span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-filter select {
  height: 46px;
  background: rgba(255, 255, 255, 0.88);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.uk-map {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  border: 2px solid #b9c8c6;
  border-radius: 8px;
  background: #dce8e5;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.map-unavailable {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-weight: 750;
}

.map-coverage-note {
  position: absolute;
  z-index: 500;
  right: 12px;
  bottom: 24px;
  max-width: min(330px, calc(100% - 24px));
  padding: 8px 10px;
  border: 1px solid rgba(32, 33, 36, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(31, 52, 50, 0.14);
}

.report-map-marker-icon {
  width: 1px !important;
  height: 1px !important;
  border: 0;
  background: transparent;
}

.report-cluster {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(11, 111, 106, 0.2);
  box-shadow: 0 12px 30px rgba(31, 52, 50, 0.22);
}

.report-cluster span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: rgba(11, 111, 106, 0.88);
  color: white;
  font-size: 0.96rem;
  font-weight: 900;
}

.report-cluster-medium {
  background: rgba(209, 122, 34, 0.22);
}

.report-cluster-medium span {
  background: rgba(209, 122, 34, 0.9);
}

.report-cluster-large {
  background: rgba(200, 80, 88, 0.22);
}

.report-cluster-large span {
  background: rgba(200, 80, 88, 0.9);
}

.report-map-marker {
  display: inline-grid;
  grid-template-columns: 34px auto;
  align-items: center;
  width: max-content;
  height: auto;
  max-width: 185px;
  min-height: 42px;
  padding: 4px 10px 4px 4px;
  border: 1px solid rgba(32, 33, 36, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(31, 52, 50, 0.17);
  opacity: 0.72;
  transform: translate(-50%, -50%);
  transform-origin: center;
  transition: opacity 120ms ease, background-color 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  --illness-color: var(--rose);
  --illness-soft: rgba(200, 80, 88, 0.12);
}

.report-map-marker:hover,
.report-map-marker.selected {
  border-color: color-mix(in srgb, var(--illness-color), #202124 12%);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 32px rgba(31, 52, 50, 0.24);
  opacity: 1;
}

.marker-count {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--illness-color);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  opacity: 0.9;
}

.report-map-marker:hover .marker-count,
.report-map-marker.selected .marker-count {
  opacity: 1;
}

.illness-red {
  --illness-color: #c85058;
  --illness-soft: rgba(200, 80, 88, 0.13);
}

.illness-orange {
  --illness-color: #d17a22;
  --illness-soft: rgba(209, 122, 34, 0.14);
}

.illness-green {
  --illness-color: #5f8f4e;
  --illness-soft: rgba(95, 143, 78, 0.14);
}

.illness-purple {
  --illness-color: #7b5ac8;
  --illness-soft: rgba(123, 90, 200, 0.13);
}

.illness-brown {
  --illness-color: #8b6a47;
  --illness-soft: rgba(139, 106, 71, 0.13);
}

.illness-blue {
  --illness-color: #2f6fb1;
  --illness-soft: rgba(47, 111, 177, 0.13);
}

.illness-grey {
  --illness-color: #a9b0b7;
  --illness-soft: rgba(108, 117, 125, 0.13);
}

.illness-teal {
  --illness-color: #0b6f6a;
  --illness-soft: rgba(11, 111, 106, 0.13);
}

.illness-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  vertical-align: middle;
  --illness-color: #0b6f6a;
  --illness-soft: rgba(11, 111, 106, 0.13);
}

.illness-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--illness-color), #ffffff 45%);
  border-radius: 50%;
  background: var(--illness-soft);
  color: var(--illness-color);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.illness-badge-map .illness-icon {
  border-color: transparent;
  background: transparent;
  color: var(--illness-color);
  font-size: 1.1rem;
}

.illness-badge-feed .illness-icon {
  border-color: rgba(32, 33, 36, 0.1);
  background: #fff;
  font-size: 0.95rem;
}

.illness-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-popup {
  width: min(300px, calc(100vw - 72px));
  max-height: 380px;
  overflow-y: auto;
}

.district-popup-shell .leaflet-popup-content {
  margin: 14px;
}

.district-popup-shell .leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 20px 45px rgba(31, 52, 50, 0.2);
}

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

.popup-head span,
.popup-section > span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.popup-head strong {
  display: block;
  margin-top: 3px;
  font-size: 1.3rem;
}

.popup-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf9;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.popup-section {
  display: grid;
  gap: 7px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.popup-section + .popup-section {
  margin-top: 11px;
}

.popup-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.popup-section ul,
.ranked-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.popup-section li {
  color: #3c4149;
  font-size: 0.88rem;
  line-height: 1.35;
}

.ranked-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border-radius: 7px;
  background: #f8faf9;
}

.ranked-list strong {
  color: var(--teal-dark);
}

.marker-label {
  overflow: hidden;
  padding-left: 8px;
  font-size: 0.84rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.insight-panel h3 {
  margin-bottom: 0;
  font-size: 1.15rem;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
}

.stat .illness-badge {
  max-width: 100%;
}

.stat .illness-icon {
  width: 28px;
  height: 28px;
  font-size: 1rem;
}

.stat .illness-name {
  font-size: 1rem;
}

.feed-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}

.feed-heading div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.feed-heading strong {
  font-size: 0.95rem;
}

.feed-heading > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 0 rgba(200, 80, 88, 0.4);
  animation: livePulse 1.8s infinite;
}

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

.report-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-item.is-new {
  border-color: rgba(11, 111, 106, 0.42);
  animation: newReport 2.4s ease-out;
}

.report-line {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.report-item strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.report-item strong > span:last-child {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.report-item time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.report-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(200, 80, 88, 0.42);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(200, 80, 88, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(200, 80, 88, 0);
  }
}

@keyframes newReport {
  0% {
    background: rgba(11, 111, 106, 0.12);
    transform: translateY(-2px);
  }

  100% {
    background: #fff;
    transform: translateY(0);
  }
}

@media (max-width: 1050px) {
  .shell,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .uk-map {
    min-height: 560px;
  }
}

@media (max-width: 680px) {
  .topbar,
  .map-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .map-controls {
    align-items: stretch;
    justify-content: stretch;
  }

  .compact-filter {
    min-width: 0;
  }

  h1 {
    font-size: 2.3rem;
  }

  .two-col,
  .stats,
  .admin-login {
    grid-template-columns: 1fr;
  }

  .uk-map {
    min-height: 480px;
  }

  .marker {
    grid-template-columns: 30px auto;
    max-width: 145px;
  }

  .marker-count {
    width: 30px;
    height: 30px;
  }
}
