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

:root {
  --bg: #F9F9FB;
  --surface: #ffffff;
  --text: #021d28;
  --text-2: #3d5c86;
  --text-3: #507d9e;
  --text-4: #a7afb5;
  --accent: #168db4;
  --accent-2: #55c1ae;
  --accent-bg: #edf7fa;
  --accent-dim: rgba(22,141,180,0.1);
  --rose: #e49397;
  --dark: #021d28;
  --border: rgba(2,29,40,0.08);
  --shadow-1: 0 1px 3px rgba(2,29,40,0.05);
  --shadow-2: 0 4px 20px rgba(2,29,40,0.07);
  --shadow-3: 0 8px 40px rgba(2,29,40,0.10);
  --r: 20px;
  --r-sm: 14px;
  --r-xs: 8px;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse 1000px 600px at 85% 15%, rgba(99,102,241,0.10), transparent 65%),
    radial-gradient(ellipse 800px 520px at 8% 60%, rgba(85,193,174,0.08), transparent 65%),
    radial-gradient(ellipse 700px 500px at 60% 110%, rgba(22,141,180,0.07), transparent 65%),
    linear-gradient(180deg, #fdfdff 0%, #f4f6fb 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}

::selection { background: var(--accent); color: #fff; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2.5rem;
  position: relative;
  z-index: 1;
}

/* ─── NAV ─── */
.nav {
  padding: 1.1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  animation: up .5s ease forwards .05s;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.nav-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--dark);
  display: grid;
  place-items: center;
}

.nav-mark svg { width: 16px; height: 16px; }

.nav-label {
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

.nav-tag {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--text-3);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: .25rem .65rem;
  border-radius: 100px;
}

/* ─── HERO ─── */
.hero {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
  opacity: 0;
  animation: up .5s ease forwards .1s;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.1;
  margin-bottom: .5rem;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: .92rem;
  color: var(--text-2);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
}

/* ─── SCENARIOS ─── */
.scenarios {
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: up .5s ease forwards .18s;
}

.scenarios-title {
  text-align: center;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.1rem;
}

.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.sc {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .7rem .8rem;
  background: var(--surface);
  border: none;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: all .2s var(--ease);
  text-align: left;
  font-family: var(--font);
}

.sc:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

.sc:active { transform: translateY(0); }

.sc-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  background: var(--accent-bg);
  border-radius: 8px;
}

.sc-body { display: flex; flex-direction: column; gap: .05rem; }

.sc-name {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.sc-desc {
  font-size: .62rem;
  color: var(--text-3);
  line-height: 1.35;
}

/* ─── CONFIG ─── */
.cfg {
  text-align: center;
  margin-bottom: 1rem;
  opacity: 0;
  animation: up .4s ease forwards .22s;
}

.cfg-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-4);
  background: none;
  border: none;
  cursor: pointer;
  padding: .2rem 0;
  transition: color .15s;
}

.cfg-btn:hover { color: var(--text-2); }
.cfg-btn svg { width: 10px; height: 10px; transition: transform .2s var(--ease); }
.cfg-btn.open svg { transform: rotate(90deg); }

.cfg-panel {
  display: none;
  max-width: 400px;
  margin: .5rem auto 0;
  padding: .8rem 1rem;
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  text-align: left;
}

.cfg-panel.visible { display: block; }

.cfg-panel label {
  display: block;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .3rem;
}

.cfg-panel input {
  width: 100%;
  padding: .5rem .65rem;
  font-family: var(--mono);
  font-size: .76rem;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--bg);
  color: var(--text);
  transition: all .15s;
}

.cfg-panel input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.cfg-panel .hint {
  margin-top: .3rem;
  font-size: .62rem;
  color: var(--text-4);
}

.cfg-panel .hint a { color: var(--accent); text-decoration: none; }
.cfg-panel .hint a:hover { text-decoration: underline; }

/* ─── PROMPT ─── */
.prompt-area {
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: up .5s ease forwards .26s;
}

.prompt {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transition: box-shadow .25s;
}

.prompt:focus-within {
  box-shadow: var(--shadow-3);
}

.prompt-body {
  padding: 1.25rem 1.35rem 1rem;
}

.prompt-body textarea {
  width: 100%;
  min-height: 280px;
  padding: 0;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  border: none;
  background: transparent;
  resize: vertical;
  caret-color: var(--accent);
}

.prompt-body textarea::placeholder { color: var(--text-4); }
.prompt-body textarea:focus { outline: none; }

.prompt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .65rem .5rem 1.35rem;
  background: var(--bg);
}

.prompt-keys {
  font-family: var(--mono);
  font-size: .6rem;
  color: var(--text-4);
  display: flex;
  align-items: center;
  gap: .15rem;
}

.prompt-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 .35rem;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-3);
  background: var(--surface);
  border-radius: 5px;
  box-shadow: var(--shadow-1);
}

.btn-go {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: var(--dark);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
}

.btn-go:hover { background: var(--accent); transform: scale(1.06); }
.btn-go:active { transform: scale(.96); }
.btn-go:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.btn-go svg { width: 18px; height: 18px; color: #fff; }

.btn-go .spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

.error-toast {
  margin-top: .6rem;
  padding: .6rem .85rem;
  background: #fef2f2;
  border-radius: var(--r-sm);
  font-size: .78rem;
  color: #dc3545;
  display: none;
  text-align: center;
  box-shadow: var(--shadow-1);
}

.error-toast.visible { display: block; }

/* ─── RESULTS ─── */
.results {
  opacity: 0;
  transform: translateY(12px);
  transition: all .5s var(--ease);
  padding-bottom: 2rem;
}

.results.visible { opacity: 1; transform: translateY(0); }

/* ─── GROUP ─── */
.group { margin-bottom: 2rem; }

.group-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .65rem;
}

.group-num {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  padding: .15rem .5rem;
  border-radius: 6px;
}

.group-name {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* ─── CURSOR STACK (grid 2-3 colonnes responsive) ─── */
.cursor-stack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: .65rem;
}

.cursor-card {
  padding: .85rem 1rem .9rem;
  background: var(--surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-1);
  transition: box-shadow .15s, transform .15s;
}

.cursor-card:hover {
  box-shadow: var(--shadow-2);
}

@media (max-width: 700px) {
  .cursor-stack { grid-template-columns: 1fr; }
}

.cursor-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .45rem;
}

.cursor-l {
  font-size: .76rem;
  font-weight: 600;
  color: var(--text);
}

.cursor-r {
  font-size: .72rem;
  font-weight: 400;
  color: var(--text-3);
}

/* ─── TRACK ─── */
.track-wrap {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}

.track {
  width: 100%;
  height: 4px;
  background: rgba(2,29,40,0.06);
  border-radius: 2px;
  position: relative;
}

.track-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  width: 50%;
  transition: width 1s var(--spring);
}

.track-thumb {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%,-50%);
  transition: left 1s var(--spring);
  cursor: default;
  z-index: 2;
  box-shadow: var(--shadow-1);
  pointer-events: none;
}

.track-badge {
  position: absolute;
  top: -22px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  padding: .05rem .45rem;
  border-radius: 5px;
  opacity: 0;
  transition: opacity .15s, left 1s var(--spring);
  pointer-events: none;
}

.cursor-card:hover .track-badge { opacity: 1; }

.track-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
}

.track-tick { width: 1px; height: 4px; background: rgba(2,29,40,0.06); }

/* ─── EXPLAINER ─── */
.explainer {
  margin-top: .65rem;
  padding: 1rem 1.2rem;
  background: var(--accent-bg);
  border-radius: var(--r-sm);
  font-size: .82rem;
  line-height: 1.7;
  color: var(--text-2);
}

.explainer-tag {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 500;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .25rem;
}

/* ─── LOADING ─── */
.loading-shimmer .track {
  background: linear-gradient(90deg, rgba(2,29,40,.06) 25%, rgba(2,29,40,.1) 50%, rgba(2,29,40,.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}

/* ─── FOOTER ─── */
.foot {
  padding: 1.5rem 0;
  text-align: center;
  font-size: .68rem;
  color: var(--text-4);
  opacity: 0;
  animation: up .4s ease forwards .4s;
}

/* ─── KEYFRAMES ─── */
@keyframes up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 700px) {
  .wrap { padding: 0 1.15rem; }
  .hero h1 { font-size: 1.7rem; }
  .hero { padding: 2rem 0 1.25rem; }
  .scenarios-grid { grid-template-columns: 1fr 1fr; }
  .prompt-foot { flex-direction: row; }
}

@media (max-width: 480px) {
  .scenarios-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.45rem; }
  .wrap { padding: 0 .9rem; }
  /* Onglets : autoriser un scroll horizontal si trop large, garder l'apparence */
  .tabs {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: .5rem .8rem; font-size: .74rem; white-space: nowrap; flex: 0 0 auto; }
  /* Curseurs : pleine largeur garantie */
  .cursor-stack { grid-template-columns: 1fr; gap: .55rem; }
  .cursor-card { padding: .8rem .85rem; }
  /* En-tête : sous-titre lede un cran plus petit */
  .ph-lede { font-size: 1rem; }
}

/* ─── PANEL ─── */
.panel {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.5rem;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1rem;
}

.panel-tag {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-bg);
  padding: .15rem .5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.panel-title {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* ─── SCORES ─── */
.scores-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}

.score-card { display: flex; flex-direction: column; gap: .35rem; }

.score-label {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 500;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.score-val {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -.02em;
  font-feature-settings: 'tnum';
  color: var(--text);
  transition: color .3s;
}

.score-bar {
  height: 4px;
  background: rgba(2,29,40,.06);
  border-radius: 2px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width .8s var(--spring);
}

.score-fill.risk { background: linear-gradient(90deg, #ef4444, #f87171); }
.score-fill.cost { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.score-fill.performance { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.score-val.risk.has-val { color: #dc2626; }
.score-val.cost.has-val { color: #d97706; }
.score-val.performance.has-val { color: var(--accent); }

/* ─── VIZ ─── */
.viz-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.viz-card {
  padding: 1rem 1.1rem;
  background: var(--bg);
  border-radius: var(--r-sm);
  display: flex;
  flex-direction: column;
}

.viz-title {
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .65rem;
}

.viz-card svg { width: 100%; height: auto; max-height: 320px; }

.synthese-global {
  padding: 1rem 1.2rem;
  background: var(--accent-bg);
  border-radius: var(--r-sm);
  font-size: .85rem;
  line-height: 1.7;
  color: var(--text-2);
}

.synthese-global:empty { display: none; }

/* ─── CARDS LIST (recos, dim synthesis, tensions) ─── */
.card-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.bordered-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--bg);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--accent);
  align-items: start;
}

.reco-bascule {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  white-space: nowrap;
  padding-top: .15rem;
}

.reco-bascule .reco-id {
  font-weight: 600;
}

.reco-bascule .reco-arrow { color: var(--text-4); }

.reco-from { color: var(--text-3); }
.reco-to { color: var(--text); font-weight: 600; }

.bordered-reason {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--text-2);
}

.bordered-reason strong { color: var(--text); }

/* Reco cards: clickable what-if simulator */
.bordered-card[data-reco-idx] {
  cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s, background .15s;
  position: relative;
}

.bordered-card[data-reco-idx]:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-1);
  background: var(--surface);
}

.bordered-card[data-reco-idx]::after {
  content: 'Simuler';
  position: absolute;
  top: .65rem; right: .85rem;
  font-family: var(--mono);
  font-size: .54rem;
  color: var(--text-4);
  background: var(--surface);
  padding: .12rem .42rem;
  border-radius: 4px;
  box-shadow: var(--shadow-1);
  text-transform: uppercase;
  letter-spacing: .06em;
  opacity: 0;
  transition: opacity .15s;
}

.bordered-card[data-reco-idx]:hover::after { opacity: 1; }

.bordered-card[data-reco-idx].applied {
  background: var(--accent-bg);
  opacity: .85;
}

.bordered-card[data-reco-idx].applied::after {
  content: '✓ Appliquée';
  opacity: 1;
  color: var(--accent);
  background: var(--surface);
}

.reco-hint {
  font-size: .72rem;
  color: var(--text-4);
  margin-bottom: .8rem;
  font-style: italic;
}

.restore-btn {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .3rem .6rem;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: all .15s;
}

.restore-btn:hover {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

/* ─── RAPPORT GLOBAL ─── */
.rapport-content {
  font-size: .87rem;
  line-height: 1.75;
  color: var(--text-2);
}

.rapport-content p {
  margin-bottom: .85rem;
}

.rapport-content p:last-child { margin-bottom: 0; }

.rapport-content strong { color: var(--text); font-weight: 600; }

.rapport-content h3 {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin: 1rem 0 .4rem;
  letter-spacing: -.005em;
}

.rapport-content h3:first-child { margin-top: 0; }

.rapport-content em {
  color: var(--text-3);
  font-style: italic;
}

/* ─── TENSIONS ─── */
.tension {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .85rem;
  padding: .65rem .9rem;
  background: var(--bg);
  border-radius: var(--r-sm);
  border-left: 3px solid;
  align-items: start;
}

.tension.cr { border-color: #dc2626; }
.tension.hi { border-color: #f59e0b; }
.tension.in { border-color: var(--accent); }

.tension-ids {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  padding-top: .12rem;
}

.tension-msg {
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.45;
}

.tension-empty {
  padding: .8rem 1rem;
  font-size: .78rem;
  color: var(--text-3);
  background: var(--bg);
  border-radius: var(--r-sm);
  text-align: center;
}

/* ─── DIM GROUPS ─── */
.dim-group { margin-bottom: 1.4rem; }

.dim-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .55rem;
}

.dim-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dim-name {
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.category-head {
  flex-direction: column;
  align-items: flex-start;
  gap: .15rem;
  margin-bottom: .8rem;
  padding-top: .3rem;
}

.dim-subtitle {
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
}

/* ─── HORS PÉRIMÈTRE ─── */
.cursor-card.out-of-scope { opacity: .55; }

.cursor-card.out-of-scope .track-fill { background: var(--text-4) !important; opacity: .25; }

.cursor-card.out-of-scope .track-thumb { border-color: var(--text-4) !important; opacity: .4; }

.cursor-card.out-of-scope .track-badge { background: rgba(167,175,181,.15) !important; color: var(--text-4) !important; }

.cursor-card.out-of-scope .target-marker { display: none !important; }

.cursor-card.out-of-scope .cursor-id-row::after {
  content: 'Hors périmètre';
  font-family: var(--mono);
  font-size: .55rem;
  color: var(--text-4);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: .1rem .42rem;
  border-radius: 4px;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 500;
}

.cursor-card.out-of-scope .cursor-id-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.cursor-card.out-of-scope .palier-text {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-4);
}

.cursor-card.out-of-scope .cursor-explain { display: none; }

/* ─── INTERDÉPENDANCES ─── */
.interdep {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: .65rem;
  align-items: start;
  padding: .65rem .9rem;
  background: var(--bg);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--accent);
}

.interdep.alignement   { border-color: var(--accent-2); }
.interdep.cascade      { border-color: var(--accent); }
.interdep.co-mouvement { border-color: #8b5cf6; }
.interdep.tension      { border-color: #f59e0b; }

.interdep-ids {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  padding-top: .12rem;
}

.interdep-type {
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .12rem .42rem;
  border-radius: 4px;
  white-space: nowrap;
  align-self: start;
}

.interdep.alignement   .interdep-type { background: rgba(85,193,174,.12); color: #0d9488; }
.interdep.cascade      .interdep-type { background: var(--accent-bg); color: var(--accent); }
.interdep.co-mouvement .interdep-type { background: rgba(139,92,246,.12); color: #7c3aed; }
.interdep.tension      .interdep-type { background: rgba(245,158,11,.14); color: #d97706; }

.interdep-msg {
  font-size: .78rem;
  color: var(--text-2);
  line-height: 1.45;
}

/* ─── CURSOR CARD (palier-aware, compact pour grid 2-3 cols) ─── */
.cursor-card .cursor-id-row {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .45rem;
}

.cursor-id {
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 500;
  padding: .08rem .38rem;
  border-radius: 5px;
  flex-shrink: 0;
}

.cursor-name {
  font-size: .76rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.cursor-new {
  font-family: var(--mono);
  font-size: .55rem;
  color: var(--rose);
  background: rgba(228,147,151,.15);
  padding: .08rem .35rem;
  border-radius: 4px;
  margin-left: .3rem;
}

/* Target palier marker (recommandation Gemini) */
.target-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px dashed var(--accent-2);
  border-radius: 50%;
  background: var(--surface);
  transform: translate(-50%,-50%);
  z-index: 1;
  opacity: 0;
  transition: left .8s var(--spring), opacity .3s;
  pointer-events: none;
}

.target-marker.visible { opacity: 1; }

.track-ticks-5 {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  padding: 0 1px;
}

.tick-5 {
  font-family: var(--mono);
  font-size: .55rem;
  color: var(--text-4);
  font-weight: 500;
  width: 8px;
  text-align: center;
}

.palier-text {
  margin-top: .5rem;
  padding: .42rem .6rem;
  background: var(--bg);
  border-radius: var(--r-xs);
  font-size: .66rem;
  line-height: 1.45;
  color: var(--text-2);
}

.palier-text:empty { display: none; }
.palier-text strong { color: var(--text); font-weight: 600; }

.palier-target-hint {
  margin-top: .3rem;
  font-size: .62rem;
  color: var(--accent-2);
  font-weight: 500;
  font-style: italic;
}

.cursor-explain {
  margin-top: .35rem;
  padding: 0 .15rem;
  font-size: .66rem;
  line-height: 1.5;
  color: var(--text-3);
}

.cursor-explain:empty { display: none; }

/* ─── PHASE INDICATOR ─── */
.phase-indicator {
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--text-4);
  text-align: center;
  margin-top: .5rem;
  height: 1em;
  transition: opacity .3s;
}

.phase-indicator.fade { opacity: 0; }

.phase-indicator:not(:empty):not(.fade)::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1.5px solid rgba(22,141,180,.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-right: .45rem;
  vertical-align: -1px;
}

/* ─── SKELETON / LOADING STATE on results panels (phase 1 only) ─── */
.results.is-loading .score-bar {
  background: linear-gradient(90deg, rgba(2,29,40,.06) 25%, rgba(2,29,40,.12) 50%, rgba(2,29,40,.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
}
.results.is-loading .score-fill { opacity: 0; }
.results.is-loading .score-val { color: var(--text-4) !important; }

.viz-card { position: relative; }

.results.is-loading .viz-card svg {
  opacity: .18;
  transition: opacity .3s;
}

.results.is-loading .viz-card::after {
  content: '';
  position: absolute;
  top: 56%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid rgba(22,141,180,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  pointer-events: none;
  z-index: 2;
}

.results.is-loading .tensions-list,
.results.is-loading #syntheseGlobalText {
  opacity: .35;
  transition: opacity .3s;
}

/* ─── TABS ─── */
.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.2rem;
  background: var(--surface);
  padding: .35rem;
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  width: fit-content;
}

.tab {
  padding: .5rem 1.1rem;
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-3);
  transition: all .15s var(--ease);
  letter-spacing: -.005em;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

.tab-count {
  margin-left: .35rem;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-4);
  font-weight: 500;
}

.tab.active .tab-count { color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── PLAYGROUND ─── */
.pg-intro {
  font-size: .82rem;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 1.1rem;
  padding: .75rem 1rem;
  background: var(--accent-bg);
  border-radius: var(--r-sm);
}

.pg-presets {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
  align-items: center;
}

.preset-btn {
  padding: .5rem 1rem;
  font-family: var(--font);
  font-size: .74rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  color: var(--text-2);
  transition: all .15s var(--ease);
}

.preset-btn:hover {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent-dim);
}

.preset-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: var(--shadow-1);
}

.preset-btn.reset {
  margin-left: auto;
  color: var(--text-3);
  background: transparent;
  border-style: dashed;
}

.preset-btn.reset:hover {
  background: var(--bg);
  color: var(--text);
  border-style: solid;
}

/* Override read-only thumb behavior for playground sliders */
.pg-card .track-thumb {
  pointer-events: auto !important;
  cursor: grab !important;
  transition: left .25s var(--spring), box-shadow .15s, transform .1s !important;
}

.pg-card .track-thumb:hover {
  box-shadow: 0 0 0 6px var(--accent-dim), var(--shadow-1);
  transform: translate(-50%,-50%) scale(1.12);
}

.pg-card .track-thumb:active {
  cursor: grabbing !important;
  transform: translate(-50%,-50%) scale(.92);
}

.pg-card .track-fill,
.pg-card .track-badge {
  transition: width .25s var(--spring), left .25s var(--spring) !important;
}

.pg-card:hover .track-badge { opacity: 1; }

/* ─── RESPONSIVE additions ─── */
@media (max-width: 700px) {
  .viz-grid { grid-template-columns: 1fr; }
  .panel { padding: 1.1rem 1.2rem; }
}

@media (max-width: 480px) {
  .scores-row { grid-template-columns: 1fr; gap: .8rem; }
}


/* ─── PAGE HEADER (light hero with fake report images) ─── */
.page-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
  border-radius: 0 0 28px 28px;
  background:
    radial-gradient(ellipse 800px 480px at 85% 20%, rgba(99,102,241,0.10), transparent 65%),
    radial-gradient(ellipse 600px 400px at 8% 85%, rgba(85,193,174,0.08), transparent 65%),
    linear-gradient(180deg, #fdfdff 0%, #f4f6fb 100%);
  border-bottom: 1px solid rgba(2,29,40,0.05);
  isolation: isolate;
}

.ph-inner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.6rem 2.5rem 2.6rem;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3rem;
  align-items: center;
  opacity: 0;
  animation: up .7s ease forwards .05s;
}

.ph-scroll-cue {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .55rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--text-4);
  opacity: 0;
  animation: up .6s ease forwards .8s;
  pointer-events: none;
}

.ph-scroll-cue svg {
  width: 14px; height: 14px;
  animation: ph-bounce 1.6s ease-in-out infinite;
}

@keyframes ph-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}

.ph-text { display: flex; flex-direction: column; gap: 1rem; }

.ph-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .32rem .8rem .32rem .55rem;
  border-radius: 100px;
  background: rgba(22,141,180,0.08);
  border: 1px solid rgba(22,141,180,0.15);
  font-family: var(--mono);
  font-size: .62rem;
  color: var(--accent);
  letter-spacing: .04em;
}

.ph-tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(85,193,174,0.55);
  animation: ph-pulse 2s ease-out infinite;
}

@keyframes ph-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(85,193,174,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(85,193,174,0); }
  100% { box-shadow: 0 0 0 0 rgba(85,193,174,0); }
}

.ph-title {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.045em;
  color: var(--text);
}

.ph-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ph-lede {
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--text);
  max-width: 520px;
  margin-top: -.2rem;
}

.ph-lede strong {
  font-weight: 600;
  color: var(--text);
}

.ph-sub {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text-2);
  max-width: 520px;
}

.ph-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1.4rem;
  border-radius: 100px;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .2s var(--ease);
  margin-top: .35rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.ph-btn svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.ph-btn:hover svg { transform: translateX(2px); }

.ph-btn-primary {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 6px 20px rgba(2,29,40,0.18);
}

.ph-btn-primary:hover {
  transform: translateY(-1px);
  background: var(--accent);
  box-shadow: 0 10px 28px rgba(22,141,180,0.30);
}

.ph-btn[disabled],
.ph-btn[aria-disabled="true"] {
  opacity: .85;
  cursor: not-allowed;
  pointer-events: none;
}

.ph-btn[disabled]:hover,
.ph-btn[aria-disabled="true"]:hover { transform: none; }

.ph-btn-note {
  align-self: flex-start;
  margin-top: .55rem;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .12em;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.ph-btn-note::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(85,193,174,0.55);
  animation: ph-pulse 2s ease-out infinite;
}

/* Right column: 2 fake report images stacked */
.ph-images {
  position: relative;
  height: 460px;
  width: 100%;
}

.ph-img {
  position: absolute;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(2,29,40,0.18), 0 4px 10px rgba(2,29,40,0.06);
  overflow: hidden;
  border: 1px solid rgba(2,29,40,0.06);
  transition: transform .35s var(--ease);
}

.ph-img-1 {
  bottom: 10px; left: 0;
  width: 62%;
  aspect-ratio: 0.71;
  z-index: 2;
  transform: rotate(-3deg);
}

.ph-img-2 {
  top: 10px; right: 0;
  width: 56%;
  aspect-ratio: 0.71;
  z-index: 1;
  transform: rotate(4deg);
}

.page-header:hover .ph-img-1 { transform: rotate(-2deg) translateY(-4px); }
.page-header:hover .ph-img-2 { transform: rotate(3deg) translateY(-4px); }

/* Real report cover (image) */
.ph-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 880px) {
  .ph-inner {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    padding: 2rem 1.5rem 2.2rem;
  }
  .ph-title { font-size: 2rem; }
  .ph-images { height: 380px; max-width: 460px; margin: 0 auto; }
}

@media (max-width: 480px) {
  .page-header { border-radius: 0 0 18px 18px; }
  .ph-title { font-size: 1.7rem; }
  .ph-images { height: 340px; }
  .ph-img-1 { width: 70%; }
  .ph-img-2 { width: 65%; }
}

/* ─── INTRO (presentation section) ─── */
.intro {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3.5rem;
  align-items: center;
  padding: 4rem 0;
  opacity: 0;
  animation: up .6s ease forwards .1s;
}

.intro-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: .22rem .6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 1.1rem;
}

.intro h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.05;
  margin-bottom: 1.1rem;
}

.intro h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro p {
  font-size: .95rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 1.6rem;
  max-width: 480px;
}

.intro-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.intro-steps li {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .82rem;
  color: var(--text-2);
}

.intro-steps li span {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Mockup composition (à droite) */
.intro-mockup {
  position: relative;
  height: 440px;
}

.mock-card {
  position: absolute;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  padding: 1.2rem 1.4rem 1.3rem;
  border: 1px solid rgba(2,29,40,0.04);
}

.mock-primary {
  top: 40px; left: 0;
  width: 86%;
  z-index: 2;
  transform: rotate(-1.2deg);
}

.mock-secondary {
  top: -8px; right: 0;
  width: 62%;
  z-index: 1;
  transform: rotate(2.2deg);
  background: linear-gradient(180deg, #fff 0%, #fbfbfd 100%);
}

.mock-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: .54rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: .14rem .5rem;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .9rem;
}

.mock-scores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .85rem 1.1rem;
  margin-bottom: 1rem;
}

.mock-score { display: flex; flex-direction: column; gap: .25rem; }

.mock-score span {
  font-family: var(--mono);
  font-size: .52rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.mock-score b {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  font-feature-settings: 'tnum';
}

.mock-bar {
  height: 3px;
  background: rgba(2,29,40,.06);
  border-radius: 2px;
  overflow: hidden;
}

.mock-bar i { display: block; height: 100%; border-radius: 2px; }

.mock-radar {
  width: 100%;
  height: auto;
  max-height: 180px;
  display: block;
}

.mock-reco {
  padding: .55rem .7rem;
  background: var(--bg);
  border-radius: var(--r-xs);
  border-left: 3px solid var(--accent-2);
  margin-bottom: .55rem;
}

.mock-reco:last-child { margin-bottom: 0; }

.mock-reco-id {
  font-family: var(--mono);
  font-size: .58rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: .15rem;
}

.mock-reco-text {
  font-size: .68rem;
  line-height: 1.45;
  color: var(--text-2);
}

@media (max-width: 880px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 2.2rem;
    padding: 2rem 0 2.5rem;
  }
  .intro h1 { font-size: 2.2rem; }
  .intro-mockup { height: 380px; max-width: 460px; margin: 0 auto; width: 100%; }
}

@media (max-width: 480px) {
  .intro h1 { font-size: 1.85rem; }
  .intro p { font-size: .88rem; }
  .intro-mockup { height: 340px; }
  .mock-primary { width: 92%; }
  .mock-secondary { width: 70%; }
}

/* ─── STEP-LAUNCH (page 3: chat zone with section title) ─── */
.step-launch {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0 3rem;
  scroll-margin-top: 1rem;
}

.step-head {
  text-align: center;
  margin-bottom: 1.8rem;
  opacity: 0;
  animation: up .55s ease forwards .15s;
}

.step-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: .58rem;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid rgba(22,141,180,0.15);
  padding: .22rem .65rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .9rem;
}

.step-title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1.05;
  margin-bottom: .65rem;
  color: var(--text);
}

.step-sub {
  font-size: .92rem;
  color: var(--text-2);
  line-height: 1.55;
  max-width: 580px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .step-launch { min-height: auto; padding: 3rem 0 2rem; }
  .step-title { font-size: 1.75rem; }
  .step-sub { font-size: .86rem; }
}
