
:root {
  --qt-navy: #0c394c;
  --qt-green: #2a685f;
  --qt-green-dark: #1e514a;
  --qt-ink: #13242b;
  --qt-muted: #66767d;
  --qt-line: #dbe4e4;
  --qt-bg: #f5f8f7;
  --qt-card: #ffffff;
  --qt-soft: #edf4f2;
  --qt-cream: #f7f1e4;
  --qt-shadow: 0 8px 26px rgba(12,57,76,.10);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--qt-bg);
  color: var(--qt-ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--qt-green-dark);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 10px 24px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--qt-line);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  display: block;
  max-height: 42px;
  max-width: 165px;
  object-fit: contain;
}

.brand-wordmark {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -.02em;
  color: var(--qt-navy);
}

.brand-sub {
  color: var(--qt-muted);
  font-size: .78rem;
  line-height: 1.1;
  letter-spacing: .035em;
}

.nav {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  color: var(--qt-ink);
  font-size: .9rem;
  font-weight: 650;
}

.nav a:hover {
  color: var(--qt-green);
}

.hero {
  max-width: 1460px;
  margin: 0 auto;
  padding: 44px 24px 24px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 9px;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--qt-green);
}

.hero h1 {
  max-width: 960px;
  margin: 0;
  color: var(--qt-navy);
  font-family: "EB Garamond", Georgia, serif;
  font-size: clamp(2.25rem, 5vw, 4.3rem);
  line-height: .99;
  letter-spacing: -.035em;
}

.hero-copy {
  max-width: 880px;
  margin-top: 18px;
  color: #485b62;
  font-size: 1.06rem;
  line-height: 1.65;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.status-pill {
  border: 1px solid #cfe0dc;
  border-radius: 999px;
  background: #fff;
  padding: 7px 11px;
  color: var(--qt-green-dark);
  font-size: .83rem;
  font-weight: 700;
}

.workspace {
  max-width: 1460px;
  margin: 0 auto;
  padding: 12px 24px 50px;
}

.controlbar {
  display: grid;
  grid-template-columns:
    minmax(130px,.7fr)
    minmax(280px,2fr)
    minmax(230px,1.1fr)
    auto
    auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--qt-line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 18px rgba(12,57,76,.05);
}

.control label {
  display: block;
  margin-bottom: 5px;
  color: var(--qt-muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.control select,
.control input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfdada;
  border-radius: 9px;
  background: #fff;
  padding: 9px 11px;
  color: var(--qt-ink);
}

.btn {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: var(--qt-navy);
  padding: 9px 15px;
  color: #fff;
  cursor: pointer;
  font-weight: 750;
}

.btn:hover {
  background: #082d3d;
}

.btn.secondary {
  border: 1px solid #cbd8d8;
  background: #fff;
  color: var(--qt-navy);
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 12px;
}

.map-card,
.side-card,
.panel {
  border: 1px solid var(--qt-line);
  border-radius: var(--radius);
  background: var(--qt-card);
  box-shadow: var(--qt-shadow);
}

.map-card {
  overflow: hidden;
}

#map {
  width: 100%;
  height: min(69vh, 760px);
  min-height: 540px;
  background: #eef2f1;
}

.side-card {
  display: flex;
  flex-direction: column;
  min-height: 540px;
  max-height: min(69vh, 760px);
  overflow: hidden;
}

.side-head {
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--qt-line);
}

.side-head .small {
  color: var(--qt-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.side-head h2 {
  margin: 4px 0 0;
  color: var(--qt-navy);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.65rem;
  line-height: 1.1;
}

.side-content {
  flex: 1;
  padding: 14px 18px 20px;
  overflow: auto;
}

.metric-feature {
  margin-bottom: 17px;
  border-radius: 11px;
  background: var(--qt-soft);
  padding: 14px;
}

.metric-feature .label {
  color: var(--qt-muted);
  font-size: .76rem;
  font-weight: 750;
}

.metric-feature .value {
  margin-top: 3px;
  color: var(--qt-navy);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
}

.detail-list {
  display: grid;
  gap: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f0;
}

.detail-row span:first-child {
  color: #607178;
  font-size: .82rem;
}

.detail-row strong {
  max-width: 160px;
  text-align: right;
  color: var(--qt-ink);
  font-size: .83rem;
  overflow-wrap: anywhere;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 10px;
  margin-top: 12px;
}

.kpi {
  border: 1px solid var(--qt-line);
  border-radius: 12px;
  background: #fff;
  padding: 14px 16px;
}

.kpi-label {
  color: var(--qt-muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.kpi-value {
  margin-top: 3px;
  color: var(--qt-navy);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.legend {
  padding: 8px 10px;
  background: rgba(255,255,255,.96);
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  color: #33464c;
  font-size: .74rem;
}

.legend-title {
  margin-bottom: 5px;
  max-width: 215px;
  font-weight: 800;
}

.legend-line {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 4px 0;
}

.legend-box {
  width: 16px;
  height: 12px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.section {
  max-width: 1460px;
  margin: 0 auto;
  padding: 14px 24px 50px;
}

.section-title {
  margin: 0 0 5px;
  color: var(--qt-navy);
  font-family: "EB Garamond", Georgia, serif;
  font-size: 2.3rem;
}

.section-copy {
  max-width: 880px;
  margin: 0 0 18px;
  color: var(--qt-muted);
  line-height: 1.6;
}

.panel {
  padding: 18px;
}

.table-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: 620px;
  border: 1px solid #e0e7e6;
  border-radius: 9px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .84rem;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid #edf1f0;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f8f7;
  color: var(--qt-navy);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tr:hover td {
  background: #f7faf9;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}

.info-box {
  border: 1px solid var(--qt-line);
  border-radius: 12px;
  background: #fff;
  padding: 18px;
}

.info-box h3 {
  margin: 0 0 8px;
  color: var(--qt-navy);
}

.info-box p,
.info-box li {
  color: #52666d;
  line-height: 1.55;
  font-size: .9rem;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
}

.download-card {
  display: block;
  border: 1px solid var(--qt-line);
  border-radius: 12px;
  background: #fff;
  padding: 18px;
  text-decoration: none;
  color: inherit;
}

.download-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--qt-shadow);
}

.download-card strong {
  color: var(--qt-navy);
}

.download-card span {
  display: block;
  margin-top: 5px;
  color: var(--qt-muted);
  font-size: .84rem;
}

.note {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #d9e4e1;
  border-radius: 10px;
  background: #f8fbfa;
  color: #51656c;
  font-size: .84rem;
  line-height: 1.55;
}

footer {
  margin-top: 20px;
  border-top: 1px solid var(--qt-line);
  background: #fff;
  padding: 30px 24px 40px;
}

.footer-inner {
  max-width: 1460px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--qt-muted);
  font-size: .85rem;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245,248,247,.92);
  backdrop-filter: blur(4px);
}

.loading-card {
  min-width: 280px;
  max-width: 440px;
  border: 1px solid var(--qt-line);
  border-radius: 14px;
  background: #fff;
  padding: 24px;
  text-align: center;
  box-shadow: var(--qt-shadow);
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 14px;
  border: 4px solid #dce7e5;
  border-top-color: var(--qt-green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

.leaflet-container {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.leaflet-tooltip {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,.13);
}

@media (max-width: 1080px) {

  .controlbar {
    grid-template-columns: 1fr 2fr;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .side-card {
    max-height: none;
    min-height: 0;
  }

  .kpi-grid,
  .info-grid,
  .download-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width: 700px) {

  .topbar {
    padding: 10px 14px;
  }

  .nav {
    display: none;
  }

  .hero,
  .workspace,
  .section {
    padding-left: 14px;
    padding-right: 14px;
  }

  .controlbar {
    grid-template-columns: 1fr;
  }

  #map {
    height: 62vh;
    min-height: 430px;
  }

  .kpi-grid,
  .info-grid,
  .download-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }
}

