/* ---------- Thème ---------- */
:root {
  color-scheme: light;
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --surface-3: #e8ebf4;
  --border: #e3e6ef;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #6b7489;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --accent-text: #ffffff;
  --good: #16a34a;
  --warning: #d97706;
  --critical: #dc2626;
  --good-soft: #e3f6ea;
  --warning-soft: #fdf1dc;
  --critical-soft: #fde7e7;
  --ring-track: #e6e9f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  --radius: 14px;
  --radius-sm: 9px;
  --series-1: #4f46e5;
  --series-2: #ea580c;
  --series-3: #0d9488;
  --series-4: #ca8a04;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d14;
    --surface: #131722;
    --surface-2: #1a1f2d;
    --surface-3: #232a3b;
    --border: #262d3f;
    --text: #e7eaf3;
    --text-2: #b3bbcd;
    --muted: #8690a7;
    --accent: #818cf8;
    --accent-2: #a78bfa;
    --accent-soft: #1d2148;
    --accent-text: #0b0d14;
    --good: #4ade80;
    --warning: #fbbf24;
    --critical: #f87171;
    --good-soft: #12301f;
    --warning-soft: #352a10;
    --critical-soft: #3a1717;
    --ring-track: #262d3f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    --series-1: #818cf8;
    --series-2: #fb923c;
    --series-3: #2dd4bf;
    --series-4: #facc15;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d14;
  --surface: #131722;
  --surface-2: #1a1f2d;
  --surface-3: #232a3b;
  --border: #262d3f;
  --text: #e7eaf3;
  --text-2: #b3bbcd;
  --muted: #8690a7;
  --accent: #818cf8;
  --accent-2: #a78bfa;
  --accent-soft: #1d2148;
  --accent-text: #0b0d14;
  --good: #4ade80;
  --warning: #fbbf24;
  --critical: #f87171;
  --good-soft: #12301f;
  --warning-soft: #352a10;
  --critical-soft: #3a1717;
  --ring-track: #262d3f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
  --series-1: #818cf8;
  --series-2: #fb923c;
  --series-3: #2dd4bf;
  --series-4: #facc15;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-size: 1.75rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .35rem; font-weight: 700; }
h2 { font-size: 1.08rem; letter-spacing: -.01em; margin: 0 0 .85rem; font-weight: 650; }
h3 { font-size: .95rem; margin: 1.1rem 0 .55rem; font-weight: 650; }
p.lead { color: var(--text-2); margin: 0 0 1.6rem; max-width: 70ch; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { font: .86em ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

/* ---------- Mise en page : barre latérale ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.2rem;
  padding: 1.1rem .8rem; background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .6rem; padding: .3rem .55rem; font-weight: 750; font-size: 1.05rem;
  color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 4px 12px rgba(79, 70, 229, .35); }
.logo svg { width: 18px; height: 18px; }
.side-nav { display: grid; gap: .15rem; }
.side-foot { margin-top: auto; display: grid; gap: .15rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: var(--text-2); text-decoration: none; font-weight: 550; font: inherit; font-weight: 550; background: none;
  border: 0; cursor: pointer; text-align: left; width: 100%; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.ico { width: 19px; height: 19px; flex: 0 0 19px; }

main { padding: 2.2rem clamp(1rem, 3vw, 2.6rem) 4rem; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { margin-bottom: 1.4rem; }
.page-head .lead { margin-bottom: 0; }

h1, h2 { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: .4rem;
    padding: .5rem .75rem; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .brand > span:last-child { display: none; }
  .side-nav, .side-foot { display: flex; gap: .1rem; margin: 0; border: 0; padding: 0; }
  .nav-link { width: auto; padding: .5rem .6rem; white-space: nowrap; }
  .nav-link span { display: none; }
  .nav-link.active span { display: inline; }
  main { padding: 1.4rem 1rem 3rem; }
  .btn { white-space: normal; }
  /* En-têtes de page avec boutons : les boutons passent sous le titre et peuvent aller à la ligne. */
  main > .row > div { flex: 1 1 100% !important; flex-wrap: wrap; }
  .card { padding: 1.1rem 1rem; }
  .checks li { grid-template-columns: 1fr; gap: .3rem; }
  .toasts { right: 1rem; bottom: 1rem; }
}

/* ---------- Cartes et grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem 1.45rem;
  margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.grid.two > .card { margin-bottom: 0; }
.grid.two + .card, .grid.two + section, .grid.two + form, .grid.two + .grid { margin-top: 1.25rem; }
.grid.tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1rem; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "+"; display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; margin-right: .5rem;
  border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
details.card[open] > summary::before { content: "–"; }
details.card[open] > summary { margin-bottom: .4rem; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; margin: .85rem 0 .35rem; font-size: .88rem; color: var(--text); }
input[type=text], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input[type=text]:focus, input[type=url]:focus, input[type=date]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
input[type=file] { font: inherit; width: 100%; padding: .55rem; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-2); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: .8rem; padding: .4rem .8rem; border: 0;
  border-radius: 7px; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 180px; }
details > summary { cursor: pointer; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .58rem 1.05rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s, transform .05s, box-shadow .15s;
  white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-text);
  box-shadow: 0 4px 14px rgba(79, 70, 229, .28); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--critical); }
.btn.danger:hover { background: var(--critical-soft); }
.btn.small { padding: .34rem .7rem; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
form.inline { display: inline; }

/* ---------- Messages ---------- */
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.1rem; border: 1px solid var(--border); background: var(--surface); }
.flash.ok { background: var(--good-soft); border-color: transparent; }
.flash.error { background: var(--critical-soft); border-color: transparent; }
.flash.warn { background: var(--warning-soft); border-color: transparent; }
.toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 50; display: grid; gap: .6rem; width: min(420px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .7rem; align-items: start; padding: .8rem .9rem .8rem 1rem; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); border-left: 4px solid var(--good); box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out; }
.toast.error { border-left-color: var(--critical); }
.toast.warn { border-left-color: var(--warning); }
.toast > span { flex: 1; font-size: .92rem; }
.toast-close { border: 0; background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 .2rem; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* Écran d'attente des traitements longs */
.busy { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(10, 12, 20, .45);
  backdrop-filter: blur(3px); }
.busy[hidden] { display: none; }
.busy-box { background: var(--surface); border-radius: var(--radius); padding: 1.6rem 1.8rem; box-shadow: var(--shadow-lg);
  display: grid; gap: .6rem; justify-items: center; text-align: center; max-width: 380px; margin: 1rem; font-weight: 600; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3.5px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-note { display: none; color: var(--text-2); margin-top: .5rem; }

/* ---------- Tuiles de score ---------- */
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow); display: grid; gap: .35rem; }
.tile .label { color: var(--text-2); font-size: .86rem; font-weight: 600; }
.tile-body { display: flex; align-items: center; gap: .9rem; }
.tile .value { font-size: 2rem; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; display: none; }
.tile .value small { font-size: .95rem; color: var(--muted); font-weight: 500; }
.ring { --p: 0; --c: var(--accent); width: 72px; height: 72px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--ring-track) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring-value { position: relative; font-weight: 750; font-size: 1.3rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile.hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.tile.hero .ring { width: 104px; height: 104px; }
.tile.hero .ring::before { inset: 9px; }
.tile.hero .ring-value { font-size: 2rem; }
.lvl-good .ring { --c: var(--good); }
.lvl-warning .ring { --c: var(--warning); }
.lvl-critical .ring { --c: var(--critical); }
.meter { display: none; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 4px; }
.lvl-good .meter > span { background: var(--good); }
.lvl-warning .meter > span { background: var(--warning); }
.lvl-critical .meter > span { background: var(--critical); }
.tile .verdict { font-size: .85rem; color: var(--text-2); }
.tile-body + .verdict, .tile-body ~ .verdict { margin-top: .1rem; }

/* ---------- Badges de statut : toujours icône + texte ---------- */
.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 650; padding: .14rem .55rem;
  border-radius: 999px; white-space: nowrap; color: var(--text); }
.status::before { font-weight: 800; }
.status.pass { background: var(--good-soft); }
.status.pass::before { content: "✓"; color: var(--good); }
.status.warn { background: var(--warning-soft); }
.status.warn::before { content: "!"; color: var(--warning); }
.status.fail { background: var(--critical-soft); }
.status.fail::before { content: "✕"; color: var(--critical); }

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: grid; grid-template-columns: 104px 1fr; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--border); }
.checks li:first-child { border-top: 0; }
.checks .advice { color: var(--text-2); font-size: .89rem; margin-top: .15rem; }

/* ---------- Puces de mots-clés ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .24rem .65rem; border-radius: 999px; font-size: .84rem;
  border: 1px solid var(--border); background: var(--surface); cursor: default; }
.chip.ok { background: var(--good-soft); border-color: transparent; }
.chip.ok::before { content: "✓"; color: var(--good); font-weight: 800; }
.chip.miss { background: var(--critical-soft); border-color: transparent; }
.chip.miss::before { content: "✕"; color: var(--critical); font-weight: 800; }
.chip .tag { font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); font-weight: 650; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; margin: 0 -.3rem; }
table { width: 100%; border-collapse: collapse; font-size: .91rem; }
th, td { text-align: left; padding: .6rem .65rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 650; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-cell { min-width: 130px; }
.bar { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin: .4rem 0 .2rem; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; }

.suggestions { list-style: none; padding: 0; margin: 0; }
.suggestions li { display: flex; gap: .7rem; padding: .65rem 0; border-top: 1px solid var(--border); align-items: baseline; }
.suggestions li:first-child { border-top: 0; }

details.offer { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem 1rem; margin-bottom: .6rem;
  background: var(--surface); transition: border-color .15s; }
details.offer:hover { border-color: var(--surface-3); }
details.offer[open] { border-color: var(--accent-soft); box-shadow: var(--shadow); }
details.offer summary { cursor: pointer; font-weight: 600; }
details.offer pre { white-space: pre-wrap; font: inherit; color: var(--text-2); max-height: 320px; overflow: auto; }

.checklist { max-height: 270px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .3rem .4rem; }
.checklist label { font-weight: 450; display: flex; gap: .6rem; align-items: baseline; margin: 0; padding: .45rem .5rem; border-radius: 7px; cursor: pointer; }
.checklist label:hover { background: var(--surface-2); }

.rewrite { border-left: 3px solid var(--accent); padding: .35rem 0 .35rem .9rem; margin: .9rem 0; }
.rewrite .before { color: var(--muted); text-decoration: line-through; }
.rewrite .after { font-weight: 600; }

code.query { display: block; background: var(--surface-2); padding: .6rem .75rem; border-radius: 8px; margin: .4rem 0; font-size: .87rem; word-break: break-word; }
.query-block { margin: .6rem 0 1rem; }
.query-block code.query { margin-bottom: .35rem; }
.query-links { display: flex; gap: .4rem; flex-wrap: wrap; }
.query-links a { padding: .15rem .6rem; border-radius: 999px; background: var(--accent-soft); text-decoration: none; font-weight: 600; }

.pipeline { display: flex; gap: .6rem; flex-wrap: wrap; }
.pipeline .step { flex: 1 1 110px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .7rem .9rem; box-shadow: var(--shadow); }
.pipeline .step b { font-size: 1.55rem; display: block; letter-spacing: -.02em; }

/* ---------- Graphique d'évolution ---------- */
.legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; font-size: .87rem; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-wrap { position: relative; overflow-x: auto; }
.chart-wrap svg { width: 100%; min-width: 520px; height: auto; display: block; }
.chart-wrap .grid { stroke: var(--border); stroke-width: 1; }
.chart-wrap .axis { stroke: var(--muted); stroke-width: 1; }
.chart-wrap .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-wrap .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart-wrap .dot { stroke: var(--surface); stroke-width: 2; }
.chart-wrap .end-label { fill: var(--text-2); font-size: 12px; }
.chart-wrap .crosshair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip { position: absolute; top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: .55rem .75rem; font-size: .85rem; box-shadow: var(--shadow-lg); pointer-events: none; min-width: 170px; }
.tip-row { display: flex; align-items: center; gap: .4rem; }
.tip-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.delta { font-weight: 650; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--critical); }
.delta.same { color: var(--muted); }

/* ---------- Candidatures ---------- */
.score-badge { display: inline-block; min-width: 2.1rem; text-align: center; font-size: .76rem; font-weight: 750;
  padding: .06rem .42rem; border-radius: 6px; font-variant-numeric: tabular-nums; }
.score-badge.lvl-good { background: var(--good-soft); }
.score-badge.lvl-warning { background: var(--warning-soft); }
.score-badge.lvl-critical { background: var(--critical-soft); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: var(--surface-2); border-radius: var(--radius); padding: .7rem; min-height: 180px; border: 2px dashed transparent;
  transition: border-color .15s, background .15s; }
.kanban-col.over { border-color: var(--accent); background: var(--accent-soft); }
.kanban-col h3 { margin: .1rem 0 .7rem; display: flex; gap: .4rem; align-items: center; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .7rem;
  margin-bottom: .55rem; cursor: grab; display: grid; gap: .15rem; box-shadow: var(--shadow); transition: transform .1s; }
.kanban-card:hover { transform: translateY(-1px); }
.kanban-card.dragging { opacity: .5; }
.kanban-head { display: flex; justify-content: space-between; gap: .4rem; align-items: baseline; }

.letter-print { display: none; white-space: pre-wrap; }

/* Aperçu du CV généré : rendu « papier » clair, quel que soit le thème */
.cv-sheet { background: #fff; color: #111; border: 1px solid var(--border); border-radius: 8px; padding: 2rem 2.2rem;
  max-width: 800px; margin: 0 auto; font-size: .93rem; }
.cv-sheet .muted { color: #555; }
.cv-name { font-size: 1.7rem; font-weight: 750; }
.cv-title { color: #2f3b8f; font-weight: 650; font-size: 1.05rem; margin-bottom: .2rem; }
.cv-sheet h3 { color: #2f3b8f; text-transform: uppercase; font-size: .86rem; letter-spacing: .04em;
  border-bottom: 1px solid #2f3b8f; padding-bottom: .15rem; margin: 1.1rem 0 .5rem; }
.cv-line { display: flex; justify-content: space-between; gap: 1rem; margin-top: .4rem; }
.cv-line em { white-space: nowrap; color: #555; }
.cv-sheet ul { margin: .2rem 0 .4rem; padding-left: 1.2rem; }

/* ---------- Comptes ---------- */
.logout-form { display: contents; }
.auth-wrap { min-height: 70vh; display: grid; place-items: center; }
.auth-card { width: min(100%, 420px); padding: 1.8rem; }
.auth-card h1 { margin-bottom: .2rem; }
input[type=email], input[type=password] { width: 100%; padding: .6rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
input[type=email]:focus, input[type=password]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn.block { width: 100%; margin-top: 1.1rem; }

/* ---------- Score par axe, profil, orthographe, recherche ---------- */
.axes { display: grid; gap: .7rem; }
.axis { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 3rem; gap: .8rem; align-items: center; }
.axis .bar { margin: 0; height: 10px; }
.axis .bar > span { background: var(--accent); }
.axis.lvl-good .bar > span { background: var(--good); }
.axis.lvl-warning .bar > span { background: var(--warning); }
.axis.lvl-critical .bar > span { background: var(--critical); }
.axis b { text-align: right; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-size: .86rem; }
.kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.timeline li { border-left: 3px solid var(--accent-soft); padding: .1rem 0 .1rem .9rem; }
.timeline .when { color: var(--muted); font-size: .84rem; }
.spell-list { list-style: none; padding: 0; margin: 0; }
.spell-list li { padding: .6rem 0; border-top: 1px solid var(--border); }
.spell-list li:first-child { border-top: 0; }
.spell-list mark { background: var(--critical-soft); color: inherit; border-bottom: 2px solid var(--critical); padding: 0 .1rem; }
.job-card { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: start; padding: .9rem 0;
  border-top: 1px solid var(--border); }
.job-card:first-child { border-top: 0; }
.job-card .ring { width: 56px; height: 56px; }
.job-card .ring::before { inset: 6px; }
.job-card .ring-value { font-size: 1rem; }
.btn-group { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
@media (max-width: 700px) {
  .axis { grid-template-columns: 1fr 3rem; }
  .axis .bar { grid-column: 1 / -1; grid-row: 2; }
  .job-card { grid-template-columns: auto 1fr; }
  .job-card > :last-child { grid-column: 1 / -1; }
}

/* ---------- Réglages et IA ---------- */
.engine-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.engine-choice { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .3rem .8rem .8rem; margin: 0; }
.engine-choice legend { font-weight: 650; padding: 0 .35rem; font-size: .92rem; }
.radio-card { display: flex; gap: .65rem; align-items: start; font-weight: 450; margin: .45rem 0 0; padding: .55rem .65rem;
  border: 1px solid var(--border); border-radius: 9px; cursor: pointer; transition: border-color .15s, background .15s; }
.radio-card:hover { background: var(--surface-2); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: .2rem; }
.radio-card > span { display: grid; }
.switch { display: flex; gap: .7rem; align-items: start; font-weight: 450; margin-top: 1.2rem; cursor: pointer; }
.switch input { margin-top: .25rem; }
.switch > span { display: grid; gap: .15rem; }
.state-row { display: flex; align-items: center; gap: .55rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot.ok { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.dot.bad { background: var(--critical); box-shadow: 0 0 0 4px var(--critical-soft); }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin-top: .4rem; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.engine-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 650; padding: .16rem .6rem;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: .4rem; }
.engine-pill::before { content: "☁"; }
.engine-pill.local::before { content: "⌂"; }

/* ---------- Positionnement marché ---------- */
.stack-bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.stack-bar .seg { display: grid; place-items: center; min-width: 2rem; font-size: .8rem; font-weight: 700; color: #fff; }
.stack-bar .seg.lvl-good { background: var(--good); }
.stack-bar .seg.lvl-warning { background: var(--warning); }
.stack-bar .seg.lvl-critical { background: var(--critical); }
:root[data-theme="dark"] .stack-bar .seg { color: #0b0d14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stack-bar .seg { color: #0b0d14; } }

/* ---------- Ma recherche, sources d'offres, entreprises suivies ---------- */
.choice-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.choice-grid .radio-card { margin: 0; }
.source-list { display: grid; gap: .5rem; }
.source-card > span { gap: .25rem; }
.source-card > span > .status { justify-self: start; }
.radio-card.static { cursor: default; }
.source-status { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: -.4rem 0 1rem; }
.source-tag { display: inline-block; margin-left: .4rem; padding: 0 .45rem; border-radius: 999px; background: var(--surface-2);
  font-size: .74rem; color: var(--text-2); }
.ring-empty { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
  border: 2px dashed var(--border); font-weight: 700; }

/* ---------- Compte : consommation du forfait ---------- */
.usage { display: grid; gap: .65rem; margin-top: 1.1rem; }
.usage-row { display: grid; grid-template-columns: minmax(170px, 240px) 1fr minmax(5rem, auto); gap: .8rem; align-items: center; }
.usage-row b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .usage-row { grid-template-columns: 1fr auto; }
  .usage-row .meter { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Connexion ---------- */
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.label-row label { margin-bottom: .35rem; }
.google-btn { margin-top: 1rem; gap: .6rem; }
.or-sep { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .85rem; margin: 1rem 0 .2rem; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Pages publiques : barre du haut, accueil, tarifs, pages légales ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-in, .site-foot-in { max-width: 1160px; margin: 0 auto; padding: .6rem 16px; display: flex; align-items: center; gap: 1rem; }
.top-nav { display: flex; gap: .2rem; margin-left: 1rem; }
.top-nav a { padding: .45rem .7rem; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 550; }
.top-nav a:hover, .top-nav a.active { background: var(--surface-2); color: var(--text); }
.top-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover, .btn.ghost.active { background: var(--surface-2); }
.btn.big { padding: .8rem 1.4rem; font-size: 1rem; border-radius: 11px; }
main.public { max-width: 1160px; margin: 0 auto; padding: 0 16px 4rem; min-width: 0; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: .25rem .7rem; border-radius: 999px; margin-bottom: 1rem; }
.center { text-align: center; }

.landing-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 3rem; align-items: center; padding: 4.5rem 0 3.5rem; }
.landing-hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); letter-spacing: -.035em; line-height: 1.07; margin-bottom: 1rem; }
.hero-lead { font-size: 1.12rem; color: var(--text-2); max-width: 56ch; margin: 0 0 1.6rem; }
.hero-cta { display: flex; gap: .7rem; flex-wrap: wrap; }
.hero-points { list-style: none; padding: 0; margin: 1.4rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; color: var(--text-2); }
.hero-points li { display: inline-flex; align-items: center; gap: .35rem; }
.hero-points .ico { color: var(--good); width: 17px; height: 17px; }
.demo-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-lg); transform: rotate(.6deg); }
.demo-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.demo-scores { display: flex; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; flex-wrap: wrap; }
.demo-scores > div { display: grid; justify-items: center; gap: .35rem; color: var(--text-2); }

.band { padding: 3rem 0 1rem; }
.section-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -.02em; margin-bottom: 1.2rem; }
.section-lead { color: var(--text-2); max-width: 68ch; margin: -.4rem 0 1.4rem; font-size: 1.02rem; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.steps b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.steps h3, .features h3 { margin: .8rem 0 .3rem; font-size: 1.02rem; }
.steps p, .features p { margin: 0; color: var(--text-2); font-size: .93rem; }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.features article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.feat-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.feat-ico .ico { width: 21px; height: 21px; }
.compare-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 .6rem; }
.compare-table td:first-child { font-weight: 600; }
.compare-table .status { margin-right: .3rem; }

.small-plans { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.plan-mini { flex: 1 1 180px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem;
  display: grid; gap: .1rem; }
.plan-mini.featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-mini .price { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; }

.pricing-head { text-align: center; padding-top: 3.5rem; }
.pricing-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.03em; }
.pricing-head .section-lead { margin: .4rem auto 1.4rem; }
.billing-toggle { display: inline-flex; gap: .2rem; padding: .25rem; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.billing-toggle button { font: inherit; font-weight: 600; border: 0; background: none; color: var(--text-2); padding: .45rem 1rem;
  border-radius: 8px; cursor: pointer; }
.billing-toggle button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tag-save { font-size: .72rem; color: var(--good); font-weight: 750; }
.plans { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); margin: 1.8rem 0 1rem; align-items: start; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.6rem;
  box-shadow: var(--shadow); display: grid; gap: .2rem; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lg); }
.plan h2 { margin: 0; font-size: 1.25rem; }
.plan-badge { position: absolute; top: -.75rem; right: 1.2rem; font-size: .74rem; font-weight: 750; padding: .22rem .7rem;
  border-radius: 999px; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.plan-price { margin: .9rem 0 .4rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem; }
.plan-price b { font-size: 2.3rem; letter-spacing: -.03em; line-height: 1; }
.plan-price span { color: var(--muted); }
.plan-price .plan-note { flex-basis: 100%; }
.plan-features { list-style: none; padding: 0; margin: .6rem 0 .4rem; display: grid; gap: .5rem; font-size: .93rem; }
.plan-features li { display: flex; gap: .5rem; align-items: start; }
.plan-features .ico { color: var(--good); width: 18px; height: 18px; flex-basis: 18px; margin-top: .1rem; }
.plan .btn.block { margin-top: .8rem; }
.plan.current { outline: 2px solid var(--good); }
.plan-table td:not(:first-child), .plan-table th:not(:first-child) { text-align: center; }

.faq { display: grid; gap: .6rem; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1.1rem; }
.faq summary { font-weight: 650; }
.faq p { color: var(--text-2); margin: .6rem 0 0; }
.final-cta { text-align: center; padding: 3.5rem 1rem; margin-top: 2rem; border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface)); border: 1px solid var(--border); }
.final-cta h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.02em; }

.legal { max-width: 780px; padding: 2.5rem 0; }
.legal h1 { font-size: 2rem; }
.legal h2 { margin-top: 1.8rem; }
.legal p, .legal li { color: var(--text-2); }
.legal .table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.todo { background: var(--warning-soft); border-radius: 4px; padding: 0 .25rem; font-weight: 600; color: var(--text); }

.site-foot { border-top: 1px solid var(--border); background: var(--surface); margin-top: 2rem; }
.site-foot-in { justify-content: space-between; align-items: start; flex-wrap: wrap; padding-top: 1.6rem; padding-bottom: 1.6rem; }
.site-foot .brand { padding-left: 0; }
.foot-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.foot-links a { color: var(--text-2); }

@media (max-width: 900px) {
  .landing-hero { grid-template-columns: minmax(0, 1fr); padding-top: 2.5rem; gap: 2rem; }
  .demo-card { transform: none; }
  .top-nav { display: none; }
  .topbar .brand > span:last-child { display: inline; }
}
@media (max-width: 520px) {
  .topbar .brand > span:last-child { display: none; }
  .top-actions .btn.ghost { padding-left: .5rem; padding-right: .5rem; }
}

/* ---------- Impression ---------- */
@media print {
  .sidebar, .no-print, form, .toasts, .busy { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card, .tile { break-inside: avoid; border-color: #ccc; box-shadow: none; }
  .tile .value { display: block; }
  .ring { display: none; }
  textarea.letter { display: none; }
  .letter-print { display: block; }
}
