/*
 * Charte Uplix : Poppins, bleu #0169E6, filets #E4E4EE, fond gris clair,
 * cartes blanches arrondies. Meme famille visuelle que netlinking.uplix.fr
 * et sentinelle.uplix.fr.
 *
 * Les teintes de series restent celles de la competence dataviz, validees
 * par validate_palette.js (separation CVD et vision normale, clair et
 * sombre) ; seule la premiere est alignee sur le bleu Uplix, de teinte
 * voisine. Le mode sombre a ses propres pas — ce n'est pas une inversion
 * automatique.
 */

:root {
  color-scheme: light;
  --surface-1:   #ffffff;
  --surface-2:   #f0f6ff;
  --plane:       #f5f6f9;
  --ink:         #1a1d29;
  --ink-2:       #4a4d5a;
  --muted:       #8a8d99;
  --grid:        #e9eaf0;
  --axis:        #d3d4de;
  --border:      #e4e4ee;
  --text:        var(--ink);

  --primary:       #0169e6;
  --primary-hover: #0154b8;
  --primary-soft:  #eaf2fe;
  --primary-ink:   #113d8a;

  --series-1: #0169e6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;

  /* Rampe ordinale : plus sombre = plus stable */
  --ord-1: #86b6ef;
  --ord-2: #5598e7;
  --ord-3: #2a78d6;
  --ord-4: #184f95;

  --good:     #00bb52;
  --warning:  #fab219;
  --critical: #e5484d;
  --success-text: #00863b;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
  --side-w: 262px;
}

/* Theme clair par defaut, quel que soit le reglage du systeme : c'est la
   charte Uplix. Le jeu sombre reste disponible via data-theme="dark". */
@supports (color: red) {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --surface-1: #1a1b1f;
    --surface-2: #1d2a3d;
    --plane:     #111214;
    --ink:       #f4f4f6;
    --ink-2:     #c3c4cc;
    --muted:     #8a8d99;
    --grid:      #2a2b31;
    --axis:      #3a3b42;
    --border:    rgba(255, 255, 255, .09);

    --primary:       #3d8bf0;
    --primary-hover: #64a3f4;
    --primary-soft:  #1d2a3d;
    --primary-ink:   #b9d5fb;

    --series-1: #3d8bf0;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --series-6: #008300;

    --ord-1: #184f95;
    --ord-2: #256abf;
    --ord-3: #3987e5;
    --ord-4: #86b6ef;

    --good: #12c463;
    --success-text: #12c463;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 14px/1.6 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, select, textarea { font-family: inherit; }

a { color: var(--primary); }

/* --- Chrome : barre laterale + colonne de contenu ------------------------- */

body.app { display: block; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
  display: flex; flex-direction: column;
  background: var(--surface-1); border-right: 1px solid var(--border);
  padding: .9rem .8rem .7rem; overflow-y: auto; overflow-x: hidden;
}
.side-logo {
  display: flex; align-items: center; gap: .55rem;
  padding: .2rem .55rem .9rem; text-decoration: none; color: var(--ink);
}
.side-logo svg { height: 30px; width: auto; }
.side-logo span { font-weight: 300; font-size: 1.15rem; letter-spacing: -.01em; padding-top: 4px; }

.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-h {
  font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); padding: .55rem .7rem .2rem;
}
.side-h:first-child { padding-top: .2rem; }
.side-nav a {
  display: flex; align-items: center; gap: .7rem;
  padding: .27rem .7rem; border-radius: 10px; white-space: nowrap;
  color: var(--ink); text-decoration: none; font-size: .88rem;
}
.side-nav a:hover { background: var(--plane); }
.side-nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.ico {
  width: 17px; height: 17px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.side-nav a .ico { color: var(--ink-2); }
.side-nav a.on .ico { color: var(--primary); }

.side-user {
  margin-top: auto; padding: .75rem .7rem .1rem;
  border-top: 1px solid var(--border); font-size: .82rem;
}
.side-user .who { display: flex; flex-direction: column; line-height: 1.35; }
.side-user .who span { color: var(--muted); font-size: .76rem; word-break: break-all; }
.side-user .credits {
  margin: .6rem 0 .2rem; padding: .35rem .6rem; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary-ink); font-size: .78rem;
}
.side-logout {
  display: flex; align-items: center; gap: .55rem; margin-top: .6rem;
  color: var(--muted); text-decoration: none; font-size: .82rem;
}
.side-logout:hover { color: var(--ink); }

.shell { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .75rem 1.6rem; min-height: 64px;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.nav-burger { display: none; cursor: pointer; padding: .35rem; border-radius: 8px; color: var(--ink); }
.nav-burger .ico { width: 22px; height: 22px; }

/* Selecteurs en pilule, comme les selecteurs d'espace de travail Uplix. */
.pill-select {
  display: inline-flex; align-items: center; gap: .1rem;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: 999px; padding: .2rem .35rem .2rem .9rem;
  box-shadow: var(--shadow);
}
.pill-select label {
  margin: 0; font-size: .68rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
}
.pill-select select {
  width: auto; max-width: 260px; border: 0; background: transparent;
  padding: .3rem 1.6rem .3rem .45rem; font-weight: 600; font-size: .88rem;
  color: var(--ink); cursor: pointer; outline-offset: 2px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8d99' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .35rem center; background-size: 15px;
}
.pill-select select:focus { outline: 2px solid var(--primary); border: 0; }
.pill-badge {
  display: inline-flex; align-items: center; padding: .25rem .65rem; border-radius: 999px;
  font-size: .76rem; font-weight: 600;
  background: color-mix(in srgb, var(--warning) 22%, var(--surface-1)); color: #8a5a00;
}
.pill-badge.off { background: var(--plane); color: var(--muted); border: 1px solid var(--border); }

.crumb {
  padding: .8rem 1.6rem; font-size: .85rem; font-weight: 500;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
  display: flex; gap: .5rem; align-items: center;
}
.crumb span { color: var(--muted); font-weight: 400; }
.crumb i { color: var(--axis); font-style: normal; }

main { width: 100%; max-width: 1240px; padding: 1.75rem 1.6rem 4rem; flex: 1; }

.pagefoot {
  padding: 1.2rem 1.6rem; color: var(--muted); font-size: .78rem;
  border-top: 1px solid var(--border); background: var(--surface-1);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .nav-toggle:checked ~ .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.18); }
  .nav-toggle:checked ~ .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 25; background: rgba(16,24,40,.25);
  }
  .shell { margin-left: 0; }
  .nav-burger { display: inline-flex; }
  .topbar { padding: .6rem 1rem; }
  .crumb, main, .pagefoot { padding-left: 1rem; padding-right: 1rem; }
  .pill-select select { max-width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
.nav-scrim { display: none; }

h1 { font-size: 1.5rem; font-weight: 600; margin: 0 0 .3rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 2.4rem 0 .5rem; letter-spacing: -.01em; }
h3 { font-size: .95rem; font-weight: 600; margin: 1.4rem 0 .4rem; color: var(--ink-2); }
.sub { color: var(--muted); margin: 0 0 1.2rem; font-size: .9rem; }
.note { color: var(--ink-2); font-size: .87rem; background: var(--surface-1);
        border: 1px solid var(--border); border-left: 3px solid var(--primary);
        border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1rem 0; box-shadow: var(--shadow); }
.empty { color: var(--muted); font-style: italic; padding: 1rem 0; }
.muted { color: var(--muted); }
.legend-note { color: var(--muted); font-size: .8rem; margin: .6rem 0 0; }

.card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.4rem; margin: 1rem 0;
  box-shadow: var(--shadow);
}
.card-k, .eyebrow {
  font-size: .7rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .4rem;
}

.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1.2rem; font-size: .9rem; }
.flash.info    { background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.flash.success { background: color-mix(in srgb, var(--good) 10%, var(--surface-1)); border: 1px solid color-mix(in srgb, var(--good) 45%, transparent); }
.flash.error   { background: color-mix(in srgb, var(--critical) 9%, var(--surface-1)); border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent); }
.flash.warn    { background: color-mix(in srgb, var(--warning) 14%, var(--surface-1)); border: 1px solid color-mix(in srgb, var(--warning) 60%, transparent); }

/* --- Tuiles ---------------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.tile {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow);
}
.tile .k { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.tile .v { font-size: 1.9rem; font-weight: 700; margin-top: .25rem; letter-spacing: -.02em; }
.tile .s { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.tile.hero { grid-column: span 2; }
.tile.hero .v { font-size: 3rem; line-height: 1.05; color: var(--primary); }
@media (max-width: 640px) { .tile.hero { grid-column: span 1; } }
/* Quatre tuiles sur une seule ligne (vue Objectifs) : les deux chiffres cles restent grands, sans prendre deux colonnes. */
.tiles.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.tiles-4 .tile.hero { grid-column: span 1; }
@media (max-width: 900px) { .tiles.tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* --- Barres de persistance -------------------------------------------------- */

.bars { display: flex; flex-direction: column; gap: 3px; margin-top: .8rem; }
.bar-row {
  display: grid; grid-template-columns: 190px 1fr 64px 58px;
  align-items: center; gap: .7rem; padding: .2rem 0; position: relative;
}
.bar-name {
  font-size: .9rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; display: flex; align-items: center; gap: .35rem;
}
.bar-track {
  position: relative; height: 15px; background: var(--plane);
  border-radius: 4px; overflow: hidden;
}
/* Intervalle de confiance : dit visuellement "ce chiffre est encore flou". */
.bar-track .ci {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 15px; background: var(--grid); border-radius: 3px;
}
.bar-track .fill {
  position: absolute; left: 0; top: 0; height: 100%;
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 0 2px var(--surface-1);   /* respiration de 2px entre remplissages */
}
.bar-val  { font-size: .9rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.bar-meta { font-size: .8rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .bar-row { grid-template-columns: 120px 1fr 54px; }
  .bar-meta { display: none; }
}

/* Infobulle sans JavaScript */
[data-tip] { cursor: default; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 20;
  background: var(--ink); color: var(--plane);
  padding: .45rem .65rem; border-radius: 6px;
  font-size: .8rem; line-height: 1.35; max-width: 460px; width: max-content;
  box-shadow: 0 4px 14px rgba(0,0,0,.22); pointer-events: none;
}

/* Pastille d'etat devant un nom d'entreprise.
   CREUX = surveillee, PLEIN = ta marque. La distinction ne repose pas sur la
   couleur : les deux etats partageaient la meme teinte, et seul un halo de 2 px
   a 30 % les separait — donc rien de lisible sur une pastille de 7 px. */
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.watched { background: transparent; border: 2px solid var(--series-2); }

/* --- Haltere (comparaison des modes) --------------------------------------- */

.legend { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: .86rem; color: var(--ink-2); margin: .8rem 0 .6rem; }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: .3rem; vertical-align: -1px; }

.dumbbells { display: flex; flex-direction: column; gap: 5px; }
.db-row { display: grid; grid-template-columns: 175px 1fr 132px 116px; align-items: center; gap: .7rem; position: relative; }
.db-track { position: relative; height: 16px; }
.db-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--grid);
}
.db-link { position: absolute; top: 50%; transform: translateY(-50%); height: 2px; background: var(--axis); }
.db-pt {
  position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--surface-1);
}
.db-pt.p1 { background: var(--series-1); }
.db-pt.p2 { background: var(--series-2); }
.db-vals { font-size: .83rem; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.db-vals .v1 { color: var(--series-1); font-weight: 600; }
.db-vals .v2 { color: var(--series-2); font-weight: 600; }
.db-vals .arrow { color: var(--muted); margin: 0 .3rem; }
.db-verdict { text-align: right; }

@media (max-width: 820px) {
  .db-row { grid-template-columns: 120px 1fr 110px; }
  .db-verdict { display: none; }
}

/* --- Graphique SVG ---------------------------------------------------------- */

.chart { overflow-x: auto; margin: .8rem 0; }
.chart svg { width: 100%; min-width: 560px; height: auto; display: block; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt   { stroke: var(--surface-1); stroke-width: 2; }
.chart .serieslabel { fill: var(--ink-2); font-size: 11.5px; }
.chart .leader { fill: none; stroke-width: 1; opacity: .55; }

/* --- Tableaux --------------------------------------------------------------- */

.tablewrap {
  overflow-x: auto; margin: 1rem 0; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tablewrap table th:first-child, .tablewrap table td:first-child { padding-left: 1rem; }
.tablewrap table th:last-child, .tablewrap table td:last-child { padding-right: 1rem; }
.tablewrap tbody tr:last-child td { border-bottom: 0; }
table { width: 100%; border-collapse: collapse; font-size: .89rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.strong { font-weight: 700; }
tbody tr:hover { background: var(--surface-2); }

/* --- Boutons de triage ---------------------------------------------------- */
/* Actif = plein et colore, inactif = fantome neutre. La decision se lit d'un
   coup d'oeil sur une liste de quarante lignes, sans avoir a comparer. */
.btn.tri-keep:not(.ghost)  { background: var(--good);     border-color: var(--good);     color: #fff; }
.btn.tri-watch:not(.ghost) { background: var(--warning);  border-color: var(--warning);  color: #fff; }
.btn.tri-cut:not(.ghost)   { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn.tri-keep.ghost:hover  { border-color: var(--good);     color: var(--good); }
.btn.tri-watch.ghost:hover { border-color: var(--warning);  color: var(--warning); }
.btn.tri-cut.ghost:hover   { border-color: var(--critical); color: var(--critical); }
.btn.small + form .btn.small { margin-left: .25rem; }

/* --- En-tetes de tableau triables ---------------------------------------- */
/* La fleche n'apparait qu'au survol tant que la colonne n'est pas active :
   sinon quarante-neuf tableaux se couvriraient de chevrons permanents. */
th.triable { cursor: pointer; user-select: none; position: relative; padding-right: 1.35rem; }
th.triable:hover { color: var(--ink); }
th.triable:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }
th.triable::after {
  content: '\2195';                 /* fleche haut-bas */
  position: absolute; right: .5rem;
  opacity: 0; font-size: .9em; font-weight: 400;
  transition: opacity .12s ease;
}
th.triable:hover::after,
th.triable:focus-visible::after { opacity: .45; }
th.tri-asc::after  { content: '\2191'; opacity: 1; color: var(--series-1); }
th.tri-desc::after { content: '\2193'; opacity: 1; color: var(--series-1); }
th.tri-asc, th.tri-desc { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  th.triable::after { transition: none; }
}

.chip {
  display: inline-block; padding: .1rem .5rem; border-radius: 999px;
  font-size: .76rem; border: 1px solid var(--border); color: var(--ink-2);
  background: var(--surface-1);
}
.chip.c-noyau       { border-color: var(--ord-4); color: var(--ord-4); font-weight: 600; }
.chip.c-recurrent   { border-color: var(--ord-3); color: var(--ord-3); }
.chip.c-occasionnel { border-color: var(--ord-2); }
.chip.v-browsing-seul { border-color: var(--series-2); color: var(--series-2); }
.chip.v-memoire-seule { border-color: var(--series-1); color: var(--series-1); }

/* --- Matrice de presence ---------------------------------------------------- */

.matrix-wrap { overflow-x: auto; margin: .9rem 0; }
table.matrix { width: auto; min-width: 100%; border-collapse: separate; border-spacing: 0; }
table.matrix th, table.matrix td { border: 0; padding: 0; }

.matrix .mx-name {
  position: sticky; left: 0; z-index: 2;
  background: var(--plane); text-align: left;
  padding: .18rem .7rem .18rem .2rem; font-size: .87rem;
  white-space: nowrap; max-width: 210px; overflow: hidden; text-overflow: ellipsis;
}
.matrix thead .mx-name { background: var(--plane); }
.matrix .mx-col {
  font-size: .62rem; color: var(--muted); font-weight: 400;
  padding: 0 0 .25rem; min-width: 15px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.matrix .mx-cell { padding: 1px; text-align: center; }
.matrix .sep { border-left: 1px solid var(--axis); }
.matrix .mx-rate {
  padding-left: .8rem; text-align: right; font-size: .85rem;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  position: sticky; right: 0; background: var(--plane);
}
.matrix tbody tr:hover .mx-name { color: var(--series-1); }

/* Rampe sequentielle a teinte unique : l'intensite porte le rang. */
/* La case est dessinee par la cellule elle-meme : un element par case
   multipliait par dix le poids de la matrice. */
.matrix td.mx-cell::after {
  content: ""; display: block; width: 13px; height: 13px;
  border-radius: 3px; background: var(--grid); margin: 0 auto;
}
.matrix td.s1::after { background: var(--ord-1); }
.matrix td.s2::after { background: var(--ord-2); }
.matrix td.s3::after { background: var(--ord-3); }
.matrix td.s4::after { background: var(--ord-4); }

/* Pastilles de legende, hors tableau. */
.mx-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  background: var(--grid); vertical-align: -1px; margin: 0 1px;
}
.mx-dot.s1 { background: var(--ord-1); }
.mx-dot.s2 { background: var(--ord-2); }
.mx-dot.s3 { background: var(--ord-3); }
.mx-dot.s4 { background: var(--ord-4); }
.mx-dot.inline { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; margin: 0 1px; }

/* --- Mise en avant du noyau -------------------------------------------------- */

.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem; margin: 1rem 0; }
.podium-card {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.podium-card.core   { border-left: 3px solid var(--ord-4); }
.podium-card.volatile { border-left: 3px solid var(--series-2); }
.podium-card h4 { margin: 0 0 .5rem; font-size: .82rem; color: var(--muted);
                  text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.podium-list { list-style: none; margin: 0; padding: 0; }
.podium-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: .8rem; padding: .22rem 0; font-size: .92rem;
  border-bottom: 1px solid var(--border);
}
.podium-list li:last-child { border-bottom: 0; }
.podium-list .p { font-weight: 700; font-variant-numeric: tabular-nums; }
.podium-card .none { color: var(--muted); font-size: .88rem; font-style: italic; }

/* --- Reponses depliables ----------------------------------------------------- */

details.answer-item {
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: .5rem;
}
details.answer-item > summary {
  cursor: pointer; padding: .6rem .9rem; list-style: none;
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  font-size: .89rem;
}
details.answer-item > summary::-webkit-details-marker { display: none; }
details.answer-item > summary::before {
  content: "▸"; color: var(--muted); font-size: .8rem; flex: none;
}
details.answer-item[open] > summary::before { content: "▾"; }
details.answer-item[open] > summary { border-bottom: 1px solid var(--border); }
.answer-item .idx { font-weight: 700; min-width: 2.2rem; font-variant-numeric: tabular-nums; }
.answer-item .body { padding: .9rem; }
.answer-body {
  font-size: .93rem; line-height: 1.65; max-height: 460px; overflow-y: auto;
  padding-right: .4rem;
}

/* Surlignage des entreprises detectees dans le texte de la reponse. */
mark.ent {
  background: color-mix(in srgb, var(--ord-1) 55%, transparent);
  color: inherit; padding: .05em .18em; border-radius: 3px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
mark.ent.watched {
  background: color-mix(in srgb, var(--series-2) 34%, transparent);
  font-weight: 600;
}

/* Les sources citees par ChatGPT ne sont PAS les marques que l'on traque :
   presentation deliberement differente pour eviter toute confusion. */
.sources-box {
  margin-top: .9rem; padding: .7rem .9rem;
  background: var(--plane); border: 1px dashed var(--axis); border-radius: 8px;
}
.sources-box h5 {
  margin: 0 0 .4rem; font-size: .78rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.sources-box ul { margin: 0; padding-left: 1.1rem; font-size: .85rem; }
.sources-box li { margin: .15rem 0; }
.sources-box .dom { color: var(--ink-2); }

/* --- Formulaires ------------------------------------------------------------ */

label { display: block; font-size: .85rem; color: var(--ink-2); margin: .8rem 0 .25rem; font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: .6rem .8rem; font: inherit;
  background: var(--surface-1); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); outline-offset: 1px; border-color: var(--primary); }
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

.btn {
  display: inline-block; padding: .55rem 1.1rem; font: inherit; font-weight: 600;
  background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: 8px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.ghost { background: var(--surface-1); color: var(--ink-2); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--plane); color: var(--ink); }
.btn.small { padding: .3rem .7rem; font-size: .84rem; font-weight: 500; }
.btn.danger { background: var(--critical); }
.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1.1rem; }

.filters { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; margin: 1rem 0; }
.filters label { margin: 0 0 .2rem; }
.filters > div { min-width: 160px; }

/* --- Progression ------------------------------------------------------------ */

.progress { height: 8px; background: var(--plane); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress span { display: block; height: 100%; background: var(--series-1); border-radius: 999px; transition: width .3s; }
.progress-label { font-size: .82rem; color: var(--muted); margin-top: .3rem; }

/* --- Diagnostic ------------------------------------------------------------- */

.check { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.check .badge { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .72rem; font-weight: 700; margin-top: .1rem; }
.check.ok  .badge { background: var(--good); }
.check.bad .badge { background: var(--critical); }
.check .body { min-width: 0; }
.check .name { font-weight: 600; font-size: .92rem; }
.check .info { color: var(--muted); font-size: .85rem; word-break: break-word; }

/* --- Connexion : couverture Uplix ------------------------------------------ */
/* Meme dessin que netlinking.uplix.fr : fond gris, trois taches floues aux
   couleurs du logo, carte givree, logo en pastille a cheval sur le bord. */

/* La couverture reste claire quel que soit le theme du systeme : la carte
   givree est blanche, des jetons sombres la rendraient illisible. */
body.login-page {
  color-scheme: light;
  --surface-1: #ffffff; --plane: #f5f6f9; --ink: #1a1d29; --ink-2: #4a4d5a; --muted: #8a8d99;
  --border: #e4e4ee; --axis: #d3d4de; --primary: #0169e6; --primary-hover: #0154b8;
  --primary-soft: #eaf2fe; --good: #00bb52; --critical: #e5484d;
  background: #ededf2; color: #1a1d29; min-height: 100vh; position: relative; overflow-x: hidden;
}
.login-blobs span {
  position: fixed; width: 340px; height: 340px; border-radius: 50%;
  filter: blur(56px); opacity: .55; pointer-events: none;
}
.login-blobs span:nth-child(1) { background: #ff5d45; top: -80px; left: -60px; }
.login-blobs span:nth-child(2) { background: #00bb52; bottom: -100px; left: 30%; }
.login-blobs span:nth-child(3) { background: #0169e6; top: 20%; right: -90px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 3rem 1rem; position: relative; }
.login-card {
  position: relative; width: 100%; max-width: 440px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px);
  border-radius: 28px; padding: 3.2rem 2.2rem 1.6rem; color: #1a1d29;
  box-shadow: 0 10px 40px rgba(16, 24, 40, .08);
}
.login-brand {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  background: #fff; border: 1px solid #e4e4ee; border-radius: 99px; padding: 12px 26px;
  display: flex;
}
.login-brand svg { height: 26px; width: auto; }
.login-card h1 { text-align: center; font-size: 1.6rem; margin: 0 0 .3rem; }
.login-card h1 b { font-weight: 700; }
.login-card h1 .lt { font-weight: 300; }
.login-card .sub { text-align: center; color: #595959; }
.login-card .btn { width: 100%; margin-top: 1rem; text-align: center; padding: .75rem 1rem; }
.login-card input[type=email], .login-card input[type=password] { background: #fff; }
.login-points { list-style: none; padding: 0; margin: 1.3rem 0 0; font-size: .85rem; color: #4a4d5a; }
.login-points li { padding-left: 1.6rem; position: relative; margin: .4rem 0; }
.login-points li::before {
  content: ""; position: absolute; left: 0; top: .2rem; width: 1rem; height: 1rem; border-radius: 50%;
  background: #00bb52 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/62% no-repeat;
}
.login-admin { margin-top: 1.3rem; font-size: .82rem; color: #8a8d99; }
.login-admin summary { cursor: pointer; }
.login-baseline { text-align: center; font-style: italic; color: #9e9e9e; font-size: .78rem; margin: 1.6rem 0 0; }

/* --- Pagination --------------------------------------------------------- */

.pager {
  display: flex; gap: .35rem; align-items: center; flex-wrap: wrap;
  margin: 1.2rem 0; justify-content: center;
}
.pager .btn { min-width: 2.1rem; text-align: center; }

/* --- Mise en avant de sa propre societe ---------------------------------- */

tr.own, .bar-row.own {
  background: color-mix(in srgb, var(--series-2) 9%, transparent);
}
tr.own td:first-child { box-shadow: inset 3px 0 0 var(--series-2); font-weight: 600; }
.dot.own {
  background: var(--series-2); border: 2px solid var(--series-2);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--series-2) 35%, transparent);
}
.badge-own {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .03em;
  background: var(--series-2); color: #fff; padding: .05rem .35rem;
  border-radius: 3px; margin-left: .35rem; vertical-align: 1px;
}
/* « Votre marque citee » dans la liste des interrogations. Meme teinte que
   partout ailleurs pour sa propre societe : on la reconnait sans lire. */
.chip.mine {
  border-color: var(--series-2); color: var(--series-2); font-weight: 600;
  display: inline-flex; align-items: center; gap: .3rem;
}
.chip.mine .dot.own { width: .5rem; height: .5rem; box-shadow: none; }
.chip.mine .r {
  font-weight: 400; opacity: .75; padding-left: .3rem;
  border-left: 1px solid color-mix(in srgb, var(--series-2) 40%, transparent);
}
details.answer-item.own { border-color: color-mix(in srgb, var(--series-2) 45%, var(--border)); }
details.answer-item.own > summary { background: color-mix(in srgb, var(--series-2) 7%, transparent); }

.chip.sig        { border-color: var(--good); color: var(--good); font-weight: 600; }
.chip.trend-up   { border-color: var(--good); color: var(--good); }
.chip.trend-down { border-color: var(--series-2); color: var(--series-2); }

/* --- Retour visuel des actions sans rechargement -------------------------- */

.dot.idle { background: var(--axis); }
tr.just-saved { animation: saved 1.2s ease-out; }
tr.save-error { animation: savefail 1.2s ease-out; }
@keyframes saved    { 0% { background: color-mix(in srgb, var(--good) 28%, transparent); } 100% { background: transparent; } }
@keyframes savefail { 0% { background: color-mix(in srgb, var(--critical) 28%, transparent); } 100% { background: transparent; } }
button[disabled] { opacity: .55; cursor: progress; }

/* --- Reponses : rendu du Markdown produit par ChatGPT ---------------------- */

.answer-body > p:first-child { margin-top: 0; }
.answer-body p  { margin: .5rem 0; }
.answer-body ul { margin: .5rem 0 .5rem 1.1rem; padding: 0; }
.answer-body li { margin: .2rem 0; }
.answer-body h3, .answer-body h4, .answer-body h5, .answer-body h6 {
  margin: 1rem 0 .3rem; font-size: .95rem; color: var(--ink);
}
.answer-body code {
  background: var(--plane); border: 1px solid var(--border);
  padding: .05em .3em; border-radius: 4px; font-size: .88em;
}
.answer-body a { word-break: break-word; }

/* Tableaux produits par le modele : compacts, et jamais debordants. */
.md-table { margin: .6rem 0; }
.md-table table { font-size: .85rem; }
.md-table th, .md-table td {
  padding: .35rem .5rem; white-space: normal; vertical-align: top;
}
.md-table th { background: var(--plane); }

/* --- Matrice : lisibilite quand les colonnes sont nombreuses --------------- */

.matrix-wrap {
  position: relative;
  /* Ombre portee sur les bords : signale qu'il reste du contenu a faire
     defiler, ce qu'une barre de defilement fine ne montre pas assez. */
  background:
    linear-gradient(to right, var(--plane) 30%, transparent),
    linear-gradient(to left,  var(--plane) 30%, transparent) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.14), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.14), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
  background-attachment: local, local, scroll, scroll;
}
.matrix-wrap::-webkit-scrollbar { height: 10px; }
.matrix-wrap::-webkit-scrollbar-thumb { background: var(--axis); border-radius: 999px; }
.matrix-wrap::-webkit-scrollbar-track { background: var(--plane); }

/* Nom d'entreprise cliquable : discret dans un tableau, mais l'ensemble du
   tableau devient navigable sans que rien ne crie au lien. */
.entity-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--border); }
.entity-link:hover { color: var(--series-1); border-bottom-color: currentColor; }

/* --- Tests ------------------------------------------------------------------ */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.similar-list { margin: .45rem 0 0; padding-left: 1.1rem; }
.similar-list li { margin: .2rem 0; }
.similar-live { margin-top: .7rem; }
tr.mine-row td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.inline-form { display: inline-flex; gap: .35rem; align-items: center; }
.inline-form input[type=number] { width: 4.5rem; padding: .3rem .5rem; }
/* Ajout d'un compte (consultant, client) : le libelle au-dessus, puis le ou
   les champs et le bouton sur une meme ligne. En ligne avec le libelle, le
   champ etait repousse a droite et le bouton passait dessous. */
.card.precreate { display: block; }
.card.precreate > label { display: block; margin: 0 0 .5rem; }
.card.precreate > div { align-items: center; }
.card.precreate > div input { flex: 1 1 220px; margin: 0; }
.card.precreate > div .btn { flex: none; }

/* --- Champ semantique ------------------------------------------------------- */
.concept-list { margin: .4rem 0 0; padding-left: 1.4rem; columns: 2 320px; column-gap: 2rem; }
.concept-list li { margin: .35rem 0; break-inside: avoid; }
.concept-list .concept { font-weight: 600; margin-right: .35rem; }
.concept-list .muted { display: block; font-size: .8rem; }
.field-todo { border-left: 3px solid var(--primary); }
.mini-bar { height: 8px; background: var(--plane); border-radius: 999px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.chip.st-take { border-color: var(--primary); color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.chip.st-held { border-color: var(--good); color: var(--success-text); }
.chip.st-weak { border-color: var(--critical); color: var(--critical); }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
a.chip { text-decoration: none; }
a.chip:hover { border-color: var(--primary); color: var(--primary); }
::placeholder { color: var(--muted); opacity: .75; }

/* Bouton principal de l'en-tete : lancer un test. */
.btn-new {
  margin-left: auto; display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.25rem; border-radius: 10px; font-size: .92rem;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}
.btn-new span { font-size: 1.25rem; line-height: 1; font-weight: 400; }
.btn-new small { font-weight: 400; opacity: .8; }
.btn-new.ghost { box-shadow: none; }
@media (max-width: 640px) { .btn-new { padding: .5rem .8rem; } .btn-new small { display: none; } }

/* Nature d'une source : independante (la ou une recommandation se gagne)
   ou site de marque (qui plaide pour lui-meme). */
.chip.src-ext   { border-color: var(--good); color: var(--success-text); }
.chip.src-brand { border-color: var(--axis); color: var(--ink-2); background: var(--plane); }

/* --- Lecture seule ------------------------------------------------------------
   Le serveur refuse toute action ; l'interface n'en propose donc aucune. Les
   formulaires GET (filtres, selecteurs) restent : on consulte librement. */
body.readonly main form[method="post"] { display: none !important; }
.pill-badge.ro { background: var(--primary-soft); color: var(--primary-ink); }
.readonly-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 12px; padding: .8rem 1.1rem; margin-bottom: 1.3rem; font-size: .88rem;
}

/* Filtre de nature des sources, en tete de page. */
.nature-filter .legend-note { margin-top: .6rem; }
.url-cible a { color: var(--muted); text-decoration: none; word-break: break-all; }
.url-cible a:hover { color: var(--primary); text-decoration: underline; }

/* --- Decouverte de prompts -------------------------------------------------- */
.chip.intent-transactionnel { border-color: var(--good); color: var(--success-text); font-weight: 600; }
.chip.intent-commercial     { border-color: var(--primary); color: var(--primary); }
.chip.intent-informationnel { color: var(--muted); }

/* --- Ecran d'attente --------------------------------------------------------- */
.loading-veil {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(245, 246, 249, .82); backdrop-filter: blur(3px);
}
.loading-box {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 10px 40px rgba(16, 24, 40, .12); padding: 1.8rem 2.2rem; text-align: center;
  max-width: 420px; margin: 1rem;
}
.loading-box p { margin: .9rem 0 0; font-weight: 500; }
.loading-box .loading-time { margin-top: .35rem; font-weight: 400; font-size: .82rem; color: var(--muted); }
.loading-spin {
  width: 42px; height: 42px; margin: 0 auto; border-radius: 50%;
  border: 4px solid var(--primary-soft); border-top-color: var(--primary);
  animation: tourne .9s linear infinite;
}
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loading-spin { animation-duration: 2.5s; } }

/* --- Brief SEO Quantum --------------------------------------------------------- */
.sq-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: .6rem; }
@media (max-width: 960px) { .sq-cols { grid-template-columns: 1fr; } }
.sq-cols h3 { margin: 0 0 .2rem; color: var(--ink); }
.sq-list { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .86rem; }
.sq-list li { padding: .3rem 0; border-bottom: 1px solid var(--border); }
.sq-list li .muted { display: block; font-size: .78rem; }

/* Rubrique repliable du menu (Administration). */
/* Sous-menu du tableau de bord : ses niveaux de lecture, en retrait, sans icone. */
.side-sub { display: flex; flex-direction: column; margin: 0 0 .15rem 1.35rem; padding-left: .6rem; border-left: 1px solid var(--border); }
.side-sub > summary { font-size: .74rem; color: var(--muted); padding: .12rem .5rem; }
.side-nav .side-sub a { font-size: .8rem; padding: .22rem .5rem; color: var(--ink-2); line-height: 1.3; white-space: normal; }
/* Une ancre du sous-menu ne doit pas glisser son titre sous l'en-tete fixe. */
h2[id] { scroll-margin-top: 5rem; }
.side-nav .side-sub a:hover { color: var(--primary); }
.side-fold { display: flex; flex-direction: column; gap: 2px; }
.side-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.side-fold > summary::-webkit-details-marker { display: none; }
.side-fold > summary::after { content: "\25B8"; font-size: .8rem; color: var(--muted); transition: transform .15s; }
.side-fold[open] > summary::after { transform: rotate(90deg); }
.side-fold > summary:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .side-fold > summary::after { transition: none; } }

/* --- Onglets ------------------------------------------------------------------- */
.tabs {
  display: flex; gap: .25rem; flex-wrap: wrap; margin: 1.2rem 0 1rem;
  border-bottom: 1px solid var(--border);
}
.tabs a {
  padding: .6rem 1rem; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: .9rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }

/* --- AI Overview -------------------------------------------------------------- */
.aio-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .aio-grid { grid-template-columns: 1fr; } }
.aio-grid .card { margin: 0 0 1rem; }
.aio-text { max-height: none; }
.aio-brands { margin: .3rem 0 0; padding-left: 1.3rem; }
.aio-brands li { padding: .2rem 0; }
.aio-brands li.own { font-weight: 600; }
.aio-refs { list-style: none; padding: 0; margin: .3rem 0 0; font-size: .86rem; }
.aio-refs li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--border); }

.field-facts { border-left: 3px solid var(--critical); }

/* --- Brief de contenu ---------------------------------------------------------- */
.brief-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 1rem; align-items: end; }
.brief-form label { margin-top: 0; }
@media (max-width: 760px) { .brief-form { grid-template-columns: 1fr; } }
.brief-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1.2rem; align-items: start; }
@media (max-width: 960px) { .brief-grid { grid-template-columns: 1fr; } }
.brief-grid .card { margin-top: 0; }
/* Blocs de commandes (vue API et MCP) : a la ligne plutot qu'un debordement de la page. */
.card pre { max-width: 100%; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.brief-plan { padding-left: 1.3rem; margin: .4rem 0 1rem; }
.brief-plan li { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.brief-concepts { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
textarea.mono { width: 100%; font-family: ui-monospace, monospace; font-size: .78rem; }

/* En-tete compact sur telephone : menu, sujet et « + » sur une ligne, la vue
   en dessous. Trois lignes mangeaient un cinquieme de l'ecran (recette du
   05/10/2026). */
@media (max-width: 640px) {
  .topbar { gap: .5rem; padding: .5rem .75rem; min-height: 0; }
  .topbar > form.pill-select:first-of-type { order: 1; flex: 1; min-width: 0; }
  .topbar > .btn-new { order: 2; margin-left: 0; padding: .55rem .8rem; }
  .topbar > .btn-new .lbl, .topbar > .btn-new small { display: none; }
  .topbar > .pill-badge { order: 3; }
  .topbar > form.pill-select:not(:first-of-type) { order: 4; flex-basis: 100%; }
  .pill-select { padding-left: .6rem; }
  .pill-select label { display: none; }
  .pill-select select { max-width: none; width: 100%; }
}

/* Champ semantique : concept, nature et axe dans une seule cellule. */
td.concept-cell { white-space: normal; min-width: 180px; max-width: 300px; }
td.concept-cell .hint { margin-left: .35rem; }
.concept-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.concept-tags .chip { font-size: .72rem; padding: .1rem .45rem; }
td.num .mini-bar { margin-top: .3rem; min-width: 70px; }

/* Filtre de nature des sources : trois gros boutons, le choix courant plein. */
.seg-filter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.seg-filter a {
  display: flex; flex-direction: column; gap: .1rem; padding: .75rem 1rem; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface-1); color: var(--ink); text-decoration: none;
  transition: border-color .15s, background .15s;
}
.seg-filter a:hover { border-color: var(--primary); }
.seg-filter .seg-n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.seg-filter .seg-l { font-weight: 600; }
.seg-filter .seg-d { font-size: .8rem; color: var(--muted); }
.seg-filter a.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.seg-filter a.on .seg-d { color: rgba(255,255,255,.85); }
@media (max-width: 640px) { .seg-filter { grid-template-columns: 1fr; } .seg-filter a { flex-direction: row; align-items: baseline; gap: .6rem; } }
.back-link { margin: 0 0 .6rem; }
.back-link a { font-weight: 600; text-decoration: none; }

/* Brief : ce qui l'a nourri, et ou en est Wisewand. */
.brief-status { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .45rem; margin-top: .8rem;
  padding-top: .8rem; border-top: 1px solid var(--border); font-size: .85rem; }
.brief-status a { font-size: .8rem; }
.chip.st-off { color: var(--muted); border-color: var(--border); background: var(--plane); }

/* Nouveau test : cout estime avant creation. */
.cost-estimate { margin: 1rem 0 .4rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--plane); }
.cost-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; }
.cost-k { font-weight: 600; }
.cost-total { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.cost-table { margin: .5rem 0; font-size: .85rem; }
.cost-table td { white-space: normal; padding: .35rem .4rem; }
.cost-table tr:last-child td { border-bottom: 0; }

/* Infobulle sur une etiquette ; ancree a droite dans les dernieres colonnes. */
.chip[data-tip], span.tip-l[data-tip] { position: relative; cursor: help; }
.tip-l[data-tip]:hover::after { left: auto; right: 0; max-width: 340px; white-space: normal; text-align: left; font-weight: 400; }
[data-tip]:hover::after { white-space: normal; max-width: 340px; font-weight: 400; text-transform: none; letter-spacing: 0; }

.period-line { margin: -.2rem 0 .8rem; font-size: .88rem; }

/* Courbe de rang (fiche entreprise) : 1er en haut. */
.rank-chart { width: 100%; height: auto; display: block; }
.rank-chart .rk-grid { stroke: var(--grid); stroke-width: 1; }
.rank-chart .rk-axis { fill: var(--muted); font-size: 11px; }
.rank-chart .rk-band { fill: var(--primary); opacity: .1; }
.rank-chart .rk-line { fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; }
.rank-chart .rk-dot { fill: var(--surface-1); stroke: var(--primary); stroke-width: 2; }

/* Bilan du champ semantique. */
.review-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: .4rem 0 1rem; }
.review-kpis > div { display: flex; flex-direction: column; padding: .7rem .9rem; border: 1px solid var(--border); border-radius: 12px; }
.review-kpis .rk-n { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.review-kpis .rk-n small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.review-kpis .rk-n.warn { color: #b7791f; }
.review-kpis .rk-n.crit { color: var(--critical); }
.review-kpis .rk-l { font-weight: 600; font-size: .85rem; }
.review-kpis .rk-d { font-size: .78rem; color: var(--muted); }
.review-synth { font-size: 1rem; line-height: 1.55; margin: 0 0 1rem; }
@media (max-width: 720px) { .review-kpis { grid-template-columns: 1fr 1fr; } }

.review-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }

/* Actions suivies. */
.action-card h3 { font-size: 1.05rem; }
.concept-pick { display: flex; flex-wrap: wrap; gap: .3rem .5rem; max-height: 240px; overflow-y: auto; padding: .5rem;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: .6rem; }
.concept-pick .pick { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; font-size: .85rem;
  padding: .15rem .5rem; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; margin: 0; }
.concept-pick .pick input { margin: 0; width: auto; }
.concept-pick .pick[hidden] { display: none; }
.concept-pick .pick.in-page { border-color: var(--good); }
.concept-pick .pick .chip { font-size: .72rem; padding: 0 .4rem; }
#pick-filter { margin-bottom: .4rem; }
#pick-more { margin-bottom: .6rem; }
#pick-more summary { cursor: pointer; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
/* Vue commerciale. Le flou habille un texte FACTICE : la vraie valeur n'est pas dans la page. */
.veil { filter: blur(5px); user-select: none; pointer-events: none; opacity: .75; }
.lock-tag { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--primary);
  border: 1px solid var(--primary); border-radius: 999px; padding: .05rem .45rem; margin-left: .3rem; white-space: nowrap; }
.chip.locked { border-style: dashed; }
.pitch-lead { font-size: 1.02rem; line-height: 1.6; margin: 0 0 .9rem; }
.pitch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin: 0 0 1rem; font-size: .85rem; }
.pitch-figure { overflow-x: auto; margin: .4rem 0; }
.pitch-figure svg { max-width: 100%; height: auto; border-radius: 10px; }
.pitch-concepts { display: flex; flex-wrap: wrap; gap: .35rem; }
.pitch-cta { border-color: var(--primary); background: var(--primary-soft); }
.pitch-new { border-top: 1px solid var(--border); margin-top: .8rem; padding-top: .8rem; }
.pitch-prompt { font-family: ui-monospace, monospace; font-size: .8rem; }

.page-scan { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; margin: .2rem 0 .8rem; font-size: .85rem; }
.page-scan form { margin: 0 0 0 auto; }
.page-scan.read { display: block; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--plane); }
.page-scan.read p { margin: 0 0 .3rem; }

.follow-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.follow-cta .btn { margin-left: auto; }

/* Vue client (client.php) : pas de menu, contenu centre. */
.public-view .sidebar, .public-view .nav-burger, .public-view .crumb { display: none; }
.public-view .shell { margin-left: 0; max-width: 1180px; margin-inline: auto; }
.share-login { max-width: 460px; margin: 3rem auto; }
.share-card summary { cursor: pointer; display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; }
.share-row { display: grid; grid-template-columns: 2fr 1fr; gap: .5rem .8rem; padding: .7rem 0; border-top: 1px solid var(--border); margin-top: .6rem; }
.share-row input { font-family: ui-monospace, monospace; font-size: .82rem; }
.share-row .share-meta, .share-row .share-actions { grid-column: 1 / -1; }
@media (max-width: 640px) { .share-row { grid-template-columns: 1fr; } }

.public-view .topbar { display: none; }
.public-brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.5rem .2rem; }
.public-brand svg { height: 30px; width: auto; }
.public-brand span { font-weight: 600; font-size: 1.15rem; }
.public-brand small { margin-left: auto; color: var(--muted); font-size: .82rem; }

/* Alertes de la semaine (tableau de bord). */
.alert-card { padding-top: .9rem; padding-bottom: .9rem; }
.alert-card.has-alerts { border-left: 4px solid var(--warning); }
.alert-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: .4rem; }

/* Profils de marque : tableau sans defilement horizontal. */
td.id-concepts { white-space: normal; min-width: 160px; max-width: 260px; }
td.id-concepts .chip { margin: 0 .2rem .2rem 0; font-size: .74rem; padding: .1rem .45rem; }
td.id-name { white-space: normal; min-width: 120px; }
td.id-name .chip { font-size: .7rem; padding: .05rem .4rem; }

/* En-tetes a deux niveaux : mesure + unite, alignes en bas. L'infobulle est
   portee par un element interieur : le ::after de la cellule sert deja a la
   fleche de tri, et les deux se marchaient dessus. */
th.th2 { vertical-align: bottom; white-space: nowrap; }
th.th2 .th-w { display: inline-block; position: relative; cursor: help; }
th.th2 .th-t { display: block; }
th.th2 .th-s { display: block; margin-top: .15rem; font-size: .72rem; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--muted); opacity: .85; }
th.th2 .th-i { font-style: normal; font-size: .7rem; opacity: .6; }
/* En-tete simple avec explication au survol (th_info) et « ⓘ » isole (info_i). */
th .th-w { display: inline-block; position: relative; cursor: help; }
th .th-i { font-style: normal; font-size: .7rem; opacity: .6; }
.info-i { font-size: .8em; font-weight: 400; color: var(--muted); cursor: help; text-transform: none; letter-spacing: 0; }
.info-i:hover { color: var(--primary); }
h2 .info-i[data-tip]:hover::after, .tile .info-i[data-tip]:hover::after, .card-k .info-i[data-tip]:hover::after {
  left: 0; right: auto; top: calc(100% + 6px); bottom: auto; font-size: .8rem; }
th.th2.num .th-w, th.th2.num .th-s, th.th2.num .th-t { text-align: right; }

/* Dans un en-tete de tableau, l'infobulle s'ouvre VERS LE BAS : vers le haut,
   elle etait coupee par le bord du tableau (overflow du conteneur). */
thead [data-tip]:hover::after { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; max-width: 300px;
  white-space: normal; text-transform: none; letter-spacing: 0; font-weight: 400; text-align: left; font-size: .8rem; }
thead th:first-child [data-tip]:hover::after, thead th:nth-child(2) [data-tip]:hover::after { left: 0; right: auto; }

/* Qui voit quel test (Utilisateurs). */
.access-table select { min-width: 130px; font-size: .82rem; padding: .25rem .4rem; }
.access-table th.access-user { white-space: normal; max-width: 140px; }

/* Import manuel d'une page protegee (site du client). */
.site-import { margin-top: .8rem; }
.site-import summary { cursor: pointer; font-size: .88rem; color: var(--primary); }

/* Concepts : chaque concept liste ouvre sa fiche (concept.php). Le lien garde
   l'apparence du texte ou de la pastille qu'il remplace ; seul le survol le signale. */
a.concept, a.concept-link { color: inherit; text-decoration: none; }
a.concept:hover, a.concept-link:hover { color: var(--primary); text-decoration: underline; }
a.chip[data-tip] { cursor: pointer; }
button.chip { cursor: pointer; font-family: inherit; }
.concept-head { margin: 0 0 .6rem; }
.concept-places { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; align-items: start; }
.concept-places .card { margin: 0; }
ul.quotes { list-style: none; margin: 0; padding: 0; }
ul.quotes li { padding: .55rem 0 .55rem .8rem; border-bottom: 1px solid var(--border); border-left: 3px solid var(--border);
  font-size: .9rem; line-height: 1.5; white-space: normal; }
ul.quotes li:last-child { border-bottom: 0; }
ul.quotes li.q-atout { border-left-color: var(--good); }
ul.quotes li.q-reserve { border-left-color: var(--critical); }
ul.quotes .badge { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: .3rem; }
ul.quotes .hint { display: block; }
/* Utilisateurs : droits d'un compte client (tests et vues ouverts). */
.client-card .client-rights { display: flex; flex-wrap: wrap; gap: .8rem 1.2rem; align-items: stretch; margin: .4rem 0 .2rem; }
.client-card .client-rights > .btn { align-self: flex-end; }
.client-card fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: .4rem .8rem .6rem; margin: 0;
  display: flex; flex-wrap: wrap; gap: .3rem .9rem; min-width: 240px; flex: 1; }
.client-card legend { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 .3rem; }
.client-card .pick { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; font-size: .86rem; margin: 0; }
.client-card .pick input { width: auto; margin: 0; }
/* Nouveau test : complet ou pitch. Les options du pitch n'apparaissent que s'il est choisi. */
fieldset.test-mode { border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .9rem .8rem; margin: 1rem 0; }
fieldset.test-mode legend { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 .3rem; }
fieldset.test-mode .pick { display: flex; align-items: baseline; gap: .5rem; font-weight: 400; margin: .3rem 0; }
fieldset.test-mode .pick input { width: auto; margin: 0; flex: none; }
fieldset.test-mode .pitch-opts { display: none; grid-template-columns: 160px 200px 1fr; gap: .2rem 1rem; margin: .6rem 0 0 1.4rem; }
fieldset.test-mode .pitch-opts .hint { grid-column: 1 / -1; }
fieldset.test-mode:has(input[value="pitch"]:checked) .pitch-opts { display: grid; }
form:has(input[name="mode"][value="pitch"]:checked) #cout-complet { display: none; }
fieldset.test-mode .light-opts { display: none; margin: .4rem 0 0 1.4rem; }
fieldset.test-mode:has(input[value="light"]:checked) .light-opts { display: block; }
form:has(input[name="mode"][value="light"]:checked) #cout-complet { display: none; }
/* Navigateur sans :has() : les options restent visibles plutot qu'introuvables. */
@supports not selector(:has(*)) { fieldset.test-mode .pitch-opts { display: grid; } }
/* Pages clients : une ligne par page, les pastilles sur une seule ligne. */
.pages-board td:first-child { max-width: 270px; }
.pages-board td:nth-child(3) { min-width: 170px; white-space: normal; }
.pages-board td:nth-child(6) { max-width: 150px; font-size: .84rem; }
.pages-board th, .pages-board td { padding-left: .45rem; padding-right: .45rem; }
/* Les deux boutons l'un sous l'autre : cote a cote, le tableau debordait de la page. */
.pages-board td.pb-actions { text-align: right; white-space: normal; }
.pages-board td.pb-actions .btn { display: block; width: max-content; margin: .15rem 0 .15rem auto; }
.pages-board .concept-tags { margin: 0; }
.pages-board .concept-tags .chip { white-space: nowrap; }
/* Enrichir une page : un conseil par concept. */
ul.enrich-list { list-style: none; margin: 0; padding: 0; }
ul.enrich-list li { padding: .7rem 0; border-bottom: 1px solid var(--border); }
ul.enrich-list li:first-child { padding-top: 0; }
ul.enrich-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.enrich-list .en-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; }
.enrich-list .en-head .muted { font-size: .82rem; }
.enrich-list .en-do { margin: .25rem 0 0; font-size: .92rem; line-height: 1.5; }
.enrich-list .en-quote { margin: .3rem 0 0; padding-left: .7rem; border-left: 3px solid var(--border); font-size: .84rem; color: var(--muted); }
/* La question posee a ChatGPT, en tete de chaque page du projet. */
.prompt-band { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .8rem; margin: 0 0 1.2rem; padding: .7rem 1rem;
  background: var(--primary-soft); border-left: 4px solid var(--primary); border-radius: var(--radius); }
.prompt-band .pb-k { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--primary); white-space: nowrap; }
.prompt-band .pb-t { font-size: 1.08rem; font-weight: 600; line-height: 1.4; color: var(--ink, inherit); }
/* Bandeau « test en cours » : resultats provisoires jusqu'a la fin du test. */
.test-band { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .8rem; margin: 0 0 1.2rem; padding: .7rem 1rem;
  font-size: .9rem; line-height: 1.5; border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
  border-left: 4px solid var(--warning); border-radius: var(--radius); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.test-band .tb-k { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; white-space: nowrap; }
.test-band .tb-t { flex: 1 1 22rem; }
.prompt-band + .test-band { margin-top: -.6rem; }
/* Tableau de bord : etat du suivi du sujet (releve chaque jour, en cours, a l'arret). */
.track-state { display: flex; align-items: flex-start; gap: .6rem; margin: 0 0 1rem; padding: .6rem .9rem; font-size: .88rem;
  border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: var(--radius); background: var(--surface-1); }
.track-state p { margin: 0; }
.track-state .ts-dot { flex: none; width: .6rem; height: .6rem; margin-top: .38rem; border-radius: 50%; background: var(--muted); }
.track-state.ts-suivi { border-left-color: var(--good); }
.track-state.ts-suivi .ts-dot { background: var(--good); }
.track-state.ts-analyse { border-left-color: var(--primary); }
.track-state.ts-analyse .ts-dot { background: var(--primary); animation: ts-pulse 1.4s ease-in-out infinite; }
.track-state.ts-cron_arrete { border-left-color: var(--critical); background: color-mix(in srgb, var(--critical) 6%, var(--surface-1)); }
.track-state.ts-cron_arrete .ts-dot { background: var(--critical); }
@keyframes ts-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .track-state.ts-analyse .ts-dot { animation: none; } }
/* Reponses : recherche, filtres et tri. */
.response-search .rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem .8rem; }
.response-search .rs-wide { grid-column: span 2; }
@media (max-width: 520px) { .response-search .rs-wide { grid-column: span 1; } }
.response-search label { margin: 0 0 .2rem; }
.response-search .rs-check { display: flex; align-items: center; gap: .4rem; margin: .8rem 0 0; font-weight: 400; font-size: .86rem; }
.response-search .rs-check input { width: auto; margin: 0; }
.rs-active { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .8rem; }
.sources-box.rs-found { margin: 0 0 .9rem; border-style: solid; border-color: var(--primary); background: var(--primary-soft); }
/* Vue Concepts : une famille depliable, plusieurs centaines de lignes au total. */
.concept-family .fam-brands { margin-left: auto; font-size: .82rem; }
.concept-family .body { padding: .8rem .9rem; }
.concept-table td { white-space: normal; }
.concept-table .cbar { display: block; height: 4px; margin: .25rem 0 0 auto; background: var(--primary); border-radius: 999px; min-width: 2px; }
.concept-table td.num { min-width: 90px; }
.concept-table a.concept-link { font-weight: 600; }
.concept-table td:first-child input { margin: 0; width: auto; }
.concept-filters { align-items: center; }
.concept-move { padding: .7rem .9rem; border: 1px dashed var(--axis); border-radius: var(--radius); }

/* Actions suivies : ce qui a change dans un passage */
.passage-diff { margin: .7rem 0; padding: .7rem .9rem; border: 1px solid var(--border, #e4e4ee); border-radius: 10px; }
.passage-diff ul { margin: .2rem 0 .4rem; padding-left: 1.1rem; }
.passage-diff ins { background: #e6f6ea; text-decoration: none; border-radius: 3px; padding: 0 .15rem; }
.passage-diff del { background: #fdeaea; color: #a33; border-radius: 3px; padding: 0 .15rem; }

/* Reglages du releve AI Overview */
.aio-settings { display: flex; flex-direction: column; gap: 1rem; margin-top: .8rem; }
.aio-toggle { display: flex; align-items: flex-start; gap: .7rem; cursor: pointer; font-weight: 400; }
.aio-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aio-toggle-track { flex: none; width: 38px; height: 22px; border-radius: 11px; background: var(--border); position: relative; transition: background .15s; margin-top: 1px; }
.aio-toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.aio-toggle input:checked + .aio-toggle-track { background: var(--primary); }
.aio-toggle input:checked + .aio-toggle-track::after { transform: translateX(16px); }
.aio-toggle input:focus-visible + .aio-toggle-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.aio-toggle .hint { display: block; }
.aio-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 760px) { .aio-fields { grid-template-columns: 1fr; } }
.aio-settings .actions { margin: 0; }
.aio-key { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--border); font-size: .88rem; }

/* Switch de moteur sous le logo */
.engine-switch { display: flex; margin: -.3rem .55rem .9rem; padding: 3px; border-radius: 999px; background: var(--surface-2, #f1f3f7); border: 1px solid var(--border); }
.engine-switch a { flex: 1; text-align: center; padding: .3rem .4rem; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.engine-switch a:hover { color: var(--ink); }
.engine-switch a.on { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Fiche entreprise : ce que ChatGPT dit d'elle, periode par periode. */
.discours-grid td, .discours-grid th { white-space: nowrap; }
.discours-grid .dg-cell { display: inline-block; min-width: 2.8rem; padding: .1rem .35rem; border-radius: 6px; font-weight: 600;
  background: color-mix(in srgb, var(--primary) calc(var(--a) * 35%), transparent); }
.discours-grid .dg-cell.atout   { background: color-mix(in srgb, var(--good) calc(var(--a) * 35%), transparent); }
.discours-grid .dg-cell.reserve { background: color-mix(in srgb, var(--critical) calc(var(--a) * 35%), transparent); }
.dg-traits { min-width: 16rem; font-size: .85rem; }
.dg-traits div + div { margin-top: .3rem; }
.dg-traits q { color: var(--muted); font-style: italic; }

/* Fiche entreprise : evolution du taux de presence (points du jour, moyenne 7 jours). */
.rank-chart .evo-dot { fill: var(--muted); opacity: .55; }
.evo-detail { margin-top: .8rem; }
.evo-detail summary { cursor: pointer; font-weight: 600; font-size: .88rem; }

/* Fiche entreprise : passages ou ChatGPT la cite, une carte par reponse. */
.passage-list { display: grid; gap: .7rem; }
.passage-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }
.passage-card header { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; font-size: .85rem; }
.passage-card .pc-text { margin: .5rem 0 0; line-height: 1.6; }
.passage-card .pc-traits { list-style: none; margin: .6rem 0 0; padding: .6rem 0 0; border-top: 1px dashed var(--border);
  display: grid; gap: .35rem; font-size: .85rem; }
.passage-card .pc-traits q { color: var(--muted); font-style: italic; }
.engine-switch.three a { font-size: .72rem; padding: .3rem .25rem; }

/* API vs IHM (compare.php) et ChatGPT reel (cgpt.php). */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } }
.compact-list { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .85rem; line-height: 1.6; }
.cmp-table .cmp-grp td { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); background: var(--primary-soft); }
.cmp-stack-l { font-size: .8rem; margin: .6rem 0 .2rem; }
.cmp-stack { display: flex; height: 1.4rem; border-radius: 6px; overflow: hidden; background: var(--grid); font-size: .7rem; }
.cmp-stack span { display: flex; align-items: center; justify-content: center; color: #fff; white-space: nowrap; overflow: hidden; }
.cmp-stack .fmt-liste-classee { background: var(--series-1); }
.cmp-stack .fmt-prose { background: var(--series-3); }
.cmp-stack .fmt-tableau { background: var(--series-4); }
.cmp-stack .fmt-mixte { background: var(--muted); }
.cmp-hist { display: flex; align-items: flex-end; gap: 4px; height: 180px; }
.cmp-hcol { flex: 1; display: flex; flex-direction: column; height: 100%; }
.cmp-bars { flex: 1; display: flex; align-items: flex-end; gap: 2px; }
.cmp-bars span { flex: 1; border-radius: 3px 3px 0 0; min-height: 1px; }
.cmp-bars .api, .cmp-key.api { background: var(--series-2); }
.cmp-bars .ihm, .cmp-key.ihm { background: var(--series-1); }
.cmp-key.b1 { background: var(--muted); }
.cmp-hx { text-align: center; font-size: .7rem; color: var(--muted); padding-top: .2rem; }
.cmp-key { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; }
.rank-chart .cmp-line { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.rank-chart .cmp-line.b1 { stroke: var(--muted); stroke-dasharray: 4 3; }
.rank-chart .cmp-line.b2 { stroke: var(--series-2); }
.rank-chart .cmp-line.b3 { stroke: var(--series-1); }
.cmp-cote { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .cmp-cote { grid-template-columns: 1fr; } }
.cmp-texte { font-size: .88rem; line-height: 1.6; max-height: 70vh; overflow: auto; }
.cmp-sources { font-size: .82rem; padding-left: 1.3rem; }
