/* ============================================================
   IDL Terminal — Design System PIA v1.0
   Inspired by piatech.co — Friendly-pro fintech
   Une couleur = un concept sémantique. Jamais décoratif.
   ============================================================ */

/* ── 1. Tokens ─────────────────────────────────────────────── */
:root {
  /* Typographie */
  --font:         'Plus Jakarta Sans', system-ui, sans-serif;
  --fw-regular:   400;
  --fw-medium:    500;
  --fw-semibold:  600;
  --fw-bold:      700;
  --fw-extrabold: 800;

  /* Neutres */
  --black:   #1A1D2E;
  --gray-7:  #374151;
  --gray-5:  #6B7280;
  --gray-3:  #D1D5DB;
  --gray-1:  #F3F4F6;
  --white:   #FFFFFF;
  --surface: #EEF2F8;

  /* Sémantiques */
  --gold:         #E8B84B;
  --gold-light:   #F5D98A;
  --gold-bg:      #FDF6E3;

  --blue:         #6AAEE8;
  --blue-light:   #A8CFEF;
  --blue-bg:      #E8F3FB;

  --green:        #5BBF8E;
  --green-light:  #A8DFC4;
  --green-bg:     #E8F7F0;

  --red:          #F0866A;
  --red-light:    #F5B8A8;
  --red-bg:       #FDF0EC;

  --purple:       #9B8FCF;
  --purple-light: #C4BCE6;
  --purple-bg:    #F2F0FA;

  --neutral:      #8A9BB0;
  --neutral-bg:   #F0F4F8;

  --cta:          #7B6FD0;
  --cta-hover:    #6658C0;

  /* Géométrie */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   24px;
  --r-full: 9999px;

  /* Ombres */
  --shadow-sm: 0 1px 3px rgba(26,29,46,.06), 0 1px 2px rgba(26,29,46,.04);
  --shadow-md: 0 4px 12px rgba(26,29,46,.08), 0 2px 4px rgba(26,29,46,.04);
  --shadow-lg: 0 8px 24px rgba(26,29,46,.10), 0 4px 8px rgba(26,29,46,.06);

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 250ms ease;
}

/* ── 2. Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--gray-7);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
img, canvas { display: block; max-width: 100%; }

/* ── 3. Navbar ──────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--gray-1);
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 1.5rem;
  gap: 1rem;
}
.nav__brand {
  display: flex; align-items: center; gap: .75rem;
  font-size: 1.125rem; font-weight: 800; color: var(--black);
}
.nav__logo {
  width: 38px; height: 38px; border-radius: var(--r-md);
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.nav__links {
  display: flex; align-items: center; gap: .25rem;
}
.nav__links a {
  font-size: .875rem; font-weight: 500; color: var(--gray-5);
  padding: .5rem .75rem; border-radius: var(--r-md);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav__links a:hover { color: var(--black); background: var(--gray-1); }
.nav__links a.active {
  color: var(--black); font-weight: 600;
  background: var(--gray-1);
}
.nav__badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .25rem .65rem; border-radius: var(--r-full);
  background: var(--green-bg); color: var(--green);
}
.nav__badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulseDot 2s infinite;
}
.nav__actions { display: flex; align-items: center; gap: .5rem; }

@media (max-width: 768px) {
  .nav__links { display: none; }
}

/* ── 4. Hero sections ───────────────────────────────────────── */
.section-hero {
  padding: 4.5rem 1.5rem 0;
  text-align: center;
  display: flex; flex-direction: column;
  align-items: center; gap: 1.25rem;
  position: relative; overflow: hidden;
}
.hero--gold    { background: var(--gold); }
.hero--blue    { background: var(--blue); }
.hero--green   { background: var(--green); }
.hero--red     { background: var(--red); }
.hero--purple  { background: var(--purple); }
.hero--neutral { background: var(--neutral); }

/* Subtle grain overlay */
.section-hero::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
  z-index: 0;
}
.section-hero > * { position: relative; z-index: 1; }

.badge-pilier {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .375rem 1.125rem;
  background: rgba(255,255,255,.25);
  border-radius: var(--r-full);
  font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: white;
}
.hero-title {
  font-size: clamp(1.9rem, 6vw, 3.25rem);
  font-weight: 800; color: white; line-height: 1.15;
  max-width: 680px;
}
.hero-sub {
  font-size: 1.05rem; color: rgba(255,255,255,.8);
  line-height: 1.75; max-width: 520px;
}
.section-hero strong { color: white; font-weight: 700; }

.hero-actions {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap; justify-content: center;
}
.hero-ratio-display {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 800; color: white;
  letter-spacing: -.04em; line-height: 1;
  margin: .5rem 0;
}

/* ── 5. Stats bar ───────────────────────────────────────────── */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .875rem; padding: 0 1.5rem 2.5rem;
}
.stat-card {
  background: rgba(255,255,255,.22);
  border-radius: var(--r-lg);
  padding: 1.375rem 1rem; text-align: center;
}
.stat-card__num {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800; color: white; line-height: 1;
}
.stat-card__label {
  font-size: .78rem; color: rgba(255,255,255,.72);
  margin-top: .35rem; font-weight: 500;
}
@media (max-width: 640px) { .stats-bar { grid-template-columns: repeat(2, 1fr); } }

/* ── 6. Generic sections ────────────────────────────────────── */
.section { padding: 4.5rem 1.5rem; }
.section--surface { background: var(--surface); }
.section--white   { background: var(--white); }

.section__header { text-align: center; margin-bottom: 2.75rem; }
.section__eyebrow {
  display: inline-block; margin-bottom: .75rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .3rem .9rem; border-radius: var(--r-full);
}
.eyebrow--gold   { background: var(--gold-bg);   color: var(--gold); }
.eyebrow--blue   { background: var(--blue-bg);   color: var(--blue); }
.eyebrow--green  { background: var(--green-bg);  color: var(--green); }
.eyebrow--red    { background: var(--red-bg);    color: var(--red); }
.eyebrow--purple { background: var(--purple-bg); color: var(--purple); }

.section__title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800; color: var(--black); margin-bottom: .625rem;
}
.section__sub {
  font-size: .9375rem; color: var(--gray-5);
  max-width: 520px; margin: 0 auto; line-height: 1.75;
}

.container { max-width: 1100px; margin: 0 auto; }
.container--sm { max-width: 800px; margin: 0 auto; }

/* ── 7. Pillar cards ────────────────────────────────────────── */
.pillars {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.pillar-card {
  background: var(--white); border-radius: var(--r-lg);
  padding: 2rem 1.5rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .875rem;
  border-top: 3px solid transparent;
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.pillar-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pillar-card--gold   { border-top-color: var(--gold); }
.pillar-card--blue   { border-top-color: var(--blue); }
.pillar-card--purple { border-top-color: var(--purple); }
.pillar-card--green  { border-top-color: var(--green); }

.pillar-card__icon {
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem;
}
.pillar-card--gold   .pillar-card__icon { background: var(--gold-bg); }
.pillar-card--blue   .pillar-card__icon { background: var(--blue-bg); }
.pillar-card--purple .pillar-card__icon { background: var(--purple-bg); }
.pillar-card--green  .pillar-card__icon { background: var(--green-bg); }

.pillar-card__title  { font-size: 1.0625rem; font-weight: 700; color: var(--black); }
.pillar-card__desc   { font-size: .875rem; color: var(--gray-5); line-height: 1.65; flex: 1; }
.pillar-card__link   {
  font-size: .85rem; font-weight: 600; color: var(--cta);
  display: inline-flex; align-items: center; gap: .35rem; margin-top: auto;
}
.pillar-card__link:hover { color: var(--cta-hover); }
@media (max-width: 768px) { .pillars { grid-template-columns: 1fr; } }

/* ── 8. Workflow cards ──────────────────────────────────────── */
.workflow-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.wf-card {
  background: var(--white); border-radius: var(--r-lg);
  padding: 2.5rem 1.5rem 1.75rem;
  border: 2px solid transparent;
  display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: .875rem;
  position: relative; margin-top: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.wf-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.wf-card__badge {
  position: absolute; top: -1rem; left: 50%; transform: translateX(-50%);
  padding: .3rem 1rem; border-radius: var(--r-full);
  font-size: .65rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: white; white-space: nowrap;
}
.wf-card__icon {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.625rem;
}
.wf-card__num   { font-size: 1.25rem; font-weight: 800; }
.wf-card__title { font-size: 1rem; font-weight: 700; margin-top: -.375rem; }
.wf-card__desc  { font-size: .875rem; color: var(--gray-5); line-height: 1.6; }

.wf--gold   { border-color: var(--gold-light); }
.wf--gold   .wf-card__badge { background: var(--gold); }
.wf--gold   .wf-card__icon  { background: var(--gold-bg); }
.wf--gold   .wf-card__num,
.wf--gold   .wf-card__title { color: var(--gold); }

.wf--blue   { border-color: var(--blue-light); }
.wf--blue   .wf-card__badge { background: var(--blue); }
.wf--blue   .wf-card__icon  { background: var(--blue-bg); }
.wf--blue   .wf-card__num,
.wf--blue   .wf-card__title { color: var(--blue); }

.wf--green  { border-color: var(--green-light); }
.wf--green  .wf-card__badge { background: var(--green); }
.wf--green  .wf-card__icon  { background: var(--green-bg); }
.wf--green  .wf-card__num,
.wf--green  .wf-card__title { color: var(--green); }

.wf--purple { border-color: var(--purple-light); }
.wf--purple .wf-card__badge { background: var(--purple); }
.wf--purple .wf-card__icon  { background: var(--purple-bg); }
.wf--purple .wf-card__num,
.wf--purple .wf-card__title { color: var(--purple); }

@media (max-width: 640px) { .workflow-grid { grid-template-columns: 1fr; } }

/* ── 9. Signal cards ────────────────────────────────────────── */
.signals-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.signal-card {
  border-radius: var(--r-lg); padding: 2rem 1.5rem;
  display: flex; flex-direction: column; gap: .625rem;
  box-shadow: var(--shadow-md);
}
.signal-card--buy     { background: var(--green); }
.signal-card--neutral { background: var(--neutral); }
.signal-card--sell    { background: var(--red); }

.signal-card__label {
  font-size: .65rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.82);
}
.signal-card__seuil {
  font-size: 2rem; font-weight: 800; color: white; line-height: 1;
}
.signal-card__title { font-size: 1rem; font-weight: 700; color: white; }
.signal-card__desc  { font-size: .875rem; color: rgba(255,255,255,.82); line-height: 1.65; }

.signal-card__chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .375rem; }
.chip--light {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .275rem .85rem;
  background: rgba(255,255,255,.25);
  border-radius: var(--r-full);
  font-size: .78rem; font-weight: 600; color: white;
}
@media (max-width: 768px) { .signals-grid { grid-template-columns: 1fr; } }

/* ── 10. Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8125rem 1.875rem; border-radius: var(--r-full);
  font-family: var(--font); font-size: .9375rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: all var(--t-base); text-decoration: none; white-space: nowrap;
}
.btn--sm { padding: .5rem 1.25rem; font-size: .875rem; }
.btn--xs { padding: .35rem .9rem;  font-size: .8rem; }

.btn--primary { background: var(--cta); color: white; border-color: var(--cta); }
.btn--primary:hover { background: var(--cta-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn--white { background: white; color: var(--black); border-color: white; }
.btn--white:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.btn--ghost { background: transparent; color: white; border-color: rgba(255,255,255,.6); }
.btn--ghost:hover { background: rgba(255,255,255,.15); }

.btn--outline { background: transparent; color: var(--cta); border-color: var(--cta); }
.btn--outline:hover { background: var(--cta); color: white; }

.btn--gold { background: var(--gold); color: white; border-color: var(--gold); }
.btn--gold:hover { filter: brightness(1.07); transform: translateY(-2px); }

/* ── 11. Dashboard KPI cards ────────────────────────────────── */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpi-row { grid-template-columns: 1fr; } }

.kpi {
  background: var(--white); border-radius: var(--r-lg);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: .375rem;
  border-top: 3px solid transparent;
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi--gold   { border-top-color: var(--gold); }
.kpi--blue   { border-top-color: var(--blue); }
.kpi--green  { border-top-color: var(--green); }
.kpi--red    { border-top-color: var(--red); }
.kpi--purple { border-top-color: var(--purple); }

.kpi__label {
  font-size: .725rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--gray-5);
  display: flex; align-items: center; gap: .4rem;
}
.kpi__value {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800; color: var(--black);
  letter-spacing: -.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi__unit { font-size: .85rem; font-weight: 500; color: var(--gray-5); }
.kpi__delta {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .78rem; font-weight: 600; margin-top: .125rem;
}
.delta--up   { color: var(--green); }
.delta--down { color: var(--red); }
.delta--neu  { color: var(--neutral); }
.kpi__sub { font-size: .78rem; color: var(--gray-5); }

/* ── 12. Panel / chart card ─────────────────────────────────── */
.panel {
  background: var(--white); border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel__header {
  padding: 1.125rem 1.5rem;
  border-bottom: 1px solid var(--gray-1);
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap;
}
.panel__title {
  font-size: .9rem; font-weight: 700; color: var(--black);
  display: flex; align-items: center; gap: .5rem;
}
.panel__title-icon {
  width: 26px; height: 26px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; background: var(--gold-bg); color: var(--gold);
}
.panel__body { padding: 1.5rem; }

/* Chart legend pills */
.chart-legend { display: flex; gap: .5rem; flex-wrap: wrap; }
.leg-pill {
  display: flex; align-items: center; gap: .4rem;
  padding: .3rem .8rem; border-radius: var(--r-full);
  font-size: .7rem; font-weight: 600; cursor: pointer;
  transition: opacity var(--t-fast); user-select: none;
  border: 1px solid transparent;
}
.leg-pill.disabled { opacity: .3; }
.leg-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.lp-green  { background: var(--green-bg); color: var(--green); border-color: var(--green-light); }
.lp-green  .leg-dot { background: var(--green); }
.lp-neutral{ background: var(--neutral-bg); color: var(--neutral); border-color: var(--gray-3); }
.lp-neutral .leg-dot { background: var(--neutral); }
.lp-red    { background: var(--red-bg);   color: var(--red);   border-color: var(--red-light); }
.lp-red    .leg-dot { background: var(--red); }

/* ── 13. Controls ───────────────────────────────────────────── */
.ctrl-row {
  display: flex; align-items: center; gap: .75rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.ctrl-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gray-5); white-space: nowrap;
}
.seg {
  display: flex; background: var(--gray-1);
  border: 1px solid var(--gray-3); border-radius: var(--r-md);
  padding: 2px; gap: 2px;
}
.seg-btn {
  padding: .35rem .875rem; border-radius: calc(var(--r-md) - 2px);
  font-size: .8rem; font-weight: 500; color: var(--gray-5);
  background: transparent; transition: all var(--t-fast); white-space: nowrap;
  font-family: var(--font);
}
.seg-btn.active {
  background: var(--white); color: var(--black); font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.chip-row { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip {
  padding: .35rem .875rem; border: 1px solid var(--gray-3);
  border-radius: var(--r-full);
  font-size: .8rem; font-weight: 500; color: var(--gray-5);
  background: var(--white); transition: all var(--t-fast); white-space: nowrap;
  font-family: var(--font);
}
.chip:hover  { border-color: var(--cta); color: var(--cta); }
.chip.active { background: var(--cta); border-color: var(--cta); color: white; font-weight: 600; }

.ctrl-spacer { flex: 1; min-width: 0; }

.btn-live {
  display: flex; align-items: center; gap: .4rem;
  padding: .4rem 1rem; border-radius: var(--r-full);
  font-size: .8rem; font-weight: 700; font-family: var(--font);
  background: var(--green-bg); border: 1px solid var(--green-light);
  color: var(--green); cursor: pointer; transition: all var(--t-fast);
}
.btn-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); animation: pulseDot 2s infinite;
}
.btn-sm {
  display: flex; align-items: center; gap: .35rem;
  padding: .4rem .875rem; border-radius: var(--r-md);
  font-size: .8rem; font-weight: 600; font-family: var(--font);
  border: 1px solid var(--gray-3); color: var(--gray-5); background: var(--white);
  cursor: pointer; transition: all var(--t-fast);
}
.btn-sm:hover  { border-color: var(--cta); color: var(--cta); }
.btn-sm.active { background: var(--cta); border-color: var(--cta); color: white; }

/* ── 14. Chart wrap & régimes ───────────────────────────────── */
.chart-wrap { position: relative; height: 380px; }

.regime-bar { display: flex; margin-top: .75rem; border-radius: var(--r-sm); overflow: hidden; }
.regime-seg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: .375rem .5rem; font-size: .58rem; font-weight: 600; gap: 1px; cursor: default;
}
.regime-years { font-size: .5rem; font-weight: 400; opacity: .75; white-space: nowrap; }
.r-et { background: var(--gold-bg);   color: var(--gold);   flex: 23; }
.r-bw { background: var(--blue-bg);   color: var(--blue);   flex: 38; }
.r-ol { background: var(--green-bg);  color: var(--green);  flex: 54; }
.r-lv { background: var(--green); color: white; flex: 2; }

/* ── 15. Accordion ──────────────────────────────────────────── */
.accordion {
  background: var(--white); border: 1px solid var(--gray-1);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--t-fast);
}
.accordion:hover { box-shadow: var(--shadow-md); }
.accordion__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; cursor: pointer; user-select: none;
  transition: background var(--t-fast);
}
.accordion__header:hover { background: var(--gray-1); }
.accordion__title {
  display: flex; align-items: center; gap: .625rem;
  font-size: .875rem; font-weight: 600; color: var(--gray-7);
}
.accordion__icon {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; flex-shrink: 0;
}
.accordion__chevron { color: var(--gray-5); transition: transform var(--t-base); }
.accordion.open .accordion__chevron { transform: rotate(180deg); }
.accordion.open .accordion__title { color: var(--black); }
.accordion__body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.accordion.open .accordion__body { max-height: 600px; }
.accordion__content {
  padding: 1.25rem 1.25rem; border-top: 1px solid var(--gray-1);
  font-size: .875rem; color: var(--gray-5); line-height: 1.75;
}
.accordion__content p { margin-bottom: .75rem; }
.accordion__content p:last-child { margin-bottom: 0; }
.accordion__content strong { color: var(--gray-7); font-weight: 600; }
.hl {
  background: var(--blue-bg); color: var(--blue);
  border-radius: 4px; padding: 1px 6px;
  font-size: .83em; font-weight: 600;
}

/* ── 16. Data table ─────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; max-height: 360px; overflow-y: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.data-table th {
  padding: .5rem 1rem; text-align: left;
  font-size: .65rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--gray-5); border-bottom: 1px solid var(--gray-1);
  background: var(--surface); position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
.data-table td {
  padding: .5rem 1rem; border-bottom: 1px solid var(--gray-1);
  color: var(--gray-7); font-variant-numeric: tabular-nums;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-1); }

/* Signal badges in table */
.badge-green   { background: var(--green-bg); color: var(--green); }
.badge-red     { background: var(--red-bg);   color: var(--red); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge-blue    { background: var(--blue-bg);  color: var(--blue); }
.badge-gold    { background: var(--gold-bg);  color: var(--gold); }
.tbl-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: var(--r-full);
  font-size: .68rem; font-weight: 700;
}
.live-dot {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .65rem; font-weight: 700;
  background: var(--green-bg); color: var(--green);
  border-radius: var(--r-full); padding: .15rem .55rem;
}
.live-dot::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--green); animation: pulseDot 2s infinite;
}

/* ── 17. Hist panels ────────────────────────────────────────── */
.hist-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 700px) { .hist-grid { grid-template-columns: 1fr; } }

.hist-panel {
  background: var(--white); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.hist-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 1.125rem; border-bottom: 1px solid var(--gray-1);
}
.hist-panel__title {
  font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; gap: .4rem;
}
.hp--green .hist-panel__title { color: var(--green); }
.hp--red   .hist-panel__title { color: var(--red); }
.hist-panel__count {
  font-size: .65rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: var(--r-full);
}
.hp--green .hist-panel__count { background: var(--green-bg); color: var(--green); }
.hp--red   .hist-panel__count { background: var(--red-bg);   color: var(--red); }

.hist-cards {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .875rem 1.125rem;
  max-height: 240px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--gray-3) transparent;
}
.hist-card {
  background: var(--surface); border: 1px solid var(--gray-3);
  border-radius: var(--r-md); padding: .4rem .6rem;
  min-width: 74px; transition: all var(--t-fast); cursor: default;
}
.hist-card:hover { border-color: var(--cta); background: var(--white); }
.hist-card.live-card { background: var(--green-bg); border-color: var(--green-light); }
.hist-year  { font-size: .75rem; font-weight: 700; color: var(--black); }
.hist-ratio { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.hp--green .hist-ratio { color: var(--green); }
.hp--red   .hist-ratio { color: var(--red); }
.hist-price { font-size: .62rem; color: var(--gray-5); margin-top: 1px; }

/* ── 18. Section nav (tabs) ─────────────────────────────────── */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: .75rem; flex-wrap: wrap;
}
.section-title {
  font-size: .9rem; font-weight: 700; color: var(--black);
  display: flex; align-items: center; gap: .5rem;
}
.tabs-row { display: flex; gap: .375rem; }
.tab-pill {
  padding: .35rem .875rem; border: 1px solid var(--gray-3);
  border-radius: var(--r-full); font-size: .78rem; font-weight: 500;
  color: var(--gray-5); background: var(--white); cursor: pointer;
  transition: all var(--t-fast); font-family: var(--font);
}
.tab-pill:hover  { border-color: var(--cta); color: var(--cta); }
.tab-pill.active { background: var(--cta); border-color: var(--cta); color: white; font-weight: 600; }

/* ── 19. Analysis sections (signal explanations) ────────────── */
.analysis-section {
  padding: 4rem 1.5rem;
}
.analysis-section--green  { background: var(--green); }
.analysis-section--neutral{ background: var(--neutral); }
.analysis-section--red    { background: var(--red); }

.analysis-section__inner {
  max-width: 840px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2.5rem; align-items: center;
}
@media (max-width: 640px) { .analysis-section__inner { grid-template-columns: 1fr; } }

.analysis-section__label {
  font-size: .65rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.75); margin-bottom: .5rem;
}
.analysis-section__seuil {
  font-size: 3.5rem; font-weight: 800; color: white;
  line-height: 1; letter-spacing: -.04em; margin-bottom: .375rem;
}
.analysis-section__title {
  font-size: 1.375rem; font-weight: 700; color: white; margin-bottom: .625rem;
}
.analysis-section__desc {
  font-size: .9375rem; color: rgba(255,255,255,.85); line-height: 1.75;
}
.analysis-examples {
  display: flex; flex-direction: column; gap: .75rem;
}
.example-card {
  background: rgba(255,255,255,.2);
  border-radius: var(--r-lg); padding: 1rem 1.25rem;
  color: white;
}
.example-card__year  { font-size: .7rem; font-weight: 700; opacity: .75; margin-bottom: .25rem; }
.example-card__ratio { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.example-card__desc  { font-size: .825rem; opacity: .85; margin-top: .25rem; }

/* ── 20. CTA band ───────────────────────────────────────────── */
.cta-band {
  background: var(--cta);
  padding: 4rem 1.5rem; text-align: center;
}
.cta-band__title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 800; color: white; margin-bottom: .75rem;
}
.cta-band__sub {
  font-size: 1rem; color: rgba(255,255,255,.8);
  max-width: 480px; margin: 0 auto 2rem; line-height: 1.7;
}

/* ── 21. Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--black); color: rgba(255,255,255,.55);
  padding: 2.25rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
}
.footer__brand {
  font-size: .9rem; font-weight: 700; color: white;
  display: flex; align-items: center; gap: .5rem;
}
.footer__src  { font-size: .75rem; }
.footer__ver  { font-size: .75rem; }

/* ── 22. Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }

/* ── 23. Animations ─────────────────────────────────────────── */
@keyframes pulseDot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .5; transform: scale(.8); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.anim-up   { animation: fadeUp .55s ease both; }
.anim-up-1 { animation-delay: .08s; }
.anim-up-2 { animation-delay: .16s; }
.anim-up-3 { animation-delay: .24s; }
.anim-up-4 { animation-delay: .32s; }

/* ── 24. Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-3); border-radius: 3px; }

/* ── 25. Focus ──────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--cta); outline-offset: 2px; }
