/* CarPocket. Design : DESIGN-bmw.md. Page blanche, bandes bleu nuit, un seul bleu d'action,
   angles droits, aucune ombre, contraste de graisses 700 / 300. */
:root {
  --primary: #1c69d4;
  --primary-active: #0653b6;
  --primary-disabled: #d6d6d6;
  --ink: #262626;
  --body: #3c3c3c;
  --muted: #6b6b6b;
  --hairline: #e6e6e6;
  --hairline-strong: #cccccc;
  --canvas: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-card: #fafafa;
  --surface-dark: #1a2129;
  --surface-dark-elevated: #262e38;
  --on-dark: #ffffff;
  --on-dark-soft: #bbbbbb;
  --error: #dc2626;
  --danger-fill: #dc2626;
  --accent-text: #1c69d4;
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
/* Thème sombre : les bandes restent un cran plus claires que la page pour garder le rythme. */
:root[data-theme="dark"] {
  --primary-disabled: #38424c;
  --ink: #f2f4f6;
  --body: #c8ced4;
  --muted: #9ca6b0;
  --hairline: #2b343d;
  --hairline-strong: #47525d;
  --canvas: #0f1418;
  --surface-soft: #171d23;
  --surface-card: #1c232a;
  --surface-dark: #1d252e;
  --surface-dark-elevated: #2a333d;
  --error: #ff8a80;
  --accent-text: #7ab0f8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font: 300 1rem/1.55 var(--font);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: max(16px, min(4vw, 48px));
}
.section { padding-block: 80px; }

/* Typographie */
.display-xl, .display-lg, .display-md, .display-sm { font-weight: 700; text-wrap: balance; color: var(--ink); }
.display-xl { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.05; }
.display-lg { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; }
.display-md { font-size: 2rem; line-height: 1.15; }
.display-sm { font-size: 1.5rem; line-height: 1.25; }
.label {
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.text-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent-text);
  font: 700 .8125rem/1.3 var(--font);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.text-link:active { opacity: .75; }
.text-link.quiet { color: var(--muted); }
.text-link.quiet:hover { color: var(--error); }

/* Boutons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 13px 32px;
  font: 700 .875rem/1 var(--font);
  letter-spacing: .5px;
  text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover, .button-primary:active { background: var(--primary-active); }
.button-primary:disabled { background: var(--primary-disabled); color: var(--muted); cursor: not-allowed; }
.button-secondary { border-color: var(--hairline-strong); background: var(--canvas); color: var(--ink); }
.button-on-dark { border-color: var(--on-dark); background: transparent; color: var(--on-dark); }
.button-on-dark:hover { background: var(--on-dark); color: var(--surface-dark); }
.button-danger { background: var(--danger-fill); color: #fff; }
.button-danger:disabled { opacity: .6; cursor: wait; }

/* Navigation */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
}
.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.375rem; font-weight: 300; line-height: 1; text-decoration: none; }
.wordmark img { flex: none; }
.top-nav .button { min-height: 40px; padding: 9px 20px; }

/* Showroom d'accueil */
.showroom {
  position: relative;
  display: flex;
  min-height: clamp(400px, 52vh, 560px);
  overflow: hidden;
  background: var(--surface-dark);
  color: var(--on-dark);
}
.showroom-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .6s ease;
}
.showroom-photo.is-active { opacity: 1; animation: showroom-drift 5s ease-out forwards; }
@keyframes showroom-drift { to { transform: scale(1.09); } }
.showroom-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(26, 33, 41, .95) 0%, rgba(26, 33, 41, .55) 38%, rgba(26, 33, 41, 0) 68%),
    linear-gradient(to right, rgba(26, 33, 41, .55) 0%, rgba(26, 33, 41, 0) 60%);
}
.showroom-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 20px;
  padding-block: 32px 16px;
}
.showroom-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.showroom-copy.is-entering > * { animation: showroom-rise .7s cubic-bezier(.2, .7, .2, 1) backwards; }
.showroom-copy.is-entering > :nth-child(2) { animation-delay: .06s; }
.showroom-copy.is-entering > :nth-child(3) { animation-delay: .14s; }
.showroom-copy.is-entering > :nth-child(4) { animation-delay: .22s; }
@keyframes showroom-rise { from { opacity: 0; transform: translateY(18px); } }
.showroom-copy .label { color: var(--on-dark-soft); }
.showroom-copy .display-xl { color: var(--on-dark); }
.showroom-stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 4px 0 0; }
.showroom-stats dd { margin: 0; color: var(--on-dark); font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.showroom-stats dt { color: var(--on-dark-soft); font-size: .75rem; font-weight: 400; letter-spacing: .5px; }
.showroom .mark { color: var(--on-dark); }
.showroom-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.showroom-actions .button-on-dark[aria-pressed="true"] { background: var(--on-dark); color: var(--surface-dark); }
.showroom-controls { display: flex; align-items: center; gap: 24px; }
.showroom-segments { display: flex; flex: 1; gap: 6px; min-width: 0; }
.showroom-segment {
  flex: 1;
  min-width: 0;
  height: 24px;
  border: 0;
  padding: 0;
  background: linear-gradient(rgba(255, 255, 255, .35), rgba(255, 255, 255, .35)) center / 100% 3px no-repeat;
  cursor: pointer;
}
.showroom-fill {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 10.5px;
  background: var(--on-dark);
  transform: scaleX(0);
  transform-origin: left;
}
.showroom-segment.is-done .showroom-fill { transform: none; }
.showroom-segment[aria-current="true"] .showroom-fill { animation: showroom-progress 4s linear forwards; }
@keyframes showroom-progress { to { transform: none; } }
.showroom.is-paused .showroom-fill,
.showroom:has(:focus-visible) .showroom-fill,
body:has(dialog[open]) .showroom-fill { animation-play-state: paused; }
@media (hover: hover) {
  .showroom:hover .showroom-fill { animation-play-state: paused; }
}
.showroom-buttons { display: flex; flex: none; gap: 6px; }
.showroom-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--on-dark);
  font: 400 1rem/1 var(--font);
  cursor: pointer;
}
.showroom-button:hover { background: var(--on-dark); color: var(--surface-dark); }
.showroom :focus-visible { outline-color: var(--on-dark); }
@media (prefers-reduced-motion: reduce) {
  .showroom-photo, .showroom-photo.is-active { animation: none; transform: none; transition: none; }
  .showroom-copy.is-entering > * { animation: none; }
  .showroom-segment[aria-current="true"] .showroom-fill { animation: none; transform: none; }
}

/* Bibliothèque */
.library-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 32px;
}
.count { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.grow { flex: 1 1 280px; }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  padding: 12px 16px;
  background: var(--canvas);
  color: var(--ink);
  font: 300 1rem/1.3 var(--font);
}
input:focus, select:focus { outline: 2px solid var(--ink); outline-offset: -2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 48px; }
.chip {
  border: 1px solid var(--hairline-strong);
  border-radius: 0;
  padding: 8px 14px;
  background: var(--canvas);
  color: var(--ink);
  font: 400 .75rem/1.4 var(--font);
  letter-spacing: .5px;
  cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--canvas); }

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 48px 24px;
}
.model-card { display: flex; flex-direction: column; min-width: 0; }
.model-photo {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  overflow: hidden;
  background: var(--surface-card);
}
.model-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 160px;
  color: var(--muted);
  font-size: .875rem;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface-dark);
  color: var(--on-dark);
  font: 400 .75rem/1.4 var(--font);
  letter-spacing: .5px;
}
.model-photo .badge { position: absolute; top: 0; left: 0; }
.model-body { display: flex; flex: 1; flex-direction: column; gap: 4px; padding-top: 16px; }
.model-body h3 { color: var(--ink); font-size: 1.125rem; font-weight: 700; line-height: 1.4; }
.model-body h3 a { text-decoration: none; }
.model-body p { font-size: .875rem; color: var(--muted); }
.model-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: auto;
  padding-top: 16px;
}
.empty { margin-top: 32px; color: var(--muted); }

.cta-band { padding-block: 80px; background: var(--surface-dark); color: var(--on-dark-soft); }
.cta-band .wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.cta-band .display-md { color: var(--on-dark); }
.cta-band .button { margin-top: 8px; }

/* Fiche */
.detail-hero { background: var(--surface-dark); color: var(--on-dark); }
.detail-title { padding-block: 32px 40px; }
.detail-title .display-xl { margin-top: 8px; color: var(--on-dark); }
.back { color: var(--on-dark-soft); font-size: .875rem; font-weight: 400; text-decoration: none; }
.back:hover { color: var(--on-dark); }
.detail-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }
.detail-eyebrow .label { color: var(--on-dark-soft); }
.detail-eyebrow .badge { background: var(--surface-dark-elevated); }
.stage { max-width: 1440px; margin-inline: auto; background: var(--surface-dark-elevated); }
.stage img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.stage .no-photo { color: var(--on-dark-soft); }
.thumbs-band { background: var(--surface-dark); padding-block: 8px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; }
.thumbs button {
  flex: 0 0 112px;
  aspect-ratio: 16 / 10;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  background: var(--surface-dark-elevated);
  opacity: .6;
  cursor: pointer;
}
.thumbs button:hover, .thumbs button[aria-current="true"] { opacity: 1; }
.thumbs button[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--primary); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.photo-credit { padding-top: 8px; color: var(--on-dark-soft); font-size: .75rem; font-weight: 400; overflow-wrap: anywhere; }

.spec-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-bottom: 1px solid var(--hairline);
}
.spec-cell { padding: 24px 24px 24px 0; }
.spec-value { color: var(--ink); font-size: 1.5rem; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.spec-cell .label { display: block; margin-top: 4px; }

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
}
.summary { max-width: 65ch; margin-top: 16px; }
.summary-source { margin-top: 12px; color: var(--muted); font-size: .875rem; }
.note { margin-bottom: 32px; padding: 16px; border: 1px solid var(--hairline); font-size: .875rem; }
.spec-group + .spec-group { margin-top: 32px; }
.spec-group h3 { margin: 0 0 8px; color: var(--ink); font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.spec-group dl { margin: 0; }
.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}
.spec-row dt { color: var(--muted); }
.spec-row dd { margin: 0; color: var(--ink); font-weight: 400; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.spec-row dd.unknown { color: var(--muted); font-weight: 300; }
.mark { margin-left: 2px; color: var(--accent-text); font-weight: 700; text-decoration: none; cursor: help; }
.legend { margin-top: 16px; color: var(--muted); font-size: .875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 16px 32px; margin-top: 32px; }

.credits { padding-block: 48px; background: var(--surface-soft); font-size: .875rem; }
.credits h2 { margin-bottom: 12px; color: var(--ink); font-size: 1.25rem; font-weight: 700; }
.credits ol { margin: 0; padding-left: 20px; overflow-wrap: anywhere; }

.footer { padding-block: 48px; background: var(--surface-soft); border-top: 1px solid var(--hairline); color: var(--muted); font-size: .875rem; }

dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: 0;
  padding: 32px 24px;
  background: var(--canvas);
  color: var(--body);
}
dialog::backdrop { background: rgba(26, 33, 41, .7); }
dialog h2 { margin-bottom: 12px; }
dialog p { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: .875rem; margin-top: 16px; margin-bottom: 0; }
.hint code { overflow-wrap: anywhere; }
.form-error { color: var(--error); font-weight: 400; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 24px; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-body { grid-template-columns: minmax(0, 1fr); }
  .stage img { aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .section, .cta-band { padding-block: 48px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar .field { flex: 1 1 100%; }
  .top-nav .button { padding-inline: 14px; font-size: .8125rem; }
  .wordmark { font-size: 1.125rem; gap: 8px; }
  .wordmark img { width: 30px; height: 30px; }
  .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .showroom { min-height: 440px; }
  .showroom-stats { gap: 12px 24px; }
  .showroom-stats dd { font-size: 1.25rem; }
  .showroom-controls { gap: 12px; }
  .showroom-button { width: 36px; height: 36px; }
}

/* Recherche avec suggestions */
.suggest-status { margin: 12px 0 0; color: var(--muted); font-size: .875rem; }
.suggestions { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow-y: auto; }
.suggestion {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-top: 1px solid var(--hairline);
  cursor: pointer;
}
.suggestion:hover, .suggestion[aria-selected="true"] { background: var(--surface-soft); }
.suggestion[aria-disabled="true"] { cursor: default; opacity: .55; }
.suggestion-photo { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-soft); }
.suggestion-photo img { width: 100%; height: 100%; object-fit: cover; }
.suggestion strong { display: block; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.suggestion small { display: block; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
dialog { max-height: calc(100dvh - 32px); }
dialog a { color: var(--accent-text); font-weight: 700; }

/* Carte en cours d'ajout */
.pending-photo img { opacity: .55; }
.pending-state { color: var(--accent-text); font-size: .875rem; font-weight: 700; }
.pending-state.failed { color: var(--error); }
.pending-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: auto; padding-top: 16px; }

/* Comparaison */
.text-link[aria-pressed="true"] { color: var(--ink); }
.compare-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  background: var(--surface-dark);
  color: var(--on-dark);
}
.compare-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-block: 10px;
}
.compare-bar-actions { display: flex; gap: 8px; }
.compare-bar .button { min-height: 40px; padding: 9px 20px; }
.compare-bar a[aria-disabled="true"] { background: var(--primary-disabled); color: var(--muted); pointer-events: none; }
body.has-compare-bar { padding-bottom: 72px; }
.compare-head { padding-block: 32px 40px; background: var(--surface-dark); }
.compare-head .display-xl { margin-top: 16px; color: var(--on-dark); }
.compare-scroll { overflow-x: auto; }
.compare-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; }
.compare-table th, .compare-table td {
  padding: 12px 16px 12px 0;
  border-top: 1px solid var(--hairline);
  color: var(--ink);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.compare-table thead th { border-top: 0; vertical-align: bottom; }
.compare-table th[scope="row"] { width: 22%; color: var(--muted); font-weight: 300; }
.compare-table .group th { padding-top: 32px; color: var(--ink); font-size: 1.25rem; font-weight: 700; }
.compare-table td.unknown { color: var(--muted); font-weight: 300; }
.compare-table td.best { color: var(--accent-text); font-weight: 700; }
.compare-car img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 12px; }
.compare-car a { display: block; color: var(--ink); font-size: 1.125rem; font-weight: 700; line-height: 1.3; text-decoration: none; }
.compare-car .text-link { margin-top: 8px; }
.footer-link { display: block; margin-top: 12px; border: 0; padding: 0; background: none; color: var(--muted); font: 400 .875rem/1.4 var(--font); text-decoration: underline; cursor: pointer; }
.compare-table thead td { border: 0; }

/* Photo principale */
.photo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 8px; padding-bottom: 8px; }
.photo-bar .photo-credit { padding-top: 0; min-width: 0; }
.main-photo-state { color: var(--on-dark-soft); font-size: .875rem; font-weight: 400; }
.main-photo-state.failed { color: #ff9a92; }
.main-photo-button { min-height: 40px; padding: 9px 16px; font-size: .8125rem; }

/* Connexion */
.login-view {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 65px);
  padding: 32px 16px;
  overflow: hidden;
  background: var(--surface-dark);
}
.login-photo { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.login-scrim { position: absolute; inset: 0; background: rgba(26, 33, 41, .72); }
.login-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(420px, 100%);
  padding: 32px 24px;
  background: var(--canvas);
}
.login-card .button { width: 100%; }

/* Pied de page et bandeaux */
.viewing-note { padding-block: 12px; background: var(--surface-soft); border-bottom: 1px solid var(--hairline); font-size: .875rem; }
.viewing-note .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }

/* Comptes */
.accounts-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.accounts-table th, .accounts-table td { padding: 12px 16px 12px 0; border-top: 1px solid var(--hairline); color: var(--ink); font-weight: 400; text-align: left; vertical-align: middle; }
.accounts-table thead th { border-top: 0; color: var(--muted); font-size: .8125rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.account-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-top: 16px; }
.account-form .field { flex: 1 1 200px; }
.notice { margin-top: 16px; font-size: .875rem; }
.notice.failed { color: var(--error); }
.suggest-back { margin-top: 12px; }

/* Bascule clair / sombre */
.top-nav-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-soft); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (max-width: 640px) {
  .theme-toggle { width: 36px; height: 36px; }
}
@media (max-width: 400px) {
  .top-nav .button { padding-inline: 10px; font-size: .75rem; }
  .wordmark img { width: 26px; height: 26px; }
}

/* Menu du profil */
.profile-menu { position: relative; }
.profile-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  padding: 0;
  background: var(--surface-dark);
  color: var(--on-dark);
  font: 700 .9375rem/1 var(--font);
  cursor: pointer;
}
.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  border: 1px solid var(--hairline-strong);
  background: var(--canvas);
}
.profile-name {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.profile-dropdown a, .profile-dropdown button {
  display: block;
  width: 100%;
  border: 0;
  padding: 12px 16px;
  background: none;
  color: var(--ink);
  font: 400 .9375rem/1.3 var(--font);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.profile-dropdown a:hover, .profile-dropdown button:hover { background: var(--surface-soft); }
.profile-dropdown button { border-top: 1px solid var(--hairline); }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.profile-facts { margin: 0; }
.profile-form { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.profile-form .button { align-self: flex-start; }
.profile-form .notice { margin-top: 0; }
@media (max-width: 820px) {
  .profile-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .profile-button { width: 36px; height: 36px; }
  .profile-form .button { align-self: stretch; }
}

/* Avatars */
.avatar {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  line-height: 1;
}
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar-initial { background: var(--surface-dark); color: var(--on-dark); font-weight: 700; }
.avatar-emoji { background: var(--surface-soft); font-size: 1.25rem; }
.profile-button { overflow: hidden; padding: 0; background: transparent; }
#profile-initial { display: block; width: 100%; height: 100%; }
.profile-layout { align-items: start; }
.profile-facts { grid-column: 1 / -1; }
.avatar-group { margin: 16px 0 8px; color: var(--muted); font-size: .8125rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, 52px); gap: 8px; }
.avatar-choice {
  width: 52px;
  height: 52px;
  border: 2px solid transparent;
  border-radius: 50%;
  padding: 2px;
  background: none;
  cursor: pointer;
}
.avatar-choice:hover { border-color: var(--hairline-strong); }
.avatar-choice[aria-pressed="true"] { border-color: var(--accent-text); }
.account-name { display: inline-flex; align-items: center; gap: 10px; }
.account-avatar { display: block; flex: none; width: 32px; height: 32px; }

/* Avatars en image */
.avatar-picture { background: var(--surface-soft); }
.avatar-picture img { width: 82%; height: 82%; object-fit: contain; }
.avatar-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--hairline); }
.avatar-logo img { width: 66%; height: 66%; object-fit: contain; }

.app-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; max-width: 65ch; margin-bottom: 48px; }
.app-intro p { color: var(--body); font-size: 1.125rem; line-height: 1.55; }

/* Ajout rapide dans le menu du haut */
.add-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
.add-icon:hover { background: var(--primary-active); }
.add-icon svg { width: 20px; height: 20px; }
@media (max-width: 640px) {
  .add-icon { width: 36px; height: 36px; }
  .app-intro .button { width: 100%; }
}

/* Découvrir */
.app-intro-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 32px 24px; margin-top: 24px; }
.person-card { display: flex; flex-direction: column; min-width: 0; border: 0; padding: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.person-photos { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-card); }
.person-photos img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.person-photos img:first-child { grid-row: 1 / 3; }
.person-photos[data-count="1"] img:first-child { grid-column: 1 / 3; }
.person-photos[data-count="2"] img:nth-child(2) { grid-row: 1 / 3; }
.person-info { display: flex; align-items: center; gap: 12px; padding-top: 12px; }
.person-info strong { display: block; color: var(--ink); font-size: 1.125rem; line-height: 1.3; overflow-wrap: anywhere; }
.person-info small { display: block; color: var(--muted); font-size: .875rem; }
.person-avatar { display: block; flex: none; width: 44px; height: 44px; }
.person-card:hover strong { text-decoration: underline; }
.in-deck { color: var(--muted); font-size: .8125rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

/* Partage du profil */
.profile-sharing { grid-column: 1 / -1; }
.sharing-toggle { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; cursor: pointer; }
.sharing-toggle input { flex: none; width: 20px; min-height: 20px; height: 20px; margin-top: 2px; padding: 0; accent-color: var(--primary); }
