/* ʻUlu Farmer Help — calm, readable, mobile-first. */
/* Palette and type follow ulu.coop (Enfold theme variables, 2026-10-25):
   page #fffdf1, panels #e4e1ce, border #e1e1e1, primary #435128, headings #515e48,
   links #3091b7, secondary blue #06a4e3, footer #435128 with #a9bd80 headings, socket #c26100.
   Fonts: Cardo (headings), PT Sans (body), self-hosted in fonts.css. */
:root {
  --bg: #fffdf1;
  --paper: #ffffff;
  --panel: #f4f1e3;        /* between page and the site's #e4e1ce */
  --ink: #3a3a3a;          /* darker than the site's #666 body text for small screens */
  --heading: #515e48;
  --muted: #6b6b6b;
  --line: #e1e1e1;
  --line-strong: #d3d0bd;
  --accent: #435128;       /* co-op olive green */
  --accent-ink: #ffffff;
  --accent-soft: #e8ecdd;
  --accent-light: #a9bd80; /* footer heading green */
  --link: #3091b7;
  --warn-soft: #fff4dc;
  --warn: #8a5a00;
  --orange: #c26100;       /* site socket bar */
  --coop: #435128;
  --ctahr: #0f6f99;        /* darker take on the site's #06a4e3 for contrast on light badges */
  --ctahr-soft: #e3f2fa;
  --radius: 6px;
  --max: 72ch;
  --font-body: "PT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Cardo", Georgia, "Times New Roman", serif;
  font-size: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55; -webkit-text-size-adjust: 100%; }
h1, h2, h3:not(.section-label):not(.passage-heading), .answer .q, .brand { font-family: var(--font-heading); color: var(--heading); font-weight: 700; }
body { display: flex; flex-direction: column; min-height: 100dvh; }
a { color: var(--link); }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 8px; }

header.site, footer.site { padding: .75rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
header.site { border-bottom: 3px solid var(--accent); background: var(--paper); }
header.site .brand { text-decoration: none; font-size: 1.25rem; }
header.site nav a { text-decoration: none; color: var(--accent); padding: .5rem; font-weight: 700; }
header.site nav a:hover { text-decoration: underline; }
footer.site { margin-top: auto; background: var(--accent); color: #f3f5ea; font-size: .85rem; border-top: 0; }
footer.site p { margin: 0; max-width: var(--max); }
footer.site a { color: var(--accent-light); }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }

h1 { font-size: 2rem; line-height: 1.15; margin: .5rem 0 .25rem; }
.lede { color: var(--muted); margin: 0 0 1rem; max-width: var(--max); }
.small-heading, .section-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; margin: 1.25rem 0 .4rem; }
.small { color: var(--muted); font-size: .9rem; }
code { background: var(--accent-soft); padding: .1em .3em; border-radius: 4px; }

/* Ask form */
.ask-form textarea { width: 100%; font: inherit; font-size: 1.1rem; padding: .9rem 1rem; border: 2px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); resize: vertical; min-height: 5.5rem; }
.ask-form textarea:focus { border-color: var(--accent); }
.ask-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .5rem; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .9rem; margin: 0; }
button { font: inherit; cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius); padding: .8rem 1.6rem; font-weight: 700; font-size: 1.05rem; min-height: 48px; min-width: 7rem; letter-spacing: .02em; }
button.primary:hover { background: #546239; }
button.primary[disabled] { opacity: .6; cursor: progress; }
button.link { background: none; border: 0; color: var(--link); text-decoration: underline; padding: .5rem; min-height: 44px; }
.context { border: 0; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.context-label { color: var(--muted); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: 999px; padding: .5rem .9rem; min-height: 44px; color: var(--ink); }
.chip[aria-pressed="true"], .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.notice { background: var(--warn-soft); color: var(--warn); padding: .75rem 1rem; border-radius: var(--radius); }

.starters { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; grid-template-columns: 1fr; }
.starter { width: 100%; text-align: left; background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: var(--radius); padding: .85rem 1rem; min-height: 48px; color: var(--accent); font-weight: 700; }
.starter:hover { border-color: var(--accent); }
.topics { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.topic { font-size: .9rem; text-decoration: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: .35rem .75rem; color: var(--heading); background: var(--paper); min-height: 36px; display: inline-flex; align-items: center; }
.topic.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Conversation */
.conversation { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.answer { background: var(--paper); border: 1px solid var(--line-strong); border-left: 5px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; }
.answer .q { font-size: 1.35rem; margin: 0 0 .35rem; }
.interpreted { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; }
.coverage { font-size: .78rem; color: var(--accent); margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.short { font-size: 1.12rem; margin: .25rem 0 .5rem; max-width: var(--max); }
.steps, .checks { padding-left: 1.4rem; margin: 0; max-width: var(--max); }
.steps li, .checks li { margin: .35rem 0; }
.contact { margin: 0; max-width: var(--max); }
.missing, .limit { background: var(--warn-soft); color: var(--warn); padding: .65rem .85rem; border-radius: var(--radius); margin: .85rem 0 0; max-width: var(--max); }
.clarify-q { font-size: 1.1rem; margin: .25rem 0 .6rem; }
.pending { color: var(--muted); font-style: italic; }
.error { color: #8a1f1f; }

/* Citation markers */
button.cite { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; height: 1.6em; padding: 0 .35em; margin: 0 .1em; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-size: .78em; font-weight: 700; vertical-align: super; line-height: 1; }
button.cite[aria-expanded="true"] { background: var(--accent); color: var(--accent-ink); }
.cite-pop { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: .6rem .8rem; border-radius: 0 var(--radius) var(--radius) 0; margin: .5rem 0; font-size: .95rem; }
.cite-pop a { color: var(--link); }
.cite-pop .t { font-weight: 600; display: block; margin-bottom: .2rem; }
.cite-pop blockquote { margin: .3rem 0; font-style: italic; }
.cite-pop a { margin-right: .75rem; }

/* Sources */
.answer-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.sources.plain { gap: .3rem; }
.source { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .7rem .85rem; background: var(--panel); }
.source:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.source-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .25rem; }
.num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; }
.badge { font-size: .75rem; border-radius: 999px; padding: .15rem .55rem; background: #e4e1ce; color: #515e48; }
.badge.pub-ulu_coop { background: var(--accent-soft); color: var(--coop); }
.badge.pub-ctahr { background: var(--ctahr-soft); color: var(--ctahr); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.source-title { font-weight: 600; display: block; margin: .15rem 0; }
.date { color: var(--muted); font-size: .8rem; display: block; }
.quote { margin: .4rem 0; font-style: italic; color: var(--ink); border-left: 3px solid var(--line); padding-left: .6rem; }
.excerpt-details summary { cursor: pointer; color: var(--link); min-height: 44px; display: flex; align-items: center; }
.excerpt { margin: .3rem 0; white-space: pre-wrap; color: var(--muted); font-size: .92rem; border-left: 3px solid var(--line); padding-left: .6rem; }
.open { font-size: .9rem; display: inline-block; min-height: 44px; line-height: 44px; }
.more-sources summary { color: var(--muted); cursor: pointer; min-height: 44px; display: flex; align-items: center; }

.followups { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.followup-bar { position: sticky; bottom: 0; background: var(--bg); padding: .5rem 0; border-top: 1px solid var(--line-strong); display: flex; gap: .5rem; align-items: center; }
.feedback { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.fb { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .8rem; min-height: 40px; }
.fb[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.fb-reasons { display: flex; flex-wrap: wrap; gap: .4rem; width: 100%; align-items: center; }
.consent { width: 100%; }

/* Browse / resource */
.search { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.search input { flex: 1; font: inherit; padding: .7rem .9rem; border: 2px solid var(--line); border-radius: var(--radius); min-height: 48px; }
.doclist { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .6rem; }
.doc { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .7rem .85rem; background: var(--paper); }
.snippet { color: var(--muted); margin: .2rem 0; font-size: .92rem; }
.resource .meta { color: var(--muted); font-size: .9rem; }
.passages { display: grid; gap: .75rem; margin-top: 1rem; }
.passage { background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .75rem .9rem; scroll-margin-top: 1rem; }
.passage:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.passage-heading { font-size: .85rem; color: var(--muted); margin: 0 0 .3rem; font-weight: 600; }
.passage-text { margin: 0; white-space: pre-wrap; }
pre.table { white-space: pre-wrap; font-family: inherit; margin: 0; background: var(--panel); padding: .5rem; border-radius: 6px; overflow-x: auto; }

@media (min-width: 640px) {
  .starters { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  h1 { font-size: 2.1rem; }
  .answer-grid { grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); align-items: start; }
  .sources-wrap { position: sticky; top: 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .answer { animation: fade .25s ease-out; }
  @keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

/* Go-live additions */
.callout-ok { background: var(--accent-soft); color: var(--accent); padding: .65rem .85rem; border-radius: var(--radius); max-width: var(--max); }
.fbform label { display: block; margin: .8rem 0; font-weight: 600; }
.fbform input[type=text], .fbform select, .fbform textarea, .fb-message { display: block; width: 100%; font: inherit; font-weight: 400; padding: .6rem .8rem; border: 2px solid var(--line); border-radius: var(--radius); margin-top: .3rem; background: var(--paper); }
.fb-msg { width: 100%; font-size: .9rem; }
.fb-send { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: .5rem 1rem; min-height: 40px; }
.about h2 { font-size: 1.15rem; margin: 1.4rem 0 .3rem; } .about p, .about li { max-width: var(--max); }
.admin .review-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .4rem; }
.admin .review-row select, .admin .review-row input { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; }
.admin .fbnote { font-size: .9rem; color: var(--muted); margin: .2rem 0; }
.primary-link { font-weight: 600; }
