/* R31 · Swiss wheat as one result field, rather than a claim beside a chart card.
   Load after the R30 editorial stylesheet. Scientific SVG geometry is unchanged. */
body.direction-frontier #wheat-result {
  --wheat-paper: #dce9df;
  --wheat-ink: #173e30;
  --wheat-muted: #3f5c4d;
  --wheat-line: #7b9385;
  --wheat-model: #18654b;
  --wheat-rival: #647b6e;
  --wheat-control: #c4d8ca;
  --paper: var(--wheat-paper);
  --ink: var(--wheat-ink);
  --muted: var(--wheat-muted);
  --line: var(--wheat-line);
  --accent: var(--wheat-ink);
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr) !important;
  gap: clamp(40px, 5vw, 72px) !important;
  align-items: center;
  margin: 0 0 40px;
  padding: clamp(28px, 3.6vw, 48px);
  border: 0;
  background: var(--wheat-paper);
  color: var(--wheat-ink);
}

body.direction-frontier[data-theme="dark"] #wheat-result {
  --wheat-paper: #19382f;
  --wheat-ink: #edf5e9;
  --wheat-muted: #c0d2c4;
  --wheat-line: #76988a;
  --wheat-model: #b8edbb;
  --wheat-rival: #8ba599;
  --wheat-control: #2b4b40;
}

body.direction-frontier #wheat-result .engineering-claim {
  min-width: 0;
  align-self: center;
}

body.direction-frontier #wheat-result .result-type {
  margin: 0 0 24px;
  color: var(--wheat-muted);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .065em;
}

body.direction-frontier #wheat-result .engineering-claim h3 {
  display: block;
  margin: 0;
  color: var(--wheat-ink);
}

body.direction-frontier #wheat-result .engineering-claim h3 strong {
  display: block;
  margin: 0 0 18px;
  font-size: clamp(104px, 10vw, 144px);
  line-height: .88;
  font-weight: 500;
  letter-spacing: -.075em;
  font-variant-numeric: lining-nums tabular-nums;
}

body.direction-frontier #wheat-result .engineering-claim h3 strong span {
  font-size: .43em;
  line-height: 1.35;
  vertical-align: top;
  letter-spacing: -.055em;
}

body.direction-frontier #wheat-result .engineering-claim h3 > span {
  display: block;
  max-width: 310px;
  margin: 0;
  font-size: clamp(23px, 2.1vw, 29px);
  line-height: 1.15;
  letter-spacing: -.035em;
}

body.direction-frontier #wheat-result .engineering-claim > p:not(.result-type) {
  max-width: 36ch;
  margin: 20px 0 0;
  color: var(--wheat-muted);
  font-size: 14px;
  line-height: 1.6;
}

body.direction-frontier #wheat-result .wheat-instrument {
  --paper: var(--wheat-paper);
  --ink: var(--wheat-ink);
  --muted: var(--wheat-muted);
  --line: var(--wheat-line);
  --model: var(--wheat-model);
  --rival: var(--wheat-rival);
  --accent: var(--wheat-ink);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wheat-ink);
}

body.direction-frontier #wheat-result .wheat-instrument figcaption {
  margin: 0 0 20px;
  color: var(--wheat-ink);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -.015em;
}

body.direction-frontier #wheat-result .wheat-instrument figcaption small {
  margin-top: 7px;
  color: var(--wheat-muted);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0;
}

/* A compact segmented control replaces another full-width horizontal rule. */
body.direction-frontier #wheat-result .figure-controls {
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 0;
  background: var(--wheat-control);
}

body.direction-frontier #wheat-result .figure-controls button {
  min-height: 44px;
  padding: 10px 15px;
  border: 0;
  background: transparent;
  color: var(--wheat-ink);
  font-size: 11px;
  line-height: 1.4;
}

body.direction-frontier #wheat-result .figure-controls button[aria-pressed="true"] {
  background: var(--wheat-ink);
  color: var(--wheat-paper);
}

body.direction-frontier #wheat-result .figure-controls button:hover:not([aria-pressed="true"]) {
  text-decoration: underline;
  text-underline-offset: 4px;
}

body.direction-frontier #wheat-result .figure-controls button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -5px !important;
}

body.direction-frontier #wheat-result .wheat-plot {
  display: block;
  width: 100%;
  height: auto;
  margin: 30px 0 4px;
}

body.direction-frontier #wheat-result .wheat-plot .plot-label {
  fill: var(--wheat-ink);
  font-size: 23px;
}

body.direction-frontier #wheat-result .wheat-plot .plot-value {
  fill: var(--wheat-ink);
  font-size: 26px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

body.direction-frontier #wheat-result .wheat-plot .plot-tick {
  fill: var(--wheat-muted);
  font-size: 19px;
}

body.direction-frontier #wheat-result .wheat-plot .plot-grid {
  stroke: var(--wheat-line);
}

body.direction-frontier #wheat-result .measure-bar.model { fill: var(--wheat-model); }
body.direction-frontier #wheat-result .measure-bar.rival { fill: var(--wheat-rival); }

body.direction-frontier #wheat-result .chart-unit-note {
  margin: 0;
  color: var(--wheat-muted);
  font-size: 11px;
  line-height: 1.6;
}

body.direction-frontier #wheat-result .plot-data {
  margin-top: 10px;
  padding: 0;
  border: 0;
  color: var(--wheat-muted);
}

body.direction-frontier #wheat-result .plot-data > summary {
  min-height: 44px;
  color: var(--wheat-ink);
  font-size: 12px;
}

body.direction-frontier #wheat-result .plot-data > summary:focus-visible {
  outline-color: var(--wheat-ink);
  outline-offset: 3px;
}

body.direction-frontier #wheat-result .plot-data :is(th, td, caption) {
  color: var(--wheat-ink);
}

body.direction-frontier #wheat-result .plot-data > p {
  color: var(--wheat-muted);
  line-height: 1.65;
}

@media (max-width: 1000px) {
  body.direction-frontier #wheat-result {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 32px !important;
  }
  body.direction-frontier #wheat-result .engineering-claim {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    column-gap: 32px;
  }
  body.direction-frontier #wheat-result .result-type {
    grid-column: 1 / -1;
    margin-bottom: 20px;
  }
  body.direction-frontier #wheat-result .engineering-claim h3 strong { font-size: 104px; }
  body.direction-frontier #wheat-result .engineering-claim h3 > span { font-size: 25px; }
  body.direction-frontier #wheat-result .engineering-claim > p:not(.result-type) {
    margin: 0;
    max-width: 30ch;
  }
  body.direction-frontier #wheat-result .wheat-instrument figcaption { margin-bottom: 16px; }
  body.direction-frontier #wheat-result .wheat-plot { margin-top: 26px; }
}

@media (max-width: 600px) {
  body.direction-frontier #wheat-result {
    gap: 28px !important;
    margin-bottom: 28px;
    padding: 26px 20px 18px;
  }
  body.direction-frontier #wheat-result .engineering-claim { display: block; }
  body.direction-frontier #wheat-result .result-type { margin-bottom: 20px; font-size: 9px; }
  body.direction-frontier #wheat-result .engineering-claim h3 {
    display: flex;
    align-items: center;
    gap: 22px;
  }
  body.direction-frontier #wheat-result .engineering-claim h3 strong {
    flex: 0 0 auto;
    margin: 0;
    font-size: 84px;
  }
  body.direction-frontier #wheat-result .engineering-claim h3 > span {
    max-width: 12ch;
    font-size: clamp(18px, 4.4vw, 23px);
    line-height: 1.15;
  }
  body.direction-frontier #wheat-result .engineering-claim > p:not(.result-type) {
    max-width: 40ch;
    margin-top: 18px;
    font-size: 13px;
  }
  body.direction-frontier #wheat-result .wheat-instrument figcaption { font-size: 16px; }
  body.direction-frontier #wheat-result .wheat-instrument figcaption small { font-size: 10px; }
  body.direction-frontier #wheat-result .wheat-plot .plot-label { font-size: 34px; }
  body.direction-frontier #wheat-result .wheat-plot .plot-value { font-size: 36px; }
  body.direction-frontier #wheat-result .wheat-plot .plot-tick { font-size: 31px; }
  body.direction-frontier #wheat-result .figure-controls button { padding-inline: 12px; }
  body.direction-frontier #wheat-result .chart-unit-note { font-size: 10px; }
}

@media (max-width: 360px) {
  body.direction-frontier #wheat-result { padding-inline: 16px; }
  body.direction-frontier #wheat-result .engineering-claim h3 { gap: 14px; }
  body.direction-frontier #wheat-result .engineering-claim h3 strong { font-size: 72px; }
  body.direction-frontier #wheat-result .engineering-claim h3 > span { font-size: 17px; }
  body.direction-frontier #wheat-result .figure-controls button { padding-inline: 10px; }
  body.direction-frontier #wheat-result .wheat-plot .plot-label { font-size: 36px; }
  body.direction-frontier #wheat-result .wheat-plot .plot-value { font-size: 38px; }
  body.direction-frontier #wheat-result .wheat-plot .plot-tick { font-size: 34px; }
}

@media (forced-colors: active) {
  body.direction-frontier #wheat-result,
  body.direction-frontier[data-theme] #wheat-result {
    --wheat-paper: Canvas;
    --wheat-ink: CanvasText;
    --wheat-muted: CanvasText;
    --wheat-line: CanvasText;
    --wheat-model: CanvasText;
    --wheat-rival: CanvasText;
    --wheat-control: Canvas;
  }
  body.direction-frontier #wheat-result .figure-controls { border: 1px solid ButtonText; }
  body.direction-frontier #wheat-result .figure-controls button[aria-pressed="true"] {
    border: 2px solid ButtonText;
  }
  body.direction-frontier #wheat-result .measure-bar.rival { fill: Canvas; stroke: CanvasText; }
}
