/* SNARE prototype styles.
   Look: bright colour bands with heavy centred headlines, uppercase tracked
   buttons in near black, clean white cards. Brand palette from the deck. */

:root {
  --forest: #004230;
  --lime: #A2DC5D;
  --soft: #EAF6DC;
  --accent: #BBD004;
  --ink: #1F1E1E;
  --muted: #5B6660;
  --line: #E3EADD;
  --bg: #F7F9F4;
  --card: #FFFFFF;
  --warn: #9A4A12;
  --warn-bg: #FDF1E6;
  --radius: 16px;
  --band: radial-gradient(130% 95% at 50% 100%, #EEF9E0 0%, #C3EA8E 38%, #A2DC5D 70%, #8FD047 100%);
  --shadow: 0 1px 2px rgba(31, 30, 30, 0.04), 0 6px 18px rgba(0, 66, 48, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  color: var(--ink);
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body { background: var(--bg); overflow: hidden; }

button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ---------- Phone shell ---------- */

.device { height: 100%; }
.phone {
  position: relative;
  height: 100%;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.viewport { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.status, .pitch, .expand-toggle { display: none; }

.bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.back {
  border: 1.5px solid var(--ink);
  background: #fff;
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  padding: 0 0 2px;
}
.brand {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.brand .dot, .pitch-brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.demo-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--ink);
}

.screen { padding: 20px 16px 40px; animation: rise 0.35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Type and bands ---------- */

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.75;
}

.band {
  margin: -20px -16px 18px;
  padding: 30px 22px 28px;
  background: var(--band);
  text-align: center;
}
.band h1 {
  font-size: 30px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 8px;
}
.band p { margin: 10px auto 0; max-width: 340px; font-size: 13.5px; color: var(--forest); }
.band .btn { margin-top: 16px; }

.band.hero { padding: 40px 22px 14px; }
.band.hero h1 { font-size: 40px; line-height: 1.02; margin-top: 10px; }
.band.hero .btn { margin-top: 22px; }
.band.hero p { margin-top: 18px; font-size: 14px; }
.hero-art { display: block; width: 100%; max-width: 320px; margin: 14px auto 0; }

.hl { position: relative; z-index: 0; white-space: nowrap; }
.hl::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: -0.28em;
  top: 50%;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.section-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 28px 0 10px; }
.section-sub { color: var(--muted); font-size: 13px; margin: -4px 0 12px; }
.footnote { margin-top: 28px; font-size: 11.5px; color: var(--muted); text-align: center; }
.empty-note { font-size: 13px; color: var(--muted); padding: 4px 2px 8px; }
.hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: #fff;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.outline { background: transparent; color: var(--ink); }
.btn.outline:hover { background: var(--ink); color: #fff; }
.btn.small { padding: 8px 13px; font-size: 11px; letter-spacing: 0.12em; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.added { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.link { border: 0; background: none; color: var(--ink); font-weight: 700; text-decoration: underline; padding: 4px 0; font-size: 13px; }

.chip {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
}
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Home ---------- */

.glance { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.glance-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.glance-card:hover { transform: translateY(-2px); }
.glance-card .icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--soft);
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.glance-card svg, .tabs svg, .bell svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.glance-card svg { width: 21px; height: 21px; color: var(--forest); }
.glance-card b { font-size: 15px; font-weight: 700; }
.glance-card span:last-child { font-size: 12px; color: var(--muted); }

.how { display: grid; gap: 8px; }
.how div {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.how b {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ---------- Plan form ---------- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card h2 small { font-weight: 600; color: var(--forest); font-size: 11px; letter-spacing: 0.08em; }

.search { position: relative; }
.search input, .field {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  background: #fff;
  outline: none;
}
.search input:focus, .field:focus { border-color: var(--ink); }
.suggest { display: grid; gap: 4px; margin-top: 6px; }
.suggest:empty { display: none; }
.suggest button { text-align: left; border: 0; background: var(--soft); padding: 9px 12px; border-radius: 10px; font-weight: 600; }
.suggest button span { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.suggest .none { font-size: 13px; color: var(--muted); padding: 6px 2px; }

.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.quick.muted { opacity: 0.4; pointer-events: none; }

.items { list-style: none; padding: 0; margin: 10px 0 0; }
.items li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.items li div:first-child strong { display: block; font-size: 14px; font-weight: 600; }
.items li div:first-child span { font-size: 12px; color: var(--muted); }
.items li.empty { color: var(--muted); font-size: 13px; justify-content: center; border: 0; padding: 14px 0 4px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--ink); background: #fff; font-weight: 700; line-height: 1; }
.qty b { min-width: 16px; text-align: center; }

.row { display: flex; gap: 8px; align-items: center; }
.row .field { flex: 1; }
.locate { white-space: nowrap; }

.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 9px 6px; font-weight: 600; font-size: 13px; color: var(--forest); }
.seg button.on { background: var(--ink); color: #fff; }

.dial { display: flex; align-items: center; gap: 12px; }
input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--forest) var(--fill, 50%), var(--soft) var(--fill, 50%));
  outline: none;
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--lime); border: 4px solid var(--ink); cursor: grab; }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--lime); border: 4px solid var(--ink); cursor: grab; }
.unit-input { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }
.unit-input:focus-within { border-color: var(--ink); }
.unit-input input { width: 64px; border: 0; outline: none; padding: 9px 0; font-weight: 700; text-align: right; background: transparent; }
.unit-input span { font-size: 13px; color: var(--muted); margin-left: 4px; }
.range-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin: 6px 108px 0 0; }
.range-labels + .card-note { margin: 8px 0 0; }

.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--soft); border-radius: 14px; padding: 8px; margin-bottom: 10px; }
.stepper button { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--ink); color: #fff; font-size: 22px; font-weight: 700; line-height: 1; }
.stepper button:disabled { opacity: 0.25; cursor: not-allowed; }
.stepper div { text-align: center; }
.stepper b { display: block; font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stepper span { font-size: 12px; color: var(--muted); }

.money-input { position: relative; }
.money-input span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 600; color: var(--muted); }
.money-input .field { padding-left: 28px; }

.sticky {
  position: sticky;
  bottom: 0;
  margin: 8px -16px -40px;
  padding: 14px 16px 16px;
  background: linear-gradient(to top, var(--bg) 72%, rgba(247, 249, 244, 0));
  z-index: 900;
}

.src {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--forest);
  margin: 0 6px 0 0;
  vertical-align: 1px;
}
.items strong .src { margin: 0 0 0 8px; }
.card-note { font-size: 12.5px; color: var(--muted); margin: -4px 0 4px; }
.extras .items li:first-child { border-top: 0; }
.banner.changed { margin: 0 0 12px; }

/* ---------- Loading ---------- */

.loading { animation: rise 0.3s ease both; }
.scan-map { height: 340px; position: relative; background: var(--soft); }
.scan-map::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  background: linear-gradient(to top, var(--bg), rgba(247, 249, 244, 0));
  z-index: 500;
  pointer-events: none;
}
.scan-chip {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.scan-chip b { color: var(--lime); font-variant-numeric: tabular-nums; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); margin-right: 6px; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.scan-pin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--ink);
  display: grid;
  place-items: center;
  animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both;
  transition: background 0.25s;
}
.scan-pin svg { width: 15px; height: 15px; fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.4); transition: all 0.25s; }
.scan-pin.checked { background: var(--lime); }
.scan-pin.checked svg { opacity: 1; transform: none; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.loading-copy { padding: 4px 24px 30px; }
.loading h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 14px; }
.progress { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-bottom: 16px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--forest), var(--lime)); border-radius: 99px; animation: fill linear forwards; }
@keyframes fill { to { width: 100%; } }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { padding: 7px 0 7px 32px; position: relative; color: var(--muted); font-size: 14px; transition: color 0.25s; }
.steps li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  transition: all 0.25s;
}
.steps li.done { color: var(--ink); font-weight: 500; }
.steps li.done::before { background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%231F1E1E' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; border-color: var(--lime); }

/* ---------- Results ---------- */

.banner { border-radius: var(--radius); padding: 14px 16px; margin-top: 4px; font-size: 13.5px; }
.banner strong { display: block; font-size: 15px; margin-bottom: 4px; }
.banner.ok { background: var(--soft); color: var(--forest); }
.banner.over { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: #fff; border: 1.5px dashed var(--line); color: var(--muted); margin-bottom: 8px; }
.banner .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.banner.over .btn { background: #fff; color: var(--warn); border-color: currentColor; }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.opt {
  text-align: left;
  border: 1.5px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.opt:hover { transform: translateY(-2px); }
.opt.on { border-color: var(--ink); background: var(--soft); box-shadow: 0 0 0 1.5px var(--ink) inset; }
.opt-label { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); }
.opt-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--soft); }
.opt.on .opt-icon { background: var(--ink); }
.opt-icon svg { width: 14px; height: 14px; fill: none; stroke: var(--forest); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.opt.on .opt-icon svg { stroke: var(--lime); }
.opt-total { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; }
.opt-meta { font-size: 12px; color: var(--muted); }
.pill { margin-top: 6px; align-self: flex-start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.pill.ok { background: var(--lime); color: var(--ink); }
.pill.over { background: var(--warn-bg); color: var(--warn); }
.pill.idle { background: var(--soft); color: var(--forest); }
.tradeoff { margin-top: 10px; font-size: 13.5px; color: var(--forest); font-weight: 600; }

.map-wrap { position: relative; margin-top: 16px; }
.map { height: 300px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #EEF3EA; box-shadow: var(--shadow); }
.map .fallback { padding: 20px; font-size: 13px; color: var(--muted); }
.map-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  background: var(--ink);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 8px;
}
.map-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.leaflet-container { font-family: 'Poppins', system-ui, sans-serif; background: #EEF3EA; }
.leaflet-control-attribution { font-size: 9px; }
/* Tint the grey basemap toward the brand greens */
.leaflet-tile-pane { filter: sepia(0.2) hue-rotate(45deg) saturate(1.5) brightness(1.02); }
.map-label {
  background: var(--ink);
  color: #fff;
  border: 0;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}
.leaflet-tooltip-top.map-label::before { border-top-color: var(--ink); }
.route-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s 0.5s ease-in-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.pin {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.pin.home { background: var(--forest); color: #fff; position: relative; }
.pin.store { background: var(--lime); color: var(--ink); }
.pin.help { background: var(--accent); color: var(--ink); }
.pin.pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid var(--forest);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.2); opacity: 0; } }
.pin.drop { animation: drop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes drop { from { transform: translateY(-22px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 11.5px; color: var(--muted); }

.nav-out {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.nav-out > span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.nav-out div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.stop { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 10px; overflow: hidden; box-shadow: var(--shadow); }
.stop-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.stop-head .pin { flex: none; border-color: var(--soft); box-shadow: none; }
.stop-head strong { display: block; font-size: 15px; }
.stop-head span { font-size: 12px; color: var(--muted); }
.stop-head .sub { margin-left: auto; font-weight: 800; }
.lines { list-style: none; margin: 0; padding: 0 14px 8px; }
.lines li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.lines li em { font-style: normal; color: var(--muted); font-size: 12px; }
.line-end { display: inline-flex; align-items: center; gap: 8px; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: var(--ink); margin-left: 6px; vertical-align: 1px; }
.tag.rescue { background: var(--forest); color: var(--lime); }
.bell { border: 0; background: none; padding: 2px; color: #A9B8AF; width: 24px; height: 24px; }
.bell svg { width: 18px; height: 18px; }
.bell:hover, .bell.on { color: var(--ink); }
.bell.on svg { fill: var(--accent); }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
}
.total-row b { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--lime); }
.total-row span { font-size: 11.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #CFCFCF; }
.log { margin-top: 10px; background: var(--lime); border-color: var(--lime); color: var(--ink); }

.swap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  margin-bottom: 8px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
}
.swap div { flex: 1; min-width: 0; }
.swap strong { display: block; }
.swap span { font-size: 12px; color: var(--muted); }
.swap .save { font-weight: 800; color: var(--forest); white-space: nowrap; }

.offer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.offer.hit { border-color: var(--lime); box-shadow: 0 0 0 1.5px var(--lime) inset, var(--shadow); }
.offer-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.offer .kind { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; background: var(--soft); color: var(--forest); margin-bottom: 8px; }
.offer h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.offer p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.offer .price { text-align: right; white-space: nowrap; }
.offer .price b { display: block; font-size: 20px; font-weight: 800; color: var(--forest); letter-spacing: -0.02em; }
.offer .price s { font-size: 12px; color: var(--muted); }
.offer dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 10px 0 0; font-size: 12.5px; }
.offer dt { color: var(--muted); }
.offer dd { margin: 0; font-weight: 500; }
.offer-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.offer-foot small { font-size: 11.5px; color: var(--muted); }

/* ---------- Alerts ---------- */

.alert-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.alert-row > div:first-child { flex: 1; min-width: 0; }
.alert-row strong { display: block; font-size: 14px; }
.alert-row > div:first-child span { font-size: 12px; color: var(--muted); }
.alert-target { text-align: right; }
.alert-target small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.alert-target b { font-size: 14px; }
.alert-row .pill { margin: 0; }
.remove { border: 0; background: none; font-size: 20px; color: var(--muted); padding: 0 2px; line-height: 1; }
.alert-form { display: grid; gap: 8px; margin-top: 12px; }
.alert-form .money-input { flex: 1; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; border: 0; background: none; padding: 0; text-align: left; }
.switch-row strong { display: block; font-size: 14.5px; }
.switch-row span span { font-size: 12px; color: var(--muted); }
.switch { flex: none; width: 46px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(20px); background: var(--lime); }

/* ---------- Impact ---------- */

.history { list-style: none; padding: 0; margin: 0 0 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; }
.history strong { display: block; font-size: 14px; }
.history span { font-size: 12px; color: var(--muted); }
.history b { color: var(--forest); font-weight: 800; }

/* ---------- Community ---------- */

.community .seg { margin-bottom: 16px; }
.joined-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.joined-row::-webkit-scrollbar { display: none; }
.joined-row .chip { white-space: nowrap; }
.live-title { display: flex; align-items: center; gap: 2px; }
.live-title .live { background: #E0472B; }

.group-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.group-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: left; }
.group-main strong { display: block; font-size: 14.5px; }
.group-main span span { font-size: 12px; color: var(--muted); }
.group-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); }
.group-icon.interest { background: var(--ink); }
.group-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--forest); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.group-icon.interest svg { stroke: var(--lime); }

.post {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.post.fresh { animation: arrive 0.6s ease both; border-color: var(--lime); }
@keyframes arrive { from { opacity: 0; transform: translateY(-12px) scale(0.98); } to { opacity: 1; transform: none; } }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head > div { flex: 1; min-width: 0; }
.post-head strong { display: block; font-size: 14px; }
.post-head > div span { font-size: 11.5px; color: var(--muted); }
.post-place .kind { margin-left: auto;  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; border: 1.5px solid var(--line); color: var(--muted); white-space: nowrap; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.post-text { margin: 10px 0 0; font-size: 14.5px; line-height: 1.5; }
.post-photo { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 12px; margin-top: 10px; }
.post-place { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--forest); font-weight: 500; }
.post-place svg, .loc-line svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.post-actions { display: flex; gap: 6px; margin: 12px 0 10px; }
.vote {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}
.vote svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.vote b { font-weight: 800; }
.vote:hover { border-color: var(--ink); }
.vote.on { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.vote.gone.on { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }

.comments { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.comment { display: flex; gap: 10px; font-size: 13px; }
.comment .avatar { width: 28px; height: 28px; font-size: 10px; }
.comment strong { font-size: 13px; }
.comment span { font-size: 11px; color: var(--muted); }
.comment p { margin: 2px 0 0; }

.composer { display: grid; gap: 8px; }
.composer h2 { margin-bottom: 2px; }
textarea.field { resize: vertical; min-height: 76px; line-height: 1.45; }
.composer-row { display: flex; gap: 6px; flex-wrap: wrap; }
.composer-row .btn:last-child { margin-left: auto; }
.loc-line { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.photo-preview { position: relative; }
.photo-preview img { display: block; width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
.photo-preview .remove { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(31, 30, 30, 0.75); color: #fff; }

.pin.tip { background: #fff; color: var(--ink); border: 2.5px dashed var(--ink); }

/* ---------- Tabs and toast ---------- */

.tabs {
  flex: none;
  height: 64px;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  flex: 1;
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8A958F;
  position: relative;
}
.tabs svg { width: 22px; height: 22px; }
.tabs button.on { color: var(--ink); }
.tabs button.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--lime); }
.tabs i {
  position: absolute;
  top: 7px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--lime);
  font-style: normal;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 18px;
  letter-spacing: 0;
}

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 90px;
  transform: translateY(20px);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1100;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- Wide screens: phone mockup on a branded backdrop ---------- */

@media (min-width: 760px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 72px;
    background:
      radial-gradient(circle at 12% 18%, rgba(187, 208, 4, 0.35) 0, rgba(187, 208, 4, 0) 32%),
      radial-gradient(circle at 88% 85%, rgba(162, 220, 93, 0.28) 0, rgba(162, 220, 93, 0) 36%),
      linear-gradient(135deg, #00513B 0%, #003325 100%);
  }
  .device {
    height: auto;
    padding: 11px;
    border-radius: 58px;
    background: #0C1813;
    box-shadow: 0 0 0 2px #2B3B33, 0 40px 80px rgba(0, 0, 0, 0.45);
  }
  .phone { width: 390px; height: min(844px, calc(100vh - 56px)); border-radius: 47px; }
  .status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px;
    padding: 4px 30px 0 34px;
    background: #fff;
    color: var(--ink);
    font-size: 15px;
    flex: none;
  }
  .status b { font-weight: 600; }
  .status .island { width: 112px; height: 30px; border-radius: 20px; background: #0C1813; }
  .status-icons { display: flex; gap: 6px; align-items: center; fill: currentColor; }
  .viewport { scrollbar-width: none; }
  .viewport::-webkit-scrollbar { display: none; }
  .tabs { height: 78px; padding-bottom: 14px; }

  .expand-toggle {
    position: fixed;
    top: 20px;
    right: 22px;
    z-index: 2000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
  }
  .expand-toggle:hover { background: #fff; color: var(--ink); }
  .expand-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
}

@media (min-width: 1100px) {
  .pitch { display: block; max-width: 420px; color: #fff; }
  .pitch-brand { display: flex; align-items: baseline; gap: 3px; font-weight: 800; font-size: 34px; letter-spacing: -0.04em; }
  .pitch-brand .dot { width: 12px; height: 12px; }
  .pitch h2 { font-size: 50px; line-height: 1.04; font-weight: 800; letter-spacing: -0.03em; margin: 22px 0 18px; }
  .pitch p { font-size: 17px; color: #CFE5C4; }
  .sdgs { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 30px; }
  .sdgs span { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 14px; border-radius: 10px; color: var(--lime); border: 1.5px solid rgba(162, 220, 93, 0.5); }
  .pitch small { font-size: 12.5px; color: #8FB6A3; }
}

/* ---------- Expanded view: the app fills the screen ---------- */

@media (min-width: 760px) {
  body.expanded { padding: 22px; }
  body.expanded .pitch { display: none; }
  body.expanded .device { width: calc(100vw - 44px); max-width: 1440px; height: calc(100vh - 44px); border-radius: 34px; padding: 9px; }
  body.expanded .phone { width: 100%; max-width: none; height: 100%; border-radius: 26px; }
  body.expanded .status { display: none; }
  body.expanded .bar { padding: 14px 28px; }
  body.expanded .expand-toggle { top: 42px; right: 46px; border-color: var(--ink); color: var(--ink); background: #fff; }
  body.expanded .expand-toggle:hover { background: var(--ink); color: #fff; }
  body.expanded .demo-tag { margin-right: 160px; }

  body.expanded .screen { max-width: 1120px; margin: 0 auto; padding: 24px 32px 48px; }
  body.expanded .band { margin: 0 0 24px; border-radius: 28px; padding: 44px 32px 40px; }
  body.expanded .band h1 { font-size: 46px; }
  body.expanded .band p { max-width: 640px; font-size: 15px; }
  body.expanded .band.hero { padding: 64px 32px 24px; }
  body.expanded .band.hero h1 { font-size: 72px; max-width: 900px; margin-left: auto; margin-right: auto; }
  body.expanded .hero-art { max-width: 520px; }
  body.expanded .how { grid-template-columns: repeat(3, 1fr); }

  /* Plan: list on the left, settings on the right */
  body.expanded .plan { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  body.expanded .plan > .band, body.expanded .plan > .sticky { grid-column: 1 / -1; }
  body.expanded .plan > .band { margin-bottom: 8px; }
  body.expanded .plan > .card { margin: 0; grid-column: 2; }
  body.expanded .plan > .card.list-card { grid-column: 1; grid-row: span 5; }
  body.expanded .plan > .banner { grid-column: 1 / -1; }
  body.expanded .plan > .card.extras { grid-column: 1; }
  body.expanded .sticky { margin: 8px 0 -48px; padding: 16px 0 24px; }
  body.expanded .sticky .btn { max-width: 420px; margin: 0 auto; display: flex; }

  /* Results: details on the left, map pinned on the right */
  body.expanded .results-grid { display: grid; grid-template-columns: minmax(0, 1fr) 460px; grid-template-areas: "top map" "bottom map"; gap: 0 28px; align-items: start; }
  body.expanded .col-top { grid-area: top; }
  body.expanded .col-bottom { grid-area: bottom; }
  body.expanded .col-map { grid-area: map; position: sticky; top: 84px; }
  body.expanded .col-map .map-wrap { margin-top: 0; }
  body.expanded .map { height: 440px; }

  body.expanded .scan-map { height: 52vh; }
  body.expanded .community > :not(.band) { max-width: 760px; margin-left: auto; margin-right: auto; }
  body.expanded .tabs button { flex: 0 0 150px; }
  body.expanded .loading-copy { max-width: 560px; margin: 0 auto; }

  body.expanded .tabs { height: 66px; padding-bottom: 0; justify-content: center; }
  body.expanded .tabs button { flex: 0 0 170px; }
  body.expanded .toast { left: 50%; right: auto; width: 420px; transform: translate(-50%, 20px); }
  body.expanded .toast.show { transform: translate(-50%, 0); }
}
