/* ORIA — Labo (démos IA exécutées dans le navigateur). Toutes les classes sont préfixées « lb- ».
 * Dépend des variables globales du site (--bleu, --accent, --fond, --ligne, --r…) ;
 * des valeurs de repli sont fournies pour que les démos restent lisibles sans la feuille globale. */

/* ============================================================ Base partagée */
.lb-root {
  --lb-bleu: var(--bleu, #071A42);
  --lb-accent: var(--accent, #1E3BB3);
  --lb-accent-2: var(--accent-2, #13247D);
  --lb-accent-soft: var(--accent-soft, #8FA8FF);
  --lb-fond: var(--fond, #F5F5F2);
  --lb-blanc: var(--blanc, #FAF9F6);
  --lb-texte2: var(--texte2, #4A4A4A);
  --lb-ligne: var(--ligne, #E4E4DE);
  --lb-ok: var(--ok, #1F7A4D);
  --lb-warn: var(--warn, #B26A00);
  --lb-danger: var(--danger, #B3261E);
  --lb-r: var(--r, 14px);
  --lb-card: #FFFFFF;
  --lb-tint: #EEF1FC;
  --lb-mono: ui-monospace, 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
  display: block;
  margin: 0 auto;
  font-family: 'Inter', Arial, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--lb-bleu);
  min-width: 0;
}

.lb-root *,
.lb-root *::before,
.lb-root *::after { box-sizing: border-box; }

.lb-root h2,
.lb-root h3,
.lb-root h4 {
  font-family: 'Manrope', 'Inter', Arial, sans-serif;
  color: var(--lb-bleu);
  line-height: 1.25;
  margin: 0 0 .5rem;
}
.lb-root h2 { font-size: 1.25rem; font-weight: 700; }
.lb-root h3 { font-size: 1.05rem; font-weight: 700; }
.lb-root h4 { font-size: .95rem; font-weight: 700; }
.lb-root p { margin: 0 0 .75rem; }
.lb-root p:last-child { margin-bottom: 0; }

.lb-root :focus-visible {
  outline: 3px solid var(--lb-accent-soft);
  outline-offset: 2px;
  border-radius: 6px;
}

.lb-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.lb-muted { color: var(--lb-texte2); font-size: .9rem; }
.lb-small { font-size: .82rem; }
.lb-mono { font-family: var(--lb-mono); font-size: .85em; }
.lb-num { font-variant-numeric: tabular-nums; }
.lb-hidden { display: none !important; }

/* Cartes / panneaux */
.lb-panel {
  background: var(--lb-card);
  border: 1px solid var(--lb-ligne);
  border-radius: var(--lb-r);
  padding: 16px;
  min-width: 0;
}
.lb-panel--soft { background: var(--lb-fond); }
.lb-panel + .lb-panel { margin-top: 16px; }
.lb-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.lb-panel-head h2,
.lb-panel-head h3 { margin: 0; }

@media (min-width: 720px) {
  .lb-panel { padding: 20px 24px; }
}

/* Grilles */
.lb-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@media (min-width: 960px) {
  .lb-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lb-grid-2--side { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
.lb-stack > * + * { margin-top: 16px; }
.lb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Bandeau confidentialité / information */
.lb-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--lb-tint);
  border: 1px solid #D9E0FA;
  border-left: 4px solid var(--lb-accent);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .9rem;
  color: var(--lb-bleu);
  margin: 0 0 16px;
}
.lb-notice svg { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--lb-accent); }
.lb-notice--warn { background: #FFF6E8; border-color: #F1DDBA; border-left-color: var(--lb-warn); }
.lb-notice--warn svg { color: var(--lb-warn); }

.lb-error {
  background: #FDF0EF;
  border: 1px solid #F2CFCB;
  border-left: 4px solid var(--lb-danger);
  border-radius: 10px;
  padding: 12px 14px;
  color: #6E1610;
  font-size: .92rem;
}

/* Badges */
.lb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  border: 1px solid transparent;
  background: var(--lb-fond);
  color: var(--lb-bleu);
}
.lb-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .9;
}
.lb-badge--plain::before { display: none; }
.lb-badge--ok { background: #E6F3EC; color: var(--lb-ok); border-color: #C6E3D3; }
.lb-badge--warn { background: #FFF2DF; color: #8A5200; border-color: #F0D7AE; }
.lb-badge--danger { background: #FCE9E7; color: var(--lb-danger); border-color: #F2C9C4; }
.lb-badge--info { background: var(--lb-tint); color: var(--lb-accent-2); border-color: #D6DEFA; }

/* Puces / boutons secondaires compacts (suggestions, filtres, bascules) */
.lb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--lb-ligne);
  background: var(--lb-card);
  color: var(--lb-bleu);
  font: inherit;
  font-size: .88rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.lb-chip:hover { border-color: var(--lb-accent); color: var(--lb-accent); }
.lb-chip[aria-pressed='true'],
.lb-chip[aria-checked='true'],
.lb-chip.is-active {
  background: var(--lb-bleu);
  border-color: var(--lb-bleu);
  color: #fff;
}
.lb-chip:disabled { opacity: .55; cursor: not-allowed; }

/* Boutons (repli si les classes globales .btn ne sont pas chargées) */
.lb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--lb-accent);
  background: var(--lb-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.lb-btn:hover { background: var(--lb-accent-2); border-color: var(--lb-accent-2); }
.lb-btn--line { background: transparent; color: var(--lb-accent); }
.lb-btn--line:hover { background: var(--lb-tint); color: var(--lb-accent-2); }
.lb-btn--sm { min-height: 36px; padding: 6px 14px; font-size: .88rem; }
.lb-btn:disabled { opacity: .55; cursor: not-allowed; }
.lb-btn svg { width: 18px; height: 18px; flex: none; }

/* Onglets */
.lb-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--lb-ligne);
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.lb-tab {
  flex: none;
  appearance: none;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  padding: 8px 12px;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--lb-texte2);
  cursor: pointer;
  min-height: 40px;
}
.lb-tab:hover { color: var(--lb-accent); }
.lb-tab[aria-selected='true'] { color: var(--lb-bleu); border-bottom-color: var(--lb-accent); }

/* Formulaires */
.lb-field { display: block; min-width: 0; }
.lb-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--lb-bleu);
}
.lb-input,
.lb-select,
.lb-textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #CFCFC7;
  border-radius: 10px;
  background: #fff;
  color: var(--lb-bleu);
  font: inherit;
  font-size: 1rem;
}
.lb-input--sm { min-height: 34px; padding: 5px 8px; font-size: .9rem; border-radius: 8px; }
.lb-input:focus,
.lb-select:focus,
.lb-textarea:focus { border-color: var(--lb-accent); outline: none; box-shadow: 0 0 0 3px rgba(30, 59, 179, .18); }
.lb-range { width: 100%; accent-color: var(--lb-accent); min-height: 32px; }

/* Barre de progression */
.lb-progress {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--lb-ligne);
  overflow: hidden;
}
.lb-progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lb-accent), var(--lb-accent-soft));
  transition: width .25s ease;
}

/* Tableaux */
.lb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.lb-table th,
.lb-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--lb-ligne);
  text-align: left;
  vertical-align: top;
}
.lb-table th { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--lb-texte2); }
.lb-table td.lb-r,
.lb-table th.lb-r { text-align: right; }

/* Indicateurs chiffrés */
.lb-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 720px) {
  .lb-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.lb-stat {
  background: var(--lb-fond);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
}
.lb-stat-k {
  display: block;
  font-family: 'Manrope', 'Inter', Arial, sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.lb-stat-l { display: block; font-size: .8rem; color: var(--lb-texte2); line-height: 1.35; margin-top: 2px; }

/* Bloc « comment ça marche » / détails pédagogiques */
.lb-details {
  border: 1px dashed #C9CFE6;
  border-radius: 12px;
  background: #FBFCFF;
  padding: 12px 14px;
  font-size: .88rem;
}

/* Surlignage des termes */
.lb-root mark,
.lb-mark {
  background: #FFE9A8;
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* Spinner */
.lb-spin {
  display: inline-block;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: lb-spin .8s linear infinite;
  vertical-align: -3px;
}
@keyframes lb-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .lb-root *,
  .lb-root *::before,
  .lb-root *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================ Démo 1 — extraction (lb-ex-*) */
.lb-ex-pick h2,
.lb-ex-result h2 { margin-bottom: 12px; }
.lb-ex-samples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  min-width: 0;
}
@media (min-width: 640px) { .lb-ex-samples { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .lb-ex-samples { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.lb-ex-opt { position: relative; min-width: 0; }
.lb-ex-radio,
.lb-ex-file {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  pointer-events: none;
}
.lb-ex-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 10px;
  border: 1.5px solid var(--lb-ligne);
  border-radius: 12px;
  background: var(--lb-card);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lb-ex-card:hover { border-color: var(--lb-accent-soft); }
.lb-ex-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1240 / 1754;
  max-height: 170px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--lb-ligne);
  border-radius: 6px;
  background: #fff;
  margin-bottom: 4px;
}
.lb-ex-card-t { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.lb-ex-card-d { font-size: .78rem; color: var(--lb-texte2); line-height: 1.35; overflow-wrap: anywhere; }
.lb-ex-radio:checked + .lb-ex-card,
.lb-ex-card.is-active {
  border-color: var(--lb-accent);
  box-shadow: 0 0 0 3px rgba(30, 59, 179, .16);
}
.lb-ex-radio:focus-visible + .lb-ex-card,
.lb-ex-file:focus-visible + .lb-ex-card {
  outline: 3px solid var(--lb-accent-soft);
  outline-offset: 2px;
}
.lb-ex-card--upload {
  align-items: center;
  justify-content: center;
  text-align: center;
  border-style: dashed;
  background: var(--lb-fond);
  min-height: 150px;
}
.lb-ex-up-ico {
  display: inline-flex;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--lb-tint);
  color: var(--lb-accent);
}
.lb-ex-up-ico svg { width: 22px; height: 22px; }
.lb-ex-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
}
.lb-ex-langf { flex: 1 1 220px; max-width: 320px; }
.lb-ex-runbox { flex: 1 1 280px; }
.lb-ex-run { width: 100%; }
@media (min-width: 640px) { .lb-ex-run { width: auto; } }
.lb-ex-weight { margin: 6px 0 0; }
.lb-ex-status { margin-top: 16px; }
.lb-ex-status-t { margin: 0 0 6px; font-size: .9rem; font-weight: 600; }
.lb-ex-pick .lb-error { margin-top: 12px; }

.lb-ex-result { margin-top: 16px; }
.lb-ex-result .lb-panel-head h2 { margin: 0; }
.lb-ex-result h2:focus { outline: none; }
.lb-ex-result h2:focus-visible { outline: 3px solid var(--lb-accent-soft); }
.lb-ex-timer { font-size: .95rem; margin: 0 0 14px; }
.lb-ex-timer strong { color: var(--lb-ok); }
.lb-ex-summary { gap: 6px; }

.lb-ex-fig { margin: 0; }
.lb-ex-pager { margin-bottom: 8px; }
.lb-ex-doc {
  position: relative;
  border: 1px solid var(--lb-ligne);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  line-height: 0;
}
.lb-ex-media { display: block; width: 100%; height: auto; }
.lb-ex-boxes { position: absolute; inset: 0; pointer-events: none; }
.lb-ex-box {
  position: absolute;
  border: 2px solid;
  border-radius: 4px;
  transition: box-shadow .15s ease, background-color .15s ease;
}
.lb-ex-box--party, .lb-ex-key--party { border-color: #1E3BB3; background: rgba(30, 59, 179, .08); }
.lb-ex-box--ref, .lb-ex-key--ref { border-color: #7B3FB5; background: rgba(123, 63, 181, .08); }
.lb-ex-box--amount, .lb-ex-key--amount { border-color: #1F7A4D; background: rgba(31, 122, 77, .10); }
.lb-ex-box--line, .lb-ex-key--line { border-color: #B26A00; background: rgba(178, 106, 0, .07); border-width: 1.5px; }
.lb-ex-box--word { border: 1px solid rgba(7, 26, 66, .28); background: none; border-radius: 2px; }
.lb-ex-box.is-hot { box-shadow: 0 0 0 4px rgba(255, 196, 0, .55); background-color: rgba(255, 214, 0, .22); }
.lb-ex-figfoot { margin-top: 8px; }
.lb-ex-check { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; cursor: pointer; min-height: 32px; }
.lb-ex-check input { width: 18px; height: 18px; accent-color: var(--lb-accent); }
.lb-ex-legend { margin: 4px 0 0; }
.lb-ex-legend span { white-space: nowrap; margin-right: 10px; }
.lb-ex-legend .lb-ex-key {
  display: inline-block;
  width: 12px; height: 12px;
  border-width: 2px;
  border-style: solid;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
}

.lb-ex-tabpanel:focus-visible { outline: 3px solid var(--lb-accent-soft); outline-offset: 2px; }
.lb-ex-fields th[scope='row'] { font-weight: 600; font-size: .85rem; color: var(--lb-bleu); text-transform: none; letter-spacing: 0; width: 34%; }
.lb-ex-fields td { vertical-align: middle; }
.lb-ex-fields td:last-child { width: 1%; white-space: nowrap; }
.lb-ex-fields .lb-input,
.lb-ex-fields .lb-select { min-width: 9em; }
@media (max-width: 559px) {
  .lb-ex-fields thead { display: none; }
  .lb-ex-fields tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--lb-ligne);
  }
  .lb-ex-fields th,
  .lb-ex-fields td { display: block; padding: 0; border: 0; }
  .lb-ex-fields th[scope='row'] { grid-column: 1 / -1; width: auto; }
  .lb-ex-fields .lb-input,
  .lb-ex-fields .lb-select { min-width: 0; }
}
.lb-ex-lines .lb-input { min-width: 6.5em; }
.lb-ex-lines td:first-child .lb-input { min-width: 13em; }
.lb-ex-numin { text-align: right; }
.lb-ex-linechk { text-align: center; vertical-align: middle; }
.lb-ex-pre {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: #0B1430;
  color: #E7ECFF;
  font-family: var(--lb-mono);
  font-size: .8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.lb-ex-checkbox { margin-top: 18px; }
.lb-ex-checks { list-style: none; margin: 0; padding: 0; }
.lb-ex-checks li { padding: 6px 0; border-bottom: 1px solid var(--lb-ligne); font-size: .9rem; }
.lb-ex-checks li:last-child { border-bottom: 0; }
.lb-ex-exports { margin-top: 16px; }
.lb-ex-cta {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--lb-ligne);
  font-size: .92rem;
}
.lb-ex-cta a { color: var(--lb-accent); font-weight: 600; }
/* ---- /extraction ---- */

/* ============================================================ Démo 2 — questions-réponses (lb-qa-*) */
.lb-qa-grid { align-items: start; }
.lb-qa-grid > .lb-panel + .lb-panel { margin-top: 0; }
.lb-qa-lib .lb-panel-head { margin-bottom: 8px; }
.lb-qa-libtoggle { width: 100%; justify-content: center; margin-bottom: 4px; }
.lb-qa-libbody.is-collapsed { display: none; }
@media (min-width: 960px) {
  .lb-qa-libtoggle { display: none; }
  .lb-qa-libbody.is-collapsed { display: block; }
  .lb-qa-lib { position: sticky; top: 16px; }
}
.lb-qa-doclist { list-style: none; margin: 0; padding: 0; }
.lb-qa-doclist li + li { margin-top: 6px; }
.lb-qa-docbtn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--lb-ligne);
  border-radius: 10px;
  background: var(--lb-card);
  color: var(--lb-bleu);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.lb-qa-docbtn:hover { border-color: var(--lb-accent); }
.lb-qa-docbtn svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--lb-accent); }
.lb-qa-doct { display: flex; flex-direction: column; min-width: 0; }
.lb-qa-doctitle { font-weight: 600; font-size: .9rem; line-height: 1.3; }
.lb-qa-docref { font-family: var(--lb-mono); font-size: .74rem; color: var(--lb-texte2); margin-top: 2px; }
.lb-qa-back { margin-bottom: 10px; }
.lb-qa-reader h3 { font-size: 1.05rem; margin-bottom: 2px; }
.lb-qa-reader h3:focus { outline: none; }
.lb-qa-reader h3:focus-visible { outline: 3px solid var(--lb-accent-soft); }
.lb-qa-readscroll {
  max-height: 520px;
  overflow-y: auto;
  margin-top: 8px;
  padding-right: 4px;
  position: relative;
  scroll-behavior: smooth;
}
.lb-qa-sec {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .9rem;
}
.lb-qa-sec + .lb-qa-sec { margin-top: 4px; }
.lb-qa-sec h4 { font-size: .9rem; margin-bottom: 4px; }
.lb-qa-sec.is-hit { background: #FFF8E1; border-color: #F3DE9A; }
.lb-qa-sec ul,
.lb-qa-passage ul { margin: 0 0 .75rem; padding-left: 1.2em; }
.lb-qa-sec li,
.lb-qa-passage li { margin-bottom: 2px; }

.lb-qa-form { margin-bottom: 14px; }
.lb-qa-askrow { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-qa-input { flex: 1 1 220px; }
.lb-qa-askrow .lb-btn { flex: 0 0 auto; }
@media (max-width: 479px) { .lb-qa-askrow .lb-btn { width: 100%; } }
.lb-qa-sugs { margin-bottom: 16px; }
.lb-qa-suglist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lb-qa-suglist .lb-chip { min-height: 36px; }
.lb-qa-offline { margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lb-qa-off { border-style: dashed; }
.lb-qa-empty { padding: 16px; border: 1px dashed var(--lb-ligne); border-radius: 12px; text-align: center; margin: 0; }
.lb-qa-card {
  border: 1px solid #D6DEFA;
  border-left: 4px solid var(--lb-accent);
  border-radius: 12px;
  padding: 14px 16px;
  background: #FBFCFF;
}
.lb-qa-card--none { border-color: #F2CFCB; border-left-color: var(--lb-danger); background: #FFF9F8; }
.lb-qa-none { font-weight: 700; color: #6E1610; }
.lb-qa-cardhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 6px; }
.lb-qa-cardhead h3 { margin: 0; font-size: 1rem; }
.lb-qa-sectitle { font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.lb-qa-passage { font-size: .95rem; }
.lb-qa-cite {
  margin: 10px 0;
  padding-top: 8px;
  border-top: 1px solid var(--lb-ligne);
  font-size: .85rem;
  font-weight: 600;
  color: var(--lb-accent-2);
}
.lb-qa-cardfoot { gap: 8px 14px; }
.lb-qa-othersh { margin-top: 18px; font-size: .95rem; }
.lb-qa-others { list-style: none; margin: 0; padding: 0; }
.lb-qa-other {
  padding: 10px 12px;
  border: 1px solid var(--lb-ligne);
  border-radius: 10px;
  background: var(--lb-card);
}
.lb-qa-other + .lb-qa-other { margin-top: 8px; }
.lb-qa-other .lb-qa-cite { margin: 6px 0 8px; padding-top: 0; border-top: 0; }
.lb-qa-snip { font-size: .9rem; margin-bottom: 0; }
.lb-qa-howwrap { margin-top: 16px; }
.lb-qa-how { margin-top: 10px; }
.lb-qa-how h4 { margin-top: 12px; }
.lb-qa-terms { gap: 6px; margin-bottom: 8px; }
.lb-qa-term {
  font-family: var(--lb-mono);
  font-size: .8rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--lb-tint);
  color: var(--lb-accent-2);
}
.lb-qa-howtable td,
.lb-qa-howtable th { padding: 6px; }
.lb-qa-cta {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--lb-ligne);
  font-size: .92rem;
}
.lb-qa-cta a { color: var(--lb-accent); font-weight: 600; }
/* ---- /qa ---- */

/* ============================================================ Démo 3 — signaux faibles (lb-sg-*) */
.lb-sg > * + * { margin-top: 16px; }
.lb-sg-main > .lb-panel + .lb-panel { margin-top: 0; }
.lb-sg-sens-val { font-weight: 700; font-size: .9rem; color: var(--lb-accent-2); }
.lb-sg-range { display: flex; align-items: center; gap: 10px; }
.lb-sg-range .lb-range { flex: 1; min-width: 0; }
.lb-sg-stats { margin: 14px 0 10px; }
.lb-sg-naive {
  display: block;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #D4D4CC;
  font-size: .76rem;
  color: var(--lb-texte2);
}

/* Liste du portefeuille */
.lb-sg-filters { margin-bottom: 12px; }
.lb-sg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.lb-sg-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--lb-ligne);
  border-radius: 12px;
  background: var(--lb-card);
  color: var(--lb-bleu);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.lb-sg-item:hover { border-color: var(--lb-accent); }
.lb-sg-item[aria-pressed='true'] {
  border-color: var(--lb-accent);
  background: var(--lb-tint);
  box-shadow: inset 0 0 0 1px var(--lb-accent);
}
.lb-sg-item-top,
.lb-sg-item-bot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
}
.lb-sg-id { font-weight: 700; font-size: .9rem; }
.lb-sg-spark { display: block; width: 100%; height: 30px; overflow: visible; }
.lb-sg-c-line { fill: none; stroke: var(--lb-bleu); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.lb-sg-c-alert { fill: none; stroke: var(--lb-accent); stroke-width: 7; stroke-linecap: round; }
.lb-sg-c-lost { stroke: var(--lb-danger); stroke-width: 1; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.lb-sg-empty { grid-column: 1 / -1; padding: 8px 0; }
.lb-sg-more { margin-top: 12px; }

/* Détail client */
.lb-sg-dhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  margin-bottom: 10px;
}
.lb-sg-dhead h3 { margin: 0; }
.lb-sg-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
@media (min-width: 560px) {
  .lb-sg-kv { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.lb-sg-kv > div { background: var(--lb-fond); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.lb-sg-kv dt { font-size: .74rem; color: var(--lb-texte2); }
.lb-sg-kv dd { margin: 2px 0 0; font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; }
.lb-sg-metrics { margin-bottom: 8px; }

.lb-sg-chart {
  position: relative;
  width: 100%;
  min-height: 210px;
  border-radius: 10px;
  touch-action: pan-y;
}
.lb-sg-chart svg { display: block; max-width: 100%; height: auto; }
.lb-sg-band { fill: var(--lb-fond); }
.lb-sg-grid { stroke: #ECECE6; stroke-width: 1; }
.lb-sg-axis { stroke: #CFCFC7; stroke-width: 1; }
.lb-sg-tick { fill: var(--lb-texte2); font-size: 11px; font-family: 'Inter', Arial, sans-serif; }
.lb-sg-line { fill: none; stroke: var(--lb-bleu); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.lb-sg-peer { fill: none; stroke: #9A9A92; stroke-width: 1.5; stroke-dasharray: 4 4; }
.lb-sg-trend { fill: none; stroke: var(--lb-accent); stroke-width: 2.5; stroke-dasharray: 7 4; stroke-linecap: round; }
.lb-sg-thr { stroke: var(--lb-danger); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; }
.lb-sg-lostline { stroke: var(--lb-danger); stroke-width: 1.5; stroke-dasharray: 3 3; }
.lb-sg-alertpt { fill: var(--lb-accent); stroke: var(--lb-card); stroke-width: 2; }
.lb-sg-naivept { fill: var(--lb-card); stroke: #6B6B66; stroke-width: 2; }
.lb-sg-cross { stroke: #9A9A92; stroke-width: 1; }
.lb-sg-crossdot { fill: var(--lb-bleu); stroke: var(--lb-card); stroke-width: 2; }
.lb-sg-tip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  max-width: 240px;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--lb-bleu);
  color: #fff;
  font-size: .76rem;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(7, 26, 66, .18);
}
.lb-sg-tip strong,
.lb-sg-tip span { display: block; white-space: nowrap; }
.lb-sg-tip span { opacity: .85; }

.lb-sg-legend {
  list-style: none;
  margin: 8px 0 14px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: .78rem;
  color: var(--lb-texte2);
}
.lb-sg-legend li { display: inline-flex; align-items: center; gap: 6px; }
.lb-sg-key { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--lb-bleu); flex: none; }
.lb-sg-key--peer { border-top: 2px dashed #9A9A92; }
.lb-sg-key--trend { border-top: 2.5px dashed var(--lb-accent); }
.lb-sg-key--lost { width: 0; height: 14px; border-top: 0; border-left: 2px dashed var(--lb-danger); }
.lb-sg-key--band { width: 16px; height: 12px; border: 1px solid var(--lb-ligne); background: var(--lb-fond); }
.lb-sg-key--alert { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--lb-accent); }
.lb-sg-key--naive { width: 9px; height: 9px; border: 2px solid #6B6B66; background: var(--lb-card); transform: rotate(45deg); margin: 0 2px; }

.lb-sg-explain:not(:empty) {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--lb-tint);
  border: 1px solid #D9E0FA;
  font-size: .92rem;
}
.lb-sg-explain p { margin: 0 0 .5rem; }
.lb-sg-note { margin-top: .5rem !important; font-style: italic; }
.lb-sg-data { margin-top: 12px; font-size: .88rem; }
.lb-sg-data summary,
.lb-sg-method summary { cursor: pointer; font-weight: 600; min-height: 32px; display: list-item; }
.lb-sg-data .lb-table-wrap { max-height: 320px; overflow-y: auto; margin-top: 8px; }
.lb-sg-data th[scope='row'] { white-space: nowrap; font-weight: 600; }
.lb-sg-method ul { margin: 8px 0 10px; padding-left: 1.2rem; }
.lb-sg-method li { margin-bottom: 4px; }
/* ---- /signals ---- */
