/* ===================== LoadMap styles ===================== */
:root {
  --ink: #1c2419;
  --ink-2: #3a4335;
  --muted: #6d6b5f;
  --paper: #f4efe3;
  --card: #fffdf8;
  --line: #e3d9c2;
  --wheat: #d9a441;
  --wheat-deep: #b07f22;
  --wheat-soft: #f3e3b8;
  --ok: #3f7d3a;
  --ok-soft: #e3efd9;
  --warn: #e0661b;
  --warn-soft: #fbe1cf;
  --full: #b23f2c;
  --full-soft: #f5dcd5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28,36,25,.06), 0 6px 18px rgba(28,36,25,.06);
  --head: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; letter-spacing: .02em; margin: 0; line-height: 1.05; text-transform: uppercase; }
h1 { font-size: clamp(30px, 4.6vw, 48px); }
h2 { font-size: 22px; text-transform: uppercase; letter-spacing: .06em; }
h3 { font-size: 19px; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-family: var(--head); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.site-header {
  background: var(--ink);
  color: #f4efe3;
  position: sticky; top: 0; z-index: 1000;
}
.site-header .inner {
  max-width: 1280px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand span { font-family: var(--head); font-size: 26px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.brand span b { color: var(--wheat); font-weight: 700; }
.site-nav { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.site-nav a {
  text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 8px 12px; border-radius: 10px; color: #e7e0cd;
}
.site-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-nav a.cta { background: var(--wheat); color: var(--ink); }
.site-nav a.cta:hover { background: #e6b350; }

.demo-banner {
  background: var(--wheat-soft); color: var(--ink-2); font-size: 14px; text-align: center;
  padding: 7px 16px; border-bottom: 1px solid var(--line);
}
.demo-banner b { font-weight: 700; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---------- Buttons & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s;
  min-height: 44px;
}
.btn:hover { border-color: #cbbd9b; background: #fff; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2d3a29; }
.btn.wheat { background: var(--wheat); border-color: var(--wheat); color: var(--ink); }
.btn.wheat:hover { background: #e6b350; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
label.field > span em { font-style: normal; font-weight: 400; color: var(--muted); }
.input, input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], select, textarea {
  width: 100%; border: 1px solid #d6cbb0; background: #fff; border-radius: 10px;
  padding: 10px 12px; min-height: 44px; outline: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--wheat-deep); box-shadow: 0 0 0 3px rgba(217,164,65,.25); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

/* ---------- Status pill ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em;
  background: #ece6d6; color: var(--ink-2); white-space: nowrap;
}
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.harvesting { background: var(--ok-soft); color: var(--ok); }
.pill.harvesting::before { animation: pulse 1.6s infinite; }
.pill.paused { background: var(--warn-soft); color: #9a5e0a; }
.pill.finished { background: #e4e2dc; color: #57554c; }
.pill.full { background: var(--full-soft); color: var(--full); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* ---------- Fill bar ---------- */
.fill { --c: var(--ok); }
.fill.warn { --c: var(--warn); }
.fill.full { --c: var(--full); }
.fill.overflow { --c: var(--wheat); }
.fill.overflow .fill-row .pct { color: var(--wheat-deep); }
.fill-name { color: var(--ink-2); font-weight: 700; margin-right: 2px; }
.fill + .fill { margin-top: 8px !important; }
.fill-track {
  position: relative; height: 14px; border-radius: 999px; background: #ebe4d2; overflow: hidden;
}
.fill-bar { position: absolute; inset: 0 auto 0 0; background: var(--c); border-radius: 999px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.fill-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 14px; }
.fill-row .pct { font-family: var(--head); font-weight: 700; font-size: 18px; color: var(--c); }

.fill.lg .fill-track { height: 42px; border-radius: 10px; }
.fill.lg .fill-bar { border-radius: 10px 0 0 10px; }
.fill.lg .fill-bar[style*="100%"] { border-radius: 10px; }
.fill.lg .fill-ticks { position: absolute; inset: 0; display: flex; pointer-events: none; }
.fill.lg .fill-ticks i { flex: 1; border-right: 2px solid rgba(255,253,248,.55); }
.fill.lg .fill-ticks i:last-child { border-right: 0; }
.fill.lg .fill-label {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 14px;
  font-family: var(--head); font-weight: 700; font-size: 24px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.fill.lg .fill-label.dark { color: var(--ink); text-shadow: none; }
.fill-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- Stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.tile { background: #f8f3e7; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.tile .label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tile .value { font-family: var(--head); font-weight: 700; font-size: clamp(28px, 4vw, 40px); line-height: 1.05; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: .5em; font-weight: 600; color: var(--muted); margin-left: 3px; }
.tile.accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.tile.accent .label { color: var(--wheat); }
.tile.accent .value small { color: #c9c2ad; }

.subsection { margin-top: 22px; padding-top: 18px; border-top: 1px dashed #d6cbb0; }
.subsection .card-head { margin-bottom: 12px; }
.subsection h3 { font-size: 18px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.tiles.sm { margin-bottom: 14px; }
.tiles.sm .tile { padding: 10px 12px; }
.tiles.sm .value { font-size: clamp(22px, 3vw, 28px); }
.breakdown { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.breakdown b { color: var(--ink-2); font-weight: 700; }
.bins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bin-box { background: #f8f3e7; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.bin-box h3 { margin-bottom: 10px; }
.bin-box .quick { display: flex; gap: 8px; margin-top: -4px; }
@media (max-width: 700px) { .bins-grid { grid-template-columns: 1fr; } }

/* ---------- Gauge ---------- */
.gauge { width: 100%; max-width: 360px; display: block; margin: 0 auto; }
.gauge .track { fill: none; stroke: #ebe4d2; stroke-width: 18; stroke-linecap: round; }
.gauge .value { fill: none; stroke: var(--wheat); stroke-width: 18; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1); }
.gauge .tick { stroke: var(--ink-2); stroke-width: 2; }
.gauge .tick.minor { stroke: #b6ad96; stroke-width: 1.5; }
.gauge .tick-label { font-family: var(--head); font-size: 14px; font-weight: 600; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.gauge .needle { transition: transform .9s cubic-bezier(.3,1.4,.5,1); }
.gauge .needle line { stroke: var(--full); stroke-width: 4; stroke-linecap: round; }
.gauge .hub { fill: var(--ink); }
.gauge .hub-in { fill: var(--card); }
.gauge .readout { font-family: var(--head); font-weight: 700; font-size: 44px; fill: var(--ink); text-anchor: middle; }
.gauge .unit { font-family: var(--head); font-weight: 600; font-size: 15px; fill: var(--muted); text-anchor: middle; letter-spacing: .08em; }

/* ---------- Home ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.hero p { margin: 10px 0 0; color: var(--ink-2); max-width: 560px; font-size: 17px; }
.summary { display: flex; gap: 10px; flex-wrap: wrap; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 120px; }
.summary b { display: block; font-family: var(--head); font-size: 28px; line-height: 1; }
.summary span { font-size: 13px; color: var(--muted); font-weight: 600; }

.directory { display: grid; grid-template-columns: minmax(340px, 430px) 1fr; gap: 20px; align-items: start; }
.panel { display: flex; flex-direction: column; gap: 12px; }
.search { position: relative; display: block; }
.search input { width: 100%; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.search input { padding-left: 42px; font-size: 17px; min-height: 50px; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 1200; list-style: none; margin: 0; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(28,36,25,.16);
  max-height: 360px; overflow-y: auto;
}
.suggest li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.suggest li:hover, .suggest li.on { background: #f3ecd9; }
.suggest .val { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest mark { background: var(--wheat-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.suggest .meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.suggest .tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; width: 52px; text-align: center; flex: none; }
.suggest .tag.farm { background: var(--ink); color: #fff; }
.suggest .tag.town { background: var(--ok-soft); color: var(--ok); }
.suggest .tag.grain { background: var(--wheat-soft); color: var(--wheat-deep); }
.search svg { pointer-events: none; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip {
  border: 1px solid #d6cbb0; background: var(--card); border-radius: 999px; padding: 6px 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; min-height: 36px;
}
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.filters select { width: auto; min-height: 36px; padding: 4px 10px; border-radius: 999px; font-size: 14px; margin-left: auto; }
.result-count { font-size: 14px; color: var(--muted); }

.farm-list { display: flex; flex-direction: column; gap: 10px; }
.farm-card {
  display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.farm-card:hover, .farm-card.active { border-color: var(--wheat-deep); }
.farm-card:hover { transform: translateY(-1px); }
.farm-card .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.farm-card h3 { font-size: 21px; }
.farm-card .where { font-size: 14px; color: var(--muted); margin-top: 2px; }
.farm-card .bars { margin: 12px 0 10px; }
.eta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); background: #f3ecd9; border-radius: 9px; padding: 7px 10px; margin: 0 0 10px; }
.eta svg { width: 17px; height: 17px; flex: none; color: var(--wheat-deep); }
.eta b { font-family: var(--head); font-size: 16px; font-weight: 700; }
.overview .eta { font-size: 13px; padding: 6px 8px; }
.overview .bars { margin: 10px 0; }
.overview .bars .fill { margin: 0; }
.ov-left, .ov-left b { color: var(--wheat-deep) !important; }
.overview .ov-left { display: block; font-size: 12px; font-weight: 600; }
.farm-card .facts { display: flex; gap: 16px; font-size: 14px; color: var(--ink-2); flex-wrap: wrap; align-items: center; }
.farm-card .facts b { font-family: var(--head); font-size: 19px; color: var(--ink); }
.farm-card .facts .locate { margin-left: auto; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); border: 1px dashed #d6cbb0; border-radius: var(--radius); }

.map-wrap { position: sticky; top: 76px; }
#map { height: calc(100vh - 110px); min-height: 460px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); background: #dcd5c2; }
.legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 500; background: rgba(255,253,248,.95);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; display: flex; gap: 12px; box-shadow: var(--shadow);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }

/* Map pins */
.pin { position: relative; }
.pin .dot {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c, var(--ok)); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.pin .dot b { transform: rotate(45deg); font-family: var(--head); font-size: 11px; color: #fff; font-weight: 700; }
.pin.warn { --c: var(--warn); } .pin.full { --c: var(--full); } .pin.ok { --c: var(--ok); }
.pin.active .dot { outline: 3px solid var(--wheat); outline-offset: 2px; }
.bin-pin .dot { width: 38px; height: 38px; background: var(--wheat); border-color: var(--ink); }
.bin-pin .dot svg { transform: rotate(45deg); width: 20px; height: 20px; color: var(--ink); }

/* Popup overview */
.leaflet-popup-content-wrapper { border-radius: 14px; padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: 380px !important; font-family: var(--body); }
.leaflet-container a.overview, .overview { color: var(--ink); }
.overview { display: block; text-decoration: none; color: var(--ink); padding: 14px 16px; cursor: pointer; }
.overview:hover { background: #fbf6ea; }
.overview h3 { color: var(--ink); font-size: 20px; margin-bottom: 2px; }
.overview .where { font-size: 13px; color: var(--muted); }
.overview .fill { margin: 10px 0; }
.overview .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 13px; color: var(--muted); }
.overview .facts b { display: block; font-family: var(--head); font-size: 20px; color: var(--ink); }
.overview .go {
  margin-top: 12px; background: var(--ink); color: #fff !important; text-align: center; border-radius: 9px; padding: 9px; font-weight: 700; font-size: 14px;
}

/* ---------- Farm page ---------- */
.back { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.farm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.farm-head .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; color: var(--ink-2); }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.live i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }
.live.off i { background: #aaa; animation: none; }
.stale { background: var(--warn-soft); border: 1px solid #ecc98a; color: #7a4a06; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.stats-grid .wide { grid-column: 1 / -1; }
#binMap { height: 440px; border-radius: 12px; border: 1px solid var(--line); }
.loc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.coords { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 14px; background: #f1ebdc; padding: 6px 10px; border-radius: 8px; }
.gauge-status { text-align: center; margin-top: 4px; color: var(--muted); font-size: 14px; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ci { background: #f8f3e7; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ci .cv { font-family: var(--head); font-weight: 700; font-size: 26px; line-height: 1.15; margin-top: 4px; }
.ci .cv a { text-decoration: none; }
.ci-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.contact .label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.contact dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.contact dt { font-weight: 700; color: var(--muted); font-size: 14px; }
.contact dd { margin: 0; }
.contact .phone { font-family: var(--head); font-size: 24px; font-weight: 700; text-decoration: none; }
.notes { white-space: pre-wrap; background: #f8f3e7; border-radius: 10px; padding: 10px 12px; margin-top: 4px; }

/* ---------- Auth ---------- */
.auth { max-width: 460px; margin: 30px auto; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #e9e2d0; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 700; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--card); box-shadow: var(--shadow); }
.msg { border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 15px; }
.msg.error { background: var(--full-soft); color: #7d2717; }
.msg.ok { background: var(--ok-soft); color: #2b5a27; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.dash-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-grid .wide { grid-column: 1 / -1; }
.checklist { background: var(--wheat-soft); border: 1px solid #e6cf91; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.checklist ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.checklist li { font-weight: 600; }
.checklist li.done { color: var(--ok); }
.checklist li::before { content: '○ '; }
.checklist li.done::before { content: '✓ '; }
.big-number { display: flex; align-items: baseline; gap: 8px; }
.big-number .num { font-size: 54px; font-weight: 700; line-height: 1; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.stepper .btn { font-family: var(--head); font-size: 19px; }
.set-row { display: flex; gap: 8px; }
.adjust { display: flex; gap: 8px; }
.adjust input { flex: 1; font-size: 18px; }
.adjust .btn { min-width: 96px; }
.pm { display: flex; background: #e9e2d0; border-radius: 10px; padding: 3px; gap: 3px; flex: none; }
.pm button { border: 0; background: transparent; width: 44px; border-radius: 8px; font-family: var(--head); font-size: 24px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.pm button[aria-pressed=true][data-sign="1"] { background: var(--ok); color: #fff; }
.pm button[aria-pressed=true][data-sign="-1"] { background: var(--full); color: #fff; }
.set-row input { flex: 1; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: #e9e2d0; border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 9px 4px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 42px; }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
input[type=range] { width: 100%; accent-color: var(--wheat-deep); height: 30px; }
.rate-row { display: grid; grid-template-columns: 1fr 120px; gap: 12px; align-items: center; }
#editMap { height: 380px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; cursor: crosshair; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 3000;
  transition: all .25s; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--full); }

.loading { padding: 60px 0; text-align: center; color: var(--muted); }
footer.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; border-top: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .directory { grid-template-columns: 1fr; }
  .map-wrap { position: relative; top: 0; order: -1; }
  #map { height: 55vh; min-height: 340px; }
  .stats-grid, .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 16px 14px 48px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .summary { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .summary div { min-width: 0; padding: 10px 12px; }
  .summary b { font-size: 24px; }
  .tiles .tile.accent { grid-column: 1 / -1; }
  .brand span { font-size: 22px; }
  .site-nav a { padding: 8px 8px; font-size: 14px; }
  .two { grid-template-columns: 1fr; }
  #binMap { height: 340px; }
  .seg { grid-template-columns: 1fr 1fr; }
}

.site-nav a[aria-current=page] { color: #fff; }


/* Header links: spread out, separated by borders */
.site-nav { gap: 0; }
.site-nav a { white-space: nowrap; padding: 8px 26px; border-radius: 0; border-left: 1px solid rgba(244,239,227,.18); }
.site-nav a:first-child { border-left: 0; }
.site-nav a:hover { background: transparent; color: #fff; }
.site-nav a[aria-current=page] { color: var(--wheat); }
.site-nav a.cta { margin-left: 26px; border-left: 0; border-radius: 10px; padding: 8px 18px; position: relative; }
.site-nav a.cta::before { content: ''; position: absolute; left: -27px; top: 4px; bottom: 4px; border-left: 1px solid rgba(244,239,227,.18); }
.site-nav a.cta:hover { background: #e6b350; color: var(--ink); }
@media (max-width: 760px) {
  .site-nav a { padding: 8px 12px; font-size: 14px; }
  .site-nav a.cta { margin-left: 12px; padding: 8px 12px; }
  .site-nav a.cta::before { left: -13px; }
}
@media (max-width: 420px) {
  .brand span { font-size: 19px; }
  .brand svg { width: 26px; height: 26px; }
  .site-nav a { padding: 6px 8px; font-size: 13px; }
  .site-nav a.cta { margin-left: 8px; padding: 7px 9px; }
  .site-nav a.cta::before { left: -9px; }
}

/* Header links in the logo font, all caps */
.site-nav a { font-family: var(--head); font-weight: 700; font-size: 19px; text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 760px) { .site-nav a { font-size: 16px; } }
@media (max-width: 420px) { .site-nav a { font-size: 14px; letter-spacing: .03em; } }

/* Buttons in the logo font, all caps */
.btn, .chip, .seg button, .tabs button, .overview .go, .l-live .go, .l-live > .go, .farm-card .locate {
  font-family: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.btn { font-size: 17px; }
.btn.sm { font-size: 15px; }
.chip { font-size: 15px; }
.seg button, .tabs button { font-size: 15px; }
.overview .go { font-size: 15px; }
.l-live .go, .l-live > .go { font-size: 17px; }
.stepper .btn { font-size: 20px; }

/* ---------- Vertical stacked storage bar ---------- */
.tank { --mother: #2f8f4e; --chaser: #e67e22; --header: #8e1b1b;
  display: grid; grid-template-columns: 1fr 120px 1fr; gap: 0 14px; height: 440px; margin: 6px 0 4px; }
.tank-col, .tank-labels, .tank-brackets { position: relative; height: 100%; }
.tank-seg { position: absolute; left: 0; right: 0; border: 4px solid; background: #fbf8f0; overflow: hidden; }
.tank-seg.mother { border-color: var(--mother); }
.tank-seg.chaser { border-color: var(--chaser); }
.tank-seg.header { border-color: var(--header); }
.tank-seg.first { border-radius: 0 0 10px 10px; }
.tank-seg.last { border-radius: 10px 10px 0 0; }
.tank-seg.first.last { border-radius: 10px; }
.tank-seg:not(.first) { border-bottom-width: 2px; }
.tank-seg:not(.last) { border-top-width: 2px; }
.tank-fill { position: absolute; left: 0; right: 0; bottom: 0; transition: height .8s cubic-bezier(.2,.8,.2,1); }
.tank-seg.mother .tank-fill { background: var(--mother); }
.tank-seg.chaser .tank-fill { background: var(--chaser); }
.tank-seg.header .tank-fill { background: var(--header); }
.tank-line { position: absolute; left: -8px; right: -8px; border-top: 2px dashed var(--ink); z-index: 2; pointer-events: none; }
.tank-label { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: flex-end; text-align: right; }
.tank-label b { display: block; font-family: var(--head); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; }
.tank-label span { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tank-label.mother b { color: var(--mother); }
.tank-label.chaser b { color: var(--chaser); }
.tank-label.header b { color: var(--header); }
.bracket { position: absolute; left: 4px; width: 16px; border: 3px solid var(--ink); border-left: 0; border-radius: 0 6px 6px 0; box-sizing: border-box; }
.bracket.space { margin-bottom: 3px; }
.bracket.grain { margin-top: 3px; }
.bracket::after { content: ''; position: absolute; left: 100%; top: 50%; width: 14px; border-top: 3px solid var(--ink); }
.bracket .bl { position: absolute; left: calc(100% + 20px); top: 50%; transform: translateY(-50%); white-space: nowrap; line-height: 1.15; }
.bracket .bl b { display: block; font-family: var(--head); font-size: 26px; }
.bracket .bl span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.bracket.grain .bl b { color: var(--mother); }
.mini-bin { background: #f8f3e7; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.mini-bin h3 { font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.mini-bin h3 em { font-style: normal; font-family: var(--body); font-weight: 400; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.mini-bin .quick { display: flex; gap: 8px; }
.sw { width: 14px; height: 14px; border-radius: 3px; border: 3px solid; display: inline-block; }
.sw.chaser { border-color: #e67e22; } .sw.header { border-color: #8e1b1b; } .sw.mother { border-color: #2f8f4e; }
@media (max-width: 560px) {
  .tank { grid-template-columns: 1fr 84px 1fr; gap: 0 10px; height: 380px; }
  .tank-label b { font-size: 15px; } .tank-label span { font-size: 12px; }
  .bracket .bl b { font-size: 20px; } .bracket .bl span { font-size: 12px; white-space: normal; display: block; max-width: 80px; }
  .bracket .bl { left: calc(100% + 16px); }
}

/* Harvest speed dials: one per 100 t/h */
.dials { display: flex; justify-content: center; gap: 8px; }
.dials .dial { flex: 1 1 0; max-width: 360px; min-width: 0; }
.dials.multi .dial { max-width: 260px; }
.dial-total { text-align: center; font-size: 15px; color: var(--ink-2); margin-top: 2px; }
.dial-total b { font-family: var(--head); font-size: 22px; color: var(--ink); }
#dGauge .dials .dial { max-width: 280px; }

/* ---------- Farm page: storage bar + gauge always fit on one screen ---------- */
.live-top { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; height: var(--fit-h, 560px); margin-bottom: 18px; }
.fit-card { display: flex; flex-direction: column; min-height: 0; }
.fit-card .card-head { margin-bottom: 10px; flex: none; }
.fit-body { flex: 1 1 auto; min-height: 0; }
.fit-body .tank { height: 100%; margin: 0; }
#gauge.fit-body { display: flex; flex-direction: column; }
#gauge .dials { flex: 1 1 auto; min-height: 0; align-items: center; }
#gauge .dials .dial { height: 100%; display: flex; align-items: center; justify-content: center; max-width: none; }
#gauge .dials .dial .gauge { width: 100%; height: 100%; max-width: 420px; max-height: 100%; }
#gauge .dial-total { flex: none; }
.fit-card .gauge-status { flex: none; }
@media (max-width: 960px) and (min-width: 701px) {
  .live-top { grid-template-columns: 1.2fr 1fr; }
}
@media (max-width: 700px) {
  .live-top { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .fit-card { padding: 12px 14px; }
  .fit-card .card-head { margin-bottom: 6px; }
  .fit-card .card-head h2 { font-size: 17px; }
  .hide-sm { display: none; }
  .farm-head { margin-bottom: 10px; gap: 4px; }
  .farm-head h1 { font-size: 28px; }
  .farm-head .meta { margin-top: 4px; font-size: 14px; }
  .back { margin-bottom: 6px; font-size: 14px; }
  .stale { padding: 6px 10px; font-size: 13px; margin-bottom: 10px; }
  .fit-card .gauge-status { font-size: 12px; margin-top: 0; }
  #gauge .dial-total { font-size: 13px; } #gauge .dial-total b { font-size: 17px; }
  .tank { grid-template-columns: 1fr 70px 1fr; gap: 0 10px; }
  .tank-label { line-height: 1.1; }
  .tank-label b { font-size: 13px; } .tank-label span { font-size: 11px; display: block; }
  .bracket .bl b { font-size: 18px; }
  .bracket .bl span { font-size: 11px; max-width: none; white-space: nowrap; }
  .tank-seg { border-width: 3px; }
  .farm-head .live { font-size: 13px; }
  #gauge .dials .dial .gauge { max-width: none; }
}

/* ---------- Compact vertical bar + speed dial (farm cards, map pop-ups) ---------- */
.mini-stats { display: grid; grid-template-columns: 1fr 130px; gap: 8px; align-items: center; margin: 12px 0 10px; }
.mini-tank .tank { height: 170px; grid-template-columns: 1fr 44px 1fr; gap: 0 8px; margin: 0; }
.mini-tank .tank-seg { border-width: 3px; }
.mini-tank .tank-seg.first { border-radius: 0 0 6px 6px; } .mini-tank .tank-seg.last { border-radius: 6px 6px 0 0; } .mini-tank .tank-seg.first.last { border-radius: 6px; }
.mini-tank .tank-label { line-height: 1.05; }
.mini-tank .tank-label b { font-size: 11px; letter-spacing: .03em; white-space: nowrap; }
.mini-tank .tank-label span { font-size: 10px; display: block; white-space: nowrap; }
.mini-tank .bracket { width: 9px; border-width: 2px; left: 2px; }
.mini-tank .bracket::after { width: 7px; border-top-width: 2px; }
.mini-tank .bracket .bl { left: calc(100% + 10px); }
.mini-tank .bracket .bl b { font-size: 15px; }
.mini-tank .bracket .bl span { font-size: 10px; }
.mini-speed { text-align: center; min-width: 0; }
.mini-title { font-family: var(--head); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mini-speed .dials { gap: 2px; }
.mini-speed .dials .dial { max-width: 130px; }
.mini-speed .dials.multi .dial { max-width: 64px; }
.mini-speed .dial-total { font-size: 11px; margin-top: 0; } .mini-speed .dial-total b { font-size: 14px; }
.mini-status { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dials.static .needle, .dials.static .value { transition: none; }
.overview .mini-stats { grid-template-columns: 1fr 100px; margin: 8px 0; }
.overview .mini-tank .tank { grid-template-columns: 1fr 36px 1fr; }
.overview .mini-tank .tank { height: 150px; }
.overview .mini-speed .dials .dial { max-width: 100px; }
.leaflet-popup-content { max-width: calc(100vw - 60px); }
@media (max-width: 420px) {
  .mini-stats { grid-template-columns: 1fr 108px; }
  .leaflet-popup-content { width: 300px !important; }
  .overview .mini-stats { grid-template-columns: 1fr 88px; }
  .overview .mini-tank .tank { grid-template-columns: 1fr 30px 1fr; gap: 0 6px; }
}

/* True-to-scale sections: thin bands and labels that have been nudged clear of each other */
.tank-seg.thin { border-width: 2px !important; min-height: 3px; }
.tank-label.moved::after, .tank-label::after { content: ''; width: 10px; border-top: 2px solid currentColor; margin-left: 6px; flex: none; }
.tank-label.mother { color: var(--mother); } .tank-label.chaser { color: var(--chaser); } .tank-label.header { color: var(--header); }
.tank-label span { color: var(--muted); }
.bracket.space.short .bl { top: 0; transform: none; }
.bracket.grain.short .bl { top: auto; bottom: 0; transform: none; }
.bracket.short::after { top: 50%; }

/* Full connector line from each label to its section of the bar */
.tank { --conn: 26px; }
.tank-label { padding-right: calc(var(--conn) + 4px); }
.tank-label::after { content: none !important; }
.tank-conn { position: absolute; top: 0; height: 100%; left: calc(100% - var(--conn)); width: calc(var(--conn) + var(--gap, 14px)); overflow: visible; pointer-events: none; }
.tank-conn line { stroke-width: 2; stroke-linecap: round; }
.tank-conn line.mother { stroke: var(--mother); } .tank-conn line.chaser { stroke: var(--chaser); } .tank-conn line.header { stroke: var(--header); }
.tank { --gap: 14px; }
.mini-tank .tank { --conn: 12px; --gap: 8px; }
.overview .mini-tank .tank { --gap: 8px; }
@media (max-width: 700px) { .tank { --gap: 10px; --conn: 18px; } }
@media (max-width: 420px) { .overview .mini-tank .tank { --gap: 6px; } }

/* % full shown inside the filled part of the vertical bar */
.tank-pct { position: absolute; left: 0; right: 0; transform: translateY(100%); padding-top: 4px; text-align: center;
  font-family: var(--head); font-weight: 700; font-size: 26px; line-height: 1; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); z-index: 2; pointer-events: none; }
.tank-pct.above { transform: none; padding: 0 0 4px; color: var(--ink); text-shadow: none; }
.mini-tank .tank-pct { font-size: 13px; padding-top: 2px; }
.mini-tank .tank-pct.above { padding: 0 0 2px; }
@media (max-width: 700px) { .tank-pct { font-size: 20px; } }

/* Preview-only outline map (towns) */
.vb-town { white-space: nowrap; pointer-events: none; }
.vb-town i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #6d6b5f; }
.vb-town span { position: absolute; left: 6px; top: -9px; font-size: 11px; color: #4d4b42; font-weight: 600; text-shadow: 0 0 3px #efe8d6, 0 0 3px #efe8d6; }
.vb-town.big span { font-size: 13px; font-weight: 700; color: #1c2419; }
.vb-town.big i { background: #1c2419; }

.vb-town.sat span { color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.vb-town.sat i { background: #fff; }

/* No connector lines between labels and the bar */
.tank-conn { display: none !important; }
.tank-label { padding-right: 0; }

/* % full shown in brackets beside the amount in storage */
/* % full inside the field bins section, in the logo font */
.tank-seg .tank-pct { position: absolute; left: 0; right: 0; text-align: center; z-index: 2; pointer-events: none;
  font-family: var(--head); font-weight: 700; font-size: 44px; line-height: 1; letter-spacing: .02em; padding: 0; text-shadow: none; }
.tank-seg .tank-pct.in { transform: translateY(50%); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.25); }
.tank-seg .tank-pct.out { transform: none; padding-bottom: 6px; color: var(--mother); }
.mini-tank .tank-seg .tank-pct { font-size: 17px; }
.mini-tank .tank-seg .tank-pct.out { padding-bottom: 2px; }
@media (max-width: 700px) { .fit-body .tank-seg .tank-pct { font-size: 30px; } }

/* Very short bracket (almost full or almost empty): just a single clean tick, no squashed bracket */
.bracket.tiny { border: 0; margin: 0 !important; }
.bracket.tiny::after { left: 0; width: 18px; top: 50%; transform: translateY(-50%); border-top-width: 3px; }
.bracket.tiny .bl { left: 26px; }
.bracket.space.tiny .bl { top: 0; transform: none; }
.bracket.grain.tiny .bl { top: auto; bottom: 0; transform: none; }
.mini-tank .bracket.tiny::after { width: 10px; border-top-width: 2px; }
.mini-tank .bracket.tiny .bl { left: 14px; }

/* Open-in-maps-app buttons */
.loc-actions .map-app { flex: 0 0 auto; }
@media (max-width: 560px) {
  .loc-actions .map-app { flex: 1 1 calc(50% - 5px); }
  .loc-actions .coords { flex: 1 1 100%; text-align: center; }
  .loc-actions #copyBtn { flex: 1 1 100%; }
}

/* Compact on-farm contact strip, part of the no-scroll area */
.live-top { grid-template-rows: minmax(0, 1fr) auto; }
.contact-strip { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; padding: 12px 18px; }
.qc-title { font-family: var(--head); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.qc-name { font-family: var(--head); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.qc-phone { font-family: var(--head); font-weight: 700; font-size: 24px; text-decoration: none; color: var(--ink); }
.qc-call { min-height: 36px; padding: 4px 16px; }
.qc-uhf { font-family: var(--head); font-weight: 700; font-size: 18px; background: var(--wheat-soft); color: var(--ink); padding: 3px 10px; border-radius: 8px; letter-spacing: .04em; }
@media (max-width: 700px) {
  .live-top { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .contact-strip { padding: 8px 12px; gap: 4px 12px; }
  .qc-title { width: 100%; font-size: 12px; }
  .qc-name { font-size: 17px; }
  .qc-phone { font-size: 19px; }
  .qc-uhf { font-size: 15px; margin-left: auto; }
  .qc-call { min-height: 32px; padding: 2px 12px; }
}

/* Phones: storage bar and speed gauge side by side, contact strip underneath */
@media (max-width: 700px) {
  .live-top { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px; }
  .live-top .fit-card { padding: 10px 10px 8px; }
  .live-top .fit-card .card-head { margin-bottom: 4px; }
  .live-top .fit-card .card-head h2 { font-size: 15px; letter-spacing: .04em; }
  .live-top .fit-card .card-head .muted { display: none; }
  .fit-body .tank { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); gap: 0 6px; --gap: 6px; }
  .fit-body .tank-label b { font-size: 11px; }
  .fit-body .tank-label span { font-size: 10px; }
  .fit-body .bracket { width: 10px; border-width: 2px; left: 2px; }
  .fit-body .bracket::after { width: 6px; border-top-width: 2px; }
  .fit-body .bracket .bl { left: calc(100% + 8px); }
  .fit-body .bracket .bl b { font-size: 16px; }
  .fit-body .bracket .bl span { font-size: 10px; }
  .fit-body .bracket.tiny::after { width: 10px; }
  .fit-body .bracket.tiny .bl { left: 14px; }
  .fit-body .tank-seg .tank-pct { font-size: 20px; }
  .fit-body .tank-seg { border-width: 2px; }
  #gauge .dials { flex-direction: column; gap: 0; }
  #gauge .dials .dial { width: 100%; }
  .live-top .gauge-status { font-size: 11px; line-height: 1.3; }
}

/* Grain being harvested + delivery destination, shown with the storage bar */
.cargo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -2px 0 10px; }
.cargo-grain { font-family: var(--head); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .05em;
  background: var(--ink); color: var(--wheat); padding: 3px 12px; border-radius: 8px; }
.cargo-dest { font-family: var(--head); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink); }
.cargo-arrow { font-family: var(--body); font-weight: 600; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--muted); margin-right: 2px; }
.cargo.compact { margin: 10px 0 -4px; gap: 4px 8px; }
.cargo.compact .cargo-grain { font-size: 13px; padding: 2px 8px; border-radius: 6px; }
.cargo.compact .cargo-dest { font-size: 13px; }
.cargo.compact .cargo-arrow { font-size: 11px; }
.overview .cargo.compact { margin: 8px 0 -2px; }
.suggest .tag.delivery { background: #e6ecf3; color: #2c4260; }
@media (max-width: 700px) {
  .fit-card .cargo { margin: 0 0 6px; gap: 3px 6px; }
  .fit-card .cargo-grain { font-size: 13px; padding: 2px 8px; }
  .fit-card .cargo-dest { font-size: 13px; }
  .fit-card .cargo-arrow { font-size: 10px; }
}

/* "Updated … ago" coloured by freshness: green < 30 min, orange 30 min–2 h, red > 2 h */
.updated { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.updated i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.updated.fresh { color: var(--ok); background: var(--ok-soft); }
.updated.fresh i { animation: pulse 1.6s infinite; }
.updated.aging { color: #b5500f; background: var(--warn-soft); }
.updated.old { color: var(--full); background: var(--full-soft); }
.farm-card .updated, .overview .updated { font-size: 12px; padding: 2px 8px; }
.pop-updated { margin: -2px 0 10px; }

/* Dashboard: grain figure beside a small vertical bar */
.dash-storage { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 6px; }
.dash-storage .mini-tank .tank { height: 160px; }
@media (max-width: 420px) { .dash-storage { grid-template-columns: 1fr; } }

/* Two locations */
.loc-tag { font-family: var(--head); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.loc-name { font-family: var(--head); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 -6px; }
.overview .loc-name { margin: 8px 0 -4px; }
.loc2-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.loc2-tank .tank { height: 340px; margin: 0; }
#loc2Map { height: 340px; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 700px) {
  .loc2-grid { grid-template-columns: 1fr; }
  .loc2-tank .tank { height: 280px; }
  #loc2Map { height: 260px; }
}

.seg.two-seg { grid-template-columns: 1fr 1fr; }
#loc2EditMap { height: 320px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 12px; cursor: crosshair; }

/* Keep the % inside the bar: the number shrinks to fit the bar's width (cqw = % of bar width) */
.tank-seg { container-type: inline-size; }
.tank-seg .tank-pct { font-size: min(44px, 36cqw); letter-spacing: 0; white-space: nowrap; }
.mini-tank .tank-seg .tank-pct { font-size: min(17px, 36cqw); }
@media (max-width: 700px) {
  .fit-body .tank-seg .tank-pct { font-size: min(20px, 36cqw); }
}

/* Other bins: the farmer's own name for that location under the heading */
.loc2-name { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: .03em; text-transform: uppercase; color: var(--mother); margin-top: 2px; }

/* ---- Farmer app ---- */
.app-hero { display: flex; align-items: center; gap: 12px; }
.app-hero-icon { display: none; }
.in-app .app-hero-icon { display: block; }
.app-hero-icon img { width: 44px; height: 44px; border-radius: 11px; display: block; }
.in-app .web-only { display: none !important; }
.in-app .site-header { padding-top: env(safe-area-inset-top); }
.in-app body { padding-bottom: env(safe-area-inset-bottom); }
.in-app .site-footer { display: none; }
.get-app { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; background: var(--card, #fffdf7);
  border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; }
.get-app:hover { border-color: #d9a441; }
.get-app img { width: 46px; height: 46px; border-radius: 11px; flex: none; }
.get-app .go { margin-left: auto; font-size: 20px; color: #b7862a; }

/* Get the app page: one big button */
.ga { max-width: 620px; padding-top: 28px; padding-bottom: 40px; }
.ga-card { background: var(--card, #fffdf7); border: 1px solid var(--line); border-radius: 20px; padding: 32px 26px; text-align: center; margin-bottom: 16px; }
.ga-appicon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 8px 24px rgba(28,36,25,.2); display: block; margin: 0 auto 18px; }
.ga-card h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.05; margin: 0 0 10px; }
.ga-sub { color: var(--muted); font-size: 17px; margin: 0 auto 22px; max-width: 440px; }
.ga-big { width: 100%; max-width: 420px; min-height: 64px; font-size: 22px !important; border-radius: 14px; }
.ga-done { background: #e5f2e7; color: #1f6b34; border-radius: 14px; padding: 18px; font-size: 17px; font-weight: 600; }
.ga-works { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.ga-qr { display: flex; gap: 22px; align-items: center; text-align: left; }
.ga-qr.hidden { display: none; }
.ga-qr .qr { width: 150px; flex: none; background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--line); }
.ga-qr .qr svg { width: 100%; height: auto; display: block; }
.ga-qr h2 { margin: 0 0 6px; }
.ga-qr p { margin: 0; color: var(--muted); }
.ga-help { background: transparent; border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.ga-help summary { cursor: pointer; font-family: var(--head); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ga-help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 12px; font-size: 14px; }
.ga-help-grid ol { margin: 6px 0 0; padding-left: 18px; }
.ga-sheet { position: fixed; inset: 0; background: rgba(20,26,18,.55); z-index: 3000; display: flex; align-items: flex-end; justify-content: center; }
.ga-sheet.hidden { display: none; }
.ga-sheet-box { position: relative; background: #fffdf7; width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 26px 22px calc(22px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .ga-sheet { align-items: center; } .ga-sheet-box { border-radius: 22px; } }
.ga-sheet h2 { margin: 0 0 14px; }
.ga-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.ga-steps2 { list-style: none; counter-reset: s; padding: 0; margin: 0 0 18px; }
.ga-steps2 li { counter-increment: s; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); font-size: 17px; }
.ga-steps2 li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: #d9a441; color: #1c2419;
  font-family: var(--head); font-weight: 700; display: grid; place-items: center; }
.ga-steps2 li > span { flex: 1; min-width: 0; }
.ga-steps2 .ico { width: 24px; height: 24px; color: #1a73e8; vertical-align: -6px; margin: 0 2px; }
.ga-sheet.top { align-items: flex-start; }
.ga-sheet.top .ga-sheet-box { border-radius: 0 0 22px 22px; padding-top: calc(26px + env(safe-area-inset-top)); }
.ga-pointer { position: fixed; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 44px; color: #fff; font-weight: 700;
  animation: gaBounce 1s ease-in-out infinite; text-shadow: 0 2px 6px rgba(0,0,0,.4); pointer-events: none; }
@keyframes gaBounce { 50% { transform: translate(-50%, 8px); } }
.ga-pointer.hidden { display: none; }
@media (max-width: 700px) { .ga-help-grid { grid-template-columns: 1fr; } .ga-qr { flex-direction: column; text-align: center; } .ga-card { padding: 26px 18px; } }

/* "Get the app" bar on the dashboard (website on a phone only) */
.app-bar { display: flex; align-items: center; gap: 12px; background: #1c2419; color: #fff; border-radius: 14px; padding: 10px 12px; margin: 0 0 14px; }
.app-bar img { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.app-bar .txt { flex: 1; line-height: 1.25; font-size: 14px; } .app-bar .txt b { font-family: var(--head); letter-spacing: .03em; text-transform: uppercase; font-size: 15px; }
.app-bar .btn { min-height: 38px; padding: 4px 16px; }
.app-bar .x { background: none; border: 0; color: #fff; opacity: .6; font-size: 22px; cursor: pointer; padding: 0 2px; }
.site-nav a.cta[aria-current=page] { color: #1c2419; }

/* "Check your email" panel on the farmer login */
.checkmail { text-align: center; }
.checkmail .cm-icon { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 18px; background: #f3e6c4; color: #1c2419; display: grid; place-items: center; }
.checkmail .cm-icon svg { width: 34px; height: 34px; }
.checkmail h3 { margin: 0 0 8px; }
.checkmail p { margin: 0 0 12px; }
