/* LT Design System: couleurs officielles COE Logistics & Transport */
:root {
  --blue: #3642B8;
  --blue-hover: #28328A;
  --blue-grad: #5E68C6;
  --ink: #222222;
  --slate: #263238;
  --grey: #5A5A5A;
  --light: #EEF3F8;
  --border: #B0BEC5;
  --white: #FFFFFF;
  --green: #2E7D32;
  --amber: #8A5200;
  --red: #B00020;
  /* Rayons: échelle cohérente */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  /* Surfaces & textes sémantiques (thème clair/sombre) */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #EEF3F8;
  --text: #222222;
  --text-muted: #5A5A5A;
  --border-soft: #EEF3F8;
  --panel: #263238;
  /* ---------- Design system: type scale (fluid, clamp) ---------- */
  --fs-xs: clamp(12px, 0.74rem + 0.05vw, 12.5px);
  --fs-sm: clamp(12.5px, 0.76rem + 0.12vw, 13.5px);
  --fs-base: clamp(14.5px, 0.86rem + 0.14vw, 16px);
  --fs-md: clamp(15px, 0.88rem + 0.22vw, 17px);
  --fs-lg: clamp(17px, 0.98rem + 0.40vw, 19px);
  --fs-xl: clamp(19px, 1.05rem + 0.70vw, 22px);
  --fs-2xl: clamp(21px, 1.10rem + 1.20vw, 26px);
  --fs-3xl: clamp(24px, 1.20rem + 1.80vw, 34px);
  /* ---------- Spacing scale (4px base, 8pt rhythm) ---------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 40px; --sp-8: 48px; --sp-9: 64px;
  /* ---------- Component geometry ---------- */
  --card-pad: var(--sp-4);
  --card-pad-lg: 22px;
  --card-radius: var(--r-md);
  --control-h: 44px;
  /* ---------- Elevation ---------- */
  --shadow-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
  --shadow-2: 0 2px 4px rgba(16,24,40,.06), 0 8px 20px rgba(16,24,40,.10);
  --shadow-3: 0 10px 30px rgba(16,24,40,.16), 0 4px 10px rgba(16,24,40,.08);
  --ring: 0 0 0 3px rgba(54,66,184,.35);
  /* ---------- Line heights ---------- */
  --lh-tight: 1.25; --lh-snug: 1.4; --lh-normal: 1.55; --lh-relaxed: 1.7;
  /* ---------- Semantic accents (AA on their own tint) ---------- */
  --ok: #1B5E20;     --ok-bg: #E6F4EA;
  --warn: #8A5200;   --warn-bg: #FFF4E0;
  --danger: #9C0006; --danger-bg: #FDECEA;
  --info: #28328A;   --info-bg: #E8F0FE;
  /* ---------- Section / table header tint (replaces the charcoal panel) ---------- */
  --head-bg: #EDF0FA;
  --head-border: #D5DAF2;
}
[data-theme="dark"] {
  --blue: #6E7BD8;
  --blue-hover: #8A95E4;
  --blue-grad: #4A55B0;
  --ink: #E7EAF0;
  --slate: #C9D0DA;
  --grey: #A8B0BC;
  --light: #232833;
  --border: #3A4350;
  --white: #1A1E24;
  --bg: #0F1115;
  --surface: #1A1E24;
  --surface-2: #232833;
  --text: #E7EAF0;
  --text-muted: #A8B0BC;
  --border-soft: #2A313C;
  --panel: #232833;
  --amber: #E8B04B;
  --shadow-1: 0 1px 2px rgba(0,0,0,.40), 0 1px 3px rgba(0,0,0,.30);
  --shadow-2: 0 2px 4px rgba(0,0,0,.40), 0 8px 20px rgba(0,0,0,.36);
  --shadow-3: 0 10px 30px rgba(0,0,0,.50), 0 4px 10px rgba(0,0,0,.34);
  --ring: 0 0 0 3px rgba(138,149,228,.45);
  --ok: #7BD389;     --ok-bg: #16281A;
  --warn: #E8B04B;   --warn-bg: #2A2113;
  --danger: #F08080; --danger-bg: #2A1618;
  --info: #9AA4FF;   --info-bg: #1B2036;
  --head-bg: #232833;
  --head-border: #36415a;
}

* { box-sizing: border-box; }

/* ---------- Accessibilité : focus clavier + skip-link + champs ---------- */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.topbar a:focus-visible, .topbar button:focus-visible,
.btn-primary:focus-visible, .btn-live:focus-visible,
.dl-btn:focus-visible, .pc-cta:focus-visible,
.faq-search button:focus-visible, .login-card button:focus-visible {
  outline-color: #fff;
}
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--blue);
  padding: 10px 16px; z-index: 200; border-radius: 0 0 var(--r-sm) 0;
  font-weight: 700; text-decoration: none; font-size: 14px;
}
.skip-link:focus { left: 0; }
input, textarea, select {
  background: var(--surface);
  color: var(--text);
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "DejaVu Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: var(--lh-normal);
}
body { font-size: var(--fs-base); }

.l10n { white-space: pre-line; overflow-wrap: break-word; }
/* Filet anti-débordement : contenus dynamiques (RAG, veille, listes): les mots
   longs (URLs, identifiants) se coupent au lieu de déborder du cadre sur mobile. */
.ask-answer, .faq-answer-body, .faq-hit .f-text, .faq-hit .f-full,
.d-title, .d-desc, .proj-text, .proj-list li, .council-summary,
.iv-summary, .iv-title, .health-card li, .health-list li,
.health-table td, .health-table th, .risk-table td { overflow-wrap: break-word; }

/* ---------- Work-in-progress stamp (top-left corner) ---------- */
.wip-stamp {
  position: fixed;
  top: 70px;
  left: 12px;
  z-index: 2000;
  pointer-events: none;
  transform: rotate(-8deg);
  border: 2px solid var(--blue);
  color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 4px;
  box-shadow: var(--shadow-2);
  opacity: 0.92;
}
[data-theme="dark"] .wip-stamp {
  color: #9aa4ff;
  border-color: #9aa4ff;
  background: rgba(30, 38, 48, 0.88);
}
/* Mobile : le tampon passe dans le flux, au-dessus de la barre, pour ne jamais couvrir le texte */
@media (max-width: 760px) {
  .wip-stamp {
    position: static;
    display: block;
    width: max-content;
    margin: 8px 12px 0;
    transform: rotate(-3deg);
    font-size: 0.68rem;
    padding: 4px 10px;
    opacity: 1;
  }
}

/* ---------- Header / nav ---------- */
.topbar {
  background: var(--blue);
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  flex-wrap: wrap;
  gap: 8px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { width: 34px; height: 34px; display: block; }
.brand .name { font-size: 16px; font-weight: 700; }
.brand .sub { font-size: 12px; opacity: .85; }

nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
nav a {
  color: #fff; text-decoration: none; padding: 8px 14px;
  border-radius: var(--r-xs); font-size: 14px; font-weight: 500;
}
nav a:hover { background: rgba(255,255,255,.14); }
nav a.active { background: rgba(255,255,255,.22); font-weight: 700; }
.lang-btn {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--r-xs); padding: 6px 12px; cursor: pointer; font-size: 13px; font-weight: 700;
}
.lang-btn:hover { background: rgba(255,255,255,.16); }
.pdf-btn {
  color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--r-xs); padding: 6px 12px; font-size: 13px; font-weight: 700;
  white-space: nowrap; margin-left: 2px;
}
.pdf-btn:hover { background: rgba(255,255,255,.16); }
.logout { color:#fff; text-decoration:none; font-size:13px; opacity:.85; margin-left:4px; }
.logout:hover { opacity:1; }
.nav-toggle {
  display: none; background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.6); border-radius: var(--r-xs);
  font-size: 20px; line-height: 1; padding: 6px 12px; cursor: pointer;
}
.nav-toggle:hover { background: rgba(255,255,255,.16); }

/* Nav regroupée: menu « Plus » (progressive disclosure) */
.nav-group { position: relative; }
.nav-more {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--r-xs); padding: 8px 14px; cursor: pointer;
  font-size: 14px; font-weight: 500;
}
.nav-more:hover, .nav-more.active { background: rgba(255,255,255,.14); }
.nav-dropdown {
  display: none; position: absolute; top: 100%; right: 0; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); box-shadow: var(--shadow-3);
  z-index: 60; padding: 6px 0; margin-top: 4px;
}
.nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown, .nav-group.open .nav-dropdown { display: block; }
.nav-dropdown a {
  display: block; color: var(--slate); padding: 9px 16px;
  font-size: 14px; border-radius: 0;
}
.nav-dropdown a:hover { background: var(--light); }
.nav-dropdown a.active { background: var(--light); color: var(--blue); font-weight: 700; }
.theme-btn {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6);
  border-radius: var(--r-xs); padding: 6px 12px; cursor: pointer;
  font-size: 15px; line-height: 1;
}
.theme-btn:hover { background: rgba(255,255,255,.16); }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }
.hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-grad) 100%);
  color: #fff; border-radius: var(--r-lg); padding: clamp(24px, 1.6vw + 16px, 40px) clamp(20px, 1.6vw + 14px, 38px); margin-bottom: var(--sp-5);
}
.hero h1 { margin: 0 0 10px; font-size: var(--fs-3xl); }
.hero .owner { font-size: 15px; opacity: .92; }
.hero .vision { font-size: 16px; margin-top: 16px; max-width: 820px; opacity: .95; }

h1.section, h2.section { color: var(--blue); font-size: var(--fs-xl); margin: 34px 0 16px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
h1.section { font-size: var(--fs-2xl); }

/* ---------- Pillars ---------- */
.pillar { margin-bottom: 26px; }
.pillar-head {
  background: var(--head-bg); color: var(--blue); border: 1px solid var(--head-border); border-radius: var(--r-sm);
  padding: 10px 16px; font-weight: 700; font-size: 15px; margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.pillar-count {
  background: var(--blue); color: #fff; border-radius: var(--r-lg);
  font-size: 12px; font-weight: 700; padding: 2px 10px; white-space: nowrap;
}
.agent-subhead {
  color: var(--blue); font-weight: 700; font-size: 14px;
  margin: 18px 0 10px; display: flex; align-items: center; gap: 8px;
}
.agent-subcount {
  background: var(--light); color: var(--slate); border-radius: var(--r-md);
  font-size: 12px; font-weight: 700; padding: 2px 8px;
}
.dlv-count {
  margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--blue);
  background: var(--light); border-radius: var(--r-xs); padding: 6px 10px;
}
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }

/* ---------- Agent card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--card-pad-lg); box-shadow: var(--shadow-1); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column;
}
.card .agent-name { color: var(--blue); font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.card .tagline { color: var(--grey); font-size: 13px; margin-bottom: 12px; }
.card .mission { font-size: 14px; margin-bottom: 12px; }
.card .resp-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--slate); font-weight: 700; margin-bottom: 6px; }
.card ul { margin: 0 0 12px; padding-left: 18px; font-size: 13.5px; }
.card ul li { margin-bottom: 5px; }
.milestone {
  margin-top: auto; background: var(--light); border-left: 4px solid var(--blue);
  padding: 10px 12px; font-size: 13px; border-radius: 0 4px 4px 0;
}
.milestone .mil-label { font-weight: 700; color: var(--blue); }

/* ---------- Deliverables ---------- */
.deliverable {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--card-pad-lg); margin-bottom: var(--sp-4); box-shadow: var(--shadow-1);
}
.deliverable .d-title { font-size: 16px; font-weight: 700; color: var(--slate); }
.deliverable .d-meta { display: flex; gap: 14px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.deliverable .d-desc { font-size: 14px; color: var(--grey); margin-bottom: 12px; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-lg); text-transform: uppercase; letter-spacing: .4px; }
.badge.final { background: #e6f4ea; color: var(--green); }
.badge.wip { background: var(--light); color: var(--blue); }
.badge.type { background: var(--light); color: var(--slate); }

/* ---------- RAG : bloc pédagogique « qu'est-ce qu'un RAG ? » (page Ask) ---------- */
.rag-explainer{background:var(--light);border:1px solid var(--border);border-radius:14px;padding:18px 20px;margin:18px 0 22px;}
.rag-explainer-head{display:flex;align-items:center;gap:10px;margin-bottom:8px;flex-wrap:wrap;}
.rag-explainer-head h2{margin:0;font-size:19px;}
.rag-explainer-badge{background:var(--blue);color:#fff;font-size:11.5px;font-weight:700;letter-spacing:.08em;padding:3px 9px;border-radius:999px;}
.rag-explainer-def{margin:0 0 14px;font-size:14px;line-height:1.55;color:var(--ink);}
.rag-steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
.rag-step{background:#fff;border:1px solid var(--border);border-radius:12px;padding:12px 13px;display:flex;gap:10px;align-items:flex-start;}
.rag-step-ic{font-size:19px;line-height:1;}
.rag-step-tx{display:flex;flex-direction:column;gap:3px;}
.rag-step-tx b{font-size:13px;color:var(--blue);}
.rag-step-tx span{font-size:12.5px;color:var(--grey);line-height:1.45;}
.rag-explainer-note{margin:14px 0 0;font-size:12.5px;color:var(--grey);font-style:italic;}

/* ---------- RAG : bandeau « comment cette réponse a été construite » ---------- */
.rag-strip{background:#fff;border:1px solid var(--border);border-left:4px solid var(--blue);border-radius:10px;padding:11px 13px;margin:10px 0 14px;}
.rag-strip-t{font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--blue);margin-bottom:9px;}
.rag-funnel{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.rag-box{flex:1 1 110px;min-width:96px;background:var(--light);border:1px solid var(--border);border-radius:9px;padding:7px 10px;display:flex;flex-direction:column;text-align:center;}
.rag-box b{font-size:17px;color:var(--ink);line-height:1.15;}
.rag-box span{font-size:11px;color:var(--grey);line-height:1.3;}
.rag-box.on{background:var(--blue);border-color:var(--blue);}
.rag-box.on b,.rag-box.on span{color:#fff;}
.rag-arrow{color:var(--grey);font-size:15px;}
.rag-note{margin-top:9px;font-size:11.5px;color:var(--grey);}
/* pastille de langue sur une source citee (document encore en francais) */
.f-lang{display:inline-block;background:#FFF4E0;color:#9E3B00;border:1px solid #F0D080;border-radius:4px;font-size:10.5px;font-weight:700;padding:0 5px;margin-right:6px;vertical-align:1px;}
.rag-warn{margin-top:7px;font-size:12px;color:#9E3B00;font-weight:600;}
.fa-msg .rag-strip{margin:8px 0 10px;padding:9px 10px;}
.fa-msg .rag-box b{font-size:15px;}
.fa-msg .rag-box span{font-size:10.5px;}
.fa-msg .rag-note{font-size:11px;}

/* ---------- Base de connaissance (Setup > Santé) ---------- */
.kb-panel{background:#fff;border:1px solid var(--border);border-radius:14px;padding:18px 20px;margin:0 0 22px;}
.kb-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.kb-head h2{margin:0;font-size:20px;}
.kb-ic{font-size:20px;}
.kb-tag{background:var(--light);color:var(--blue);font-size:11.5px;font-weight:700;padding:3px 9px;border-radius:999px;}
.kb-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(132px,1fr));gap:10px;margin:14px 0 18px;}
.kb-kpi{background:var(--light);border-radius:10px;padding:11px 12px;}
.kb-kpi-v{font-size:20px;font-weight:800;color:var(--blue);line-height:1.1;}
.kb-kpi-l{font-size:11.5px;color:var(--grey);margin-top:3px;}
.kb-bars{display:flex;flex-direction:column;gap:8px;}
.kb-bar-row{display:grid;grid-template-columns:190px 1fr 92px;align-items:center;gap:10px;}
.kb-bar-l{font-size:12.5px;color:var(--ink);}
.kb-bar-track{background:var(--light);border-radius:999px;height:12px;overflow:hidden;}
.kb-bar-fill{display:block;height:100%;background:var(--blue);border-radius:999px;}
.kb-bar-v{font-size:12.5px;color:var(--ink);text-align:right;font-variant-numeric:tabular-nums;}
.kb-bar-share{color:var(--grey);margin-left:6px;font-size:11.5px;}
.kb-foot{margin-top:12px;font-size:11.5px;color:var(--grey);}
.kb-gap{margin-top:16px;background:#FFF8E1;border:1px solid #F0D080;border-radius:10px;padding:12px 14px;}
.kb-gap h3{margin:0 0 6px;font-size:14px;color:#5a4a10;}
.kb-gap h3 .count{display:inline-block;margin-left:6px;background:#fff;color:#5a4a10;border:1px solid #E0C070;border-radius:999px;padding:0 8px;font-size:12px;vertical-align:1px;}
.kb-gap-list{margin:8px 0 0;padding-left:18px;font-size:12.5px;color:#5a4a10;line-height:1.5;}
.kb-ok{margin-top:14px;font-size:12.5px;color:#1e8e3e;font-weight:600;}
@media(max-width:760px){
  .rag-steps{grid-template-columns:1fr;}
  .rag-arrow{display:none;}
  .rag-box{flex:1 1 100%;}
  .kb-bar-row{grid-template-columns:1fr;gap:4px;}
  .kb-bar-v{text-align:left;}
}
.badge.review { background: #fff4e0; color: var(--amber); }
.badge.draft  { background: #fdecea; color: var(--red); }
.dl-group { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-btn {
  display: inline-block; background: var(--blue); color: #fff; text-decoration: none;
  padding: 8px 16px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600;
}
.dl-btn:hover { background: var(--blue-hover); }
.dl-btn .label { font-size: 12px; opacity: .85; }
.dl-btn .ext {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  background: rgba(255,255,255,.22); border-radius: 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px; vertical-align: 1px;
}
/* The version and the write time of a file, next to the button that hands it over: a reader has
   to be able to tell which build they are taking. Grey and small, so it informs without competing
   with the file it belongs to. */
.d-stamp {
  color: var(--grey); font-size: 12.5px; align-self: center;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
footer {
  text-align: center; color: var(--grey); font-size: 12.5px;
  padding: 22px; border-top: 1px solid var(--border); margin-top: 20px;
}

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--blue), var(--blue-grad)); padding: 20px; }
.login-card { background: var(--surface); border-radius: var(--r-md); padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: var(--shadow-3); }
.login-card h1 { color: var(--blue); font-size: 22px; margin: 0 0 6px; }
.login-card .sub { color: var(--grey); font-size: 13.5px; margin-bottom: 24px; }
.login-card label { font-size: 13px; font-weight: 700; color: var(--slate); display: block; margin-bottom: 6px; }
.login-card input[type=password] {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 15px; margin-bottom: 8px;
}
.login-card button {
  width: 100%; background: var(--blue); color: #fff; border: none; border-radius: var(--r-sm);
  padding: 12px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 10px;
}
.login-card button:hover { background: var(--blue-hover); }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 6px; }

/* ---------- Responsive ---------- */
/* Nav hamburger (tablette + mobile) */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .topbar { justify-content: space-between; }
  .topbar nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 4px 0 12px;
  }
  .topbar nav.open { display: flex; }
  .topbar nav a { padding: 10px 12px; font-size: 15px; }
  .topbar nav .lang-btn { align-self: flex-start; margin-top: 8px; }
  .topbar nav .logout { align-self: flex-start; margin: 8px 0 0 0; padding: 8px 12px; }
}

/* Mobile */
@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .container { padding: 18px 14px 48px; }
  .hero { padding: 26px 20px; }
  h1.section, h2.section { margin: 26px 0 12px; }
  .agent-grid, .act-grid { grid-template-columns: 1fr; }
  .brand .name { font-size: 14px; }
  .brand .sub { display: none; }
  .brand .logo { width: 28px; height: 28px; }

  /* KPIs : 2 par ligne */
  .act-summary, .risk-kpis { gap: 8px; }
  .kpi { flex: 1 1 44%; min-width: 0; padding: 12px 14px; }
  .kpi .num { font-size: 20px; }

  /* Dashboard feed : empiler les lignes */
  .act-feed .row { flex-wrap: wrap; gap: 4px 10px; padding: 12px 14px; }
  .act-feed .when, .act-feed .who { min-width: 0; }
  .act-feed .who { width: 100%; }

  /* FAQ : bouton sous l'input */
  .faq-search { flex-direction: column; }
  .faq-search button { width: 100%; }

  /* Tables risques : scroll horizontal */
  #risk-kri, #risk-roadmap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .risk-table { min-width: 0; }  /* was 620px, which forced the whole page to scroll sideways */

  /* Matrice risques : cellules compactes */
  .risk-grid { grid-template-columns: 52px repeat(5, minmax(44px, 1fr)); }
  .m-cell { min-height: 44px; }
  .m-risk { font-size: 12px; padding: 1px 4px; }

  /* Deliverables / brand : cartes plus petites */
  .swatch { width: 46%; }
  .brand-logos .logo-card { width: 140px; }
  .logo-demo { height: 110px; }
  .logo-demo img { width: 80px; height: 80px; }

  /* Ask : boutons pleine largeur */
  .ask-controls { flex-direction: column; }
  .btn-primary, .btn-live { width: 100%; }
}

/* =========================================================
   PHASE 2: Dashboard / FAQ / Ask
   ========================================================= */
.page-sub { color: var(--grey); font-size: var(--fs-sm); margin: -8px 0 18px; max-width: 860px; }

/* ---------- Dashboard activité ---------- */
.act-summary {
  display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px 18px; flex: 1 1 150px; min-width: 130px;
}
.kpi .num { font-size: 24px; font-weight: 800; color: var(--blue); }
.kpi .lbl { font-size: 12px; color: var(--grey); text-transform: uppercase; letter-spacing: .5px; }

.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 26px; }
.act-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--card-pad-lg); box-shadow: var(--shadow-1); }
.act-card .a-name { font-size: 16px; font-weight: 800; color: var(--blue); margin-bottom: 2px; }
.act-card .a-tag { font-size: 12.5px; color: var(--grey); margin-bottom: 12px; min-height: 17px; }
.act-card .a-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--slate); margin-bottom: 10px; }
.act-card .a-stats b { color: var(--ink); }
.act-card .a-last { font-size: 12.5px; color: var(--grey); border-top: 1px solid var(--light); padding-top: 9px; }
.act-card .a-last .lv { color: var(--blue); font-weight: 600; }

.act-feed { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.act-feed .row { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--light); font-size: 13.5px; }
.act-feed .row:last-child { border-bottom: none; }
.act-feed .when { min-width: 120px; color: var(--grey); font-size: 12.5px; }
.act-feed .who { min-width: 150px; color: var(--blue); font-weight: 700; }
.act-feed .what { flex: 1; color: var(--ink); }
.act-feed .meta { color: var(--grey); font-size: 12px; white-space: nowrap; }
.act-stamp { color: var(--grey); font-size: 12px; text-align: right; margin-top: 8px; }

/* ---------- FAQ ---------- */
.faq-search { display: flex; gap: 10px; margin-bottom: 8px; }
.faq-search input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 15px; font-family: inherit;
}
.faq-search input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.faq-search button {
  background: var(--blue); color: #fff; border: none; border-radius: var(--r-sm);
  padding: 12px 22px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.faq-search button:hover { background: var(--blue-hover); }
.faq-hint { color: var(--grey); font-size: 13px; margin-bottom: 18px; }

.faq-hit {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue);
  border-radius: var(--r-sm); padding: 16px 18px; margin-bottom: 14px;
}
.faq-hit .f-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.faq-hit .f-label {
  background: var(--blue); color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-lg);
}
.faq-hit .f-label.recital { background: var(--blue); }
.faq-hit .f-label.annex { background: var(--amber); }
.faq-hit .f-title { font-weight: 700; color: var(--slate); font-size: 14.5px; }
.faq-hit .f-score { margin-left: auto; color: var(--grey); font-size: 12px; }
.faq-hit .f-text { font-size: 14px; color: var(--ink); line-height: 1.6; }
.faq-answer {
  background: var(--light); border: 1px solid var(--blue); border-radius: var(--r-sm);
  padding: 16px 18px; margin-bottom: 18px;
}
.faq-answer-head { font-weight: 700; color: var(--blue); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.faq-answer-body { font-size: 15px; color: var(--ink); line-height: 1.65; }
.faq-answer-body br { line-height: 1.5; }
.faq-warn { margin-top: 10px; padding: 8px 12px; background: #fff7e6; border: 1px solid var(--amber); border-radius: var(--r-sm); color: #7a4d00; font-size: 13px; font-weight: 600; }
.faq-answer-src { margin-top: 10px; font-size: 12.5px; color: var(--grey); border-top: 1px solid var(--border); padding-top: 8px; }
.faq-answer-loading { color: var(--grey); font-size: 14px; font-style: italic; }
.faq-answer .cite { color: var(--blue); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--blue); cursor: pointer; }
.faq-answer .cite:hover { background: var(--light); }
.faq-answer-src-head { margin-top: 14px; font-weight: 700; color: var(--slate); font-size: 13px; }
.faq-answer-srcs { margin-top: 8px; }
.faq-hit .f-more { margin-top: 8px; background: none; border: none; color: var(--blue); font-size: 12.5px; cursor: pointer; padding: 0; font-weight: 600; }
.faq-hit .f-more:hover { text-decoration: underline; }
.faq-hit .f-full { margin-top: 6px; font-size: 14px; color: var(--ink); line-height: 1.6; white-space: pre-wrap; }
.doc-proj { margin-bottom: 24px; }
.doc-count { font-size: 12px; color: var(--grey); background: var(--light); padding: 2px 8px; border-radius: var(--r-md); font-weight: 600; }
.doc-empty { color: var(--grey); font-size: 13px; font-style: italic; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--light); font-size: 14px; }
.doc-list li a { color: var(--blue); text-decoration: none; word-break: break-all; }
.doc-list li a:hover { text-decoration: underline; }
.doc-size { margin-left: auto; color: var(--grey); font-size: 12px; white-space: nowrap; }
.doc-date { color: var(--grey); font-size: 12px; white-space: nowrap; min-width: 76px; text-align: right; }
.doc-stamp { color: var(--grey); font-size: 12px; margin: 10px 0 0; }
.doc-summary { color: var(--slate); font-size: 13px; font-weight: 600; margin: 4px 0 10px; }
.doc-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 22px; padding: 14px; background: var(--light); border-radius: var(--r-lg); }
.doc-proj-sel { min-width: 200px; flex: 1 1 auto; }
.doc-file { flex: 1 1 auto; min-width: 180px; font-size: 13px; }
.doc-status { font-size: 13px; color: var(--grey); }

/* ---------- Ask ---------- */
.ask-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; margin-bottom: 16px; }
.ask-box textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px;
  font-size: 15px; font-family: inherit; resize: vertical;
}
.ask-box textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.ask-controls { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btn-primary, .btn-live {
  border: none; border-radius: var(--r-sm); padding: 11px 20px; font-size: 14.5px;
  font-weight: 700; cursor: pointer;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-live { background: var(--green); color: #fff; }
.btn-live:hover { background: #1b5e20; }
.btn-ghost { border: 1px solid var(--blue); background: var(--surface); color: var(--blue); }
.btn-ghost:hover { background: var(--light); }
.btn-ghost:disabled { opacity: .55; cursor: progress; }
.btn-primary:disabled, .btn-live:disabled { opacity: .55; cursor: progress; }

.ask-status { font-size: 13.5px; color: var(--slate); min-height: 20px; margin-bottom: 8px; }
.ask-status .spin { color: var(--blue); font-weight: 700; }
.ask-routing { margin-bottom: 14px; }
.ask-routing .route-line { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--grey); flex-wrap: wrap; }
.ask-routing .route-pill {
  background: var(--light); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 4px 12px; font-size: 13px; color: var(--slate);
}
.ask-routing .route-pill.sel { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.ask-answer {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px;
  font-size: 15px; line-height: 1.65; white-space: pre-wrap; display: none;
}
.ask-answer .a-meta {
  display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--grey);
  border-bottom: 1px solid var(--light); padding-bottom: 9px; margin-bottom: 12px; flex-wrap: wrap;
}
.ask-answer .badge-live { background: #e6f4ea; color: var(--green); }
.ask-answer .badge-grounded { background: var(--light); color: var(--slate); }

/* ---------- Sous-titres de section (pages Risques/Brand) ---------- */
.sub-section { color: var(--slate); font-size: var(--fs-md); margin: 28px 0 12px; font-weight: 700; }

/* ---------- Risques : KPIs ---------- */
.risk-kpis { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.risk-kpis .kpi { min-width: 110px; }

/* ---------- Risques : matrice 5×5 ---------- */
.risk-matrix-wrap { overflow-x: auto; margin-bottom: 10px; }

/* ---------- Note de provenance du coût (dashboard activité) ---------- */
.cost-note { color: var(--grey); font-size: 12px; line-height: 1.55; margin: 8px 0 14px; }
.cost-note b { color: var(--slate); }

/* ---------- Bulles d'aide (tooltips) : survol, clavier, appui mobile ----------
   Une seule couche .tt-layer en position fixe (jamais rognee par un tableau qui
   a overflow:hidden). Les declencheurs portent data-tip. */
.tt { border-bottom: 1px dotted rgba(54, 66, 184, .55); cursor: help; outline: none; }
.tt:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
.tt-inline { font-weight: 700; }
.tt-h { border-bottom-style: dotted; }
th .tt, .kpi .lbl .tt, .pp-stat .l .tt { padding-bottom: 1px; }
.tt-layer {
  display: none; position: fixed; z-index: 200; pointer-events: none;
  max-width: min(400px, 86vw);
  background: #222222; color: #FFFFFF; font-size: 12.5px; font-weight: 400; line-height: 1.5;
  padding: 10px 12px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  text-align: left; white-space: normal;
}
.tt-layer b { color: #FFFFFF; }

/* ---------- Echelle de criticité (explications) ---------- */
.risk-scale { margin: 6px 0 18px; }
.risk-scale .scale-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.risk-scale .scale-col {
  flex: 1 1 300px; min-width: 260px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px;
}
.risk-scale .scale-title { font-weight: 800; color: var(--blue); font-size: 13.5px; margin-bottom: 8px; }
.risk-scale .scale-row { display: flex; gap: 8px; font-size: 12.5px; color: var(--ink); padding: 3px 0; align-items: baseline; }
.risk-scale .scale-k { font-family: monospace; font-weight: 800; color: var(--slate); min-width: 22px; }
.risk-scale .scale-sub { color: var(--grey); }
.risk-scale .scale-note { margin-top: 8px; font-size: 12px; color: var(--grey); font-style: italic; }
.risk-scale .dot-k { display: inline-block; width: 10px; height: 10px; border-radius: 50%; min-width: 10px; }
.risk-scale .dot-k.low { background: #C6EFCE; }
.risk-scale .dot-k.med { background: #FFEB9C; }
.risk-scale .dot-k.high { background: #FFC7CE; }
.r-status { font-size: 11.5px; font-weight: 700; color: var(--slate); background: var(--light); padding: 2px 8px; border-radius: var(--r-lg); }
.risk-grid {
  display: grid;
  grid-template-columns: 92px repeat(5, minmax(64px, 1fr));
  grid-auto-rows: minmax(62px, auto);
  gap: 3px;
  max-width: 760px;
}
.m-corner, .m-head, .m-row-label {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--grey);
  background: var(--light); border-radius: var(--r-xs); text-align: center; padding: 4px;
}
.m-head { background: var(--blue); color: #fff; }
.m-cell {
  border-radius: var(--r-xs); display: flex; align-items: center; justify-content: center;
  padding: 5px; min-height: 60px; flex-wrap: wrap; gap: 3px;
}
.m-cell.c-green  { background: #C6EFCE; color: #006100; }
.m-cell.c-orange { background: #FFEB9C; color: #8A5200; }
.m-cell.c-red    { background: #FFC7CE; color: #9C0006; }
.m-risk {
  font-size: 12px; font-weight: 800; background: rgba(255,255,255,.7);
  border-radius: var(--r-xs); padding: 2px 6px; cursor: help;
}
.risk-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--slate); margin-bottom: 6px; }
.risk-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Risques : registre ---------- */
.risk-card {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--grey);
  border-radius: var(--card-radius); padding: var(--card-pad); box-shadow: var(--shadow-1); margin-bottom: 12px;
}
.risk-card.r-red    { border-left-color: #C00000; }
.risk-card.r-orange { border-left-color: #E8A200; }
.risk-card.r-green  { border-left-color: #2E7D32; }
.risk-card .r-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.risk-card .r-id { font-weight: 800; font-size: 12.5px; color: var(--slate); font-family: monospace; }
.risk-card .r-title { font-weight: 700; font-size: 15px; }
.risk-card .r-level { font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: var(--r-lg); text-transform: uppercase; }
.risk-card .r-level.red    { background: #FFC7CE; color: #9C0006; }
.risk-card .r-level.orange { background: #FFEB9C; color: #8A5200; }
.risk-card .r-level.green  { background: #C6EFCE; color: #006100; }
.risk-card .r-meta { color: var(--grey); font-size: 12.5px; margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.risk-card .r-toggle { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 13px; padding: 2px 0; margin-left: auto; font-weight: 700; }
.risk-card .r-body { margin-top: 10px; font-size: 13.5px; display: none; border-top: 1px solid var(--light); padding-top: 10px; }
.risk-card .r-body.open { display: block; }
.risk-card .r-row { margin-bottom: 8px; }
.risk-card .r-row .lbl { font-weight: 700; color: var(--slate); }

/* ---------- Risques : taxonomie ---------- */
.taxo-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 13px 18px; margin-bottom: 10px; }
.taxo-group .t-cat { font-weight: 800; color: var(--blue); font-size: 14.5px; }
.taxo-group .t-count { color: var(--grey); font-size: 12px; }
.taxo-sub { margin: 7px 0 0 4px; font-size: 13.5px; }
.taxo-sub .t-sub { font-weight: 700; color: var(--slate); }
.taxo-sub .t-ex { color: var(--grey); }

/* ---------- Risques : KRI & Roadmap (tables) ---------- */
.risk-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); font-size: 13px; margin-bottom: 8px; }
.risk-table th { background: var(--head-bg); color: var(--blue); border-bottom: 2px solid var(--head-border); text-align: left; padding: 8px 10px; font-size: 12px; }
.risk-table td { padding: 8px 10px; border-top: 1px solid var(--light); vertical-align: top; }
.risk-table tr:nth-child(even) td { background: var(--light); }
.risk-table td.mono { font-family: monospace; font-size: 12px; white-space: nowrap; }
.thr-green  { color: #006100; font-weight: 700; }
.thr-orange { color: #8A5200; font-weight: 700; }
.thr-red    { color: #9C0006; font-weight: 700; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: var(--r-md); }
.pill.p1 { background: #FFC7CE; color: #9C0006; }
.pill.p2 { background: #FFEB9C; color: #8A5200; }
.pill.p3 { background: #C6EFCE; color: #006100; }

/* ---------- Brand / design system ---------- */
.brand-logos { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.logo-card { width: 200px; text-align: center; }
.logo-demo {
  border: 1px solid var(--border); border-radius: var(--r-md); height: 150px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.logo-demo img { width: 110px; height: 110px; }
.logo-cap { font-size: 12.5px; color: var(--grey); }
.brand-swatches { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.swatch { width: 158px; }
.swatch .sw {
  height: 64px; border-radius: var(--r-sm); border: 1px solid var(--border);
  display: flex; align-items: flex-end; padding: 6px 8px;
  font-size: 12px; font-weight: 700; font-family: monospace; letter-spacing: .5px;
}
.swatch .sw-name { font-weight: 800; font-size: 13px; margin-top: 6px; }
.swatch .sw-desc { font-size: 12px; color: var(--grey); margin-top: 2px; }
.brand-typo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 18px; max-width: 440px; }
.typo-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--light); font-size: 13.5px; }
.typo-row:last-child { border-bottom: none; }
.typo-lbl { font-weight: 700; }
.typo-spec { color: var(--grey); font-family: monospace; }
.brand-note { background: #fff4e0; border: 1px solid #e8c48a; border-radius: var(--r-sm); padding: 12px 16px; font-size: 13px; color: #7a5200; margin-top: 20px; }

/* ---------- Rapports ---------- */
.report-actions { margin-bottom: 6px; }
.report-status { min-height: 22px; font-size: 13.5px; color: var(--slate); margin-bottom: 6px; }
.report-status .spin { color: var(--blue); font-weight: 700; }
.report-list { margin-top: 6px; }
.report-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--light); flex-wrap: wrap; }
.report-row:last-child { border-bottom: none; }
.report-row .report-date { color: var(--grey); font-size: 12.5px; }
.report-empty { color: var(--grey); font-size: 13.5px; padding: 10px 0; }

/* =========================================================
   Accueil « programme » + fiches projet
   ========================================================= */
.hero-badge {
  display: inline-block; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.4); font-size: 12px; font-weight: 700;
  letter-spacing: .4px; padding: 4px 12px; border-radius: var(--r-lg); margin-bottom: 14px;
}
.hero-cta {
  display: inline-block; margin-top: 20px; background: var(--surface); color: var(--blue);
  text-decoration: none; padding: 11px 22px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 700;
}
.hero-cta:hover { background: var(--light); }

.kpi-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin: 0 0 8px;
}
.kpi-band .kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px; text-align: center; }
.kpi-band .kpi .num { font-size: 28px; font-weight: 800; color: var(--blue); }
.kpi-band .kpi .lbl { font-size: 12px; color: var(--grey); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.kpi-band a.kpi { text-decoration: none; display: flex; flex-direction: column; justify-content: center; }
.kpi-band a.kpi .num { font-size: 16px; font-weight: 800; }
.kpi-band a.kpi:hover { border-color: var(--blue); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px 22px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.project-card:hover { box-shadow: var(--shadow-3); transform: translateY(-2px); border-color: var(--blue); }
.pc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-pillar {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--slate); background: var(--light); border-radius: var(--r-md); padding: 2px 10px;
}
.pc-status { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--green); background: #e6f4ea; border-radius: var(--r-md); padding: 2px 10px; }
.pc-status.coming { color: var(--grey); background: var(--light); }
.pc-name { color: var(--blue); font-size: var(--fs-lg); font-weight: 800; text-decoration: none; line-height: 1.25; }
a.pc-name:hover { text-decoration: underline; }
.pc-tagline { color: var(--grey); font-size: 13px; }
.pc-milestone {
  font-size: 12.5px; background: var(--light); border-left: 3px solid var(--blue);
  border-radius: 0 4px 4px 0; padding: 8px 10px; color: var(--slate);
}
.pc-milestone .ml-label { font-weight: 700; color: var(--blue); }
.pc-actions { display: flex; align-items: center; gap: 12px; margin-top: auto; flex-wrap: wrap; }
.pc-cta { background: var(--blue); color: #fff; text-decoration: none; padding: 8px 14px; border-radius: var(--r-sm); font-size: 13px; font-weight: 700; }
.pc-cta:hover { background: var(--blue-hover); }
.pc-cta.disabled { background: var(--light); color: var(--grey); cursor: default; }
.pc-chip { color: var(--blue); text-decoration: none; font-size: 13px; font-weight: 700; padding: 8px 2px; }
.pc-chip:hover { text-decoration: underline; }

.card .agent-name { text-decoration: none; }
.card .agent-name:hover { text-decoration: underline; }
.card .pc-cta { margin-top: 12px; align-self: flex-start; }

.coming-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.coming-card { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--card-radius); padding: var(--card-pad); display: flex; flex-direction: column; gap: 8px; opacity: .85; }
.coming-badge {
  align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--grey);
  background: var(--light); border-radius: var(--r-md); padding: 2px 10px;
  text-transform: uppercase; letter-spacing: .4px;
}
.coming-name { color: var(--slate); font-weight: 700; font-size: 14.5px; }

/* --- Fiche projet --- */
.proj-hero {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-grad) 100%);
  color: #fff; border-radius: var(--r-lg); padding: clamp(24px, 1.6vw + 16px, 40px) clamp(20px, 1.6vw + 14px, 38px); margin-bottom: var(--sp-5);
}
.proj-hero .crumb { font-size: 13px; opacity: .85; margin-bottom: 12px; }
.proj-hero .crumb a { color: #fff; }
.proj-hero h1 { margin: 0 0 8px; font-size: var(--fs-3xl); }
.proj-hero .tagline { font-size: 15px; opacity: .92; margin-bottom: 16px; }
.proj-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pb { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: var(--r-lg); background: rgba(255,255,255,.18); }
.proj-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px 24px; margin-bottom: 18px; }
.proj-section h2 { color: var(--blue); font-size: 17px; margin: 0 0 12px; }
.proj-section h2 .count { background: var(--light); color: var(--slate); font-size: 12px; border-radius: var(--r-md); padding: 2px 8px; margin-left: 6px; vertical-align: middle; }
.proj-text { font-size: var(--fs-base); color: var(--ink); margin: 0; }
.proj-list { margin: 0; padding-left: 20px; font-size: 14px; }
.proj-list li { margin-bottom: 7px; }
.crosslinks { display: flex; gap: 10px; flex-wrap: wrap; }
.crosslinks a {
  background: var(--light); color: var(--blue); text-decoration: none;
  border: 1px solid var(--border); padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 700;
}
.crosslinks a:hover { border-color: var(--blue); }

/* Responsive: composants accueil + fiches projet */
@media (max-width: 640px) {
  .kpi-band { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-band .kpi { padding: 14px 12px; }
  .kpi-band .kpi .num { font-size: 24px; }
  .project-grid { grid-template-columns: 1fr; }
  .coming-grid { grid-template-columns: 1fr; }
  .proj-hero { padding: 26px 20px; }
  .proj-section { padding: 18px 16px; }
  .hero-cta { padding: 10px 16px; font-size: 13.5px; }
}

/* --- Entretiens (insights) --- */
.interview {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 18px 20px; margin-bottom: 14px;
}
.iv-head {
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--blue); font-weight: 700; margin: 12px 0 6px;
}
.iv-list { margin: 0; padding-left: 18px; font-size: 13.5px; }
.iv-list li { margin-bottom: 5px; }
.iv-meta { color: var(--grey); font-size: 12px; font-weight: 400; }
.iv-meta-line { color: var(--grey); font-size: 12.5px; margin: 6px 0 2px; }
.iv-disclaimer { color: var(--grey); font-size: 12px; font-style: italic; margin: 4px 0 10px; }
.iv-summary { font-size: 14px; color: var(--ink); margin-bottom: 10px; }
.iv-section { margin-bottom: 12px; }
.iv-heading { font-size: 13.5px; font-weight: 700; color: var(--slate); margin: 10px 0 6px; }
.iv-speaker { color: var(--grey); font-size: 12px; font-weight: 400; }

/* --- Entretiens : CRUD + chronomètre --- */
.iv-create { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 20px; }
.iv-create textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; font-size: 14.5px; font-family: inherit; resize: vertical; }
.iv-create textarea:focus, .iv-create input:focus, .iv-create select:focus { outline: none; border-color: var(--blue); }
.iv-create-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.iv-create-row select, .iv-create-row input { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 14px; font-family: inherit; }
.iv-create-row select { min-width: 200px; }
.iv-create-row input { flex: 1; min-width: 200px; }
.iv-status { font-size: 13.5px; color: var(--slate); min-height: 20px; margin-top: 8px; }
.iv-hint { font-size: 13px; color: var(--slate); margin: 0 0 12px; }
.iv-record-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.iv-rec-status { font-size: 13.5px; color: var(--slate); font-variant-numeric: tabular-nums; }

.council { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 20px; }
.council-summary { font-size: 14.5px; color: var(--slate); margin: 10px 0; }
.council-list { margin: 6px 0 0; padding-left: 0; list-style: none; }
.council-list li { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.council-list li:last-child { border-bottom: none; }
.council-prio { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; padding: 1px 7px; border-radius: var(--r-md); margin-right: 6px; vertical-align: middle; }
.council-prio.high { background: #fdecea; color: var(--red); }
.council-prio.medium { background: #fff4e0; color: #8A5200; }
.council-prio.low { background: var(--light); color: var(--slate); }
.council-run input { flex: 1; min-width: 240px; }
.health-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.health-score-wrap { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 16px; flex-wrap: wrap; }
.health-score { font-size: 44px; font-weight: 800; line-height: 1; }
.health-score span { font-size: 18px; font-weight: 700; color: var(--grey); }
.health-score.good { color: #1e8e3e; }
.health-score.warn { color: #8A5200; }
.health-score.bad { color: var(--red); }
.health-gen { font-size: 13px; color: var(--slate); }
.health-issues { background: #fff7e6; border: 1px solid #ffe1a8; border-radius: var(--r-md); padding: 14px 18px; margin-bottom: 16px; }
.health-issues h3 { margin: 0 0 8px; font-size: 15px; color: #8A5200; }
.health-issues ul { margin: 0; padding-left: 18px; }
.health-issues li { margin: 3px 0; font-size: 14px; }
.health-ok { background: #e8f5ec; border: 1px solid #bfe6cc; border-radius: var(--r-md); padding: 12px 18px; margin-bottom: 16px; font-size: 14.5px; color: #1e8e3e; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 20px; }
.health-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--card-pad); box-shadow: var(--shadow-1); }
.health-card h4 { margin: 0 0 8px; font-size: 13.5px; color: var(--blue); }
.health-card ul { margin: 0; padding: 0; list-style: none; }
.health-card li { font-size: 13.5px; color: var(--slate); padding: 2px 0; }
.health-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.health-table th, .health-table td { padding: 8px 12px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.health-table th { background: var(--light); color: var(--blue); font-weight: 700; }
.health-table tr:last-child td { border-bottom: none; }
.health-list { list-style: none; margin: 0 0 20px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.health-list li { font-size: 13.5px; color: var(--slate); padding: 5px 0; border-bottom: 1px solid var(--border); }
.health-list li:last-child { border-bottom: none; }
.health-list .muted { color: var(--grey); }
.health-table td, .health-table th { vertical-align: top; }


.iv-actions-bar { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.iv-btn { background: var(--light); color: var(--blue); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.iv-btn:hover { border-color: var(--blue); }
.iv-btn-danger { color: var(--red); }
.iv-btn-danger:hover { border-color: var(--red); background: #fdecea; }

.iv-edit-form { background: var(--light); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.iv-edit-form input, .iv-edit-form textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; font-size: 14px; font-family: inherit; }
.iv-edit-actions { display: flex; gap: 8px; }

/* =========================================================
   Polish & a11y (micro-interactions, états, dark-mode)
   ========================================================= */
/* Micro-interactions & feedback (confirmation / affordance) */
button, .btn-primary, .btn-live, .btn-ghost, .dl-btn, .pc-cta, .hero-cta,
.faq-search button, .login-card button, .lang-btn, .iv-btn, .nav-more, .theme-btn {
  transition: background-color .15s ease, border-color .15s ease,
              color .15s ease, transform .1s ease, box-shadow .15s ease, opacity .15s ease;
}
button:active, .btn-primary:active, .btn-live:active, .btn-ghost:active,
.dl-btn:active, .pc-cta:active, .hero-cta:active { transform: translateY(1px); }

/* Tendance KPI (delta vs période précédente) */
.trend { font-size: 12px; font-weight: 700; margin-left: 2px; }
.trend.up   { color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--text-muted); }

/* États de chargement (skeleton) & états vides */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border-soft) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: sk 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty-state { text-align: center; color: var(--text-muted); padding: 28px 16px; font-size: 14px; }

/* Respect du mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Nav regroupée: version mobile : accordéon « Plus » au tap */
@media (max-width: 820px) {
  .nav-group { width: 100%; }
  .nav-more {
    display: block; width: 100%; text-align: left;
    background: transparent; border: none; border-radius: 0;
    color: #fff; padding: 10px 12px; font-size: 15px; font-weight: 500;
  }
  .nav-more:hover, .nav-more.active { background: rgba(255,255,255,.14); }
  .nav-dropdown {
    display: none; position: static; min-width: 0; background: transparent;
    border: none; box-shadow: none; padding: 0; margin: 0;
  }
  .nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown { display: none; }
  .nav-group.open .nav-dropdown { display: block; }
  .nav-dropdown a { color: #fff; padding: 10px 12px 10px 26px; font-size: 15px; }
  .nav-dropdown a:hover { background: rgba(255,255,255,.14); }
  .nav-dropdown a.active { background: rgba(255,255,255,.22); }
  .topbar nav .theme-btn { align-self: flex-start; margin-top: 8px; }
}


/* ── Entretiens : héro enregistrement + historique (v2) ── */
.iv-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
           padding: 24px 26px; margin-bottom: 20px; box-shadow: var(--shadow-1); }
.iv-hero-head { margin-bottom: 16px; }
.iv-hero-title { font-size: 20px; font-weight: 800; color: var(--ink); }
.iv-hero-sub { font-size: 14px; color: var(--grey); margin-top: 4px; }
.iv-dest { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.iv-chip { background: var(--surface-2); color: var(--slate); border: 1px solid var(--border);
           border-radius: 999px; padding: 8px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer;
           transition: background .15s, color .15s, border-color .15s; font-family: inherit; }
.iv-chip:hover { border-color: var(--blue); color: var(--blue); }
.iv-chip.is-on { background: var(--blue); color: #fff; border-color: var(--blue); }
.iv-chip-subject.is-on { background: var(--ink); border-color: var(--ink); }
.iv-subject-row { margin-bottom: 12px; }
.iv-subject-row input { width: 100%; padding: 12px 14px; border: 1px solid var(--border);
                        border-radius: var(--r-sm); font-size: 14.5px; font-family: inherit; }
.iv-subject-row input:focus { outline: none; border-color: var(--blue); }
.iv-hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.iv-lang { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.iv-lang-btn { background: var(--surface); color: var(--grey); border: none; padding: 9px 12px;
               font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.iv-lang-btn.is-on { background: var(--light); color: var(--blue); }
.iv-big { padding: 12px 22px; font-size: 15px; border-radius: var(--r-sm); display: inline-flex;
          align-items: center; gap: 9px; }
.iv-big.recording { background: var(--red); }
.iv-rec-ico { font-size: 16px; }
.iv-rec-status { font-size: 14px; color: var(--slate); font-variant-numeric: tabular-nums; }
.iv-hint { font-size: 12.5px; color: var(--grey); margin: 14px 0 0; }
.iv-text-fold { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
                padding: 4px 18px; margin-bottom: 22px; }
.iv-text-fold summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--blue); padding: 12px 0; }
.iv-text-body { padding: 0 0 16px; }
.iv-text-body textarea { width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm);
                         padding: 12px 14px; font-size: 14.5px; font-family: inherit; resize: vertical; }
.iv-text-body textarea:focus { outline: none; border-color: var(--blue); }
.iv-empty { color: var(--grey); font-size: 14px; padding: 8px 0 24px; }
.iv-group { margin-bottom: 26px; }
.iv-group-head { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 10px;
                 display: flex; align-items: center; gap: 8px; }
.iv-group-count { background: var(--light); color: var(--slate); font-size: 12px; font-weight: 700;
                  border-radius: var(--r-md); padding: 2px 8px; }
.iv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.iv-title { font-size: 15.5px; font-weight: 800; color: var(--ink); }
.iv-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
           padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.iv-pill-proc { background: #fff4e0; color: var(--amber); }
.iv-pill-rec { background: var(--light); color: var(--slate); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: ivPulse 1.2s infinite; }
@keyframes ivPulse { 0% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } 100% { opacity: 1; transform: scale(1); } }
.iv-tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--blue);
          background: var(--light); border-radius: var(--r-sm); padding: 2px 9px; }
.iv-date { color: var(--grey); font-size: 12.5px; }
@media (max-width: 640px) {
  .iv-big { width: 100%; justify-content: center; }
  .iv-hero-actions { align-items: stretch; }
  .iv-top { flex-direction: column; gap: 8px; }
}

/* ---------- Contenu intégral des livrables (rendu markdown) ---------- */
.dv-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px 22px; margin: 18px 0;
}
.dv-title { font-size: var(--fs-lg); font-weight: 800; color: var(--blue); margin: 0 0 6px; }
.dv-dl { margin: 10px 0 6px; }
.dv-body { font-size: var(--fs-base); line-height: 1.6; color: var(--ink); margin-top: 8px; }
.dv-body .md-h { color: var(--blue); font-weight: 700; margin: 20px 0 8px; }
.dv-body .md-h:first-child { margin-top: 4px; }
.dv-body .md-p { margin: 8px 0; }
.dv-body .md-ul, .dv-body .md-ol { margin: 8px 0 8px 20px; padding: 0; }
.dv-body .md-ul li, .dv-body .md-ol li { margin: 4px 0; }
.dv-body .md-quote {
  border-left: 4px solid var(--blue); background: var(--surface-2); padding: 8px 14px;
  margin: 12px 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--slate); font-style: italic;
}
.dv-body .md-table {
  border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px; display: block;
  overflow-x: auto; white-space: normal;
}
.dv-body .md-table tbody { display: table; width: 100%; }
.dv-body .md-table th {
  background: var(--blue); color: #fff; text-align: left; padding: 7px 10px; font-weight: 700;
}
.dv-body .md-table td { border-bottom: 1px solid var(--border-soft); padding: 6px 10px; vertical-align: top; }
.dv-body .md-table tr:nth-child(even) td { background: var(--surface-2); }
.dv-body strong { color: var(--ink); font-weight: 700; }

/* ---------- Section Téléchargements (bas de page) ---------- */
.dl-row { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.dl-row:last-child { border-bottom: none; }
.dl-row-title { font-size: 14px; font-weight: 700; color: var(--slate); margin-bottom: 8px; }

/* ---------- Sommaire des livrables + ancres ---------- */
.dv-toc {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px;
}
.dv-toc-link {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--blue);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 14px; text-decoration: none; transition: background .12s ease, color .12s ease;
}
.dv-toc-link:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.dv-section { scroll-margin-top: 76px; }

/* ---------- En-tête Deliverables + bouton déplier/tout replier ---------- */
.dv-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.dv-head h2 { margin: 0; }
.dv-toggle {
  font-size: 13px; font-weight: 700; color: var(--blue);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 16px; cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.dv-toggle:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Lire la suite / repli du contenu long ---------- */
.dv-fold { margin-top: 8px; }
.dv-fold summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--blue);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 16px; transition: background .12s ease, color .12s ease;
}
.dv-fold summary::-webkit-details-marker { display: none; }
.dv-fold summary:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.dv-fold .less { display: none; }
.dv-fold[open] .more { display: none; }
.dv-fold[open] .less { display: inline; }
.dv-fold .dv-body { margin-top: 14px; }

@media (max-width: 640px) {
  .dv-section { padding: 14px 14px; }
  .dv-body .md-table { font-size: 12px; }
}

/* ---------- Livrable clé (featured, sous le jalon) ---------- */
.dv-featured {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--blue);
  border-radius: var(--r-md);
  padding: 22px 24px; margin: 20px 0;
}
.dv-featured-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.dv-featured-tag {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--blue); border-radius: 999px; padding: 4px 12px;
}
.dv-featured-title { font-size: var(--fs-xl); font-weight: 800; color: var(--blue); margin: 0 0 6px; }
.dv-featured .dv-body { margin-top: 12px; }

/* ---------- Floating agent (bottom-right) ---------- */
.fa-root { position: fixed; right: 20px; bottom: 20px; z-index: 999; }
.fa-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--blue); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-3); transition: transform .12s ease, background .12s ease;
}
.fa-fab:hover { background: var(--blue-hover); transform: translateY(-2px); }
.fa-panel {
  position: absolute; right: 0; bottom: 68px; width: 340px; max-width: calc(100vw - 40px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-3); overflow: hidden;
  display: flex; flex-direction: column;
}
.fa-panel[hidden] { display: none; }
.fa-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--blue); color: #fff; padding: 12px 16px;
}
.fa-title { font-weight: 700; font-size: 14px; }
.fa-close { background: none; border: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.fa-body {
  padding: 12px 14px; overflow-y: auto; max-height: 320px; min-height: 56px;
  display: flex; flex-direction: column; gap: 8px;
}
.fa-msg { font-size: 13px; line-height: 1.5; max-width: 85%; padding: 8px 12px; border-radius: 12px; }
.fa-msg-user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.fa-msg-agent { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 4px; }
.fa-q {
  margin: 0 14px 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; font-family: inherit; resize: none;
  background: var(--surface); color: var(--ink);
}
.fa-actions { display: flex; gap: 8px; padding: 0 14px 12px; }
.fa-fast, .fa-live {
  flex: 1; padding: 9px 0; border-radius: 10px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; transition: opacity .12s ease;
}
.fa-fast { background: var(--blue); color: #fff; }
.fa-live { background: var(--surface-2); color: var(--blue); border: 1px solid var(--border); }
.fa-fast:hover, .fa-live:hover { opacity: .88; }
.fa-fast:disabled, .fa-live:disabled { opacity: .5; cursor: default; }
.fa-status { padding: 0 14px 10px; font-size: 12px; color: var(--grey); }
.fa-badge {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--blue);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 8px; margin-bottom: 4px;
}
.fa-badge-live { background: var(--blue); color: #fff; border-color: var(--blue); }
.fa-agent, .fa-time { font-size: 12px; color: var(--grey); margin-left: 6px; }
.fa-answer { margin-top: 4px; }
.fa-srcs { margin-top: 8px; }
.fa-err { color: #c62828; }
.fa-warn { color: #8A5200; font-size: 12px; margin-bottom: 6px; }
.fa-spin { opacity: .7; font-style: italic; }
.fa-msg .faq-hit { background: #fff; }
@media (max-width: 480px) {
  .fa-panel { width: calc(100vw - 32px); }
}

/* ---------- Phase 1 a11y: wide data tables scroll, never break the layout ---------- */
.risk-table, .health-table, .ppwr-table {
  display: block; overflow-x: auto; max-width: 100%; white-space: normal;
}

/* ---------- Phase 1 a11y: 44px minimum tap targets on small screens ---------- */
@media (max-width: 820px) {
  .nav-toggle { min-width: 44px; min-height: 44px; }
  .topbar nav a, .nav-more, .lang-btn, .logout, .pdf-btn, .theme-btn,
  .dl-btn, .hero-cta, .pc-cta, .pc-chip, .iv-btn, .iv-lang-btn,
  .dv-toggle, .r-toggle, .pill, .crosslinks a, .btn-primary, .btn-live,
  .faq-search button, .fa-fast, .fa-live, .iv-chip, .fl-dl a {
    min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
  }
}

/* ---------- Phase 1 a11y: tap-target refinements (mobile) ---------- */
@media (max-width: 820px) {
  /* WCAG 2.2 AA 24px floor for anything interactive (no-op on inline boxes) */
  a, button, summary, input, select { min-height: 24px; }
  /* form controls get the full 44px */
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  select { min-height: 44px; }
  .skip-link { padding: 12px 16px; }
  /* block-level link targets: grow the hit box with padding (keeps layout width) */
  .pc-name, .dv-toc-link, .proj-nav a, summary, .doc-list a { padding-top: 12px; padding-bottom: 12px; }
  /* inline links inside running text: widen the hit box without reflowing lines */
  .risk-card a, .news-item a { padding-top: 6px; padding-bottom: 6px; }
}

/* ---------- Phase 1 a11y: swatch hex labels must be readable on any fill ---------- */
.swatch .sw { align-items: flex-end; }
.swatch .sw-hex {
  background: rgba(255, 255, 255, .94); color: #222222;
  padding: 2px 7px; border-radius: var(--r-xs);
  font-family: monospace; font-size: 12px; font-weight: 700; letter-spacing: .5px;
}

/* ============================================================
   Design system: components (Phase 2)
   Primitives are documented on brand.html. Existing page classes
   above are normalised onto the same tokens.
   ============================================================ */

/* ---------- Unified page head (first h1 of a content page) ---------- */
main > h1.section:first-child {
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  margin: 0 0 var(--sp-2);
  padding-bottom: var(--sp-3);
  border-bottom: 3px solid var(--blue);
}
main > h1.section:first-child + .page-sub { margin-top: 0; margin-bottom: var(--sp-5); }

/* ---------- ds-card ---------- */
.ds-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--card-radius); padding: var(--card-pad);
}
.ds-card--raised { box-shadow: var(--shadow-1); }
.ds-card--lg { padding: var(--card-pad-lg); }

/* ---------- ds-head (section bar) ---------- */
.ds-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  background: var(--head-bg); color: var(--blue); border: 1px solid var(--head-border);
  border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); font-weight: 700;
}

/* ---------- ds-badge ---------- */
.ds-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--slate); border: 1px solid var(--head-border);
}
.ds-badge--blue   { background: var(--blue);       color: #fff;        border-color: var(--blue); }
.ds-badge--ok     { background: var(--ok-bg);      color: var(--ok);     border-color: transparent; }
.ds-badge--warn   { background: var(--warn-bg);    color: var(--warn);   border-color: transparent; }
.ds-badge--danger { background: var(--danger-bg);  color: var(--danger); border-color: transparent; }
.ds-badge--info   { background: var(--info-bg);    color: var(--info);   border-color: transparent; }

/* ---------- ds-kpi ---------- */
.ds-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--card-radius); padding: var(--sp-4) var(--sp-4) var(--sp-3);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.ds-kpi .ds-kpi-num { font-size: var(--fs-2xl); font-weight: 800; color: var(--blue); line-height: var(--lh-tight); }
.ds-kpi .ds-kpi-lbl { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- ds-callout ---------- */
.ds-callout {
  border-left: 4px solid var(--blue); background: var(--head-bg);
  border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4);
  color: var(--slate); line-height: var(--lh-normal);
}
.ds-callout--warn   { border-left-color: var(--warn);   background: var(--warn-bg);   color: var(--warn); }
.ds-callout--danger { border-left-color: var(--danger); background: var(--danger-bg); color: var(--danger); }
.ds-callout--ok     { border-left-color: var(--ok);     background: var(--ok-bg);     color: var(--ok); }

/* ---------- ds-empty ---------- */
.ds-empty {
  text-align: center; color: var(--text-muted); background: var(--surface-2);
  border: 1px dashed var(--border); border-radius: var(--card-radius);
  padding: var(--sp-6) var(--sp-4); font-size: var(--fs-sm);
}

/* ---------- ds-table ---------- */
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.ds-table th {
  background: var(--head-bg); color: var(--blue); text-align: left;
  padding: var(--sp-2) var(--sp-3); border-bottom: 2px solid var(--head-border);
}
.ds-table td { padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--border-soft); vertical-align: top; }
.ds-table-scroll { display: block; overflow-x: auto; max-width: 100%; white-space: normal; }

/* ============================================================
   Phase 3: navigation mega-menu + command palette trigger
   ============================================================ */
.nav-caret { font-size: 10px; opacity: .8; margin-left: 2px; }
.nav-dropdown--mega {
  min-width: 300px; padding: 8px;
  display: none; grid-template-columns: 1fr;
}
.nav-group:hover .nav-dropdown--mega,
.nav-group:focus-within .nav-dropdown--mega,
.nav-group.open .nav-dropdown--mega { display: grid; }
.nav-dropdown a.nav-item { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px !important; border-radius: var(--r-xs); }
.nav-item-t { font-size: 14px; font-weight: 700; color: var(--blue); }
.nav-item-d { font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); }
.nav-dropdown a.nav-item:hover { background: var(--surface-2); }
.nav-dropdown a.nav-item.active .nav-item-t { color: var(--blue); }

.cmd-open {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.45); border-radius: var(--r-xs);
  padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: inherit;
}
.cmd-open:hover { background: rgba(255,255,255,.24); }
.cmd-kbd {
  font-family: inherit; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.22); border-radius: 3px; padding: 1px 5px;
}

/* ---------- Command palette ---------- */
.cmd-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(16, 20, 32, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 16px 16px;
}
.cmd-overlay[hidden] { display: none; }
.cmd-panel {
  width: 100%; max-width: 640px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--card-radius);
  box-shadow: var(--shadow-3); overflow: hidden;
  display: flex; flex-direction: column; max-height: 70vh;
}
.cmd-field { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.cmd-field input {
  flex: 1; border: none; background: transparent; color: var(--text);
  font-size: var(--fs-md); font-family: inherit; outline: none; min-height: 0;
}
.cmd-hint { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.cmd-results { overflow-y: auto; padding: 6px; }
.cmd-group-head {
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); padding: 10px 12px 4px;
}
.cmd-row {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  padding: 9px 12px; border-radius: var(--r-xs); text-decoration: none;
  color: var(--text); cursor: pointer; border: none; background: none;
  font-family: inherit; text-align: left;
}
.cmd-row .cmd-t { font-size: var(--fs-sm); font-weight: 600; color: var(--blue); }
.cmd-row .cmd-d { font-size: var(--fs-xs); color: var(--text-muted); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-row[aria-selected="true"], .cmd-row:hover { background: var(--head-bg); }
.cmd-empty { padding: 22px 16px; text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }

@media (max-width: 820px) {
  .nav-dropdown--mega { min-width: 0; }
  .cmd-open-t { display: none; }
  .cmd-overlay { padding: 5vh 10px 10px; }
  .cmd-panel { max-height: 82vh; }
}

/* ============================================================
   Phase 3: in-page table of contents
   ============================================================ */
html { scroll-behavior: smooth; }
h2.section { scroll-margin-top: 90px; }
.toc {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue);
  border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-5); box-shadow: var(--shadow-1);
}
.toc-head {
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 6px;
}
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: var(--sp-5); }
.toc li { font-size: var(--fs-sm); margin: 2px 0; break-inside: avoid; }
.toc a { color: var(--blue); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
@media (max-width: 640px) { .toc ol { columns: 1; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

h2, h3.sub-section { scroll-margin-top: 90px; }

/* ---------- Phase 3 a11y: new interactive elements on small screens ---------- */
@media (max-width: 820px) {
  .gloss-az button { min-height: 32px; min-width: 34px; }
  .cmd-row, .nav-item { min-height: 44px; }
  .cmd-open { min-height: 44px; }
}

/* ---------- Phase 3: charts ---------- */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-4); margin: 0 0 var(--sp-5); }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--card-radius); padding: var(--card-pad); box-shadow: var(--shadow-1); min-width: 0; }
.chart-head { margin-bottom: 6px; }
.chart-t { font-size: var(--fs-sm); font-weight: 800; color: var(--text); }
.chart-s { font-size: var(--fs-xs); color: var(--text-muted); }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-h { max-height: 260px; }

/* ---------- Phase 3: what changed ---------- */
.changes { display: grid; gap: 8px; margin: 0 0 var(--sp-5); }
.changes-load { font-size: var(--fs-sm); color: var(--text-muted); padding: 10px 2px; }
a.change { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: var(--card-radius); padding: 11px var(--card-pad); box-shadow: var(--shadow-1); transition: transform .12s ease, box-shadow .12s ease; }
a.change:hover { transform: translateX(2px); box-shadow: var(--shadow-2); }
.ch-ico { font-size: 16px; line-height: 1.3; }
.ch-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-t { font-size: var(--fs-sm); font-weight: 700; color: var(--blue); overflow-wrap: anywhere; }
.ch-m { font-size: var(--fs-xs); color: var(--text-muted); }
@media (max-width: 640px) { .chart-grid { grid-template-columns: 1fr; } }
