/* =====================================================================
   Portail Autisme — feuille de style.
   Palette Artisan Digital + design "accessibilité d'abord" :
   contrastes élevés, cibles tactiles larges (>=44px), focus visible,
   réduction des animations, respect de prefers-color-scheme.
   ===================================================================== */

:root {
  --ad-black:  #0e0e10;
  --ad-blue:   #2173d0;
  --ad-light:  #5bc0f8;
  --bg:        #f6f8fb;
  --surface:   #ffffff;
  --text:      #15181d;
  --muted:     #5b6470;
  --border:    #d8dee7;
  --ok:        #1c7a4a;
  --error:     #b3261e;
  --radius:    14px;
  --maxw:      1040px;
  --focus:     #1558b0;
}

/* Variables sombres : appliquées soit par choix explicite (data-theme="dark"),
   soit par préférence système quand l'utilisateur n'a pas choisi. */
:root[data-theme="dark"] {
  --bg: #0e0e10; --surface: #181a1f; --text: #eef1f5;
  --muted: #9aa4b2; --border: #2a2e36; --focus: #5bc0f8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0e0e10; --surface: #181a1f; --text: #eef1f5;
    --muted: #9aa4b2; --border: #2a2e36; --focus: #5bc0f8;
  }
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

a { color: var(--ad-blue); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ad-blue); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1.25rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text); font-weight: 700; min-width: 0; }
.brand-logo { display: inline-flex; align-items: center; }
/* Le logo contient déjà le wordmark : on le laisse respirer (ratio ~1.93). */
.brand-logo img { display: block; height: 40px; width: auto; max-width: 160px; object-fit: contain; }
.brand-sep { width: 1px; height: 26px; background: var(--border); flex: 0 0 auto; }
.brand-product { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; color: var(--muted); white-space: nowrap; }
/* En dark mode, le texte noir du logo a besoin d'un fond clair pour rester lisible. */
:root[data-theme="dark"] .brand-logo,
:root[data-theme="dark"] .footer-brand { background: #fff; border-radius: 10px; padding: .25rem .5rem; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .brand-logo,
  :root:not([data-theme="light"]):not([data-theme="dark"]) .footer-brand { background: #fff; border-radius: 10px; padding: .25rem .5rem; }
}

/* Boutons d'icône (thème) */
.icon-btn {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text); cursor: pointer; font-size: 1.1rem;
}
.icon-btn:hover { border-color: var(--ad-blue); }
.theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .theme-icon-dark { display: none; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .theme-icon-light { display: inline; }
}
.header-tools { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.lang-switch {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0 .6rem; min-width: 44px; min-height: 44px; display: grid; place-items: center;
  text-decoration: none; font-weight: 700; color: var(--text);
}

/* Hamburger */
.nav-toggle { display: none; }
.burger, .burger::before, .burger::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--text);
  border-radius: 2px; transition: transform .2s, opacity .2s;
}
.burger { position: relative; }
.burger::before { position: absolute; top: -6px; }
.burger::after  { position: absolute; top: 6px; }
body.nav-open .nav-toggle .burger { background: transparent; }
body.nav-open .nav-toggle .burger::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle .burger::after  { transform: translateY(-6px) rotate(-45deg); }

.main-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.main-nav a, .nav-voice {
  padding: .55rem .8rem; border-radius: 10px; text-decoration: none;
  color: var(--text); font-weight: 600; background: transparent; border: 0; cursor: pointer; font: inherit;
}
.main-nav a:hover, .nav-voice:hover { background: rgba(33,115,208,.10); }
.main-nav a[aria-current="page"] { background: var(--ad-blue); color: #fff; }
.nav-voice { display: none; } /* visible uniquement dans le tiroir mobile */
.nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; border: 0; }

/* Desktop : nav en barre entre le logo et les outils */
@media (min-width: 861px) {
  .site-header { flex-wrap: nowrap; }
  .main-nav { order: 1; margin-left: 1rem; margin-right: auto; }
  .header-tools { order: 2; margin-left: 0; }
}

/* Mobile : header compact + nav en tiroir latéral */
@media (max-width: 860px) {
  .brand-sep, .brand-product { display: none; }
  .brand-logo img { height: 34px; }
  .nav-toggle { display: inline-grid; }
  .main-nav {
    position: fixed; top: 0; right: 0; z-index: 60;
    height: 100dvh; width: min(82vw, 320px);
    flex-direction: column; gap: .2rem; align-items: stretch;
    background: var(--surface); border-left: 1px solid var(--border);
    padding: 4.75rem 1rem 1.5rem; overflow-y: auto;
    transform: translateX(100%); transition: transform .22s ease;
    box-shadow: -8px 0 30px rgba(0,0,0,.2);
  }
  body.nav-open .main-nav { transform: translateX(0); }
  .main-nav a, .nav-voice { padding: .95rem 1rem; font-size: 1.05rem; text-align: left; }
  .nav-voice { display: block; margin-top: .4rem; border-top: 1px solid var(--border); border-radius: 0; }
  body.nav-open { overflow: hidden; } /* évite le scroll derrière le tiroir */
}
@media (prefers-reduced-motion: reduce) { .main-nav { transition: none; } }

/* Groupe « Mon espace » (dropdown desktop / liste mobile) */
.nav-group { position: relative; display: flex; align-items: center; }
.nav-sub-toggle {
  font: inherit; font-weight: 600; color: var(--text); background: transparent; border: 0;
  cursor: pointer; padding: .55rem .8rem; border-radius: 10px; display: inline-flex; gap: .3rem; align-items: center;
}
.nav-sub-toggle:hover { background: rgba(33,115,208,.10); }
.nav-group.is-active .nav-sub-toggle { background: var(--ad-blue); color: #fff; }
.nav-sub a { display: block; color: var(--text); text-decoration: none; font-weight: 600; }
.nav-sub a:hover { background: rgba(33,115,208,.10); }
@media (min-width: 861px) {
  .nav-sub {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 8px 24px rgba(14,14,16,.16); padding: .35rem; display: none; z-index: 70;
  }
  .nav-sub.open { display: block; }
  .nav-sub a { padding: .6rem .8rem; border-radius: 8px; }
}
@media (max-width: 860px) {
  .nav-group { flex-direction: column; align-items: stretch; }
  .nav-sub-toggle { display: none; }
  .nav-sub a { padding: .95rem 1rem; font-size: 1.05rem; border-radius: 10px; }
}

/* Compte (connexion / déconnexion) dans la nav */
.nav-account { display: inline-flex; align-items: center; gap: .35rem; }
@media (min-width: 861px) { .nav-account { margin-left: auto; } }
.nav-acct-login { background: var(--ad-blue); color: #fff !important; padding: .5rem .95rem; border-radius: 10px; font-weight: 700; text-decoration: none; }
.nav-acct-login:hover { background: #1a5fb0; }
.nav-acct-me, .nav-acct-logout { text-decoration: none; color: var(--text); font-weight: 600; padding: .5rem .7rem; border-radius: 10px; white-space: nowrap; }
.nav-acct-me:hover, .nav-acct-logout:hover { background: rgba(33,115,208,.10); }
.nav-acct-logout { color: var(--error); }
@media (max-width: 860px) {
  .nav-account { flex-direction: column; align-items: stretch; margin-top: .5rem; border-top: 1px solid var(--border); padding-top: .5rem; }
  .nav-acct-login { text-align: center; }
  .nav-acct-me, .nav-acct-logout { padding: .95rem 1rem; font-size: 1.05rem; }
}

/* Bandeau beta (visible sur toutes les pages) */
.beta-strip {
  background: linear-gradient(135deg, rgba(33,115,208,.13), rgba(91,192,248,.10));
  border-bottom: 1px solid var(--border); color: var(--text);
  font-size: .85rem; text-align: center; padding: .45rem 1rem;
}
.beta-strip a { color: var(--ad-blue); font-weight: 700; }

.site-footer {
  margin-top: 3.5rem; padding: 2rem 1.25rem; display: grid; gap: .9rem;
  border-top: 1px solid var(--border); background: var(--surface);
  text-align: center; color: var(--muted); font-size: .9rem;
}
.site-footer a { color: var(--muted); }
.footer-links { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }
.footer-links a { font-weight: 600; }
.footer-brand { display: inline-block; margin: .25rem auto 0; opacity: .9; }
.footer-brand img { height: 54px; width: auto; }
.disclaimer { max-width: 65ch; margin-inline: auto; }
.credit { font-size: .82rem; }
.service-free { font-weight: 700; color: var(--ad-blue); margin: 0; }

/* ---------- Layout ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.25rem; }
h1 { font-size: 1.9rem; line-height: 1.2; }
h2 { font-size: 1.3rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.narrow { max-width: 640px; margin-inline: auto; }

/* ---------- Hero / cards ---------- */
.hero {
  position: relative; overflow: hidden;
  margin: .5rem 0 2rem; padding: 2.75rem 2rem;
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(91,192,248,.28), transparent 55%),
    linear-gradient(135deg, rgba(33,115,208,.12), rgba(91,192,248,.06));
  border: 1px solid var(--border);
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.9rem); max-width: 20ch; margin-top: 0;
  background: linear-gradient(120deg, var(--ad-blue), var(--ad-light));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { max-width: 56ch; color: var(--text); opacity: .82; }
.trust {
  display: inline-block; margin-top: 1.25rem; color: var(--muted);
  font-size: .9rem; background: var(--surface); border: 1px solid var(--border);
  padding: .4rem .8rem; border-radius: 999px;
}

.cards-grid {
  display: grid; gap: 1rem; margin-top: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.cards-list { list-style: none; padding: 0; display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.card.feature {
  position: relative; text-decoration: none; color: var(--text); display: block;
  overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card.feature::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--ad-blue), var(--ad-light));
  opacity: 0; transition: opacity .15s;
}
.card.feature:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(14,14,16,.12); border-color: var(--ad-light); }
.card.feature:hover::before { opacity: 1; }
.card .ico {
  display: inline-grid; place-items: center; width: 52px; height: 52px;
  font-size: 1.6rem; border-radius: 14px; margin-bottom: .5rem;
  background: linear-gradient(135deg, rgba(33,115,208,.16), rgba(91,192,248,.16));
}
.card.empty { text-align: center; color: var(--muted); }

.callout {
  background: rgba(91,192,248,.14); border: 1px solid var(--ad-light);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0;
}
.callout.error { background: rgba(179,38,30,.10); border-color: var(--error); color: var(--error); }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
label { font-weight: 600; display: block; margin-bottom: .35rem; }
input, select, textarea {
  font: inherit; width: 100%; padding: .7rem .8rem;
  border: 2px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
.help { color: var(--muted); font-size: .9rem; margin: .15rem 0 .4rem; font-weight: 400; }
.filters-grid, .grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); }
.grid2 .full, .actions.full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; }
.check input { width: auto; min-height: 0; margin-right: .5rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 1rem; padding: 1rem 1.25rem; }
legend { font-weight: 700; padding: 0 .4rem; }

/* Voice field */
.voice-field { display: flex; gap: .5rem; align-items: flex-start; }
.voice-field input, .voice-field textarea { flex: 1; }
.mic {
  flex: 0 0 auto; min-width: 48px; min-height: 48px;
  border: 2px solid var(--ad-blue); background: var(--surface); color: var(--ad-blue);
  border-radius: 12px; font-size: 1.2rem; cursor: pointer;
}
.mic.listening { background: var(--ad-blue); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(33,115,208,.5);} 50% { box-shadow: 0 0 0 8px rgba(33,115,208,0);} }
.mic.unavailable { display: none; }

/* Champ photo / caméra (smartphone) */
.photo-field { display: grid; gap: .5rem; }
.photo-btn {
  display: inline-flex; align-items: center; gap: .5rem; align-self: start;
  border: 2px dashed var(--ad-blue); background: rgba(33,115,208,.06);
  color: var(--ad-blue); border-radius: 12px; padding: .7rem 1rem;
  font: inherit; font-weight: 700; cursor: pointer; min-height: 44px;
}
.photo-btn:hover { background: rgba(33,115,208,.12); }
.photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.photo-preview { display: flex; gap: .5rem; flex-wrap: wrap; }
.photo-preview img { height: 72px; width: auto; border-radius: 8px; border: 1px solid var(--border); }
.photo-name { font-size: .85rem; color: var(--muted); }

/* Radio cards */
.radio-cards { display: grid; gap: .6rem; }
.radio-card {
  display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem;
  border: 2px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 600;
}
.radio-card input { width: auto; min-height: 0; }
.radio-card:has(input:checked) { border-color: var(--ad-blue); background: rgba(33,115,208,.08); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-ghost {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
  padding: .7rem 1.1rem; border-radius: 12px; text-decoration: none; min-height: 44px;
  border: 2px solid transparent;
}
.btn-primary { background: linear-gradient(135deg, var(--ad-blue), #2e8be6); color: #fff; box-shadow: 0 2px 10px rgba(33,115,208,.30); }
.btn-primary:hover { background: linear-gradient(135deg, #1a5fb0, #2173d0); box-shadow: 0 4px 16px rgba(33,115,208,.40); }
.btn-ghost { background: transparent; color: var(--ad-blue); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--ad-blue); }
.btn-lg { font-size: 1.05rem; padding: .85rem 1.4rem; }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

/* ---------- Géoloc annuaire ---------- */
.geo-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.geo-row .grow { flex: 1; min-width: 180px; margin: 0; }
.geo-row .btn-primary { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.section-h { margin-top: 2rem; font-size: 1.15rem; color: var(--muted); }
.dist {
  float: right; font-weight: 800; color: var(--ad-blue);
  background: rgba(33,115,208,.10); border-radius: 999px; padding: .15rem .6rem; font-size: .85rem;
}

/* Filtres repliables (annuaire) */
.filters-more { margin: .6rem 0 .2rem; }
.filters-more > summary {
  cursor: pointer; font-weight: 700; padding: .7rem .9rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); min-height: 44px;
  display: flex; align-items: center; gap: .5rem; list-style: none;
}
.filters-more > summary::-webkit-details-marker { display: none; }
.filters-more > summary::after { content: "▾"; margin-left: auto; transition: transform .2s; }
.filters-more[open] > summary::after { transform: rotate(180deg); }
.filters-more[open] { border: 1px solid var(--border); border-radius: 12px; padding: 0 .9rem .8rem; }
.filters-more[open] > summary { border: 0; padding-left: 0; padding-right: 0; }
.filters-more .field { margin-bottom: .9rem; }

/* ---------- Modale « écrire un message » (genmail) ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-box {
  background: var(--surface); color: var(--text); width: 100%; max-width: 640px;
  max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0;
  padding: 1.25rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.3);
}
.modal-box h3 { margin: 0 0 .25rem; }
.modal-box textarea { width: 100%; min-height: 220px; margin-top: .6rem; }
.modal-box .card-actions { position: sticky; bottom: 0; background: var(--surface); padding-top: .7rem; margin-top: .3rem; }
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 1rem; }
  .modal-box { border-radius: 16px; }
}

/* ---------- Carte (Leaflet) + fiche détail + export ---------- */
.annuaire-map { height: 320px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); margin: 1rem 0; }
.map-pin { display: block; width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.map-you { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--ad-blue); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--ad-blue); }
.map-pop { font-size: .9rem; min-width: 170px; }
.map-pop .btn-sm { margin-top: .4rem; }
.map-tel { display: inline-block; margin: .2rem 0; }
.map-legend { background: var(--surface); color: var(--text); padding: .4rem .5rem; border-radius: 8px; font-size: .75rem; box-shadow: 0 1px 5px rgba(0,0,0,.25); display: grid; gap: .15rem; }
.map-legend .leg { display: flex; align-items: center; gap: .3rem; }
.map-legend .leg i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.btn-sm { padding: .4rem .7rem; min-height: 0; font-size: .85rem; }
.export-toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin: .25rem 0 1rem; }
.card .card-actions, .specialist-detail .card-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.specialist-detail .kv { margin: 1rem 0; }
.email-tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; margin-left: .4rem; }
.email-tag.ok { background: rgba(28,122,74,.16); color: var(--ok); }
.email-tag.warn { background: rgba(217,119,6,.16); color: #b06a00; }
.contrib { margin-top: 1.25rem; }
.contrib-box { border: 1px solid var(--border); border-radius: 12px; padding: 0 .9rem .6rem; }
.contrib-box > summary { cursor: pointer; font-weight: 700; padding: .85rem 0; }
.contrib-form { margin: .6rem 0; }
.contrib-form label { display: block; margin-bottom: .3rem; }

/* ---------- Specialist / plan ---------- */
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .2rem .55rem;
  border-radius: 999px; background: rgba(33,115,208,.12); color: var(--ad-blue); margin-bottom: .4rem; }
.specialist .meta { color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .15rem .8rem; margin: .6rem 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.results-count { font-weight: 700; margin-top: 1.5rem; }

.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: .8rem; }
.steps li { display: flex; gap: .8rem; align-items: flex-start; }
.steps li.is-done .step-title { text-decoration: line-through; color: var(--muted); }
.step-n {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ad-blue); color: #fff; font-weight: 700;
  display: grid; place-items: center;
}
.step-title { font-weight: 600; margin: 0; }

.checklist { list-style: none; padding: 0; display: grid; gap: .5rem; }
.checklist input { width: auto; min-height: 0; margin-right: .6rem; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); }
.table th { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.row-actions { display: flex; gap: .3rem; }
.row-actions button { padding: .35rem .6rem; min-height: 0; font-size: .85rem; }

/* ---------- Beta ---------- */
.beta-badge {
  font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, var(--ad-blue), var(--ad-light));
  padding: .12rem .4rem; border-radius: 999px; align-self: center;
}
.beta-screen { text-align: center; }
.beta-badge-lg { display: inline-block; font-size: .8rem; margin-bottom: .6rem; }
.callout.maint { background: rgba(179,38,30,.10); border-color: var(--error); color: var(--error); font-weight: 700; }

/* ---------- Dashboard ---------- */
.dash-2col { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .dash-2col { grid-template-columns: 1fr; } }
.switches .switch-row {
  display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 0;
  border-top: 1px solid var(--border); font-weight: 400;
}
.switches .switch-row input { width: 22px; height: 22px; margin-top: .15rem; flex: 0 0 auto; }
.switches .switch-row.danger strong { color: var(--error); }

/* ---------- Admin ---------- */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat b { display: block; font-size: 2rem; color: var(--ad-blue); }
.stat span { color: var(--muted); font-size: .9rem; }
.config-status { list-style: none; padding: 0; display: grid; gap: .4rem; }
.ok { color: var(--ok); font-size: .85rem; }

/* ---------- Zéro clavier : chips, capture, FAB ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-block; padding: .7rem 1.1rem; border-radius: 999px;
  border: 2px solid var(--border); background: var(--surface); font-weight: 700;
  min-height: 44px; line-height: 1.6;
}
.chip input:checked + span { border-color: var(--ad-blue); background: rgba(33,115,208,.12); color: var(--ad-blue); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.import-flow fieldset { border: none; padding: 0; margin: 0 0 1.6rem; }
.import-flow legend { font-size: 1.05rem; font-weight: 800; margin-bottom: .7rem; padding: 0; }

.capture-row { display: grid; gap: .8rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .capture-row { grid-template-columns: 1fr; } }
.capture-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  min-height: 120px; border-radius: 16px; cursor: pointer; font-weight: 800; font-size: 1.05rem;
  border: 2px solid var(--ad-blue);
  background: linear-gradient(135deg, rgba(33,115,208,.14), rgba(91,192,248,.10));
  color: var(--ad-blue); text-align: center; padding: 1rem;
}
.capture-btn span { font-size: 1rem; }
.capture-btn::first-line { font-size: 2.2rem; }
.capture-btn.ghost { background: var(--surface); border-style: dashed; }
.capture-btn:hover { box-shadow: 0 6px 20px rgba(33,115,208,.18); }
.capture-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.doc-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); }
.doc-tile {
  display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: .5rem; background: var(--surface);
}
.doc-tile img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; }
.doc-pdf { font-size: 2.4rem; text-align: center; height: 90px; display: grid; place-items: center; }
.doc-label { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bouton flottant import (surtout mobile) */
.fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.7rem; text-decoration: none;
  background: linear-gradient(135deg, var(--ad-blue), #2e8be6); color: #fff;
  box-shadow: 0 6px 20px rgba(33,115,208,.45);
}
.fab:hover { transform: scale(1.05); }
@media (min-width: 900px) { .fab { display: none; } } /* desktop : la nav suffit */

/* Séparateur "ou" */
.sep-or { display: flex; align-items: center; gap: .8rem; color: var(--muted); margin: 1.25rem 0; }
.sep-or::before, .sep-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Zone danger (suppression de compte) */
.danger-zone { border-color: var(--error); }
.danger-zone h2 { color: var(--error); }

/* ---------- Prose (KB / legal) ---------- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6rem; }
.kb-article { max-width: 70ch; margin-inline: auto; }

/* ---------- Embed (Workbench iframe) ---------- */
body.embed { background: transparent; }
.embed-wrap { padding: 1rem; }
.embed-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .actions, .mic, .filters { display: none !important; }
  .card { border: none; padding: 0; }
  body { background: #fff; }
}
