/* =====================================================================
   Banana Farming Knowledge Base — design system
   ===================================================================== */

:root {
  --brand: #f5b301;
  --brand-deep: #d99a00;
  --brand-soft: #fff3d0;
  --leaf: #2f7d4f;
  --leaf-deep: #1f5d3a;
  --berry: #c2452d;

  --bg: #fffdf6;
  --bg-alt: #faf6ea;
  --surface: #ffffff;
  --surface-2: #f7f3e7;
  --ink: #1b1a15;
  --ink-2: #3d3b33;
  --muted: #6d6a5e;
  --line: #e8e2d1;
  --line-strong: #d8d0ba;

  --note-bg: #eef4ff;
  --note-line: #4a7fd6;
  --tip-bg: #eaf7ee;
  --tip-line: #2f7d4f;
  --warn-bg: #fff6e5;
  --warn-line: #d98a00;
  --danger-bg: #fdeceb;
  --danger-line: #c2452d;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(30, 26, 10, 0.06), 0 1px 6px rgba(30, 26, 10, 0.04);
  --shadow: 0 4px 18px rgba(30, 26, 10, 0.09), 0 1px 4px rgba(30, 26, 10, 0.05);
  --shadow-lg: 0 18px 50px rgba(30, 26, 10, 0.18);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --header-h: 60px;
  --sidebar-w: 276px;
  --toc-w: 236px;
  --content-max: 780px;

  /* figures, diagrams and charts */
  --fig-a: #2f7d4f;
  --fig-b: #f0b429;
  --fig-c: #9a6320;
  --fig-d: #3f6fbf;
  --fig-e: #b83a24;
  --fig-g: #5f5a4e;
  --fig-on: #ffffff;
  --fig-ink: var(--ink);
  --fig-muted: var(--muted);
  --fig-line: var(--line-strong);
}

html[data-theme="dark"] {
  --brand: #f7c948;
  --brand-deep: #e0af13;
  --brand-soft: #3a3117;
  --leaf: #57bd85;
  --leaf-deep: #7bd6a4;
  --berry: #ef7d63;

  --bg: #131208;
  --bg-alt: #191712;
  --surface: #1c1a15;
  --surface-2: #24221b;
  --ink: #f4f1e6;
  --ink-2: #ddd8c9;
  --muted: #a49e8c;
  --line: #302d24;
  --line-strong: #423e33;

  --note-bg: #16243b;
  --note-line: #6fa2e8;
  --tip-bg: #14281d;
  --tip-line: #57bd85;
  --warn-bg: #2e2410;
  --warn-line: #e0af13;
  --danger-bg: #331814;
  --danger-line: #ef7d63;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.65);

  --fig-a: #35885a;
  --fig-b: #f7c948;
  --fig-c: #a06a24;
  --fig-d: #4a7fd6;
  --fig-e: #c2452d;
  --fig-g: #6f6a5c;
  --fig-on: #ffffff;
  --fig-ink: var(--ink);
  --fig-muted: var(--muted);
  --fig-line: var(--line-strong);
  color-scheme: dark;
}

/* ------------------------------------------------------------- reset -- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--leaf-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
html[data-theme="dark"] a {
  color: var(--leaf);
}
a:hover {
  color: var(--brand-deep);
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2.5px solid var(--leaf);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ------------------------------------------------------------ header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  max-width: 1600px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 17px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.brand:hover {
  color: var(--ink);
}

.search-trigger {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 14.5px;
  text-align: left;
}
.search-trigger span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-trigger:hover {
  border-color: var(--brand-deep);
  color: var(--ink-2);
}
.search-trigger svg,
.search-bar svg {
  width: 17px;
  height: 17px;
  flex: none;
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: var(--ink-2);
}
.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
}
.icon-btn svg {
  width: 19px;
  height: 19px;
}
.nav-toggle {
  display: none;
}
[data-theme="light"] [data-theme-toggle] svg:last-child,
[data-theme="dark"] [data-theme-toggle] svg:first-child {
  display: none;
}

/* ------------------------------------------------------------ layout -- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0;
  max-width: 1600px;
  margin: 0 auto;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 14px 40px 18px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sidebar-kicker {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.nav-close {
  display: none;
}

.nav-section + .nav-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.nav-section-title {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 800;
}
.nav-group + .nav-group {
  margin-top: 14px;
}
.nav-group-title {
  margin: 0 0 5px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14.5px;
  line-height: 1.4;
  border-left: 2.5px solid transparent;
}
.nav-list a:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.nav-list a.active {
  background: var(--brand-soft);
  border-left-color: var(--brand);
  color: var(--ink);
  font-weight: 650;
}

.sidebar-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.sidebar-foot p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.sidebar-scrim {
  display: none;
}

/* -------------------------------------------------------------- main -- */

.main {
  min-width: 0;
  padding: 26px 34px 70px;
}

.main-home {
  padding-top: 8px;
}
.main-home .article-head {
  display: none;
}
.main-home .breadcrumb {
  display: none;
}
.main-home .prose {
  max-width: 980px;
}
.main-home .prose h2 {
  margin-top: 2.6rem;
}

.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--brand-deep);
  text-decoration: underline;
}
.crumb-sep {
  opacity: 0.55;
}

.article-head {
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.article-head h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.article-subtitle {
  margin: 0 0 14px;
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 62ch;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--muted);
}
.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-meta span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  margin-right: 8px;
}

.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.badge-tool {
  background: var(--leaf);
  color: #fff;
}

/* Verdict chips (soil & tissue test interpreter) */
.verdict {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.verdict.badge-bad {
  background: var(--danger-bg);
  color: var(--danger-line);
  box-shadow: inset 0 0 0 1px var(--danger-line);
}
.verdict.badge-warn {
  background: var(--warn-bg);
  color: var(--warn-line);
  box-shadow: inset 0 0 0 1px var(--warn-line);
}
.verdict.badge-ok {
  background: var(--tip-bg);
  color: var(--leaf-deep);
  box-shadow: inset 0 0 0 1px var(--tip-line);
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
}
.tag {
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ------------------------------------------------------------- prose -- */

.prose {
  max-width: var(--content-max);
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.05em;
  color: var(--ink-2);
}

.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  line-height: 1.25;
  letter-spacing: -0.018em;
  color: var(--ink);
  scroll-margin-top: calc(var(--header-h) + 18px);
}
.prose h2 {
  font-size: 1.62rem;
  margin: 2.4rem 0 0.85rem;
  padding-top: 0.5rem;
  font-weight: 800;
}
.prose h3 {
  font-size: 1.28rem;
  margin: 2rem 0 0.6rem;
  font-weight: 750;
}
.prose h4 {
  font-size: 1.06rem;
  margin: 1.5rem 0 0.5rem;
  font-weight: 750;
}
.prose h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--leaf));
}

.anchor {
  margin-left: 9px;
  color: var(--line-strong);
  text-decoration: none;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.15s;
}
.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor,
.anchor:focus {
  opacity: 1;
}
.anchor:hover {
  color: var(--brand-deep);
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
  color: var(--ink-2);
}
.prose li {
  margin: 0.3em 0;
}
.prose li::marker {
  color: var(--leaf);
  font-weight: 700;
}
.prose li > ul,
.prose li > ol {
  margin: 0.3em 0 0.4em;
}

.prose strong {
  color: var(--ink);
  font-weight: 700;
}

.task {
  color: var(--leaf);
  font-weight: 700;
  margin-right: 3px;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1.5px 5px;
  color: var(--berry);
}
html[data-theme="dark"] .prose code {
  color: #f0a68f;
}

.code-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 1.2em;
  font-size: 13.5px;
  line-height: 1.6;
}
.code-block code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink-2);
  font-size: inherit;
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--brand);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05em;
  font-style: italic;
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.6rem 0;
}

.prose figure {
  margin: 1.6em 0;
}
.prose figcaption {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

/* callouts */
.callout {
  margin: 1.5em 0;
  padding: 14px 18px 6px;
  border-radius: var(--radius);
  border-left: 4px solid var(--note-line);
  background: var(--note-bg);
}
.callout-title {
  margin: 0 0 6px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.97em;
}
.callout-icon {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--note-line);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex: none;
}
.callout p {
  color: var(--ink-2);
  font-size: 0.97em;
}
.callout p:last-child {
  margin-bottom: 8px;
}
.callout ul,
.callout ol {
  font-size: 0.97em;
}
.callout-tip {
  border-left-color: var(--tip-line);
  background: var(--tip-bg);
}
.callout-tip .callout-icon {
  background: var(--tip-line);
}
.callout-warning,
.callout-caution,
.callout-important {
  border-left-color: var(--warn-line);
  background: var(--warn-bg);
}
.callout-warning .callout-icon,
.callout-caution .callout-icon,
.callout-important .callout-icon {
  background: var(--warn-line);
}
.callout-danger {
  border-left-color: var(--danger-line);
  background: var(--danger-bg);
}
.callout-danger .callout-icon {
  background: var(--danger-line);
}
.callout-checklist {
  border-left-color: var(--leaf);
  background: var(--tip-bg);
}
.callout-checklist .callout-icon {
  background: var(--leaf);
}
.callout-example {
  border-left-color: var(--muted);
  background: var(--surface-2);
}
.callout-example .callout-icon {
  background: var(--muted);
}

/* tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.4em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
  min-width: 460px;
}
.prose thead th {
  background: var(--surface-2);
  text-align: left;
  font-weight: 750;
  padding: 11px 14px;
  border-bottom: 2px solid var(--line-strong);
  color: var(--ink);
  white-space: nowrap;
}
.prose tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}
.prose tbody tr:last-child td {
  border-bottom: 0;
}
.prose tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.prose tbody tr:hover {
  background: var(--brand-soft);
}

/* ------------------------------------------------------------- cards -- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 16px;
  margin: 1.4em 0 1.8em;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand-deep);
  color: inherit;
}
.card-kicker {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-deep);
}
.card h3 {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.3;
  color: var(--ink);
  font-weight: 750;
}
.card p {
  margin: 0;
  font-size: 14.2px;
  color: var(--muted);
  line-height: 1.55;
}
.card-link {
  margin-top: auto;
  padding-top: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--leaf);
}

/* steps */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 1.4em 0;
  padding: 0;
}
.prose .steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 52px;
  border-left: 2px solid var(--line);
  margin-left: 16px;
}
.prose .steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.prose .steps > li::before {
  content: counter(step);
  position: absolute;
  left: -17px;
  top: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: #1b1a15;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  border: 3px solid var(--bg);
}
.prose .steps > li > strong:first-child {
  display: block;
  font-size: 1.04em;
  margin-bottom: 3px;
  color: var(--ink);
}

/* hero (home) */
.hero {
  position: relative;
  padding: 44px 40px 40px;
  margin: 0 0 34px;
  border-radius: 26px;
  background:
    radial-gradient(900px 320px at 8% -20%, rgba(245, 179, 1, 0.35), transparent 60%),
    radial-gradient(700px 320px at 95% 110%, rgba(47, 125, 79, 0.28), transparent 62%),
    var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: repeating-linear-gradient(
    -45deg,
    rgba(245, 179, 1, 0.22) 0 14px,
    transparent 14px 28px
  );
  pointer-events: none;
}
.hero-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--leaf-deep);
  background: var(--tip-bg);
  border: 1px solid var(--tip-line);
  padding: 5px 12px;
  border-radius: 999px;
  margin: 0 0 16px;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 850;
  max-width: 17ch;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--brand-deep), var(--leaf));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  margin: 0 0 22px;
  font-size: 1.09rem;
  color: var(--ink-2);
  max-width: 62ch;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--leaf-deep);
  color: #fff;
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--brand-deep);
  color: var(--ink);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stat {
  padding: 9px 15px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-size: 19px;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.2;
}

.section-title {
  margin: 2.4rem 0 0.4rem;
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-title:first-child {
  margin-top: 0;
}
.section-lead {
  margin: 0 0 4px;
  color: var(--muted);
  max-width: 68ch;
}

/* checklist rows */
.checklist {
  list-style: none;
  padding: 0;
  margin: 1.2em 0;
}
.checklist li {
  position: relative;
  padding: 9px 12px 9px 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 8px;
}
.checklist li::before {
  content: "\2713";
  position: absolute;
  left: 12px;
  top: 9px;
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--leaf);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ------------------------------------------------------------ calculators */

.calc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin: 1.6em 0;
}
.calc-head {
  padding: 16px 20px;
  background: linear-gradient(120deg, var(--brand-soft), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.calc-head h2 {
  margin: 0 0 4px;
  font-size: 1.14rem;
  font-weight: 800;
  padding-top: 0;
}
.calc-head h2::before {
  display: none;
}
.calc-head p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}
.calc-body {
  padding: 20px;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.field .hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.field input,
.field select {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  width: 100%;
}
.field input:focus,
.field select:focus {
  border-color: var(--leaf);
  outline: 2px solid color-mix(in srgb, var(--leaf) 35%, transparent);
  outline-offset: 0;
}
.calc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.btn-calc {
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--leaf);
  color: #fff;
  border: 1px solid var(--leaf-deep);
  font-weight: 700;
  cursor: pointer;
}
.btn-calc:hover {
  background: var(--leaf-deep);
}
.btn-reset {
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  cursor: pointer;
}
.btn-reset:hover {
  background: var(--line);
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.result {
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.result.is-key {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.result-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 750;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
.result-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.result-unit {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 3px;
}
.result-note {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.45;
}
.calc-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

/* data bars */
.bars {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.bars li {
  display: grid;
  grid-template-columns: 120px 1fr 54px;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  margin-bottom: 8px;
}
.bars .bar-track {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
}
.bars .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--leaf));
  border-radius: 999px;
}
.bars .bar-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 700;
}

/* --------------------------------------------------------------- toc -- */

.toc-rail {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 30px 22px 40px 6px;
  font-size: 13.5px;
}
.toc-title {
  margin: 0 0 10px;
  font-size: 11.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}
.toc-list a {
  display: block;
  padding: 5px 0 5px 13px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
}
.toc-list a:hover {
  color: var(--ink);
}
.toc-list a.active {
  color: var(--leaf-deep);
  border-left-color: var(--brand);
  font-weight: 700;
}
html[data-theme="dark"] .toc-list a.active {
  color: var(--brand);
}
.toc-l3 a {
  padding-left: 26px;
  font-size: 13px;
}
.toc-print {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding: 7px 13px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.toc-print:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.toc-print svg {
  width: 15px;
  height: 15px;
}

/* ------------------------------------------------------------- pager -- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: var(--content-max);
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.pager-link:hover {
  border-color: var(--brand-deep);
  transform: translateY(-2px);
  color: inherit;
}
.pager-next {
  text-align: right;
}
.pager-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--muted);
}
.pager-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 15.5px;
}
.pager-section {
  font-size: 12.5px;
  color: var(--muted);
}
.pager-spacer {
  display: block;
}

/* ------------------------------------------------------------ footer -- */

.site-footer {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: var(--content-max);
  font-size: 14px;
  color: var(--muted);
}
.site-footer p {
  margin: 0 0 8px;
}
.footer-note {
  font-size: 13px;
  line-height: 1.6;
}

/* -------------------------------------------------------- search modal -- */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: start center;
  padding: 9vh 18px 18px;
}
.search-modal[hidden] {
  display: none;
}
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 10, 0.55);
  backdrop-filter: blur(3px);
}
.search-panel {
  position: relative;
  width: min(660px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop 0.14s ease-out;
}
@keyframes pop {
  from {
    transform: translateY(-8px) scale(0.985);
    opacity: 0;
  }
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.search-bar input {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  font-size: 16.5px;
  color: var(--ink);
  outline: none;
  min-width: 0;
}
.search-bar input::placeholder {
  color: var(--muted);
}
.search-hint {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 4px;
}
.chip:hover {
  border-color: var(--brand-deep);
  background: var(--brand-soft);
}
.search-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 52vh;
  overflow-y: auto;
}
.search-results li + li {
  margin-top: 2px;
}
.search-result {
  display: block;
  padding: 11px 13px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid transparent;
}
.search-result:hover,
.search-result.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: inherit;
}
.sr-title {
  display: block;
  font-weight: 700;
  color: var(--ink);
  font-size: 15.5px;
}
.sr-title mark,
.sr-snippet mark {
  background: color-mix(in srgb, var(--brand) 55%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.sr-crumb {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-deep);
  font-weight: 750;
  margin-bottom: 3px;
}
.sr-snippet {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 3px;
}
.search-empty {
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
}
.search-foot {
  display: flex;
  gap: 16px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.search-foot kbd {
  margin-right: 3px;
}

/* --------------------------------------------------------- responsive -- */

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .toc-rail {
    display: none;
  }
}

@media (max-width: 940px) {
  .nav-toggle {
    display: grid;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: min(320px, 86vw);
    z-index: 70;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
    background: var(--surface);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .nav-close {
    display: grid;
  }
  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0;
    background: rgba(20, 18, 10, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 65;
  }
  body.nav-open .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .main {
    padding: 22px 20px 60px;
  }
  .hero {
    padding: 32px 24px 30px;
    margin-left: -4px;
    margin-right: -4px;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }
  .search-trigger span,
  .search-trigger kbd {
    display: none;
  }
  .search-trigger {
    flex: 0;
    margin-left: auto;
    padding: 9px;
    border-radius: 10px;
  }
  .header-actions {
    margin-left: 0;
  }
  .brand-text {
    font-size: 16px;
  }
  .prose h2 {
    font-size: 1.42rem;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-next {
    text-align: left;
  }
  .bars li {
    grid-template-columns: 92px 1fr 48px;
    font-size: 12.5px;
  }
  .result-value {
    font-size: 19px;
  }
  .search-modal {
    padding: 12px;
  }
}

/* ------------------------------------------------------------- print -- */

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --ink: #000;
    --ink-2: #111;
    --muted: #444;
    --line: #bbb;
  }
  .site-header,
  .sidebar,
  .toc-rail,
  .pager,
  .search-modal,
  .sidebar-scrim,
  .skip-link,
  .anchor {
    display: none !important;
  }
  .layout {
    display: block;
    max-width: none;
  }
  .main {
    padding: 0;
  }
  .prose {
    max-width: none;
  }
  .prose a {
    color: #000;
    text-decoration: underline;
  }
  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
  .table-wrap,
  .card,
  .calc,
  .callout,
  .checklist li {
    box-shadow: none;
    break-inside: avoid;
  }
  .prose h2,
  .prose h3 {
    break-after: avoid;
  }
  body {
    font-size: 11.5pt;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------- crop calendar -- */

.prose table.cal,
table.cal {
  min-width: 880px;
  border-collapse: collapse;
  font-size: 12px;
}
.cal thead th,
.cal tbody td {
  padding: 0;
}
.cal th.rowhead {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 178px;
  max-width: 212px;
  white-space: normal;
  text-align: left;
  vertical-align: middle;
  padding: 7px 10px;
  background: var(--surface-2);
  border-right: 2px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 12.5px;
  line-height: 1.3;
}
.cal .mh {
  padding: 6px 2px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 11px;
}
.cal .mh span {
  display: block;
  font-weight: 750;
}
.cal .mh small {
  display: block;
  font-size: 9.5px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--muted);
}
.cal td.lvl {
  height: 28px;
  border: 1px solid var(--line);
}
.lvl-0 { background: var(--surface); }
.lvl-1 { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); }
.lvl-2 { background: color-mix(in srgb, var(--brand) 58%, var(--surface)); }
.lvl-3 { background: linear-gradient(135deg, var(--brand), var(--leaf)); }
.cal td.stage {
  height: 16px;
  border: 1px solid var(--line);
}
.st-plant { background: #a8762a; }
.st-veg { background: #79c27c; }
.st-flower { background: var(--brand); }
.st-fill { background: #e07b39; }
.st-harvest { background: var(--leaf); }
.cal tbody tr:hover,
.cal tbody tr:nth-child(even) {
  background: transparent;
}
.cal tbody tr:nth-child(even) th.rowhead {
  background: var(--surface-2);
}

/* ---------------------------------------------------- figures -- */

.fig {
  margin: 28px 0;
}
.fig-art {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
}
.fig svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 440px;
}
.fig text {
  font-family: var(--sans);
  fill: var(--fig-ink);
}
.fig .f-muted { fill: var(--fig-muted); }
.fig .f-on { fill: var(--fig-on); }
.fig .f-a { fill: var(--fig-a); }
.fig .f-b { fill: var(--fig-b); }
.fig .f-c { fill: var(--fig-c); }
.fig .f-d { fill: var(--fig-d); }
.fig .f-e { fill: var(--fig-e); }
.fig .f-g { fill: var(--fig-g); }
.fig .f-line { stroke: var(--fig-line); }
.fig .s-a { stroke: var(--fig-a); }
.fig .s-b { stroke: var(--fig-b); }
.fig .s-d { stroke: var(--fig-d); }
.fig .s-e { stroke: var(--fig-e); }
.fig .s-g { stroke: var(--fig-g); }
.fig figcaption {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--muted);
}
@media print {
  .fig-art { break-inside: avoid; }
}
