/* ============================================================
   CAMDOG — feuille de style (noir & or, responsive)
   ============================================================ */
:root {
  --black: #0d0d0d; --ink: #1c1c1c; --gold: #c9a227; --gold-d: #a8841a; --gold-l: #f3e3a6;
  --green: #1d7a46; --green-l: #e5f5ec; --red: #b42318; --red-l: #fdecea; --amber: #a15c07; --amber-l: #fef3c7;
  --g50: #f8f8f6; --g100: #efefeb; --g200: #e2e2dc; --g300: #cfcfc6; --g500: #75756c; --g700: #3f3f39;
  --radius: 14px; --shadow: 0 6px 24px rgba(0,0,0,.08); --shadow-l: 0 16px 40px rgba(0,0,0,.18);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--ink); line-height: 1.55;
  background: linear-gradient(rgba(248,247,243,.90), rgba(248,247,243,.93)), url('/assets/img/fond.jpg') center top / cover no-repeat;
  min-height: 100vh; display: flex; flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; overflow-wrap: anywhere; }
p { margin: 0 0 .75rem; }
.main { flex: 1; width: 100%; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.page { padding-top: 2rem; padding-bottom: 3rem; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--g500); }
.small { font-size: .85rem; }
.big-emoji { font-size: 3rem; }
.hide { display: none !important; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .65rem 1.15rem; border-radius: 10px;
  font-weight: 700; font-size: .92rem; border: 2px solid transparent; cursor: pointer; white-space: nowrap; font-family: inherit;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: linear-gradient(180deg, #d9b33a, var(--gold-d)); color: #111; box-shadow: 0 4px 14px rgba(201,162,39,.35); }
.btn-dark { background: var(--black); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--g300); }
.btn-green { background: var(--green); color: #fff; }
.btn-wa { background: #25d366; color: #fff; }
.btn-red { background: #fff; color: var(--red); border-color: #f2b8b5; }
.btn-sm { padding: .4rem .75rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }

/* ---------- Annonce, alertes ---------- */
.announce { background: var(--black); color: var(--gold-l); text-align: center; font-size: .85rem; font-weight: 600; padding: .5rem 1rem; }
.flash-wrap:empty { display: none; }
.flash-wrap { padding-top: 1rem; }
.alert { padding: .8rem 1rem; border-radius: 10px; margin-bottom: .75rem; font-size: .92rem; border: 1px solid; }
.alert-ok { background: var(--green-l); color: #14532d; border-color: #b7e4c7; }
.alert-error { background: var(--red-l); color: #8a1c1c; border-color: #f5c2c0; }
.alert-info { background: #eef4ff; color: #1e3a8a; border-color: #c7d7fe; }
.alert-warn { background: var(--amber-l); color: #78350f; border-color: #fcd98b; }

/* ---------- En-tête ---------- */
.hdr { position: sticky; top: 0; z-index: 100; background: var(--black); color: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.35); }
.hdr-bar { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .55rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.brand img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 1px rgba(201,162,39,.6); }
.brand span { font-weight: 900; font-size: 1.2rem; letter-spacing: .06em; color: var(--gold); }
.brand small { display: block; font-size: .65rem; letter-spacing: .14em; color: #bfb38a; font-weight: 600; text-transform: uppercase; }
.brand-light span { color: var(--gold); }
.nav { flex: 1; display: flex; justify-content: center; align-items: center; gap: .15rem; min-width: 0; }
.nav > a, .dd-btn { padding: .5rem .7rem; border-radius: 8px; font-size: .87rem; font-weight: 600; color: #e9e6da; background: none; border: 0; cursor: pointer; font-family: inherit; white-space: nowrap; }
.nav > a:hover, .dd-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav > a.is-active { color: var(--black); background: var(--gold); }
.dd { position: relative; }
.dd-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; z-index: 120; background: #fff; color: var(--ink);
  border-radius: 12px; box-shadow: var(--shadow-l); overflow: hidden; padding: .3rem 0;
}
.dd:focus-within .dd-menu, .dd:hover .dd-menu { display: block; }
.dd-menu a { display: block; padding: .6rem 1rem; font-size: .9rem; font-weight: 500; }
.dd-menu a:hover, .dd-menu a.is-active { background: var(--gold-l); }
.dd-menu .strong { font-weight: 800; }
.dd-menu .danger, .drawer .danger { color: var(--red); }
.dd-right { left: auto; right: 0; }
.hdr-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.hdr-actions .btn-ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.user-btn { display: flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); color: #fff; padding: .25rem .7rem .25rem .25rem; border-radius: 999px; cursor: pointer; font-family: inherit; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: #111; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bell { position: relative; font-size: 1.15rem; padding: .3rem; }
.bell b { position: absolute; top: -2px; right: -4px; background: var(--red); color: #fff; font-size: .65rem; border-radius: 999px; padding: 0 .35rem; }
.burger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); flex-direction: column; align-items: center; justify-content: center; gap: 5px; cursor: pointer; }
.burger span { width: 20px; height: 2px; background: #fff; border-radius: 2px; }
.drawer, .drawer-overlay { display: none; }
.menu-toggle:checked ~ .drawer-overlay { display: block; position: fixed; inset: 0; z-index: 190; background: rgba(0,0,0,.5); }
.menu-toggle:checked ~ .drawer { display: block; position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 360px); z-index: 200; background: #fff; overflow-y: auto; padding: 1rem 1rem 2rem; box-shadow: var(--shadow-l); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(100%); } to { transform: none; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.drawer-close { width: 40px; height: 40px; border-radius: 10px; background: var(--g100); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.drawer-auth { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.drawer-user { display: flex; gap: .7rem; align-items: center; background: var(--gold-l); border-radius: 12px; padding: .7rem; margin-bottom: 1rem; }
.drawer-user div { display: flex; flex-direction: column; min-width: 0; }
.drawer-user small { color: var(--g500); overflow-wrap: anywhere; }
.drawer nav a { display: block; padding: .75rem .6rem; border-radius: 10px; font-weight: 600; }
.drawer nav a.is-active { background: var(--gold-l); }
.drawer-acc { border-top: 1px solid var(--g200); margin-top: .75rem; padding-top: .75rem; }
@media (max-width: 1100px) { .nav { display: none; } .burger { display: flex; } }
@media (max-width: 640px) { .hide-sm { display: none !important; } .user-name { display: none; } .user-btn { padding: .2rem; } .brand span { font-size: 1.05rem; } .brand img { width: 38px; height: 38px; } }

/* ---------- Pied de page ---------- */
.ftr { background: var(--black); color: #cfcab8; margin-top: 3rem; padding: 2.5rem 0 5.5rem; }
.ftr-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; }
.ftr h4 { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin-bottom: .8rem; }
.ftr a { display: block; padding: .2rem 0; font-size: .9rem; }
.ftr a:hover { color: var(--gold); }
.ftr p { font-size: .88rem; margin-top: .8rem; }
.wa-text { color: #4ade80 !important; font-weight: 700; }
.ftr-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; border-top: 1px solid #2a2a2a; margin-top: 2rem; padding-top: 1rem; font-size: .8rem; color: #8d8a7e; }
@media (max-width: 860px) { .ftr-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .ftr-grid { grid-template-columns: 1fr; } }
.wa-float { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 90; width: 58px; height: 58px; border-radius: 50%; background: #25d366; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(37,211,102,.45); }

/* ---------- Cartes et grilles ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,.04); }
.pad { padding: clamp(1.1rem, 4vw, 2rem); }
.grid { display: grid; gap: 1.1rem; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.page-title { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 900; }
.page-sub { color: var(--g500); margin-bottom: 1.5rem; }
.section-title { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-d); border-bottom: 2px solid var(--gold-l); padding-bottom: .45rem; margin: 1.6rem 0 1rem; }
.section-title:first-child { margin-top: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.dog-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.dog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-l); }
.dog-card-img { position: relative; aspect-ratio: 4 / 3; background: #111; }
.dog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.badge-cert { position: absolute; top: .5rem; left: .5rem; background: var(--gold); color: #111; font-size: .72rem; font-weight: 800; padding: .2rem .55rem; border-radius: 999px; }
.dog-card-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.dog-card-body small { color: var(--g500); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--gold-d); }

.item-card { overflow: hidden; display: flex; flex-direction: column; }
.item-card .thumb { aspect-ratio: 16 / 10; background: #111; }
.item-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-card .body { padding: 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.item-card .price { font-weight: 900; font-size: 1.1rem; color: var(--gold-d); }

.pill { display: inline-block; font-size: .74rem; font-weight: 700; padding: .22rem .6rem; border-radius: 999px; background: var(--g100); color: var(--g700); white-space: nowrap; }
.pill-ok { background: var(--green-l); color: #14532d; }
.pill-warn { background: var(--amber-l); color: var(--amber); }
.pill-bad { background: var(--red-l); color: var(--red); }
.pill-gold { background: var(--gold-l); color: #6b5310; }

/* ---------- Accueil ---------- */
.hero { position: relative; color: #fff; background: url('/assets/img/fond.jpg') center / cover; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.7) 50%, rgba(0,0,0,.35) 100%); }
.hero-in { position: relative; padding: clamp(2.5rem, 8vw, 5.5rem) 1.25rem; max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr .7fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 900; letter-spacing: .02em; color: var(--gold); margin-bottom: .2rem; }
.hero .tag { font-size: clamp(1.05rem, 3.5vw, 1.35rem); font-weight: 600; margin-bottom: .8rem; }
.hero p { color: #e2ddc9; max-width: 560px; }
.hero-logo { width: min(100%, 300px); justify-self: center; border-radius: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 2px rgba(201,162,39,.5); }
.hero-search { display: flex; gap: .5rem; background: #fff; padding: .45rem; border-radius: 14px; margin: 1.3rem 0 1rem; max-width: 620px; }
.hero-search input, .hero-search select { border: 0 !important; box-shadow: none !important; }
.hero-search input { flex: 1; min-width: 0; }
.hero-btns { display: flex; gap: .6rem; flex-wrap: wrap; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.kicker { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; color: var(--gold-l); border: 1px solid rgba(201,162,39,.6); padding: .3rem .8rem; border-radius: 999px; margin-bottom: 1rem; }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; } .hero-logo { width: 160px; justify-self: start; order: -1; } }
@media (max-width: 560px) { .hero-search { flex-direction: column; } .hero-search .btn { width: 100%; } }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: -2.2rem; position: relative; }
.tile { padding: 1.2rem; display: flex; flex-direction: column; gap: .25rem; transition: transform .15s; }
.tile:hover { transform: translateY(-3px); }
.tile .ico { font-size: 1.8rem; }
.tile strong { font-size: 1rem; }
.tile small { color: var(--g500); }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat { text-align: center; padding: 1.2rem .5rem; }
.stat strong { display: block; font-size: 2rem; font-weight: 900; color: var(--gold-d); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pillars { background: var(--black); color: #fff; border-radius: var(--radius); padding: 2rem 1.25rem; text-align: center; }
.pillars h2 { color: var(--gold); }
.pillars .grid { margin-top: 1.25rem; }
.pillars div div strong { color: var(--gold-l); display: block; font-size: 1.05rem; }
.pillars small { color: #bdb8a6; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field label, .lbl { font-size: .84rem; font-weight: 700; color: var(--g700); }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--g300); border-radius: 10px; background: #fff; font: inherit; font-size: .95rem; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.2); }
.hint { font-size: .8rem; color: var(--g500); }
.check { display: flex; gap: .55rem; align-items: center; font-weight: 600; font-size: .92rem; }
.check input { width: 18px; height: 18px; accent-color: var(--gold-d); }
@media (max-width: 768px) { input, select, textarea { font-size: 16px !important; } }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: .6rem; margin-bottom: 1.25rem; }
@media (max-width: 860px) { .filters { grid-template-columns: 1fr 1fr; } .filters > :first-child { grid-column: 1 / -1; } }
.breed-info { background: var(--gold-l); border-radius: 10px; padding: .75rem 1rem; font-size: .86rem; display: grid; gap: .2rem; }

/* Photos (téléversement) */
.uploader { border: 2px dashed var(--gold); border-radius: 14px; padding: 1rem; background: #fffdf5; }
.uploader input[type=file] { width: 100%; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .6rem; margin-top: .75rem; }
.previews figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #111; }
.previews img { width: 100%; height: 100%; object-fit: cover; }
.previews figcaption { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; padding: .2rem .35rem; display: flex; justify-content: space-between; align-items: center; gap: .3rem; }
.previews figcaption label { display: flex; gap: .2rem; align-items: center; cursor: pointer; }

/* Généalogie */
.ped-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 640px) { .ped-grid { grid-template-columns: 1fr; } }
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; background: #fff; border: 1px solid var(--g200); border-radius: 10px; box-shadow: var(--shadow-l); overflow: hidden; }
.ac-list .head { font-size: .72rem; color: var(--g500); padding: .4rem .75rem; background: var(--g50); }
.ac-list button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: .55rem .75rem; border-top: 1px solid var(--g100); cursor: pointer; font: inherit; font-size: .88rem; }
.ac-list button:hover { background: var(--gold-l); }
.ac-list small { color: var(--g500); }
.ac-linked { font-size: .72rem; font-weight: 800; color: var(--green); }
details.more summary { cursor: pointer; font-weight: 700; color: var(--gold-d); padding: .3rem 0; }
.tree { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)); gap: .5rem; overflow-x: auto; }
.tree-col { display: flex; flex-direction: column; justify-content: space-around; gap: .45rem; }
.tree-cell { border: 1px solid var(--g200); border-radius: 10px; padding: .45rem .65rem; background: #fff; font-size: .85rem; }
.tree-cell small { display: block; font-size: .66rem; color: var(--g500); text-transform: uppercase; letter-spacing: .03em; }
.tree-cell.m { border-left: 4px solid #3b82f6; } .tree-cell.f { border-left: 4px solid #ec4899; }
.tree-cell a { font-weight: 800; color: var(--gold-d); }
@media (max-width: 640px) { .tree { grid-template-columns: 1fr 1fr; } .tree-col.g3 { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; } }

/* ---------- Fiche chien / élevage ---------- */
.detail { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.gallery-main { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: #111; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .5rem; overflow-x: auto; }
.gallery-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.gallery-thumbs img:hover { border-color: var(--gold); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; }
.info-grid div small { display: block; font-size: .72rem; color: var(--g500); text-transform: uppercase; letter-spacing: .03em; }
.info-grid div strong { font-size: .95rem; overflow-wrap: anywhere; }
.kennel-box { display: flex; gap: .9rem; align-items: center; }
.kennel-box img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #111; flex-shrink: 0; }
.badges { display: flex; gap: .4rem; flex-wrap: wrap; margin: .4rem 0 .8rem; }
.qr { width: 150px; height: 150px; }

/* ---------- Tableaux / listes ---------- */
.list { display: flex; flex-direction: column; gap: .75rem; }
.row-card { padding: 1rem; display: flex; gap: .9rem; align-items: flex-start; }
.row-card .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: #111; flex-shrink: 0; }
.row-card .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.row-card small { color: var(--g500); overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.actions form { display: inline; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--g500); }
.pager { display: flex; gap: .35rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.pager a, .pager span { min-width: 38px; padding: .45rem .7rem; border-radius: 8px; text-align: center; background: #fff; border: 1px solid var(--g200); font-weight: 700; }
.pager span { background: var(--black); color: var(--gold); }
.tabs { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; padding-bottom: .3rem; }
.tabs a { flex-shrink: 0; padding: .5rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--g200); font-weight: 700; font-size: .85rem; }
.tabs a.is-active { background: var(--black); color: var(--gold); border-color: var(--black); }

/* ---------- Espace usager ---------- */
.dash { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.dash-nav { display: flex; flex-direction: column; gap: .2rem; padding: .7rem; position: sticky; top: 80px; }
.dash-nav a { padding: .6rem .8rem; border-radius: 10px; font-weight: 600; font-size: .92rem; display: flex; justify-content: space-between; }
.dash-nav a.is-active { background: var(--black); color: var(--gold); }
.dash-nav a b { background: var(--red); color: #fff; font-size: .7rem; border-radius: 999px; padding: .05rem .45rem; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } .dash-nav { position: static; flex-direction: row; overflow-x: auto; } .dash-nav a { flex-shrink: 0; } }

/* ---------- Administration ---------- */
.admin-body { background: #f3f2ee; }
.atop { position: sticky; top: 0; z-index: 60; background: var(--black); display: flex; justify-content: space-between; align-items: center; padding: .55rem 1.25rem; }
.atop-act { display: flex; gap: .5rem; align-items: center; }
.atop-act a { color: #e9e6da; font-size: .85rem; font-weight: 600; padding: .45rem .75rem; border-radius: 8px; }
.atop-out { background: rgba(255,255,255,.1); }
.abody { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.aside { background: #fff; border-right: 1px solid var(--g200); padding: 1rem .7rem; display: flex; flex-direction: column; gap: .2rem; position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; }
.aside a { display: flex; gap: .6rem; padding: .65rem .8rem; border-radius: 10px; font-weight: 600; font-size: .92rem; }
.aside a:hover { background: var(--g100); }
.aside a.is-active { background: var(--black); color: var(--gold); }
.amain { padding: 1.5rem clamp(1rem, 3vw, 2rem) 3rem; min-width: 0; }
.atitle { font-size: clamp(1.3rem, 4vw, 1.7rem); font-weight: 900; margin-bottom: 1.2rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .8rem; margin-bottom: 1.25rem; }
.kpi { padding: 1rem; display: flex; flex-direction: column; gap: .2rem; }
.kpi strong { font-size: 1.8rem; font-weight: 900; color: var(--gold-d); line-height: 1; }
.kpi span { font-size: .8rem; color: var(--g500); }
.kpi.ok strong { color: var(--green); } .kpi.warn strong { color: var(--amber); } .kpi.bad strong { color: var(--red); }
@media (max-width: 900px) {
  .abody { grid-template-columns: 1fr; }
  .aside { position: sticky; top: 56px; z-index: 50; height: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--g200); padding: .5rem; }
  .aside a { flex-shrink: 0; white-space: nowrap; border: 1px solid var(--g200); border-radius: 999px; padding: .45rem .8rem; font-size: .82rem; }
}

/* ---------- Certificat ---------- */
.cert { background: #fff; border: 4px double var(--gold-d); border-radius: 12px; padding: clamp(1.25rem, 5vw, 2.5rem); max-width: 820px; margin: 0 auto; }
.cert-head { display: flex; gap: 1rem; align-items: center; border-bottom: 2px solid var(--gold-l); padding-bottom: 1rem; }
.cert-head img { width: 72px; height: 72px; border-radius: 12px; }
.cert h2 { text-align: center; font-size: clamp(1.3rem, 5vw, 1.9rem); color: var(--gold-d); margin-top: 1rem; }
.cert table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.cert th, .cert td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--g100); font-size: .92rem; }
.cert th { width: 40%; color: var(--g500); font-weight: 600; }
@media print { .hdr, .ftr, .wa-float, .noprint, .announce { display: none !important; } body { background: #fff !important; } }


/* ============================================================
   Mise à jour 11 — photos entières (jamais coupées), responsive, rapidité
   ============================================================ */
/* Les photos s'adaptent au cadre SANS être rognées : on voit toujours tout le chien */
.dog-card-img, .item-card .thumb, .gallery-main, .previews figure {
  background: radial-gradient(circle at center, #2a2a2a 0%, #0d0d0d 100%);
}
.dog-card-img img, .item-card .thumb img, .gallery-main img, .previews img {
  width: 100%; height: 100%; object-fit: contain; object-position: center;
}
.gallery-main { aspect-ratio: 4 / 3; max-height: 72vh; }
.row-card .thumb, .kennel-box img, .gallery-thumbs img { object-fit: contain; background: #111; }
.dog-card-img, .item-card .thumb { aspect-ratio: 1 / 1; }

/* Rapidité : le navigateur ne dessine que ce qui est visible */
.dog-card, .item-card, .row-card { content-visibility: auto; contain-intrinsic-size: 320px; }
.ftr { content-visibility: auto; contain-intrinsic-size: 400px; }

/* Responsive : rien ne déborde, tout se réorganise sur téléphone */
.card, .grow, .field, .detail > *, .dash > *, .amain > * { min-width: 0; }
code, small, strong, a { overflow-wrap: anywhere; }
.actions > form, .actions > a, .actions > button { max-width: 100%; }
.actions form[style*="display:flex"] { flex-wrap: wrap; }
.actions select, .actions input[type=text] { max-width: 100%; }
@media (max-width: 640px) {
  .wrap { padding: 0 .85rem; }
  .page { padding-top: 1.1rem; padding-bottom: 2rem; }
  .pad { padding: 1rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .btn { width: 100%; }
  .grid { gap: .8rem; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dog-card-body, .item-card .body { padding: .65rem .7rem .8rem; }
  .dog-card-body strong, .item-card .body strong { font-size: .92rem; }
  .dog-card-body small, .item-card .body small { font-size: .76rem; }
  .item-card .price { font-size: .98rem; }
  .info-grid { grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
  .row-card { padding: .8rem; gap: .7rem; }
  .row-card .thumb { width: 56px; height: 56px; }
  .actions .btn { flex: 1 1 auto; }
  .filters { grid-template-columns: 1fr !important; }
  .filters > :first-child { grid-column: auto; }
  .hero-in { padding: 2rem .85rem 3.2rem; gap: 1.2rem; }
  .hero-search select { max-width: none !important; }
  .tiles { gap: .6rem; margin-top: -1.8rem; }
  .tile { padding: .9rem; }
  .tile .ico { font-size: 1.5rem; }
  .tile small { display: none; }
  .stat strong { font-size: 1.6rem; }
  .page-title { font-size: 1.45rem; }
  .gallery-thumbs img { width: 60px; height: 60px; }
  .wa-float { width: 52px; height: 52px; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .cert th { width: auto; display: block; padding-bottom: 0; border: 0; }
  .cert td { display: block; padding-top: .1rem; }
  .ped-grid { gap: .6rem; }
}
@media (max-width: 380px) {
  .cards { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .brand span { display: none; }
}
@media (min-width: 641px) and (max-width: 1100px) {
  .detail { grid-template-columns: 1fr; }
  .gallery-main { max-height: 60vh; }
}

/* Avertissement avant déconnexion automatique */
.idle-warn { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 300;
  width: min(92vw, 420px); background: var(--black); color: #fff; border: 1px solid var(--gold); border-radius: 14px; padding: 1rem;
  box-shadow: var(--shadow-l); display: flex; flex-direction: column; gap: .4rem; }
.idle-warn strong { color: var(--gold); }
.idle-warn span { font-size: .88rem; color: #ddd; }

/* ============================================================
   Mise à jour 13 — pedigree, certificats A4, portées
   ============================================================ */
.ped-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ped { border-collapse: separate; border-spacing: 6px; width: 100%; min-width: 820px; table-layout: fixed; }
.ped td { padding: 0; vertical-align: middle; }
.ped td.ped-root { width: 22%; }
.pc { display: flex; gap: .5rem; align-items: center; background: #fff; border: 1px solid var(--g200); border-left-width: 4px; border-radius: 10px; padding: .35rem; min-height: 54px; height: 100%; }
.pc-m { border-left-color: #3b82f6; } .pc-f { border-left-color: #ec4899; }
.pc img, .pc-ph { width: 44px; height: 44px; flex-shrink: 0; border-radius: 8px; object-fit: contain; background: #111; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.pc-t { display: flex; flex-direction: column; min-width: 0; font-size: .8rem; line-height: 1.25; }
.pc-t strong { overflow-wrap: anywhere; }
.pc-t small { font-size: .66rem; color: var(--g500); overflow-wrap: anywhere; }
.pc-t .pc-title { color: var(--gold-d); font-weight: 700; }
.pc-t a { color: var(--gold-d); }
.pc-empty { justify-content: center; color: var(--g300); }
.pc-root { border-width: 2px; border-color: var(--gold); background: var(--gold-l); }
.pc-root img, .pc-root .pc-ph { width: 64px; height: 64px; }

/* Certificat officiel (feuille A4) */
.sheet { position: relative; background: #fff; max-width: 210mm; margin: 0 auto; padding: clamp(1rem, 4vw, 14mm); border: 3px double var(--gold-d); box-shadow: var(--shadow); }
.sheet-kennel { border-color: #111; }
.sheet-land { max-width: 297mm; }
.sheet-head { display: flex; gap: 1rem; align-items: center; border-bottom: 2px solid var(--gold-l); padding-bottom: .8rem; }
.sheet-head img { width: 76px; height: 76px; object-fit: contain; border-radius: 12px; background: #111; flex-shrink: 0; }
.sheet-head div { display: flex; flex-direction: column; min-width: 0; }
.sheet-head small { color: var(--g500); overflow-wrap: anywhere; }
.sheet-brand { font-size: 1.35rem; letter-spacing: .04em; color: var(--gold-d); overflow-wrap: anywhere; }
.sheet-kennel .sheet-brand { color: #111; }
.sheet-title { text-align: center; font-size: clamp(1.3rem, 5vw, 1.9rem); letter-spacing: .05em; text-transform: uppercase; margin: 1rem 0 .2rem; }
.sheet-sub { margin-bottom: .6rem; }
.sheet-body { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 1.2rem; align-items: start; margin-top: .8rem; }
.sheet-body:not(:has(.sheet-photo)) { grid-template-columns: 1fr; }
.sheet-photo { width: 100%; aspect-ratio: 1; object-fit: contain; background: #111; border-radius: 12px; border: 2px solid var(--gold); }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th, .sheet-table td { text-align: left; padding: .42rem .5rem; border-bottom: 1px solid var(--g100); font-size: .92rem; vertical-align: top; }
.sheet-table th { width: 40%; color: var(--g500); font-weight: 600; }
.sheet-cond { margin-top: 1rem; padding: .8rem; border: 1px dashed var(--g300); border-radius: 10px; font-size: .9rem; }
.sheet-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.2rem; align-items: end; margin-top: 1.6rem; }
.sig { display: flex; flex-direction: column; gap: .15rem; text-align: center; font-size: .82rem; }
.sig-box { height: 72px; border-bottom: 1.5px solid #333; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; }
.sig-box img { max-height: 66px; max-width: 100%; object-fit: contain; }
.sig-name { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.5rem; color: #222; }
.sig small { color: var(--g500); }
.seal { border: 2px solid var(--green); color: var(--green); border-radius: 12px; padding: .55rem .4rem; font-size: .76rem; font-weight: 700; line-height: 1.5; }
.seal b { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; }
.sig-qr img { width: 92px; height: 92px; margin: 0 auto; }
.sheet-note { text-align: center; font-size: .7rem; color: var(--g500); margin: 1rem 0 0; overflow-wrap: anywhere; }
.sheet-void { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-size: clamp(1.3rem, 6vw, 2.5rem); font-weight: 900; color: rgba(180, 35, 24, .32); transform: rotate(-16deg); pointer-events: none; z-index: 2; }
@media (max-width: 640px) {
  .sheet-body { grid-template-columns: 1fr; }
  .sheet-photo { max-width: 200px; margin: 0 auto; }
  .sheet-table th, .sheet-table td { display: block; width: auto; border: 0; padding: .1rem .2rem; }
  .sheet-table tr { display: block; border-bottom: 1px solid var(--g100); padding: .3rem 0; }
  .sheet-head img { width: 56px; height: 56px; }
}
@page { size: A4; margin: 10mm; }
@page land { size: A4 landscape; margin: 8mm; }
@media print {
  .sheet { box-shadow: none; max-width: none; padding: 6mm; }
  .sheet-land, .ped-wrap { page: land; }
  .main { padding: 0; }
  .wrap.page { padding: 0; max-width: none; }
  .ped { min-width: 0; }
  .ped-wrap { overflow: visible; }
  .card { box-shadow: none; border: 0; }
}

/* Statistiques du vendeur */
.bars { display: flex; align-items: flex-end; gap: .35rem; height: 190px; overflow-x: auto; padding-bottom: .2rem; }
.bar-col { flex: 1 0 34px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .1rem; min-width: 34px; }
.bar-pair { display: flex; align-items: flex-end; gap: 3px; height: 130px; width: 100%; justify-content: center; }
.bar { display: block; width: 45%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 0; }
.bar-v { background: var(--gold); } .bar-o { background: var(--green); }
.bar-col small { font-size: .66rem; color: var(--g500); } .bar-col b { font-size: .75rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: .2rem; }
.dot-v { background: var(--gold); } .dot-o { background: var(--green); }

/* ============================================================
   Mise à jour 21 — accueil épuré : logo une seule fois, bloc Chiots | Chiens
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hero-in { grid-template-columns: 300px minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.hero-logo { width: 100%; max-width: 300px; justify-self: center; order: 0; border-radius: 24px; }
.hero-text { min-width: 0; }
.hero-lead { font-size: clamp(1.7rem, 5vw, 2.8rem); font-weight: 900; line-height: 1.15; color: #fff; margin: 0 0 .6rem; }
.hero-lead span { color: var(--gold); display: block; }
.hero-sub { color: #e2ddc9; font-size: 1.02rem; max-width: 560px; margin-bottom: 0; }
.hero-search { flex-direction: row !important; align-items: center; }
.hero-search select { max-width: 200px; }
.hero-search .btn { width: auto !important; flex-shrink: 0; }
.hero-btns .btn { flex: 1 1 0; max-width: 260px; }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; gap: 1.2rem; text-align: center; padding-top: 1.6rem; padding-bottom: 3.4rem; }
  .hero-logo { width: 150px; justify-self: center; order: 0; border-radius: 18px; }
  .hero-sub { margin: 0 auto; }
  .hero-search { margin: 1.1rem auto .9rem; }
  .hero-btns { justify-content: center; }
}
@media (max-width: 560px) {
  .hero-lead { font-size: 1.6rem; }
  .hero-sub { font-size: .95rem; }
  .hero-btns .btn { max-width: none; padding: .75rem .6rem; }
  .hero-in { padding-bottom: 3rem; }
}

/* Bloc « Chiots | Chiens » côte à côte */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; margin-top: 2rem; }
.panel { padding: 1.1rem 1.1rem .6rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; border-bottom: 2px solid var(--gold-l); padding-bottom: .55rem; margin-bottom: .35rem; }
.panel-head h2 { font-size: 1.15rem; margin: 0; }
.panel-head a { font-size: .85rem; font-weight: 700; color: var(--gold-d); white-space: nowrap; }
.mini { display: flex; gap: .8rem; align-items: center; padding: .6rem .2rem; border-bottom: 1px solid var(--g100); border-radius: 10px; }
.mini:last-child { border-bottom: 0; }
.mini:hover { background: var(--g50); }
.mini img { width: 70px; height: 70px; flex-shrink: 0; border-radius: 12px; object-fit: contain; background: radial-gradient(circle, #2a2a2a, #0d0d0d); }
.mini-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.mini-t strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-t small { font-size: .78rem; color: var(--g500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-p { font-size: .82rem; color: var(--gold-d); white-space: nowrap; flex-shrink: 0; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }

.show-sm { display: none; }
.mini-price { color: var(--gold-d) !important; font-weight: 800; }
@media (max-width: 560px) { .show-sm { display: block; } .mini-p { display: none; } .mini img { width: 62px; height: 62px; } }

/* Barres horizontales (sources, appareils) */
.hbar { position: relative; display: flex; justify-content: space-between; gap: .6rem; padding: .45rem .6rem; margin-bottom: .35rem; border-radius: 8px; background: var(--g50); overflow: hidden; font-size: .88rem; }
.hbar span, .hbar b { position: relative; z-index: 1; }
.hbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--gold-l); z-index: 0; }

/* Vidéos intégrées (replays, dressage, conseils) */
.video-box { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; margin: .6rem 0; }
.video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Application installée (Android / iPhone) */
@media (display-mode: standalone) { .hdr { padding-top: env(safe-area-inset-top); } .atop { padding-top: calc(.55rem + env(safe-area-inset-top)); } }
.install-bar { position: fixed; left: .75rem; right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); z-index: 95; background: var(--black); color: #fff; border: 1px solid var(--gold);
  border-radius: 16px; padding: .8rem .9rem; display: flex; gap: .7rem; align-items: center; box-shadow: var(--shadow-l); max-width: 520px; margin: 0 auto; }
.install-bar img { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; }
.install-bar div { flex: 1; min-width: 0; font-size: .85rem; line-height: 1.35; }
.install-bar strong { color: var(--gold); display: block; font-size: .95rem; }
.install-bar .x { background: none; border: 0; color: #aaa; font-size: 1.3rem; cursor: pointer; padding: .2rem; }

/* Certificats : filigrane CAMDOG et rubriques */
.sheet { overflow: hidden; }
.sheet > *:not(.sheet-wm):not(.sheet-void) { position: relative; z-index: 1; }
.sheet-wm { position: absolute !important; z-index: 0 !important; left: 50%; top: 50%; width: 72%; max-width: 560px; transform: translate(-50%, -50%); opacity: .08; pointer-events: none; }
.sheet-land .sheet-wm { width: 46%; }
.sheet-table th.sheet-group { color: var(--gold-d); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; padding-top: .9rem; border-bottom: 2px solid var(--gold-l); width: auto; }
@media print { .sheet-wm { opacity: .08; } }

/* Impression A4 : une seule page, rien ne déborde */
.print-only { display: none; }
@page { size: A4 portrait; margin: 10mm; }
@page land { size: A4 landscape; margin: 8mm; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; }
  .hdr, .ftr, .announce, .flash-wrap, .drawer, .drawer-overlay, .wa-float, .install-bar, .idle-warn, .noprint, .dash-nav, .atop, .aside { display: none !important; }
  .main, .wrap, .page, .dash, .dash > div, .amain { padding: 0 !important; margin: 0 !important; max-width: none !important; display: block !important; }
  .a4-fit { margin: 0 !important; box-shadow: none !important; break-inside: avoid; page-break-inside: avoid; overflow: hidden; }
  .a4-land { page: land; }
  .print-only { display: flex; }
  .ped-print-head { gap: 12px; align-items: center; margin-bottom: 8px; }
  .ped-print-head img { width: 56px; height: 56px; border-radius: 10px; }
  .ped-print-head div { display: flex; flex-direction: column; }
  .ped-print-head strong { font-size: 18px; color: #a8841a; }
  .a4-fit .ped { min-width: 0 !important; }
  .a4-fit .ped-wrap { overflow: visible !important; }
}

/* ============================================================
   Certificats et pedigrees : une page A4 exacte, présentation officielle
   ============================================================ */
.cert-page { max-width: 1180px; }
.a4-wrap { width: 100%; overflow: hidden; }
.a4 { position: relative; box-sizing: border-box; background: #fff; color: #1c1c1c; margin: 0 auto; overflow: hidden; transform-origin: top left;
  box-shadow: 0 10px 40px rgba(0,0,0,.18); font-family: "Segoe UI", Arial, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.a4-portrait { width: 210mm; height: 297mm; padding: 15mm 15mm 0; }
.a4-land { width: 297mm; height: 210mm; padding: 9mm 12mm 0; }
.a4-frame { position: absolute; inset: 6mm; border: 1.4mm double #c9a227; pointer-events: none; }
.a4-frame::after { content: ""; position: absolute; inset: 1.6mm; border: .25mm solid #e7d48e; }
.tpl-kennel .a4-frame { border-color: #1a1a1a; }
.a4-frame .cn { position: absolute; width: 7mm; height: 7mm; background: #fff; border: .6mm solid #c9a227; transform: rotate(45deg); }
.a4-frame .cn::after { content: ""; position: absolute; inset: 1.3mm; background: #c9a227; }
.a4-frame .tl { top: -4mm; left: -4mm; } .a4-frame .tr { top: -4mm; right: -4mm; } .a4-frame .bl { bottom: -4mm; left: -4mm; } .a4-frame .br { bottom: -4mm; right: -4mm; }
.a4-wm { position: absolute; left: 50%; top: 52%; width: 64%; transform: translate(-50%, -50%); opacity: .07; pointer-events: none; z-index: 0; }
.a4-land .a4-wm { width: 40%; }
.a4 > *:not(.a4-wm):not(.a4-frame):not(.a4-void) { position: relative; z-index: 1; }
.a4-void { position: absolute; z-index: 3; top: 45%; left: 0; right: 0; text-align: center; font-size: 22pt; font-weight: 900; color: rgba(180,35,24,.3); transform: rotate(-16deg); }

.c-head { display: flex; align-items: center; gap: 4.5mm; padding-bottom: 3.5mm; border-bottom: .4mm solid #e7d48e; }
.c-logo { width: 22mm; height: 22mm; object-fit: contain; background: #111; border-radius: 3mm; flex-shrink: 0; }
.c-org { display: flex; flex-direction: column; min-width: 0; }
.c-org strong { font-size: 15pt; letter-spacing: .08em; color: #a8841a; line-height: 1.15; }
.tpl-kennel .c-org strong { color: #111; }
.c-org small { font-size: 8pt; color: #666; }
.c-ref { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
.c-ref span { font-size: 7pt; color: #888; text-transform: uppercase; letter-spacing: .08em; }
.c-ref b { font-family: Consolas, monospace; font-size: 9pt; color: #a8841a; margin: .5mm 0; }
.c-title { text-align: center; margin: 6mm 0 5mm; }
.c-kicker { font-size: 7.5pt; letter-spacing: .35em; color: #a8841a; font-weight: 700; }
.c-title h1 { font-family: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif; font-size: 23pt; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 1.5mm 0 2mm; color: #111; }
.c-attest { font-family: Georgia, serif; font-style: italic; font-size: 9.5pt; color: #555; max-width: 150mm; margin: 0 auto; line-height: 1.45; }
.c-dog { display: grid; grid-template-columns: 50mm 1fr; gap: 6mm; align-items: start; }
.c-photo img { width: 50mm; height: 50mm; object-fit: contain; background: #111; border: .8mm solid #c9a227; border-radius: 3mm; }
.cbox { border: .35mm solid #e2d4a0; border-radius: 3mm; padding: 2.6mm 4mm 2mm; background: rgba(255, 253, 245, .88); break-inside: avoid; }
.cbox h4 { margin: 0 0 1.6mm; font-size: 7.5pt; text-transform: uppercase; letter-spacing: .14em; color: #a8841a; border-bottom: .3mm solid #efe3b8; padding-bottom: 1.4mm; }
.cf { display: flex; justify-content: space-between; gap: 3mm; font-size: 9pt; padding: 1mm 0; border-bottom: .2mm dotted #e4dcc4; }
.cf:last-child { border-bottom: 0; }
.cf span { color: #777; flex-shrink: 0; }
.cf b { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.c-two { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; margin-top: 5mm; }
.cbox-wide { margin-top: 5mm; }
.c-sale { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; align-items: center; }
.c-price b { font-size: 14pt; color: #a8841a; }
.c-cond { font-size: 8.3pt; color: #444; margin: 2mm 0 0; line-height: 1.4; }
.c-foot { position: absolute !important; left: 15mm; right: 15mm; bottom: 17mm; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6mm; align-items: end; }
.c-sig { text-align: center; font-size: 8.3pt; display: flex; flex-direction: column; gap: .6mm; }
.c-sig-box { height: 17mm; border-bottom: .35mm solid #333; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 1mm; }
.c-sig-box img { max-height: 15mm; max-width: 100%; object-fit: contain; }
.c-sig-name { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 17pt; color: #222; }
.c-sig small, .c-seal small, .c-qr small { color: #777; font-size: 7pt; }
.c-seal { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5mm; }
.c-seal svg { width: 25mm; height: 25mm; }
.c-seal b { font-family: Consolas, monospace; font-size: 7.5pt; letter-spacing: .04em; }
.c-qr { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5mm; }
.c-qr .qr-local svg { width: 25mm; height: 25mm; }
.c-bottom { position: absolute !important; left: 0; right: 0; bottom: 9.5mm; text-align: center; font-size: 6.8pt; color: #8a8576; margin: 0; }

/* Pedigree A4 paysage */
.a4-land .c-head { padding-bottom: 2.5mm; }
.a4-land .c-logo { width: 15mm; height: 15mm; }
.a4-land .c-title { position: absolute !important; top: 9.5mm; left: 0; right: 0; margin: 0; pointer-events: none; }
.a4-land .c-title h1 { font-size: 17pt; margin: .5mm 0 0; }
.a4-land .c-attest { display: none; }
.c-pedtop { display: flex; gap: 4mm; align-items: center; margin-top: 2.5mm; }
.c-photo-sm { width: 17mm; height: 17mm; object-fit: contain; background: #111; border: .6mm solid #c9a227; border-radius: 2.5mm; flex-shrink: 0; }
.cgrid3 { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 5mm; }
.a4-land .cf { font-size: 8pt; padding: .55mm 0; }
.c-tree { position: absolute !important; left: 10mm; right: 10mm; top: 46mm; bottom: 38mm; }
.c-tree svg { width: 100%; height: 100%; display: block; }
.a4-land .c-foot { left: 14mm; right: 14mm; bottom: 12.5mm; gap: 10mm; }
.a4-land .c-sig-box { height: 11mm; }
.a4-land .c-seal svg, .a4-land .c-qr .qr-local svg { width: 18mm; height: 18mm; }
.a4-land .c-bottom { bottom: 7mm; }

/* Pedigree interactif (page publique) */
.ped-live .c-tree { top: 42mm; bottom: 14mm; }

@page certp { size: A4 portrait; margin: 0; }
@page certl { size: A4 landscape; margin: 0; }
@media print {
  html, body { background: #fff !important; margin: 0 !important; }
  .flash-wrap, .install-bar, .idle-warn, .announce { display: none !important; }
  .cert-page { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .a4-wrap { height: auto !important; overflow: visible !important; }
  .a4 { transform: none !important; box-shadow: none !important; margin: 0 !important; }
  .a4-portrait { page: certp; height: 296.5mm; }
  .a4-land { page: certl; height: 209.5mm; }
}

/* --- Retouches certificats (v2) --- */
.a4-wm { opacity: .12; }
.a4-land .a4-wm { width: 48%; opacity: .14; }
.a4-land { display: flex; flex-direction: column; padding: 9mm 12mm 7mm; }
.a4-land .c-pedtop { display: grid; grid-template-columns: 19mm 1.75fr 1fr; gap: 3.5mm; align-items: stretch; margin-top: 2.5mm; }
.a4-land .c-pedtop .cbox { padding: 1.8mm 3mm 1.2mm; }
.a4-land .c-pedtop .cbox h4 { margin-bottom: 1mm; padding-bottom: .8mm; font-size: 6.8pt; }
.c-photo-sm { width: 19mm; height: 100%; min-height: 19mm; background: #111; border: .6mm solid #c9a227; border-radius: 2.5mm; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.c-photo-sm img { width: 100%; height: 100%; object-fit: contain; }
.cgrid2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 5mm; }
.a4-land .cf { font-size: 7.6pt; padding: .45mm 0; }
.a4-land .c-tree { position: relative !important; left: auto; right: auto; top: auto; bottom: auto; flex: 1 1 auto; min-height: 0; margin: 2mm -2mm 1mm; }
.a4-land .c-foot { position: relative !important; left: auto; right: auto; bottom: auto; flex: none; margin: 0 6mm; }
.a4-land .c-bottom { position: relative !important; bottom: auto; flex: none; margin-top: 1.2mm; }
.ped-live .c-tree { top: auto; bottom: auto; }
/* Vérification */
.kv { display: grid; gap: .5rem; margin: .8rem 0; }
.kv > div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .8rem; background: var(--cream, #faf6ec); border-radius: 10px; }
.kv span { color: var(--muted, #777); font-size: .9rem; }
.kv b { text-align: right; }
.a4-land .c-title { position: static !important; margin: 1.2mm 0 0; }
.a4-land .c-kicker { display: none; }
.a4-land .c-title h1 { font-size: 15pt; margin: 0; }
.a4-land .c-org strong { font-size: 12.5pt; }
.a4-land .c-sig-box { height: 9mm; }
.a4-land .c-seal svg, .a4-land .c-qr .qr-local svg { width: 15mm; height: 15mm; }

/* Photo du père / de la mère dans le formulaire de généalogie */
.ped-parent { display: flex; gap: .8rem; align-items: flex-start; }
.ped-parent > .field { flex: 1; min-width: 0; }
.ped-photo { display: flex; flex-direction: column; align-items: center; gap: .25rem; flex-shrink: 0; padding-top: 1.3rem; }
.ped-ph { width: 78px; height: 78px; border-radius: 50%; border: 3px solid var(--gold); background: #141414; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.ped-ph img { width: 100%; height: 100%; object-fit: cover; }
.ped-ph-empty { color: var(--gold); font-size: 1.5rem; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.ped-ph-empty small { font-size: .65rem; margin-top: .2rem; color: #ddd; }
.ped-photo .small { font-size: .75rem; }
.ped-photo { width: 92px; text-align: center; }
