/* ==========================================================================
   iFarmhand — modern "Field Clarity" stylesheet (2026 redesign)
   Drop-in replacement for the original styles.css. No HTML changes required
   for index.html / login.html — it restyles the existing class names and
   loads the new webfonts. home.html + home.js are the redesigned dashboard.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand */
  --green-50:#ECF7EE; --green-100:#D2EDD9; --green-200:#A6DCB6; --green-300:#71C58C;
  --green-400:#43AA66; --green-500:#1F8A4C; --green-600:#15703F; --green-700:#125A34;
  --green-800:#11472B; --green-900:#0C3220;
  --amber-50:#FCF4E3; --amber-100:#F8E6BF; --amber-200:#F1CD82; --amber-300:#EBB54B;
  --amber-400:#E0991F; --amber-500:#C47D14; --amber-600:#9C6010; --amber-700:#774810;
  --blue-50:#EAF3FD; --blue-100:#CDE2FA; --blue-500:#1F66CC; --blue-700:#173F7E;
  --red-50:#FCEEEB; --red-100:#F8D5CD; --red-500:#B43A20; --red-600:#8E2D19;
  --stone-0:#FFFFFF; --stone-50:#FAFAF7; --stone-100:#F4F3EE; --stone-150:#ECEBE3;
  --stone-200:#E2E0D6; --stone-300:#CFCDBF; --stone-400:#A8A697; --stone-500:#7C7A6C;
  --stone-600:#5B5A4E; --stone-700:#42413A; --stone-800:#2B2A25; --stone-900:#1A1A16;

  --color-primary:var(--green-500); --color-primary-hover:var(--green-600); --color-primary-press:var(--green-700);
  --surface-page:var(--stone-50); --surface-card:var(--stone-0); --surface-sunken:var(--stone-100);
  --surface-inverse:var(--green-900);
  --text-strong:var(--stone-900); --text-body:var(--stone-700); --text-muted:var(--stone-500); --text-faint:var(--stone-400);
  --text-on-dark:#F4F3EE; --text-on-dark-muted:rgba(244,243,238,.68);
  --border-subtle:var(--stone-200); --border-default:var(--stone-300); --border-strong:var(--stone-400);

  --status-success-soft:var(--green-50); --status-success-text:var(--green-700);
  --status-warning-soft:var(--amber-50); --status-warning-text:var(--amber-700);
  --status-danger-soft:var(--red-50); --status-danger-text:var(--red-600);
  --status-info-soft:var(--blue-50); --status-info-text:var(--blue-700);

  --font-display:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-sans:'Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-mono:'JetBrains Mono','SFMono-Regular',ui-monospace,monospace;

  /* Responsive type scale: 16px body, 14px supporting floor. */
  --text-caption:.875rem;
  --text-body-size:1rem;
  --text-important:1.125rem;
  --text-card-title:1.25rem;
  --text-section:clamp(1.375rem,2vw,1.5rem);
  --text-page:clamp(1.75rem,3vw,2rem);
  --text-reading:clamp(2.125rem,4vw,2.5rem);

  --radius-sm:6px; --radius-md:10px; --radius-lg:14px; --radius-xl:20px; --radius-full:999px;
  --shadow-xs:0 1px 2px rgba(26,26,22,.06);
  --shadow-sm:0 1px 2px rgba(26,26,22,.05),0 2px 6px rgba(26,26,22,.05);
  --shadow-md:0 2px 4px rgba(26,26,22,.04),0 8px 18px rgba(26,26,22,.08);
  --shadow-lg:0 4px 10px rgba(26,26,22,.06),0 18px 40px rgba(26,26,22,.12);
  --ring:0 0 0 3px rgba(31,138,76,.22);
  --ring-danger:0 0 0 3px rgba(180,58,32,.20);
  --sidebar-width:260px;
  --ease-out:cubic-bezier(.22,1,.36,1);
}

* { box-sizing:border-box; }
.sr-only { position:absolute !important; width:1px !important; height:1px !important; padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important; white-space:nowrap !important; border:0 !important; }
html { min-height:100%; }
body {
  margin:0; min-height:100vh; font-family:var(--font-sans); font-size:var(--text-body-size); line-height:1.5;
  color:var(--text-body); background:var(--surface-page);
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; text-rendering:optimizeLegibility;
}
h1,h2,h3,h4 { margin:0; font-family:var(--font-display); font-weight:700; line-height:1.2; letter-spacing:-.02em; color:var(--text-strong); }
p { margin:0; }
a { color:var(--green-600); text-decoration:none; }
a:hover { text-decoration:underline; }
::selection { background:var(--green-200); color:var(--green-900); }

/* ============================ AUTH PAGES ============================ */
/* Restyles existing index.html / login.html markup — no HTML changes. */

.page-shell {
  display:grid; grid-template-columns:1.02fr .98fr; gap:0;
  width:min(1180px,calc(100% - 2rem)); min-height:calc(100vh - 4rem);
  margin:2rem auto; border:1px solid var(--border-subtle); border-radius:var(--radius-xl);
  background:var(--surface-card); box-shadow:var(--shadow-lg); overflow:hidden;
}

.hero-panel {
  position:relative; overflow:hidden; padding:clamp(2rem,4vw,3.5rem);
  display:flex; flex-direction:column; gap:1.5rem; color:var(--text-on-dark);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(224,153,31,.16), transparent 55%),
    linear-gradient(160deg, var(--green-800), var(--green-900));
}
.hero-panel::after {
  content:""; position:absolute; inset:auto -10% -22% -10%; height:320px;
  background:radial-gradient(closest-side, rgba(255,255,255,.07), transparent); pointer-events:none;
}
.hero-panel > * { position:relative; z-index:1; }

.brand-mark {
  align-self:flex-start; display:inline-flex; align-items:center; gap:.5rem; padding:0;
  border:0; background:none; color:#fff; font-family:var(--font-display);
  font-weight:800; font-size:1.6rem; letter-spacing:-.03em; text-transform:none;
}
.brand-mark::before {
  content:""; width:34px; height:34px; border-radius:10px; flex:none;
  background:
    radial-gradient(circle at 50% 78%, var(--green-500) 0 60%, transparent 61%),
    var(--green-500);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16'/%3E%3C/svg%3E") center/contain no-repeat;
  box-shadow:inset 0 0 0 100px var(--green-500);
}
/* simpler sprout tile via background image */
.brand-mark::before {
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='16' fill='%231F8A4C'/%3E%3Cpath d='M14 46H50' stroke='%230C3220' stroke-opacity='.28' stroke-width='3' stroke-linecap='round'/%3E%3Cpath d='M32 46V28' stroke='%23fff' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M32 34C26 33 21 29 20 22C27 22 32 26 32 33Z' fill='%23EBB54B'/%3E%3Cpath d='M32 30C38 28 42 23 42 16C35 17 31 22 31 29Z' fill='%23A6DCB6'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask:none; mask:none; box-shadow:none;
}

.eyebrow {
  margin:.5rem 0 0; color:var(--amber-300); font-size:.78rem; font-weight:700;
  letter-spacing:.12em; text-transform:uppercase;
}
.hero-panel h1 {
  margin:0; max-width:15ch; color:#fff; font-size:clamp(2.1rem,3.6vw,3.1rem); line-height:1.05;
}
.hero-copy { max-width:46ch; color:var(--text-on-dark-muted); font-size:1.05rem; line-height:1.6; }

.hero-grid { display:grid; grid-template-columns:1fr 1fr; gap:.9rem; margin-top:auto; }
.insight-card {
  padding:1rem; border:1px solid rgba(255,255,255,.12); border-radius:var(--radius-lg);
  background:rgba(255,255,255,.05); backdrop-filter:none;
}
.insight-label { color:var(--amber-300); font-size:.72rem; font-weight:800; letter-spacing:.07em; text-transform:uppercase; }
.insight-card strong { display:block; margin:.5rem 0 .4rem; color:#fff; font-size:.98rem; }
.insight-card p { color:var(--text-on-dark-muted); font-size:.86rem; line-height:1.5; }

.page-note, .info-stack { margin-top:.4rem; }
.info-stack { display:grid; gap:.8rem; }
.page-note, .info-pill {
  padding:1rem; border:1px solid rgba(255,255,255,.12); border-radius:var(--radius-lg); background:rgba(255,255,255,.05);
}
.page-note strong, .info-pill strong { display:block; margin-bottom:.35rem; color:#fff; }
.page-note p, .info-pill p { color:var(--text-on-dark-muted); font-size:.88rem; line-height:1.55; }

.form-panel {
  display:flex; flex-direction:column; justify-content:center;
  padding:clamp(1.75rem,3.5vw,3.25rem); background:var(--surface-card);
}
.form-panel__header { margin-bottom:1.5rem; }
.form-tag { color:var(--color-primary); font-size:.78rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.form-panel h2 { margin-top:.5rem; font-size:clamp(1.9rem,3vw,2.4rem); }
.form-copy { margin-top:.5rem; color:var(--text-muted); }

form { display:grid; gap:1rem; }
.field-row { display:grid; gap:1rem; grid-template-columns:1fr 1fr; }
.field-group { display:grid; gap:.4rem; }
label { font-size:.85rem; font-weight:600; color:var(--text-strong); }

input, select {
  width:100%; height:44px; padding:0 13px; font:inherit; font-size:.95rem; color:var(--text-strong);
  background:var(--surface-card); border:1px solid var(--border-default); border-radius:var(--radius-md);
  transition:border-color .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
input::placeholder { color:var(--text-faint); }
input:hover, select:hover { border-color:var(--border-strong); }
input:focus, select:focus { outline:none; border-color:var(--color-primary); box-shadow:var(--ring); }
.input-error { border-color:var(--status-danger-text) !important; }
.input-error:focus { box-shadow:var(--ring-danger) !important; }

.password-shell { position:relative; }
.password-shell input { padding-right:4rem; }
.password-toggle {
  position:absolute; top:50%; right:8px; transform:translateY(-50%); border:0; cursor:pointer;
  padding:.35rem .65rem; border-radius:var(--radius-sm); background:var(--green-50);
  color:var(--color-primary-press); font:inherit; font-size:.78rem; font-weight:700;
}
.helper-text { font-size:.82rem; color:var(--text-muted); line-height:1.45; }
.error-text { min-height:1rem; font-size:.82rem; color:var(--status-danger-text); }

.checkbox-row { display:flex; gap:.7rem; align-items:flex-start; color:var(--text-body); font-weight:500; font-size:.9rem; line-height:1.45; }
.checkbox-row input { width:18px; height:18px; min-height:0; margin-top:1px; accent-color:var(--color-primary); flex:none; }

.submit-btn {
  height:50px; border:0; border-radius:var(--radius-md); background:var(--color-primary); color:#fff;
  font:inherit; font-size:1.02rem; font-weight:700; cursor:pointer; box-shadow:var(--shadow-xs);
  transition:background .14s var(--ease-out), transform .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.submit-btn:hover { background:var(--color-primary-hover); transform:translateY(-1px); box-shadow:var(--shadow-sm); }
.submit-btn:active { background:var(--color-primary-press); transform:none; }
.submit-btn:focus-visible { outline:none; box-shadow:var(--ring); }

.social-auth { display:grid; gap:.7rem; margin-top:.3rem; }
.social-auth__label {
  position:relative; text-align:center; color:var(--text-faint); font-size:.82rem; font-weight:500;
}
.social-auth__grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.6rem; }
.social-btn {
  display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 .75rem;
  border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--surface-card);
  color:var(--text-body); font-weight:700; font-size:.85rem; text-decoration:none;
  transition:border-color .14s var(--ease-out), background .14s var(--ease-out);
}
.social-btn:hover { border-color:var(--border-strong); background:var(--stone-50); text-decoration:none; }
.social-btn.is-disabled, .social-btn[aria-disabled="true"] { opacity:.5; pointer-events:auto; }
.social-auth__help { color:var(--text-muted); text-align:center; }

.form-footnote { margin:.3rem 0 0; color:var(--text-muted); font-size:.9rem; }
.form-footnote a, .inline-link { color:var(--color-primary-press); font-weight:700; }

.runtime-banner {
  display:none; margin-top:1rem; padding:.85rem 1rem; border-radius:var(--radius-md);
  background:var(--status-warning-soft); border:1px solid var(--amber-100);
  color:var(--status-warning-text); font-size:.88rem; font-weight:500; line-height:1.5;
}
.runtime-banner.is-visible { display:block; }
.support-mode-banner { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.75rem 1rem; border:2px solid var(--amber-500); border-radius:var(--radius-md); background:var(--amber-100); color:var(--amber-700); box-shadow:var(--shadow-sm); }
.support-mode-banner > div { display:grid; gap:.15rem; }
.support-mode-banner strong { color:var(--text-strong); }
.support-mode-banner span { font-size:.8rem; }
.admin-account-list { display:grid; gap:.55rem; grid-column:1 / -1; }
.admin-account-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.7rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--stone-50); }
.admin-account-row > div { display:flex; align-items:center; gap:.6rem; min-width:0; }
.admin-account-row > div:first-child { display:grid; gap:.15rem; }
.admin-account-row strong { color:var(--text-strong); }
.admin-account-row span:not(.status-pill) { color:var(--text-muted); font-size:.76rem; }
@media (max-width:700px) { .support-mode-banner,.admin-account-row,.admin-account-row > div { align-items:stretch; flex-direction:column; } }
.runtime-banner--light { background:var(--status-warning-soft); }

.status-banner {
  display:none; padding:.85rem 1rem; border-radius:var(--radius-md); font-weight:600; font-size:.9rem;
  background:var(--status-success-soft); border:1px solid var(--green-100); color:var(--status-success-text);
}
.status-banner.is-visible { display:block; }
.status-banner.is-error { background:var(--status-danger-soft); border-color:var(--red-100); color:var(--status-danger-text); }

@media (max-width:900px) {
  .page-shell { grid-template-columns:1fr; min-height:0; }
  .hero-panel { display:none; }
  .field-row { grid-template-columns:1fr; }
}

/* ============================ DASHBOARD (home.html) ============================ */
.app { display:grid; grid-template-columns:var(--sidebar-width) minmax(0,1fr); min-height:100vh; }

.sidebar {
  display:flex; flex-direction:column; gap:1rem; padding:1.25rem 1rem; box-sizing:border-box;
  position:sticky; top:0; height:100vh; color:var(--text-on-dark);
  background:linear-gradient(180deg, var(--green-800), var(--green-900));
}
.sidebar__brand { display:inline-flex; align-items:center; gap:.65rem; }
.sidebar__mark { width:36px; height:36px; flex:none; }
.sidebar__word { font-family:var(--font-display); font-weight:800; font-size:1.35rem; letter-spacing:-.03em; color:#fff; }
.sidebar__overline { margin:.1rem 0 0 .25rem; color:var(--text-on-dark-muted); font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.nav { display:flex; flex-direction:column; gap:3px; }
.nav__item {
  display:flex; align-items:center; gap:.7rem; width:100%; padding:.6rem .7rem; border:0; cursor:pointer;
  border-radius:var(--radius-md); background:transparent; color:var(--text-on-dark-muted);
  font:inherit; font-size:.95rem; font-weight:600; text-align:left;
  transition:background .14s var(--ease-out), color .14s var(--ease-out);
}
.nav__item:hover { background:rgba(255,255,255,.08); color:#fff; }
.nav__item.is-active { background:rgba(255,255,255,.12); color:#fff; font-weight:700; }
.nav__item svg { width:19px; height:19px; flex:none; color:currentColor; }
.nav__item.is-active svg { color:var(--amber-300); }
.sidebar__foot { margin-top:auto; display:flex; flex-direction:column; gap:.75rem; padding-top:1rem; border-top:1px solid rgba(255,255,255,.1); }
.userchip { display:flex; align-items:center; gap:.7rem; }
.userchip__avatar { width:38px; height:38px; flex:none; border-radius:50%; display:grid; place-items:center; background:linear-gradient(135deg,var(--amber-300),var(--amber-500)); color:var(--green-900); font-weight:800; }
.userchip__meta { min-width:0; }
.userchip__meta strong { display:block; color:#fff; font-size:.85rem; }
.userchip__meta span { display:block; color:var(--text-on-dark-muted); font-size:.75rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ghost-btn {
  height:40px; border:1px solid rgba(255,255,255,.16); border-radius:var(--radius-md); cursor:pointer;
  background:rgba(255,255,255,.08); color:#fff; font:inherit; font-weight:700; font-size:.9rem;
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  transition:background .14s var(--ease-out);
}
.ghost-btn:hover { background:rgba(255,255,255,.14); }
.ghost-btn svg { width:16px; height:16px; }

.main { display:flex; flex-direction:column; gap:1.1rem; width:100%; padding:1.4rem clamp(1.1rem,2.4vw,2.1rem) 2.5rem; min-width:0; max-width:none; box-sizing:border-box; }

.topbar { display:grid; grid-template-columns:minmax(220px,.8fr) minmax(560px,1.65fr) auto; align-items:end; gap:1rem; }
.topbar__right { display:flex; flex-direction:column; align-items:flex-end; gap:.55rem; margin-left:auto; }
.weather-highlights { min-width:0; padding:.6rem .7rem; border:1px solid var(--border-subtle); border-radius:var(--radius-lg); background:linear-gradient(120deg,#fff,#f5fbff); box-shadow:var(--shadow-sm); }
.weather-highlights__head { display:flex; align-items:center; justify-content:space-between; gap:.6rem; margin-bottom:.45rem; }
.weather-highlights__head div { display:flex; align-items:baseline; gap:.5rem; min-width:0; }
.weather-highlights__head strong { color:var(--text-strong); font-size:.76rem; }
.weather-highlights__head span { color:var(--text-muted); font-size:.64rem; font-weight:700; white-space:nowrap; }
.weather-highlights__days { display:grid; grid-template-columns:repeat(11,minmax(45px,1fr)); gap:.3rem; }
.weather-day { position:relative; min-width:0; padding:.38rem .24rem; border:1px solid #dce8e1; border-radius:.55rem; background:#fff; text-align:center; }
.weather-day--today { border-color:var(--color-primary); background:var(--green-50); box-shadow:inset 0 0 0 1px var(--green-100); }
.weather-day--forecast { background:#f4f9ff; border-color:#d8e7f3; }
.weather-day--forecast:first-of-type { margin-left:.2rem; }
.weather-day__label,.weather-day__date { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.weather-day__label { color:var(--text-strong); font-size:.64rem; font-weight:800; text-transform:uppercase; }
.weather-day__date { margin-top:.05rem; color:var(--text-muted); font-size:.58rem; }
.weather-day__icon { display:block; margin:.12rem 0; font-size:1rem; line-height:1.15; }
.weather-day__temp { display:block; color:var(--text-strong); font-size:.7rem; white-space:nowrap; }
.weather-day__rain { display:block; margin-top:.1rem; color:#28739b; font-size:.57rem; font-weight:700; white-space:nowrap; }
.weather-highlights__empty { margin:.7rem 0; color:var(--text-muted); font-size:.76rem; text-align:center; }
.weather-highlights:not(.is-empty) .weather-highlights__empty { display:none; }
@media (max-width:1180px) {
  .topbar { grid-template-columns:minmax(0,1fr) auto; }
  .weather-highlights { grid-column:1 / -1; grid-row:2; }
}
.farm-switcher { display:grid; gap:.3rem; width:min(320px,100%); }
.farm-switcher label { color:var(--text-muted); font-size:.7rem; font-weight:800; letter-spacing:.09em; text-transform:uppercase; }
.farm-switcher__control { position:relative; }
.farm-switcher__control svg { position:absolute; z-index:1; top:50%; left:.8rem; width:18px; height:18px; transform:translateY(-50%); color:var(--color-primary); pointer-events:none; }
.farm-switcher select { min-width:250px; padding-left:2.4rem; padding-right:2.2rem; border-color:var(--green-200); background-color:var(--surface-card); box-shadow:var(--shadow-sm); font-weight:700; }
.farm-switcher select:hover { border-color:var(--color-primary); }
.farm-switcher select:disabled { opacity:.65; cursor:wait; }
.topbar__overline { color:var(--text-muted); font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.topbar h1 { margin-top:.25rem; font-size:clamp(1.6rem,3vw,2.35rem); }
.topbar__meta-row { display:flex; align-items:center; gap:.6rem; }
.meta-badge { padding:.5rem .85rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); display:flex; flex-direction:column; gap:1px; min-width:118px; }
.meta-badge--accent { background:var(--amber-50); border-color:var(--amber-100); }
.meta-badge span { font-size:.7rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted); }
.meta-badge strong { font-size:.95rem; color:var(--text-strong); }

.weather-bar { display:flex; align-items:center; gap:.8rem; width:min(620px,calc(100vw - var(--sidebar-width) - 3rem)); padding:.65rem .75rem; border:1px solid #b9d9ed; border-radius:var(--radius-lg); background:linear-gradient(105deg,#edf8ff,#fff 55%,var(--green-50)); box-shadow:var(--shadow-sm); }
.weather-bar__condition { display:flex; align-items:center; gap:.45rem; min-width:185px; }
.weather-bar__icon { width:44px; height:44px; flex:none; filter:drop-shadow(0 3px 5px rgba(20,70,100,.18)); }
.weather-bar__condition strong { display:block; margin-top:.1rem; font-family:var(--font-display); font-size:1.05rem; color:var(--text-strong); text-transform:capitalize; }
.weather-bar__source { display:block; color:var(--text-muted); font-size:.7rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.weather-bar__metrics { flex:1; display:grid; grid-template-columns:repeat(4,minmax(64px,1fr)); gap:.35rem; }
.weather-bar__metrics span { display:flex; flex-direction:column; gap:.1rem; padding-left:.7rem; border-left:1px solid var(--border-subtle); }
.weather-bar__metrics small { color:var(--text-muted); font-size:.68rem; font-weight:700; text-transform:uppercase; }
.weather-bar__metrics strong { color:var(--text-strong); font-size:.88rem; }
.weather-bar__refresh { min-height:36px; padding:0 .8rem; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--surface-card); color:var(--color-primary-press); font:inherit; font-size:.78rem; font-weight:800; cursor:pointer; white-space:nowrap; }
.weather-bar__refresh:hover { background:var(--green-50); border-color:var(--color-primary); }
.weather-bar__refresh:disabled { opacity:.55; cursor:wait; }

.summary { display:grid; grid-template-columns:repeat(4,1fr); gap:.85rem; }
.stat { display:flex; flex-direction:column; gap:.4rem; padding:1rem 1.1rem; background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); }
.stat__label { font-size:.72rem; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--text-muted); }
.stat__value { font-family:var(--font-display); font-weight:800; font-size:1.5rem; letter-spacing:-.02em; color:var(--text-strong); line-height:1.12; }
.stat__value.mono { font-family:var(--font-mono); font-weight:600; font-size:1.15rem; }
.stat__detail { font-size:.82rem; color:var(--text-muted); line-height:1.45; }

.workspace { display:grid; grid-template-columns:380px minmax(0,1fr); gap:1rem; align-items:start; }
.panel { background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); padding:1.25rem; }
.panel__eyebrow { font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--text-muted); }
.panel__title { margin-top:.2rem; font-size:1.35rem; }
.panel__head { margin-bottom:1rem; }
.farm-form { display:flex; flex-direction:column; gap:.85rem; }
.farm-form .field-row { gap:.75rem; }
.field-row--actions { align-items:center; grid-template-columns:repeat(3,1fr); }
.field-row--actions .btn { width:100%; justify-content:center; }
input[readonly] { background:var(--surface-sunken); color:var(--text-body); cursor:default; }
input.mono, select.mono { font-family:var(--font-mono); font-size:.85rem; }

.btn {
  height:44px; padding:0 1.1rem; border:1px solid transparent; border-radius:var(--radius-md); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  font:inherit; font-weight:700; font-size:.92rem; transition:background .14s var(--ease-out), border-color .14s var(--ease-out);
}
.btn svg { width:17px; height:17px; }
.btn--primary { background:var(--color-primary); color:#fff; }
.btn--primary:hover { background:var(--color-primary-hover); }
.btn--primary:disabled { opacity:.5; cursor:not-allowed; }
.btn--block { width:100%; }
.btn:focus-visible { outline:none; box-shadow:var(--ring); }

.map-card { display:flex; flex-direction:column; gap:.75rem; padding:.9rem; }
.map-card__head { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; padding:.3rem .3rem 0; }
.map-card__title { margin-top:.15rem; font-size:1.3rem; }
.map-card__actions { display:flex; align-items:center; justify-content:flex-end; gap:.55rem; flex-wrap:wrap; }
.map-card__expand { min-height:34px; display:inline-flex; align-items:center; gap:.45rem; padding:0 .75rem; border:1px solid var(--border-default); border-radius:var(--radius-full); background:var(--surface-card); color:var(--text-body); font:inherit; font-size:.78rem; font-weight:800; cursor:pointer; box-shadow:var(--shadow-sm); }
.map-card__expand:hover { border-color:var(--color-primary); color:var(--color-primary-press); background:var(--green-50); }
.map-card__expand:focus-visible { outline:none; box-shadow:var(--ring); }
.map-card__expand-icon { width:16px; height:16px; }
.map-card__expand-icon--close { display:none; }
.map-card--properties .studio__tools,.map-card--properties .studio__readout,.map-card--properties .tag-pill { display:none; }
.map-card--view-only .studio__tools,.map-card--view-only .tag-pill { display:none; }
.map-layer-control { display:none; position:absolute; top:12px; right:12px; z-index:500; min-width:180px; padding:.75rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); box-shadow:var(--shadow-md); }
.map-card--view-only .map-layer-control { display:grid; gap:.55rem; }
.map-layer-control strong { color:var(--text-strong); font-size:.76rem; letter-spacing:.06em; text-transform:uppercase; }
.map-layer-control label { display:flex; align-items:center; gap:.5rem; color:var(--text-body); font-size:.8rem; cursor:pointer; }
.map-layer-control input { width:16px; height:16px; min-height:0; accent-color:var(--color-primary); }
.map-card.is-placing-property .studio__map { cursor:crosshair; }
.map-card.is-placing-property .leaflet-overlay-pane svg path,
.map-card.is-placing-property .leaflet-marker-pane { pointer-events:none !important; }
.property-location { padding:.7rem .8rem; border:1px dashed var(--border-default); border-radius:var(--radius-md); background:var(--surface-sunken); color:var(--text-muted); font-family:var(--font-mono); font-size:.78rem; text-align:center; }
.farm-property-list { display:grid; gap:.5rem; margin-top:1rem; }
.farm-property-list article { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.65rem; padding:.65rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); }
.farm-property-list__icon { display:grid; place-items:center; width:34px; height:34px; border-radius:var(--radius-md); background:var(--green-50); font-size:1.25rem; }
.farm-property-list strong,.farm-property-list small { display:block; }
.farm-property-list small { margin-top:.15rem; color:var(--text-muted); font-size:.72rem; text-transform:capitalize; }
.farm-property-list select { width:auto; height:28px; margin-top:.35rem; padding:0 1.8rem 0 .55rem; font-size:.72rem; text-transform:capitalize; }
.farm-property-list button { border:0; background:transparent; color:var(--status-danger-text); font:inherit; font-size:.72rem; font-weight:800; cursor:pointer; }
.farm-property-list__empty { padding:.8rem; border:1px dashed var(--border-default); border-radius:var(--radius-md); color:var(--text-muted); font-size:.82rem; line-height:1.45; }
.farm-property-marker-shell { background:none; border:0; }
.farm-property-marker { display:grid; place-items:center; width:34px; height:34px; border:3px solid #fff; border-radius:50%; background:var(--green-600); box-shadow:0 3px 10px rgba(0,0,0,.3); font-size:18px; }
.farm-property-marker--in-use { background:#dceeff; }.farm-property-marker--idle { background:#f3f0e8; }.farm-property-marker--maintenance { background:#fff0cf; }.farm-property-marker--offline { background:#f5d8d2; filter:grayscale(.45); }
.farm-property-tooltip { padding:.55rem .65rem !important; border:1px solid var(--border-default) !important; border-radius:var(--radius-md) !important; box-shadow:var(--shadow-md) !important; }
.farm-property-tooltip strong,.farm-property-tooltip span,.farm-property-tooltip small { display:block; }
.farm-property-tooltip span { margin-top:.15rem; color:var(--text-body); font-size:.76rem; text-transform:capitalize; }
.farm-property-tooltip small { margin-top:.25rem; max-width:220px; color:var(--text-muted); white-space:normal; }
.settings-workspace { display:grid; gap:1rem; }
.settings-workspace__head { padding:1.25rem; border:1px solid var(--border-subtle); border-radius:var(--radius-lg); background:linear-gradient(135deg,var(--green-50),var(--surface-card)); }
.settings-workspace__head h2 { margin-top:.25rem; font-size:1.8rem; }
.settings-workspace__head p:last-child { margin-top:.45rem; color:var(--text-muted); }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.85rem; }
.settings-card { display:grid; grid-template-columns:auto minmax(0,1fr); gap:.85rem; align-items:start; padding:1rem; border:1px solid var(--border-subtle); border-radius:var(--radius-lg); background:var(--surface-card); box-shadow:var(--shadow-sm); }
.settings-card--active { grid-column:1 / -1; border-color:var(--green-200); }
.settings-card__icon { display:grid; place-items:center; width:42px; height:42px; border-radius:var(--radius-md); background:var(--green-50); color:var(--color-primary); font-size:1.3rem; font-weight:800; }
.settings-card h3 { margin:.45rem 0 .3rem; font-size:1.1rem; }
.settings-card p { color:var(--text-muted); font-size:.84rem; line-height:1.5; }
.settings-card code { padding:.1rem .25rem; border-radius:4px; background:var(--surface-sunken); font-family:var(--font-mono); }
.settings-card .btn,.settings-card .status-banner { grid-column:2; justify-self:start; }
.settings-card__warning { margin-top:.55rem; color:var(--status-warning-text) !important; }
.settings-card.is-disabled { opacity:.62; }
.settings-inline-form,.settings-toggle-list { grid-column:2; display:grid; gap:.55rem; width:min(100%,430px); }
.settings-inline-form input { width:100%; }
.settings-inline-form label,.settings-toggle-list label { display:flex; align-items:center; gap:.45rem; color:var(--text-body); font-size:.84rem; }
.settings-inline-form label input,.settings-toggle-list label input { width:auto; }
.accounting-detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:1rem; padding:1rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); }
.tag-pill { display:inline-flex; align-items:center; padding:.3rem .7rem; border:1px solid var(--border-default); border-radius:var(--radius-full); background:var(--surface-card); font-size:.78rem; font-weight:700; color:var(--text-body); }

/* Boundary studio (Leaflet) */
.studio { position:relative; height:540px; border-radius:var(--radius-md); overflow:hidden; background:var(--green-900); }
.studio__map { position:absolute; inset:0; }
.studio__map.leaflet-container { background:var(--green-900); font-family:var(--font-sans); }
.studio__search { position:absolute; top:12px; left:12px; z-index:500; display:flex; align-items:center; gap:.5rem; background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:var(--radius-md); padding:6px 8px 6px 12px; box-shadow:var(--shadow-md); }
.studio__search svg { width:16px; height:16px; color:var(--text-faint); flex:none; }
.studio__search input { border:0; outline:none; height:auto; padding:0; width:190px; font-size:.85rem; background:transparent; box-shadow:none; }
.studio__search input:focus { box-shadow:none; }
.studio__search button { height:32px; border:0; background:var(--color-primary); color:#fff; font:inherit; font-weight:700; font-size:.82rem; padding:0 12px; border-radius:var(--radius-sm); cursor:pointer; }
.studio__tools { position:absolute; top:12px; right:12px; z-index:500; width:236px; background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); padding:13px; }
.studio__tools-head { font-size:.72rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--text-muted); margin-bottom:10px; }
.studio__tool-row { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.studio__tool { display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 4px; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); color:var(--text-body); font:inherit; font-size:11px; font-weight:600; cursor:pointer; transition:all .14s var(--ease-out); }
.studio__tool svg { width:18px; height:18px; }
.studio__tool:hover { border-color:var(--border-strong); background:var(--stone-50); }
.studio__tool.is-active { border-color:var(--color-primary); background:var(--green-50); color:var(--color-primary-press); }
.studio__tool.is-active svg { color:var(--color-primary); }
.studio__tool-row--sub { margin-top:6px; }
.studio__mini { display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:8px 4px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--surface-card); color:var(--text-muted); font:inherit; font-size:11px; font-weight:600; cursor:pointer; }
.studio__mini:hover { background:var(--stone-50); color:var(--text-strong); }
.studio__mini svg { width:14px; height:14px; }
.studio__soil-toggle { width:100%; min-height:34px; margin-top:7px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--amber-50); color:var(--amber-700); font:inherit; font-size:.76rem; font-weight:800; cursor:pointer; }
.studio__soil-toggle:disabled { opacity:.55; cursor:not-allowed; }
.studio__soil-toggle:not(:disabled):hover { background:var(--amber-100); }
.studio__hint { margin-top:11px; font-size:.72rem; line-height:1.5; color:var(--text-muted); }
.studio__import { margin-top:12px; padding-top:12px; border-top:1px solid var(--border-subtle); display:grid; gap:6px; }
.studio__import-label { display:flex; align-items:center; justify-content:center; min-height:34px; border:1px dashed var(--border-strong); border-radius:var(--radius-sm); background:var(--green-50); color:var(--color-primary-press); font-size:.78rem; font-weight:800; cursor:pointer; transition:all .14s var(--ease-out); }
.studio__import-label:hover { background:#e4f3db; border-color:var(--color-primary); }
.studio__import input { width:100%; font-size:.72rem; color:var(--text-muted); }
.studio__import small { color:var(--text-faint); font-size:.68rem; line-height:1.35; }
.studio__readout { position:absolute; left:12px; bottom:12px; z-index:500; display:flex; flex-direction:column; gap:2px; background:rgba(12,50,32,.86); backdrop-filter:blur(8px); border:1px solid rgba(255,255,255,.14); border-radius:var(--radius-md); padding:10px 16px; color:#fff; opacity:.75; }
.studio__readout.is-on { opacity:1; }
.studio__readout-label { font-size:.7rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--amber-300); }
.studio__readout-value { font-family:var(--font-mono); font-size:1.3rem; font-weight:600; letter-spacing:-.01em; }
.map-card.is-expanded { position:fixed; inset:12px; z-index:2000; margin:0; padding:.9rem; background:var(--surface-card); box-shadow:0 24px 80px rgba(7,35,22,.32); }
.map-card.is-expanded .studio { height:auto; flex:1; min-height:0; }
.map-card.is-expanded .map-card__expand-icon--open { display:none; }
.map-card.is-expanded .map-card__expand-icon--close { display:block; }
.map-card.is-expanded.map-card--condensed .studio { height:auto; }
body.map-expanded { overflow:hidden; }
.if-pin { width:16px; height:16px; border-radius:50%; background:#fff; border:4px solid var(--color-primary); box-shadow:0 2px 6px rgba(0,0,0,.4); box-sizing:border-box; }
.leaflet-control-zoom { border:1px solid var(--border-subtle) !important; box-shadow:var(--shadow-sm) !important; }
.leaflet-bar a { color:var(--text-body) !important; }

.soil-import-card { display:grid; gap:.8rem; padding:1rem; border:1px solid var(--border-subtle); border-radius:var(--radius-lg); background:linear-gradient(180deg,var(--amber-50),var(--surface-card)); }
.soil-import-card h3 { margin-top:.2rem; font-size:1.05rem; }
.weather-source-card { display:grid; gap:.8rem; padding:1rem; border:1px solid #b9d9ed; border-radius:var(--radius-lg); background:linear-gradient(180deg,#edf8ff,var(--surface-card)); }
.weather-source-card h3 { margin-top:.2rem; font-size:1.05rem; }
.weather-source-card p:not(.panel__eyebrow) { margin-top:.35rem; color:var(--text-muted); font-size:.82rem; line-height:1.5; }
.weather-source-card a { display:inline-block; margin-top:.4rem; color:var(--color-primary-press); font-size:.78rem; font-weight:800; }
.secret-input { display:flex; align-items:stretch; }
.secret-input input { min-width:0; border-radius:var(--radius-md) 0 0 var(--radius-md); }
.secret-input button { padding:0 .8rem; border:1px solid var(--border-default); border-left:0; border-radius:0 var(--radius-md) var(--radius-md) 0; background:var(--surface-sunken); color:var(--text-body); font:inherit; font-size:.78rem; font-weight:800; cursor:pointer; }
.secret-input button:hover { background:var(--green-50); color:var(--color-primary-press); }
.soil-import-card p { margin-top:.35rem; color:var(--text-muted); font-size:.88rem; line-height:1.55; }
.soil-import-card a { display:inline-flex; margin-top:.45rem; font-size:.85rem; font-weight:800; }
.soil-import-card__actions { display:grid; gap:.45rem; }
.soil-import-card__label { display:flex; align-items:center; justify-content:center; min-height:40px; border:1px dashed var(--amber-500); border-radius:var(--radius-md); background:rgba(255,255,255,.68); color:var(--amber-700); font-weight:800; cursor:pointer; }
.soil-import-card__label:hover { background:#fff; }
.soil-import-card__actions input { font-size:.78rem; color:var(--text-muted); }
.soil-import-card__actions small { color:var(--text-muted); font-size:.78rem; line-height:1.4; }
.soil-summary { display:grid; gap:.55rem; }
.soil-summary__empty { padding:.8rem; border:1px dashed var(--border-default); border-radius:var(--radius-md); color:var(--text-muted); font-size:.86rem; }
.soil-summary__head { display:flex; align-items:flex-start; justify-content:space-between; gap:.7rem; flex-wrap:wrap; }
.soil-summary__head strong { color:var(--text-strong); }
.soil-summary__head span, .soil-summary p { color:var(--text-muted); font-size:.82rem; line-height:1.45; }
.soil-summary__chips { display:flex; flex-wrap:wrap; gap:.4rem; }
.soil-summary__chips span { display:inline-flex; padding:.28rem .55rem; border-radius:var(--radius-full); background:var(--surface-card); border:1px solid var(--border-subtle); color:var(--text-body); font-size:.76rem; font-weight:700; }
.aquaspy-card { display:grid; gap:1rem; padding:1rem; border:1px solid var(--green-200); border-radius:var(--radius-lg); background:linear-gradient(160deg,var(--green-50),var(--surface-card) 60%); }
.aquaspy-card--irrigation { margin:1rem 0; }
.aquaspy-view-tabs { display:flex; gap:.35rem; overflow-x:auto; padding-bottom:.25rem; border-bottom:1px solid var(--border-subtle); }
.aquaspy-view-tabs button { min-width:82px; padding:.65rem .8rem; border:0; border-bottom:3px solid transparent; background:transparent; color:var(--text-muted); font:inherit; font-size:.82rem; font-weight:800; cursor:pointer; }
.aquaspy-view-tabs button:hover { color:var(--color-primary); background:var(--green-50); }
.aquaspy-view-tabs button.is-active { border-bottom-color:var(--color-primary); color:var(--color-primary-press); background:var(--surface-card); }
.aquaspy-controls { display:flex; align-items:end; justify-content:flex-end; gap:.55rem; flex-wrap:wrap; }
.aquaspy-controls label { display:grid; gap:.25rem; margin-right:auto; color:var(--text-muted); font-size:.7rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.aquaspy-controls select { min-width:160px; }
.aquaspy-location-card { display:grid; grid-template-columns:minmax(300px,.8fr) minmax(420px,1.2fr); gap:.9rem; padding:.9rem; border:1px solid var(--green-200); border-radius:var(--radius-md); background:linear-gradient(135deg,var(--green-50),#fff); }
.aquaspy-location-card__form { display:grid; align-content:start; gap:.75rem; }
.aquaspy-location-card__form h4 { margin-top:.2rem; color:var(--text-strong); font-size:1rem; }
.aquaspy-location-card__form p:not(.panel__eyebrow) { margin-top:.3rem; color:var(--text-muted); font-size:.8rem; line-height:1.45; }
.aquaspy-location-card__actions { display:grid; gap:.4rem; }
.aquaspy-location-card__actions label { color:var(--text-body); font-size:.76rem; font-weight:800; }
.aquaspy-location-map { min-height:250px; overflow:hidden; border:1px solid var(--border-default); border-radius:var(--radius-md); background:var(--surface-sunken); }
.aquaspy-sensor-marker-shell { background:none; border:0; }
.aquaspy-sensor-marker { display:grid; place-items:center; width:36px; height:36px; border:3px solid #fff; border-radius:50%; background:#1f66cc; color:#fff; box-shadow:0 3px 12px rgba(0,0,0,.38); font-size:1.15rem; }
.aquaspy-options { display:flex; align-items:center; gap:.8rem 1.1rem; flex-wrap:wrap; padding:.75rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-sunken); }
.aquaspy-options strong { color:var(--text-strong); font-size:.82rem; }
.aquaspy-options label { display:flex; align-items:center; gap:.35rem; font-size:.8rem; }
.aquaspy-options input { width:16px; height:16px; }
.aquaspy-provider-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65rem; }
.aquaspy-provider-grid article { padding:.8rem; border:1px solid var(--green-200); border-radius:var(--radius-md); background:var(--green-50); text-align:center; }
.aquaspy-provider-grid span,.aquaspy-provider-grid small { display:block; color:var(--text-muted); font-size:.7rem; }
.aquaspy-provider-grid span { font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.aquaspy-provider-grid strong { display:block; margin:.3rem 0; color:var(--green-800); font-size:1rem; }
.aquaspy-chart__event { stroke:var(--blue-500,#2f7fbd); stroke-width:2; stroke-dasharray:5 4; }
.aquaspy-chart__mask { fill:rgba(180,58,32,.1); }
.aquaspy-chart__projected { fill:none; stroke:var(--text-muted); stroke-width:2; stroke-dasharray:7 5; }
.aquaspy-chart__annotation { fill:var(--text-body); font:700 11px var(--font-sans); }
.aquaspy-card__head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
.aquaspy-card h3 { margin-top:.2rem; font-size:1.1rem; }
.aquaspy-card p { margin-top:.35rem; color:var(--text-muted); font-size:.88rem; line-height:1.55; }
.aquaspy-card a { display:inline-flex; margin-top:.4rem; font-size:.84rem; font-weight:800; }
.aquaspy-card__connect { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:.75rem; }
.aquaspy-empty { padding:1rem; border:1px dashed var(--green-200); border-radius:var(--radius-md); color:var(--text-muted); background:rgba(255,255,255,.7); font-size:.86rem; line-height:1.5; }
.aquaspy-dashboard { display:grid; gap:.85rem; }
.aquaspy-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65rem; }
.aquaspy-metrics article { min-width:0; padding:.75rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); }
.aquaspy-metrics span,.aquaspy-metrics small { display:block; color:var(--text-muted); font-size:.69rem; line-height:1.35; }
.aquaspy-metrics span { font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.aquaspy-metrics strong { display:block; margin:.35rem 0 .2rem; overflow:hidden; color:var(--text-strong); font-family:var(--font-display); font-size:1.1rem; text-overflow:ellipsis; }
.aquaspy-chart-shell { padding:.8rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); overflow:hidden; }
.aquaspy-chart__head { display:flex; justify-content:space-between; gap:.75rem; margin-bottom:.35rem; color:var(--text-strong); font-size:.82rem; }
.aquaspy-chart__head span { color:var(--text-muted); font-size:.72rem; text-align:right; }
.aquaspy-chart-shell svg { display:block; width:100%; height:auto; min-height:180px; }
.aquaspy-chart__grid line { stroke:var(--border-subtle); stroke-width:1; }
.aquaspy-chart__grid text,.aquaspy-chart__empty { fill:var(--text-muted); font:11px var(--font-sans); }
.aquaspy-chart__axis-line,.aquaspy-chart__x-tick line { stroke:var(--border-strong); stroke-width:1; }
.aquaspy-chart__x-tick text { fill:var(--text-body); font:700 11px var(--font-sans); }
.aquaspy-chart__band { fill:rgba(31,138,76,.11); }
.aquaspy-chart__line { fill:none; stroke:var(--color-primary); stroke-width:3; stroke-linejoin:round; stroke-linecap:round; }
.aquaspy-chart__line--average { stroke:#111; stroke-width:2.5; }
.aquaspy-chart__layer { fill:none; stroke-width:1.5; opacity:.72; }
.aquaspy-chart__layer--0 { stroke:#1976d2; }.aquaspy-chart__layer--1 { stroke:#2e9d50; }.aquaspy-chart__layer--2 { stroke:#e29a18; }.aquaspy-chart__layer--3 { stroke:#8d5bd1; }.aquaspy-chart__layer--4 { stroke:#d45454; }.aquaspy-chart__layer--5 { stroke:#168d91; }
.aquaspy-chart__point { fill:var(--amber-500); stroke:#fff; stroke-width:2; }
.aquaspy-depths { display:flex; gap:.5rem; overflow-x:auto; padding-bottom:.2rem; }
.aquaspy-depths span { flex:0 0 auto; min-width:82px; padding:.55rem .65rem; border-radius:var(--radius-md); background:var(--surface-sunken); text-align:center; }
.aquaspy-depths small,.aquaspy-depths strong { display:block; }
.aquaspy-depths small { color:var(--text-muted); font-size:.68rem; }
.aquaspy-depths strong { margin-top:.2rem; color:var(--text-strong); }

/* Module section */
.module { background:var(--surface-card); border:1px solid var(--border-subtle); border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); padding:1.4rem; }
.module__head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.module__title { margin-top:.2rem; font-size:1.75rem; }
.rec-pill { display:inline-flex; align-items:center; padding:.4rem .8rem; border-radius:var(--radius-full); background:var(--amber-100); color:var(--amber-700); font-size:.8rem; font-weight:700; }
.module__summary { margin-top:.6rem; color:var(--text-muted); font-size:.95rem; line-height:1.6; max-width:80ch; }
.module__metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:.85rem; margin:1.1rem 0; }
.metric { padding:1rem 1.1rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); }
.metric span { display:block; margin-bottom:.4rem; font-size:.72rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted); }
.metric strong { display:block; margin-bottom:.25rem; font-size:1.25rem; font-family:var(--font-display); letter-spacing:-.01em; color:var(--text-strong); }
.metric p { font-size:.84rem; color:var(--text-muted); line-height:1.45; }
.module__tabs { display:inline-flex; gap:2px; padding:3px; background:var(--surface-sunken); border-radius:var(--radius-md); margin-bottom:1rem; }
.module__tab { border:0; cursor:pointer; padding:7px 14px; border-radius:var(--radius-sm); background:transparent; font:inherit; font-size:.85rem; font-weight:600; color:var(--text-muted); }
.module__tab.is-active { background:var(--surface-card); color:var(--text-strong); font-weight:700; box-shadow:var(--shadow-xs); }
.module__list { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:1fr 1fr; gap:.6rem 1.75rem; }
.module__list li { display:flex; gap:.65rem; align-items:flex-start; font-size:.92rem; color:var(--text-body); line-height:1.5; }
.module__list li::before { content:""; flex:none; width:7px; height:7px; border-radius:50%; background:var(--color-primary); margin-top:.5rem; }

@media (max-width:1180px) {
  .summary { grid-template-columns:repeat(2,1fr); }
  .workspace { grid-template-columns:1fr; }
  .module__metrics, .module__list { grid-template-columns:1fr; }
}
@media (max-width:820px) {
  .app { grid-template-columns:1fr; }
  .sidebar { position:static; height:auto; }
  .nav { flex-direction:row; flex-wrap:wrap; }
  .summary { grid-template-columns:1fr 1fr; }
  .topbar__meta-row { flex-wrap:wrap; }
}

.sidebar__section {
  display:flex;
  flex-direction:column;
  gap:.35rem;
  padding-top:.9rem;
  border-top:1px solid rgba(255,255,255,.1);
}

.sidebar__section-label {
  margin:0 0 .15rem .25rem;
  color:var(--text-on-dark-muted);
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.nav__item--secondary {
  color:rgba(255,255,255,.8);
}

.topbar__copy {
  margin-top:.45rem;
  max-width:62ch;
  color:var(--text-muted);
  line-height:1.55;
}

.summary {
  grid-template-columns:repeat(5,minmax(0,1fr));
}

.topbar h1 {
  font-size:clamp(.8rem,1.5vw,1.175rem);
}

.flow-banner {
  display:flex;
  flex-wrap:wrap;
  gap:.6rem;
  padding:.95rem 1rem;
  background:var(--surface-card);
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
}

.flow-banner__step {
  display:inline-flex;
  align-items:center;
  padding:.45rem .75rem;
  border-radius:var(--radius-full);
  background:var(--green-50);
  color:var(--green-700);
  font-size:.78rem;
  font-weight:700;
}

.workspace {
  grid-template-columns:420px minmax(0,1fr);
}

.is-hidden {
  display:none !important;
}

.workspace--single {
  grid-template-columns:minmax(0,780px);
}

.workspace--single .workspace__aside {
  width:100%;
}

.workspace__aside {
  display:grid;
  gap:1rem;
}

.panel__copy {
  margin-top:.45rem;
  color:var(--text-muted);
  font-size:.9rem;
  line-height:1.55;
}

textarea {
  width:100%;
  min-height:96px;
  padding:.8rem .9rem;
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
  background:var(--surface-card);
  color:var(--text-strong);
  font:inherit;
  resize:vertical;
  transition:border-color .14s var(--ease-out), box-shadow .14s var(--ease-out);
}

textarea:focus {
  outline:none;
  border-color:var(--color-primary);
  box-shadow:var(--ring);
}

.btn--secondary {
  background:var(--amber-50);
  border-color:var(--amber-100);
  color:var(--amber-700);
}

.btn--secondary:hover {
  background:var(--amber-100);
}

.btn--outline {
  background:var(--surface-card);
  border-color:var(--border-default);
  color:var(--text-body);
}

.btn--outline:hover {
  background:var(--stone-50);
}

.btn--danger {
  background:var(--red-50);
  border-color:var(--red-100);
  color:var(--red-600);
}

.btn--danger:hover {
  background:var(--red-100);
}

.btn--danger:disabled {
  opacity:.5;
  cursor:not-allowed;
}

.map-card--condensed .studio {
  height:430px;
}

@media (max-width: 700px) {
  .settings-grid { grid-template-columns:1fr; }
  .settings-card--active { grid-column:auto; }
  .settings-card { grid-template-columns:1fr; }
  .settings-card .btn,.settings-card .status-banner { grid-column:auto; justify-self:stretch; }
  .aquaspy-card__head { flex-direction:column; }
  .aquaspy-card__connect { grid-template-columns:1fr; }
  .aquaspy-metrics { grid-template-columns:1fr; }
  .aquaspy-provider-grid { grid-template-columns:1fr; }
  .aquaspy-controls .btn { flex:1; padding:0 .65rem; }
  .map-card.is-expanded { inset:0; border-radius:0; padding:.55rem; }
  .map-card.is-expanded .map-card__head { align-items:center; }
  .map-card.is-expanded .map-card__title { font-size:1rem; }
  .map-card.is-expanded .tag-pill { display:none; }
  .map-card.is-expanded .studio__tools { top:auto; right:8px; bottom:8px; width:min(236px, calc(100% - 16px)); max-height:47%; overflow:auto; }
  .map-card.is-expanded .studio__search { top:8px; left:8px; right:8px; }
  .map-card.is-expanded .studio__search input { width:100%; min-width:0; }
  .map-card.is-expanded .studio__readout { left:8px; bottom:calc(47% + 16px); }
  .topbar__right { width:100%; align-items:stretch; }
  .topbar { display:flex; align-items:stretch; }
  .weather-highlights { width:100%; order:3; overflow:hidden; }
  .weather-highlights__days { display:flex; overflow-x:auto; padding-bottom:.25rem; }
  .weather-day { flex:0 0 64px; }
  .farm-switcher { width:100%; }
  .farm-switcher select { min-width:0; }
  .weather-bar { align-items:stretch; flex-direction:column; width:100%; }
  .weather-bar__metrics { grid-template-columns:repeat(2,1fr); }
  .weather-bar__refresh { width:100%; }
}

.map-fallback {
  display:grid;
  place-items:center;
  height:100%;
  padding:2rem;
  color:#fff;
  text-align:center;
  line-height:1.6;
  background:linear-gradient(180deg, rgba(12,50,32,.94), rgba(17,71,43,.9));
}

.module__status-row {
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
  margin:1rem 0 1.1rem;
}

.status-pill {
  display:inline-flex;
  align-items:center;
  padding:.42rem .72rem;
  border-radius:var(--radius-full);
  font-size:.78rem;
  font-weight:700;
}

.status-pill--success {
  background:var(--green-50);
  color:var(--green-700);
}

.status-pill--warning {
  background:var(--amber-50);
  color:var(--amber-700);
}

.status-pill--danger {
  background:var(--red-50);
  color:var(--red-600);
}

.status-pill--info {
  background:var(--blue-50);
  color:var(--blue-700);
}

.decision-card,
.comparison-card {
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  background:var(--surface-card);
  box-shadow:var(--shadow-sm);
}

.decision-card {
  padding:1rem 1.05rem;
  margin-bottom:1rem;
}

.decision-card__meta {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.9rem;
  flex-wrap:wrap;
}

.decision-card__title {
  margin-top:.2rem;
  font-size:1.35rem;
}

.deadline-pill {
  display:inline-flex;
  align-items:center;
  padding:.38rem .7rem;
  border-radius:var(--radius-full);
  background:var(--surface-sunken);
  color:var(--text-body);
  font-size:.78rem;
  font-weight:700;
}

.decision-card__statement {
  margin-top:.75rem;
  color:var(--text-strong);
  font-size:1rem;
  line-height:1.6;
}

.decision-card__grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.85rem;
  margin-top:1rem;
}

.decision-note {
  padding:.95rem 1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--stone-50);
}

.decision-note h4 {
  margin:0 0 .55rem;
  font-size:.95rem;
}

.decision-note p,
.decision-note li {
  color:var(--text-muted);
  line-height:1.55;
}

.decision-note ul {
  margin:0;
  padding-left:1.1rem;
}

.decision-approval {
  display:grid;
  gap:.7rem;
  margin-top:1rem;
}

.decision-approval__actions {
  display:flex;
  flex-wrap:wrap;
  gap:.65rem;
}

.ai-card {
  display:grid;
  gap:1rem;
  padding:1rem 1.05rem;
  margin-bottom:1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  background:
    radial-gradient(circle at 92% 12%, rgba(31,102,204,.10), transparent 32%),
    var(--surface-card);
  box-shadow:var(--shadow-sm);
}

.ai-card--top { position:relative; margin:0; border-color:#c9d9f0; background:radial-gradient(circle at 94% 4%,rgba(31,102,204,.13),transparent 28%),linear-gradient(180deg,#fff,#f8fbff); }
.ai-card--top > .ai-card__head { padding-right:7.5rem; }
.ai-chat__expand { position:absolute; top:1rem; right:1rem; z-index:2; }
.ai-card--top .ai-card__head h2 { margin-top:.2rem; font-size:1.45rem; }
.ai-settings { border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-card); }
.ai-settings summary { padding:.75rem .9rem; cursor:pointer; color:var(--text-strong); font-size:.86rem; font-weight:800; }
.ai-settings__grid { display:grid; grid-template-columns:minmax(240px,1.35fr) minmax(220px,1fr) auto; gap:.8rem; align-items:end; padding:0 .9rem .9rem; }
.ai-settings > .status-banner { margin:0 .9rem .9rem; }
.ai-daily { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.85rem 1rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--green-50); }
.ai-daily strong, .ai-chat__head strong { display:block; color:var(--text-strong); }
.ai-daily span, .ai-chat__head span { display:block; margin-top:.18rem; color:var(--text-muted); font-size:.8rem; }
.ai-chat__head { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding-top:.25rem; border-top:1px solid var(--border-subtle); }
.ai-chat__messages { display:flex; flex-direction:column; gap:.4rem; max-height:460px; min-height:110px; overflow:auto; padding:.65rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--stone-50); }
.ai-chat__empty { margin:auto; color:var(--text-muted); font-size:.87rem; text-align:center; }
.ai-message { max-width:min(82%,760px); padding:.42rem .9rem; border-radius:var(--radius-lg); line-height:1.45; font-size:.9rem; }
.ai-message > :nth-child(2) { white-space:pre-wrap; }
.ai-message--user { align-self:flex-end; background:var(--color-primary); color:#fff; border-bottom-right-radius:4px; }
.ai-message--assistant { align-self:flex-start; background:var(--surface-card); color:var(--text-body); border:1px solid var(--border-subtle); border-bottom-left-radius:4px; }
.ai-message__meta { display:flex; flex-wrap:wrap; gap:.45rem; margin-bottom:.2rem; opacity:.72; font-size:.68rem; font-weight:800; text-transform:uppercase; }
.ai-message__files { display:flex; flex-wrap:wrap; gap:.35rem; margin-top:.5rem; }
.ai-message__files span, .ai-attachment { display:inline-flex; align-items:center; gap:.35rem; padding:.3rem .5rem; border:1px solid rgba(255,255,255,.25); border-radius:var(--radius-full); font-size:.7rem; font-weight:700; }
.ai-message--assistant .ai-message__files span { border-color:var(--border-subtle); }
.ai-attachments { display:flex; flex-wrap:wrap; gap:.45rem; }
.ai-attachment { border-color:var(--border-default); background:var(--surface-card); color:var(--text-body); }
.ai-attachment button { border:0; background:transparent; color:var(--red-600); cursor:pointer; font:inherit; font-weight:900; }
.ai-composer { display:grid; gap:.55rem; }
.ai-composer textarea { resize:vertical; min-height:88px; }
.ai-composer__actions { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.ai-composer__actions input[type="file"] { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.ai-composer__hint { color:var(--text-muted); font-size:.75rem; }
.ai-composer__actions #sendAiQuestionBtn { margin-left:auto; }
.ai-disclaimer { color:var(--text-faint); font-size:.72rem; line-height:1.45; }
.ai-card.is-chat-expanded { position:fixed; inset:1rem; z-index:1200; height:calc(100vh - 2rem); margin:0; overflow:hidden; grid-template-rows:auto auto minmax(0,1fr); box-shadow:0 24px 70px rgba(20,31,45,.28); }
.ai-card.is-chat-expanded .overview-pane--assistant { flex:1; }
.ai-card.is-chat-expanded .ai-chat__messages { min-height:240px; }
body.has-expanded-ai-chat { overflow:hidden; }

.ai-card__head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
}

.ai-card__head h3 {
  margin-top:.2rem;
  font-size:1.2rem;
}

.ai-card__head p {
  margin-top:.4rem;
  max-width:68ch;
  color:var(--text-muted);
  font-size:.9rem;
  line-height:1.55;
}

.ai-card__controls {
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto;
  gap:.75rem;
  align-items:end;
}

.ai-card__controls label {
  grid-column:1 / -1;
  margin-bottom:-.35rem;
}

.ai-card__result {
  padding:1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--stone-50);
  color:var(--text-body);
  line-height:1.6;
}

.ai-card__result-meta {
  display:flex;
  flex-wrap:wrap;
  gap:.65rem;
  margin-bottom:.65rem;
  color:var(--text-muted);
  font-size:.8rem;
}

.ai-card__result-meta strong {
  color:var(--text-strong);
}

.comparison-card {
  padding:1rem 1.05rem;
  margin-bottom:1rem;
}

.comparison-card__head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:.8rem;
  flex-wrap:wrap;
}

.comparison-card__head h3 {
  margin-top:.2rem;
  font-size:1.2rem;
}

.comparison-card__summary {
  color:var(--text-muted);
  font-size:.88rem;
}

.comparison-table-wrap {
  overflow:auto;
}

.comparison-table {
  width:100%;
  border-collapse:collapse;
}

.comparison-table th,
.comparison-table td {
  padding:.8rem .75rem;
  border-bottom:1px solid var(--border-subtle);
  text-align:left;
  vertical-align:top;
}

.comparison-table th {
  color:var(--text-muted);
  font-size:.78rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.audit-grid {
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);
  gap:1rem;
}

.audit-grid--single {
  grid-template-columns:minmax(0,860px);
}

.log-list {
  display:grid;
  gap:.85rem;
}

.log-empty {
  padding:1.1rem;
  border:1px dashed var(--border-default);
  border-radius:var(--radius-md);
  color:var(--text-muted);
  line-height:1.6;
}

.log-entry {
  padding:1rem 1.05rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--stone-50);
}

.log-entry__head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:.85rem;
  flex-wrap:wrap;
}

.log-entry__module {
  display:inline-flex;
  margin-bottom:.3rem;
  color:var(--text-muted);
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
}

.log-entry h3 {
  font-size:1.05rem;
}

.log-entry__action {
  display:inline-flex;
  align-items:center;
  padding:.36rem .65rem;
  border-radius:var(--radius-full);
  font-size:.76rem;
  font-weight:700;
}

.log-entry__action--approved {
  background:var(--green-50);
  color:var(--green-700);
}

.log-entry__action--modified {
  background:var(--amber-50);
  color:var(--amber-700);
}

.log-entry__action--rejected {
  background:var(--red-50);
  color:var(--red-600);
}

.log-entry__meta {
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin-top:.55rem;
  color:var(--text-muted);
  font-size:.82rem;
}

.log-entry__why,
.log-entry__note,
.log-entry__small {
  margin-top:.65rem;
  color:var(--text-body);
  line-height:1.55;
}

.log-entry__small {
  font-size:.88rem;
  color:var(--text-muted);
}

.source-grid {
  display:grid;
  gap:.75rem;
}

.source-card {
  padding:.95rem 1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--stone-50);
}

.source-card__head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  margin-bottom:.45rem;
}

.source-card__head strong {
  color:var(--text-strong);
  font-size:.95rem;
}

.source-card__head span {
  font-size:.75rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.source-card p {
  color:var(--text-muted);
  font-size:.88rem;
  line-height:1.5;
}

.source-card p + p {
  margin-top:.3rem;
}

.source-card--success .source-card__head span {
  color:var(--green-700);
}

.source-card--warning .source-card__head span {
  color:var(--amber-700);
}

.source-card--danger .source-card__head span {
  color:var(--red-600);
}

@media (max-width:1180px) {
  .summary {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .workspace,
  .audit-grid {
    grid-template-columns:1fr;
  }

  .decision-card__grid {
    grid-template-columns:1fr;
  }
}

@media (max-width:820px) {
  .summary {
    grid-template-columns:1fr 1fr;
  }

  .field-row--actions {
    grid-template-columns:1fr;
  }

  .decision-approval__actions,
  .ai-card__controls,
  .module__status-row {
    display:flex;
    flex-direction:column;
    align-items:stretch;
  }
  .ai-settings__grid { grid-template-columns:1fr; }
  .ai-daily, .ai-chat__head { align-items:stretch; flex-direction:column; }
  .ai-message { max-width:92%; }
  .ai-composer__actions #sendAiQuestionBtn { margin-left:0; }
}

@media (max-width:640px) {
  .summary {
    grid-template-columns:1fr;
  }

  .flow-banner {
    padding:.85rem .9rem;
  }
}

/* ============================ COMPACT WORKSPACE ============================ */

/* Forms fill the panel width and add/remove columns as space changes. */
.field-row {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));
}

.farm-form,
.farm-form > *,
.field-group,
.secret-input {
  min-width:0;
}

.workspace--single {
  grid-template-columns:minmax(0,1fr);
}

.workspace--single .workspace__aside {
  width:100%;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,460px),1fr));
  align-items:start;
}

.ai-settings__grid {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
}

.ai-settings__grid .btn {
  align-self:end;
}

.provider-settings-card {
  margin-bottom:1rem;
  border-color:#c9d9f0;
  background:linear-gradient(180deg,#f8fbff,#fff);
}

.provider-settings-card summary {
  color:var(--blue-700);
}

.provider-settings-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; margin-bottom:1rem; }
.provider-settings-list .provider-settings-card { margin-bottom:0; }
.provider-settings-list .ai-settings__grid { grid-template-columns:1fr; }
.ai-daily__actions { display:grid; grid-template-columns:minmax(150px,210px) auto; align-items:end; gap:.35rem .65rem; }
.ai-daily__actions label { grid-column:1 / -1; color:var(--text-muted); font-size:.7rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }

@media (max-width:1200px) {
  .provider-settings-list { grid-template-columns:1fr; }
  .provider-settings-list .ai-settings__grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); }
}

@media (max-width:700px) {
  .ai-daily__actions { width:100%; grid-template-columns:1fr; }
  .ai-daily__actions label { grid-column:auto; }
}

/* Overview is a screen-height command center: map left, daily decision right. */
.main--overview {
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(340px,.75fr);
  grid-template-rows:auto auto minmax(0,1fr);
  grid-template-areas:
    "topbar topbar"
    "runtime runtime"
    "map assistant";
  height:100svh;
  max-width:none;
  padding-bottom:1.1rem;
  overflow:hidden;
}

.main--overview .topbar {
  grid-area:topbar;
  align-items:center;
}

.main--overview .topbar__copy {
  display:none;
}

.main--overview .runtime-banner {
  grid-area:runtime;
  margin-top:0;
}

.main--overview #workspaceView {
  display:contents;
}

.main--overview #mapPanel {
  grid-area:map;
  min-width:0;
  min-height:0;
  height:100%;
}

.main--overview #mapPanel .studio {
  flex:1;
  height:auto;
  min-height:0;
}

.main--overview #aiAssistantPanel {
  grid-area:assistant;
  grid-template-rows:auto auto minmax(0,1fr);
  min-width:0;
  min-height:0;
  height:100%;
  margin:0;
  overflow:hidden;
}

.main--overview #aiAssistantPanel .ai-card__head p {
  font-size:.8rem;
  line-height:1.4;
}

.main--overview #aiAssistantPanel .ai-card__head h2 {
  font-size:1.25rem;
}

.overview-tabs {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:3px;
  padding:3px;
  border-radius:var(--radius-md);
  background:var(--surface-sunken);
}

.overview-tab {
  min-width:0;
  min-height:36px;
  padding:.4rem .5rem;
  border:0;
  border-radius:var(--radius-sm);
  background:transparent;
  color:var(--text-muted);
  font:inherit;
  font-size:.78rem;
  font-weight:700;
  cursor:pointer;
}

.overview-tab:hover {
  color:var(--text-strong);
}

.overview-tab.is-active {
  color:var(--green-700);
  background:var(--surface-card);
  box-shadow:var(--shadow-xs);
}

.overview-tab:focus-visible {
  outline:none;
  box-shadow:var(--ring);
}

.overview-pane {
  display:flex;
  flex-direction:column;
  gap:.7rem;
  min-height:0;
  overflow:hidden;
}

.overview-pane--briefing .ai-card__result {
  flex:1;
  min-height:0;
  overflow:auto;
}

.overview-pane--assistant .ai-chat__head {
  padding-top:0;
  border-top:0;
}

.overview-pane--assistant .ai-chat__messages {
  flex:1;
  min-height:0;
  max-height:none;
}

.overview-pane--assistant .ai-composer textarea {
  min-height:64px;
  max-height:110px;
}

.overview-pane--weather {
  overflow:auto;
}

.overview-pane--weather .weather-bar {
  width:100%;
  flex-direction:column;
  align-items:stretch;
}

.overview-pane--weather .weather-bar__condition {
  min-width:0;
}

.overview-pane--weather .weather-bar__metrics {
  width:100%;
  grid-template-columns:repeat(2,minmax(0,1fr));
}

.overview-pane--weather .weather-bar__refresh {
  width:100%;
}

.weather-empty {
  padding:1rem;
  border:1px dashed #b9d9ed;
  border-radius:var(--radius-md);
  background:#f5fbff;
  color:var(--text-muted);
  font-size:.86rem;
  line-height:1.5;
}

.weather-periods {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.6rem;
}

.weather-period {
  display:flex;
  flex-direction:column;
  gap:.3rem;
  min-width:0;
  padding:.8rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--surface-card);
}

.weather-period--forecast {
  border-color:var(--green-200);
  background:var(--green-50);
}

.weather-period span {
  color:var(--text-muted);
  font-size:.68rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.weather-period strong {
  overflow-wrap:anywhere;
  color:var(--text-strong);
  font-family:var(--font-display);
  font-size:1rem;
}

.weather-period small {
  color:var(--text-muted);
  font-size:.7rem;
}

@media (max-width:1000px) {
  .aquaspy-location-card { grid-template-columns:1fr; }
  .main--overview {
    grid-template-columns:minmax(0,1fr) minmax(320px,.82fr);
    padding-right:1rem;
    padding-left:1rem;
  }

  .main--overview .map-card__head .tag-pill {
    display:none;
  }

  .main--overview .studio__tools {
    width:210px;
  }

  .weather-periods {
    grid-template-columns:1fr;
  }
}

@media (max-width:820px) {
  .main--overview {
    display:flex;
    height:auto;
    min-height:calc(100svh - 1px);
    overflow:visible;
  }

  .main--overview #workspaceView {
    display:block;
    order:2;
  }

  .main--overview #mapPanel {
    min-height:520px;
  }

  .main--overview #aiAssistantPanel {
    min-height:560px;
    order:3;
  }

  .weather-periods {
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media (max-width:560px) {
  .weather-periods {
    grid-template-columns:1fr;
  }

  .overview-tabs {
    grid-template-columns:1fr;
  }
}

/* ====================== FARM ENTERPRISE WORKSPACE ====================== */
.topbar {
  grid-template-columns:minmax(260px,.8fr) minmax(620px,1.7fr);
  align-items:start;
}

.topbar > .weather-highlights {
  grid-column:1 / -1;
  grid-row:2;
}

.topbar__right {
  width:100%;
  min-width:0;
}

.enterprise-switcher {
  display:grid;
  grid-template-columns:minmax(170px,1fr) auto minmax(190px,1fr) auto;
  align-items:end;
  gap:.65rem;
  width:100%;
}

.enterprise-switcher .farm-switcher {
  width:100%;
  min-width:0;
}

.enterprise-switcher .farm-switcher select {
  width:100%;
  min-width:0;
}

.enterprise-switcher__action {
  min-width:96px;
  white-space:nowrap;
}

.field-view-switcher {
  grid-template-columns:1fr minmax(112px,.58fr);
  column-gap:.45rem;
}

.field-view-switcher > label {
  grid-column:1 / -1;
}

.field-view-switcher__search {
  min-width:0;
  height:48px;
  padding:.65rem .75rem;
}

.field-scope-banner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.85rem 1rem;
  border:1px solid var(--amber-100);
  border-radius:var(--radius-lg);
  background:var(--amber-50);
  color:var(--text-body);
}

.field-scope-banner > div { min-width:0; }
.field-scope-banner strong,
.field-scope-banner span { display:block; }
.field-scope-banner strong { color:var(--text-strong); }
.field-scope-banner span { margin-top:.2rem; color:var(--text-muted); font-size:var(--text-caption); line-height:1.45; }

.resource-assignments {
  min-width:0;
  padding:.8rem;
  border:1px solid var(--border-default);
  border-radius:var(--radius-md);
}

.resource-assignments legend {
  padding:0 .35rem;
  color:var(--text-strong);
  font-size:1rem;
  font-weight:700;
}

.resource-assignments legend span,
.resource-assignments > small {
  color:var(--text-muted);
  font-size:var(--text-caption);
  font-weight:500;
}

.resource-assignments > input { width:100%; }
.resource-assignments__list {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:.35rem;
  max-height:230px;
  margin:.65rem 0;
  padding:.25rem;
  overflow:auto;
}

.resource-assignments__list label {
  display:flex;
  align-items:center;
  gap:.5rem;
  min-width:0;
  padding:.45rem .5rem;
  border-radius:var(--radius-sm);
  background:var(--surface-sunken);
  cursor:pointer;
}

.resource-assignments__list input {
  width:18px;
  height:18px;
  min-height:0;
  flex:none;
  accent-color:var(--color-primary);
}

.resource-assignments__list span {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.resource-location-actions,
.farm-accounting-actions,
.accounting-field-scope {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
}

.resource-location-actions .btn { flex:1; }
.farm-property-list__assignment { display:block; margin-top:.2rem; color:var(--color-primary-press); font-size:var(--text-caption); font-weight:700; }

.farm-accounting-actions,
.accounting-field-scope {
  padding:.85rem 1rem;
  border:1px solid var(--green-200);
  border-radius:var(--radius-md);
  background:var(--green-50);
}

.farm-accounting-actions strong,
.farm-accounting-actions span,
.accounting-field-scope strong,
.accounting-field-scope span { display:block; }
.farm-accounting-actions span,
.accounting-field-scope span { margin-top:.2rem; color:var(--text-muted); font-size:var(--text-caption); line-height:1.4; }
.accounting-field-scope.is-blocked { border-color:var(--amber-100); background:var(--amber-50); }
.is-field-scope-disabled { opacity:.62; }

.farm-field-tooltip {
  padding:.5rem .6rem !important;
  border:1px solid var(--border-default) !important;
  border-radius:var(--radius-md) !important;
  box-shadow:var(--shadow-md) !important;
}
.farm-field-tooltip strong,
.farm-field-tooltip span { display:block; }
.farm-field-tooltip span { margin-top:.15rem; color:var(--text-muted); font-size:var(--text-caption); }

.farm-dialog {
  width:min(620px,calc(100vw - 2rem));
  max-width:none;
  padding:0;
  overflow:hidden;
  border:1px solid var(--border-default);
  border-radius:var(--radius-lg);
  background:var(--surface-card);
  color:var(--text-body);
  box-shadow:0 28px 80px rgba(15,45,29,.32);
}

.farm-dialog::backdrop { background:rgba(8,28,18,.68); backdrop-filter:blur(4px); }
.farm-dialog__form { display:grid; }
.farm-dialog__head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:1.15rem 1.25rem;
  background:linear-gradient(135deg,var(--green-900),var(--green-700));
  color:#fff;
}
.farm-dialog__head .panel__eyebrow { color:var(--green-100); }
.farm-dialog__head h2 { margin-top:.2rem; color:#fff; font-size:var(--text-section); }
.farm-dialog__head p:not(.panel__eyebrow) { margin-top:.35rem; color:rgba(255,255,255,.8); font-size:var(--text-caption); line-height:1.45; }
.farm-dialog__close { display:grid; place-items:center; flex:none; width:44px; height:44px; border:1px solid rgba(255,255,255,.3); border-radius:50%; background:rgba(255,255,255,.08); color:#fff; font:inherit; font-size:1.35rem; cursor:pointer; }
.farm-dialog__body { display:grid; gap:.85rem; padding:1.1rem 1.25rem; background:var(--stone-50); }
.farm-dialog__actions { display:flex; justify-content:flex-end; gap:.65rem; padding:.9rem 1.25rem 1.1rem; border-top:1px solid var(--border-subtle); }
.farm-dialog__form > .status-banner:not(:empty) { margin:.75rem 1.25rem 0; }

@media (max-width:1200px) {
  .topbar { grid-template-columns:1fr; }
  .topbar > .weather-highlights { grid-column:1; grid-row:auto; }
  .topbar__right { align-items:stretch; }
}

@media (max-width:760px) {
  .enterprise-switcher { grid-template-columns:minmax(0,1fr) auto; }
  .field-view-switcher { grid-column:1; }
  .enterprise-switcher__action { grid-column:2; }
  .field-scope-banner,
  .farm-accounting-actions,
  .accounting-field-scope { align-items:stretch; flex-direction:column; }
  .resource-assignments__list { grid-template-columns:1fr; }
}

@media (max-width:520px) {
  .enterprise-switcher { grid-template-columns:1fr; }
  .enterprise-switcher__action,
  .field-view-switcher { grid-column:1; }
  .enterprise-switcher__action,
  .field-scope-banner .btn,
  .farm-accounting-actions .btn { width:100%; }
  .resource-location-actions,
  .farm-dialog__actions { flex-direction:column; }
  .farm-dialog__actions .btn { width:100%; }
}

/* ============================ FARM ACCOUNTING ============================ */

.accounting-workspace {
  display:grid;
  gap:1rem;
  padding:1.2rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  background:var(--surface-card);
  box-shadow:var(--shadow-sm);
}

.accounting-head,
.accounting-pane__head,
.accounting-actions {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.accounting-head h2 {
  margin-top:.2rem;
  font-size:1.65rem;
}

.accounting-head p:not(.panel__eyebrow),
.accounting-pane__head p {
  margin-top:.4rem;
  max-width:72ch;
  color:var(--text-muted);
  line-height:1.5;
}

.source-badge {
  display:inline-flex;
  flex:none;
  padding:.45rem .7rem;
  border-radius:var(--radius-full);
  background:var(--blue-50);
  color:var(--blue-700);
  font-size:.75rem;
  font-weight:800;
}

.accounting-form {
  gap:1rem;
  min-width:0;
}

.expense-setup {
  display:grid;
  gap:1rem;
  padding:1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  background:linear-gradient(145deg,var(--stone-50),#fff);
}

.expense-setup__head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.expense-setup__head h3,
.accounting-section-label span {
  color:var(--text-strong);
  font-family:var(--font-display);
  font-size:1.18rem;
}

.expense-setup__head p:not(.panel__eyebrow),
.accounting-section-label p {
  margin-top:.35rem;
  color:var(--text-muted);
  font-size:.86rem;
  line-height:1.45;
}

.expense-setup__total {
  display:grid;
  flex:none;
  gap:.2rem;
  min-width:170px;
  padding:.7rem .85rem;
  border:1px solid var(--green-200);
  border-radius:var(--radius-md);
  background:var(--green-50);
}

.expense-setup__total small {
  color:var(--green-700);
  font-size:.67rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.expense-setup__total strong { color:var(--green-900); font-size:1.05rem; }

.expense-category-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));
  gap:.75rem;
}

.expense-category {
  display:grid;
  grid-template-columns:38px minmax(0,1fr);
  align-content:start;
  gap:.65rem .75rem;
  min-height:180px;
  padding:.85rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--surface-card);
  box-shadow:var(--shadow-xs);
}

.expense-category__icon {
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  border-radius:11px;
  background:var(--green-100);
  color:var(--green-800);
  font-family:var(--font-display);
  font-weight:850;
}

.expense-category h4 { margin:.1rem 0 .25rem; font-size:.96rem; }
.expense-category p { color:var(--text-muted); font-size:.76rem; line-height:1.4; }

.expense-category__footer {
  display:flex;
  grid-column:1 / -1;
  align-items:center;
  justify-content:space-between;
  gap:.6rem;
  margin-top:auto;
  padding-top:.65rem;
  border-top:1px solid var(--border-subtle);
}

.expense-category__footer span { color:var(--text-muted); font-size:.73rem; font-weight:750; }
.expense-category__footer .btn { min-height:34px; padding:.35rem .65rem; font-size:.74rem; }

.expense-item-list {
  display:grid;
  grid-column:1 / -1;
  gap:.35rem;
}

.expense-item-list article {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.5rem;
  padding:.45rem .5rem;
  border-radius:var(--radius-sm);
  background:var(--stone-50);
}

.expense-item-list article > div:first-child { display:grid; min-width:0; }
.expense-item-list strong { overflow:hidden; font-size:.75rem; text-overflow:ellipsis; white-space:nowrap; }
.expense-item-list span { color:var(--text-muted); font-size:.68rem; }
.expense-item-list button { padding:.2rem; border:0; background:transparent; color:var(--green-700); font:inherit; font-size:.66rem; font-weight:800; cursor:pointer; }
.expense-item-list button[data-delete-expense] { color:var(--red-600); }

.expense-category--rates { border-color:var(--blue-100); background:linear-gradient(145deg,var(--blue-50),#fff); }
.expense-category--future { grid-template-columns:1fr; min-height:150px; border-style:dashed; background:var(--stone-50); opacity:.78; }
.expense-category--future .status-pill { justify-self:start; }
.expense-category--future .btn { justify-self:start; margin-top:auto; }

.accounting-section-label {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:1rem;
  padding:.15rem .1rem;
}

.accounting-meta-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr));
  gap:.75rem;
  padding:1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--stone-50);
}

.accounting-kpis {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:.7rem;
}

.expense-dialog {
  width:min(980px,calc(100vw - 2rem));
  max-width:none;
  max-height:min(88vh,900px);
  padding:0;
  overflow:hidden;
  border:1px solid var(--border-default);
  border-radius:var(--radius-lg);
  background:var(--surface-card);
  color:var(--text-body);
  box-shadow:0 28px 80px rgba(15,45,29,.32);
}

.expense-dialog::backdrop { background:rgba(8,28,18,.68); backdrop-filter:blur(4px); }
.expense-dialog__form { display:grid; grid-template-rows:auto minmax(0,1fr) auto auto; max-height:min(88vh,900px); }

.expense-dialog__head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:1.15rem 1.25rem;
  border-bottom:1px solid var(--border-subtle);
  background:linear-gradient(135deg,var(--green-900),var(--green-700));
  color:#fff;
}

.expense-dialog__head .panel__eyebrow { color:var(--green-100); }
.expense-dialog__head h2 { margin-top:.2rem; color:#fff; font-size:1.45rem; }
.expense-dialog__head p:not(.panel__eyebrow) { margin-top:.35rem; max-width:72ch; color:rgba(255,255,255,.78); font-size:.82rem; line-height:1.45; }
.expense-dialog__close { display:grid; place-items:center; flex:none; width:34px; height:34px; border:1px solid rgba(255,255,255,.3); border-radius:50%; background:rgba(255,255,255,.08); color:#fff; font:inherit; font-size:1.2rem; cursor:pointer; }

.expense-dialog__body {
  display:grid;
  gap:.85rem;
  padding:1rem 1.25rem;
  overflow:auto;
  background:var(--stone-50);
}

.expense-form-section {
  display:grid;
  gap:.8rem;
  padding:1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--surface-card);
}

.expense-form-section--intro { border-color:var(--blue-100); background:var(--blue-50); }
.expense-form-section h3 { color:var(--text-strong); font-size:1rem; }
.expense-form-section p { color:var(--text-muted); font-size:.8rem; line-height:1.5; }
.expense-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; }
.expense-form-grid--three { grid-template-columns:repeat(3,minmax(0,1fr)); }

.expense-field { display:grid; align-content:start; gap:.35rem; min-width:0; }
.expense-field > span,
.expense-choice legend { color:var(--text-body); font-size:.76rem; font-weight:750; }
.expense-field small { color:var(--text-muted); font-size:.68rem; line-height:1.35; }
.expense-field select,
.expense-input-wrap input { width:100%; height:42px; border:1px solid var(--border-default); border-radius:var(--radius-sm); background:#fff; color:var(--text-strong); font:inherit; font-size:.84rem; }
.expense-field select { padding:0 .65rem; }
.expense-input-wrap { display:flex; min-width:0; }
.expense-input-wrap b { display:grid; place-items:center; min-width:34px; padding:0 .45rem; border:1px solid var(--border-default); border-right:0; border-radius:var(--radius-sm) 0 0 var(--radius-sm); background:var(--stone-100); color:var(--text-muted); font-size:.78rem; }
.expense-input-wrap b + input { border-radius:0 var(--radius-sm) var(--radius-sm) 0; }
.expense-input-wrap input:has(+ .expense-input-suffix) { border-radius:var(--radius-sm) 0 0 var(--radius-sm); }
.expense-input-wrap b + input:has(+ .expense-input-suffix) { border-radius:0; }
.expense-input-wrap .expense-input-suffix { border-right:1px solid var(--border-default); border-left:0; border-radius:0 var(--radius-sm) var(--radius-sm) 0; }
.expense-input-wrap input { padding:0 .65rem; }

.expense-choice { padding:.75rem; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); }
.expense-choice legend { padding:0 .3rem; }
.expense-choice > div { display:flex; flex-wrap:wrap; gap:.75rem 1.5rem; }
.expense-choice label,
.expense-check { display:flex; align-items:center; gap:.45rem; color:var(--text-body); font-size:.78rem; }
.expense-choice input,
.expense-check input { width:18px; height:18px; accent-color:var(--green-700); }
.expense-check { justify-self:start; padding:.45rem .55rem; border-radius:var(--radius-sm); background:var(--stone-50); }

.expense-dialog__actions {
  display:flex;
  justify-content:flex-end;
  gap:.65rem;
  padding:.85rem 1.25rem 1rem;
  border-top:1px solid var(--border-subtle);
  background:#fff;
}

.expense-dialog__form > .status-banner:not(:empty) { margin:.75rem 1.25rem 0; }

.accounting-kpis article {
  display:grid;
  gap:.35rem;
  padding:.85rem 1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--surface-card);
}

.accounting-kpis span {
  color:var(--text-muted);
  font-size:.7rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.accounting-kpis strong {
  color:var(--text-strong);
  font-family:var(--font-display);
  font-size:1.2rem;
}

.accounting-kpi--return {
  border-color:var(--green-200) !important;
  background:var(--green-50) !important;
}

.accounting-kpi--return.is-negative {
  border-color:var(--red-100) !important;
  background:var(--red-50) !important;
}

.remote-sensing-workspace {
  display:grid;
  gap:1rem;
  padding:1.2rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  background:var(--surface-card);
  box-shadow:var(--shadow-sm);
}
.remote-sensing-head,
.remote-card-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}
.remote-sensing-head h2 { margin-top:.2rem; font-size:1.75rem; }
.remote-sensing-head p:not(.panel__eyebrow) { max-width:70ch; margin-top:.5rem; color:var(--text-muted); line-height:1.55; }
.remote-controls {
  display:grid;
  gap:.8rem;
  padding:1rem;
  border:1px solid var(--blue-100);
  border-radius:var(--radius-lg);
  background:linear-gradient(115deg,#f3faff,#fff 58%,var(--green-50));
}
.remote-controls__intro { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.remote-controls__label { color:var(--text-strong); font-size:.9rem; font-weight:800; }
.remote-controls__hint { color:var(--text-muted); font-size:.78rem; }
.remote-controls__fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:.75rem; align-items:end; }
.remote-controls__fields .btn { min-width:116px; }
.remote-controls .status-banner:empty { display:none; }
.remote-snapshot-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.55rem; }
.remote-snapshot {
  display:grid;
  gap:.15rem;
  min-width:0;
  padding:.75rem .85rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--surface-card);
  color:var(--text-body);
  font:inherit;
  text-align:left;
  cursor:pointer;
  transition:background .14s var(--ease-out),border-color .14s var(--ease-out),transform .14s var(--ease-out);
}
.remote-snapshot:hover { border-color:var(--green-300); background:var(--green-50); transform:translateY(-1px); }
.remote-snapshot.is-active { border-color:var(--green-500); background:var(--green-50); box-shadow:inset 0 0 0 1px var(--green-500); }
.remote-snapshot span { color:var(--text-strong); font-family:var(--font-display); font-size:1rem; font-weight:800; }
.remote-snapshot strong { color:var(--green-700); font-size:.75rem; }
.remote-snapshot small { color:var(--text-muted); font-size:.72rem; }
.remote-visual-grid { display:grid; grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr); gap:1rem; }
.remote-preview-card,
.remote-chart-card,
.remote-info-card,
.remote-upload-card {
  min-width:0;
  padding:1rem;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  background:var(--surface-card);
}
.remote-card-head { align-items:center; margin-bottom:.8rem; }
.remote-card-head h3 { margin-top:.2rem; font-size:1.1rem; }
.remote-preview { position:relative; overflow:hidden; border-radius:var(--radius-md); background:var(--green-900); }
.remote-preview__map { aspect-ratio:720/420; width:100%; min-height:320px; background:var(--green-900); }
.remote-preview__map.leaflet-container { font-family:var(--font-sans); }
.remote-preview__map .leaflet-control-attribution { font-size:9px; }
.remote-preview__overlay { position:absolute; left:12px; bottom:12px; display:grid; gap:.12rem; min-width:150px; padding:.65rem .8rem; border:1px solid rgba(255,255,255,.18); border-radius:var(--radius-md); background:rgba(12,50,32,.82); color:#fff; backdrop-filter:blur(8px); }
.remote-preview__overlay span { color:rgba(255,255,255,.72); font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.remote-preview__overlay strong { color:var(--amber-200); font-family:var(--font-display); font-size:1.55rem; line-height:1; }
.remote-preview__overlay small { color:rgba(255,255,255,.78); font-size:.74rem; }
.remote-preview__badge { position:absolute; top:12px; right:12px; padding:.35rem .55rem; border:1px solid rgba(255,255,255,.2); border-radius:var(--radius-full); background:rgba(12,50,32,.72); color:#fff; font-size:.7rem; font-weight:800; }
.remote-legend { display:flex; justify-content:flex-end; gap:.8rem; flex-wrap:wrap; margin-top:.7rem; color:var(--text-muted); font-size:.7rem; }
.remote-legend span { display:inline-flex; align-items:center; gap:.32rem; }
.remote-legend__swatch { width:10px; height:10px; border-radius:3px; }
.remote-legend__swatch--low { background:#235a53; }
.remote-legend__swatch--mid { background:#66bb7b; }
.remote-legend__swatch--high { background:#e4d267; }
.remote-chart { overflow:hidden; padding:.35rem .15rem 0; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:linear-gradient(180deg,#fcfdf9,var(--green-50)); }
.remote-chart svg { display:block; width:100%; height:auto; min-height:220px; }
.remote-chart__grid path { fill:none; stroke:var(--border-subtle); stroke-dasharray:4 6; }
.remote-chart__labels text { fill:var(--text-faint); font-family:var(--font-mono); font-size:11px; }
.remote-chart__area { fill:rgba(67,170,102,.14); }
.remote-chart__line { fill:none; stroke:var(--green-500); stroke-linecap:round; stroke-linejoin:round; stroke-width:4; }
#remoteTrendDots circle { fill:var(--surface-card); stroke:var(--green-500); stroke-width:4; }
.remote-chart-note { display:flex; justify-content:space-between; gap:.75rem; margin-top:.65rem; color:var(--text-muted); font-size:.74rem; }
.remote-chart-note strong { color:var(--green-700); white-space:nowrap; }
.remote-metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.7rem; }
.remote-metric { display:grid; gap:.25rem; min-width:0; padding:.9rem 1rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-sunken); }
.remote-metric--accent { border-color:var(--green-200); background:var(--green-50); }
.remote-metric span { color:var(--text-muted); font-size:.68rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.remote-metric strong { color:var(--text-strong); font-family:var(--font-display); font-size:1.35rem; }
.remote-metric small { color:var(--text-muted); font-size:.72rem; overflow-wrap:anywhere; }
.remote-detail-grid { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr); gap:1rem; }
.remote-info-list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.55rem; margin:.9rem 0; }
.remote-info-list div { display:grid; gap:.18rem; min-width:0; padding:.65rem .7rem; border-radius:var(--radius-md); background:var(--surface-sunken); }
.remote-info-list span { color:var(--text-muted); font-size:.68rem; font-weight:700; text-transform:uppercase; }
.remote-info-list strong { color:var(--text-strong); font-size:.8rem; overflow-wrap:anywhere; }
.remote-info-copy { color:var(--text-muted); font-size:.8rem; line-height:1.5; }
.remote-upload-card { display:grid; align-content:start; gap:.55rem; background:linear-gradient(180deg,var(--amber-50),var(--surface-card)); }
.remote-upload-card h3 { margin-top:.1rem; font-size:1.05rem; }
.remote-upload-card p:not(.panel__eyebrow) { color:var(--text-muted); font-size:.8rem; line-height:1.5; }
.remote-upload-meta { display:grid; grid-template-columns:1fr 1fr; gap:.65rem; margin-top:.25rem; }
.remote-saved-field { margin-top:.2rem; }
.remote-upload { display:grid; gap:.2rem; margin-top:.3rem; padding:.8rem; border:1px dashed var(--amber-500); border-radius:var(--radius-md); background:rgba(255,255,255,.68); color:var(--amber-700); cursor:pointer; }
.remote-upload:hover { background:#fff; }
.remote-upload span { font-size:.8rem; font-weight:800; }
.remote-upload small { color:var(--text-muted); font-size:.72rem; overflow-wrap:anywhere; }
#remoteDataInput { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.planet-card { display:grid; gap:.8rem; padding:1rem; border:1px solid var(--green-200); border-radius:var(--radius-lg); background:linear-gradient(145deg,var(--surface-card),var(--green-50)); }
.planet-card__copy { max-width:78ch; color:var(--text-muted); font-size:.82rem; line-height:1.55; }
.planet-connect { display:grid; grid-template-columns:minmax(240px,1fr) auto; gap:.7rem; align-items:end; }
.planet-search { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)) auto; gap:.7rem; align-items:end; padding-top:.75rem; border-top:1px solid var(--border-subtle); }
.planet-results,.planet-orders { display:grid; gap:.55rem; }
.planet-results > p,.planet-orders > p { color:var(--text-muted); font-size:.8rem; }
.planet-scene,.planet-order { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.8rem; align-items:center; padding:.75rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:rgba(255,255,255,.78); }
.planet-scene__details,.planet-order__details { display:flex; gap:.65rem; align-items:center; flex-wrap:wrap; }
.planet-scene__details strong,.planet-order__details strong { color:var(--text-strong); }
.planet-scene__details span,.planet-order__details span { color:var(--text-muted); font-size:.75rem; }
.planet-scene .btn,.planet-order .btn { white-space:nowrap; }

@media (max-width:1000px) {
  .remote-visual-grid,
  .remote-detail-grid { grid-template-columns:1fr; }
  .remote-info-list { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

@media (max-width:700px) {
  .remote-controls__fields { grid-template-columns:1fr 1fr; }
  .remote-controls__fields .btn { width:100%; }
  .remote-snapshot-strip,
  .remote-metric-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .remote-info-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .planet-search { grid-template-columns:1fr 1fr; }
}

@media (max-width:520px) {
  .remote-sensing-workspace { padding:.85rem; }
  .remote-sensing-head,
  .remote-card-head,
  .remote-chart-note { align-items:flex-start; flex-direction:column; }
  .remote-controls__fields,
  .remote-snapshot-strip,
  .remote-metric-grid { grid-template-columns:1fr; }
  .remote-legend { justify-content:flex-start; }
  .remote-upload-meta { grid-template-columns:1fr; }
  .planet-connect,.planet-search,.planet-scene,.planet-order { grid-template-columns:1fr; }
}

.accounting-tabs {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:3px;
  padding:3px;
  border-radius:var(--radius-md);
  background:var(--surface-sunken);
}

.accounting-tab {
  min-height:40px;
  padding:.45rem .7rem;
  border:0;
  border-radius:var(--radius-sm);
  background:transparent;
  color:var(--text-muted);
  font:inherit;
  font-size:.82rem;
  font-weight:750;
  cursor:pointer;
}

.accounting-tab.is-active {
  background:var(--surface-card);
  color:var(--green-700);
  box-shadow:var(--shadow-xs);
}

.accounting-tab:focus-visible {
  outline:none;
  box-shadow:var(--ring);
}

.accounting-pane {
  display:grid;
  gap:.8rem;
  min-width:0;
}

.accounting-pane__head {
  align-items:center;
}

.accounting-pane__head h3,
.accounting-savings h3 {
  font-size:1.1rem;
}

.accounting-pane__head p {
  font-size:.82rem;
}

.accounting-table-wrap {
  max-height:520px;
  overflow:auto;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--surface-card);
}

.accounting-table {
  width:100%;
  min-width:980px;
  border-collapse:separate;
  border-spacing:0;
}

.accounting-table--summary {
  min-width:720px;
}

.accounting-table--enterprise { min-width:1180px; }
.accounting-table--enterprise td.accounting-section-cell { min-width:150px; width:150px; }
.accounting-table--enterprise td.accounting-category-cell { min-width:190px; width:190px; }
.accounting-table--enterprise .accounting-activity-cell { min-width:210px; }
.accounting-table--enterprise .accounting-section-cell .accounting-input,
.accounting-table--enterprise .accounting-category-cell .accounting-input,
.accounting-table--enterprise .accounting-activity-cell .accounting-input { width:100%; }

.accounting-table th {
  position:sticky;
  top:0;
  z-index:2;
  padding:.65rem .55rem;
  border-bottom:1px solid var(--border-default);
  background:var(--green-900);
  color:#fff;
  font-size:.7rem;
  font-weight:800;
  letter-spacing:.04em;
  text-align:left;
  text-transform:uppercase;
  white-space:nowrap;
}

.accounting-table td {
  min-width:120px;
  padding:.35rem;
  border-bottom:1px solid var(--border-subtle);
  vertical-align:middle;
}

.accounting-table td:first-child {
  min-width:220px;
}

.accounting-table td:nth-child(2) {
  min-width:210px;
}

.accounting-table tr:last-child td {
  border-bottom:0;
}

.accounting-table tr:hover td {
  background:var(--green-50);
}

.accounting-input {
  height:36px;
  min-width:105px;
  padding:0 .55rem;
  border-radius:var(--radius-sm);
  font-size:.8rem;
}

.accounting-input[readonly] {
  background:var(--stone-100);
  font-weight:700;
}

.accounting-row-remove {
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border:1px solid var(--red-100);
  border-radius:var(--radius-sm);
  background:var(--red-50);
  color:var(--red-600);
  font:inherit;
  font-size:1.1rem;
  font-weight:800;
  cursor:pointer;
}

.accounting-savings {
  display:grid;
  grid-template-columns:minmax(180px,.35fr) minmax(0,1fr);
  gap:1rem;
  padding:1rem;
  border:1px solid var(--amber-100);
  border-radius:var(--radius-md);
  background:var(--amber-50);
}

#accountingSavingsList {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.6rem;
}

#accountingSavingsList article {
  display:grid;
  gap:.25rem;
  padding:.7rem;
  border:1px solid rgba(196,125,20,.2);
  border-radius:var(--radius-sm);
  background:rgba(255,255,255,.65);
}

#accountingSavingsList strong {
  color:var(--text-strong);
  font-size:.83rem;
}

#accountingSavingsList span,
#accountingSavingsList p,
.accounting-actions span {
  color:var(--text-muted);
  font-size:.78rem;
  line-height:1.4;
}

.accounting-actions {
  align-items:center;
}

@media (max-width:1000px) {
  .accounting-kpis {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .accounting-tabs {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .accounting-savings {
    grid-template-columns:1fr;
  }
}

@media (max-width:700px) {
  .accounting-head,
  .accounting-pane__head,
  .accounting-actions,
  .expense-setup__head,
  .accounting-section-label {
    align-items:stretch;
    flex-direction:column;
  }

  .source-badge {
    align-self:flex-start;
  }

  .accounting-kpis,
  .accounting-tabs,
  #accountingSavingsList,
  .expense-form-grid,
  .expense-form-grid--three {
    grid-template-columns:1fr;
  }

  .expense-dialog {
    width:calc(100vw - 1rem);
    max-height:94vh;
  }

  .expense-dialog__form { max-height:94vh; }
  .expense-dialog__head,
  .expense-dialog__body { padding:.9rem; }
  .expense-dialog__actions { padding:.75rem .9rem; }
  .expense-dialog__actions .btn { flex:1; }
}

.ai-prompt-settings { padding:0; overflow:hidden; }
.ai-prompt-settings > summary { padding:1rem; cursor:pointer; color:var(--text-strong); font-weight:800; }
.ai-prompt-settings__intro { padding:0 1rem 1rem; color:var(--text-muted); }
.ai-prompt-settings__grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; padding:0 1rem 1rem; }
.ai-prompt-settings textarea { min-height:9rem; padding:.75rem; resize:vertical; border:1px solid var(--border-default); border-radius:var(--radius-md); color:var(--text-strong); background:var(--surface-card); font:inherit; line-height:1.5; }
.ai-prompt-settings textarea:focus { outline:none; border-color:var(--color-primary); box-shadow:var(--ring); }
.ai-prompt-settings__actions { display:flex; justify-content:flex-end; gap:.75rem; padding:0 1rem 1rem; }
.ai-prompt-settings > .status-banner { margin:0 1rem 1rem; }
.ai-base-prompt { margin:0 1rem 1rem; padding:.75rem; border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--surface-sunken); }
.ai-base-prompt summary { cursor:pointer; color:var(--text-strong); font-weight:700; }
.ai-base-prompt pre { max-height:18rem; margin:.75rem 0 0; overflow:auto; white-space:pre-wrap; color:var(--text-body); font:var(--text-caption)/1.5 var(--font-sans); }

@media (max-width:700px) {
  .ai-prompt-settings__grid { grid-template-columns:1fr; }
  .ai-prompt-settings__actions { flex-direction:column-reverse; }
  .ai-prompt-settings__actions .btn { width:100%; }
}

/* ======================== RESPONSIVE TYPOGRAPHY ======================== */
/* Keep decision text readable on laptops, tablets, and large phones. */
.topbar h1,
.module__title { font-size:var(--text-page); line-height:1.15; }

.panel__head h2,
.accounting-head h2,
.remote-sensing-head h2 { font-size:var(--text-section); line-height:1.2; }

.panel__head h3,
.remote-card-head h3,
.expense-form-section h3 { font-size:var(--text-card-title); line-height:1.3; }

.stat__value,
.primary-reading,
.remote-preview__overlay strong {
  font-size:var(--text-reading);
  line-height:1.1;
  font-weight:700;
  font-variant-numeric:tabular-nums;
}

.metric strong,
.accounting-kpis strong,
.studio__readout-value,
.aquaspy-metrics strong {
  font-size:clamp(1.375rem,2vw,1.5rem);
  font-variant-numeric:tabular-nums;
}

/* Functional controls stay at 16px, preventing input zoom on iPhone. */
button,
input,
select,
textarea,
.btn,
.nav__item,
.module__tab,
.aquaspy-view-tabs button { font-size:1rem; }

input,
select,
textarea,
.btn { min-height:3rem; }

label,
.expense-field > span,
.expense-choice legend,
.expense-choice label,
.expense-check { font-size:1rem; }

/* Supporting information has a firm 14px floor. */
.eyebrow,
.insight-label,
.form-tag,
.helper-text,
.error-text,
.sidebar__overline,
.userchip__meta strong,
.userchip__meta span,
.weather-highlights__head strong,
.weather-highlights__head span,
.weather-day__label,
.weather-day__date,
.weather-day__temp,
.weather-day__rain,
.weather-highlights__empty,
.farm-switcher label,
.topbar__overline,
.meta-badge span,
.weather-bar__source,
.weather-bar__metrics small,
.stat__label,
.stat__detail,
.panel__eyebrow,
.map-layer-control strong,
.map-layer-control label,
.farm-property-list small,
.farm-property-list button,
.studio__tools-head,
.studio__tool,
.studio__mini,
.studio__hint,
.studio__readout-label,
.aquaspy-chart__head span,
.aquaspy-metrics span,
.aquaspy-metrics small,
.aquaspy-depths small,
.metric span,
.metric p,
.ai-message__meta,
.ai-composer__hint,
.ai-disclaimer,
.expense-category p,
.expense-category__footer span,
.expense-item-list strong,
.expense-item-list span,
.expense-field small,
.accounting-kpis span,
.remote-controls__hint,
.remote-snapshot strong,
.remote-snapshot small,
.remote-preview__overlay span,
.remote-preview__overlay small,
.remote-preview__badge,
.remote-legend,
.weather-period span,
.weather-period small { font-size:var(--text-caption); }

.aquaspy-chart__annotation { font:700 14px var(--font-sans); }
.aquaspy-chart__grid text,
.aquaspy-chart__empty { font:14px var(--font-sans); }
.aquaspy-chart__x-tick text { font:700 14px var(--font-sans); }
.remote-preview__map .leaflet-control-attribution { font-size:12px; }

.stat__value,
.metric strong,
.accounting-kpis strong,
.studio__readout-value,
.aquaspy-metrics strong,
.remote-preview__overlay strong { font-feature-settings:'tnum' 1, 'zero' 1; }

@media (max-width:820px) {
  button,
  input,
  select,
  textarea,
  .btn { min-height:3rem; }
}

@media (max-width:560px) {
  .topbar h1,
  .module__title { font-size:1.75rem; }

  .panel__head h2,
  .accounting-head h2,
  .remote-sensing-head h2 { font-size:1.375rem; }
}
/* Local HR workspace keeps private records outside the dashboard data model. */
.hr-frame { width: 100%; height: 1100px; min-height: 80vh; border: 1px solid #dce6df; border-radius: 16px; background: #f5f8f5; }
.hr-accounting-link { padding: 18px; margin-bottom: 18px; }
.hr-accounting-link summary { cursor: pointer; font-weight: 700; }
.hr-accounting-link p { margin: 12px 0; }
