:root {
  --forest-950: #102b20;
  --forest-900: #183c2d;
  --forest-800: #24513d;
  --forest-700: #34664f;
  --moss: #89a36d;
  --cream: #f7f1e4;
  --cream-deep: #eee4d1;
  --paper: #fffdf8;
  --chestnut: #9b4f28;
  --chestnut-dark: #75371c;
  --ink: #1f2822;
  --muted: #667168;
  --line: rgba(24, 60, 45, 0.13);
  --shadow: 0 18px 45px rgba(19, 43, 33, 0.16);
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.app-shell {
  width: 100%;
  height: 100%;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  color: var(--cream);
  background: var(--forest-950);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--moss);
}

.brand-mark svg {
  width: 100%;
  height: 100%;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.brand small {
  margin-top: 5px;
  color: rgba(247, 241, 228, 0.65);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(247, 241, 228, 0.14);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease;
}

.icon-button:hover {
  border-color: rgba(247, 241, 228, 0.28);
  background: rgba(255, 255, 255, 0.1);
}

.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.icon-button span {
  font-size: 12px;
  font-weight: 600;
}

.workspace {
  display: grid;
  height: calc(100% - var(--topbar-height));
  grid-template-columns: minmax(320px, 390px) 1fr;
}

.sidebar {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 8px 0 30px rgba(20, 48, 36, 0.08);
}

.sidebar-intro {
  padding: 24px 28px 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(137, 163, 109, 0.18), transparent 45%),
    var(--paper);
}

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

h1 {
  margin: 0;
  color: var(--forest-950);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(27px, 2.5vw, 34px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.intro-copy {
  max-width: 310px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.summary-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.summary-number {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.summary-number strong {
  color: var(--forest-900);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.summary-number span,
.summary-meta {
  color: var(--muted);
  font-size: 10px;
}

.summary-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: right;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #629a5b;
  box-shadow: 0 0 0 3px rgba(98, 154, 91, 0.13);
}

.search-wrap {
  position: relative;
  margin: 0 24px 14px;
}

.search-wrap svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--cream);
  font-size: 12px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.search-wrap input:focus {
  border-color: rgba(155, 79, 40, 0.55);
  box-shadow: 0 0 0 3px rgba(155, 79, 40, 0.09);
}

.filters-panel {
  padding: 0 24px 14px;
}

.filter-label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.filter-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.filter-links button {
  display: flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 6px 8px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--paper);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.filter-links button:hover,
.filter-links button.is-active {
  border-color: rgba(155, 79, 40, 0.55);
  color: var(--chestnut);
  background: rgba(155, 79, 40, 0.07);
}

.filter-links button span {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0 4px;
  place-items: center;
  border-radius: 999px;
  color: var(--forest-800);
  background: var(--cream-deep);
  font-size: 8px;
}

.month-filter {
  display: grid;
  grid-template-columns: 1fr 145px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.month-filter .filter-label {
  margin: 0;
}

.month-filter select {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--forest-900);
  background: var(--cream);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.month-filter select:focus {
  border-color: rgba(155, 79, 40, 0.55);
  box-shadow: 0 0 0 3px rgba(155, 79, 40, 0.09);
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 27px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-heading button {
  border: 0;
  color: var(--chestnut);
  background: none;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.tree-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.tree-list::-webkit-scrollbar {
  width: 7px;
}

.tree-list::-webkit-scrollbar-thumb {
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--cream-deep);
}

.tree-item {
  display: grid;
  width: 100%;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 16px 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.tree-item:hover,
.tree-item.is-active {
  background: var(--cream);
}

.tree-item:hover {
  transform: translateX(2px);
}

.tree-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--cream);
  background: var(--forest-800);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.1);
}

.tree-avatar svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.tree-copy {
  min-width: 0;
}

.tree-copy strong,
.tree-copy span,
.tree-copy small {
  display: block;
}

.tree-copy strong {
  overflow: hidden;
  color: var(--forest-950);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-copy span {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-copy small {
  margin-top: 3px;
  color: var(--chestnut);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tree-metric {
  min-width: 44px;
  color: var(--chestnut);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.loading-list {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 44px;
}

.loading-list span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--moss);
  animation: bounce 900ms infinite alternate;
}

.loading-list span:nth-child(2) {
  animation-delay: 150ms;
}

.loading-list span:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes bounce {
  to {
    transform: translateY(-7px);
    opacity: 0.45;
  }
}

.empty-state {
  padding: 50px 30px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 24px 16px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}

.sidebar-footer a {
  color: var(--forest-800);
  font-size: 10px;
  font-weight: 700;
}

.sidebar-footer p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.map-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(24, 60, 45, 0.92), rgba(36, 81, 61, 0.86)),
    var(--forest-900);
}

.map {
  width: 100%;
  height: 100%;
}

.map-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(24, 60, 45, 0.1);
  border-radius: 999px;
  color: var(--forest-900);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 8px 25px rgba(18, 43, 32, 0.12);
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(9px);
}

.legend-marker {
  width: 11px;
  height: 11px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--chestnut);
  box-shadow: 0 0 0 2px var(--chestnut);
}

.map-message {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: min(380px, calc(100% - 40px));
  padding: 34px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 24px;
  color: var(--cream);
  background: rgba(16, 43, 32, 0.93);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(15px);
}

.map-message[hidden] {
  display: none;
}

.message-icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--moss);
  background: rgba(137, 163, 109, 0.13);
}

.message-icon svg {
  width: 40px;
  height: 40px;
}

.message-icon path {
  fill: currentColor;
}

.message-icon circle {
  fill: var(--forest-950);
}

.detail-card h2 {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-weight: 400;
}

.map-message h2 {
  font-size: 27px;
}

.map-message p {
  margin: 10px 0 22px;
  color: rgba(247, 241, 228, 0.69);
  font-size: 12px;
  line-height: 1.55;
}

.primary-button,
.secondary-button {
  min-height: 43px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  border: 0;
  color: white;
  background: var(--chestnut);
  box-shadow: 0 8px 20px rgba(117, 55, 28, 0.23);
}

.primary-button:hover {
  background: var(--chestnut-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--forest-900);
  background: transparent;
}

.detail-card {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 3;
  width: min(340px, calc(100% - 40px));
  padding: 25px;
  border: 1px solid rgba(24, 60, 45, 0.1);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.detail-card[hidden] {
  display: none;
}

.detail-close,
.dialog-close {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.detail-close {
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: var(--cream);
  font-size: 21px;
}

.detail-kicker {
  margin: 0 0 6px;
  color: var(--chestnut);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-card h2 {
  padding-right: 24px;
  color: var(--forest-950);
  font-size: 27px;
  line-height: 1.05;
}

.detail-botanical {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}

.detail-location {
  margin: 17px 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.detail-harvest {
  margin: -8px 0 17px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--forest-800);
  background: var(--cream);
  font-size: 10px;
  font-weight: 700;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.detail-facts div {
  padding: 14px 7px;
  text-align: center;
}

.detail-facts div + div {
  border-left: 1px solid var(--line);
}

.detail-facts strong,
.detail-facts span {
  display: block;
}

.detail-facts strong {
  color: var(--forest-900);
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 17px;
  font-weight: 400;
}

.detail-facts span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.directions-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  color: var(--chestnut);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.directions-link svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.leaflet-control-attribution {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 9px !important;
}

.leaflet-control-zoom a {
  color: var(--forest-900);
}

.leaflet-tooltip {
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--forest-950);
  box-shadow: 0 8px 25px rgba(18, 43, 32, 0.17);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 10px;
  line-height: 1.4;
}

.leaflet-tooltip strong {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 13px;
  font-weight: 400;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: 330px;
  padding: 12px 16px;
  transform: translateY(120px);
  border-radius: 10px;
  color: white;
  background: var(--forest-950);
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 780px) {
  :root {
    --topbar-height: 64px;
  }

  body {
    overflow: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
    padding: 0 15px;
  }

  .brand small,
  .icon-button span {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .icon-button {
    width: 39px;
    padding: 0;
    justify-content: center;
  }

  .workspace {
    display: flex;
    height: auto;
    min-height: calc(100vh - var(--topbar-height));
    flex-direction: column-reverse;
  }

  .map-panel {
    position: sticky;
    top: var(--topbar-height);
    height: 52vh;
    min-height: 390px;
  }

  .sidebar {
    min-height: 620px;
    border-right: 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 28px rgba(20, 48, 36, 0.08);
  }

  .sidebar-intro {
    padding: 27px 22px 21px;
  }

  h1 {
    font-size: 30px;
  }

  .search-wrap {
    margin-right: 18px;
    margin-left: 18px;
  }

  .tree-list {
    overflow: visible;
  }

  .tree-item {
    padding-right: 20px;
    padding-left: 20px;
  }

  .map-badge {
    top: 12px;
    left: 12px;
  }

  .detail-card {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }

  .map-message {
    padding: 27px 23px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
