/* AgroRefiner golden path - the stylesheet.
 *
 * The Lux house style carried onto a screen: Georgia for display, a clean sans
 * for data and controls, one paper, one ink, one accent.
 *
 * Palette, every value checked with the data-viz palette checker against the
 * canvas it sits on:
 *   ink      #1A1A1A  16.67:1   body and display
 *   slate    #4A5568   7.21:1   secondary text
 *   muted    #8A8F9A   3.11:1   hairlines and borders, never text
 *   sand     #F0EEE9            panel fill
 *   hairline #E0DDD8            rules
 *   canvas   #FBFAF7            paper
 *   bronze   #B08968            the active state
 * Series, four with a 0.334 lightness spread, every value direct-labeled so
 * color is never the only channel:
 *   ink #1A1A1A, teal #2F6B6B, oat #8A6B51, red #9B1C1C
 */

:root {
  --ink: #1a1a1a;
  --slate: #4a5568;
  --muted: #8a8f9a;
  --sand: #f0eee9;
  --hairline: #e0ddd8;
  --canvas: #fbfaf7;
  --bronze: #b08968;
  --oat: #8a6b51;
  --red: #9b1c1c;

  /* The AgroRefiner greens, read from Images/Branding/AgroRefiner Logo Dark.svg,
   * which declares #00C48F and #4A4A4A. The logo green measures 2.17:1 on the
   * canvas, so it carries meaning on ink and on dark fills, where it reads
   * 7.70:1. The same hue at lightness 0.22 gives #007052, which measures 5.85:1
   * on the canvas and is what marks and text use. */
  --agro: #00c48f;
  --agro-deep: #007052;
  --agro-mid: #009970;
  --agro-grey: #4a4a4a;
  --teal: #007052;

  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", ui-monospace, monospace;

  --gap: 8px;
  --rule: 1px solid var(--hairline);
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.06), 0 8px 24px rgba(26, 26, 26, 0.08);
  --speed: 180ms;
}

* { box-sizing: border-box; }

html {
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.0625rem);
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  text-rendering: optimizeLegibility;
}

/* Tabular figures everywhere there are numbers, right aligned, decimals
 * stacked. Rule 11 of the data-viz standard. */
.num, td.num, .metric-value, .money {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
td.num, th.num { text-align: right; }

a { color: var(--teal); }
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 100;
  background: var(--ink);
  color: var(--canvas);
  padding: 12px 16px;
  border-radius: 3px;
}

/* ------------------------------------------------------------- login page */
body.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  background: var(--sand);
}
.login-card {
  width: min(420px, 100%);
  background: var(--canvas);
  border: var(--rule);
  border-radius: 4px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-card .eyebrow { margin: 0 0 4px; }
.login-card h1 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  margin: 0 0 4px;
  line-height: 1.2;
  text-wrap: balance;
}
.login-card .sub {
  font-style: italic;
  color: var(--slate);
  margin: 0 0 24px;
}
.login-card label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}
.login-card input {
  width: 100%;
  font: inherit;
  padding: 12px;
  min-height: 48px;
  border: 1px solid var(--muted);
  border-radius: 3px;
  background: var(--canvas);
  color: var(--ink);
}
.login-card button {
  width: 100%;
  margin-top: 16px;
  min-height: 48px;
  font: inherit;
  font-weight: 600;
  color: var(--canvas);
  background: var(--ink);
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity var(--speed) ease-out;
}
.login-card button:hover { opacity: 0.88; }
.login-card .err { color: var(--red); font-size: 0.875rem; }
.login-card .foot-note {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: var(--rule);
  font-size: 0.8125rem;
  color: var(--slate);
}

.eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0;
}

/* ------------------------------------------------------------- the shell */
.shell { max-width: 1480px; margin: 0 auto; padding: 0 20px 80px; }

.masthead {
  padding: 28px 0 18px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0;
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.08;
  margin: 6px 0 4px;
  text-wrap: balance;
}
.masthead .sub {
  font-family: var(--serif);
  font-style: italic;
  color: var(--slate);
  margin: 0;
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.125rem);
}
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  padding: 10px 0 0;
  font-size: 0.75rem;
  color: var(--slate);
}
.meta-strip b {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ------------------------------------------------------------- presets */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  padding: 16px 0;
  border-bottom: var(--rule);
}
.preset {
  font: inherit;
  font-size: 0.875rem;
  padding: 10px 14px;
  min-height: 44px;
  background: var(--canvas);
  border: 1px solid var(--muted);
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background var(--speed) ease-out, border-color var(--speed) ease-out;
}
.preset:hover { background: var(--sand); }
.preset[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--canvas);
  font-weight: 600;
}
.preset .preset-note {
  display: block;
  font-size: 0.6875rem;
  color: var(--slate);
  font-weight: 400;
}
.preset[aria-pressed="true"] .preset-note { color: var(--hairline); }
.preset.recommend { border-color: var(--bronze); border-width: 2px; }

/* ------------------------------------------------------------- the figures */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0;
  border-bottom: var(--rule);
}
.metric {
  padding: 18px 16px 16px 0;
  border-right: var(--rule);
}
.metric:last-child { border-right: 0; }
.metric-label {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 6px;
}
.metric-value {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  line-height: 1.1;
  margin: 0;
}
.metric-sub { font-size: 0.75rem; color: var(--slate); margin: 4px 0 0; }
.metric.is-good .metric-value { color: var(--teal); }
.metric.is-watch .metric-value { color: var(--red); }

/* ------------------------------------------------------------- the layout */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  padding-top: 24px;
  align-items: start;
}
@media (max-width: 1080px) {
  .main-grid { grid-template-columns: minmax(0, 1fr); }
}

section { margin: 0 0 36px; }
h2.sec {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  margin: 0 0 2px;
  padding-bottom: 8px;
  border-bottom: var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
h2.sec .n {
  font-family: var(--sans);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sec-note {
  font-size: 0.8125rem;
  color: var(--slate);
  margin: 10px 0 16px;
  max-inline-size: 72ch;
}

/* ------------------------------------------------------------- the plant */
.plant-wrap {
  position: relative;
  background: var(--sand);
  border: var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.plant-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--plant-bg);
  background-size: cover;
  background-position: center;
  opacity: 0.1;
  pointer-events: none;
}
.plant-scroll {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
#plant { display: block; width: 100%; height: auto; position: relative; }
@media (max-width: 900px) {
  #plant { width: 900px; max-width: none; }
  .plant-hint { display: block; }
}
.plant-hint {
  display: none;
  padding: 8px 14px 0;
  font-size: 0.6875rem;
  color: var(--slate);
}

.node { cursor: pointer; }
.node .node-box {
  fill: var(--canvas);
  stroke: var(--muted);
  stroke-width: 1;
  transition: fill var(--speed) ease-out, stroke var(--speed) ease-out;
}
.node .node-name {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  fill: var(--ink);
  pointer-events: none;
}
.node .node-rate {
  font-family: var(--sans);
  font-size: 9.5px;
  fill: var(--slate);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.node .node-flag {
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-transform: uppercase;
}
.node:hover .node-box, .node:focus .node-box {
  stroke: var(--ink);
  stroke-width: 2;
}
.node.on .node-box { fill: #fff; stroke: var(--bronze); stroke-width: 2.5; }
.node.off .node-box { fill: var(--sand); stroke-dasharray: 3 3; }
.node.off .node-name, .node.off .node-rate { fill: var(--muted); }
.node.constrained .node-box { stroke: var(--red); }
.node .node-badge { fill: var(--bronze); }
.node.off .node-badge { fill: var(--muted); }
.flow { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.flow.hot { stroke: var(--bronze); stroke-width: 2.5; }
.flow.cold { stroke: var(--hairline); stroke-dasharray: 4 4; }
.plant-label {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--muted);
}
.plant-group {
  fill: none;
  stroke: var(--hairline);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 12px 14px;
  border-top: var(--rule);
  background: var(--canvas);
  font-size: 0.75rem;
  color: var(--slate);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch {
  width: 14px;
  height: 10px;
  border: 1px solid var(--muted);
  display: inline-block;
}
.swatch.on { border: 2px solid var(--bronze); background: #fff; }
.swatch.off { border-style: dashed; background: var(--sand); }
.swatch.cons { border-color: var(--red); }

/* ------------------------------------------------------------- the rail */
.rail { position: sticky; top: 16px; }
.panel {
  background: var(--canvas);
  border: var(--rule);
  border-radius: 4px;
  padding: 16px;
  margin-bottom: 16px;
}
.panel.focus { background: var(--sand); }
.panel h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1rem;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: var(--rule);
}
.ctl { margin-bottom: 16px; }
.ctl:last-child { margin-bottom: 0; }
.ctl label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.8125rem;
  margin-bottom: 6px;
}
.ctl label .v {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.ctl input[type="range"] { width: 100%; accent-color: var(--bronze); height: 44px; }
.ctl .hint { font-size: 0.6875rem; color: var(--slate); margin: 2px 0 0; }
.ctl select {
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--muted);
  border-radius: 3px;
  background: var(--canvas);
  color: var(--ink);
}
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 0.8125rem;
  cursor: pointer;
}
.switch input { width: 24px; height: 24px; accent-color: var(--bronze); margin: 0; flex: none; }

/* ------------------------------------------------------------- the bars */
.bars { margin: 0; }
.bar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 8px 0;
  border-bottom: var(--rule);
}
.bar-row:last-child { border-bottom: 0; }
.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.8125rem;
}
.bar-head .bar-val {
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  white-space: nowrap;
}
.bar-track { height: 10px; background: var(--sand); border-radius: 1px; }
.bar-fill {
  height: 100%;
  border-radius: 1px;
  transition: width var(--speed) ease-out;
}
.bar-fill.cap { background: var(--oat); }
.bar-fill.rev { background: var(--teal); }
.bar-fill.ink { background: var(--ink); }
.bar-fill.warn { background: var(--red); }
.bar-note { font-size: 0.6875rem; color: var(--slate); }

/* ------------------------------------------------------------- decisions */
.decisions { display: grid; gap: 16px; }
.decision {
  border: var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.decision > header {
  padding: 14px 16px;
  background: var(--sand);
  border-bottom: var(--rule);
}
.decision h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.0625rem;
  margin: 0 0 6px;
}
.decision .frame {
  font-size: 0.8125rem;
  color: var(--slate);
  margin: 0;
  max-inline-size: 80ch;
}
.opts { display: grid; gap: 0; }
.opt {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: var(--rule);
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  transition: background var(--speed) ease-out;
}
.opt:last-child { border-bottom: 0; }
.opt:hover { background: var(--sand); }
.opt[aria-pressed="true"] { background: #fff; box-shadow: inset 4px 0 0 var(--bronze); }
.opt-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  display: grid;
  place-items: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--slate);
  margin-top: 1px;
}
.opt[aria-pressed="true"] .opt-mark {
  border-color: var(--bronze);
  background: var(--bronze);
  color: #fff;
}
.opt-name { font-weight: 600; font-size: 0.9375rem; }
.opt-gets { font-size: 0.8125rem; color: var(--slate); }
.opt-note { font-size: 0.75rem; color: var(--slate); margin-top: 4px; }
.opt-cost {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
}
.opt-time { font-size: 0.6875rem; color: var(--slate); font-weight: 400; }
.tag {
  display: inline-block;
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: 1px;
}
.tag.rec { background: var(--bronze); color: #fff; }
.tag.quoted { background: var(--sand); color: var(--slate); border: 1px solid var(--hairline); }
.tag.budget { background: none; color: var(--slate); border: 1px dashed var(--muted); }

/* ------------------------------------------------------------- tables */
table.hair {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
table.hair th {
  text-align: left;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  font-weight: 600;
  padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
table.hair td {
  padding: 8px 10px 8px 0;
  border-bottom: var(--rule);
  vertical-align: top;
}
table.hair tr:last-child td { border-bottom: 0; }
table.hair .dim { color: var(--slate); font-size: 0.75rem; }
table.hair tr.sum td {
  border-top: 1px solid var(--ink);
  border-bottom: 0;
  font-weight: 700;
  padding-top: 10px;
}
table.hair tbody tr.is-off td { color: var(--muted); }

/* ------------------------------------------------------------- the sheet */
.sheet-back {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  display: none;
  z-index: 40;
}
.sheet-back[open] { display: block; }
.sheet {
  position: fixed;
  inset: auto 0 0 auto;
  top: 0;
  width: min(560px, 100%);
  height: 100dvh;
  background: var(--canvas);
  border-left: var(--rule);
  box-shadow: var(--shadow);
  overflow-y: auto;
  z-index: 41;
  display: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet[open] { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] { animation: slide-in var(--speed) ease-out; }
  @keyframes slide-in {
    from { transform: translateX(16px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
  }
}
.sheet-shot {
  display: block;
  width: 100%;
  height: auto;
  background: var(--sand);
  border-bottom: var(--rule);
}
.sheet-body { padding: 20px; }
.sheet h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 4px 0 8px;
  line-height: 1.15;
}
.sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(26, 26, 26, 0.72);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.sheet dl { margin: 16px 0 0; }
.sheet dt {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-top: 14px;
}
.sheet dd { margin: 3px 0 0; font-size: 0.875rem; }
.sheet .caption { font-size: 0.6875rem; color: var(--slate); padding: 8px 20px 0; }

/* ------------------------------------------------------------- tooltip */
.tip {
  position: fixed;
  z-index: 50;
  max-width: 280px;
  background: var(--ink);
  color: var(--canvas);
  padding: 10px 12px;
  border-radius: 3px;
  font-size: 0.75rem;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: var(--shadow);
  display: none;
}
.tip[open] { display: block; }
.tip b { display: block; font-size: 0.8125rem; margin-bottom: 3px; }
.tip .tip-rate {
  font-variant-numeric: tabular-nums;
  color: var(--bronze);
  display: block;
  margin-top: 4px;
}

/* ------------------------------------------------------------- footer */
.foot {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
  font-size: 0.75rem;
  color: var(--slate);
}
.foot p { margin: 0 0 6px; max-inline-size: 80ch; }
.source-line { font-size: 0.6875rem; color: var(--slate); margin: 8px 0 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.gallery button {
  padding: 0;
  border: var(--rule);
  background: var(--sand);
  cursor: pointer;
  overflow: hidden;
  border-radius: 3px;
  display: block;
}
.gallery img { display: block; width: 100%; height: auto; }
.gallery figcaption {
  font-size: 0.6875rem;
  color: var(--slate);
  padding: 6px 8px;
  text-align: left;
}

@media (max-width: 640px) {
  .shell { padding: 0 14px 60px; }
  .metric { border-right: 0; border-bottom: var(--rule); padding-right: 0; }
  .opt { grid-template-columns: 24px minmax(0, 1fr); }
  .opt-cost { grid-column: 2; text-align: left; }
}

/* ------------------------------------------------------------------- tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 2px solid var(--ink);
  margin-top: 4px;
}
.tab {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 12px 16px;
  min-height: 44px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--slate);
  cursor: pointer;
  transition: color var(--speed) ease-out, border-color var(--speed) ease-out;
}
.tab:hover { color: var(--ink); background: var(--sand); }
.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--agro-deep);
}
.tab .tab-n {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--canvas);
  background: var(--agro-deep);
  border-radius: 8px;
  padding: 1px 6px;
  vertical-align: 1px;
}
.view[hidden] { display: none; }

/* ------------------------------------------------------------- data layers */
.layer-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.layer {
  font: inherit;
  font-size: 0.75rem;
  padding: 9px 13px;
  min-height: 44px;
  border: 1px solid var(--muted);
  border-radius: 20px;
  background: var(--canvas);
  color: var(--ink);
  cursor: pointer;
  transition: background var(--speed) ease-out;
}
.layer:hover { background: var(--sand); }
.layer[aria-pressed="true"] {
  background: var(--agro-deep);
  border-color: var(--agro-deep);
  color: #fff;
  font-weight: 600;
}

/* ------------------------------------------------------------ process map */
#map, #mind, #tree { display: block; height: auto; }
@media (max-width: 1500px) { #map { width: 1620px; max-width: none; } }
@media (max-width: 1400px) { #mind { width: 1500px; max-width: none; } }
@media (max-width: 1440px) { #tree { width: 1540px; max-width: none; } }
@media (min-width: 1501px) { #map { width: 100%; } }
@media (min-width: 1401px) { #mind { width: 100%; } }
@media (min-width: 1441px) { #tree { width: 100%; } }

.map-band {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--muted);
}
.map-rule { stroke: var(--hairline); stroke-width: 1; }
.map-flow { stroke: var(--muted); stroke-width: 2; fill: none; color: var(--muted); }
.map-flow.hot { stroke: var(--agro-deep); stroke-width: 3; color: var(--agro-deep); }
.map-flow.cold { stroke: var(--hairline); stroke-dasharray: 5 5; color: var(--hairline); }
.map-node { cursor: pointer; }
.map-box {
  fill: var(--canvas);
  stroke: var(--muted);
  stroke-width: 1;
  transition: stroke var(--speed) ease-out;
}
.map-strip { fill: var(--muted); }
.map-node.on .map-box { fill: #fff; stroke: var(--agro-deep); stroke-width: 2; }
.map-node.on .map-strip { fill: var(--agro-deep); }
.map-node.off .map-box { fill: var(--sand); stroke-dasharray: 4 4; }
.map-node.off .map-strip { fill: var(--hairline); }
.map-node.bind .map-box { stroke: var(--red); stroke-width: 2.5; }
.map-node.bind .map-strip { fill: var(--red); }
.map-node:hover .map-box, .map-node:focus .map-box { stroke: var(--ink); stroke-width: 2.5; }
.map-name { font-family: var(--sans); font-size: 15px; font-weight: 700; fill: var(--ink); }
.map-ord { font-family: var(--sans); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; fill: var(--muted); }
.map-key { font-family: var(--sans); font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; fill: var(--slate); }
.map-val { font-family: var(--sans); font-size: 11px; fill: var(--ink); font-variant-numeric: tabular-nums; }
.map-flag { font-family: var(--sans); font-size: 9px; letter-spacing: 0.1em; fill: var(--red); font-weight: 700; }
.map-node.off .map-name, .map-node.off .map-val { fill: var(--slate); }

/* --------------------------------------------------------------- mind map */
.mind-link { fill: none; stroke-linecap: round; opacity: 0.85; }
.mind-twig { fill: none; stroke-width: 2; opacity: 0.6; }
.mind-leaf-box { fill: var(--canvas); stroke: var(--hairline); stroke-width: 1; }
.mind-leaf-text { font-family: var(--sans); font-size: 10.5px; fill: var(--ink); }
.mind-hub-text { font-family: var(--sans); font-size: 13px; font-weight: 700; fill: #fff; }
.mind-core-ring { fill: var(--ink); stroke: var(--agro); stroke-width: 3; }
.mind-core-text { font-family: var(--serif); font-size: 19px; fill: var(--agro); }

/* ----------------------------------------------------------- decision tree */
.tree-edge { fill: none; stroke: var(--muted); stroke-width: 2; color: var(--muted); }
.tree-edge-pill { fill: var(--canvas); stroke: var(--hairline); }
.tree-edge-label { font-family: var(--sans); font-size: 9.5px; fill: var(--slate); font-weight: 600; }
.tree-box { fill: var(--canvas); stroke: var(--muted); stroke-width: 1.5; }
.tree-title { font-family: var(--sans); font-size: 13px; font-weight: 700; fill: var(--ink); }
.tree-sub { font-family: var(--sans); font-size: 10px; fill: var(--slate); }
.tree-node.k-start .tree-box { fill: var(--ink); stroke: var(--ink); }
.tree-node.k-start .tree-title { fill: var(--agro); }
.tree-node.k-start .tree-sub { fill: var(--hairline); }
.tree-node.k-gate .tree-box { fill: var(--sand); stroke: var(--bronze); stroke-width: 2; }
.tree-node.k-work .tree-box { fill: var(--canvas); stroke: var(--slate); }
.tree-node.k-ok .tree-box { fill: #fff; stroke: var(--agro-deep); stroke-width: 2.5; }
.tree-node.k-ok .tree-title { fill: var(--agro-deep); }
.tree-node.k-end .tree-box { fill: var(--sand); stroke: var(--red); stroke-width: 2; stroke-dasharray: 5 4; }
.tree-node.k-goal .tree-box { fill: var(--agro-deep); stroke: var(--agro-deep); }
.tree-node.k-goal .tree-title { fill: #fff; }
.tree-node.k-goal .tree-sub { fill: #d6f5ea; }
.swatch.gate { background: var(--sand); border: 2px solid var(--bronze); }
.swatch.work { background: var(--canvas); border: 1px solid var(--slate); }
.swatch.ok { background: #fff; border: 2px solid var(--agro-deep); }
.swatch.goal { background: var(--agro-deep); border: 1px solid var(--agro-deep); }

/* --------------------------------------------------------------- the steps */
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li {
  counter-increment: s;
  position: relative;
  padding: 14px 0 14px 46px;
  border-bottom: var(--rule);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 13px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--agro-deep);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.steps .step-name { font-weight: 600; font-size: 0.9375rem; }
.steps .step-cost {
  float: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.875rem;
}
.steps .step-note { font-size: 0.8125rem; color: var(--slate); margin-top: 4px; }

/* --------------------------------------------------------------- the labor */
.labor-ctl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  padding: 16px;
  background: var(--sand);
  border: var(--rule);
  border-radius: 4px;
  margin-bottom: 18px;
}
.labor-ctl .ctl { margin-bottom: 0; }

.metric.is-good .metric-value { color: var(--agro-deep); }
.bar-fill.rev { background: var(--agro-deep); }
.preset[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.preset[aria-pressed="true"] .preset-note { color: var(--agro); }
.node.on .node-box { stroke: var(--agro-deep); }
.node .node-badge { fill: var(--agro-deep); }
.flow.hot { stroke: var(--agro-deep); }
.swatch.on { border-color: var(--agro-deep); }
.opt[aria-pressed="true"] { box-shadow: inset 4px 0 0 var(--agro-deep); }
.opt[aria-pressed="true"] .opt-mark { border-color: var(--agro-deep); background: var(--agro-deep); }
.tag.rec { background: var(--agro-deep); }
.decision > header { border-left: 4px solid var(--agro-deep); }
.tip .tip-rate { color: var(--agro); }
