:root {
  --ground: #F6F5F0;
  --card: #FFFFFF;
  --ink: #16201C;
  --ink-2: #3D4743;
  --muted: #5A635F;
  --line: #E4E2DA;
  --line-2: #D6D3C9;
  --accent: #0E6B42;
  --accent-ink: #0B5A37;
  --accent-soft: #E2F0E7;
  --med: #9A5306;
  --med-ink: #874604;
  --med-soft: #FBEAD0;
  --long: #74263A;
  --long-soft: #F2DEE2;
  --you: #2563EB;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: 'Public Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); }
a:hover { color: #083F27; }
[hidden] { display: none !important; }

.proto-banner {
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px 16px;
}
.proto-banner a { color: #BFE5CF; }

.app { max-width: 440px; margin: 0 auto; }
.screen {
  min-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px 20px 24px;
}
.screen-form { display: flex; flex-direction: column; gap: 18px; flex-grow: 1; }

.brand-row { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.tag { font-size: 12px; font-weight: 600; color: #4A5450; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; }

.hero { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.06em; }
h1 { margin: 0; font-size: 38px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.hero p, .intro p, .done-head p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.hero p { font-size: 16px; }
.intro { display: flex; flex-direction: column; gap: 8px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card-title { font-size: 15px; font-weight: 700; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.fine { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.center { text-align: center; }
.label { font-size: 14px; font-weight: 700; }
.link-strong { font-size: 14px; font-weight: 600; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #EEECE5; }
.row:last-child { border-bottom: 0; }
.row-name { font-size: 15px; font-weight: 600; display: block; }
.row-sub { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; }
.badge.short { background: var(--accent-soft); color: var(--accent-ink); }
.badge.short::before { border-radius: 50%; background: var(--accent); }
.badge.medium { background: var(--med-soft); color: var(--med-ink); }
.badge.medium::before { border-radius: 2px; background: #C26A0A; }
.badge.long { background: var(--long-soft); color: var(--long); }
.badge.long::before { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #9C2F4A; }
.badge.stale { background: #ECEAE3; color: #4A5450; }
.badge.stale::before { border-radius: 50%; background: #A9A69C; }

.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; border-radius: 14px; border: 0;
  font: inherit; font-size: 17px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0B5A37; color: #fff; }
.btn-primary[aria-disabled="true"], .btn-primary:disabled { background: #A9B8AF; pointer-events: none; }
.btn-outline { background: #fff; color: var(--ink); border: 1px solid var(--line-2); height: 48px; font-size: 15px; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-small { height: 44px; padding: 0 16px; font-size: 15px; border-radius: 10px; flex-shrink: 0; }

.stepbar { display: flex; align-items: center; gap: 12px; }
.back { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink); }
.step { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #4A5450; }
.progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.progress i { height: 4px; border-radius: 2px; background: var(--line-2); }
.progress i.on { background: var(--accent); }

.loc-row { display: flex; align-items: center; gap: 10px; }
.loc-chip {
  flex-grow: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.loc-chip svg { flex-shrink: 0; }
#loc-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-action { margin-left: auto; color: var(--accent-ink); font-weight: 700; white-space: nowrap; }
@media (max-width: 479px) {
  .loc-chip { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; height: auto; min-height: 44px; padding: 5px 12px; text-align: left; font-size: 13px; line-height: 1.3; }
  .loc-chip svg { grid-row: span 2; }
  .chip-action { margin-left: 0; }
}

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 12px; background: #E9E7E0; flex-shrink: 0; }
.seg button { height: 38px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #4A5450; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(22,32,28,0.12); }
.seg-wide { padding: 4px; gap: 4px; }
.seg-wide button { height: 44px; font-size: 15px; }

#map-view { display: flex; flex-direction: column; gap: 12px; }
#map { height: 320px; border-radius: 16px; border: 1px solid #DAD7CC; overflow: hidden; z-index: 0; }
.focus-card { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.focus-card .grow { flex-grow: 1; min-width: 0; }
.focus-card button { height: 44px; padding: 0 16px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.focus-card .add { border: 0; background: var(--ink); color: #fff; }
.focus-card .remove { border: 1px solid var(--line-2); background: #fff; color: var(--ink); }

.pin {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px;
  border-radius: 999px; font: 800 13px 'Public Sans', system-ui, sans-serif; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(22,32,28,0.25); cursor: pointer; transform: translate(-50%, -50%);
  border: 2px solid; background: #fff;
}
.pin.short { border-color: var(--accent); color: var(--accent-ink); }
.pin.medium { border-color: var(--med); color: var(--med-ink); }
.pin.long { border-color: var(--long); color: var(--long); }
.pin.stale { border-color: #A9A69C; color: #4A5450; }
.pin.picked { color: #fff; border-color: #fff; }
.pin.picked.short { background: var(--accent); }
.pin.picked.medium { background: var(--med); }
.pin.picked.long { background: var(--long); }
.pin.picked.stale { background: #6B7570; }
.pin.focused { outline: 3px solid rgba(22,32,28,0.35); outline-offset: 1px; }
.leaflet-div-icon.pin-wrap { background: none; border: 0; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.site-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
}
.box { width: 24px; height: 24px; flex-shrink: 0; border-radius: 6px; border: 2px solid #A9A69C; background: #fff; display: flex; align-items: center; justify-content: center; color: #fff; }
.site-row[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.site-row .grow { flex-grow: 1; min-width: 0; }

.chip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 76px; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
}
.chip b { font-size: 15px; display: flex; align-items: center; gap: 6px; }
.chip span { font-size: 13px; color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: #0B3D27; }
.chip[aria-pressed="true"] span { color: #2B4A3B; }

.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.note svg { flex-shrink: 0; margin-top: 1px; }
.note p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

input[type="email"], input[type="text"], textarea {
  width: 100%; padding: 0 14px; border: 2px solid var(--line-2); border-radius: 12px;
  background: #fff; color: var(--ink); font: inherit; font-size: 16px;
}
input[type="email"] { height: 52px; }
input[type="email"]:focus, input[type="text"]:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { padding: 12px 14px; resize: vertical; min-height: 84px; }
.error { margin: 0; color: #9C2F4A; font-size: 13px; font-weight: 600; }

.summary { padding: 4px 16px; gap: 0; }
.sum-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #EEECE5; }
.sum-row:last-child { border-bottom: 0; }
.sum-row div { display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.sum-row a { font-size: 14px; font-weight: 700; }

.done-head { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 16px; }
.check-circle { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; }
.done-head h2 { font-size: 34px; }
.live { border: 2px solid var(--accent); }
.live .big { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; display: block; }
.live .meta { font-size: 14px; color: var(--ink-2); display: block; margin-top: 4px; }
.feedback .fb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 14px; background: #E9E7E0; }
.share-row .small { display: block; margin-top: 2px; }

/* Typed starting point on the sites screen */
.addr-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.addr-row { display: flex; gap: 8px; }
.addr-row input { flex: 1; min-width: 0; height: 44px; }
.addr-device { align-self: flex-start; min-height: 36px; padding: 0; border: 0; background: none; color: var(--accent-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

/* First-visit tour on the sites screen */
.tour { position: fixed; inset: 0; z-index: 2000; }
.tour-spot { position: fixed; border-radius: 16px; box-shadow: 0 0 0 200vmax rgba(22,32,28,0.62); transition: all 0.2s ease; pointer-events: none; }
.tour-card { position: fixed; width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(22,32,28,0.28); }
.tour-card h3 { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 800; }
.tour-card p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.tour-actions .btn { margin-left: auto; }
.tour-skip { height: 44px; padding: 0 4px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }

@media (min-width: 640px) {
  body { padding: 24px 0; }
  .app { background: var(--ground); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
  .screen { min-height: 820px; }
}
