/* Polices auto-hébergées (sous-ensemble latin, licence SIL OFL) : aucune requête vers Google Fonts. */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed-600-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-700-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/barlow-condensed-800-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-700-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap; src: url("/fonts/barlow-condensed-800-italic-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("/fonts/inter-latin.woff2") format("woff2"); }

:root {
  --paper: #f4f1ea;
  --surface: #e9e5db;
  --ink: #111214;
  --mute: #6b6a65;
  --line: #d6d1c5;
  --accent: #ff4f1f;
  --accent-ink: #111214;
  --danger: #c4270a;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --pad: clamp(1.1rem, 4vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; font-size: 81.25%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem;
}
.skip:focus { top: 1rem; }

/* ---------- Marque ---------- */
.logo {
  display: inline-flex; align-items: center; gap: .55rem;
  font: italic 800 1.7rem/1 var(--display);
  text-transform: uppercase; letter-spacing: .04em; text-decoration: none;
}
.logo::before {
  content: ""; width: .6em; height: 1em; background: var(--accent);
  transform: skewX(-20deg);
}
.logo.small { font-size: 1.2rem; }

/* ---------- Barre haute ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 2rem;
  padding: .85rem var(--pad);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topnav { flex: 1; display: flex; gap: 1.5rem; }
.topnav a {
  text-decoration: none; font-weight: 500; font-size: .95rem;
  display: inline-flex; align-items: center; gap: .4rem;
}
.topnav a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.count {
  background: var(--ink); color: var(--paper); border-radius: 99px;
  font-size: .72rem; padding: .05rem .5rem; font-variant-numeric: tabular-nums;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .75rem 1.4rem; border: 2px solid transparent; cursor: pointer;
  font: 700 .95rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; border-radius: 2px;
  transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover:not(:disabled) { background: #2a2c31; }
.btn-ghost { background: transparent; border-color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.btn-danger { background: var(--danger); color: #fff; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem;
  background: transparent; border: 0; cursor: pointer; border-radius: 50%;
}
.icon-btn:hover { background: var(--surface); }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .6fr);
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
  padding: clamp(1.2rem, 3vw, 2.2rem) var(--pad);
  max-width: 1280px; margin: 0 auto;
}
.hero:has(.featured[hidden]) { grid-template-columns: minmax(0, 1fr); }
.eyebrow {
  margin: 0 0 1.2rem; font: 700 .9rem/1 var(--display);
  letter-spacing: .22em; text-transform: uppercase; color: var(--mute);
  display: flex; align-items: center; gap: .8rem;
}
.eyebrow::before { content: ""; width: 2.5rem; height: 2px; background: var(--accent); }
h1, .h1 {
  margin: 0; font: italic 800 clamp(2.4rem, 5.2vw, 4.4rem)/.9 var(--display);
  text-transform: uppercase; letter-spacing: -.005em;
}
:is(h1, .h1) .outline { color: transparent; -webkit-text-stroke: 2px var(--ink); }
:is(h1, .h1) .accent { color: var(--accent); }
.lede { max-width: 32rem; margin: 1.4rem 0 0; color: var(--mute); font-size: 1rem; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.4rem; margin-top: 1.6rem; }
.link-arrow {
  font: 700 .95rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; border-bottom: 2px solid var(--ink); padding-bottom: .3rem;
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); }

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem;
  margin: 2rem 0 0; padding-top: 1rem; border-top: 2px solid var(--ink);
}
.stats div { min-width: 0; }
.stats dt { order: 2; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.stats dd {
  margin: 0; font: 800 clamp(1.5rem, 2.6vw, 2.1rem)/1 var(--display);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.stats div { display: flex; flex-direction: column; gap: .35rem; }
.stats .warn dd { color: var(--accent); }

.featured {
  position: relative; display: block; aspect-ratio: 5 / 4; overflow: hidden;
  width: 100%; max-width: 380px; max-height: 300px; justify-self: end;
  background: var(--surface); text-decoration: none; color: #fff;
  animation: rise .8s var(--ease) both;
}
.featured img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.featured:hover img { transform: scale(1.04); }
.featured::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .7), transparent 45%);
}
.featured-tag {
  position: absolute; z-index: 2; top: 1rem; left: 1rem; background: var(--ink);
  color: var(--paper); padding: .35rem .7rem;
  font: 700 .8rem/1 var(--display); letter-spacing: .18em; text-transform: uppercase;
}
.featured-cap { position: absolute; z-index: 2; left: 1rem; right: 1rem; bottom: 1rem; }
.featured-cap small { display: block; font: 600 .75rem/1 var(--display); letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.featured-cap strong { display: block; margin-top: .3rem; font: italic 800 clamp(1.3rem, 2.2vw, 1.8rem)/.95 var(--display); text-transform: uppercase; }

/* ---------- Collection ---------- */
.catalog-section { max-width: 1280px; margin: 0 auto; padding: 1rem var(--pad) 4rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
h2 { margin: 0; font: italic 800 clamp(1.7rem, 3vw, 2.4rem)/1 var(--display); text-transform: uppercase; }
.result-count { margin: 0; color: var(--mute); font-size: .9rem; }

.toolbar {
  display: grid; align-items: center; gap: .8rem 1rem;
  grid-template-columns: minmax(14rem, 1fr) auto auto;
  grid-template-areas: "search selects view" "chips chips chips";
  padding: 1rem 0; margin-bottom: 1.4rem;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line);
}
.search {
  grid-area: search; display: flex; align-items: center; gap: .6rem; min-width: 0;
  background: #fff; border: 1px solid var(--line); padding: 0 .9rem; height: 2.7rem;
}
.search:focus-within { border-color: var(--ink); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; }
.chips { grid-area: chips; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  border: 1px solid var(--ink); background: transparent; cursor: pointer; white-space: nowrap;
  padding: .4rem .95rem; border-radius: 99px; font-size: .85rem; font-weight: 500;
  transition: background .2s, color .2s;
}
.chip:hover { background: var(--surface); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.selects { grid-area: selects; display: flex; flex-wrap: wrap; gap: .5rem; }
select {
  height: 2.7rem; padding: 0 2rem 0 .8rem; background: #fff; border: 1px solid var(--line);
  appearance: none; cursor: pointer; max-width: 11rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23111' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center;
}
select:hover, select:focus { border-color: var(--ink); }
.view-toggle { grid-area: view; display: flex; border: 1px solid var(--ink); }
.view-toggle button {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem;
  background: transparent; border: 0; cursor: pointer;
}
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.catalog.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 2rem 1.2rem; }
.catalog.list { display: flex; flex-direction: column; }

.tile { display: block; text-decoration: none; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.tile-media { position: relative; overflow: hidden; background: var(--surface); aspect-ratio: 5 / 4; }
.tile-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .9s var(--ease), opacity .5s;
}
.tile:hover .tile-media img:first-child { transform: scale(1.05); }
.tile-media img + img { opacity: 0; }
.tile:hover .tile-media img + img { opacity: 1; }
.tile:focus-visible { outline-offset: 6px; }
.ph {
  display: grid; place-items: center; width: 100%; height: 100%;
  font: italic 800 clamp(4rem, 9vw, 7rem)/1 var(--display); color: var(--line);
  background: repeating-linear-gradient(-45deg, var(--surface) 0 14px, #e2ddd1 14px 28px);
  text-transform: uppercase; position: absolute; inset: 0;
}
.tag {
  position: absolute; z-index: 2; top: .8rem; left: .8rem; background: var(--accent);
  color: var(--accent-ink); padding: .3rem .6rem;
  font: 700 .75rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase;
}
.tile-body { display: grid; gap: .25rem; padding-top: .9rem; }
.t-brand { margin: 0; font: 600 .8rem/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.t-name { margin: .2rem 0 0; font: italic 800 1.5rem/1 var(--display); text-transform: uppercase; }
.t-spec, .t-usage, .t-price { margin: 0; font-size: .88rem; color: var(--mute); }
.tile-body > .t-price { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.t-usage { display: grid; gap: .35rem; min-height: 1.1rem; margin: .35rem 0 .15rem; }
.t-km { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.t-km strong { font-weight: 600; color: var(--ink); }
.t-km span { font-size: .78rem; color: var(--mute); white-space: nowrap; }
.t-bar { display: block; height: 4px; background: var(--surface); overflow: hidden; }
.t-bar i { display: block; height: 100%; background: var(--ink); }
.t-bar.warn i { background: var(--accent); }
.t-bar.over i { background: var(--danger); }
.t-bar.done i { background: var(--mute); }
.tile:hover .t-name { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--accent); text-underline-offset: 4px; }

.catalog.list .tile {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.2rem; align-items: center;
  padding: .9rem 0; border-bottom: 1px solid var(--line);
}
.catalog.list .tile-media { aspect-ratio: 1; }
.catalog.list .tile-media img + img { display: none; }
.catalog.list .tile-body {
  padding: 0; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, .6fr); align-items: center; gap: 1rem;
}
.catalog.list .t-name { font-size: 1.5rem; }
.catalog.list .t-usage { margin: 0; }
.catalog.list .t-price { text-align: right; }
.catalog.list .tag { top: .3rem; left: .3rem; padding: .2rem .35rem; font-size: .65rem; }
.catalog.list .ph { font-size: 2.2rem; }

.skeleton { aspect-ratio: 5 / 4; background: linear-gradient(100deg, var(--surface) 30%, #f1eee6 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

.state { grid-column: 1 / -1; text-align: center; padding: clamp(3rem, 9vw, 6rem) 1rem; border: 2px dashed var(--line); }
.state .big { font: italic 800 clamp(2.2rem, 6vw, 4rem)/.95 var(--display); text-transform: uppercase; margin: 0 0 .8rem; }
.state p { margin: 0 auto 1.5rem; max-width: 30rem; color: var(--mute); }
.state .btn { margin: 0 .3rem; }

/* ---------- Fiche détaillée ---------- */
.detail { max-width: 1280px; margin: 0 auto; padding: 1.4rem var(--pad) 4rem; }
.back { display: inline-flex; gap: .5rem; text-decoration: none; font-weight: 500; font-size: .92rem; margin-bottom: 1.4rem; }
.back:hover { color: var(--accent); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 3rem); align-items: start; }
.gallery { position: sticky; top: 5.5rem; }
.gallery-main { position: relative; aspect-ratio: 1; max-height: 75vh; width: 100%; background: var(--surface); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; animation: fade .5s; }
.thumbs { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .6rem; }
.thumb { width: 84px; aspect-ratio: 1; padding: 0; border: 2px solid transparent; background: var(--surface); cursor: pointer; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--ink); }
.detail-info { position: sticky; top: 5.5rem; }
.detail-info .t-brand { font-size: .9rem; }
.detail-title { margin: .6rem 0 .3rem; font: italic 800 clamp(2.2rem, 4.5vw, 3.6rem)/.9 var(--display); text-transform: uppercase; }
.detail-sub { margin: 0; color: var(--mute); }
.badge-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0; }
.badge {
  padding: .3rem .75rem; border: 1px solid var(--ink); border-radius: 99px; font-size: .8rem; font-weight: 500;
}
.badge.warn { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.spec { margin: 1.4rem 0; border-top: 2px solid var(--ink); }
.spec div { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--mute); font-size: .88rem; }
.spec dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.notes { white-space: pre-wrap; color: var(--mute); margin: 1rem 0; }
.detail-actions { display: flex; gap: .7rem; margin-top: 1.5rem; flex-wrap: wrap; }

.maintenance { margin-top: clamp(2.5rem, 6vw, 4.5rem); max-width: 900px; }
.timeline { list-style: none; margin: 1.4rem 0; padding: 0 0 0 1.6rem; border-left: 2px solid var(--ink); }
.timeline li { position: relative; padding: 0 0 1.5rem 1.2rem; }
.timeline li::before {
  content: ""; position: absolute; left: -2.15rem; top: .35rem; width: .8rem; height: .8rem;
  background: var(--accent); border: 2px solid var(--paper); box-shadow: 0 0 0 2px var(--ink); border-radius: 50%;
}
.tl-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.tl-type { font: italic 800 1.4rem/1.1 var(--display); text-transform: uppercase; }
.tl-meta { color: var(--mute); font-size: .86rem; }
.tl-note { margin: .3rem 0 0; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--mute); font-size: .82rem; text-decoration: underline; }
.link-btn:hover { color: var(--danger); }
.empty-inline { color: var(--mute); padding: 1rem 0; }

.maint-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; padding: 1.2rem; background: var(--surface); }
.maint-form .span-2 { grid-column: span 2; }
.maint-form .span-4 { grid-column: 1 / -1; }
.maint-form .actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

/* ---------- Formulaires ---------- */
.field { display: grid; gap: .35rem; font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
.field input, .field select, .field textarea {
  width: 100%; max-width: none; height: auto; padding: .65rem .75rem; font-weight: 400; font-size: .95rem;
  background: #fff; border: 1px solid var(--line); border-radius: 2px;
}
.field select { height: 2.75rem; padding: 0 2rem 0 .75rem; }
.field input:focus, .field textarea:focus { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: -1px; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.req { color: var(--accent); font-weight: 600; font-size: .72rem; margin-left: .3rem; text-transform: uppercase; letter-spacing: .08em; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.span-2 { grid-column: span 2; }
.form-error { margin: 0; padding: .8rem 1rem; background: #fde8e3; color: var(--danger); font-weight: 500; }

.dialog { width: min(760px, calc(100% - 1.5rem)); max-height: 92vh; padding: 0; border: 0; background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(17, 18, 20, .6); backdrop-filter: blur(3px); }
.dialog[open] { animation: pop .3s var(--ease); display: flex; flex-direction: column; }
.dialog form { display: flex; flex-direction: column; min-height: 0; max-height: 92vh; }
.dialog-sm { width: min(440px, calc(100% - 1.5rem)); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.4rem; border-bottom: 2px solid var(--ink); }
.dialog-head h2 { font-size: 1.9rem; }
.dialog-body { padding: 1.4rem; overflow-y: auto; display: grid; gap: 1.6rem; }
.dialog-body h2 { font-size: 1.9rem; }
.dialog-body p { margin: 0; color: var(--mute); }
.dialog-foot { display: flex; justify-content: flex-end; gap: .7rem; padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: var(--paper); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: .8rem; font: 700 .85rem/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }

.combo-list { list-style: none; margin: .4rem 0 0; padding: 0; max-height: 17rem; overflow-y: auto; background: #fff; border: 1px solid var(--ink); }
.combo-list li { display: flex; align-items: center; gap: .8rem; padding: .45rem .7rem; cursor: pointer; border-bottom: 1px solid var(--line); }
.combo-list li:last-child { border-bottom: 0; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--surface); }
.combo-list li[aria-selected="true"] { box-shadow: inset 4px 0 0 var(--accent); }
.combo-list img { width: 64px; aspect-ratio: 5 / 4; object-fit: cover; flex: none; background: var(--surface); }
.combo-list .opt-name { font-weight: 600; font-size: .92rem; }
.combo-list .opt-meta { display: block; font-size: .78rem; color: var(--mute); font-weight: 400; }
.combo-list .combo-empty { cursor: default; color: var(--mute); font-size: .9rem; }
.combo-list .combo-empty:hover { background: transparent; }
.hint { font-size: .82rem; margin-top: .5rem !important; }

.dropzone {
  display: grid; justify-items: center; gap: .3rem; text-align: center; padding: 1.6rem 1rem;
  border: 2px dashed var(--ink); cursor: pointer; transition: background .2s, border-color .2s;
}
.dropzone span { color: var(--mute); font-size: .85rem; }
.dropzone:hover, .dropzone.over { background: var(--surface); border-color: var(--accent); }
#photoInput:focus-visible + .photo-list, #photoInput:focus-visible ~ .dropzone { outline: 3px solid var(--accent); }
.photo-list { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .7rem; }
.photo-list li { position: relative; aspect-ratio: 1; background: var(--surface); overflow: hidden; }
.photo-list img { width: 100%; height: 100%; object-fit: cover; }
.photo-list .cover-tag { position: absolute; left: .3rem; top: .3rem; background: var(--ink); color: var(--paper); font: 700 .7rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; padding: .25rem .4rem; }
.photo-list .photo-actions { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; padding: .3rem; background: linear-gradient(to top, rgba(0,0,0,.65), transparent); }
.photo-list button { background: rgba(255,255,255,.92); border: 0; cursor: pointer; font-size: .72rem; font-weight: 600; padding: .2rem .45rem; border-radius: 2px; }
.photo-list button:hover { background: var(--accent); }

/* ---------- Divers ---------- */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 2rem var(--pad); background: var(--ink); color: #aaa8a0; font-size: .85rem;
}
.footer .logo { color: var(--paper); }

.toasts { position: fixed; z-index: 200; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; }
.toast {
  min-width: 14rem; max-width: 22rem; padding: .85rem 1.1rem; background: var(--ink); color: var(--paper);
  border-left: 5px solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: pop .3s var(--ease); font-size: .92rem;
}
.toast.error { border-left-color: #ff3b3b; background: #3a0f0a; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Navigation, statut, usure ---------- */
.topnav { flex-wrap: wrap; row-gap: .3rem; }
.nav-btn {
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit;
  font: 500 .95rem/1 var(--body, inherit);
}
.nav-btn:hover, .topnav a[aria-current="true"] { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.tile.inactive .tile-media img { filter: grayscale(.85); opacity: .7; }
.tile.inactive .tag { background: var(--ink); color: var(--paper); }

.wear { margin: 0 0 1.2rem; }
.wear-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .85rem; margin-bottom: .45rem; }
.wear-head span { color: var(--mute); }
.wear-head strong { font-variant-numeric: tabular-nums; }
.wear-bar { height: .55rem; background: var(--surface); border: 1px solid var(--line); }
.wear-bar span { display: block; height: 100%; background: var(--ink); transition: width .6s var(--ease); }
.wear-bar.warn span, .wear-bar.over span { background: var(--accent); }
.wear-bar.over span { background: var(--danger); }
.wear-bar.done span { background: var(--mute); }
.wear-note { margin: .45rem 0 0; font-size: .82rem; color: var(--accent); font-weight: 600; }
.wear-note.done { color: var(--mute); font-weight: 500; }

/* ---------- Rappels et activités ---------- */
.reminders, .activities { margin-top: clamp(2rem, 5vw, 3.5rem); max-width: 900px; }
.rows { list-style: none; margin: 1.2rem 0; padding: 0; border-top: 2px solid var(--ink); }
.rows li { display: flex; align-items: center; gap: .9rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.rows .row-main { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.rows small { color: var(--mute); font-size: .82rem; }
.rows li.done .row-main { opacity: .5; text-decoration: line-through; }
.rows li.late small { color: var(--accent); font-weight: 600; }
.rows-sum { margin: 1rem 0 0; color: var(--mute); font-size: .88rem; }
.check {
  flex: none; width: 1.3rem; height: 1.3rem; border: 2px solid var(--ink); background: transparent;
  cursor: pointer; position: relative; border-radius: 2px;
}
.check[aria-checked="true"] { background: var(--ink); }
.check[aria-checked="true"]::after {
  content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px;
  border: solid var(--paper); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.activities input[type="file"] { padding: .55rem .6rem; height: auto; }

/* ---------- Pages statistiques et comparateur ---------- */
.page-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1.2rem; }
.stats-page .stats { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin-top: 0; }
.stats-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; margin: 2.5rem 0; }
.stats-page h2, .compare-page h2 { font-size: 1.6rem; margin: 0 0 .8rem; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.bars li { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: center; gap: .7rem; font-size: .85rem; }
.bar-label { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: .8rem; background: var(--surface); }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar-val { font-variant-numeric: tabular-nums; min-width: 4.5rem; text-align: right; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table thead th { border-bottom: 2px solid var(--ink); }
.table tbody th { font-weight: 500; color: var(--mute); white-space: nowrap; }
.table td { font-variant-numeric: tabular-nums; }
.compare { min-width: 34rem; }
.compare thead th { min-width: 10rem; font-weight: 700; }
.compare thead th a { display: block; margin: .5rem 0 .2rem; }
.cmp-media { position: relative; aspect-ratio: 5 / 4; background: var(--surface); overflow: hidden; }
.cmp-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-add { max-width: 22rem; margin-bottom: 1.4rem; }
.data-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.dialog-body .field { font-size: .85rem; }
@media (max-width: 960px) {
  .stats-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Connexion et compte ---------- */
body:not([data-auth="in"]) :is(.topnav, #addBtn, .user-menu, #main, .footer) { display: none; }
body:not([data-auth="out"]) #authView { display: none; }
body:not([data-auth="in"]) .topbar { justify-content: flex-start; }

.auth {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 26rem); gap: clamp(1.5rem, 5vw, 4.5rem);
  align-items: center; max-width: 1280px; margin: 0 auto; padding: clamp(2rem, 7vw, 5rem) var(--pad);
  min-height: calc(100vh - 4.5rem);
}
.auth-card { display: grid; gap: 1rem; padding: 1.6rem; background: #fff; border: 2px solid var(--ink); animation: rise .6s var(--ease) both; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); }
.auth-switch button {
  padding: .65rem .5rem; border: 0; background: transparent; cursor: pointer;
  font: 700 .9rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase;
}
.auth-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn-google { background: #fff; border-color: var(--line); color: var(--ink); text-transform: none; letter-spacing: .02em; font: 600 .95rem/1 var(--body); }
.btn-google:hover:not(:disabled) { border-color: var(--ink); }
.auth-sep { display: flex; align-items: center; gap: .8rem; margin: 0; color: var(--mute); font-size: .8rem; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-form { display: grid; gap: .9rem; }
.auth-form .hint { margin: -.4rem 0 0 !important; color: var(--mute); }
.auth-form .link-btn { justify-self: center; }
.auth-form .link-btn:hover { color: var(--ink); }
.auth-info { margin: 0; padding: .8rem 1rem; background: var(--surface); font-weight: 500; }

.user-menu { position: relative; }
.avatar-btn { display: grid; place-items: center; padding: 0; border: 2px solid var(--ink); border-radius: 50%; background: none; cursor: pointer; }
.avatar {
  display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; overflow: hidden;
  background: var(--ink); color: var(--paper); font: 800 1.1rem/1 var(--display);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-panel {
  position: absolute; right: 0; top: calc(100% + .6rem); z-index: 40; width: max-content; min-width: 14rem; max-width: 20rem;
  display: grid; gap: .3rem; padding: 1rem; background: var(--paper); border: 2px solid var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18); animation: pop .2s var(--ease);
}
.user-panel p { margin: 0; overflow-wrap: anywhere; }
.user-name { font-weight: 600; }
.user-email { color: var(--mute); font-size: .85rem; }
.user-email:empty { display: none; }
.user-panel .btn { margin-top: .6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "search view" "selects selects" "chips chips"; }
}
@media (max-width: 960px) {
  .hero, .auth { grid-template-columns: minmax(0, 1fr); }
  .auth { min-height: 0; }
  .featured { justify-self: start; }
  .catalog.list .tile-body { grid-template-columns: minmax(0, 1fr) auto; }
  .catalog.list .t-spec { display: none; }
  .catalog.list .t-usage { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 720px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery, .detail-info { position: static; }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { gap: 1rem; }
  .fields, .maint-form { grid-template-columns: minmax(0, 1fr); }
  .span-2, .maint-form .span-2 { grid-column: auto; }
  .catalog.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.6rem .8rem; }
  .t-name { font-size: 1.35rem; }
  .selects { width: 100%; }
  .selects label { flex: 1 1 40%; }
  .selects select { max-width: none; width: 100%; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .dialog { max-height: 100vh; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Strava ---------- */
.btn-strava { background: #fc5200; color: #fff; }
.btn-strava:hover:not(:disabled) { background: #e04800; }
.badge-strava { background: #fc5200; border-color: #fc5200; color: #fff; font-weight: 600; }
.strava-note { margin: 1rem 0 0; font-size: .85rem; color: var(--mute); }
.strava-note a { color: inherit; font-weight: 600; }

.strava-banner {
  max-width: 1280px; margin: 0 auto; padding: 1rem var(--pad) 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap;
}
.strava-banner > p { margin: 0; flex: 1 1 22rem; padding-left: .9rem; border-left: 4px solid #fc5200; }
.banner-actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }

.strava-page { max-width: 900px; }
.strava-page section { margin-top: clamp(2rem, 5vw, 3rem); }
.strava-page h2 { font-size: 1.6rem; margin: 0 0 .4rem; }
.strava-page .form-error { margin-top: 1rem; }
.strava-intro { display: grid; gap: 1.2rem; justify-items: start; }
.strava-intro .lede { margin: 0; }
.strava-intro .hint { max-width: 36rem; color: var(--mute); }
.strava-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.strava-status p { margin: 0; }
.strava-rows li { flex-wrap: wrap; }
.strava-rows .row-main a { color: inherit; }
.strava-thumb { flex: none; position: relative; width: 3.6rem; height: 3.6rem; background: var(--surface); overflow: hidden; }
.strava-thumb img { width: 100%; height: 100%; object-fit: contain; }
.strava-thumb .ph { font-size: 1.3rem; }
.strava-choice select { max-width: 19rem; }
.strava-rows .retired { color: var(--accent); font-weight: 600; }
.strava-powered { margin-top: 3rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
#stravaImportForm .btn { margin-top: .4rem; }
@media (max-width: 640px) {
  .strava-choice { flex: 1 1 100%; }
  .strava-choice select { max-width: none; width: 100%; }
}

/* ---------- Encart « Dernière sortie » ---------- */
.featured .ph { font-size: clamp(4rem, 8vw, 6rem); }
.featured-meta { display: grid; gap: .15rem; margin-top: .55rem; font-size: .8rem; font-variant-numeric: tabular-nums; opacity: .92; }
.featured-meta span:first-child { font-weight: 600; }

/* ---------- Page de connexion : plus grande que l'application (taille de base réduite à 81,25 %) ---------- */
html:has(body[data-auth="out"]) { font-size: 100%; }
body[data-auth="out"] .auth {
  max-width: 1400px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 29rem); gap: clamp(2rem, 7vw, 7rem);
}
body[data-auth="out"] .auth h1 { font-size: clamp(2.8rem, 6.6vw, 6.4rem); }
body[data-auth="out"] .auth h1 .outline { -webkit-text-stroke-width: 2.5px; }
body[data-auth="out"] .auth .lede { font-size: 1.15rem; max-width: 34rem; margin-top: 1.8rem; }
body[data-auth="out"] .auth-card { padding: 2.2rem; gap: 1.2rem; }
body[data-auth="out"] .auth-switch button { padding: .85rem .5rem; font-size: 1rem; }
body[data-auth="out"] .auth .btn { padding: .95rem 1.4rem; font-size: 1.02rem; }
body[data-auth="out"] .auth .field { font-size: .88rem; }
body[data-auth="out"] .auth .field input { padding: .8rem .9rem; font-size: 1rem; }
@media (max-width: 960px) {
  body[data-auth="out"] .auth { grid-template-columns: minmax(0, 1fr); }
  body[data-auth="out"] .auth-card { padding: 1.5rem; }
}

.activities .more-btn { margin-top: .2rem; }

/* ---------- Au placard ---------- */
.placard { margin-top: clamp(3rem, 7vw, 5rem); padding-top: 1.4rem; border-top: 2px solid var(--ink); }
.placard-lede { margin: -.4rem 0 1.4rem; color: var(--mute); font-size: .9rem; }
.detail-grid + .activities { margin-top: clamp(2.5rem, 6vw, 4.5rem); }

/* ---------- Navigation : 7 entrées ---------- */
.topnav { gap: .4rem 1.2rem; }
@media (max-width: 1180px) { .topnav a, .nav-btn { font-size: .88rem; } }
/* Mobile : logo et actions sur une ligne, navigation en dessous, défilante horizontalement. */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; row-gap: .55rem; }
  .topnav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; gap: 1.2rem; padding-bottom: .15rem; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a, .topnav .nav-btn { flex: none; white-space: nowrap; }
  #addBtn { margin-left: auto; }
}

/* ---------- Projection d'usure ---------- */
.wear-proj { margin: .45rem 0 0; font-size: .82rem; color: var(--mute); }
.wear-proj strong { color: var(--ink); font-weight: 600; }

/* ---------- Composants ---------- */
.components { margin-top: clamp(2rem, 5vw, 3.5rem); max-width: 900px; }
.components .row-main .t-bar { margin-top: .35rem; max-width: 22rem; }
.row-actions { display: flex; gap: .9rem; flex: none; }
.row-actions .link-btn:hover { color: var(--ink); }
.comp-pct { font: 600 .78rem/1 var(--body); color: var(--mute); margin-left: .35rem; font-variant-numeric: tabular-nums; }
.comp-pct.warn { color: var(--accent); }
.comp-pct.over { color: var(--danger); }
.comp-history { margin: 0 0 1.2rem; }
.comp-history summary { cursor: pointer; color: var(--mute); font-size: .88rem; }
.comp-history .rows { margin-top: .6rem; }

/* ---------- Graphiques ---------- */
.evolution { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.evolution + .activities { margin-top: clamp(2rem, 5vw, 3rem); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; margin-top: 1.2rem; }
.chart { margin: 0; min-width: 0; }
.chart figcaption { font-size: .85rem; font-weight: 600; margin-bottom: .9rem; }
.chart-plot { position: relative; height: 190px; margin-left: 2.8rem; }
.gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.gl em { position: absolute; right: calc(100% + .5rem); top: -.55em; font: normal .72rem/1 var(--body); color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-tip {
  position: absolute; z-index: 5; transform: translateX(-50%); pointer-events: none;
  background: var(--ink); color: var(--paper); padding: .35rem .55rem; border-radius: 2px;
  font-size: .78rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.cchart, .lchart { position: relative; }
.cchart-cols { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.cchart .col { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100%; padding: 0; border: 0; background: none; cursor: default; }
.cchart .col i { display: block; width: min(24px, 60%); background: var(--ink); border-radius: 4px 4px 0 0; transition: opacity .15s; }
.cchart .col:hover i, .cchart .col:focus-visible i { opacity: .72; }
.cchart .col:focus-visible { outline-offset: 0; }
.cchart-x, .lchart-x { display: grid; margin: .45rem 0 0 2.8rem; font-size: .72rem; color: var(--mute); }
.cchart-x { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); text-align: center; }
.cchart-x span { overflow: hidden; white-space: nowrap; }
.lchart-x { grid-template-columns: auto 1fr auto; gap: .5rem; }
.lchart-x span:nth-child(2) { text-align: center; }
.lchart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.lchart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.lchart .area { fill: var(--accent); opacity: .1; }
.lchart .limit { stroke: var(--danger); stroke-width: 1; vector-effect: non-scaling-stroke; }
.lchart .proj { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 5; opacity: .55; vector-effect: non-scaling-stroke; }
.lchart-limit { position: absolute; left: .4rem; transform: translateY(-120%); font-size: .72rem; color: var(--mute); }
.lchart-dot, .xdot {
  position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 2px var(--paper); transform: translate(-50%, 50%); pointer-events: none;
}
.lchart-end { position: absolute; transform: translate(-100%, -.9rem); margin-left: -.4rem; font-size: .78rem; font-weight: 600; white-space: nowrap; pointer-events: none; }
.xhair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink); opacity: .35; pointer-events: none; }
.chart-data { margin-top: .9rem; font-size: .85rem; }
.chart-data summary { cursor: pointer; color: var(--mute); }
.chart-data .table { margin-top: .5rem; }
.stats-cols .cchart { margin-top: .4rem; }
@media (max-width: 720px) {
  .charts { grid-template-columns: minmax(0, 1fr); }
  .cchart-x span:nth-child(even) { visibility: hidden; }
}

/* ---------- Remplaçant suggéré ---------- */
.successor {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.4rem; align-items: center;
  margin-top: clamp(2rem, 5vw, 3rem); padding: 1.2rem; max-width: 900px;
  background: var(--surface); border-left: 4px solid var(--accent);
}
.successor-media { aspect-ratio: 5 / 4; background: var(--paper); display: block; }
.successor-media img { width: 100%; height: 100%; object-fit: contain; }
.successor h2 { font-size: 1.7rem; margin: .2rem 0; }
.successor-kicker { margin: 0; font: 700 .78rem/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.successor-meta { margin: 0 0 .9rem; color: var(--mute); font-size: .88rem; }
@media (max-width: 640px) { .successor { grid-template-columns: minmax(0, 1fr); } .successor-media { max-width: 12rem; } }

/* ---------- Envies ---------- */
.wish-page .lede { margin: 0 0 1.6rem; }
.wish-form { display: grid; grid-template-columns: minmax(0, 1fr) 8rem auto; gap: .9rem; align-items: end; max-width: 720px; margin-bottom: 2.2rem; }
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 2rem 1.2rem; }
.wish { display: grid; gap: .3rem; align-content: start; }
.wish .tile-media { margin-bottom: .6rem; }
.wish .tile-media img { object-fit: contain; }
.wish .t-spec a { color: var(--ink); }
.wish .banner-actions { margin-top: .5rem; }
@media (max-width: 640px) { .wish-form { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Bilan annuel ---------- */
.wrapped section { margin-top: clamp(2rem, 5vw, 3rem); }
.wrapped h2 { font-size: 1.6rem; margin: 0 0 .8rem; }
.wrapped-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.wrapped-head .eyebrow { margin: 0; }
.wrapped-year select { min-width: 7rem; }
.wrapped-hero { margin: .8rem 0 .2rem; font-size: clamp(4rem, 13vw, 9rem); line-height: .85; }
.wrapped-hero span { font-size: .4em; color: var(--accent); }
.wrapped-sub { margin: 0 0 1.4rem; color: var(--mute); font-size: 1.05rem; }
.wrapped-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 1.2rem; margin: 2.4rem 0 1rem; }
.wrapped-card { display: grid; grid-template-rows: auto 1fr; text-decoration: none; background: var(--surface); }
.wrapped-media { position: relative; display: block; aspect-ratio: 5 / 3; overflow: hidden; background: var(--paper); }
.wrapped-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wrapped-media .ph { font-size: 3rem; }
.wrapped-card-body { display: grid; gap: .25rem; padding: .9rem 1rem 1.1rem; }
.wrapped-card-body small { font: 700 .75rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.wrapped-card-body strong { font: italic 800 1.4rem/1 var(--display); text-transform: uppercase; }
.wrapped-card-body span { font-size: .85rem; color: var(--mute); }
.wrapped-card:hover strong { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.wrapped .stats { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.wrapped .stats dd { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
.wrapped-rank { counter-reset: rank; }
.wrapped-rank li::before { counter-increment: rank; content: counter(rank); font: italic 800 1.3rem/1 var(--display); width: 1.6rem; color: var(--mute); }
.wrapped-rank a { color: inherit; }
.rank-km { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Vitrine publique : réglages ---------- */
.showcase-form { gap: 1.1rem; }
.check-row { display: flex; align-items: center; gap: .6rem; font-size: .9rem; font-weight: 500; cursor: pointer; }
.check-row input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); }
.check-group { border: 1px solid var(--line); padding: .8rem 1rem 1rem; margin: 0; display: grid; gap: .6rem; }
.check-group legend { padding: 0 .3rem; font-size: .82rem; font-weight: 600; }
.slug-field { display: flex; align-items: stretch; }
.slug-field > span { display: flex; align-items: center; padding: 0 .6rem; background: var(--surface); border: 1px solid var(--line); border-right: 0; color: var(--mute); font-weight: 500; }
.slug-field input { flex: 1; min-width: 0; }
.showcase-link { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .8rem 1rem; background: var(--surface); }
.showcase-link a { font-weight: 600; color: var(--ink); word-break: break-all; }
.user-panel .btn + .btn { margin-top: .5rem; }

/* ---------- Vitrine publique : page ---------- */
/* id : passe devant la règle qui masque .footer hors connexion (spécificité d'id via :is(#main…)). */
body[data-auth="public"] #vitrineFooter { display: flex; }
body[data-auth="public"] .footer a { color: var(--paper); }
.vitrine-head { max-width: 1280px; margin: 0 auto; padding: clamp(1.6rem, 4vw, 3rem) var(--pad) 1rem; }
.vitrine-head h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.vitrine-head .stats { max-width: 40rem; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
.vitrine .tile { cursor: default; }
.vitrine .tile:hover .t-name { text-decoration: none; }

/* ---------- Page d'accueil publique : fonctionnalités, questions fréquentes, liens légaux ---------- */
.landing { max-width: 1400px; margin: 0 auto; padding: 0 var(--pad) clamp(2.5rem, 6vw, 5rem); }
.landing h2 { margin: 0 0 1.4rem; font: italic 800 clamp(1.9rem, 4vw, 3rem)/.95 var(--display); text-transform: uppercase; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0 0 clamp(2.5rem, 6vw, 4.5rem); padding: 0; list-style: none; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .features { grid-template-columns: minmax(0, 1fr); } }
.features li { padding: 1.3rem 1.4rem; background: #fff; border: 1px solid var(--line); }
.features h3 { margin: 0 0 .45rem; font: 700 1.25rem/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.features h3::before { content: ""; display: block; width: 1.8rem; height: 3px; margin-bottom: .8rem; background: var(--accent); }
.features p { margin: 0; color: var(--mute); }
.faq { display: grid; gap: .6rem; max-width: 60rem; }
.faq details { background: #fff; border: 1px solid var(--line); }
.faq summary { padding: 1rem 1.2rem; cursor: pointer; font-weight: 600; }
.faq details p { margin: 0; padding: 0 1.2rem 1.1rem; color: var(--mute); }
.legal-links { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; max-width: 1400px; margin: 0 auto; padding: 1.4rem var(--pad) 2rem; border-top: 1px solid var(--line); color: var(--mute); font-size: .9rem; }
.legal-links a { color: inherit; }
.footer-links a { color: var(--paper); }
.user-panel .btn-danger { color: var(--danger); border-color: transparent; }

/* ---------- Pages statiques (confidentialité, mentions légales, 404) ---------- */
.page { max-width: 52rem; margin: 0 auto; padding: clamp(1.6rem, 5vw, 3.5rem) var(--pad) 3rem; }
.page h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin-bottom: 1.4rem; }
.page h2 { margin: 2rem 0 .6rem; font: 700 1.5rem/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.page p, .page li { color: var(--ink); }
.page .meta { color: var(--mute); font-size: .9rem; }
.page table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.page th, .page td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
body[data-auth="public"] #pageFooter { display: flex; }

/* ---------- Garages : abonnements, classement, abonnés, découverte ---------- */
.vitrine-cta { margin: 1.4rem 0 0; }
.tabs { display: flex; gap: .3rem 1.6rem; flex-wrap: wrap; margin: 0 0 1.8rem; border-bottom: 1px solid var(--line); }
.tabs a {
  display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 0; margin-bottom: -1px;
  text-decoration: none; font: 700 1rem/1 var(--display); letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute); border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
:is(.garages-page, .garage-page) a.link-btn:hover { color: var(--ink); }
.badge-ok { background: var(--ink); color: var(--paper); }

.garage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1.6rem 1.2rem; }
.garage-grid .skeleton { aspect-ratio: 4 / 3; }
.garage-card { display: grid; align-content: start; gap: .7rem; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.garage-link { display: grid; gap: .8rem; text-decoration: none; }
.garage-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; aspect-ratio: 2 / 1; background: var(--surface); overflow: hidden; }
.strip-cell { position: relative; overflow: hidden; background: var(--surface); }
.strip-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.garage-link:hover .strip-cell img { transform: scale(1.05); }
.strip-cell .ph { font-size: 3rem; }
.garage-card-body { display: grid; gap: .25rem; }
.garage-card-body small { font: 600 .8rem/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.garage-card-body strong { font: italic 800 1.5rem/1 var(--display); text-transform: uppercase; }
.garage-card-body span { font-size: .85rem; color: var(--mute); }
.garage-link:hover strong { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.garage-card-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.garage-card-actions .btn { padding: .55rem 1.1rem; font-size: .85rem; }
.garage-card.gone { opacity: .75; }

.follow-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .9rem; align-items: end; max-width: 720px; margin: 2.2rem 0 0; }
.garages-page .follow-form:first-child, .garages-page .tabs + .follow-form { margin: 0 0 2.2rem; }
.discover-head { align-items: center; margin-top: .5rem; }
.discover-head h2 { font-size: 1.6rem; }
.discover-search { width: min(100%, 18rem); }
.discover-hint { color: var(--mute); margin: -.4rem 0 1.2rem !important; }
.garage-section + .garage-section { margin-top: clamp(2.5rem, 6vw, 3.5rem); }
.garage-section h2 { font-size: 1.6rem; margin: 0 0 .9rem; }
.garage-section .hint { color: var(--mute); margin: -.5rem 0 1.1rem !important; }

.garage-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.garage-head .eyebrow { margin-bottom: .8rem; }
.garage-head .page-title { margin: 0; }
.garage-page .stats { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); max-width: 56rem; }
.garage-hint { color: var(--mute); }
.garage-page .face, .garage-page .common, .garage-collection { margin-top: clamp(2rem, 5vw, 3.5rem); }
.garage-page h2 { font-size: 1.6rem; margin: 0 0 .8rem; }
.garage-page .tile { cursor: default; }
.garage-page .tile:hover .t-name { text-decoration: none; }
.garage-page .bars li, .garages-page .bars li { grid-template-columns: minmax(5.5rem, 9rem) minmax(0, 1fr) auto; }
.face-table { max-width: 56rem; }
.face-table thead th { font-weight: 700; }
.face-table td.win { font-weight: 700; color: var(--ink); }
.face-table td.win::after { content: " ▲"; color: var(--accent); font-size: .75em; }
.common .rows { max-width: 900px; }
.tile-wish { justify-self: start; margin-top: .3rem; }
.tile-wish:hover { color: var(--ink); }
.t-mine { margin: .3rem 0 0; font-size: .8rem; font-weight: 600; color: var(--accent); }

.rank-thumb { flex: none; position: relative; width: 3.2rem; height: 3.2rem; background: var(--surface); overflow: hidden; }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-thumb .ph { font-size: 1.2rem; }
.rank-list .row-main a { color: inherit; }
.rank-list .t-bar { margin-top: .3rem; max-width: 16rem; }
.rank-list li.is-me .t-bar i, .bars li.is-me .bar i { background: var(--ink); }
.rank-list li.is-me strong a, .bars li.is-me .bar-label { color: var(--ink); font-weight: 700; }

.lb-head { display: flex; align-items: center; gap: .8rem 1.4rem; flex-wrap: wrap; }
.lb-head .hint { margin: 0 !important; color: var(--mute); }
.lb-note { color: var(--mute); }
.lb-cols { margin-top: 2rem; }
.lb-cols h2 { font-size: 1.6rem; margin: 0 0 .8rem; }
.lb-cols .hint { margin: -.4rem 0 .8rem !important; color: var(--mute); }
.seg { display: inline-flex; border: 1px solid var(--ink); }
.seg button { padding: .55rem .95rem; border: 0; background: transparent; cursor: pointer; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.podium { list-style: none; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); align-items: end; gap: .8rem; max-width: calc(var(--n, 3) * 15.3rem); margin: 2rem 0 0; padding: 0; }
.podium li { display: grid; gap: .3rem; justify-items: center; text-align: center; padding: 1rem .6rem 1.2rem; background: var(--surface); border-top: 4px solid var(--line); min-width: 0; }
.podium-1 { order: 2; padding-top: 1.8rem !important; border-top-color: var(--accent) !important; }
.podium-2 { order: 1; }
.podium-3 { order: 3; }
.podium-rank { font: italic 800 2.4rem/1 var(--display); color: var(--mute); }
.podium-1 .podium-rank { color: var(--accent); font-size: 3.2rem; }
.podium a { font-weight: 600; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium a:hover { text-decoration: underline; }
.podium strong { font: 800 1.5rem/1 var(--display); font-variant-numeric: tabular-nums; }
.podium small { font-size: .7em; color: var(--mute); }
.podium li.is-me { background: var(--ink); color: var(--paper); }
.podium li.is-me small, .podium li.is-me .podium-rank { color: var(--paper); }

.followers .avatar { flex: none; width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
.followers .row-actions { align-items: center; flex-wrap: wrap; }
.followers .btn { padding: .5rem 1rem; font-size: .82rem; }
.followers-skeleton { aspect-ratio: auto; height: 8rem; max-width: 900px; }

@media (max-width: 640px) {
  .follow-form { grid-template-columns: minmax(0, 1fr); }
  .podium { gap: .4rem; }
  .podium strong { font-size: 1.15rem; }
  .followers li { flex-wrap: wrap; }
}
