/* Limier - technical print interface: warm paper, precise rules, electric blue. */

/* Space Grotesk is self-hosted in two subsets for French text coverage. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/SpaceGrotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/SpaceGrotesk-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #FAFAF8;
  --bg-alt: #F3F1EC;
  --fg: #1C1917;
  --muted: #57534E;
  --muted-2: #78716C;
  --faint: #A8A29E;
  --line: #E7E5E0;
  --line-strong: #D6D3CE;
  --card: #ffffff;
  --accent: #2452E0;
  --surface: var(--card);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --ink: var(--fg);
  --ink-2: var(--muted);
  --ink-3: var(--muted-2);
  --ink-faint: var(--faint);
  --accent-2: var(--accent);
  --accent-ink: var(--accent);
  --accent-soft: #EEF1FC;
  --surface-2: var(--bg-alt);
  --ring: rgba(36, 82, 224, 0.35);
  --btn-primary-bg: var(--accent);
  --btn-primary-ink: #ffffff;
  --ok: #2452E0;
  --ok-bg: #EEF1FC;
  --warn: #8A5A00;
  --warn-bg: #F8F0DD;
  --err: #A33B32;
  --err-bg: #F8E9E6;
  --hero-bg: var(--bg);
  --hero-ink: var(--fg);
  --hero-ink-2: var(--muted);
  --hero-border: var(--line);
  --radius: 0;
  --radius-lg: 0;
  --radius-pill: 0;
  --shadow-sm: none;
  --shadow: none;
  --shadow-glow: none;
  --font: "Space Grotesk", Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", Helvetica, Arial, sans-serif;
  --font-sans: "Space Grotesk", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Sticky footer : la page occupe au moins toute la hauteur, le main pousse le
     footer en bas meme sur une page courte (login, inscription, etat vide). */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
#main { flex: 1 0 auto; }

h1, h2, h3,
.hero__title, .section-head__title, .cta-band__title, .brand__name {
  font-family: var(--font-display);
}
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.12; margin: 0; }

a { color: inherit; }

.container { width: min(var(--maxw), 94vw); margin: 0 auto; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { left: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(251, 251, 253, 0.8);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand__mark { display: inline-flex; }
.brand__name { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em; }
.brand__logo { display: block; height: 30px; width: auto; }
.brand { gap: 8px; }
.brand__by {
  align-self: flex-end; margin: 0 0 3px -2px;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink-faint); white-space: nowrap;
}
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover { color: var(--ink); }
.site-nav .btn { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  --b-pad-y: 12px; --b-pad-x: 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; font-weight: 600; font-size: 0.97rem; line-height: 1;
  padding: var(--b-pad-y) var(--b-pad-x);
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: transform 0.06s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--sm { --b-pad-y: 9px; --b-pad-x: 15px; font-size: 0.9rem; }
.btn--lg { --b-pad-y: 15px; --b-pad-x: 26px; font-size: 1.02rem; border-radius: var(--radius-lg); }
.btn--block { width: 100%; }

.btn--primary {
  color: var(--btn-primary-ink);
  background: var(--btn-primary-bg);
  box-shadow: var(--shadow-glow);
}
.btn--primary:disabled { opacity: 0.65; cursor: progress; box-shadow: none; transform: none; }

.btn--ghost { background: var(--surface); border-color: var(--border-strong); }

.btn--quiet {
  color: var(--hero-ink); background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Effets de SURVOL uniquement sur les appareils a vrai survol (souris). Sur tactile, le
   ":hover" "colle" : le 1er tap applique le hover au lieu de cliquer -> le bouton semble
   "ne pas repondre" au 1er tap (bug "Lancer la recherche" sur mobile). Le ":active"
   (retour au tap) reste, lui, actif partout. */
@media (hover: hover) {
  .btn--primary:hover { filter: brightness(0.93); box-shadow: var(--shadow); transform: translateY(-1px); }
  .btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
  .btn--quiet:hover { background: rgba(255, 255, 255, 0.12); }
}

.btn__spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.htmx-indicator { display: none; }
.htmx-request.btn .htmx-indicator, .htmx-request .htmx-indicator { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-ink);
  padding: clamp(64px, 9vw, 120px) 0 clamp(72px, 10vw, 130px);
}
.hero__glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.55; pointer-events: none; }
.hero__glow--1 { width: 560px; height: 560px; top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.22), transparent 70%); }
.hero__glow--2 { width: 620px; height: 620px; bottom: -260px; right: -160px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%); opacity: 0.45; }
.hero__grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 75%);
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--hero-ink-2);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hero-border);
  padding: 7px 14px; border-radius: var(--radius-pill);
}
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18); }

.hero__title {
  font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; margin: 22px 0 18px;
  letter-spacing: -0.035em;
}
.hero__title-accent { color: #2dd4bf; }
.hero__subtitle { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--hero-ink-2); max-width: 30em; margin: 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 32px 0 28px; }
.hero__trust {
  display: flex; flex-wrap: wrap; gap: 26px; list-style: none; padding: 0; margin: 0;
  font-size: 0.92rem; color: var(--hero-ink-2);
}
.hero__trust strong { color: var(--hero-ink); font-weight: 700; }
.hero__trust li { position: relative; }

/* Preview card (decoratif, montre le produit) */
/* ---------- Hero : deck 3D de cartes de resultat (design leaderboard reel) ---------- */
.hero__preview { position: relative; display: flex; justify-content: center; align-items: center; }
/* Scene 3D : cartes de resultat DEPLIEES (etat ouvert : titre, chips, raison du
   match, barre), empilees en deck facon banque (Revolut / Trade Republic).
   Chaque carte porte une petite epaisseur (tranche de carte de credit) via des
   ombres dures empilees. La carte i remonte en retrait derriere la precedente.
   Ancre par le BAS (carte Top match calee en bas, les autres montent) + hauteur
   dimensionnee sur l'etendue du deck -> aucun vide en haut/bas, deck centre. */
.hero-deck {
  position: relative; width: min(100%, 460px); height: 340px;
  perspective: 1500px;
}
.hero-rcard {
  --lift: calc(var(--i) * -84px);
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: calc(10 - var(--i)); /* la carte 0 (Top match) reste DEVANT (backdrop-filter casse le tri Z natif) */
  padding: 16px 18px 14px; border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(28, 32, 46, 0.96), rgba(15, 17, 28, 0.96));
  border: 1px solid var(--hero-border);
  display: flex; flex-direction: column; gap: 10px;
  transform-origin: bottom center;
  transform:
    translateY(var(--lift))
    scale(calc(1 - var(--i) * 0.045))
    rotateX(9deg) rotateY(-15deg) rotate(-1deg);
  opacity: calc(1 - var(--i) * 0.16);
  box-shadow:
    2px 3px 0 rgba(8, 9, 16, 0.6),
    4px 6px 0 rgba(8, 9, 16, 0.42),
    22px 34px 55px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}
.hero-rcard--top { border-color: rgba(20, 168, 163, 0.4); }
.hero-rcard__head { display: flex; align-items: center; gap: 9px; }
.hero-rcard__tag {
  flex: none;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: #8ef0d6; background: rgba(20, 168, 163, 0.18);
  padding: 4px 9px; border-radius: var(--radius-pill); white-space: nowrap;
}
.hero-rcard__title {
  flex: 1 1 auto; min-width: 0;
  font-size: 0.98rem; font-weight: 700; color: var(--hero-ink); line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0;
}
.hero-rcard__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-rchip {
  flex: none; font-size: 0.72rem; font-weight: 600; padding: 3px 9px;
  border-radius: var(--radius-pill); white-space: nowrap;
  background: rgba(255, 255, 255, 0.06); color: var(--hero-ink-2); border: 1px solid var(--hero-border);
}
.hero-rchip--rate { color: #86efac; background: rgba(34, 197, 94, 0.12); border-color: transparent; }
.hero-rcard__reason {
  margin: 0; font-size: 0.82rem; line-height: 1.45; color: var(--hero-ink-2);
}
.hero-rcard__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.hero-matchbar {
  flex: none; width: 88px; height: 12px;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px);
  mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px);
  /* Remplie jusqu'a --fill (score du match) en teal franc, le reste en ticks eteints.
     NB : variable dediee (PAS --match, enregistree en @property inherits:false pour les
     cartes de resultat -> ne descendrait pas de l'article vers ce span). */
  background: linear-gradient(90deg,
    #2dd4bf 0, #5eead4 calc(var(--fill) - 14px),
    rgba(45, 212, 191, 0.55) var(--fill), rgba(255, 255, 255, 0.09) var(--fill));
}
.hero-rcard__src { flex: none; font-size: 0.72rem; color: var(--hero-ink-2); opacity: 0.7; white-space: nowrap; }
/* Survol du deck : les cartes s'ecartent legerement (fan), comme un jeu qu'on ouvre. */
@media (hover: hover) and (pointer: fine) {
  .hero-deck:hover .hero-rcard {
    transform:
      translateY(calc(-50% + var(--lift) + var(--i) * -20px))
      scale(calc(1 - var(--i) * 0.045))
      rotateX(6deg) rotateY(-12deg) rotate(-1deg);
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-rcard, .hero-deck:hover .hero-rcard { transition: none; }
}

/* ---------- Section heads ---------- */
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head__kicker {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent-ink);
}
.section-head__title { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; margin-top: 12px; }
.section-head__lead { color: var(--ink-3); margin: 14px 0 0; font-size: 1.05rem; }

/* ---------- How it works ---------- */
.how { padding: clamp(56px, 8vw, 90px) 0; }
.steps-grid {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
.step-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.step-card__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius); font-weight: 800; color: #fff;
  background: var(--accent); margin-bottom: 16px;
}
.step-card__title { font-size: 1.18rem; font-weight: 700; margin-bottom: 8px; }
.step-card__text { color: var(--ink-3); margin: 0; }
.rule-list {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.rule-pill {
  font-size: 0.82rem; line-height: 1.3; color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 5px 12px; white-space: nowrap;
}

/* ---------- Sources ---------- */
/* Fond en degrade qui part et revient au fond de page : pas de filet, juste un
   creux de teinte au centre (transition douce avec les sections voisines). */
.sources {
  padding: clamp(56px, 7vw, 90px) 0;
  background: linear-gradient(to bottom, var(--bg), var(--bg-alt) 38%, var(--bg-alt) 62%, var(--bg));
}
/* ---------- Reseau carre des sources (convergence vers Limier) ---------- */
.sources-web { max-width: 620px; margin: 8px auto 0; }
.web-svg { width: 100%; height: auto; display: block; }

/* tiles : carre logo + nom */
.tile { fill: var(--card); stroke: var(--line-strong); stroke-width: 0.5; }
.tile-label { fill: var(--fg); font: 500 12px/1 var(--font-mono); }
.src-tile { cursor: help; }

/* spine + lien source -> spine : trait fin, accent */
.spine { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.55; }
.link { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.45;
  stroke-dasharray: 6 230; stroke-dashoffset: 236; animation: linkflow 4.4s linear infinite; }
/* leger decalage par source pour un rythme irregulier */
.link.v-ft { animation-delay: -0.9s; }
.link.v-jm { animation-delay: -1.7s; }
.link.v-cd { animation-delay: -2.4s; }
.link.v-jb { animation-delay: -3.1s; }

/* bloc Limier */
.limier-box { fill: var(--card); stroke: var(--accent); stroke-width: 1; }
.limier-label { fill: var(--fg); font: 500 13px/1 var(--font-mono); letter-spacing: 0.4px; }

/* autres sources : source non officielle, anonyme */
.tile--anon { fill: var(--bg-alt); stroke: var(--line-strong); }
.tile-label--anon { fill: var(--muted-2); font: 400 12px/1 var(--font-mono); font-style: italic; }
.anon-dot { fill: var(--muted-2); }

@keyframes linkflow { 0% { stroke-dashoffset: 236; } 100% { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .link { animation: none; stroke-dasharray: none; opacity: 0.5; }
}

/* ---------- Temoignage (citation unique, encadree, discrete) ---------- */
.quote { padding: clamp(48px, 7vw, 84px) 0; }
.quote__inner {
  max-width: 640px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: clamp(24px, 4vw, 34px);
}
.quote__mark { display: block; width: 30px; height: auto; color: var(--accent); margin-bottom: 14px; }
.quote__kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); margin: 0 0 12px;
}
/* Verbatim : petit, italique, muted -> lecture "citation", pas titre. */
.quote__text {
  font-style: italic; font-weight: 400;
  font-size: clamp(1rem, 1.3vw, 1.1rem); line-height: 1.65;
  color: var(--ink-2); margin: 0;
}
.quote__author {
  display: flex; align-items: center; gap: 12px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
}
.quote__avatar {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.02em;
}
.quote__meta { display: flex; flex-direction: column; line-height: 1.35; }
.quote__name { font-size: 0.95rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.quote__name:hover { color: var(--accent-ink); text-decoration: underline; }
.quote__role { font-size: 0.82rem; color: var(--ink-3); }

/* ---------- CTA band (bas de vitrine) : pleine largeur, fond sombre ---------- */
.cta-band {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-ink);
  padding: clamp(64px, 9vw, 120px) 0;
}
.cta-band__inner { position: relative; text-align: center; }
.cta-band__glow {
  position: absolute; z-index: 0; width: 620px; height: 620px; border-radius: 50%; filter: blur(110px);
  top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0.42; pointer-events: none;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.2), transparent 70%);
}
.cta-band__title { position: relative; z-index: 1; font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 800; }
.cta-band__text { position: relative; z-index: 1; color: var(--hero-ink-2); margin: 14px 0 28px; font-size: 1.08rem; }
.cta-band .btn { position: relative; z-index: 1; }

/* ---------- Espace de travail (page recherche, type logiciel) ---------- */
/* Barre d'app : sobre, distincte de la nav vitrine. */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.appbar__inner {
  display: flex; align-items: center; justify-content: space-between; height: 60px;
  width: min(1320px, 94vw); margin: 0 auto;
}
.appbar__actions { display: flex; align-items: center; gap: 12px; }

/* Deux zones : rail de controle (gauche) + canvas de resultats (droite). */
.workspace {
  width: min(1320px, 94vw); margin: 0 auto;
  display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 32px; align-items: start;
  padding: 0;
}
/* Rail : panneau pleine hauteur (sticky), separateur a droite, action ancree en bas. */
.rail {
  position: sticky; top: 60px; height: calc(100vh - 60px);
  display: flex; flex-direction: column; overflow-y: auto;
  padding: 26px 26px 26px 0; border-right: 1px solid var(--border);
}
.rail__form { display: flex; flex-direction: column; gap: 22px; flex: 1; }
.rail__form > .btn { margin-top: auto; }
.rail__field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 8px; }
.rail__hint { margin: 8px 0 0; font-size: 0.82rem; color: var(--ink-faint); }
.rail__count { margin-top: 4px; text-align: right; font-variant-numeric: tabular-nums; }
/* Le champ Criteres absorbe l'espace libre du rail ; sa textarea remplit la zone
   (et n'est pas redimensionnable : la hauteur suit la colonne). */
.rail__field--grow { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.rail__field--grow textarea { flex: 1; min-height: 180px; resize: none; }

/* Canvas : la grande zone de travail, pleine hauteur elle aussi. */
.canvas { display: flex; flex-direction: column; padding: 26px 0; min-height: calc(100vh - 60px); }
.canvas__output { flex: 1; display: flex; flex-direction: column; }
.canvas-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 6px; color: var(--ink-faint);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 24px;
}
.canvas-empty__icon {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg-alt); color: var(--ink-faint); margin-bottom: 10px;
}
.canvas-empty__title { font-size: 1.15rem; font-weight: 700; color: var(--ink-2); margin: 0; }
.canvas-empty__text { margin: 0; max-width: 34ch; }

/* Zone de depot du CV */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 8px; text-align: center; cursor: pointer;
  padding: 30px 24px; border-radius: var(--radius);
  border: 1.5px dashed var(--border-strong); background: var(--bg-alt);
  color: var(--ink-3); transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.dropzone:hover { border-color: var(--accent); color: var(--ink-2); }
.dropzone:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.dropzone__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__icon { color: var(--accent); }
.dropzone__prompt { font-size: 0.96rem; }
.dropzone__prompt strong { color: var(--ink); }
.dropzone__file { font-size: 0.9rem; font-weight: 600; color: var(--ink-faint); }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.dropzone.has-file .dropzone__icon, .dropzone.has-file .dropzone__prompt { display: none; }
.dropzone.has-file .dropzone__file { color: var(--ok); font-size: 1rem; }
.dropzone.has-file .dropzone__file::before { content: "Fichier pret : "; font-weight: 500; }

/* Selecteur segmente de fraicheur : pleine largeur, segments egaux */
.segmented {
  display: flex; width: 100%; padding: 4px; gap: 4px;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
}
.segmented__opt { position: relative; flex: 1; }
.segmented__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented__opt span {
  display: block; padding: 9px 8px; border-radius: var(--radius); font-weight: 600; font-size: 0.92rem;
  text-align: center; color: var(--ink-3); white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented__opt input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented__opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Source toggle chips : logo + nom, compact */
.source-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.source-chip {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  background: var(--bg-alt); transition: border-color 0.15s ease, opacity 0.15s ease;
}
.source-chip__input { position: absolute; opacity: 0; width: 0; height: 0; }
.source-chip__logo { width: 16px; height: 16px; border-radius: 3px; object-fit: cover; flex-shrink: 0; }
.source-chip__name { font-size: 0.75rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.source-chip:has(.source-chip__input:checked) { border-color: var(--accent); }
.source-chip:has(.source-chip__input:not(:checked)) { opacity: 0.4; }
.source-chip:has(.source-chip__input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px 14px;
  resize: vertical; min-height: 150px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Indicateur flottant "recherche en cours" ---------- */
.run-indicator {
  position: fixed; bottom: 20px; right: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; max-width: min(360px, 88vw);
  padding: 6px 6px 6px 15px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  animation: rise 0.3s ease both;
}
.run-indicator[hidden] { display: none; }
.run-indicator__main {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.run-indicator__spinner {
  flex: none; width: 15px; height: 15px; border-radius: 50% !important;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
.run-indicator__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-indicator__stop {
  flex: none; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer;
  color: var(--err); background: var(--err-bg); border: 1px solid transparent;
  border-radius: var(--radius-pill); padding: 6px 13px;
}
.run-indicator__stop:hover { filter: brightness(0.97); }
.run-indicator__stop:disabled { opacity: 0.6; cursor: default; }

/* ---------- Barre de progression ---------- */
.run { margin-top: 28px; }
.progress-bar { margin-bottom: 4px; }
.progress-bar__track {
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--bg-alt); overflow: hidden;
}
.progress-bar__fill {
  height: 100%; border-radius: 3px; background: var(--accent);
  transition: width 0.4s ease;
}
.progress-bar__label {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-3);
}
.progress-bar__spinner {
  width: 12px; height: 12px; border-radius: 50% !important;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite; flex-shrink: 0;
}
.progress-bar__text { font-weight: 500; }
.progress-bar .tl-item { display: none; }

/* ---------- Resultats : liste vivante, classee en temps reel ---------- */
.rlive { margin-top: 28px; }
/* Bandeau affiche quand on restaure la derniere recherche (apres un refresh). */
.rlive__restored {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; padding: 9px 14px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 0.85rem; font-weight: 600;
}
.rlive__restored-clear {
  flex: none; background: none; border: 1px solid currentColor; color: inherit;
  border-radius: var(--radius-pill); padding: 4px 14px; font: inherit; font-size: 0.8rem; cursor: pointer;
  transition: background 0.15s ease;
}
.rlive__restored-clear:hover { background: var(--accent-soft); }
.rlive__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.rlive__counts { display: flex; gap: 10px; align-items: center; }
.rlive__count {
  font-size: 0.9rem; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 6px 13px;
}
.rlive__count b { color: var(--accent-ink); font-weight: 800; }
.rlive__count--muted { color: var(--ink-faint); }
.rlive__count--muted b { color: var(--ink-3); }
.rlive__tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rlive__tags-label { font-size: 0.78rem; font-weight: 600; color: var(--ink-faint); }
.tag {
  font-size: 0.76rem; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: var(--radius-pill); padding: 3px 10px;
}

/* Liste "leaderboard" : une LIGNE par mission, re-ordonnee en direct par le client
   (FLIP). Ligne compacte toujours visible ; le detail se revele au survol (desktop)
   et s'ouvre dans la modale au clic / tap. */
.rlive__list { display: flex; flex-direction: column; gap: 8px; }
.rlive__divider {
  margin: 16px 0 4px; display: flex; align-items: center; gap: 12px;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-faint);
}
.rlive__divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.rcard {
  position: relative; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); will-change: transform;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.rcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.rcard[data-relevant="0"] { background: var(--bg-alt); box-shadow: none; opacity: 0.92; }
/* Bouton transparent etire sur toute la ligne (cliquable partout, focusable clavier).
   Le lien "Voir l'offre" repasse au-dessus (z-index) pour rester cliquable. */
.rcard__open {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.rcard__open:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: var(--radius); }

/* --- Ligne compacte (toujours visible) --- */
.rcard__line { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.rcard__title {
  flex: 1 1 auto; min-width: 0;
  font-size: 0.95rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rcard__line .rcard__chips { flex: none; display: flex; gap: 5px; }
.rcard__src { flex: none; font-size: 0.72rem; color: var(--ink-faint); white-space: nowrap; }
/* Barre de match (style ticks) : puissance du match SANS chiffre, pertinentes
   uniquement. Shimmer placeholder pendant le stream ; au classement final, la barre
   se remplit avec le score calibre ENVELOPPE le long du rang (jamais plus haute que
   celle du dessus -> coherente avec la position finale). */
@property --match {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}
.matchbar {
  --match: 0%;
  width: 56px; height: 11px; flex: none;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px);
  mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px);
  background: linear-gradient(90deg,
    var(--accent) 0,
    var(--accent-2) calc(var(--match) - 14px),
    rgba(20, 168, 163, 0.45) var(--match),
    var(--border) var(--match));
  transition: --match 0.9s ease; /* remplissage anime au reveal (no-op si @property non supporte) */
}
.matchbar--pending {
  background: linear-gradient(90deg,
    var(--border) 0 35%, rgba(20, 168, 163, 0.4) 50%, var(--border) 65% 100%);
  background-size: 220% 100%;
  animation: matchbar-shimmer 1.5s linear infinite;
}
@keyframes matchbar-shimmer {
  from { background-position: 110% 0; }
  to { background-position: -110% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .matchbar { transition: none; }
  .matchbar--pending { animation: none; }
}
.rcard__chevron {
  position: relative; z-index: 2;
  flex: none; display: inline-flex; color: var(--ink-faint); cursor: pointer;
  transition: color 160ms ease;
}
.rcard.is-open .rcard__chevron { color: var(--accent-ink); }
.rcard__chevron:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(36, 82, 224, 0.35); }

.rchip {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap;
  background: var(--bg-alt); color: var(--ink-2); border: 1px solid var(--border);
}
.rchip--rate { background: var(--ok-bg); color: var(--ok); border-color: transparent; }

/* --- Detail repliable (revele au survol). Technique grid 0fr -> 1fr : pas de
   hauteur magique, pas de troncature. --- */
.rcard__details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s ease-in-out; }
.rcard__details-inner {
  overflow: hidden; min-height: 0; padding: 0 14px;
  opacity: 0; transition: opacity 0.5s ease;
}
/* The inline detail opens only through the chevron. */
.rcard.is-open .rcard__details { grid-template-rows: 1fr; }
.rcard.is-open .rcard__details-inner { opacity: 1; }
.rcard__details-inner > :last-child { margin-bottom: 12px; }
.rcard__label {
  display: block; margin: 8px 0 2px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--accent-ink);
}
.rcard__details-inner > .rcard__label:first-child { margin-top: 4px; }
.rcard__reason { margin: 0; font-size: 0.82rem; color: var(--ink-2); line-height: 1.45; }
.rcard__summary { margin: 0; font-size: 0.8rem; color: var(--ink-faint); line-height: 1.45; }
.rcard__foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.rcard__date { font-size: 0.72rem; color: var(--ink-faint); }
.rcard__link {
  position: relative; z-index: 2; margin-left: auto; /* au-dessus du bouton-overlay */
  font-size: 0.8rem; font-weight: 600; color: var(--accent-ink); text-decoration: none;
}
.rcard__link:hover { text-decoration: underline; }

/* Meilleur resultat : un simple tag "Top match" (comme sur le hero), pose par le
   client en fin de classement sur la 1re carte pertinente. Pas de fond teinte. Le
   ::before d'une ligne flex devient un item flex -> order:-1 le place en tete. */
.rcard--top .rcard__line::before {
  content: "Top match";
  order: -1; flex: none; align-self: center;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  color: #15803d; background: rgba(34, 197, 94, 0.13);
  padding: 4px 9px; border-radius: var(--radius-pill); white-space: nowrap;
}

/* Apparition d'une carte pendant le stream (avant la mise en place finale). */
@keyframes rcard-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rcard--enter { animation: rcard-enter 0.4s ease both; }

/* Modale de detail (clone agrandi de la carte cliquee) */
.rmodal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(7, 7, 15, 0.55);
}
.rmodal[hidden] { display: none; }
.rmodal__panel {
  position: relative; width: min(560px, 100%);
  animation: rise 0.22s ease both;
}
/* Le scroll vit sur le corps : le panneau garde un overflow visible pour que la
   pastille de fermeture puisse deborder hors du coin de la carte. */
.rmodal__body { max-height: 85vh; overflow-y: auto; }
.rmodal__close {
  position: absolute; top: -14px; right: -14px; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  font-size: 1.1rem; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm);
}
.rmodal__close:hover { border-color: var(--accent); color: var(--accent-ink); }
.rmodal .rcard { cursor: default; width: 100%; opacity: 1; }
.rmodal .rcard:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }
.rmodal .rcard__open { display: none; } /* pas d'overlay cliquable dans la modale */
.rmodal .rcard__chevron { display: none; } /* pas de chevron : le detail est deja ouvert */
/* Ligne : titre en grand sur sa propre ligne, chips + source en dessous. */
.rmodal .rcard__line { flex-wrap: wrap; gap: 10px; padding: 18px 20px 4px; }
.rmodal .rcard__title { flex-basis: 100%; white-space: normal; overflow: visible; text-overflow: clip; font-size: 1.25rem; }
.rmodal .rcard__chips {
  order: 2; flex: 1 1 100% !important; max-width: none !important;
  justify-content: flex-start; overflow: visible;
}
.rmodal .rchip--loc { white-space: normal; overflow-wrap: anywhere; }
.rmodal .matchbar { order: 3; }
.rmodal .rcard__src { font-size: 0.8rem; }
.rmodal .rchip { font-size: 0.8rem; }
/* Detail force ouvert (la modale montre tout). */
.rmodal .rcard__details { grid-template-rows: 1fr; }
.rmodal .rcard__details-inner { padding: 0 20px; opacity: 1; }
.rmodal .rcard__details-inner > :last-child { margin-bottom: 18px; }
.rmodal .rcard__reason { font-size: 0.95rem; }
.rmodal .rcard__summary { font-size: 0.9rem; }
.rmodal .rcard__link { font-size: 0.95rem; }

/* Etat vide */
.empty {
  text-align: center; padding: 44px 28px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.empty__icon {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 16px;
}
.empty__title { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.empty__text { margin: 0 auto; color: var(--ink-3); max-width: 42em; }

/* Alerts */
.alert { border-radius: var(--radius); padding: 16px 18px; margin-top: 20px; font-size: 0.96rem; }
.alert--error { background: var(--err-bg); color: var(--err); }
.alert__msg { margin: 0; }
.alert__cta { margin-top: 12px; }
.alert--warn { background: var(--warn-bg); color: var(--warn); }
.alert--info { background: #e6f0ff; color: #1257c7; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 64px 0 0; }
.site-footer__inner {
  display: grid; grid-template-columns: minmax(0, 1.4fr) 2fr; gap: 40px 48px; padding-bottom: 44px;
}
.site-footer__brand .brand__name { font-size: 1.15rem; font-weight: 800; }
.site-footer__note { margin: 12px 0 0; color: var(--ink-faint); font-size: 0.9rem; line-height: 1.5; max-width: 34em; }
/* Colonnes de liens, empiles VERTICALEMENT dans chaque colonne. */
.site-footer__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.site-footer__col { display: flex; flex-direction: column; gap: 11px; }
.site-footer__title {
  margin: 0 0 3px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-faint);
}
.site-footer__col a { color: var(--ink-3); text-decoration: none; font-size: 0.92rem; width: fit-content; }
.site-footer__col a:hover { color: var(--ink); text-decoration: underline; }
/* Barre de bas : copyright, separee par un filet. */
.site-footer__bottom {
  border-top: 1px solid var(--border); padding: 20px 0;
  font-size: 0.82rem; color: var(--ink-faint);
}
@media (max-width: 720px) {
  .site-footer { padding-top: 44px; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 32px; }
  .site-footer__cols { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

/* ---------- Entrance animation ---------- */
.hero__copy > *, .hero__preview { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero__copy > *:nth-child(2) { animation-delay: 0.05s; }
.hero__copy > *:nth-child(3) { animation-delay: 0.1s; }
.hero__copy > *:nth-child(4) { animation-delay: 0.15s; }
.hero__copy > *:nth-child(5) { animation-delay: 0.2s; }
.hero__preview { animation-delay: 0.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; }
  /* Empile : les cartes du deck remontent en eventail -> degagement au-dessus
     pour ne pas chevaucher la liste "sources / donnee / classement". */
  .hero__preview { margin-top: 24px; max-width: 460px; }
  .steps-grid { grid-template-columns: 1fr; }
  .site-nav a:not(.btn) { display: none; }
  /* Espace de travail empile : controles au-dessus, resultats en dessous.
     minmax(0, 1fr) (et non 1fr) : borne la colonne a la largeur de l'ecran. Sinon
     le `min-width: auto` d'une piste 1fr la laisse gonfler au min-content de son
     contenu (ex: un titre de mission en `white-space: nowrap`) -> la page deborde
     horizontalement et le mobile dezoome ("repasse en version desktop"). */
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 18px 0 40px; }
  .rail {
    position: static; height: auto; overflow: visible;
    border-right: none; padding: 0;
  }
  .rail__form { flex: 0 1 auto; }
  .rail__form > .btn { margin-top: 0; }
  /* Zone resultats plein ecran sur mobile : permet a `scrollIntoView` d'amener les
     resultats EN HAUT apres "Lancer la recherche" (sinon ils restent hors ecran en bas
     car la page n'est pas assez haute pour defiler). */
  .canvas { padding: 0; min-height: calc(100dvh - 56px); }
  .canvas__output { display: block; }
  .canvas-empty { flex: none; min-height: 300px; }
  /* Leaderboard en mode empile (meme breakpoint que l'empilement du workspace) : la
     ligne PASSE A LA LIGNE -> plus de scroll horizontal. Titre + chevron en haut ;
     chips (TJM/mode/lieu) + source en dessous. Au tactile la modale est desactivee,
     donc tout doit rester visible ici. */
  .rlive__list .rcard__line { flex-wrap: wrap; gap: 6px 8px; padding: 11px 13px; }
  /* Titre sur PLUSIEURS lignes au tactile (pas d'ellipse) : tout est visible inline,
     et son min-content redevient petit (un mot) -> ne force plus la largeur. */
  .rlive__list .rcard__title { order: 1; flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .rlive__list .rcard__chevron { order: 2; }
  .rlive__list .rcard__chips { order: 3; flex-basis: 100%; flex-wrap: wrap; }
  .rlive__list .rcard__src { order: 4; }
}
@media (max-width: 540px) {
  .segmented { flex-wrap: wrap; }
  .hero__trust { gap: 16px; }
  .rlive__head { align-items: flex-start; }
  .appbar .btn { display: none; } /* barre d'app epuree : on est deja dans la recherche */
}

/* ---------- Preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Menu compte (nav) ---------- */
.site-nav__link { white-space: nowrap; }
/* Acces permanent a la recherche dans le header (connecte, sauf sur /recherche).
   Flat : pas d'ombre, pas de degrade, pas de transition/transform. */
.header-cta {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 8px 13px; border-radius: var(--radius); line-height: 1;
  border: 0; background: var(--surface-2);
  color: var(--ink); font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.header-cta:hover { color: var(--accent-ink); }
.header-cta__icon { display: block; }
@media (max-width: 600px) {
  .header-cta { padding: 8px 10px; }
  .header-cta__label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
.account { position: relative; }
.account__trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: border-color 0.15s ease;
}
.account__trigger:hover { border-color: var(--accent); }
.account__avatar {
  width: 26px; height: 26px; border-radius: 50%;
  object-fit: cover; background: #fff;
  border: 1px solid var(--border);
}
.account__chevron { color: var(--ink-faint); transition: transform 0.15s ease; }
.account__trigger[aria-expanded="true"] .account__chevron { transform: rotate(180deg); }
.account__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); animation: rise 0.16s ease both;
}
.account__menu[hidden] { display: none; }
.account__menu form { margin: 0; }
.account__email {
  margin: 0 0 6px; padding: 8px 12px 10px; font-size: 0.8rem; color: var(--ink-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.account__item {
  display: block; width: 100%; box-sizing: border-box; text-align: left;
  padding: 9px 12px; border: none; border-radius: var(--radius); background: none;
  color: var(--ink); font: inherit; font-size: 0.92rem; cursor: pointer; text-decoration: none;
}
.account__item:hover { background: var(--bg-alt); }
.account__item--danger { color: #dc2626; }
.account__item--accent { color: var(--accent-ink); font-weight: 600; }
.account__sep { height: 1px; margin: 6px 0; background: var(--border); }
.account__credits { margin: 2px 0 6px; padding: 0 12px; font-size: 0.85rem; color: var(--ink-2); }
.account__credits strong { color: var(--ink); }

/* Champ piege anti-bot (honeypot) : hors ecran pour les humains, rempli par les bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Authentification (login / register) ---------- */
.auth { max-width: 420px; margin: 56px auto; padding: 0 20px; }
.auth__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 28px;
}
.auth__title { margin: 0 0 4px; font-size: 1.4rem; }
.auth__sub { margin: 0 0 20px; color: var(--ink-2); font-size: 0.92rem; }
.auth__form { display: flex; flex-direction: column; gap: 14px; }
.auth__field { display: flex; flex-direction: column; gap: 6px; }
.auth__field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.auth__field input {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 11px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth__field input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring);
}
.auth__error {
  margin: 0; padding: 10px 12px; border-radius: var(--radius); font-size: 0.88rem; color: var(--ink);
  background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.3);
}
.auth__alt { margin: 16px 0 0; text-align: center; font-size: 0.9rem; color: var(--ink-2); }
.auth__sep {
  display: flex; align-items: center; gap: 12px; margin: 18px 0;
  color: var(--ink-faint); font-size: 0.8rem;
}
.auth__sep::before, .auth__sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Mon compte (pleine page, facon GitHub Settings) ---------- */
.account-page { max-width: 760px; margin: 40px auto 64px; padding: 0 24px; }
.account-page__head { margin-bottom: 8px; }
.account-page__title { margin: 0 0 4px; font-size: 1.6rem; }
.account-page__sub { margin: 0; color: var(--ink-2); }
.account-page__section {
  margin: 32px 0 0; padding-bottom: 8px; font-size: 1.05rem;
  border-bottom: 1px solid var(--border);
}
.account-page__section--danger { color: var(--err); border-bottom-color: var(--err); }
.account-rows { margin-top: 4px; }
.account-row {
  display: flex; align-items: baseline; gap: 24px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.account-row__label { flex: 0 0 140px; color: var(--ink-2); font-size: 0.9rem; }
.account-row__value { font-size: 0.95rem; }
.account-row__action { margin-left: 12px; font-size: 0.85rem; }
.danger-zone {
  margin-top: 16px; border: 1px solid var(--err); border-radius: var(--radius);
  padding: 18px 20px; background: var(--surface);
}
.danger-zone__row { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.danger-zone__text { flex: 1 1 280px; }
.danger-zone__title { margin: 0 0 6px; font-size: 1rem; }
.danger-zone__desc { margin: 0; color: var(--ink-2); font-size: 0.9rem; }
.danger-zone__form { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.danger-zone__label { font-size: 0.85rem; color: var(--ink-2); }
.danger-zone__form input {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font: inherit;
}
.danger-zone__form input:focus { outline: 2px solid var(--err); outline-offset: 1px; border-color: transparent; }
.btn--danger { background: var(--err); color: #fff; border-color: transparent; align-self: flex-start; }
.btn--danger:hover { filter: brightness(0.92); }
.account-page__back { margin-top: 28px; font-size: 0.9rem; }

/* ---------- Back office ---------- */
.admin { max-width: 1200px; margin: 40px auto; padding: 0 24px; }
.admin__title { margin: 0 0 4px; font-size: 1.6rem; }
.admin__sub { margin: 0 0 24px; color: var(--ink-2); font-size: 0.92rem; }
.admin__section-title { margin: 40px 0 14px; font-size: 1.15rem; font-weight: 700; }

/* Vue d'ensemble : cartes chiffres en tete. Arrondis a 0 (look back office sobre).
   Couleurs via tokens -> compatible clair/sombre automatiquement. */
.admin__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 8px; }
.admin__stat { background: var(--surface); border: 1px solid var(--border); border-radius: 0; padding: 16px 18px; }
.admin__stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.admin__stat-label {
  margin-top: 4px; font-size: 0.76rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--ink-2);
}

/* Tables : pleine largeur, bords droits, sans scroll horizontal (les cellules passent a la ligne) */
.admin__table-wrap { border: 1px solid var(--border); border-radius: 0; overflow: hidden; background: var(--surface); }
.admin__table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin__table th, .admin__table td {
  padding: 11px 14px; text-align: left; vertical-align: middle; word-break: break-word;
}
.admin__table thead th {
  background: var(--bg-alt); color: var(--ink-2); font-weight: 600; font-size: 0.76rem;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.admin__table tbody tr + tr { border-top: 1px solid var(--border); }
.admin__table tbody tr:hover { background: var(--bg-alt); }
.admin__issue-msg { white-space: pre-wrap; word-break: break-word; }
.admin__inline { display: flex; gap: 6px; align-items: center; margin: 0; }
.admin__inline input {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 0; padding: 6px 9px; width: 100%; max-width: 150px;
}
.admin__inline input[type="number"] { width: 72px; }
/* Bords droits aussi pour les boutons, mais seulement dans le back office. */
.admin .btn { border-radius: 0; }
/* Lisibilite clair/sombre : .btn--ghost ne fixe aucune couleur de texte (un <button>
   n'herite pas la couleur -> couleur systeme, illisible en sombre) et .btn--quiet vise la
   palette hero de la landing (toujours claire -> illisible en clair). On les neutralise
   ici, via tokens, pour le back office uniquement. */
.admin .btn--ghost,
.admin .btn--quiet {
  color: var(--ink); background: var(--surface); border-color: var(--border-strong);
}

/* ---------- Credits (achat) ---------- */
.credits { max-width: 820px; margin: 48px auto; padding: 0 20px; }
.credits__title { margin: 0 0 6px; font-size: 1.6rem; }
.credits__balance { margin: 0 0 20px; color: var(--ink-2); }
.credits__banner {
  margin: 0 0 20px; padding: 12px 14px; border-radius: var(--radius); font-size: 0.92rem;
  background: var(--bg-alt); border: 1px solid var(--border);
}
.credits__banner--ok { background: rgba(34, 197, 94, 0.1); border-color: rgba(34, 197, 94, 0.35); }
.credits__packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.pack {
  display: flex; flex-direction: column; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px 18px;
}
.pack__label { margin: 0; font-size: 1.05rem; }
.pack__credits { margin: 6px 0 0; font-size: 1.05rem; }
.pack__credits strong { display: block; font-size: 1.6rem; }
.pack__price { margin: 8px 0 0; font-size: 1.4rem; font-weight: 800; }
.pack__unit { margin: 2px 0 14px; font-size: 0.82rem; color: var(--ink-faint); }
.pack form { margin: auto 0 0; }
@media (max-width: 640px) { .credits__packs { grid-template-columns: 1fr; } }

/* ===================== Landing - profondeur & micro-interactions ===================== */

/* Reveal au scroll : la classe `reveal` est posee par landing.js (donc sans JS, ou en
   prefers-reduced-motion, le contenu reste visible). `is-revealed` declenche l'apparition. */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-revealed { opacity: 1; transform: none; }

/* Cartes "comment ca marche" : aucun effet au survol (le fond 3D des particules
   suffit). Le badge numero garde juste sa teinte d'accent (statique). */
.step-card__num { box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 80%, transparent); }

/* Kicker de section en degrade (avec repli si background-clip:text non supporte). */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .section-head__kicker {
    background: var(--accent);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}

/* ===================== Pages legales + liens footer ===================== */
.legal { padding: clamp(48px, 7vw, 90px) 0; }
.legal__inner { max-width: 760px; }
.legal__title { font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 800; margin: 0 0 6px; }
.legal__updated { color: var(--ink-faint); font-size: 0.85rem; margin: 0 0 28px; }
.legal h2 { font-size: 1.2rem; font-weight: 700; margin: 30px 0 10px; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.7; }
.legal ul { padding-left: 1.2em; margin: 10px 0; }
.legal li { margin: 4px 0; }
.legal a { color: var(--accent-ink); }
.legal__back { margin-top: 36px; }

/* ---------- Pages metiers (vitrine SEO) ---------- */
.mpage-hero { padding: clamp(56px, 8vw, 110px) 0 clamp(32px, 5vw, 56px); }
.mpage-hero__inner { max-width: 780px; }
.mpage-hero__crumb { font-size: 0.85rem; color: var(--ink-3); margin: 0 0 18px; display: flex; gap: 8px; }
.mpage-hero__crumb a { color: var(--accent-ink); text-decoration: none; }
.mpage-hero__crumb a:hover { text-decoration: underline; }
.mpage-hero__title {
  font-size: clamp(1.9rem, 4.2vw, 3rem); font-weight: 800; line-height: 1.12;
  letter-spacing: -0.02em; margin: 0 0 18px;
}
.mpage-hero__accent { color: var(--accent-ink); }
.mpage-hero__pitch { font-size: clamp(1.02rem, 1.5vw, 1.18rem); color: var(--ink-2); max-width: 38em; margin: 0; }
.mpage-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 24px; }
.mpage-hero__trust {
  list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 0; margin: 0;
  font-size: 0.92rem; color: var(--ink-3);
}
.mpage-hero__trust strong { color: var(--ink); font-weight: 700; }
.mpage-section { padding: clamp(28px, 4.5vw, 52px) 0; }
.mpage-keywords .rule-pill { font-size: 0.92rem; padding: 7px 15px; }
.mpage-faq { max-width: 760px; display: grid; gap: 12px; }
.mpage-faq__item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.mpage-faq__q { font-weight: 700; cursor: pointer; }
.mpage-faq__a { color: var(--ink-2); line-height: 1.65; margin: 12px 0 2px; }
.mpage-link { display: inline-block; text-decoration: none; transition: border-color 0.15s ease, color 0.15s ease; }
.mpage-link:hover { border-color: var(--accent); color: var(--accent-ink); }
.mpage-grid {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.mpage-card {
  display: flex; flex-direction: column; gap: 10px; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.mpage-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); }
.mpage-card__title { font-size: 1.15rem; font-weight: 700; margin: 0; }
.mpage-card__text { color: var(--ink-3); font-size: 0.92rem; line-height: 1.55; margin: 0; flex: 1; }
.mpage-card__cta { color: var(--accent-ink); font-weight: 600; font-size: 0.92rem; }

/* ===================== Widget flottant "Un souci ?" (connectes) ===================== */
.feedback { position: fixed; bottom: 18px; left: 18px; z-index: 40; }
.feedback__toggle {
  border: 0; cursor: pointer; border-radius: var(--radius-pill); padding: 11px 18px;
  font: inherit; font-weight: 600; font-size: 0.9rem; color: #fff;
  background: var(--accent); box-shadow: var(--shadow-glow);
  transition: transform 0.06s ease, box-shadow 0.2s ease;
}
.feedback__toggle:hover { transform: translateY(-1px); }
.feedback__panel {
  position: absolute; bottom: 54px; left: 0; width: min(320px, 86vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 16px;
}
.feedback__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.feedback__title { font-size: 0.95rem; font-weight: 700; }
.feedback__close { border: 0; background: none; cursor: pointer; font-size: 1.3rem; line-height: 1; color: var(--ink-faint); padding: 0 4px; }
.feedback__close:hover { color: var(--ink); }
.feedback__form textarea { width: 100%; min-height: 96px; }
.feedback__error { color: var(--err); font-size: 0.82rem; margin: 6px 0 0; }
.feedback__done p { margin: 0 0 12px; color: var(--ok); font-size: 0.9rem; }
.feedback__form .btn, .feedback__done .btn { margin-top: 10px; }

/* ===================== Myelink light system ===================== */

/* The product is intentionally light-only. These final rules keep the existing
   HTMX and result classes stable while replacing the former visual language. */
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
*, *::before, *::after { border-radius: 0 !important; }
h1, h2, h3, h4, .brand__name { font-weight: 500; color: var(--fg); }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.025em; }
p, li { color: var(--muted); text-wrap: pretty; }
a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 0.5px solid rgba(36, 82, 224, 0.3);
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
a:hover { color: var(--fg); border-bottom-color: var(--accent); }
button, input, textarea { font-family: var(--font-sans); }
button { color: inherit; }
.container {
  width: 100%; max-width: 1180px; padding-inline: clamp(20px, 4vw, 48px);
}
.skip-link {
  background: var(--accent); color: #fff; border: 0; padding: 10px 16px;
}
.skip-link:focus { left: 16px; }

/* Header */
.site-header {
  background: rgba(250, 250, 248, 0.85);
  border-bottom: 0.5px solid var(--line);
  backdrop-filter: blur(12px);
}
.site-header__inner { height: 72px; }
.brand { color: var(--fg); border-bottom: 0; }
.brand:hover { color: var(--fg); border-bottom: 0; }
.brand__name { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.03em; }
.header-cta { font-weight: 400; background: var(--bg-alt); border: 0.5px solid var(--line); }
.account__trigger { font-weight: 400; border: 0.5px solid var(--line-strong); }
.account__avatar { display: block; object-fit: cover; }
.account__item--accent { font-weight: 400; }
.brand__logo { display: none; }
.brand__by {
  align-self: flex-end; margin: 0 0 3px -2px;
  color: var(--muted-2); font: 400 10px/1.2 var(--font-mono); letter-spacing: 0.04em;
  white-space: nowrap;
}
.site-nav { gap: 24px; }
.site-nav a { color: var(--muted); font: 400 12px/1.2 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 0.5px solid transparent; }
.site-nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Buttons */
.btn {
  padding: 14px 28px; border: 0.5px solid var(--line-strong);
  font: 400 12px/1.2 var(--font-mono); letter-spacing: 0.04em;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.btn:active { transform: none; }
.btn--sm { padding: 10px 16px; font-size: 11px; }
.btn--lg { padding: 15px 28px; font-size: 12px; }
.btn--primary {
  color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: none;
}
.btn--primary:hover { color: #fff; background: var(--fg); border-color: var(--fg); box-shadow: none; transform: none; filter: none; }
.btn--ghost, .btn--quiet { color: var(--fg); background: transparent; border-color: var(--line-strong); box-shadow: none; }
.btn--ghost:hover, .btn--quiet:hover { color: var(--accent); background: transparent; border-color: var(--accent); }
.btn:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(36, 82, 224, 0.35);
}

/* Landing */
.hero {
  background: var(--bg); color: var(--fg); padding: clamp(72px, 10vw, 128px) 0 96px;
  border-bottom: 0.5px solid var(--line);
}
.hero__glow, .hero__grid, .cta-band__glow { display: none; }
.hero__inner { grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr); gap: clamp(36px, 7vw, 96px); }
.eyebrow {
  display: inline-flex; padding: 0; border: 0; background: transparent;
  color: var(--accent); font: 400 12px/1.4 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
}
.eyebrow__dot { width: 7px; height: 7px; margin-top: 2px; background: var(--accent); box-shadow: none; }
.hero__title {
  max-width: 18ch; margin: 22px 0 24px; color: var(--fg);
  font-size: clamp(44px, 6vw, 76px); font-weight: 500; line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance;
}
.hero__title-accent { color: var(--accent); }
.hero__subtitle { max-width: 58ch; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.hero__actions { gap: 12px; margin: 32px 0 30px; }
.hero__trust { gap: 24px; font: 400 11px/1.5 var(--font-mono); color: var(--muted-2); }
.hero__trust strong { color: var(--accent); font-weight: 500; }
.hero__preview { align-self: stretch; }
.hero-deck { height: 340px; perspective: none; }
.hero-rcard {
  padding: 24px 22px 20px; background: var(--card); border: 0.5px solid var(--line-strong);
  box-shadow: none; transform: translateY(calc(var(--i) * -78px)) !important; opacity: calc(1 - var(--i) * 0.08);
  transition: border-color 160ms ease, opacity 160ms ease;
}
.hero-rcard--top { border-color: var(--accent); }
.hero-rcard__tag, .hero-rchip, .hero-rcard__src { font-family: var(--font-mono); font-weight: 400; }
.hero-rcard__tag { color: var(--accent); background: var(--accent-soft); padding: 4px 8px; }
.hero-rcard__title { color: var(--fg); font-weight: 500; }
.hero-rchip { color: var(--muted-2); background: var(--bg-alt); border: 0.5px solid var(--line); padding: 4px 8px; }
.hero-rchip--rate { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }
.hero-rcard__reason { color: var(--muted); }
.hero-matchbar { background: linear-gradient(90deg, var(--accent) 0, var(--accent) var(--fill), var(--line) var(--fill)); }
.hero-rcard__src { color: var(--muted-2); }
@media (hover: hover) and (pointer: fine) {
  .hero-deck:hover .hero-rcard { transform: translateY(calc(var(--i) * -78px)) !important; opacity: calc(1 - var(--i) * 0.08); }
}

/* Sections and cards */
.how, .sources, .quote, .mpage-section { padding: 88px 0; }
.sources { background: var(--bg-alt); }
.section-head { max-width: 620px; margin-bottom: 36px; }
.section-head__kicker, .quote__kicker {
  color: var(--accent); font: 400 12px/1.4 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase;
}
.section-head__kicker { background: none; -webkit-text-fill-color: currentColor; }
.section-head__title { margin-top: 12px; font-size: clamp(30px, 3.6vw, 44px); font-weight: 500; line-height: 1.08; text-wrap: balance; }
.section-head__lead { margin-top: 14px; color: var(--muted); font-size: 16px; }
.steps-grid, .mpage-grid { gap: 1px; background: var(--line); }
.step-card, .mpage-card, .quote__inner, .mpage-faq__item, .pack, .auth__card, .empty, .canvas-empty, .rcard, .admin__stat, .admin__table-wrap, .danger-zone {
  background: var(--card); border: 0.5px solid var(--line-strong); box-shadow: none;
}
.step-card { padding: 32px 28px; transition: border-color 160ms ease; }
.step-card:hover, .mpage-card:hover, .rcard:hover { border-color: var(--accent); box-shadow: none; transform: none; }
.step-card__num {
  width: auto; height: auto; margin-bottom: 28px; justify-content: flex-start;
  color: var(--accent); background: transparent; font: 500 12px/1.2 var(--font-mono); box-shadow: none;
}
.step-card__num::before { content: "0"; }
.step-card__title { margin-bottom: 10px; font-size: 20px; font-weight: 500; }
.step-card__text { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.rule-list { gap: 8px; }
.rule-pill, .tag, .rchip {
  color: var(--muted-2); background: var(--bg-alt); border: 0.5px solid var(--line);
  padding: 5px 9px; font: 400 11px/1.35 var(--font-mono);
}
.sources-web .tile-label, .sources-web .limier-label { color: var(--fg); }
.sources-web .tile-label--anon { color: var(--muted-2); }
.sources-web .link { stroke: var(--accent); }
.sources-web .spine { stroke: var(--accent); }
.quote__inner { max-width: 720px; padding: 32px 28px; border-left: 2px solid var(--accent); }
.quote__mark { color: var(--accent); }
.quote__text { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.quote__author { border-top: 0.5px solid var(--line); }
.quote__avatar { background: var(--bg-alt); color: var(--accent); font: 400 11px/1 var(--font-mono); }
.quote__name, .quote__role { font-family: var(--font-mono); }
.quote__name { color: var(--fg); font-size: 12px; }
.quote__role { color: var(--muted-2); font-size: 11px; }
.cta-band { padding: 88px 0 96px; background: var(--bg-alt); color: var(--fg); border-top: 0.5px solid var(--line); }
.cta-band__title { font-size: clamp(30px, 3.6vw, 44px); font-weight: 500; color: var(--fg); }
.cta-band__text { color: var(--muted); font-size: 16px; }

/* Search workspace */
.appbar { background: rgba(250, 250, 248, 0.9); border-bottom: 0.5px solid var(--line); }
.appbar__inner, .workspace { width: 100%; max-width: 1180px; padding-inline: clamp(20px, 4vw, 48px); }
.appbar__inner { height: 64px; }
.rail { top: 64px; padding: 32px 32px 32px 0; border-right: 0.5px solid var(--line); }
.rail__form { gap: 24px; }
.rail__field label, .rail__hint, .rail__count { font: 400 11px/1.5 var(--font-mono); }
.rail__field label { color: var(--fg); letter-spacing: 0.08em; text-transform: uppercase; }
.rail__hint { color: var(--muted-2); }
.dropzone { padding: 30px 24px; border: 0.5px dashed var(--line-strong); background: var(--bg-alt); color: var(--muted-2); transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease; }
.dropzone:hover, .dropzone:focus-within, .dropzone.is-dragover { border-color: var(--accent); color: var(--accent); background: var(--card); box-shadow: none; }
.dropzone__prompt, .dropzone__file { font-family: var(--font-mono); font-size: 11px; }
.dropzone__prompt strong { color: var(--fg); font-weight: 500; }
.dropzone.has-file { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.segmented { padding: 0; gap: 1px; background: var(--line); border: 0.5px solid var(--line); }
.segmented__opt span { padding: 10px 8px; color: var(--muted-2); background: var(--bg-alt); font: 400 11px/1.3 var(--font-mono); }
.segmented__opt input:checked + span { color: var(--fg); background: var(--card); box-shadow: none; }
.segmented__opt input:focus-visible + span { outline: 0; box-shadow: 0 0 0 3px rgba(36, 82, 224, 0.35); }
textarea, .auth__field input, .danger-zone__form input, .admin__inline input {
  color: var(--fg); background: var(--card); border: 0.5px solid var(--line-strong); padding: 12px 14px; box-shadow: none;
}
textarea:focus, .auth__field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(36, 82, 224, 0.35); }
.canvas { padding: 32px 0; }
.canvas-empty { min-height: 360px; padding: 32px; border-style: dashed; }
.canvas-empty__icon, .empty__icon { width: auto; height: auto; margin-bottom: 14px; background: transparent; color: var(--accent); }
.canvas-empty__title, .empty__title { color: var(--fg); font-size: 20px; font-weight: 500; }
.canvas-empty__text, .empty__text { color: var(--muted); max-width: 42ch; }
.run-indicator { padding: 10px 14px; background: var(--card); border: 0.5px solid var(--line-strong); box-shadow: none; }
.run-indicator__main, .run-indicator__stop { font: 400 11px/1.3 var(--font-mono); }
.run-indicator__stop { color: var(--accent); background: transparent; border: 0.5px solid var(--accent); padding: 7px 10px; }
.run-indicator__spinner { border-color: var(--line-strong); border-top-color: var(--accent); }

/* Progress and result leaderboard */
.run, .rlive { margin-top: 32px; }
.progress-bar__fill { transition: width 0.2s ease; }
.progress-bar__spinner { border-color: var(--line-strong); border-top-color: var(--accent); }
.progress-bar__label { font: 400 11px/1.5 var(--font-mono); color: var(--muted); }
.progress-bar__text { color: var(--fg); }
.rlive__restored { padding: 10px 14px; background: var(--bg-alt); border: 0.5px solid var(--line); color: var(--muted); font: 400 11px/1.5 var(--font-mono); }
.rlive__restored-clear { color: var(--accent); border: 0.5px solid var(--accent); background: transparent; font: inherit; }
.rlive__head { padding-bottom: 16px; border-bottom: 0.5px solid var(--line); }
.rlive__counts { gap: 16px; }
.rlive__count, .rlive__tags-label { color: var(--muted-2); background: transparent; border: 0; padding: 0; font: 400 11px/1.4 var(--font-mono); }
.rlive__count b { color: var(--accent); font-weight: 500; }
.rlive__list { gap: 8px; }
.rlive__divider { color: var(--muted-2); font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.1em; }
.rlive__divider::after { height: 0.5px; background: var(--line); }
.rcard { transition: border-color 160ms ease; }
.rcard[data-relevant="0"] { background: var(--bg-alt); opacity: 0.82; }
.rcard { height: auto; }
.rcard__line { min-height: 72px; padding: 14px 16px; }
.rcard__title {
  flex: 1 1 18ch; min-width: 12ch;
  color: var(--fg); font-size: 15px; font-weight: 500;
}
.rcard__line .rcard__chips {
  flex: 0 1 auto; max-width: 44%; flex-wrap: wrap; justify-content: flex-end;
}
.rcard__src, .rcard__date, .rcard__label { color: var(--muted-2); font-family: var(--font-mono); font-size: 11px; }
.rcard__label { color: var(--accent); letter-spacing: 0.1em; }
.rchip { color: var(--muted-2); background: var(--bg-alt); }
.rchip--rate { color: var(--accent); background: var(--accent-soft); }
.rcard__details-inner { padding: 0 16px; }
.rcard__details, .rcard__details-inner { transition: none; }
.rcard__reason, .rcard__summary { color: var(--muted); font-size: 14px; line-height: 1.6; }
.rcard__link { color: var(--accent); font-family: var(--font-mono); font-size: 11px; }
.matchbar { background: linear-gradient(90deg, var(--accent) 0, var(--accent) var(--match), var(--line) var(--match)); }
.matchbar--pending { background: var(--line); animation: none; }
.rcard--top .rcard__line::before { color: var(--accent); background: var(--accent-soft); border: 0.5px solid var(--accent); padding: 4px 8px; font: 400 10px/1 var(--font-mono); }
.rmodal { background: rgba(28, 25, 23, 0.32); }
.rmodal__close { top: 0; right: 0; width: 36px; height: 36px; background: var(--card); border: 0.5px solid var(--line-strong); box-shadow: none; }
.empty { padding: 48px 28px; }
.alert { border: 0.5px solid var(--line); padding: 16px 18px; }
.alert--error { background: var(--err-bg); color: var(--err); }

/* Account, auth, credits, admin and legal pages */
.auth { max-width: 480px; margin: 88px auto; }
.auth__card { padding: 32px 28px; }
.auth__title, .credits__title, .account-page__title, .admin__title, .legal__title { font-size: clamp(30px, 3.6vw, 44px); font-weight: 500; letter-spacing: -0.025em; }
.auth__sub, .credits__balance, .account-page__sub, .admin__sub { color: var(--muted); font-size: 15px; }
.auth__field label, .danger-zone__label { color: var(--muted-2); font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.auth__field input { font-size: 15px; }
.auth__error { background: var(--err-bg); border: 0.5px solid var(--err); color: var(--err); }
.auth__sep { color: var(--muted-2); font: 400 11px/1.4 var(--font-mono); }
.auth__alt { color: var(--muted-2); font-size: 13px; }
.account-page, .credits, .admin { max-width: 780px; margin: 88px auto 96px; }
.account-page__section, .admin__section-title { margin-top: 48px; padding-bottom: 10px; border-bottom: 0.5px solid var(--line); color: var(--fg); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; }
.account-row { padding: 16px 0; border-bottom: 0.5px solid var(--line); }
.account-row__label { color: var(--muted-2); font: 400 11px/1.4 var(--font-mono); }
.account-row__value { color: var(--fg); font-size: 15px; }
.danger-zone { padding: 24px; }
.danger-zone__title { font-size: 18px; font-weight: 500; }
.danger-zone__desc { color: var(--muted); font-size: 14px; }
.btn--danger { color: #fff; background: var(--err); border-color: var(--err); }
.credits__banner { padding: 14px; background: var(--bg-alt); border: 0.5px solid var(--line); font: 400 11px/1.5 var(--font-mono); }
.credits__packs { gap: 1px; background: var(--line); }
.pack { padding: 32px 28px; text-align: left; }
.pack__label { font: 400 12px/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.pack__credits strong, .pack__price { color: var(--accent); font-weight: 500; }
.pack__credits strong { font-size: 32px; }
.pack__unit { color: var(--muted-2); font: 400 11px/1.4 var(--font-mono); }
.admin { max-width: 1180px; }
.admin__stats { gap: 1px; background: var(--line); }
.admin__stat { padding: 24px; }
.admin__stat-value { color: var(--accent); font-size: 32px; font-weight: 500; }
.admin__stat-label, .admin__table thead th { color: var(--muted-2); font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.1em; }
.admin__table thead th { background: var(--bg-alt); }
.legal { padding: 88px 0 96px; }
.legal__updated { color: var(--muted-2); font: 400 11px/1.4 var(--font-mono); }
.legal h2 { margin-top: 40px; font-size: 20px; font-weight: 500; }
.legal p, .legal li { color: var(--muted); font-size: 15px; line-height: 1.75; }
.legal a { color: var(--accent); }
.mpage-hero { padding: 88px 0 56px; border-bottom: 0.5px solid var(--line); }
.mpage-hero__inner { max-width: 780px; }
.mpage-hero__crumb, .mpage-hero__trust { color: var(--muted-2); font: 400 11px/1.5 var(--font-mono); }
.mpage-hero__title { max-width: 20ch; font-size: clamp(38px, 5vw, 64px); font-weight: 500; line-height: 1.06; }
.mpage-hero__accent { color: var(--accent); }
.mpage-hero__pitch { max-width: 58ch; color: var(--muted); font-size: 16px; line-height: 1.7; }
.mpage-card { padding: 32px 28px; transition: border-color 160ms ease; }
.mpage-card__title { font-size: 20px; font-weight: 500; }
.mpage-card__text { color: var(--muted); font-size: 14px; }
.mpage-card__cta { color: var(--accent); font: 400 11px/1.4 var(--font-mono); }
.mpage-faq { gap: 1px; background: var(--line); }
.mpage-faq__item { padding: 20px 22px; }
.mpage-faq__q { color: var(--fg); font-size: 16px; font-weight: 500; }
.mpage-faq__a { color: var(--muted); }

/* Footer */
.site-footer { padding: 64px 0 0; background: var(--bg-alt); border-top: 0.5px solid var(--line); }
.site-footer__inner { grid-template-columns: minmax(0, 1.2fr) 2fr; gap: 40px; padding-bottom: 44px; }
.site-footer__brand .brand__name { font-size: 20px; font-weight: 600; }
.site-footer__note { max-width: 36em; color: var(--muted-2); font-size: 14px; }
.site-footer__title { color: var(--muted-2); font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.12em; }
.site-footer__col a { color: var(--muted); font: 400 12px/1.5 var(--font-mono); border-bottom: 0.5px solid transparent; }
.site-footer__col a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.site-footer__bottom { border-top: 0.5px solid var(--line); color: var(--muted-2); font: 400 11px/1.5 var(--font-mono); }
.feedback__toggle { padding: 14px 20px; color: #fff; background: var(--accent); border: 0.5px solid var(--accent); box-shadow: none; font: 400 11px/1.3 var(--font-mono); }
.feedback__toggle:hover { transform: none; }
.feedback__panel { background: var(--card); border: 0.5px solid var(--line-strong); box-shadow: none; }

/* The former scroll reveal is intentionally static in the light print system. */
.reveal, .reveal.is-revealed { opacity: 1; transform: none; transition: none; }

@media (max-width: 880px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__preview { max-width: 460px; margin-top: 24px; }
  .workspace { padding-block: 18px 40px; }
  .rail { padding: 0; border-right: 0; }
  .canvas { padding: 0; }
  .account-page, .credits, .admin { margin-top: 56px; }
}
@media (max-width: 720px) {
  .site-footer { padding-top: 44px; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .site-footer__cols { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .hero { padding-top: 56px; }
  .hero__title { font-size: clamp(44px, 14vw, 60px); }
  .hero__actions, .mpage-hero__actions { align-items: stretch; flex-direction: column; }
  .hero__actions .btn, .mpage-hero__actions .btn { width: 100%; }
  .hero-deck { height: 300px; }
  .site-nav { gap: 10px; }
  .site-nav a:not(.btn) { display: none; }
  .appbar .btn { display: none; }
  .credits__packs { grid-template-columns: 1fr; }
  .account-row { flex-wrap: wrap; }
}
@media (max-width: 880px) {
  .rcard__line .rcard__chips { max-width: none; }
  .rlive__list .rcard__title { min-width: 0; }
}
