/* ==========================================================================
   AGIR ANTIFASCISTE — STYLES
   Charte : couleurs « papier journal » + titres arrondis.
   Couleurs : modifiez les variables ci-dessous (clair puis sombre).
   ========================================================================== */

:root {
  --bg: #FAF7F0;
  --surface: #FFFFFF;
  --surface-2: #F1ECE1;
  --text: #17140F;
  --muted: #645D52;
  --border: #E4DCCD;
  --border-strong: #C8BDA8;
  --accent: #A3121B;       /* rouge du logo */
  --accent-soft: #F6E4E2;
  --accent-2: #A3121B;     /* mot mis en avant dans le grand titre */
  --logo-red: #C30001;     /* rouge exact du drapeau du logo */
  --on-accent: #FFFFFF;
  --good: #22633F;
  --good-soft: #E3EFE4;
  --t1: #A3121B; --t1-soft: #F6E4E2;
  --t2: #8A4B0C; --t2-soft: #F5EAD9;
  --t3: #4E4A44; --t3-soft: #ECE8E1;
  --t0: #22633F; --t0-soft: #E3EFE4;
  --shadow: none;
  --shadow-lg: 0 20px 60px rgba(23, 20, 15, .18);
  --focus: #1F5FD1;
  --radius: 6px;
  --radius-sm: 4px;
  --logo-zoom: 1; /* > 1 pour rogner davantage les bords du logo */
  --measure: 760px; /* largeur commune des blocs de texte */

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --display-weight: 800;
  --display-tracking: -.03em;
  --em-style: normal;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12100D; --surface: #1B1915; --surface-2: #23201B; --text: #F2EDE3; --muted: #ADA597;
    --border: #2F2B25; --border-strong: #463F35; --accent: #FF7A7F; --accent-soft: #3A1A1B; --accent-2: #FF7A7F; --on-accent: #1B0A0B;
    --logo-red: #E5262B;
    --good: #78CF98; --good-soft: #17271C;
    --t1: #FF7A7F; --t1-soft: #3A1A1B; --t2: #F2B46A; --t2-soft: #33250F; --t3: #C2BBAF; --t3-soft: #2A2620; --t0: #78CF98; --t0-soft: #17271C;
    --shadow: none; --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
    --focus: #8DB7FF; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12100D; --surface: #1B1915; --surface-2: #23201B; --text: #F2EDE3; --muted: #ADA597;
  --border: #2F2B25; --border-strong: #463F35; --accent: #FF7A7F; --accent-soft: #3A1A1B; --accent-2: #FF7A7F; --on-accent: #1B0A0B;
  --logo-red: #E5262B;
  --good: #78CF98; --good-soft: #17271C;
  --t1: #FF7A7F; --t1-soft: #3A1A1B; --t2: #F2B46A; --t2-soft: #33250F; --t3: #C2BBAF; --t3-soft: #2A2620; --t0: #78CF98; --t0-soft: #17271C;
  --shadow: none; --shadow-lg: 0 20px 60px rgba(0,0,0,.5);
  --focus: #8DB7FF; color-scheme: dark;
}

/* Taille du texte (bouton « AA ») */
/* La page défile toujours au niveau de la fenêtre, avec une barre de défilement toujours visible */
html { font-size: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; overflow-y: scroll; }
html[data-size="1"] { font-size: 112.5%; }
html[data-size="2"] { font-size: 125%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden; /* navigateurs anciens */
  overflow-x: clip;   /* coupe le débordement sans transformer body en zone de défilement */
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: calc(var(--display-tracking) / 2); font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1em; }
cite { font-style: italic; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: .6em 1em; border-radius: 8px; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.narrow { max-width: 1180px; } /* même largeur que le catalogue */

/* ---------- En-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.logo { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: var(--accent); flex-shrink: 0; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border-strong); transition: transform .3s ease; }
.brand:hover .logo { transform: rotate(-8deg); }
.logo img { width: 100%; height: 100%; object-fit: cover; transform: scale(var(--logo-zoom)); }
.logo-fallback { display: none; width: 44px; height: 44px; }
.logo--fallback .logo-fallback { display: block; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; line-height: 1; letter-spacing: -.01em; }
.brand-name span { color: var(--logo-red); font-weight: 800; }

.mainnav { display: none; gap: 4px; margin-left: auto; }
.mainnav a { color: var(--text); text-decoration: none; font-size: .95rem; padding: .5em .8em; border-radius: 999px; white-space: nowrap; }
.mainnav a:hover { background: var(--surface-2); }
.tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
@media (min-width: 1000px) { .mainnav { display: flex; } .tools { margin-left: 8px; } .menu-btn { display: none !important; } }

.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: background .15s, border-color .15s, transform .15s;
}
.tool:hover { border-color: var(--border-strong); background: var(--surface-2); }
.tool:active { transform: scale(.96); }
.tool svg { width: 20px; height: 20px; }
.tool-progress { color: var(--good); }
.tool-progress svg { stroke-width: 2.6; }
.aa { font-family: var(--font-display); font-size: .95rem; }
.aa span { font-size: 1.25em; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; } :root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: block; } :root:not([data-theme="light"]) .i-moon { display: none; } }

@media (max-width: 999px) {
  .mainnav.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px 16px; box-shadow: var(--shadow);
  }
  .mainnav.open a { padding: .85em 1em; font-size: 1.05rem; }
}
@media (max-width: 480px) {
  .topbar-inner { gap: 10px; }
  .brand { gap: 8px; }
  .brand-name { font-size: 1rem; line-height: 1.05; }
  .brand-name span { display: block; }
  .tools { gap: 4px; }
  .tool { min-width: 40px; height: 40px; padding: 0 8px; }
}

/* ---------- Accueil ---------- */
.hero { padding: clamp(40px, 8vw, 96px) 0 48px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 1em; }
.eyebrow--quote { font-size: clamp(1.05rem, .9rem + .7vw, 1.45rem); letter-spacing: .06em; }

/* Paragraphes justifiés, façon gazette */
.prose p, .lead, .hero-why, .section-lead, .manifesto p, .rules li, .research li > p:nth-of-type(3), .tips p, .pillars p, .research-nuance, .callout {
  text-align: justify; hyphens: auto; -webkit-hyphens: auto;
}
/* Colonnes de journal sur grand écran */
@media (min-width: 1000px) {
  .cols { column-count: 2; column-gap: 48px; column-rule: 1px solid var(--border); }
  .cols > * { break-inside: avoid; }
  .cols h3 { break-after: avoid; }
  .cols > :first-child { margin-top: 0; }
  .cols .col-span { column-span: all; }
  .cols > div { margin-bottom: 1.4em; }
  .cols > div > h3:first-child { margin-top: 0; }
  .cols .legal { grid-template-columns: 170px 1fr; }
}
.hero h1 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(2.5rem, 1.4rem + 5vw, 5rem); line-height: 1.02; letter-spacing: var(--display-tracking); margin-bottom: .35em; }
.hero h1 em { font-style: var(--em-style); color: var(--accent-2); }
.lead { font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem); color: var(--muted); max-width: var(--measure); }

.search { position: relative; margin-top: 32px; max-width: var(--measure); }
.search input {
  width: 100%; height: 68px; padding: 0 64px 0 58px;
  font: inherit; font-size: 1.2rem; color: var(--text);
  background: var(--surface); border: 2px solid var(--border-strong); border-radius: 999px;
  box-shadow: var(--shadow); appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted); opacity: .8; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.search input::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; color: var(--muted); pointer-events: none; }
.search-kbd { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font: 600 .85rem var(--font-sans); color: var(--muted); border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 8px; pointer-events: none; }
.search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.search-clear svg { width: 18px; height: 18px; }
.search-clear[hidden] { display: none; }
.search.has-value .search-kbd { display: none; }
@media (hover: none) { .search-kbd { display: none; } }
.search-help { color: var(--muted); font-size: .9rem; margin: 10px 0 0 24px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; }
.quick-label { color: var(--muted); font-size: .95rem; margin-right: 4px; }
.quick button, .chip {
  border: 1px solid var(--border); background: var(--surface); border-radius: 999px;
  padding: .45em 1em; font-size: .95rem; cursor: pointer; min-height: 40px;
  transition: background .15s, border-color .15s;
}
.quick button:hover, .chip:hover { border-color: var(--border-strong); background: var(--surface-2); }

.results { margin-top: 28px; }
.results:empty { display: none; }
.results-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.results-head p { margin: 0; color: var(--muted); }
.noresult { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 24px; max-width: var(--measure); }
.noresult h3 { font-size: 1.2rem; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 48px 0 0; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; max-width: var(--measure); }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stats div { background: var(--surface); padding: 18px 20px; }
.stats dt { font-size: .85rem; color: var(--muted); order: 2; }
.stats dd { margin: 0; font-family: var(--font-display); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.stats div { display: flex; flex-direction: column-reverse; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: var(--surface-2); }
.section-head { margin-bottom: 36px; }
.section-lead { color: var(--muted); font-size: 1.125rem; }
.prose { }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.callout { background: var(--surface); border-left: 4px solid var(--accent); padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-top: 1.5em; }

.pillars { list-style: none; padding: 0; margin: 32px 0; display: grid; gap: 16px; }
@media (min-width: 720px) { .pillars { grid-template-columns: repeat(3, 1fr); } }
.pillars li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.pillar-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 14px; }
.pillars p { color: var(--muted); margin: 0; }

/* ---------- Démarche ---------- */
.hero-why { max-width: var(--measure); color: var(--muted); font-size: 1rem; border-left: 3px solid var(--logo-red); padding-left: 14px; margin-top: 4px; }
.hero-why a { font-weight: 600; white-space: nowrap; }
.intro-fear { font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + .5vw, 1.35rem); line-height: 1.45; }
.rules { padding: 0; margin: 0 0 8px; list-style: none; counter-reset: r; display: grid; gap: 10px; }
.rules li { counter-increment: r; position: relative; padding: 14px 18px 14px 56px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); }
.rules li::before { content: counter(r); position: absolute; left: 16px; top: 13px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: .9rem; }

/* ---------- Travaux de recherche ---------- */
.research-title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.35rem; margin: 40px 0 16px; }
.research { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
@media (min-width: 720px) { .research { grid-template-columns: repeat(2, 1fr); } }
.research li { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.research p { margin: 0; }
.research li > p:nth-of-type(3) { color: var(--muted); font-size: .97rem; }
.research-who { font-weight: 800; font-size: 1.05rem; }
.research-who span { display: block; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-top: 2px; }
.research-work { font-size: .93rem; }
.research a { margin-top: auto; padding-top: 6px; font-size: .93rem; font-weight: 600; }
.research-nuance { margin: 18px 0 8px; font-size: .97rem; color: var(--muted); }
.research-nuance strong { color: var(--text); }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.chips { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
@media (min-width: 900px) { .chips { flex-wrap: wrap; overflow: visible; } }
.chip { white-space: nowrap; flex-shrink: 0; }
/* Bloc justifié : app.js répartit les boutons en lignes équilibrées (au moins 5 par ligne) */
.chip-break { flex-basis: 100%; height: 0; }
.chips.is-balanced .chip { flex: 1 1 auto; text-align: center; }
@media (min-width: 900px) { .chip { font-size: .88rem; padding: .4em .7em; } }
.chip[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .n { opacity: .6; font-size: .85em; margin-left: 4px; }
.filters-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.select { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 600; flex: 1 1 200px; max-width: 280px; }
.select select { font: inherit; font-size: 1rem; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); height: 46px; padding: 0 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 46px; cursor: pointer; font-size: .97rem; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); font-weight: 600; cursor: pointer; text-decoration: none; font-size: .97rem;
}
.btn svg { width: 18px; height: 18px; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: .18em; font-size: .95rem; }
.count { color: var(--muted); margin: 0 0 16px; font-weight: 600; }

/* ---------- Fiches ---------- */
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s; scroll-margin-top: 100px; min-width: 0;
}
.card:hover { border-color: var(--border-strong); }
.card.is-done { background: color-mix(in srgb, var(--good-soft) 55%, var(--surface)); border-color: color-mix(in srgb, var(--good) 35%, var(--border)); }
.card.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--focus); } 100% { box-shadow: var(--shadow); } }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.card-cat { font-size: .82rem; color: var(--muted); font-weight: 600; }
.card h3 { font-size: 1.2rem; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.owner-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer;
}
.owner-btn:hover { border-color: var(--border-strong); }
.owner-btn .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.owner-btn .who small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.owner-btn .who strong { font-size: 1rem; overflow-wrap: anywhere; }
.owner-btn .tier { margin-left: auto; flex-shrink: 0; }
.owner-btn svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.tier { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; padding: .25em .7em; border-radius: 999px; white-space: nowrap; }
.tier::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.t1 { color: var(--t1); background: var(--t1-soft); }
.t2 { color: var(--t2); background: var(--t2-soft); }
.t3 { color: var(--t3); background: var(--t3-soft); }
.t0 { color: var(--t0); background: var(--t0-soft); }
.t4 { color: var(--muted); background: var(--surface-2); }
.card-note { font-size: .95rem; color: var(--muted); margin: 0; }
.alts h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--good); margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.alts h4 svg { width: 16px; height: 16px; stroke-width: 2.6; }
.alts ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.alt { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 3px solid var(--good-soft); }
.alt-name { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.alt-name a { color: var(--text); text-decoration-color: var(--border-strong); }
.alt-name a:hover { color: var(--accent); }
.alt-name a::after { content: " ↗"; color: var(--muted); font-weight: 400; font-size: .85em; }
.alt p { margin: 0; font-size: .93rem; color: var(--muted); line-height: 1.45; }
.tag { font-size: .72rem; font-weight: 700; padding: .12em .55em; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag-gratuit { background: var(--good-soft); color: var(--good); }
.tag-public { background: var(--accent-soft); color: var(--accent); }
.tag-coop { background: var(--t2-soft); color: var(--t2); }
.alts-more { margin-top: 4px; }
.card-foot { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.done-btn {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1.5px solid var(--border-strong); background: transparent; cursor: pointer; font-weight: 600; font-size: .95rem;
}
.done-btn svg { width: 18px; height: 18px; stroke-width: 2.6; }
.done-btn[aria-pressed="true"] { background: var(--good); border-color: var(--good); color: var(--surface); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: transparent; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }

.legend { display: grid; gap: 8px; margin-top: 32px; font-size: .93rem; color: var(--muted); }
@media (min-width: 900px) { .legend { grid-template-columns: repeat(2, 1fr); } }
.legend p { margin: 0; }
.legend .tier { margin-right: 6px; }
.more-wrap { text-align: center; margin-top: 24px; }

/* ---------- Propriétaires ---------- */
.owners { display: grid; gap: 12px; }
@media (min-width: 640px) { .owners { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .owners { grid-template-columns: repeat(3, 1fr); } }
.owner-card {
  text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s;
}
.owner-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.owner-card h3 { margin: 0; font-size: 1.1rem; }
.owner-card p { margin: 0; color: var(--muted); font-size: .93rem; }
.owner-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font-size: .88rem; color: var(--muted); font-weight: 600; }

/* ---------- Trop cher ---------- */
.tips { list-style: none; padding: 0; margin: 0 0 40px; display: grid; gap: 16px; }
@media (min-width: 720px) { .tips { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tips { grid-template-columns: repeat(3, 1fr); } }
.tips li { background: var(--surface); border-radius: var(--radius); padding: 22px; border: 1px solid var(--border); }
.tips h3 { color: var(--good); }
.tips p { margin: 0; color: var(--muted); }
.manifesto { font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); line-height: 1.5; border-top: 2px solid var(--text); padding-top: 28px; }

.constitution { margin: 8px 0 0; padding: 22px 26px; background: var(--surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--logo-red); border-radius: var(--radius); }
.constitution p { margin: 0 0 12px; font-style: italic; }
.constitution footer { font-family: var(--font-sans); font-size: .9rem; color: var(--muted); }

/* ---------- Progression ---------- */
.progress-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.progress-big { font-family: var(--font-display); font-size: clamp(2rem, 1.5rem + 2vw, 3rem); font-weight: 600; line-height: 1.1; margin-bottom: .3em; }
.bar { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 16px 0 20px; }
.bar span { display: block; height: 100%; background: var(--good); border-radius: 999px; transition: width .5s ease; }
.done-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; }
.done-list li { background: var(--good-soft); color: var(--good); border-radius: 999px; padding: .3em .4em .3em .9em; font-weight: 600; font-size: .93rem; display: flex; align-items: center; gap: 4px; }
.done-list button { border: 0; background: transparent; color: inherit; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.done-list button:hover { background: color-mix(in srgb, var(--good) 18%, transparent); }
.done-list svg { width: 14px; height: 14px; }
.progress-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Transparence ---------- */
.sources { margin-top: 2em; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 20px; }
.sources summary { cursor: pointer; font-weight: 700; padding: 14px 0; min-height: 44px; }
.sources ul { padding-left: 1.2em; font-size: .93rem; }

/* ---------- Mentions légales ---------- */
.legal { display: grid; grid-template-columns: 1fr; gap: 4px 24px; margin: 0 0 1em; }
@media (min-width: 640px) { .legal { grid-template-columns: 240px 1fr; } }
.legal dt { font-weight: 700; color: var(--muted); font-size: .93rem; margin-top: 10px; }
.legal dd { margin: 0; }
@media (min-width: 640px) { .legal dd { margin-top: 10px; } }
.todo { background: var(--t2-soft); color: var(--t2); font-weight: 700; font-size: .85em; padding: .1em .5em; border-radius: var(--radius-sm); }

/* ---------- Pied de page ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: .93rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between; }
.footer p { margin: 0; }

/* ---------- Fenêtre propriétaire ---------- */
.dialog {
  border: 0; padding: 0; border-radius: 20px; background: var(--surface); color: var(--text);
  width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(10, 12, 14, .55); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop .22s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-inner { padding: 28px; overflow: auto; max-height: calc(100vh - 48px); }
@media (max-width: 600px) { .dialog { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 20px 20px 0 0; } .dialog-inner { padding: 22px 18px 28px; max-height: 92vh; } }
.dlg-close { position: sticky; top: 0; float: right; margin: -8px -8px 0 8px; background: var(--surface-2); z-index: 2; }
.dialog h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); margin-top: 8px; }
.dlg-role { color: var(--muted); font-weight: 600; }
.dlg-resume { font-size: 1.1rem; }
.pillar-block { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.pillar-block h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.pillar-block ul { padding-left: 1.1em; margin: 0; }
.pillar-block li { margin-bottom: .5em; }
.dlg-brands { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.dlg-brands li { background: var(--surface-2); border-radius: 999px; padding: .2em .8em; font-size: .9rem; }
.dlg-note { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: .88rem; color: var(--muted); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- Notification ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 200;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Touches « journal » ---------- */
.card, .pillars li, .owner-card, .progress-card { border-color: var(--border-strong); }
.section-head h2 { border-top: 3px solid var(--text); padding-top: .4em; }

/* ---------- Impression : liste de courses compacte ---------- */
@media print {
  .topbar, .hero, .section:not(#catalogue), .filters, .footer, .card-foot, .legend, .dialog, .toast, .more-wrap, .section-head .section-lead { display: none !important; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .section { padding: 0; } .section-alt { background: #fff; }
  .grid { display: block; columns: 2; column-gap: 16px; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #bbb; padding: 8px 10px; margin-bottom: 8px; gap: 4px; background: #fff !important; }
  .alt p, .card-note, .owner-btn svg, .tag { display: none; }
  .owner-btn { background: none; padding: 0; }
  .alt-name a::after { content: ""; }
  a { color: #000; text-decoration: none; }
}
