/* ──────────────────────────────────────────────────────────────────────────
   Lisible — design « Plan » · couleurs « Engine » (slate + émeraude / ambre / rouge)
   Principe : la couleur porte le SENS, pas la décoration.
     · encre bleu nuit pour la structure, les boutons et les lignes du plan ;
     · émeraude = validé · ambre = à surveiller · rouge = incident · gris = en attente ;
     · chaque statut a en plus sa FORME (cercle ✓, triangle !, carré ✕, cercle pointillé).
   Les trois volets se distinguent par leur numéro, leur nom et leur icône.
   Couleurs et tailles définies une seule fois ici (jetons).
   ────────────────────────────────────────────────────────────────────────── */

:root {
  /* neutres (échelle slate) */
  --ink: #0f172b;
  --ink-2: #45556c;      /* texte secondaire, 7,6:1 sur blanc */
  --ink-3: #62748e;      /* rails et traits neutres, 4,8:1 sur blanc */
  --bg: #fafafa;
  --card: #ffffff;
  --line: #e5e5e5;
  --row: #ececf0;
  --chip: #f1f5f9;

  /* statuts : main = trait/forme (≥ 3:1 sur blanc) · tint = fond · deep = texte (≥ 4,5:1 sur tint) */
  --ok-main: #009966;   --ok-tint: #d0fae5;   --ok-deep: #006045;
  --warn-main: #e17100; --warn-tint: #fef3c6; --warn-deep: #973c00;
  --bad-main: #e7000b;  --bad-tint: #ffe2e2;  --bad-deep: #9f0712;
  --wait-main: #62748e; --wait-tint: #f1f5f9; --wait-deep: #45556c;

  /* forme */
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 43, 0.04), 0 1px 3px rgba(15, 23, 43, 0.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tap: 44px;
  --gutter: 16px;
  --page: 920px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

.pl-skip {
  position: absolute; left: var(--gutter); top: -80px; z-index: 10;
  padding: 12px 16px; background: var(--ink); color: #fff; font-weight: 600; border-radius: var(--r-sm);
}
.pl-skip:focus { top: var(--gutter); }

.pl-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ── En-tête ─────────────────────────────────────────────────────────────── */
.pl-bar { background: var(--card); border-bottom: 1px solid var(--line); }
.pl-header {
  max-width: var(--page); margin: 0 auto; padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
}
.pl-brand { display: inline-flex; align-items: center; gap: 12px; min-height: var(--tap); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; }
.pl-mark { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--ink); }
.pl-mark .t { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
.pl-mark .d { fill: #fff; }

.pl-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.pl-nav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 14px;
  border-radius: var(--r-md); color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none;
}
.pl-nav a:hover { background: var(--chip); color: var(--ink); }
.pl-nav a[aria-current="page"] { background: var(--chip); color: var(--ink); }

/* ── Page ────────────────────────────────────────────────────────────────── */
.pl-main { max-width: var(--page); margin: 0 auto; padding: 8px var(--gutter) 48px; }
.pl-hero { padding: 36px 0 24px; }
.pl-h1 { margin: 0 0 8px; font-size: 38px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; }
.pl-lead { margin: 0; max-width: 64ch; color: var(--ink-2); font-size: 17px; }
.pl-meta { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }

/* ── Cartes ──────────────────────────────────────────────────────────────── */
.pl-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px 26px; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.pl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 20px;
  border: 1.5px solid var(--ink); border-radius: var(--r-md); background: var(--ink); color: #fff;
  font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.pl-btn:hover { background: #1d293d; border-color: #1d293d; }
.pl-btn--ghost { background: var(--card); color: var(--ink); }
.pl-btn--ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Pastilles de statut ─────────────────────────────────────────────────── */
.pl-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
}
.pl-pill svg { width: 12px; height: 12px; flex: none; }
.pl-pill--ok { background: var(--ok-tint); color: var(--ok-deep); }
.pl-pill--warn { background: var(--warn-tint); color: var(--warn-deep); }
.pl-pill--bad { background: var(--bad-tint); color: var(--bad-deep); }
.pl-pill--wait { background: var(--wait-tint); color: var(--wait-deep); }

/* ── Plan (carte principale) ─────────────────────────────────────────────── */
.pl-plan { margin: 0 0 24px; }
.pl-plan-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 14px; }
.pl-eyebrow { margin: 0; color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pl-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.pl-map { display: block; width: 100%; height: auto; margin: 0 0 8px; }
.pl-map text { font-family: var(--font); }
.pl-map .trk { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.pl-map .cut { fill: none; stroke: var(--ink-3); stroke-width: 4; stroke-linecap: butt; stroke-dasharray: 7 7; }
.pl-map .tag { fill: var(--chip); stroke: var(--line); stroke-width: 1; }
.pl-map .num { fill: var(--ink); }
.pl-map .num-t { fill: #fff; font-size: 12px; font-weight: 700; text-anchor: middle; }
.pl-map .name { fill: var(--ink); font-size: 15px; font-weight: 600; }
.pl-map .lbl { fill: var(--ink); font-size: 12px; text-anchor: middle; }
.pl-map .knot { fill: var(--ink); }
.pl-map .end { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.pl-map .end-t { fill: var(--ink); font-size: 14px; font-weight: 600; text-anchor: middle; }
.pl-map .end-i { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pl-map .end-n { fill: var(--bad-deep); font-size: 12px; font-weight: 700; text-anchor: middle; }

.ok-c { fill: var(--ok-tint); stroke: var(--ok-main); stroke-width: 2.5; }
.ok-g { fill: none; stroke: var(--ok-deep); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.warn-c { fill: var(--warn-tint); stroke: var(--warn-main); stroke-width: 2.5; stroke-linejoin: round; }
.warn-g { fill: none; stroke: var(--warn-deep); stroke-width: 2.4; stroke-linecap: round; }
.warn-d { fill: var(--warn-deep); }
.bad-c { fill: var(--bad-tint); stroke: var(--bad-main); stroke-width: 2.5; }
.bad-g { fill: none; stroke: var(--bad-deep); stroke-width: 2.4; stroke-linecap: round; }
.wait-c { fill: #fff; stroke: var(--wait-main); stroke-width: 2.5; stroke-dasharray: 3 3; }

.pl-plan-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  padding-top: 18px; border-top: 1px solid var(--row);
}
.pl-plan-foot p { margin: 0; max-width: 56ch; color: var(--ink-2); font-size: 15px; }

/* ── Cartes des trois volets ─────────────────────────────────────────────── */
.pl-lines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0 0 24px; padding: 0; list-style: none; }
.pl-line { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px; }
.pl-line-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; }
.pl-tile { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--chip); color: var(--ink); }
.pl-kicker { margin: 0 0 2px; color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.pl-line h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
.pl-q { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; }

.pl-stations { margin: 0 0 20px; padding: 0; list-style: none; }
.pl-stations li { position: relative; padding: 0 0 13px 32px; }
.pl-stations li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border: 2.5px solid var(--ink); border-radius: 50%; background: #fff; }
.pl-stations li::after { content: ""; position: absolute; left: 7.5px; top: 22px; bottom: 0; width: 3px; border-radius: 2px; background: var(--ink-3); }
.pl-stations li:last-child { padding-bottom: 0; }
.pl-stations li:last-child::after { display: none; }
.pl-st-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.pl-st-sub { display: block; color: var(--ink-2); font-size: 13px; line-height: 1.4; }

.pl-line-foot { margin-top: auto; }
.pl-line-foot .pl-btn { width: 100%; }
.pl-line-note { margin: 10px 0 0; min-height: calc(13px * 1.4 * 3); color: var(--ink-2); font-size: 13px; line-height: 1.4; }

/* terminus affiché sous les cartes sur mobile */
.pl-end-m { display: none; align-items: center; gap: 14px; margin: 0 0 24px; padding: 16px 18px; border: 2px solid var(--ink); border-radius: var(--r-lg); background: var(--card); font-weight: 600; }
.pl-end-m svg { flex: none; }
.pl-end-m span { display: block; color: var(--ink-2); font-size: 14px; font-weight: 400; }

/* ── Note et ordre conseillé ─────────────────────────────────────────────── */
.pl-note { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 32px; padding: 14px 18px; border-radius: var(--r-md); background: var(--chip); color: var(--ink); font-size: 15px; }
.pl-note .pl-ico { margin-top: 2px; color: var(--ink-2); }

.pl-order h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; }
.pl-order ol { margin: 0; padding: 0; list-style: none; counter-reset: step; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.pl-order li { position: relative; counter-increment: step; padding: 16px 20px 16px 64px; border-top: 1px solid var(--row); font-size: 15px; }
.pl-order li:first-child { border-top: 0; }
.pl-order li::before {
  content: counter(step); position: absolute; left: 20px; top: 15px; display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
}

/* ── Pied de page ────────────────────────────────────────────────────────── */
.pl-footer { max-width: var(--page); margin: 0 auto; padding: 20px var(--gutter) 32px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }

/* ── Adaptations ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .pl-map, .pl-plan-head { display: none; }
  .pl-lines { grid-template-columns: minmax(0, 1fr); }
  .pl-line-note { min-height: 0; }
  .pl-end-m { display: flex; }
  .pl-plan { padding: 18px; }
  .pl-plan-foot { border-top: 0; padding-top: 0; }
  .pl-plan-foot .pl-btn { width: 100%; }
}
@media (max-width: 560px) {
  .pl-h1 { font-size: 30px; }
  .pl-lead { font-size: 16px; }
  .pl-hero { padding-top: 22px; }
  .pl-nav a { padding: 0 10px; font-size: 14px; }
  .pl-nav a .pl-ico { display: none; }
}
/* ── Pages d'outils : même en-tête, à la largeur de l'espace de travail ───── */
.pl-bar--wide .pl-header { max-width: 1440px; padding-left: 28px; padding-right: 28px; }
.pl-pagehead { max-width: 1440px; margin: 0 auto; padding: 28px 28px 14px; display: flex; align-items: center; gap: 16px; }
.pl-pagehead .pl-tile { width: 48px; height: 48px; flex: none; }
.pl-pagehead .pl-h1 { margin: 0; font-size: 28px; }
.pl-footer--wide { max-width: 1440px; padding-left: 28px; padding-right: 28px; }
@media (max-width: 760px) {
  .pl-bar--wide .pl-header { padding-left: 16px; padding-right: 16px; }
  .pl-pagehead { padding: 20px 16px 8px; gap: 12px; }
  .pl-pagehead .pl-h1 { font-size: 22px; }
  .pl-pagehead .pl-tile { width: 40px; height: 40px; }
  .pl-footer--wide { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
