:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1d1c1a;
  --muted: #625e57;
  --line: #d9d4ca;
  --accent: #b8431f;
  --accent-ink: #ffffff;
  --accent-soft: #fbeae3;
  --error: #a3221a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161514;
    --surface: #211f1d;
    --ink: #f1eee8;
    --muted: #aaa49a;
    --line: #3b3834;
    --accent: #f08a62;
    --accent-ink: #1d1009;
    --accent-soft: #3a2218;
    --error: #ff9a8f;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.brand {
  margin: 0 0 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--accent);
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.9rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lead { margin: 0 0 1.5rem; color: var(--muted); }
a { color: var(--accent); }

.error {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--error);
  background: var(--surface);
  color: var(--error);
  font-weight: 600;
}

/* Champ piège pour les robots : hors écran, jamais atteint au clavier. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.part { margin-top: 2.5rem; }

h2 {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
  font-size: 1.2rem;
}

.intro {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
}

fieldset { margin: 0 0 1.75rem; padding: 0; border: 0; min-width: 0; }

legend {
  padding: 0;
  margin-bottom: 0.6rem;
  font-weight: 650;
  font-size: 1.05rem;
  line-height: 1.35;
}

small { font-weight: 400; font-size: 0.85rem; color: var(--muted); }
legend small { display: block; margin-top: 0.1rem; }

.opt {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.4rem;
  padding: 0.75rem 0.85rem;
  min-height: 3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

.opt input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.15rem 0 0;
  accent-color: var(--accent);
}

.opt em {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
}

.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.opt:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt input:focus { outline: none; }

input[type="text"], textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.85rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

input[type="text"]:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.other { margin: 0 0 0.4rem; }
textarea { resize: vertical; margin-top: 0.4rem; }
.note { display: block; font-weight: 650; }

button {
  display: block;
  width: 100%;
  margin-top: 2.5rem;
  padding: 0.95rem 1rem;
  font: inherit;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.privacy { margin: 1rem 0 0; font-size: 0.85rem; color: var(--muted); }
.share a { display: inline-block; margin-top: 1.25rem; }

/* Résultats */
.filters { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }

.filters a {
  padding: 0.4rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}

.filters a[aria-current] { border-color: var(--accent); background: var(--accent-soft); }
.result { margin-bottom: 1.75rem; }
h3 { margin: 0 0 0.5rem; font-size: 1rem; line-height: 1.35; }
h3 small { display: block; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 0.3rem 0.4rem 0.3rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { text-align: left; font-weight: 400; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { width: 30%; }
meter { width: 100%; height: 0.7rem; }
.texts { margin: 0.5rem 0 0; padding-left: 1.1rem; font-size: 0.92rem; }
.texts li { margin-bottom: 0.3rem; overflow-wrap: anywhere; }
