:root {
  --accent: #E90130;
  --accent-soft: #fdeaef;
  --accent-line: #f7c2cf;
  --ink: #16181d;
  --ink-2: #353a45;
  --muted: #6b7280;
  --muted-2: #9aa1ad;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #fafafb;
  --border: #e6e8ec;
  --border-strong: #d6d9df;
  --shadow: rgba(20, 24, 29, 0.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  user-select: none;
}

/* faint dotted background */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, rgba(20,24,29,0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}
/* flow tab: light graph-paper grid instead of dots */
body.tab-flow::before {
  background-image:
    linear-gradient(rgba(20,24,29,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,24,29,0.055) 1px, transparent 1px);
  background-size: 44px 44px;
}

header {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 14px 26px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  z-index: 100;
}
header .brand { display: flex; align-items: baseline; gap: 10px; }
header h1 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
header h1 .accent { color: var(--accent); }
header .sub { font-size: 12px; color: var(--muted); font-weight: 500; }

.controls { display: flex; gap: 6px; align-items: center; }
.btn {
  background: var(--panel); color: var(--ink-2);
  border: 1px solid var(--border-strong);
  padding: 7px 13px; border-radius: 7px;
  cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600;
  transition: all 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.icon-btn { padding: 7px 11px; }

#canvas-wrapper {
  position: fixed; inset: 0; z-index: 1;
  overflow: hidden; cursor: grab;
}
#canvas-wrapper.dragging { cursor: grabbing; }

#canvas {
  position: absolute; top: 50%; left: 50%;
  width: 2300px; height: 600px; /* keep in sync with CANVAS_W/CANVAS_H in app.js */
  transform-origin: 0 0;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* connecting chevrons */
.chevron {
  position: absolute;
  top: 230px;
  width: 56px; height: 56px;
  color: var(--accent);
  opacity: 0.85;
  pointer-events: none;
}
.chevron svg { width: 100%; height: 100%; }

/* baseline rail */
.rail {
  position: absolute;
  top: 258px; left: 70px;
  width: 2160px; height: 2px;
  background: linear-gradient(to right, var(--border), var(--border) 100%);
  z-index: -1;
}

/* Step cards */
.card {
  position: absolute;
  top: 70px;
  width: 320px; height: 400px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 26px 24px 22px;
  cursor: pointer;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px rgba(20,24,29,0.04);
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 20px 46px -16px var(--shadow), 0 0 0 1px var(--accent);
}

.card .num {
  position: absolute;
  top: -18px; left: 24px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -4px var(--accent);
}

.card .illo {
  height: 150px;
  display: flex; align-items: center; justify-content: center;
  margin: 6px 0 14px;
}
.card .illo svg { height: 130px; width: auto; }

.card .card-title {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.card .card-tag {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.card ul {
  list-style: none;
  font-size: 12.5px; color: var(--muted);
  line-height: 1.5;
}
.card ul li {
  padding-left: 16px; position: relative;
  margin-bottom: 7px;
}
.card ul li::before {
  content: ''; position: absolute; left: 0; top: 7px;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent);
}
.card .open-hint {
  margin-top: auto;
  font-size: 11px; font-weight: 600;
  color: var(--muted-2);
  display: flex; align-items: center; gap: 6px;
  padding-top: 12px;
}
.card .open-hint::after { content: '→'; transition: transform 0.2s; }
.card:hover .open-hint { color: var(--accent); }
.card:hover .open-hint::after { transform: translateX(4px); }

/* Detail panel */
#detail-panel {
  position: fixed; top: 0; right: -560px;
  width: 560px; max-width: 92vw; height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-strong);
  padding: 40px 38px 40px;
  overflow-y: auto;
  transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 50;
  box-shadow: -24px 0 60px -30px var(--shadow);
}
#detail-panel.open { right: 0; }

#detail-panel .panel-num {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
#detail-panel .panel-num .badge {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
#detail-panel .panel-num .step-of {
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-2);
}
#detail-panel .panel-illo {
  height: 96px; margin: 0 0 18px;
  display: flex; align-items: center; justify-content: flex-start;
}
#detail-panel .panel-illo svg { height: 90px; }
#detail-panel h2 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 8px; line-height: 1.1;
}
#detail-panel .tech-pill {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 11px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  margin-bottom: 18px;
}
#detail-panel .summary {
  font-size: 15px; color: var(--ink-2); line-height: 1.6;
  margin-bottom: 22px; padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
#detail-panel h3 {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent);
  margin: 24px 0 10px;
}
#detail-panel ul { list-style: none; }
#detail-panel ul li {
  padding: 9px 0 9px 20px;
  font-size: 13.5px; line-height: 1.55;
  color: var(--ink-2);
  border-bottom: 1px solid var(--panel-soft);
  position: relative;
}
#detail-panel ul li::before {
  content: ''; position: absolute; left: 0; top: 15px;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent);
}
#detail-panel code {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px;
  color: var(--ink);
}
#detail-panel .panel-nav {
  display: flex; gap: 10px; margin-top: 30px;
  padding-top: 22px; border-top: 1px solid var(--border);
}
#detail-panel .panel-nav .btn { flex: 1; text-align: center; }
#detail-panel .panel-nav .btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
#detail-panel .panel-nav .btn.primary:hover { filter: brightness(0.88); }
#detail-panel .panel-nav .btn:disabled { opacity: 0.35; cursor: default; }

#close-panel {
  position: fixed; top: 18px; right: 22px; z-index: 60;
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--ink);
  width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px -4px var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, color 0.15s, border-color 0.15s, background 0.15s;
}
#detail-panel.open #close-panel { opacity: 1; pointer-events: auto; }
#close-panel:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

footer {
  position: fixed; bottom: 16px; left: 22px;
  font-size: 11.5px; color: var(--muted);
  z-index: 90; display: flex; gap: 16px; align-items: center;
}
footer kbd {
  background: var(--panel); border: 1px solid var(--border-strong);
  padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--ink-2);
}
footer .caveat { color: var(--accent); font-weight: 700; }

#zoom-level {
  position: fixed; bottom: 16px; right: 22px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--panel); border: 1px solid var(--border-strong);
  padding: 6px 12px; border-radius: 6px; color: var(--muted);
  z-index: 90;
}

/* line-art icon defaults */
.lineart { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.lineart .fill-accent { fill: var(--accent); stroke: none; }
.lineart .stroke-accent { stroke: var(--accent); }
.lineart .fill-white { fill: #fff; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; background: var(--panel-soft); border: 1px solid var(--border); padding: 4px; border-radius: 10px; }
.tab {
  background: transparent; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700;
  color: var(--muted); padding: 7px 16px; border-radius: 7px;
  transition: all 0.15s; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--accent); color: #fff; box-shadow: 0 4px 12px -4px var(--accent); }

/* view toggling — one body class per tab; add a rule per extra tab */
#canvas-wrapper { display: none; }
body.tab-flow #canvas-wrapper { display: block; }
body.tab-flow .flow-only { display: inline-flex; }
body:not(.tab-flow) .flow-only { display: none; }
body:not(.tab-flow) #zoom-level { display: none; }
body:not(.tab-flow) footer { display: none; }
body.tab-context #view-context, body.tab-data #view-data, body.tab-findings #view-findings { display: block; }

/* ===== FINDINGS cards ===== */
.finding-grid { max-width: 1180px; margin: 0 auto 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.finding-grid.headline { grid-template-columns: repeat(auto-fill, minmax(540px, 1fr)); }
.finding-card { background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px; padding: 20px 22px; cursor: pointer; transition: all 0.2s; box-shadow: 0 1px 2px rgba(20,24,29,0.04); display: flex; flex-direction: column; }
.finding-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 16px 36px -18px var(--shadow); }
.finding-card.hl { border-top: 3px solid var(--accent); }
.finding-card .fc-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 11px; flex-wrap: wrap; }
.finding-card .fc-cat { font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; background: var(--accent); padding: 3px 8px; border-radius: 5px; }
.finding-card.hl .fc-cat { background: var(--ink); }
.finding-card .fc-agent { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.finding-card h4 { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 8px; }
.finding-card.hl h4 { font-size: 18.5px; }
.finding-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.finding-card .fc-more { margin-top: auto; padding-top: 14px; font-size: 11px; font-weight: 700; color: var(--accent); }
.finding-card .fc-more::after { content: ' →'; }

/* ===== SCROLLING VIEWS (data / findings / context) ===== */
.chart-view {
  position: fixed; inset: 0; top: 0;
  padding: 88px 36px 56px;
  overflow-y: auto; z-index: 1; display: none;
}
.view-intro { max-width: 1180px; margin: 0 auto 26px; }
.view-intro h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.view-intro h2 span { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
.view-intro p { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.view-intro .caveat { color: var(--accent); }

.chart-grid {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}
.chart-card {
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 18px 18px 16px; cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(20,24,29,0.04);
  display: flex; flex-direction: column;
}
.chart-card:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 18px 40px -18px var(--shadow), 0 0 0 1px var(--accent);
}
.chart-card h4 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.chart-card .unit {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--accent); margin: 2px 0 12px;
}
.chart-card .takeaway { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.45; }
.chart-card svg.barchart, #detail-panel svg.barchart { width: 100%; height: auto; display: block; }

/* legend chips */
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend i.bar-accent { background: var(--accent); }
.legend i.bar-ink { background: var(--ink); }
.legend i.bar-mute { background: #c9ccd2; }

/* bar fills */
.bar-accent { fill: var(--accent); }
.bar-ink { fill: var(--ink); }
.bar-mute { fill: #c9ccd2; }
.bar-dnf { fill: #eef0f3; stroke: #c9ccd2; stroke-width: 1; stroke-dasharray: 3 3; }

/* chart-mode detail panel overrides */
#detail-panel.mode-chart .panel-num .badge { display: none; }
#detail-panel.mode-chart .panel-illo { height: auto; display: block; margin-bottom: 16px; }
#detail-panel.mode-chart .panel-illo svg { height: auto; width: 100%; }
#detail-panel.mode-chart .panel-nav { display: none; }
#detail-panel .data-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12.5px; }
#detail-panel .data-table th, #detail-panel .data-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); }
#detail-panel .data-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
#detail-panel .data-table td.num { text-align: right; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; color: var(--ink); }
#detail-panel .data-table tr.hl td { background: var(--accent-soft); }
#detail-panel .note { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 14px; line-height: 1.5; padding: 10px 12px; background: var(--panel-soft); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; }

/* ===== INPUT → OUTPUT block ===== */
.io-block { max-width: 1180px; margin: 0 auto 30px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: stretch; }
.io-card { background: var(--panel); border: 1px solid var(--border-strong); border-radius: 16px; padding: 20px 22px; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(20,24,29,0.04); }
.io-card.io-in { border-top: 3px solid var(--ink); }
.io-card.io-out { border-top: 3px solid var(--accent); }
.io-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); margin-bottom: 6px; }
.io-tag.out { color: var(--accent); }
.io-card h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 12px; line-height: 1.25; }
.io-list { list-style: none; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.io-list li { padding-left: 16px; position: relative; margin-bottom: 7px; }
.io-list li::before { content: ''; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.io-list code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; background: var(--panel-soft); border: 1px solid var(--border); padding: 0 4px; border-radius: 3px; }
.io-arrow { display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--accent); font-weight: 700; }
.io-more { margin-top: auto; align-self: flex-start; background: none; border: none; color: var(--accent); font-weight: 700; font-size: 12.5px; cursor: pointer; padding: 14px 0 0; font-family: inherit; }
.io-more:hover { text-decoration: underline; }
@media (max-width: 820px) { .io-block { grid-template-columns: 1fr; } .io-arrow { transform: rotate(90deg); height: 26px; } }

/* ===== screenshot gallery (optional — add .shot-card blocks, see SKILL.md) ===== */
.gallery-head { max-width: 1180px; margin: 0 auto 12px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); }
.gallery-head span { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: 0; }
.shot-gallery { max-width: 1180px; margin: 0 auto 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.shot-card { background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; cursor: pointer; transition: all 0.2s; }
.shot-card:hover { border-color: var(--accent); box-shadow: 0 14px 32px -16px var(--shadow); transform: translateY(-3px); }
.shot-card .thumb { height: 148px; overflow: hidden; background: #f5f6f8; border-bottom: 1px solid var(--border); }
.shot-card .thumb img { width: 100%; display: block; object-fit: cover; object-position: top center; }
.shot-card .cap { padding: 9px 12px; font-size: 12.5px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shot-card .cap small { font-weight: 600; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.shot-card.flag .cap { color: var(--accent); }

/* ===== long-document cards (optional — fed by a JSON sidecar, see SKILL.md) ===== */
.brief-gallery { max-width: 1180px; margin: 0 auto 32px; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.brief-card { background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; cursor: pointer; transition: all 0.2s; box-shadow: 0 1px 2px rgba(20,24,29,0.04); display: flex; flex-direction: column; }
.brief-card:hover { border-color: var(--accent); box-shadow: 0 14px 32px -16px var(--shadow); }
.brief-card .brief-body { padding: 22px 26px; font-size: 13px; color: var(--ink-2); line-height: 1.55; max-height: 230px; overflow: hidden; position: relative; }
.brief-card .brief-body h5 { font-size: 16px; font-weight: 800; margin-bottom: 8px; color: var(--ink); }
.brief-card .brief-body::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(transparent, #fff); }
.brief-card .brief-foot { padding: 13px 26px; border-top: 1px solid var(--border); font-weight: 700; color: var(--accent); font-size: 12.5px; }

/* ===== rendered markdown / doc in panel ===== */
#detail-panel.mode-chart .panel-illo img { width: 100%; border-radius: 10px; border: 1px solid var(--border); display: block; }
.doc { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.doc h1, .doc h2, .doc h3 { letter-spacing: -0.01em; color: var(--ink); line-height: 1.25; }
.doc h1 { font-size: 19px; font-weight: 800; margin: 18px 0 8px; }
.doc h2 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.doc h3 { font-size: 14px; font-weight: 700; margin: 14px 0 6px; }
.doc h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin: 20px 0 8px; font-weight: 800; }
.doc ol { margin: 6px 0 6px 4px; padding-left: 18px; }
.doc ol li { padding: 4px 0; }
.doc blockquote { border-left: 3px solid var(--accent); padding: 4px 12px; margin: 10px 0; color: var(--muted); background: var(--panel-soft); border-radius: 0 6px 6px 0; }
.doc hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.doc p { margin: 8px 0; }
.doc em, .doc i { color: var(--muted); }
.doc pre { background: var(--panel-soft); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; line-height: 1.5; overflow-x: auto; white-space: pre-wrap; color: var(--ink); margin: 6px 0; }
.doc ul { list-style: none; margin: 6px 0; }
.doc ul li { padding: 5px 0 5px 16px; position: relative; }
.doc ul li::before { content: ''; position: absolute; left: 0; top: 12px; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.doc code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--panel-soft); border: 1px solid var(--border); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.doc th, .doc td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.doc th { font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; }
.doc td.num, .doc th.num { text-align: right; font-family: 'JetBrains Mono', monospace; }

/* ============================================================
   Ajouts projet — draft-mediatransport
   ============================================================ */

/* on laisse copier les chiffres dans les vues de lecture */
#detail-panel, .chart-view, footer { user-select: text; }

/* --- bascule de langue --- */
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.lang-switch button {
  appearance: none; border: 0; background: var(--panel); color: var(--muted);
  font: 600 11.5px/1 -apple-system, system-ui, sans-serif; letter-spacing: 0.06em;
  padding: 7px 10px; cursor: pointer; transition: background 0.18s, color 0.18s;
}
.lang-switch button + button { border-left: 1px solid var(--border); }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { background: var(--ink); color: #fff; }

/* --- pastille de couverture sur les cartes du canevas --- */
.cov {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; margin-bottom: 10px; align-self: flex-start;
}
.cov::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cov.full    { background: var(--accent-soft); color: var(--accent); }
.cov.partial { background: #fff5e6; color: #a86100; }
.cov.thin    { background: #f1f2f4; color: var(--muted); }

/* --- badges de source dans le panneau --- */
.src-badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 5px; margin-right: 8px;
  vertical-align: 2px;
}
.src-engie { background: var(--ink); color: #fff; }
.src-klek  { background: var(--accent); color: #fff; }
.src-gap   { background: #fff; color: #a86100; border: 1px solid #f0cc93; }

#panel-sections h3 .src-badge { vertical-align: 1px; }

/* --- vignette de la slide source dans le panneau --- */
.panel-slide { margin: 0 0 18px; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.panel-slide img { display: block; width: 100%; height: auto; }
.panel-slide figcaption {
  font-size: 11px; color: var(--muted); padding: 7px 10px;
  border-top: 1px solid var(--border); background: var(--panel-soft);
}

/* --- bandeau de chiffres-clés (onglet contexte) --- */
.kpi-row {
  max-width: 900px; margin: 0 auto 26px; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
}
.kpi {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 16px 16px 14px; text-align: left;
}
.kpi .v {
  font: 800 25px/1 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent); letter-spacing: -0.02em;
}
.kpi .k { font-size: 11.5px; color: var(--ink-2); margin-top: 7px; font-weight: 600; line-height: 1.35; }
.kpi .s { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }

/* --- bloc "ce que c'est" en tête de contexte --- */
.ctx-lead { max-width: 900px; margin: 0 auto 24px; font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.ctx-lead p { margin-bottom: 16px; }
.ctx-lead b { color: var(--ink); }

/* --- galerie des slides sources : on montre la slide entiere, pas un crop --- */
.shot-card .thumb { height: auto; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; }
.shot-card .thumb img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.shot-card .sub { padding: 0 12px 11px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.shot-card .cap { padding-bottom: 5px; }

/* --- note de réserve --- */
.caveat-box {
  max-width: 900px; margin: 0 auto 26px; border: 1px solid #f0cc93; background: #fffaf2;
  border-radius: 12px; padding: 16px 20px;
}
.caveat-box .ttl {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: #a86100; margin-bottom: 7px;
}
.caveat-box p { font-size: 14.5px; line-height: 1.6; color: var(--ink-2); margin: 0; }

@media (max-width: 760px) {
  header { flex-wrap: wrap; gap: 10px; }
  .kpi .v { font-size: 21px; }
}

/* la pastille de couverture prend de la place : illustration réduite */
.card .illo { height: 108px; margin: 2px 0 10px; }
.card .illo svg { height: 100px; }
