/* =============================================================================
 *  style.css — Simulateur « Ma vie en Suisse »
 *  Design : dashboard financier SaaS, clair/sombre, responsive.
 *  Palette de données validée (contrôle CVD + contraste) : voir --series-*.
 * ========================================================================== */

/* ----------------------------- 1. Tokens --------------------------------- */
:root {
  color-scheme: light;

  --page:            #f4f5f7;
  --surface:         #ffffff;
  --surface-2:       #fafafa;
  --surface-sunken:  #f0f1f4;
  --ink:             #0b0b0b;
  --ink-2:           #52514e;
  --ink-muted:       #6f6d67;   /* 5.17:1 sur blanc — WCAG AA */
  --grid:            #e6e6e1;
  --line:            rgba(11, 11, 11, 0.10);
  --line-strong:     rgba(11, 11, 11, 0.16);

  --accent:          #2a78d6;
  --accent-soft:     #eaf2fd;
  --accent-ink:      #184f95;
  /* variante assombrie pour tout ce qui porte du texte (contraste AA ≥ 4.5:1) */
  --accent-text:     #256abf;

  --good:            #0ca30c;
  --good-ink:        #006300;
  --warning:         #fab219;
  --serious:         #ec835a;
  --critical:        #d03b3b;

  /* palette catégorielle — ordre fixe, jamais recyclé */
  --series-1: #2a78d6; /* logement          */
  --series-2: #eb6834; /* impôts            */
  --series-3: #1baf7a; /* épargne           */
  --series-4: #eda100; /* cotisations       */
  --series-5: #e87ba4; /* assurance maladie */
  --series-6: #008300; /* alimentation      */
  --series-7: #4a3aa7; /* transport         */
  --series-8: #e34948; /* loisirs & autres  */

  --radius-lg: 20px;
  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(11,11,11,.05), 0 8px 24px -12px rgba(11,11,11,.14);
  --shadow-lg: 0 2px 4px rgba(11,11,11,.04), 0 24px 48px -20px rgba(11,11,11,.22);

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page:            #0d0d0d;
  --surface:         #1a1a19;
  --surface-2:       #212120;
  --surface-sunken:  #131312;
  --ink:             #ffffff;
  --ink-2:           #c3c2b7;
  --ink-muted:       #a09e96;   /* 6.49:1 sur #1a1a19 — WCAG AA */
  --grid:            #2c2c2a;
  --line:            rgba(255, 255, 255, 0.10);
  --line-strong:     rgba(255, 255, 255, 0.18);

  --accent:          #3987e5;
  --accent-soft:     #16243a;
  --accent-ink:      #86b6ef;
  --accent-text:     #86b6ef;
  --good-ink:        #0ca30c;

  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;

  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -20px rgba(0,0,0,.7);
}

/* ----------------------------- 2. Base ----------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -0.01em; }

button, input, select { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ----------------------------- 3. En-tête -------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(140deg, #e94a4a, #c8102e);
  display: grid; place-items: center; color: #fff; font-size: 20px; line-height: 1;
  box-shadow: 0 4px 14px -6px rgba(200, 16, 46, .8);
}

.brand-text h1 { font-size: 16px; }
.brand-text p { margin: 0; font-size: 12px; color: var(--ink-muted); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--surface-sunken); border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2); white-space: nowrap;
}

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; display: grid; place-items: center; font-size: 16px;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.icon-btn:hover { background: var(--surface-sunken); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }

/* ----------------------------- 4. Grille --------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: clamp(16px, 2vw, 28px);
  padding: clamp(16px, 2.2vw, 28px);
  align-items: start;
  max-width: 1720px; margin: 0 auto;
}

.panel {
  position: sticky; top: 74px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

.results { display: flex; flex-direction: column; gap: clamp(16px, 2vw, 22px); min-width: 0; }

/* ----------------------------- 5. Cartes --------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2vw, 22px);
}

.card + .card { margin-top: 14px; }

.card-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px;
}
.card-head h2, .card-head h3 { font-size: 15px; }
.card-head .hint { margin-left: auto; font-size: 12px; color: var(--ink-muted); }

.section-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-muted); margin: 0 0 12px;
}
.section-label::after {
  content: ''; flex: 1; height: 1px; background: var(--grid);
}

/* ----------------------------- 6. Formulaire ----------------------------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

label.field-label, .field > label, .field-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 560; color: var(--ink-2); margin-bottom: 6px;
}
.field-label .value { margin-left: auto; font-weight: 660; color: var(--ink); font-variant-numeric: tabular-nums; }

select, input[type='number'], input[type='text'] {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
  appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%),
                    linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
select:focus, input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

input[type='range'] {
  width: 100%; appearance: none; background: transparent; margin: 6px 0 0; height: 20px;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 5px; border-radius: 99px; background: var(--surface-sunken);
  border: 1px solid var(--line);
}
input[type='range']::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; margin-top: -7px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,.2); cursor: pointer;
  transition: transform .15s var(--ease);
}
input[type='range']::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type='range']::-moz-range-track { height: 5px; border-radius: 99px; background: var(--surface-sunken); }
input[type='range']::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--accent); cursor: pointer;
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.switch input { appearance: none; margin: 0; width: 38px; height: 22px; border-radius: 99px;
  background: var(--surface-sunken); border: 1px solid var(--line-strong); position: relative;
  cursor: pointer; transition: background .2s var(--ease); flex: none; }
.switch input::after {
  content: ''; position: absolute; inset: 2px auto 2px 2px; width: 16px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s var(--ease);
}
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }

/* segmented / pills */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line-strong);
  background: var(--surface-2); cursor: pointer; font-size: 12.5px; color: var(--ink-2);
  transition: all .16s var(--ease);
}
.pill:hover { border-color: var(--accent); color: var(--ink); }
.pill[aria-pressed='true'] {
  background: var(--accent-text); border-color: var(--accent-text);
  color: #fff; font-weight: 560;
}
:root[data-theme='dark'] .pill[aria-pressed='true'] { color: #0d0d0d; }

.lifestyle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.lifestyle-card {
  text-align: left; padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface-2);
  cursor: pointer; transition: all .16s var(--ease);
}
.lifestyle-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.lifestyle-card[aria-pressed='true'] {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.lifestyle-card .ls-title { display: block; font-weight: 620; font-size: 13px; }
.lifestyle-card .ls-desc { display: block; font-size: 11px; color: var(--ink-muted); margin-top: 2px; line-height: 1.35; }

.salary-hint {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 11px; color: var(--ink-muted); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--accent-text); text-decoration: underline;
  text-underline-offset: 2px; font-variant-numeric: tabular-nums;
}
.link-btn:hover { filter: brightness(1.15); }
.link-btn[data-off='true'] { font-weight: 660; }

.market-bar {
  position: relative; height: 6px; border-radius: 99px; margin-top: 8px;
  background: var(--surface-sunken); border: 1px solid var(--line);
}
.market-bar .range {
  position: absolute; top: -1px; bottom: -1px; border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}
.market-bar .cursor {
  position: absolute; top: -4px; width: 3px; height: 12px; border-radius: 2px;
  background: var(--accent); transition: left .3s var(--ease);
}

/* ----------------------------- 7. KPI ------------------------------------ */
.kpi-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--kpi-color, var(--accent));
}
.kpi .k-label { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .k-value {
  font-size: clamp(24px, 2.6vw, 32px); font-weight: 680; letter-spacing: -0.025em;
  margin-top: 4px; line-height: 1.1;
}
.kpi .k-value .cur { font-size: .52em; font-weight: 600; color: var(--ink-muted); margin-right: 4px; vertical-align: .28em; }
.kpi .k-sub { font-size: 12px; color: var(--ink-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi.is-negative .k-value { color: var(--critical); }

/* ----------------------------- 8. Score ---------------------------------- */
.hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 3vw, 32px);
  align-items: center;
}
.gauge { position: relative; width: 176px; height: 176px; flex: none; }
.gauge svg { transform: rotate(-90deg); overflow: visible; }
.gauge-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.gauge-center .g-val { font-size: 40px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.gauge-center .g-max { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }

.hero-text .band {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--surface-2);
}
.hero-text .narrative { margin: 12px 0 0; color: var(--ink-2); font-size: 14.5px; max-width: 62ch; }

.score-parts { display: grid; gap: 9px; margin-top: 16px; }
.score-part { display: grid; grid-template-columns: 150px 1fr 44px; gap: 10px; align-items: center; font-size: 12px; }
.score-part .sp-label { color: var(--ink-2); }
.score-part .sp-track { display: block; height: 6px; border-radius: 99px; background: var(--surface-sunken); border: 1px solid var(--line); overflow: hidden; }
.score-part .sp-fill { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s var(--ease); }
.score-part .sp-val { text-align: right; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ----------------------------- 9. Onglets -------------------------------- */
.tabs {
  display: flex; gap: 4px; padding: 4px; border-radius: 14px;
  background: var(--surface-sunken); border: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1; white-space: nowrap; padding: 9px 14px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; font-size: 13px; font-weight: 560;
  color: var(--ink-2); transition: all .18s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'] {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.tabpanel[hidden] { display: none; }
.tabpanel { animation: fade .28s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ----------------------------- 10. Graphiques ---------------------------- */
.chart-2col { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: clamp(16px, 2.5vw, 30px); align-items: center; }

.donut-wrap { position: relative; display: grid; place-items: center; }
.donut { width: 100%; max-width: 300px; height: auto; overflow: visible; }
.donut path { transition: opacity .18s var(--ease), transform .18s var(--ease); transform-origin: center; cursor: pointer; }
.donut.has-hover path:not(.is-hovered) { opacity: .32; }
.donut-center { position: absolute; text-align: center; pointer-events: none; }
.donut-center .d-label { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .06em; }
.donut-center .d-val { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.donut-center .d-sub { font-size: 12px; color: var(--ink-muted); }

.legend { display: grid; gap: 2px; }
.legend-row {
  display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center;
  padding: 7px 8px; border-radius: 8px; cursor: default;
  transition: background .15s var(--ease);
  font-variant-numeric: tabular-nums;
}
.legend-row:hover { background: var(--surface-sunken); }
.legend-row .swatch { width: 12px; height: 12px; border-radius: 4px; }
.legend-row .l-name { font-size: 13px; color: var(--ink-2); }
.legend-row .l-amount { font-size: 13px; font-weight: 600; }
.legend-row .l-share { font-size: 12px; color: var(--ink-muted); width: 46px; text-align: right; }

/* barre brut → net */
.waterfall { display: grid; gap: 8px; }
.wf-bar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; background: var(--surface-sunken); gap: 2px; }
.wf-seg {
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600; color: #fff;
  min-width: 2px; transition: flex-grow .5s var(--ease);
  white-space: nowrap; overflow: hidden;
}
.wf-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); }
.wf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wf-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* tableau */
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 10px; text-align: right; font-size: 13px; }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); font-weight: 640; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data tbody tr { border-top: 1px solid var(--grid); }
table.data tbody tr:hover { background: var(--surface-sunken); }
table.data tr.is-current { background: var(--accent-soft); }
table.data tr.is-current td:first-child { font-weight: 660; }
table.data td.best { color: var(--good-ink); font-weight: 660; }
table.data td.best::after { content: ' ★'; font-size: 10px; }
table.data tfoot td { border-top: 2px solid var(--line-strong); font-weight: 680; }
.table-scroll { overflow-x: auto; }

/* barre inline dans les tableaux */
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell .mini-bar { height: 6px; border-radius: 99px; background: var(--accent); opacity: .85; }

/* line chart */
.line-chart { width: 100%; height: auto; overflow: visible; }
.line-chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.line-chart .axis-text { fill: var(--ink-muted); font-size: 11px; }
.line-chart .area { opacity: .16; }
.line-chart .series-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.line-chart .dot { stroke: var(--surface); stroke-width: 2; }

/* milestones */
.milestones { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.milestone {
  padding: 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2);
}
.milestone .m-year { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-muted); }
.milestone .m-val { font-size: 20px; font-weight: 680; margin-top: 3px; letter-spacing: -.02em; }
.milestone .m-gain { font-size: 11.5px; color: var(--good-ink); margin-top: 2px; }

/* ----------------------------- 11. Conseils ------------------------------ */
.advice-list { display: grid; gap: 10px; }
.advice {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px;
  padding: 13px 15px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface-2);
  border-left: 3px solid var(--tone, var(--accent));
  animation: fade .3s var(--ease) backwards;
}
.advice .a-icon { font-size: 19px; line-height: 1.2; }
.advice .a-title { font-weight: 640; font-size: 13.5px; }
.advice .a-text { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.advice[data-tone='danger'] { --tone: var(--critical); }
.advice[data-tone='warn']   { --tone: var(--warning); }
.advice[data-tone='good']   { --tone: var(--good); }
.advice[data-tone='great']  { --tone: var(--good); }
.advice[data-tone='info']   { --tone: var(--accent); }

/* ----------------------------- 12. Divers -------------------------------- */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--surface-sunken); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}

.btn {
  padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2);
  font-size: 13px; font-weight: 560;
  transition: all .16s var(--ease);
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent-text); border-color: var(--accent-text); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }

.tooltip {
  position: fixed; z-index: 90; pointer-events: none; opacity: 0;
  padding: 9px 12px; border-radius: 10px; font-size: 12.5px;
  background: var(--ink); color: var(--page);
  box-shadow: var(--shadow-lg); transition: opacity .14s var(--ease);
  max-width: 240px;
}
.tooltip.show { opacity: 1; }
.tooltip .t-title { font-weight: 660; margin-bottom: 2px; }

footer.legal {
  padding: 22px clamp(16px, 3vw, 32px) 40px;
  font-size: 12px; color: var(--ink-muted); text-align: center;
  max-width: 900px; margin: 0 auto; line-height: 1.6;
}
footer.legal strong { color: var(--ink-2); }

.reliability {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 4px; font-size: 9px; font-weight: 700;
  background: var(--surface-sunken); border: 1px solid var(--line-strong); color: var(--ink-muted);
  cursor: help;
}

.num { font-variant-numeric: tabular-nums; }

/* ----------------------------- 13. Responsive ---------------------------- */
.fab { display: none; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .results { order: -1; }
  .panel { position: static; max-height: none; overflow: visible; }
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero-text .narrative { margin-inline: auto; }
  .score-part { grid-template-columns: 130px 1fr 44px; }
  .chart-2col { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .layout { padding: 12px; gap: 14px; }
  .card { padding: 15px; border-radius: 16px; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi .k-value { font-size: 22px; }
  .brand-text p { display: none; }
  .chip.hide-sm { display: none; }
  .lifestyle-grid { grid-template-columns: 1fr; }
  .score-part { grid-template-columns: 108px 1fr 40px; font-size: 11.5px; }
  .gauge { width: 150px; height: 150px; }
  .tab { padding: 9px 10px; font-size: 12.5px; }
  table.data th, table.data td { padding: 8px 7px; font-size: 12px; }
  .row-2 { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .fab {
    display: inline-flex; align-items: center; gap: 8px;
    position: fixed; right: 16px; bottom: 18px; z-index: 60;
    padding: 12px 18px; border-radius: 999px; border: 0; cursor: pointer;
    background: var(--accent-text); color: #fff; font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 24px -8px rgba(42,120,214,.7);
  }
  .fab:active { transform: scale(.96); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .panel, .topbar-actions, .tabs { display: none; }
  .layout { grid-template-columns: 1fr; }
  .card { break-inside: avoid; box-shadow: none; }
}

/* horodatage de compilation (pied de page) */
.build-stamp { font-size: 11px; color: var(--ink-muted); margin-top: 6px; }
