/* ============================================================
   HIBISCUS: A DEEP-DIVE KNOWLEDGEBASE — design system
   Palette: calyx crimson, leaf green, warm cream paper
   ============================================================ */

:root {
  --bg: #f7f1e6;
  --bg-soft: #efe5d3;
  --panel: #fffdf8;
  --panel-tint: #faf4e8;
  --ink: #33261c;
  --ink-soft: #55473a;
  --muted: #7c6b58;
  --line: rgba(62, 45, 28, 0.16);
  --line-soft: rgba(62, 45, 28, 0.09);

  --crimson: #b0103c;
  --crimson-deep: #8a0c30;
  --crimson-soft: #f9e3e9;
  --crimson-line: #e5b7c5;

  --leaf: #3c6e4f;
  --leaf-deep: #2b5038;
  --leaf-soft: #e6efe6;
  --leaf-line: #b7d0bb;

  --gold: #b07f24;
  --gold-soft: #f6ecd2;

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

  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(62, 45, 28, 0.06), 0 6px 18px -10px rgba(62, 45, 28, 0.28);
  --sidebar-w: 300px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.68;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 85% -120px, rgba(176, 16, 60, 0.07), transparent 60%),
    radial-gradient(900px 420px at -10% 12%, rgba(60, 110, 79, 0.08), transparent 55%),
    var(--bg);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.22;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); margin: 0 0 0.4em; letter-spacing: -0.01em; }
h2 {
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  margin: 2.2em 0 0.55em;
  padding-bottom: 0.25em;
  border-bottom: 2px solid var(--crimson-line);
}
h3 { font-size: 1.17rem; margin: 1.7em 0 0.4em; }
h4 { font-size: 1rem; margin: 1.4em 0 0.3em; }

p { margin: 0.7em 0; }
a { color: var(--crimson-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--crimson); }
strong { color: var(--ink); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-soft); padding: 0.12em 0.35em; border-radius: 4px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ---------- progress bar ---------- */
#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
  z-index: 60; transition: width 90ms linear;
}

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--panel-tint);
  border-right: 1px solid var(--line-soft);
  padding: 20px 14px 40px;
  scrollbar-width: thin;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; border-bottom: 1px solid var(--line-soft); }
.brand .mark {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--crimson) 0%, var(--crimson-deep) 72%);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35), var(--shadow);
}
.brand .mark::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 2px var(--gold);
}
.brand .bt { font-family: var(--serif); font-size: 1.22rem; font-weight: 700; line-height: 1.1; }
.brand .bt small { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

#searchbox {
  width: 100%; margin: 12px 0 6px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--ink); font-size: 0.92rem;
}
#searchbox:focus { outline: 2px solid var(--crimson-line); border-color: var(--crimson); }
#search-results { margin: 4px 0 10px; }
#search-results a {
  display: block; padding: 6px 10px; border-radius: 7px;
  text-decoration: none; font-size: 0.9rem; color: var(--ink);
}
#search-results a b { color: var(--crimson-deep); font-weight: 700; }
#search-results a:hover { background: var(--crimson-soft); }
#search-results .empty { font-size: 0.85rem; color: var(--muted); padding: 4px 10px; }

.nav-group { margin-top: 14px; }
.nav-group > .group-label {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--leaf-deep);
  padding: 4px 10px; cursor: pointer; user-select: none;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-group > .group-label .carat { font-size: 0.6rem; transition: transform 0.15s; color: var(--muted); }
.nav-group.closed .carat { transform: rotate(-90deg); }
.nav-group > ul { list-style: none; margin: 2px 0 0; padding: 0; }
.nav-group.closed > ul { display: none; }
.nav-group > ul a {
  display: block; padding: 5px 10px 5px 22px; font-size: 0.94rem;
  color: var(--ink-soft); text-decoration: none; border-radius: 7px;
  border-left: 3px solid transparent;
}
.nav-group > ul a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-group > ul a.active {
  background: var(--crimson-soft); border-left-color: var(--crimson);
  color: var(--crimson-deep); font-weight: 600;
}

.sidebar-foot { margin-top: 18px; padding: 10px; font-size: 0.78rem; color: var(--muted); border-top: 1px solid var(--line-soft); }

/* ---------- main column ---------- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; width: min(880px, 100%); margin: 0 auto; padding: 34px 38px 90px; }

/* mobile top strip (hidden on desktop) */
.top-strip {
  display: none; position: sticky; top: 0; z-index: 50;
  background: var(--panel-tint); border-bottom: 1px solid var(--line-soft);
  padding: 10px 14px; align-items: center; gap: 10px;
}
.top-strip .burger {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  border-radius: 8px; padding: 6px 10px; font-size: 1rem; cursor: pointer; line-height: 1;
}
.top-strip .ts-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.top-strip .ts-search { margin-left: auto; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 9px; font-size: 0.9rem; width: 130px; }

/* ---------- article / typography blocks ---------- */
.article { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(22px, 4vw, 46px) clamp(20px, 4.5vw, 52px); }

.lede { font-size: 1.12rem; color: var(--ink-soft); font-family: var(--serif); font-style: italic; margin: 0.4em 0 1.4em; }
.kicker { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--leaf-deep); background: var(--leaf-soft); border: 1px solid var(--leaf-line); padding: 3px 10px; border-radius: 999px; margin-bottom: 14px; }
.meta-line { color: var(--muted); font-size: 0.88rem; margin: -0.4em 0 1.6em; }

figure { margin: 1.8em 0; text-align: center; }
figcaption { font-size: 0.84rem; color: var(--muted); margin-top: 8px; font-style: italic; }

/* on-this-page box */
.toc { background: var(--panel-tint); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 20px 12px; margin: 0 0 2em; font-size: 0.92rem; }
.toc .toc-title { font-weight: 700; font-family: var(--serif); letter-spacing: 0.03em; margin-bottom: 6px; color: var(--crimson-deep); }
.toc ul { margin: 0; padding-left: 1.2em; }
.toc li { margin: 3px 0; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--crimson-deep); text-decoration: underline; }
.toc .lvl-3 { font-size: 0.9em; }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 0.94rem; background: var(--panel); }
th, td { padding: 9px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
th { background: var(--panel-tint); font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #fbf7ee; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* callouts */
.callout { border-radius: var(--radius-sm); padding: 13px 18px; margin: 1.5em 0; font-size: 0.95rem; border: 1px solid; }
.callout .ct { display: block; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.callout.tip { background: var(--leaf-soft); border-color: var(--leaf-line); }
.callout.tip .ct { color: var(--leaf-deep); }
.callout.warn { background: var(--crimson-soft); border-color: var(--crimson-line); }
.callout.warn .ct { color: var(--crimson-deep); }
.callout.science { background: var(--gold-soft); border-color: #e4cf9c; }
.callout.science .ct { color: #7a5a17; }
.callout.plain { background: var(--panel-tint); border-color: var(--line-soft); }
.callout.plain .ct { color: var(--muted); }

/* cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin: 1.6em 0; }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform 0.12s ease, border-color 0.12s ease;
}
a.card:hover { transform: translateY(-2px); border-color: var(--crimson-line); color: var(--ink); }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; color: var(--crimson-deep); }
.card .card-kw { display: inline-block; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.card p { margin: 8px 0 0; font-size: 0.92rem; color: var(--ink-soft); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 1.6em 0; }
.stat { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px 16px; text-align: center; }
.stat .v { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: var(--crimson-deep); line-height: 1.1; }
.stat .k { font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.stat .s { font-size: 0.8rem; color: var(--ink-soft); margin-top: 3px; }

/* flow steps (process diagrams) */
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin: 1.6em 0; counter-reset: step; }
.flow .step {
  flex: 1 1 150px; background: var(--panel); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); padding: 12px 14px; position: relative; font-size: 0.9rem;
  counter-increment: step;
}
.flow .step::before {
  content: counter(step); position: absolute; top: -9px; left: 10px;
  background: var(--crimson); color: #fff; font-size: 0.72rem; font-weight: 700;
  width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center;
}
.flow .step b { display: block; margin-bottom: 3px; font-size: 0.98rem; }
.flow .arrow { align-self: center; color: var(--crimson); font-weight: 700; }

ul.checks, ul.xes { list-style: none; padding-left: 4px; }
ul.checks li::before { content: "✔  "; color: var(--leaf-deep); font-weight: 700; }
ul.xes li::before { content: "✘  "; color: var(--crimson); font-weight: 700; }
ul.pills { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 8px; }
ul.pills li { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px 14px; font-size: 0.88rem; }

dl.gloss { display: grid; grid-template-columns: minmax(140px, 0.9fr) 2.4fr; gap: 0; }
dl.gloss dt { font-weight: 700; padding: 9px 12px 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 0.97rem; color: var(--crimson-deep); }
dl.gloss dd { margin: 0; padding: 9px 0 9px 12px; border-bottom: 1px dashed var(--line-soft); font-size: 0.95rem; }
dl.gloss dd a { font-style: italic; }

blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--crimson-line); color: var(--ink-soft); font-style: italic; font-family: var(--serif); font-size: 1.05rem; }

/* FAQ accordions */
details.faq { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel); margin: 10px 0; }
details.faq summary { cursor: pointer; padding: 13px 18px; font-weight: 600; font-family: var(--serif); font-size: 1.05rem; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before { content: "▸"; display: inline-block; margin-right: 10px; color: var(--crimson); transition: transform 0.15s; }
details.faq[open] summary::before { transform: rotate(90deg); }
details.faq[open] summary { border-bottom: 1px solid var(--line-soft); background: var(--crimson-soft); }
details.faq .faq-body { padding: 12px 18px 16px; font-size: 0.97rem; }

/* prev / next pager */
.pager { display: flex; gap: 14px; margin-top: 2.4em; }
.pager a { flex: 1; text-decoration: none; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 16px; }
.pager a .dir { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager a .pg { font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: 1.02rem; }
.pager a:hover { border-color: var(--crimson-line); }
.pager a:hover .pg { color: var(--crimson-deep); }
.pager a.next { text-align: right; }

/* back to top */
#to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 55;
  border: 1px solid var(--line); background: var(--panel); color: var(--crimson-deep);
  border-radius: 50%; width: 42px; height: 42px; font-size: 1.1rem; cursor: pointer;
  box-shadow: var(--shadow); display: none; line-height: 1;
}
#to-top:hover { background: var(--crimson-soft); }

/* site footer */
.site-footer { border-top: 1px solid var(--line-soft); background: var(--panel-tint); padding: 26px 38px 40px; color: var(--muted); font-size: 0.85rem; }
.site-footer .f-inner { width: min(880px, 100%); margin: 0 auto; }
.site-footer a { color: var(--ink-soft); }

/* hero (home) */
.hero { background: radial-gradient(900px 340px at 100% 0%, rgba(176,16,60,0.10), transparent 55%), linear-gradient(180deg, var(--panel-tint), var(--panel)); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(24px, 4.5vw, 54px); margin-bottom: 22px; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); margin: 0.2em 0 0.35em; }
.hero h1 .accent { color: var(--crimson); font-style: italic; }
.hero .lede { font-size: 1.22rem; margin-bottom: 0.5em; }
.hero .hero-stats { display: flex; flex-wrap: wrap; gap: 18px 30px; margin: 1.6em 0 0.2em; color: var(--ink-soft); font-size: 0.95rem; }
.hero .hero-stats b { color: var(--crimson-deep); font-family: var(--serif); font-size: 1.15rem; }

.breadcrumb { font-size: 0.85rem; color: var(--muted); margin: 0 0 18px; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--crimson-deep); text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }

/* inline anatomy svg frame */
.anatomy { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 10px; }
.anatomy svg { width: 100%; height: auto; }

/* backlinks / related chips */
.see-also { margin-top: 2.4em; padding-top: 1em; border-top: 1px solid var(--line-soft); }
.see-also ul { margin: 0.4em 0 0; }

/* ---------- field diagnosis key ---------- */
details.diag { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel); margin: 10px 0; }
details.diag > summary { cursor: pointer; padding: 12px 16px; font-weight: 700; font-family: var(--serif); font-size: 1.08rem; list-style: none; border-radius: var(--radius-sm); }
details.diag > summary::-webkit-details-marker { display: none; }
details.diag > summary::before { content: "▸"; display: inline-block; margin-right: 10px; color: var(--crimson); transition: transform 0.15s; }
details.diag[open] > summary::before { transform: rotate(90deg); }
details.diag[open] > summary { border-bottom: 1px solid var(--line-soft); background: var(--crimson-soft); }
.diag-inner { padding: 10px 16px 16px; }
.diag-inner > p.hint { font-size: 0.9rem; color: var(--muted); margin: 8px 0 4px; }

details.diag-sub { margin: 8px 0 0; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: var(--panel-tint); }
details.diag-sub > summary { cursor: pointer; padding: 9px 14px; font-weight: 600; font-size: 0.98rem; list-style: none; }
details.diag-sub > summary::-webkit-details-marker { display: none; }
details.diag-sub > summary::before { content: "?  "; color: var(--gold); font-weight: 800; }
details.diag-sub[open] > summary { border-bottom: 1px dashed var(--line); }
.diag-out { padding: 10px 14px 14px; }

.dx { border-left: 4px solid var(--leaf-line); background: var(--panel); padding: 9px 14px; margin: 9px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 0.94rem; }
.dx .dx-name { font-weight: 700; font-family: var(--serif); font-size: 1.02rem; }
.dx .dx-tag { display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 1px 9px; margin-left: 8px; vertical-align: 1px; }
.dx.pest { border-left-color: var(--crimson); }
.dx.pest .dx-tag { background: var(--crimson-soft); color: var(--crimson-deep); }
.dx.disease { border-left-color: var(--gold); }
.dx.disease .dx-tag { background: var(--gold-soft); color: #7a5a17; }
.dx.disorder { border-left-color: var(--muted); }
.dx.disorder .dx-tag { background: var(--panel-tint); color: var(--muted); }
.dx.quality { border-left-color: var(--leaf); }
.dx.quality .dx-tag { background: var(--leaf-soft); color: var(--leaf-deep); }
.dx p { margin: 5px 0 0; }

/* contributed-photo slots (field diagnostics gallery) */
.ps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 1.6em 0; }
.photo-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  aspect-ratio: 4 / 3; text-align: center; padding: 12px;
  border: 1.5px dashed var(--crimson-line); border-radius: var(--radius-sm);
  background: repeating-linear-gradient(45deg, var(--panel), var(--panel) 10px, var(--panel-tint) 10px, var(--panel-tint) 20px);
}
.photo-slot .ps-tag { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--crimson-deep); border: 1px solid var(--crimson-line); background: var(--panel); border-radius: 999px; padding: 2px 10px; }
.photo-slot .ps-cap { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.35; }
.ps-grid + figcaption, .ps-note { font-size: 0.84rem; color: var(--muted); font-style: italic; }

/* ---------- language editions ---------- */
body.lang { background: var(--bg); }
body.lang .layout { grid-template-columns: minmax(0, 1fr); }
body.lang .content { width: min(880px, 100%); padding-top: 40px; }
.lang-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  background: var(--panel-tint); border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 7px 8px 7px 18px; margin: 0 0 20px; font-size: 0.92rem;
}
.lang-bar .lb-lbl { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.lang-bar a { text-decoration: none; color: var(--ink-soft); padding: 2px 11px; border-radius: 999px; }
.lang-bar a:hover { background: var(--bg-soft); color: var(--ink); }
.lang-bar a.on { background: var(--crimson); color: #fff; font-weight: 700; }
.lang-foot { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--line-soft); font-size: 0.85rem; color: var(--muted); }

[dir="rtl"] .content, [dir="rtl"] .article, [dir="rtl"] p, [dir="rtl"] li { text-align: right; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] .lede, [dir="rtl"] .lang-bar { text-align: right; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }

/* ---------- planting-date calculator tool ---------- */
.tool-panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 18px 20px; margin: 1.2em 0; }
.tool-panel .tp-title { font-family: var(--serif); font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.inp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px 18px; }
.field label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.field .hint { font-size: 0.8rem; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.field input[type="number"], .field input[type="date"], .field select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); font-size: 0.95rem;
}
.field select { cursor: pointer; }
.field input:focus, .field select:focus { outline: 2px solid var(--crimson-line); border-color: var(--crimson); }
.field.check { display: flex; align-items: center; gap: 8px; padding-top: 24px; }
.field.check input { width: 18px; height: 18px; accent-color: var(--crimson); }
.field input:disabled { opacity: 0.45; }
.presets { margin-top: 14px; }
.presets .ps-lbl { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 7px; }
button.preset {
  border: 1px solid var(--line); background: var(--panel-tint); color: var(--ink-soft);
  border-radius: 999px; padding: 5px 13px; font-size: 0.86rem; cursor: pointer;
}
button.preset:hover { border-color: var(--crimson-line); background: var(--crimson-soft); color: var(--crimson-deep); }
button.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 8px 13px; font-size: 0.9rem; cursor: pointer; }
button.btn:hover { border-color: var(--crimson-line); color: var(--crimson-deep); }
.verdict { border-radius: var(--radius-sm); border: 1px solid; padding: 14px 18px; margin: 1.4em 0; }
.verdict .vt { font-weight: 700; font-family: var(--serif); font-size: 1.12rem; margin-bottom: 4px; }
.verdict p { margin: 6px 0 4px; font-size: 0.95rem; }
.verdict ul { margin: 6px 0 0; }
.verdict li { font-size: 0.9rem; margin: 3px 0; }
.verdict.good { background: var(--leaf-soft); border-color: var(--leaf-line); }
.verdict.good .vt { color: var(--leaf-deep); }
.verdict.warn { background: var(--gold-soft); border-color: #e4cf9c; }
.verdict.warn .vt { color: #7a5a17; }
.verdict.bad { background: var(--crimson-soft); border-color: var(--crimson-line); }
.verdict.bad .vt { color: var(--crimson-deep); }
.verdict.plain { background: var(--panel-tint); border-color: var(--line-soft); }
.verdict.plain .vt { color: var(--ink-soft); }

/* water-balance bar (drying calculator) */
.water-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line-soft); margin: 4px 0 6px; }
.water-bar .seg { height: 100%; }
.water-bar .seg.solids { background: var(--leaf); }
.water-bar .seg.removed { background: var(--crimson); }
.water-bar .seg.stays { background: var(--gold); }
.wb-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 1.4em; }
.wb-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.wb-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.tool-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.9rem; color: var(--ink-soft); margin: 14px 0 4px; }
.tool-stats b { color: var(--crimson-deep); }
.tl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 1.4em 0; }
.tl .tl-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow); }
.tl .tl-card .tl-k { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.tl .tl-card .tl-d { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--crimson-deep); margin: 2px 0; }
.tl .tl-card .tl-c { font-size: 0.82rem; color: var(--ink-soft); line-height: 1.4; }
.chart-box { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: 14px; margin: 1.4em 0; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-box figcaption { text-align: left; margin-top: 8px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 0.84rem; color: var(--ink-soft); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { display: inline-flex; align-items: center; min-width: 16px; justify-content: center; }
details.settings { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel); margin: 10px 0; }
details.settings > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-family: var(--serif); font-size: 1.05rem; list-style: none; }
details.settings > summary::-webkit-details-marker { display: none; }
details.settings > summary::before { content: "▸ "; color: var(--crimson); }
details.settings[open] > summary { border-bottom: 1px solid var(--line-soft); background: var(--crimson-soft); }
details.settings[open] > summary::before { content: "▾ "; }
.settings-body { padding: 14px 16px 16px; }

/* small screens */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; inset: 0 0 0 auto; width: min(320px, 86vw); padding-top: 64px; box-shadow: -12px 0 40px rgba(62,45,28,0.25); }
  body.nav-open .sidebar { display: block; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(40,28,18,0.4); z-index: 35; }
  .top-strip { display: flex; }
  .content { padding: 18px 16px 70px; }
  .site-footer { padding: 20px 18px; }
  dl.gloss { grid-template-columns: 1fr; }
  dl.gloss dd { padding-left: 0; }
}

/* ---------- feasibility calculator: buyer-quote checklist ---------- */
.buyer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 14px; margin-bottom: 12px; }
.buyer-card { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); background: var(--panel-tint); padding: 14px; }
.buyer-card .bc-title { font-family: var(--serif); font-weight: 700; font-size: 0.98rem; margin-bottom: 10px; color: var(--crimson-deep); }
.buyer-card .field { margin-bottom: 10px; }
.buyer-card .field:last-child { margin-bottom: 0; }
.buyer-card .field input[type="text"] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font-size: 0.92rem; }
.buyer-card .field input[type="text"]:focus { outline: 2px solid var(--crimson-line); border-color: var(--crimson); }
.verdict ul.q-recs { list-style: disc; margin: 6px 0 0; padding-left: 1.3em; }
.verdict ul.q-recs li { font-size: 0.9rem; margin: 3px 0; }
.verdict .q-caution { margin: 8px 0 0; padding: 8px 12px; border: 1px dashed var(--crimson-line); border-radius: var(--radius-sm); background: var(--crimson-soft); font-size: 0.9rem; color: var(--crimson-deep); }

/* ---------- feasibility calculator comparison ---------- */
.compare-you { background: var(--gold-soft); }
.compare-you strong { color: #7a5a17; }

/* ---------- printable grower plan (planting-date calculator) ---------- */
.plan-doc { display: none; }
.print-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 1.6em 0 0.4em; }
.print-hint { font-size: 0.86rem; color: var(--muted); }

@media print {
  body.plan-tool { background: #fff; }
  body.plan-tool .layout, body.plan-tool .main-col { display: block; }
  body.plan-tool .content { width: 100%; max-width: none; margin: 0; padding: 0 4px; }
  body.plan-tool .article { display: none; }
  body.plan-tool .top-strip, body.plan-tool .pager, body.plan-tool .site-footer, body.plan-tool #to-top, body.plan-tool #progress { display: none !important; }
  body.plan-tool .plan-doc { display: block; color: #222; }
  .plan-doc .plan-head { border-bottom: 3px double #b0103c; padding-bottom: 10px; margin-bottom: 14px; }
  .plan-doc .plan-brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: #8a0c30; letter-spacing: 0.04em; }
  .plan-doc .plan-title { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; margin: 3px 0 2px; }
  .plan-doc .plan-meta { font-size: 0.78rem; color: #555; }
  .plan-doc h3 { font-family: var(--serif); font-size: 1.02rem; margin: 16px 0 6px; border-bottom: 1px solid #ccc; padding-bottom: 3px; }
  .plan-doc table { border-collapse: collapse; width: 100%; font-size: 0.86rem; margin: 6px 0 4px; }
  .plan-doc th, .plan-doc td { border: 1px solid #bbb; padding: 6px 9px; text-align: left; vertical-align: top; }
  .plan-doc th { background: #f2ead8; font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; }
  .plan-doc .plan-verdict { border: 1px solid #bbb; border-left: 5px solid #b0103c; padding: 10px 14px; margin: 12px 0; font-size: 0.92rem; }
  .plan-doc .plan-recs { margin: 6px 0; padding-left: 1.3em; }
  .plan-doc .plan-recs li { margin: 3px 0; font-size: 0.9rem; }
  .plan-doc .plan-settings { font-size: 0.82rem; color: #444; margin: 4px 0; }
  .plan-doc .plan-foot { margin-top: 18px; padding-top: 8px; border-top: 1px solid #999; font-size: 0.74rem; color: #555; }
}

@media print {
  .sidebar, .top-strip, .pager, #to-top, #progress { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .article, .hero { box-shadow: none; border-color: #ddd; }
  a { color: inherit; }
}
