:root {
  --bg: #f7f1e8;
  --bg-alt: #fff9f2;
  --panel: rgba(255, 250, 244, 0.86);
  --panel-strong: #fffdf9;
  --line: rgba(84, 69, 53, 0.12);
  --text: #1f2a2a;
  --muted: #675f57;
  --accent: #0d8a7a;
  --accent-deep: #0b6159;
  --accent-soft: #e2f5f1;
  --warm: #f2a65a;
  --warm-soft: #ffe2c3;
  --shadow: 0 24px 70px rgba(78, 52, 35, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 138, 122, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(242, 166, 90, 0.14), transparent 22%),
    linear-gradient(180deg, #fbf6ef 0%, #f6efe3 54%, #f7f1e8 100%);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.72), transparent 22%),
    radial-gradient(circle at 78% 22%, rgba(255, 236, 214, 0.8), transparent 18%);
  z-index: 0;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.9fr);
  gap: 20px;
  padding: 28px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(13, 138, 122, 0.08), transparent 45%),
    linear-gradient(315deg, rgba(242, 166, 90, 0.1), transparent 40%);
  pointer-events: none;
}

.hero-copy,
.hero-spotlight {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker,
.spotlight-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-deep);
}

.hero h1,
.section-head h2,
.side-header h3 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 700;
  line-height: 0.95;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 4.4rem);
  max-width: 12ch;
}

.hero-text {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #f7fffc;
  background: linear-gradient(135deg, var(--accent) 0%, #07665e 100%);
  box-shadow: 0 14px 28px rgba(13, 138, 122, 0.22);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(84, 69, 53, 0.12);
}

.hero-spotlight {
  min-height: 320px;
  border-radius: calc(var(--radius-lg) - 4px);
  border: 1px solid rgba(84, 69, 53, 0.08);
  background:
    linear-gradient(180deg, rgba(20, 27, 27, 0.06), rgba(20, 27, 27, 0.24)),
    linear-gradient(135deg, rgba(13, 138, 122, 0.38), rgba(242, 166, 90, 0.38));
  overflow: hidden;
}

.hero-spotlight-placeholder,
.spotlight-card {
  height: 100%;
}

.hero-spotlight-placeholder {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  color: #fffdfa;
}

.spotlight-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 320px;
  color: #fffdfa;
}

.spotlight-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spotlight-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 18, 18, 0.1) 0%, rgba(8, 18, 18, 0.8) 100%),
    linear-gradient(135deg, rgba(13, 138, 122, 0.1), rgba(242, 166, 90, 0.2));
}

.spotlight-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px;
  display: grid;
  gap: 12px;
}

.spotlight-title {
  margin: 0;
  font-size: clamp(1.7rem, 2vw, 2.4rem);
  line-height: 0.98;
}

.spotlight-meta,
.latest-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill,
.inline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fffdfa;
  font-size: 0.78rem;
  font-weight: 700;
}

.inline-pill {
  background: var(--accent-soft);
  border-color: rgba(13, 138, 122, 0.14);
  color: var(--accent-deep);
}

.spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.spotlight-action,
.card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.18);
  color: #fffdfa;
}

.spotlight-action.secondary,
.card-action.secondary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.stats-grid,
.split-grid {
  display: grid;
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: 22px;
  display: grid;
  gap: 10px;
}

.stat-label,
.system-card span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.stat-value {
  font-size: clamp(1.5rem, 2vw, 2.2rem);
  line-height: 1;
}

.stat-foot {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.section-head h2 {
  font-size: clamp(2rem, 2.2vw, 2.7rem);
}

.section-meta {
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

#latestSection,
.panel-map,
.split-grid > .panel {
  padding: 24px;
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.latest-card,
.empty-card {
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.empty-card {
  grid-column: 1 / -1;
  padding: 28px;
  color: var(--muted);
}

.latest-card {
  display: grid;
  grid-template-rows: auto 1fr;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.latest-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 40px rgba(76, 58, 39, 0.12);
}

.latest-card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, rgba(13, 138, 122, 0.22), rgba(242, 166, 90, 0.3));
}

.latest-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.latest-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: end start;
  padding: 18px;
  color: #fffdf9;
  background:
    linear-gradient(180deg, rgba(10, 22, 22, 0.1), rgba(10, 22, 22, 0.55)),
    linear-gradient(135deg, rgba(13, 138, 122, 0.78), rgba(242, 166, 90, 0.78));
}

.latest-card-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}

.latest-card h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.15;
}

.latest-card p {
  margin: 0;
}

.latest-location,
.latest-address,
.system-meta-small,
.reject-item p {
  color: var(--muted);
}

.latest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f4ede3;
  color: #5f5348;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-operator {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.tag-created {
  background: var(--warm-soft);
  color: #7b5328;
}

.latest-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-action {
  min-height: 38px;
  background: var(--accent);
  color: #fffdfa;
}

.card-action.secondary {
  border: 1px solid var(--line);
}

.toolbar {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar-block {
  display: grid;
  gap: 10px;
}

.toolbar-label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.tabs,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab,
.chip {
  border: 1px solid rgba(84, 69, 53, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tab:hover,
.chip:hover {
  transform: translateY(-1px);
}

.tab[aria-pressed="true"],
.chip[aria-pressed="true"] {
  color: #fffdfa;
  background: var(--accent);
  border-color: transparent;
}

.tab-all {
  background: #e7e5e1;
}

.chip-group {
  background: #f5efe6;
}

#map {
  height: min(72vh, 760px);
  min-height: 430px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(84, 69, 53, 0.12);
}

.leaflet-container {
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: rgba(255, 251, 245, 0.96);
  color: var(--text);
}

.cluster-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #2b1d11;
  font-weight: 800;
  font-size: 13px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 26px rgba(76, 58, 39, 0.2);
  background: var(--c);
}

.pin {
  width: 18px;
  height: 18px;
  background: var(--pin);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;
  box-shadow: 0 6px 14px rgba(27, 30, 30, 0.22);
}

.pin::after {
  content: "";
  width: 7px;
  height: 7px;
  background: #fffdfa;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  left: 5px;
}

.pin-wrap {
  position: relative;
  width: 34px;
  height: 42px;
}

.pin-wrap svg {
  pointer-events: none;
}

.pin-icon {
  overflow: visible;
}

.pin-lte {
  filter: drop-shadow(0 0 8px rgba(13, 138, 122, 0.32));
}

.pin-nr {
  filter: drop-shadow(0 0 8px rgba(234, 116, 80, 0.32));
}

.pin-mixed {
  filter: drop-shadow(0 0 8px rgba(242, 166, 90, 0.4));
}

.band {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  margin: 2px 6px 0 0;
  border: 1px solid transparent;
}

.band-lte {
  background: #dff7f1;
  color: #0b6159;
  border-color: rgba(13, 138, 122, 0.18);
}

.band-nr {
  background: #ffe5d3;
  color: #8a5131;
  border-color: rgba(242, 166, 90, 0.18);
}

.band-off {
  opacity: 0.55;
  text-decoration: line-through;
}

.nr-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  border: 1px solid transparent;
}

.nr-on {
  background: #e2f5f1;
  color: #0b6159;
  border-color: rgba(13, 138, 122, 0.14);
}

.nr-off {
  background: #ffe5d3;
  color: #8a5131;
  border-color: rgba(242, 166, 90, 0.18);
}

.kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 14px;
  align-items: center;
}

.kv .key {
  color: var(--muted);
}

.kv .val {
  text-align: right;
  font-weight: 700;
}

.split-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.system-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.system-card strong {
  overflow-wrap: anywhere;
}

.rejects-wrap {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.rejects-head {
  margin-bottom: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

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

.reject-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.reject-item strong {
  display: block;
  margin-bottom: 4px;
}

.reject-item p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.reject-empty {
  margin: 0;
  color: var(--muted);
}

.side {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(440px, calc(100vw - 28px));
  background: rgba(255, 251, 245, 0.96);
  color: var(--text);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow: 0 30px 80px rgba(40, 29, 19, 0.22);
  transform: translateX(calc(100% + 24px));
  transition: transform 0.26s ease;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.side.open {
  transform: translateX(0);
}

.side-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.58));
}

.side-header h3 {
  font-size: 1.8rem;
}

.side .sub {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.92rem;
}

.side .body {
  overflow: auto;
  padding: 18px 20px 22px;
}

.site-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 18px;
  display: block;
  margin-bottom: 14px;
}

.side-actions,
.side-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.side-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  background: var(--accent-soft);
  color: var(--accent-deep);
  cursor: pointer;
}

.side .row {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.side .label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.side .value {
  font-weight: 700;
  line-height: 1.45;
}

.close {
  border: none;
  min-width: 88px;
  min-height: 38px;
  border-radius: 999px;
  cursor: pointer;
  background: #1b2424;
  color: #fffdfa;
  font-weight: 700;
}

.photo-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: none;
  background: transparent;
}

.photo-dialog::backdrop {
  background: rgba(19, 24, 24, 0.62);
  backdrop-filter: blur(6px);
}

.photo-dialog-card {
  background: rgba(255, 251, 245, 0.98);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 34px 90px rgba(28, 21, 15, 0.24);
  overflow: hidden;
}

.photo-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 0;
}

.photo-dialog-header h3 {
  font-size: clamp(1.6rem, 2vw, 2rem);
}

.photo-dialog-figure {
  margin: 0;
  padding: 18px 20px 20px;
  display: grid;
  gap: 12px;
}

.photo-dialog-image {
  width: 100%;
  max-height: calc(100vh - 210px);
  aspect-ratio: 4 / 5;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(18, 26, 26, 0.06), rgba(18, 26, 26, 0.12)),
    linear-gradient(135deg, rgba(13, 138, 122, 0.12), rgba(242, 166, 90, 0.14));
}

.photo-dialog-caption {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .latest-grid,
  .split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 1220px);
    padding: 18px 0 30px;
  }

  .hero,
  #latestSection,
  .panel-map,
  .split-grid > .panel {
    padding: 20px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(2.2rem, 11vw, 3.2rem);
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid,
  .latest-grid,
  .split-grid,
  .system-grid {
    grid-template-columns: 1fr;
  }

  .latest-card {
    grid-template-rows: auto 1fr;
  }

  .kv {
    grid-template-columns: 1fr;
  }

  .kv .val {
    text-align: left;
  }

  .side {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    height: min(82vh, 760px);
  }

  .photo-dialog {
    width: min(calc(100vw - 20px), 760px);
    max-height: calc(100vh - 20px);
  }

  .photo-dialog-header,
  .photo-dialog-figure {
    padding-left: 16px;
    padding-right: 16px;
  }

  .photo-dialog-image {
    max-height: calc(100vh - 190px);
  }
}
