:root {
  --glass: rgba(12, 16, 13, 0.84);
  --line: rgba(255, 255, 255, 0.072);
  --line-2: rgba(255, 255, 255, 0.13);
  /* three levels of ink, not two */
  --text: #e8ede8;
  --muted: #99a69c;
  --faint: #6b786f;
  /* data hues, brought to one common low chroma */
  --accent: #63c987;
  --accent-dim: rgba(99, 201, 135, 0.16);
  --amber: #d7a463;
  --water: #79a6c6;
  --warn: #e0827b;
  --radius: 14px;
  /* vertical rhythm: the panel only ever uses these */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 22px; --s6: 32px; --s7: 44px;
  --pad: 22px;
  color-scheme: dark;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono { font-family: var(--mono); font-size: 0.95em; font-variant-numeric: tabular-nums; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0a0d0b; color: var(--text); }
#map { position: fixed; inset: 0; background: #0a0d0b; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; top: 16px; left: 16px; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  background: var(--glass); border: 1px solid var(--line-2);
  padding: 10px 16px 10px 13px; border-radius: var(--radius);
  font-weight: 500; font-size: 15px; letter-spacing: 0.2px;
  color: var(--accent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.brand span { color: var(--text); }

.search { position: relative; }
.search input {
  width: 290px; padding: 11px 14px;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--radius);
  color: var(--text); font: inherit; font-size: 13px; outline: none;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: rgba(99, 201, 135, 0.45); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

#geo-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  margin: 0; padding: 6px; list-style: none;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: var(--radius);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  max-height: 300px; overflow-y: auto;
}
#geo-results li {
  padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13px;
}
#geo-results li .sub { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
#geo-results li:hover, #geo-results li.active { background: rgba(255, 255, 255, 0.07); }

#draw-btn, #lang-btn, #import-btn, #radar-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line-2);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s, background 0.15s;
}
#draw-btn:hover { border-color: rgba(99, 201, 135, 0.45); }
#draw-btn.armed { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
#radar-btn.armed { background: rgba(215, 164, 99, 0.16); border-color: var(--amber); color: var(--amber); }
#radar-btn, #import-btn { padding: 11px 14px; }
#draw-btn svg { opacity: 0.9; }
#lang-btn { padding: 11px 13px; font-family: var(--mono); font-size: 12px; }
#langmenu {
  position: fixed; top: 66px; z-index: 1200; min-width: 170px;
  background: var(--glass); border-radius: 14px; padding: 6px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.055), 0 20px 48px -12px rgba(0,0,0,.7);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  animation: rise2 .18s ease;
}
#langmenu button {
  display: block; width: 100%; text-align: left; font: inherit; font-size: 12.5px;
  color: var(--muted); background: none; border: 0; border-radius: 9px;
  padding: 8px 11px; cursor: pointer;
}
#langmenu button:hover { background: rgba(255,255,255,.07); color: var(--text); }
#langmenu button.on { color: var(--accent); }
#import-btn { padding: 11px 12px; }

/* ---------- hint ---------- */
#hint {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 1000;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 9px 18px; font-size: 13px; color: var(--text);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  animation: rise 0.25s ease;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- results panel: one continuous surface ---------- */
#panel {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  max-height: calc(100vh - 32px - 44px);
  width: 420px; max-width: calc(100vw - 32px);
  border: 0; border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05) 0, rgba(255,255,255,.012) 120px, rgba(255,255,255,0) 300px),
    var(--glass);
  backdrop-filter: blur(30px) saturate(1.25); -webkit-backdrop-filter: blur(30px) saturate(1.25);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.55),                /* dark halo: the edge survives bright imagery */
    inset 0 0 0 1px rgba(255,255,255,.055),   /* hairline of glass */
    inset 0 1px 0 rgba(255,255,255,.10),      /* light from above */
    0 1px 2px rgba(0,0,0,.35),                /* contact */
    0 30px 64px -18px rgba(0,0,0,.78);        /* ambient */
  overflow-y: auto; overscroll-behavior: contain;
  animation: slide 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slide { from { opacity: 0; transform: translateX(24px); } }
#panel::-webkit-scrollbar { width: 10px; }
#panel::-webkit-scrollbar-track { background: transparent; }
#panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.11); border-radius: 99px;
  border: 3px solid transparent; background-clip: content-box;
}
#panel::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }
#panel-content { padding: 0; }   /* the two zones carry their own padding now */

/* content dissolves at the bottom edge instead of being guillotined */
.panel-fade {
  position: sticky; bottom: 0; z-index: 2; pointer-events: none;
  height: 42px;
  background: linear-gradient(to top, rgba(13,17,14,.95), rgba(13,17,14,0));
}

/* ---------- header as a zone ---------- */
.p-head {
  position: sticky; top: 0; z-index: 3;
  padding: 19px var(--pad) 15px;
  background: linear-gradient(180deg, rgba(17,22,18,.97) 0, rgba(17,22,18,.93) 62%,
                              rgba(17,22,18,.72) 88%, rgba(17,22,18,0) 100%);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.p-head::after {                 /* hairline that fades out before the rounded corners */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0, rgba(255,255,255,.115) 10%,
                              rgba(255,255,255,.115) 90%, transparent 100%);
}
.p-body { padding: 0 var(--pad); }   /* the .panel-fade block supplies the bottom spacing */

.loc-title {
  font-size: 21px; font-weight: 500; letter-spacing: -.014em; line-height: 1.18;
  margin: 0 76px 0 0;   /* clears the delete + close buttons */
}
.loc-title .adm, .readout .adm { color: var(--faint); font-weight: 400; }
.loc-geo {
  margin-top: 7px; font-family: var(--mono); font-size: 10.5px; font-weight: 400;
  color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .005em;
}
.loc-geo .sep { color: rgba(255,255,255,.16); margin: 0 .55em; }
.loc-note { margin-top: 7px; font-size: 11px; line-height: 1.5; color: var(--faint); }
.loc-note b {
  font-family: var(--mono); font-size: 10.5px; font-weight: 400;
  color: var(--muted); font-variant-numeric: tabular-nums;
}

.panel-close {
  position: absolute; top: 17px; right: 16px; width: 26px; height: 26px;
  border: 0; border-radius: 7px; background: none; color: var(--faint);
  font-size: 17px; line-height: 1; cursor: pointer; padding: 0;
  transition: color .15s, background .15s;
}
.panel-close:hover { color: var(--text); background: rgba(255,255,255,.07); }

/* hover hints below icon-only buttons */
/* data-tip hosts are already positioned (absolute buttons); no position override */
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 40;
  background: rgba(10, 14, 11, .96); color: var(--text);
  font-size: 11px; font-weight: 400; line-height: 1.35; white-space: nowrap;
  padding: 6px 9px; border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(-2px); pointer-events: none;
  transition: opacity .12s ease .25s, transform .12s ease .25s;
}
[data-tip]:hover::after { opacity: 1; transform: translateY(0); }

/* ---------- section labels ---------- */
.section-h {
  font-size: 9.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .145em;
  color: var(--faint); margin: var(--s6) 0 var(--s3);
}

/* ---------- climate figure + site readout ---------- */
.site-fig { margin: 0 -16px; }        /* the hero gets 32px more drawing width than the text column */
.site-fig svg { display: block; width: 100%; height: auto; }

/* Site facts as a two-column table: fills top-to-bottom, so the DOM order stays
   the logical reading order and no label/value pair can ever be split by a wrap. */
.readout {
  margin: var(--s5) 0 0;
  display: grid; grid-template-rows: repeat(5, auto);
  grid-auto-flow: column; grid-auto-columns: 1fr; column-gap: 26px;
}
.readout .rd {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 11px; color: var(--faint); padding: 4.5px 0; border-top: 1px solid var(--line);
}
.readout .rd:nth-child(1), .readout .rd:nth-child(6) { border-top: 0; }
.readout b {
  font-family: var(--mono); font-size: 10.5px; font-weight: 400; color: var(--text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ---------- criteria row (structure per SPEC.md, finish per SPEC-2) ---------- */
.sec-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: var(--s7) 0 var(--s3); }
.sec-row .section-h { margin: 0; }

.crit-toggle {
  flex: 0 0 auto; font: inherit; font-size: 10.5px; color: var(--faint);
  background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap;
}
.crit-toggle b {
  font-family: var(--mono); font-size: 10.5px; font-weight: 400;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.crit-toggle.active b { color: var(--accent); }
.crit-toggle:hover { color: var(--muted); }
/* a chevron reads finer than a filled triangle at this size */
.crit-toggle .car {
  display: inline-block; width: 4.5px; height: 4.5px; margin-left: 7px; vertical-align: 2px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg); opacity: .6; transition: transform .18s ease;
}
.crit-toggle[aria-expanded="true"] .car { transform: rotate(-135deg); }


/* No closing rule: the list's first hairline closes the block. */
.crit-panel { margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
.crit-panel[hidden] { display: none; }
.crit-row { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.crit-row .k {
  flex: 0 0 78px; font-size: 9.5px; text-transform: uppercase; letter-spacing: .11em;
  color: var(--faint); padding-top: 2px;
}
.crit-row .opts { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 15px; row-gap: 4px; margin: -3px 0; }
.opt { font: inherit; font-size: 11.5px; background: none; border: 0; padding: 3px 0; margin: 0; color: var(--muted); cursor: pointer; }
.opt:hover { color: var(--text); }
.opt.on { color: var(--text); }
.opt.on.constrained { color: var(--accent); }
.opt .c { font-family: var(--mono); font-size: 9px; color: var(--faint); margin-left: 5px; font-variant-numeric: tabular-nums; }
.opt.on .c { display: none; }
.opt[disabled] { opacity: .35; cursor: default; }
.crit-clear { display: block; margin: 10px 0 0 auto; font: inherit; font-size: 10px; color: var(--faint); background: none; border: 0; padding: 0; cursor: pointer; }
.crit-clear:hover { color: var(--text); }

/* ---------- species list: a ledger, not a stack of boxes ---------- */
#sp-list { margin: 0 calc(var(--pad) * -1); }   /* hairlines bleed to the panel edge */
.sp { border-top: 1px solid var(--line); }
.sp:last-child { border-bottom: 1px solid var(--line); }
.sp-head {
  display: flex; align-items: center; gap: 13px;
  padding: 10px var(--pad); min-height: 62px; cursor: pointer; user-select: none;
  transition: background .13s;
}
.sp-head:hover { background: rgba(255,255,255,.028); }
.sp.open { background: rgba(255,255,255,.022); }
/* species search: the question box */
.sp-search {
  display: flex; align-items: center; gap: 9px;
  margin-top: var(--s5); padding: 0 2px 9px; border-bottom: 1px solid var(--line);
  color: var(--faint);
}
.sp-search input {
  flex: 1; background: none; border: 0; outline: none; color: var(--text);
  font: inherit; font-size: 12.5px; padding: 2px 0;
}
.sp-search input::placeholder { color: var(--faint); }
.sp-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sp-search:focus-within { color: var(--muted); border-bottom-color: rgba(99, 201, 135, 0.35); }
.sp-head.noexpand { cursor: default; }
.sp-get .inv { font-size: 10px; color: var(--warn); max-width: 150px; text-align: right; white-space: normal; }

/* chips row: guerrilla-mode front controls, one line */
.chips-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: var(--s5); padding-bottom: 8px;
}
.chips-row .crit-toggle { margin-left: auto; }

/* collapsible sections: "Why these plants?" and "For projects" */
.disc {
  display: flex; align-items: center; width: 100%;
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: none; border: 0; border-top: 1px solid var(--line);
  padding: 13px 0; margin-top: var(--s5); cursor: pointer; text-align: left;
}
.disc:hover { color: var(--text); }
.disc .car {
  width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: rotate(45deg); margin-left: auto; transition: transform .16s; opacity: .6;
}
.disc.open .car { transform: rotate(-135deg); }
.disc-body { padding-bottom: var(--s4); }
.disc-body[hidden] { display: none; }

/* one sentence of land advice, in the product's own voice */
.land-note { font-size: 11px; color: var(--faint); line-height: 1.55; margin-top: var(--s4); }

/* feedback mini-form */
.fb-form { padding: 10px 0; border-bottom: 1px solid var(--line); }
.fb-form textarea {
  width: 100%; background: rgba(255,255,255,.045); border: 1px solid var(--line-2);
  border-radius: 10px; color: var(--text); font: inherit; font-size: 12.5px;
  padding: 9px 11px; resize: vertical; outline: none;
}
.fb-form textarea:focus { border-color: rgba(99, 201, 135, 0.45); }
.fb-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-ok { font-size: 12px; color: var(--muted); padding: 8px 0; }

/* follow-ups: the loop's next action, offered as quiet rows */
.follow { margin-top: var(--s4); border-top: 1px solid var(--line); }
.fu {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font: inherit; font-size: 12px; color: var(--muted); text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  padding: 10px 2px; cursor: pointer;
}
.fu:hover { color: var(--text); }
.fu .fa { color: var(--faint); font-size: 12px; transform: scaleX(-1); }
.fu:hover .fa { color: var(--accent); }

/* analysis loader: pixel-grid churn + elapsed readout */
.load-elapsed { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.load-elapsed .mono { font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.pxg { display: grid; grid-template-columns: repeat(3, 3px); gap: 1.5px; width: 12px; }
.pxg i { width: 3px; height: 3px; background: var(--muted); animation: pxblink 1.05s steps(2, jump-none) infinite; }
.pxg i:nth-child(1) { animation-delay: 0s; } .pxg i:nth-child(2) { animation-delay: .35s; }
.pxg i:nth-child(3) { animation-delay: .7s; } .pxg i:nth-child(4) { animation-delay: .85s; }
.pxg i:nth-child(5) { animation-delay: .15s; } .pxg i:nth-child(6) { animation-delay: .5s; }
.pxg i:nth-child(7) { animation-delay: .6s; } .pxg i:nth-child(8) { animation-delay: .25s; }
.pxg i:nth-child(9) { animation-delay: .95s; }
@keyframes pxblink { 50% { opacity: .15; } }

/* the active step's label shimmers while it works */
.load-step.active .lt {
  background: linear-gradient(90deg, var(--muted) 25%, var(--text) 50%, var(--muted) 75%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: lshimmer 1.8s linear infinite;
}
@keyframes lshimmer { to { background-position: -200% 0; } }

/* "Where to get it" rows */
.getrows .sk.gfree { color: var(--accent); font-weight: 600; }
.getrows a { color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.18); }
.getrows a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.getrows .chk { color: var(--faint); font-size: .85em; }

/* first-run invitation */
#intro {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 940;
  display: flex; align-items: center; gap: 12px; max-width: min(92vw, 640px);
  background: rgba(13, 17, 14, .94); border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 12px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: rise .3s ease;
}
#intro .iq { font-size: 12.5px; color: var(--text); }
#intro .ialt { font-size: 11px; color: var(--faint); white-space: nowrap; }
#intro #intro-go {
  font: inherit; font-size: 12px; font-weight: 600; color: #0c120d;
  background: var(--accent); border: 0; border-radius: 9px; padding: 7px 13px; cursor: pointer;
  white-space: nowrap;
}
#intro #intro-go:hover { filter: brightness(1.08); }
.sp-thumb {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  background-color: rgba(255,255,255,.045); background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09);
}
.sp-names { flex: 1; min-width: 0; }
.sp-common { font-size: 13.5px; font-weight: 500; letter-spacing: -.004em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sci { font-size: 11px; font-style: italic; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.nearby { font-size: 9.5px; font-weight: 500; letter-spacing: .02em; margin-left: 5px; color: var(--accent); }
.nearby.gbif { color: var(--faint); font-weight: 400; }
.nearby.otherreg { color: var(--amber); font-weight: 400; font-style: normal; } /* lives on the sci line */
.nearby.mgnl { color: var(--amber); font-weight: 400; opacity: .85; } /* sub-suitable rows say so */
.it.wet { color: var(--water); }
/* the acquisition column: the one thing on the row that converts intent to action */
.sp-get { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.sp-get .spd { font-size: 10px; color: var(--faint); letter-spacing: .01em; }
.sp-get .prc { font-family: var(--mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-empty { padding: 18px var(--pad); font-size: 11.5px; color: var(--muted); }

/* ---------- expanded card as one composition ---------- */
.sp-body { padding: 0 var(--pad) var(--s5); }
.sp-body[hidden] { display: none; }

/* the photo bleeds to the panel edge: specimen plate, single focus of the card */
.sp-photo {
  width: calc(100% + var(--pad) * 2); margin: 0 calc(var(--pad) * -1); height: 176px;
  background-color: rgba(255,255,255,.04); background-size: cover; background-position: center;
  box-shadow: inset 0 1px 0 rgba(0,0,0,.45), inset 0 -1px 0 rgba(0,0,0,.45);
}
/* two deliberate lines: verdict, then uses. Never an accidental wrap. */
.sp-meta { margin: var(--s4) 0 0; font-size: 11.5px; color: var(--muted); }
.sp-meta .grade { color: var(--accent); }
.sp-meta .sep { color: rgba(255,255,255,.16); margin: 0 .45em; }
.sp-uses { margin: 4px 0 0; font-size: 11px; line-height: 1.65; color: var(--faint); }
.sp-uses .it { display: inline-block; white-space: nowrap; margin-right: 13px; }

/* envelope strips: label | strip | value on ONE line */
.factors { margin: var(--s5) 0 0; }
.factor { display: grid; grid-template-columns: 74px 1fr 60px; align-items: center; gap: 11px; padding: 5px 0; }
.factor .fk { font-size: 11px; color: var(--muted); }
.factor .fx { font-family: var(--mono); font-size: 10.5px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.rtrack { position: relative; height: 4px; border-radius: 2px; background: rgba(255,255,255,.035); }
.rabs { position: absolute; top: 0; height: 100%; border-radius: 2px; background: rgba(99,201,135,.17); }
.ropt { position: absolute; top: 0; height: 100%; border-radius: 2px; background: rgba(99,201,135,.40); }
/* a caliper mark, not a slider handle: dark halo so it reads over the band */
.rtick {
  position: absolute; top: -4px; width: 1.5px; height: 12px; border-radius: 1px;
  background: var(--text); box-shadow: 0 0 0 2.5px rgba(13,17,14,.7);
}
.rtick.out { background: var(--warn); }
.evidence { font-size: 10.5px; color: var(--faint); margin-top: var(--s3); line-height: 1.6; }
.evidence a { color: var(--accent); text-decoration: none; }

.growth-fig { margin: var(--s5) 0 0; }
.growth-fig svg { display: block; width: 100%; height: auto; }
.fig-cap { font-size: 10.5px; color: var(--faint); margin-top: var(--s2); line-height: 1.55; }

.stats { margin: var(--s5) 0 0; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 11.5px; padding: 5.5px 0; }
.stat .sk { color: var(--muted); white-space: nowrap; }
.stat .sv { font-family: var(--mono); font-size: 11px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat.wide { margin-top: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 12.5px; }
.stat.wide .sv { font-size: 12px; }

/* ---------- buttons + footnote ---------- */
/* "mostrar mais" continues the ledger instead of being a pill */
.chip.more {
  display: block; width: calc(100% + var(--pad) * 2); margin: 0 calc(var(--pad) * -1);
  padding: 14px 0; text-align: center; font: inherit; font-size: 11px; color: var(--muted);
  background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: color .13s, background .13s;
}
.chip.more:hover { color: var(--text); background: rgba(255,255,255,.028); }
/* the bare .chip stays a pill: "Mostrar mesmo assim" and "Tentar de novo" */
.chip {
  font: inherit; font-size: 11px; padding: 6px 11px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--text); border-color: rgba(255,255,255,.2); }

.footnote {
  margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid var(--line);
  font-size: 10.5px; line-height: 1.8; color: var(--faint);
}
.footnote a { color: var(--faint); text-decoration: underline; text-decoration-color: rgba(255,255,255,.18); text-underline-offset: 2px; }
.footnote a:hover { color: var(--muted); }

/* ---------- loading + error states ---------- */
.loading { display: flex; flex-direction: column; gap: 10px; padding: var(--s5) 0 8px; }
.load-step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.load-step.done { color: var(--text); }
.load-step .dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); flex-shrink: 0;
}
.load-step.done .dot { background: var(--accent); }
.load-step.active .dot { background: var(--accent); animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.error-box {
  background: rgba(224, 130, 123, 0.08); border: 1px solid rgba(224, 130, 123, 0.25);
  border-radius: 11px; padding: 12px; font-size: 12.5px; line-height: 1.5; color: #f0b6b1;
}
.error-box .mono { display: block; margin-top: 6px; font-size: 10px; opacity: 0.8; }
.retry-row { margin: 12px 0 0; }

/* loading skeleton: previews the layout that is about to render */
.skel { margin: 22px 0; }
.skel-fig { height: 118px; border-radius: 12px; }
.skel-row { height: 54px; border-radius: 12px; margin-top: 8px; }
.skel-fig, .skel-row {
  background: linear-gradient(100deg, rgba(255,255,255,.04) 40%, rgba(255,255,255,.085) 50%, rgba(255,255,255,.04) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- planting simulator ---------- */
.sim-canvas { position: absolute; pointer-events: none; transform-origin: 0 0; }
#sim {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1100;
  display: flex; align-items: center; gap: 12px;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 9px 12px 9px 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
#sim input[type="range"] { width: 240px; accent-color: var(--accent); }
.sim-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.sim-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.sim-note { font-size: 9.5px; color: var(--faint); max-width: 210px; line-height: 1.45; }
#sim .panel-close { position: static; }

/* ---------- leaflet chrome ---------- */
.leaflet-control-zoom { border: 1px solid var(--line-2) !important; border-radius: 11px !important; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,0.35) !important; }
.leaflet-control-zoom a {
  background: var(--glass) !important; color: var(--text) !important;
  border-bottom: 1px solid var(--line) !important; width: 32px !important; height: 32px !important; line-height: 32px !important;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.leaflet-control-zoom a:last-child { border-bottom: none !important; }
.leaflet-control-attribution {
  background: rgba(10, 13, 11, 0.6) !important; color: var(--muted) !important;
  font-size: 10px !important; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-container { font-family: inherit !important; }

@media (max-width: 760px) {
  .bar { left: 10px; right: 10px; top: 10px; gap: 6px; flex-wrap: wrap; }
  .brand { padding: 9px 10px; }
  .brand span { display: none; }           /* logo only; the popover still explains */
  .search { flex: 1; min-width: 130px; }
  .search input { width: 100%; padding: 9px 12px; }
  #draw-btn span, #radar-btn span, #import-btn span { display: none; } /* icon-only controls */
  #draw-btn, #import-btn, #radar-btn, #lang-btn { padding: 9px 10px; }
  #about, #langmenu { left: 10px; right: 10px; width: auto; min-width: 0; top: 106px; }

  /* panel becomes a bottom sheet */
  #panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: none; max-height: 62vh;
    border-radius: 18px 18px 0 0;
  }
  .p-head { padding: 14px var(--pad) 12px; }
  .readout { grid-template-rows: repeat(9, auto); column-gap: 0; } /* single column: two columns clip at 390px */
  .readout .rd:nth-child(6) { border-top: 1px solid var(--line); }

  /* map controls and the sim pill lift above the sheet when it is open */
  .leaflet-control-zoom { display: none; }  /* pinch zoom exists */
  body.panel-open .leaflet-bottom.leaflet-left { bottom: 62vh; }
  #sim {
    left: 10px; right: 10px; transform: none; width: auto;
    flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; border-radius: 16px;
    bottom: 10px;
  }
  body.panel-open #sim { bottom: calc(62vh + 10px); }
  #sim input[type="range"] { width: 100%; order: 5; }
  .sim-note { display: none; }
  #proj { display: none; }
  #hint { bottom: auto; top: 106px; max-width: calc(100vw - 20px); text-align: center; }

  /* first-run invitation stacks instead of squeezing */
  #intro { flex-wrap: wrap; left: 10px; right: 10px; transform: none; max-width: none; row-gap: 8px; }
  #intro .iq { flex: 1 1 100%; }
  #intro .ialt { white-space: normal; flex: 1; min-width: 0; }

  /* the sheet header stays opaque: scrolled rows must not ghost through the headline */
  .p-head { background: linear-gradient(180deg, rgba(17,22,18,.97) 0, rgba(17,22,18,.96) 70%, rgba(17,22,18,.93) 100%); }

  #site-footer { padding: 7px 10px; font-size: 10px; gap: 8px; }
  #site-footer span:first-child { font-size: 11px; }
  /* global feedback modal on phone: almost full width */
  .fb-form div[style*="max-width:420px"] { max-width: calc(100vw - 20px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  #panel, #hint { animation: none; }
  .load-step.active .dot { animation: none; }
  .skel-fig, .skel-row { animation: none; }
  .pxg i { animation: none; }
  .load-step.active .lt { animation: none; color: var(--text); background: none; }
}

/* 2040s outlook */
.nearby.warn45 { color: var(--amber); }
.d45 { color: var(--faint); font-size: .9em; }

/* Replant India footer: no Replantio branding, India-first */
#site-footer {
  transition: transform .22s ease, opacity .2s ease;
  box-shadow: 0 -8px 24px rgba(0,0,0,.25);
}
#site-footer a#footer-feedback:active { transform: scale(.97); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* feedback form polish — touch targets 44px+ */
.fb-form textarea { font-size: 14px; line-height: 1.45; }
.fb-form .chip { min-height: 44px; font-size: 13px; }
.fb-ok { padding: 10px 0; font-size: 13px; }

/* ———————————————————— */

/* ---------- report export (print to PDF) ---------- */
@media print {
  body { background: #fff; }
  .bar, #hint, #sim, .sim-canvas, #map, .panel-fade, .panel-close, .chip,
  .retry-row, .leaflet-control-container, #intro { display: none !important; }
  .disc-body[hidden] { display: block !important; }  /* the report prints everything */
  .disc .car { display: none; }
  :root {
    --text: #101510; --muted: #3d463f; --faint: #5a655c;
    --line: rgba(0, 0, 0, 0.14); --line-2: rgba(0, 0, 0, 0.28);
    --accent: #1c7c44; --amber: #8a5f1c; --water: #2f6289; --warn: #a63c35;
  }
  #panel {
    position: static; width: 100%; max-width: none; max-height: none;
    box-shadow: none; border-radius: 0; background: #fff;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    overflow: visible; animation: none;
  }
  .p-head { position: static; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .p-head::after { background: rgba(0, 0, 0, 0.2); }
  .sp, .stats, .site-fig, .readout { break-inside: avoid; }
  .sp-head:hover, .sp.open, .chip.more:hover { background: none; }
  .rtick { background: #111; box-shadow: 0 0 0 2.5px #fff; }
  svg text { fill: #333 !important; stroke: none !important; }
  .sp-photo { box-shadow: none; }
  .error-box { color: #7c2d26; }
}

/* area vertex handles + delete button */
.vhandle {
  background: #fff; border: 1.5px solid rgba(10, 14, 9, 0.85); border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); cursor: grab;
}
.vhandle:active { cursor: grabbing; }
.panel-del {
  position: absolute; top: 17px; right: 48px; width: 26px; height: 26px;
  border: 0; border-radius: 7px; background: none; color: var(--faint);
  cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.panel-del:hover { color: var(--warn); background: rgba(255, 255, 255, 0.07); }
.panel-fb {
  position: absolute; top: 17px; right: 76px; width: 26px; height: 26px;
  border: 0; border-radius: 7px; background: none; color: var(--faint);
  cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.panel-fb:hover { color: var(--accent); background: rgba(255,255,255,.07); }

/* project roll-up */
#proj {
  position: fixed; left: 16px; bottom: 178px; z-index: 900;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 8px 14px; font-size: 11px; color: var(--muted);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
#proj b { font-family: var(--mono); font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
@media print { #proj { display: none !important; } }

/* locate control */
.locate-btn {
  width: 32px; height: 32px; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 11px;
  color: var(--text); cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.locate-btn:hover { border-color: rgba(99, 201, 135, 0.45); }
#radar-btn[hidden] { display: none; }

/* about popover */
#about {
  position: fixed; top: 66px; left: 16px; z-index: 1200; width: 340px;
  background: var(--glass); border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.055), 0 20px 48px -12px rgba(0,0,0,.7);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  font-size: 12.5px; line-height: 1.65; color: var(--text);
  animation: rise2 .2s ease;
}
@keyframes rise2 { from { opacity: 0; transform: translateY(-6px); } }
#about p { margin: 0 0 10px; }
#about .about-links { margin: 0; color: var(--muted); font-size: 11.5px; }
#about a { color: var(--accent); text-decoration: none; }
#about a:hover { text-decoration: underline; }

/* toast */
#toast {
  position: fixed; bottom: 92px; left: 50%; transform: translate(-50%, 8px); z-index: 1300;
  max-width: min(420px, calc(100vw - 24px));
  background: var(--glass); border-radius: 14px; padding: 11px 16px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.055), 0 12px 40px -8px rgba(0,0,0,.7);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  font-size: 12.5px; line-height: 1.55; color: var(--text);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* radar candidate navigator */
#radarnav {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 1100;
  display: flex; align-items: center; gap: 8px;
  background: var(--glass); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 7px 10px 7px 8px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
#radarnav .rn-btn {
  width: 28px; height: 28px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.06); color: var(--text); font-size: 16px; line-height: 1;
}
#radarnav .rn-btn:hover { background: rgba(255,255,255,.12); }
#radarnav .rn-label { font-size: 11px; color: var(--muted); min-width: 90px; text-align: center; }
#radarnav .rn-go {
  border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-dim);
  color: var(--accent); font: inherit; font-size: 11.5px; padding: 5px 12px; cursor: pointer;
}
#radarnav .panel-close { position: static; }
@media (max-width: 760px) {
  #radarnav { bottom: 12px; }
  body.panel-open #radarnav { bottom: calc(62vh + 10px); }
}
