:root {
  --bg: #f5f1e7;
  --paper: #fffdf8;
  --ink: #1f261e;
  --muted: #60705f;
  --line: #d7cfbf;
  --accent: #456b39;
  --accent-soft: #dce8d3;
  --warm: #a46d38;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #fff7dc 0, transparent 28rem),
    linear-gradient(180deg, #f0eadb 0%, var(--bg) 100%);
}

.page {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.topnav {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.topnav a {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.88);
  color: var(--ink);
  text-decoration: none;
}

.topnav a.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #24371f;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 420px);
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(69,107,57,0.08), rgba(164,109,56,0.08)),
    var(--paper);
  box-shadow: 0 18px 50px rgba(71, 58, 37, 0.08);
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--accent);
}

h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: clamp(30px, 5vw, 50px); line-height: 1; }
h2 { font-size: 22px; }
.subtle { color: var(--muted); }

.filters {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
}

.filters label,
.cards .card {
  display: grid;
  gap: 8px;
}

.filter-actions {
  display: grid;
  gap: 10px;
}

select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font: inherit;
}

button {
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #fffdf8;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  border-color: var(--line);
  background: #c9c2b4;
  color: #f6f2ea;
  cursor: not-allowed;
}

.export-hint {
  margin: 0;
  font-size: 13px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card, .panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(71, 58, 37, 0.05);
}

.card {
  padding: 18px 20px;
}

.card .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.card .value {
  font-size: 34px;
  line-height: 1;
}

.grid.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.map-layout {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.panel {
  padding: 22px;
}

.panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.bar-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: #ede7db;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #6b9360);
}

.bars.compact .bar-track {
  height: 10px;
}

.bar-fill.positive {
  background: linear-gradient(90deg, #2f7d44, #66a85d);
}

.bar-fill.negative {
  background: linear-gradient(90deg, #985232, #d38a49);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

thead th {
  position: sticky;
  top: 0;
  background: #f9f5ec;
  color: var(--muted);
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: rgba(220, 232, 211, 0.18);
}

.empty {
  padding: 24px;
  color: var(--muted);
}

.map-frame {
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.map-metrics {
  margin-top: 24px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.legend-block {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-chip {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(31, 38, 30, 0.18);
}

.legend-note {
  width: 100%;
}

.map-popup {
  line-height: 1.45;
}

.parcel-label {
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(31, 38, 30, 0.14);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(31, 38, 30, 0.1);
  color: #182015;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.05;
  padding: 0 5px;
  min-height: 0;
  white-space: nowrap;
}

.parcel-label::before {
  display: none;
}

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero, .grid.two-col { grid-template-columns: 1fr; }
  .map-frame { min-height: 460px; }
}

@media (max-width: 700px) {
  .cards { grid-template-columns: 1fr; }
  .page { padding: 18px 14px 38px; }
  .hero, .panel { padding: 18px; }
}
