/* Projet terre — feuille de style commune à toutes les pages.
   Thème : un carnet de terrain breton. Papier kraft, encre vert-de-gris,
   une couleur par page tirée du paysage (bruyère, ajonc, châtaigne, mûre…). */

:root {
  --paper: #F4F0E4;
  --sheet: #FBF9F2;
  --ink: #22291F;
  --muted: #5D6457;
  --line: #DCD5C2;
  --line-soft: #E9E3D3;
  --warn: #9A4B1C;
  --warn-bg: #F7E5D2;
  --display: "Alegreya", Georgia, "Times New Roman", serif;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(60, 50, 30, .06), 0 6px 18px -10px rgba(60, 50, 30, .25);
  --s-automne: #B4622A; --s-hiver: #4F7189; --s-printemps: #4E8A3A; --s-ete: #B88A12;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141A16; --sheet: #1B231D; --ink: #E6E9E1; --muted: #A6B0A3; --line: #34413A; --line-soft: #26302A;
    --warn: #EBA273; --warn-bg: #3A2617;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .6);
    --s-automne: #E3925A; --s-hiver: #8FB3CC; --s-printemps: #93C77E; --s-ete: #E2BE55;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #141A16; --sheet: #1B231D; --ink: #E6E9E1; --muted: #A6B0A3; --line: #34413A; --line-soft: #26302A;
  --warn: #EBA273; --warn-bg: #3A2617;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .6);
  --s-automne: #E3925A; --s-hiver: #8FB3CC; --s-printemps: #93C77E; --s-ete: #E2BE55;
  color-scheme: dark;
}

/* Une couleur par page : -l en clair, -d en sombre. */
body { --accent-l: #3D6B45; --accent-d: #8CC196; }
.p-plan       { --accent-l: #3D6B45; --accent-d: #8CC196; }
.p-terre      { --accent-l: #7A5638; --accent-d: #D2A57E; }
.p-potager    { --accent-l: #B0582A; --accent-d: #E6955F; }
.p-verger     { --accent-l: #855426; --accent-d: #D6A06A; }
.p-animaux    { --accent-l: #7E4F7B; --accent-d: #C99AC5; }
.p-eau        { --accent-l: #2D6F8F; --accent-d: #7DB8D3; }
.p-energie    { --accent-l: #8C6A0C; --accent-d: #E0BE55; }
.p-conserves  { --accent-l: #9A3449; --accent-d: #E58B9D; }
.p-calendrier { --accent-l: #56682E; --accent-d: #B6C97A; }
.p-formations { --accent-l: #2B6B67; --accent-d: #7CC4BE; }
.p-lexique    { --accent-l: #565D66; --accent-d: #AEB6C0; }
.p-outils     { --accent-l: #4F6357; --accent-d: #A3BBAE; }
.p-maison     { --accent-l: #8C4F3A; --accent-d: #E6A48C; }
.p-idees      { --accent-l: #5B4F9C; --accent-d: #B1A8E8; }
.p-climat     { --accent-l: #3F5A86; --accent-d: #9DB4DE; }
body, .tile { --accent: var(--accent-l); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(body, .tile) { --accent: var(--accent-d); } }
:root[data-theme="dark"] :is(body, .tile) { --accent: var(--accent-d); }
body, .tile { --accent-soft: color-mix(in srgb, var(--accent) 13%, var(--sheet)); --accent-line: color-mix(in srgb, var(--accent) 35%, var(--line)); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.6;
  background-color: var(--paper);
  /* grain de papier très léger */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
strong { font-weight: 700; }
p, li, dd { max-width: 70ch; }
ul, ol { padding-left: 1.25rem; }
li { margin: .3rem 0; }
li::marker { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; text-wrap: balance; color: var(--ink); }
h3 { font-size: 1.25rem; margin: 1.8rem 0 .5rem; }
h4 { font-size: 1.05rem; margin: 1.2rem 0 .3rem; }
img, svg { max-width: 100%; }
small, .muted { color: var(--muted); }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1180px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.topbar-in { position: relative; }
.pages-nav { flex: 1; min-width: 0; }
.pages-nav > ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.pages-nav li { margin: 0; }
.pages-nav a, .grp > button { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font: inherit; font-size: .95rem; white-space: nowrap; background: none; border: 0; cursor: pointer; }
.pages-nav a:hover, .grp > button:hover, .grp > button[aria-expanded="true"] { color: var(--ink); background: var(--line-soft); }
.pages-nav a[aria-current="page"] { color: var(--sheet); background: var(--accent); }
.grp { position: relative; }
.grp.here > button { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.grp > button svg { width: 14px; height: 14px; transition: transform .15s; }
.grp > button[aria-expanded="true"] svg { transform: rotate(180deg); }
.grp .short { display: none; }
.drop { position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; list-style: none; margin: 0; padding: 6px; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 30; }
.drop[hidden] { display: none; }
.drop a { border-radius: 8px; padding: 9px 12px; color: var(--ink); }
.drop a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
@media (max-width: 640px) {
  .grp .long { display: none; } .grp .short { display: inline; }
  .pages-nav a, .grp > button { padding: 6px 8px; font-size: .9rem; }
  .grp { position: static; }
  .drop { left: 8px; right: 8px; top: calc(100% + 2px); min-width: 0; }
  .drop a { padding: 12px 14px; font-size: 1rem; }
  /* Filet de sécurité sur les très petits écrans : la barre glisse au doigt au lieu de passer sous le bouton du thème. */
  .pages-nav { overflow-x: auto; scrollbar-width: none; }
  .pages-nav::-webkit-scrollbar { display: none; }
}
.pages-nav > ul > li { flex: none; }
.home-ico { display: none; flex: none; width: 18px; height: 18px; }
@media (max-width: 480px) {
  /* La maison du menu remplace la feuille : c'est le même lien vers l'accueil. */
  .brand { display: none; }
  .home-ico { display: block; } .home-txt { display: none; }
  .pages-nav a, .grp > button { padding: 6px 7px; }
  .grp > button svg { display: none; }
}
.theme-btn { flex: none; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; display: grid; place-items: center; }
.theme-btn svg { width: 18px; height: 18px; }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); transition: width .1s linear; }

/* ---------- Mise en page ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 0 16px 72px; }
.hero { position: relative; padding: 44px 0 28px; max-width: 820px; }
.hero::after { /* brin de fougère en filigrane */
  content: ""; position: absolute; right: 0; top: 18px; width: 150px; height: 150px; opacity: .14; pointer-events: none;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M20 92 C40 70 55 45 82 10'/%3E%3Cpath d='M30 79 l-14-6 M36 71 l-16-10 M43 62 l-16-13 M50 53 l-15-16 M57 44 l-12-17 M64 35 l-9-16 M71 26 l-6-13 M34 75 l12 9 M40 67 l15 7 M47 58 l17 4 M54 49 l17 2 M61 40 l16 -1 M68 31 l13 -3 M75 21 l9 -4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M20 92 C40 70 55 45 82 10'/%3E%3Cpath d='M30 79 l-14-6 M36 71 l-16-10 M43 62 l-16-13 M50 53 l-15-16 M57 44 l-12-17 M64 35 l-9-16 M71 26 l-6-13 M34 75 l12 9 M40 67 l15 7 M47 58 l17 4 M54 49 l17 2 M61 40 l16 -1 M68 31 l13 -3 M75 21 l9 -4'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 700px) { .hero::after { width: 96px; height: 96px; top: 10px; } }
.eyebrow { margin: 0 0 .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.3rem); margin: 0 0 .6rem; font-weight: 800; letter-spacing: -.01em; }
.lede { font-size: 1.16rem; color: var(--muted); margin: 0; max-width: 62ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.facts li { margin: 0; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: .9rem; }
.facts b { color: var(--accent); }

.layout { display: grid; gap: 32px; }
@media (min-width: 1100px) { .layout.has-toc { grid-template-columns: 220px minmax(0, 1fr); } }
.content { min-width: 0; max-width: 860px; }
.content.wide { max-width: none; }

/* Sommaire : colonne collante sur grand écran, dépliable ailleurs */
.toc { font-size: .93rem; }
.toc details { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; }
.toc summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "▾"; color: var(--accent); }
.toc details[open] summary::after { content: "▴"; }
.toc ol { list-style: none; margin: .6rem 0 .2rem; padding: 0; counter-reset: t; }
.toc li { margin: 0; counter-increment: t; }
.toc a { display: flex; gap: 8px; padding: 4px 6px; border-radius: 6px; color: var(--muted); text-decoration: none; line-height: 1.3; }
.toc a::before { content: counter(t, decimal-leading-zero); font-variant-numeric: tabular-nums; color: var(--accent); font-size: .8rem; padding-top: 2px; opacity: .8; }
.toc a:hover { background: var(--line-soft); color: var(--ink); }
.toc a.active { color: var(--ink); background: var(--accent-soft); font-weight: 700; }
@media (min-width: 1100px) {
  .toc { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 90px); overflow: auto; padding-top: 6px; }
  .toc details { background: transparent; border: 0; padding: 0; }
  .toc summary { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
  .toc summary::after, .toc details[open] summary::after { content: none; }
}

/* ---------- Sections ---------- */
.content > section { counter-increment: sec; padding-top: 8px; }
.content { counter-reset: sec; }
.content > section > h2 {
  font-size: clamp(1.55rem, 3.6vw, 1.95rem); margin: 2.6rem 0 1rem; color: var(--ink);
  display: flex; align-items: baseline; gap: 12px;
}
.content > section > h2::before {
  content: counter(sec, decimal-leading-zero); font-family: var(--body); font-size: .85rem; font-weight: 700; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 999px; padding: 1px 8px; transform: translateY(-3px); flex: none;
}
.content > section > h2 + p.intro, .intro { font-size: 1.06rem; color: var(--muted); }

/* ---------- Encadrés ---------- */
.box, .note {
  background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 14px 18px; margin: 1.1rem 0; box-shadow: var(--shadow);
}
.box > :first-child, .note > :first-child, .warn > :first-child { margin-top: 0; }
.box > :last-child, .note > :last-child, .warn > :last-child { margin-bottom: 0; }
.box ul, .warn ul { margin: .4rem 0 0; }
.warn { background: var(--warn-bg); border-left: 4px solid var(--warn); border-radius: 10px; padding: 14px 18px 14px 50px; margin: 1.1rem 0; position: relative; }
.warn::before { content: "!"; position: absolute; left: 16px; top: 13px; width: 22px; height: 22px; border-radius: 50%; background: var(--warn); color: var(--warn-bg); font-weight: 800; display: grid; place-items: center; font-size: .9rem; }
.warn strong:first-child { color: var(--warn); }
.me { /* « Pour mon alimentation », notes personnelles */
  background: var(--accent-soft); border: 1px dashed var(--accent-line); border-radius: 12px; padding: 12px 18px; margin: 1.2rem 0;
  font-family: var(--display); font-size: 1.05rem;
}
.me strong:first-child { font-family: var(--body); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); display: block; }
.see { font-size: .95rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: .6rem; margin-top: 1.2rem; }
.see::before { content: "→ "; color: var(--accent); font-weight: 700; }

/* ---------- Cartes ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 1rem 0; padding: 0; list-style: none; }
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; margin: 0; }
.card h3, .card h4 { margin: 0 0 .4rem; }
.card p { margin: .3rem 0; }
.card ul { margin: .4rem 0 0; }
.card.accent { border-top: 4px solid var(--accent); }
.card .tag { float: right; }
.recipe h4 { font-size: 1.15rem; }
.recipe .meta { font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }

/* ---------- Tableaux ---------- */
.tbl { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 12px; background: var(--sheet); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .96rem; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child > td, tr:last-child > th { border-bottom: 0; }
tr:first-child > th { font-family: var(--body); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: color-mix(in srgb, var(--accent) 6%, var(--sheet)); }
tbody tr:hover, table tr:hover > td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
/* Sur téléphone, chaque ligne devient une petite fiche (étiquettes posées par projet.js). */
@media (max-width: 640px) {
  .tbl { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr:first-child { display: none; }
  table.stack tr { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; padding: 8px 4px; box-shadow: var(--shadow); }
  table.stack td { border: 0; padding: 4px 12px; }
  table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  table.stack td:first-child { font-size: 1.05rem; }
  table.stack td:first-child::before { display: none; }
  table.stack td.chk { float: right; width: auto; }
  table.stack td.chk + td { font-size: 1.05rem; padding-right: 48px; }
  table.stack td.chk + td::before { display: none; }
}
@media (max-width: 480px) { .brand span { display: none; } }

/* ---------- Étiquettes ---------- */
.tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 700; line-height: 1.5; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); white-space: nowrap; }
.tag.p1 { background: color-mix(in srgb, var(--warn) 14%, var(--sheet)); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.tag.p2 { }
.tag.p3 { background: var(--line-soft); color: var(--muted); border-color: var(--line); }
.tag.automne { --c: var(--s-automne); } .tag.hiver { --c: var(--s-hiver); } .tag.printemps { --c: var(--s-printemps); } .tag.ete { --c: var(--s-ete); }
.tag.automne, .tag.hiver, .tag.printemps, .tag.ete { background: color-mix(in srgb, var(--c) 15%, var(--sheet)); color: var(--c); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }

/* ---------- Le chemin (frise des années) ---------- */
.path { list-style: none; margin: 1.2rem 0; padding: 0 0 0 26px; position: relative; }
.path::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), var(--accent-line)); border-radius: 2px; }
.year { position: relative; margin: 0 0 22px; }
.year::before { content: ""; position: absolute; left: -24px; top: 10px; width: 14px; height: 14px; border-radius: 50%; background: var(--sheet); border: 3px solid var(--accent); }
.year.buy::before { background: var(--accent); width: 18px; height: 18px; left: -26px; top: 8px; }
.year-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.year-head h3 { margin: 0; font-size: 1.35rem; }
.year-head .when { font-size: .85rem; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.seasons { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.season { background: var(--sheet); border: 1px solid var(--line); border-top: 4px solid var(--c, var(--accent)); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); font-size: .97rem; }
.season > b:first-child { display: block; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c); margin-bottom: 2px; }
.season.automne { --c: var(--s-automne); } .season.hiver { --c: var(--s-hiver); } .season.printemps { --c: var(--s-printemps); } .season.ete { --c: var(--s-ete); }
.season .rec { display: block; color: var(--muted); font-size: .9rem; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.season ul { margin: .2rem 0 0; padding-left: 1.1rem; }

/* ---------- Calendrier ---------- */
.months { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin: 1rem 0; }
.month { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 80px; }
.month h3 { margin: 0; padding: 10px 16px; font-size: 1.3rem; display: flex; justify-content: space-between; align-items: baseline; background: color-mix(in srgb, var(--c) 12%, var(--sheet)); border-bottom: 1px solid var(--line); }
.month h3 small { font-family: var(--body); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c); font-weight: 700; }
.month.now { outline: 3px solid var(--accent); outline-offset: 2px; }
.month.now h3::after { content: "ce mois-ci"; font-family: var(--body); font-size: .72rem; font-weight: 700; color: var(--sheet); background: var(--accent); border-radius: 999px; padding: 2px 8px; margin-left: auto; }
.month.now h3 small { display: none; }
.month dl { margin: 0; padding: 8px 16px 12px; display: grid; gap: 8px; }
.month dt { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.month dt::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--k); }
.month dd { margin: 0; font-size: .95rem; line-height: 1.45; }
.k-potager { --k: #C0662F; } .k-arbres { --k: #8A5A2B; } .k-animaux { --k: #8E5B8A; } .k-maison { --k: #4F7189; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: .6rem 0; padding: 0; list-style: none; font-size: .9rem; }
.legend li { margin: 0; display: flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--k); }

/* ---------- Lexique ---------- */
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 1rem 0; padding: 0; list-style: none; }
.letters li { margin: 0; }
.letters a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--sheet); border: 1px solid var(--line); text-decoration: none; font-weight: 700; }
.letters a:hover { background: var(--accent); color: var(--sheet); }
.lexicon-search { width: 100%; max-width: 420px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); color: var(--ink); font: inherit; }
dl.lexicon { margin: 0; }
.lexicon .letter { font-family: var(--display); font-size: 1.8rem; color: var(--accent); margin: 1.6rem 0 .4rem; border-bottom: 1px solid var(--line); }
.lexicon dt { font-weight: 700; margin-top: .8rem; scroll-margin-top: 80px; }
.lexicon dt small { font-weight: 400; color: var(--muted); }
.lexicon dd { margin: .1rem 0 0; color: var(--ink); }
.lexicon dd a { font-size: .9rem; }
.lexicon dt:target, .lexicon dt:target + dd { background: var(--accent-soft); }

/* ---------- Cases à cocher (Formations, listes) ---------- */
.chk { width: 44px; text-align: center; }
.chk input, .checklist input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
tr.done td { color: var(--muted); }
tr.done td strong { text-decoration: line-through; text-decoration-color: var(--accent); }
ul.checklist { list-style: none; padding: 0; }
ul.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; margin: 6px 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; }
ul.checklist li input { margin-top: 4px; flex: none; }
ul.checklist li.done span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent); }
.progress-note { font-size: .9rem; color: var(--muted); }
/* Carnet de bord (Carnet de jardin) : notes datées gardées sur le serveur. */
.journal form { display: grid; gap: 8px; grid-template-columns: auto 1fr; align-items: start; }
.journal textarea, .journal input[type=date] { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet); color: var(--ink); }
.journal textarea { width: 100%; resize: vertical; min-height: 4.5rem; }
.journal form > button { grid-column: 1 / -1; justify-self: start; }
.journal button { font: inherit; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--sheet); color: var(--ink); cursor: pointer; }
.journal form > button[type=submit], .journal-edit button[type=submit] { background: var(--accent); border-color: var(--accent); color: var(--sheet); font-weight: 700; }
.journal button:disabled, .journal textarea:disabled, .journal input:disabled { opacity: .55; cursor: not-allowed; }
.journal-liste { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.journal-liste li { margin: 0; padding: 10px 14px; background: var(--sheet); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; }
.journal-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.journal-tete time { font-weight: 700; color: var(--accent); }
.journal-actions { display: inline-flex; gap: 6px; }
.journal-actions button { padding: 2px 10px; font-size: .85rem; }
.journal-texte { margin: 4px 0 0; white-space: pre-wrap; }
.journal-edit { display: grid; gap: 8px; }
@media (max-width: 480px) { .journal form { grid-template-columns: 1fr; } }
/* Recherche dans tout le projet (accueil). */
.site-search { width: 100%; font: inherit; font-size: 1.05rem; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--sheet); color: var(--ink); }
.site-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.results li { margin: 0; }
.results a { display: block; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); color: var(--ink); text-decoration: none; }
.results a:hover, .results a:focus-visible { border-color: var(--accent); }
.r-page { display: block; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.r-snip { display: block; color: var(--muted); font-size: .92rem; margin-top: 2px; }
.results mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- Figures et schémas ---------- */
figure.plan { margin: 1.2rem 0; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.plan-scroll { overflow-x: auto; }
figure.plan svg { display: block; width: 100%; min-width: 560px; height: auto; }
figure.plan figcaption { font-size: .9rem; color: var(--muted); margin-top: .5rem; }
svg text { font-family: var(--body); fill: var(--ink); }

/* ---------- Pied de page, retour en haut ---------- */
.foot { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.foot a { color: var(--muted); }
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 15; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--sheet); color: var(--accent); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }

/* ---------- Impression ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .toc, .to-top, .theme-btn { display: none !important; }
  .hero::after { display: none; }
  .layout.has-toc { display: block; }
  .box, .note, .warn, .card, .season, .month, .tbl, figure { box-shadow: none; break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}
