:root {
  --fond: #f6f7f9; --carte: #fff; --texte: #1d2129; --doux: #6b7280;
  --bord: #e5e7eb; --accent: #2563eb; --accent-fond: #e8efff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #0f1115; --carte: #181b21; --texte: #e6e8eb; --doux: #9aa1ab;
          --bord: #2a2f37; --accent: #6b9bff; --accent-fond: #1d2a45; }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
       background: var(--fond); color: var(--texte); line-height: 1.5; }
header, main { max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; }
header { padding-top: 2.5rem; padding-bottom: 1rem; }
h1 { margin: 0; font-size: 1.8rem; }
#compteur { margin: .25rem 0 1rem; color: var(--doux); }
#recherche { width: 100%; padding: .7rem .9rem; font-size: 1rem; border-radius: 10px;
             border: 1px solid var(--bord); background: var(--carte); color: var(--texte); }
#recherche:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.tag { font: inherit; font-size: .85rem; padding: .2rem .7rem; border-radius: 999px;
       border: 1px solid var(--bord); background: var(--carte); color: var(--doux); cursor: pointer; }
button.tag:hover, .tag.actif { border-color: var(--accent); color: var(--accent); background: var(--accent-fond); }
.tag.petit { font-size: .75rem; padding: .05rem .55rem; cursor: default; }
.grille { list-style: none; padding: 0; margin: 1rem 0 3rem; display: grid; gap: 1rem;
          grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px;
         padding: 1rem 1.1rem; position: relative; transition: border-color .15s, transform .15s; }
.carte:hover { border-color: var(--accent); transform: translateY(-2px); }
.carte a { display: flex; align-items: center; gap: .6rem; color: var(--texte);
           text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.carte a::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.icone { width: 22px; height: 22px; border-radius: 4px; }
.domaine { display: block; color: var(--doux); font-size: .85rem; margin-top: .15rem; }
.description { margin: .5rem 0 0; font-size: .92rem; }
.carte .tags { margin-top: .6rem; }
#vide { color: var(--doux); text-align: center; padding: 2rem 0; }
