:root {
  color-scheme: light dark;
  --fond: #f4f1ea;
  --surface: #ffffff;
  --surface-2: #f8f6f1;
  --encre: #1d1a16;
  --encre-2: #5b5449;
  --trait: rgba(29, 26, 22, 0.1);
  --trait-fort: rgba(29, 26, 22, 0.32);
  --accent: #4a2fb0;
  --accent-texte: #ffffff;
  --accent-doux: #ebe6fb;
  --or: #9a8433;
  --danger: #b3261e;
  --danger-texte: #ffffff;
  --danger-doux: #fbe8e6;
  --ok: #1d6a3b;
  --ok-doux: #e3f3e8;
  --verre: rgba(244, 241, 234, 0.72);
  --ombre: 0 1px 2px rgba(29, 26, 22, 0.05), 0 12px 32px -16px rgba(29, 26, 22, 0.22);
  --rayon: 1.25rem;
  --rayon-petit: 0.8rem;
  --marge: clamp(1rem, 4vw, 2rem);
}
@media screen and (prefers-color-scheme: dark) {
  :root {
    --fond: #121110;
    --surface: #1d1b18;
    --surface-2: #26231f;
    --encre: #f4f0e9;
    --encre-2: #bcb4a7;
    --trait: rgba(244, 240, 233, 0.1);
    --trait-fort: rgba(244, 240, 233, 0.34);
    --accent: #b9a8ff;
    --accent-texte: #15121f;
    --accent-doux: #2c2550;
    --or: #d4bd62;
    --danger: #ff8f84;
    --danger-texte: #2a0f0c;
    --danger-doux: #3d1f1c;
    --ok: #8fd8a7;
    --ok-doux: #17311f;
    --verre: rgba(18, 17, 16, 0.7);
    --ombre: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 16px 40px -20px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 9rem; }
@media (min-width: 48rem) { html { scroll-padding-top: 6.5rem; } }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--encre);
  background:
    radial-gradient(60rem 32rem at 12% -12rem, color-mix(in srgb, var(--or) 18%, transparent), transparent 70%),
    radial-gradient(48rem 28rem at 105% -6rem, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    var(--fond);
  background-repeat: no-repeat;
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.003em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 0.4rem; }
.evitement { position: absolute; left: -9999px; }
.evitement:focus { left: 1rem; top: 1rem; z-index: 20; background: var(--surface); padding: 0.6rem 1rem; border-radius: var(--rayon-petit); box-shadow: var(--ombre); }
.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.bandeau {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: max(0.6rem, env(safe-area-inset-top)) max(var(--marge), env(safe-area-inset-right)) 0.6rem max(var(--marge), env(safe-area-inset-left));
  background: var(--verre);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--trait);
}
.marque img { display: block; width: 3.25rem; height: auto; border-radius: 0.7rem; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.bandeau nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--marge)); padding: 0 var(--marge); }
.bandeau nav::-webkit-scrollbar { display: none; }
.bandeau nav ul { display: flex; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.bandeau nav a {
  display: block;
  white-space: nowrap;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  color: var(--encre);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 150ms ease;
}
.bandeau nav a:hover { background: var(--trait); }
.bandeau nav a[aria-current="page"] { background: var(--accent-doux); color: var(--accent); }
.qui { margin: 0 0 0 auto; color: var(--encre-2); font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
.bandeau form { margin: 0; }
@media (min-width: 48rem) {
  .bandeau { flex-wrap: nowrap; }
  .bandeau nav { order: 0; flex-basis: auto; margin: 0; padding: 0; }
}

main {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) max(var(--marge), env(safe-area-inset-right)) 3rem max(var(--marge), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 1;
}
.public main { max-width: 27rem; }
.public.large main { max-width: 46rem; }
.public .bandeau { justify-content: center; background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; position: static; padding-top: max(2rem, env(safe-area-inset-top)); }
.public .marque img { width: 6rem; border-radius: 1.1rem; box-shadow: var(--ombre); }

h1 {
  margin: 0;
  font-size: clamp(1.85rem, 1.35rem + 2.2vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 700;
  text-wrap: balance;
}
.public h1 { text-align: center; }
h2 { margin: 0 0 0.85rem; font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.012em; font-weight: 650; text-wrap: balance; }
p { margin: 0; }
.texte { hyphens: auto; text-wrap: pretty; }

.carte {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  box-shadow: var(--ombre);
}
.pile { display: flex; flex-direction: column; gap: 1rem; }
.etroit { max-width: 26rem; }
.public .etroit { max-width: none; }
.rangee { display: grid; gap: 1rem; align-items: end; }
@media (min-width: 52rem) { .rangee { grid-template-columns: 1fr 1fr 1.2fr auto auto; } }
.cotes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); align-items: end; }
.ajout > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.95rem; padding: 0.35rem 0; }
.ajout[open] > summary { margin-bottom: 0.75rem; }

.champ { display: flex; flex-direction: column; gap: 0.35rem; }
label, legend { font-weight: 600; font-size: 0.95rem; }
input, select, textarea {
  font: inherit;
  font-size: max(1rem, 16px);
  color: var(--encre);
  background: var(--surface-2);
  border: 1px solid var(--trait-fort);
  border-radius: var(--rayon-petit);
  padding: 0.65rem 0.85rem;
  min-height: 2.9rem;
  width: 100%;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent); border-radius: var(--rayon-petit); }
input[type="search"] { -webkit-appearance: none; appearance: none; }
textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
input[type="file"] { padding: 0.4rem; cursor: pointer; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 0.45rem 1rem; margin-right: 0.75rem; background: var(--accent-doux); color: var(--accent); cursor: pointer; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 0.35rem; }
.case { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.35rem 0; }
.case input { width: 1.4rem; height: 1.4rem; min-height: 0; margin: 0.1rem 0 0; padding: 0; flex-shrink: 0; accent-color: var(--accent); }
.case label { font-weight: 400; font-size: 1rem; }

.bouton, .bouton-doux, .bouton-danger, .bouton-danger-doux {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  min-height: 2.9rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 100ms ease-out, background-color 150ms ease, filter 150ms ease;
}
.bouton { background: var(--accent); color: var(--accent-texte); }
.bouton-doux { background: var(--accent-doux); color: var(--accent); }
.bouton-danger { background: var(--danger); color: var(--danger-texte); }
.bouton-danger-doux { background: var(--danger-doux); color: var(--danger); }
.bouton:active, .bouton-doux:active, .bouton-danger:active, .bouton-danger-doux:active { transform: scale(0.97); }
@media (hover: hover) {
  .bouton:hover, .bouton-danger:hover { filter: brightness(1.08); }
  .bouton-doux:hover, .bouton-danger-doux:hover { filter: brightness(0.97); }
}
.bandeau .bouton-doux { min-height: 2.5rem; padding: 0.45rem 1rem; font-size: 0.95rem; }

.message { padding: 0.85rem 1.1rem; border-radius: var(--rayon-petit); font-weight: 600; border: 1px solid transparent; }
.message.erreur { color: var(--danger); background: var(--danger-doux); }
.message.ok { color: var(--ok); background: var(--ok-doux); }

.liste { margin: 0; }
.liste div { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0; border-top: 1px solid var(--trait); }
.liste div:first-child { border-top: 0; padding-top: 0; }
.liste div:last-child { padding-bottom: 0; }
@media (min-width: 40rem) { .liste div { flex-direction: row; gap: 1.25rem; } .liste dt { width: 12rem; flex-shrink: 0; } }
.liste dt { color: var(--encre-2); font-size: 0.95rem; }
.liste dd { margin: 0; overflow-wrap: anywhere; }

.filtre { margin-bottom: 1rem; }
.comptes { list-style: none; margin: 0; padding: 0; }
.comptes li { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.95rem 0; border-top: 1px solid var(--trait); }
.comptes li:first-child { border-top: 0; padding-top: 0; }
.comptes li[hidden] { display: none; }
@media (min-width: 52rem) { .comptes li { flex-direction: row; flex-wrap: wrap; align-items: flex-start; } .qui-compte { flex: 1 1 18rem; } }
.nom { font-weight: 650; letter-spacing: -0.005em; }
.barre { text-decoration: line-through; color: var(--encre-2); }
.discret { color: var(--encre-2); font-size: 0.95rem; font-weight: 400; }
.gerer { flex: 0 1 auto; }
.gerer > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.6rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: var(--accent-doux);
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 100ms ease-out;
}
.gerer > summary::-webkit-details-marker { display: none; }
.gerer > summary::after { content: ""; width: 0.45rem; height: 0.45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-0.12rem) rotate(45deg); transition: transform 200ms ease; }
.gerer[open] > summary::after { transform: translateY(0.1rem) rotate(-135deg); }
.gerer > summary:active { transform: scale(0.97); }
.gerer[open] { flex-basis: 100%; }
.gestes { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.gestes form { margin: 0; }
.gestes .bouton-doux, .gestes .bouton-danger-doux { min-height: 2.6rem; padding: 0.5rem 1rem; font-size: 0.95rem; }
.comptes li > .message { flex-basis: 100%; }
.depot { margin-top: 0.9rem; }
.retraits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.retraits li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.6rem 0; border-top: 1px solid var(--trait); overflow-wrap: anywhere; }
.retraits li > :first-child { flex: 1 1 10rem; }
.retraits form { margin: 0; flex-shrink: 0; }
.retraits .bouton-danger-doux { min-height: 2.6rem; padding: 0.5rem 1rem; font-size: 0.95rem; }
.portrait { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 1rem; }
.montre { flex-basis: 100%; display: flex; flex-direction: column; gap: 0.5rem; background: var(--accent-doux); border-radius: var(--rayon-petit); padding: 1rem; }
.code { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.code code { font: 600 1.15rem/1.3 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.04em; background: var(--surface); padding: 0.35rem 0.7rem; border-radius: 0.5rem; }
.annonce { margin: 0; font: inherit; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--trait); border-radius: var(--rayon-petit); padding: 0.9rem 1rem; }
.presence { border-top: 1px solid var(--trait); padding-top: 0.6rem; }
.journal p { margin: 0; }
.journal .somme { white-space: nowrap; font-variant-numeric: tabular-nums; }
.journal li > .discret { flex-shrink: 0; }
.journal .bouton-doux { min-height: 2.6rem; padding: 0.5rem 1rem; font-size: 0.95rem; }
.presence legend { float: left; width: 100%; overflow-wrap: anywhere; }
.presence legend + * { clear: both; }

.tuiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.chiffre { font-size: 2.2rem; line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.texte ul, .simple { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.45rem; }
.texte p + p, .texte p + ul, .texte ul + p { margin-top: 0.7rem; }
.photo { border-radius: var(--rayon-petit); height: auto; max-width: 100%; }
.trombi { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.fiche { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1rem; box-shadow: var(--ombre); }
.fiche > div { flex: 1 1 9rem; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.fiche img, .initiales { width: 5.5rem; height: 5.5rem; flex-shrink: 0; border-radius: 50%; object-fit: cover; }
.initiales { display: grid; place-items: center; background: var(--accent-doux); color: var(--accent); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em; }
.coordonnees { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; overflow-wrap: anywhere; }
.competences > summary { cursor: pointer; color: var(--accent); font-size: 0.95rem; font-weight: 600; }
.competences ul { margin-top: 0.5rem; font-size: 0.95rem; color: var(--encre-2); overflow-wrap: anywhere; }
.fiches .fiche { break-inside: avoid; }
.fiches .fiche img { width: 7rem; height: auto; border-radius: var(--rayon-petit); }

.pile > h2 { margin-bottom: 0; }
h3 { margin: 0; font-size: 1.1rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }

.pied {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 var(--marge) max(2rem, env(safe-area-inset-bottom));
  font-size: 0.9rem;
  color: var(--encre-2);
}
.public .pied { text-align: center; }
.pied a { color: var(--encre-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .bouton:active, .bouton-doux:active, .bouton-danger:active, .bouton-danger-doux:active, .gerer > summary:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .bandeau { background: var(--fond); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --trait: var(--trait-fort); }
  .bouton-doux, .bouton-danger-doux, .gerer > summary { border-color: currentColor; }
  .carte { box-shadow: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .bandeau { background: var(--fond); }
}
@media print {
  .bandeau nav, .bandeau form, .qui, .pied, .gerer, .gestes { display: none; }
  .bandeau { position: static; }
  body { background: #fff; }
  .carte, .fiche { box-shadow: none; }
}
