/* Page /api-deci — compléments au socle pages.css (préfixe dc-).
 * Carte de couverture du héro (balayage, marqueurs), liste de couverture,
 * légende des couleurs PEI, outil de test local et simulateur de couleur.
 * Couleurs PEI = celles de l'application (pei_legend_screen.dart).
 */
.dc { --pei4: #388E3C; --pei3: #9CCC65; --pei2: #FFB300; --pei5: #42A5F5; --pei0: #E53935; }
.dc code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .88em; padding: 1px 5px; border-radius: 5px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06); color: #e6edf6; }
.dc pre code, .dc .pg-code code { background: none; border: 0; padding: 0; }
/* .pg-sec a (couleur de lien) ne doit pas repeindre les boutons des sections. */
.dc .pg-sec a.pg-btn-fire, .dc .pg-sec a.pg-btn-fire:hover { color: #fff; }
.dc .pg-sec a.pg-btn-ghost { color: var(--text); }

/* La colonne de contenu ne doit jamais s'élargir sur un bloc de code ou un tableau. */
.dc .pg-layout > div { min-width: 0; }

/* ── Héro ── */
.dc-hero { padding-bottom: 36px; }
@media (min-width: 1001px) { .dc-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 36px; } }
.dc-hero .pg-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dc-hero .pg-kpi .v { font-size: 26px; }

/* ── Carte ── */
.dc-map { position: relative; margin: 0; border-radius: 22px; border: 1px solid rgba(79,195,247,.22); overflow: hidden; isolation: isolate;
  background: radial-gradient(110% 80% at 50% -10%, rgba(79,195,247,.12), transparent 60%), linear-gradient(180deg, #0B1A31, #0A1628);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04); padding: 44px 14px 46px; }
.dc-aura { position: absolute; inset: -20% -10% auto -10%; height: 70%; z-index: -1; pointer-events: none; filter: blur(12px);
  background: radial-gradient(60% 60% at 30% 20%, rgba(56,189,248,.16), transparent 70%), radial-gradient(50% 50% at 80% 30%, rgba(242,76,192,.10), transparent 70%);
  animation: dc-aura 16s ease-in-out infinite alternate; }
@keyframes dc-aura { from { transform: translate3d(-2%, -1%, 0) scale(1.02); } to { transform: translate3d(3%, 2%, 0) scale(1.08); } }
.dc-hud { position: absolute; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font: 600 11.5px/1.3 'JetBrains Mono', ui-monospace, monospace; color: #8FA0B6; letter-spacing: .02em; }
.dc-hud.top { top: 14px; text-transform: uppercase; letter-spacing: .1em; }
.dc-hud.bottom { bottom: 14px; }
.dc-hud b { color: #EAF7FF; }
.dc-hud span { display: inline-flex; align-items: center; gap: 7px; }
.dc-live { width: 7px; height: 7px; border-radius: 50%; background: #38BDF8; box-shadow: 0 0 10px #38BDF8; animation: dc-blink 2s ease-in-out infinite; }
@keyframes dc-blink { 50% { opacity: .35; } }

.dc-svg { display: block; width: 100%; height: auto; overflow: visible; }
.dc-land { fill: rgba(28,47,77,.62); stroke: rgba(79,195,247,.42); stroke-width: 1.2; stroke-linejoin: round; }
.dc-grat { stroke: rgba(79,195,247,.10); stroke-width: 1; stroke-dasharray: 2 5; }
.dc-dot { fill: rgba(139,152,171,.34); }
.dc-dot.tw { animation: dc-tw 5s ease-in-out infinite; }
@keyframes dc-tw { 50% { fill: rgba(200,225,255,.7); } }

/* Balayage : la rotation se fait autour du centre de la France (variables posées par la vue). */
.dc-sweep { transform-box: view-box; transform-origin: var(--cx) var(--cy); animation: dc-rot var(--t, 9s) linear infinite; }
@keyframes dc-rot { to { transform: rotate(360deg); } }
.dc-wedge { fill: #38BDF8; }
.dc-beam { stroke: rgba(125,211,252,.55); stroke-width: 1.4; }

/* Marqueurs : apparition, pulsation, éclair au passage du faisceau. */
.dc-mk { transform-box: fill-box; transform-origin: center; opacity: 0; transform: scale(.2); cursor: pointer; outline: none;
  animation: dc-pop .6s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes dc-pop { to { opacity: 1; transform: scale(1); } }
.dc-core { fill: #38BDF8; filter: url(#dc-glow); transition: fill .2s; }
.dc-core-in { fill: #EAF7FF; }
.dc-code { fill: #062038; font: 800 12px Inter, sans-serif; text-anchor: middle; pointer-events: none; }
.dc-pulse { transform-box: fill-box; transform-origin: center; fill: none; stroke: #38BDF8; stroke-width: 1.4; opacity: 0;
  animation: dc-pulse 9s ease-out infinite; }
@keyframes dc-pulse { 0% { opacity: .75; transform: scale(.9); } 14% { opacity: 0; transform: scale(2.6); } 100% { opacity: 0; transform: scale(2.6); } }
.dc-hit { fill: #fff; opacity: 0; pointer-events: none; animation: dc-hit 9s ease-out infinite; }
@keyframes dc-hit { 0% { opacity: .55; } 6% { opacity: 0; } 100% { opacity: 0; } }
.dc-mk:hover .dc-core, .dc-mk:focus .dc-core, .dc-mk.on .dc-core { fill: #f24cc0; }
.dc-mk:focus-visible .dc-core { stroke: #fff; stroke-width: 2; }

.dc-tip { position: absolute; z-index: 5; pointer-events: none; padding: 8px 12px; border-radius: 10px; background: rgba(6,14,26,.95);
  border: 1px solid rgba(79,195,247,.45); color: #E6EDF6; font-size: 12.5px; line-height: 1.4; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); opacity: 0; transform: translate(-50%, calc(-100% - 12px)); transition: opacity .12s; }
.dc-tip.is-on { opacity: 1; }
.dc-tip b { color: #7DD3FC; }
.dc-tip span { color: #8FA0B6; }
.dc-tip em { font-style: normal; color: #f9a8e3; }

/* ── Liste de couverture ── */
.dc-cov { list-style: none; margin: 18px 0 8px; padding: 0 !important; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); }
.dc-cov li { display: grid; grid-template-columns: minmax(150px, 1.3fr) 130px minmax(80px, 2fr) 80px; gap: 14px; align-items: center;
  padding: 10px 16px; border-top: 1px solid var(--border); font-size: 14.5px; line-height: 1.3; }
.dc-cov li:first-child { border-top: 0; }
.dc-cov li:hover { background: rgba(255,255,255,.02); }
.dc-cov-n b { color: var(--text); font-weight: 600; }
.dc-cov-n i { font-style: normal; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-left: 4px; }
.dc-cov-via .pg-chip { font-size: 11px; padding: 3px 8px; }
.dc-cov-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.04); overflow: hidden; }
.dc-cov-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #38BDF8, var(--f));
  transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.dc-cov-c { text-align: right; font: 700 14px Inter, sans-serif; font-variant-numeric: tabular-nums; color: #7DD3FC; }
.dc-cov li.tot { background: rgba(255,255,255,.03); }
.dc-cov li.tot .dc-cov-c { color: #fff; }
.dc-cov li.tot .dc-cov-bar { background: none; }

/* ── Tableau des champs ── */
.dc-fields td:first-child { white-space: nowrap; }
.dc-req, .dc-rec { display: inline-block; margin-left: 4px; font: 700 10px Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; vertical-align: 1px; }
.dc-req { color: #ffb4a8; background: rgba(255,90,60,.12); }
.dc-rec { color: #ffd39a; background: rgba(255,167,38,.12); }

/* Petites formes de marqueur (tableau des types). */
.dc-shape { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; background: #fff; border: 2.4px solid var(--pei4); border-radius: 50%; }
.dc-shape[data-type="bouche"] { border-radius: 0; transform: rotate(45deg) scale(.85); }
.dc-shape[data-type="citerne"] { border-radius: 0; }
.dc-shape[data-type="colonne_seche"] { border-radius: 0; width: 8px; }
.dc-shape[data-type="poteau_relais"] { border-style: dashed; }
.dc-shape[data-type="point_aspiration"], .dc-shape[data-type="pena_baignable"],
.dc-shape[data-type="borne_agricole"], .dc-shape[data-type="colonne_aspiration"] { border: 0; border-radius: 0; background: var(--pei4); }
.dc-shape[data-type="point_aspiration"] { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.dc-shape[data-type="pena_baignable"] { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.dc-shape[data-type="borne_agricole"] { clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%); }
.dc-shape[data-type="colonne_aspiration"] { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

/* ── Légende couleurs ── */
.dc-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.dc-lg { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border);
  border-top: 3px solid var(--k); }
.dc-lg b { display: block; color: var(--text); font-size: 14px; line-height: 1.25; }
.dc-lg small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.35; margin-top: 3px; }
.dc-pin { flex: none; position: relative; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 4px solid var(--k);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--k) 22%, transparent), 0 0 18px color-mix(in srgb, var(--k) 45%, transparent); }
.dc-lg.ko .dc-pin::before, .dc-lg.ko .dc-pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 3px; margin: -1.5px 0 0 -7px;
  background: var(--k); border-radius: 2px; transform: rotate(45deg); }
.dc-lg.ko .dc-pin::after { transform: rotate(-45deg); }

/* ── Outil de test ── */
.dc-lab { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 16px; margin-top: 18px; }
.dc-lab-in, .dc-lab-out, .dc-play { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.dc-lab-in { display: grid; gap: 14px; align-content: start; }
.dc-drop { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; border: 1.5px dashed var(--border-strong);
  color: var(--text-muted); cursor: pointer; transition: border-color .2s, background .2s; font-size: 14px; }
.dc-drop:hover, .dc-drop.over { border-color: var(--f); background: rgba(242,76,192,.06); color: var(--text); }
.dc-drop:focus-within { border-color: var(--f); box-shadow: 0 0 0 3px rgba(242,76,192,.18); }
.dc-drop svg { flex: none; color: var(--f); }
.dc-drop b { color: var(--text); }
.dc-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dc-lab .pg-field textarea { min-height: 190px; font: 12.5px/1.55 'JetBrains Mono', ui-monospace, monospace; }
.dc-lab-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dc-lab-out { min-height: 280px; font-size: 14.5px; color: var(--text-muted); }
.dc-lab-empty { margin: 0; color: var(--text-dim); }
.dc-res-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.dc-res-head strong { font: 800 18px Inter, sans-serif; color: var(--text); margin-right: 6px; }
.dc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.dc-stats div { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.dc-stats b { display: block; font: 800 20px/1.1 Inter, sans-serif; color: var(--text); font-variant-numeric: tabular-nums; }
.dc-stats span { font-size: 11.5px; color: var(--text-dim); }
.dc-dist { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.04); margin: 8px 0 8px; }
.dc-dist i { display: block; height: 100%; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.dc-dist-l { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; margin-bottom: 12px; }
.dc-dist-l span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--k); vertical-align: 0; }
.dc-msgs { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: 6px; }
.dc-msgs li { font-size: 13.5px !important; line-height: 1.5 !important; padding: 8px 10px 8px 12px; border-radius: 10px; border-left: 3px solid var(--c);
  background: rgba(79,195,247,.06); }
.dc-msgs li.warn { border-left-color: var(--a); background: rgba(255,167,38,.07); }
.dc-msgs li.ko { border-left-color: #ff5a3c; background: rgba(255,90,60,.08); }
.dc-msgs li.ok { border-left-color: var(--g); background: rgba(52,211,153,.07); }
.dc-lab-out .pg-code { margin: 14px 0 0; }
.dc-lab-out .pg-code pre { max-height: 260px; }

/* ── Simulateur de couleur ── */
.dc-play { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; align-items: center; margin-top: 14px; }
.dc-play-in { grid-template-columns: 1fr 1fr; }
.dc-play-out { display: flex; gap: 18px; align-items: center; }
.dc-pv { flex: none; width: 110px; height: 110px; border-radius: 18px; background: radial-gradient(circle at 50% 45%, rgba(79,195,247,.10), transparent 70%), #0a1322;
  border: 1px solid var(--border); }
.dc-pv-code { font: 600 12px 'JetBrains Mono', monospace; color: var(--text-dim); }
.dc-pv-code b { color: var(--text); }
.dc-pv-t { font: 800 19px/1.25 Inter, sans-serif; color: var(--text); margin: 6px 0; }
.dc-pv-d { margin: 0; font-size: 13.5px !important; line-height: 1.5 !important; }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .dc-map { max-width: 620px; }
  .dc-legend { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dc-lab, .dc-play { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dc-hero .pg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dc-map { padding: 40px 6px 52px; border-radius: 16px; }
  .dc-hud { font-size: 10.5px; }
  .dc-cov li { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .dc-cov-via { grid-row: 2; }
  .dc-cov-bar { grid-column: 1 / -1; grid-row: 3; }
  .dc-cov-c { grid-row: 1; grid-column: 2; }
  .dc-legend { grid-template-columns: 1fr 1fr; }
  .dc-stats { grid-template-columns: 1fr 1fr; }
  .dc-play-in { grid-template-columns: 1fr; }
  .dc-play-out { flex-direction: column; align-items: flex-start; }
  /* Tableau des champs empilé : une carte par champ. */
  .dc-fields thead { display: none; }
  .dc-fields, .dc-fields tbody, .dc-fields tr, .dc-fields td { display: block; width: auto; }
  .dc-fields tr { padding: 10px 12px; border-top: 1px solid var(--border); }
  .dc-fields tr:first-child { border-top: 0; }
  .dc-fields td { border: 0; padding: 2px 0; }
  .dc-fields td:nth-child(2), .dc-fields td:nth-child(3) { display: inline-block; margin-right: 10px; font-size: 12.5px; color: var(--text-dim); }
}
@media (prefers-reduced-motion: reduce) {
  .dc-mk { opacity: 1; transform: none; }
  .dc-pulse, .dc-hit { opacity: 0; }
  .dc-sweep { display: none; }
  .dc-cov-bar i, .dc-dist i { transition: none; }
}

/* H1 orienté requête ; la phrase narrative passe en sous-titre juste dessous (oct. 2026). */
.kd-h1s { font-size: clamp(21px, 2.7vw, 30px); line-height: 1.2; letter-spacing: -.015em; font-weight: 700; color: #e6edf6;
  margin: -4px 0 18px; max-width: 680px; text-wrap: balance; }

/* Maillage interne en pied de page : termes du glossaire et autres modules (modules/_liens.php). */
.kd-rel { display: grid; gap: 10px; margin-top: 22px; }
.kd-rel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.kd-rel-row > b { font: 700 12px Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim, #6f809b); }
.kd-rel-row .pg-meta { margin-top: 0; gap: 6px; }
.kd-rel-row .pg-meta a { padding: 5px 10px; font-size: 12.5px; }
.dc-others { margin-top: 34px; }
.dc-others > b { display: block; font: 700 12px Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim, #6f809b); margin-bottom: 4px; }
.dc-others .pg-card h3 { font-size: 16px; margin-bottom: 4px; }
.dc-others .pg-card p { font-size: 13.5px; }
