/* GeoDataFarm - "Field & contour".
 * Colours and type come from the approved design (claude.ai design canvas,
 * December 2026). Components use only the variables in :root.
 * Fonts are served from /static/fonts (SIL OFL), not from Google. */

@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/inter-latin-ext-wght-normal.ad4eb06671be.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../fonts/inter-latin-wght-normal.8e433c0592f7.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-ext-wght-normal.0c620fb096d6.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url("../fonts/space-grotesk-latin-wght-normal.b75d397ffd1c.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --gdf-ground: #F6F7F3;      /* page background */
  --gdf-surface: #FFFFFF;     /* header, cards */
  --gdf-ink: #18211C;
  --gdf-muted: #55615A;
  --gdf-line: #DDE2DA;
  --gdf-line-strong: #C9D1C6;
  --gdf-green: #2E6A3B;
  --gdf-green-hover: #24552F;
  --gdf-green-tint: #E3EEE2;
  --gdf-green-ink: #1F3A25;   /* text on the green tint */
  --gdf-on-green: #FFFFFF;
  --gdf-amber: #E0A526;
  --gdf-amber-tint: #FBF0D6;
  --gdf-amber-ink: #4A3D1C;
  --gdf-danger: #A33A2C;
  --gdf-footer: #1F2A23;
  --gdf-footer-ink: #DCE3DA;
  --gdf-code-bg: #1F2A23;
  --gdf-code-ink: #E7ECE6;
  --gdf-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gdf-font-head: "Space Grotesk", var(--gdf-font);
  --gdf-font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --gdf-radius: 12px;
  --gdf-radius-lg: 16px;
  --gdf-max: 75rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --gdf-ground: #121915;
    --gdf-surface: #1A231D;
    --gdf-ink: #E6ECE7;
    --gdf-muted: #A5B0A8;
    --gdf-line: #2C3830;
    --gdf-line-strong: #3C4A40;
    --gdf-green: #7CC08A;
    --gdf-green-hover: #96D0A2;
    --gdf-green-tint: #1F3325;
    --gdf-green-ink: #CFE6D3;
    --gdf-on-green: #0E1410;
    --gdf-amber: #E8B64A;
    --gdf-amber-tint: #2E2615;
    --gdf-amber-ink: #F0DDB0;
    --gdf-danger: #E07A6A;
    --gdf-footer: #0C110E;
    --gdf-code-bg: #0C110E;
    color-scheme: dark;
  }
}

/* --- Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--gdf-ground); color: var(--gdf-ink);
       font-family: var(--gdf-font); font-size: 1rem; line-height: 1.55;
       min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }
a { color: var(--gdf-green); }
a:hover { color: var(--gdf-green-hover); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--gdf-font-head); font-weight: 600; line-height: 1.15;
             letter-spacing: -0.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 1.5vw + 1rem, 1.9rem); }
h3 { font-size: 1.3rem; font-weight: 500; }
p { margin: 0 0 1em; }
.lead { font-size: 1.2rem; color: var(--gdf-muted); max-width: 34em; }
.muted { color: var(--gdf-muted); }
pre, code { font-family: var(--gdf-font-mono); }
pre { background: var(--gdf-code-bg); color: var(--gdf-code-ink); padding: 1.1rem 1.25rem;
      border-radius: var(--gdf-radius); overflow-x: auto; font-size: .9rem; line-height: 1.6; }
:focus-visible { outline: 3px solid var(--gdf-amber); outline-offset: 2px; }
[hidden] { display: none !important; }   /* even on elements styled display:flex */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden;
                   clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--gdf-max); margin: 0 auto; padding: 0 1rem; }
@media (min-width: 40rem) { .wrap { padding: 0 1.5rem; } }
.page { padding-block: 2.5rem 5rem; min-height: 60vh; }

/* --- Buttons and forms ---------------------------------------------------- */
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.75rem; padding: 0 1.1rem; border: 1px solid transparent; border-radius: 10px;
  background: var(--gdf-green); color: var(--gdf-on-green);
  font: 600 1rem var(--gdf-font); text-decoration: none; cursor: pointer;
}
.button:hover, button:hover { background: var(--gdf-green-hover); color: var(--gdf-on-green); }
.button.secondary, button.secondary {
  background: var(--gdf-surface); color: var(--gdf-ink); border-color: var(--gdf-line-strong); font-weight: 500;
}
.button.secondary:hover, button.secondary:hover { border-color: var(--gdf-green); color: var(--gdf-ink); }
.button.dark { background: var(--gdf-ink); color: var(--gdf-ground); }
.button.large { min-height: 3.25rem; padding: 0 1.5rem; font-size: 1.05rem; border-radius: var(--gdf-radius); }
.link-button { background: none; border: 0; min-height: 0; padding: 0; color: var(--gdf-green);
               font: inherit; text-decoration: underline; cursor: pointer; }
.link-button:hover { background: none; color: var(--gdf-green-hover); }
.buttons { display: flex; flex-wrap: wrap; gap: .75rem; }

form p { margin: 0 0 1rem; }
.card form { margin-bottom: 1.25rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=date], select, textarea {
  width: 100%; min-height: 2.75rem; font: inherit; padding: .5rem .75rem; color: var(--gdf-ink);
  background: var(--gdf-surface); border: 1px solid var(--gdf-line-strong); border-radius: 10px;
}
.helptext { display: block; font-size: .9rem; color: var(--gdf-muted); margin-top: .25rem; }
.errorlist, .error { color: var(--gdf-danger); padding: 0; margin: .25rem 0; list-style: none; }

/* --- Header --------------------------------------------------------------- */
.site-header { background: var(--gdf-surface); border-bottom: 1px solid var(--gdf-line); }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
                     justify-content: space-between; padding-block: .75rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none;
         color: var(--gdf-ink); font: 700 1.25rem var(--gdf-font-head); }
.brand:hover { color: var(--gdf-ink); }
.brand svg { flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.nav > a:not(.button), .nav .link-button {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; padding: 0 .75rem;
  border-radius: 8px; color: var(--gdf-ink); text-decoration: none; font-size: .95rem;
}
.nav > a:not(.button):hover, .nav .link-button:hover { background: var(--gdf-ground); color: var(--gdf-ink); }
.nav > a[aria-current] { color: var(--gdf-green); font-weight: 600; }
.nav .button { min-height: 2.5rem; margin-left: .5rem; font-size: .95rem; }
.nav form { display: inline; }
.farm-badge { font-size: .85rem; color: var(--gdf-muted); padding: 0 .5rem; }

.help-strip { background: var(--gdf-green-tint); color: var(--gdf-green-ink);
              border-bottom: 1px solid var(--gdf-line-strong); }
.help-strip .wrap { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center;
                    justify-content: space-between; padding-block: .85rem; }
.help-strip p { margin: 0; display: flex; gap: .6rem; align-items: center; }
.help-strip svg { flex: none; }
.help-strip .button { min-height: 2.5rem; font-size: .95rem; }

.messages { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.messages li { padding: .75rem 1rem; border-radius: var(--gdf-radius); background: var(--gdf-green-tint);
               color: var(--gdf-green-ink); }

/* --- Footer --------------------------------------------------------------- */
.site-footer { background: var(--gdf-footer); color: var(--gdf-footer-ink); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: space-between;
                     padding-block: 3rem; }
.site-footer a { color: var(--gdf-footer-ink); }
.site-footer a:hover { color: #FFFFFF; }
.footer-about { max-width: 22rem; display: flex; flex-direction: column; gap: .6rem; }
.footer-about strong { font: 700 1.25rem var(--gdf-font-head); color: #FFFFFF; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 3rem; }
.footer-cols > div { display: flex; flex-direction: column; gap: .6rem; }
.footer-cols .title, .site-footer label { font-weight: 600; color: #FFFFFF; margin: 0; }
.site-footer select { width: auto; min-height: 2.5rem; background: #26332B; color: #FFFFFF;
                      border-color: #3C4A40; }

/* --- Cards and lists ------------------------------------------------------ */
.card { background: var(--gdf-surface); border: 1px solid var(--gdf-line);
        border-radius: var(--gdf-radius-lg); padding: 1.5rem; }
.narrow { max-width: 28rem; margin-inline: auto; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.link-card { display: flex; flex-direction: column; gap: .5rem; padding: 1.35rem;
             background: var(--gdf-surface); border: 1px solid var(--gdf-line);
             border-radius: 14px; color: var(--gdf-ink); text-decoration: none; }
a.link-card:hover { border-color: var(--gdf-green); color: var(--gdf-ink); }
.link-card .kicker, .kicker { font-size: .8rem; font-weight: 600; color: var(--gdf-green);
                              text-transform: none; letter-spacing: 0; }
.link-card .title { font: 500 1.2rem var(--gdf-font-head); }
.link-card p { margin: 0; color: var(--gdf-muted); font-size: .95rem; }
.tag { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .8rem;
       background: var(--gdf-surface); border: 1px solid var(--gdf-line); }
.tag.green { background: var(--gdf-green-tint); color: var(--gdf-green-ink); border-color: transparent; }
.pill { align-self: flex-start; padding: .35rem .8rem; border-radius: 999px; font-size: .85rem;
        font-weight: 600; background: var(--gdf-green-tint); color: var(--gdf-green-ink); }

/* Tip box: a tinted box, never a coloured side bar. */
.note { display: flex; gap: .75rem; align-items: flex-start; padding: 1rem 1.1rem;
        border-radius: var(--gdf-radius); background: var(--gdf-green-tint); color: var(--gdf-green-ink); }
.note p:last-child { margin-bottom: 0; }

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--gdf-line); }

/* --- Home ----------------------------------------------------------------- */
.hero { display: flex; flex-wrap: wrap; gap: 3.5rem; align-items: center; padding-block: 4.5rem 4rem; }
.hero > div { flex: 1 1 min(26rem, 100%); min-width: 0; display: flex; flex-direction: column; gap: 1.5rem; }
.hero h1 { font-size: clamp(2.4rem, 4vw + 1rem, 3.5rem); line-height: 1.05; margin: 0; }
.hero .lead { margin: 0; }
.hero figure { flex: 1 1 min(26rem, 100%); min-width: 0; margin: 0; padding: 1rem; background: var(--gdf-surface);
               border: 1px solid var(--gdf-line); border-radius: 20px; }
.band { background: var(--gdf-surface); border-block: 1px solid var(--gdf-line); }
.section { padding-block: 4.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline;
                flex-wrap: wrap; gap: .75rem; margin-bottom: 1.75rem; }
.section-head h2 { margin: 0; }
.home-messages { margin-top: 1.5rem; }
.features { margin-top: 2rem; }
.pro-section { padding-bottom: 5rem; }
.pro-band { display: flex; overflow-wrap: anywhere; flex-wrap: wrap; gap: 2rem; align-items: center; justify-content: space-between;
            padding: 2.5rem; border-radius: 20px; background: var(--gdf-amber-tint); color: var(--gdf-amber-ink); }
.pro-band > div { flex: 1 1 min(26rem, 100%); min-width: 0; }
.pro-band h2 { margin: .75rem 0 .5rem; }
.pro-band p { margin: 0; }
.pro-band .pill { background: var(--gdf-amber); color: #18211C; }
.feature { display: flex; flex-direction: column; gap: .75rem; padding: 1.75rem;
           border-radius: var(--gdf-radius-lg); background: var(--gdf-ground); }
.feature h3 { margin: 0; }
.feature p { margin: 0; color: var(--gdf-muted); }

/* --- Help ----------------------------------------------------------------- */
.help-head { max-width: 47rem; display: flex; flex-direction: column; gap: 1rem; margin-bottom: 3rem; }
.help-head h1, .help-head p { margin: 0; }
.search-form { display: flex; gap: .5rem; }
.search-form input { min-height: 3.25rem; font-size: 1.05rem; border-radius: var(--gdf-radius); }
.choice { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem; border-radius: var(--gdf-radius-lg);
          background: var(--gdf-surface); border: 1px solid var(--gdf-line); color: var(--gdf-ink); text-decoration: none; }
.choice.primary { background: var(--gdf-green-tint); border-color: transparent; color: var(--gdf-green-ink); }
.choice:hover { border-color: var(--gdf-green); color: inherit; }
.choice svg { flex: none; }
.choice strong { display: block; font: 600 1.35rem var(--gdf-font-head); margin-bottom: .2rem; }
.help-section { margin-top: 3.5rem; }
.help-section > p { color: var(--gdf-muted); margin-top: -.25rem; }
.tab-card { display: flex; flex-direction: column; gap: .55rem; padding: 1.35rem;
            background: var(--gdf-surface); border: 1px solid var(--gdf-line); border-radius: 14px; }
.tab-card .name { font: 600 1.25rem var(--gdf-font-head); }
.split { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 3.5rem; }
.split > * { flex: 1 1 min(22rem, 100%); min-width: 0; }
.problem-list { list-style: none; padding: 0; margin: 0; }
.problem-list a { display: flex; justify-content: space-between; gap: .75rem; padding: 1rem .25rem;
                  border-bottom: 1px solid var(--gdf-line); color: var(--gdf-ink); text-decoration: none; }
.problem-list a:hover { color: var(--gdf-green); }
.ask-box { display: flex; flex-direction: column; gap: .9rem; align-self: flex-start; }
.ask-box h2 { margin: 0; }
.ask-box p { margin: 0; color: var(--gdf-muted); }
.ask-inline { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center;
              justify-content: space-between; margin-top: 2rem; }
.ask-inline p { margin: .2rem 0 0; color: var(--gdf-muted); }
.ask-inline strong { font: 600 1.2rem var(--gdf-font-head); }

.guide-layout { display: flex; flex-wrap: wrap; gap: 3rem; align-items: flex-start; }
.guide-nav { flex: 1 1 min(15rem, 100%); max-width: 18rem; display: flex; flex-direction: column; gap: .2rem; font-size: .95rem; }
.guide-nav .group { padding: 1rem .75rem .4rem; font-size: .8rem; font-weight: 600; color: var(--gdf-muted); }
.guide-nav .group:first-child { padding-top: 0; }
.guide-nav a { padding: .55rem .75rem; border-radius: 8px; color: var(--gdf-ink); text-decoration: none; }
.guide-nav a:hover { background: var(--gdf-surface); }
.guide-nav a[aria-current] { background: var(--gdf-green-tint); color: var(--gdf-green-ink); font-weight: 600; }
.guide { flex: 999 1 min(35rem, 100%); min-width: 0; max-width: 47.5rem; }
.guide .crumbs { font-size: .9rem; color: var(--gdf-muted); margin-bottom: .75rem; }
.guide .tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.guide h2 { margin-top: 2rem; }
.guide p, .guide li { font-size: 1.06rem; line-height: 1.65; }
.guide figure { margin: 1.5rem 0; }
.guide figure img { border-radius: 14px; border: 1px solid var(--gdf-line); }
.prev-next { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
             margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gdf-line); }
.prev-next a { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; font-weight: 600; }
.prev-next a span { font-size: .8rem; font-weight: 400; color: var(--gdf-muted); }
.prev-next a.next { text-align: right; margin-left: auto; }
.search-form button { min-height: 3.25rem; border-radius: var(--gdf-radius); }

@media (max-width: 40rem) {
  .hero { padding-block: 2.5rem; gap: 2rem; }
  .section { padding-block: 3rem; }
  .pro-band { padding: 1.5rem; }
  .nav .button { margin-left: 0; }
}

/* --- Farm app: map + field journal ----------------------------------------- */
.app { display: flex; flex-direction: column; min-height: calc(100vh - 4.5rem); }
.app-bar { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center;
           justify-content: space-between; padding: .9rem 1.5rem;
           background: var(--gdf-surface); border-bottom: 1px solid var(--gdf-line); }
.app-title { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.app-title h1 { font-size: 1.6rem; margin: 0; }
.app-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.app-filters label { display: flex; flex-direction: column; gap: .2rem; margin: 0;
                     font-size: .8rem; font-weight: 600; color: var(--gdf-muted); }
.app-filters select { width: auto; min-width: 9rem; min-height: 2.5rem; color: var(--gdf-ink); font-weight: 500; }
.app-message { padding: 2rem 1.5rem; }
.app-body { flex: 1; display: flex; flex-wrap: wrap; min-height: 0; }
.map-panel { flex: 3 1 min(30rem, 100%); min-height: 24rem; position: relative; }
#map { position: absolute; inset: 0; }
@media (max-width: 50rem) { .map-panel { min-height: 55vh; } #map { position: relative; height: 55vh; } }
.map-empty { position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 2; margin: 0;
             padding: .6rem 1rem; border-radius: 10px; background: var(--gdf-surface);
             box-shadow: 0 2px 8px rgb(0 0 0 / .15); font-size: .95rem; }
.journal-panel { flex: 2 1 min(22rem, 100%); max-height: calc(100vh - 9rem); overflow-y: auto;
                 padding: 1.25rem 1.5rem 2rem; background: var(--gdf-surface);
                 border-left: 1px solid var(--gdf-line); }
.journal-panel.htmx-request { opacity: .6; transition: opacity .2s; }
.journal-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
                margin-bottom: 1rem; }
.journal-head h2 { margin: 0; font-size: 1.35rem; }
.journal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.journal-entry { padding: .9rem 1rem; border: 1px solid var(--gdf-line); border-radius: var(--gdf-radius);
                 background: var(--gdf-ground); }
.entry-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.entry-top time { font-size: .9rem; color: var(--gdf-muted); font-variant-numeric: tabular-nums; }
.entry-field { margin: .4rem 0 0; font-weight: 600; }
.entry-details { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: .5rem 0 0; font-size: .92rem; }
.entry-details div { display: flex; gap: .35rem; }
.entry-details dt { color: var(--gdf-muted); }
.entry-details dd { margin: 0; font-weight: 500; }
.entry-other { margin: .5rem 0 0; font-size: .92rem; }
.entry-source { margin: .4rem 0 0; font-size: .82rem; color: var(--gdf-muted); }
/* One tint per operation; text stays dark enough to read on each. */
.op { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.op-plant { background: #E3EEE2; color: #1F3A25; }
.op-ferti { background: #FBF0D6; color: #5A4310; }
.op-spray { background: #E1ECF4; color: #1D3B52; }
.op-harvest { background: #F1E4B0; color: #4A3D1C; }
.op-plowing, .op-harrowing { background: #EDE6DD; color: #4A3A2A; }
.op-soil { background: #EAE3EE; color: #3F2E4A; }
@media (prefers-color-scheme: dark) {
  .op { filter: brightness(.85); }
}
.maplibregl-popup-content { font: 500 .9rem var(--gdf-font); color: #18211C; padding: .45rem .7rem; }

/* --- Farm app: side menu ----------------------------------------------------- */
.app.with-menu { flex-direction: row; }
.app-menu { flex: none; width: 15rem; display: flex; flex-direction: column; gap: .2rem;
            padding: 1rem .75rem; background: var(--gdf-surface); border-right: 1px solid var(--gdf-line); }
.app-menu a { display: flex; align-items: center; gap: .6rem; min-height: 2.75rem; padding: 0 .75rem;
              border-radius: 10px; color: var(--gdf-ink); text-decoration: none; font-weight: 500; }
.app-menu a:hover { background: var(--gdf-ground); color: var(--gdf-ink); }
.app-menu a svg { flex: none; color: var(--gdf-green); }
.app-menu a[aria-current] { background: var(--gdf-green-tint); color: var(--gdf-green-ink); font-weight: 600; }
.app-menu a.later { color: var(--gdf-muted); font-weight: 400; }
.app-menu a.later svg { color: var(--gdf-muted); }
.app-menu-group { margin: 1.25rem .75rem .25rem; font-size: .78rem; font-weight: 600; color: var(--gdf-muted); }
.app-menu-note { margin: .5rem .75rem 0; font-size: .8rem; color: var(--gdf-muted); }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-messages { margin: 1rem 1.5rem 0; }
@media (max-width: 50rem) {
  .app.with-menu { flex-direction: column; }
  .app-menu { width: auto; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: .25rem;
              padding: .5rem; border-right: 0; border-bottom: 1px solid var(--gdf-line); }
  .app-menu a { white-space: nowrap; min-height: 2.5rem; }
  .app-menu-group, .app-menu-note { display: none; }
}

/* --- New journal entry ----------------------------------------------------- */
.entry-page { padding: 1.5rem; max-width: 56rem; }
.entry-page h1 { font-size: 1.8rem; }
.op-picker { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; }
.op-choice { display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.1rem;
             border-radius: 12px; border: 2px solid transparent; text-decoration: none; font-weight: 600; }
.op-choice[aria-current] { border-color: var(--gdf-ink); }
.op-choice:hover { border-color: var(--gdf-line-strong); }
.entry-form fieldset { border: 0; padding: 0; margin: 1rem 0; }
.entry-form legend { font: 600 1.15rem var(--gdf-font-head); margin-bottom: .75rem; padding: 0; }
.entry-grid { display: grid; gap: 0 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.entry-form textarea { width: 100%; font: inherit; padding: .5rem .75rem; color: var(--gdf-ink);
                       background: var(--gdf-surface); border: 1px solid var(--gdf-line-strong); border-radius: 10px; }
.entry-form .check label { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; font-weight: 500; }
.entry-form .check input { width: 1.25rem; height: 1.25rem; }
.req { color: var(--gdf-danger); }
.unit { font-weight: 400; color: var(--gdf-muted); }
.small { font-size: .85rem; }
.journal-head .button { min-height: 2.5rem; font-size: .9rem; }

/* --- Data sets on the map ---------------------------------------------------- */
.data-filter { display: flex; flex-direction: column; gap: .2rem; margin: 0; font-size: .8rem;
               font-weight: 600; color: var(--gdf-muted); }
.data-filter select { width: auto; min-width: 14rem; max-width: 22rem; min-height: 2.5rem;
                      color: var(--gdf-ink); font-weight: 500; }
.map-legend { position: absolute; left: .75rem; bottom: 2.25rem; z-index: 2; min-width: 9rem;
              padding: .6rem .75rem; border-radius: 10px; background: var(--gdf-surface);
              box-shadow: 0 2px 8px rgb(0 0 0 / .15); font-size: .85rem; font-variant-numeric: tabular-nums; }
.map-legend strong { display: block; margin-bottom: .3rem; }
.map-legend div { display: flex; align-items: center; gap: .5rem; }
.map-legend .swatch { width: 1.1rem; height: .8rem; border-radius: 3px; border: 1px solid rgb(0 0 0 / .1); }
.maplibregl-popup-content { white-space: pre-line; }

/* --- Import ------------------------------------------------------------------ */
.entry-page.wide { max-width: 72rem; }
.entry-page .crumbs { font-size: .9rem; color: var(--gdf-muted); margin: 0 0 .5rem; }
.entry-page section.card { margin-bottom: 1.25rem; }
.entry-page section.card h2, .entry-page form.card h2 { font-size: 1.25rem; }
.op-radio { cursor: pointer; gap: .5rem; border-color: var(--gdf-line); background: var(--gdf-surface); }
.op-radio:has(input:checked) { border-color: var(--gdf-green); background: var(--gdf-green-tint); color: var(--gdf-green-ink); }
.op-radio input { width: 1.1rem; height: 1.1rem; margin: 0; }
.table-scroll { overflow-x: auto; }
.import-table td, .import-table th { vertical-align: middle; white-space: nowrap; }
.import-table input[type=text], .import-table input[type=date], .import-table select { min-width: 9rem; }
.import-table input[type=checkbox] { width: 1.2rem; height: 1.2rem; }
.import-status progress { width: 100%; height: .9rem; accent-color: var(--gdf-green); }
.import-history { margin-top: 2rem; font-size: 1.3rem; }
.result-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .8rem .25rem;
              border-bottom: 1px solid var(--gdf-line); }
.reread-form { margin-bottom: 1.25rem; }
.reread-form select { width: auto; min-width: 7rem; }
.table-scroll.preview { margin-top: 1rem; max-height: 14rem; }
.date-choice { border: 0; padding: 0; margin: 1rem 0 0; }
.date-choice legend { font-weight: 600; margin-bottom: .5rem; }
.date-choice .check { display: flex; align-items: center; gap: .5rem; font-weight: 500; margin: .5rem 0; }
.date-choice .indent { margin-left: 1.75rem; }

/* --- Fields: drawing ---------------------------------------------------------- */
.draw-tools { position: absolute; top: .75rem; left: .75rem; z-index: 3; display: flex; gap: .5rem; flex-wrap: wrap; }
.draw-tools button { box-shadow: 0 2px 8px rgb(0 0 0 / .2); }
.field-form h2, .fields-heading { font-size: 1.3rem; }
.fields-heading { margin-top: 2rem; }
.draw-steps { padding-left: 1.2rem; margin: 0 0 1rem; font-size: .92rem; }
.field-area { font-weight: 600; color: var(--gdf-green); min-height: 1.4em; margin: 0 0 .5rem; }
.field-list { list-style: none; padding: 0; margin: 0; }
.field-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem;
                 padding: .75rem 0; border-bottom: 1px solid var(--gdf-line); }
.field-remove summary { cursor: pointer; color: var(--gdf-muted); font-size: .9rem; }
.field-remove form { margin-top: .5rem; max-width: 14rem; }
button.danger { background: var(--gdf-danger); color: #FFFFFF; }
button.danger:hover { background: var(--gdf-danger); filter: brightness(.9); color: #FFFFFF; }

/* --- Data sets ---------------------------------------------------------------- */
.dataset-group { margin-bottom: 1.25rem; }
.dataset-group h2 { font-size: 1.2rem; }
.rename-inline { display: flex; gap: .4rem; margin-top: .4rem; }
.rename-inline input { min-width: 10rem; }
.danger-zone { border-color: color-mix(in srgb, var(--gdf-danger) 40%, var(--gdf-line)); }
.danger-zone input { max-width: 22rem; }

/* --- Map legend: style panel ----------------------------------------------- */
.map-legend { max-width: min(18rem, calc(100% - 1.5rem)); max-height: calc(100% - 3rem); overflow-y: auto; }
.legend-head { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; }
.legend-style { font-size: .82rem; }
.style-panel { display: flex; flex-direction: column; gap: .45rem; margin-top: .6rem; padding-top: .6rem;
               border-top: 1px solid var(--gdf-line); }
.style-panel label { display: flex; flex-direction: column; gap: .15rem; margin: 0; font-size: .8rem;
                     font-weight: 600; color: var(--gdf-muted); }
.style-panel label.inline { flex-direction: row; align-items: center; gap: .4rem; }
.style-panel select, .style-panel input[type=text] { min-height: 2.2rem; padding: .25rem .5rem; font-size: .88rem;
                                                      color: var(--gdf-ink); font-weight: 400; }
.style-panel .minmax { display: flex; gap: .5rem; }
.style-panel .minmax label { flex: 1; }
.style-panel .buttons button { min-height: 2.2rem; font-size: .88rem; padding: 0 .8rem; }
.style-panel p { margin: 0; }

/* --- Data tools ------------------------------------------------------------- */
.data-tools details { border-top: 1px solid var(--gdf-line); padding: .6rem 0; }
.data-tools summary { cursor: pointer; font-weight: 600; }
.tool-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem .9rem;
             margin-top: .6rem; align-items: end; }
.tool-form .wide { grid-column: 1 / -1; }
.tool-form label { display: flex; flex-direction: column; gap: .2rem; margin: 0; }
.tool-form p { margin: 0; }
.tool-form code { font-size: .82rem; background: var(--gdf-green-tint); padding: 0 .25rem; border-radius: 3px; }
.confirm-box { border-left: 4px solid var(--gdf-green, #2E6A3B); }
.danger-link { color: var(--gdf-danger); font-size: .85rem; margin-top: .4rem; }

/* --- Analyses ----------------------------------------------------------------- */
.analyse-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem 1rem;
                align-items: end; }
.analyse-form .wide { grid-column: 1 / -1; }
.analyse-form label { display: flex; flex-direction: column; gap: .25rem; margin: 0; }
.analyse-form details summary { cursor: pointer; font-weight: 600; }
.analyse-form .limits input { min-height: 2.2rem; max-width: 9rem; }
.analyse-result .section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
                                flex-wrap: wrap; }
.chart { position: relative; margin: 1rem 0; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--gdf-line); stroke-width: 1; }
.chart-svg .axis { stroke: var(--gdf-line-strong); stroke-width: 1; }
.chart-svg .tick { fill: var(--gdf-muted); font-size: 12px; }
.chart-svg .line { fill: none; stroke: var(--gdf-green); stroke-width: 2; stroke-linejoin: round; }
.chart-svg .dot { fill: var(--gdf-green); stroke: var(--gdf-surface); stroke-width: 2; }
.chart-svg .bar { fill: var(--gdf-green); }
.chart-svg .hit { fill: transparent; cursor: default; outline: none; }
.chart-svg .hit.active, .chart-svg .hit:focus-visible { fill: var(--gdf-ink); fill-opacity: .06; }
.chart-tip { position: absolute; white-space: pre-line; pointer-events: none; background: var(--gdf-surface);
             color: var(--gdf-ink); border: 1px solid var(--gdf-line-strong); border-radius: 6px;
             padding: .4rem .6rem; font-size: .85rem; box-shadow: 0 2px 8px rgb(0 0 0 / .12); }

/* --- Prescription files --------------------------------------------------------- */
.source-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .6rem 1rem; }
.source-list label { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; }
.analyse-form h2 { margin: .5rem 0 0; font-size: 1.1rem; }
.prescription-map { min-height: 26rem; margin-top: 1rem; border-radius: 8px; overflow: hidden; }
#rx-map { position: absolute; inset: 0; }
.stat-row { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: .5rem 0; }
.stat-row div { display: flex; flex-direction: column; }
.stat-row dt { font-size: .8rem; color: var(--gdf-muted); }
.stat-row dd { margin: 0; font-size: 1.25rem; font-weight: 600; }
.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.5rem; }
.download-grid h3 { margin: 0; font-size: 1rem; }

/* --- Reports ------------------------------------------------------------------- */
.report-kinds, .report-ops { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.report-kinds legend, .report-ops legend { font-weight: 600; margin-bottom: .35rem; padding: 0; }
.analyse-form label.inline { flex-direction: row; align-items: center; gap: .4rem; font-weight: 400; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.report-head h2 { margin: 0 0 .25rem; }
.report-section { margin-top: 1.5rem; break-inside: auto; }
.report-section h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.report-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 1rem; }
.report-table th, .report-table td { border: 1px solid var(--gdf-line); padding: .35rem .5rem; text-align: left;
                                     vertical-align: top; }
.report-table thead th, .report-table th[scope=row] { background: var(--gdf-green-tint); color: var(--gdf-green-ink); }
.spray-table th[scope=row] { width: 34%; font-weight: 600; }
.spray-table td { width: 22%; }
.report-table .pair { display: inline-block; margin-right: .9rem; }
.nowrap { white-space: nowrap; }

@media print {
  .site-header, .site-footer, .app-menu, .no-print, .messages { display: none !important; }
  .app.with-menu, .app-main, .entry-page { display: block; margin: 0; padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .report-table th, .report-table td { border-color: #999; }
  .report-table thead th, .report-table th[scope=row] { background: #eee; color: #000; }
  .spray-table, .report-table tr { break-inside: avoid; }
  .table-scroll { overflow: visible; }
}

/* --- Journal settings ------------------------------------------------------------ */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1rem; border-bottom: 1px solid var(--gdf-line); }
.tabs a { padding: .5rem .85rem; border-radius: 6px 6px 0 0; color: var(--gdf-ink); text-decoration: none; }
.tabs a[aria-current=page] { background: var(--gdf-surface); border: 1px solid var(--gdf-line); border-bottom-color: var(--gdf-surface);
                             margin-bottom: -1px; font-weight: 600; }
.settings-table input[type=text] { min-height: 2.1rem; padding: .2rem .45rem; width: 100%; min-width: 6rem; }
.settings-table select { min-height: 2.1rem; padding: .2rem .4rem; }
.settings-table td { vertical-align: top; }
.settings-table .small { display: block; margin-top: .2rem; }
.muted-row input[type=text], .muted-row select { color: var(--gdf-muted); }
.icon-button { min-height: 2rem; min-width: 2rem; padding: 0 .4rem; background: transparent; color: var(--gdf-ink);
               border: 1px solid var(--gdf-line); border-radius: 6px; }
.icon-button:disabled { opacity: .35; }

/* --- Weather -------------------------------------------------------------------- */
.fetch-form .buttons { margin-top: .5rem; }
.day-chart { margin: 1.25rem 0; }
.day-chart figcaption { margin-bottom: .35rem; }

/* --- Crop rotation ------------------------------------------------------------- */
.plan-table input[type=text] { min-height: 2.1rem; padding: .2rem .45rem; width: 100%; min-width: 8rem; }
.plan-table .current { background: var(--gdf-green-tint); }
.area-map-wrap { position: relative; height: 22rem; border-radius: 8px; overflow: hidden; }
#area-map { position: absolute; inset: 0; }
.app-menu a.app-menu-help { margin-top: .75rem; }
.help-guide { max-width: 46rem; }
.help-guide section { margin-top: 2.5rem; scroll-margin-top: 5rem; }
.help-guide section h2 { font-size: 1.35rem; }
.help-guide li { margin-block: .3rem; }
.help-toc ol { margin: 0; padding-left: 1.25rem; columns: 2 14rem; }
.spray-search { display: flex; flex-direction: column; gap: .5rem; }
.product-hits { list-style: none; padding: 0; margin: 0; max-height: 16rem; overflow-y: auto; }
.product-hits li { padding: .2rem 0; }
.product-card h3 { margin: .5rem 0; font-size: 1.1rem; }
.product-details { display: grid; grid-template-columns: minmax(8rem, max-content) 1fr; gap: .25rem 1rem; margin: 0 0 .75rem; font-size: .92rem; }
.product-details dt { color: var(--gdf-muted); }
.product-details dd { margin: 0; overflow-wrap: anywhere; }
.buffer-out { display: block; font-size: .9rem; }
.entry-grid .spray-search { grid-column: 1 / -1; }
.swatch { display: inline-block; width: 1rem; height: 1rem; border-radius: 3px; vertical-align: middle; }
.pro-badge { font-size: .8rem; vertical-align: middle; padding: .1rem .45rem; border-radius: 999px; background: var(--gdf-green-tint); color: var(--gdf-green-ink); }
.risk { font-weight: 600; }
.risk-low { color: var(--gdf-green-ink); }
.risk-moderate { color: #9a6b00; }
.risk-high { color: #b3261e; }
.planned-table input { width: 100%; min-width: 4rem; }
