/* ============================================================
   AgroAI — interactive field map
   Dark, earthy "precision monitoring instrument" theme.
   Visual layer only — no IDs/classes the app logic relies on
   are renamed (.armed, .spin,
   .status.info/ok/error, .sw, .sar-overlay all preserved).
   Design tokens (palette/type/spacing/shadows) live in tokens.css,
   which this page loads first.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* The page now scrolls: analysis up top, the 7-day forecast below it. */
  min-height: 100%;
}
/* The Leaflet map fills its framed container in the dashboard grid. */
#map { position: absolute; inset: 0; z-index: 0; background: var(--bg); }

/* Ambient aurora — a slow drifting colour wash, FIXED behind the page so it
   stays put as the document scrolls (above the bg, below all content). */
body::before {
  content: ""; position: fixed; inset: -10%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 38% at 82% 6%, rgba(46, 125, 50, 0.14), transparent 70%),
    radial-gradient(38% 40% at 8% 92%, rgba(46, 111, 176, 0.10), transparent 70%);
  opacity: 0.85;
  animation: aurora 16s var(--ease) infinite;
  will-change: transform, opacity;
}

/* Tabular figures everywhere numbers appear, so data stays aligned */
.t-data, .result-date, .result-meta, .legend, .wordmark .tag {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Small eyebrow/label type roles (this page is self-contained on the dark theme) */
.t-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.t-micro { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.t-data  { color: var(--text); }

/* Accessible focus for every interactive element */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================================================
   Top bar — sticky full-width header for the scrolling dashboard
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: var(--s4);
  padding: 10px clamp(16px, 4vw, 36px);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--glass-edge);
  animation: rise 0.5s var(--ease) both;
}
.topbar .mark {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.4s var(--ease);
}
.topbar:hover .mark { transform: scale(1.04); }
.topbar .mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* push the nav + live status to the right edge */
.topbar .brand-nav { margin-left: auto; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark .name {
  font-family: var(--font-head);
  font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: var(--text);
}
.wordmark .name b { color: var(--accent); font-weight: 700; }
.wordmark .tag {
  font-size: 9px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-top: 4px;
}
.live {
  display: inline-flex; align-items: center; gap: 7px; margin-left: var(--s1);
  padding-left: var(--s3); border-left: 1px solid var(--border);
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.55); animation: ping 1.8s infinite;
}
@keyframes ping { 75%, 100% { box-shadow: 0 0 0 7px rgba(46, 125, 50, 0); } }

/* logo doubles as the "back to site" link; nav links interconnect the pages */
.brand-home { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: inherit; }
.brand-nav { display: flex; align-items: center; gap: var(--s4); margin-left: var(--s2); padding-left: var(--s4); border-left: 1px solid var(--border); }
.brand-nav a {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; transition: color 0.15s var(--ease);
}
.brand-nav a:hover { color: var(--accent); }

/* ============================================================
   Control panel
   ============================================================ */
.panel {
  position: absolute; top: var(--s4); right: var(--s4); z-index: 1000; width: 344px;
  max-height: calc(100vh - 2 * var(--s4)); overflow-y: auto;
  background: var(--surface-sheen), var(--surface-glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--glass-edge), var(--shadow-chrome);
  padding: var(--s6);
  transform-origin: top center;
  animation: rise3d 0.6s 0.06s var(--ease) both;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-pill); border: 2px solid transparent; background-clip: padding-box; }

.panel-title {
  margin: 0; font-family: var(--font-head);
  font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--text);
}
.panel-sub { margin: var(--s2) 0 var(--s4); font-size: 13px; line-height: 1.55; color: var(--muted); }

/* ---- Use-my-location ---- */
.btn-locate { margin-bottom: var(--s4); }

/* ---- Buttons ---- */
.btn-row { display: flex; gap: var(--s2); margin-bottom: var(--s2); }
.btn-row .btn { flex: 1; }
.btn {
  position: relative; overflow: hidden;
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 11px 14px; border-radius: var(--r-md);
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease),
              transform 0.12s var(--ease), box-shadow 0.18s var(--ease);
}
.btn svg { width: 15px; height: 15px; position: relative; z-index: 1; }
.btn:not(:disabled):hover { transform: translateY(-2px); }
.btn:not(:disabled):active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* light sheen that sweeps across the high-emphasis actions on hover */
.btn-emerald::after, .btn-ghost.armed::after {
  content: ""; position: absolute; top: 0; left: -75%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.30), transparent);
  transform: skewX(-18deg); transition: left 0.6s var(--ease); pointer-events: none;
}
.btn-emerald:not(:disabled):hover::after, .btn-ghost.armed:not(:disabled):hover::after { left: 135%; }

/* primary — the single most important action; bright green reserved for this */
.btn-emerald { background: var(--accent-grad); color: var(--accent-ink); box-shadow: var(--glass-edge), var(--shadow-glow); }
.btn-emerald:not(:disabled):hover { box-shadow: var(--glass-edge), var(--shadow-glow-lg); }
/* secondary — elevated dark surface */
.btn-dark { background: var(--surface-sheen), var(--surface-2); color: var(--text); border-color: var(--border-strong); box-shadow: var(--glass-edge); }
.btn-dark:not(:disabled):hover { background: var(--surface-sheen), #E4EEDE; border-color: var(--accent-line); box-shadow: var(--glass-edge), var(--shadow-chrome); }
/* ghost — outlined accent */
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--accent-line); }
.btn-ghost:not(:disabled):hover { background: var(--accent-weak); border-color: var(--accent); }
.btn-ghost.armed { background: var(--accent-grad); color: var(--accent-ink); border-color: var(--accent); box-shadow: var(--glass-edge), var(--shadow-glow); }
/* quiet — low-emphasis */
.btn-quiet { background: transparent; color: var(--muted); border-color: var(--border-strong); }
.btn-quiet:not(:disabled):hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   Status banner
   ============================================================ */
.status {
  margin: var(--s1) 0 var(--s2); padding: 11px var(--s3); border-radius: var(--r-md);
  font-size: 12.5px; line-height: 1.5; display: flex; gap: var(--s2); align-items: flex-start;
  border: 1px solid var(--border);
  animation: rise 0.3s var(--ease) both;
}
.status .spin {
  width: 15px; height: 15px; flex: none; margin-top: 1px;
  border: 2px solid rgba(20, 54, 26, 0.15); border-top-color: currentColor;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.status.info  { background: var(--water-weak);  border-color: var(--water-line);  color: var(--water); }
.status.ok    { background: var(--accent-weak);  border-color: var(--accent-line);  color: var(--accent); }
.status.warn  { background: var(--wheat-weak);   border-color: var(--wheat-line);   color: var(--wheat); }
.status.error { background: var(--danger-weak);  border-color: var(--danger-line);  color: var(--danger); }

/* ============================================================
   Result readout
   ============================================================ */
.result {
  margin-top: var(--s2); padding: var(--s4); border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-sheen), var(--surface-2);
  box-shadow: var(--glass-edge);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.result:hover { transform: translateY(-2px); box-shadow: var(--glass-edge), var(--shadow-lift); }
.result:not([hidden]) { animation: rise3d 0.45s var(--ease) both; }
.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.result-date { font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--text); }

/* Actionable headline above the scale (e.g. "38% of your field reads dry") */
.result-summary { margin: var(--s3) 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.result-summary b { color: var(--text); font-family: var(--font-head); font-weight: 600; }
.result-summary:empty { display: none; }

.legend-scale {
  display: flex; align-items: center; gap: var(--s2); margin: var(--s3) 0 7px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
/* Stacked bar of the actual per-class shares, dry → wet (left → right) */
.distribution {
  flex: 1; display: flex; height: 9px; border-radius: var(--r-pill);
  overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--border) inset;
}
.distribution i { height: 100%; min-width: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 7px var(--s3); margin: 0; font-size: 11px; font-weight: 500; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--text); font-weight: 600; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18) inset; }

/* Discrete SAR overlay — keep 20 m cells as crisp blocks, never browser-smoothed */
.sar-overlay { image-rendering: pixelated; image-rendering: crisp-edges; }

.opacity { display: flex; flex-direction: column; gap: 7px; margin-top: var(--s3); }
.opacity input {
  width: 100%; cursor: pointer; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent) 0%, var(--border-strong) 100%);
}
.opacity input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-grad); border: 2px solid var(--surface);
  box-shadow: var(--glass-edge), var(--shadow-glow); transition: transform 0.12s var(--ease);
}
.opacity input::-webkit-slider-thumb:hover { transform: scale(1.12); }
.opacity input::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface);
  background: #2E7D32; box-shadow: var(--shadow-glow);
}
.result-meta { margin: var(--s3) 0 0; font-size: 11px; color: var(--muted-2); line-height: 1.5; }

.panel-foot {
  margin: var(--s4) 0 0; padding-top: var(--s4); border-top: 1px solid var(--border);
  font-size: 10.5px; color: var(--muted-2); line-height: 1.5;
}

/* ============================================================
   Leaflet chrome — frame the data, don't compete with it
   ============================================================ */
.leaflet-container { font-family: var(--font-body); background: var(--bg); }
.leaflet-control-zoom,
.leaflet-bar {
  border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-chrome) !important;
  overflow: hidden;
}
.leaflet-control-zoom a,
.leaflet-bar a {
  background: var(--surface-glass) !important;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--muted) !important;
  border-bottom: 1px solid var(--border) !important;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.leaflet-control-zoom a:hover,
.leaflet-bar a:hover { color: var(--accent) !important; background: var(--surface-2) !important; }
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.82) !important;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--muted-2) !important; font-size: 10px !important;
  border-top-left-radius: var(--r-sm); padding: 2px 8px !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }

/* ============================================================
   Motion primitives
   ============================================================ */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
/* 3D entrance — element tips back into place, giving the panel/cards depth */
@keyframes rise3d {
  from { opacity: 0; transform: perspective(900px) translateY(18px) rotateX(8deg); }
  to   { opacity: 1; transform: perspective(900px) translateY(0) rotateX(0); }
}
/* slow ambient drift for the aurora wash */
@keyframes aurora {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  50%      { transform: translate3d(1.5%, -2%, 0) scale(1.08); opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ============================================================
   Responsive — premium on mobile: panel becomes a bottom sheet
   ============================================================ */
@media (max-width: 760px) {
  .brandbar { top: var(--s3); left: var(--s3); padding: 8px 12px 8px 9px; gap: var(--s2); }
  .brandbar .mark { width: 34px; height: 34px; }
  .wordmark .tag, .live, .brand-nav { display: none; }

  .panel {
    left: 0; right: 0; bottom: 0; top: auto; width: auto;
    max-height: 56vh; padding: var(--s4) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom, 0px));
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-left: none; border-right: none; border-bottom: none;
    animation: sheet 0.4s var(--ease) both;
  }
  /* grab handle affordance for the sheet */
  .panel::before {
    content: ""; display: block; width: 36px; height: 4px; border-radius: var(--r-pill);
    background: var(--border-strong); margin: -6px auto var(--s3);
  }
  .panel-title { font-size: 19px; }
}
@keyframes sheet { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Dashboard — single scrolling page (analysis up top, forecast below)
   ============================================================ */
.dash {
  position: relative; z-index: 2;
  max-width: 1280px; margin: 0 auto;
  padding: var(--s6) clamp(16px, 4vw, 28px) 56px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ---- Page head: field title + neutral trend headline ---- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.dash-h1 { margin: 0; font-family: var(--font-head); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.dash-sub { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dash-sub svg { width: 14px; height: 14px; color: var(--muted); }

.headline { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; max-width: 400px; animation: rise 0.4s var(--ease) both; }
.headline-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.headline-pill svg { width: 16px; height: 16px; }
.headline-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
.headline-sub b { color: var(--text); font-weight: 600; }

/* ---- Stat tiles (Field Area · Average Soil Moisture · You are losing · …) ---- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.tile {
  background: var(--surface-sheen), var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--glass-edge); padding: 17px 18px;
  min-height: 110px; display: flex; flex-direction: column; justify-content: space-between;
}
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-top span { font-size: 13px; font-weight: 500; color: var(--muted); }
.tile-top svg { width: 18px; height: 18px; opacity: 0.9; }
.tile-val { font-family: var(--font-head); font-size: 30px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.tile-val small { font-size: 13px; font-weight: 500; color: var(--muted-2); margin-left: 5px; font-family: var(--font-body); }
.tile-val .note { font-size: 13px; font-weight: 600; margin-left: 7px; font-family: var(--font-body); }
.tile-val .sub { display: block; font-size: 12px; font-weight: 500; color: var(--muted-2); margin-top: 4px; font-family: var(--font-body); }
.tile-val.small { font-size: 19px; }

/* ---- Map + side column (controls before processing, readout after) ---- */
.mapgrid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.mapframe {
  position: relative; height: 540px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--glass-edge);
}
.mapframe #map { border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4); }

/* floating chrome over the map */
.map-daylabel {
  position: absolute; top: 16px; left: 16px; z-index: 500;
  display: flex; align-items: center; gap: 8px;
  /* Near-solid so the current date stays legible over any satellite imagery. */
  background: rgba(255, 255, 255, 0.97); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 8px 13px; border-radius: var(--r-md); border: 1px solid var(--accent-line);
  box-shadow: var(--shadow-chrome), var(--glass-edge);
  font-size: 13px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
}
.map-legend {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 500;
  display: flex; gap: 13px;
  background: var(--surface-glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-chrome), var(--glass-edge);
  font-size: 11px; font-weight: 600; color: var(--muted-2);
}
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.sidecol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.controls {
  background: var(--surface-sheen), var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--glass-edge); padding: var(--s6);
}
.controls .panel-foot { margin-top: var(--s4); }

/* ---- Per-day readout panel (analysis only) ---- */
.result-headings { min-width: 0; }
.r-kicker { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.r-title { margin: 3px 0 0; font-family: var(--font-head); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.r-date { font-family: var(--font-body); font-weight: 500; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.r-pill { padding: 4px 11px; border-radius: var(--r-pill); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.r-cap { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.r-moist {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 16px; margin-top: var(--s4); border: 1px solid; border-radius: var(--r-md);
}
.r-big { font-family: var(--font-head); font-size: 38px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.r-big small { font-size: 18px; }
.r-right { text-align: right; }
.r-mid { font-family: var(--font-head); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.r-mid small { font-size: 13px; }
.r-sub { display: block; font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.r-dist-wrap { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.result .distribution { height: 14px; }
.r-wx { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: var(--s4); }
.r-wxcell { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.r-wxval { display: flex; align-items: center; gap: 7px; font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text); margin-top: 5px; font-variant-numeric: tabular-nums; }
.r-wxval svg { width: 16px; height: 16px; }

/* ============================================================
   7-day forecast — day toolbar + the three graphs
   ============================================================ */
.forecast {
  background: var(--surface-sheen), var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--glass-edge); overflow: hidden;
  animation: rise 0.45s var(--ease) both;
}
.forecast-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.forecast-title { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.forecast-title svg { width: 16px; height: 16px; color: var(--accent); }
.agro-play { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--r-pill); background: var(--accent-weak); color: var(--accent); border: 1px solid var(--accent-line); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.15s var(--ease); }
.agro-play:hover { background: rgba(46, 125, 50, 0.2); }
.agro-play svg { width: 14px; height: 14px; }
.forecast-note { margin: 0; padding: 10px 18px 0; font-size: 11.5px; color: var(--muted-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.forecast-note .seg { display: inline-flex; align-items: center; gap: 6px; }
.forecast-note .seg i { width: 18px; height: 0; border-top: 2px solid var(--muted); display: inline-block; }
.forecast-note .seg.fcst i { border-top-style: dashed; }

.day-strip { display: flex; gap: 12px; padding: 14px 18px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.day-strip::-webkit-scrollbar { height: 8px; }
.day-strip::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-pill); }
.day-divider { flex: 0 0 1px; align-self: stretch; margin: 4px 2px; background: linear-gradient(var(--border-strong), transparent); position: relative; }
.day-divider::after { content: "NOW"; position: absolute; top: -2px; left: 50%; transform: translateX(-50%); font-size: 8px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted-2); white-space: nowrap; }

.daycard {
  flex: 0 0 122px; scroll-snap-align: start; cursor: pointer;
  display: flex; flex-direction: column; gap: 9px; padding: 13px; text-align: left;
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface-2);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.daycard:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.daycard.sel { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line), var(--shadow-glow); transform: translateY(-2px); }
.daycard-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.daycard-label { font-size: 12.5px; font-weight: 600; color: var(--text); }
.daycard-tag { font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; border-radius: 5px; padding: 1px 5px; white-space: nowrap; }
.daycard-tag.now { color: var(--accent); background: var(--accent-weak); border: 1px solid var(--accent-line); }
.daycard-tag.rec { color: var(--muted); background: var(--surface); border: 1px solid var(--border-strong); }
.daycard-wx { display: flex; align-items: center; gap: 8px; }
.daycard-wx svg { width: 20px; height: 20px; }
.daycard-temp { font-family: var(--font-head); font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.daycard-precip { display: flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.daycard-precip svg { width: 11px; height: 11px; color: var(--water); }
.daycard-bar { height: 6px; border-radius: var(--r-pill); background: var(--bg); overflow: hidden; }
.daycard-bar i { display: block; height: 100%; border-radius: var(--r-pill); transition: width 0.3s var(--ease); }
.daycard-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.daycard-foot .pct { font-family: var(--font-head); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.daycard-cls { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-2); }

/* ---- the three graphs (temperature · precipitation · soil moisture) ---- */
.charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 4px 18px 18px; }
.chart-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 15px 16px; }
.chart-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chart-h .ico { flex: none; width: 34px; height: 34px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface); }
.chart-h .ico svg { width: 17px; height: 17px; }
.chart-h h3 { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text); letter-spacing: 0.06em; }
.chart-h p { margin: 2px 0 0; font-size: 11px; color: var(--muted-2); }
.chart-card svg { display: block; width: 100%; }

/* ---- Dashboard responsiveness ---- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .mapgrid { grid-template-columns: 1fr; }
  .mapframe { height: 420px; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { gap: var(--s3); }
  .topbar .wordmark .tag, .topbar .brand-nav { display: none; }
  .dash-head { flex-direction: column; align-items: flex-start; }
  .headline { align-items: flex-start; text-align: left; }
  .mapframe { height: 340px; }
}
