:root {
  color-scheme: light;
  --canvas: #f6f7f2;
  --paper: #fff;
  --ink: #172a25;
  --muted: #52665c;
  --green: #173d30;
  --dark: #102d24;
  --leaf: #deed90;
  --line: #d5ddd4;
  --soft: #eaf0e7;
  --rust: #943d29;
  --shadow: 0 12px 40px rgba(23, 61, 48, .1);
  --sans: "DM Sans", "Avenir Next", "Segoe UI", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font: 100%/1.5 var(--sans);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: rgba(69, 109, 54, .15); }
button, .button {
  display: inline-flex;
  min-height: 2.75rem;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .58rem 1rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--paper);
  color: var(--green);
  font: 600 .9375rem/1.35 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { border-color: #839787; background: #f2f5ee; }
button:active, .button:active { transform: translateY(1px); }
button:disabled, [aria-disabled=true] { opacity: .55; cursor: default; }
button:disabled:active { transform: none; }
.primary, button[type=submit]:not(.secondary):not(.danger) { border-color: var(--green); background: var(--green); color: white; }
.primary:hover, button[type=submit]:not(.secondary):not(.danger):hover { background: var(--dark); border-color: var(--dark); }
.secondary { background: var(--paper); color: var(--green); }
.danger { border-color: #dcb1a5; color: #8c321d; background: #fff9f6; }
.danger:hover { background: #faebe4; border-color: #b96147; }
.link-button, .text-button { border: 0; padding-inline: .25rem; background: transparent; text-decoration: underline; text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #598536; outline-offset: 3px; }
main:focus:not(:focus-visible) { outline: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--green); text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(2.8rem, 5.5vw, 4.7rem); line-height: 1.03; letter-spacing: -.049em; }
h2 { font-size: clamp(1.85rem, 3.1vw, 2.55rem); line-height: 1.1; letter-spacing: -.038em; }
h3 { font-size: 1.09rem; line-height: 1.35; }
p + p { margin-top: .65rem; }
.muted, small, .help, .hint { color: var(--muted); }
small, .help, .hint { font-size: .875rem; }
.wordmark { display: inline-flex; align-items: center; gap: .77rem; flex: none; color: var(--green); font: 600 1.65rem/1 var(--serif); letter-spacing: -.055em; white-space: nowrap; }
.field-mark { position: relative; width: 2.1rem; height: 2.1rem; overflow: hidden; border-radius: .35rem; background: var(--green); }
.field-mark::before, .field-mark::after { position: absolute; content: ""; }
.field-mark::before { top: .34rem; right: .36rem; width: .37rem; height: .37rem; border-radius: 50%; background: var(--leaf); }
.field-mark::after { inset: 36% -48% -76% -46%; border-radius: 49%; background: repeating-radial-gradient(ellipse at 9% 99%, transparent 0 5px, var(--leaf) 5px 7px, transparent 7px 9px); transform: rotate(-13deg); }
.skip-link { position: absolute; top: .5rem; left: .5rem; z-index: 5; padding: .6rem 1rem; background: var(--leaf); transform: translateY(-180%); }
.skip-link:focus { transform: none; }

/* Field boundaries, tramlines and a headland drawn as a continuous aerial view. */
.auth-layout { display: grid; grid-template-columns: minmax(24rem, .92fr) minmax(0, 1.08fr); min-height: 100vh; min-height: 100svh; }
.auth-paper { display: flex; min-width: 0; flex-direction: column; gap: 3rem; padding: clamp(2rem, 5vw, 5rem); background: #fcfdf9; }
.auth-body { width: min(100%, 25rem); margin: auto; padding-bottom: max(2.5rem, 9vh); }
.auth-body h1 { margin-bottom: 1.125rem; }
.auth-body h2 { margin-bottom: .9rem; }
.auth-body p { color: var(--muted); }
.auth-body form { margin-top: 1.65rem; }
.auth-body form > button[type=submit], .auth-body form .primary { width: 100%; margin-top: .2rem; }
.auth-body form + button, .auth-body form + a { margin-top: 1rem; }
.field-art { position: relative; isolation: isolate; overflow: hidden; min-height: 14rem; background: #2d4837; }
.parcel { position: absolute; inset: 0; }
.parcel-a { clip-path: polygon(0 0, 41% 0, 36% 27%, 0 39%); background: repeating-radial-gradient(ellipse at -30% -12%, #64834d 0 4px, #738f5a 5px 7px, #617e4e 8px 13px); }
.parcel-b { clip-path: polygon(41.7% 0, 100% 0, 100% 14%, 36.7% 26.7%); background: repeating-linear-gradient(77deg,#3d5944 0 5px,#49694c 6px 9px,#38573f 10px 15px); }
.parcel-c { clip-path: polygon(0 40%, 35.6% 28%, 31.5% 58.8%, 0 71%); background: repeating-linear-gradient(160deg,#87a264 0 3px,#79935b 4px 10px,#6f8954 11px 13px); }
.parcel-d { clip-path: polygon(36.4% 27.8%, 100% 15.1%, 100% 57.5%, 32.3% 58.6%); background: repeating-radial-gradient(ellipse at 121% 32%,#c1ba76 0 3px,#aaa968 4px 11px,#bcb372 12px 17px); }
.parcel-e { clip-path: polygon(0 72.3%,31.3% 60.3%,26.2% 100%,0 100%); background: repeating-linear-gradient(37deg,#56724a 0 5px,#638054 6px 9px,#526c48 10px 13px); }
.parcel-f { clip-path: polygon(32.3% 60.1%,74.5% 59.4%,80.1% 100%,27% 100%); background: repeating-radial-gradient(ellipse at 98% 108%,#4e704b 0 7px,#628459 8px 11px,#52744f 12px 16px); }
.parcel-g { clip-path: polygon(75.5% 59.3%,100% 58.9%,100% 85.1%,78.8% 81.2%); background: repeating-linear-gradient(113deg,#83986a 0 8px,#91a374 9px 12px,#798e64 13px 16px); }
.parcel-h { clip-path: polygon(79% 82.2%,100% 86.3%,100% 100%,81% 100%); background: repeating-linear-gradient(8deg,#a4a36a 0 5px,#adad70 6px 8px,#969762 9px 14px); }
.field-track { position: absolute; inset: 0; background: linear-gradient(112deg,rgba(224,236,176,.12),transparent 45%,rgba(13,38,28,.22)), repeating-linear-gradient(0deg,transparent 0 2px,rgba(35,56,39,.025) 2px 3px); }

.topbar { border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar-inner { display: flex; max-width: 88rem; min-height: 4.75rem; align-items: center; gap: clamp(1.5rem, 5vw, 5rem); margin-inline: auto; padding: 0 clamp(1.25rem, 5vw, 4.5rem); }
.main-nav { display: flex; align-self: stretch; gap: .15rem; }
.main-nav button { position: relative; align-self: stretch; min-width: 4rem; border: 0; border-radius: 0; padding-inline: 1rem; background: transparent; color: var(--muted); }
.main-nav button:hover, .main-nav button.active, .main-nav button[aria-current=page], .main-nav button[aria-selected=true] { color: var(--green); }
.main-nav button.active::after, .main-nav button[aria-current=page]::after, .main-nav button[aria-selected=true]::after { position: absolute; inset: auto 1rem 0; height: 3px; background: var(--green); content: ""; }
.account { display: flex; min-width: 0; align-items: center; gap: .9rem; margin-left: auto; }
#account-label { max-width: 16rem; overflow: hidden; font-size: .875rem; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
#signout { flex: none; min-height: 2.4rem; padding: .42rem .85rem; }
#main { max-width: 83rem; min-height: 60vh; margin-inline: auto; padding: clamp(2.1rem, 5vw, 4.5rem) clamp(1.25rem, 5vw, 4.5rem) 5rem; }
#main > * + * { margin-top: 1.5rem; }
.page-head, .section-head, .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; }
.page-head { align-items: end; padding-bottom: .65rem; }
.heading-group { min-width: 0; }
.heading-group > * + *, .page-head h1 + p { margin-top: .6rem; }
.page-head p, .section-head p { color: var(--muted); }
.actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,12rem),1fr)); overflow: hidden; gap: 1px; border-radius: .7rem; background: #406151; }
.stat { display: flex; min-height: 7.25rem; flex-direction: column; justify-content: center; gap: .35rem; padding: 1.3rem 1.55rem; background: var(--green); color: #e0ebdf; }
.stat strong, .stat b, .stat .value { display: block; font: 500 2.65rem/1 var(--serif); letter-spacing: -.045em; color: var(--leaf); }
.stat small, .stat .muted { color: #dae4d8; }
.panel { overflow-wrap: anywhere; padding: clamp(1.1rem, 2.5vw, 2rem); border: 1px solid var(--line); border-radius: .7rem; background: var(--paper); }
.panel > * + * { margin-top: 1.1rem; }
.panel + .panel { margin-top: 1.1rem; }
.section-head { align-items: baseline; }
.section-head h2 + p { margin-top: .25rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 0; border-bottom: 1px solid var(--line); }
.row > * { min-width: 0; }
.row:last-child { border-bottom: 0; }
.rows { border-top: 1px solid var(--line); }
.empty { display: grid; gap: .55rem; justify-items: start; padding: clamp(1.5rem, 4vw, 3rem); border: 1px dashed #bacab9; border-radius: .5rem; background: #f6f8f2; color: var(--muted); }
.empty > button { margin-top: .3rem; }
.badge { display: inline-flex; width: fit-content; align-items: center; padding: .23rem .65rem; border-radius: 1.5rem; background: var(--soft); color: #355741; font-size: .875rem; font-weight: 600; line-height: 1.4; }
.badge.pending, .badge.warning { color: #6c470c; background: #f8edce; }
.badge.rejected, .badge.error { color: #883e29; background: #fae7df; }
.tabs { display: flex; max-width: 100%; overflow-x: auto; gap: .3rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); }
.tabs button { flex: none; border-color: transparent; background: transparent; color: var(--muted); }
.tabs button.active, .tabs button[aria-selected=true], .tabs button[aria-pressed=true] { background: var(--soft); color: var(--green); }
table { width: 100%; border-collapse: collapse; font-size: .96rem; text-align: left; }
th, td { padding: .82rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .875rem; font-weight: 600; color: var(--muted); }
.table-wrap { overflow-x: auto; }
dl { display: grid; gap: .3rem 1rem; grid-template-columns: max-content 1fr; }
dt { color: var(--muted); }
dd { margin: 0; }
details > summary { cursor: pointer; color: var(--green); font-weight: 600; }
details[open] > summary { margin-bottom: .85rem; }
img { max-width: 100%; }

form { display: grid; gap: 1rem; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
label, .field { display: grid; gap: .36rem; min-width: 0; font-size: .9375rem; font-weight: 600; color: var(--ink); }
label small, .field small { font-weight: 400; }
input, select, textarea { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 2.9rem; border: 1px solid #afbeb0; border-radius: .38rem; padding: .58rem .73rem; background-color: var(--paper); color: var(--ink); font-size: 1rem; font-weight: 400; }
textarea { min-height: 6rem; resize: vertical; }
select { appearance: none; padding-right: 2.25rem; background-image: linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position: calc(100% - 1.03rem) 52%,calc(100% - .76rem) 52%; background-size: .28rem .28rem; background-repeat: no-repeat; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 1.2rem; min-height: 1.2rem; accent-color: var(--green); vertical-align: middle; }
input::placeholder, textarea::placeholder { color: #657368; opacity: 1; }
.wide { grid-column: 1/-1; }
.form-actions { justify-content: flex-end; margin-top: .55rem; }
.error, .error-text, [role=alert] { color: var(--rust); }
.notice, .warning-box { padding: .75rem 1rem; border-left: 3px solid #a78224; background: #fbf4dc; color: #62491b; }
dialog { width: min(35rem,calc(100% - 1.5rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: .8rem; padding: clamp(1.25rem, 3vw, 2rem); background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(15 37 29 / .58); }
dialog h2 { font-size: 2.3rem; }
#dialog-content > * + *, .dialog-head + * { margin-top: 1.25rem; }
dialog button[aria-label=Close] { width: 2.75rem; padding: 0; }
#toast { position: fixed; z-index: 8; right: max(1rem,env(safe-area-inset-right)); bottom: max(1rem,env(safe-area-inset-bottom)); max-width: min(29rem,calc(100% - 2rem)); border-radius: .5rem; background: var(--dark); color: white; box-shadow: var(--shadow); }
#toast:not(:empty) { padding: .85rem 1.2rem; }
#toast:empty { display: none; }

@media (max-width: 52rem) {
  .topbar-inner { flex-wrap: wrap; gap: 0 1rem; padding-top: .85rem; }
  .main-nav { order: 3; flex-basis: 100%; min-height: 3rem; margin-top: .4rem; }
  .main-nav button:first-child { margin-left: -.75rem; }
  .auth-layout { grid-template-columns: minmax(21rem, 1.2fr) minmax(0,.8fr); }
  #account-label { max-width: 11rem; }
}
@media (max-width: 42rem) {
  .auth-layout { display: flex; flex-direction: column; }
  .auth-paper { flex: 1; gap: 2.65rem; padding: 1.6rem 1.35rem 2.5rem; }
  .auth-body { margin-block: auto; padding-block: .5rem .85rem; }
  .field-art { min-height: clamp(8rem,23vh,13rem); }
  .page-head, .section-head { align-items: start; flex-wrap: wrap; gap: 1rem; }
  .page-head .actions { flex-basis: 100%; }
  .stats { grid-template-columns: repeat(auto-fit,minmax(min(100%,8rem),1fr)); }
  .stat { min-height: 6.4rem; padding: .9rem 1rem; }
  .row { align-items: start; flex-wrap: wrap; }
  .fields { grid-template-columns: 1fr; }
  #account-label { display: none; }
  th, td { padding-inline: .4rem; }
}
@media (max-width: 22rem) {
  .auth-paper { padding-inline: 1rem; }
  .wordmark { font-size: 1.45rem; gap: .5rem; }
  .field-mark { width: 1.8rem; height: 1.8rem; }
  .form-actions > button { flex: 1 1 100%; }
}
