/* dashboard/assets/site.css — banner, badges, change arrows, embargo, selectors */
.dash-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; padding: .45rem 1rem;
  background: #FFF4D6; border-bottom: 1px solid #E0C46C; font-size: .86rem; color: #3a3000; }
.dash-banner p { margin: 0; }
.dash-banner .disclaimer { flex: 1 1 32rem; }
.dash-banner .stamp { flex: 0 1 auto; color: #4a4a4a; }
.dash-banner .lang-toggle { margin-left: auto; font-weight: 600; padding: .15rem .6rem; border: 1px solid #1F4E79; border-radius: 4px;
  color: #1F4E79; text-decoration: none; background: #fff; }
.dash-banner .lang-toggle:hover, .dash-banner .lang-toggle:focus { background: #1F4E79; color: #fff; }
.embargo-banner { display: none; flex-basis: 100%; font-weight: 600; color: #7a1f00; }
body.embargo-active .embargo-banner { display: block; }

.badge-kind { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  padding: .05rem .4rem; border-radius: 3px; border: 1px solid; }
.badge-kind.modelled { color: #5a2d82; border-color: #5a2d82; background: #f4eefa; }
.badge-kind.observed { color: #0b5d3b; border-color: #0b5d3b; background: #eaf6f0; }

.headline { font-size: 1.08rem; line-height: 1.45; margin-bottom: .6rem; }
.chg { white-space: nowrap; font-variant-numeric: tabular-nums; }
.chg.up { color: #0b4f8a; font-weight: 700; }
.chg.down { color: #a33a00; font-weight: 700; }
.chg.none { color: #6b6b6b; }
.dash-table { font-size: .88rem; }
.dash-table caption { caption-side: top; color: #444; font-size: .82rem; }
.dash-table td.num, .dash-table td { font-variant-numeric: tabular-nums; }
.dash-table th[scope="row"] { font-weight: 600; white-space: nowrap; }
ul.counts { padding-left: 1.1rem; margin-bottom: .6rem; }
ul.counts li { margin-bottom: .15rem; }
svg.spark { vertical-align: middle; }

.embargo-msg { display: none; }
body.embargo-active .poll-based { display: none !important; }
body.embargo-active .embargo-msg { display: block; }
.embargo-notice { border-left: 4px solid #a33a00; background: #fff3ee; padding: .6rem .8rem; margin: .4rem 0; }
.embargo-notice p { margin: .3rem 0 0; }

.dash-select { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.dash-select label { font-weight: 600; font-size: .9rem; }
.dash-select select { max-width: 22rem; }
.switch-pane { display: none; }
.switch-pane.active { display: block; }
.dash-figure { margin: 0; min-height: 320px; }
.dash-figure .plotly, .dash-figure .html-widget { width: 100% !important; }
ul.downloads { columns: 2 16rem; padding-left: 1.1rem; }
details > summary { cursor: pointer; font-weight: 600; margin: .4rem 0; }

@media (max-width: 767.98px) {
  .dash-banner { font-size: .8rem; padding: .4rem .75rem; }
  .dash-banner .lang-toggle { margin-left: 0; }
  .dash-figure { min-height: 280px; }
  .dash-table { font-size: .8rem; }
  ul.downloads { columns: 1; }
}

/* Who's rising? page */
.in-short { margin: 0; padding-left: 1.1rem; font-size: 1.05rem; line-height: 1.55; }
.in-short li { margin-bottom: .25rem; }
.switch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.switch-card { border: 1px solid #ddd; border-radius: 8px; padding: .7rem .85rem; background: #fafafa; }
.switch-card p { margin: .25rem 0; }
.switch-title { font-size: 1rem; font-weight: 700; margin: 0 0 .35rem; }
.switch-chance { margin-top: .45rem !important; }
.dots10 { display: block; margin-top: .2rem; max-width: 100%; height: auto; }
.how-we-know { margin-top: .6rem; font-size: .92rem; color: #444; }
.how-we-know > *:not(summary) { margin-top: .35rem; }
.key { font-size: 1.1rem; }
.shock-key { display: inline-block; width: 1.1em; height: .8em; background: rgba(213,94,0,0.18); vertical-align: middle; }

/* ---- election-night theme (2026-10-29) ------------------------------------------- */
:root { --fr-blue: #0055A4; --fr-red: #EF4135; --ink: #14213D; --muted: #5B6475; --line: #E6E9EF; --page: #F2F4F8; }
body { background: var(--page); color: var(--ink); }
.navbar { position: relative; border-bottom: 0 !important; }
.navbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--fr-blue) 0 33.33%, #fff 33.33% 66.66%, var(--fr-red) 66.66% 100%); }
.navbar .navbar-brand, .navbar .navbar-title { font-weight: 750; letter-spacing: .01em; }
.navbar .nav-link { font-weight: 550; }
.navbar .nav-link.active { box-shadow: inset 0 -3px 0 #fff; }
.dash-banner { background: #fff; border-bottom: 1px solid var(--line); color: var(--ink); }
.dash-banner .disclaimer strong { background: #FFF4D6; border: 1px solid #E0C46C; border-radius: 999px; padding: .02rem .5rem; font-size: .78rem; }
.dash-banner .lang-toggle { border-radius: 999px; border-color: var(--fr-blue); color: var(--fr-blue); }
.dash-banner .lang-toggle:hover, .dash-banner .lang-toggle:focus { background: var(--fr-blue); }
.card { border: 0 !important; border-radius: 12px !important; box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 2px 6px rgba(16,24,40,.06); }
.card-header { background: #fff !important; border-bottom: 1px solid var(--line) !important; font-weight: 700; color: var(--ink); font-size: .95rem; }
.card-header .nav-link { font-weight: 600; }
.headline { font-size: 1.22rem; line-height: 1.45; font-weight: 600; color: var(--ink); }
.small, .text-muted { color: var(--muted) !important; }

/* key numbers */
.hero { margin-top: .5rem; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--accent, var(--fr-blue)); border-radius: 10px; padding: .7rem .85rem; }
.kpi-value { font-size: 1.55rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-label { font-size: .85rem; font-weight: 600; color: var(--ink); margin-top: .1rem; }
.kpi-sub { font-size: .78rem; color: var(--muted); margin-top: .15rem; }

/* candidate cards */
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .75rem; margin-bottom: .5rem; }
.cand-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .85rem .7rem 1.05rem; overflow: hidden; }
.cand-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.cand-top { display: flex; gap: .55rem; align-items: flex-start; }
.cand-rank { flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center; }
.cand-name { font-weight: 700; line-height: 1.2; }
.cand-party { font-size: .78rem; color: var(--muted); }
.cand-tag { margin-left: .35rem; padding: 0 .35rem; border: 1px solid var(--muted); border-radius: 999px; font-size: .7rem; }
.cand-share { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: .35rem 0 .1rem; line-height: 1.1; }
.cand-int { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: .45rem; }
.trend { display: inline-block; font-size: .8rem; font-weight: 600; margin-bottom: .45rem; }
.trend.up { color: #00704A; } .trend.down { color: #B03A00; } .trend.none { color: var(--muted); font-weight: 500; }
.meter { margin-top: .35rem; }
.meter-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink); }
.meter-label strong { font-variant-numeric: tabular-nums; }
.meter-track { height: 7px; border-radius: 999px; background: #EDEFF3; overflow: hidden; margin-top: .15rem; }
.meter-fill { height: 100%; border-radius: 999px; }

@media (max-width: 767.98px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 1.25rem; }
  .headline { font-size: 1.08rem; }
  .cand-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .cand-share { font-size: 1.5rem; }
}
@media (max-width: 420px) { .cand-grid { grid-template-columns: 1fr; } }
/* bslib wraps chunk output in fill containers (flex columns); give these components their own layout back */
.kpi-row .html-fill-container, .cand-grid .html-fill-container { display: block; }
.cand-grid.html-fill-container { display: grid; }
.kpi-row.html-fill-container { display: grid; }
.cand-card .cand-top { display: flex !important; flex-direction: row; }
.cand-card .meter-label { display: flex !important; flex-direction: row; }
.cand-card .cand-int, .cand-card .trend span { display: inline; }
.cand-card .trend { display: inline-block; }
.cand-grid, .kpi-row { align-content: start; align-items: start; }
.kpi-value { overflow-wrap: normal; word-break: normal; hyphens: none; }
@media (max-width: 767.98px) {
  .kpi-value { font-size: 1.05rem; }
  .kpi { padding: .55rem .65rem; }
  .headline { font-size: 1rem; }
}
/* tables, notes and spacing in the election-night style */
.dash-table { border-collapse: separate; border-spacing: 0; }
.dash-table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650;
  border-bottom: 1px solid var(--line) !important; background: #fff; }
.dash-table td, .dash-table tbody th { border-color: #F0F2F6 !important; }
.dash-table tbody tr:hover > * { background: #F7F9FC; }
.dash-table caption { font-weight: 600; color: var(--ink); }
.headline + .kpi-row { margin-top: .4rem; }
.kpi-row + .in-short, .kpi-row + .headline { margin-top: .9rem; }
.how-we-know { border-top: 1px dashed var(--line); padding-top: .4rem; }
details > summary { color: var(--fr-blue); }
.switch-card { background: #fff; border-color: var(--line); border-radius: 10px; }
.card-header .nav-tabs .nav-link.active { color: var(--ink); border-bottom: 3px solid var(--fr-red); }

/* ---- vivid theme: tricolour, portraits, stronger colour (2026-11-04) ------------------------ */
:root { --fr-blue: #0055A4; --fr-navy: #002654; --fr-red: #EF4135; --page: #EBF0F7; }
body { background: var(--page); }
/* navbar: deep blue gradient, a drawn French flag before the title, a thicker tricolour band */
.navbar { background: linear-gradient(100deg, #071833 0%, var(--fr-navy) 45%, #0B3C86 100%) !important; padding-bottom: 6px; }
.navbar::after { height: 6px; }
.navbar .navbar-title-text a { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.12rem; letter-spacing: .015em; }
.navbar .navbar-title-text a::before { content: ""; flex: 0 0 auto; width: 1.6rem; height: 1.08rem; border-radius: 3px;
  background: linear-gradient(90deg, #002395 0 33.4%, #fff 33.4% 66.6%, #ED2939 66.6% 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.55), 0 2px 6px rgba(0,0,0,.35); }
.navbar .nav-link { color: rgba(255,255,255,.82) !important; border-radius: 6px; }
.navbar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,.08); }
.navbar .nav-link.active { color: #fff !important; background: rgba(255,255,255,.12); box-shadow: inset 0 -3px 0 var(--fr-red); }

/* cards: a blue accent on each header, deeper shadow */
.card { box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 18px rgba(16,24,40,.08); }
.card-header { box-shadow: inset 4px 0 0 var(--fr-blue); font-size: 1rem; letter-spacing: .005em; }
.headline { font-size: 1.28rem; }

/* key-number tiles: tinted by their accent, optional portraits */
.kpi { border-top-width: 5px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent, var(--fr-blue)) 11%, #fff) 0%, #fff 75%);
  border-color: color-mix(in srgb, var(--accent, var(--fr-blue)) 22%, #fff); border-top-color: var(--accent, var(--fr-blue));
  box-shadow: 0 2px 8px rgba(16,24,40,.06); }
.kpi-value { font-size: 1.7rem; }
.kpi.kpi-with-photo { display: block !important; }
.kpi-photos { display: flex !important; flex-direction: row !important; align-items: center; margin-bottom: .45rem; }
.kpi-body { min-width: 0; }
.kpi-ph, .cand-photo { display: block; flex: 0 0 auto; border-radius: 50%; overflow: hidden; background: color-mix(in srgb, var(--c) 25%, #fff); }
.kpi-ph img, .cand-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kpi-ph { width: 44px; height: 44px; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.kpi-ph + .kpi-ph { margin-left: -10px; }

/* candidate cards: colour band on top, tinted head, portrait with a party-colour ring and the rank */
.cand-card { border: 1px solid color-mix(in srgb, var(--c) 28%, #fff); border-top: 5px solid var(--c); padding: .8rem .9rem .75rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 15%, #fff) 0, #fff 96px); box-shadow: 0 2px 10px rgba(16,24,40,.07);
  transition: transform .15s ease, box-shadow .15s ease; }
.cand-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16,24,40,.13); }
.cand-card::before { display: none; }
.cand-card .cand-top { align-items: center; gap: .8rem; }
.cand-avatar { position: relative; flex: 0 0 auto; display: inline-block; }
.cand-photo { width: 60px; height: 60px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.cand-avatar .cand-rank { position: absolute; right: -7px; bottom: -5px; width: 1.5rem; height: 1.5rem; font-size: .78rem;
  border: 2px solid #fff; background: var(--fr-navy); }
.cand-name { font-size: 1.03rem; }
.cand-party { font-weight: 600; color: color-mix(in srgb, var(--c) 65%, var(--ink)); }
.cand-share { font-size: 2.15rem; color: color-mix(in srgb, var(--c) 72%, var(--ink)); }
.meter-track { height: 9px; background: color-mix(in srgb, var(--c) 13%, #EDEFF3); }

/* other cards and tabs */
.switch-card { border-top: 4px solid var(--fr-blue); box-shadow: 0 2px 8px rgba(16,24,40,.05); }
.card-header .nav-tabs .nav-link.active { border-bottom-width: 3px; color: var(--fr-navy); }

@media (max-width: 767.98px) {
  .kpi-value { font-size: 1.15rem; }
  .kpi-ph { width: 36px; height: 36px; }
  .kpi-ph + .kpi-ph { margin-left: -10px; }
  .cand-photo { width: 46px; height: 46px; }
  .cand-share { font-size: 1.55rem; }
  .headline { font-size: 1.05rem; }
  .navbar .navbar-title-text a { font-size: 1rem; }
}

/* install hint (assets/site.js): shown once on Android/desktop Chrome and on iOS Safari */
.install-hint { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1080;
  max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem;
  background: var(--fr-navy, #0B1D3A); color: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(16,24,40,.28); font-size: .9rem; }
.install-hint p { margin: 0; flex: 1; }
.install-hint button { border: 0; border-radius: 6px; cursor: pointer; font: inherit; }
.install-hint .install-go { background: #fff; color: var(--fr-navy, #0B1D3A); font-weight: 600; padding: .3rem .8rem; }
.install-hint .install-close { background: transparent; color: #fff; font-size: 1.4rem; line-height: 1; padding: 0 .3rem; opacity: .8; }

/* where the numbers come from (front page) */
.sources-note { margin-top: .9rem; padding: .7rem .9rem; border-left: 4px solid #0055A4; background: #F4F7FB; border-radius: 0 6px 6px 0; font-size: .95rem; color: #14213D; }
.sources-note p { margin: 0; }
.sources-note + details { margin-top: .5rem; font-size: .9rem; }
.sources-note + details .table-responsive { max-height: 22rem; overflow-y: auto; }
