/* Hivy Leads Docs : même palette que l'app (crème chaud + jaune Hivy). */
:root {
  --page: oklch(97.75% .006 85);
  --side: oklch(98.6% .006 85);
  --surface: #fff;
  --sub: oklch(95.5% .008 85);
  --line: oklch(92.5% .008 82);
  --ink: oklch(22% .012 60);
  --ink2: oklch(38% .012 65);
  --muted: oklch(55% .012 70);
  --hy: #f5c842;
  --hy-soft: oklch(95% .06 92);
  --hy-ink: #1a1400;
  --link: oklch(42% .09 75);
  --radius: 12px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --page: #101010; --side: #141414; --surface: #1a1a1a; --sub: #222;
  --line: #2a2a2a; --ink: #f2efe8; --ink2: #cfcac0; --muted: #8f8a80;
  --hy-soft: #2b2510; --link: #f5c842;
  color-scheme: dark;
}
* { box-sizing: border-box }
html { scroll-padding-top: 80px }
body { margin: 0; background: var(--page); color: var(--ink); font: 15px/1.7 var(--font); -webkit-font-smoothing: antialiased }
a { color: var(--link) }

/* Barre du haut */
.top { position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 16px;
  padding: 0 24px 0 24px; background: color-mix(in oklch, var(--page) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line) }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -.01em }
.brand em { font-style: normal; font-weight: 500; color: var(--muted) }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--hy); display: grid; place-items: center }
.logo svg { width: 15px; height: 16px }
.sp { flex: 1 }
.search-btn { display: flex; align-items: center; gap: 8px; width: 260px; height: 36px; padding: 0 10px; margin-left: 24px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer }
.search-btn kbd { margin-left: auto; font: 11px var(--font); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px }
.theme, .burger { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink2); cursor: pointer; display: grid; place-items: center }
.burger { display: none }

/* Mise en page 3 colonnes */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 240px; width: 100% }
.side { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 20px 14px 40px 14px; border-right: 1px solid var(--line) }
.side a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink2); text-decoration: none; font-size: 14px; line-height: 1.4 }
.side a:hover { background: var(--sub); color: var(--ink) }
.side a[aria-current] { background: var(--hy-soft); color: var(--ink); font-weight: 600 }
.nav-sec { margin: 22px 10px 6px; font-size: 12.5px; font-weight: 650; color: var(--ink) }

.doc { padding: 40px 56px 80px; min-width: 0; width: 100%; max-width: 860px; margin: 0 auto }
.crumb { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted) }
h1 { margin: 0; font-size: 34px; line-height: 1.15; letter-spacing: -.025em; font-weight: 700; text-wrap: balance }
.lead { margin: 12px 0 32px; font-size: 17px; color: var(--muted); text-wrap: pretty }
h2 { margin: 44px 0 12px; font-size: 22px; letter-spacing: -.015em; line-height: 1.3 }
h3 { margin: 28px 0 8px; font-size: 17px }
h2 .anchor, h3 .anchor { color: inherit; text-decoration: none }
h2 .anchor:hover::after, h3 .anchor:hover::after { content: " #"; color: var(--muted) }
p, li { color: var(--ink2) }
strong { color: var(--ink) }
ul, ol { padding-left: 22px }
li { margin: 4px 0 }
code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--sub); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px }

table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: table }
th { text-align: left; background: var(--sub); font-weight: 600; color: var(--ink) }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top }
tr:last-child td { border-bottom: 0 }

/* Cartes */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0 8px }
.card { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-decoration: none; transition: border-color .15s, transform .15s }
.card:hover { border-color: var(--hy); transform: translateY(-1px) }
.card strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px }
.card span { display: block; color: var(--muted); font-size: 14px; line-height: 1.5 }

/* Étapes numérotées */
.steps { counter-reset: st; margin: 20px 0; padding-left: 4px }
.steps h4 { counter-increment: st; position: relative; margin: 22px 0 4px; padding-left: 44px; font-size: 15.5px; color: var(--ink) }
.steps h4::before { content: counter(st); position: absolute; left: 0; top: -3px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--hy); color: var(--hy-ink); display: grid; place-items: center; font-size: 13.5px; font-weight: 700 }
.steps p { margin: 0 0 0 44px; padding-bottom: 6px }

/* Encadrés */
.note { margin: 24px 0; padding: 14px 18px; border-radius: var(--radius); background: var(--hy-soft); border: 1px solid color-mix(in oklch, var(--hy) 45%, transparent) }
.note p { margin: 4px 0 }
.note-t { font-weight: 650; color: var(--ink) !important; font-size: 14px }

/* Précédent / suivant */
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line) }
.pn a { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14.5px; background: var(--surface) }
.pn a:hover { border-color: var(--hy) }
.pn span { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted) }
.pn .next { text-align: right }

/* Sommaire */
.toc { position: sticky; top: 60px; height: calc(100vh - 60px); padding: 40px 20px; font-size: 13.5px }
.toc p { margin: 0 0 10px; font-weight: 650; color: var(--ink) }
.toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.4 }
.toc a.on, .toc a:hover { color: var(--ink); border-left-color: var(--hy) }

/* Recherche */
.search { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .35); display: flex; justify-content: center; padding-top: 12vh }
.search[hidden] { display: none }
.search-box { width: min(620px, 92vw); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px rgb(0 0 0 / .2) }
.search input { width: 100%; height: 54px; border: 0; border-bottom: 1px solid var(--line); padding: 0 18px; font: inherit; font-size: 16px; background: transparent; color: var(--ink); outline: none }
#res { padding: 8px }
#res a { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none }
#res a:hover, #res a.on { background: var(--hy-soft) }
#res small { display: block; color: var(--muted); font-size: 12px }
#res strong { display: block; color: var(--ink); font-size: 14.5px }
#res span { display: block; color: var(--ink2); font-size: 13px; line-height: 1.45 }
.empty { padding: 12px; color: var(--muted); margin: 0 }

/* Responsive */
@media (max-width: 1180px) { .layout { grid-template-columns: 250px minmax(0, 1fr) } .toc { display: none } }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr }
  .burger { display: grid }
  .search-btn { width: auto; margin-left: auto } .search-btn kbd { display: none }
  .top { padding: 0 14px; gap: 10px } .top .sp { display: none } .brand em { display: none }
  .side { position: fixed; top: 60px; left: 0; z-index: 15; width: 280px; background: var(--side); transform: translateX(-100%); transition: transform .2s }
  .nav-open .side { transform: none; box-shadow: 0 10px 40px rgb(0 0 0 / .15) }
  .doc { padding: 28px 20px 60px }
  h1 { font-size: 28px }
  .cards { grid-template-columns: 1fr }
  table { display: block; overflow-x: auto }
}
