/* Guide illustré « Relier votre propre nom de domaine » (/aide/nom-de-domaine, src/guide/nom-de-domaine.ts).
   Chargée après style.css, legal.css et guide.css, dont elle reprend la colonne de lecture, le sommaire collant, le
   panneau sable, les captures et les encadrés. Charte design/CHARTE.md : thème clair, jetons de style.css seulement
   (aucune couleur ajoutée, aucun vert), rayons 14 et 24 px, grille de 8 px. Lisible sur téléphone (360 px). */

/* ---------- Texte courant ---------- */
.nd-guide .nd-code, .nd-guide code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; font-size: .92em;
  background: var(--cream); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; display: inline-block; max-width: 100%; white-space: nowrap; overflow-x: auto; vertical-align: bottom;
}
.nd-guide h3 { font-size: 1.125rem; margin: 0 0 10px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.nd-guide section[id], .nd-guide li[id] { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.nd-sub {
  margin: 20px 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--soft);
}

/* ---------- Ce que ça change : quatre points ---------- */
.legal > ul.nd-benefits {
  max-width: none; list-style: none; padding: 0; margin: 0 0 8px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px;
}
.nd-benefits li {
  margin: 0; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--ochre);
  border-radius: var(--r-field); padding: 16px 20px; box-shadow: var(--shadow-1);
}
.nd-benefits p { margin: 0; }
.nd-benefits p + p { margin-top: 6px; color: var(--soft); line-height: 1.55; }
.nd-benefits__title { font-weight: 700; color: var(--ink); }

/* ---------- Les trois étapes ---------- */
.legal > ol.nd-steps { max-width: none; list-style: none; padding: 0; margin: 0; }
.nd-step {
  margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
  padding: 24px; box-shadow: var(--shadow-1);
}
.nd-step > p { max-width: 72ch; }
.nd-step .guide-figure { margin: 20px 0 8px; max-width: 720px; }

/* ---------- Valeurs à copier ---------- */
.nd-copy {
  display: grid; gap: 0; margin: 16px 0; max-width: 640px;
  background: var(--cream); border: 1px solid var(--line); border-radius: var(--r-field); overflow: hidden;
}
.nd-copy__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 12px 16px; }
.nd-copy__row + .nd-copy__row { border-top: 1px solid var(--line); }
.nd-copy__label { font-size: .875rem; font-weight: 600; color: var(--soft); }
.nd-copy__cell { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.nd-guide .nd-copy__value {
  font-size: 1.0625rem; font-weight: 700; color: var(--ink); background: var(--surface); border-color: #cfc3ab; padding: 4px 10px;
  white-space: nowrap; max-width: 100%; overflow-x: auto;
}
.nd-copy__btn { flex: none; }

/* ---------- Fournisseurs ---------- */
.legal > ul.nd-chips { max-width: none; list-style: none; padding: 0; margin: 8px 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.nd-chips li { margin: 0; }
.nd-chips a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-field);
  color: var(--ink); font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.nd-chips a:hover { border-color: var(--ember); color: var(--ember-d); }

.nd-provider { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 24px; }
.nd-provider > ul, .nd-provider > ol, .nd-provider > p { max-width: 72ch; }
.nd-path__label { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.nd-guide ol.nd-path { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; max-width: none; }
.nd-path li { margin: 0; padding: 0; display: inline-flex; align-items: center; font-size: .9rem; font-weight: 600; color: var(--ink); }
.nd-path li:not(:last-child)::after { content: "›"; margin: 0 8px; color: var(--faint); font-weight: 700; }
.nd-provider__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 32px; align-items: start; }
.nd-provider__text > ol { padding-left: 24px; margin: 0 0 8px; }
.nd-provider__text > ol > li { margin: 6px 0; }
.nd-sources { font-size: .9rem; }
.nd-lang { color: var(--soft); font-size: .85em; }

/* Schéma d'un formulaire : cadre pointillé dessiné dans le SVG lui-même. */
.nd-schema { margin: 16px 0; max-width: 440px; }
.nd-schema__svg { display: block; width: 100%; height: auto; }
.nd-schema figcaption { margin-top: 8px; font-size: .8125rem; line-height: 1.5; color: var(--soft); }
.nd-schema--general { margin-top: 24px; }


/* ---------- Ça ne marche pas ? ---------- */
.nd-trouble table { min-width: 0; }
.nd-trouble td { vertical-align: top; }
.nd-trouble td:first-child { font-weight: 400; min-width: 0; width: 46%; }
.nd-status {
  display: inline-block; margin: 0 0 6px; padding: 2px 10px; border-radius: 999px;
  background: var(--info-bg); color: var(--info); font-size: .8125rem; font-weight: 700;
}
.nd-msg { display: block; color: var(--ink); font-style: italic; line-height: 1.5; }

/* ---------- Téléphone ---------- */
@media (max-width: 640px) {
  .nd-step { padding: 16px; border-radius: var(--r-field); }
  .nd-copy__row { padding: 10px 12px; }
  .nd-trouble table, .nd-trouble thead, .nd-trouble tbody, .nd-trouble tr, .nd-trouble td { display: block; width: auto; }
  .nd-trouble thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nd-trouble tr { padding: 12px 14px; border-top: 1px solid var(--line); }
  .nd-trouble tr:first-child { border-top: 0; }
  .nd-trouble td, .nd-trouble td:first-child { padding: 0; border: 0; width: auto; min-width: 0; }
  .nd-trouble td + td { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .nd-chips a { transition: none; }
}

/* ---------- Impression et enregistrement en PDF ---------- */
@media print {
  .nd-chips, .nd-copy__btn { display: none !important; }
  .nd-step { border: 0; box-shadow: none; padding: 0; margin-bottom: 14pt; }
  .nd-benefits li { box-shadow: none; break-inside: avoid; }
  .nd-copy { break-inside: avoid; background: none; }
  .nd-schema, .nd-figure { break-inside: avoid; }
  .nd-figure { max-width: 70%; }
  .nd-schema { max-width: 60%; }
  .nd-provider { break-before: auto; }
  .nd-provider h3, .nd-sub, .nd-path__label { break-after: avoid; }
  .nd-provider__grid { display: block; }
  .nd-trouble tr { break-inside: avoid; }
  .nd-status { border: 1px solid currentColor; background: none; }
  .nd-page .legal-toc__list a { display: inline; min-height: 0; }
  .nd-page .legal-toc__list li + li { margin-top: 2pt; }
  /* Sur papier, l'adresse des pages officielles doit se lire. */
  .nd-sources a::after { content: " : " attr(href); font-weight: 400; font-size: 8pt; overflow-wrap: anywhere; }
}
