/* Simulateur du coût d'un accident (taux AT/MP) — complète legal_v2.css et
   calcul.css (formulaire .ct-*, cartes de résultat, tableau) avec ce qui lui
   est propre : liste d'accidents, réglages avancés, renvois aux sources,
   barème en tableau large. Mêmes jetons de couleur (--lg-*). */

/* ── Renvois [n] vers les sources ────────────────────────────────────── */
.lg2 .sc-ref {
  margin-left: 1px; font-size: .72em; font-weight: 600; line-height: 0;
  vertical-align: super; white-space: nowrap;
  color: var(--lg-orange-fonce); font-variant-numeric: tabular-nums;
}
.lg2 .sc-ref:hover { color: var(--lg-noir); text-decoration: none; }
.lg2 .ct-pousse .sc-ref, .lg2 .sc-info .sc-ref { color: inherit; }

/* ── Accidents ───────────────────────────────────────────────────────── */
.sc-accidents { display: grid; gap: 12px; }
.sc-accident {
  display: grid; gap: 16px;
  padding: 20px; border-radius: 22px; background: #fff;
}
.sc-accident-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sc-accident-tete[hidden] { display: none; }
.sc-accident-titre { font-size: 15px; font-weight: 600; }
.sc-supprimer {
  padding: 6px 14px; border: 1px solid var(--lg-trait); border-radius: 980px; background: #fff;
  font-family: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; color: var(--lg-gris); cursor: pointer;
  transition: border-color .2s, color .2s;
}
.sc-supprimer:hover { border-color: var(--lg-noir); color: var(--lg-noir); }
.sc-accident .ct-champ input, .sc-accident .ct-champ select { background-color: var(--lg-fond); border-color: transparent; }
.sc-accident .ct-champ input:focus, .sc-accident .ct-champ select:focus { background-color: #fff; border-color: var(--lg-orange); }
.sc-accident .ct-duo { align-items: end; }
.sc-accident .ct-champ[hidden] { display: none; }
.sc-accident .sc-cout { margin: 0; }

/* Années de déclaration et de notification : seulement en calcul affiné */
.sc-avance { display: none; }
.est-affine .sc-avance { display: grid; }

/* ── Affiner le calcul ───────────────────────────────────────────────── */
.sc-affiner { border-top: 1px solid var(--lg-trait); padding-top: 4px; }
.sc-affiner summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; list-style: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--lg-noir);
}
.sc-affiner summary::-webkit-details-marker { display: none; }
.sc-affiner summary:hover { color: var(--lg-orange-fonce); }
.sc-affiner summary svg { flex: none; transition: transform .35s var(--lg-courbe); }
.sc-affiner[open] summary svg { transform: rotate(180deg); }
.sc-affiner-corps { display: grid; gap: 20px; padding-bottom: 4px; }
.sc-affiner-corps > .ct-aide { margin: -6px 0 0; }
.sc-ajouter {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border: 0; border-radius: 980px;
  background: var(--lg-noir); color: #fff; font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.2; cursor: pointer;
  transition: background-color .2s;
}
.sc-ajouter:hover { background: #000; }

.sc input:focus-visible, .sc select:focus-visible, .sc button:focus-visible,
.sc summary:focus-visible, .sc a:focus-visible {
  outline: 2px solid var(--lg-orange); outline-offset: 2px;
}

/* ── Résultat ────────────────────────────────────────────────────────── */
.ct-resultats { position: sticky; top: 76px; }
.sc-montant .ct-res-valeur { margin: 6px 0 14px; font-size: clamp(48px, 6vw, 76px); }
.sc-detail { margin: 0; font-size: 15px; line-height: 1.55; color: var(--lg-texte); }
.sc-annees { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.sc-annees:empty { display: none; }
.sc-annees li {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 7px 14px; border-radius: 980px; background: var(--lg-fond);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.sc-annee { font-weight: 500; color: var(--lg-gris); }
.sc-sources-ligne {
  margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--lg-trait);
  font-size: 12.5px; line-height: 1.6; color: var(--lg-gris-clair);
}
.sc-info {
  margin: 0; padding: 18px 22px; border-radius: 20px;
  background: var(--lg-orange-doux); font-size: 14.5px; line-height: 1.55; color: var(--lg-texte);
}
.sc-info strong { color: #c2410c; font-weight: 600; }
.lg2 .ct-pousse strong { font-weight: 600; color: #fff; }

/* ── Barème : deux tableaux, première colonne fixe au défilement ─────── */
.sc-tab-hote + .sc-tab-hote { margin-top: -8px; }
.sc-tab { min-width: 600px; }
.sc-tab caption {
  padding: 22px 28px 4px; text-align: left;
  font-size: 15px; font-weight: 600; color: var(--lg-noir);
}
.sc-tab th, .sc-tab td { padding: 12px 10px; font-size: 14px; white-space: nowrap; }
.sc-tab thead th { padding-top: 14px; vertical-align: bottom; white-space: normal; line-height: 1.3; }
.sc-tab th:first-child {
  position: sticky; left: 0; z-index: 1;
  min-width: 230px; white-space: normal; background: var(--lg-fond);
}
/* Nom en retrait sous le code CTN quand il passe sur deux lignes */
.sc-tab .ct-tab-code { float: left; margin-right: 0; }
.sc-tab-nom { display: block; margin-left: 32px; }
.sc-tab .ct-tab-detail { margin-left: 0; }
.sc-tab tbody tr:last-child td, .sc-tab tbody tr:last-child th { padding-bottom: 22px; }
.sc-tab .sc-tab-fusion { text-align: center; color: var(--lg-noir); font-weight: 500; }
.sc-tab-astuce { display: none; }
.lg-sec .sc-tab-astuce { margin-top: -12px; font-size: 13px; color: var(--lg-gris-clair); }

/* ── Sources ─────────────────────────────────────────────────────────── */
.sc-sources {
  margin: 0 0 28px; padding: 0; list-style: none; counter-reset: source;
  display: grid; gap: 4px;
}
.sc-sources li {
  counter-increment: source; display: flex; gap: 12px;
  padding: 8px 12px; margin: 0 -12px; border-radius: 12px;
  font-size: 15px; line-height: 1.5; transition: background-color .4s;
}
.sc-sources li::before {
  content: '[' counter(source) ']'; flex: none; min-width: 32px;
  font-size: 13px; font-weight: 600; line-height: 1.75; color: var(--lg-gris-clair);
  font-variant-numeric: tabular-nums;
}
.sc-sources li:target { background: var(--lg-orange-doux); }
.sc-sources li:target::before { color: var(--lg-orange-fonce); }
.lg2 .lg-sec .sc-sources a { color: var(--lg-noir); }
.lg2 .lg-sec .sc-sources a:hover { color: var(--lg-orange-fonce); }
.lg-sec .lg-alerte { margin: 0; }

@media (max-width: 900px) {
  .ct-resultats { position: static; }
}
@media (max-width: 720px) {
  .lg-sec .sc-tab-astuce { display: block; }
}
@media (max-width: 640px) {
  .sc-accident { padding: 16px; border-radius: 18px; }
  .sc-accident .ct-duo { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sc-tab th:first-child { min-width: 150px; box-shadow: 1px 0 0 var(--lg-trait); }
  .sc-tab caption { padding: 18px 20px 0; }
  .sc-sources li { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-affiner summary svg, .sc-sources li { transition: none; }
}
@media print {
  .sc-tab th:first-child { position: static; }
}
