/* Docs pages (/docs, /developers): the homepage's header and footer (styles.css), then a sticky table of
   contents on the left and one reading column, the layout of our bot's docs (6 Nov 2026), in SUNFIRE's
   colours: square corners like every frame of the site, the pixel font for titles, the fire orange for accents.
   On a phone the contents become a strip of pills stuck to the top. docs.js lights up the section being read.
   Blocks (prefix d-): numbered steps, cards with a pixel icon, key figures, notes, tables, example rows. */
html { scroll-snap-type: none; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.docs-page {
  --panel: #101216;
  --panel-2: #0B0C0F;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --dim: rgba(248, 246, 242, 0.66);
  --faint: rgba(248, 246, 242, 0.45);
  --ember: #FF6B1F;
  --ember-soft: #EF9B41;
  --sun: #F8DB51;
  --warn: #FF5A4E;
  background: var(--canvas);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}
/* on a reading page the header scrolls away instead of sitting over the text (it has no background) */
.docs-page .site-header { position: relative; }
.docs-page a { color: var(--ember-soft); text-decoration: none; }
.docs-page a:hover { text-decoration: underline; }
.docs-page .header-nav a, .docs-page .sheet-nav a, .docs-page .footer-col a, .docs-page .header-cta { text-decoration: none; }
.docs-page .header-nav a[aria-current="page"] { color: var(--sun); }
.docs-page .header-cta { color: #0B0B0C; }
.docs-page .footer-col a { color: var(--text-dim); }
.docs-page .footer-col a:hover { color: #EF9B41; }
.docs-page .sheet-nav a { color: var(--text); }

/* -- the layout: contents on the left, one reading column -- */
.d-shell {
  width: min(1240px, 100% - 2 * var(--gutter));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-top: 32px;
}
.d-main { min-width: 0; max-width: 780px; }
nav.d-side {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 6px;
}
.d-side .grp {
  margin: 26px 0 10px;
  font: 700 11.5px/1.2 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ember);
}
.d-side .grp:first-child { margin-top: 0; }
.d-side a {
  display: block;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--line);
  font-size: 15px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.16s, border-color 0.16s, background-color 0.16s;
}
.d-side a:hover { color: var(--text); border-left-color: var(--line-2); text-decoration: none; }
.d-side a.ici {
  color: var(--text);
  font-weight: 600;
  border-left-color: var(--ember);
  background: linear-gradient(90deg, rgba(255, 107, 31, 0.14), rgba(255, 107, 31, 0));
}
@media (max-width: 980px) {
  .d-shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 8px; }
  .d-main { max-width: none; }
  nav.d-side {
    top: 0;
    z-index: 10;
    max-height: none;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: visible;
    margin: 0 0 8px;
    padding: 12px 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  nav.d-side::-webkit-scrollbar { display: none; }
  .d-side .grp { display: none; }
  .d-side a { flex: 0 0 auto; padding: 7px 14px; border: 1px solid var(--line-2); font-size: 13.5px; white-space: nowrap; }
  .d-side a.ici { border-color: var(--ember); color: var(--sun); background: rgba(255, 107, 31, 0.12); }
  /* a pill takes you to a section that starts below the strip, not under it */
  .docs-page .d-main section { scroll-margin-top: 48px; }
}

/* -- the opening -- */
.d-hero { padding: 24px 0 40px; border-bottom: 1px solid var(--line); }
.d-sur {
  display: block;
  margin: 0 0 12px;
  font: 700 12px/1.2 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sun);
}
.d-hero h1 { margin: 0; font: 400 40px/1.1 var(--font-brand); text-wrap: balance; }
.d-lead { margin: 18px 0 0; max-width: 60ch; font-size: 18px; line-height: 1.6; color: var(--dim); }
/* la date d'une page légale (terms.html, privacy.html), sous son chapeau */
.d-date { margin: 14px 0 0; font: 400 11px/1.4 var(--font-brand); text-transform: uppercase; letter-spacing: .04em; color: var(--dim); }
.d-puces { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; padding: 0; }
.d-puces li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.02);
  font-size: 14px;
  font-weight: 600;
}
/* the chips are a list, but not a bulleted one */
.d-main .d-puces li { margin: 0; padding: 8px 14px; color: var(--text); }
.d-main .d-puces li::before { display: none; }
.d-puces svg, .d-carte > svg, .d-chiffres svg { width: 16px; height: 16px; flex: 0 0 auto; fill: var(--ember); }

/* -- sections -- */
.d-main section { padding-top: 56px; scroll-margin-top: 16px; }
.d-main section + section { margin-top: 8px; border-top: 1px solid var(--line); }
.d-main h2 { margin: 0; font: 400 32px/1.15 var(--font-brand); text-wrap: balance; }
.d-intro { margin: 14px 0 0; max-width: 66ch; font-size: 17px; color: var(--dim); }
.d-main h3 { margin: 32px 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.d-main p { margin: 12px 0 0; max-width: 70ch; color: var(--dim); }
.d-main p b, .d-main li b, .d-main td b { color: var(--text); font-weight: 600; }
.d-main ul { margin: 14px 0 0; padding: 0; list-style: none; max-width: 70ch; }
.d-main ul > li { position: relative; padding-left: 22px; margin-top: 8px; color: var(--dim); }
.d-main ul > li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 7px; height: 7px; background: var(--ember); }
.d-main code, .d-main .mono { font-family: var(--font-mono); font-size: 13.5px; }
.d-main code {
  padding: 1px 6px;
  border: 1px solid rgba(255, 107, 31, 0.24);
  background: rgba(255, 107, 31, 0.08);
  color: #FFB27A;
  white-space: nowrap;
}

/* numbered steps, one card each */
.d-etapes { list-style: none; counter-reset: etape; display: grid; gap: 10px; margin: 22px 0 0; padding: 0; }
.d-etapes > li {
  counter-increment: etape;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 16px;
  padding: 18px 20px 18px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.d-etapes > li::before {
  content: counter(etape);
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--ember);
  color: #0B0B0C;
  font: 400 16px/1 var(--font-brand);
}
.d-etapes > li > b { font-size: 17px; font-weight: 600; color: var(--text); }
.d-etapes > li > span { display: block; margin-top: 4px; font-size: 15.5px; color: var(--dim); }

/* cards with a pixel icon */
.d-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 22px; }
.d-carte { padding: 20px 20px 22px; border: 1px solid var(--line); background: var(--panel); }
.d-carte > svg { width: 24px; height: 24px; display: block; margin-bottom: 14px; }
.d-carte > b { display: block; font-size: 17px; font-weight: 600; color: var(--text); }
.d-main .d-carte > p { margin-top: 6px; font-size: 15px; line-height: 1.6; }

/* key figures */
.d-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 22px; }
.d-chiffres > div { padding: 18px 20px; border: 1px solid var(--line); background: var(--panel-2); }
.d-chiffres b { display: block; font: 400 24px/1.2 var(--font-brand); color: var(--sun); }
.d-chiffres span { display: block; margin-top: 8px; font-size: 14px; line-height: 1.45; color: var(--dim); }

/* notes: a line of fire, not a box */
.d-note { position: relative; margin-top: 22px; padding: 14px 18px 14px 22px; background: linear-gradient(90deg, rgba(255, 107, 31, 0.1), rgba(255, 107, 31, 0.02)); }
.d-note::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--fire); }
.d-note > b { display: block; margin-bottom: 6px; font: 700 11.5px/1.2 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); }
.d-main .d-note p { margin: 0; font-size: 15px; }
.d-main .d-note p + p { margin-top: 8px; }
.d-note.d-attention { background: linear-gradient(90deg, rgba(255, 90, 78, 0.1), rgba(255, 90, 78, 0.02)); }
.d-note.d-attention::before { background: var(--warn); }
.d-note.d-attention > b { color: var(--warn); }
.d-note ul { margin-top: 4px; }

/* tables in a panel */
.d-table { margin-top: 20px; overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
.d-main table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
.d-main th { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; font: 700 11.5px/1.2 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--sun); }
.d-main td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--dim); }
.d-main tr:last-child td { border-bottom: 0; }
.d-main td.k { white-space: nowrap; color: var(--text); font-weight: 600; }
.d-main td code { white-space: normal; overflow-wrap: anywhere; } /* a long value wraps inside its cell */
.d-main td.k.mono { font-weight: 400; color: #FFB27A; }
.d-main .addr { word-break: break-all; }

/* a worked example, line by line */
.d-ex { margin-top: 20px; padding: 4px 20px; border: 1px solid var(--line); background: var(--panel); }
.d-ex .l { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding: 12px 0; font-size: 15px; color: var(--dim); }
.d-ex .l + .l { border-top: 1px solid var(--line); }
.d-ex .l b { flex: 0 0 auto; color: var(--text); font-weight: 600; text-align: right; }
.d-ex .l.feu b { color: var(--ember); }

/* code blocks (API page) */
.d-main pre { margin: 14px 0 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); background: var(--panel); line-height: 1.5; }
.d-main pre code { padding: 0; border: 0; background: none; color: var(--text); white-space: pre; }
.d-route { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.d-verbe { padding: 3px 8px; background: var(--ember); color: #0B0B0C; font: 700 12px/1.2 var(--font-mono); }

@media (max-width: 620px) {
  .d-hero h1 { font-size: 32px; }
  .d-main h2 { font-size: 24px; }
  .d-lead { font-size: 16.5px; }
  .d-main section { padding-top: 44px; }
  .d-etapes > li { grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; padding: 16px; }
  .d-ex .l { flex-direction: column; gap: 4px; }
  .d-ex .l b { text-align: left; }
  /* two-column tables become one card per row */
  .d-main .d-table table, .d-main .d-table thead, .d-main .d-table tbody, .d-main .d-table tr, .d-main .d-table th, .d-main .d-table td { display: block; width: auto; min-width: 0; }
  .d-main .d-table thead { display: none; }
  .d-main .d-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .d-main .d-table tr:last-child { border-bottom: 0; }
  .d-main .d-table td { padding: 0; border: 0; }
  .d-main .d-table td.k { white-space: normal; margin-bottom: 4px; }
}
@media print { .site-header, nav.d-side, .site-footer { display: none; } .d-shell { display: block; } }
