/* ============================================================
   app.css — espace authentifié Better Searcher.
   Langage "technique" calé sur la landing (rayons serrés via tokens,
   eyebrows mono, séparateurs hairline). Les atomes partagés (.btn,
   .card, .input, .field, .alert, .kbd, .badge, .eyebrow…) vivent dans
   base.css — ici uniquement les composants propres à l'app.
   ============================================================ */

body.page-app { height: 100vh; height: 100dvh; overflow: hidden; } /* dvh : évite le rognage sous la barre Safari iOS */
/* Auth : PAS de lock hauteur/overflow → la page défile si la carte dépasse l'écran
   (boutons sociaux + captcha + erreur). L'app authentifiée (page-app) garde son lock. */
body.page-auth { min-height: 100vh; min-height: 100dvh; }

/* ---------- En-têtes de page ---------- */
.page-head { margin-bottom: clamp(22px, 3vw, 32px); }
.page-head .eyebrow { display: block; margin-bottom: 12px; }
.page-title { margin: 0; font-size: clamp(28px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.02em; }
.page-sub { margin: 9px 0 0; color: var(--muted); font-size: 15px; max-width: 660px; line-height: 1.5; }

/* helpers texte (remplacent les styles inline) */
.meta { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.meta--caps { letter-spacing: 0.1em; }
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }
.input--area { font-family: var(--font-sans); resize: vertical; }
.card--narrow { max-width: 620px; }
.section-div { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }

/* ---------- Shell ---------- */
.shell { display: flex; height: 100%; }
.sidebar { flex: none; width: 268px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.region { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.region__bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; opacity: .6;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 72% -10%, #000 28%, transparent 82%);
  mask-image: radial-gradient(ellipse 120% 90% at 72% -10%, #000 28%, transparent 82%); }
.region__bg::before, .region__bg::after { content: ""; position: absolute; width: 1px; height: 70%; top: -12%; background: linear-gradient(transparent, color-mix(in oklch, var(--accent) 55%, transparent), transparent); filter: blur(.5px); opacity: .35; }
.region__bg::before { left: 58%; transform: rotate(33deg); }
.region__bg::after  { left: 82%; height: 50%; transform: rotate(33deg); opacity: .22; }
.content { position: relative; flex: 1; overflow-y: auto; padding: clamp(22px, 3vw, 40px) clamp(18px, 3.4vw, 46px) 72px; }
.content--flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.content__inner { max-width: 1180px; margin: 0 auto; }

.region__menu { display: none; }
.shell__scrim { display: none; }

/* ---------- Sidebar ---------- */
.sidebar__brand { flex: none; padding: 18px 18px 14px; }
.sidebar__brand .bs-brand { gap: 11px; }
.sidebar__brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.sidebar__brand-sub { font-size: 9px; letter-spacing: 0.34em; color: var(--faint); margin-top: 2px; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 4px 12px; display: flex; flex-direction: column; gap: 2px; }
.snav__group { margin: 16px 8px 8px; font-size: 9.5px; letter-spacing: 0.16em; color: var(--faint); }
.snav__group:first-child { margin-top: 4px; }
.snav__link { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-size: 13.5px; transition: background .15s, color .15s; }
.snav__link:hover { background: var(--surface2); color: var(--text); }
.snav__link.is-active { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.snav__ic { flex: none; opacity: .92; }
.snav__label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snav__badge { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-sm); background: var(--accent); color: var(--bg); font-family: var(--font-mono); font-size: 10px; display: inline-flex; align-items: center; justify-content: center; }

.sidebar__foot { flex: none; border-top: 1px solid var(--border); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sidebar__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* .langtoggle — composant partagé (sidebar + header de la landing) → défini dans base.css */
.sidebar__collapse { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: none; color: var(--faint); font-size: 12px; cursor: pointer; padding: 4px; }
.sidebar__collapse:hover { color: var(--text); }
.sidebar__collapse-ic { display: inline-block; transition: transform .2s; }
.sidebar__theme { width: 100%; justify-content: flex-start; }
.usercard { display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px; transition: border-color .15s; }
.usercard:hover { border-color: var(--border2); }
.usercard__main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.usercard__avatar { flex: none; width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--accent); color: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.usercard__id { min-width: 0; display: flex; flex-direction: column; }
.usercard__name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard__mail { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usercard__logout { flex: none; color: var(--faint); padding: 7px; border-radius: var(--r-sm); display: inline-flex; }
.usercard__logout:hover { color: var(--hi); background: var(--surface); }

/* Encart d'upgrade (formule gratuite) — pied de sidebar */
.sidebar__upsell { display: flex; gap: 9px; padding: 11px; border-radius: var(--r-md); text-decoration: none; color: inherit; border: 1px solid color-mix(in oklch, var(--accent) 40%, var(--border)); background: color-mix(in oklch, var(--accent) 9%, var(--surface2)); transition: border-color .15s, transform .15s; }
.sidebar__upsell:hover { border-color: var(--accent); transform: translateY(-1px); }
.sidebar__upsell-ic { flex: none; color: var(--accent); margin-top: 1px; }
.sidebar__upsell-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sidebar__upsell-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.sidebar__upsell-body { font-size: 11px; color: var(--muted); line-height: 1.35; }
.sidebar__upsell-cta { font-size: 10px; letter-spacing: 0.04em; color: var(--accent); margin-top: 2px; }

@media (min-width: 981px) {
  .shell.is-collapsed .sidebar { width: 76px; }
  .shell.is-collapsed .snav__label,
  .shell.is-collapsed .snav__group,
  .shell.is-collapsed .snav__badge,
  .shell.is-collapsed .sidebar__brand-txt,
  .shell.is-collapsed .usercard__id,
  .shell.is-collapsed .usercard__logout,
  .shell.is-collapsed .langtoggle,
  .shell.is-collapsed .sidebar__upsell,
  .shell.is-collapsed .sidebar__theme .label,
  .shell.is-collapsed .sidebar__collapse .snav__label { display: none; }
  .shell.is-collapsed .snav__link,
  .shell.is-collapsed .sidebar__theme,
  .shell.is-collapsed .sidebar__row { justify-content: center; }
  .shell.is-collapsed .usercard__main { justify-content: center; }
  .shell.is-collapsed .sidebar__collapse-ic { transform: rotate(180deg); }
}

/* ---------- Dashboard ---------- */
.topbanner { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); padding: 14px 18px; margin-bottom: clamp(20px, 3vw, 30px); }
.topbanner__ic { flex: none; color: var(--accent); display: inline-flex; }
.topbanner__txt { flex: 1; font-size: 14px; color: var(--muted); }
.topbanner__txt b { color: var(--text); font-weight: 600; }
.topbanner__close { flex: none; background: transparent; border: none; color: var(--faint); cursor: pointer; font-size: 16px; line-height: 1; padding: 4px; border-radius: var(--r-sm); }
.topbanner__close:hover { color: var(--text); background: var(--surface2); }

/* Bannière mode démo (lecture seule) — bandeau plein cadre au-dessus du contenu */
.demobanner { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px clamp(16px, 3vw, 28px); background: color-mix(in oklch, var(--accent) 12%, var(--surface)); border-bottom: 1px solid color-mix(in oklch, var(--accent) 32%, var(--border)); z-index: 30; }
.demobanner__ic { flex: none; color: var(--accent); display: inline-flex; }
.demobanner__txt { flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.demobanner__actions { flex: none; display: flex; align-items: center; gap: 14px; }
.demobanner__actions .btn { padding: 6px 13px; font-size: 12.5px; }
.demobanner__exit { font-size: 12px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.demobanner__exit:hover { color: var(--text); text-decoration: underline; }
.demobanner.is-flash { animation: bs-demoflash .9s ease; }
@keyframes bs-demoflash { 0%,100% { background: color-mix(in oklch, var(--accent) 12%, var(--surface)); } 30% { background: color-mix(in oklch, var(--accent) 30%, var(--surface)); } }
@media (max-width: 700px) { .demobanner__txt { font-size: 12px; } .demobanner__exit { display: none; } }

.search-hero { margin-top: clamp(20px, 3vw, 30px); border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-lg); padding: clamp(16px, 2vw, 22px); }
.search-row { display: flex; gap: 12px; align-items: stretch; }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--r); padding: 0 16px; height: 60px; transition: border-color .15s, box-shadow .15s; }
.search-field:hover { border-color: color-mix(in oklch, var(--accent) 30%, var(--border2)); }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 14%, transparent); }
.search-field svg { flex: none; color: var(--faint); }
.search-field input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text); font-family: var(--font-mono); font-size: 15px; }
.search-field input::placeholder { color: var(--faint); }
.search-go { flex: none; display: inline-flex; align-items: center; gap: 9px; background: var(--accent); color: var(--bg); border: none; border-radius: var(--r); padding: 0 24px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s, transform .15s ease, box-shadow .2s; }
.search-go:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 6px 18px -9px color-mix(in oklch, var(--accent) 75%, transparent); }
.search-go:active { transform: translateY(0); }
.search-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.search-meta__l { color: var(--faint); font-size: 13px; }
.search-meta__r { display: flex; align-items: center; gap: 16px; color: var(--faint); font-size: 12px; }
.search-meta__r.is-center { justify-content: center; }
.chip { border: 1px solid var(--border2); background: transparent; color: var(--muted); border-radius: var(--r-sm); padding: 8px 16px; font-size: 13px; cursor: pointer; transition: color .15s, border-color .15s, background .15s, transform .15s ease; }
.chip:hover { color: var(--text); border-color: var(--text); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }
.chip.is-on { background: var(--surface2); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); border-color: transparent; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: clamp(28px, 4vw, 48px); }
.stats--flush { margin-top: 0; }
.stat { padding: 4px 22px; }
.stat:first-child { padding-left: 4px; }
.stat:not(:first-child) { border-left: 1px solid var(--border); }
.stat__label { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; }
.stat__label svg { color: var(--faint); }
.stat__num { margin-top: 14px; font-size: clamp(32px, 3.4vw, 44px); font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat__num--word { font-size: clamp(26px, 3vw, 38px); text-transform: uppercase; }
/* Tuile « Formule » cliquable → upgrade (dashboard, utilisateur gratuit) */
.stat--cta { display: block; text-decoration: none; color: inherit; border-radius: var(--r-sm); transition: background .15s; }
.stat--cta:hover { background: color-mix(in oklch, var(--accent) 8%, transparent); }
.stat--cta:hover .stat__num { color: var(--accent); }
.stat__upgrade { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }

/* ---------- Recherche avancée ---------- */
.adv { display: grid; grid-template-columns: 460px 1fr; gap: clamp(24px, 3vw, 48px); align-items: start; }
.adv__form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(18px, 2vw, 26px); }
.adv__group { border: none; margin: 0; padding: 0; }
.adv__group + .adv__group { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.adv__group-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.16em; color: var(--faint); margin-bottom: 12px; }
.adv__empty { align-self: center; text-align: center; padding: 40px 20px; }
.adv__empty-ic { margin: 0 auto 22px; width: 72px; height: 72px; border-radius: var(--r-md); border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; color: var(--faint); }
.adv__empty h2 { margin: 0; font-size: 22px; font-weight: 600; }
.adv__empty p { margin: 12px auto 18px; max-width: 360px; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ---------- Formules & tarifs ----------
   Déplacé dans assets/css/plans.css (composant partagé landing + /pricing).
   Chargé via $page_css sur les deux pages. */

/* ---------- Statut de paiement (checkout) ---------- */
.checkout-status { max-width: 460px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 40px 28px; }
.checkout-status svg { color: var(--accent); }
.checkout-status--activated svg { color: var(--ok); }
.checkout-status h2 { margin: 0; font-size: 20px; }
.checkout-status p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 34ch; }
.checkout-status .btn { margin-top: 8px; }
.checkout-status__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ---------- Panneau abonnement (account) ---------- */
.billing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 4px 0 16px; }
.billing-cell { display: flex; flex-direction: column; gap: 3px; }
.billing-cell__lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.billing-cell__val { font-size: 14px; font-weight: 600; }
.billing-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 560px) { .billing-grid { grid-template-columns: 1fr; } }

/* ---------- Listes (historique / favoris / notifications) ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.listrow { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 13px 15px; text-decoration: none; color: inherit; transition: border-color .15s, background .15s, transform .15s ease, box-shadow .2s; }
a.listrow:hover { border-color: var(--border2); background: var(--surface2); transform: translateY(-1px); box-shadow: var(--shadow); }
a.listrow:active { transform: translateY(0); }
.listrow__ic { flex: none; width: 38px; height: 38px; border-radius: var(--r); background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.listrow__ic.is-unread { background: var(--accent); color: var(--bg); }
.listrow__body { flex: 1; min-width: 0; }
a.listrow__body { text-decoration: none; color: inherit; }
.note { margin: 0; font-size: 13.5px; color: var(--muted); }
.note--accent { color: var(--text); padding: 11px 13px; border-radius: var(--r-sm); border: 1px solid color-mix(in oklch, var(--accent) 35%, var(--border)); background: color-mix(in oklch, var(--accent) 7%, transparent); }
.listrow__top { display: flex; align-items: center; gap: 9px; }
.listrow__title { font-size: 14px; font-weight: 600; }
.listrow__meta { margin-top: 3px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--faint); }
.listrow__sub { margin-top: 3px; font-size: 13px; color: var(--muted); }
.listrow__act { flex: none; display: flex; align-items: center; gap: 8px; }
.tag-new { font-family: var(--font-mono); font-size: 9px; color: var(--accent); letter-spacing: 0.1em; }
.iconbtn { background: transparent; border: 1px solid var(--border); color: var(--faint); border-radius: var(--r-sm); padding: 7px 9px; cursor: pointer; font-size: 12px; transition: color .15s, border-color .15s, background .15s, transform .15s ease; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.iconbtn:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); transform: translateY(-1px); }
.iconbtn:active { transform: translateY(0); }
.iconbtn--danger:hover { color: var(--hi); border-color: color-mix(in oklch, var(--hi) 45%, var(--border)); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--faint); }
.empty-state h2 { margin: 0 0 8px; font-size: 18px; color: var(--muted); font-weight: 600; }
.empty-state p { margin: 0; font-size: 13.5px; }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

/* ---------- Mes stats ---------- */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 14px; }
.bar__label { font-size: 13px; color: var(--muted); }
.bar__track { height: 8px; border-radius: var(--r-sm); background: var(--surface2); overflow: hidden; }
.bar__fill { height: 100%; background: var(--accent); border-radius: var(--r-sm); }
.bar__val { font-family: var(--font-mono); font-size: 12px; color: var(--text); text-align: right; }

/* ---------- Statut ---------- */
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: none; }
.status-row--head { border-bottom: 1px solid var(--border); }
.status-row--flush { border-bottom: none; }
.status-row__name { font-size: 13.5px; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; }
.status-dot--lead { font-size: 13px; letter-spacing: 0; }
.status-dot .dot { width: 8px; height: 8px; border-radius: 50%; }
.kv__title { font-size: 16px; font-weight: 600; }
.kv__sub { font-family: var(--font-mono); font-size: 11px; color: var(--faint); margin-top: 4px; }

/* ---------- Documentation ---------- */
.doc h3 { font-size: 15px; margin: 22px 0 8px; }
.doc p { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin: 0 0 10px; }
.doc code { font-family: var(--font-mono); font-size: 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1px 6px; }

/* ---------- Auth (login / register) ---------- */
.auth { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth__card { position: relative; z-index: 2; width: 100%; max-width: 408px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 36px); box-shadow: var(--shadow-lg); }
.auth__brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 6px; color: var(--text); text-decoration: none; }
.auth__brand .bs-brand__name { font-size: 12px; }
.auth__title { margin: 18px 0 4px; font-size: 22px; font-weight: 600; text-align: center; }
.auth__sub { margin: 0 0 22px; text-align: center; color: var(--muted); font-size: 13.5px; }
.auth__switch { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.auth__switch a { color: var(--accent); text-decoration: none; }
.auth__switch a:hover { text-decoration: underline; }
.auth__demo { margin-top: 14px; text-align: center; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); letter-spacing: 0.04em; }

/* Connexion sociale (Google / Telegram) — séparateur + pile de boutons */
.auth__or { display: flex; align-items: center; gap: 12px; margin: 18px 0 16px; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.auth__or::before, .auth__or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth__social { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.auth__social .btn { display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth__social .btn svg { width: 18px; height: 18px; flex: none; }

/* Rester connecté (login) */
.auth__remember { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.auth__remember input { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }

/* ---------- Vérification e-mail (code à 6 chiffres) ---------- */
.auth__stack { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 408px; }
.input--code { text-align: center; font-family: var(--font-mono); font-size: 30px; font-weight: 600; letter-spacing: .5em; padding-left: .5em; }
.input--code::placeholder { letter-spacing: .5em; color: var(--faint); opacity: .5; }
.auth__hint { margin: 8px 0 0; font-size: 12px; color: var(--faint); line-height: 1.5; }
.auth__forgot { margin-top: 8px; text-align: right; font-size: 12.5px; }
.auth__forgot a { color: var(--accent); text-decoration: none; }
.auth__forgot a:hover { text-decoration: underline; }
.auth__aside { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
.auth__aside a, .linkbtn { color: var(--accent); text-decoration: none; }
.auth__aside a:hover, .linkbtn:hover { text-decoration: underline; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.auth__aside-sep { color: var(--faint); }

/* Mot de passe : jauge de robustesse + checklist des exigences (register) */
.auth__pw { margin-top: 10px; }
.auth__meter { height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.auth__meter-bar { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--border2); transition: width .25s ease, background .25s ease; }
.auth__pw.is-weak   .auth__meter-bar { background: var(--hi); }
.auth__pw.is-medium .auth__meter-bar { background: var(--warn); }
.auth__pw.is-strong .auth__meter-bar { background: var(--ok); }
.auth__meter-label { min-height: 13px; margin-top: 5px; font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.auth__pw.is-weak   .auth__meter-label { color: var(--hi); }
.auth__pw.is-medium .auth__meter-label { color: var(--warn); }
.auth__pw.is-strong .auth__meter-label { color: var(--ok); }
.auth__reqs { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.auth__req { position: relative; padding-left: 22px; font-size: 12px; color: var(--muted); transition: color .15s; }
.auth__req::before { content: ""; position: absolute; left: 0; top: 0; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--border2); background: transparent; transition: border-color .15s, background .15s; }
.auth__req.is-ok { color: var(--ok); }
.auth__req.is-ok::before { border-color: var(--ok); background: var(--ok); }
.auth__req.is-ok::after { content: ""; position: absolute; left: 5px; top: 3px; width: 3px; height: 6px; border: solid var(--bg); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }

/* Widget captcha Cloudflare Turnstile (aligné à gauche) + placeholder de chargement.
   Le skeleton est positionné derrière ; l'iframe du widget (opaque, 300×65) le recouvre
   une fois rendue. min-height réserve la place → pas de saut de mise en page. */
.auth__captcha { position: relative; margin-top: 16px; min-height: 65px; }
.auth__captcha > .cf-turnstile { position: relative; z-index: 1; }
.auth__captcha-ph { position: absolute; top: 0; left: 0; z-index: 0; width: 300px; max-width: 100%; height: 65px; display: flex; align-items: center; gap: 10px; padding: 0 15px; border: 1px solid var(--border2); border-radius: var(--r); background: var(--bg); color: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.auth__captcha-spin { width: 15px; height: 15px; flex: none; border-radius: 50%; border: 2px solid var(--border2); border-top-color: var(--accent); animation: bs-spin .7s linear infinite; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .adv { grid-template-columns: 1fr; }
  .adv__empty { display: none; }
}
@media (max-width: 980px) {
  .region__menu { display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 75; width: 44px; height: 44px; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r); color: var(--text); cursor: pointer; }
  .content { padding-top: 64px; }
  .content--flush { padding-top: 0; }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-100%); transition: transform .22s ease; z-index: 80; }
  .shell.is-open .sidebar { transform: none; }

  /* ---------- Tiroir mobile : lisibilité & cibles tactiles renforcées ----------
     Le tiroir héritait des tailles « bureau » (liens 13.5px, en-têtes 9.5px, icônes
     18px) → trop petit et peu accessible au doigt. Ici : tiroir plus large, liens
     ≥ 44px, police et icônes agrandies. Le rail « réduire », le sélecteur de langue
     et le bouton thème n'ont aucun sens en tiroir plein écran → masqués. */
  .sidebar { width: min(87vw, 324px); box-shadow: var(--shadow-lg); }
  .sidebar__brand { padding: 20px 18px 14px; }
  .sidebar__brand .bs-brand { gap: 12px; }
  .sidebar__brand-sub { font-size: 10px; letter-spacing: 0.26em; margin-top: 3px; }
  .sidebar__nav { padding: 8px 12px calc(12px + env(safe-area-inset-bottom)); gap: 4px; }
  .snav__group { font-size: 11px; letter-spacing: 0.14em; margin: 18px 12px 8px; }
  .snav__group:first-child { margin-top: 6px; }
  .snav__link { min-height: 46px; padding: 12px 14px; gap: 14px; font-size: 15.5px; border-radius: var(--r-md); }
  .snav__ic { width: 21px; height: 21px; }
  .snav__badge { min-width: 20px; height: 20px; padding: 0 6px; font-size: 11px; }
  .sidebar__foot { padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); gap: 12px; }
  .sidebar__row,
  .sidebar__theme { display: none; }
  .sidebar__upsell-title { font-size: 13.5px; }
  .sidebar__upsell-body { font-size: 12px; }
  .usercard__avatar { width: 40px; height: 40px; font-size: 13px; }
  .usercard__name { font-size: 14.5px; }
  .usercard__mail { font-size: 12px; }
  .shell__scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 78; border: none; }
  .shell.is-open .shell__scrim { opacity: 1; pointer-events: auto; }
  .stats { grid-template-columns: 1fr 1fr; gap: 18px 0; }
  .stat:nth-child(3) { border-left: none; padding-left: 4px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .stat:not(:first-child) { border-left: none; padding-left: 4px; border-top: 1px solid var(--border); padding-top: 16px; }
  .search-row { flex-direction: column; align-items: stretch; }
  .search-go { height: 48px; justify-content: center; }
  .grid-2 { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 96px 1fr 44px; gap: 10px; }
}

/* ---------- Indice « bientôt » (champs non couverts) ---------- */
.field__hint { font-size: 11px; color: var(--faint); font-weight: 400; letter-spacing: .02em; margin-left: 6px; }

/* ---------- Affiliation (lien de parrainage, retraits) ---------- */
.aff-copy { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.aff-copy__input { flex: 1 1 260px; min-width: 0; }
.aff-copy__btn { flex: 0 0 auto; white-space: nowrap; }
.aff-copy__btn.is-copied { border-color: var(--ok); color: var(--ok); }
.aff-amt { color: var(--ok); }
.aff-amt--neg { color: var(--hi); }
.aff-payout {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  background: var(--surface);
}
.aff-payout + .aff-payout { margin-top: 12px; }

/* ---------- Outils de liste (favoris / historique) : filtre + facettes ---------- */
.listtools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.listtools__search { flex: 1; min-width: 190px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 12px; color: var(--faint); transition: border-color .15s; }
.listtools__search:focus-within { border-color: var(--border2); }
.listtools__search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 13.5px; outline: none; font-family: var(--font-sans); }
.listtools__facets { display: flex; gap: 6px; flex-wrap: wrap; }
.listtools__facets .chip { padding: 6px 12px; font-size: 12px; }

/* Regroupement par date (historique) */
.listgroup { display: flex; flex-direction: column; gap: 10px; }
.listgroup + .listgroup { margin-top: 14px; }
.listgroup__head { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--faint); text-transform: uppercase; margin: 2px 2px 4px; }

/* ---------- « Ajouter à l'investigation » : bouton + popover partagé ---------- */
.addwrap { position: relative; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.addbtn { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in oklch, var(--accent) 10%, transparent); border: 1px solid color-mix(in oklch, var(--accent) 35%, var(--border)); color: var(--accent); border-radius: var(--r-sm); padding: 7px 11px; font-size: 12.5px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .15s ease; }
.addbtn:hover { background: color-mix(in oklch, var(--accent) 16%, transparent); transform: translateY(-1px); }
.addbtn:active { transform: translateY(0); }
.addbtn.is-busy { opacity: .55; pointer-events: none; }
.addwrap__done { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--ok); }
.addwrap__open { color: var(--accent); text-decoration: none; font-family: var(--font-mono); font-size: 11px; }
.addwrap__open:hover { text-decoration: underline; }
.addwrap__msg { font-size: 12px; }
.addwrap__msg--err { color: var(--hi); }

.addpop { position: fixed; z-index: 60; min-width: 210px; max-width: 300px; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow-y: auto; }
.addpop[hidden] { display: none; }
.addpop__head { padding: 6px 8px 4px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--faint); }
.addpop__item { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addpop__item:hover { background: var(--surface2); }
.addpop__item--new { color: var(--accent); font-weight: 500; }
.addpop__sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ---------- Utilisation : jauge de quota du jour ---------- */
.quota { display: flex; flex-direction: column; gap: 9px; }
.quota__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quota__label { font-size: 13.5px; color: var(--muted); }
.quota__val { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.quota__track { height: 10px; border-radius: var(--r-sm); background: var(--surface2); overflow: hidden; }
.quota__fill { height: 100%; width: 0; background: var(--accent); border-radius: var(--r-sm); transition: width .3s ease; }
.quota__fill.is-high { background: var(--warn); }
.quota__fill.is-full { background: var(--hi); }

/* ---------- Filtres rapides segmentés (dashboard) : base interne vs fuites API ---------- */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.filterseg { display: flex; align-items: center; gap: 8px; }
/* Séparateur vertical entre groupes (desktop). */
.filterseg + .filterseg::before {
  content: "";
  align-self: stretch;
  width: 1px;
  margin: 3px 6px 3px -5px;
  background: var(--border);
}
.filterseg__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--faint);
  user-select: none;
}
.filterseg--api .filterseg__label { color: color-mix(in oklch, var(--accent) 75%, var(--muted)); }
.search-filters .chip { display: inline-flex; align-items: center; gap: 6px; }
.search-filters .chip svg { flex: none; color: var(--faint); transition: color .15s; }
.search-filters .chip:hover svg { color: var(--muted); }
.search-filters .chip.is-on svg { color: var(--accent); }
.search-filters .chip--auto svg { color: var(--accent); }   /* Auto : icône toujours en accent */

/* ---------- Espace compte (/account) ---------- */
.acct { max-width: 760px; margin-left: auto; margin-right: auto; }
.acct-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 22px; margin-bottom: 20px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
}
.acct-hero__avatar {
  flex: none; width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 21px; font-weight: 700; color: var(--accent);
  background: color-mix(in oklch, var(--accent) 14%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--accent) 28%, var(--border));
}
.acct-hero__id { flex: 1; min-width: 0; }
.acct-hero__name { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.acct-hero__mail { margin-top: 2px; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.acct-hero__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.acct-hero__since { font-size: 11.5px; color: var(--faint); }
.planbadge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.planbadge--free { color: var(--muted); background: var(--surface2); border: 1px solid var(--border); }
.planbadge--paid {
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--border));
}
.card__title--ic { display: flex; align-items: center; gap: 9px; }
.card__title--ic svg { flex: none; color: var(--accent); }
.card--danger .card__title--ic svg { color: var(--danger); }
@media (max-width: 560px) {
  .acct-hero { flex-wrap: wrap; gap: 14px; }
  .acct-hero__meta { flex-direction: row; align-items: flex-start; text-align: left; width: 100%; }
}
/* Groupe fuites (API) : teinte d'accent pour le distinguer de la base interne. */
.filterseg--api .chip { border-color: color-mix(in oklch, var(--accent) 28%, var(--border2)); }
.filterseg--api .chip:hover { border-color: var(--accent); color: var(--text); }
.filterseg--api .chip.is-on { box-shadow: inset 0 0 0 1px var(--accent); }

/* Indicateur « détecté » (mis à jour en direct par app.js, aligné sur le serveur). */
.autodetect {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--accent) 32%, var(--border));
  background: color-mix(in oklch, var(--accent) 12%, var(--surface));
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  animation: bs-detect-in .18s ease;
}
.autodetect[hidden] { display: none; }
.autodetect svg { opacity: .9; }
@keyframes bs-detect-in { from { opacity: 0; transform: translateX(-5px); } to { opacity: 1; transform: none; } }

/* Badge « détecté » DANS le champ de recherche (à droite) : ne réagence plus la rangée de filtres. */
.search-field .autodetect { flex: none; margin-left: 2px; padding: 4px 10px 4px 7px; font-size: 11.5px; }
.search-field .autodetect svg { color: var(--accent); opacity: 1; }

@media (max-width: 640px) {
  .search-filters { gap: 10px; }
  .filterseg { flex-wrap: wrap; gap: 6px; }
  .filterseg + .filterseg::before { display: none; }
  .filterseg--auto { width: 100%; }
}

/* Communauté / support Telegram (sidebar + carte compte) */
.sidebar__tg .snav__ic { color: var(--accent); }
.acct-support__cta { display: inline-flex; align-items: center; gap: 8px; }
