/* =========================================================
   GREENSCOPE
   MAIN STYLESHEET
   ========================================================= */

:root {
  --bg: #f4f7f1;
  --surface: #ffffff;
  --ink: #142018;
  --muted: #6a746c;
  --line: #dce5db;

  --green: #1c6b45;
  --green-2: #52a56e;
  --lime: #dff1cc;

  --warn: #a96b27;

  --shadow:
    0 16px 45px rgba(29, 52, 34, 0.08);
}


/* =========================================================
   RESET
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;

  width: 100%;
  min-height: 100vh;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: var(--ink);
  background: var(--bg);

  overflow-x: hidden;
}

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


/* =========================================================
   BUTTONS
   ========================================================= */

button {
  border: 0;

  padding: 0.72rem 1rem;

  border-radius: 12px;

  cursor: pointer;

  background: var(--green);
  color: #ffffff;

  font-weight: 750;

  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

button:hover {
  opacity: 0.92;
}

button:active {
  transform: translateY(1px);
}

button.secondary {
  background: #edf3ec;
  color: var(--ink);
}


/* =========================================================
   HEADER
   ========================================================= */

.topbar {
  width: 100%;
  max-width: 1280px;

  margin: 0 auto;

  padding: 22px 28px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.brand {
  font-size: 1.35rem;
  font-weight: 900;

  letter-spacing: -0.04em;
}

.tagline {
  margin-top: 2px;

  font-size: 0.8rem;

  color: var(--muted);
}

.badge {
  padding: 0.45rem 0.7rem;

  border:
    1px solid #c4dfa9;

  border-radius: 999px;

  background: var(--lime);

  font-size: 0.74rem;
  font-weight: 800;

  white-space: nowrap;
}


/* =========================================================
   MAIN
   ========================================================= */

main {
  width: 100%;
  max-width: 1280px;

  margin: 0 auto;

  padding:
    10px
    28px
    54px;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
  padding:
    52px
    0
    30px;

  display: grid;

  grid-template-columns:
    minmax(0, 1.6fr)
    minmax(240px, 0.7fr);

  gap: 22px;

  align-items: end;
}

.eyebrow {
  margin:
    0
    0
    8px;

  color: var(--green);

  font-size: 0.72rem;
  font-weight: 900;

  letter-spacing: 0.14em;
}

h1 {
  margin: 0;

  max-width: 900px;

  font-size:
    clamp(
      2.35rem,
      5vw,
      5.2rem
    );

  line-height: 0.92;

  letter-spacing: -0.06em;
}

h2 {
  margin: 0;

  letter-spacing: -0.035em;
}

.lead {
  max-width: 700px;

  margin-bottom: 0;

  color: var(--muted);

  font-size: 1.05rem;

  line-height: 1.7;
}


/* =========================================================
   SHARED CARDS
   ========================================================= */

.hero-note,
.panel,
.side-card,
.map-card,
.metric,
.method {
  background: var(--surface);

  border:
    1px solid var(--line);

  box-shadow: var(--shadow);
}


/* =========================================================
   SATELLITE STATUS
   ========================================================= */

.hero-note {
  padding: 18px;

  display: flex;
  flex-direction: column;

  gap: 7px;

  border-radius: 18px;
}

.hero-note strong {
  color: var(--muted);

  font-size: 0.8rem;
}

.hero-note span {
  font-size: 1.25rem;
  font-weight: 900;

  line-height: 1.25;
}

.hero-note small {
  color: var(--muted);

  line-height: 1.45;
}


/* =========================================================
   METRICS
   ========================================================= */

.metrics {
  margin:
    12px
    0
    22px;

  display: grid;

  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );

  gap: 12px;
}

.metric {
  min-width: 0;

  padding: 18px;

  border-radius: 16px;

  display: flex;
  flex-direction: column;

  gap: 4px;
}

.metric span {
  color: var(--muted);

  font-size: 0.78rem;
  font-weight: 700;
}

.metric strong {
  font-size: 1.8rem;

  letter-spacing: -0.04em;
}

.metric small {
  color: var(--muted);

  font-size: 0.72rem;

  line-height: 1.4;
}


/* =========================================================
   MAIN WORKSPACE
   ========================================================= */

.workspace {
  width: 100%;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(280px, 330px);

  gap: 16px;

  align-items: stretch;
}

.map-card,
.side-card,
.panel,
.method {
  overflow: hidden;

  border-radius: 20px;
}

.map-card {
  width: 100%;
  min-width: 0;

  display: flex;
  flex-direction: column;
}

.side-card {
  width: 100%;
  min-width: 0;
}


/* =========================================================
   MAP HEADER
   ========================================================= */

.card-head {
  padding:
    18px
    18px
    14px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  flex: 0 0 auto;
}

.controls {
  display: flex;

  gap: 8px;

  flex-wrap: wrap;

  justify-content: flex-end;

  flex-shrink: 0;
}


/* =========================================================
   LEAFLET MAP
   ========================================================= */

#map {
  position: relative;

  display: block;

  width: 100%;

  height: 520px;
  min-height: 520px;

  margin: 0;

  padding: 0;

  overflow: hidden;

  background: #e7ece5;

  border-top:
    1px solid var(--line);

  border-bottom:
    1px solid var(--line);
}


/*
   DO NOT force tile width or height here.

   Leaflet uses CSS transforms to position tiles and must
   control their dimensions itself.
*/

#map.leaflet-container {
  width: 100% !important;

  height: 520px !important;

  min-height: 520px !important;

  background: #e7ece5;
}


/*
   Protect Leaflet tiles from external/global image rules.
*/

.leaflet-container img,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  max-width: none !important;
  max-height: none !important;
}


/*
   Keep tile panes clipped correctly.
*/

.leaflet-map-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane {
  position: absolute;
}


/*
   Avoid visual seams while transforms occur.
*/

.leaflet-tile {
  visibility: inherit;
  opacity: 1;
}


/*
   Leaflet controls.
*/

.leaflet-control-container {
  position: relative;

  z-index: 1000;
}

.leaflet-top,
.leaflet-bottom {
  z-index: 1000;
}

.leaflet-control-layers {
  border: 0;

  border-radius: 12px;

  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.12);
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
}


/* =========================================================
   MAP HELP
   ========================================================= */

.map-help {
  padding:
    12px
    18px;

  flex: 0 0 auto;

  background: var(--surface);

  color: var(--muted);

  font-size: 0.8rem;

  line-height: 1.5;
}


/* =========================================================
   SIDE PANEL
   ========================================================= */

.side-card {
  padding: 20px;
}

.mission {
  margin:
    18px
    0;

  padding: 16px;

  background: #f1f7ea;

  border:
    1px solid #d8e7c7;

  border-radius: 16px;
}

.mission span {
  color: var(--green);

  font-size: 0.7rem;
  font-weight: 900;

  text-transform: uppercase;
}

.mission strong {
  display: block;

  margin:
    8px
    0;

  font-size: 1.1rem;

  line-height: 1.35;
}

.mission p {
  margin: 0;

  color: var(--muted);

  font-size: 0.85rem;

  line-height: 1.5;
}


/* =========================================================
   FIELD LEGEND
   ========================================================= */

.legend {
  margin:
    22px
    0;

  display: grid;

  gap: 8px;
}

.legend h3,
.analysis-box h3 {
  margin:
    0
    0
    6px;

  font-size: 0.88rem;
}

.legend div {
  display: flex;

  align-items: center;

  gap: 8px;

  color: var(--muted);

  font-size: 0.82rem;
}

.dot {
  width: 10px;
  height: 10px;

  flex:
    0
    0
    10px;

  display: inline-block;

  border-radius: 50%;
}

.dot.tree {
  background: #236c45;
}

.dot.grass {
  background: #7ea64b;
}

.dot.hard {
  background: #6e7470;
}

.dot.exposed {
  background: #b67a34;
}


/* =========================================================
   ANALYSIS IMPORT
   ========================================================= */

.analysis-box {
  padding-top: 18px;

  border-top:
    1px solid var(--line);
}

.analysis-box p {
  color: var(--muted);

  font-size: 0.82rem;

  line-height: 1.5;
}

.analysis-box input {
  width: 100%;

  font-size: 0.75rem;
}


/* =========================================================
   LOWER GRID
   ========================================================= */

.lower-grid {
  margin-top: 16px;

  display: grid;

  grid-template-columns:
    minmax(0, 1.2fr)
    minmax(0, 0.8fr);

  gap: 16px;
}

.panel {
  min-width: 0;
  min-height: 330px;

  padding: 20px;
}


/* =========================================================
   CHART
   ========================================================= */

.chart-wrap {
  position: relative;

  width: 100%;

  height: 245px;

  margin-top: 10px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}


/* =========================================================
   HELPERS
   ========================================================= */

.muted {
  color: var(--muted);

  font-size: 0.82rem;

  line-height: 1.5;
}


/* =========================================================
   OBSERVATIONS
   ========================================================= */

.obs-list {
  max-height: 220px;

  margin-top: 16px;

  display: grid;

  gap: 8px;

  overflow-y: auto;
}

.obs-item {
  padding:
    10px
    12px;

  border:
    1px solid var(--line);

  border-radius: 12px;
}

.obs-item strong {
  display: block;

  margin-bottom: 3px;

  font-size: 0.82rem;
}

.obs-item small {
  color: var(--muted);

  line-height: 1.4;
}

.danger-link {
  margin-top: 12px;

  padding: 0;

  background: transparent;

  color: #8c4b43;

  font-size: 0.78rem;
}


/* =========================================================
   RESEARCH WORKFLOW
   ========================================================= */

.method {
  margin-top: 16px;

  padding: 22px;
}

.steps {
  margin-top: 18px;

  display: grid;

  grid-template-columns:
    repeat(
      5,
      minmax(0, 1fr)
    );

  gap: 8px;
}

.steps div {
  min-width: 0;
  min-height: 120px;

  padding: 14px;

  display: flex;
  flex-direction: column;

  gap: 5px;

  background: #f4f7f1;

  border-radius: 14px;
}

.steps b {
  color: var(--green);

  font-size: 1.45rem;
}

.steps span {
  font-size: 0.86rem;
  font-weight: 800;

  line-height: 1.35;
}

.steps small {
  color: var(--muted);

  line-height: 1.4;
}


/* =========================================================
   DIALOG
   ========================================================= */

dialog {
  width:
    min(
      470px,
      calc(100% - 32px)
    );

  padding: 0;

  color: var(--ink);
  background: var(--surface);

  border:
    1px solid var(--line);

  border-radius: 18px;

  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.2);
}

dialog::backdrop {
  background:
    rgba(15, 24, 18, 0.45);
}

dialog form {
  padding: 20px;
}

.dialog-head {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;
}

.icon-btn {
  padding:
    2px
    10px;

  background: transparent;

  color: var(--ink);

  font-size: 1.6rem;
}

label {
  margin-top: 16px;

  display: grid;

  gap: 6px;

  font-size: 0.78rem;
  font-weight: 800;
}

select,
textarea {
  width: 100%;

  padding: 10px;

  color: var(--ink);
  background: #ffffff;

  border:
    1px solid var(--line);

  border-radius: 10px;
}

textarea {
  min-height: 95px;

  resize: vertical;
}

.dialog-actions {
  margin-top: 18px;

  display: flex;

  justify-content: flex-end;

  gap: 8px;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
  width: 100%;
  max-width: 1280px;

  margin: 0 auto;

  padding:
    24px
    28px
    36px;

  display: flex;

  justify-content: space-between;

  gap: 20px;

  color: var(--muted);

  font-size: 0.78rem;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

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

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

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

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

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

  #map,
  #map.leaflet-container {
    height: 470px !important;
    min-height: 470px !important;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 560px) {

  .topbar,
  main,
  footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .hero {
    padding-top: 28px;
  }

  h1 {
    font-size:
      clamp(
        2.2rem,
        12vw,
        3.5rem
      );
  }

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

    gap: 8px;
  }

  .metric {
    padding: 14px;
  }

  .metric strong {
    font-size: 1.5rem;
  }

  .card-head {
    flex-direction: column;

    align-items: flex-start;
  }

  .controls {
    width: 100%;

    justify-content: flex-start;
  }

  .controls button {
    flex:
      1
      1
      auto;
  }

  #map,
  #map.leaflet-container {
    height: 410px !important;
    min-height: 410px !important;
  }

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

  footer {
    flex-direction: column;
  }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 400px) {

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

  #map,
  #map.leaflet-container {
    height: 380px !important;
    min-height: 380px !important;
  }
}
/* =========================================================
   ONLINE / SOCIAL MOVEMENT ENHANCEMENTS
   ========================================================= */
.brand-wrap{color:inherit;text-decoration:none}.top-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.status-pill{font-size:.72rem;font-weight:800;background:#edf3ec;border:1px solid var(--line);border-radius:999px;padding:.45rem .7rem;color:var(--green)}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.button-link{display:inline-flex;align-items:center;justify-content:center;border-radius:12px;padding:.72rem 1rem;text-decoration:none;font-weight:750}.secondary-link{background:#edf3ec;color:var(--ink)}
.impact-section{margin:22px 0;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:20px;padding:22px}.section-copy{max-width:820px;color:var(--muted);line-height:1.65}.impact-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:18px}.impact-card{background:#f4f7f1;border-radius:14px;padding:14px;display:flex;flex-direction:column;gap:5px}.impact-card span{font-size:.75rem;color:var(--muted);font-weight:700}.impact-card strong{font-size:1.55rem;letter-spacing:-.03em}.progress-track{width:100%;height:10px;background:#e7ede5;border-radius:999px;overflow:hidden;margin-top:14px}.progress-fill{height:100%;width:0;background:var(--green);border-radius:inherit;transition:width .25s ease}
.data-mode-box{border-top:1px solid var(--line);padding-top:18px;margin-top:18px}.data-mode-box h3{margin:0 0 6px;font-size:.88rem}.data-mode-box p{color:var(--muted);font-size:.82rem;line-height:1.5}.full-button{width:100%}
.two-column-info{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:16px}.info-card{background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:20px;padding:22px}.info-card p:last-child{color:var(--muted);line-height:1.65;margin-bottom:0}
.privacy-note{margin-top:14px;padding:10px 12px;border-radius:10px;background:#f4f7f1;border:1px solid var(--line);font-size:.78rem;color:var(--muted);line-height:1.45}.privacy-note strong{color:var(--ink)}
.map-card{scroll-margin-top:20px}.metric-decrease{border-top:3px solid #b06d2f}.metric-increase{border-top:3px solid var(--green2)}
@media(max-width:900px){.impact-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.two-column-info{grid-template-columns:1fr}}
@media(max-width:560px){.top-actions{justify-content:flex-start}.impact-grid{grid-template-columns:1fr 1fr}.hero-actions>*{flex:1 1 auto}.status-pill{display:none}}
@media(max-width:400px){.impact-grid{grid-template-columns:1fr}}
