/* DIY.ag shared site styles */
:root {
    --sky: #EEF1EE;          /* limestone sky */
    --topsoil: #3A2E26;      /* text */
    --silt: #8A7560;         /* A-horizon */
    --claypan: #6E6A63;      /* Bt claypan gray */
    --bluestem: #6B3A4E;     /* big bluestem in fall */
    --wheat: #C9A24A;
    --leaf: #4E6B3A;
    --rule: #CFD3CC;
    --paper: #F8F9F6;

    --display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
    --body: "Source Serif 4", Georgia, "Times New Roman", serif;

    --measure: 38rem;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  html { scroll-padding-top: calc(3.5rem + env(safe-area-inset-top, 0px)); scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
  *, *::before, *::after { box-sizing: inherit; }

  body {
    margin: 0;
    background: var(--sky);
    color: var(--topsoil);
    font-family: var(--body);
    font-size: 1.125rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }
  img, svg { max-width: 100%; }
  a { color: var(--bluestem); text-underline-offset: 0.18em; }
  a:focus-visible, button:focus-visible { outline: 3px solid var(--wheat); outline-offset: 3px; border-radius: 2px; }

  h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.05; letter-spacing: 0.005em; margin: 0; }
  h2 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 1.25rem; }
  h3 { font-size: 1.55rem; margin-bottom: 0.4rem; }
  p { margin: 0 0 1em; max-width: var(--measure); }
  em.latin { font-style: italic; }

  /* ---------- nav ---------- */
  .site-nav {
    position: sticky; top: 0; z-index: 10;
    background: rgba(238, 241, 238, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--rule);
    padding-top: env(safe-area-inset-top, 0px);
  }
  .site-nav .inner {
    max-width: 72rem; margin: 0 auto; padding: 0.7rem 1.25rem;
    display: flex; gap: 1.5rem; align-items: baseline; overflow-x: auto; white-space: nowrap;
  }
  .site-nav .brand { font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--topsoil); text-decoration: none; margin-right: auto; }
  .site-nav a.link { font-family: var(--display); font-weight: 500; font-size: 1.1rem; color: var(--claypan); text-decoration: none; }
  .site-nav a.link:hover { color: var(--bluestem); }

  /* ---------- hero: the soil profile ---------- */
  .hero { max-width: 72rem; margin: 0 auto; padding: 3.5rem 1.25rem 0; display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
  @media (min-width: 900px) { .hero { grid-template-columns: 5fr 6fr; align-items: end; } }
  .hero h1 { font-size: clamp(3rem, 8vw, 5.4rem); font-weight: 700; margin-bottom: 1.25rem; }
  .hero .lede { font-size: 1.3rem; line-height: 1.5; }
  .hero .byline { color: var(--claypan); font-size: 1rem; }
  .profile-fig { margin: 0; }
  .profile-fig figcaption { font-size: 0.95rem; color: var(--claypan); padding: 0.75rem 0 0; max-width: 34rem; }

  .roots path { stroke-dasharray: 900; stroke-dashoffset: 900; animation: grow 2.8s ease-out 0.3s forwards; }
  .roots.deep path { animation-duration: 4.2s; }
  @keyframes grow { to { stroke-dashoffset: 0; } }
  @media (prefers-reduced-motion: reduce) { .roots path { animation: none; stroke-dashoffset: 0; } }

  /* ---------- sections descend through horizons ---------- */
  section { padding: 4.5rem 1.25rem; }
  section .inner { max-width: 72rem; margin: 0 auto; }
  .horizon-a { background: var(--paper); }
  .horizon-b { background: #E7E3DC; }
  .horizon-c { background: #DEDAD3; }
  .horizon-d { background: #D4D1CB; }
  .horizon-label { font-family: var(--display); font-weight: 500; font-size: 1.05rem; color: var(--silt); margin-bottom: 0.4rem; }

  .two-col { display: grid; gap: 2rem 3.5rem; grid-template-columns: 1fr; }
  @media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; } }
  .idea { border-top: 2px solid var(--topsoil); padding-top: 0.9rem; }
  .idea p { font-size: 1.05rem; }

  .note {
    border-left: 4px solid var(--wheat); padding: 0.2rem 0 0.2rem 1.1rem; margin: 2rem 0 0; max-width: var(--measure);
    font-size: 1.02rem;
  }

  /* phases: genuinely a sequence */
  .phases { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 0; grid-template-columns: 1fr; counter-reset: phase; }
  @media (min-width: 900px) { .phases { grid-template-columns: repeat(4, 1fr); } }
  .phases li { counter-increment: phase; padding: 1.1rem 1.25rem 1.25rem 0; border-top: 6px solid var(--silt); }
  .phases li:nth-child(2) { border-color: var(--leaf); }
  .phases li:nth-child(3) { border-color: var(--bluestem); }
  .phases li:nth-child(4) { border-color: var(--wheat); }
  .phases li::before { content: "Phase " counter(phase); display: block; font-family: var(--display); font-size: 1.05rem; color: var(--claypan); }
  .phases p { font-size: 1rem; margin: 0; }

  /* table */
  .table-wrap table { min-width: 680px; }
  .table-wrap { overflow-x: auto; margin-top: 2rem; border-top: 2px solid var(--topsoil); -webkit-overflow-scrolling: touch; }
  table { border-collapse: collapse; width: 100%; font-size: 0.98rem; line-height: 1.45; }
  th { font-family: var(--display); font-weight: 600; font-size: 1.1rem; text-align: left; padding: 0.75rem 1rem 0.6rem 0; vertical-align: bottom; }
  td { padding: 0.8rem 1rem 0.8rem 0; border-top: 1px solid #BFBBB3; vertical-align: top; }
  td:first-child { font-family: var(--display); font-weight: 600; font-size: 1.12rem; width: 15%; }
  .pill { display: inline-block; font-family: var(--display); font-size: 0.95rem; padding: 0.05rem 0.5rem; border: 1px solid var(--bluestem); color: var(--bluestem); border-radius: 3px; white-space: nowrap; }

  /* challenges */
  .challenges { display: grid; gap: 1.75rem 3rem; grid-template-columns: 1fr; margin-top: 2rem; }
  @media (min-width: 760px) { .challenges { grid-template-columns: 1fr 1fr; } }
  .challenges h3 { font-size: 1.35rem; }
  .challenges p { font-size: 1.02rem; margin: 0; }

  /* farm facts */
  .facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.5rem; margin: 1.5rem 0 0; font-size: 1.02rem; max-width: 34rem; }
  .facts dt { font-family: var(--display); font-weight: 600; font-size: 1.12rem; }
  .facts dd { margin: 0; }

  /* timeline */
  .timeline { list-style: none; margin: 2rem 0 0; padding: 0; position: relative; }
  .timeline::before { content: ""; position: absolute; left: 0.45rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--claypan); }
  .timeline li { position: relative; padding: 0 0 2rem 2.2rem; max-width: 44rem; }
  .timeline li::before { content: ""; position: absolute; left: 0; top: 0.45rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--sky); border: 3px solid var(--leaf); }
  .timeline li.now::before { background: var(--wheat); border-color: var(--topsoil); }
  .timeline .when { font-family: var(--display); font-weight: 600; font-size: 1.3rem; display: block; }
  .timeline p { font-size: 1.02rem; margin: 0.2rem 0 0; }

  /* questions */
  .questions { margin: 1.5rem 0 0; padding-left: 1.2rem; max-width: 42rem; }
  .questions li { margin-bottom: 0.9rem; font-size: 1.05rem; }

  footer { background: var(--topsoil); color: #E6E1D8; padding: 3rem 1.25rem calc(3rem + env(safe-area-inset-bottom, 0px)); }
  footer .inner { max-width: 72rem; margin: 0 auto; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
  @media (min-width: 760px) { footer .inner { grid-template-columns: 2fr 1fr; } }
  footer h2 { font-size: 2rem; color: #fff; margin-bottom: 0.75rem; }
  footer p { font-size: 1rem; }
  footer a { color: var(--wheat); }
  footer small { color: #B9B2A6; font-size: 0.9rem; }

/* ================================================================
   Tool pages (field inventory, protocols)
   ================================================================ */
.tool-main { max-width: 46rem; margin: 0 auto; padding: 2rem 1.25rem 5rem; }
.tool-main h1 { font-size: clamp(2.4rem, 7vw, 3.4rem); font-weight: 700; margin-bottom: 0.75rem; }
.tool-main h2 { font-size: 1.9rem; margin: 2.25rem 0 0.75rem; }
.tool-main h3 { font-size: 1.35rem; margin: 1.5rem 0 0.4rem; }
.tool-main p, .tool-main li { font-size: 1.05rem; }
.muted { color: var(--claypan); }
.small { font-size: 0.95rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 44px; padding: 0.5rem 1.1rem;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem; letter-spacing: 0.01em;
  background: var(--topsoil); color: #fff; border: 2px solid var(--topsoil); border-radius: 4px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: #4d3e33; }
.btn.secondary { background: transparent; color: var(--topsoil); }
.btn.secondary:hover { background: #E2E5E0; }
.btn.danger { background: transparent; color: #8B2B2B; border-color: #8B2B2B; }
.btn.small { min-height: 36px; padding: 0.25rem 0.75rem; font-size: 1rem; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }

.notice { border-left: 4px solid var(--wheat); background: var(--paper); padding: 0.75rem 1rem; margin: 1rem 0; font-size: 1rem; }
.notice p { margin: 0; }
.error { border-left-color: #8B2B2B; }

.field { margin: 0 0 1.1rem; }
.field > label, .field > .label { display: block; font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin-bottom: 0.3rem; }
.field .hint { font-size: 0.92rem; color: var(--claypan); margin: 0.2rem 0 0; }
.tool-main input[type=text], .tool-main input[type=date], .tool-main input[type=number], .tool-main input[type=search], .tool-main select, .tool-main textarea {
  width: 100%; min-height: 44px; padding: 0.55rem 0.7rem; font: inherit; font-size: 1.05rem;
  color: var(--topsoil); background: #fff; border: 1.5px solid #9B958C; border-radius: 4px;
}
.tool-main textarea { min-height: 5rem; }
.tool-main input:focus-visible, .tool-main select:focus-visible, .tool-main textarea:focus-visible { outline: 3px solid var(--wheat); outline-offset: 1px; }
.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.seg { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.seg button {
  min-height: 44px; min-width: 3rem; padding: 0.35rem 0.75rem; font: inherit; font-size: 1rem; line-height: 1.2;
  background: #fff; color: var(--topsoil); border: 1.5px solid #9B958C; border-radius: 4px; cursor: pointer; text-align: center;
}
.seg button[aria-pressed="true"] { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.seg button .sub { display: block; font-size: 0.8rem; opacity: 0.85; }

.list { list-style: none; margin: 0.5rem 0 0; padding: 0; border-top: 2px solid var(--topsoil); }
.list > li { border-bottom: 1px solid var(--rule); padding: 0.9rem 0; }
.list .row { display: flex; gap: 0.75rem; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.list .title { font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.15; }
.meta { font-size: 0.95rem; color: var(--claypan); }

.stop { border-top: 6px solid var(--silt); padding: 0.9rem 0 0.5rem; margin-top: 1.5rem; }
.stop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.stop-head h3 { margin: 0; }
.obs { border-bottom: 1px solid var(--rule); padding: 0.6rem 0; display: flex; gap: 0.75rem; justify-content: space-between; align-items: flex-start; }
.obs .name { font-size: 1.05rem; }
.obs .name i { font-style: italic; }
.tag { display: inline-block; font-family: var(--display); font-size: 0.95rem; padding: 0 0.45rem; border: 1px solid var(--claypan); border-radius: 3px; color: var(--claypan); margin: 0.15rem 0.25rem 0 0; white-space: nowrap; }
.tag.flag { border-color: #8B2B2B; color: #8B2B2B; }
.tag.role { border-color: var(--bluestem); color: var(--bluestem); }

.picker-results { list-style: none; margin: 0.3rem 0 0; padding: 0; border: 1.5px solid #9B958C; border-radius: 4px; background: #fff; max-height: 22rem; overflow-y: auto; }
.picker-results li { border-bottom: 1px solid var(--rule); }
.picker-results li:last-child { border-bottom: 0; }
.picker-results button { display: block; width: 100%; text-align: left; padding: 0.6rem 0.75rem; min-height: 44px; font: inherit; font-size: 1rem; background: none; border: 0; color: var(--topsoil); cursor: pointer; }
.picker-results button:hover, .picker-results button:focus-visible { background: #EEF1EE; }
.picker-results i { font-style: italic; }
.chosen { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; background: #fff; border: 1.5px solid var(--leaf); border-radius: 4px; }

.thumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 4px; border: 1px solid var(--rule); }
.thumb-wrap { position: relative; }
.thumb-wrap button { position: absolute; top: 2px; right: 2px; min-height: 28px; min-width: 28px; font-size: 0.9rem; background: rgba(58,46,38,0.85); color: #fff; border: 0; border-radius: 3px; cursor: pointer; }

.data-table-wrap { overflow-x: auto; border-top: 2px solid var(--topsoil); margin-top: 0.5rem; }
.data-table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: 0.98rem; }
.data-table th { font-family: var(--display); font-weight: 600; font-size: 1.05rem; text-align: left; padding: 0.5rem 0.75rem 0.4rem 0; }
.data-table td { padding: 0.55rem 0.75rem 0.55rem 0; border-top: 1px solid var(--rule); vertical-align: top; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--leaf); border-radius: 2px; min-width: 2px; }

.back { display: inline-block; font-family: var(--display); font-size: 1.1rem; margin-bottom: 1rem; }
.gps-readout { font-size: 0.95rem; color: var(--claypan); margin-left: 0.25rem; }

/* protocol pages */
.protocol ol.steps { padding-left: 1.4rem; }
.protocol ol.steps > li { margin-bottom: 0.9rem; padding-left: 0.25rem; }
.protocol .draft { border-left-color: var(--bluestem); }
.kit { columns: 2 14rem; padding-left: 1.2rem; }
.kit li { break-inside: avoid; margin-bottom: 0.3rem; }

@media print {
  .site-nav, .btn-row { display: none; }
  body { background: #fff; font-size: 11pt; }
  .tool-main { padding: 0; max-width: none; }
  a { color: inherit; }
}
@media (max-width: 559px) {
  .data-table { min-width: 0; }
  .data-table .barcol { display: none; }
}

/* zones */
.tag.zone { font-weight: 600; }
.zone-edit { border-top: 2px solid var(--topsoil); padding: 0.9rem 0 0.2rem; margin-top: 1rem; }
.zone-edit-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.zone-edit-head strong { font-family: var(--display); font-size: 1.25rem; }
.zone-grid { display: grid; grid-template-columns: 6rem 1fr 4.5rem; gap: 0 0.75rem; }
.zone-grid input[type=color] { width: 100%; min-height: 44px; padding: 2px; border: 1.5px solid #9B958C; border-radius: 4px; background: #fff; }
.seg button strong { font-family: var(--display); }
.slope-row { display: flex; gap: 0.6rem; align-items: center; }
.slope-row input { max-width: 8rem; }


/* ================================================================
   Tool & protocol page layout v2: centered sheet
   ================================================================ */
.tool-page { background: var(--sky); }
.tool-main {
  max-width: 52rem; margin: 2.25rem auto 4rem; padding: 2.25rem 2.5rem 2.75rem;
  background: #FCFCFA; border: 1px solid var(--rule); border-radius: 10px;
}
@media (max-width: 640px) {
  .tool-main { margin: 0 auto; padding: 1.5rem 1.15rem 3.5rem; border: 0; border-radius: 0; }
}
.tool-main p { max-width: none; }
.tool-main h2 { margin: 2.5rem 0 0.9rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.tool-main h2:first-child, .view-head + h2, .view-head + .notice + h2 { border-top: 0; padding-top: 0; }

.view-head { text-align: center; padding-bottom: 1.4rem; margin-bottom: 1.6rem; border-bottom: 2px solid var(--topsoil); }
.view-head h1 { margin: 0.2rem 0 0.5rem; }
.view-head p { margin: 0 auto; max-width: 38rem; }
.view-head .back { margin-bottom: 0.4rem; }
.back { font-size: 1.05rem; color: var(--claypan); }
.back::before { content: "‹ "; }

.notice { border-radius: 0 6px 6px 0; background: #F2F4F0; }
.btn-row { align-items: center; }
.btn.small { border-width: 1.5px; }

/* stops become cards */
.stop {
  background: #F3F5F1; border: 1px solid var(--rule); border-top: 6px solid var(--silt);
  border-radius: 8px; padding: 1rem 1.15rem 0.4rem; margin-top: 1.25rem;
}
.stop .obs { border-bottom-color: #DADDD6; }
.stop .obs:last-of-type { border-bottom: 0; }
.stop-head h3 { font-size: 1.5rem; }

/* list rows and tables */
.list > li { padding: 1rem 0.25rem; }
.data-table td:first-child { min-width: 11rem; }
.data-table tbody tr:hover { background: #F3F5F1; }

/* forms: calmer grouping */
.field > label, .field > .label { color: var(--topsoil); }
.tool-main form .field { margin-bottom: 1.35rem; }
.seg button { border-radius: 6px; }
.chosen { border-radius: 6px; }

/* ---------- protocol page ---------- */
.doc-head { text-align: center; }
.doc-head .lede { font-size: 1.18rem; line-height: 1.55; }
.doc-status {
  display: inline-block; margin: 0.9rem auto 0; padding: 0.25rem 0.75rem;
  font-family: var(--display); font-size: 1.02rem; color: var(--bluestem);
  border: 1.5px solid var(--bluestem); border-radius: 999px;
}
.toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 0.5rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.toc a {
  display: inline-block; padding: 0.2rem 0.65rem; font-family: var(--display); font-size: 1.02rem;
  color: var(--topsoil); text-decoration: none; background: #F3F5F1; border: 1px solid var(--rule); border-radius: 999px;
}
.toc a:hover { border-color: var(--topsoil); }
.protocol h2 { scroll-margin-top: 4.5rem; }
.protocol .draft { margin-top: 0; }
.protocol ul { padding-left: 1.3rem; }
.protocol li { margin-bottom: 0.45rem; }
.kit { background: #F3F5F1; border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1rem 0.6rem 2.2rem; }

.protocol ol.steps { list-style: none; counter-reset: step; padding-left: 0; }
.protocol ol.steps > li { counter-increment: step; position: relative; padding-left: 2.9rem; margin-bottom: 1.1rem; min-height: 2rem; }
.protocol ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05rem;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--leaf); color: #fff;
  font-family: var(--display); font-weight: 600; font-size: 1.1rem; line-height: 2rem; text-align: center;
}
.protocol ol.steps ul { margin-top: 0.5rem; }
@media (max-width: 640px) {
  .doc-head .lede { font-size: 1.05rem; }
  .view-head h1 { font-size: 2.3rem; }
  .toc a { font-size: 0.95rem; }
}

/* ---------- soil samples ---------- */
.checks { display: grid; gap: 0.35rem 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .checks { grid-template-columns: 1fr 1fr; } }
.check { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 1rem; line-height: 1.35; cursor: pointer; }
.check input[type=checkbox] { width: 1.2rem; height: 1.2rem; margin: 0.12rem 0 0; flex: none; accent-color: var(--leaf); }
.sample-pick .title { font-size: 1.25rem; }
.tag.status-planned { border-color: #9B958C; color: #6E6A63; }
.tag.status-collected { border-color: var(--wheat); color: #8A6A1E; }
.tag.status-shipped { border-color: #3F6E7A; color: #3F6E7A; }
.tag.status-results { border-color: var(--leaf); color: #fff; background: var(--leaf); }
.result-row { display: grid; grid-template-columns: 1fr 6rem 6.5rem auto; gap: 0.4rem; margin-bottom: 0.4rem; align-items: center; }
@media (max-width: 480px) { .result-row { grid-template-columns: 1fr 5rem auto; } .result-row [data-k=unit] { display: none; } }
.files { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.files li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule); }

/* bag labels: Avery 5160 / 8160 layout, 3 x 10 on US Letter */
.label-preview { overflow-x: auto; margin-top: 1rem; }
.label-sheet {
  width: 8.5in; box-sizing: border-box; padding: 0.5in 0.1875in 0;
  display: grid; grid-template-columns: repeat(3, 2.625in); grid-auto-rows: 1in; column-gap: 0.125in;
  background: #fff; border: 1px solid var(--rule); transform-origin: top left;
}
.bag-label { box-sizing: border-box; padding: 0.08in 0.14in; overflow: hidden; font-family: var(--display); color: #000; outline: 1px dashed #D5D8D2; }
.bag-label.blank { outline-color: #EEE; }
.l-id { font-weight: 700; font-size: 15pt; line-height: 1.05; letter-spacing: 0.02em; }
.l-line { font-size: 8.5pt; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) { .label-sheet { zoom: 0.45; } }

@media print {
  .no-print { display: none !important; }
  body.print-labels { background: #fff; }
  body.print-labels .site-nav, body.print-labels .view-head { display: none; }
  body.print-labels .tool-main { margin: 0; padding: 0; border: 0; max-width: none; background: #fff; }
  body.print-labels .label-preview { margin: 0; overflow: visible; }
  body.print-labels .label-sheet { border: 0; zoom: 1; }
  body.print-labels .bag-label { outline: 0; }
  .sheet-table { min-width: 0; font-size: 9.5pt; }
  .tool-main { border: 0; margin: 0; }
}

[hidden] { display: none !important; }
.field > label.btn { display: inline-flex; font-family: var(--display); font-size: 1rem; margin-bottom: 0; }

/* ---------- fields and trials ---------- */
.req { color: #8B2B2B; }
.progress-row { margin: 0.6rem 0 0.9rem; }
.progress-label { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.progress { height: 12px; background: #E3E6E0; border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; background: var(--leaf); border-radius: 6px; min-width: 4px; }
.coll-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.75rem; }
@media (min-width: 640px) { .coll-grid { grid-template-columns: 1fr 1fr; } }
.coll-card { background: #F3F5F1; border: 1px solid var(--rule); border-radius: 8px; padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; }
.coll-card .btn { align-self: flex-start; margin-top: auto; }
.coll-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.coll-head h3 { margin: 0; font-size: 1.3rem; }
.coll-head h3 a { color: var(--topsoil); text-decoration: none; }
.coll-head .meta { font-family: var(--display); font-size: 1.2rem; }
.coll-card ul { list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; font-size: 0.98rem; }
.coll-card li { padding: 0.25rem 0; border-bottom: 1px solid #DADDD6; }
.coll-card p { margin: 0.4rem 0 0.8rem; }
table.kv { border-collapse: collapse; width: 100%; font-size: 0.98rem; margin: 0.25rem 0 0.75rem; }
table.kv th { text-align: left; font-family: var(--display); font-weight: 600; font-size: 1.02rem; padding: 0.35rem 1rem 0.35rem 0; width: 34%; vertical-align: top; }
table.kv td { padding: 0.35rem 0; border-bottom: 1px solid var(--rule); white-space: pre-wrap; }
.brief-plant { break-inside: avoid; border-top: 1px solid var(--rule); padding: 0.9rem 0 0.4rem; }
.brief-plant h3 { margin: 0 0 0.2rem; font-family: var(--body); font-size: 1.15rem; font-weight: 600; }
.brief-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin: 0.5rem 0; }
.brief-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; border: 1px solid var(--rule); }
.nb-entry { break-inside: avoid; border-top: 2px solid var(--topsoil); padding-top: 0.6rem; margin-top: 1.2rem; }
.nb-when { font-family: var(--display); color: var(--claypan); font-size: 1rem; }
.nb-entry h3 { margin: 0.1rem 0 0.4rem; }
.compare-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
@media (max-width: 560px) { .compare-grid { grid-template-columns: 1fr; } }
.cmp-cell { background: #F3F5F1; border: 1px solid var(--rule); border-radius: 8px; padding: 0.75rem; }
.cmp-head { margin-bottom: 0.4rem; }
.cmp-head strong { font-family: var(--display); font-size: 1.2rem; margin-right: 0.4rem; }
.cmp-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 0.35rem; margin: 0.4rem 0; }
.cmp-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
@media print {
  body.print-doc { background: #fff; }
  body.print-doc .site-nav { display: none; }
  body.print-doc .tool-main { margin: 0; padding: 0; border: 0; max-width: none; background: #fff; }
  body.print-doc .view-head { border-bottom-width: 1px; }
  body.print-doc a { color: inherit; text-decoration: none; }
}

/* ---------- photo viewer, captions, slope-from-photo ---------- */
img[data-pid] { cursor: zoom-in; }
.thumbs img.has-gps { box-shadow: inset 0 0 0 2px var(--leaf); border-color: var(--leaf); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 12, 0.88); display: flex; align-items: center; justify-content: center; padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
.lb-inner { background: #FCFCFA; border-radius: 10px; max-width: min(56rem, 100%); max-height: 100%; overflow: auto; padding: 0.75rem; }
.lb-inner img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: #111; border-radius: 6px; cursor: default; }
.lb-meta { font-size: 0.98rem; padding: 0.6rem 0.2rem; line-height: 1.5; }
.brief-photos figure { margin: 0; }
.brief-photos figcaption { font-size: 0.78rem; color: var(--claypan); line-height: 1.3; margin-top: 0.2rem; }
ol.how { padding-left: 1.3rem; }
ol.how li { margin-bottom: 0.4rem; }
.sp-canvas-wrap { margin-top: 1rem; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #111; }
#spCanvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.sp-readout { font-size: 1.1rem; margin: 0.75rem 0 0; }
.sp-readout strong { font-family: var(--display); font-size: 1.5rem; color: var(--leaf); }
@media print { .lightbox { display: none; } }

/* ---------- guides: recipes and calculator ---------- */
.recipe-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .recipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.recipe { min-width: 0; overflow-wrap: anywhere; background: #F3F5F1; border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem 0.6rem; break-inside: avoid; }
.recipe-head h3 { margin: 0; font-family: var(--body); font-size: 1.2rem; font-weight: 600; }
.recipe table.kv th { width: 40%; }
.pending { font-family: var(--display); color: var(--bluestem); border: 1px dashed var(--bluestem); border-radius: 3px; padding: 0 0.4rem; }
.calc { background: #F3F5F1; border: 1px solid var(--rule); border-radius: 8px; padding: 1.1rem 1.1rem 0.3rem; }
.calc h3 { margin-top: 0.5rem; }
.calc-out { margin-top: 1.25rem; }
.calc-summary { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin: 0.5rem 0 1rem; }
.calc-summary > div { background: #fff; border: 1px solid var(--rule); border-top: 5px solid var(--leaf); border-radius: 8px; padding: 0.7rem 0.9rem; }
.calc-summary .big { display: block; font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1.1; }
.calc-summary .meta { display: block; margin-top: 0.2rem; }

.recipe .tag { white-space: normal; }
.recipe table.kv, .recipe table.kv tbody, .recipe table.kv tr { display: block; width: auto; }
.recipe table.kv tr { border-bottom: 1px solid var(--rule); padding: 0.35rem 0; }
.recipe table.kv th, .recipe table.kv td { display: block; width: auto; padding: 0; border: 0; }
.recipe table.kv th { font-size: 0.95rem; color: var(--claypan); }

table.kv { min-width: 0; }

tr.off-season td { color: var(--claypan); background: #F7EDED; }

/* ---------- field page ---------- */
.stat-row { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); margin: 1.25rem 0; }
.stat-row > div { background: #F3F5F1; border: 1px solid var(--rule); border-radius: 8px; padding: 0.6rem 0.75rem; }
.stat-row .big { display: block; font-family: var(--display); font-weight: 700; font-size: 1.6rem; line-height: 1.1; }
.stat-row .meta { display: block; font-size: 0.88rem; line-height: 1.25; margin-top: 0.15rem; }
.field-jump { display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; margin: 0 0 1rem; }
.field-jump a { display: inline-block; padding: 0.25rem 0.7rem; font-family: var(--display); font-size: 1.05rem;
  color: var(--topsoil); text-decoration: none; background: #F3F5F1; border: 1px solid var(--rule); border-radius: 999px; }
.field-jump a:hover { border-color: var(--topsoil); }
.map-grid { display: grid; gap: 0.9rem; grid-template-columns: minmax(0, 1fr); margin: 0.75rem 0 1rem; }
@media (min-width: 720px) { .map-grid { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); } }
.map-grid figure { margin: 0; }
.map-grid img { width: 100%; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }
.map-grid figcaption { font-family: var(--display); font-size: 1.02rem; color: var(--claypan); margin-top: 0.2rem; }
ul.plain { list-style: none; padding: 0; margin: 0.4rem 0 1rem; }
ul.plain li { padding: 0.3rem 0; border-bottom: 1px solid var(--rule); font-size: 1rem; }

/* sync status */
.sync-badge { position: fixed; right: 0.75rem; bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); z-index: 20;
  background: #FCFCFA; border: 1px solid var(--rule); border-radius: 999px; padding: 0.25rem 0.8rem;
  font-family: var(--display); font-size: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.sync-badge a { color: var(--claypan); text-decoration: none; }
.sync-badge a:hover { color: var(--topsoil); }
@media print { .sync-badge { display: none; } }

/* choosing what a new zone map means */
.choices { display: grid; gap: 0.75rem; margin: 1rem 0 1.25rem; }
.choice { display: flex; gap: 0.75rem; align-items: flex-start; background: #F3F5F1; border: 1px solid var(--rule);
  border-radius: 8px; padding: 0.9rem 1rem; cursor: pointer; font-size: 1rem; line-height: 1.5; }
.choice input { margin-top: 0.3rem; width: 1.2rem; height: 1.2rem; accent-color: var(--leaf); flex: none; }
.choice:has(input:checked) { border-color: var(--leaf); box-shadow: inset 0 0 0 1px var(--leaf); }

/* photo viewer: fit by default, zoom and pan on request */
.lb-stage { overflow: auto; max-height: 72vh; border-radius: 6px; background: #111; -webkit-overflow-scrolling: touch; }
.lb-stage img { display: block; width: 100%; max-height: 72vh; object-fit: contain; cursor: zoom-in; }
.lb-stage.zoomed { cursor: grab; }
.lb-stage.zoomed img { width: auto; max-width: none; max-height: none; cursor: zoom-out; }
details.explain { background: #F3F5F1; border: 1px solid var(--rule); border-radius: 8px; padding: 0.6rem 0.9rem; margin: 0.75rem 0; }
details.explain summary { font-family: var(--display); font-size: 1.1rem; cursor: pointer; }
details.explain p { font-size: 0.98rem; margin: 0.6rem 0 0; }

/* maps inside the printed brief */
.brief-maps { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); margin: 1rem 0 1.5rem; }
@media (min-width: 700px) { .brief-maps { grid-template-columns: 1fr 1fr; } }
.brief-maps figure { margin: 0; break-inside: avoid; }
.brief-maps img { width: 100%; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
.brief-maps figcaption { font-size: 0.85rem; color: var(--claypan); line-height: 1.35; margin-top: 0.25rem; }
@media print { .brief-maps { grid-template-columns: 1fr 1fr; } .brief-maps img { border: 0; } }

/* notes */
.notes { margin: 1rem 0 1.5rem; }
.notes h3 { margin-top: 1.75rem; }
.note-list { margin: 0.5rem 0 0.75rem; }
.note { background: #F3F5F1; border: 1px solid var(--rule); border-radius: 8px; padding: 0.6rem 0.85rem; margin-bottom: 0.5rem; font-size: 1rem; line-height: 1.5; }
.note-meta { font-family: var(--display); font-size: 0.95rem; color: var(--claypan); margin-bottom: 0.2rem; }
.note-form textarea { min-height: 4rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 0.92rem; color: var(--bluestem); text-decoration: underline; cursor: pointer; }

/* ================================================================
   Field mode: big targets, thumb-reachable, readable in sun
   ================================================================ */
.fm { display: flex; flex-direction: column; min-height: calc(100vh - 3.5rem); }
.tool-main:has(.fm) { max-width: 40rem; padding: 0 0 7rem; border: 0; background: transparent; margin: 0 auto; }
.fm-top { position: sticky; top: 3.4rem; z-index: 5; display: flex; align-items: center; gap: 0.6rem;
  background: var(--topsoil); color: #fff; padding: 0.6rem 0.9rem; border-radius: 0 0 10px 10px; }
.fm-top .fm-where { flex: 1; min-width: 0; font-family: var(--display); font-size: 1.25rem; line-height: 1.15; }
.fm-top .fm-sub { display: block; font-size: 0.9rem; font-family: var(--body); color: #D8D3C8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-top .tag { background: rgba(255,255,255,0.12); }
.fm-exit { color: #E8C547; font-family: var(--display); font-size: 1.1rem; text-decoration: none; }
.fm-count { font-family: var(--display); font-size: 1.9rem; line-height: 1; min-width: 1.6rem; text-align: right; }
.fm-empty { padding: 2rem 1rem; text-align: center; color: var(--claypan); }
.fm-here { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.75rem 0.9rem 0; }
.fm-chip { background: #F3F5F1; border: 1px solid var(--rule); border-radius: 999px; padding: 0.35rem 0.8rem;
  font: inherit; font-size: 0.95rem; color: var(--topsoil); cursor: pointer; }
.fm-chip i { font-style: italic; }
.fm-chip-sub { color: var(--claypan); font-size: 0.85rem; }
.fm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; padding: 0.9rem; }
.fm-sp { min-height: 5.2rem; border: 2px solid var(--rule); border-radius: 12px; background: #FCFCFA;
  padding: 0.6rem 0.7rem; text-align: left; font: inherit; color: var(--topsoil); cursor: pointer; }
.fm-sp:active { background: #E8EDE6; }
.fm-sp-name { display: block; font-family: var(--display); font-weight: 600; font-size: 1.3rem; line-height: 1.1; }
.fm-sp-latin { display: block; font-size: 0.85rem; color: var(--claypan); font-style: italic; margin-top: 0.15rem; }
.fm-sp-find { border-style: dashed; }
.fm-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 0.5rem; padding: 0.6rem 0.9rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  background: rgba(238,241,238,0.96); border-top: 1px solid var(--rule); z-index: 6; }
.fm-btn { flex: 1; min-height: 3.4rem; font-size: 1.25rem; border-radius: 10px; }

.fm-sheet { position: fixed; inset: 0; z-index: 40; background: rgba(20,16,12,0.5); display: flex; align-items: flex-end; }
.fm-sheet-in { width: 100%; max-height: 92vh; overflow-y: auto; background: #FCFCFA; border-radius: 14px 14px 0 0;
  padding: 1rem 0.9rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 640px) { .fm-sheet { align-items: center; justify-content: center; } .fm-sheet-in { max-width: 34rem; border-radius: 14px; } }
.fm-sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 0.75rem; }
.fm-sheet-head strong { font-family: var(--display); font-size: 1.5rem; display: block; line-height: 1.1; }
.fm-sheet-head .fm-sub { font-size: 0.95rem; color: var(--claypan); }
.fm-x { background: none; border: 0; font-size: 1.5rem; line-height: 1; color: var(--claypan); cursor: pointer; padding: 0 0.3rem; }
.fm-row { margin-bottom: 0.9rem; }
.fm-label { display: block; font-family: var(--display); font-size: 1.05rem; color: var(--claypan); margin-bottom: 0.3rem; }
.fm-opts { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem; }
.fm-opts.wide { grid-template-columns: repeat(auto-fit, minmax(5.2rem, 1fr)); }
.fm-opts button { min-height: 3.2rem; border: 2px solid var(--rule); border-radius: 10px; background: #fff;
  font: inherit; font-family: var(--display); font-size: 1.15rem; color: var(--topsoil); cursor: pointer; line-height: 1.1; }
.fm-opts button small { display: block; font-family: var(--body); font-size: 0.68rem; color: var(--claypan); }
.fm-opts button.on { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.fm-opts button.on small { color: #E6EDE2; }
.fm-photo { min-height: 3.2rem; display: inline-flex; }
.fm-check { display: inline-flex; margin-left: 0.75rem; font-size: 1.05rem; }
.fm-save { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.fm-search { width: 100%; min-height: 3.2rem; font-size: 1.15rem; padding: 0.5rem 0.7rem; border: 2px solid #9B958C; border-radius: 10px; }
.fm-results { list-style: none; padding: 0; margin: 0.6rem 0 0; max-height: 50vh; overflow-y: auto; }
.fm-results button { display: block; width: 100%; text-align: left; min-height: 3.4rem; padding: 0.5rem 0.6rem;
  background: none; border: 0; border-bottom: 1px solid var(--rule); font: inherit; color: var(--topsoil); cursor: pointer; }
.fm-results strong { font-family: var(--display); font-size: 1.15rem; display: block; }
.fm-results span { font-size: 0.9rem; color: var(--claypan); }
/* field mode takes over the screen: no site menu, nothing under the thumb bar */
body.in-field-mode .site-nav { display: none; }
body.in-field-mode .fm-top { top: 0; border-radius: 0; padding-top: calc(0.6rem + env(safe-area-inset-top, 0px)); }
body.in-field-mode .tool-main { padding-top: 0; }
body.in-field-mode .sync-badge { bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px)); right: 0.6rem; font-size: 0.9rem; }

/* walking the field: the map is drawn from the zone polygons, no tiles needed */
.walk-map { padding: 0.6rem 0.6rem 0; }
.fieldmap { display: block; width: 100%; height: auto; max-height: 48vh; background: #FCFCFA;
  border: 1px solid var(--rule); border-radius: 10px; }
.fm-pt { cursor: pointer; }
.walk-zones { margin: 0.4rem 0.9rem 0; font-size: 0.95rem; color: var(--claypan); }
.walk-strip { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.7rem 0.9rem 0; -webkit-overflow-scrolling: touch; }
.walk-thumb { flex: none; width: 5.6rem; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.walk-thumb img { width: 5.6rem; height: 5.6rem; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }
.walk-thumb span { display: block; font-size: 0.78rem; color: var(--claypan); line-height: 1.2; margin-top: 0.15rem; }
.walk-shot img { width: 100%; max-height: 38vh; object-fit: contain; border-radius: 8px; background: #111; margin-bottom: 0.75rem; }
.walk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; margin: 0.5rem 0 1.25rem; }
.walk-grid figure { margin: 0; }
.walk-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }
.walk-grid figcaption { font-size: 0.8rem; color: var(--claypan); line-height: 1.25; margin-top: 0.2rem; }
.walk .fm-sheet-in textarea { width: 100%; min-height: 3.5rem; }
/* moving around the field map */
.walk-map { position: relative; }
.fieldmap { touch-action: none; cursor: grab; }
.fieldmap:active { cursor: grabbing; }
.map-zoom { position: absolute; right: 1.1rem; top: 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.map-zoom button { width: 2.6rem; height: 2.6rem; font-size: 1.4rem; line-height: 1; border: 1px solid var(--rule);
  background: rgba(252,252,250,0.95); border-radius: 8px; color: var(--topsoil); cursor: pointer; }
.map-zoom button:active { background: #E8EDE6; }

/* which version am I actually running */
.build-mark { position: fixed; left: 0.75rem; bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); z-index: 20;
  font-family: var(--display); font-size: 0.85rem; color: var(--claypan); opacity: 0.75; }
.build-mark.stale { opacity: 1; }
.build-mark button { font: inherit; font-size: 0.9rem; background: #F5E6C8; color: var(--topsoil);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.3rem 0.85rem; cursor: pointer; }
body.in-field-mode .build-mark { display: none; }
@media print { .build-mark { display: none; } }

/* On a laptop, give the walking map the room it deserves: the map is the point,
   the photo strip can sit beside it rather than under it. */
@media (min-width: 900px) {
  body.in-field-mode .tool-main { max-width: none; padding-left: 1rem; padding-right: 1rem; }
  .fm.walk { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto;
             gap: 0 1.25rem; align-items: start; }
  .fm.walk .fm-top { grid-column: 1 / -1; }
  .fm.walk .walk-map { grid-column: 1; grid-row: 2; padding: 0.75rem 0 0 0.75rem; }
  .fm.walk .walk-zones { grid-column: 1; }
  .fm.walk .walk-strip { grid-column: 2; grid-row: 2; display: grid;
                         grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
                         gap: 0.75rem; overflow-y: auto; max-height: calc(100vh - 13rem); padding: 0.75rem 0 0; align-content: start; }
  .fm.walk .walk-strip:empty::after { content: 'Photos you take appear here.'; color: var(--claypan); font-size: 1rem; }
  .fm.walk .walk-thumb { width: 100%; }
  .fm.walk .walk-thumb img { width: 100%; height: 9rem; }
  .fm.walk .walk-thumb span { font-size: 0.9rem; }
  .fm.walk .fieldmap { max-height: calc(100vh - 13rem); }
  .fm.walk .fm-bar { grid-column: 1 / -1; position: static; border: 0; background: transparent;
                     padding: 0.75rem 0.75rem 1.5rem; max-width: 34rem; }
  .map-zoom button { width: 2.9rem; height: 2.9rem; }
}
/* and on a phone, use the height that is actually there */
@media (max-width: 899px) {
  .fm.walk .fieldmap { max-height: calc(100vh - 19rem); }
}

/* a tall field should fill the height, a wide one the width: let the drawing decide */
.walk-map { display: flex; justify-content: center; }
.fieldmap { width: auto; max-width: 100%; height: auto; margin: 0 auto; }
@media (min-width: 900px) {
  .fm.walk .walk-map { align-items: flex-start; }
  .fm.walk .fieldmap { height: calc(100vh - 13rem); max-height: calc(100vh - 13rem); }
}
@media (max-width: 899px) {
  .fm.walk .fieldmap { height: calc(100vh - 19rem); max-height: calc(100vh - 19rem); }
}
.trace-form { padding: 0.75rem 0.9rem 0; }
.trace-form .field { margin-bottom: 0.5rem; }
.map-layers { position: absolute; left: 1.1rem; top: 1.1rem; }
.map-layers button { font: inherit; font-size: 0.95rem; background: rgba(252,252,250,0.95); color: var(--topsoil);
  border: 1px solid var(--rule); border-radius: 8px; padding: 0.4rem 0.8rem; cursor: pointer; }
.build-mark button.quiet { background: none; border: 0; padding: 0.2rem 0.3rem; color: var(--claypan); text-decoration: underline; }

/* the save button in a labelling sheet stays put while you scroll the fields */
.fm-save { position: sticky; bottom: 0; background: linear-gradient(to top, #FCFCFA 70%, rgba(252,252,250,0)); padding: 0.6rem 0 0.2rem; }
.fm-sheet-in { padding-bottom: 0.4rem; }
.np-preview img { width: 100%; max-height: 60vh; object-fit: contain; border: 1px solid var(--rule); border-radius: 8px; background: #111; }
.photo-card { cursor: pointer; }
.photo-card img { transition: filter 0.1s; }
.photo-card:active img { filter: brightness(0.9); }
.photo-note { display: block; color: var(--topsoil); font-style: italic; margin-top: 0.15rem; line-height: 1.35; }
.fm-unknown { margin-top: 0.4rem; }
.fm-unknown button { font: inherit; background: #F0EDE4; border: 1px solid var(--rule); border-radius: 8px;
  padding: 0.5rem 0.9rem; cursor: pointer; color: var(--topsoil); }
.fm-unknown .hint { display: block; margin-top: 0.3rem; font-size: 0.85rem; color: var(--claypan); }
.sp-state { font-family: var(--display); color: var(--claypan); margin-bottom: 0.4rem; }
.sp-quick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.sp-quick button { font: inherit; font-size: 0.95rem; background: #F0EDE4; border: 1px solid var(--rule);
  border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer; color: var(--topsoil); }
.chosen .tag.flag { margin-top: 0.2rem; display: inline-block; }
.fm-pt { cursor: pointer; }
.fm-pt:hover circle:first-child { stroke: #B5341B; stroke-width: 4; }

/* the plan */
.plan-head { background: #F4F1E8; border-left: 4px solid var(--rule); padding: 0.9rem 1.1rem; margin: 0.8rem 0 1.2rem; }
.plan-head p { margin: 0 0 0.4rem; }
.verdict.good { color: #2E7D32; font-weight: 600; }
.verdict.bad { color: #B5341B; font-weight: 600; }
ol.chain { list-style: none; padding: 0; margin: 0 0 1rem; }
ol.chain li { display: flex; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
ol.chain li.now { background: #FBF6E4; }
ol.chain li.after { opacity: 0.65; }
.chain-when { min-width: 8.5rem; }
.chain-when .meta { display: block; }
.owed { font-size: 0.85rem; color: #B5341B; font-style: italic; margin-top: 0.15rem; }
.gantt { margin: 1rem 0 0.4rem; }
.gantt-bar { position: relative; height: 4.5rem; border-bottom: 2px solid var(--topsoil); }
.gantt-stage, .gantt-now { position: absolute; bottom: 0; transform: translateX(-50%); text-align: center; font-size: 0.8rem; }
.gantt-stage i { display: block; width: 2px; height: 1.6rem; background: var(--claypan); margin: 0 auto 0.2rem; }
.gantt-stage.passed i { background: #2E7D32; height: 2.4rem; }
.gantt-stage.projected { opacity: 0.55; }
.gantt-now i { display: block; width: 3px; height: 4.2rem; background: #B5341B; margin: 0 auto 0.2rem; }
.gantt-now span { color: #B5341B; font-weight: 700; }
.gantt-axis { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--claypan); }
tr.done td { opacity: 0.6; }

/* the programme and the work queue */
ol.prog { list-style: none; padding: 0; margin: 0.6rem 0 1rem; }
ol.prog li { display: flex; gap: 0.9rem; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
ol.prog li.passed { opacity: 0.55; }
.p-n { width: 2rem; height: 2rem; border-radius: 50%; background: var(--topsoil); color: #FCFCFA;
  font-family: var(--display); display: flex; align-items: center; justify-content: center; flex: none; }
.meta.good { color: #2E7D32; } .meta.bad { color: #B5341B; }
ul.tasks { list-style: none; padding: 0; margin: 0.6rem 0 1.4rem; }
li.task { display: flex; gap: 1rem; align-items: flex-start; padding: 0.75rem 0.6rem; border-bottom: 1px solid var(--rule); }
li.task.late { background: #FDF1EC; }
li.task.done { opacity: 0.55; }
li.task.skipped { opacity: 0.45; text-decoration: line-through; }
.t-when { min-width: 8rem; } .t-when .meta { display: block; }
.t-what { flex: 1; } .t-do { display: flex; flex-direction: column; gap: 0.3rem; }
.t-note { font-style: italic; color: var(--claypan); margin-top: 0.2rem; }
.tag.ok { background: #DCEBD8; color: #2E7D32; }
@media (max-width: 620px) {
  li.task { flex-wrap: wrap; } .t-when { min-width: 100%; } .t-do { flex-direction: row; }
}

/* ---- the two doors, and the simplified site navigation ---- */
.site-nav .spacer { flex: 1; }
.site-nav .link.on { border-bottom: 2px solid var(--topsoil); }
.site-nav .link.signin { background: var(--topsoil); color: #FCFCFA; padding: 0.4rem 1rem; border-radius: 999px; }
.hero { padding: 2rem 0 1rem; }
.hero .eyebrow { font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.85rem; color: var(--claypan); margin: 0 0 0.4rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; margin: 0 0 0.8rem; }
.hero .lede { font-size: 1.18rem; max-width: 42em; }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; margin: 2rem 0 1rem; }
.door { display: block; padding: 1.3rem 1.4rem; border: 1px solid var(--rule); border-radius: 10px;
  text-decoration: none; color: var(--topsoil); background: #FCFCFA; transition: transform 0.08s; }
.door:hover { transform: translateY(-2px); border-color: var(--topsoil); }
.door strong { display: block; font-family: var(--display); font-size: 1.25rem; margin-bottom: 0.3rem; }
.door span { color: var(--claypan); font-size: 0.97rem; }
.door.primary { background: var(--topsoil); color: #FCFCFA; border-color: var(--topsoil); }
.door.primary span { color: #E6E1D6; }
.toc { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; padding: 0.9rem 0 1.4rem;
  border-bottom: 1px solid var(--rule); margin-bottom: 1.6rem; font-size: 0.95rem; }
.page-head { padding: 1.4rem 0 0.4rem; }
ul.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem,1fr)); gap: 0.9rem; }
ul.cards a { display: block; padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: 9px;
  text-decoration: none; color: var(--topsoil); }
ul.cards strong { display: block; font-family: var(--display); margin-bottom: 0.2rem; }
ul.cards span { color: var(--claypan); font-size: 0.93rem; }

/* the hero reads top to bottom, not in two columns */
.hero { display: block; max-width: 62rem; }
.hero .eyebrow { order: 0; }
.hero > * { max-width: none; }
.hero .lede { margin: 0 0 0.5rem; }

/* crops and history */
ul.cropzones .meta { font-variant-numeric: tabular-nums; }
td.bad { color: #B5341B; font-weight: 600; }
label.check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.95rem; color: var(--claypan); }
