/* app.css : styles sobres en complément de DSFR (vendoré). Aucun CDN. */
:root{
  --coeur:#C9530F; --peri:#4A5FD8; --faible:#6B8E23; --retiree:#6a6a6a; --blue-ink:#2f3d95;
  --coeur-bg:#fbeadf; --peri-bg:#e6eafb; --faible-bg:#eef3e2; --retiree-bg:#efefef;
  --ink:#161616; --muted:#666; --line:#e5e5e5;
}
.tc-hero{background:#f5f7fd;border-bottom:1px solid #dde3f8;}
.tc-section{scroll-margin-top:5rem;}
.tc-kpi{border:1px solid var(--line);border-radius:.5rem;padding:1rem 1.25rem;height:100%;background:#fff;}
.tc-kpi .tc-kpi-val{font-size:2rem;line-height:1.1;font-weight:700;color:var(--blue-ink);font-variant-numeric:tabular-nums;}
.tc-kpi .tc-kpi-lbl{font-size:.85rem;color:var(--muted);margin-top:.25rem;}
.tc-kpi.coeur{border-top:3px solid var(--coeur);}
.tc-kpi.coeur .tc-kpi-val{color:var(--coeur);}
.tc-kpi.faible .tc-kpi-val{color:var(--faible);}
.tc-kpi-sub{font-size:.78rem;color:var(--muted);margin-top:.35rem;}
/* Grille de lecture */
.tc-grid-3{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;}
.tc-classe{border:1px solid var(--line);border-radius:.5rem;background:#fff;padding:1rem 1.1rem;display:flex;flex-direction:column;gap:.4rem;}
.tc-classe .tc-classe-n{font-size:1.9rem;font-weight:700;line-height:1.1;font-variant-numeric:tabular-nums;}
.tc-classe h3{font-size:1rem;margin:0;}
.tc-classe p{font-size:.84rem;margin:0;color:#333;}
.tc-classe.coeur{border-top:4px solid var(--coeur);}
.tc-classe.coeur .tc-classe-n{color:var(--coeur);}
.tc-classe.peri{border-top:4px solid var(--peri);}
.tc-classe.peri .tc-classe-n{color:var(--peri);}
.tc-classe.faible{border-top:4px solid var(--faible);}
.tc-classe.faible .tc-classe-n{color:var(--faible);}
.tc-classe.retiree{border-top:4px solid var(--retiree);background:#fafafa;}
.tc-classe.retiree .tc-classe-n{color:var(--retiree);}
.tc-strip{display:flex;height:18px;border-radius:4px;overflow:hidden;gap:2px;margin:.75rem 0 .35rem;}
.tc-strip span{display:block;height:100%;}
.tc-strip .coeur{background:var(--coeur);}
.tc-strip .peri{background:var(--peri);}
.tc-strip .faible{background:var(--faible);}
.tc-strip .retiree{background:#bdbdbd;}
/* Barres */
.tc-chart{margin:.5rem 0 1rem;}
.tc-bar-row{display:flex;align-items:center;gap:.5rem;margin:.25rem 0;font-size:.82rem;}
.tc-bar-lbl{flex:0 0 38%;max-width:38%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink);}
.tc-bar-track{display:flex;flex:1 1 auto;gap:2px;height:14px;position:relative;}
/* display:block indispensable : sur un span inline, width/height sont ignorés */
.tc-bar-fill{display:block;height:100%;border-radius:0 3px 3px 0;background:var(--peri);min-width:2px;}
.tc-bar-fill.coeur{background:var(--coeur);border-radius:3px 0 0 3px;}
.tc-bar-fill.coeur:last-child{border-radius:3px;}
.tc-bar-fill.faible{background:var(--faible);}
.tc-bar-fill.one{background:var(--blue-ink);border-radius:3px;}
.tc-bar-val{flex:0 0 96px;white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums;color:var(--muted);}
.tc-bar-row:hover .tc-bar-lbl{font-weight:700;}
.tc-legend{display:flex;flex-wrap:wrap;gap:.4rem 1rem;font-size:.78rem;color:var(--muted);margin:.25rem 0 .5rem;}
.tc-legend span{display:inline-flex;align-items:center;gap:.35rem;}
.tc-dot{width:11px;height:11px;border-radius:50%;display:inline-block;}
.tc-dot.hollow{background:none;border:2px dashed var(--faible);}
.tc-sq{width:11px;height:11px;border-radius:2px;display:inline-block;}
.tc-note{font-size:.82rem;color:var(--muted);border-left:3px solid var(--peri);padding-left:.6rem;margin:.5rem 0;}
.tc-src{font-size:.78rem;color:var(--muted);}
.tc-anchor-nav{position:sticky;top:0;z-index:5;background:#fff;border-bottom:1px solid var(--line);}
.tc-anchor-nav ul{display:flex;flex-wrap:wrap;gap:.25rem 1rem;list-style:none;margin:0;padding:.5rem 0;font-size:.85rem;}
.tc-anchor-nav a{color:var(--blue-ink);text-decoration:none;background:none;}
.tc-anchor-nav a:hover{text-decoration:underline;}
.tc-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:1rem;}
/* Carte */
.tc-map-wrap{background:#fff;border:1px solid var(--line);border-radius:.5rem;padding:1rem;max-width:760px;margin:0 auto;}
.tc-map-wrap svg{width:100%;height:auto;display:block;}
.tc-map-wrap a.map-marker{background:none;cursor:pointer;}
.tc-map-wrap a.map-marker:hover circle{stroke:#1e2330;}
/* Fiches */
.tc-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:1rem;}
.tc-card{border:1px solid var(--line);border-radius:.5rem;background:#fff;padding:1rem 1.1rem;display:flex;flex-direction:column;gap:.4rem;scroll-margin-top:5rem;border-left:4px solid var(--peri);}
.tc-card.coeur{border-left-color:var(--coeur);}
.tc-card.faible{border-left-color:var(--faible);background:#fbfcf8;}
.tc-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:.5rem;flex-wrap:wrap;}
.tc-card-head h3{font-size:1rem;margin:0;line-height:1.3;}
.tc-card-sub{font-size:.85rem;color:var(--ink);margin:0;}
.tc-card-meta{font-size:.76rem;color:var(--muted);margin:0;}
.tc-badges{display:flex;flex-wrap:wrap;gap:.3rem;}
.tc-badge{font-size:.7rem;font-weight:700;border-radius:3px;padding:.1rem .4rem;white-space:nowrap;}
.tc-badge.coeur{background:var(--coeur-bg);color:#8a3200;}
.tc-badge.peri{background:var(--peri-bg);color:#2f3d95;}
.tc-badge.faible{background:var(--faible-bg);color:#3f5a0f;}
.tc-badge.retiree{background:var(--retiree-bg);color:#555;}
.tc-badge.niv{background:#f0f0f2;color:#333;}
.tc-badge.niv.inc{background:#fff4e0;color:#7a4d00;}
.tc-badge.sna{background:#f0f0f2;color:#555;font-weight:500;}
.tc-rncp{font-size:.8rem;margin:0;color:#333;}
.tc-rncp a{font-weight:700;}
.tc-extrait{font-size:.79rem;line-height:1.4;color:#333;background:#f7f8fb;border-radius:.35rem;padding:.45rem .6rem;margin:0;}
.tc-card.coeur .tc-extrait{background:#fdf3ec;}
.tc-card.faible .tc-extrait{background:#f2f5ea;}
.tc-eff{font-size:.8rem;margin:0;color:var(--ink);}
.tc-eff strong{color:var(--blue-ink);}
.tc-card.coeur .tc-eff strong{color:var(--coeur);}
details.tc-fold{border:1px solid var(--line);border-radius:.5rem;background:#fff;padding:.6rem 1rem;margin-top:1.5rem;}
details.tc-fold summary{cursor:pointer;font-weight:700;font-size:.95rem;color:var(--ink);}
details.tc-fold .tc-cards{margin-top:1rem;}
details.tc-fold.faible{border-left:4px solid var(--faible);}
details.tc-fold.retiree{border-left:4px solid var(--retiree);background:#fafafa;}
ul.tc-retirees{font-size:.82rem;margin:.75rem 0 .25rem;padding-left:1.1rem;}
ul.tc-retirees li{margin:.2rem 0;}
/* Filtres */
.tc-filters{display:flex;flex-wrap:wrap;gap:.5rem 1rem;align-items:center;margin:.75rem 0 1rem;}
.tc-filters label{font-size:.8rem;color:var(--muted);display:inline-flex;align-items:center;gap:.35rem;}
.tc-filters select,.tc-filters input[type=search]{font-size:.85rem;padding:.25rem .5rem;border:1px solid #ccc;border-radius:.25rem;background:#fff;max-width:14rem;}
.tc-count{font-size:.8rem;color:var(--muted);}
.tc-reset{font-size:.8rem;color:var(--blue-ink);background:none;border:none;cursor:pointer;text-decoration:underline;padding:0;}
/* Tableau */
.tc-table-wrap{overflow-x:auto;background:#fff;border:1px solid var(--line);border-radius:.5rem;}
table.tc-table{width:100%;border-collapse:collapse;font-size:.8rem;}
table.tc-table th,table.tc-table td{border-bottom:1px solid var(--line);padding:.4rem .55rem;text-align:left;vertical-align:top;}
table.tc-table th{background:#f6f6f8;cursor:pointer;white-space:nowrap;user-select:none;}
table.tc-table th:hover{background:#eceef4;}
table.tc-table td.num,table.tc-table th.num{text-align:right;font-variant-numeric:tabular-nums;}
table.tc-table tr.faible td{color:#555;background:#fbfcf8;}
/* Lecture experte */
.tc-quote{border-left:4px solid var(--coeur);background:#fff;padding:.9rem 1.1rem;border-radius:.35rem;font-size:.92rem;line-height:1.5;}
.tc-quote p{margin:0 0 .5rem;}
.tc-quote p:last-child{margin:0;}
ol.tc-steps{counter-reset:s;list-style:none;padding:0;margin:.5rem 0 0;font-size:.86rem;}
ol.tc-steps li{list-style:none;position:relative;padding-left:2rem;margin:.45rem 0;}
ol.tc-steps li::marker{content:"";}
.tc-steps li::before{counter-increment:s;content:counter(s);position:absolute;left:0;top:0;width:1.4rem;height:1.4rem;border-radius:50%;background:var(--blue-ink);color:#fff;font-size:.75rem;font-weight:700;display:flex;align-items:center;justify-content:center;}
@media (max-width:62em){.tc-grid-3{grid-template-columns:1fr 1fr;}}
@media (max-width:48em){.tc-grid-2,.tc-grid-3{grid-template-columns:1fr;}.tc-bar-lbl{flex-basis:42%;max-width:42%;}.tc-cards{grid-template-columns:1fr;}}
@media print{.tc-anchor-nav,.tc-filters{display:none;}.tc-card{break-inside:avoid;}}
