/* Implémentation de la maquette pc-scan.dc.html : papier crème, encre chaude,
   un seul accent teal, chiffres tabulaires. Variantes retenues, celles par
   défaut de la maquette : liste « Établi » et verdict « Titre ». */
:root {
  --paper: #f3f1ea;
  --card: #fff;
  --ink: #1b1a16;
  --ink2: #3a3833;
  --ink3: #59564e;
  --muted: #706c62;
  --faint: #a9a396;
  --hairline: #e3e0d6;
  --rule: #d3cfc2;
  --wash: #faf9f4;
  --teal: #0f8a91;
  --tealDeep: #0b6b70;
  --tealWash: #e2efef;
  --tealEdge: #bfdedd;
  --bad: #b23b34;
  --badWash: #f7eae8;
  --badEdge: #e6c4bf;
  --good: #2f7d4f;
  --goodWash: #e8f2ea;
  --goodEdge: #bcd8c4;
  --warn: #9a6b1f;
  --warnWash: #f6efe1;
  --warnEdge: #e6d3b3;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

/* `display:flex` d'une règle de classe l'emporte sur le `display:none` que
   l'agent utilisateur attache à [hidden] : sans ceci, masquer une section la
   laisse visible. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--tealDeep);
  text-decoration: none;
}

a:hover {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 2px;
}

::selection {
  background: var(--teal);
  color: #fff;
}

button {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

input {
  font-family: inherit;
}

input::placeholder {
  color: var(--faint);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.mono {
  font-family: var(--mono);
}

.faint {
  color: var(--faint);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.eyebrow.faint {
  color: #c3bdb0;
}

.fineprint {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px 24px 110px;
}

/* --- en-tête ------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--mono);
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.wordmark .dot {
  color: var(--teal);
}

.tagline {
  color: var(--muted);
  font-size: 14px;
}

.historyButton {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink2);
  cursor: pointer;
}

.historyButton:hover {
  border-color: var(--teal);
  color: var(--tealDeep);
}

.clockGlyph {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.clockGlyph::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 1.5px;
  height: 5px;
  background: currentColor;
  transform-origin: bottom;
  transform: rotate(35deg);
}

.counter {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tealDeep);
  background: var(--tealWash);
  border-radius: 20px;
  padding: 1px 8px;
}

/* --- barre de scan ------------------------------------------------------- */

.scanBar {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 30px;
}

.scanBar input {
  flex: 1 1 300px;
  min-width: 240px;
  font-family: var(--mono);
  font-size: 15px;
  padding: 0 18px;
  min-height: 54px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink);
  outline: none;
}

.scanBar input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(15 138 145 / 0.14);
}

.scanBar button {
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 0 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-height: 54px;
  white-space: nowrap;
}

.scanBar button:hover {
  background: var(--tealDeep);
}

.scanBar button:disabled {
  background: #8ec1c4;
  cursor: default;
}

.scanHint {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* --- état vide ----------------------------------------------------------- */

.intro {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-top: 46px;
  animation: fadeUp 0.5s ease both;
}

.introText {
  flex: 1 1 430px;
  min-width: min(100%, 420px);
}

.introText h1 {
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 16ch;
  text-wrap: balance;
}

.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink3);
  max-width: 54ch;
  margin: 20px 0 0;
  text-wrap: pretty;
}

.steps {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  flex: 1 1 140px;
  min-width: 130px;
  display: flex;
  flex-direction: column;
}

.stepNo {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--teal);
  font-weight: 600;
}

.stepName {
  font-weight: 600;
  margin-top: 6px;
}

.stepWhat {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
  line-height: 1.45;
}

.examples {
  margin-top: 34px;
}

.exampleRow {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.exampleCard {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
}

.exampleCard:hover {
  border-color: var(--teal);
  box-shadow: 0 10px 24px -18px rgb(0 0 0 / 0.4);
}

.exampleSource {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tealDeep);
}

.exampleCard[data-source="leboncoin"] .exampleSource {
  color: var(--warn);
}

.exampleName {
  font-size: 14px;
  font-weight: 600;
}

.introText .fineprint {
  margin-top: 28px;
}

.previewCard {
  flex: 1 1 320px;
  min-width: min(100%, 300px);
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 24px 50px -34px rgb(0 0 0 / 0.35);
  position: relative;
  overflow: hidden;
}

.previewCard .eyebrow + .eyebrow {
  margin-top: 14px;
  display: block;
}

.previewVerdict {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.previewLabel {
  font-size: 32px;
  font-weight: 700;
  color: var(--bad);
  letter-spacing: -0.02em;
}

.previewGap {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--bad);
}

.previewSentence {
  font-size: 13.5px;
  color: var(--muted);
  margin: 8px 0 18px;
  line-height: 1.5;
}

.previewLine {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid #eeece4;
}

.previewName {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
}

.previewLine .mono {
  font-size: 13px;
}

.previewFade {
  height: 56px;
  margin-top: -4px;
  background: linear-gradient(to bottom, rgb(255 255 255 / 0), var(--card));
}

/* --- chargement ---------------------------------------------------------- */

.loading {
  margin-top: 40px;
}

.loadingHead {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink3);
  font-size: 16px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd8cc;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.skeletons {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #eae7df 25%, #f4f2ec 37%, #eae7df 63%);
  background-size: 680px 100%;
  animation: shimmer 1.4s infinite linear;
}

/* --- erreurs ------------------------------------------------------------- */

.errorWrap {
  margin-top: 40px;
  animation: fadeUp 0.4s ease both;
}

.errorCard {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--teal);
  border-radius: 12px;
  padding: 24px 26px;
  max-width: 640px;
}

.errorCard.warn {
  border-left-color: var(--warn);
}

.errorLabel {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

.errorCard.warn .errorLabel {
  color: var(--warn);
}

.errorMessage {
  font-size: 19px;
  line-height: 1.5;
  margin: 11px 0 16px;
  color: var(--ink);
  max-width: 54ch;
  text-wrap: pretty;
}

/* --- résultat : en-tête d'annonce --------------------------------------- */

#result {
  animation: fadeUp 0.45s ease both;
}

.listingHead {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 26px 0 18px;
}

.sourceBadge {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--tealWash);
  color: var(--tealDeep);
  border: 1px solid var(--tealEdge);
  white-space: nowrap;
}

.sourceBadge[data-source="leboncoin"] {
  background: #f6ede0;
  color: var(--warn);
  border-color: var(--warnEdge);
}

.listingIdentity {
  flex: 1 1 240px;
  min-width: 200px;
}

.listingTitle {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.28;
}

.listingIdentity a {
  font-size: 13px;
  display: inline-block;
  margin-top: 7px;
}

.askedPrice {
  text-align: right;
}

.askedValue {
  font-family: var(--mono);
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 600;
  line-height: 1.1;
}

.askedValue.unknown {
  color: #a9a498;
}

/* --- verdict (variante « Balance ») ------------------------------------- */

.staleness {
  font-size: 11px;
  color: var(--warn);
  margin-top: 6px;
}

.staleness:empty {
  display: none;
}

.staleness .linkButton {
  font-size: 11px;
  color: var(--tealDeep);
  text-decoration: underline;
  padding: 0;
}

.verdict {
  padding: 26px 0 24px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

/* Les deux barres énoncent déjà le verdict. Le mot ne sert que lorsqu'elles ne
   peuvent rien montrer : pas de pièce chiffrée, ou pas de prix demandé. */
.verdictHead {
  display: none;
}

.verdict.none .verdictHead,
.verdict.unknown .verdictHead {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 20px;
}

/* Le verdict devient une pastille : ce sont les barres qui portent la démonstration. */
.verdictChip {
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  background: #eeece4;
  color: var(--ink);
  border: 1px solid var(--rule);
}

.verdictGap {
  font-size: clamp(17px, 2.6vw, 25px);
  font-weight: 500;
}

.verdict.over .verdictChip {
  background: var(--badWash);
  color: var(--bad);
  border-color: var(--badEdge);
}

.verdict.over .verdictGap {
  color: var(--bad);
}

.verdict.over .balanceBar.asked {
  background: var(--bad);
}

.verdict.deal .verdictChip {
  background: var(--goodWash);
  color: var(--good);
  border-color: var(--goodEdge);
}

.verdict.deal .verdictGap {
  color: var(--good);
}

.verdict.deal .balanceBar.asked {
  background: var(--good);
}

.verdict.unknown .verdictChip {
  color: #6b6560;
}

.verdict.none .verdictChip {
  font-size: clamp(26px, 4vw, 40px);
  background: none;
  border: none;
  padding: 0;
  color: #c3bdb0;
}

.verdict.none .balance,
.verdict.unknown .balanceRow:first-child .balanceBar {
  display: none;
}

.balance {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 660px;
  margin-top: 18px;
}

.balanceRow {
  display: flex;
  align-items: center;
  gap: 16px;
}

.balanceKey {
  flex: 0 0 120px;
  font-size: 12px;
  color: #8a857a;
  text-align: right;
}

.balanceTrack {
  flex: 1;
  height: 14px;
  background: #eeece4;
  border-radius: 999px;
  overflow: hidden;
}

.balanceBar {
  height: 100%;
  border-radius: 999px;
  background: #8a857a;
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.balanceBar.sum {
  background: var(--teal);
}

.balanceValue {
  flex: 0 0 92px;
  font-size: 14px;
  font-weight: 600;
}

.verdictSentence {
  font-size: 17px;
  line-height: 1.5;
  color: #3f3d37;
  max-width: 60ch;
  margin: 18px 0 0;
  text-wrap: pretty;
}

.verdictUnpriced {
  font-size: 12.5px;
  color: var(--warn);
  margin-top: 10px;
}

.verdictUnpriced:empty {
  display: none;
}

/* --- colonnes ------------------------------------------------------------ */

.columns {
  display: flex;
  flex-wrap: wrap;
  gap: 38px;
  align-items: flex-start;
  margin-top: 8px;
}

.partsColumn {
  flex: 1 1 540px;
  min-width: min(100%, 540px);
}

.partsHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 6px;
}

.partsHead h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.partsHead .mono {
  font-size: 12px;
}

/* --- une pièce -----------------------------------------------------------

   Lue comme une légende : la catégorie et les badges en tête, le nom en
   dessous, puis seulement l'image et les chiffres. */

.band {
  padding: 20px 14px;
  border-bottom: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: inset 3px 0 0 transparent;
  transition:
    background 0.15s,
    box-shadow 0.15s;
}

.band.active {
  background: #f0f6f5;
  box-shadow: inset 3px 0 0 var(--teal);
}

.bandHead {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* Les actions vivent au bout de la ligne des badges : présentes, mais elles ne
   prennent plus une colonne entière au composant. */
.bandActions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.iconButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  color: #8a857a;
}

.iconButton svg {
  width: 14px;
  height: 14px;
}

.iconButton.fixButton:hover {
  color: var(--tealDeep);
  background: #e6f1f1;
  border-color: var(--tealEdge);
}

.iconButton.dropButton:hover {
  color: #a5352c;
  background: #f7ece9;
}

.bandName {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 7px;
}

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

.bandBody {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.thumb {
  flex: 0 0 68px;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--wash);
  object-fit: contain;
  padding: 3px;
}

.bandEvidence {
  flex: 1 1 220px;
  min-width: 190px;
}

.catLabel {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #8a857a;
  background: #f1efe8;
  border: 1px solid var(--hairline);
}

.chip.manual {
  color: var(--tealDeep);
  background: var(--tealWash);
  border-color: var(--tealEdge);
}

.cert {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cert.exact {
  background: var(--teal);
  border: 2px solid var(--teal);
}

.cert.profile {
  background: var(--card);
  border: 2px dashed #b7b2a6;
}

.cert.unknown {
  background: var(--card);
  border: 2px solid var(--bad);
}

.identity {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
}

.pill.exact {
  color: var(--tealDeep);
  background: var(--tealWash);
  border: 1px solid var(--tealEdge);
}

.pill.profile {
  color: #8a857a;
  background: transparent;
  border: 1px dashed #c3bdb0;
}

.pill.unknown {
  color: var(--bad);
  background: var(--badWash);
  border: 1px solid var(--badEdge);
}

.evidence {
  border-left: 2px solid var(--teal);
  padding: 2px 0 2px 13px;
  cursor: pointer;
}

.evidenceLabel {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.evidenceText {
  color: #403d36;
  font-size: 14.5px;
  line-height: 1.5;
  margin-top: 3px;
  font-style: italic;
}

.evidenceNone {
  color: var(--faint);
  font-size: 13px;
  font-style: italic;
}

/* Toute la colonne se cale à droite, sous la médiane : les chiffres et leurs
   réserves se lisent alors sur un seul bord. */
.bandPrice {
  flex: 0 0 186px;
  min-width: 170px;
  text-align: right;
}

.median {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.median.none {
  font-size: 14px;
  color: #a9a498;
}

.range {
  margin-top: 2px;
}

.rangeTrack {
  position: relative;
  height: 4px;
  background: #e9e6dd;
  border-radius: 2px;
}

.rangeDot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--teal);
}

.rangeEnds {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-top: 6px;
}

.rangeEnds .label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.countLine {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #8a857a;
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.lowCount {
  color: var(--warn);
  background: var(--warnWash);
  border-radius: 5px;
  padding: 1px 6px;
}

.basisLine {
  font-family: var(--mono);
  font-size: 11px;
  color: #b3ada0;
  margin-top: 4px;
}

.excluded {
  margin-top: 9px;
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--warn);
  background: var(--warnWash);
  border: 1px solid var(--warnEdge);
  border-radius: 6px;
  padding: 3px 9px;
}

/* --- ajout / état sans pièce -------------------------------------------- */

.addRow {
  margin-top: 18px;
}

button.ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed #b7b2a6;
  background: var(--card);
  color: #4a4740;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

button.ghost:hover {
  border-color: var(--teal);
  color: var(--tealDeep);
}

button.primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal);
  color: #fff;
  border: none;
  padding: 13px 22px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button.primary:hover {
  background: var(--tealDeep);
}

.noParts {
  background: var(--card);
  border: 1px dashed #cfcabc;
  border-radius: 14px;
  padding: 34px;
  text-align: center;
  margin-top: 22px;
}

.noPartsTitle {
  font-size: 20px;
  font-weight: 600;
}

.noParts p {
  color: var(--muted);
  max-width: 46ch;
  margin: 10px auto 22px;
  line-height: 1.55;
}

/* --- corps de l'annonce ------------------------------------------------- */

.bodyColumn {
  flex: 1 1 300px;
  max-width: 380px;
  min-width: min(100%, 300px);
  position: sticky;
  top: 24px;
}

.bodyCard {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 22px;
}

.bodyCardHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bodyCardHead a {
  font-size: 11px;
}

.bodyText {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink2);
  text-wrap: pretty;
  white-space: pre-wrap;
}

.bodyText mark {
  background: #dcefee;
  color: var(--tealDeep);
  padding: 1px 3px;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 #9cd0cd;
  transition: background 0.12s;
}

.bodyText mark.active {
  background: var(--teal);
  color: #fff;
  box-shadow: none;
}

.bodyLegend {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eeece4;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--faint);
  line-height: 1.4;
}

.legendSwatch {
  width: 22px;
  height: 12px;
  border-radius: 3px;
  background: #dcefee;
  box-shadow: inset 0 -1px 0 #9cd0cd;
  flex-shrink: 0;
}

/* --- calques : modale et tiroir ----------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgb(20 18 14 / 0.42);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 20px;
  animation: backdrop 0.18s ease;
}

.overlay[hidden] {
  display: none;
}

.historyOverlay {
  z-index: 70;
  justify-content: flex-end;
  padding: 0;
}

.modal {
  background: #fbfaf6;
  border-radius: 16px;
  width: min(560px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 80px -24px rgb(0 0 0 / 0.45);
  border: 1px solid var(--hairline);
  animation: modalIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.modalHead {
  padding: 22px 24px 16px;
  border-bottom: 1px solid #eeece4;
}

.modalHeadRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modalTitle {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modalSub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}

.closeButton {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--faint);
  cursor: pointer;
  padding: 2px 4px;
}

.closeButton:hover {
  color: var(--ink);
}

.modalHead input {
  margin-top: 16px;
  width: 100%;
  font-family: var(--mono);
  font-size: 15px;
  padding: 13px 15px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
  outline: none;
}

.modalHead input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(15 138 145 / 0.14);
}

.modalHead .mono {
  margin-top: 9px;
  font-size: 11.5px;
}

.modalBody {
  overflow-y: auto;
  padding: 8px;
}

.modalNote {
  padding: 34px 20px;
  text-align: center;
  color: var(--faint);
  font-size: 14px;
}

.hit {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.hit:hover {
  background: #eef4f3;
}

.hitThumb {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--wash);
  object-fit: contain;
  padding: 2px;
}

.hitMain {
  flex: 1;
  min-width: 0;
}

.hitCat {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.hitName {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

.hitSpecs {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #8a857a;
  margin-top: 3px;
}

.hitPrice {
  text-align: right;
  flex-shrink: 0;
  font-family: var(--mono);
}

.hitMedian {
  font-size: 14px;
  font-weight: 600;
}

.hitCount {
  font-size: 10.5px;
  color: var(--faint);
  margin-top: 2px;
}

.hitArrow {
  color: var(--teal);
  font-size: 16px;
  flex-shrink: 0;
}

.drawer {
  width: min(440px, 100%);
  height: 100%;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  box-shadow: -30px 0 80px -30px rgb(0 0 0 / 0.4);
  animation: drawerIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.drawerHead {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--rule);
}

.drawerHeadRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawerTitles {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.drawerTitles .mono {
  font-size: 12px;
  font-weight: 400;
}

.drawerNote {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
  line-height: 1.45;
}

.drawerBody {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawerFoot {
  padding: 14px 20px;
  border-top: 1px solid var(--rule);
}

.linkButton {
  background: none;
  border: none;
  color: #8a857a;
  font-size: 13px;
  cursor: pointer;
}

.linkButton:hover {
  color: #a5352c;
}

.historyCard {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 13px;
  padding: 16px 16px 15px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.historyCard:hover {
  border-color: var(--teal);
}

.historyCard.current {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(15 138 145 / 0.12);
}

.historyTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.historyBadge {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--tealWash);
  color: var(--tealDeep);
  border: 1px solid var(--tealEdge);
}

.historyBadge[data-source="leboncoin"] {
  background: #f6ede0;
  color: var(--warn);
  border-color: var(--warnEdge);
}

.historyWhen {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.historyTitle {
  font-size: 15px;
  font-weight: 600;
  margin-top: 11px;
  line-height: 1.3;
  padding-right: 18px;
}

.historyFacts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 13px;
  font-family: var(--mono);
  font-size: 12.5px;
  align-items: center;
}

.historyFacts .key {
  color: var(--faint);
}

.historyFacts strong {
  font-weight: 600;
}

.historyChip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eeece4;
  color: #6b6560;
  border: 1px solid var(--rule);
}

.historyChip.over {
  background: var(--badWash);
  color: var(--bad);
  border-color: var(--badEdge);
}

.historyChip.deal {
  background: var(--goodWash);
  color: var(--good);
  border-color: var(--goodEdge);
}

.historyParts {
  margin-top: 11px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
}

.historyDrop {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #c3bdb0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 6px;
}

.historyDrop:hover {
  color: #a5352c;
  background: #f7ece9;
}

/* --- animations ---------------------------------------------------------- */

@keyframes shimmer {
  0% {
    background-position: -680px 0;
  }
  100% {
    background-position: 680px 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes backdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drawerIn {
  from {
    transform: translateX(24px);
    opacity: 0.4;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 44rem) {
  .page {
    padding: 24px 16px 80px;
  }
  .askedPrice {
    text-align: left;
  }
  .bodyColumn {
    position: static;
  }
  .bandPrice,
  .bandEvidence {
    flex-basis: 100%;
  }
  .bandActions {
    flex-direction: row;
  }
  .bandActions button {
    flex: 1;
  }
}
