/* Agrotest reference: #398039 green, floating white panels, Roboto type,
   10px corners and a 93px header. No external assets or font requests. */
:root {
  color-scheme: light;
  --green: #398039; --green-dark: #26602e; --green-light: #edf5eb;
  --ink: #292b29; --muted: #626b63; --paper: #fff; --canvas: #efefef;
  --line: #dde3dd; --ok: #26602e; --bad: #a12d29; --focus: #195cac;
  --shadow: 2px 2px 8px #2438240c; --radius: 10px;
  font-family: Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.5; }
a { color: var(--green-dark); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, select, input:not([type='checkbox']):not([type='radio']), textarea { min-height: 44px; }
button, select, input, textarea { border: 1px solid #aeb9ae; border-radius: 8px; padding: 10px 13px; color: var(--ink); background: #fff; }
button { cursor: pointer; min-width: 44px; font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s; }
button:hover:not(:disabled) { border-color: var(--green); background: var(--green-light); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { cursor: not-allowed; color: #667067; background: #edf0ed; border-color: #d3d9d3; }
button.button-primary, button[type='submit']:not([data-action]), button[data-action='sign-in'] { color: #fff; background: var(--green); border-color: var(--green); }
button.button-primary:hover:not(:disabled), button[type='submit']:not([data-action]):hover:not(:disabled) { background: var(--green-dark); border-color: var(--green-dark); }
button.button-primary:disabled { color: #637063; background: #e0e7df; border-color: #d3ddd1; }
button[data-action^='archive'], button[data-action^='cancel'], button[data-action^='revoke'], button[data-action^='retire'] { color: var(--bad); }
input:not([type='checkbox']):not([type='radio']), select, textarea { width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: #747d74; }
input[type='checkbox'], input[type='radio'] { accent-color: var(--green); width: 20px; height: 20px; min-width: 20px; margin: 0; padding: 0; }
input[type='file'] { background: #f7faf6; border-style: dashed; padding: 12px; }
input[type='file']::file-selector-button { border: 0; border-radius: 5px; padding: 8px 12px; margin-right: 12px; color: var(--green-dark); background: #e1eedf; font: inherit; font-weight: 600; cursor: pointer; }
input:read-only:not([type='checkbox']), textarea:read-only { background: #f6f8f5; }
input[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--bad); background: #fff7f5; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; left: -1000px; top: 8px; z-index: 300; padding: 12px 20px; background: #fff; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { left: 12px; }
h1, h2, h3, h4, p { margin-top: 0; }
h2 { font-size: 28px; line-height: 1.2; letter-spacing: -.6px; font-weight: 600; }
h3 { font-size: 17px; line-height: 1.4; }
h4 { font-size: 14px; }
p { margin-bottom: 12px; }
code, pre { overflow-wrap: anywhere; white-space: pre-wrap; }
.ui-icon { width: 24px; height: 24px; flex: none; }
.eyebrow { display: block; font-size: 10px; letter-spacing: 1.1px; line-height: 1.5; font-weight: 700; text-transform: uppercase; }

/* Global bar and floating navigation. */
.app-header { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 28px; min-height: 93px; padding: 16px 28px; background: #f8f8f8f5; border-bottom: 1px solid #e0e4df; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; width: 252px; flex: none; text-decoration: none; color: var(--green-dark); }
.brand-mark { display: grid; place-items: center; width: 39px; height: 43px; border: 1px solid #b9ceb5; border-radius: 12px 3px 12px 3px; background: #edf5e9; }
.brand-mark svg { width: 26px; height: 26px; }
.brand h1 { font-size: 25px; line-height: 1; letter-spacing: -.8px; margin: 0; font-weight: 700; }
.brand h1 span { font-weight: 400; }
.brand small { display: block; margin-top: 5px; color: #72816f; font-size: 9px; letter-spacing: 2px; }
#shell-context { min-width: 0; padding-left: 24px; border-left: 1px solid var(--line); }
#shell-context .eyebrow { color: var(--muted); margin-bottom: 3px; }
#shell-context strong { display: block; max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.header-account { display: flex; gap: 16px; align-items: center; margin-left: auto; }
#shell-user { display: flex; gap: 10px; align-items: center; }
.user-avatar { display: grid; place-items: center; flex: none; width: 37px; height: 37px; color: var(--green-dark); background: #e3ecdf; border-radius: 50%; font-weight: 700; font-size: 12px; }
.user-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
#shell-actions button { border-color: var(--line); background: transparent; font-size: 12px; }
body[data-session='anonymous'] #shell-actions { display: none; }
#shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 28px; padding: 22px 28px 40px; max-width: 1920px; margin: 0 auto; }
.app-nav { position: sticky; top: 115px; align-self: start; max-height: calc(100svh - 137px); overflow-y: auto; scrollbar-width: thin; padding: 0 5px 8px 0; }
.nav-workspace { display: flex; align-items: center; gap: 12px; padding: 15px 14px 20px; color: var(--green-dark); }
.nav-workspace .ui-icon { width: 30px; height: 30px; }
.nav-workspace .eyebrow { font-size: 9px; color: var(--muted); letter-spacing: .5px; }
.nav-workspace strong { display: block; max-width: 195px; margin-top: 4px; overflow-wrap: anywhere; font-size: 13px; }
.nav-group { margin-bottom: 20px; }
.nav-group-title { padding: 0 14px; margin-bottom: 8px; font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 1.3px; color: #747b73; }
.app-nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.app-nav a { display: flex; align-items: center; gap: 14px; min-height: 53px; padding: 12px 17px; border-radius: var(--radius); box-shadow: var(--shadow); background: white; text-decoration: none; color: #41483f; font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.app-nav a .ui-icon { color: var(--green-dark); width: 23px; height: 23px; }
.app-nav a:hover, .app-nav a[aria-current='page'] { background: var(--green); color: #fff; }
.app-nav a:hover .ui-icon, .app-nav a[aria-current='page'] .ui-icon { color: #fff; }
.app-nav a[aria-current='page']::after { content: '›'; margin-left: auto; font-size: 21px; font-weight: 400; }
.nav-group-access a { box-shadow: none; background: transparent; min-height: 44px; font-size: 11px; }
.nav-group-access ul { gap: 0; }
.locale { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 0; border-top: 1px solid #d9dfd7; }
.locale label { font-size: 11px; color: var(--muted); }
.locale select { width: 125px; font-size: 12px; }
.nav-toggle { display: none; }
.app-main { min-width: 0; }
#shell-status:empty { display: none; }
#shell-status:not(:empty) { max-width: 1120px; margin: 18px 28px 0 328px; padding: 14px 18px; background: #fff; border-left: 4px solid var(--green); border-radius: 8px; box-shadow: var(--shadow); }
#shell-status[data-tone='error'] { border-color: var(--bad); background: #fff5f2; color: #792521; }
#shell-status[data-tone='success'] { border-color: var(--ok); background: var(--green-light); }
/* Keep the live announcement for assistive technology while avoiding a second visible refusal card. */
#shell-status.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Shared page, form and state hierarchy. */
.page-view { min-width: 0; }
.page-heading { margin: 4px 0 25px; }
.page-heading h2 { margin: 0 0 9px; }
.page-heading p { margin: 0; color: var(--muted); max-width: 720px; font-size: 14px; }
.page-view > section, .page-view > .basemap-panel, .page-view > .empty-state,
.product-catalogue, .product-validation, .product-history, .preview-row,
.lab-profile-editor, .allocation-panel, .catalog-editor { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 23px; margin-block: 18px; box-shadow: var(--shadow); min-width: 0; }
.page-view > section h3:first-child { margin-top: 0; }
form { min-width: 0; background: var(--paper); padding: 24px; border: 1px solid var(--line); border-radius: 12px; margin-block: 18px; box-shadow: var(--shadow); }
fieldset { border: 1px solid var(--line); border-radius: 9px; min-width: 0; padding: 18px; margin: 0 0 20px; }
form > fieldset:only-child { border: 0; padding: 0; margin: 0; }
legend { padding: 0 7px; font-weight: 600; font-size: 16px; color: var(--ink); }
form > fieldset:only-child > legend { padding: 0 0 17px; }
.field { min-width: 0; margin: 0 0 18px; }
.field label, .field-controls > label { display: block; font-size: 12px; color: #4f594e; font-weight: 600; margin-bottom: 7px; }
.field input, .field select, .field textarea { display: block; }
.field .hint { margin: 6px 0 0; }
.hint, .version, .map-bounded, .map-page, .tile-info { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.hint { line-height: 1.6; }
.controls { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-block: 18px; }
.controls:empty { display: none; }
.controls > .action-unavailable { margin: 0; }
.controls > .field { flex: 1 1 200px; }
.action-unavailable { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 100%; vertical-align: top; margin: 0 8px 8px 0; }
.action-unavailable .hint, .action-unavailable small { max-width: 280px; font-size: 11px; }
.split { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.5fr); gap: 22px; align-items: start; }
.split > form { margin: 0; }
.tenants { list-style: none; padding: 0; margin: 0; }
.tenants li { margin-bottom: 9px; padding: 13px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.tenants li button { border: none; display: block; width: 100%; text-align: left; }
.tenants button[aria-current='true'] { color: var(--green-dark); background: var(--green-light); }
.tenants .state { margin: 5px 12px 0; }
.switch, .checkbox { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 0 16px 12px 0; cursor: pointer; }
.state { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid #d5e0d1; border-radius: 5px; background: #f2f6f0; color: var(--green-dark); font-size: 11px; font-weight: 600; white-space: normal; }
.state[data-state='failed'], .state[data-state='revoked'], .state[data-state='aborted'] { color: var(--bad); background: #fff1ed; border-color: #efd1c8; }
.empty-state { text-align: center; padding: 35px 24px; border: 1px dashed #bdcdb7; background: #f8fbf6; border-radius: 10px; margin-block: 18px; }
.empty { font-weight: 600; color: #4e5c49; padding: 16px 0; }
.empty-state .empty { margin: 0 0 7px; padding: 0; font-size: 16px; }
.empty-state .empty-hint { margin: 0; color: var(--muted); }
.empty-state a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 600; }
.empty-state form { text-align: left; max-width: 580px; margin: 24px auto 0; }
.page-view .problem { border: 1px solid #e4bdb1; border-left: 4px solid var(--bad); padding: 20px; background: #fff7f4; box-shadow: none; }
.problem h3 { color: #8b3029; margin-bottom: 10px; }
.problem p { overflow-wrap: anywhere; }
.refusal, .boundary-refused, .layer-disagreement { color: var(--bad); background: #fff3ee; padding: 12px; border-radius: 8px; }
.boundary-ok, .layer-agreement, .product-validation-ok { color: var(--green-dark); background: var(--green-light); padding: 12px; border-radius: 8px; }

/* Named, keyboard-accessible table regions contain horizontal overflow. */
.table-scroll { width: 100%; max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: white; margin: 15px 0 22px; }
table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
caption { text-align: left; padding: 17px 18px; font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--line); }
thead { background: #f5f7f3; color: #596453; }
th, td { border: 0; border-bottom: 1px solid #e7ebe4; padding: 13px 17px; vertical-align: top; overflow-wrap: anywhere; min-width: 100px; max-width: 400px; }
thead th { font-size: 10px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; white-space: nowrap; }
tbody th { font-weight: 500; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #f7faf5; }
td button, th button { font-size: 12px; }
.problem .table-scroll { margin-bottom: 0; background: #fffdfb; }
.problem th, .problem td { border-color: #edddd5; }
dl { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 8px 18px; font-size: 12px; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }

/* Landing page: real routes, no fabricated metrics. */
.workspace-overview { margin-bottom: 30px; }
.welcome-panel { position: relative; overflow: hidden; padding: 31px 35px; border-radius: 12px; color: #fff; background: #326e32; box-shadow: var(--shadow); }
.welcome-panel::after { content: ''; position: absolute; inset: 0 0 0 65%; background: repeating-linear-gradient(130deg, transparent 0 26px, #ffffff0c 27px 28px); pointer-events: none; }
.welcome-panel .eyebrow { color: #d6e8cd; margin-bottom: 13px; }
.welcome-panel h3 { font-size: 25px; line-height: 1.25; letter-spacing: -.5px; max-width: 530px; margin: 0 0 12px; }
.welcome-panel p { max-width: 550px; margin: 0; color: #e1edda; font-size: 13px; }
.welcome-panel > .ui-icon { position: absolute; right: 27px; top: 30px; width: 100px; height: 100px; color: #b9d3ad; opacity: .25; }
.task-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.task-card { display: flex; flex-direction: column; padding: 21px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.task-card:hover { border-color: var(--green); transform: translateY(-2px); }
.task-card > .ui-icon { width: 37px; height: 37px; color: var(--green); background: var(--green-light); border-radius: 8px; padding: 6px; margin-bottom: 21px; }
.task-card h3 { font-size: 15px; margin-bottom: 9px; }
.task-card p { font-size: 12px; color: var(--muted); margin-bottom: 21px; }
.task-open { margin-top: auto; font-size: 11px; color: var(--green-dark); font-weight: 600; }
.workspace-settings-title { margin: 28px 0 15px; font-size: 17px; }

/* Keep the original geometry/basemap coordinate system. */
.page-map > svg { display: block; width: 100%; height: clamp(320px, 48vh, 560px); padding: 28px; background: #e8eee4; border: 1px solid #c8d4c3; border-radius: 10px; box-shadow: var(--shadow); }
.map-frame { position: relative; overflow: hidden; max-width: 100%; border: 1px solid #c8d4c3; border-radius: 10px; background: #e8eee4; box-shadow: var(--shadow); }
.map-frame .map-basemap { position: absolute; z-index: 0; filter: grayscale(.35) contrast(.9); }
.map-frame .map-data { position: absolute; inset: 0; z-index: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 22px; list-style: none; padding: 15px 18px; margin: 12px 0; background: white; border: 1px solid var(--line); border-radius: 8px; }
.legend li { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.legend-swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid #667562; border-radius: 3px; flex: none; }
.page-map > .field, .page-values > .field, .page-imports > .field { display: inline-block; width: min(440px, 100%); vertical-align: top; margin-right: 14px; }
.map-bounded { background: #e4eae0; border-radius: 7px; padding: 10px 14px; }
.values-map-panel > svg, .map-data svg { max-width: 100%; }
.basemap-panel { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-block: 16px; }

/* Operational workflows. */
.workflow { display: grid; grid-template-columns: repeat(4, 1fr); list-style: none; margin: 0 0 24px; padding: 0; background: #f8faf6; border: 1px solid #d7e2d1; border-radius: 10px; }
.workflow li { display: flex; gap: 10px; align-items: center; padding: 17px 14px; border-right: 1px solid #d7e2d1; font-size: 11px; font-weight: 600; color: #4b6044; }
.workflow li:last-child { border: 0; }
.step-number { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: #e6efdf; color: var(--green-dark); font-size: 10px; }
.import-controls, .job-controls, .member-controls, .artifact-controls, .product-version-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 15px; border: 1px solid var(--line); background: #fff; border-radius: 9px; }
.preview-rows { display: grid; gap: 12px; }
.preview-row { margin: 0; border-left: 4px solid #9cad91; box-shadow: none; }
.preview-row[data-verdict='rejected'] { border-left-color: var(--bad); }
.preview-row[data-verdict='flagged'] { border-left-color: #9c6e1f; background: #fffaf0; }
.preview-row[data-verdict='accepted'] { border-left-color: var(--green); }
.row-location { font-size: 11px; color: var(--muted); }
.row-verdict { font-weight: 600; }
.row-source, .product-sourcing { font-size: 12px; overflow-wrap: anywhere; }
.product-content-row, .product-evidence-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.product-families { color: var(--green-dark); font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: .8px; }
.product-presentation { border-top: 1px solid var(--line); padding-top: 16px; }
.page-products form > fieldset, .page-catalogs form, .page-crops form, .page-profile form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
.page-products form > fieldset > :not(.field), .page-catalogs form > :not(.field), .page-crops form > :not(.field), .page-profile form > :not(.field) { grid-column: 1/-1; }
.page-products form > fieldset > button, .page-catalogs form > button, .page-crops form > button, .page-profile form > button { justify-self: start; }
.page-catalogs form > .field:has(textarea), .page-crops form > .field:has(textarea) { grid-column: 1/-1; }
.field-controls { flex: 1 1 330px; display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 10px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.field-controls > span:first-child { grid-column: 1/-1; font-weight: 600; margin-bottom: 9px; }
.field-controls > label, .field-controls > input { grid-column: 1/-1; margin-bottom: 0; }
.field-controls .field { margin: 0 0 6px; }
.field-controls > button { justify-self: start; }
.field-controls > .field-soil-texture { grid-column: 1/-1; border-top: 1px solid var(--line); padding-top: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin-bottom: 25px; background: #fafcf8; padding: 22px; }
.form-grid legend { font-size: 14px; padding: 0 8px; }
.form-grid .field { margin-bottom: 14px; }
.calculation-coverage { overflow: hidden; }
.coverage-state { display: inline-block; border-radius: 4px; padding: 3px 7px; background: #edf3e7; font-size: 11px; }
.coverage-state-refused, .coverage-state-missing { background: #fff0e9; color: var(--bad); }
.coverage-source, .coverage-gaps { font-size: 11px; color: var(--muted); }
.label-verification { padding: 12px 15px; background: #fff7e5; color: #775c21; border: 1px solid #eadab1; border-radius: 7px; }
.profile-identity { padding: 20px; background: var(--green-light); border: 1px solid #d9e4d3; border-radius: 10px; }

/* Original field-row artwork and branded access screens. */
.auth-page { display: grid; grid-template-columns: 1fr 1fr; min-height: min(650px, calc(100svh - 160px)); background: white; border-radius: 15px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-story { display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; padding: 45px 38px; background: #2f6c31; color: #fff; }
.auth-story::after { content: ''; position: absolute; left: -20%; right: -20%; bottom: -100px; height: 220px; transform: rotate(-12deg); border-radius: 50% 50% 0 0; background: repeating-linear-gradient(100deg, #8cb47620 0 13px, #c1db9620 14px 16px, transparent 17px 38px); }
.auth-story > .ui-icon { width: 57px; height: 57px; color: #c8dfb9; margin-bottom: 37px; }
.auth-story .eyebrow { color: #cde0bf; margin-bottom: 18px; }
.auth-story h2 { font-size: 31px; line-height: 1.3; white-space: pre-line; margin: 0 0 21px; font-weight: 500; }
.auth-story p { color: #ddebd4; font-size: 13px; line-height: 1.8; max-width: 340px; }
.auth-form { padding: 42px 36px; align-self: center; min-width: 0; }
.auth-form form { box-shadow: none; border: none; padding: 0; margin: 0; }
.auth-form h2 { font-size: 24px; margin-bottom: 27px; }
.auth-form button[type='submit'], .auth-form button[data-action='sign-in'] { width: 100%; margin-top: 7px; }
.auth-form .action-unavailable { display: flex; }
.auth-form .problem { margin-bottom: 22px; }
.auth-form .page-heading { margin-top: 0; }
.auth-navigation { display: flex; flex-wrap: wrap; gap: 12px 24px; }

@media (min-width: 1500px) { #shell { gap: 34px; } .page-view { max-width: 1400px; } }
@media (max-width: 1200px) {
  .app-header { gap: 18px; padding-inline: 22px; } .brand { width: 230px; }
  #shell { grid-template-columns: 240px minmax(0, 1fr); gap: 22px; padding-inline: 22px; }
  .user-name { max-width: 130px; } .task-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-story { padding: 30px; } .auth-story h2 { font-size: 27px; } .auth-form { padding: 32px 25px; }
  #shell-status:not(:empty) { margin-left: 284px; }
}
@media (max-width: 900px) {
  .app-header { min-height: 76px; padding: 12px 18px; } .brand { width: auto; }
  .brand h1 { font-size: 22px; } .brand small { font-size: 8px; } #shell-context { display: none; }
  .header-account { gap: 10px; } #shell { display: block; padding: 15px 18px 30px; }
  .app-nav { position: relative; top: auto; max-height: none; overflow: visible; padding: 0; margin-bottom: 24px; background: #f8faf6; border: 1px solid #d8e1d2; border-radius: 10px; }
  .nav-workspace { min-height: 68px; padding: 12px 120px 12px 16px; }
  .nav-workspace strong { max-width: none; } .nav-workspace .eyebrow { font-size: 9px; }
  .nav-toggle { display: block; position: absolute; right: 12px; top: 12px; color: var(--green-dark); border-color: #c2d2b8; background: #fff; font-size: 12px; }
  .nav-content { display: none; padding: 8px 14px 18px; } .app-nav.is-open .nav-content { display: block; }
  .app-nav ul { grid-template-columns: 1fr 1fr; } .nav-group { margin-bottom: 20px; } .nav-group-title { padding-left: 3px; }
  .locale { justify-content: flex-start; } #shell-status:not(:empty) { margin: 16px 18px 0; }
  .page-heading h2 { font-size: 25px; } .auth-page { min-height: 530px; } .workflow li { padding: 14px 10px; gap: 6px; }
}
@media (max-width: 40rem) {
  .app-header { gap: 10px; padding-inline: 14px; } .brand-mark { width: 31px; height: 36px; }
  .brand h1 { font-size: 21px; } .brand small { letter-spacing: 1.3px; font-size: 7px; }
  .user-name { display: none; } #shell-actions button { padding: 8px; font-size: 11px; } .header-account { gap: 8px; }
  #shell { padding: 12px 12px 25px; } .nav-workspace { padding-left: 13px; }
  .nav-workspace strong { font-size: 12px; } .nav-workspace .eyebrow { font-size: 8px; }
  .app-nav a { font-size: 10px; padding: 10px; gap: 9px; } .app-nav a .ui-icon { width: 21px; height: 21px; }
  .page-heading { margin: 4px 2px 21px; } .page-heading h2 { font-size: 24px; } .page-heading p { font-size: 13px; line-height: 1.6; }
  form, .page-view > section, .page-view > .empty-state, .product-catalogue { padding: 19px 16px; }
  .split, .form-grid, .auth-page { grid-template-columns: 1fr; } .split { gap: 18px; } .form-grid { padding: 17px 13px; }
  .page-products form > fieldset, .page-catalogs form, .page-crops form, .page-profile form { grid-template-columns: 1fr; }
  .task-grid { gap: 10px; } .task-card { padding: 17px 14px; } .task-card p { font-size: 11px; } .task-card h3 { font-size: 13px; } .task-open { font-size: 10px; }
  .welcome-panel { padding: 26px 22px; } .welcome-panel h3 { font-size: 22px; } .welcome-panel p { font-size: 12px; } .welcome-panel > .ui-icon { right: 5px; opacity: .12; }
  .workflow { grid-template-columns: 1fr 1fr; } .workflow li { border: 0; padding: 12px; font-size: 10px; }
  .auth-story { min-height: 245px; padding: 29px 26px; }
  .auth-story > .ui-icon { position: absolute; width: 70px; height: 70px; right: 25px; bottom: 20px; margin: 0; opacity: .25; }
  .auth-story .eyebrow { font-size: 9px; margin-bottom: 14px; } .auth-story h2 { font-size: 27px; margin-bottom: 13px; }
  .auth-story p { font-size: 12px; max-width: 270px; margin: 0; } .auth-form { padding: 28px 23px; } .auth-form h2 { font-size: 23px; }
  .field-controls { padding: 18px; grid-template-columns: 1fr; } .field-controls .field { grid-column: 1/-1; }
  .page-map > .field, .page-values > .field, .page-imports > .field { margin-right: 0; }
  th, td { padding: 12px; min-width: 110px; } dl { grid-template-columns: 1fr; gap: 5px; } dd { margin-bottom: 10px; }
  .allocation-readable, .allocation-readable tbody { display: block; width: 100%; }
  .allocation-readable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .allocation-readable caption { display: block; text-align: left; }
  .allocation-readable tbody tr { display: block; padding: 10px 0; border-top: 1px solid var(--line); }
  .allocation-readable tbody :is(th, td) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; min-width: 0; padding: 8px 12px; border: 0; overflow-wrap: anywhere; }
  .allocation-readable tbody :is(th, td)::before { content: attr(data-label); font-size: 11px; font-weight: 600; color: var(--muted); }
}
@media (pointer: coarse) {
  button, select, input:not([type='checkbox']):not([type='radio']), .app-nav a { min-height: 48px; }
  .checkbox, .switch { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .app-nav a[aria-current='page'], .state { border: 2px solid currentColor; } .legend-swatch { forced-color-adjust: none; } }

/* Field workspaces share the reference's white panels and restrained green hierarchy. */
summary { cursor: pointer; min-height: 44px; padding-block: 10px; font-weight: 600; color: var(--green-dark); }
summary::marker { color: var(--green); }
[hidden] { display: none !important; }
.import-workspace-intro, .map-workspace-intro { color: var(--muted); max-width: 850px; margin-bottom: 20px; }
.import-stepper, .calc-workflow-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; list-style: none; padding: 0; margin: 22px 0; border: 1px solid #d2dfcf; border-radius: 10px; overflow: hidden; background: #d2dfcf; counter-reset: steps; }
.import-stepper li, .calc-workflow-steps li { display: flex; align-items: center; gap: 10px; padding: 17px; font-size: 12px; background: #f7faf5; color: #586852; counter-increment: steps; }
.import-stepper li::before { content: '0' counter(steps); display: grid; place-items: center; min-width: 29px; height: 29px; border-radius: 50%; background: #e2ecdc; font-size: 11px; font-weight: 700; }
.import-stepper li[aria-current] { background: var(--green); color: #fff; font-weight: 700; }
.import-stepper li[aria-current]::before { background: #ffffff25; }
.import-workspace-panel { position: relative; }
.import-workspace-panel[data-panel='context'] > div { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: end; }
.import-workspace-panel form, .import-workspace-panel .import-read, .import-workspace-panel .import-preview { box-shadow: none; border: none; margin: 0; padding: 0; }
.import-workspace-panel form + section, .import-workspace-panel form + form { margin-top: 22px; }
.import-workspace-panel[data-panel='upload'] { border-top: 3px solid var(--green); }
.import-integrity { padding: 10px 16px; background: #f7f9f5; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 18px; }
.import-integrity[open] summary { margin-bottom: 14px; }
.import-integrity .field { margin-bottom: 14px; }
.import-advanced, .map-object-table, .map-boundary-task { padding: 9px 22px; margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.import-advanced > section { margin-block: 20px; }
.import-summary, .calc-run-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.import-summary > div, .calc-run-summary > div { padding: 17px; border-radius: 9px; background: #f2f7ee; border: 1px solid #dce7d5; }
.import-summary dt, .calc-run-summary dt { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.import-summary dd { margin: 0; font-size: 27px; font-weight: 600; color: var(--green-dark); }
.import-row-filter { display: grid; grid-template-columns: auto minmax(180px, 1fr); gap: 8px 20px; align-items: center; margin-block: 25px; padding-block: 18px; border-block: 1px solid var(--line); }
.import-row-filter p { grid-column: 1/-1; margin: 0; }
.import-controls > span { flex-basis: 100%; font-weight: 600; }
.import-server-state { color: var(--green-dark); font-weight: 600; }
.calc-workspace-header { padding: 22px 25px; background: #f6faf2; border: 1px solid #d7e3ce; border-radius: 12px; }
.workspace-eyebrow, .calc-step-label { font-size: 12px; font-weight: 700; color: var(--green-dark); }
.calc-context-strip { display: flex; flex-wrap: wrap; gap: 12px 25px; padding-top: 10px; font-size: 13px; }
.calc-context-field { font-weight: 700; }
.calc-context-season { color: var(--muted); }
.calc-workflow-steps { margin-bottom: 0; }
.calc-step-number { font-size: 11px; color: var(--green-dark); font-weight: 700; }
.calculation-workspace #calculation-form { border: none; padding: 0; background: transparent; box-shadow: none; }
.calc-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: stretch; }
.calc-input-grid .calc-input-section { margin: 0; background: #fff; padding: 22px; display: block; box-shadow: var(--shadow); }
.calc-input-section > legend { font-size: 15px; }
.calc-input-section > .hint { margin-bottom: 20px; }
.calc-input-notices:empty { display: none; }
.calc-coverage-gate, .calc-launch { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 12px; margin-top: 20px; }
.calc-coverage-gate .calculation-coverage { margin: 0; }
.calc-coverage-details { border-top: 1px solid var(--line); margin-top: 16px; }
.calc-coverage-details > summary { padding: 12px 0; font-weight: 600; color: var(--green-dark); }
.calc-coverage-details[open] > summary { margin-bottom: 8px; }
.calc-launch { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 20px; border-left: 4px solid var(--green); }
.calc-launch h3, .calc-launch > .hint { grid-column: 1; }
.calc-launch .controls { grid-column: 2; grid-row: 1/3; margin: 0; }
.calc-output-workspace > section { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }
.calc-run-summary { grid-template-columns: 2fr 1fr; }
.calc-run-summary dd { font-size: 13px; margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.calc-evidence-details { background: #f6f8f4; padding: 10px 16px; border: 1px solid var(--line); border-radius: 9px; margin-top: 20px; }
.calc-result-empty { padding: 28px; background: #f5f8f2; border-radius: 10px; }
.calc-result-empty h3 { font-size: 16px; }
.calc-review-notice { padding: 18px; background: #fffbf2; border: 1px solid #eddfbd; border-radius: 10px; }
.map-context { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; padding: 18px 22px; background: white; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; }
.map-context > .field { flex: 1 1 280px; margin: 0; }
.map-field-search { flex: 1 1 180px; }
.map-shortcuts { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; }
.map-shortcuts a { min-height: 44px; display: flex; align-items: center; padding: 8px; }
.map-workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 18px; align-items: start; }
.map-work-surface, .map-layer-rail { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.map-toolbar { display: flex; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.map-toolbar strong { color: var(--green-dark); font-size: 13px; }
.map-object-count { color: var(--muted); font-size: 11px; }
.map-canvas { height: clamp(360px, 55vh, 640px); position: relative; overflow: hidden; background-color: #edf1e7; background-image: linear-gradient(#80916f12 1px, transparent 1px), linear-gradient(90deg, #80916f12 1px, transparent 1px); background-size: 32px 32px; }
.map-boundary-hint { margin: 0; padding: 0 18px 12px; }
.map-canvas #map-drawing, .map-canvas #map-boundary { display: block; width: 100%; height: 100%; margin: 0; border: 0; border-radius: 0; background: transparent; padding: 18px; touch-action: none; user-select: none; cursor: grab; }
.map-canvas svg.is-panning, .map-canvas svg.is-panning path { cursor: grabbing; }
.map-canvas .empty-state { max-width: 400px; margin: 45px auto; background: #ffffffd9; }
.map-canvas path { cursor: pointer; transition: fill-opacity .12s; }
.map-canvas path:hover, .map-canvas path.is-selected { fill-opacity: .65; stroke: #193f27; stroke-width: 3; }
.map-zoom-controls { position: absolute; top: 16px; right: 16px; display: grid; gap: 5px; }
.map-zoom-controls button { padding: 6px 11px; font-size: 12px; box-shadow: var(--shadow); }
.map-work-surface > .legend { padding: 15px 20px; margin: 0; border-top: 1px solid var(--line); }
.map-work-surface > p { margin: 12px 20px; }
.map-background-label { display: block; padding: 9px 20px; font-size: 10px; color: var(--muted); border-block: 1px solid var(--line); }
.map-layer-rail { padding: 20px; }
.map-layer-rail > h3 { font-size: 15px; }
.map-layer-card { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 12px; padding: 12px; }
.map-layer-card[data-visible='false'] { background: #f2f3f1; }
.map-layer-toggle { display: flex; gap: 10px; align-items: center; cursor: pointer; min-height: 44px; }
.map-layer-toggle strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.map-layer-toggle small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.map-layer-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.map-layer-actions button, .map-layer-rail > .controls button { font-size: 11px; padding: 8px; }
.map-object-inspector { border-top: 1px solid var(--line); padding-top: 18px; }
.map-object-inspector h3 { font-size: 14px; }
.map-object-facts { display: block; font-size: 11px; margin: 0; }
.map-object-facts dt { color: var(--muted); margin-top: 10px; }
.map-object-facts dd { margin: 3px 0; overflow-wrap: anywhere; }
.map-object-table tr.is-selected { background: #e7f2df; }
.map-indicator-field, .map-source-scale { grid-column: 1/-1; }
.map-source-scale { padding: 14px; background: #f7faf4; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 16px; }
.map-source-scale > strong { display: block; font-size: 12px; margin-bottom: 10px; }
.map-scale-gradient { display: block; height: 13px; border-radius: 4px; background: linear-gradient(90deg, #e0edd6, #b7d39d, #83b360, #538b3b, #2c5d2c); }
.map-scale-extents { display: flex; justify-content: space-between; gap: 15px; font-size: 11px; margin: 5px 0 10px; }
.map-source-scale p { font-size: 11px; margin-bottom: 7px; }
.map-selected-reading { padding: 13px; background: var(--green-light); border-radius: 8px; margin-bottom: 12px; }
.map-selected-reading span { display: block; font-size: 10px; color: var(--muted); }
.map-selected-reading strong { display: block; font-size: 25px; color: var(--green-dark); }
.map-raw-attributes summary { font-size: 12px; cursor: pointer; padding-block: 9px; }
.import-upload-components { list-style: none; padding: 0; margin: 15px 0; }
.import-upload-components li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.import-upload-components strong { flex: 1 1 200px; overflow-wrap: anywhere; font-size: 12px; }
.import-upload-components small { color: var(--muted); }
.app-main { scroll-margin-top: 112px; }
.map-boundary-task > .boundary-file { margin-top: 20px; }
.map-source-panel .layer-inspection { padding: 0; }
@media (max-width: 1200px) { .map-workspace-grid { grid-template-columns: minmax(0, 1fr); } .map-layer-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; } .map-layer-rail > h3, .map-layer-rail > .hint, .map-object-inspector { grid-column: 1/-1; } .map-layer-card { margin: 0; } }
@media (max-width: 640px) {
  .import-stepper, .calc-workflow-steps { grid-template-columns: 1fr; }
  .import-stepper li, .calc-workflow-steps li { padding: 12px 16px; }
  .import-workspace-panel[data-panel='context'] > div, .calc-input-grid { grid-template-columns: 1fr; }
  .import-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
  .import-summary > div { padding: 12px; } .import-summary dd { font-size: 22px; }
  .import-row-filter { grid-template-columns: 1fr; } .import-row-filter p { grid-column: 1; }
  .calc-launch { display: block; } .calc-launch .controls { margin-top: 20px; }
  .calc-run-summary { grid-template-columns: 1fr; }
  .calc-workspace-header, .calc-coverage-gate, .calc-launch { padding: 18px; }
  .map-context { padding: 16px; gap: 8px; } .map-field-search { flex-basis: 100%; }
  .map-layer-rail { display: block; padding: 16px; } .map-layer-card { margin-bottom: 12px; }
  .map-canvas { height: 400px; } .map-toolbar { padding: 14px; }
  .map-object-count { max-width: 90px; text-align: right; }
}

/* Keep routine work visible; disclose diagnostics only when requested. */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.map-layer-details summary, .map-diagnostics summary, .map-source-panel > summary { cursor: pointer; color: var(--green-dark); font-size: 12px; padding: 9px 0; }
.map-diagnostics { padding: 0 20px; border-top: 1px solid var(--line); }
.map-diagnostics > p { font-size: 12px; overflow-wrap: anywhere; }
.map-source-panel { padding: 10px 20px; margin-top: 18px; border: 1px solid var(--line); background: #fff; border-radius: 10px; }
.map-coverage-warning { padding: 12px 20px; margin: 0; color: #78531c; background: #fffbf2; }
.map-context > button { font-size: 12px; }
.calc-workspace-header { padding: 12px 20px; }
.calc-context-strip { padding-top: 0; }
.season-program { margin-block: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.season-program > button, .season-program > a { margin: 8px 12px 8px 0; }
.season-program-map { display: block; width: 100%; max-height: 480px; border: 1px solid var(--line); margin-block: 16px; }
.season-program-map path:focus { outline: 2px solid #142d75; outline-offset: 2px; stroke: #142d75; stroke-width: 3; }
.season-program table { width: 100%; }
.season-program .program-create-season { margin-block: 16px; }
.calc-launch { display: flex; justify-content: flex-end; padding: 18px 24px; }
.calc-launch .controls { margin: 0; }
@media (min-width: 1201px) {
  body[data-route='map'] #shell { grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding-inline: 20px; }
  body[data-route='map'] .map-workspace-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 12px; }
  body[data-route='map'] .map-canvas { height: clamp(440px, 65vh, 760px); }
}

/* Values provenance is optional detail, with readable stacked audit fields in a table cell. */
.values-source-details { min-width: 16rem; max-width: 32rem; }
.values-source-details > summary { cursor: pointer; color: var(--green-dark); padding-block: 6px; }
.values-source-details dl { display: block; margin: 12px 0; }
.values-source-details dt { margin-top: 10px; font-weight: 600; }
.values-source-details dd { margin: 4px 0 12px; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Separate ordinary saved-allocation download choices on desktop and mobile. */
.allocation-reports { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.allocation-reports > p { flex-basis: 100%; }
.allocation-reports > a { padding: 0.35rem 0; }
