/* Agri-Compa$$ main workspace — streamlined screen layout, 5 November 2026.
   Load after brand-theme.css and access-brand.css. All rules stay inside .app.
   This stylesheet changes spacing and hierarchy, not calculations or input data.
   Controls, validation messages and source explanations remain in the native DOM. */

@media screen {
  .app {
    --ac-shell-height: 76px;
    --ac-workspace-gap: 16px;
    --ac-panel-padding: 16px;
    font-size: 15px;
    line-height: 1.45;
  }

  /* A single compact shell: product, current plan, save state and Plan actions. */
  .app > .topbar.ac-app-header {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    min-height: var(--ac-shell-height);
    height: auto;
    padding: 6px 20px;
    overflow: visible;
  }
  .app > .topbar.ac-app-header .brand {
    flex: 0 0 auto;
    width: 190px;
    max-width: 190px;
    min-width: 0;
    margin: 0;
    padding: 0;
    gap: 0;
  }
  .app > .topbar.ac-app-header .brand-title.ac-brand-lockup {
    flex: 0 0 auto;
    width: 190px;
    max-width: 190px;
    gap: 0;
  }
  .app > .topbar.ac-app-header .brand > img.ac-product-mark,
  .app > .topbar.ac-app-header .brand-title.ac-brand-lockup > img.ac-product-mark {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
  }
  .app > .topbar.ac-app-header .top-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px !important;
    width: auto;
    min-width: 0;
    margin-left: auto;
  }
  .app > .topbar.ac-app-header .active-plan-chip.ac-plan-switch {
    display: flex;
    flex: 0 1 300px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1px;
    width: auto;
    min-width: 150px;
    max-width: 300px;
    min-height: 44px;
    padding: 6px 11px;
    border-radius: 8px;
    text-align: left;
  }
  .app > .topbar.ac-app-header .ac-plan-switch > span { font-size: 10px; line-height: 1.25; }
  .app > .topbar.ac-app-header .ac-plan-switch > b {
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    line-height: 1.35;
  }
  .app > .topbar.ac-app-header .autosave-state {
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.35;
  }
  .app > .topbar.ac-app-header .autosave-state i { width: 6px; height: 6px; }
  .app > .topbar.ac-app-header .save-state.visible {
    max-width: 260px;
    white-space: normal;
    font-size: 12px;
    line-height: 1.4;
  }
  .app > .topbar.ac-app-header > .save-state.visible.ac-save-error { flex: 1 1 100%; width: 100%; max-width: none; margin: 0; }
  .app .ac-plan-actions { position: relative; flex: 0 0 auto; margin: 0; }
  .app .ac-plan-actions > summary {
    list-style-position: inside;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--ac-brand-line);
    border-radius: 8px;
    background: #fff;
    color: var(--ac-brand-forest);
    font: 650 13px/22px var(--ac-font);
    white-space: nowrap;
    cursor: pointer;
  }
  .app .ac-plan-actions > summary:hover,
  .app .ac-plan-actions[open] > summary { background: var(--ac-brand-sage-light); border-color: var(--ac-brand-green); }
  .app .ac-plan-menu {
    position: absolute;
    z-index: 3000;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    gap: 4px;
    width: min(300px, calc(100vw - 24px));
    max-height: calc(100dvh - 100px);
    padding: 8px;
    overflow: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--ac-brand-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px #18543824;
  }
  .app .ac-plan-menu :is(button, a.button, label.button) {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 9px 11px;
    white-space: normal;
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
  }
  .app .ac-plan-menu :is(p, small) { margin: 4px 7px; font-size: 12px; line-height: 1.4; }

  /* A narrower navigation rail gives the actual working area more room. */
  .app > .app-body > .sidebar {
    flex: 0 0 228px;
    width: 228px;
    height: calc(100dvh - var(--ac-shell-height));
    max-height: calc(100dvh - var(--ac-shell-height));
    padding: 12px 10px;
    overflow-y: auto;
  }
  .app .sidebar .s7u-side .s7u-side-menu nav button.s7u-nav-item {
    min-height: 44px !important;
    padding: 8px 10px !important;
    gap: 8px;
    font-size: 13px;
    line-height: 1.35;
  }
  .app .sidebar .s7u-side .e1-nav-label { line-height: 1.35 !important; }
  .app .sidebar .s7u-side .e1-icon { width: 27px; height: 27px; flex-basis: 27px; }
  .app .sidebar .s7u-side .e1-icon svg { width: 19px; height: 19px; }
  .app .sidebar .s7u-side-label { margin: 12px 10px 5px !important; font-size: 10px; }
  .app .sidebar .ac-reports-nav { margin: 12px 0; padding-top: 12px; }
  .app .sidebar .ac-reports-nav > h2 { margin: 0 10px 5px; font-size: 10px; }
  .app .sidebar .s7u-tools { margin-top: 12px; padding-top: 4px; }
  .app .sidebar .s7u-tools > summary { min-height: 44px; padding: 10px; font-size: 13px; }
  .app .sidebar .ac-sidebar-footer {
    flex: 0 0 auto;
    margin: auto 0 0;
    padding: 18px 10px 4px;
    color: var(--ac-brand-muted);
    font-size: 11px;
    line-height: 1.4;
  }
  .app .sidebar .ac-sidebar-footer img {
    display: block;
    width: 130px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }
  .app .sidebar .ac-sidebar-footer p { margin: 7px 0 0; font-size: 11px; line-height: 1.4; }

  /* Shared rhythm: one page heading, moderate card padding, readable data. */
  .app > .app-body > .workspace {
    flex: 1 1 0;
    width: calc(100% - 228px);
    min-width: 0;
    padding: 18px 22px 40px;
  }
  .app .page-stack { gap: var(--ac-workspace-gap); }
  .app .workspace :is(h1, .intro h1, .farm-hero h1, .bms-header h1) {
    font-size: clamp(23px, 2vw, 28px);
    line-height: 1.2;
    letter-spacing: -.025em;
    margin-top: 0;
  }
  .app .workspace :is(h2, .panel h2, .wide-panel h2, .results h2) { font-size: 19px; line-height: 1.3; }
  .app .workspace :is(h3, .chart-card h3, .what-grid h3) { font-size: 16px; line-height: 1.35; }
  .app .workspace p { font-size: 14px; line-height: 1.5; }
  .app .workspace :is(.page-heading p, .intro p, .farm-hero p, .section-title p, .report-note p) {
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.5;
  }
  .app .workspace :is(small, .conversion-note, .chart-note, .formula-note, .field-help, .buy-note p) { font-size: 12px; line-height: 1.45; }
  .app .workspace :is(.page-heading, .panel-head, .section-title) { gap: 10px; }
  .app .workspace .page-heading { margin-bottom: 0; min-height: 0; align-items: flex-start; }
  .app .workspace .page-heading :is(h1, h2) { margin-bottom: 4px; }
  .app .workspace :is(.panel, .wide-panel, .chart-card) { padding: var(--ac-panel-padding); border-radius: 10px; }
  .app .workspace :is(.panel, .wide-panel) > :is(h2, h3):first-child { margin-top: 0; }
  .app .workspace :is(.panel, .wide-panel) > p { margin-top: 6px; margin-bottom: 12px; }
  .app .workspace :is(.panel, .wide-panel) > p:last-child { margin-bottom: 0; }
  .app :is(.button-row, .portfolio-actions) { gap: 8px; }
  .app :is(.button, .q-button),
  .app .gm-module :is(.top-actions button, .panel-head > button, .export, .portfolio-actions button) {
    min-height: 42px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.4;
  }

  /* Saved-plan and reconciliation disclosures keep their controls available. */
  .app .workspace details.ac-home-plans,
  .app .workspace details.ac-context-check,
  .app .workspace details.ac-privacy-details { padding: 0 !important; }
  .app .workspace :is(.ac-home-plans, .ac-context-check, .ac-privacy-details) > summary {
    min-height: 44px;
    padding: 10px 14px;
    color: var(--ac-brand-forest);
    font-size: 13px;
    font-weight: 650;
    line-height: 22px;
    list-style-position: inside;
    cursor: pointer;
  }
  .app .ac-context-check > :not(summary) { margin-left: 14px; margin-right: 14px; }
  .app .ac-context-check > p { margin-top: 8px; margin-bottom: 10px; }
  .app .ac-context-check > :last-child:not(summary) { margin-bottom: 14px; }
  .app .ac-check-state {
    float: right;
    margin-left: 10px;
    padding: 1px 7px;
    border: 1px solid var(--ac-brand-line);
    border-radius: 12px;
    background: var(--ac-brand-cream);
    color: var(--ac-brand-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 20px;
  }
  .app .ac-home-plans .w-current-plan {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr);
    align-items: start;
    gap: 14px;
    margin: 0;
    padding: 12px 16px 16px !important;
    border-top: 1px solid var(--ac-brand-line);
  }
  .app .ac-home-plans .w-current-plan h2 { margin-top: 0; font-size: 17px; }
  .app .q-workbench .q-paddock { margin-top: 8px; padding-top: 0; }
  .app .q-workbench .q-paddock > summary {
    min-height: 44px;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 650;
    line-height: 22px;
    cursor: pointer;
  }
  .app .q-workbench .q-paddock .q-input-grid { margin-top: 8px; }
  .app .ac-paddock-state { float: right; margin-left: 10px; color: var(--ac-brand-muted); font-size: 11px; font-weight: 500; }
  .app > .topbar.ac-app-header .ac-unsaved { color: #895114; }
  .app > .topbar.ac-app-header .ac-unsaved i { background: #a96b20; }
  .app > .topbar.ac-app-header .ac-save-warning {
    min-height: 36px;
    padding: 5px 8px;
    border: 1px solid #d8b785;
    border-radius: 6px;
    background: #fff3df;
    color: #805017;
    white-space: normal;
    font: 600 12px/1.35 var(--ac-font);
    cursor: pointer;
  }

  /* The shared context row expands to reveal real help and example assumptions. */
  .app .ac-workspace-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 12px;
    margin: 0 0 12px;
    min-width: 0;
  }
  .app .ac-example-label { margin-right: auto; font-size: 12px; line-height: 1.4; color: var(--ac-brand-muted); }
  .app .ac-scenario-context { display: flex; flex: 1 1 320px; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
  .app .ac-scenario-context > span { font-size: 12px; line-height: 1.35; }
  .app .ac-scenario-context .scenario-select { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .app .ac-scenario-context .scenario-select > span { font-size: 12px; line-height: 1.35; }
  .app .ac-scenario-context select {
    min-height: 40px;
    min-width: 180px;
    max-width: min(390px, 100%);
    padding: 7px 10px;
    font-size: 14px;
    border: 1px solid var(--ac-brand-field);
    border-radius: 7px;
    background: #fff;
    color: var(--ac-brand-ink);
  }
  .app .ac-screen-help { margin: 0; min-width: 0; max-width: 100%; }
  .app .ac-screen-help > summary {
    list-style-position: inside;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--ac-brand-line);
    border-radius: 7px;
    color: var(--ac-brand-forest);
    background: #fff;
    font-size: 13px;
    font-weight: 650;
    line-height: 22px;
    cursor: pointer;
  }
  .app .ac-screen-help[open] { flex: 1 1 100%; }
  .app .ac-screen-help[open] > summary { background: var(--ac-brand-sage-light); }
  .app .ac-screen-help-body {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    padding: 12px 14px;
    border: 1px solid var(--ac-brand-line);
    border-radius: 8px;
    background: #fff;
  }
  .app .ac-screen-help-body :is(p, ul) { margin-top: 0; margin-bottom: 0; font-size: 13px; line-height: 1.5; }
  .app .ac-screen-help-body .s7u-help { display: block !important; margin: 0; }
  .app .ac-screen-help-body .s7u-help summary { min-height: 40px; padding: 7px 0; }
  .app .ac-screen-help-body .ac-page-video { justify-content: flex-start; margin: 0; }
  .app .ac-screen-help-body .hf-notice { margin: 0; }
  .app .workspace > .hf-error { margin: 0 0 12px; }

  /* Keep the six native stages and every action, without a second large banner. */
  .app .s7u-journey.ac-compact-journey {
    padding: 12px 14px !important;
    margin: 0 0 14px;
    border-top-width: 3px;
  }
  .app .ac-compact-journey .s7u-journey-head { gap: 10px; margin-bottom: 6px !important; }
  .app .ac-compact-journey .e1-journey-title { flex-basis: auto; align-items: center; gap: 9px; }
  .app .ac-compact-journey .e1-journey-title > .e1-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; }
  .app .ac-compact-journey .s7u-journey-head h2 { font-size: 16px !important; line-height: 1.3; margin: 0; }
  .app .ac-compact-journey .s7u-reviewed-count { padding: 3px 8px !important; font-size: 11px !important; }
  .app .ac-compact-journey .s7u-steps {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin: 6px 0 10px !important;
  }
  .app .ac-compact-journey .s7u-steps li { min-width: 0; }
  .app .ac-compact-journey .s7u-step { min-height: 52px !important; padding: 3px 2px !important; gap: 4px !important; }
  .app .ac-compact-journey .s7u-circle { width: 25px !important; height: 25px !important; font-size: 12px !important; }
  .app .ac-compact-journey .s7u-step-label { min-height: 0; font-size: 12px !important; line-height: 1.25 !important; }
  .app .ac-compact-journey .s7u-steps li:not(:last-child)::after { top: 16px; }
  .app .ac-compact-journey .s7u-subpages { gap: 6px; margin: 6px 0; }
  .app .ac-compact-journey .s7u-subpages .button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  .app .ac-compact-journey .s7u-attention { margin: 8px 0; padding: 6px 10px; font-size: 12px; }
  .app .ac-compact-journey .s7u-attention summary { min-height: 36px; padding: 5px 0; }
  .app .ac-compact-journey .s7u-actions {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px !important;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--ac-brand-line);
  }
  .app .ac-compact-journey .s7u-actions .button { min-height: 40px !important; padding: 7px 11px !important; font-size: 12px; }
  .app .ac-compact-journey .s7u-actions .button.primary { margin-left: auto; grid-column: auto; }

  /* Home: work choices first; the worked example is a compact optional section. */
  .app .w-home .page-heading { padding: 0 !important; }
  .app .w-current-plan,
  .app .x-task-grid > .w-task { padding: 16px !important; }
  .app .x-task-grid { gap: 14px; }
  .app .x-task-grid .w-task { gap: 9px; }
  .app .x-task-grid h2 { font-size: 18px !important; line-height: 1.3; }
  .app .w-task > .e1-icon { width: 33px; height: 33px; flex-basis: 33px; border-radius: 9px; }
  .app .w-task p { font-size: 13px; line-height: 1.45; }
  .app .ac-task-actions { gap: 7px; padding-top: 4px; }
  .app .ac-task-actions > .button { width: auto; }
  .app .ac-task-actions .ac-video-link { padding: 7px 9px; font-size: 12px; }
  .app .w-current-plan { gap: 18px; }
  .app .hf-card.ac-home-example { padding: 14px 16px !important; }
  .app .ac-home-example .hf-card-heading { align-items: center; gap: 12px; }
  .app .ac-home-example .hf-card-heading h2 { margin: 0 0 3px; font-size: 19px; line-height: 1.3; }
  .app .ac-home-example .hf-card-heading p { margin: 3px 0; font-size: 13px; line-height: 1.45; }
  .app .ac-home-example .button-row { margin: 9px 0 0; gap: 7px; }
  .app .ac-home-example :is(.hf-example-details, .ac-example-details) { margin-top: 10px; }
  .app .ac-home-example :is(.hf-example-details, .ac-example-details) > summary { min-height: 40px; padding: 8px 0; font-size: 13px; }
  .app .ac-home-example .hf-facts { margin: 12px 0; gap: 8px 20px; font-size: 13px; }
  .app .ac-home-example .hf-badge { font-size: 11px; padding: 5px 8px; }

  /* Crop inputs and all machinery forms: moderate density, complete labels. */
  .app .form-grid,
  .app .s4-workspace .form-grid.two,
  .app .s6-workspace .s6-grid { gap: 14px 16px; }
  .app .workspace :is(.field, .select-field, .sp-field, .gm-budget-field) { gap: 5px; min-width: 0; }
  .app .workspace :is(.field > label, .field > span:first-child, .select-field > span:first-child, .sp-field > span:first-child) {
    font-size: 13px;
    line-height: 1.4;
  }
  .app .workspace :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea) {
    min-height: 42px;
    padding: 8px 10px;
    font-size: 15px;
    line-height: 1.4;
  }
  .app .workspace :is(.field small, .field-help, .conversion-note, .s5-pending) { font-size: 12px; line-height: 1.4; }
  .app .gm-module :is(.field em, .sp-field em) { padding: 8px; font-size: 12px; }
  .app .gm-module :is(.wide-panel, .relative-risk-panel) { padding: 16px !important; }
  .app .gm-module .s7u-crop-guide { gap: 8px !important; margin-bottom: 12px !important; padding: 9px 10px !important; }
  .app .gm-module .s7u-crop-guide nav { gap: 6px !important; }
  .app .gm-module .s7u-crop-guide nav .button { padding: 6px 9px !important; min-height: 38px !important; font-size: 12px; }
  .app .gm-module > .topbar {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 12px;
    height: auto;
    min-height: 0;
    padding: 9px 12px;
    margin: 0 0 12px;
    border: 1px solid var(--ac-brand-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
  }
  .app .gm-module > .topbar .top-actions { display: flex; flex: 1 1 auto; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 7px !important; }
  .app .gm-module > .topbar .top-actions button { min-height: 38px; padding: 6px 10px; font-size: 12px; }
  .app .gm-module > .topbar .fixture-status { font-size: 11px; line-height: 1.4; margin-right: auto; }
  .app .gm-module > .topbar .shopping-alert { flex: 1 1 100%; margin: 0; }
  .app .gm-module > .topbar .brand { gap: 8px; font-size: 13px; }
  .app .gm-module > .topbar .brand b { font-size: 13px; }
  .app .gm-module > .topbar .brand span { font-size: 11px; }
  .app .gm-module :is(.gm-budget-head, .gm-quick-cost-head, .line-head) { gap: 8px; }
  .app .gm-module :is(.gm-budget-head, .gm-quick-cost-head) h3 { font-size: 16px; }
  .app .gm-module :is(.gm-machinery-editor, .gm-seed-levy) { margin: 14px 0; padding: 14px; }
  .app .gm-module .gm-machine-card { margin: 12px 0; gap: 12px; padding: 12px; }
  .app .gm-module .ac-input-category > :is(.line-head, .gm-budget-head) { min-height: 48px; padding: 8px 11px !important; }
  .app .gm-module .ac-input-category-toggle { min-height: 36px; padding: 6px 10px; font-size: 12px; }
  .app .s4-pickers { gap: 10px; }
  .app .e2-scope { gap: 8px 12px !important; padding: 10px 12px !important; }
  .app .e2-scope .field { margin-top: 0; }
  .app .e2-scope h2 { font-size: 14px !important; }
  .app .e2-scope p { font-size: 12px !important; }
  .app .e2-cards { gap: 12px; margin: 12px 0; }
  .app .e2-card { padding: 12px; }
  .app .e2-card h3 { margin: 0 0 5px; font-size: 15px; }
  .app .e2-card p { margin: 5px 0; font-size: 13px; }
  .app .e3-allocation { gap: 12px; padding: 12px 0; }
  .app .e4-handoff { padding: 12px 14px; }
  .app .e4-handoff h2 { font-size: 16px; }

  /* Compact scenario management and seasonal controls without hiding messages. */
  .app .s4-workspace .s5-scenario-controls {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr);
    align-items: end;
    gap: 10px 16px;
    margin-bottom: 14px;
    padding: 12px 14px;
  }
  .app .s5-scenario-controls > .field { margin: 0; }
  .app .s4-workspace .s5-scenario-controls > details { margin: 0; }
  .app .s5-scenario-controls > details > summary {
    min-height: 42px;
    padding: 9px 0;
    font-size: 13px;
    line-height: 22px;
    list-style-position: inside;
  }
  .app .s5-scenario-controls > details[open],
  .app .s5-scenario-controls > [role="status"] { grid-column: 1 / -1; }
  .app .s5-scenario-controls > details[open] > .form-grid { margin: 10px 0 14px; }
  .app .s4-workspace .s4-pickers { margin-bottom: 12px; gap: 12px; }
  .app .gm-module > .topbar.ac-module-toolbar { padding: 5px 10px; min-height: 48px; gap: 6px 10px; }
  .app .gm-module > .topbar.ac-module-toolbar > h2 { margin: 0; font-size: 16px; line-height: 1.3; }
  .app .ac-crop-actions > summary { min-height: 36px; padding: 6px 10px; font-size: 12px; line-height: 22px; }
  .app .season-planner { gap: 14px; }
  .app .season-planner > .sp-title { margin: 0; padding: 0; }
  .app .season-planner > .sp-title p:last-child { margin-bottom: 0; }
  .app .season-planner > .gm-season-bar { margin: 0; }
  .app .season-planner > .gm-season-save-status:empty {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .app .season-planner .gm-season-frequency { margin: 0; padding: 8px 12px; }
  .app .season-planner .gm-season-quick { margin: 0; padding: 14px; }
  .app .season-planner .gm-season-quick-row { padding: 12px 0; gap: 10px; }

  /* The crop summary uses a dark surface; its old light-card ink must not leak in. */
  .app .workspace .gm-module aside.results,
  .app .workspace .gm-module .detail-workspace > aside.results {
    background: var(--ac-brand-forest);
    color: #fff;
    --muted: #dce8df;
  }
  .app .workspace .gm-module aside.results :is(h2, h3, .step.light),
  .app .workspace .gm-module aside.results .hero-result :is(span, em),
  .app .workspace .gm-module aside.results .crop-result-metrics :is(span, b),
  .app .workspace .gm-module aside.results .whole :is(span, small) { color: #f1f6ee !important; opacity: 1; }
  .app .workspace .gm-module aside.results .hero-result strong,
  .app .workspace .gm-module aside.results .whole strong { color: #f3d37b; }
  .app .workspace .gm-module .farm-kpis .accent { color: #fff; --muted: #dce8df; }
  .app .workspace .gm-module .farm-kpis .accent :is(span, strong, small) { color: #f1f6ee; }
  .app .workspace .gm-module .farm-table tfoot { color: #fff; --muted: #dce8df; }
  .app .workspace .gm-module .farm-table tfoot :is(th, td) { background: transparent; color: inherit; }
  .app .workspace .gm-module .farm-table tfoot small { color: #dce8df; }
  .app .workspace .scenario-tag { color: #fff; --muted: #dce8df; }
  .app .workspace .scenario-tag :is(span, b, strong, small) { color: inherit; }
  .app .workspace .gm-module :is(aside.results, .farm-table tfoot, .farm-kpis .accent) :is(.negative, .negative-value, .is-negative, .loss, .w-loss, .q-loss, .sp-loss) {
    color: #ffd0c5 !important;
  }

  /* Tables retain their units and numerical columns; scrolling stays local. */
  .app .workspace :is(.table-scroll, .table-wrap, .q-table-scroll, .bms-table-wrap) { max-width: 100%; overflow-x: auto; }
  .app .workspace table { font-size: 13px; line-height: 1.4; }
  .app .workspace table :is(th, td) { padding: 9px 10px; font-size: 13px; line-height: 1.4; }
  .app .workspace table thead th { font-size: 12px; line-height: 1.35; }
  .app .workspace table caption { padding-bottom: 8px; font-size: 12px; line-height: 1.45; }
  .app .workspace table .button { min-height: 36px; padding: 6px 9px; font-size: 12px; }
  .app .workspace table :is(input, select) { font-size: 14px; }
  .app .gm-module .gm-quick-cost-table { min-width: 1120px; }
  .app .gm-module .gm-quick-cost-table :is(th, td) { padding: 8px; }
  .app .gm-module .gm-quick-cost-table :is(th, td):first-child { min-width: 155px; }
  .app .gm-module .gm-inline-edit-cell { min-width: 96px; }
  .app .gm-module .gm-inline-value { min-height: 40px; height: 40px; padding: 7px 8px; font-size: 14px; }
  .app .workspace :is(.metrics, .dashboard-kpis, .w-summary) { gap: 12px; }
  .app .workspace :is(.metric, .metrics > .panel, .dashboard-kpis > div, .w-summary > div) { padding: 14px; }
  .app .workspace :is(.metric strong, .metric b, .metrics > .panel h2, .dashboard-kpis strong, .w-summary b, .farm-kpis strong, .input-cards strong, .scenario-summary strong, .compare-grid article > strong) {
    font-size: clamp(21px, 1.9vw, 26px);
    line-height: 1.2;
  }

  /* Reports, risk, cash and the snapshot share the same compact section rhythm. */
  .app .ac-report-grid { gap: 14px; }
  .app .ac-report-card h2 { margin-bottom: 6px; font-size: 18px; }
  .app .ac-report-card p { margin-bottom: 12px; font-size: 13px; }
  .app .ac-report-context { margin-top: 4px; font-size: 12px; }
  .app .q-workbench { padding: 16px; border-radius: 10px; }
  .app .q-workbench .q-heading { margin-bottom: 10px; gap: 10px; }
  .app .q-workbench .q-heading h2 { margin: 0 0 5px; font-size: 19px; }
  .app .q-workbench .q-heading p { margin: 5px 0; font-size: 13px; }
  .app .q-workbench .q-toolbar { gap: 8px 10px; margin: 6px 0 12px; padding: 10px 0; }
  .app .q-workbench .q-toolbar .q-field { gap: 4px; }
  .app .q-workbench .q-field > span { font-size: 12px; }
  .app .q-workbench .q-field :is(input, select) { min-height: 42px; padding: 8px 10px; }
  .app .q-workbench .q-basis { padding: 10px 12px; font-size: 13px; }
  .app .q-workbench :is(.q-profile, .q-matrix-section, .q-panel) { margin-top: 18px; padding-top: 16px; }
  .app .q-workbench .q-profile-grid { gap: 14px; margin: 14px 0; }
  .app .q-workbench .q-score { padding: 16px; }
  .app .q-workbench .q-score h4 { font-size: 16px; }
  .app .q-workbench .q-metrics { gap: 10px; margin: 12px 0; }
  .app .q-workbench .q-metrics > div { padding: 12px; }
  .app .q-workbench .q-input-grid { gap: 14px 16px; }
  /* Five crop factors need readable selects, not five squeezed columns. */
  .app .gm-module .mallee-matrix .paddock-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
  .app .gm-module .mallee-matrix .paddock-fields label { min-width: 0; }
  .app .gm-module .mallee-matrix .paddock-fields select {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 10px;
    font-size: 14px;
  }
  .app .ac-journey-map { margin: 0; }
  .app .ac-journey-map > summary { display: none; }

  .app .q-workbench .q-crop-assessment { padding: 14px; }
  .app .q-workbench :is(.q-warning, .q-notice, .q-connection) { padding: 10px 12px; font-size: 13px; line-height: 1.5; }
  .app .w-cost-review h2,
  .app .s6-link h2 { font-size: 17px; }
  .app .bms-snapshot { width: 100%; max-width: none; padding: 0; margin: 0; }
  .app .bms-header { gap: 12px; margin-bottom: 10px; }
  .app .bms-header h1 { font-size: clamp(23px, 2vw, 28px); }
  .app .bms-farm-name { margin-top: 4px; font-size: 13px; }
  .app .bms-intro { margin-bottom: 14px; font-size: 13px; }
  .app .bms-denominators { gap: 10px; margin-bottom: 16px; }
  .app .bms-denominator { padding: 12px; }
  .app .bms-denominator dt { font-size: 12px; }
  .app .bms-denominator dd { margin: 6px 0 4px; font-size: 23px; }
  .app .bms-denominator small { font-size: 11px; line-height: 1.4; }
  .app :is(.bms-panel, .bms-chart) { padding: 16px; margin-bottom: 16px; }
  .app .bms-details { margin-bottom: 16px; }
  .app .bms-details summary { padding: 11px 14px; min-height: 44px; font-size: 13px; }
  .app .bms-details-body { padding: 14px; }
  .app .bms-bars { gap: 14px; }
  .app .bms-bar-track { height: 26px; }
  .app .bms-chart figcaption { margin-top: 14px; font-size: 12px; }
  .app .bms-operation-cards { gap: 12px; margin-top: 14px; }
  .app .bms-operation-card { padding: 14px; }
  .app .bms-operation-card strong { font-size: 24px; }
  .app .bms-labour-settings { padding: 14px; }
  .app .bms-actions button { min-height: 40px; padding: 7px 11px; font-size: 12px; }
  .app .data-privacy-page .share-panel { padding: 14px 16px !important; }
  .app .privacy-summary-grid { gap: 12px; }
  .app .privacy-summary-grid article { padding: 12px !important; }
  .app .ac-privacy-details > .privacy-summary-grid { margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--ac-brand-line); }
  .app .help-resource-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; }
  .app .help-resource-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px 10px;
    border: 1px solid var(--ac-brand-line);
    border-radius: 7px;
    background: #fff;
    color: var(--ac-brand-forest);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.4;
  }
  .app .help-resource-links a:hover { background: var(--ac-brand-sage-light); border-color: var(--ac-brand-green); }


  @media (min-width: 901px) {
    .app .sidebar .s7u-side-menu {
      display: flex !important;
      flex-direction: column;
      gap: 0 !important;
      min-height: calc(100dvh - var(--ac-shell-height) - 24px);
    }
    .app .x-task-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .app .ac-compact-journey .s7u-steps { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .app .ac-compact-journey .s7u-steps li:nth-child(3)::after { display: block; }
  }
  @media (max-width: 1100px) and (min-width: 901px) {
    .app > .topbar.ac-app-header { gap: 12px; }
    .app > .topbar.ac-app-header .active-plan-chip.ac-plan-switch { max-width: 260px; }
    .app > .app-body > .sidebar { flex-basis: 214px; width: 214px; }
    .app > .app-body > .workspace { width: calc(100% - 214px); padding: 16px 18px 36px; }
    .app .x-task-grid { gap: 12px; }
    .app .x-task-grid > .w-task { padding: 14px !important; }
    .app .x-task-grid h2 { font-size: 16px !important; }
  }
  @media (max-width: 1100px) and (min-width: 651px) {
    .app .gm-module .mallee-matrix .paddock-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 900px) and (min-width: 651px) {
    .app > .topbar.ac-app-header { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
    .app > .topbar.ac-app-header .top-actions { width: 100%; min-width: 0; }
    .app > .topbar.ac-app-header .active-plan-chip.ac-plan-switch { flex: 1 1 auto; min-width: 0; max-width: 300px; }
    .app > .topbar.ac-app-header > .save-state.visible.ac-save-error { grid-column: 1 / -1; }
  }
  @media (max-width: 900px) {
    .app > .topbar.ac-app-header { padding: 6px 14px; gap: 10px 14px; }
    .app > .topbar.ac-app-header .brand,
    .app > .topbar.ac-app-header .brand > img.ac-product-mark,
    .app > .topbar.ac-app-header .brand-title.ac-brand-lockup,
    .app > .topbar.ac-app-header .brand-title.ac-brand-lockup > img.ac-product-mark { width: 180px; max-width: 180px; }
    .app > .topbar.ac-app-header .active-plan-chip.ac-plan-switch { max-width: 300px; min-width: 0; }
    .app > .app-body > .sidebar { width: 100%; height: auto; max-height: none; padding: 4px 14px; overflow: visible; }
    .app > .app-body > .workspace { width: 100%; padding: 16px 18px 32px; }
    .app .sidebar .s7u-mobile-toggle { min-height: 44px; padding: 7px 2px; font-size: 14px; }
    .app .sidebar .s7u-mobile-toggle small { font-size: 11px; }
    .app .sidebar .s7u-side-menu.is-open { padding: 6px 0 12px; }
    .app .sidebar .ac-sidebar-footer { padding: 14px 10px 6px; }
    .app .x-task-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .app .x-task-grid h2 { font-size: 17px !important; }
    .app .e2-scope { grid-template-columns: minmax(0, 1fr) auto !important; }
    .app .e2-scope .field { grid-column: 1 / -1; }
  }
  @media (max-width: 650px) {
    .app { --ac-panel-padding: 14px; --ac-workspace-gap: 14px; }
    .app > .topbar.ac-app-header {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 4px 10px;
      min-height: 0;
      padding: 6px 12px;
    }
    .app > .topbar.ac-app-header .brand { grid-column: 1; grid-row: 1; justify-self: start; }
    .app > .topbar.ac-app-header .brand,
    .app > .topbar.ac-app-header .brand > img.ac-product-mark,
    .app > .topbar.ac-app-header .brand-title.ac-brand-lockup,
    .app > .topbar.ac-app-header .brand-title.ac-brand-lockup > img.ac-product-mark { width: 150px; max-width: 150px; }
    .app > .topbar.ac-app-header .top-actions { display: contents; }
    .app > .topbar.ac-app-header .autosave-state { grid-column: 2; grid-row: 2; justify-self: end; font-size: 11px; }
    .app > .topbar.ac-app-header .autosave-state.ac-unsaved { grid-column: 1 / -1; grid-row: 3; justify-self: stretch; white-space: normal; }
    .app > .topbar.ac-app-header .ac-unsaved .ac-save-warning { flex: 1; text-align: left; }
    .app > .topbar.ac-app-header .active-plan-chip.ac-plan-switch {
      grid-column: 1;
      grid-row: 2;
      min-width: 0;
      width: 100%;
      max-width: none;
      min-height: 44px;
      padding: 5px 9px;
    }
    .app > .topbar.ac-app-header .ac-plan-actions { grid-column: 2; grid-row: 1; justify-self: end; }
    .app > .topbar.ac-app-header .ac-plan-actions > summary { padding: 10px; font-size: 12px; }
    .app > .topbar.ac-app-header .save-state.visible { grid-column: 1 / -1; max-width: none; }
    .app .ac-plan-menu { max-height: min(60dvh, 420px); }
    .app > .app-body > .workspace { padding: 13px 12px 28px; }
    .app > .app-body > .sidebar { padding: 4px 12px; }
    .app .workspace :is(h1, .intro h1, .farm-hero h1, .bms-header h1) { font-size: 23px; }
    .app .workspace :is(h2, .panel h2, .wide-panel h2, .results h2) { font-size: 18px; }
    .app .workspace .page-heading { flex-wrap: wrap; gap: 8px; }
    .app .workspace .page-heading > div { min-width: 0; }
    .app :is(.button, .q-button),
    .app .gm-module :is(.top-actions button, .panel-head > button, .export, .portfolio-actions button) { min-height: 44px; }
    .app .workspace :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea),
    .app .workspace table :is(input, select),
    .app .q-workbench .q-field :is(input, select) { min-height: 44px; font-size: 16px; }
    .app .workspace .form-grid.four,
    .app .workspace .form-grid.two,
    .app .s6-workspace .s6-grid { grid-template-columns: minmax(0, 1fr); }
    .app .ac-workspace-tools { margin-bottom: 10px; gap: 7px; }
    .app .ac-scenario-context { flex-basis: 100%; }
    .app .ac-scenario-context select { width: 100%; min-width: 0; max-width: 100%; font-size: 16px; min-height: 44px; }
    .app .ac-example-label { flex: 1 1 130px; }
    .app .ac-screen-help > summary { min-height: 44px; }
    .app .ac-screen-help-body { padding: 10px; }
    .app .ac-compact-journey { padding: 10px !important; }
    .app .ac-journey-map > summary {
      display: list-item;
      list-style-position: inside;
      min-height: 44px;
      margin: 6px 0;
      padding: 10px;
      border: 1px solid var(--ac-brand-line);
      border-radius: 7px;
      background: var(--ac-brand-sage-light);
      color: var(--ac-brand-forest);
      font: 650 13px/22px var(--ac-font);
      cursor: pointer;
    }
    .app .ac-journey-map > summary:hover { border-color: var(--ac-brand-green); }
    .app .ac-compact-journey .s7u-steps::before,
    .app .ac-compact-journey .s7u-steps::after,
    .app .ac-compact-journey .s7u-steps li::before,
    .app .ac-compact-journey .s7u-steps li::after,
    .app .ac-compact-journey .s7u-step::before,
    .app .ac-compact-journey .s7u-step::after { display: none !important; }
    .app .gm-module .mallee-matrix .paddock-fields { grid-template-columns: minmax(0, 1fr); }
    .app .gm-module .mallee-matrix .paddock-fields select { min-height: 44px; font-size: 16px; }

    .app .ac-compact-journey .s7u-journey-head h2 { font-size: 15px !important; }
    .app .ac-compact-journey .s7u-steps { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px !important; margin: 5px 0 8px !important; }
    .app .ac-compact-journey .s7u-step { min-height: 56px !important; padding: 5px 3px !important; }
    .app .ac-compact-journey .s7u-circle { width: 22px !important; height: 22px !important; font-size: 11px !important; }
    .app .ac-compact-journey .s7u-step-label { font-size: 11px !important; line-height: 1.2 !important; }
    .app .ac-compact-journey .s7u-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px !important; padding-top: 7px; }
    .app .ac-compact-journey .s7u-actions .button { min-height: 44px !important; padding: 7px 8px !important; width: 100%; font-size: 12px; }
    .app .ac-compact-journey .s7u-actions .button.primary { grid-column: auto; margin-left: 0; }
    .app .ac-compact-journey .s7u-subpages .button,
    .app .ac-compact-journey .s7u-attention summary { min-height: 44px; }
    .app .x-task-grid { grid-template-columns: minmax(0, 1fr); }
    .app .x-task-grid .w-task { gap: 8px; }
    .app .x-task-grid > .w-task,
    .app .w-current-plan { padding: 14px !important; }
    .app .ac-task-actions > .button { flex: 1 1 auto; }
    .app .hf-card.ac-home-example { padding: 13px 14px !important; }
    .app .ac-home-example .hf-card-heading { display: block; }
    .app .ac-home-example .hf-card .button-row { flex-wrap: wrap; }
    .app .gm-module > .topbar { padding: 9px 10px; }
    .app .gm-module > .topbar .top-actions { justify-content: flex-start; }
    .app .gm-module > .topbar .fixture-status { flex-basis: 100%; }
    .app .gm-module > .topbar .top-actions button { min-height: 44px; }
    .app .gm-module :is(.wide-panel, .relative-risk-panel) { padding: 14px !important; }
    .app .gm-module .s7u-crop-guide nav .button { min-height: 44px !important; }
    .app .gm-module .ac-input-category-toggle { width: auto; min-height: 44px; }
    .app .e2-scope { grid-template-columns: minmax(0, 1fr) !important; }
    .app .e2-scope .field { grid-column: auto; }
    .app .e2-scope .button-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app .e2-scope .button { width: 100%; min-width: 0; }
    .app .q-workbench { padding: 14px; }
    .app .q-workbench .q-toolbar { gap: 10px; }
    .app .q-workbench .q-profile-grid { gap: 12px; }
    .app .q-workbench .q-score { padding: 14px; }
    .app .q-workbench .q-paddock > summary { padding: 8px 0; }
    .app .ac-paddock-state { float: none; display: block; margin: 2px 0 0 16px; }
    .app .ac-home-plans .w-current-plan { grid-template-columns: minmax(0, 1fr); padding: 12px !important; }
    .app .ac-check-state { max-width: 54%; }
    .app .s4-workspace .s5-scenario-controls { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
    .app .s5-scenario-controls > details > summary { min-height: 44px; }
    .app .ac-crop-actions > summary { min-height: 44px; padding: 10px; }
    .app > .topbar.ac-app-header .ac-save-warning { min-height: 44px; }
    .app .season-planner .gm-season-quick { padding: 12px; }
    .app .q-workbench .q-input-grid,
    .app .q-workbench .q-metrics { grid-template-columns: minmax(0, 1fr); }
    .app .help-resource-links a { min-height: 44px; }
    .app .ac-privacy-details > .privacy-summary-grid { padding: 12px; }
    .app .bms-header { gap: 9px; }
    .app .bms-actions { margin-top: 9px; }
    .app .bms-actions button { min-height: 44px; }
    .app .bms-denominators { gap: 8px; }
    .app .bms-denominator { padding: 10px; }
    .app .bms-denominator dd { font-size: 20px; }
    .app :is(.bms-panel, .bms-chart) { padding: 12px; }
    .app .bms-details-body { padding: 12px; }
    .app .bms-bar-track { height: 24px; }
    .app .bms-operation-card { padding: 12px; }
  }
}

@media print {
  .app .gm-module .detail-workspace > aside.results { background: #185438 !important; color: #fff; }
  .app .gm-module .detail-workspace > aside.results :is(h2, h3, .step.light),
  .app .gm-module .detail-workspace > aside.results .hero-result :is(span, em),
  .app .gm-module .detail-workspace > aside.results .crop-result-metrics :is(span, b),
  .app .gm-module .detail-workspace > aside.results .whole :is(span, small) { color: #f1f6ee !important; opacity: 1; }
  .app .gm-module .detail-workspace > aside.results :is(.hero-result, .whole) strong { color: #f3d37b !important; }
  .app .gm-module .detail-workspace > aside.results :is(.negative, .negative-value, .is-negative, .loss, .w-loss, .q-loss, .sp-loss),
  .app .gm-module .detail-workspace > aside.results :is(.hero-result, .whole, .crop-result-metrics) :is(.negative, .negative-value, .is-negative, .loss, .w-loss, .q-loss, .sp-loss) { color: #ffd0c5 !important; }
  .app .ac-plan-actions,
  .app .ac-sidebar-footer { display: none !important; }
  .app details.ac-privacy-details { display: block; }
  .app details.ac-privacy-details::details-content { display: block !important; content-visibility: visible !important; height: auto !important; }
  .app details.ac-privacy-details > :not(summary) { display: block !important; }
  .app details.ac-privacy-details > .privacy-summary-grid { display: grid !important; }
  .app details.ac-privacy-details > summary { list-style: none; padding-bottom: 8px; }
}
