/* Direction : un entourage gris strictement neutre, comme dans une salle d’évaluation des couleurs.
   Les seules couleurs vives de la page sont celles du visiteur, posées sur un bandeau pleine largeur
   que les panneaux de réglage viennent recouvrir. Toute l’audace tient dans ce bandeau. */
:root {
  color-scheme: light;
  --paper: #e9e9e9;
  --sheet: #ffffff;
  --ink: #111111;
  --ink-soft: #4a4a4a;
  --rule: #d0d0d0;
  --control: #757575;
  --wash: #efefef;
  --wash-strong: #dfdfdf;

  /* États : toujours accompagnés d’une icône et d’un libellé. */
  --good: #0b8a0b;
  --on-good: #ffffff;
  --warn: #b87800;
  --on-warn: #111111;
  --bad: #d03b3b;
  --on-bad: #ffffff;

  --lift: 0 1px 2px rgb(0 0 0 / .14), 0 18px 44px -18px rgb(0 0 0 / .5);

  --display: "Contraste Display", Didot, "Bodoni 72", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --page: 1280px;
  --gutter: clamp(16px, 4vw, 40px);

  /* La paire du visiteur, réécrite par le script. */
  --fg: #5b21b6;
  --bg: #ffd60a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #131313;
    --sheet: #1f1f1f;
    --ink: #f2f2f2;
    --ink-soft: #bdbdbd;
    --rule: #3a3a3a;
    --control: #8c8c8c;
    --wash: #2c2c2c;
    --wash-strong: #3a3a3a;
    --good: #35c759;
    --on-good: #0b0b0b;
    --warn: #fab219;
    --on-warn: #0b0b0b;
    --bad: #ff7b72;
    --on-bad: #0b0b0b;
    --lift: 0 1px 2px rgb(0 0 0 / .5), 0 18px 44px -18px rgb(0 0 0 / .85);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #131313;
  --sheet: #1f1f1f;
  --ink: #f2f2f2;
  --ink-soft: #bdbdbd;
  --rule: #3a3a3a;
  --control: #8c8c8c;
  --wash: #2c2c2c;
  --wash-strong: #3a3a3a;
  --good: #35c759;
  --on-good: #0b0b0b;
  --warn: #fab219;
  --on-warn: #0b0b0b;
  --bad: #ff7b72;
  --on-bad: #0b0b0b;
  --lift: 0 1px 2px rgb(0 0 0 / .5), 0 18px 44px -18px rgb(0 0 0 / .85);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: underline; text-underline-offset: .16em; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--mono); font-size: .95em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprite, [hidden] { display: none !important; }
.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 20;
  padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--sheet); font-weight: 600;
}
.skip-link:focus { top: 10px; }
.noscript { max-width: var(--page); margin: 16px auto; padding: 0 var(--gutter); font-weight: 600; }

/* États partagés : verdict, cases du tableau, jauge. */
[data-status="good"] { --st: var(--good); --st-on: var(--on-good); }
[data-status="warn"] { --st: var(--warn); --st-on: var(--on-warn); }
[data-status="bad"]  { --st: var(--bad);  --st-on: var(--on-bad); }
.mark {
  width: 22px; height: 22px; padding: 4px; flex: none; border-radius: 50%;
  background: var(--st); color: var(--st-on);
  fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 12px;
  background: var(--wash); color: var(--ink);
  font-weight: 600; font-size: .9375rem; white-space: nowrap;
  transition: background-color .15s;
}
.btn:hover { background: var(--wash-strong); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  transition: background-color .15s;
}
.icon-btn:hover { background: var(--wash); }

/* Barre du haut */
.topbar { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.topbar-inner {
  max-width: var(--page); margin-inline: auto; padding: 10px var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
}
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-note { color: var(--ink-soft); font-size: .875rem; }
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Onglets entre les deux outils */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--wash); }
.tab {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 14px;
  border-radius: 10px; color: var(--ink-soft); font-size: .9375rem; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.tab:hover { color: var(--ink); background: var(--wash-strong); }
.tab[aria-current="page"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .14), inset 0 0 0 1px var(--rule); }
@media (max-width: 640px) {
  .tabs { order: 3; width: 100%; }
  .tab { flex: 1; }
}

/* Atelier : réglages à gauche, bandeau et résultat à droite. */
.workbench { overflow-x: clip; }
.workbench-grid {
  max-width: var(--page); margin-inline: auto; padding: 0 var(--gutter) 56px;
  display: grid; column-gap: 36px;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "controls specimen" "controls result";
}

/* Le bandeau : déborde sur toute la largeur de la fenêtre et passe sous les panneaux. */
.specimen { grid-area: specimen; position: relative; min-width: 0; padding: 24px 0; }
.band { position: absolute; z-index: 0; inset: 0 -100vw -44px; background-color: var(--bg); forced-color-adjust: none; }
.band-flood { position: absolute; inset: 0; background-color: var(--bg); }
.specimen-inner {
  position: relative; z-index: 1; container-type: inline-size;
  color: var(--fg); forced-color-adjust: none;
}
.specimen-word {
  font: 400 min(20.5cqi, 150px)/.98 var(--display);
  letter-spacing: -.012em; white-space: nowrap;
}
.specimen-large { margin-top: 6px; font-size: 24px; line-height: 1.3; }
.specimen-normal { margin-top: 2px; max-width: 62ch; font-size: 16px; }
.specimen-ui { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 15px; }
.s-btn { padding: 8px 14px; border-radius: 10px; background: var(--fg); color: var(--bg); font-weight: 600; }
.s-outline { padding: 8px 14px; border-radius: 10px; box-shadow: inset 0 0 0 2px var(--fg); }
.s-field { min-width: 120px; }
.s-star { width: 30px; height: 30px; fill: var(--fg); }
.s-link { text-decoration: underline; text-underline-offset: .16em; }
.is-flooding .specimen-inner,
.is-flooding .s-btn { transition: color .45s, background-color .45s; }

/* Panneau des couleurs */
.controls {
  grid-area: controls; position: relative; z-index: 2; align-self: start;
  margin-top: 28px; border-radius: 20px;
  background: var(--sheet); box-shadow: var(--lift);
}
/* Les réglages restent à portée de main pendant la lecture des corrections. */
@media (min-width: 960px) and (min-height: 760px) {
  .controls { position: sticky; top: 16px; }
}
.zone { padding: 20px 24px 34px; }
.swap-row + .zone { padding: 34px 24px 24px; }
.zone-title { margin-bottom: 12px; font-size: 1rem; font-weight: 700; }
.picker { display: flex; gap: 10px; }
.swatch {
  position: relative; z-index: 3; width: 56px; height: 56px; flex: none; border-radius: 14px;
  background: var(--c); box-shadow: inset 0 0 0 1.5px var(--control);
  forced-color-adjust: none; cursor: pointer;
}
.swatch:has(:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.field {
  flex: 1; min-width: 0; display: flex; align-items: center; padding-right: 4px;
  border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--control);
}
.field:focus-within { box-shadow: inset 0 0 0 2.5px var(--ink); }
.field.is-invalid { box-shadow: inset 0 0 0 2.5px var(--bad); }
.field-label { flex: 1; min-width: 0; }
.field-label input {
  width: 100%; height: 56px; padding: 0 4px 0 16px; border: 0; background: transparent; outline: 0;
  font-family: var(--mono); font-size: 1.125rem; font-weight: 600;
}
.field-msg { margin-top: 8px; font-size: .875rem; }
.field-msg:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  min-height: 32px; padding: 4px 10px; border: 0; border-radius: 8px;
  background: var(--wash); color: var(--ink-soft);
  font-family: var(--mono); font-size: .8125rem; text-align: left;
  transition: background-color .15s, color .15s;
}
.chip:hover { background: var(--wash-strong); color: var(--ink); }

/* Curseurs */
.sliders { display: grid; gap: 4px; margin-top: 14px; }
.slider-row {
  display: grid; grid-template-columns: 82px minmax(0, 1fr) 48px; align-items: center; gap: 10px;
  color: var(--ink-soft); font-size: .875rem;
}
.slider-value { color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 30px; margin: 0; padding: 0;
  background: transparent; cursor: pointer; border-radius: 8px;
  --track: var(--wash-strong);
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 12px; border-radius: 6px; background: var(--track);
  box-shadow: inset 0 0 0 1px var(--control);
}
input[type="range"]::-moz-range-track {
  height: 12px; border-radius: 6px; background: var(--track);
  box-shadow: inset 0 0 0 1px var(--control);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; box-sizing: border-box;
  width: 24px; height: 24px; margin-top: -6px; border-radius: 50%;
  background: var(--c, #fff); border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px #111, 0 2px 6px rgb(0 0 0 / .35);
  transition: transform .12s;
}
input[type="range"]::-moz-range-thumb {
  box-sizing: border-box;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c, #fff); border: 3px solid #fff;
  box-shadow: 0 0 0 1.5px #111, 0 2px 6px rgb(0 0 0 / .35);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input.hue {
  --track: linear-gradient(to right, hsl(0 90% 55%), hsl(60 90% 55%), hsl(120 90% 55%), hsl(180 90% 55%), hsl(240 90% 55%), hsl(300 90% 55%), hsl(360 90% 55%));
}
.seen { margin-top: 8px; color: var(--ink-soft); font-size: .875rem; }

/* Bouton Inverser : à cheval sur la séparation entre les deux couleurs. */
.swap-row { position: relative; border-top: 1px solid var(--rule); }
.swap {
  position: absolute; left: 50%; top: 0; z-index: 4; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--sheet);
  font-weight: 700; white-space: nowrap;
  box-shadow: 0 0 0 4px var(--sheet);
  transition: transform .18s cubic-bezier(.3, 1.4, .5, 1);
}
.swap:hover { transform: translate(-50%, -50%) scale(1.05); }
.swap:active { transform: translate(-50%, -50%) scale(.97); }
.swap kbd {
  padding: 1px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--sheet) 20%, var(--ink));
  font: 500 .75rem/1.5 var(--mono);
}
@media (hover: none) { .swap kbd { display: none; } }

/* Paires récentes */
.recents { padding: 14px 24px 18px; border-top: 1px solid var(--rule); }
.recents-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recents-title { font-size: .875rem; font-weight: 700; }
.text-btn { min-height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--ink-soft); font-size: .875rem; text-decoration: underline; text-underline-offset: .16em; }
.text-btn:hover { color: var(--ink); }
.recents-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.recent {
  width: 48px; height: 44px; padding: 0; border: 0; border-radius: 10px;
  background: var(--r-bg); color: var(--r-fg);
  font: 400 1.25rem/1 var(--display); forced-color-adjust: none;
  box-shadow: inset 0 0 0 1px var(--control);
  transition: transform .15s;
}
.recent:hover { transform: translateY(-2px); }
.recent[aria-current="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Résultat */
.result {
  grid-area: result; position: relative; z-index: 2; align-self: start; min-width: 0;
  padding: 24px 28px 28px; border-radius: 20px;
  background: var(--sheet); box-shadow: var(--lift);
  container-type: inline-size;
}
.result:focus { outline: 0; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.figure { font-size: clamp(56px, 11.5cqi, 80px); font-weight: 800; line-height: 1; letter-spacing: -.035em; }
.figure-unit { margin-left: .03em; color: var(--ink-soft); font-weight: 500; }
.verdict-block { flex: 1 1 200px; min-width: 0; }
.verdict { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 700; }
.verdict-text { margin-top: 2px; color: var(--ink-soft); font-size: .9375rem; line-height: 1.4; }
.result-actions { display: flex; flex-direction: column; gap: 6px; }

/* Jauge : échelle logarithmique de 1 à 21, pour écarter les seuils 3, 4,5 et 7. */
.meter { margin-top: 18px; }
.meter-bar {
  position: relative; height: 14px; overflow: hidden; border-radius: 4px;
  background: color-mix(in srgb, var(--st) 16%, var(--sheet));
  forced-color-adjust: none;
  transition: background-color .25s;
}
.meter-fill {
  height: 100%; border-radius: 0 4px 4px 0; background: var(--st);
  transition: width .38s cubic-bezier(.2, .8, .2, 1), background-color .25s;
}
.meter-gap { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--sheet); }
.meter-axis {
  position: relative; height: 40px; margin-top: 4px;
  color: var(--ink-soft); font-size: .8125rem; line-height: 1.3; font-variant-numeric: tabular-nums;
}
.meter-axis span { position: absolute; top: 0; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.meter-axis span:first-child { transform: none; }
.meter-axis span:last-child { transform: translateX(-100%); }
.meter-axis small { display: block; font-size: inherit; }

/* Cases de conformité */
.grades { width: 100%; margin-top: 6px; border-collapse: separate; border-spacing: 0 6px; }
.grades th { text-align: left; font-weight: 600; font-size: .9375rem; line-height: 1.3; padding-right: 10px; }
.grades thead th { padding-bottom: 0; color: var(--ink-soft); font-size: .8125rem; }
.grades thead th:not(:first-child) { padding-left: 6px; }
.grades tbody th small { display: block; color: var(--ink-soft); font-size: .8125rem; font-weight: 400; }
.grades td { width: 29%; padding: 0 0 0 6px; vertical-align: top; }
.grades td.not-defined { color: var(--ink-soft); font-size: .875rem; vertical-align: middle; padding-left: 16px; }
.grade {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--st) 13%, var(--sheet));
  font-size: .875rem; line-height: 1.25;
}
.grade b { font-weight: 600; }
.grade small { display: block; color: var(--ink-soft); font-size: .8125rem; font-weight: 400; font-variant-numeric: tabular-nums; }

/* Corrections proposées */
.fixes { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--rule); }
.fixes-title { font-size: 1.0625rem; font-weight: 700; }
.fixes-title:focus { outline: 0; }
.fixes-note { margin-top: 2px; color: var(--ink-soft); font-size: .875rem; }
.fix-table { width: calc(100% + 12px); margin: 8px -6px 0; border-collapse: separate; border-spacing: 6px; }
.fix-table th { text-align: left; font-size: .8125rem; font-weight: 600; color: var(--ink-soft); vertical-align: middle; }
.fix-table tbody th { font-size: .9375rem; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fix-table tbody th small { display: block; color: var(--ink-soft); font-size: .8125rem; font-weight: 400; white-space: normal; }
.fix-table td { width: 38%; vertical-align: middle; }
.fix {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 10px 6px 6px;
  border: 0; border-radius: 12px; background: var(--wash); text-align: left;
  transition: background-color .15s, transform .15s;
}
.fix:hover { background: var(--wash-strong); transform: translateY(-1px); }
.fix-chip {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 8px;
  font: 400 1.0625rem/1 var(--display); forced-color-adjust: none;
  box-shadow: inset 0 0 0 1px var(--control);
}
.fix-values { min-width: 0; line-height: 1.25; }
.fix-hex { display: block; font-family: var(--mono); font-size: .8125rem; font-weight: 600; }
.fix-ratio { display: block; color: var(--ink-soft); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.fix-none { display: block; padding: 6px 10px; color: var(--ink-soft); font-size: .875rem; }
.fixes-done { margin-top: 2px; color: var(--ink-soft); font-size: .9375rem; }

/* Sur les petits écrans, le verdict reste visible pendant le réglage des curseurs. */
.peek { display: none; }
@media (max-width: 959px) {
  .workbench-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "specimen" "controls" "result";
    row-gap: 16px;
  }
  .controls { margin-top: 62px; }
  .peek {
    grid-column: 1; grid-row: 2 / 4; align-self: start;
    position: sticky; top: 8px; z-index: 5;
    display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 14px;
    border-radius: 14px; background: var(--sheet); box-shadow: var(--lift);
  }
  .peek-ratio { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; }
  .peek-grade { display: flex; align-items: center; gap: 5px; font-size: .875rem; font-weight: 600; }
  .peek-grade .mark { width: 18px; height: 18px; padding: 3px; }
  .peek-pair {
    display: grid; place-items: center; width: 34px; height: 34px; margin-left: auto; border-radius: 8px;
    background: var(--bg); color: var(--fg); font: 400 1rem/1 var(--display);
    box-shadow: inset 0 0 0 1px var(--control); forced-color-adjust: none;
  }
}
@container (max-width: 640px) {
  .result-actions { flex-flow: row wrap; width: 100%; }
  .result-actions .btn { flex: 1 1 auto; }
}
@container (max-width: 520px) {
  .grade b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .meter-axis .meter-long { display: none; }
}
@container (max-width: 300px) {
  .grade { gap: 5px; padding: 6px; }
  .grade .mark { width: 18px; height: 18px; padding: 3px; }
  .grades th { padding-right: 4px; }
  .grades td { padding-left: 4px; }
}
@media (max-width: 480px) {
  .brand-note { display: none; }
  .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #random { width: 44px; padding: 0; }
  .result { padding: 18px 16px 20px; }
  .zone { padding: 18px 16px 34px; }
  .swap-row + .zone { padding: 34px 16px 20px; }
  .recents { padding: 14px 16px 16px; }
  .fix { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Sections d’information : titre à gauche, contenu à droite, sans cartes. */
.info {
  max-width: var(--page); margin-inline: auto; padding: 48px var(--gutter);
  display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px 48px;
}
.info + .info::before {
  content: ""; grid-column: 1 / -1; height: 1px; margin-top: -48px; margin-bottom: 28px; background: var(--rule);
}
.info h2 { font: 400 clamp(1.875rem, 2.8vw, 2.25rem)/1.08 var(--display); text-wrap: balance; }
.info-intro { margin-top: 10px; color: var(--ink-soft); max-width: 40ch; }
@media (max-width: 859px) { .info { grid-template-columns: minmax(0, 1fr); } }

/* Testeur de taille */
.size-sample {
  display: flex; align-items: center; min-height: 148px; padding: 20px 24px;
  border-radius: 16px; background: var(--bg); color: var(--fg); forced-color-adjust: none;
}
.size-sample p { line-height: 1.25; overflow-wrap: anywhere; }
.size-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 24px; margin-top: 14px; }
.size-controls .slider-row { grid-template-columns: 56px minmax(0, 1fr) 56px; }
#sizeRange { --c: var(--ink); }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.switch input {
  -webkit-appearance: none; appearance: none; position: relative; width: 46px; height: 28px; margin: 0; flex: none;
  border-radius: 14px; background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--control); cursor: pointer;
  transition: background-color .15s;
}
.switch input::before {
  content: ""; position: absolute; top: 5px; left: 5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--control); transition: transform .15s, background-color .15s;
}
.switch input:checked { background: var(--ink); box-shadow: none; }
.switch input:checked::before { transform: translateX(18px); background: var(--sheet); }
.size-text { margin-top: 10px; max-width: 70ch; }
.size-grades { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Vision des couleurs */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 24px 16px; }
.tile-paint {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 136px; padding: 14px 16px;
  border-radius: 16px; background: var(--t-bg); color: var(--t-fg); forced-color-adjust: none;
}
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-aa { font: 400 2.75rem/1 var(--display); }
.tile-star { width: 26px; height: 26px; fill: currentColor; }
.tile-line { font-size: .875rem; line-height: 1.3; }
.tile h3 { margin-top: 10px; font-size: 1rem; font-weight: 700; }
.tile-ratio { font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile p.tile-desc { color: var(--ink-soft); font-size: .875rem; line-height: 1.4; }

/* Recommandations */
.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); column-gap: 40px; }
.rules li { padding: 14px 0 18px; border-top: 1px solid var(--rule); }
.rule-ref { font: 500 .8125rem/1.4 var(--mono); color: var(--ink-soft); }
.rules h3 { margin-top: 2px; font-size: 1rem; line-height: 1.35; font-weight: 700; text-wrap: balance; }
.rules p { margin-top: 4px; color: var(--ink-soft); font-size: .9375rem; line-height: 1.45; }
.formula { margin-top: 2px; }
.formula summary { font-weight: 700; cursor: pointer; }
.formula p { margin-top: 6px; color: var(--ink-soft); max-width: 75ch; }
.formula code { color: var(--ink); }

/* Pied de page */
.site-footer { background: var(--sheet); border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: .875rem; }
.site-footer-inner {
  max-width: var(--page); margin-inline: auto; padding: 18px var(--gutter);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 32px;
}

/* Message de confirmation */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translate(-50%, 16px);
  padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--sheet);
  font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (forced-colors: active) {
  .mark { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  .switch input { box-shadow: none; border: 1px solid CanvasText; }
  .switch input::before { background: CanvasText; }
  .switch input:checked { background: Highlight; }
  .meter-bar { outline: 1px solid CanvasText; }
  .swap { border: 1px solid CanvasText; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
