:root {
    --ink: #14202e;
    --ink-2: #2f3d52;
    --ink-3: #4a586d;
    --muted: #526074;
    --muted-2: #58677a;
    --paper: #f6f1e6;
    --paper-2: #efe7d6;
    --paper-3: #e8dec9;
    --line: #d8ccb1;
    --line-strong: #b5a378;
    --safran: #d49a28;
    --safran-2: #f0c15c;
    --safran-soft: #f4e2b3;
    --navy: #0b3a59;
    --navy-2: #1e5c84;
    --navy-soft: #cfdeeb;
    --teal: #287f7a;
    --teal-2: #5fa9a3;
    --teal-soft: #c7e0dc;
    --green: #2f7d4f;
    --green-soft: #c8e0ce;
    --orange: #c46b2b;
    --orange-soft: #f3d4b4;
    --red: #a94135;
    --red-soft: #ecc6c0;
    --white: #fffdf7;
    --ink-shadow: 0 1px 0 rgba(20, 32, 46, 0.05), 0 14px 36px rgba(38, 32, 22, 0.10);
    --surface-page: var(--paper);
    --surface-card: rgba(255, 253, 247, 0.94);
    --surface-card-strong: var(--white);
    --border-subtle: rgba(20, 32, 46, 0.14);
    --border-strong: rgba(20, 32, 46, 0.26);
    --text-primary: var(--ink);
    --text-secondary: rgba(20, 32, 46, 0.76);
    --text-muted: rgba(20, 32, 46, 0.58);
    --accent-gold: var(--safran);
    --accent-gold-soft: rgba(212, 154, 40, 0.15);
    --status-good: #237a57;
    --status-warn: #b7791f;
    --status-bad: #b42318;
    --status-info: #2563a8;
    --radius-card: 18px;
    --radius-control: 999px;
    --shadow-card: var(--ink-shadow);
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --transition-fast: 160ms var(--ease-out);

    --grid-noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05  0 0 0 0 0.05  0 0 0 0 0.05  0 0 0 0.10 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  }

  * { box-sizing: border-box; }
  html, body { max-width: 100%; overflow-x: clip; }
  html { scroll-behavior: smooth; }
  :focus-visible {
    outline: 2px solid #865404;
    outline-offset: 3px;
  }
  button:active,
  .header-link:active,
  .toc-link:active,
  .share-btn:active,
  .nav-btn:active {
    transform: scale(0.98);
  }

  body {
    margin: 0;
    background:
      radial-gradient(1200px 600px at 80% -10%, rgba(212, 154, 40, 0.10), transparent 60%),
      radial-gradient(900px 500px at -10% 30%, rgba(11, 58, 89, 0.05), transparent 60%),
      var(--paper);
    background-attachment: fixed;
    color: var(--ink);
    font-family: "Manrope", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--grid-noise);
    opacity: 0.35;
    pointer-events: none;
    mix-blend-mode: multiply;
    z-index: 0;
  }

  .shell {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: 80px;
  }

  /* =========================== HEADER =========================== */
  header.topbar {
    margin-top: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
  }

  .brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
  .brand-mark {
    width: 52px; height: 52px;
    display: inline-grid; place-items: center;
    border: 2px solid var(--ink);
    background: var(--safran);
    font-family: "JetBrains Mono", monospace;
    font-weight: 800; font-size: 15px;
    letter-spacing: 0.04em;
    position: relative;
  }
  .brand-mark::after {
    content: ""; position: absolute;
    inset: -5px -5px 3px 3px;
    border: 1px solid var(--ink);
    z-index: -1;
    background: var(--paper-2);
  }
  .brand .lockup strong {
    font-family: "Instrument Serif", serif;
    font-weight: 400; font-size: 22px;
    letter-spacing: -0.01em;
    display: block; line-height: 1;
  }
  .brand .lockup small {
    display: block; margin-top: 4px;
    color: var(--muted);
    font-size: 11px; letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .breadcrumb {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px; letter-spacing: 0.05em;
    color: var(--muted); text-transform: uppercase;
  }
  .breadcrumb a { color: var(--muted); text-decoration: none; }
  .breadcrumb a:hover { color: var(--ink); }
  .breadcrumb .sep { margin: 0 8px; opacity: 0.5; }
  .breadcrumb .current { color: var(--ink); }

  .header-actions { display: flex; gap: 8px; align-items: center; }
  .icon-btn {
    width: 36px; height: 36px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--line);
    background: var(--white);
    cursor: pointer;
    transition: all 0.18s ease;
  }
  .icon-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
  .icon-btn svg { width: 16px; height: 16px; stroke: var(--ink-2); fill: none; stroke-width: 1.6; }
  .header-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink-2);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
  }
  .header-link:hover { border-color: var(--ink); color: var(--ink); }
  abbr[data-tip] {
    text-decoration: underline dotted var(--line-strong);
    text-underline-offset: 3px;
    cursor: help;
  }

  /* =========================== HERO =========================== */
  .hero {
    margin: 38px 0 28px;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 36px;
    align-items: end;
  }
  .hero h1 {
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    font-size: clamp(34px, 4.2vw, 54px);
    line-height: 1.02;
    letter-spacing: -0.018em;
    margin: 0 0 16px;
    color: var(--ink);
  }
  .hero h1 em { font-style: italic; color: #865404; }
  .hero .lede {
    font-size: 15px; color: var(--ink-3);
    max-width: 60ch; line-height: 1.55; margin: 0;
  }
  .hero-side { border-left: 1px solid var(--line); padding: 6px 0 6px 24px; }
  .hero-side .kicker {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px; letter-spacing: 0.12em;
    color: var(--muted); text-transform: uppercase;
    margin-bottom: 10px; display: block;
  }
  .hero-side ul { margin: 0; padding: 0; list-style: none; }
  .hero-side li {
    padding: 7px 0;
    border-bottom: 1px dotted var(--line);
    display: flex; justify-content: space-between;
    font-size: 13px;
  }
  .hero-side li:last-child { border: 0; }
  .hero-side li span:last-child {
    font-family: "JetBrains Mono", monospace;
    font-weight: 600; color: var(--ink);
  }

  /* =========================== CONTROL BAND =========================== */
  .control-band {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 24px;
    align-items: end;
    padding: 22px 0;
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid var(--line);
    margin-bottom: 26px;
  }
  .kicker {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px; letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    display: block; margin-bottom: 10px;
  }
  .global-period {
    display: flex; gap: 0;
    border: 1px solid var(--line);
    width: max-content;
  }
  .global-period button {
    padding: 7px 12px;
    border: 0;
    border-right: 1px solid var(--line);
    background: var(--white);
    font-family: "JetBrains Mono", monospace;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer; color: var(--ink-3);
    transition: all 0.18s ease;
  }
  .global-period button:last-child { border-right: 0; }
  .global-period button:hover { background: var(--paper-2); color: var(--ink); }
  .global-period button.active { background: var(--safran); color: var(--ink); }

  .last-update {
    text-align: right;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px; color: var(--muted);
  }
  .last-update .dot {
    display: inline-block;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green);
    margin-right: 6px;
    animation: pulse 2s ease-in-out infinite;
    vertical-align: middle;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
  }
  .last-update strong { color: var(--ink); font-weight: 600; display: block; margin-top: 4px; }

  /* =========================== KPI GRID =========================== */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 32px;
  }
  .kpi {
    background: var(--white);
    border: 1px solid var(--line);
    padding: 16px 16px 14px;
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 158px;
  }
  .kpi:hover {
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: var(--ink-shadow);
  }
  .kpi[data-domain="electricity"] { border-top: 3px solid var(--navy); }
  .kpi[data-domain="gas"] { border-top: 3px solid var(--safran); }
  .kpi[data-domain="carbon"] { border-top: 3px solid var(--teal); }
  .kpi[data-domain="market"] { border-top: 3px solid var(--orange); }

  .kpi .label {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px; letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .kpi .value {
    font-family: "JetBrains Mono", monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 700; font-size: 26px;
    color: var(--ink); line-height: 1.1;
    letter-spacing: -0.01em;
  }
  .kpi .value .unit {
    font-size: 12px; font-weight: 500;
    color: var(--muted); margin-left: 4px;
  }
  .kpi .delta {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px; font-weight: 600;
    margin-top: 6px;
    display: flex; align-items: center; gap: 4px;
  }
  .kpi .delta.up { color: var(--red); }
  .kpi .delta.down { color: var(--green); }
  .kpi .delta.neutral { color: var(--muted); }
  .kpi .delta .ctx { color: var(--muted); font-weight: 500; margin-left: 2px; }

  .kpi .sparkline-wrap {
    margin: 10px -16px -14px;
    height: 40px;
    background: linear-gradient(to bottom, transparent 0%, rgba(20, 32, 46, 0.02) 100%);
  }
  .kpi .sparkline { width: 100%; height: 100%; display: block; }

  .kpi .quality {
    position: absolute; top: 12px; right: 12px;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px; letter-spacing: 0.08em;
    padding: 2px 6px;
    border: 1px solid; text-transform: uppercase;
    font-weight: 600;
  }
  .quality.ok { color: var(--green); border-color: var(--green-soft); background: rgba(200, 224, 206, 0.3); }
  .quality.warn { color: var(--orange); border-color: var(--orange-soft); background: rgba(243, 212, 180, 0.3); }
  .quality.alert { color: var(--red); border-color: var(--red-soft); background: rgba(236, 198, 192, 0.4); }

  /* =========================== SECTION =========================== */
  .section {
    margin-bottom: 36px;
  }
  .section-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    gap: 18px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }
  .section-head .ornament {
    font-family: "Instrument Serif", serif;
    font-size: 28px; color: var(--safran);
    line-height: 1;
  }
  .section-head h2 {
    font-family: "Instrument Serif", serif;
    font-weight: 400; font-size: 32px;
    margin: 0; letter-spacing: -0.015em;
  }
  .section-head h2 em { font-style: italic; color: var(--navy); }
  .section-head .meta-tag {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    text-align: right;
  }
  .section-head .meta-tag strong {
    display: block; color: var(--ink);
    font-size: 13px; margin-top: 4px;
    font-weight: 600;
  }
  .section .section-lede {
    color: var(--ink-3);
    max-width: 78ch;
    margin: 0 0 18px;
    font-size: 13.5px;
  }

  /* =========================== CARDS GRID =========================== */
  .chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    min-width: 0;
  }
  .chart-grid.full > * { grid-column: 1 / -1; }
  .chart-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .lib-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: 20px 22px 16px;
    display: flex; flex-direction: column;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    min-height: 320px;
    position: relative;
    min-width: 0;
  }
  @media (hover: hover) and (pointer: fine) {
    .lib-card:hover {
      border-color: var(--border-strong);
      box-shadow: var(--shadow-card);
    }
  }
  .lib-card.dark {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
  }
  .lib-card.dark .card-num {
    display: none;
  }
  .lib-card.dark .card-head h3 { color: var(--paper); }
  .lib-card.dark .card-head .subtitle { color: var(--paper-3); }
  .lib-card.dark .card-foot { color: var(--paper-2); border-color: rgba(246, 241, 230, 0.15); }
  .lib-card.dark .card-head { border-color: rgba(246, 241, 230, 0.15); }

  .card-head {
    display: flex; align-items: flex-start; gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  .card-num {
    display: none;
  }
  .card-head .titles { flex: 1; min-width: 0; }
  .card-head h3 {
    margin: 0;
    font-family: "Instrument Serif", serif;
    font-weight: 400; font-size: 22px;
    letter-spacing: -0.012em;
    line-height: 1.15;
  }
  .card-head .subtitle {
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
    margin-left: 4px;
  }
  .card-head .badge {
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 7px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    color: var(--ink-3);
    font-weight: 600;
    align-self: center;
  }
  .card-head .badge[data-state="live"],
  .status-pill[data-state="live"] { border-color: rgba(35, 122, 87, 0.35); color: var(--status-good); background: rgba(35, 122, 87, 0.10); }
  .card-head .badge[data-state="partial"],
  .status-pill[data-state="partial"] { border-color: rgba(183, 121, 31, 0.35); color: var(--status-warn); background: rgba(183, 121, 31, 0.10); }
  .card-head .badge[data-state="proxy"],
  .card-head .badge[data-state="provisional"],
  .status-pill[data-state="proxy"],
  .status-pill[data-state="provisional"] { border-color: rgba(37, 99, 168, 0.32); color: var(--status-info); background: rgba(37, 99, 168, 0.10); }
  .card-head .badge[data-state="error"],
  .status-pill[data-state="error"] { border-color: rgba(180, 35, 24, 0.34); color: var(--status-bad); background: rgba(180, 35, 24, 0.10); }
  .lib-card.dark .card-head .badge {
    background: rgba(244, 226, 179, 0.10);
    border-color: rgba(244, 226, 179, 0.2);
    color: var(--paper-2);
  }
  .card-body { flex: 1; min-height: 0; position: relative; }
  .card-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    display: flex; justify-content: space-between;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.04em;
    gap: 14px;
  }
  .card-foot .src { color: var(--ink-3); }
  .source-note {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px 9px;
    align-items: baseline;
  }
  .source-note b {
    color: var(--ink);
    font-weight: 800;
  }
  .lib-card.dark .source-note b { color: var(--paper); }

  .lib-legend {
    display: flex; flex-wrap: wrap; gap: 14px;
    margin-top: 10px;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: var(--ink-3);
  }
  .lib-card.dark .lib-legend { color: var(--paper-2); }
  .lib-legend .key { display: inline-flex; align-items: center; gap: 6px; }
  .lib-legend .key .sw {
    width: 12px; height: 4px;
    display: inline-block;
  }
  .lib-legend .key .sw.dot { width: 8px; height: 8px; border-radius: 50%; }
  .lib-legend .key .sw.dashed {
    background-image: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 6px);
    background-color: transparent !important;
    height: 2px;
  }

  .card-body { min-width: 0; }
  .lib-svg { width: 100%; max-width: 100%; height: auto; display: block; min-width: 0; }
  .lib-svg .axis { stroke: var(--line-strong); stroke-width: 1; fill: none; }
  .lib-svg .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; fill: none; }
  .lib-svg .lbl { font-family: "JetBrains Mono", monospace; font-size: 10px; fill: var(--muted); }
  .lib-svg .lbl-val { font-family: "JetBrains Mono", monospace; font-size: 11px; fill: var(--ink); font-weight: 700; }
  .lib-card.dark .lib-svg .axis { stroke: rgba(246, 241, 230, 0.3); }
  .lib-card.dark .lib-svg .grid { stroke: rgba(246, 241, 230, 0.12); }
  .lib-card.dark .lib-svg .lbl { fill: var(--paper-3); }
  .lib-card.dark .lib-svg .lbl-val { fill: var(--paper); }

  /* =========================== TABLEAU FRONTIÈRES =========================== */
  .border-table {
    width: 100%; border-collapse: collapse;
    font-size: 12px;
  }
  .border-table th {
    text-align: left;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--paper-3);
    padding: 8px 10px;
    border-bottom: 1px solid rgba(246, 241, 230, 0.2);
    font-weight: 600;
  }
  .border-table th.num, .border-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .border-table td {
    padding: 9px 10px;
    border-bottom: 1px dotted rgba(246, 241, 230, 0.12);
    color: var(--paper);
    font-family: "JetBrains Mono", monospace;
  }
  .border-table tr:last-child td { border-bottom: 0; }
  .border-table td:first-child {
    font-family: "Manrope", sans-serif;
    font-weight: 600;
  }
  .border-table .flag {
    display: inline-block;
    width: 14px; height: 10px;
    margin-right: 8px;
    border: 1px solid rgba(246, 241, 230, 0.3);
    vertical-align: middle;
  }
  .border-table .arrow-out { color: var(--green-soft); }
  .border-table .arrow-in { color: var(--red-soft); }

  /* =========================== KPI TABLE =========================== */
  .kpi-table {
    width: 100%; border-collapse: collapse;
    font-size: 12px;
  }
  .kpi-table th {
    text-align: left;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px; letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 6px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
  }
  .kpi-table th.num, .kpi-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
  .kpi-table td {
    padding: 11px 6px;
    border-bottom: 1px dotted var(--line);
    font-family: "JetBrains Mono", monospace;
    color: var(--ink-2);
  }
  .kpi-table tr:last-child td { border-bottom: 0; }
  .kpi-table .indic {
    font-family: "Manrope", sans-serif;
    font-weight: 600; color: var(--ink);
  }
  .kpi-table .val-col {
    font-weight: 700; color: var(--ink);
  }
  .kpi-table .ctx { color: var(--muted); font-weight: 400; }
  .trend-up { color: var(--red); font-weight: 700; }
  .trend-down { color: var(--green); font-weight: 700; }
  .trend-flat { color: var(--muted); font-weight: 700; }

  /* =========================== ANNOTATIONS =========================== */
  .annotation-box {
    position: absolute;
    padding: 8px 10px;
    background: rgba(20, 32, 46, 0.92);
    border: 1px solid rgba(212, 154, 40, 0.4);
    color: var(--paper);
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: 0.02em;
    pointer-events: none;
  }
  .annotation-box strong { color: var(--safran-2); font-weight: 700; }
  .lib-card.dark .annotation-box {
    background: rgba(246, 241, 230, 0.96);
    color: var(--ink);
    border-color: rgba(212, 154, 40, 0.5);
  }
  .lib-card.dark .annotation-box strong { color: var(--orange); }

  .topo-region {
    position: absolute;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--paper-3);
    pointer-events: none;
  }
  @keyframes flowDash {
    to { stroke-dashoffset: -24; }
  }
  .flow-line {
    stroke-dasharray: 10 8;
    animation: flowDash 1.25s linear infinite;
  }

  /* =========================== ALERTS =========================== */
  .alert-strip {
    background: linear-gradient(95deg, var(--safran-soft) 0%, rgba(244, 226, 179, 0.3) 100%);
    border: 1px solid var(--line-strong);
    padding: 12px 16px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12.5px;
    color: var(--ink-2);
  }
  .alert-strip .pill {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
  }
  .alert-strip .meta {
    margin-left: auto;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--muted);
  }
  .alert-strip strong { color: var(--ink); }

  /* =========================== TOC RAIL =========================== */
  .toc-rail {
    position: fixed;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .toc-rail.visible { opacity: 1; pointer-events: auto; }
  .toc-rail-inner {
    background: rgba(255, 253, 247, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    padding: 14px 16px 12px;
    min-width: 192px;
    box-shadow: var(--ink-shadow);
  }
  .toc-rail-kicker {
    display: block;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  .toc-rail ul { list-style: none; margin: 0; padding: 0; }
  .toc-rail li { margin: 0; }
  .toc-link {
    display: block;
    padding: 5px 0 5px 14px;
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-3);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
  }
  .toc-link:hover { color: var(--ink); border-left-color: var(--line-strong); }
  .toc-link.active {
    color: var(--ink);
    border-left-color: var(--safran);
    font-weight: 700;
  }
  .toc-divider {
    height: 1px;
    background: var(--line);
    margin: 8px 0;
  }
  .toc-fab {
    display: none;
    position: fixed;
    bottom: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
    border: 0;
    z-index: 60;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(20, 32, 46, 0.28);
  }
  .toc-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(246, 241, 230, 0.98);
    padding: 78px 28px 32px;
  }
  .toc-drawer[open] { display: block; }
  .toc-drawer-close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
  }
  .toc-drawer .toc-link {
    font-size: 20px;
    padding: 12px 0 12px 16px;
  }

  /* =========================== CARD SUMMARY =========================== */
  .card-summary {
    display: flex;
    gap: 8px;
    margin: -6px 0 14px;
    padding: 10px 12px;
    background: var(--paper-2);
    border-left: 2px solid var(--safran);
    font-family: "Manrope", sans-serif;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--ink-2);
    font-style: italic;
  }
  .card-summary[hidden] { display: none; }
  .summary-mark {
    color: var(--safran);
    font-style: normal;
    font-weight: 700;
    flex-shrink: 0;
  }
  .summary-text strong {
    color: var(--ink);
    font-style: normal;
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    font-size: 12px;
  }
  .lib-card.dark .card-summary {
    background: rgba(246, 241, 230, 0.08);
    color: var(--paper-2);
    border-left-color: var(--safran-2);
  }
  .lib-card.dark .card-summary .summary-text strong { color: var(--paper); }

  /* =========================== ADDITIONS V2.1 =========================== */
  .card-body.compact { min-height: 160px; }
  .split-60,
  .split-55 {
    display: grid;
    gap: 18px;
    align-items: stretch;
  }
  .split-60 { grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); }
  .split-55 { grid-template-columns: minmax(0, 1.25fr) minmax(240px, 1fr); }
  .panel-label {
    margin: 0 0 8px;
    font: 700 10px/1 "JetBrains Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
  }
  .map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 18px;
    align-items: stretch;
  }
  .map-stage { position: relative; min-height: 420px; }
  .map-counter {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 7px 9px;
    background: rgba(255, 253, 247, 0.9);
    border: 1px solid var(--line);
    font: 700 11px/1.25 "JetBrains Mono", monospace;
    color: var(--ink-2);
  }
  .map-filters {
    border-left: 1px solid var(--line);
    padding-left: 16px;
    display: grid;
    align-content: start;
    gap: 10px;
  }
  .map-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: var(--ink-2);
  }
  .map-filter input { accent-color: #865404; }
  .sw.round { border-radius: 50%; }
  .loop-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
  }
  .loop-table th,
  .loop-table td {
    padding: 7px 6px;
    border-bottom: 1px solid rgba(216, 204, 177, 0.22);
    text-align: left;
  }
  .loop-table th { color: var(--muted); font-weight: 700; text-transform: uppercase; }
  .loop-table .num { text-align: right; white-space: nowrap; }
  .loop-table .muted-cell { color: var(--muted); }
  .loop-table .loop-total td {
    border-top: 1px solid rgba(216, 204, 177, 0.45);
    font-weight: 800;
  }
  .loop-note {
    margin: 0 0 10px;
    max-width: 62ch;
    color: rgba(246, 241, 230, 0.78);
    font-size: 12px;
    line-height: 1.45;
  }
  .loop-bars {
    width: 120px;
    min-width: 120px;
  }
  .loop-bar-track {
    position: relative;
    height: 10px;
    background: rgba(246, 241, 230, 0.12);
  }
  .loop-bar-phys,
  .loop-bar-comm,
  .loop-bar-gap {
    position: absolute;
    top: 0;
    height: 10px;
    left: 50%;
  }
  .loop-bar-phys { background: var(--navy-2); }
  .loop-bar-comm {
    top: 2px;
    height: 6px;
    background: repeating-linear-gradient(45deg, var(--paper-2) 0 3px, transparent 3px 6px);
    opacity: 0.85;
  }
  .loop-bar-gap { top: 3px; height: 4px; background: var(--safran); }
  .metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }
  .metric-mini {
    border: 1px solid var(--line);
    background: var(--paper-2);
    padding: 10px;
  }
  .metric-mini strong {
    display: block;
    font-family: "Instrument Serif", serif;
    font-size: 26px;
    line-height: 1;
    font-weight: 400;
  }
  .metric-mini span {
    display: block;
    margin-top: 4px;
    font: 700 10px/1.25 "JetBrains Mono", monospace;
    color: var(--muted);
    text-transform: uppercase;
  }
  .traj-bar-container { margin: 24px 0 8px; }
  .traj-scale {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.04em;
  }
  .traj-bar {
    position: relative;
    width: 100%;
    height: 36px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--paper-2);
  }
  .traj-segment {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
  }
  .traj-segment.installed { background: var(--teal); color: var(--paper); }
  .traj-segment.reserved {
    background: repeating-linear-gradient(45deg, var(--safran), var(--safran) 4px, var(--white) 4px, var(--white) 8px);
    color: var(--ink);
  }
  .traj-segment.gap {
    background: rgba(212, 134, 42, 0.14);
    color: var(--ink);
    border-left: 2px solid var(--safran);
  }
  .traj-target-tick {
    position: absolute;
    top: -6px;
    bottom: -6px;
    width: 1.5px;
    background: var(--ink);
    z-index: 3;
  }
  .traj-target-label {
    position: absolute;
    top: -22px;
    transform: translateX(-50%);
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  .traj-labels {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: var(--muted);
    text-align: center;
  }
  .traj-labels span {
    border-right: 1px dotted var(--line);
    padding: 0 8px;
  }
  .traj-labels span:nth-child(3) { border-left: 2px solid var(--line-strong); }
  .traj-labels .gap-label strong {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid rgba(212, 134, 42, 0.55);
    background: rgba(212, 134, 42, 0.14);
    color: var(--ink);
  }
  .traj-labels span:last-child { border-right: 0; }
  .traj-labels strong {
    display: block;
    font-size: 13px;
    color: var(--ink);
    font-weight: 700;
    margin-bottom: 2px;
  }
  .traj-note {
    margin-top: 28px;
    padding: 12px 14px;
    background: var(--paper-2);
    border-left: 3px solid var(--safran);
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.55;
  }
  .traj-note strong { color: var(--ink); }

  /* =========================== ANNEXES =========================== */
  .annexes-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 18px;
  }
  .annex-card {
    border: 1px solid var(--line);
    background: var(--white);
    padding: 18px;
    box-shadow: var(--ink-shadow);
  }
  .annex-card h3 {
    margin: 0 0 14px;
    font-family: "Instrument Serif", serif;
    font-size: 24px;
    font-weight: 400;
  }
  .annex-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
  }
  .annex-table th,
  .annex-table td {
    border-bottom: 1px solid var(--line);
    padding: 7px 6px;
    text-align: left;
  }
  .annex-table th {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .annex-card dl { margin: 0; }
  .annex-card dt {
    font-weight: 800;
    color: var(--ink);
    margin-top: 12px;
  }
  .annex-card dt:first-child { margin-top: 0; }
  .annex-card dd {
    margin: 3px 0 0;
    color: var(--ink-3);
    font-size: 12.5px;
  }
  .api-status-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
  }
  .api-status-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--ink-3);
  }
  .status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted-2);
    flex-shrink: 0;
  }
  .status-dot.success { background: var(--green); }
  .status-dot.warn { background: var(--safran); }
  .status-dot.alert { background: var(--red); }
  .status-dot.skipped { background: var(--muted-2); }
  .source-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 700;
  }
  .source-status .status-dot { width: 8px; height: 8px; }
  .source-status[data-state="success"] { color: var(--green); }
  .source-status[data-state="warn"] { color: #865404; }
  .source-status[data-state="alert"],
  .source-status[data-state="error"] { color: var(--red); }
  .source-status[data-state="skipped"] { color: var(--muted-2); }
  .source-last-update {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--ink-3);
    white-space: nowrap;
  }

  /* =========================== FOOTER =========================== */
  footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    font-size: 11px;
    color: var(--muted);
  }
  footer .legal { line-height: 1.6; max-width: 70ch; }
  footer .links { display: flex; gap: 18px; align-items: flex-start; }
  footer a {
    color: var(--ink-3);
    text-decoration: none;
    border-bottom: 1px dotted var(--line-strong);
    padding-bottom: 1px;
  }
  footer a:hover { color: var(--ink); border-color: var(--ink); }

  /* =========================== CARD ACTIONS (period + share) =========================== */
  .card-actions {
    display: flex; align-items: center; gap: 6px;
    margin-left: auto; align-self: flex-start;
    min-width: 0;
  }
  .period-mini {
    display: inline-flex;
    border: 1px solid var(--line);
    background: var(--paper-2);
    border-radius: var(--radius-control);
    overflow: hidden;
    max-width: 100%;
  }
  .lib-card.dark .period-mini { border-color: rgba(246, 241, 230, 0.2); background: rgba(246, 241, 230, 0.06); }
  .period-mini button {
    min-height: 28px;
    min-width: 34px;
    padding: 4px 8px; border: 0;
    border-right: 1px solid var(--line);
    background: transparent;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
    color: var(--ink-3); cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  }
  .lib-card.dark .period-mini button { color: var(--paper-2); border-color: rgba(246, 241, 230, 0.15); }
  .period-mini button:last-child { border-right: 0; }
  .period-mini button:hover { background: rgba(212, 154, 40, 0.18); color: var(--ink); }
  .lib-card.dark .period-mini button:hover { color: var(--paper); background: rgba(212, 154, 40, 0.22); }
  .period-mini button.active {
    background: var(--safran);
    color: var(--ink);
    box-shadow: inset 0 0 0 1px rgba(20, 32, 46, 0.28);
    font-weight: 800;
  }
  .lib-card.dark .period-mini button.active { color: var(--ink); }
  .period-mini button:disabled,
  .period-mini button.is-partial {
    color: var(--muted);
    background: rgba(142, 139, 130, 0.12);
    cursor: not-allowed;
    opacity: 0.45;
    text-decoration: line-through;
  }
  .period-mini button:disabled:hover,
  .period-mini button.is-partial:hover {
    color: var(--muted);
    background: rgba(142, 139, 130, 0.12);
  }
  .lib-card.dark .period-mini button:disabled,
  .lib-card.dark .period-mini button.is-partial {
    color: rgba(246, 241, 230, 0.45);
    background: rgba(246, 241, 230, 0.06);
  }

  .share-btn {
    width: 28px; height: 28px;
    border: 1px solid var(--line);
    background: var(--paper-2);
    cursor: pointer;
    display: inline-grid; place-items: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  }
  .lib-card.dark .share-btn { border-color: rgba(246, 241, 230, 0.2); background: rgba(246, 241, 230, 0.06); }
  .share-btn:hover { background: var(--ink); border-color: var(--ink); }
  .share-btn:hover svg { stroke: var(--paper); }
  .share-btn svg {
    width: 12px; height: 12px;
    stroke: var(--ink-2); fill: none; stroke-width: 2;
    transition: stroke 0.18s ease;
  }
  .lib-card.dark .share-btn svg { stroke: var(--paper-2); }
  .csv-btn svg { stroke-width: 1.8; }

  /* navigateur temporel (carte 3B) */
  .nav-bar { display: flex; align-items: center; gap: 6px; }
  .nav-btn {
    width: 22px; height: 22px;
    border: 1px solid var(--line);
    background: var(--paper-2);
    cursor: pointer;
    display: inline-grid; place-items: center;
    font-family: "JetBrains Mono", monospace;
    font-weight: 700; font-size: 12px;
    color: var(--ink-2); line-height: 1;
    transition: color 0.15s ease, border-color 0.15s ease;
  }
  .nav-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
  .nav-label {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px; font-weight: 600;
    color: var(--ink);
    min-width: 100px;
    text-align: center;
    background: var(--paper-2);
    border: 1px solid var(--line);
    padding: 3px 10px;
    letter-spacing: 0.04em;
  }

  /* =========================== TOOLTIP =========================== */
  #tooltip {
    position: fixed;
    pointer-events: none;
    background: rgba(20, 32, 46, 0.96);
    color: var(--paper);
    border: 1px solid rgba(212, 154, 40, 0.55);
    padding: 9px 12px;
    font-family: "JetBrains Mono", monospace;
    font-size: 10.5px; line-height: 1.55;
    letter-spacing: 0.02em;
    z-index: 9999;
    opacity: 0;
    transition: opacity var(--transition-fast);
    min-width: 150px; max-width: 240px;
    box-shadow: 0 12px 36px rgba(20, 32, 46, 0.28);
  }
  #tooltip.visible { opacity: 1; }
  #tooltip .tt-title {
    display: block;
    color: var(--safran-2);
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(244, 226, 179, 0.18);
    padding-bottom: 4px;
  }
  #tooltip .tt-row {
    display: flex; align-items: center; gap: 7px;
    padding: 1px 0;
  }
  #tooltip .tt-sw { width: 8px; height: 8px; flex-shrink: 0; }
  #tooltip .tt-sw.line { height: 2px; }
  #tooltip .tt-name { flex: 1; color: var(--paper-3); font-weight: 500; }
  #tooltip .tt-val { color: var(--paper); font-weight: 700; font-variant-numeric: tabular-nums; }
  #tooltip .tt-pct { color: var(--muted-2); font-weight: 500; margin-left: 6px; font-size: 9px; }

  /* légendes cliquables */
  .lib-legend .key.toggleable {
    cursor: pointer;
    transition: opacity var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
    user-select: none;
    padding: 3px 6px;
    border-radius: var(--radius-control);
  }
  .lib-legend .key.toggleable:hover,
  .lib-legend .key.toggleable:focus-visible { background: rgba(212, 154, 40, 0.12); }
  .lib-legend .key.toggleable.disabled { opacity: 0.32; }
  .lib-legend .key.toggleable.disabled span:not(.sw) { text-decoration: line-through; }
  .lib-legend[data-autotoggle="true"] .key {
    cursor: pointer;
    padding: 3px 6px;
    border-radius: var(--radius-control);
  }
  .lib-legend[data-autotoggle="true"] .key:hover,
  .lib-legend[data-autotoggle="true"] .key:focus-visible {
    background: rgba(212, 154, 40, 0.12);
  }
  .data-empty-state {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--muted);
  }
  .data-empty-state strong {
    color: var(--ink-2);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .data-empty-state span {
    max-width: 28ch;
    font-size: 10px;
  }

  /* overlays SVG (capture mouse pour tooltip) */
  .svg-overlay { fill: transparent; cursor: crosshair; }
  .svg-cursor-line {
    stroke: var(--ink-2); stroke-width: 1;
    stroke-dasharray: 2 3; opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
  }
  .lib-card.dark .svg-cursor-line { stroke: var(--paper-2); }
  .svg-cursor-line.visible { opacity: 0.55; }
  .svg-hover-pt {
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease;
  }
  .svg-hover-pt.visible { opacity: 1; }
  @keyframes nukePulse {
    0%, 100% { opacity: 0.72; stroke-width: 1.2; }
    50% { opacity: 1; stroke-width: 2.8; }
  }
  .nuke-running {
    animation: nukePulse 1.8s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
  }

  /* indicateur de chargement carte (pendant changement de période) */
  .lib-card.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 253, 247, 0.55);
    pointer-events: none;
    animation: pulseLoad 1.2s ease-in-out infinite;
  }
  .lib-card.dark.loading::after { background: rgba(20, 32, 46, 0.45); }
  @keyframes pulseLoad {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
  }
  .lib-card.loading .card-foot::after {
    content: "Chargement des données...";
    color: var(--ink-2);
    font-weight: 700;
  }

  /* =========================== FADE-IN =========================== */
  .fade-in { animation: fadeUp 0.6s ease forwards; opacity: 0; }
  .delay-1 { animation-delay: 0.08s; }
  .delay-2 { animation-delay: 0.18s; }
  .delay-3 { animation-delay: 0.28s; }
  .delay-4 { animation-delay: 0.38s; }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* =========================== RESPONSIVE =========================== */
  @media (max-width: 1024px) {
    .toc-rail { display: none; }
    .toc-fab { display: inline-grid; place-items: center; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .hero { grid-template-columns: 1fr; gap: 20px; }
    .chart-grid,
    .chart-grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
    .chart-grid.three { grid-template-columns: 1fr; }
    .annexes-grid { grid-template-columns: minmax(0, 1fr); }
    .split-60,
    .split-55,
    .map-layout { grid-template-columns: 1fr; }
    .map-filters { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
    .control-band { grid-template-columns: 1fr; gap: 16px; }
    .last-update { text-align: left; }
    .card-foot { flex-direction: column; align-items: flex-start; }
    .border-table,
    .kpi-table { min-width: 720px; }
    .card-body:has(.border-table),
    .card-body:has(.kpi-table) { overflow-x: auto; }
    .card-body > div[style*="display:grid"],
    .card-body > div[style*="display: grid"] { grid-template-columns: minmax(0, 1fr) !important; }
    .lib-svg { min-height: 220px; }
    .traj-labels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 0; }
    .traj-labels span:nth-child(2n) { border-right: 0; }
    .traj-labels span:nth-child(3) { border-left: 0; }
  }
  @media (max-width: 1280px) {
    .toc-rail { right: 8px; }
    .toc-rail-inner { min-width: 168px; padding: 10px 12px; }
  }
  @media (max-width: 1520px) {
    .toc-rail { display: none; }
    .toc-fab { display: inline-grid; place-items: center; }
  }
  @media (max-width: 640px) {
    .kpi-grid { grid-template-columns: 1fr; }
    header.topbar { grid-template-columns: 1fr; gap: 12px; }
    .breadcrumb { display: none; }
    .header-actions { justify-content: flex-start; flex-wrap: wrap; }
    .shell { width: min(100% - 20px, 1280px); }
    .hero { margin-top: 24px; }
    .hero h1 { font-size: 34px; }
    .hero-side { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
    .hero-side li { gap: 12px; align-items: baseline; }
    .global-period { width: 100%; overflow-x: auto; }
    .global-period button { flex: 1 0 auto; }
    .section-head { grid-template-columns: 1fr; align-items: start; gap: 6px; }
    .section-head .ornament { display: none; }
    .section-head .meta-tag { text-align: left; }
    .lib-card { padding: 16px 14px 14px; min-height: 0; }
    .card-head { gap: 8px; flex-wrap: wrap; }
    .card-head h3 { font-size: 19px; }
    .card-head .subtitle { display: block; margin: 4px 0 0; }
    .card-actions { width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 2px; }
    .period-mini { max-width: 100%; overflow-x: auto; }
    .period-mini button { min-width: 38px; min-height: 34px; }
    .lib-legend { gap: 8px; }
    .metric-row { grid-template-columns: 1fr; }
    .lib-svg { min-height: 180px; }
    .annotation-box { position: static; margin: 8px 0 0; display: inline-block; max-width: 100%; }
    .traj-scale { display: grid; grid-template-columns: 1fr; gap: 4px; }
    .traj-labels { grid-template-columns: 1fr; text-align: left; }
    .traj-labels span,
    .traj-labels span:nth-child(2n) {
      border-right: 0;
      border-bottom: 1px dotted var(--line);
      padding: 6px 0;
    }
    .traj-labels span:last-child { border-bottom: 0; }
    footer { grid-template-columns: 1fr; }
    footer .links { flex-wrap: wrap; }
  }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(calc(-100% - 12px));
}
.skip-link:focus { transform: none; }
section[id] { scroll-margin-block-start: 24px; }
dialog.toc-drawer { margin: 0; border: 0; max-width: none; max-height: none; width: 100%; height: 100%; overflow: auto; }
.toc-drawer-close { width: 44px; height: 44px; }
.toc-drawer ul { list-style: none; margin: 0; padding: 0; }
.toc-fab { bottom: max(18px, env(safe-area-inset-bottom)); right: max(18px, env(safe-area-inset-right)); }
.toc-link[aria-current="location"] { color: var(--ink); font-weight: 700; border-left-color: var(--safran); }
.dashboard-state { max-width: 48rem; margin-block: 4px; }
[data-state="stale"] { text-decoration: underline dotted; text-underline-offset: .2em; }
.last-update:has(.dashboard-state[data-quality="stale"]) .dot,
.last-update:has(.dashboard-state[data-quality="partial"]) .dot { background: var(--status-warn); }
.last-update:has(.dashboard-state[data-quality="loading"]) .dot { background: var(--muted); }
.last-update:has(.dashboard-state[data-quality="missing"]) .dot,
.last-update:has(.dashboard-state[data-quality="error"]) .dot { background: var(--status-bad); }
.annex-card { min-width: 0; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; }
.annex-table { min-width: 38rem; }
.installation-list { margin-top: 12px; }
.installation-list summary { cursor: pointer; min-height: 36px; }
.installation-list ul { max-height: 24rem; overflow-y: auto; padding-inline-start: 22px; }
.installation-list li { padding-block: 4px; }
.outage-list { max-height: 28rem; overflow: auto; }
.outage-list li { margin-block: 8px; }
.section { content-visibility: auto; contain-intrinsic-block-size: auto 1600px; }
.section:target { content-visibility: visible; }
.dashboard-doc { max-width: 54rem; margin-inline: auto; padding: 24px; }
.dashboard-doc dt { font-weight: 700; margin-block-start: 1rem; }
.dashboard-doc dd { margin-inline-start: 0; }
.dashboard-doc code { overflow-wrap: anywhere; }
@media print {
  .toc-rail, .toc-fab, .header-actions, .skip-link, .card-actions, #tooltip, #retry-dashboard { display: none !important; }
  html, body { overflow: visible; }
  .shell { width: auto; }
  .lib-card, .annex-card { box-shadow: none; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  .annex-table { min-width: 0; }
  .section { content-visibility: visible; }
}
