/* Couche finale : sobriété, une seule famille de police, composants du comparateur. Chargée après theme.css. */
:root {
  --font-title: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 10px;
}

/* Typographie : une seule famille, hiérarchie par la taille et la graisse */
h1, h2, h3, .stat .v, .gcard .gn, .gbanner .sig, .fact b { font-family: var(--font); }
h1 { font-size: clamp(1.5rem, 2.6vw, 1.85rem); font-weight: 650; letter-spacing: -.022em; }
h2 { font-size: 1.15rem; font-weight: 650; letter-spacing: -.012em; }
.page { padding-top: 32px; }
.page-head { margin-bottom: 18px; }
.page-head .lead { font-size: .98rem; margin: 4px 0 0; }
.hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 650; letter-spacing: -.028em; }
.hero h1 em { font-style: normal; color: var(--ink-2); }
.hero .wrap { padding-top: 36px; padding-bottom: 30px; }
.stat .v { font-weight: 650; letter-spacing: -.02em; font-size: clamp(1.4rem, 2.6vw, 1.75rem); }
.stat[class*="tone-"] { border-top: 1px solid var(--border); }
.stat .l { font-size: .88rem; }
.gbanner .sig { font-weight: 750; letter-spacing: -.03em; }

/* En-tête : marque discrète */
.brand { font-weight: 650; letter-spacing: -.01em; gap: 9px; }
.brand svg { width: 26px; height: 17px; }
.brand .sub { color: var(--muted); font-weight: 450; font-size: .85rem; }
@media (max-width: 1240px) { .brand .sub { display: none; } }
.nav-aside { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.nav-aside:hover { color: var(--ink); text-decoration: none; }
.nav-aside.active { color: var(--ink); font-weight: 600; }

/* Barre d'outils de filtres */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 150px; position: relative; }
.field.grow { flex: 1 1 220px; }
.field > span, .field summary > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.field select, .field input { height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; min-width: 0; }
.field select:focus, .field input:focus { outline: none; border-color: var(--ink-2); }
.dd summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.dd summary::-webkit-details-marker { display: none; }
.dd summary b { height: 38px; display: flex; align-items: center; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: 8px; font-weight: 500; font-size: .92rem; position: relative; }
.dd summary b::after { content: ""; position: absolute; right: 12px; top: 15px; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.dd[open] summary b { border-color: var(--ink-2); }
.dd-panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 320px; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 8px; }
.dd-actions { display: flex; justify-content: space-between; padding: 4px 6px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dd-item { display: grid; grid-template-columns: 18px 10px 54px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px; border-radius: 6px; cursor: pointer; font-size: .88rem; }
.dd-item:hover { background: var(--surface-2); }
.dd-item i { width: 10px; height: 10px; border-radius: 50%; }
.dd-item span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: .84rem; padding: 0; }
.tag { display: inline-flex; align-items: center; gap: 8px; padding: 3px 6px 3px 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .86rem; }
.tag .avatar { width: 24px; height: 24px; font-size: .6rem; }
.tag button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 4px; }

/* Panneaux */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; min-width: 0; }
.panel > header, .panel > summary { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 1.02rem; }
.panel.fold > summary { cursor: pointer; list-style: none; margin: 0; }
.panel.fold > summary::-webkit-details-marker { display: none; }
.panel.fold > summary h2::before { content: "+ "; color: var(--muted); }
.panel.fold[open] > summary { margin-bottom: 14px; }
.panel.fold[open] > summary h2::before { content: "– "; }
.inline-select { font: inherit; font-weight: 650; color: var(--ink); border: 0; border-bottom: 1.5px solid var(--ink-2); background: none; padding: 0 2px; cursor: pointer; }

.ent { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.ent i { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* Barres divergentes */
.div-chart { display: flex; flex-direction: column; gap: 6px; }
.div-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 150px; gap: 14px; align-items: center; min-height: 26px; }
.div-head { min-height: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; }
.div-head .div-track { background: none; display: flex; justify-content: space-between; height: auto; }
.div-head .div-track::after { display: none; }
.div-track { position: relative; display: grid; grid-template-columns: 1fr 1fr; height: 14px; }
.div-track::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 1px; background: var(--ink-2); opacity: .5; }
.half { background: var(--surface-2); display: flex; overflow: hidden; }
.half.left { justify-content: flex-end; border-radius: 3px 0 0 3px; }
.half.right { border-radius: 0 3px 3px 0; }
.half.left span { background: var(--contre); height: 100%; }
.half.right span { background: var(--pour); height: 100%; }
.div-val { font-size: .84rem; white-space: nowrap; }
.div-val b { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .div-row { grid-template-columns: 80px minmax(0, 1fr); } .div-val { grid-column: 2; margin-top: -4px; } }

/* Carte de chaleur sobre */
.hm-wrap { overflow-x: auto; }
.hm { border-collapse: separate; border-spacing: 3px; font-size: .78rem; }
.hm th { font-weight: 500; color: var(--muted); padding: 0 4px; text-align: left; white-space: nowrap; }
.hm thead th { vertical-align: bottom; height: 110px; padding: 0; }
.hm-col, .hm-colh { border: 0; background: none; cursor: pointer; color: var(--muted); font: inherit; font-size: .76rem; padding: 0 0 6px; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; text-align: left; }
.hm-colh { cursor: default; }
.hm-col:hover, .hm-col.on { color: var(--ink); font-weight: 650; }
.hm-cell { display: flex; width: 38px; height: 28px; border-radius: 4px; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 550; }
.hm-cell.empty { background: transparent; border: 1px dashed var(--border); }
.hm-cell.on { box-shadow: 0 0 0 1.5px var(--ink); }

/* Classement d'accord */
.rank { display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 48px; gap: 14px; align-items: center; font-size: .86rem; }
.rank-row b { text-align: right; font-variant-numeric: tabular-nums; }
.rank-track { height: 10px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.rank-track span { display: block; height: 100%; border-radius: 3px; opacity: .85; }
.pairs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pairs li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.pairs li:last-child { border-bottom: 0; }
.pairs li b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Grille vote par vote */
.votes-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.votes-bar .legend { margin: 0; }
.vgrid th, .vgrid td { padding: 8px 10px; }
.vgrid th.c, .vgrid td.c { text-align: center; }
.vgrid th.c .ent { font-size: .76rem; }
.vgrid .vt { min-width: 280px; }
.vgrid .vt a { color: var(--ink); font-size: .88rem; font-weight: 500; }
.vgrid tbody tr:hover { background: var(--surface-2); }
.vdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.vdot.none { width: 6px; height: 6px; background: var(--border); }

/* Divers allégés */
.tabs { margin: 4px 0 18px; }
.tabs button { padding: 9px 14px; font-size: .92rem; }
.lcard { border-top-width: 1px; border-left: 3px solid var(--tc, var(--accent)); }
.chip.theme { border: 0; padding-left: 0; background: none; }
.footer { font-size: .84rem; }

.mainnav .nav-2 { color: var(--muted); }
@media (max-width: 1140px) { .mainnav .nav-2 { margin-left: 0 !important; } }

.dd.field { display: block; }
.dd.field summary { gap: 4px; }

.agenda-mini { list-style: none; margin: 10px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: .9rem; }
.agenda-mini li { display: flex; flex-direction: column; gap: 2px; }

h3.ttl { display: inline-block; margin-right: 2px; }
.page-head .pill-row { margin-top: 12px; }
