/* Mobile first: single column, system fonts, no external assets.
   Colours are chosen for WCAG AA contrast on their backgrounds. */
:root {
  --text: #1c1c1a;
  --muted: #4a4a45;
  --bg: #ffffff;
  --green: #1d5c2a;      /* 7.6:1 on white */
  --green-dark: #143f1d;
  --soft: #f2f4ef;
  --border: #c9cfc4;
  --focus: #b35c00;
  --chat: #e6ebe1;       /* chat mock-up background (our own colours, not WhatsApp's) */
  --bubble-out: #d4ecc4; /* the farmer's own message */
  --badge: #fdf0d3;      /* "illustrative" label */
  --badge-text: #6b3a00;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
}

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem; }

a { color: var(--green); text-underline-offset: 0.15em; }
a:hover { color: var(--green-dark); }
a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--bg); padding: 0.5rem 1rem; }
.skip:focus { left: 0.5rem; z-index: 1; }

.site-header { background: var(--green); color: #fff; padding: 0.75rem 0 0.5rem; }
.site-header a { color: #fff; }
.site-header a:focus-visible { outline-color: #fff; }
.brand-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.lang-switch a { font-size: 0.95rem; }

nav ul { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
nav a { display: inline-block; padding: 0.35rem 0; text-decoration: none; }
nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

main { padding-top: 1.5rem; padding-bottom: 2.5rem; }

h1 { font-size: 1.75rem; line-height: 1.25; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

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

pre, code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; }
pre { background: var(--soft); border: 1px solid var(--border); padding: 0.75rem; overflow-x: auto; }
:not(pre) > code { background: var(--soft); padding: 0.1em 0.3em; }

table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; }

blockquote { margin: 1rem 0; padding: 0.5rem 1rem; border-left: 4px solid var(--green); background: var(--soft); }

/* Worked example (/example/). Plain HTML and CSS, no logos. */
.report { margin: 1rem 0; border: 1px solid var(--border); background: var(--bg); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.report-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding: 0.5rem 0.75rem; background: var(--soft); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.report-from { font-weight: 700; color: var(--text); }
.report-text { margin: 0; border: 0; background: var(--bg); font-size: 0.75rem; line-height: 1.45; }
.report-text:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }

.chat { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.75rem; background: var(--chat); border-radius: 0.75rem; }
.bubble { max-width: 85%; padding: 0.5rem 0.75rem; border-radius: 0.6rem; white-space: pre-line; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); font-size: 0.95rem; line-height: 1.45; }
.bubble-in { align-self: flex-start; background: var(--bg); border-top-left-radius: 0; }
.bubble-out { align-self: flex-end; background: var(--bubble-out); border-top-right-radius: 0; }
.bubble-letter { max-width: 100%; }

.chat-digest { border-radius: 0.75rem 0.75rem 0 0; padding-bottom: 0.4rem; }
/* The [Show details] quick-reply button: a <summary>, so it works without JS. */
.chat-more > summary { display: block; list-style: none; cursor: pointer; padding: 0 0.75rem 0.75rem; background: var(--chat); border-radius: 0 0 0.75rem 0.75rem; }
.chat-more > summary::-webkit-details-marker { display: none; }
.quick-reply-button { display: block; max-width: 85%; padding: 0.5rem 0.75rem; text-align: center; background: var(--bg); color: var(--green); font-weight: 600; border-radius: 0.6rem; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15); }
.chat-more > summary:focus-visible { outline: none; }
.chat-more > summary:focus-visible .quick-reply-button { outline: 3px solid var(--focus); outline-offset: 2px; }
.chat-more[open] > summary .quick-reply-button { color: var(--muted); }
.chat-letter { margin: 1rem 0; }

.benchmark { margin: 1rem 0; padding: 0.75rem 1rem; border: 2px dashed var(--badge-text); background: var(--badge); }
.benchmark p { margin: 0; }
.benchmark .benchmark-label { margin-bottom: 0.4rem; font-size: 0.9rem; font-weight: 700; color: var(--badge-text); }
.benchmark-line { color: var(--text); }

.site-footer { background: var(--soft); border-top: 1px solid var(--border); color: var(--muted); padding: 1rem 0; font-size: 0.95rem; }
.site-footer p { margin: 0.25rem 0; }

@media (min-width: 40rem) {
  body { font-size: 1.125rem; }
  h1 { font-size: 2.1rem; }
}
