:root {
  --paper: #f5efe2;
  --card: #fffaf0;
  --ink: #23271f;
  --muted: #6c6a5c;
  --line: #e0d6c0;
  --green: #2f4a2c;
  --green-2: #44683f;
  --wheat: #d9a93c;
  --wheat-soft: #f3e2b5;
  --red: #a2412c;
  --blue: #36597a;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(60, 50, 20, .06), 0 6px 18px -10px rgba(60, 50, 20, .25);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.5; }
a { color: var(--green-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; margin: 0 0 .4em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 3rem 1rem; }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

/* En-tête */
.top { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.5rem; background: var(--green); color: #f4ecd8; position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand svg { width: 34px; height: 34px; stroke: var(--wheat); stroke-width: 1.6; fill: none; }
.brand strong { display: block; font-family: var(--serif); font-size: 1.15rem; line-height: 1.1; }
.brand span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; opacity: .75; }
nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
nav a { color: #f4ecd8; text-decoration: none; padding: .4rem .75rem; border-radius: 8px; font-size: .92rem; opacity: .85; }
nav a:hover { background: rgba(255,255,255,.08); opacity: 1; }
nav a.on { background: var(--wheat); color: var(--green); opacity: 1; font-weight: 600; }
.who { margin-left: auto; display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.who button { background: transparent; border: 1px solid rgba(244,236,216,.4); color: inherit; }

main { max-width: 1180px; margin: 0 auto; padding: 1.8rem 1.5rem 4rem; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.head p { margin: 0; }

/* Cartes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.stack > * + * { margin-top: 1rem; }

/* Formulaires */
label { display: block; font-size: .85rem; font-weight: 600; margin: .7rem 0 .25rem; }
input, select { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--wheat); outline-offset: 0; border-color: var(--wheat); }
button, .btn { font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 8px; padding: .55rem 1rem; background: var(--green); color: #f8f1df; text-decoration: none; display: inline-block; }
button:hover { background: var(--green-2); }
button.ghost { background: transparent; color: var(--green); border: 1px solid var(--line); }
button.ghost:hover { background: var(--wheat-soft); }
button.warn { background: var(--red); }
button.gold { background: var(--wheat); color: var(--green); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; }
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.tabs button { background: transparent; color: var(--ink); border-radius: 0; font-weight: 500; padding: .45rem .9rem; }
.tabs button.on { background: var(--green); color: #f8f1df; }

/* Ferme */
.farm-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.money { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; color: var(--green); }
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; background: #ece4cf; color: var(--muted); }
.pill.on { background: #dfead6; color: #355f2d; }
.pill.on::before, .pill.off::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.warn { background: #f4dcd3; color: var(--red); }
.pill.gold { background: var(--wheat-soft); color: #7b5a12; }
.pill.blue { background: #dbe5ef; color: var(--blue); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
td { padding: .5rem; border-bottom: 1px solid #efe7d4; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.form-tag { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* Annonces */
.listing { display: flex; flex-direction: column; gap: .5rem; }
.listing .title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.listing .price { font-size: 1.15rem; font-weight: 700; color: var(--green); }
.listing .meta { font-size: .85rem; color: var(--muted); }
.listing .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.bar { height: 6px; border-radius: 99px; background: #ece4cf; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--wheat); }

/* Journal */
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: .55rem 0; border-bottom: 1px solid #efe7d4; font-size: .9rem; }
.events li:last-child { border: 0; }
.events time { display: block; font-size: .75rem; color: var(--muted); }

/* Divers */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty h3 { color: var(--ink); }
.token { font-family: ui-monospace, Menlo, Consolas, monospace; background: #f1ead8; padding: .35rem .55rem; border-radius: 6px; font-size: .85rem; word-break: break-all; }
.steps { margin: .5rem 0 0; padding-left: 1.2rem; }
.steps li { margin: .3rem 0; }
.note { background: var(--wheat-soft); border-left: 4px solid var(--wheat); padding: .7rem .9rem; border-radius: 6px; font-size: .9rem; }
.auth { max-width: 420px; margin: 3rem auto; }
.hero { text-align: center; margin: 1rem auto 2rem; max-width: 640px; }
.hero h1 { font-size: 2.3rem; color: var(--green); }

dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 460px; width: calc(100% - 2rem); box-shadow: 0 20px 50px -15px rgba(0,0,0,.4); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(35, 39, 31, .45); }
dialog form { padding: 1.4rem 1.5rem; }
dialog .actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; }
.total { margin-top: .9rem; padding: .7rem .9rem; background: #f1ead8; border-radius: 8px; display: flex; justify-content: space-between; font-weight: 600; }

#toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%) translateY(150%); background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px; transition: transform .25s; z-index: 50; max-width: 90vw; font-size: .92rem; }
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); }

@media (max-width: 720px) {
  .top { padding: .6rem 1rem; gap: .6rem; }
  nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  main { padding: 1.2rem 1rem 3rem; }
}

.tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tile .money { font-size: 1.45rem; }
.tile.alert { border-color: #e3b3a6; background: #fbefe9; }
.scroll { overflow-x: auto; }
details summary { cursor: pointer; }
@media (max-width: 720px) {
  table.stack thead { display: none; }
  table.stack tr { display: grid; padding: .5rem 0; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: .15rem 0; text-align: left; }
  table.stack td.r { text-align: left; }
}

/* Badges */
.badge { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; margin-left: .3rem; border-radius: 99px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1.25rem; text-align: center; vertical-align: middle; }
.badge[hidden] { display: none; }
.pill.tag { font-size: .65rem; padding: .05rem .4rem; margin-left: .35rem; }

/* Discussion */
.chat { display: grid; grid-template-columns: 270px minmax(0, 1fr); padding: 0; overflow: hidden; height: calc(100vh - 230px); min-height: 460px; }
.clist { border-right: 1px solid var(--line); padding: .8rem; overflow-y: auto; background: #fbf6ea; }
.chan { display: block; width: 100%; text-align: left; background: transparent; color: var(--ink); font-weight: 400; border-radius: 8px; padding: .55rem .6rem; margin-top: .3rem; }
.chan:hover { background: var(--wheat-soft); }
.chan.on { background: var(--green); color: #f8f1df; }
.chan .cname { display: flex; align-items: center; font-weight: 600; }
.chan .cname .badge { margin-left: auto; }
.chan .cprev { display: block; font-size: .78rem; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmain { display: flex; flex-direction: column; min-width: 0; }
.ctitle { padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: .8rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; }
.msg { max-width: 78%; align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: .45rem .7rem; }
.msg.mine { align-self: flex-end; background: #e6eedf; border-color: #cbdbbf; border-radius: 12px 4px 12px 12px; }
.mhead { display: flex; align-items: center; gap: .2rem; font-size: .8rem; }
.mhead time { color: var(--muted); margin-left: .5rem; }
.mact { margin-left: auto; padding-left: .6rem; opacity: 0; transition: opacity .15s; }
.msg:hover .mact, .msg:focus-within .mact { opacity: 1; }
.mact button { background: none; color: var(--muted); font-weight: 500; font-size: .75rem; padding: 0 .3rem; }
.mact button:hover { color: var(--red); background: none; }
.txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; background: var(--wheat-soft); color: #6b4f10; border-radius: 6px; padding: .1rem .5rem; margin: .2rem 0; text-decoration: none; }
.chip button { background: none; color: inherit; padding: 0 .2rem; font-size: 1rem; line-height: 1; }
.compose { border-top: 1px solid var(--line); padding: .7rem 1.1rem; display: flex; flex-direction: column; gap: .4rem; background: #fbf6ea; }
.compose textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; resize: none; background: #fff; color: var(--ink); }
.compose textarea:focus { outline: 2px solid var(--wheat); border-color: var(--wheat); }
.report blockquote { margin: .6rem 0; padding: .6rem .8rem; background: #f6efe0; border-left: 3px solid var(--red); border-radius: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.report.closed { opacity: .7; }
.report.closed blockquote { border-left-color: var(--line); }
@media (max-width: 720px) {
  .chat { grid-template-columns: 1fr; height: auto; }
  .clist { border-right: 0; border-bottom: 1px solid var(--line); max-height: 180px; }
  .msgs { height: 55vh; }
  .mact { opacity: 1; }
  .msg { max-width: 92%; }
}

/* Coopérative */
.bstrip { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.bcard { display: flex; flex-direction: column; gap: .15rem; }
.bimg { background: linear-gradient(#e9f0f3, #f6f1e3 70%, #d9cfae 70%); border-radius: 8px; margin-bottom: .5rem; padding: .3rem; }
.bimg svg { display: block; width: 100%; height: 92px; }
.bimg.sm { margin: 0; padding: 0; }
.bimg.sm svg { height: 44px; }
.trend { font-size: .7rem; color: var(--muted); }
.trend.up { color: #3f7d3a; }
.trend.down { color: var(--red); }

.melink { color: inherit; text-decoration: none; padding: .3rem .5rem; border-radius: 8px; }
.melink:hover { background: rgba(255,255,255,.1); }
th.c, td.c { text-align: center; }

/* Vitrine publique */
a.brand { color: inherit; text-decoration: none; }
.btn.gold { background: var(--wheat); color: var(--green); }
.btn.ghostbtn { background: transparent; color: var(--green); border: 1px solid var(--green); }
.pub main { max-width: 1120px; }
.pub section { margin: 2.6rem 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2rem; align-items: center; margin: 1rem 0 2rem; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.1; color: var(--green); text-wrap: balance; }
.lead { font-size: 1.12rem; max-width: 60ch; }
.hero-art { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 22px rgba(60, 50, 20, .18)); }
.steps3 { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.steps3 li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem 3.6rem; position: relative; }
.steps3 li::before { content: counter(s); position: absolute; left: 1rem; top: .9rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--wheat); color: var(--green); font-weight: 700; display: grid; place-items: center; }
.steps3 strong { display: block; font-family: var(--serif); font-size: 1.1rem; }
.steps3 span { color: var(--muted); font-size: .93rem; }
a.pubcard { text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
a.pubcard:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(60, 50, 20, .35); }
.faq { margin-top: .6rem; padding: .9rem 1.1rem; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: .6rem 0 0; color: #3d3f36; }
.prose { max-width: 760px; }
.prose p, .prose li { font-size: 1.02rem; }
.guide { padding-left: 1.3rem; }
.guide li { margin: 1.2rem 0; }
.guide h2 { font-size: 1.2rem; margin: 0 0 .3rem; }
.pubfoot { border-top: 1px solid var(--line); padding: 1.6rem 1.5rem 2.4rem; text-align: center; color: var(--muted); display: grid; gap: .35rem; }
.pubfoot a { color: var(--muted); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } .hero-art { order: -1; } }
@media (prefers-reduced-motion: reduce) { a.pubcard { transition: none; } }

/* Admin : référencement */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: .35rem 0; border-bottom: 1px solid #efe7d4; }
.checks li.ok strong { color: #355f2d; }
.checks li.ko strong { color: #8a5a12; }
.bad { color: var(--red); font-weight: 600; }
.seopage { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
.seopage textarea, .faqrow textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.serp { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; font-family: Arial, sans-serif; margin-top: 1.9rem; }
.serp-url { font-size: .8rem; color: #202124; }
.serp-title { font-size: 1.2rem; color: #1a0dab; margin: .2rem 0; line-height: 1.3; }
.serp-desc { font-size: .86rem; color: #4d5156; line-height: 1.45; }
.faqrow { display: grid; gap: .35rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.faqrow button { justify-self: end; }
.savebar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 35%); padding: 1.2rem 0 .4rem; display: flex; justify-content: flex-end; }

/* Téléchargements */
.small-btn { font-size: .85rem; padding: .4rem .7rem; }
.ghost-a { background: transparent; color: var(--green); border: 1px solid var(--line); }
.dlcard { position: relative; padding-top: 1.4rem; }
.dlnum { position: absolute; top: -14px; left: 1.2rem; width: 30px; height: 30px; border-radius: 50%; background: var(--wheat); color: var(--green); font-weight: 700; display: grid; place-items: center; }
.dlcard .btn { margin-top: .3rem; }

tr.grp th { background: #efe6cf; color: var(--green); font-family: var(--serif); font-size: .95rem; text-transform: none; letter-spacing: 0; padding: .45rem .5rem; }
