/* AgriVision Seed Intelligence -- real brand theme, pulled directly from
   agrivisionsolutions.com on 2026-08-20 (D34): green #4db849, CTA orange
   #eb6a23, near-black #0d0d0d header/nav surface. Typography mirrors the
   real site too -- "Nunito Sans" for body/nav (their actual font, on
   Google Fonts), "Michroma" for headings/brand type (closest widely
   available match to their licensed "microgramma-extended" display font).
   Google Fonts is loaded from base.html's <head>; if that request can't
   reach the internet the stack below falls straight back to system
   sans-serif fonts -- nothing breaks, it just renders slightly plainer. */

:root {
  --av-green: #4db849;
  --av-green-dark: #3a9636;
  --av-green-light: #eaf7e9;
  --av-navy: #0d0d0d;
  --av-gold: #eb6a23;
  --av-gold-dark: #c6571b;
  --av-gray-50: #f7f8f7;
  --av-gray-100: #eef0ee;
  --av-gray-300: #cfd6d1;
  --av-gray-600: #5f6367;
  --av-red: #b3413a;
  --radius: 8px;
  --font-body: "Nunito Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-brand: "Michroma", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  margin: 0;
  background: var(--av-gray-50);
  color: #262a2c;
  font-size: 15px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--av-navy);
  color: white;
  padding: 20px 32px;   /* D203: bigger banner (was 12px 28px) */
}

.topbar-left { display: flex; align-items: center; gap: 24px; }

.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 18px; }
.brand-logo { height: 56px; width: auto; display: block; }
.brand-agrivision { font-family: var(--font-brand); font-weight: 400; font-size: 15px; letter-spacing: 0.02em; }
.brand-sub { font-size: 16px; color: var(--av-green); align-self: flex-end; margin-bottom: 2px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

.nav-cobrand { font-size: 12px; color: #7d7e7f; text-transform: none; font-weight: 400; letter-spacing: normal; }

/* Hamburger menu button, top left of the topbar */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 40px;
}
.hamburger-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 2px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.hamburger-btn:hover span { background: var(--av-green); }

/* Slide-out nav panel, anchored under the hamburger button at top-left */
.nav-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--av-navy);
  border-right: 1px solid rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 20000;
  padding: 20px 0;
  overflow-y: auto;
}
.nav-menu-panel.open { transform: translateX(0); }

.nav-menu-section { padding: 0 20px 20px; }
.nav-menu-section + .nav-menu-section { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
.nav-menu-heading {
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 400;
  color: var(--av-green);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.nav-menu-panel a {
  display: block;
  color: #e6e7e7;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 0;
}
.nav-menu-panel a:hover { color: var(--av-green); }
.nav-menu-placeholder {
  display: block;
  color: #7d7e7f;
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  padding: 4px 0;
}

.nav-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 19999;
}
.nav-menu-backdrop.open { opacity: 1; pointer-events: auto; }

.content { max-width: 1600px; margin: 0 auto; padding: 28px; }
.content-wide { max-width: 1900px; }
/* D148: full browser width (Agronomy Intelligence map + Field Weather pages) */
.content-full { max-width: 2200px; padding: 24px; }

/* Quote-builder product tables: keep the Product cell on one line (it can
   wrap awkwardly -- e.g. "Channel 207-87 (RIB)" -- when the table's other
   9 columns crowd it) and let the table scroll horizontally instead of
   squeezing/wrapping if the window is too narrow for everything to fit. */
.table-scroll { overflow-x: auto; }
.table-scroll table td:first-child, .table-scroll table th:first-child { white-space: nowrap; }

/* D442 Finance calculator: the options table scrolls sideways on a phone; money and dates stay on one line */
.fc-scroll { overflow-x: auto; }
.fc-scroll td.num, .fc-scroll td.nw { white-space: nowrap; }
.fc-scroll td:first-child { min-width: 170px; }

.footer {
  text-align: center;
  color: var(--av-gray-600);
  font-size: 12px;
  padding: 24px;
}

h1 { font-family: var(--font-brand); font-weight: 400; font-size: 22px; margin: 0 0 6px; letter-spacing: 0.01em; color: var(--av-navy); }
h2 { font-size: 17px; margin: 28px 0 10px; color: var(--av-green-dark); font-weight: 800; }
h3 { font-size: 14px; margin: 16px 0 6px; }
.subtitle { color: var(--av-gray-600); margin-bottom: 20px; }

.card {
  background: white;
  border: 1px solid var(--av-gray-100);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--av-gray-100); }
th { font-weight: 600; color: var(--av-gray-600); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total-row td { font-weight: 700; border-top: 2px solid var(--av-gray-300); }

th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--av-green-dark); }
th.sortable .sort-arrow { display: inline-block; width: 10px; font-size: 10px; color: var(--av-green); }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 3px;   /* D476: square notes, was round */
}
.badge-demo { background: #fbe8c6; color: #7a5416; }
.badge-status-draft { background: var(--av-gray-100); color: var(--av-gray-600); }
.badge-status-presented { background: #dbe9fb; color: #244d7a; }
.badge-status-accepted { background: var(--av-green-light); color: #2c6f29; border-bottom: 2px solid var(--av-green-dark); }
.badge-status-revised { background: #fbe8c6; color: #7a5416; }
.badge-status-declined { background: #f8dcda; color: #8a1f17; }
.badge-status-expired { background: var(--av-gray-100); color: var(--av-gray-600); text-decoration: line-through; }
.badge-live { background: var(--av-green-light); color: #2c6f29; border-bottom: 2px solid var(--av-green-dark); }
.badge-comingsoon { background: var(--av-gray-100); color: var(--av-gray-600); }

a.button, button, input[type=submit] {
  display: inline-block;
  background: var(--av-gold);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 3px;   /* D476 (PLT-031): square with a heavy bottom edge, was a round pill */
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
a.button:hover, button:hover { background: var(--av-gold-dark); }
/* D476: the edge goes only on real buttons; classed tool buttons (map tools, close x, bell) keep their own look */
a.button, button:not([class]), input[type=submit] { padding-bottom: 7px; border-bottom: 3px solid var(--av-gold-dark); }
a.button:hover, button:not([class]):hover, input[type=submit]:hover { border-bottom-color: #a5481a; }
a.button:active, button:not([class]):active, button.secondary:active, input[type=submit]:active { transform: translateY(1px); }
a.button.secondary, button.secondary, summary.button.secondary { background: white; color: #1f2a22; border: 1px solid var(--av-gray-300); border-bottom: 3px solid #aeb7b1; border-radius: 3px; font-weight: 700; padding: 8px 16px 7px; display: inline-block; }
a.button.secondary:hover, button.secondary:hover, summary.button.secondary:hover { background: var(--av-gray-50); border-bottom-color: #8f9a93; }
button.danger, button.secondary.danger { background: white; color: var(--av-red); border: 1px solid var(--av-red); border-bottom: 3px solid var(--av-red); border-radius: 3px; padding: 4px 10px 3px; font-size: 12px; font-weight: 600; }
button.danger:hover, button.secondary.danger:hover { background: #fbecea; }

/* D476 (PLT-031): selection boxes + typed boxes to match the buttons; orange arrow behind a thin line */
select, textarea, input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=submit]):not([type=button]):not([type=hidden]):not([type=color]):not([type=range]):not([type=image]) {
  background-color: white; color: #1f2a22; border: 1px solid var(--av-gray-300); border-bottom: 2px solid #aeb7b1; border-radius: 3px; box-sizing: border-box; font-family: inherit;
}
select {
  -webkit-appearance: none; appearance: none; padding-left: 10px; padding-right: 38px !important; font-weight: 600; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c6571b' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"), linear-gradient(var(--av-gray-300), var(--av-gray-300));
  background-repeat: no-repeat, no-repeat; background-position: right 8px center, right 30px center; background-size: 14px, 1px 60%;
}
select[multiple], select[size] { background-image: none; padding-right: 10px !important; }
select:hover { border-color: var(--av-gray-600); }
select:disabled, input:disabled, textarea:disabled { background-color: var(--av-gray-100); color: var(--av-gray-600); cursor: not-allowed; }

form.inline { display: inline; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--av-gray-600); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 8px 10px; font-size: 14px; font-family: inherit;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
/* 2026-10-09 (Derek: settings rows 'not centered'): labels that wrap no longer push inputs out of line */
.form-grid { align-items: end; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.flash-error { background: #fbe4e2; color: var(--av-red); }
.flash-success { background: var(--av-green-light); color: var(--av-green-dark); }

.swatch { display: inline-block; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--av-gray-300); flex-shrink: 0; }

/* Dashboard front page -- Seed Intelligence (live) + Agronomy Intelligence
   (placeholder) module cards, side by side, matching the hamburger nav's
   two-section framing. */
.module-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.module-card-header { display: flex; align-items: center; justify-content: space-between; }
.module-card-header h2 { margin: 0; }
.module-card-disabled { opacity: 0.75; }

/* Weather ribbon -- a slim strip at the top of the Dashboard, above the
   module cards. Styled as a plain white .card (like everything else in
   the app) rather than a colored banner, so it reads as "part of this
   app" instead of an alert/ad bar; green is used the same sparing way
   the summary tiles already use it (bold accent on the number only). */
.weather-ribbon { padding: 14px 20px; }
.weather-ribbon-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--av-gray-100);
}
.weather-ribbon-location { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--av-gray-600); }
.weather-ribbon-updated { font-size: 11px; color: var(--av-gray-600); }
.weather-ribbon-items { display: flex; flex-wrap: wrap; gap: 20px 32px; }
.weather-ribbon-item { flex: 1 1 110px; min-width: 110px; }
.weather-ribbon-item-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--av-gray-600); }
.weather-ribbon-item-temp { font-size: 20px; font-weight: 700; color: var(--av-green-dark); margin-top: 2px; }
.weather-ribbon-item-desc { font-size: 13px; color: #262a2c; margin-top: 2px; }
.weather-ribbon-item-precip { font-size: 11px; color: var(--av-gray-600); margin-top: 2px; }
.weather-ribbon-empty { color: var(--av-gray-600); font-style: italic; font-size: 13px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.summary-tile { background: white; border: 1px solid var(--av-gray-100); border-radius: var(--radius); padding: 16px; }
.summary-tile .label { font-size: 12px; color: var(--av-gray-600); text-transform: uppercase; letter-spacing: 0.03em; }
.summary-tile .value { font-size: 22px; font-weight: 700; color: var(--av-green-dark); margin-top: 4px; }
.summary-tile .value.small { font-size: 16px; }
.summary-tile .last-year { font-size: 12px; color: var(--av-gray-600); margin-top: 4px; }   /* D469: last year's order vs this quote */
.q-window { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 9px 2px; border-radius: 3px; background: var(--av-green-light); color: #2c6f29; border: 1px solid #cfe8cd; border-bottom: 2px solid var(--av-green-dark); }   /* D472 */
.q-window.ended { background: #fff4e0; color: #7a5416; border-color: #f3d9a4; }
.q-ended { color: var(--av-gold-dark); font-weight: 600; }
/* D476 (PLT-032): quote header -- name + actions, then one strip of labeled facts */
.q-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 12px; }
.q-title h1 { margin: 0; }
.qd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.q-facts { display: flex; flex-wrap: wrap; background: white; border: 1px solid var(--av-gray-100); border-radius: var(--radius); margin: 0 0 14px; }
.q-fact { flex: 1 1 auto; min-width: 0; padding: 10px; border-left: 1px solid var(--av-gray-100); position: relative; box-sizing: border-box; }
.q-fact-grow { flex: 2 1 120px; }
.q-fact-name { flex: 1 1 105px; }
.q-fact:first-child { border-left: none; }
.q-fact-l { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--av-gray-600); margin-bottom: 4px; white-space: nowrap; }
.q-fact-auto { font-weight: 400; text-transform: none; letter-spacing: 0; }
.q-fact-v { min-height: 36px; display: flex; align-items: center; font-size: 14.5px; font-weight: 700; color: #1f2a22; }
.q-fact-v form { margin: 0; width: 100%; }
.q-fact-v select, .q-fact-v input { width: 100%; max-width: 100%; min-height: 36px; font-size: 14px; }
.q-alloc > summary { cursor: pointer; list-style: none; }
.q-alloc > summary::-webkit-details-marker { display: none; }
.q-alloc-box { position: absolute; right: 0; top: 100%; z-index: 20; width: min(460px, 86vw); margin: 4px 0 0; font-size: 13px; font-weight: 400; box-shadow: 0 8px 24px rgba(0,0,0,.16); }
.q-alloc-box select { width: 100%; margin-bottom: 6px; }
@media (max-width: 600px) {
  .q-facts { display: grid; grid-template-columns: 1fr 1fr; }
  .q-fact { border-left: none; border-top: 1px solid var(--av-gray-100); }
  .q-fact:nth-child(even) { border-left: 1px solid var(--av-gray-100); }
  .q-fact:nth-child(-n+2) { border-top: none; }
  .qd-actions { width: 100%; }
  .qd-actions > a.button:not(.secondary) { flex: 1 0 100%; text-align: center; box-sizing: border-box; }
  .qd-actions > a.button.secondary, .qd-actions > button.secondary { flex: 1 1 auto; text-align: center; box-sizing: border-box; padding-left: 10px; padding-right: 10px; }
  .q-alloc-box { position: fixed; left: 16px; right: 16px; top: auto; width: auto; }
}
.q-reprice { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: #fff4e0; border: 1px solid #f3d9a4; border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; font-size: 13px; }
.q-reprice-sub { font-size: 12px; color: var(--av-gray-600); margin-top: 4px; }
.ly-hybrids { margin: 0 0 12px; font-size: 13px; }
.cmp-opts { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0; }   /* D473: Compare hybrids */
.cmp-opts .form-row { margin: 0; }
.cmp-opts input { width: 72px; text-align: right; }
.cmp-table { background: white; }
.cmp-table select { max-width: 170px; font-size: 13px; }
.cmp-table input { width: 84px; text-align: right; font-size: 13px; }
.cmp-sub { font-weight: 400; font-size: 11px; text-transform: none; margin-top: 3px; color: var(--av-gray-600); }
.cmp-none { color: var(--av-gray-600); }
.cmp-return td { font-weight: 700; }
.cmp-first td { border-top: 2px solid var(--av-gray-100); }
.cmp-up { color: var(--av-green-dark); }
.cmp-down { color: var(--av-red); }
.ly-hybrids summary { cursor: pointer; font-weight: 600; }
.q-fold > summary { cursor: pointer; margin: 28px 0 10px; color: var(--av-green-dark); }   /* D475: quote sections */
.q-fold > summary h2 { display: inline; margin: 0; }
.ly-scroll { overflow-x: auto; margin-top: 6px; }

.trace-toggle { font-size: 12px; color: var(--av-green); cursor: pointer; text-decoration: underline; background: none; border: none; padding: 0; }
.trace-panel { display: none; background: var(--av-green-light); border-radius: var(--radius); padding: 10px 14px; margin-top: 6px; font-size: 13px; }
.trace-panel.open { display: block; }
.trace-panel div { display: flex; justify-content: space-between; padding: 2px 0; }
.trace-panel .final { font-weight: 700; border-top: 1px solid var(--av-green); margin-top: 4px; padding-top: 4px; }

.scenario-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.scenario-card { background: white; border: 1px solid var(--av-gray-100); border-radius: var(--radius); padding: 16px; position: relative; }
.scenario-card.cheapest { border-color: var(--av-green); box-shadow: 0 0 0 1px var(--av-green); }
.scenario-card .tag { position: absolute; top: -10px; right: 12px; background: var(--av-green); color: white; font-size: 11px; padding: 2px 8px; border-radius: 3px; font-weight: 700; }
.scenario-card .total { font-size: 24px; font-weight: 700; color: var(--av-green-dark); margin: 8px 0 4px; }
.scenario-card .meta { font-size: 13px; color: var(--av-gray-600); }
.scenario-card .meta div { margin-top: 2px; }

.assumption-note { font-size: 12px; color: var(--av-gray-600); background: var(--av-gray-100); padding: 10px 14px; border-radius: var(--radius); margin-top: 12px; }

.quote-list td a { color: var(--av-green-dark); font-weight: 600; text-decoration: none; }
.quote-list td a:hover { text-decoration: underline; }

/* D151 home weather card */
.home-wx { margin-bottom: 20px; }
.home-wx-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.home-wx-sub { color: var(--av-gray-600); font-size: 13px; margin-top: 2px; }
.home-wx-tiles { margin: 14px 0 6px; }
.home-wx-dep { font-size: 12px; color: var(--av-gray-600); margin-top: 2px; }
.home-wx-dep.pos { color: var(--av-green-dark); } .home-wx-dep.neg { color: var(--av-gold-dark); }
.home-wx-chart, .home-wx-soil { margin-top: 12px; }
.home-wx-chart-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--av-gray-600); margin-bottom: 4px; }
.home-wx-legend { font-size: 11px; color: var(--av-gray-600); margin-top: 4px; }
.home-wx-legend .sw { display:inline-block; width:10px; height:10px; margin:0 4px -1px 10px; border-radius:2px; }
.home-wx-soil-table td.fc, .home-wx-soil-table th:nth-child(n+6) { color: var(--av-gray-600); font-style: italic; }
.home-wx-note { color: var(--av-gray-600); margin-top: 10px; }
.home-wx-foot { font-size: 11px; color: var(--av-gray-600); margin-top: 12px; border-top: 1px solid var(--av-gray-100); padding-top: 8px; }

.home-wx-forecast { margin-top: 12px; }

/* D372 screen text standard (UI_STANDARDS rule 17): shared (i) tooltip, freshness line, DRAFT badge -- see templates/_ui.html */
.av-i { cursor: help; color: var(--av-gray-600); font-size: 0.95em; margin-left: 4px; outline: none; }
.av-i:focus, .av-i:hover { color: var(--av-green-dark, #1f5c3d); }
.av-upd { color: var(--av-gray-600); font-size: 12px; }
.av-upd.warn { color: #b3261e; font-weight: 600; }
.av-draft { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 1px 7px; border-radius: 8px;
            background: #fff4e5; color: #8a5300; border: 1px solid #f0b46a; vertical-align: middle; }

/* QC 10/19 (Derek: "QC ALL pages ... THE UI IS IN AGREEMENT WITH THE STANDARD"): on phones, wide tables scroll sideways
   inside their own box and dropdowns never grow wider than the screen -- the quotes list, quote page, optimizer, NPNI and
   seed allocation pages were 510-685 px wide on a 375 px phone (the whole page shrank to fit). Desktop + print unchanged. */
@media (max-width: 760px) {
  .av-main table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .av-main select { max-width: 100%; }
  .av-main [style*="display:flex"] > *, .av-main [style*="display: flex"] > * { min-width: 0; max-width: 100%; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }   /* beats inline 3/4-column grids */
}

/* D382: one empty-state line (ui.empty) */
.av-empty { color: var(--av-gray-600); font-size: 13px; margin: 8px 0; }

/* D374 Seed Optimizer -- moved here from _optimize_best.html + settings_seed_optimizer.html (D382, UI rule 3) */
  .so-dots{color:var(--av-green);letter-spacing:1px}.so-dots i{color:var(--av-gray-300);font-style:normal}
  .so-pill{font-size:11px;padding:1px 7px;border-radius:8px;white-space:nowrap}
  .so-pill.above{background:#eaf7e9;color:#2f7d2b}.so-pill.below{background:#fbe9e7;color:#b3413a}.so-pill.average{background:var(--av-gray-100);color:var(--av-gray-600)}
  .so-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:12px;margin-bottom:10px}
  .so-group{border:1px solid var(--av-gray-300);background:var(--av-gray-50);border-radius:8px;padding:10px 14px 12px;min-width:0}
  .so-group h3{display:flex;justify-content:space-between;align-items:baseline;margin:0 0 8px;font-size:11px;font-weight:700;
    color:var(--av-gray-600);text-transform:uppercase;letter-spacing:0.04em}
  .so-link{font-size:12px;font-weight:500;text-transform:none;letter-spacing:0}
  .so-fields{display:flex;gap:12px;flex-wrap:wrap;align-items:end}
  .so-fields .form-row{margin:0;min-width:0}
  .so-fields select{max-width:100%}
  .so-run{display:flex;justify-content:flex-end;margin:0 0 12px}
  .so-runs{margin-top:14px}.so-runs summary{cursor:pointer;font-weight:600;font-size:14px}
  .so-result{border:1px solid var(--av-gray-300);border-left:4px solid var(--av-green);border-radius:8px;padding:12px 16px;margin:0 0 16px}
  .so-result h3{margin:0 0 8px}
  .so-result-h{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap;margin-bottom:8px}.so-result-h h3{margin:0}
  .so-muted{color:var(--av-gray-600);font-size:12px}
  .so-plans{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px}
  /* D447 (SEED-135 / SEED-136): Custom card + each hybrid vs its +-2 RM peers */
  .so-plan.cus{border:2px dashed #8aa7d6;background:#fbfcff}
  /* D449 (Derek 10/28 "These need to be level across"): each card = 4 sections (numbers / notes / hybrids / button) on shared
     grid rows, so the hybrid lists and the buttons start at the same height; every hybrid row is the same height */
  .so-plans{grid-auto-rows:auto}
  .so-plans > .so-plan{display:grid;grid-row:span 4;grid-template-rows:subgrid;row-gap:0;align-content:start}
  .so-plan > .so-sec{min-width:0}
  .so-plan > .so-act{align-self:end;padding-top:8px}
  .so-plan.ly > .so-ly-main{grid-row:span 3}   /* D539: the Last year card's body spans numbers + notes + hybrids rows: the plan cards' Hybrids lists start right under their numbers */
  .so-ht thead th{height:34px;vertical-align:bottom;white-space:nowrap}
  .so-ht tbody tr{height:124px}
  .so-cut tbody tr:last-child{height:auto}
  .so-plan .so-hyb form{padding:0;margin:0}   /* the Custom table starts level with the others (.so-plan form pads the button) */
  .so-pill.cus{background:#e8effb;color:#2c5aa0}
  .so-warn{background:#fff6e0;color:#8a5a00;border-radius:6px;padding:6px 8px;font-size:11.5px;margin:6px 0}
  .so-bar{position:relative;height:6px;margin:6px 6px 8px;min-width:60px;border-radius:3px;background:linear-gradient(90deg,#f1d4d0,#eceeea 45%,#eceeea 55%,#d5ecd2)}
  .so-bdot{position:absolute;top:-3px;width:10px;height:10px;border-radius:50%;background:var(--av-gray-800,#1d2b22);border:2px solid #fff;box-shadow:0 0 0 1px #1d2b22;transform:translateX(-50%)}
  .so-bavg{position:absolute;top:-2px;width:2px;height:10px;background:var(--av-gray-600,#6b7a70)}
  .so-cmp{font-size:10.5px;line-height:1.35;color:var(--av-gray-600,#6b7a70)}
  .so-cmp .so-top{color:var(--av-green-dark,#2f8a2c)} .so-cmp .so-low{color:var(--av-red,#c0392b)}
  td.num > .so-top{color:var(--av-green-dark,#2f8a2c);font-weight:600} td.num > .so-low{color:var(--av-red,#c0392b)}   /* D451 Value at its RM */
  .so-ht{width:100%;table-layout:fixed}.so-ht th:nth-child(1){width:42%}.so-ht th:nth-child(2){width:18%}
  .so-ht td{overflow-wrap:anywhere}.so-peer{min-width:0}
  .so-cut th:nth-child(1){width:38%}.so-cut th:nth-child(2){width:27%}.so-cut .so-cu{width:46px}
  .so-cu{width:56px;padding:3px 5px;font-size:12px;text-align:right}
  .so-x{background:none;border:0;color:var(--av-gray-600,#6b7a70);cursor:pointer;padding:0 4px;font-size:12px}
  .so-add{width:100%;font-size:12px}
  .so-plan{border:1px solid var(--av-gray-300);border-radius:8px;padding:12px 14px;display:flex;flex-direction:column;gap:2px;min-width:0}
  .so-plan.rec{border:2px solid var(--av-green)}
  .so-plan.ly{border:2px solid #8aa7d6}   /* D505 */
  .so-plan[hidden],.so-yoy[hidden]{display:none}
  .so-yoy{margin:14px 0 4px;padding:12px 14px;border:2px solid #8aa7d6;border-radius:8px}
  .so-yoy h3{margin:0 0 4px}
  .so-yoy-scroll{overflow-x:auto;margin-top:8px}
  .so-yoy-t{width:100%;font-size:13px}
  .so-yoy-h td{font-weight:600;padding-top:10px}
  .so-yoy-t2 td{font-weight:600;border-top:2px solid var(--av-gray-300)}
  /* D505 (Derek 11/06: "if the window needs to expand to show all 5 we have to make it work but has to be readable"): 5 across when they fit */
  .so-plans:has(> .so-plan.ly:not([hidden])){grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:10px}
  .so-plans:has(> .so-plan.ly:not([hidden])) .so-plan{padding:10px 10px}
  .so-plans:has(> .so-plan.ly:not([hidden])) .so-ht{table-layout:fixed;width:100%}
  .so-plans:has(> .so-plan.ly:not([hidden])) .so-ht td,.so-plans:has(> .so-plan.ly:not([hidden])) .so-ht th{overflow-wrap:anywhere;padding-left:3px;padding-right:3px}
  .so-toggles{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 10px}
  .so-tog{min-height:32px;padding:4px 12px;font-size:13px;border:1px solid var(--av-green);border-radius:6px;background:var(--av-green);color:#fff;cursor:pointer}
  .so-tog.off{background:transparent;color:var(--av-gray-600);border-color:var(--av-gray-300)}
  .so-plan-h{display:flex;justify-content:space-between;align-items:center;gap:8px}
  .so-big{font-size:22px;font-weight:700}.so-big span{font-size:13px;font-weight:400;color:var(--av-gray-600)}
  .so-dl{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;margin:10px 0 6px;font-size:13px}
  .so-dl dt{color:var(--av-gray-600)}.so-dl dd{margin:0;text-align:right}
  .so-hyb summary{cursor:pointer;font-size:13px;margin:4px 0}.so-hyb table{width:100%;font-size:12.5px}.so-hyb th{font-size:11px}
  .so-new{font-size:11px;color:var(--av-green)}
  .so-note{font-size:12px;color:var(--av-gold-dark);margin:6px 0 0}
  .so-ly{font-size:12.5px;margin:0 0 12px;color:var(--av-gray-600);display:grid;grid-template-columns:auto minmax(0,1fr);gap:2px 10px}
  .so-ly-h{grid-column:1/-1}
  .so-ly b{color:var(--av-navy)}
  .so-reach{font-size:12.5px;line-height:1.45;border:1px solid var(--av-gold-dark);border-radius:6px;padding:8px 10px;margin:8px 0 0}
  .so-plan form{margin-top:auto;padding-top:10px}
  .so-k{color:var(--av-gray-600);font-size:11px;text-transform:uppercase;letter-spacing:0.03em}
  .so-num{width:70px}
  .so-tiles{display:flex;gap:24px;flex-wrap:wrap;font-size:13px;margin:4px 0 12px}
  .so-tiles .l{color:var(--av-gray-600);font-size:11px;text-transform:uppercase;letter-spacing:.03em}

/* D382: segmented switch (one choice of two or three), e.g. Optimize to Target's Lowest cost | Best return */
.av-seg { display: inline-flex; border: 1px solid var(--av-gray-300); border-radius: 7px; overflow: hidden; margin: 0 0 12px; font-size: 13px; }
.av-seg a { padding: 6px 14px; text-decoration: none; color: var(--av-gray-600); }
.av-seg a.on { background: var(--av-green); color: #0d0d0d; font-weight: 600; }
/* D458 (SEED-140): the arrow at the start of a quote line opens "how this price is figured"; the line's hybrid is a picker */
.line-prod { white-space: nowrap; }
.line-prod .line-hybrid { display: inline-block; vertical-align: middle; }
.line-prod .sa-note { white-space: normal; padding-left: 28px; }
.line-open { width: 24px; height: 24px; padding: 0; margin: 0 4px 0 -4px; border: 0; border-radius: 6px; background: none; color: var(--av-green-dark, #3a9636); cursor: pointer; vertical-align: middle; display: inline-grid; place-items: center; }
.line-open:hover { background: var(--av-green-light, #eaf7e9); }
.line-open:focus-visible { outline: 2px solid var(--av-green-dark, #3a9636); outline-offset: 1px; }
.line-open svg { transition: transform .15s; }
.line-open[aria-expanded="true"] svg { transform: rotate(90deg); }
/* D530: Last year card -- last year's terms, bushels */
.so-ly-terms{background:#eef6ec;border-radius:9px;padding:8px 10px;margin:0 0 8px;font-size:13px}
.so-ly-terms label{display:flex;gap:8px;align-items:center;margin:0}
.so-ly-terms select{width:auto;padding:3px 8px;margin:0}
.so-ly-pay{margin:0}
.so-ly-growth{margin-top:6px}
.so-ok{color:#2f7d32;font-weight:700}
.so-bad{color:#a3241f;font-weight:700}
.so-ly-bu{margin-top:10px;padding-top:8px;border-top:1px solid var(--av-gray-200,#e6e9e2)}
.so-ly-hy{width:100%;font-size:12.5px;margin-top:8px;border-collapse:collapse}
.so-ly-hy td,.so-ly-hy th{padding:3px 2px;border-top:1px solid var(--av-gray-100,#f0f2ee)}
/* D603 (CUS-036): the grower page -- phone first, two columns of lines on a wide screen */
.gp { display: flex; flex-direction: column; gap: 12px; max-width: 1280px; margin: 0 auto; }
.gp .card { margin: 0; padding: 0; overflow: hidden; }
.gp-head { padding: 12px 14px !important; display: flex; flex-direction: column; gap: 8px; }
.gp-sl { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--av-green-dark); }
.gp-row { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.gp-row h1 { margin: 0; font-size: 22px; line-height: 1.15; flex: 1 1 260px; }
.gp-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.gp-facts { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; font-size: 13.5px; color: #3d4440; }
.gp-pill { font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 2px 9px; }
.gp-pill.ok { background: var(--av-green-light); color: #256b22; }
.gp-pill.warn { background: #fde9dc; color: #a2440f; }
.gp-pill.grey { background: var(--av-gray-100); color: #555c58; }
.gp-season { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 700; margin: 0; }
.gp-season select { width: auto; padding: 4px 8px; font-weight: 800; }
.gp-mut { color: var(--av-gray-600); font-weight: 400; font-size: 12.5px; }
.gp-card-h { display: flex; align-items: baseline; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--av-gray-100); flex-wrap: wrap; }
.gp-card-h h2 { font-size: 15px; margin: 0; font-family: var(--font-body); font-weight: 800; }
.gp-lines { display: grid; grid-template-columns: 1fr; }
.gp-ln { display: flex; flex-direction: column; gap: 4px; padding: 11px 14px; border-bottom: 1px solid var(--av-gray-100); min-width: 0; color: inherit; text-decoration: none; }
a.gp-ln:hover { background: #f6faf5; }
.gp-lt { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--av-green-dark); }
.gp-lh { font-size: 15px; font-weight: 700; }
.gp-note { font-size: 12.5px; color: var(--av-gray-600); }
.gp-map { width: 100%; height: auto; max-height: 520px; border-radius: 8px; background: #2e3b2a; display: block; }
.gp-map-small { max-height: 260px; }
.gp-f { fill: rgba(255,255,255,.04); stroke: #fff; stroke-width: 1.3; paint-order: stroke; filter: drop-shadow(0 0 1px #000); vector-effect: non-scaling-stroke; }
.gp-map a:hover .gp-f, .gp-f.on { stroke: #ffd24a; stroke-width: 2.4; }
.gp-legend { display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 12px; color: var(--av-gray-600); align-items: center; }
.gp-sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; border: 1px solid rgba(0,0,0,.25); }
.gp-sw-line { background: #2e3b2a; box-shadow: inset 0 0 0 2px #fff; }
.gp-sw-none { background: rgba(255,255,255,.04); }
.gp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 99px; margin-right: 5px; vertical-align: 0; }
.gp-bars { width: 100%; height: auto; max-height: 160px; }
.gp-bv { font-size: 10px; text-anchor: middle; fill: #3d4440; font-weight: 700; }
.gp-bl { font-size: 10px; text-anchor: middle; fill: #6b736d; }
.gp-soilrow { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; font-size: 12.5px; }
.gp-bandbar { display: flex; height: 16px; border-radius: 4px; overflow: hidden; border: 1px solid rgba(0,0,0,.18); }
.gp-bandbar span { display: block; height: 100%; }
.gp-wx { display: flex; gap: 6px; align-items: flex-end; }
.gp-wm { flex: 1; text-align: center; font-size: 11px; color: var(--av-gray-600); }
.gp-wb { position: relative; height: 76px; border-bottom: 1px solid var(--av-gray-300); }
.gp-wr { position: absolute; bottom: 0; left: 22%; right: 22%; background: #2f7fc1; border-radius: 2px 2px 0 0; }
.gp-wn { position: absolute; left: 10%; right: 10%; height: 0; border-top: 2px dashed #1b231e; }
.gp-gaps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.gp-tbl { width: 100%; font-size: 13px; }
.gp-tbl td, .gp-tbl th { padding: 7px 8px; }
.gp-up { color: #256b22; font-weight: 800; }
.gp-down { color: #a2440f; font-weight: 800; }
.gp-pad { padding: 10px 14px; }
.gp-years { display: flex; flex-direction: column; padding: 4px 14px 12px; }
.gp-yb { display: grid; grid-template-columns: 56px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--av-gray-100); }
.gp-y { font-size: 20px; font-weight: 800; color: var(--av-green-dark); font-variant-numeric: tabular-nums; }
.gp-yh { font-size: 14px; font-weight: 800; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.gp-yb ul { margin: 4px 0 6px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.gp-yb li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; }
.gp-yb li .k { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--av-gray-600); padding-top: 2px; }
.gp-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 10px 14px; border-bottom: 1px solid var(--av-gray-100); margin: 0; }
.gp-pick label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--av-gray-600); min-width: 0; flex: 1 1 140px; }
.gp-pick select { font-size: 13px; font-weight: 700; max-width: 100%; text-transform: none; letter-spacing: 0; }
.gp-pick button { flex: 0 0 auto; }
.gp-res { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; background: #fbfdfb; }
.gp-view { margin: 0; align-self: flex-start; }
.gp-anh { font-size: 12.5px; color: var(--av-gray-600); font-weight: 700; }
.gp-anline { font-size: 14px; font-weight: 700; }
.gp-count { font-size: 12px; }
.gp-early { display: inline-block; font-size: 11px; font-weight: 800; color: #6b4a00; background: #fff4cc; border: 1px solid #e8cc6a; border-radius: 99px; padding: 0 7px; }
.gp-dots { width: 160px; height: 18px; display: block; }
.gp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gp-chip { font-size: 12.5px; background: #fff; border: 1px solid var(--av-gray-300); border-radius: 8px; padding: 3px 8px; }
.gp-all { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .gp-lines { grid-template-columns: 1fr 1fr; }
  .gp-ln { border-right: 1px solid var(--av-gray-100); }
  .gp-ln-map { grid-row: span 4; }
  .gp-all { grid-template-columns: 1fr 1fr; }
  .gp-row h1 { font-size: 26px; }
}
