/* Trail du P'tit Bois. Plain CSS, no build step (shared hosting). Phone first. */
:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --ink: #1f2420;
  --ink-soft: #545b55;
  --line: #d9d8d0;
  --brand: #2f5d3a;
  --brand-ink: #ffffff;
  --focus: #1a56db;
  --danger: #b3261e;
  --radius: 14px;
  --tap: 48px;
  /* Status colours, same families as the Google Sheets */
  --grey-bg: #e8e8e6;   --grey-ink: #3c3f3d;
  --blue-bg: #d6e6fb;   --blue-ink: #0f4a8a;
  --yellow-bg: #fbefc2; --yellow-ink: #6b5200;
  --green-bg: #d5eed8;  --green-ink: #1d6130;
  --orange-bg: #fde0c4; --orange-ink: #8a4300;
  --red-bg: #f9d6d3;    --red-ink: #9b1c14;
  font-size: 17px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.45;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.guest { padding-bottom: 0; }
a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
p { margin: .4rem 0 .8rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--brand); color: var(--brand-ink);
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: calc(.4rem + env(safe-area-inset-top)) .9rem .4rem; min-height: 56px;
}
.topbar a { color: inherit; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.05rem; }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border-radius: 50%; }
.bell svg { width: 26px; height: 26px; }
.badge { position: absolute; top: 4px; right: 2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #ffd54a; color: #3b2d00; font-size: .8rem; font-weight: 700; display: grid; place-items: center; }

main { max-width: 760px; margin: 0 auto; padding: 1rem .9rem 2rem; }

/* Bottom navigation */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; color: var(--ink-soft); text-decoration: none; font-size: .74rem; text-align: center; padding: 4px 2px; position: relative; }
.tabbar a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 20%; right: 20%; height: 3px; background: var(--brand); border-radius: 0 0 3px 3px; }
.tabbar svg { width: 26px; height: 26px; }
.tabbar .badge { top: 4px; right: calc(50% - 26px); }

/* Flash and errors */
.flash { background: var(--green-bg); color: var(--green-ink); border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.flash.error { background: var(--red-bg); color: var(--red-ink); }
.field-error { color: var(--danger); font-weight: 600; font-size: .92rem; margin: .3rem 0 0; }

/* Cards and lists */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: .8rem; }
.list { list-style: none; padding: 0; margin: 0; }
.task { display: grid; grid-template-columns: 1fr auto; gap: .6rem; align-items: center; border-left: 6px solid var(--c, var(--line)); scroll-margin-top: 80px; }
.task-title { font-weight: 650; color: var(--ink); text-decoration: none; display: block; font-size: 1.02rem; }
.task-title:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; color: var(--ink-soft); font-size: .88rem; margin-top: .3rem; align-items: center; }
.late { color: var(--red-ink); font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .15rem .65rem; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.tone-grey { background: var(--grey-bg); color: var(--grey-ink); }
.tone-blue { background: var(--blue-bg); color: var(--blue-ink); }
.tone-yellow { background: var(--yellow-bg); color: var(--yellow-ink); }
.tone-green { background: var(--green-bg); color: var(--green-ink); }
.tone-orange { background: var(--orange-bg); color: var(--orange-ink); }
.tone-red { background: var(--red-bg); color: var(--red-ink); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--ink-soft); }

/* Buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--tap); min-width: var(--tap);
  padding: .6rem 1.1rem; border-radius: 12px; border: 2px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.15; text-align: center;
}
.btn.secondary { background: var(--surface); color: var(--brand); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); padding-inline: .5rem; }
.btn.danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn.block { width: 100%; }
.btn.done { background: var(--green-ink); border-color: var(--green-ink); }
.btn.small { min-height: 44px; padding: .4rem .8rem; font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.inline { display: inline; margin: 0; }
.status-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.status-picker button { min-height: 56px; border-radius: 12px; border: 2px solid transparent; font: inherit; font-weight: 700; cursor: pointer; }
.status-picker button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 2px #fff; }

/* Forms */
.field { margin-bottom: 1.1rem; }
label, .label { display: block; font-weight: 650; margin-bottom: .35rem; }
.hint { display: block; color: var(--ink-soft); font-size: .88rem; font-weight: 400; margin-top: -.15rem; margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: var(--tap); padding: .6rem .8rem; border: 2px solid #8f948f; border-radius: 10px; background: #fff; color: var(--ink); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--danger); }
input[type=file] { font: inherit; width: 100%; padding: .5rem 0; }
.check { display: flex; gap: .7rem; align-items: center; min-height: var(--tap); font-weight: 500; }
.check input { width: 26px; height: 26px; flex: none; accent-color: var(--brand); }
.password-wrap { display: flex; gap: .4rem; }
.password-wrap input { flex: 1; }
.password-wrap button { flex: none; width: 56px; border-radius: 10px; border: 2px solid #8f948f; background: #fff; cursor: pointer; display: grid; place-items: center; }
.password-wrap svg { width: 24px; height: 24px; }
fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; }
legend { font-weight: 650; margin-bottom: .35rem; padding: 0; }

/* Commission tiles */
.tiles { display: grid; gap: .7rem; }
.tile { display: block; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); border-top: 8px solid var(--c); padding: .9rem 1rem; text-decoration: none; color: var(--ink); }
.tile strong { display: block; font-size: 1.08rem; }
.progress { height: 10px; background: var(--grey-bg); border-radius: 5px; overflow: hidden; margin-top: .6rem; }
.progress span { display: block; height: 100%; background: var(--green-ink); }
.commission-head { border-left: 8px solid var(--c); padding-left: .8rem; }

/* Tabs inside a page */
.tabs { display: flex; gap: .3rem; border-bottom: 2px solid var(--line); margin: 0 0 1rem; overflow-x: auto; }
.tabs a { padding: .7rem 1rem; min-height: var(--tap); text-decoration: none; color: var(--ink-soft); font-weight: 650; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--brand); }
.filters { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .6rem; }
.filters a { flex: none; }

/* Comments */
.comment { border-left: 4px solid var(--line); padding: .3rem 0 .3rem .8rem; margin-bottom: 1rem; scroll-margin-top: 80px; }
.comment:target { border-color: var(--focus); background: #eef3fd; border-radius: 0 8px 8px 0; }
.comment .who { font-weight: 700; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: .2rem 0; }
.comment.deleted .body { font-style: italic; color: var(--ink-soft); }
details summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; color: var(--brand); font-weight: 650; }

/* Tables (board) */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: .6rem .7rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: #efeee8; font-size: .82rem; }
tfoot td { font-weight: 700; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
dl.facts dt { color: var(--ink-soft); }
dl.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.key-points { white-space: pre-wrap; }
.thumb { max-width: 100%; max-height: 320px; border-radius: 10px; border: 1px solid var(--line); }

.guest-box { max-width: 440px; margin: 0 auto; padding: 2rem 1.1rem; }
.guest-logo { text-align: center; margin: 1rem 0 1.5rem; }
.guest-logo img { width: 84px; height: 84px; border-radius: 20px; }

@media (min-width: 700px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  main { padding-top: 1.5rem; }
}
