:root {
  --bg: #faf6f1;
  --card: #ffffff;
  --ink: #2b2a27;
  --muted: #7a756c;
  --line: #ebe4da;
  --green: #5f7f52;
  --green-soft: #e6eedf;
  --coral: #e8734f;
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 Nunito, system-ui, sans-serif;
}

h1, h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; line-height: 1.2; margin: 0; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Hero */
.cover { height: 240px; background: var(--green-soft) center/cover; }
.hero-body { display: flex; gap: 20px; align-items: flex-start; margin-top: -56px; }
.hero-body > div { padding-top: 70px; }
.avatar {
  width: 128px; height: 128px; flex: none; border-radius: 50%;
  border: 5px solid var(--bg); object-fit: cover; background: var(--green-soft);
}
.hero-body > div { min-width: 0; }
.hero h1 { font-size: clamp(1.4rem, 4vw, 2rem); overflow-wrap: anywhere; }
.meta { margin: 6px 0 0; color: var(--muted); }

.intro { margin: 28px 0 20px; max-width: 62ch; }
.intro p { margin: 0 0 12px; }

.demo {
  margin-top: 20px;
  background: #fff4d6; border: 1px solid #f0dca0; border-radius: 12px;
  padding: 10px 14px; font-size: .9rem;
}

/* Onglets */
.tabs { margin-top: 24px; display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 12px 14px; cursor: pointer; white-space: nowrap;
  font: inherit; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--green); }

/* Cartes */
.toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; color: var(--muted); font-size: .9rem; }
.toolbar #count { margin-right: auto; font-weight: 700; }
.toolbar select { font: inherit; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; cursor: pointer; }
.check input { width: auto; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; padding-bottom: 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.item { display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(43, 42, 39, .08); }
.item .photo { position: relative; aspect-ratio: 1; background: #fff; }
.item .photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.item .photo img.contain { object-fit: contain; padding: 12px; }
.item.taken .photo img { opacity: .45; }
.badge {
  position: absolute; top: 12px; left: 12px; background: var(--green); color: #fff;
  font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge.static { position: static; display: inline-block; }
.details {
  position: absolute; right: 10px; bottom: 10px; background: #fff; border-radius: 10px;
  padding: 6px 12px; font-weight: 700; font-size: .85rem; box-shadow: 0 2px 8px rgba(43, 42, 39, .15);
}
.item .body { padding: 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; border-top: 1px solid var(--line); }
.brand { color: var(--coral); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.item h3 {
  margin: 0; font-size: .95rem; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price { font-family: Fraunces, Georgia, serif; font-size: 1.1rem; margin-top: auto; padding-top: 4px; }
.price.big { font-size: 1.6rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.progress { height: 8px; border-radius: 999px; background: var(--green-soft); overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 6px;
  border-radius: 999px; padding: 10px 18px; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; border: 1.5px solid transparent;
}
.btn.primary { background: var(--coral); color: #fff; }
.btn.primary:hover, .btn.green:hover { filter: brightness(.95); }
.btn.green { background: var(--green); color: #fff; }
.btn small { display: block; font-weight: 600; opacity: .85; font-size: .8rem; }
.stack { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.stack .btn { flex-direction: column; gap: 0; }
.btn.inline { display: inline; padding: 0; font-size: inherit; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.link { padding: 4px; color: var(--muted); font-weight: 600; font-size: .9rem; background: none; text-decoration: underline; }
.btn:disabled { opacity: .5; cursor: default; }

/* Virement */
.bank { padding: 24px; max-width: 640px; margin-bottom: 64px; }
.bank h2 { font-size: 1.4rem; margin-bottom: 8px; }
.rows { margin: 20px 0; display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: 12px; padding: 10px 14px; }
.row div { flex: 1; min-width: 0; }
.row small { display: block; color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.row span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.row .btn { padding: 6px 14px; font-size: .85rem; }
.qr { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 20px; }
.qr img { width: 160px; height: 160px; border-radius: 8px; }
.qr p { flex: 1; min-width: 200px; margin: 0; color: var(--muted); }

/* Fenêtre */
dialog {
  border: 0; border-radius: var(--radius); padding: 28px 24px 24px; color: var(--ink);
  width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
}
dialog.wide { width: min(900px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(43, 42, 39, .5); }
dialog h2 { font-size: 1.4rem; }
.close {
  position: absolute; top: 10px; right: 10px; z-index: 1; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--bg); font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.gallery .main { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 60px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; }
.thumbs button.on { border-color: var(--green); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }
.info p { margin: 4px 0; }
.dialog-item { font-weight: 700; margin: 8px 0 0; }
label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 14px; }
input, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); resize: vertical;
}
input:focus, textarea:focus { outline: 2px solid var(--green); border-color: transparent; }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.error { color: #b3261e; font-size: .9rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  max-width: calc(100vw - 32px); z-index: 10;
}

@media (max-width: 560px) {
  .cover { height: 160px; }
  .hero-body { flex-direction: column; gap: 10px; }
  .hero-body > div { padding-top: 0; }
  .avatar { width: 104px; height: 104px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail { grid-template-columns: 1fr; gap: 16px; }
}
