:root {
  --green: #9bb59d;
  --green-light: #aed3b0;
  --accent: #58f0b1;
  --brown: #4a3d35;
  --brown-nav: #3a2f2f;
  --ink: #10251b;
  --muted-ink: #2e4e3f;
  --card: #f1f8f4;
  --surface: #fff;
  --danger: #d32f2f;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #e9eee9;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.prototype-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(430px, 1fr);
  gap: 32px;
  align-items: center;
  padding: 20px 32px;
}

.prototype-panel {
  justify-self: end;
  width: 100%;
  max-width: 300px;
  color: #233228;
}
.prototype-kicker { margin: 0 0 8px; color: #54705b; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.prototype-panel h1 { margin: 0; font-size: 28px; line-height: 1.08; }
.prototype-copy { margin: 10px 0 24px; color: #5c695f; font-size: 14px; line-height: 1.5; }
.prototype-control { margin-top: 18px; }
.prototype-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.prototype-select {
  width: 100%; padding: 12px; border: 1px solid #b7c4b9; border-radius: 12px; background: white; color: #243428;
}
.prototype-help { min-height: 36px; margin: 8px 0 0; color: #637067; font-size: 12px; line-height: 1.45; }
.screen-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.screen-link {
  border: 1px solid #c5d0c7; border-radius: 10px; padding: 9px 10px; background: rgba(255,255,255,.66); color: #33483a; text-align: left; font-size: 13px;
}
.screen-link.active { background: var(--brown); border-color: var(--brown); color: white; }
.contract-status { margin-top: 22px; padding: 12px 14px; border-radius: 12px; background: #dce9df; color: #295034; font-size: 12px; line-height: 1.45; }
.contract-status.error { background: #f8dddd; color: #7a2424; }

.phone-wrap { justify-self: start; position: relative; }
.phone {
  width: min(430px, calc(100vw - 40px));
  height: min(880px, calc(100vh - 40px));
  min-height: 640px;
  position: relative;
  overflow: hidden;
  background: white;
  border: 8px solid #1e2420;
  border-radius: 38px;
  box-shadow: 0 26px 70px rgba(32,52,38,.23), 0 5px 15px rgba(32,52,38,.15);
}
.phone::before {
  content: ""; position: absolute; z-index: 30; top: 8px; left: 50%; transform: translateX(-50%); width: 88px; height: 22px; border-radius: 20px; background: #1e2420;
}
.screen { height: 100%; overflow: hidden; background: var(--green); }
.screen-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
.screen-scroll::-webkit-scrollbar { display: none; }
.auth-screen .screen-scroll { padding-bottom: 0; }

.page-pad { padding: 20px 24px 36px; }
.top-safe { padding-top: 42px; }
.white-page { background: white; }
.green-page { background: var(--green); }
.header-bar { background: var(--green); color: white; padding: 44px 20px 24px; }
.header-bar h1 { margin: 0; font-size: 20px; }
h1.page-title { margin: 0; color: #000; font-size: 30px; line-height: 1.2; }
h2 { margin: 0; }
p { line-height: 1.45; }
.muted { color: var(--muted-ink); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.spacer-8 { height: 8px; }
.spacer-12 { height: 12px; }
.spacer-16 { height: 16px; }
.spacer-20 { height: 20px; }
.spacer-24 { height: 24px; }
.spacer-32 { height: 32px; }
.spacer-40 { height: 40px; }

.card { background: white; border-radius: 16px; padding: 16px; box-shadow: 0 3px 8px rgba(0,0,0,.12); }
.soft-card { background: var(--card); border-radius: 20px; padding: 20px; box-shadow: 0 4px 9px rgba(0,0,0,.12); }
.button { border: 0; border-radius: 12px; padding: 0 18px; min-height: 50px; font-weight: 700; background: var(--brown); color: white; }
.button.full { width: 100%; }
.button.pill { border-radius: 80px; min-height: 56px; font-size: 18px; }
.button.secondary { background: white; color: var(--ink); border: 1px solid #777; }
.button.danger { background: #e57373; }
.button:disabled { opacity: .44; cursor: default; }
.text-button { border: 0; background: transparent; color: var(--brown); font-weight: 700; padding: 10px; }
.back-button { border: 0; padding: 12px 14px; border-radius: 22px; background: rgba(255,255,255,.3); color: #000; font-weight: 600; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.gap { gap: 12px; }
.grow { flex: 1; }

.brand-image { display: block; width: 150px; height: 150px; object-fit: contain; margin: 0 auto; }
.brand-image.large { width: 180px; height: 180px; }
.brand-image.small { width: 120px; height: 120px; }
.metro-logo { display: block; width: 64px; height: 64px; object-fit: contain; margin: 0 auto; }
.auth-content { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 42px 24px 28px; }
.auth-content.signup { justify-content: flex-start; }
.auth-title { margin: 24px 0 4px; text-align: center; color: #000; font-size: 30px; }
.auth-subtitle { margin: 0 0 32px; text-align: center; color: var(--muted-ink); font-size: 14px; }
.field { position: relative; margin-bottom: 16px; }
.field label { position: absolute; top: -7px; left: 12px; padding: 0 5px; color: var(--muted-ink); background: var(--card); font-size: 12px; }
.field input, .field select, .outlined-input {
  width: 100%; min-height: 54px; border: 1.5px solid var(--brown); border-radius: 12px; padding: 13px 14px; background: transparent; color: var(--ink); outline: none;
}
.field input:focus, .field select:focus, .outlined-input:focus { box-shadow: 0 0 0 2px rgba(74,61,53,.16); }
.landing { min-height: 100%; padding: 42px 24px 36px; text-align: center; }
.landing h1 { margin: 14px 0 2px; font-size: 30px; color: #000; }
.landing h2 { margin: 0; font-size: 24px; color: #000; }
.account-link { width: 100%; border: 0; background: transparent; color: #2e7d32; font-weight: 600; font-size: 16px; padding: 2px; }

.bottom-nav {
  position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(78px + env(safe-area-inset-bottom, 0px)); padding: 0 14px max(8px, env(safe-area-inset-bottom, 0px)); background: var(--brown-nav); display: grid; grid-template-columns: 1fr 1fr 62px 1fr 1fr; align-items: center;
}
.nav-button { height: 54px; border: 0; background: transparent; color: #929292; display: grid; place-items: center; }
.nav-button.active { color: var(--accent); }
.nav-button svg { width: 25px; height: 25px; }
.fab { width: 58px; height: 58px; align-self: start; margin-top: -25px; border: 0; border-radius: 50%; background: #4e7d5a; color: white; box-shadow: 0 4px 10px rgba(0,0,0,.25); display: grid; place-items: center; }
.fab svg { width: 27px; height: 27px; }

.footprint-value { display: flex; align-items: baseline; gap: 8px; color: #000; }
.footprint-value strong { font-size: 54px; font-weight: 400; line-height: 1; }
.trend { margin-top: 18px; display: flex; gap: 8px; align-items: center; color: #000; font-size: 14px; }
.trend.good { color: #000; }
.trend svg { color: var(--accent); }
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toggle button { height: 56px; border: 0; border-radius: 20px; background: white; color: #000; }
.toggle button.active { background: var(--brown); color: white; }
.line-chart { width: 100%; height: 166px; overflow: visible; }
.chart-labels { display: flex; justify-content: space-between; color: white; font-size: 12px; }
.calendar-head { color: white; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; }
.calendar-head button { border: 0; background: transparent; color: white; font-size: 28px; }
.calendar-month { border: 0; background: transparent; color: white; font-weight: 700; padding: 10px; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.calendar-week { color: rgba(255,255,255,.65); text-align: center; font-weight: 700; margin: 12px 0 8px; }
.calendar-day { aspect-ratio: 1; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: white; display: grid; place-items: center; position: relative; }
.calendar-day.has-data::after { content: ""; position: absolute; bottom: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.calendar-day.blank { visibility: hidden; }
.month-list { max-height: 280px; overflow-y: auto; }
.month-list button { display: block; width: 100%; padding: 9px; border: 0; background: transparent; color: white; }
.month-list button.active { color: var(--accent); font-weight: 800; }
.plant-scene { position: relative; height: 300px; overflow: hidden; margin: 20px -24px -36px; }
.plant-scene::before { content:""; position:absolute; left:-10%; right:-10%; bottom:-45%; height: 90%; background: var(--green-light); border-radius: 50% 50% 0 0; transform: rotate(-2deg); }
.plant-scene img { position:absolute; z-index:1; left:50%; bottom:0; transform:translateX(-50%); height:240px; max-width:90%; object-fit:contain; }

.overview-top { padding: 42px 20px 28px; }
.overview-summary { display: grid; grid-template-columns: 180px 1fr; gap: 32px; align-items: center; margin-top: 28px; }
.donut-wrap { position: relative; width: 180px; height: 180px; display: grid; place-items: center; }
.donut { width: 170px; height: 170px; border-radius: 50%; position: relative; }
.donut::after { content:""; position:absolute; inset:26px; border-radius:50%; background:var(--green); }
.donut-center { position:absolute; z-index:2; color:#000; font-weight:700; text-align:center; }
.legend { display: grid; gap: 11px; color: white; font-size: 14px; }
.legend-row { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto; }
.overview-sheet { min-height: 430px; border-radius: 32px 32px 0 0; background: white; padding: 20px; }
.overview-sheet h2 { font-size: 24px; color: #171717; }
.mode-total { display:flex; justify-content:space-between; gap:12px; align-items:center; margin: 20px 0; font-size:18px; font-weight:700; }
.mode-name { display:flex; align-items:center; gap:10px; }

.tree-main { min-height: 100%; display:flex; flex-direction:column; align-items:center; padding: 42px 24px calc(124px + env(safe-area-inset-bottom, 0px)); }
.tree-title-row { width:100%; display:grid; grid-template-columns:80px 1fr 80px; align-items:center; text-align:center; }
.tree-title-row h1 { font-size:30px; color:#000; }
.view-all { border:0; border-radius:20px; background:rgba(255,255,255,.3); height:48px; color:#000; font-weight:700; }
.tree-image { flex:1; min-height:220px; max-height:420px; width:min(100%,380px); object-fit:contain; }
.tree-card { width:100%; border-radius:24px; background:rgba(255,255,255,.86); padding:20px; box-shadow:0 4px 10px rgba(0,0,0,.15); text-align:center; }
.tree-card h2 { font-size:22px; }
.tree-card .tree-value { margin:5px 0; font-size:34px; font-weight:800; color:#000; }
.tree-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:24px; }
.tree-stage { background:rgba(255,255,255,.95); border-radius:20px; padding:14px; text-align:center; box-shadow:0 4px 9px rgba(0,0,0,.12); }
.tree-stage img { width:90px; height:90px; object-fit:contain; }
.tree-stage strong { display:block; }
.tree-stage span { display:block; margin-top:4px; color:#777; font-size:11px; }

.content-list { padding: 20px 20px 110px; }
.status-card { background:rgba(155,181,157,.13); border-radius:16px; padding:16px; }
.status-card h3 { margin:0 0 8px; color:var(--green); }
.button-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:16px; }
.progress { height:4px; border-radius:4px; background:#ddd; overflow:hidden; }
.progress > span { display:block; height:100%; background:var(--green); }
.divider { height:1px; background:#ddd; margin:16px 0; }
.section-title { margin:0 0 8px; font-size:16px; color:var(--ink); }
.mode-option { display:flex; align-items:center; gap:8px; min-height:44px; }
.mode-option input { width:20px; height:20px; accent-color:var(--brown); }
.mode-symbol { width:25px; text-align:center; color:var(--muted-ink); }
.manual-content { padding:20px 20px 110px; }
.manual-content .outlined-input { background:#f8fcfa; }
.label-title { display:block; margin-bottom:8px; font-weight:700; }
.success { color:#477f4e; font-weight:700; text-align:center; }
.error { color:#b3261e; }

.settings { padding:42px 20px 110px; }
.settings-head { display:flex; align-items:center; gap:12px; }
.settings-head h1 { font-size:30px; color:#000; }
.settings-card { margin-top:16px; background:white; border-radius:12px; padding:16px; }
.settings-card.account { background:var(--card); border-radius:20px; padding:18px; box-shadow:0 3px 8px rgba(0,0,0,.12); user-select:none; }
.settings-card h2 { font-size:20px; margin-bottom:12px; }
.account-label { display:block; color:var(--muted-ink); font-size:13px; font-weight:700; margin-top:10px; }
.switch-row { display:flex; justify-content:space-between; align-items:center; min-height:40px; gap:10px; }
.switch { position:relative; width:48px; height:28px; flex:0 0 auto; }
.switch input { opacity:0; width:0; height:0; }
.slider { position:absolute; inset:0; background:#b8b8b8; border-radius:20px; transition:.15s; }
.slider::before { content:""; position:absolute; width:22px; height:22px; left:3px; top:3px; border-radius:50%; background:white; transition:.15s; box-shadow:0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background:var(--brown); }
.switch input:checked + .slider::before { transform:translateX(20px); }

.modal-backdrop { position:absolute; z-index:50; inset:0; display:grid; place-items:center; padding:24px; background:rgba(0,0,0,.42); }
.modal { width:100%; max-height:78%; overflow:auto; border-radius:26px; background:white; padding:24px; box-shadow:0 12px 38px rgba(0,0,0,.28); }
.modal h2 { margin-bottom:12px; color:#222; }
.modal-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.trip-row { display:flex; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid #ddd; }
.trip-row:last-child { border-bottom:0; }
.trip-row p { margin:3px 0; font-size:13px; }
.delete-button { border:0; background:transparent; color:var(--danger); padding:10px; }

.icon { width:24px; height:24px; display:inline-block; vertical-align:middle; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

@media (max-width: 820px) {
  :root { background: var(--green); }
  .prototype-shell { display:block; min-height:100vh; padding:0; }
  .prototype-panel { display:none; }
  .phone-wrap { width:100%; }
  .phone { width:100%; height:100dvh; min-height:0; border:0; border-radius:0; box-shadow:none; }
  .phone::before { display:none; }
}

@media (max-width: 390px) {
  .overview-summary { grid-template-columns:155px 1fr; gap:16px; }
  .donut-wrap { width:155px; height:155px; }
  .donut { width:150px; height:150px; }
  .page-pad { padding-left:20px; padding-right:20px; }
}


/* Compact prototype selector for phone-sized views. */
.mobile-prototype-switcher { display:none; }

@media (max-width:820px) {
  .mobile-prototype-switcher {
    position:absolute;z-index:70;top:calc(7px + env(safe-area-inset-top,0px));left:8px;right:8px;
    display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;height:40px;padding:4px;overflow:hidden;
    border:1px solid rgba(255,255,255,.18);border-radius:14px;background:rgba(17,35,27,.94);
    box-shadow:0 8px 20px rgba(8,24,17,.18);color:white;backdrop-filter:blur(14px);
  }
  .mobile-prototype-label {
    padding:0 9px 0 7px;color:rgba(255,255,255,.58);font-size:8px;font-weight:850;
    letter-spacing:.09em;text-transform:uppercase;
  }
  .mobile-prototype-track {
    display:flex;min-width:0;gap:3px;overflow-x:auto;overscroll-behavior-x:contain;
    scrollbar-width:none;scroll-snap-type:x proximity;touch-action:pan-x;
  }
  .mobile-prototype-track::-webkit-scrollbar { display:none; }
  .mobile-prototype-track button {
    flex:0 0 auto;height:32px;min-width:68px;padding:0 11px;border:0;border-radius:10px;background:transparent;
    color:rgba(255,255,255,.66);font-size:9px;font-weight:800;white-space:nowrap;scroll-snap-align:center;
  }
  .mobile-prototype-track button.active {
    background:#f4f3eb;color:#173126;box-shadow:0 3px 9px rgba(0,0,0,.16);
  }
}
