/* =========================================================================
   SAC Templates Hub — Design v5 colorful avec icônes SVG pro
   Palette : SAP blue + cyan + amber + violet sur navy profond
   Typo : Bricolage Grotesque (display) + IBM Plex Sans (body) + IBM Plex Mono (code)
   ========================================================================= */
:root {
  --accent: #0a6ed1;
  --accent-dark: #054a8f;
  --accent-soft: #e8f1fb;
  --cyan: #16b8c9;
  --cyan-soft: #e0f7f9;
  --violet: #7c4dff;
  --violet-soft: #ede7ff;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --rose: #e53e6c;
  --green: #16a34a;
  --navy: #14264a;
  --navy-2: #1d3563;
  --ink: #0a1428;
  --grey-50: #f8fafc;
  --grey-100: #eef2f7;
  --grey-200: #dde4ee;
  --grey-300: #b9c4d3;
  --text: #1c2840;
  --muted: #5a6781;
  --line: #e3e8f0;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(20, 38, 74, .06), 0 2px 8px rgba(20, 38, 74, .04);
  --shadow-md: 0 4px 14px rgba(20, 38, 74, .08), 0 10px 30px rgba(20, 38, 74, .08);
  --shadow-lg: 0 24px 60px rgba(10, 20, 40, .25);
  --shadow-color: 0 8px 24px rgba(10, 110, 209, .25);
  --maxw: 1180px;
  --display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Consolas", "Menlo", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* Skip-link accessibilité — visible au focus clavier */
.skip-link {
  position: absolute; left: 8px; top: -40px;
  background: var(--accent); color: #fff;
  padding: .6rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; z-index: 999;
  text-decoration: none;
  transition: top .15s;
}
.skip-link:focus { top: 8px; outline: 2px solid #fff; outline-offset: 2px; }
/* Classe utilitaire « screen-reader only » : visible pour les lecteurs d'écran, invisible à l'œil */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

main { display: block; }
body {
  font-family: var(--body);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
h1, h2, h3, h4 {
  font-family: var(--display); color: var(--ink); line-height: 1.18;
  letter-spacing: -.022em; font-weight: 700;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.brand, .brand:hover, .nav-links a, .nav-links a:hover, .chip, .chip:hover { text-decoration: none; }
.btn:hover, .toc a:hover, .news-card:hover, .res-card:hover, .tpl-card:hover, .feature:hover { text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-size: .74rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; display: inline-block;
}
.muted { color: var(--muted); }
.center { text-align: center; }

/* ===== Icônes SVG (rendues via icons.js) ===== */
[data-icon], svg.ic { width: 1em; height: 1em; display: inline-block; vertical-align: middle; }
[data-icon] svg { width: 100%; height: 100%; display: block; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--body); font-weight: 600; font-size: .94rem;
  padding: .7rem 1.3rem; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; transition: all .18s ease; white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #1a85e0 100%);
  color: #fff; box-shadow: var(--shadow-color);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(10, 110, 209, .35); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--grey-200); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-light { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); backdrop-filter: blur(4px); }
.btn-light:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .5); }
.btn-accent {
  background: linear-gradient(135deg, var(--cyan), #14a3b3); color: #fff;
  box-shadow: 0 8px 24px rgba(22, 184, 201, .3);
}
.btn-sm { padding: .45rem 1rem; font-size: .85rem; }
.btn-sm svg { width: 14px; height: 14px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-weight: 700; font-size: 1.08rem; color: var(--ink);
  letter-spacing: -.015em;
}
.brand .logo { width: 30px; height: 30px; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-links a {
  color: var(--text); font-weight: 500; font-size: .92rem; position: relative;
  padding: .35rem 0; transition: color .15s;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -24px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; }
.nav-toggle svg { width: 24px; height: 24px; stroke: var(--navy); }

/* ---------------- Hero (mesh gradient v5) ---------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 500px at 88% -10%, rgba(22, 184, 201, .35), transparent 60%),
    radial-gradient(700px 480px at 5% 110%, rgba(124, 77, 255, .22), transparent 55%),
    radial-gradient(600px 420px at 50% 50%, rgba(10, 110, 209, .35), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, #0e1f3e 100%);
  color: #e7ecf3;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .06) 1px, transparent 0);
  background-size: 24px 24px; opacity: .5;
}
.hero-inner {
  position: relative;
  padding: 84px 0 76px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  margin: .6rem 0 1.1rem;
  letter-spacing: -.028em; line-height: 1.05;
  font-weight: 700;
}
.hero h1 .hl {
  background: linear-gradient(90deg, #a8d8ff 0%, #16b8c9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700;
}
.hero p.lead {
  font-size: 1.1rem; color: #d4dde8; max-width: 32rem; line-height: 1.6;
}
.hero .eyebrow { color: #a8d8ff; }
.hero-cta { display: flex; gap: .7rem; margin-top: 1.9rem; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 2.6rem; margin-top: 2.6rem;
  border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 1.8rem;
}
.hero-stats .s b {
  font-family: var(--display); font-size: 1.7rem; color: #fff;
  display: block; font-weight: 700; letter-spacing: -.02em;
}
.hero-stats .s span {
  font-size: .78rem; color: #c7d2e6; text-transform: uppercase; letter-spacing: .08em;
}

/* Hero search card */
.search-card {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius); padding: 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
}
.search-card h3, .search-card h2 { color: #fff; font-size: 1.05rem; margin-bottom: .35rem; font-weight: 600; }
.search-card p { color: #c7d2e6; font-size: .86rem; margin-bottom: 1.1rem; }
.search-bar { display: flex; gap: .5rem; }
.search-bar input {
  flex: 1; border: 0; border-radius: var(--radius); padding: .7rem 1rem;
  font-family: var(--body); font-size: .94rem;
}
.search-bar input:focus { outline: 2px solid var(--cyan); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: #d8e0ec;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  padding: .35rem .8rem; border-radius: 20px; transition: all .15s;
}
.chip:hover { background: rgba(255, 255, 255, .14); border-color: var(--cyan); text-decoration: none; color: #fff; }
.chip svg { width: 14px; height: 14px; opacity: .85; }

/* ---------------- Sections ---------------- */
section.block { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 42px; }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: .5rem 0; font-weight: 700; letter-spacing: -.025em;
}
.section-head p { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }

/* feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: transform .18s, box-shadow .18s, border-color .18s;
  position: relative; overflow: hidden;
}
.feature:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-soft);
}
.feature .ic {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.feature .ic svg { width: 22px; height: 22px; }
.feature.cyan .ic { background: var(--cyan-soft); color: #0a8c9a; }
.feature.violet .ic { background: var(--violet-soft); color: var(--violet); }
.feature.amber .ic { background: var(--amber-soft); color: #b07a18; }
.feature h3 { font-size: 1.08rem; margin-bottom: .4rem; font-weight: 700; letter-spacing: -.015em; }
.feature p { font-size: .9rem; color: var(--muted); line-height: 1.55; }
.feature.highlight {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; border: 0;
}
.feature.highlight h3 { color: #fff; }
.feature.highlight p { color: #d4dde8; }
.feature.highlight .ic {
  background: rgba(255, 255, 255, .15); color: #a8d8ff;
}

/* ---------------- Catalog ---------------- */
.catalog-layout { display: grid; grid-template-columns: 250px 1fr; gap: 36px; align-items: start; }
.filters {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; position: sticky; top: 92px;
}
.filters h4, .filters h2.filter-title {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 20px 0 10px; font-weight: 700; font-family: var(--body);
}
.filters h4:first-child, .filters h2.filter-title:first-child { margin-top: 0; }
.filter-opt {
  display: block; padding: .45rem .75rem; border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--text); cursor: pointer; transition: all .12s;
}
.filter-opt:hover { background: var(--grey-100); }
.filter-opt.active {
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 600;
}
.catalog-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px; gap: 12px; flex-wrap: wrap;
}
.catalog-toolbar input {
  border: 1px solid var(--grey-200); border-radius: var(--radius);
  padding: .6rem 1rem; font-family: var(--body); font-size: .92rem; min-width: 260px;
}
.catalog-toolbar input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.tpl-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tpl-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-soft);
}
.tpl-thumb {
  position: relative; height: 140px; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  display: grid; place-items: center; border-bottom: 1px solid var(--line);
}
.tpl-thumb .mini { width: 100%; height: 100%; }
.tpl-thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  opacity: 0; transition: opacity .18s;
  background: rgba(15, 26, 46, .75); color: #fff; font-weight: 500; font-size: .85rem;
  gap: .5rem; flex-direction: column;
}
.tpl-thumb:hover .play { opacity: 1; }
.tpl-thumb .play .pbtn {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.tpl-thumb .play .pbtn svg { width: 18px; height: 18px; }
.badge-cat {
  position: absolute; top: 12px; left: 12px; font-size: .7rem; font-weight: 600;
  padding: .25rem .65rem; border-radius: 16px;
  background: rgba(255, 255, 255, .95); color: var(--navy);
  backdrop-filter: blur(4px);
}
.badge-cat.planning {
  background: linear-gradient(135deg, var(--amber), #d97706); color: #fff;
}
.tpl-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.tpl-meta {
  display: flex; gap: .4rem; align-items: center; font-size: .74rem;
  color: var(--muted); margin-bottom: .55rem;
}
.tpl-meta .ind {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--accent); font-weight: 600;
}
.tpl-meta .ind svg { width: 13px; height: 13px; }
.tpl-meta svg { width: 14px; height: 14px; vertical-align: -2px; flex: none; }
.tpl-body h3 { font-size: 1.05rem; margin-bottom: .35rem; font-weight: 700; letter-spacing: -.015em; }
.tpl-body p.desc { font-size: .87rem; color: var(--muted); flex: 1; line-height: 1.5; }
.kpi-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .9rem 0 1.1rem; }
.kpi-chips span {
  font-size: .72rem; background: var(--accent-soft); color: var(--accent-dark);
  padding: .22rem .55rem; border-radius: 12px; font-weight: 500;
}
.tpl-actions { display: flex; gap: .5rem; }
.tpl-actions .btn { flex: 1; justify-content: center; }

/* dropdown download */
.dl { position: relative; }
.dl-menu {
  position: absolute; bottom: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 5px; display: none; min-width: 210px; z-index: 5;
}
.dl-menu.open { display: block; }
.dl-menu a {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: var(--navy); font-size: .87rem; gap: 10px;
}
.dl-menu a:hover { background: var(--accent-soft); text-decoration: none; }
.dl-menu a svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.dl-menu a small { color: var(--muted); font-family: var(--mono); font-size: .78em; margin-left: auto; }

/* ---------------- Preview Modal ---------------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(10, 20, 40, .65);
  backdrop-filter: blur(4px); z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 24px;
}
.modal-back.open { display: flex; }
.modal {
  width: min(960px, 100%); max-height: 92vh; overflow: auto;
  background: var(--grey-50); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.modal-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 22px 26px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
.modal-top h3 { font-size: 1.22rem; font-weight: 700; }
.modal-top .sub { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.modal-close {
  background: var(--grey-100); border: 0; width: 36px; height: 36px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 1.3rem; color: var(--navy);
  transition: background .12s;
}
.modal-close:hover { background: var(--grey-200); }

/* ===== Aperçu live façon vraie Story SAC (canvas clair, tuiles blanches) ===== */
.dash { background: #eef2f7; padding: 14px; }
.dash-bar {
  background: #fff;
  padding: 9px 14px;
  margin: -14px -14px 14px -14px;
  display: flex; align-items: center; gap: .55rem;
  border-bottom: 1px solid var(--line);
}
.dash-bar .dot { width: 8px; height: 8px; border-radius: 50%; }
.dash-bar .label {
  color: var(--navy); font-size: .82rem; margin-left: auto;
  font-family: var(--body); font-weight: 600;
}
.dash-bar .label::before {
  content: ""; display: inline-block; width: 4px; height: 14px;
  background: var(--accent); border-radius: 2px; vertical-align: -3px; margin-right: 8px;
}
.dash-canvas { padding: 14px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 14px;
  min-width: 0; /* permet ellipsis */
}
.kpi-tile .lab {
  color: var(--muted); font-size: .72rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-tile .val {
  font-family: var(--display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--ink); margin: .25rem 0 .15rem;
  font-weight: 700; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kpi-tile .delta { font-size: .78rem; font-weight: 600; font-family: var(--mono); }
.kpi-tile .delta.up { color: #197a3c; }
.kpi-tile .delta.down { color: #b8412e; }
.chart-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; align-items: stretch; }
.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 14px 10px;
  display: flex; flex-direction: column;
  overflow: hidden; /* la légende reste DANS la carte */
}
.chart-card .ct {
  color: var(--navy); font-size: .82rem; font-weight: 600;
  margin: 0 0 10px; flex: 0 0 auto;
  display: block; line-height: 1.2;
  /* empêche le donut de remonter par-dessus le titre dans certains agencements */
  z-index: 2; position: relative;
}
.chart-card .chart-body { flex: 1 1 auto; min-height: 0; position: relative; }
.chart-card.full { grid-column: 1 / -1; }
.chart-card svg { max-width: 100%; max-height: 100%; height: 100%; width: 100%; display: block; }
.chart-legend {
  flex: 0 0 auto; /* hauteur réservée naturelle */
  display: flex; flex-wrap: wrap;
  gap: 6px 14px; justify-content: center;
  margin: 8px 0 2px; padding: 0;
  font-size: .74rem; color: var(--navy);
  max-width: 100%; /* ne déborde pas latéralement */
}
.chart-legend span {
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; /* un item ne se coupe pas en deux lignes */
}
.preview-tabs {
  display: flex; gap: 0; margin: 0;
  padding: 6px 14px 0; background: var(--grey-50);
  border-bottom: 1px solid var(--line);
}
.preview-tabs button {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); padding: .5rem .9rem;
  font-family: var(--body); font-size: .85rem; cursor: pointer; font-weight: 500;
}
.preview-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.preview-tabs button:hover:not(.active) { color: var(--navy); background: rgba(0,0,0,.02); }
.modal-foot {
  padding: 20px 26px 24px; background: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.modal-foot .kpis { font-size: .82rem; color: var(--muted); }

/* svg chart tooltip */
.chart-tip {
  position: fixed; pointer-events: none; background: var(--ink); color: #fff;
  font-size: .76rem; padding: .4rem .6rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); z-index: 200; opacity: 0; transition: opacity .1s;
  white-space: nowrap; font-family: var(--mono);
}
.chart-tip.show { opacity: 1; }

/* ---------------- Suggestions (AI) ---------------- */
.suggest-layout { display: grid; grid-template-columns: 440px 1fr; gap: 36px; align-items: start; }
.suggest-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: .84rem; font-weight: 600; color: var(--navy); margin-bottom: .4rem;
}
.field select, .field input {
  width: 100%; border: 1px solid var(--grey-200); border-radius: var(--radius);
  padding: .65rem .9rem; font-family: var(--body); font-size: .94rem; background: #fff;
  transition: all .12s;
}
.field select:focus, .field input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.suggest-results { min-height: 320px; }
.placeholder-ai {
  background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%);
  border: 1px dashed var(--grey-300); border-radius: var(--radius);
  padding: 56px 32px; text-align: center; color: var(--muted);
}
.placeholder-ai .ai-orb {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(10, 110, 209, .35);
  animation: float 3s ease-in-out infinite;
}
.placeholder-ai .ai-orb svg { width: 30px; height: 30px; color: #fff; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.rec-card {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px;
  transition: transform .18s, box-shadow .18s;
}
.rec-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.rec-card .rank { font-family: var(--mono); font-size: .82rem; color: var(--accent); font-weight: 700; }
.rec-card h3 { font-size: 1.15rem; margin: .25rem 0; font-weight: 700; }
.rec-card .match {
  float: right;
  background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff;
  font-weight: 700; font-size: .78rem; padding: .3rem .75rem; border-radius: 14px;
}
.rec-card .reason { font-size: .9rem; color: var(--muted); margin: .55rem 0 1.1rem; line-height: 1.55; }
.ai-source {
  font-size: .78rem; color: var(--muted); margin-bottom: 16px;
  display: inline-flex; align-items: center; gap: .45rem;
}
.ai-source .pill {
  background: var(--grey-100); padding: .2rem .65rem; border-radius: 12px;
  font-family: var(--mono); font-size: .9em;
}

/* ---------------- Resources cards (générique) ---------------- */
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.res-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.res-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
.res-card .top {
  height: 110px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 100%);
}
.res-card .top.alt { background: linear-gradient(135deg, var(--violet) 0%, var(--accent) 100%); }
.res-card .top.amber { background: linear-gradient(135deg, var(--amber) 0%, #d97706 100%); }
.res-card .top svg { width: 38px; height: 38px; opacity: .9; }
.res-card .rc-body { padding: 20px; }
.res-card .rc-body .tag {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); font-weight: 700;
}
.res-card h3 { font-size: 1.05rem; margin: .35rem 0; font-weight: 700; }
.res-card p { font-size: .87rem; color: var(--muted); line-height: 1.5; }

/* video embed */
.video-wrap {
  position: relative; padding-top: 56.25%; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--line);
}
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------------- Contact ---------------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.contact-form {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm);
}
.contact-form textarea {
  width: 100%; border: 1px solid var(--grey-200); border-radius: var(--radius);
  padding: .65rem .9rem; font-family: var(--body); min-height: 140px; resize: vertical;
}
.contact-info .ci { display: flex; gap: 16px; margin-bottom: 24px; }
.contact-info .ci .ic {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; flex: none;
}
.contact-info .ci .ic svg { width: 20px; height: 20px; }
.form-note { font-size: .88rem; padding: .8rem 1rem; border-radius: var(--radius); margin-top: 14px; display: none; }
.form-note.ok { display: block; background: #e7f6ec; color: #1f5e3a; border: 1px solid #c1e6cb; }
.form-note.err { display: block; background: #fdecef; color: #9f1d3a; border: 1px solid #f4c6d1; }

/* ---------------- Chatbot ---------------- */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 80;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff;
  box-shadow: 0 10px 28px rgba(10, 110, 209, .35);
  display: grid; place-items: center; transition: transform .15s;
}
.chat-fab:hover { transform: translateY(-2px) scale(1.05); }
.chat-fab svg { width: 26px; height: 26px; }
.chat-panel {
  position: fixed; right: 24px; bottom: 92px; z-index: 81;
  width: min(380px, calc(100vw - 32px)); height: 540px;
  max-height: calc(100vh - 130px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-head {
  background: linear-gradient(135deg, var(--navy) 0%, var(--accent) 100%); color: #fff;
  padding: 16px 18px; display: flex; align-items: center; gap: 12px;
}
.chat-head .av {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .15);
  display: grid; place-items: center;
}
.chat-head .av svg { width: 18px; height: 18px; color: #fff; }
.chat-head b { font-size: .96rem; font-weight: 600; }
.chat-head span { font-size: .74rem; color: #d4dde8; display: block; }
.chat-head .x { margin-left: auto; background: none; border: 0; color: #fff; cursor: pointer; font-size: 1.4rem; opacity: .8; }
.chat-head .x:hover { opacity: 1; }
.chat-body {
  flex: 1; overflow-y: auto; padding: 16px;
  background: var(--grey-50); display: flex; flex-direction: column; gap: 10px;
}
.msg {
  max-width: 84%; padding: .6rem .9rem; border-radius: 14px;
  font-size: .9rem; line-height: 1.55;
}
.msg.bot { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user {
  background: linear-gradient(135deg, var(--accent), var(--cyan)); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.msg.typing { color: var(--muted); font-style: italic; }
.chat-quick {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 14px 8px; background: var(--grey-50);
}
.chat-quick button {
  font-size: .76rem; background: #fff; border: 1px solid var(--grey-200);
  border-radius: 14px; padding: .35rem .75rem; cursor: pointer; color: var(--navy);
  transition: all .12s;
}
.chat-quick button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chat-input {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--line); background: #fff;
}
.chat-input input {
  flex: 1; border: 1px solid var(--grey-200); border-radius: var(--radius);
  padding: .55rem .9rem; font-family: var(--body); font-size: .9rem;
}
.chat-input input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.chat-input button {
  background: linear-gradient(135deg, var(--accent), var(--cyan)); border: 0; color: #fff;
  width: 40px; height: 40px; border-radius: var(--radius-sm); cursor: pointer;
  display: grid; place-items: center;
}
.chat-input button svg { width: 18px; height: 18px; }

/* ---------------- Footer ---------------- */
.site-footer {
  background: linear-gradient(180deg, var(--navy) 0%, #0a1428 100%); color: #d4dde8;
  padding: 56px 0 28px; margin-top: 48px;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.site-footer h4, .site-footer h3 {
  color: #fff; font-size: .84rem; margin-bottom: 14px;
  font-family: var(--body); font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
}
.site-footer a { color: #d4dde8; font-size: .9rem; display: block; margin-bottom: .5rem; }
.site-footer a:hover { color: #a8d8ff; text-decoration: none; }
.footer-brand {
  display: flex; align-items: center; gap: .55rem;
  color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.08rem;
  margin-bottom: 14px;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  margin-top: 36px; padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: .82rem; color: #a0aac0;
}
.footer-bottom svg { width: 14px; height: 14px; opacity: .8; }

/* ---------------- Cookie banner ---------------- */
.cookie {
  position: fixed; left: 24px; bottom: 24px; z-index: 90; max-width: 380px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-md); display: none;
}
.cookie.show { display: block; }
.cookie p { font-size: .84rem; color: var(--muted); margin-bottom: 12px; }
.cookie .row { display: flex; gap: 8px; }

/* ---------------- Hint secteur sur page Suggestions / Générateur ---------------- */
.sector-hint {
  margin-top: 12px; padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--cyan-soft) 100%);
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .88rem; color: var(--navy);
}
.sector-hint b { font-weight: 700; font-size: .82rem; color: var(--accent-dark); }
.sector-hint .hint-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.sector-hint .hint-tags span {
  background: #fff; border: 1px solid var(--grey-200); color: var(--navy);
  font-size: .76rem; padding: .22rem .55rem; border-radius: 10px;
  font-family: var(--mono);
}

/* Misc */
.tag-line { display: inline-flex; gap: .35rem; align-items: center; }
.loading-dots::after { content: "…"; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 33% { content: "."; } 66% { content: ".."; } 100% { content: "..."; } }

@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 68px 0 auto 0;
    background: #fff; flex-direction: column; gap: 0;
    padding: 10px 0; border-bottom: 1px solid var(--line); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .9rem 24px; width: 100%; }
  .nav-links a.active::after { display: none; }
  .nav-toggle { display: block; }
  .hero-inner, .catalog-layout, .suggest-layout, .contact-layout { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .res-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .filters { position: static; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .chart-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .feature-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.2rem; }
}

/* ---------------- FAQ (win #1 audit) ---------------- */
.faq-list { display:flex; flex-direction:column; gap: 12px; margin-top: 24px; }
.faq-item {
  background: var(--grey-50); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0;
  transition: border-color .15s, box-shadow .15s;
}
.faq-item[open] { border-color: var(--accent); box-shadow: 0 2px 8px rgba(10,110,209,.08); }
.faq-item summary {
  padding: 16px 20px; cursor: pointer;
  font-weight: 600; color: var(--navy);
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; width: 10px; height: 10px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s;
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item p { padding: 0 20px 18px; color: var(--text); line-height: 1.6; margin: 0; }
.hero-reassure svg { vertical-align: -2px; }

/* ---------------- Blog (v29) ---------------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.blog-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.blog-card:hover { border-color: var(--accent); box-shadow: 0 4px 16px rgba(10,110,209,.1); transform: translateY(-2px); }
.blog-cat {
  display: inline-block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); background: #f0f7ff;
  padding: 3px 10px; border-radius: 99px;
}
.blog-body { font-size: 1.02rem; line-height: 1.75; color: #1a2535; }
.blog-body p { margin: 0 0 18px; }
.blog-body p.lead { font-size: 1.12rem; color: var(--muted); line-height: 1.7; margin-bottom: 24px; }
.blog-body h2 { font-size: 1.4rem; font-weight: 700; color: var(--navy); margin: 36px 0 14px; letter-spacing: -.015em; }
.blog-body strong { color: var(--navy); font-weight: 600; }
.lead-grid { align-items: center; }
@media (max-width: 720px) {
  .lead-grid { grid-template-columns: 1fr !important; }
  .detail-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   v30 — Accessibilité (focus clavier) + signature de marque
   ============================================================ */

/* #10 — États :focus-visible nets et cohérents (clavier) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Sur fonds navy/sombres : focus cyan pour rester visible */
.hero a:focus-visible,
.site-footer a:focus-visible,
[class*="navy"] a:focus-visible { outline-color: var(--cyan); }
summary:focus-visible { outline-offset: 3px; }

/* #6 — Lien GitHub dans le header */
.nav-gh { display: inline-flex; align-items: center; padding: 4px 6px; color: var(--muted); }
.nav-gh:hover { color: var(--accent); }
.nav-gh svg { width: 20px; height: 20px; display: block; }
.footer-gh { font-weight: 600; }

/* #21 — Signature visuelle : motif "data-bars" (écho du logo bar-chart) */
.brand-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 20px; vertical-align: -3px; }
.brand-bars i {
  width: 4px; border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--accent));
}
.brand-bars i:nth-child(1) { height: 40%; }
.brand-bars i:nth-child(2) { height: 75%; }
.brand-bars i:nth-child(3) { height: 55%; }
.brand-bars i:nth-child(4) { height: 100%; }
.brand-bars i:nth-child(5) { height: 65%; }
.brand-bars.on-dark i { background: linear-gradient(180deg, #6fd0ff, var(--cyan)); }

/* #7 — Aperçu dashboard de marque (fiches + home) */
.tpl-preview {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); background: #fff;
}
.home-preview-strip { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
@media (max-width: 820px) { .home-preview-strip { grid-template-columns: 1fr; } }

/* ============================================================
   v35 — Dégraissage : on masque le lanceur du chatbot.
   (Le code reste en place ; seule l'entrée visible est retirée
   pour recentrer le site sur le catalogue de templates.)
   ============================================================ */
.chat-fab { display: none !important; }
