/* Thème sobre : typographie éditoriale, aplats neutres, la couleur réservée aux données. Chargé après app.css. */
:root {
  --v-blue: #2f4fd8; --v-violet: #6d4bc4; --v-pink: #c2417a; --v-orange: #c46a1c;
  --v-green: #1b8a5a; --v-teal: #127a8a; --v-yellow: #b38712; --v-red: #c23a32; --v-slate: #5b6577;
  --bg: #f7f7f5;
  --border: #e2e2dc;
  --radius: 10px;
  --shadow: none;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-title: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #121215; --border: #2e2e35; } }
:root[data-theme="dark"] { --bg: #121215; --border: #2e2e35; }

body { font-size: 15.5px; letter-spacing: -.003em; }
h1 { font-weight: 700; letter-spacing: -.015em; }
h2 { font-weight: 650; font-size: clamp(1.25rem, 2.2vw, 1.5rem); }
h3 { font-family: var(--font); font-weight: 650; font-size: 1rem; letter-spacing: 0; }
.page-head .lead, .hero .lead { color: var(--muted); }

.tone-blue { --t: var(--v-blue); } .tone-violet { --t: var(--v-violet); } .tone-pink { --t: var(--v-pink); }
.tone-orange { --t: var(--v-orange); } .tone-green { --t: var(--v-green); } .tone-teal { --t: var(--v-teal); }
.tone-yellow { --t: var(--v-yellow); } .tone-red { --t: var(--v-red); } .tone-slate { --t: var(--v-slate); }

/* En-tête */
.topbar { background: var(--surface); backdrop-filter: none; }
.mainnav a { border-radius: 0; padding: 18px 10px 16px; margin-bottom: -11px; border-bottom: 2px solid transparent; font-size: .9rem; }
.mainnav a:hover { background: none; color: var(--ink); }
.mainnav a.active { background: none; color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.mainnav .nav-learn { color: var(--ink-2); font-weight: 500; }
@media (max-width: 1140px) { .mainnav a { margin: 0; padding: 10px 12px; border-bottom: 0; } .mainnav a.active { background: var(--surface-2); border-radius: 8px; } }
.search input { border-radius: 8px; }
.brand b { color: var(--ink); }

/* Cartes et tuiles */
.card, .stat, .row, .lcard, .gcard, .award, .kvb, .tbl-wrap, .flow-detail, .vote-card { box-shadow: none; border-radius: var(--radius); }
.card.link:hover, .lcard:hover, .gcard:hover { transform: none; box-shadow: none; border-color: var(--ink-2); }
.stat .v { font-family: var(--font-title); font-weight: 650; }
.stat[class*="tone-"] { border-top: 3px solid var(--t); }
.stat[class*="tone-"] .v { color: var(--ink); }
.stat .ico { display: none; }

.ttl { display: block; }
.ttl .b { display: none; }
h3.ttl { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }

.btn { border-radius: 8px; font-weight: 550; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
:root[data-theme="dark"] .btn.primary { color: #111; }

/* Hero */
.hero { background: var(--surface); }
.hero h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); }
.hero h1 em { color: var(--accent); font-style: italic; }
.hero-chambers a { border-radius: var(--radius); }

/* Chips, statuts, thèmes */
.chip { border-radius: 6px; font-weight: 550; }
.chip.theme { background: transparent; border: 1px solid var(--border); color: var(--ink-2); padding-left: 8px; }
.chip.theme::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tc); flex: none; }
.status { border-radius: 6px; font-weight: 600; padding: 2px 8px; }
.st-promulguee { background: color-mix(in srgb, var(--v-green) 12%, var(--surface)); color: var(--v-green); }
.st-navette { background: color-mix(in srgb, var(--v-blue) 10%, var(--surface)); color: var(--v-blue); }
.st-adoptee { background: color-mix(in srgb, var(--v-teal) 12%, var(--surface)); color: var(--v-teal); }
.st-rejetee, .st-censuree { background: color-mix(in srgb, var(--v-red) 10%, var(--surface)); color: var(--v-red); }
.gchip { border-radius: 6px; }

/* Listes */
.row.striped { border-left: 3px solid var(--stripe, var(--border)); }
.lcards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.lcard { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); padding: 16px; color: inherit; border-top: 3px solid var(--tc, var(--accent)); min-width: 0; }
.lcard:hover { text-decoration: none; }
.lcard .lt { font-weight: 600; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lcard .lf { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }

.ibtn { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; align-items: center; justify-content: center; font-size: .68rem; font-weight: 700; border: 1px solid var(--border); color: var(--muted); cursor: help; vertical-align: middle; font-style: normal; margin-left: 4px; }

/* Onglets */
.tabs { gap: 0; margin: 6px 0 22px; }
.tabs button { padding: 10px 16px; font-weight: 550; font-size: .95rem; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--ink); }
[data-panel][hidden] { display: none !important; }

/* Loi : bandeau d'état et moments */
.banner { display: flex; gap: 14px; align-items: baseline; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--t); margin-bottom: 18px; flex-wrap: wrap; }
.banner .big { display: none; }
.banner b { font-size: 1.05rem; color: var(--ink); }
.banner .sub { color: var(--muted); font-size: .92rem; }
.moments { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 0; position: relative; }
.moments li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; align-items: start; font-size: .95rem; padding: 0 0 14px; position: relative; }
.moments li::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.moments li:last-child::before { display: none; }
.moments li .mi { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); margin-top: 6px; position: relative; z-index: 1; }
.moments li .md { color: var(--muted); font-size: .8rem; display: block; }

/* Groupe */
.gbanner { position: relative; border-radius: var(--radius); padding: 24px; overflow: hidden; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-top: 6px solid var(--gc); color: var(--ink); }
.gbanner.light { color: var(--ink); }
.gb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: center; }
@media (max-width: 820px) { .gb-grid { grid-template-columns: minmax(0, 1fr); } }
.gbanner .sig { font-family: var(--font-title); font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 700; line-height: 1; color: color-mix(in srgb, var(--gc) 85%, var(--ink)); }
.gbanner h1 { font-size: clamp(1.15rem, 2.4vw, 1.45rem); margin: 8px 0 6px; font-family: var(--font); font-weight: 650; }
.gbanner p { color: var(--ink-2); max-width: 620px; margin: 0 0 12px; }
.gb-chips { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); }
.gb-chips span, .gb-chips a { padding: 0; background: none; font-weight: 500; }
.gb-chips a { color: var(--accent); }
.gbanner .hemi-box { padding: 0; }
.gbanner .crumbs, .gbanner .crumbs a { color: var(--muted); }

.awards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.award { background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; color: inherit; display: block; }
.award:hover { text-decoration: none; border-color: var(--ink-2); }
.award .ae { display: none; }
.award .al { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.award .an { font-weight: 650; color: var(--ink); }
.award .av { font-size: .82rem; color: var(--muted); }

.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; margin: 9px 0; font-size: .88rem; }
.hbar .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hbar .track span { display: block; height: 100%; border-radius: 99px; background: var(--bc, var(--accent)); }

.kv-badges { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.kvb { background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; }
.kvb .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.kvb .v { font-size: 1.1rem; font-weight: 650; margin: 4px 0 8px; }

.mtable .mini-bar { width: 70px; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.mtable .mini-bar span { display: block; height: 100%; background: var(--ink-2); }
.mtable th[data-sort] { cursor: pointer; user-select: none; }
.mtable th[aria-sort] { color: var(--ink); }
.mtable .avatar { width: 32px; height: 32px; font-size: .72rem; }
.role-pill { display: inline-block; font-size: .74rem; font-weight: 550; padding: 1px 7px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); margin: 3px 4px 0 0; }
.moves { display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.moves div { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

.gcard { display: flex; flex-direction: column; gap: 6px; padding: 16px; color: inherit; border: 1px solid var(--border); border-left: 4px solid var(--gc); background: var(--surface); min-width: 0; }
.gcard:hover { text-decoration: none; }
.gcard .gtop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gcard .gsig { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.gcard .gn { font-family: var(--font-title); font-size: 1.5rem; font-weight: 650; color: var(--ink); }
.gcard .gname { font-size: .86rem; color: var(--ink-2); }
.gcard .gpitch { font-size: .84rem; color: var(--muted); line-height: 1.45; }
.gcard .seatbar { display: none; }

/* Comprendre */
.facts3 { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 12px 0; }
.fact { border-radius: var(--radius); padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--t, var(--accent)); color: inherit; }
.fact .fe { display: none; }
.fact b { display: block; font-size: 1.05rem; margin: 0 0 2px; font-family: var(--font-title); }
.fact span { font-size: .86rem; color: var(--muted); }
a.fact:hover { text-decoration: none; border-color: var(--ink-2); }
.learn h2 .n { display: none; }
.learn-nav a.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.learn-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
details.more-box > summary { list-style: none; }
details.more-box > summary::-webkit-details-marker { display: none; }
details.more-box > summary::before { content: "+ "; }
details.more-box[open] > summary::before { content: "– "; }

/* Comparateur */
.cmp-dot { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .75rem; }
.cmp-grid td, .cmp-grid th { padding: 7px 8px; }
.cmp-heat td { width: 44px; height: 32px; }
.cmp-th { font-size: .82rem; cursor: pointer; }
.cmp-th[aria-pressed="true"] { border-color: var(--ink) !important; color: var(--ink); font-weight: 650; }

/* Hémicycles : sièges un peu plus fins */
.legend button, .legend span { font-size: .84rem; }
.builder button { border-width: 1px; border-radius: 8px; font-weight: 550; }
.builder button[aria-pressed="true"] { border-color: var(--ink-2); background: var(--surface-2); }
#c-groups button[aria-pressed="false"] { opacity: .5; }
.majbar { border-radius: 6px; height: 26px; }
.callout { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.next-box { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.station .badge { display: none; }
